Package jsl.utilities.random.rvariable
Class TruncatedRV
- java.lang.Object
-
- jsl.utilities.random.rvariable.AbstractRVariable
-
- jsl.utilities.random.rvariable.TruncatedRV
-
- All Implemented Interfaces:
java.util.function.DoubleSupplier,GetNameIfc,GetValueIfc,IdentityIfc,PreviousValueIfc,RandomIfc,GetRandomNumberStreamIfc,RNStreamControlIfc,SetRandomNumberStreamIfc,NewAntitheticInstanceIfc,RVariableIfc,SampleIfc
public class TruncatedRV extends AbstractRVariable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jsl.utilities.random.rvariable.RVariableIfc
RVariableIfc.RVType
-
-
Field Summary
Fields Modifier and Type Field Description protected doublemyCDFLLprotected doublemyCDFULprotected doublemyDeltaFUFLprotected DistributionIfcmyDistributionprotected doublemyFofLLprotected doublemyFofULprotected doublemyLowerLimitprotected doublemyUpperLimit-
Fields inherited from class jsl.utilities.random.rvariable.AbstractRVariable
myRNStream
-
-
Constructor Summary
Constructors Constructor Description TruncatedRV(DistributionIfc distribution, double cdfLL, double cdfUL, double truncLL, double truncUL)Constructs a truncated random variable based on the provided distributionTruncatedRV(DistributionIfc distribution, double cdfLL, double cdfUL, double truncLL, double truncUL, int streamNum)Constructs a truncated random variable based on the provided distributionTruncatedRV(DistributionIfc distribution, double cdfLL, double cdfUL, double truncLL, double truncUL, RNStreamIfc rng)Constructs a truncated random variable based on the provided distribution
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doublegenerate()doublegetCDFLowerLimit()The CDF's original lower limitdoublegetCDFUpperLimit()The CDF's original upper limitdoublegetTruncatedLowerLimit()The lower limit for the truncated distributiondoublegetTruncatedUpperLimit()The upper limit for the trunctated distributionRVariableIfcnewInstance(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
-
-
-
-
Field Detail
-
myDistribution
protected final DistributionIfc myDistribution
-
myLowerLimit
protected final double myLowerLimit
-
myUpperLimit
protected final double myUpperLimit
-
myCDFLL
protected final double myCDFLL
-
myCDFUL
protected final double myCDFUL
-
myFofLL
protected final double myFofLL
-
myFofUL
protected final double myFofUL
-
myDeltaFUFL
protected final double myDeltaFUFL
-
-
Constructor Detail
-
TruncatedRV
public TruncatedRV(DistributionIfc distribution, double cdfLL, double cdfUL, double truncLL, double truncUL)
Constructs a truncated random variable based on the provided distribution- Parameters:
distribution- the distribution to truncate, must not be nullcdfLL- The lower limit of the range of support of the distributioncdfUL- The upper limit of the range of support of the distributiontruncLL- The truncated lower limit (if moved in from cdfLL), must be >= cdfLLtruncUL- The truncated upper limit (if moved in from cdfUL), must be <= cdfUL
-
TruncatedRV
public TruncatedRV(DistributionIfc distribution, double cdfLL, double cdfUL, double truncLL, double truncUL, int streamNum)
Constructs a truncated random variable based on the provided distribution- Parameters:
distribution- the distribution to truncate, must not be nullcdfLL- The lower limit of the range of support of the distributioncdfUL- The upper limit of the range of support of the distributiontruncLL- The truncated lower limit (if moved in from cdfLL), must be >= cdfLLtruncUL- The truncated upper limit (if moved in from cdfUL), must be <= cdfULstreamNum- A positive integer to identify the stream
-
TruncatedRV
public TruncatedRV(DistributionIfc distribution, double cdfLL, double cdfUL, double truncLL, double truncUL, RNStreamIfc rng)
Constructs a truncated random variable based on the provided distribution- Parameters:
distribution- the distribution to truncate, must not be nullcdfLL- The lower limit of the range of support of the distributioncdfUL- The upper limit of the range of support of the distributiontruncLL- The truncated lower limit (if moved in from cdfLL), must be >= cdfLLtruncUL- The truncated upper limit (if moved in from cdfUL), must be <= cdfUL
-
-
Method Detail
-
getCDFLowerLimit
public final double getCDFLowerLimit()
The CDF's original lower limit- Returns:
- CDF's original lower limit
-
getCDFUpperLimit
public final double getCDFUpperLimit()
The CDF's original upper limit- Returns:
- CDF's original upper limit
-
getTruncatedLowerLimit
public final double getTruncatedLowerLimit()
The lower limit for the truncated distribution- Returns:
- lower limit for the truncated distribution
-
getTruncatedUpperLimit
public final double getTruncatedUpperLimit()
The upper limit for the trunctated distribution- Returns:
- upper limit for the trunctated distribution
-
generate
protected double generate()
- Specified by:
generatein 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
-
-