Learn R Programming

gofCopula (version 0.1-2)

gofHybrid: Hybrid gof test

Description

gofHybrid combines all tests in this package to perform the hybrid test presented in Zhang et al. (2015). The test gives the possibility to combine several single tests which is helpful since in different test scenarios are different tests the most powerful.

Usage

gofHybrid(copula, x, testset = c("gofPIOSRn", "gofKernel"), margins = "ranks", 
          M = 1000, execute.times.comp = T, param = 0.5, param.est = T, df = 4, 
          df.est = T, m = 1, MJ = 100, delta.J = 0.5, nodes.Integration = 12, 
          m_b = 0.5, zeta.m = 0, b_Rn = 0.05)

Arguments

copula
The copula to test for. Possible are "gaussian", "t", "clayton", "gumbel" and "frank".
x
A matrix containing the residuals of the data. Take into account that the dimension of the matrix must fit the required dimensions from the single tests.
testset
The tests to be used. Possible are "gofPIOSRn", "gofPIOSTn", "gofKernel", "gofRosenblattSnB", "gofRosenblattSnC", "gofADChisq", "gofADGamma", "gofSn",
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 bootstrapping samples in the single tests.
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.
param
The copulae parameters to use for each test, if it shall not be estimated.
param.est
Shall be either TRUE or FALSE. TRUE means that param will be estimated.
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.
m
Length of blocks. Only necessary if the test gofPIOSTn is part of testset.
MJ
Size of bootstrapping sample. Only necessary if the test gofKernel is part of testset.
delta.J
Scaling parameter for the matrix of smoothing parameters. Only necessary if the test gofKernel is part of testset.
nodes.Integration
Number of knots of the bivariate Gauss-Legendre quadrature. Only necessary if the test gofKernel is part of testset.
m_b
The power of the statistic. Only necessary if the test gofRn is part of testset.
zeta.m
The adjustment parameter. Only necessary if the test gofRn is part of testset.
b_Rn
The bandwidth for the estimation of the first-order partial derivatives based on the empirical copula. Only necessary if the test gofRn is part of testset.

Value

  • A object of the class gofCOP with the components
  • methoda character which informs about the performed analysis
  • erg.testsa matrix with the p-values and test statistics of the hybrid and the individual tests

Details

In most of scenarios for goodness-of-fit tests, including the one for copula models (e.g. Genest et al. (2009)) there exists no single dominate optimal test. Zhang et al. (2015) proposed a hybrid test which performed in their simulation study more desirably compared to the applied single tests. The p-value is a combination of the single tests in the following way: $$p_n^{hybrid} = q \cdot \min{(p_n^{(1)}, \dots, p_n^{(q)})}$$ where $q$ is the number of tests and $p_n^{(i)}$ the p-value of the test $i$. It is ensured that the hybrid test is consistent as long as at least one of the tests is consistent. The computation of the individual p-values is performed as described in the details of this tests. Note that the derivation differs.

References

Zhang, S., Okhrin, O., Zhou, Q., and Song, P.. Goodness-of-fit Test For Specification of Semiparametric Copula Dependence Models. under revision in Journal of Econometrics from 15.01.2014 http://sfb649.wiwi.hu-berlin.de/papers/pdf/SFB649DP2013-041.pdf 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

Examples

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

gofHybrid("gaussian", data, testset = c("gofRosenblattSnB", "gofRosenblattSnC"), M = 10)

Run the code above in your browser using DataLab