Learn R Programming

copula (version 0.999-7)

gofTstat: Goodness-of-fit Test Statistics

Description

gofTstat() computes various goodness-of-fit test statistics.

Usage

gofTstat(u, method=c("Sn", "SnB", "SnC", "AnChisq", "AnGamma"),
useR=FALSE, ...)

Arguments

u
$n\times d$-matrix of values in $[0,1]$, supposedly independent uniform observations in the hypercube, that is, $U_i \sim U[0,1]^d$, i.i.d., for $i \in {1,\dots,n}$.
method
a character string specifying the goodness-of-fit test statistic to be used, which has to be one (or a unique abbreviation) of [object Object],[object Object],[object Object],[object Object],[
useR
logical indicating whether an Ror C implementation is used.
...
additional arguments passed for computing the different test statistics.

Value

  • The value of the test statistic, a numeric.

Details

This function should be used with care. The different test statistics were implemented (partly) for different purposes and goodness-of-fit tests and should be used only with knowledge about such (see the references for more details).

References

Genest, C., Ré{e}millard, B., and Beaudoin, D. (2009), Goodness-of-fit tests for copulas: A review and a power study Insurance: Mathematics and Economics 44, 199--213.

Rosenblatt, M. (1952), Remarks on a Multivariate Transformation, The Annals of Mathematical Statistics 23, 3, 470--472.

Hering, C. and Hofert, M. (2011), Goodness-of-fit tests for Archimedean copulas in large dimensions, submitted.

Hofert, M., Mächler{Maechler}, M., and McNeil, A. J. (2012). Likelihood inference for Archimedean copulas in high dimensions under known margins. Journal of Multivariate Analysis 110, 133--150.

See Also

gofCopula() for goodness-of-fit tests were (some of) these test statistics are used.

Examples

Run this code
## generate data
cop <- archmCopula("Gumbel", param=iTau(gumbelCopula(), 0.5), dim=5)
set.seed(1)
U <- rCopula(1000, cop)

## compute Sn (as is done in a parametric bootstrap, for example)
Uhat <- pobs(U) # pseudo-observations
u <- rtrafo(Uhat, cop) # Rosenblatt transformed data (with correct copula)
gofTstat(u, method="Sn", copula=cop) # compute test statistic Sn; requires copula argument

Run the code above in your browser using DataLab