|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--jsc.goodnessfit.KolmogorovCB
Kolmogorov-Smirnov confidence band for the distribution function of a continuous variable. Calculates the sample distribution function and a confidence band for the population distribution function using a critical value of the Kolmogorov-Smirnov goodness-of-fit D-statistic.
For sample sizes up to 100, the exact critical value can be calculated using an algorithm from Miller(1956). For larger samples, an approximation from Stephens(1970) can be used. If used to test a discrete distribution, the true confidence band may be wider than the calculated band.
| Constructor Summary | |
KolmogorovCB(double[] x)
Create confidence band from a sample of data. |
|
KolmogorovCB(double[] x,
double confidenceCoeff,
boolean approx)
Create confidence band from a sample of data. |
|
KolmogorovCB(SampleDistributionFunction sdf,
double confidenceCoeff,
boolean approx)
Create confidence band from a sample distribution function. |
|
| Method Summary | |
static double |
approxCriticalValue(int n,
double alpha)
Calculate an approximate critical value of the Kolmogorov-Smirnov statistic for completely specified continuous distributions. |
static double |
exactCriticalValue(int n,
double alpha)
Calculate the exact critical value of the Kolmogorov-Smirnov statistic for completely specified continuous distributions. |
double |
getConfidenceCoeff()
Returns the confidence coefficient. |
double |
getCriticalValue()
Return the critical value of the Kolmogorov-Smirnov D-statistic used to calculate the confidence band. |
double |
getLowerLimit(int i)
Returns the value of the lower confidence limit function at the ith x-value. |
int |
getN()
Returns n, the number of indexed values that define the band. |
SampleDistributionFunction |
getSdf()
Returns the sample distribution function S(x) calculated for the confidence band. |
double |
getUpperLimit(int i)
Returns the value of the upper confidence limit function at the ith x-value. |
double |
getX(int i)
Returns the ith x-value. |
void |
setConfidenceCoeff(double coeff)
Specifies the confidence coefficient. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public KolmogorovCB(SampleDistributionFunction sdf,
double confidenceCoeff,
boolean approx)
sdf - the sample distribution function.confidenceCoeff - the confidence coefficient; must be between 0 and 1.approx - if true, Stephen's approximation is used to calculate the critical value.
IllegalArgumentException - if confidenceCoeff less than 0 or greater than 1.
public KolmogorovCB(double[] x,
double confidenceCoeff,
boolean approx)
x - the observations.confidenceCoeff - the confidence coefficient; must be between 0 and 1.approx - if true, Stephen's approximation is used to calculate the critical value.
IllegalArgumentException - if confidenceCoeff less than 0 or greater than 1.
IllegalArgumentException - if less than 2 observations.public KolmogorovCB(double[] x)
x - the observations.
IllegalArgumentException - if confidenceCoeff less than 0 or greater than 1.
IllegalArgumentException - if less than 2 observations.| Method Detail |
public static double approxCriticalValue(int n,
double alpha)
n - the sample size; must be > 0.alpha - the significance level; must be greater than or equal to 0 and less than or equal to 1.
IllegalArgumentException - if n < 1.
IllegalArgumentException - if alpha < 0 or > 1.
public static double exactCriticalValue(int n,
double alpha)
N.B. This method is unreliable when alpha < 1.0e-9 or alpha > 1 - 1.0e-9.
n - the sample size; must be > 0.alpha - the significance level; must be greater than or equal to 0 and less than or equal to 1.
IllegalArgumentException - if n < 1.
IllegalArgumentException - if alpha < 0 or > 1.public double getConfidenceCoeff()
ConfidenceBand
getConfidenceCoeff in interface ConfidenceBandpublic void setConfidenceCoeff(double coeff)
N.B. The coefficient should be less than 1 - 1.0e-9 for small samples.
setConfidenceCoeff in interface ConfidenceBandcoeff - the confidence coefficient; must be between 0 and 1.
IllegalArgumentException - if confidenceCoeff not > 0 and < 1.public double getCriticalValue()
public double getLowerLimit(int i)
ConfidenceBand
getLowerLimit in interface ConfidenceBandi - the index of x; from 0 to n-1.
public double getUpperLimit(int i)
ConfidenceBand
getUpperLimit in interface ConfidenceBandi - the index of x; from 0 to n-1.
public int getN()
ConfidenceBand
getN in interface ConfidenceBandpublic SampleDistributionFunction getSdf()
public double getX(int i)
ConfidenceBand
getX in interface ConfidenceBandi - the index of x; from 0 to n-1.
|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||