Learn R Programming

vines (version 1.1.5)

vineGoF: Vine Goodness-of-fit Tests

Description

Goodness-of-fit tests to verify whether the dependence structure of a sample is appropriately modeled by vine model.

Usage

vineGoF(vine, data, method = "PIT", ...)

Arguments

vine
A Vine object.
data
Data matrix of pseudo-observations.
method
Goodness-of-fit method. Supported values: "PIT" (Probability Integral Transform).
...
Additional arguments for the goodness-of-fit method.

Value

A vineGoF or a subclass with specific information about the goodness-of-fit method used. The statistic slot of this object contains the value of the statistic and pvalue the p-value.

Details

The "PIT" (Probability Integral Transform) method uses the vinePIT function to transform the data into variables which are independent and Uniform(0,1) and then use a hypothesis test to verify whether the resulting variables are independent and Uniform(0,1). The additional parameter statistic specifies the test to be applied for this purpose.

References

Aas, K. and Czado, C. and Frigessi, A. and Bakken, H. (2009) Pair-copula constructions of multiple dependence. Insurance: Mathematics and Economics 44, 182--198.

Breymann, W. and Dias, A. and Embrechts, P. (2003) Dependence structures for multivariate high-frequency data in finance. Quantitative Finance 1, 1--14.

See Also

vineGoF, vinePIT.

Examples

Run this code
copula <- normalCopula(c(-0.25, -0.21, 0.34, 0.51, -0.07, -0.18), 
                       dispstr = "un", dim = 4)
data <- rCopula(100, copula)

selectCopula <- function (vine, j, i, x, y) {
    data <- cbind(x, y)
    fit <- fitCopula(normalCopula(), data, method = "itau")
    fit@copula
}
normalCVine <- vineFit("CVine", data, method = "ml",
                       selectCopula = selectCopula,
                       optimMethod = "")@vine
normalDVine <- vineFit("DVine", data, method = "ml",
                       selectCopula = selectCopula,
                       optimMethod = "")@vine
show(normalCVine)
show(normalDVine)

normalCVineGof <- vineGoF(normalCVine, data, method = "PIT",
                          statistic = "Breymann")
normalDVineGof <- vineGoF(normalDVine, data, method = "PIT",
                          statistic = "Breymann")
show(normalCVineGof)
show(normalDVineGof)

Run the code above in your browser using DataLab