Learn R Programming

goftest (version 1.2-3)

pAD: Null Distribution of Anderson-Darling Test Statistic

Description

pAD computes the cumulative distribution function, and qAD computes the quantile function, of the null distribution of the Anderson-Darling test statistic.

Usage

pAD(q, n = Inf, lower.tail = TRUE, fast=TRUE)
  qAD(p, n = Inf, lower.tail = TRUE, fast=TRUE)

Arguments

q

Numeric vector of quantiles (values for which the cumulative probability is required).

p

Numeric vector of probabilities.

n

Integer. Sample size for the Anderson-Darling test.

lower.tail

Logical. If TRUE (the default), probabilities are \(P(X \le q)\), and otherwise they are \(P(X > q)\).

fast

Logical value indicating whether to use a fast algorithm or a slower, more accurate algorithm, in the case n=Inf.

Value

A numeric vector of the same length as p or q.

Details

pAD uses the algorithms and C code described in Marsaglia and Marsaglia (2004).

qAD uses uniroot to find the quantiles.

The argument fast applies only when n=Inf and determines whether the asymptotic distribution is approximated using the faster algorithm adinf (accurate to 4-5 places) or the slower algorithm ADinf (accurate to 11 places) described in Marsaglia and Marsaglia (2004).

References

Anderson, T.W. and Darling, D.A. (1952) Asymptotic theory of certain 'goodness-of-fit' criteria based on stochastic processes. Annals of Mathematical Statistics 23, 193--212.

Anderson, T.W. and Darling, D.A. (1954) A test of goodness of fit. Journal of the American Statistical Association 49, 765--769.

Marsaglia, G. and Marsaglia, J. (2004) Evaluating the Anderson-Darling Distribution. Journal of Statistical Software 9 (2), 1--5. February 2004. 10.18637/jss.v009.i02

See Also

ad.test

Examples

Run this code
# NOT RUN {
  pAD(1.1, n=5)
  pAD(1.1)
  pAD(1.1, fast=FALSE)

  qAD(0.5, n=5)
  qAD(0.5)
# }

Run the code above in your browser using DataLab