org.apache.commons.math3.random

## Class StableRandomGenerator

- java.lang.Object
- - org.apache.commons.math3.random.StableRandomGenerator

All Implemented Interfaces:
  NormalizedRandomGenerator

    public class StableRandomGenerator
    extends java.lang.Object
    implements 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.

Since:
  3.0
Version:
  $Id: StableRandomGenerator.java 1394763 2012-10-05 19:54:00Z psteitz $

### Field Summary

Fields
`private double` `alpha` stability parameter
`private double` `beta` skewness parameter
`private RandomGenerator` `generator` Underlying generator.
`private double` `zeta` cache of expression value used in generation

### Constructor Summary

Constructors
Constructor and Description
`StableRandomGenerator(RandomGenerator generator, double alpha, double beta)` Create a new generator.

### Method Summary

Methods
`double` `nextNormalizedDouble()` Generate a random scalar with zero location and unit scale.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### generator

    private final RandomGenerator generator

Underlying generator.

#### alpha

    private final double alpha

stability parameter

#### beta

    private final double beta

skewness parameter

#### zeta

    private final double zeta

cache of expression value used in generation

### Constructor Detail

#### StableRandomGenerator

    public StableRandomGenerator(RandomGenerator generator,
                         double alpha,
                         double beta)
                          throws NullArgumentException,
                                 OutOfRangeException

Create a new generator.

Parameters:
  `generator` - underlying random generator to use
  `alpha` - Stability parameter. Must be in range (0, 2]
  `beta` - Skewness parameter. Must be in range [-1, 1]
Throws:
  `NullArgumentException` - if generator is null
  `OutOfRangeException` - if `alpha <= 0` or `alpha > 2` or `beta < -1` or `beta > 1`

### Method Detail

#### nextNormalizedDouble

    public double nextNormalizedDouble()

Generate a random scalar with zero location and unit scale.

Specified by:
  `nextNormalizedDouble` in interface `NormalizedRandomGenerator`
Returns:
  a random scalar with zero location and unit scale