R/RVineHessian.R
RVineHessian.Rd
This function calculates the Hessian matrix of the log-likelihood of a d-dimensional R-vine copula model with respect to the copula parameter and evaluates it on a given copula data set.
RVineHessian(data, RVM)
An N x d data matrix (with uniform margins).
An RVineMatrix()
object including the structure, the
pair-copula families, and the parameters.
Only the following copula
families are allowed in RVM$family
0
= independence copula 1
= Gaussian copula 2
= Student t copula (t-copula)3
= Clayton copula 4
= Gumbel copula 5
= Frank copula 6
= Joe copula 13
= rotated Clayton copula (180 degrees; survival Clayton'') \cr `14` = rotated Gumbel copula (180 degrees;
survival Gumbel'') 16
= rotated Joe copula (180 degrees; ``survival Joe'') 23
= rotated Clayton copula (90 degrees)
`24` = rotated Gumbel copula (90 degrees)
`26` = rotated Joe copula (90 degrees)
`33` = rotated Clayton copula (270 degrees)
`34` = rotated Gumbel copula (270 degrees)
`36` = rotated Joe copula (270 degrees)
The calculated Hessian matrix of the log-likelihood value of the R-vine copula model.
The product of the gradient vector with its transposed version.
The Hessian matrix is not available for R-vine copula models with two parameter Archimedean copulas, i.e. BB1, BB6, BB7, BB8 and their rotated versions.
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
Schepsmeier, U. and J. Stoeber (2014) Derivatives and Fisher information of bivariate copulas. Statistical Papers, 55(2), 525-542. online first: https://link.springer.com/article/10.1007/s00362-013-0498-x.
Web supplement: Derivatives and Fisher Information of bivariate copulas. https://mediatum.ub.tum.de/node?id=1119201
Stoeber, J. and U. Schepsmeier (2013). Estimating standard errors in regular vine copula models. Computational Statistics, 28 (6), 2679-2707 https://link.springer.com/article/10.1007/s00180-013-0423-8#.
# define 5-dimensional R-vine tree structure matrix
Matrix <- c(5, 2, 3, 1, 4,
0, 2, 3, 4, 1,
0, 0, 3, 4, 1,
0, 0, 0, 4, 1,
0, 0, 0, 0, 1)
Matrix <- matrix(Matrix, 5, 5)
# define R-vine pair-copula family matrix
family <- c(0, 1, 3, 4, 4,
0, 0, 3, 4, 1,
0, 0, 0, 4, 1,
0, 0, 0, 0, 3,
0, 0, 0, 0, 0)
family <- matrix(family, 5, 5)
# define R-vine pair-copula parameter matrix
par <- c(0, 0.2, 0.9, 1.5, 3.9,
0, 0, 1.1, 1.6, 0.9,
0, 0, 0, 1.9, 0.5,
0, 0, 0, 0, 4.8,
0, 0, 0, 0, 0)
par <- matrix(par, 5, 5)
# define second R-vine pair-copula parameter matrix
par2 <- matrix(0, 5, 5)
# define RVineMatrix object
RVM <- RVineMatrix(Matrix = Matrix, family = family,
par = par, par2 = par2,
names = c("V1", "V2", "V3", "V4", "V5"))
# simulate a sample of size 300 from the R-vine copula model
set.seed(123)
simdata <- RVineSim(300, RVM)
# compute the Hessian matrix of the first row of the data
out2 <- RVineHessian(simdata[1,], RVM)
out2$hessian
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] -0.20835529 0.600506359 -0.647786496 1.3836564 0.295496669
#> [2,] 0.60050636 4.561415817 2.843538595 4.7922232 0.029152110
#> [3,] -0.64778650 2.843538595 -0.406889590 -1.8820037 -0.011448628
#> [4,] 1.38365637 4.792223161 -1.882003719 -215.0854092 -8.179330186
#> [5,] 0.29549667 0.029152110 -0.011448628 -8.1793302 -0.907743917
#> [6,] -0.10271728 0.871015881 -0.342065691 -3.3111368 -0.020142347
#> [7,] -0.01578703 0.009626409 -0.003780487 0.5644751 0.003433822
#> [8,] -0.21060115 0.046926816 -0.018429117 2.7517032 0.016739194
#> [9,] -0.22170193 1.090100315 -0.428104614 0.3525682 0.002144747
#> [10,] -0.01356155 -1.409004629 0.553344839 15.9123751 0.096798351
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] -0.10271728 -0.015787031 -0.21060115 -0.221701930 -0.01356155
#> [2,] 0.87101588 0.009626409 0.04692682 1.090100315 -1.40900463
#> [3,] -0.34206569 -0.003780487 -0.01842912 -0.428104614 0.55334484
#> [4,] -3.31113679 0.564475121 2.75170316 0.352568244 15.91237509
#> [5,] -0.02014235 0.003433822 0.01673919 0.002144747 0.09679835
#> [6,] -0.13575833 0.010053493 0.04900877 0.006279360 0.28340480
#> [7,] 0.01005349 -0.099238982 -0.39629213 -0.032928908 0.14494818
#> [8,] 0.04900877 -0.396292130 -0.45095779 -0.160521830 0.70659334
#> [9,] 0.00627936 -0.032928908 -0.16052183 -0.230989188 0.09053388
#> [10,] 0.28340480 0.144948179 0.70659334 0.090533884 -1.72188179