| 1 |
head 1.1; |
| 2 |
access; |
| 3 |
symbols; |
| 4 |
locks |
| 5 |
adrian:1.1; strict; |
| 6 |
comment @# @; |
| 7 |
|
| 8 |
|
| 9 |
1.1 |
| 10 |
date 2014.06.08.11.23.35; author adrian; state Exp; |
| 11 |
branches; |
| 12 |
next ; |
| 13 |
|
| 14 |
|
| 15 |
desc |
| 16 |
@@ |
| 17 |
|
| 18 |
|
| 19 |
1.1 |
| 20 |
log |
| 21 |
@Initial revision |
| 22 |
@ |
| 23 |
text |
| 24 |
@\name{pcramer} |
| 25 |
\alias{pcramer} |
| 26 |
\alias{qcramer} |
| 27 |
\title{ |
| 28 |
Null Distribution of Cramer-von Mises Test Statistic |
| 29 |
} |
| 30 |
\description{ |
| 31 |
\code{pcramer} computes the cumulative distribution function, |
| 32 |
and \code{qcramer} computes the quantile function, |
| 33 |
of the null distribution of the |
| 34 |
\ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises test |
| 35 |
statistic. |
| 36 |
} |
| 37 |
\usage{ |
| 38 |
pcramer(q, n = Inf, lower.tail = TRUE) |
| 39 |
qcramer(p, n = Inf, lower.tail = TRUE) |
| 40 |
} |
| 41 |
\arguments{ |
| 42 |
\item{q}{ |
| 43 |
Numeric vector of quantiles (values for which the |
| 44 |
cumulative probability is required). |
| 45 |
} |
| 46 |
\item{p}{ |
| 47 |
Numeric vector of probabilities. |
| 48 |
} |
| 49 |
\item{n}{ |
| 50 |
Integer. Sample size for the |
| 51 |
\ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises test. |
| 52 |
} |
| 53 |
\item{lower.tail}{ |
| 54 |
Logical. If \code{TRUE} (the default), |
| 55 |
probabilities are \eqn{P(X \le q)}{P(X <= q)}, |
| 56 |
and otherwise they are \eqn{P(X > q)}. |
| 57 |
} |
| 58 |
} |
| 59 |
\details{ |
| 60 |
For finite \code{n} the cumulative distribution function is |
| 61 |
approximated by the first order expansion |
| 62 |
\eqn{V(x) + \psi_1(x)/n}{V(x) + psi1(x)/n}, |
| 63 |
equation (1.8) of |
| 64 |
\ifelse{latex}{\out{Cs\"org\"o}}{Csorgo} and Faraway (1996). |
| 65 |
|
| 66 |
\code{qcramer} uses \code{\link[stats]{uniroot}} to find the |
| 67 |
quantiles. |
| 68 |
} |
| 69 |
\value{ |
| 70 |
A numeric vector of the same length as \code{p} or \code{q}. |
| 71 |
} |
| 72 |
\references{ |
| 73 |
\ifelse{latex}{\out{Cs\"org\H{o}}}{Csorgo}, S. and Faraway, J.J. (1996) |
| 74 |
The exact and asymptotic distributions of |
| 75 |
\ifelse{latex}{\out{Cram\'er}}{Cramer}-von Mises statistics. |
| 76 |
\emph{Journal of the Royal Statistical Society, Series B} |
| 77 |
\bold{58}, 221--234. |
| 78 |
} |
| 79 |
\author{ |
| 80 |
Original Matlab code by Julian Faraway, |
| 81 |
translated to \R by Adrian Baddeley. |
| 82 |
} |
| 83 |
\seealso{ |
| 84 |
\code{\link{cvm.test}} |
| 85 |
} |
| 86 |
\examples{ |
| 87 |
pcramer(1.1) |
| 88 |
pcramer(1.1, n=5) |
| 89 |
qcramer(0.5) |
| 90 |
qcramer(0.5, n=5) |
| 91 |
} |
| 92 |
\keyword{distribution} |
| 93 |
\keyword{htest} |
| 94 |
|
| 95 |
@ |