File: goftest-package.Rd

package info (click to toggle)
r-cran-goftest 1.2-2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 236 kB
  • sloc: ansic: 180; sh: 13; makefile: 2
file content (80 lines) | stat: -rwxr-xr-x 2,880 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
\name{goftest-package}
\alias{goftest-package}
\alias{goftest}
\docType{package}
\title{
  Classical Goodness-of-Fit Tests
}
\description{
  \ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises
  and Anderson-Darling tests of goodness-of-fit
  for continuous univariate distributions, using modern
  algorithms to compute the null distributions.
}
\details{
  The \pkg{goftest} package contains implementations of the
  classical \ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises
  and Anderson-Darling tests of goodness-of-fit
  for continuous univariate distributions.

  The \ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises test
  is performed by \code{\link{cvm.test}}. The cumulative distribution
  function of the null distribution of the test statistic
  is computed by \code{\link{pCvM}}
  using the algorithm of \ifelse{latex}{\out{Cs\"org\H{o}}}{Csorgo}
  and Faraway (1996). The quantiles are computed by \code{\link{qCvM}}
  by root-finding.

  The Anderson-Darling test is performed by 
  \code{\link{ad.test}}. The cumulative distribution
  function of the null distribution of the test statistic
  is computed by \code{\link{pAD}}
  using the algorithm of Marsaglia and Marsaglia (2004).
  The quantiles are computed by \code{\link{qAD}} by root-finding.

  By default, each test assumes that the parameters of the null
  distribution are known (a \emph{simple} null hypothesis).
  If the parameters were estimated (calculated from the data)
  then the user should set \code{estimated=TRUE} which uses
  the method of Braun (1980) to adjust for the effect of 
  estimating the parameters from the data. 
}
\author{
  Adrian Baddeley, Julian Faraway, John Marsaglia, George Marsaglia.

  Maintainer: Adrian Baddeley <adrian.baddeley@uwa.edu.au>
}
\references{
  Braun, H. (1980)
  A simple method for testing goodness-of-fit in the presence of
  nuisance parameters.
  \emph{Journal of the Royal Statistical Society} \bold{42}, 53--63.

  \ifelse{latex}{\out{Cs\"org\H{o}}}{Csorgo}, S. and Faraway, J.J. (1996)
  The exact and asymptotic distributions of
  \ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises statistics.
  \emph{Journal of the Royal Statistical Society, Series B}
  \bold{58}, 221--234.

  Marsaglia, G. and Marsaglia, J. (2004)
  Evaluating the Anderson-Darling Distribution.
  \emph{Journal of Statistical Software} \bold{9} (2), 1--5.
  February 2004. 
  \url{http://www.jstatsoft.org/v09/i02}
}
\keyword{package}
\keyword{htest}
\seealso{
  \code{\link[stats]{ks.test}}
}
\examples{
  x <- rnorm(30, mean=2, sd=1)
  # default behaviour: parameters fixed: simple null hypothesis
  cvm.test(x, "pnorm", mean=2, sd=1)
  ad.test(x, "pnorm", mean=2, sd=1)
  # parameters estimated: composite null hypothesis
  mu <- mean(x)
  sigma <- sd(x)
  cvm.test(x, "pnorm", mean=mu, sd=sigma, estimated=TRUE)
  ad.test(x, "pnorm", mean=mu, sd=sigma, estimated=TRUE)
}