I guess I overlook something, but when migrating from Apache common math3, there was a method “sample()” defined on statistical distributions that allowed to draw a random sample based on the used distribution and defined parameters for that distribution.
I cannot figure out how to do this with Hipparchus, since the sample function isn’t there anymore. Any hints or tips?
I’m not familiar with that part of the library but I see that there is a bunch of generator classes in the package called random within hipparchus-core. Maybe it has the distribution that you need?
Thanks, indeed the random generator classes have methods that provide this functionality. For future reference:
val rg: RandomGenerator = JDKRandomGenerator()
val gen = GaussianRandomGenerator(rg)
gen.nextNormalizedDouble()
For my use-case it would be nicer if this would be the instance of a class and could be past as a parameter (rather than a hard-coded method on a generator). But can work around this.
Not native speaker either, so I will just wait until someone more fluent than me in both math/english decides!
As next version will be a major one (3.0), we can can change these names if required.