Top Description Fields Constructors Methods
org.apache.commons.math3.random

public Class StableRandomGenerator

extends Object
implements NormalizedRandomGenerator
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.random.NormalizedRandomGenerator
Imports
org.apache.commons.math3.exception.NullArgumentException, .OutOfRangeException, org.apache.commons.math3.exception.util.LocalizedFormats, org.apache.commons.math3.util.FastMath

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.

Since
3.0

Field Summary

Modifier and TypeField and Description
private final double
alpha

stability parameter

private final double
beta

skewness parameter

private final RandomGenerator
generator

Underlying generator.

private final double
zeta

cache of expression value used in generation

Constructor Summary

AccessConstructor and Description
public
StableRandomGenerator(final RandomGenerator
underlying random generator to use
generator
,
final double
Stability parameter. Must be in range (0, 2]
alpha
,
final double
Skewness parameter. Must be in range [-1, 1]
beta
)

Create a new generator.

Method Summary

Modifier and TypeMethod and Description
public double

Returns:

a random scalar with zero location and unit scale
nextNormalizedDouble
()

Implements org.apache.commons.math3.random.NormalizedRandomGenerator.nextNormalizedDouble.

Generate a random scalar with zero location and unit scale.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alphaback to summary
private final double alpha

stability parameter

betaback to summary
private final double beta

skewness parameter

generatorback to summary
private final RandomGenerator generator

Underlying generator.

zetaback to summary
private final double zeta

cache of expression value used in generation

Constructor Detail

StableRandomGeneratorback to summary
public StableRandomGenerator(final RandomGenerator generator, final double alpha, final double beta) throws NullArgumentException, OutOfRangeException

Create a new generator.

Parameters
generator:RandomGenerator

underlying random generator to use

alpha:double

Stability parameter. Must be in range (0, 2]

beta:double

Skewness parameter. Must be in range [-1, 1]

Exceptions
NullArgumentException:
if generator is null
OutOfRangeException:
if alpha <= 0 or alpha > 2 or beta < -1 or beta > 1

Method Detail

nextNormalizedDoubleback to summary
public double nextNormalizedDouble()

Implements org.apache.commons.math3.random.NormalizedRandomGenerator.nextNormalizedDouble.

Generate a random scalar with zero location and unit scale.

Returns:double

a random scalar with zero location and unit scale