Package jline.lang.processes
Class DiscreteSampler
java.lang.Object
jline.lang.processes.Distribution
jline.lang.processes.DiscreteDistribution
jline.lang.processes.DiscreteSampler
- All Implemented Interfaces:
Serializable
A class for discrete distributions specified from the probability mass function
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDiscreteSampler
(Matrix p, Matrix x) Constructs a discrete distribution from a finite probability vector p at the points specified in vector x -
Method Summary
Methods inherited from class jline.lang.processes.DiscreteDistribution
evalPMF, evalPMF
Methods inherited from class jline.lang.processes.Distribution
evalProbInterval, getName, getNumParams, getParam, getRate, getSupport, getVar, isContinuous, isDiscrete, isImmediate, setNumParams, setParam
-
Constructor Details
-
DiscreteSampler
-
DiscreteSampler
Constructs a discrete distribution from a finite probability vector p at the points specified in vector x- Parameters:
p
- - the probability of an itemx
- - the value of an item
-
-
Method Details
-
main
-
sample
public double sample() -
sample
public double[] sample(int n) - Overrides:
sample
in classDistribution
-
sample
- Specified by:
sample
in classDistribution
-
getMean
public double getMean()Computes the distribution mean- Specified by:
getMean
in classDistribution
- Returns:
- - the mean of the distribution
-
getSCV
public double getSCV()Computes the distribution squared coefficient of variation (SCV = variance/mean^2)- Specified by:
getSCV
in classDistribution
- Returns:
-
getSkewness
public double getSkewness()- Specified by:
getSkewness
in classDistribution
-
evalCDF
public double evalCDF(double t) - Specified by:
evalCDF
in classDistribution
-
evalPMF
-
evalPMF
- Overrides:
evalPMF
in classDiscreteDistribution
-
isDisabled
public boolean isDisabled()- Overrides:
isDisabled
in classDistribution
-