Module net.finmath.lib
Package net.finmath.randomnumbers
Class AcceptanceRejectionRandomNumberGenerator
java.lang.Object
net.finmath.randomnumbers.AcceptanceRejectionRandomNumberGenerator
- All Implemented Interfaces:
Serializable
,DoubleSupplier
,RandomNumberGenerator
,RandomNumberGenerator1D
public class AcceptanceRejectionRandomNumberGenerator
extends Object
implements RandomNumberGenerator1D
Class implementing
RandomNumberGenerator1D
by the acceptance rejection method.
Note that the acceptance rejection methods requires a two dimensional uniform random number sequence with independent components.- Version:
- 1.1
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionAcceptanceRejectionRandomNumberGenerator(RandomNumberGenerator uniformRandomNumberGenerator, DoubleUnaryOperator targetDensity, DoubleUnaryOperator referenceDensity, DoubleUnaryOperator referenceDistributionICDF, double acceptanceLevel)
Create a random number sequence using the given input sequence and acceptance-rejection sampling. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Thread safe implementation returning the next double value of this random number generator.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.finmath.randomnumbers.RandomNumberGenerator1D
getAsDouble, getDimension, getNext, nextDoubleFast
-
Constructor Details
-
AcceptanceRejectionRandomNumberGenerator
public AcceptanceRejectionRandomNumberGenerator(RandomNumberGenerator uniformRandomNumberGenerator, DoubleUnaryOperator targetDensity, DoubleUnaryOperator referenceDensity, DoubleUnaryOperator referenceDistributionICDF, double acceptanceLevel)Create a random number sequence using the given input sequence and acceptance-rejection sampling.- Parameters:
uniformRandomNumberGenerator
- A two dimension (at least) uniform number generator (with i.i.d components). The first two components will be used.targetDensity
- The density f of the target distribution F.referenceDensity
- The density g.referenceDistributionICDF
- The ICDF, i.e. the inverse of G where G' = g.acceptanceLevel
- The constant C such that f ≤ C g.
-
-
Method Details
-
nextDouble
public double nextDouble()Description copied from interface:RandomNumberGenerator1D
Thread safe implementation returning the next double value of this random number generator.- Specified by:
nextDouble
in interfaceRandomNumberGenerator1D
- Returns:
- The next double value of this random number generator
-