RVineGofTest(data, RVM, method = "White", statistic = "CvM",
B = 200, alpha = 2)
RVineMatrix
objects of the R-vine model under the null hypothesis.
Only the following copula families are allowed in RVM$family
due to restrictions in
"White"
= goodness-of-fit test based on White's information matrix equality (default)
"IR"
= goodness-of-fit test based on the information ratio
"Breymann"
= goodness"CvM"
= Cramer-von Mises test statistic (univariate for "Breymann"
, "Berg"
and "Berg2"
, multivariate for "ECP"
and "ECP2"
B = 200
)
For B = 0
the asymptotic p-value is returned if available, otherwise only the test statistic is returned.
WARNING: If B
is chosen too large, computations2,4,6,...
for the "Berg2"
goodness-of-fit test (default alpha = 2
)method = "White"
:B = 0
or bootstrapped for B > 0
method = "IR"
:method = "Breymann"
, method = "Berg"
and method = "Berg2"
:statistic
B = 0
or bootstrapped for B > 0
.
A asymptotic p-value is only available for the Anderson-Darling test statistic if the R-package ADGofTest
is loaded.
Furthermore, a asymptotic p-value can be calculated for the Kolmogorov-Smirnov test statistic. For the Cramer-von Mises no asymptotic p-value is available so far.method = "ECP"
and method = "ECP2"
:statistic
method = "White"
:
This goodness-of fit test uses the information matrix equality of White (1982) and was original investigated by Huang and Prokhorov (2011) for copulas.
Schepsmeier (2012) enhanced their approach to the vine copula case.
The main contribution is that under correct model specification the Fisher Information can be equivalently calculated as minus the expected Hessian matrix or as the expected outer product of the score function.
The null hypothesis is
$$H_0: \boldsymbol{H}(\theta) + \boldsymbol{C}(\theta) = 0$$
against the alternative
$$H_1: \boldsymbol{H}(\theta) + \boldsymbol{C}(\theta) \neq 0 ,$$
where $\boldsymbol{H}(\theta)$ is the expected Hessian matrix and $\boldsymbol{C}(\theta)$ is the expected outer product of the score function.
For the calculation of the test statistic we use the consistent maximum likelihood estimator $\hat{\theta}$ and the sample counter parts of $\boldsymbol{H}(\theta)$ and $\boldsymbol{C}(\theta)$.
The correction of the Covariance-Matrix in the test statistic for the uncertainty in the margins is skipped. The implemented test assumes that there is no uncertainty in the margins. The correction can be found in Huang and Prokhorov (2011) for bivariate copulas and in Schepsmeier (2013) for vine copulas. It involves multi-dimensional integrals.
method = "IR"
:
As the White test the information matrix ratio test is based on the expected Hessian matrix $\boldsymbol{H}(\theta)$ and the expected outer product of the score function $\boldsymbol{C}(\theta)$.
$$H_0: -\boldsymbol{H}(\theta)^{-1}\boldsymbol{C}(\theta) = I_{p}$$
against the alternative
$$H_1: -\boldsymbol{H}(\theta)^{-1}\boldsymbol{C}(\theta) \neq I_{p} .$$
The test statistic can then be calculated as
$$IR_n:=tr(\Phi(\theta))/p$$
with $\Phi(\theta)=-\boldsymbol{H}(\theta)^{-1}\boldsymbol{C}(\theta)$, $p$ is the number of parameters, i.e. the length of $\theta$, and $tr(A)$ is the trace of the matrix $A$
For details see Schepsmeier (2013)
method = "Breymann"
, method = "Berg"
and method = "Berg2"
:
These tests are based on the multivariate probability integral transform (PIT) applied in RVinePIT
. The multivariate data $y_{i}$ returned form the PIT are aggregated to univariate data by different aggregation functions $\Gamma(\cdot)$ in the sum
$$s_t=\sum_{i=1}^d \Gamma(y_{it}), t=1,...,n$$
In Breymann et al. (2003) the weight function is suggested as $\Gamma(\cdot)=\Phi^{-1}(\cdot)^2$, while in Berg and Bakken (2007) the weight function is either $\Gamma(\cdot)=|\cdot-0.5|$ (method="Berg"
) or $\Gamma(\cdot)=(\cdot-0.5)^{\alpha},\alpha=2,4,6,...$ (method="Berg2"
).
Furthermore, the "Berg"
and "Berg2"
test are based on the order statistics of the PIT returns.
See Berg and Bakken (2007) or Schepsmeier (2013) for details.
method = "ECP"
and method = "ECP2"
:
Both tests are test for $H_0: C \in C_0$ against $H_1: C \notin C_0$
where C denotes the (vine) copula distribution function and $C_0$ is a class of parametric
(vine) copulas with $\Theta\subseteq R^p$ being the parameter space of dimension p.
They are based on the empirical copula process (ECP)
$$\hat{C}_n(u)-C_{\hat{\theta}_n}(u),$$
with $u=(u_1,\ldots,u_d)\in[0,1]^d$ and $\hat{C}_n(u) = \frac{1}{n+1}\sum_{t=1}^n \boldsymbol{1}_{{U_{t1}\leq u_1,\ldots,U_{td}\leq u_d }}$.
The ECP is utilized in a multivariate Cramer-von Mises (CvM) or multivariate Kolmogorov-Smirnov (KS) based test statistic.
An extension of the ECP-test is the
combination of the multivariate PIT approach with the ECP. The general idea is that
the transformed data of a multivariate PIT should be "close" to the independence
copula Genest et al. (2009). Thus a distance of CvM or KS type between them
is considered. This approach is called ECP2. Again we refer to Schepsmeier (2013) for details.BiCopGofTest
, RVinePIT
# time-consuming example
# load data set
data(daxreturns)
# select the R-vine structure, families and parameters
RVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6))
# White test with asymptotic p-value
RVineGofTest(daxreturns[,1:5], RVM, B = 0)
# ECP2 test with Cramer-von-Mises test statistic and a bootstrap
# with 200 replications for the calculation of the p-value
RVineGofTest(daxreturns[,1:5], RVM, method = "ECP2",
statistic = "CvM", B = 200)
Run the code above in your browser using DataLab