Package goftest. R topics documented: April 3, Type Package

Similar documents
Package codadiags. February 19, 2015

Package invgamma. May 7, 2017

Package AID. R topics documented: November 10, Type Package Title Box-Cox Power Transformation Version 2.3 Date Depends R (>= 2.15.

Package Delaporte. August 13, 2017

Package depth.plot. December 20, 2015

Package gtheory. October 30, 2016

Package BayesNI. February 19, 2015

Package polypoly. R topics documented: May 27, 2017

Package sdprisk. December 31, 2016

Package jmuoutlier. February 17, 2017

Package dhsic. R topics documented: July 27, 2017

Package sscor. January 28, 2016

Package LIStest. February 19, 2015

Package skellam. R topics documented: December 15, Version Date

Package homtest. February 20, 2015

Package SK. May 16, 2018

Package MultisiteMediation

Package TSF. July 15, 2017

Package RTransferEntropy

Package leiv. R topics documented: February 20, Version Type Package

Package RATest. November 30, Type Package Title Randomization Tests

Package SimCorMultRes

Package SEMModComp. R topics documented: February 19, Type Package Title Model Comparisons for SEM Version 1.0 Date Author Roy Levy

Package severity. February 20, 2015

Package NonpModelCheck

Package EL. February 19, 2015

Package esreg. August 22, 2017

Package IndepTest. August 23, 2018

Package BNN. February 2, 2018

Package BSSasymp. R topics documented: September 12, Type Package

Package locfdr. July 15, Index 5

Package ShrinkCovMat

Package generalhoslem

Package R1magic. August 29, 2016

Package unbalhaar. February 20, 2015

Package factorqr. R topics documented: February 19, 2015

Package idmtpreg. February 27, 2018

Package robustrao. August 14, 2017

Package SpatialNP. June 5, 2018

Package RI2by2. October 21, 2016

Package NlinTS. September 10, 2018

Package ssanv. June 23, 2015

Package darts. February 19, 2015

Package EMVS. April 24, 2018

Package WaveletArima

Package pearson7. June 22, 2016

Package matrixnormal

Package emg. R topics documented: May 17, 2018

Package supernova. February 23, 2018

Package covsep. May 6, 2018

Package R1magic. April 9, 2013

Package gk. R topics documented: February 4, Type Package Title g-and-k and g-and-h Distribution Functions Version 0.5.

Package flan. R topics documented: October 30, 2017

Package rbvs. R topics documented: August 29, Type Package Title Ranking-Based Variable Selection Version 1.0.

Package ltsbase. R topics documented: February 20, 2015

Package weightquant. R topics documented: December 30, Type Package

Goodness-of-fit Tests for the Normal Distribution Project 1

Stat 427/527: Advanced Data Analysis I

Package GD. January 12, 2018

Package lsei. October 23, 2017

Package date. R topics documented: February 20, Version Title Functions for Handling Dates. Description Functions for handling dates.

Package cartogram. June 21, 2018

Package mcmcse. July 4, 2017

Package ppcc. June 28, 2017

Package cvequality. March 31, 2018

Package thief. R topics documented: January 24, Version 0.3 Title Temporal Hierarchical Forecasting

Package plspolychaos

Package face. January 19, 2018

Package Tcomp. June 6, 2018

Package eel. September 1, 2015

Package FinCovRegularization

Package MicroMacroMultilevel

Package HMMcopula. December 1, 2018

Package SimSCRPiecewise

Package BayesTreePrior

Package TimeSeries.OBeu

Package HIMA. November 8, 2017

Package NORMT3. February 19, 2015

Package scpdsi. November 18, 2018

Package ForecastCombinations

Package noncompliance

Package Grace. R topics documented: April 9, Type Package

Package horseshoe. November 8, 2016

Package hwwntest. R topics documented: August 3, Type Package Title Tests of White Noise using Wavelets Version 1.3.

Package CPE. R topics documented: February 19, 2015

Package CompQuadForm

Package bigtime. November 9, 2017

Package varband. November 7, 2016

Package FDRSeg. September 20, 2017

Package ChIPtest. July 20, 2016

Package hot.deck. January 4, 2016

Package bayeslm. R topics documented: June 18, Type Package

Package dominanceanalysis

Package effectfusion

Package bpp. December 13, 2016

Package CCP. R topics documented: December 17, Type Package. Title Significance Tests for Canonical Correlation Analysis (CCA) Version 0.

Package PVR. February 15, 2013

Package rnmf. February 20, 2015

Package msu. September 30, 2017

Package sbgcop. May 29, 2018

Transcription:

Type Package Package goftest April 3, 2017 Title Classical Goodness-of-Fit Tests for Univariate Distributions Version 1.1-1 Date 2017-04-03 Depends R (>= 3.3) Imports stats Cramer-Von Mises and Anderson-Darling tests of goodness-of-fit for continuous univariate distributions, using efficient algorithms. License GPL (>= 2) NeedsCompilation yes Author Julian Faraway [aut], George Marsaglia [aut], John Marsaglia [aut], Adrian Baddeley [aut, cre] Maintainer Adrian Baddeley <Adrian.Baddeley@curtin.edu.au> Repository CRAN Date/Publication 2017-04-03 06:17:16 UTC R topics documented: goftest-package....................................... 2 ad.test............................................ 3 cvm.test........................................... 4 pad............................................. 5 pcvm............................................ 6 recognisecdf........................................ 7 Index 9 1

2 goftest-package goftest-package Classical Goodness-of-Fit Tests Cramér-von Mises and Anderson-Darling tests of goodness-of-fit for continuous univariate distributions, using modern algorithms to compute the null distributions. The goftest package contains implementations of the classical Cramér-von Mises and Anderson- Darling tests of goodness-of-fit for continuous univariate distributions. The Cramér-von Mises test is performed by cvm.test. The cumulative distribution function of the null distribution of the test statistic is computed by pcvm using the algorithm of Csörgő and Faraway (1996). The quantiles are computed by qcvm by root-finding. The Anderson-Darling test is performed by ad.test. The cumulative distribution function of the null distribution of the test statistic is computed by pad using the algorithm of Marsaglia and Marsaglia (2004). The quantiles are computed by qad by root-finding. Adrian Baddeley, Julian Faraway, John Marsaglia, George Marsaglia. Maintainer: Adrian Baddeley <adrian.baddeley@uwa.edu.au> Csörgő, S. and Faraway, J.J. (1996) The exact and asymptotic distributions of Cramér-von Mises statistics. Journal of the Royal Statistical Society, Series B 58, 221 234. Marsaglia, G. and Marsaglia, J. (2004) Evaluating the Anderson-Darling Distribution. Journal of Statistical Software 9 (2), 1 5. February 2004. http://www.jstatsoft.org/v09/i02 ks.test x <- rnorm(10, mean=2, sd=1) cvm.test(x, "pnorm", mean=2, sd=1) ad.test(x, "pnorm", mean=2, sd=1)

ad.test 3 ad.test Anderson-Darling Test of Goodness-of-Fit Performs the Anderson-Darling test of goodness-of-fit to a specified continuous univariate probability distribution. ad.test(x, null = "punif",..., nullname) x null Numeric vector of data values. A function, or a character string giving the name of a function, to compute the cumulative distribution function for the null distribution.... Additional arguments for the cumulative distribution function. nullname Optional character string describing the null distribution. The default is "uniform distribution". This command performs the Anderson-Darling test of goodness-of-fit to the distribution specified by the argument null. It is assumed that the values in x are independent and identically distributed random values, with some cumulative distribution function F. The null hypothesis is that F is the function specified by the argument null, while the alternative hypothesis is that F is some other function. An object of class "htest" representing the result of the hypothesis test. Original C code by George Marsaglia and John Marsaglia. R interface by Adrian Baddeley. 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. http://www.jstatsoft.org/v09/i02

4 cvm.test pad for the null distribution of the test statistic. x <- rnorm(10, mean=2, sd=1) ad.test(x, "pnorm", mean=2, sd=1) cvm.test Cramer-Von Mises Test of Goodness-of-Fit Performs the Cramér-von Mises test of goodness-of-fit to a specified continuous univariate probability distribution. cvm.test(x, null = "punif",..., nullname) x null Numeric vector of data values. A function, or a character string giving the name of a function, to compute the cumulative distribution function for the null distribution.... Additional arguments for the cumulative distribution function. nullname Optional character string describing the null distribution. The default is "uniform distribution". This command performs the Cramér-von Mises test of goodness-of-fit to the distribution specified by the argument null. It is assumed that the values in x are independent and identically distributed random values, with some cumulative distribution function F. The null hypothesis is that F is the function specified by the argument null, while the alternative hypothesis is that F is some other function. An object of class "htest" representing the result of the hypothesis test. Adrian Baddeley. Csörgő, S. and Faraway, J.J. (1996) The exact and asymptotic distributions of Cramér-von Mises statistics. Journal of the Royal Statistical Society, Series B 58, 221 234.

pad 5 pcvm for the null distribution of the test statistic. x <- rnorm(10, mean=2, sd=1) cvm.test(x, "pnorm", mean=2, sd=1) pad Null Distribution of Anderson-Darling Test Statistic pad computes the cumulative distribution function, and qad computes the quantile function, of the null distribution of the Anderson-Darling test statistic. pad(q, n = Inf, lower.tail = TRUE, fast=true) qad(p, n = Inf, lower.tail = TRUE, fast=true) q p n lower.tail fast Numeric vector of quantiles (values for which the cumulative probability is required). Numeric vector of probabilities. Integer. Sample size for the Anderson-Darling test. Logical. If TRUE (the default), probabilities are P (X q), and otherwise they are P (X > q). Logical value indicating whether to use a fast algorithm or a slower, more accurate algorithm, in the case n=inf. 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). A numeric vector of the same length as p or q.

