gofWhite {gofCopula} | R Documentation |
2 dimensional gof tests based on White's information matrix equality.
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
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
|
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 |
df |
The degrees of freedom, if not meant to be estimated. Only
necessary if tested for |
df.est |
Indicates if |
margins |
Specifies which estimation method for the margins shall be
used. The default is |
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 |
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 |
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 |
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
H_0 : \mathbf{V}(\theta) +
\mathbf{S}(\theta) = 0
where
\mathbf{V}(\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
A_{\theta_n}^{-1} \bar{d}(\theta_n)
with
\bar{d}(\theta_n) = \frac{1}{n}
\sum_{i=1}^n vech(\mathbf{V}_n(\theta_n|\mathbf{u}) +
\mathbf{S}_n(\theta_n|\mathbf{u})),
d(\theta_n) = vech(\mathbf{V}_n(\theta_n|\mathbf{u}) +
\mathbf{S}_n(\theta_n|\mathbf{u})),
A_{\theta_n} = \frac{1}{n} \sum_{i=1}^n (d(\theta_n) - D_{\theta_n}
\mathbf{V}_n(\theta_n)^{-1} \delta l(\theta_n))(d(\theta_n) - D_{\theta_n}
\mathbf{V}_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}.
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 |
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
data(IndexReturns2D)
gofWhite("normal", IndexReturns2D, M = 10)