Learn R Programming

gofCopula (version 0.1-2)

gofWhite: 2 dimensional gof tests based on White's information matrix equality.

Description

gofWhite 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 with the gof test based on White's information matrix equality. The possible copulae are "gaussian", "t", "gumbel", "clayton" and "frank". See for reference Schepsmeier et al. (2015). The parameter estimation is performed with pseudo maximum likelihood method.

Usage

gofWhite(copula, x, M = 1000, param = 0, param.est = T, df = 0, df.est = T, 
          margins = "ranks", execute.times.comp = T)

Arguments

copula
The copula to test for. Possible are the copulae "gaussian", "t", "clayton", "gumbel" and "frank".
x
A 2 dimensional matrix containing the residuals of the data.
M
Number of bootstrap samples.
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.
df
The degrees of freedom for the "t"-copula.
df.est
Indicates if df shall be estimated. Has to be either FALSE or TRUE, where TRUE means that it will be estimated.
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
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

The details are obtained from Schepsmeier et al. (2015) who states that this test uses the information matrix equality of White (1982). Under correct model specification is the Fisher Information equivalently calculated as minus the expected Hessian matrix or as the expected outer product of the score function. The null hypothesis is $$H_0 : \mathbf{H}(\theta) + \mathbf{S}(\theta) = 0$$ where $\mathbf{H}(\theta)$ is the expected Hessian matrix and $\mathbf{S}(\theta)$ is the expected outer product of the score function. The test statistic is derived by $$T_n = n(\bar{d}(\theta_n))^\top V_{\theta_n}^{-1} \bar{d}(\theta_n)$$ with $$\bar{d}(\theta_n) = \frac{1}{n} \sum_{i=1}^n vech(\mathbf{H}_n(\theta_n|\mathbf{u}) + \mathbf{S}_n(\theta_n|\mathbf{u})),$$ $$d(\theta_n) = vech(\mathbf{H}_n(\theta_n|\mathbf{u}) + \mathbf{S}_n(\theta_n|\mathbf{u})),$$ $$V_{\theta_n} = \frac{1}{n} \sum_{i=1}^n (d(\theta_n) - D_{\theta_n} \mathbf{H}_n(\theta_n)^{-1} \delta l(\theta_n))(d(\theta_n) - D_{\theta_n} \mathbf{H}_n(\theta_n)^{-1} \delta l(\theta_n))^\top$$ and $$D_{\theta_n} = \frac{1}{n} \sum_{i=1}^n [\delta_{\theta_k} d_l(\theta_n)]_{l=1, \dots, \frac{p(p+1)}{2}, k=1, \dots, p}$$ where $l(\theta_n)$ represents the log likelihood function and $p$ is the length of the parameter vector $\theta$. The test statistic will be rejected if $$T > (1 - \alpha) (\chi^2_{p(p+1)/2})^{-1}.$$

References

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))

gofWhite("gaussian", data)

Run the code above in your browser using DataLab