6 pcvm Original C code by G. and J. Marsaglia. R interface by Adrian Baddeley. 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. http://www.jstatsoft.org/v09/i02 ad.test pad(1.1, n=5) pad(1.1) pad(1.1, fast=false) qad(0.5, n=5) qad(0.5) pcvm Null Distribution of Cramer-von Mises Test Statistic pcvm computes the cumulative distribution function, and qcvm computes the quantile function, of the null distribution of the Cramér-von Mises test statistic. pcvm(q, n = Inf, lower.tail = TRUE) qcvm(p, n = Inf, lower.tail = TRUE) q p n lower.tail Numeric vector of quantiles (values for which the cumulative probability is required). Numeric vector of probabilities. Integer. Sample size for the Cramér-von Mises test. Logical. If TRUE (the default), probabilities are P (X q), and otherwise they are P (X > q).

recognisecdf 7 For finite n the cumulative distribution function is approximated by the first order expansion V (x)+ ψ 1 (x)/n, equation (1.8) of Csörgö and Faraway (1996). qcvm uses uniroot to find the quantiles. A numeric vector of the same length as p or q. Original Matlab code by Julian Faraway, translated to R by Adrian Baddeley. Csörgő, S. and Faraway, J.J. (1996) The exact and asymptotic distributions of Cramér-von Mises statistics. Journal of the Royal Statistical Society, Series B 58, 221 234. cvm.test pcvm(1.1, n=5) pcvm(1.1) qcvm(0.5, n=5) qcvm(0.5) recognisecdf Explanatory Name of Distribution Function Recognises many standard cumulative distribution functions and returns a string describing the distribution. recognisecdf(s="punif") s A single character string giving the name of an R function that calculates cumulative probabilities.

8 recognisecdf The list of recognised distribution functions includes all those available in the stats package and in goftest. Character string, or NULL if the name is not recognised. Adrian Baddeley. pad recognisecdf("punif") recognisecdf("pt")

Index Topic distribution pad, 5 pcvm, 6 recognisecdf, 7 Topic htest ad.test, 3 cvm.test, 4 goftest-package, 2 pad, 5 pcvm, 6 Topic package goftest-package, 2 ad.test, 2, 3, 6 cvm.test, 2, 4, 7 goftest (goftest-package), 2 goftest-package, 2 ks.test, 2 pad, 2, 4, 5, 8 pcvm, 2, 5, 6 qad, 2 qad (pad), 5 qcvm, 2 qcvm (pcvm), 6 recognisecdf, 7 uniroot, 5, 7 9