Supremum class version of the Anderson-Darling test providing a comparison of a fitted distribution
with the empirical distribution.
Usage
ad.test(x, distn, fit, H = NA, alternative = c("two.sided", "less", "greater"), sim = 100, tol = 1e-04, estfun = NA)
Arguments
x
a numeric vector of data values
distn
character string naming the null distribution function
fit
list of null distribution parameters
H
a treshold value
alternative
indicates the alternative hypothesis and must be one of
"two.sided" (default), "less", or "greater". Initial letter must be specified only.
sim
maximum number of szenarios in the Monte-Carlo simulation
tol
if the difference of two subsequent p-value calculations is lower than tol the
Monte-Carlo simulation stops
estfun
an function as character string or NA (default). See mctest.
Value
A list with class "mchtest" containing the following components
statistic
the value of the Supremum Class Anderson-Darling statistic
treshold
the treshold value
p.value
the p-value of the test
data.name
a character string giving the name of the data
method
the character string "Supremum Class Anderson-Darling test"
alternative
the alternative
sim.no
number of simulated szenarios in the Monte-Carlo simulation
Details
The supremum class Anderson-Darling test compares the null distribution with the
empirical distribution of the observed data. The test statistic is given by
$$AD^+ = \sqrt{n}\sup_j\{\frac{z_H + \frac{j}{n}(1-z_H)-z_j}{\sqrt{(z_j-z_H)(1-z_j)}}\}$$
$$AD^- = \sqrt{n}\sup_j\{\frac{z_j -(z_H + \frac{j-1}{n}(1-z_H))}{\sqrt{(z_j-z_H)(1-z_j)}}\}$$
$$AD = \max\{AD^+, AD^-\}.$$
with $z_H = F_theta(H)$ and $
z_j=F_theta(x_j)$, where $x_1, \dots, x_n$ are the ordered data values. Here,
$F_theta$ is the null distribution.
References
Chernobay, A., Rachev, S., Fabozzi, F. (2005), Composites goodness-of-fit tests
for left-truncated loss samples, Tech. rep., University of Calivornia Santa Barbara