
SSJ V. 2.6. 

PREV PACKAGE NEXT PACKAGE  FRAMES NO FRAMES 
See:
Description
Class Summary  

FBar  This class is similar to FDist , except that it provides static methods
to compute or approximate the complementary distribution function of X,
which we define as
bar(F)(x) = P[X >= x], instead of
F(x) = P[X <= x]. 
FDist  This class provides methods to compute (or approximate) the distribution functions of special types of goodnessoffit test statistics. 
GofFormat  This class contains methods used to format results of GOF test statistics, or to apply a series of tests simultaneously and format the results. 
GofStat  This class provides methods to compute several types of EDF goodnessoffit test statistics and to apply certain transformations to a set of observations. 
GofStat.OutcomeCategoriesChi2  This class helps managing the partitions of possible outcomes into categories for applying chisquare tests. 
KernelDensity  This class provides methods to compute a kernel density estimator from a set of n individual observations x_{0},…, x_{n1}, and returns its value at m selected points. 
This package contains tools for performing
univariate goodnessoffit (GOF) statistical tests.
Methods for computing (or approximating) the distribution
function F(x) of certain GOF test statistics, as well as their
complementary distribution function
bar(F)(x) = 1  F(x), are
implemented in classes of package
probdist
.
Tools for computing the GOF test statistics and the corresponding
pvalues, and for formating the results, are provided in classes
GofStat
and
GofFormat
.
We are concerned here with GOF test statistics for testing the hypothesis
H_{0} that a sample of N observations
X_{1},..., X_{N} comes from a
given univariate probability distribution F.
We consider tests such as those of KolmogorovSmirnov, AndersonDarling,
Crámervon Mises, etc.
These test statistics generally measure, in different ways, the
distance between a continuous distribution function F and
the empirical distribution function
(EDF) hat(F)_{N} of
X_{1},..., X_{N}.
They are also called EDF test statistics.
The observations X_{i} are usually transformed into
U_{i} = F(X_{i}),
which satisfy
0 <= U_{i} <= 1 and which
follow the U(0, 1) distribution under H_{0}.
(This is called the probability integral transformation.)
Methods for applying this transformation, as well as other types of
transformations, to the observations X_{i} or U_{i}
are provided in GofStat
.
Then the GOF tests are applied to the U_{i} sorted by increasing order.
The corresponding pvalues are easily computed by calling the appropriate
methods in the classes of package probdist
.
If a GOF test statistic Y has a continuous distribution under
H_{0} and takes the value y, its (right) pvalue is defined as
p = P[Y >= y  H_{0}]. The test usually rejects
H_{0} if p
is deemed too close to 0 (for a onesided test) or too close to 0 or 1
(for a twosided test).
In the case where Y has a discrete distribution under H_{0}, we distinguish the right pvalue p_{R} = P[Y >= y  H_{0}] and the left pvalue p_{L} = P[Y <= y  H_{0}]. We then define the pvalue for a twosided test as
p =  p_{R}  if p_{R} < p_{L}, 
p =  1  p_{L}  if p_{R} >= p_{L} and p_{L} < 0.5, 
p =  0.5  otherwise. 
A very common type of test in the discrete case is the chisquare test, which applies when the possible outcomes are partitioned into a finite number of categories. Suppose there are k categories and that each observation belongs to category i with probability p_{i}, for 0 <= i < k. If there are n independent observations, the expected number of observations in category i is e_{i} = np_{i}, and the chisquare test statistic is defined as
GofStat.OutcomeCategoriesChi2
,
a nested class defined inside the
GofStat
class, provides tools to automatically
regroup categories in the cases where some e_{i}'s are too small.
The class GofFormat
contains methods used to format results of GOF
test statistics, or to apply several such tests simultaneously to a
given data set and format the results to produce a report that also
contains the pvalues of all these tests.
A C version of this class is actually used extensively in the package
TestU01, which applies statistical tests to random number generators.
The class also provides tools to plot an empirical or
theoretical distribution function, by creating a data file that
contains a graphic plot in a format compatible with a given software.

SSJ V. 2.6. 

PREV PACKAGE NEXT PACKAGE  FRAMES NO FRAMES 