Package jsl.utilities.distributions
Class PearsonType5
- java.lang.Object
-
- jsl.utilities.distributions.Distribution
-
- jsl.utilities.distributions.PearsonType5
-
- All Implemented Interfaces:
ControllableIfc
,CDFIfc
,ContinuousDistributionIfc
,DistributionFunctionIfc
,DistributionIfc
,DomainIfc
,InverseCDFIfc
,MeanIfc
,PDFIfc
,VarianceIfc
,GetNameIfc
,IdentityIfc
,NewInstanceIfc
,ParametersIfc
,GetRVariableIfc
public class PearsonType5 extends Distribution implements ContinuousDistributionIfc, InverseCDFIfc, GetRVariableIfc
Represents a Pearson Type V distribution, see Law (2007) Simulation Modeling and Analysis, McGraw-Hill, pg 293 Code contributed by Seda Gumrukcu
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jsl.utilities.distributions.Distribution
Distribution.RandomControls
-
-
Field Summary
-
Fields inherited from class jsl.utilities.distributions.Distribution
myId, myName
-
-
Constructor Summary
Constructors Constructor Description PearsonType5()
Creates a PearsonType5 distribution shape = 1.0 scale = 1.0PearsonType5(double[] parameters)
Creates a PearsonType5 distribution parameters[0] = shape parameters[1] = scalePearsonType5(double shape, double scale)
Creates a PearsonType5 distributionPearsonType5(double shape, double scale, java.lang.String name)
Creates a PearsonType5 distribution
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
cdf(double x)
Returns the F(x) = Pr{X <= x} where F represents the cumulative distribution functionInterval
getDomain()
double
getMean()
Returns the mean or expected value of a distributiondouble[]
getParameters()
Gets the parameters parameters[0] = shape parameters[1] = scaleRVariableIfc
getRandomVariable(RNStreamIfc rng)
double
getScale()
Gets the scale parameterdouble
getShape()
Gets the shape parameterdouble
getVariance()
Returns the variance of the distribution if defineddouble
invCDF(double p)
Provides the inverse cumulative distribution function for the distribution While closed form solutions for the inverse cdf may not exist, numerical search methods can be used to solve F(X) = U.PearsonType5
newInstance()
Returns a new instancedouble
pdf(double x)
Returns the f(x) where f represents the probability density function for the distribution.void
setParameters(double[] parameters)
Sets the parameters parameters[0] = shape parameters[1] = scalevoid
setParameters(double shape, double scale)
Sets the shape and scale parameters-
Methods inherited from class jsl.utilities.distributions.Distribution
getControls, getId, getName, getStandardDeviation, inverseContinuousCDFViaBisection, inverseContinuousCDFViaBisection, inverseDiscreteCDFViaSearchUp, setControls, setId, setName, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jsl.utilities.distributions.CDFIfc
cdf, complementaryCDF
-
Methods inherited from interface jsl.utilities.random.rvariable.GetRVariableIfc
getRandomVariable, getRandomVariable
-
-
-
-
Constructor Detail
-
PearsonType5
public PearsonType5()
Creates a PearsonType5 distribution shape = 1.0 scale = 1.0
-
PearsonType5
public PearsonType5(double[] parameters)
Creates a PearsonType5 distribution parameters[0] = shape parameters[1] = scale- Parameters:
parameters
- the parameter array
-
PearsonType5
public PearsonType5(double shape, double scale)
Creates a PearsonType5 distribution- Parameters:
shape
- must be >0scale
- must be > 0
-
PearsonType5
public PearsonType5(double shape, double scale, java.lang.String name)
Creates a PearsonType5 distribution- Parameters:
shape
- must be >0scale
- must be > 0name
- an optional label/name
-
-
Method Detail
-
newInstance
public final PearsonType5 newInstance()
Description copied from interface:NewInstanceIfc
Returns a new instance- Specified by:
newInstance
in interfaceNewInstanceIfc
- Specified by:
newInstance
in classDistribution
- Returns:
- the new instance
-
setParameters
public final void setParameters(double shape, double scale)
Sets the shape and scale parameters- Parameters:
shape
- must be > 0scale
- must be > 0
-
getShape
public final double getShape()
Gets the shape parameter- Returns:
- the shape parameter
-
getScale
public final double getScale()
Gets the scale parameter- Returns:
- the scale parameter
-
cdf
public double cdf(double x)
Description copied from interface:CDFIfc
Returns the F(x) = Pr{X <= x} where F represents the cumulative distribution function
-
getMean
public double getMean()
Description copied from interface:MeanIfc
Returns the mean or expected value of a distribution
-
getParameters
public double[] getParameters()
Gets the parameters parameters[0] = shape parameters[1] = scale- Specified by:
getParameters
in interfaceParametersIfc
- Returns:
- Returns an array of the parameters
-
getVariance
public double getVariance()
Description copied from interface:VarianceIfc
Returns the variance of the distribution if defined- Specified by:
getVariance
in interfaceVarianceIfc
- Returns:
- If shape <= 2.0, returns Double.NaN, otherwise returns the variance
-
invCDF
public double invCDF(double p)
Description copied from interface:InverseCDFIfc
Provides the inverse cumulative distribution function for the distribution While closed form solutions for the inverse cdf may not exist, numerical search methods can be used to solve F(X) = U.- Specified by:
invCDF
in interfaceInverseCDFIfc
- Parameters:
p
- The probability to be evaluated for the inverse, p must be [0,1] or an IllegalArgumentException is thrown- Returns:
- The inverse cdf evaluated at the supplied probability
-
pdf
public double pdf(double x)
Description copied from interface:PDFIfc
Returns the f(x) where f represents the probability density function for the distribution. Note this is not a probability.
-
setParameters
public void setParameters(double[] parameters)
Sets the parameters parameters[0] = shape parameters[1] = scale- Specified by:
setParameters
in interfaceParametersIfc
- Parameters:
parameters
- the parameter array
-
getRandomVariable
public final RVariableIfc getRandomVariable(RNStreamIfc rng)
- Specified by:
getRandomVariable
in interfaceGetRVariableIfc
- Overrides:
getRandomVariable
in classDistribution
- Parameters:
rng
- the stream to use- Returns:
- a random variable
-
-