Package jsl.utilities.random.rvariable
Class InverseCDFRV
- java.lang.Object
-
- jsl.utilities.random.rvariable.AbstractRVariable
-
- jsl.utilities.random.rvariable.InverseCDFRV
-
- All Implemented Interfaces:
java.util.function.DoubleSupplier
,GetNameIfc
,GetValueIfc
,IdentityIfc
,PreviousValueIfc
,RandomIfc
,GetRandomNumberStreamIfc
,RNStreamControlIfc
,SetRandomNumberStreamIfc
,NewAntitheticInstanceIfc
,RVariableIfc
,SampleIfc
public class InverseCDFRV extends AbstractRVariable
Facilitates the creation of random variables from distributions that implement InverseCDFIfc
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jsl.utilities.random.rvariable.RVariableIfc
RVariableIfc.RVType
-
-
Field Summary
-
Fields inherited from class jsl.utilities.random.rvariable.AbstractRVariable
myRNStream
-
-
Constructor Summary
Constructors Constructor Description InverseCDFRV(InverseCDFIfc invFun)
Makes one using the next stream from the underlying stream providerInverseCDFRV(InverseCDFIfc invFun, int streamNum)
Makes one using the supplied stream number to assign the streamInverseCDFRV(InverseCDFIfc invFun, RNStreamIfc rng)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
generate()
RVariableIfc
newInstance(RNStreamIfc rng)
-
Methods inherited from class jsl.utilities.random.rvariable.AbstractRVariable
advanceToNextSubstream, getAntitheticOption, getId, getName, getPreviousValue, getRandomNumberStream, getValue, newAntitheticInstance, newInstance, resetStartStream, resetStartSubstream, sample, setAntitheticOption, setName, setPreviousValue, setRandomNumberStream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsl.utilities.random.rng.GetRandomNumberStreamIfc
getStreamNumber
-
Methods inherited from interface jsl.utilities.random.rvariable.RVariableIfc
asDoubleStream, getAsDouble, getSumOfValues, newInstance
-
Methods inherited from interface jsl.utilities.random.rng.SetRandomNumberStreamIfc
setRandomNumberStream
-
-
-
-
Constructor Detail
-
InverseCDFRV
public InverseCDFRV(InverseCDFIfc invFun)
Makes one using the next stream from the underlying stream provider- Parameters:
invFun
- the inverse of the distribution function, must not be null
-
InverseCDFRV
public InverseCDFRV(InverseCDFIfc invFun, int streamNum)
Makes one using the supplied stream number to assign the stream- Parameters:
invFun
- the inverse of the distribution function, must not be nullstreamNum
- a positive integer
-
InverseCDFRV
public InverseCDFRV(InverseCDFIfc invFun, RNStreamIfc rng)
- Parameters:
invFun
- the inverse of the distribution function, must not be nullrng
- a random number stream, must not be null
-
-
Method Detail
-
generate
protected double generate()
- Specified by:
generate
in classAbstractRVariable
- Returns:
- the randomly generated variate
-
newInstance
public RVariableIfc newInstance(RNStreamIfc rng)
- Parameters:
rng
- the RNStreamIfc to use- Returns:
- a new instance with same parameter values
-
-