Learn R Programming

gofCopula (version 0.1-2)

gofKendallCvM: 2 dimensional gof test (Cramer-von Mises) based on Kendall's process

Description

gofKendallCvM is a wrapper for the function BiCopGofTest from the package VineCopula which extends its functionality. The margins can be estimated by a bunch of distributions and the time which is necessary for the estimation can be given. It tests a given 2 dimensional dataset for a copula based on Kendall's process with the Cramer-von Mises test statistic. The possible copulae are "gaussian", "gumbel", "clayton" and "frank". See for reference Genest et al. (2009). The parameter estimation is performed with pseudo maximum likelihood method.

Usage

gofKendallCvM(copula, x, param = 0, param.est = T, margins = "ranks", 
              M = 100, execute.times.comp = T)

Arguments

copula
The copula to test for. Possible are the copulae "gaussian", "clayton", "gumbel" and "frank".
x
A 2 dimensional matrix containing the residuals of the data.
param
The parameter to be used.
param.est
Shall be either TRUE or FALSE. TRUE means that param will be estimated with a maximum likelihood estimation.
margins
Specifies which estimation method shall be used in case that the input data are not in the range [0,1]. The default is "ranks", which is the standard approach to convert data in such a case. Alternatively can the following distributions be sp
M
Number of bootstrap samples.
execute.times.comp
Logical. Defines if the time which the estimation most likely takes shall be computed. It'll be just given if M is at least 100.

Value

  • A object of the class gofCOP with the components
  • methoda character which informs about the performed analysis
  • erg.testsa matrix with the p-value and test statistic of test

Details

With the pseudo observations $U_{ij}$ for $i = 1, \dots,n$, $j = 1, \dots,d$ and $\mathbf{u} \in [0,1]^d$ is the empirical copula given by $C_n(\mathbf{u}) = \frac{1}{n} \sum_{i = 1}^n \mathbf{I}(U_{i1} \leq u_1, \dots, U_{id} \leq u_d).$ Let the rescaled pseudo observations be $\mathbf{V}_1 = C_n(\mathbf{U}_1), \dots, \mathbf{V}_n = C_n(\mathbf{U}_n)$ and the distribution function of $\mathbf{V}$ shall be $K$. The estimated version is given by $$K_n(v) = \frac{1}{n} \sum_{i=1}^n \mathbf{I}(\mathbf{V}_i \leq v)$$ with $v \in [0,1]^d.$ The testable $H_0^{'}$ hypothesis is then $$K \in \mathcal{K}_0 = {K_{\theta} : \theta \in \Theta }$$ with $\Theta$ being an open subset of $R^p$ for an integer $p \geq 1$, see Genest et al. (2009). The resulting Cramer-von Mises test statistic is then given by $$T = n \int_0^1 (K_n(v) - K_{\theta_n})^2 d K_{\theta_n}(v).$$ Because $H_0^{'}$ consists of more distributions than the $H_0$ is the test not necessarily consistent. The approximate p-value is computed by the formula $$\frac{1}{M} \sum_{b=1}^M \mathbf{I}_{{T_b \leq T}}.$$

References

Christian Genest, Bruno Remillard, David Beaudoin (2009). Goodness-of-fit tests for copulas: A review and a power study. Insurance: Mathematics and Economics, Volume 44, Issue 2, April 2009, Pages 199-213, ISSN 0167-6687. http://dx.doi.org/10.1016/j.insmatheco.2007.10.005 Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler (2015). VineCopula: Statistical Inference of Vine Copulas. R package version 1.4.. https://cran.r-project.org/package=VineCopula

Examples

Run this code
data = cbind(rnorm(100), rnorm(100))

gofKendallCvM("gaussian", data, M = 1)

Run the code above in your browser using DataLab