Scientific Programming Question

Click For Summary
SUMMARY

The discussion centers on generating a random distribution of doubles following a truncated power law distribution in Java. The probability distribution is defined by the equation P(T) proportional to exp(-T/A)*T^(-B), where A and B are constants. The user seeks guidance on implementing this either through custom programming or by utilizing existing scientific programming libraries. Recommendations include creating a TruncatedPowerLaw class extending the Random class and exploring the GNU Scientific Library, which offers random number generators for various distributions.

PREREQUISITES
  • Familiarity with Java programming
  • Understanding of probability distributions, specifically truncated power law distributions
  • Knowledge of random number generation techniques
  • Basic concepts of object-oriented programming, particularly class inheritance
NEXT STEPS
  • Research how to implement custom random number generators in Java
  • Explore the GNU Scientific Library for C/C++ and its Java interface
  • Study the algorithms presented in Numerical Recipes, particularly Chapter 7
  • Investigate existing Java libraries for statistical distributions, such as Apache Commons Math
USEFUL FOR

Java developers, data scientists, and researchers involved in scientific programming who need to generate random distributions based on specific mathematical models.

CoreyWhite
Messages
1
Reaction score
0
Hello, I'm new to these forums, so please forgive any problems with my post. In particular, I wasn't sure where to put this post.

I'm working on a scientific programming problem in Java, and I don't have a huge amount of familiarity with either scientific programming or Java, so you can imagine my dilemma. I'm trying to generate a random distribution of doubles following a truncated power law distribution. That is, I want to generate a list of times, T, for which the probability distribution P(T) is proportional to:

exp(-T/A)*T^(-B),

where A and B are constants.

Does anyone have any thoughts on how I would go about this? I'm open to programming it myself, if someone can suggest how to get started, or of course if such a distribution is already implemented in some publicly available scientific programming library that would be even better. If writing it myself, I figured I would create a TruncatedPowerLaw class extending the Random class, with a method for nextTruncatedPowerLaw, but I really have no idea where to go from there (i.e., the hard stuff). Thanks in advance!

By the way, if someone sees a way to accomplish this easily in another language, I'm not completely averse to that, although Java is preferred.
 
Technology news on Phys.org
If you don't mind programming in C or C++, you could use the GNU Scientific Library. It has random number generators for a lot of distributions.
There is a Java interface to it, but I don't know if it covers the entire library.
 
You can also try the Numerical Recipes book Chpt. 7 (It's available for free online). It might have an algorithm for your problem though you'll probably have to program the solution yourself.
 

Similar threads

Replies
86
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
37
Views
6K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
19
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
3
Views
4K
  • · Replies 14 ·
Replies
14
Views
2K
Replies
2
Views
2K