Package jsl.utilities.distributions
Class PearsonType6
- java.lang.Object
-
- jsl.utilities.distributions.Distribution
-
- jsl.utilities.distributions.PearsonType6
-
- All Implemented Interfaces:
ControllableIfc
,CDFIfc
,ContinuousDistributionIfc
,DistributionFunctionIfc
,DistributionIfc
,DomainIfc
,InverseCDFIfc
,MeanIfc
,PDFIfc
,VarianceIfc
,GetNameIfc
,IdentityIfc
,NewInstanceIfc
,ParametersIfc
,GetRVariableIfc
public class PearsonType6 extends Distribution implements ContinuousDistributionIfc, InverseCDFIfc, GetRVariableIfc
Represents a Pearson Type VI distribution, see Law (2007) Simulation Modeling and Analysis, McGraw-Hill, pg 294Code contributed by Nabil Lehlou
-
-
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 PearsonType6()
Creates a PearsonTypeVI distribution with alpha1 = 2.0 alpha2 = 3.0 beta = 1.0PearsonType6(double[] parameters)
Creates a PearsonTypeVI distributionPearsonType6(double alpha1, double alpha2, double beta)
Creates a PearsonTypeVI distributionPearsonType6(double alpha1, double alpha2, double beta, java.lang.String name)
Creates a PearsonTypeVI 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()
params[0] = alpha1 params[1] = alpha2 params[2] = betaRVariableIfc
getRandomVariable(RNStreamIfc rng)
double
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.PearsonType6
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[] params)
params[0] = alpha1 params[1] = alpha2 params[2] = betavoid
setParameters(double alpha1, double alpha2, double beta)
void
setScale(double beta)
void
setShapeParameters(double alpha1, double alpha2)
-
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
-
PearsonType6
public PearsonType6()
Creates a PearsonTypeVI distribution with alpha1 = 2.0 alpha2 = 3.0 beta = 1.0
-
PearsonType6
public PearsonType6(double alpha1, double alpha2, double beta)
Creates a PearsonTypeVI distribution- Parameters:
alpha1
- shape 1alpha2
- shape 2beta
- scale
-
PearsonType6
public PearsonType6(double[] parameters)
Creates a PearsonTypeVI distributionparameters[0] = alpha1 parameters[1] = alpha2 parameters[2] = beta
- Parameters:
parameters
- the parameter array
-
PearsonType6
public PearsonType6(double alpha1, double alpha2, double beta, java.lang.String name)
Creates a PearsonTypeVI distribution- Parameters:
alpha1
- shape 1alpha2
- shape 2beta
- scalename
- an optional name/label
-
-
Method Detail
-
newInstance
public final PearsonType6 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 alpha1, double alpha2, double beta)
- Parameters:
alpha1
- shape 1alpha2
- shape 2beta
- scale
-
setShapeParameters
public final void setShapeParameters(double alpha1, double alpha2)
- Parameters:
alpha1
- shape 1alpha2
- shape 2
-
setScale
public void setScale(double beta)
- Parameters:
beta
- the scale
-
setParameters
public void setParameters(double[] params)
params[0] = alpha1 params[1] = alpha2 params[2] = beta- Specified by:
setParameters
in interfaceParametersIfc
- Parameters:
params
- the parameter array
-
getParameters
public double[] getParameters()
params[0] = alpha1 params[1] = alpha2 params[2] = beta- Specified by:
getParameters
in interfaceParametersIfc
- Returns:
- the parameter array
-
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.
-
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
-
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
-
getMean
public double getMean()
Description copied from interface:MeanIfc
Returns the mean or expected value of a distribution
-
getVariance
public double getVariance()
Description copied from interface:VarianceIfc
Returns the variance of the distribution if defined- Specified by:
getVariance
in interfaceVarianceIfc
- Returns:
- Returns the variance or Double.NaN if alpha2 <= 2.0
-
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
-
-