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 doublecdf(double x)Returns the F(x) = Pr{X <= x} where F represents the cumulative distribution functionIntervalgetDomain()doublegetMean()Returns the mean or expected value of a distributiondouble[]getParameters()params[0] = alpha1 params[1] = alpha2 params[2] = betaRVariableIfcgetRandomVariable(RNStreamIfc rng)doublegetVariance()Returns the variance of the distribution if defineddoubleinvCDF(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.PearsonType6newInstance()Returns a new instancedoublepdf(double x)Returns the f(x) where f represents the probability density function for the distribution.voidsetParameters(double[] params)params[0] = alpha1 params[1] = alpha2 params[2] = betavoidsetParameters(double alpha1, double alpha2, double beta)voidsetScale(double beta)voidsetShapeParameters(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:NewInstanceIfcReturns a new instance- Specified by:
newInstancein interfaceNewInstanceIfc- Specified by:
newInstancein 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:
setParametersin interfaceParametersIfc- Parameters:
params- the parameter array
-
getParameters
public double[] getParameters()
params[0] = alpha1 params[1] = alpha2 params[2] = beta- Specified by:
getParametersin interfaceParametersIfc- Returns:
- the parameter array
-
pdf
public double pdf(double x)
Description copied from interface:PDFIfcReturns 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:CDFIfcReturns the F(x) = Pr{X <= x} where F represents the cumulative distribution function
-
invCDF
public double invCDF(double p)
Description copied from interface:InverseCDFIfcProvides 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:
invCDFin 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:MeanIfcReturns the mean or expected value of a distribution
-
getVariance
public double getVariance()
Description copied from interface:VarianceIfcReturns the variance of the distribution if defined- Specified by:
getVariancein interfaceVarianceIfc- Returns:
- Returns the variance or Double.NaN if alpha2 <= 2.0
-
getRandomVariable
public final RVariableIfc getRandomVariable(RNStreamIfc rng)
- Specified by:
getRandomVariablein interfaceGetRVariableIfc- Overrides:
getRandomVariablein classDistribution- Parameters:
rng- the stream to use- Returns:
- a random variable
-
-