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

Description Usage Arguments Details Value References Examples

View source: R/tests_White.R

Description

gofWhite tests a given 2 dimensional dataset for a copula with the gof test based on White's information matrix equality. The possible copulae are "normal", "t", "clayton", "gumbel", "frank" and "joe". See for reference Schepsmeier et al. (2015). The parameter estimation is performed with pseudo maximum likelihood method. In case the estimation fails, inversion of Kendall's tau is used. The margins can be estimated by a bunch of distributions and the time which is necessary for the estimation can be given. The approximate p-values are computed with a parametric bootstrap, which computation can be accelerated by enabling in-build parallel computation. The computation of the test statistic and p-values is performed by corresponding functions from the VineCopula package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
gofWhite(
  copula = c("normal", "t", "clayton", "gumbel", "frank", "joe"),
  x,
  param = 0.5,
  param.est = TRUE,
  df = 4,
  df.est = TRUE,
  margins = "ranks",
  flip = 0,
  M = 1000,
  lower = NULL,
  upper = NULL,
  seed.active = NULL,
  processes = 1
)

Arguments

copula

The copula to test for. Possible are the copulae "normal", "t", "clayton", "gumbel", "frank" and "joe".

x

A matrix containing the data with rows being observations and columns being variables.

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, if not meant to be estimated. Only necessary if tested for "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 for the margins shall be used. The default is "ranks", which is the standard approach to convert data in such a case. Alternatively the following distributions can be specified: "beta", "cauchy", Chi-squared ("chisq"), "f", "gamma", Log normal ("lnorm"), Normal ("norm"), "t", "weibull", Exponential ("exp"). Input can be either one method, e.g. "ranks", which will be used for estimation of all data sequences. Also an individual method for each margin can be specified, e.g. c("ranks", "norm", "t") for 3 data sequences. If one does not want to estimate the margins, set it to NULL.

flip

The control parameter to flip the copula by 90, 180, 270 degrees clockwise. Only applicable for bivariate copula. Default is 0 and possible inputs are 0, 90, 180, 270 and NULL.

M

Number of bootstrap samples.

lower

Lower bound for the maximum likelihood estimation of the copula parameter. The constraint is also active in the bootstrapping procedure. The constraint is not active when a switch to inversion of Kendall's tau is necessary. Default NULL.

upper

Upper bound for the maximum likelihood estimation of the copula parameter. The constraint is also active in the bootstrapping procedure. The constraint is not active when a switch to inversion of Kendall's tau is necessary. Default NULL.

seed.active

Has to be either an integer or a vector of M+1 integers. If an integer, then the seeds for the bootstrapping procedure will be simulated. If M+1 seeds are provided, then these seeds are used in the bootstrapping procedure. Defaults to NULL, then R generates the seeds from the computer runtime. Controlling the seeds is useful for reproducibility of a simulation study to compare the power of the tests or for reproducibility of an empirical study.

processes

The number of parallel processes which are performed to speed up the bootstrapping. Shouldn't be higher than the number of logical processors. Please see the details.

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

H0 : V(theta) + S(theta) = 0

where V(theta) is the expected Hessian matrix and S(theta) is the expected outer product of the score function.

The test statistic is derived by

T_n = n(dbar(theta_n))^T A_(theta_n)^(-1) dbar(theta_n)

with

dbar(theta_n) = 1/n sum(vech(V(theta_n|u) + S(theta_n|u)), i=1, ..., n),

d(theta_n) = vech(V(theta_n|u) + S(theta_n|u)),

Atheta_n] = 1/n sum(d(theta_n) - D(theta_n) V_n(theta_n)^(-1) d l(theta_n)d(theta_n) - D(theta_n) V_n(theta_n)^(-1) d l(theta_n)^T, i=1, ..., n)

and

D(theta_n = 1/n sum(d_(theta_k) d[l](theta_n)_(l=1, ...,(p(p+1))/2, k=1, ..., p), i=1, ..., n)

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

For small values of M, initializing the parallelisation via processes does not make sense. The registration of the parallel processes increases the computation time. Please consider to enable parallelisation just for high values of M.

Please note, the test gofWhite may be unstable for t-copula. Please handle the results carefully.

Value

An object of the class gofCOP with the components

method

a character which informs about the performed analysis

copula

the copula tested for

margins

the method used to estimate the margin distribution.

param.margins

the parameters of the estimated margin distributions. Only applicable if the margins were not specified as "ranks" or NULL.

theta

dependence parameters of the copulae

df

the degrees of freedem of the copula. Only applicable for t-copula.

res.tests

a matrix with the p-values and test statistics of the hybrid and the individual tests

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

Schepsmeier, U. and J. Stoeber (2014). Derivatives and Fisher information of bivariate copulas. Statistical Papers, 55(2), 525-542. https://link.springer.com/article/10.1007/s00362-013-0498-x

Stoeber, J. and U. Schepsmeier (2013). Estimating standard errors in regular vine copula models Computational Statistics, 28 (6), 2679-2707

Schepsmeier, U. (2015). Efficient information based goodness-of-fit tests for vine copula models with fixed margins. Journal of Multivariate Analysis 138, 34-52. Schepsmeier, U. (2014). A goodness-of-fit test for regular vine copula models.

Examples

1
2
3

gofCopula documentation built on April 22, 2021, 5:10 p.m.