hyperbCvMTest: Cramer-von~Mises Test of a Hyperbolic Distribution

View source: R/hyperbCvMTest.R

hyperbCvMTestR Documentation

Cramer-von~Mises Test of a Hyperbolic Distribution

Description

Carry out a Crämer-von~Mises test of a hyperbolic distribution where the parameters of the distribution are estimated, or calculate the p-value for such a test.

Usage

hyperbCvMTest(x, Theta, conf.level = 0.95, ...)
hyperbCvMTestPValue(xi, chi, Wsq, digits = 3)
## S3 method for class 'hyperbCvMTest'
print(x, prefix = "\t", ...)

Arguments

x

A numeric vector of data values for hyperbCvMTest, or object of class "hyperbCvMTest" for print.hyperbCvMTest.

Theta

Parameters of the hyperbolic distribution taking the form c(pi,zeta,delta,mu).

conf.level

Confidence level of the the confidence interval.

...

Further arguments to be passed to or from methods.

xi

Value of \xi in the (\xi,\chi) parameterization of the hyperbolic distribution.

chi

Value of \chi in the (\xi,\chi) parameterisation of the hyperbolic distribution.

Wsq

Value of the test statistic in the Crämer-von~Mises test of the hyperbolic distribution.

digits

Number of decimal places for p-value.

prefix

Character(s) to be printed before the description of the test.

Details

hyperbCvMTest carries out a Crämer-von~Mises goodness-of-fit test of the hyperbolic distribution. The parameter Theta must be given in the (\pi,\zeta) parameterisation.

hyperbCvMTestPValue calculates the p-value of the test, and is not expected to be called by the user. The method used is interpolation in Table 5 given in Puig & Stephens (2001), which assumes all the parameters of the distribution are unknown. Since the table used is limited, large p-values are simply given as “>~0.25” and very small ones as “<~0.01”. The table is created as the matrix wsqTable when the package HyperbolicDist is invoked.

print.hyperbCvMTest prints the output from the Crämer-von~Mises goodness-of-fit test for the hyperbolic distribution in very similar format to that provided by print.htest. The only reason for having a special print method is that p-values can be given as less than some value or greater than some value, such as “<\ ~0.01”, or “>\ ~0.25”.

Value

hyperbCvMTest returns a list with class hyperbCvMTest containing the following components:

statistic

The value of the test statistic.

method

A character string with the value “Crämer-von~Mises test of hyperbolic distribution”.

data.name

A character string giving the name(s) of the data.

parameter

The value of the parameter Theta.

p.value

The p-value of the test.

warn

A warning if the parameter values are outside the limits of the table given in Puig & Stephens (2001).

hyperbCvMTestPValue returns a list with the elements p.value and warn only.

Author(s)

David Scott, Thomas Tran

References

Puig, Pedro and Stephens, Michael A. (2001), Goodness-of-fit tests for the hyperbolic distribution. The Canadian Journal of Statistics/La Revue Canadienne de Statistique, 29, 309–320.

Examples

Theta <- c(2,2,2,2)
dataVector <- rhyperb(500, Theta)
fittedTheta <- hyperbFit(dataVector)$Theta
hyperbCvMTest(dataVector, fittedTheta)
dataVector <- rnorm(1000)
fittedTheta <- hyperbFit(dataVector, startValues = "FN")$Theta
hyperbCvMTest(dataVector, fittedTheta)

HyperbolicDist documentation built on Nov. 26, 2023, 9:07 a.m.