Learn R Programming

gofCopula (version 0.2-2)

gofco: Interface with copula class

Description

gofco is an interface with the copula package. It reads out the information from a copula class object and hands them over to a specified gof test or set of tests.

Usage

gofco(copulaobject, x, testset = c("gofPIOSRn", "gofKernel"), margins = "ranks", dispstr = "ex", M = 1000, execute.times.comp = T, m = 1, MJ = 100, delta.J = 0.5, nodes.Integration = 12, m_b = 0.5, zeta.m = 0, b_Rn = 0.05, processes = 1)

Arguments

copulaobject
An object with the copula class from the copula package.
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", "gofRosenblattChisq", "gofRosenblattGamma", "gofSn", "gofKendallCvM", "gofKendallKS", "gofWhite", "gofRn".
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 specified: "beta", "cauchy", Chi-squared ("chisq"), "f", "gamma", Log normal ("lnorm"), Normal ("norm"), "t", "weibull", Exponential ("exp").
dispstr
A character string specifying the type of the symmetric positive definite matrix characterizing the elliptical copula. Implemented structures are "ex" for exchangeable, "ar1" for AR(1), "toep" for Toeplitz, and "un" for unstructured, see package copula.
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.
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.
processes
The number of parallel processes which are performed to speed up the bootstrapping. Shouldn't be higher than the number of logical processors.

Value

A object of the class gofCOP with the components gofCOP with the components

Details

The function reads out the arguments in the copula class object. If the dependence parameter is not specified in the object, it is estimated. In case that the object describes a "t"-copula, then the same holds for the degrees of freedom. The dimension is not extracted from the object. It is obtained from the inserted dataset.

When more than one test shall be performed, the hybrid test is computed too.

References

Yan, Jun. Enjoy the joy of copulas: with a package copula. Journal of Statistical Software 21.4 (2007): 1-21.

Examples

Run this code
data(IndexReturns)
copObject = normalCopula()

gofco(copObject, x = IndexReturns[c(1:100),c(1:2)], testset = c("gofPIOSRn", "gofKernel"), M = 20)

Run the code above in your browser using DataLab