Package goftest. R topics documented: July 3, 2015. Type Package

Similar documents
Package nortest. R topics documented: July 30, Title Tests for Normality Version Date

Package retrosheet. April 13, 2015

Package sendmailr. February 20, 2015

Package dunn.test. January 6, 2016

Package uptimerobot. October 22, 2015

Package jrvfinance. R topics documented: October 6, 2015

Package TSfame. February 15, 2013

Package cpm. July 28, 2015

Package SCperf. February 19, 2015

Package changepoint. R topics documented: November 9, Type Package Title Methods for Changepoint Detection Version 2.

Package globe. August 29, 2016

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

Package empiricalfdr.deseq2

Package httprequest. R topics documented: February 20, 2015

Package hive. July 3, 2015

Package hive. January 10, 2011

Package SHELF. February 5, 2016

Package mcmcse. March 25, 2016

Package MixGHD. June 26, 2015

Package GenBinomApps

Package survpresmooth

Package sjdbc. R topics documented: February 20, 2015

1 Why is multiple testing a problem?

Package robfilter. R topics documented: February 20, Version 4.1 Date Title Robust Time Series Filters

Package neuralnet. February 20, 2015

Package ggrepel. February 8, 2016

How To Test For Significance On A Data Set

Package OECD. R topics documented: January 17, Type Package Title Search and Extract Data from the OECD Version 0.2.

ANALYZING NETWORK TRAFFIC FOR MALICIOUS ACTIVITY

Package fastghquad. R topics documented: February 19, 2015

Package acrm. R topics documented: February 19, 2015

Package pdfetch. R topics documented: July 19, 2015

Package HHG. July 14, 2015

Package decompr. August 17, 2016

Software for Distributions in R

Package bigrf. February 19, 2015

Package translater. R topics documented: February 20, Type Package

Package trimtrees. February 20, 2015

Package searchconsoler

Package lmertest. July 16, 2015

Package polynom. R topics documented: June 24, Version 1.3-8

Package PACVB. R topics documented: July 10, Type Package

Package wordnet. January 6, 2016

Package erp.easy. September 26, 2015

Package bigdata. R topics documented: February 19, 2015

Package bizdays. March 13, 2015

Package LexisPlotR. R topics documented: April 4, Type Package

Package EstCRM. July 13, 2015

Package png. February 20, 2015

The Normal Distribution. Alan T. Arnholt Department of Mathematical Sciences Appalachian State University

Package syuzhet. February 22, 2015

Package tvm. R topics documented: August 21, Type Package Title Time Value of Money Functions Version Author Juan Manuel Truppia

Package tagcloud. R topics documented: July 3, 2015

Package CRM. R topics documented: February 19, 2015

Package hoarder. June 30, 2015

Package RCassandra. R topics documented: February 19, Version Title R/Cassandra interface

Package plan. R topics documented: February 20, 2015

Package MBA. February 19, Index 7. Canopy LIDAR data

Package PKI. February 20, 2013

Package packrat. R topics documented: March 28, Type Package

The Variability of P-Values. Summary

Package xtal. December 29, 2015

Package dsstatsclient

Package fimport. February 19, 2015

Package ATE. R topics documented: February 19, Type Package Title Inference for Average Treatment Effects using Covariate. balancing.

COMPARING DISTRIBUTIONS: THE TWO-SAMPLE ANDERSON-DARLING TEST AS AN ALTERNATIVE TO THE KOLMOGOROV-SMIRNOFF TEST

Package DDIwR. R topics documented: February 19, Version Date Title DDI with R Depends R (>= 3.1.0) Imports XML, foreign

Package CoImp. February 19, 2015

Package biganalytics

Modeling Individual Claims for Motor Third Party Liability of Insurance Companies in Albania

Package TimeWarp. R topics documented: April 1, 2015

Package benford.analysis

Package pxr. February 20, 2015

Calculating P-Values. Parkland College. Isela Guerra Parkland College. Recommended Citation

TECHNICAL UNIVERSITY OF CRETE DATA STRUCTURES FILE STRUCTURES

Sources: On the Web: Slides will be available on:

A TOOLKIT FOR STATISTICAL COMPARISON OF DATA DISTRIBUTIONS

Package sudoku. February 20, 2015

Financial TIme Series Analysis: Part II

Package CIFsmry. July 10, Index 6

Package R4CDISC. September 5, 2015

Package PKI. July 28, 2015

Package hier.part. February 20, Index 11. Goodness of Fit Measures for a Regression Hierarchy

Package DCG. R topics documented: June 8, Type Package

THE MULTIVARIATE ANALYSIS RESEARCH GROUP. Carles M Cuadras Departament d Estadística Facultat de Biologia Universitat de Barcelona

Package missforest. February 20, 2015

Package brewdata. R topics documented: February 19, Type Package

Transcription:

Type Package Package goftest July 3, 2015 Title Classical Goodness-of-Fit Tests for Univariate Distributions Version 1.0-3 Date 2014-07-03 Depends R (>= 3.1) 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@uwa.edu.au> Repository CRAN Date/Publication 2015-07-03 12:51:04 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