xvCopula {copula} | R Documentation |
k
-fold cross-validationComputes the leave-one-out cross-validation criterion (or a
k
-fold version of it) for the hypothesized parametric copula
family using, by default, maximum pseudo-likelihood estimation. The
leave-one-out criterion is a crossvalidated log likelihood, denoted
xv^n, defined in
equation (42) of Grønneberg and Hjort (2014).
For k < n, n the sample size, the k
-fold version
uses k randomly chosen (almost) equally sized data blocks
instead of n. When n is large, k-fold is
considerably faster (if k is “small” compared to n).
xvCopula(copula, x, k = NULL, verbose = interactive(), ...)
copula |
object of class |
x |
a data matrix that will be transformed to pseudo-observations. |
k |
the number of data blocks; if |
verbose |
a logical indicating if progress of the cross validation
should be displayed via |
... |
additional arguments passed to |
A real number equal to the cross-validation criterion multiplied by the sample size.
Note that k
-fold cross-validation with k < n
shuffles the lines of x
prior to forming the blocks. The
result thus depends on the value of the random seed.
The default estimation method is maximum pseudo-likelihood estimation
but this can be changed if necessary along with all the other
arguments of fitCopula()
.
Grønneberg, S., and Hjort, N.L. (2014) The copula information criteria. Scandinavian Journal of Statistics 41, 436–459.
fitCopula()
for the underlying estimation procedure and
gofCopula()
for goodness-of-fit tests.
## A two-dimensional data example ---------------------------------- x <- rCopula(200, claytonCopula(3)) ## Model (copula) selection -- takes time: each fits 200 copulas to 199 obs. xvCopula(gumbelCopula(), x) xvCopula(frankCopula(), x) xvCopula(joeCopula(), x) xvCopula(claytonCopula(), x) xvCopula(normalCopula(), x) xvCopula(tCopula(), x) xvCopula(plackettCopula(), x) ## The same with 10-fold cross-validation set.seed(1) # k-fold is random (for k < n) ! xvCopula(gumbelCopula(), x, k=10) xvCopula(frankCopula(), x, k=10) xvCopula(joeCopula(), x, k=10) xvCopula(claytonCopula(), x, k=10) xvCopula(normalCopula(), x, k=10) xvCopula(tCopula(), x, k=10) xvCopula(plackettCopula(),x, k=10)