org.jquantlib.math.randomnumbers
Class InverseCumulativeRsg<USG extends UniformRandomSequenceGenerator,IC extends InverseCumulative>
- java.lang.Object
-
- org.jquantlib.math.randomnumbers.InverseCumulativeRsg<USG,IC>
-
- All Implemented Interfaces:
- UniformRandomSequenceGenerator
public class InverseCumulativeRsg<USG extends UniformRandomSequenceGenerator,IC extends InverseCumulative> extends java.lang.Object implements UniformRandomSequenceGenerator
Inverse cumulative random sequence generatorIt uses a sequence of uniform deviate in (0, 1) as the source of cumulative distribution values. Then an inverse cumulative distribution is used to calculate the distribution deviate. The uniform deviate sequence is supplied by USG.
-
-
Constructor Summary
Constructors Constructor and Description InverseCumulativeRsg(USG ursg)InverseCumulativeRsg(USG ursg, IC ic)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intdimension()Sample<double[]>lastSequence()long[]nextInt32Sequence()Once JVM does not support unsigned fixed arithmetic, we use 64bit variables as containers for 32bit values in order to reduce the complexity and performance overhead of certain fixed arithmetic operations.Sample<double[]>nextSequence()
-
-
-
Constructor Detail
-
InverseCumulativeRsg
public InverseCumulativeRsg(USG ursg)
-
-
Method Detail
-
dimension
public int dimension()
- Specified by:
dimensionin interfaceUniformRandomSequenceGenerator
-
nextInt32Sequence
public long[] nextInt32Sequence()
Description copied from interface:UniformRandomSequenceGeneratorOnce JVM does not support unsigned fixed arithmetic, we use 64bit variables as containers for 32bit values in order to reduce the complexity and performance overhead of certain fixed arithmetic operations.From the user's perspective, it's easier to understand that a certain
longvariable contains values from 0 to 2^32 than understand that a certainintvariable contains negative values that should be converted to it's two's complement and extended to alongvariable before use.- Specified by:
nextInt32Sequencein interfaceUniformRandomSequenceGenerator- Returns:
- an array of unsigned 32bit wide numbers encapsulated in a 64bit containers
- See Also:
- Bug 4504839, Java and Unsigned Types, Two's complement
-
nextSequence
public Sample<double[]> nextSequence()
- Specified by:
nextSequencein interfaceUniformRandomSequenceGenerator- Returns:
- next sample from the Gaussian distribution
-
lastSequence
public final Sample<double[]> lastSequence()
- Specified by:
lastSequencein interfaceUniformRandomSequenceGenerator
-
-
DataMelt 3.0 © DataMelt by jWork.ORG