Module net.finmath.lib
Package net.finmath.randomnumbers
Class AcceptanceRejectionRandomNumberGenerator
java.lang.Object
net.finmath.randomnumbers.AcceptanceRejectionRandomNumberGenerator
- All Implemented Interfaces:
Serializable
,RandomNumberGenerator
public class AcceptanceRejectionRandomNumberGenerator
extends Object
implements RandomNumberGenerator
Class implementing
RandomNumberGenerator
by the acceptance rejection method.
Note that the acceptance rejection methods requires a two dimensional uniform random number sequence with independent components.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
-
Constructor Summary
ConstructorDescriptionAcceptanceRejectionRandomNumberGenerator
(RandomNumberGenerator uniformRandomNumberGenerator, DoubleUnaryOperator targetDensity, DoubleUnaryOperator referenceDensity, DoubleUnaryOperator referenceDistributionICDF, double acceptanceLevel) -
Method Summary
Modifier and TypeMethodDescriptionint
Get the sample vector dimension.double[]
getNext()
Get the next sample vector of dimension n, where n isgetDimension
.
-
Constructor Details
-
AcceptanceRejectionRandomNumberGenerator
public AcceptanceRejectionRandomNumberGenerator(RandomNumberGenerator uniformRandomNumberGenerator, DoubleUnaryOperator targetDensity, DoubleUnaryOperator referenceDensity, DoubleUnaryOperator referenceDistributionICDF, double acceptanceLevel)
-
-
Method Details
-
getNext
public double[] getNext()Description copied from interface:RandomNumberGenerator
Get the next sample vector of dimension n, where n isgetDimension
. An implementation has to be thread safe.- Specified by:
getNext
in interfaceRandomNumberGenerator
- Returns:
- The next sample vector of dimension n, where n is
getDimension
.
-
getDimension
public int getDimension()Description copied from interface:RandomNumberGenerator
Get the sample vector dimension.- Specified by:
getDimension
in interfaceRandomNumberGenerator
- Returns:
- The sample vector dimension n.
-