|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.probdist.DiscreteDistribution umontreal.iro.lecuyer.probdist.EmpiricalDist
public class EmpiricalDist
Extends DiscreteDistribution
to an empirical
distribution function,
based on the observations
X(1),..., X(n) (sorted by increasing order).
The distribution is uniform over the n observations, so the
distribution function has a jump of 1/n at each of the n observations.
Constructor Summary | |
---|---|
EmpiricalDist(double[] obs)
Constructs a new empirical distribution using all the observations stored in obs, and which are assumed to have been sorted in increasing numerical order. |
|
EmpiricalDist(Reader in)
Constructs a new empirical distribution using the observations read from the reader in. |
Method Summary | |
---|---|
double |
barF(double x)
Returns bar(F)(x) = 1 - F(x). |
double |
cdf(double x)
Returns the distribution function F(x). |
double |
getInterQuartileRange()
Returns the interquartile range of the observations, defined as the difference between the third and first quartiles. |
double |
getMean()
Computes the mean E[X] = ∑ipixi of the distribution. |
double |
getMedian()
Returns the median. |
static double |
getMedian(double[] obs,
int n)
Returns the median. |
int |
getN()
Returns n, the number of observations. |
double |
getObs(int i)
Returns the value of X(i), for i = 0, 1,…, n - 1. |
double[] |
getParams()
Return a table containing parameters of the current distribution. |
double |
getSampleMean()
Returns the sample mean of the observations. |
double |
getSampleStandardDeviation()
Returns the sample standard deviation of the observations. |
double |
getSampleVariance()
Returns the sample variance of the observations. |
double |
getStandardDeviation()
Computes the standard deviation of the distribution. |
double |
getVariance()
Computes the variance Var[X] = ∑ipi(xi - E[X])2 of the distribution. |
double |
inverseF(double u)
Returns the inverse distribution function F-1(u), defined in. |
double |
prob(int i)
Returns pi, the probability of the i-th value, for 0 <= i < n. |
String |
toString()
Returns a String containing information about the current distribution. |
Methods inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistribution |
---|
getValue, getXinf, getXsup |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EmpiricalDist(double[] obs)
public EmpiricalDist(Reader in) throws IOException
IOException
Method Detail |
---|
public double prob(int i)
DiscreteDistribution
prob
in class DiscreteDistribution
i
- value number,
0 <= i < n
public double cdf(double x)
Distribution
cdf
in interface Distribution
cdf
in class DiscreteDistribution
x
- value at which the distribution function is evaluated
public double barF(double x)
Distribution
barF
in interface Distribution
barF
in class DiscreteDistribution
x
- value at which the complementary distribution function is evaluated
public double inverseF(double u)
Distribution
inverseF
in interface Distribution
inverseF
in class DiscreteDistribution
u
- value in the interval (0, 1) for which the inverse
distribution function is evaluated
public double getMean()
DiscreteDistribution
getMean
in interface Distribution
getMean
in class DiscreteDistribution
public double getStandardDeviation()
DiscreteDistribution
getStandardDeviation
in interface Distribution
getStandardDeviation
in class DiscreteDistribution
public double getVariance()
DiscreteDistribution
getVariance
in interface Distribution
getVariance
in class DiscreteDistribution
public double getMedian()
public static double getMedian(double[] obs, int n)
obs
- the array of observationsn
- the number of observations
public int getN()
getN
in class DiscreteDistribution
public double getObs(int i)
public double getSampleMean()
public double getSampleVariance()
public double getSampleStandardDeviation()
public double getInterQuartileRange()
public double[] getParams()
getParams
in interface Distribution
getParams
in class DiscreteDistribution
public String toString()
toString
in class DiscreteDistribution
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |