Package org.hipparchus.random
Class StableRandomGenerator
java.lang.Object
org.hipparchus.random.StableRandomGenerator
- All Implemented Interfaces:
NormalizedRandomGenerator
This class provides a stable normalized random generator. It samples from a stable distribution with location parameter 0 and scale 1.
The implementation uses the Chambers-Mallows-Stuck method as described in Handbook of computational statistics: concepts and methods by James E. Gentle, Wolfgang Härdle, Yuichi Mori.
-
Constructor Summary
ConstructorDescriptionStableRandomGenerator
(RandomGenerator generator, double alpha, double beta) Create a new generator. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Generate a random scalar with zero location and unit scale.
-
Constructor Details
-
StableRandomGenerator
public StableRandomGenerator(RandomGenerator generator, double alpha, double beta) throws MathIllegalArgumentException, NullArgumentException Create a new generator.- Parameters:
generator
- underlying random generator to usealpha
- Stability parameter. Must be in range (0, 2]beta
- Skewness parameter. Must be in range [-1, 1]- Throws:
NullArgumentException
- if generator is nullMathIllegalArgumentException
- ifalpha <= 0
oralpha > 2
orbeta < -1
orbeta > 1
-
-
Method Details
-
nextNormalizedDouble
public double nextNormalizedDouble()Generate a random scalar with zero location and unit scale.- Specified by:
nextNormalizedDouble
in interfaceNormalizedRandomGenerator
- Returns:
- a random scalar with zero location and unit scale
-