| 1 |
head 1.6; |
| 2 |
access; |
| 3 |
symbols; |
| 4 |
locks |
| 5 |
adrian:1.6; strict; |
| 6 |
comment @# @; |
| 7 |
|
| 8 |
|
| 9 |
1.6 |
| 10 |
date 2018.06.06.08.23.51; author adrian; state Exp; |
| 11 |
branches; |
| 12 |
next 1.5; |
| 13 |
|
| 14 |
1.5 |
| 15 |
date 2018.06.06.08.22.11; author adrian; state Exp; |
| 16 |
branches; |
| 17 |
next 1.4; |
| 18 |
|
| 19 |
1.4 |
| 20 |
date 2018.03.29.13.57.19; author adrian; state Exp; |
| 21 |
branches; |
| 22 |
next 1.3; |
| 23 |
|
| 24 |
1.3 |
| 25 |
date 2014.06.09.08.37.32; author adrian; state Exp; |
| 26 |
branches; |
| 27 |
next 1.2; |
| 28 |
|
| 29 |
1.2 |
| 30 |
date 2014.06.09.05.19.07; author adrian; state Exp; |
| 31 |
branches; |
| 32 |
next 1.1; |
| 33 |
|
| 34 |
1.1 |
| 35 |
date 2014.06.09.05.11.00; author adrian; state Exp; |
| 36 |
branches; |
| 37 |
next ; |
| 38 |
|
| 39 |
|
| 40 |
desc |
| 41 |
@@ |
| 42 |
|
| 43 |
|
| 44 |
1.6 |
| 45 |
log |
| 46 |
@Summary: more stuff |
| 47 |
@ |
| 48 |
text |
| 49 |
@\name{goftest-package} |
| 50 |
\alias{goftest-package} |
| 51 |
\alias{goftest} |
| 52 |
\docType{package} |
| 53 |
\title{ |
| 54 |
Classical Goodness-of-Fit Tests |
| 55 |
} |
| 56 |
\description{ |
| 57 |
\ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises |
| 58 |
and Anderson-Darling tests of goodness-of-fit |
| 59 |
for continuous univariate distributions, using modern |
| 60 |
algorithms to compute the null distributions. |
| 61 |
} |
| 62 |
\details{ |
| 63 |
The \pkg{goftest} package contains implementations of the |
| 64 |
classical \ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises |
| 65 |
and Anderson-Darling tests of goodness-of-fit |
| 66 |
for continuous univariate distributions. |
| 67 |
|
| 68 |
The \ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises test |
| 69 |
is performed by \code{\link{cvm.test}}. The cumulative distribution |
| 70 |
function of the null distribution of the test statistic |
| 71 |
is computed by \code{\link{pCvM}} |
| 72 |
using the algorithm of \ifelse{latex}{\out{Cs\"org\H{o}}}{Csorgo} |
| 73 |
and Faraway (1996). The quantiles are computed by \code{\link{qCvM}} |
| 74 |
by root-finding. |
| 75 |
|
| 76 |
The Anderson-Darling test is performed by |
| 77 |
\code{\link{ad.test}}. The cumulative distribution |
| 78 |
function of the null distribution of the test statistic |
| 79 |
is computed by \code{\link{pAD}} |
| 80 |
using the algorithm of Marsaglia and Marsaglia (2004). |
| 81 |
The quantiles are computed by \code{\link{qAD}} by root-finding. |
| 82 |
|
| 83 |
By default, each test assumes that the parameters of the null |
| 84 |
distribution are known (a \emph{simple} null hypothesis). |
| 85 |
If the parameters were estimated (calculated from the data) |
| 86 |
then the user should set \code{estimated=TRUE} which uses |
| 87 |
the method of Braun (1980) to adjust for the effect of |
| 88 |
estimating the parameters from the data. |
| 89 |
} |
| 90 |
\author{ |
| 91 |
Adrian Baddeley, Julian Faraway, John Marsaglia, George Marsaglia. |
| 92 |
|
| 93 |
Maintainer: Adrian Baddeley <adrian.baddeley@@uwa.edu.au> |
| 94 |
} |
| 95 |
\references{ |
| 96 |
Braun, H. (1980) |
| 97 |
A simple method for testing goodness-of-fit in the presence of |
| 98 |
nuisance parameters. |
| 99 |
\emph{Journal of the Royal Statistical Society} \bold{42}, 53--63. |
| 100 |
|
| 101 |
\ifelse{latex}{\out{Cs\"org\H{o}}}{Csorgo}, S. and Faraway, J.J. (1996) |
| 102 |
The exact and asymptotic distributions of |
| 103 |
\ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises statistics. |
| 104 |
\emph{Journal of the Royal Statistical Society, Series B} |
| 105 |
\bold{58}, 221--234. |
| 106 |
|
| 107 |
Marsaglia, G. and Marsaglia, J. (2004) |
| 108 |
Evaluating the Anderson-Darling Distribution. |
| 109 |
\emph{Journal of Statistical Software} \bold{9} (2), 1--5. |
| 110 |
February 2004. |
| 111 |
\url{http://www.jstatsoft.org/v09/i02} |
| 112 |
} |
| 113 |
\keyword{package} |
| 114 |
\keyword{htest} |
| 115 |
\seealso{ |
| 116 |
\code{\link[stats]{ks.test}} |
| 117 |
} |
| 118 |
\examples{ |
| 119 |
x <- rnorm(30, mean=2, sd=1) |
| 120 |
# default behaviour: parameters fixed: simple null hypothesis |
| 121 |
cvm.test(x, "pnorm", mean=2, sd=1) |
| 122 |
ad.test(x, "pnorm", mean=2, sd=1) |
| 123 |
# parameters estimated: composite null hypothesis |
| 124 |
mu <- mean(x) |
| 125 |
sigma <- sd(x) |
| 126 |
cvm.test(x, "pnorm", mean=mu, sd=sigma, estimated=TRUE) |
| 127 |
ad.test(x, "pnorm", mean=mu, sd=sigma, estimated=TRUE) |
| 128 |
} |
| 129 |
@ |
| 130 |
|
| 131 |
|
| 132 |
1.5 |
| 133 |
log |
| 134 |
@Summary: more stuff |
| 135 |
@ |
| 136 |
text |
| 137 |
@d37 3 |
| 138 |
a39 1 |
| 139 |
However, a method is provided to adjust for the effect of |
| 140 |
d48 5 |
| 141 |
@ |
| 142 |
|
| 143 |
|
| 144 |
1.4 |
| 145 |
log |
| 146 |
@Summary: added message about simple null |
| 147 |
@ |
| 148 |
text |
| 149 |
@d35 4 |
| 150 |
a38 3 |
| 151 |
It is assumed that all the parameters of the null |
| 152 |
distribution are known (a \emph{simple} null hypothesis). The calculation does not |
| 153 |
account for the effect of estimating the parameters. |
| 154 |
d64 2 |
| 155 |
a65 1 |
| 156 |
x <- rnorm(10, mean=2, sd=1) |
| 157 |
d68 5 |
| 158 |
@ |
| 159 |
|
| 160 |
|
| 161 |
1.3 |
| 162 |
log |
| 163 |
@minor |
| 164 |
@ |
| 165 |
text |
| 166 |
@d34 4 |
| 167 |
@ |
| 168 |
|
| 169 |
|
| 170 |
1.2 |
| 171 |
log |
| 172 |
@prettified. |
| 173 |
@ |
| 174 |
text |
| 175 |
@d22 2 |
| 176 |
a23 1 |
| 177 |
function of the null distribution is computed by \code{\link{pCvM}} |
| 178 |
d30 2 |
| 179 |
a31 1 |
| 180 |
function of the null distribution is computed by \code{\link{pAD}} |
| 181 |
d59 3 |
| 182 |
a61 2 |
| 183 |
x <- rnorm(10) |
| 184 |
cvm.test(x, "pnorm") |
| 185 |
@ |
| 186 |
|
| 187 |
|
| 188 |
1.1 |
| 189 |
log |
| 190 |
@Initial revision |
| 191 |
@ |
| 192 |
text |
| 193 |
@d15 17 |
| 194 |
a31 7 |
| 195 |
\tabular{ll}{ |
| 196 |
Package: \tab goftest\cr |
| 197 |
Type: \tab Package\cr |
| 198 |
Version: \tab 1.0-0\cr |
| 199 |
Date: \tab 2014-06-08\cr |
| 200 |
License: \tab GPL\cr |
| 201 |
} |
| 202 |
d34 1 |
| 203 |
a34 1 |
| 204 |
Adrian Baddeley, Julian Faraway, John Marsaglia, George Marsaglia |
| 205 |
@ |