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 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()Gets the parameters parameters[0] = shape parameters[1] = scaleRVariableIfcgetRandomVariable(RNStreamIfc rng)doublegetScale()Gets the scale parameterdoublegetShape()Gets the shape parameterdoublegetVariance()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.PearsonType5newInstance()Returns a new instancedoublepdf(double x)Returns the f(x) where f represents the probability density function for the distribution.voidsetParameters(double[] parameters)Sets the parameters parameters[0] = shape parameters[1] = scalevoidsetParameters(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:NewInstanceIfcReturns a new instance- Specified by:
newInstancein interfaceNewInstanceIfc- Specified by:
newInstancein 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:CDFIfcReturns the F(x) = Pr{X <= x} where F represents the cumulative distribution function
-
getMean
public double getMean()
Description copied from interface:MeanIfcReturns the mean or expected value of a distribution
-
getParameters
public double[] getParameters()
Gets the parameters parameters[0] = shape parameters[1] = scale- Specified by:
getParametersin interfaceParametersIfc- Returns:
- Returns an array of the parameters
-
getVariance
public double getVariance()
Description copied from interface:VarianceIfcReturns the variance of the distribution if defined- Specified by:
getVariancein interfaceVarianceIfc- Returns:
- If shape <= 2.0, returns Double.NaN, otherwise returns the variance
-
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
-
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.
-
setParameters
public void setParameters(double[] parameters)
Sets the parameters parameters[0] = shape parameters[1] = scale- Specified by:
setParametersin interfaceParametersIfc- Parameters:
parameters- the parameter array
-
getRandomVariable
public final RVariableIfc getRandomVariable(RNStreamIfc rng)
- Specified by:
getRandomVariablein interfaceGetRVariableIfc- Overrides:
getRandomVariablein classDistribution- Parameters:
rng- the stream to use- Returns:
- a random variable
-
-