# Log-likelihood of C- and D-vine copula models

### Description

This function calculates the log-likelihood of d-dimensional C- and D-vine copula models for a given copula data set.

### Usage

1 2 |

### Arguments

`data` |
An N x d data matrix (with uniform margins). |

`family` |
A d*(d-1)/2 integer vector of C-/D-vine pair-copula families with values |

`par` |
A d*(d-1)/2 vector of pair-copula parameters. |

`par2` |
A d*(d-1)/2 vector of second parameters for two parameter pair-copula families
(default: |

`type` |
Type of the vine model: |

### Details

Let *u=(u'_1,...,u'_N)'* be *d*-dimensional observations
with *u_i=(u_{i,1},...,u_{i,d})' in [0,1]^d*.
Then the log-likelihood of a C-vine copula is given by

*
loglik:=l_{CVine}(θ|u)=
∑_{i=1}^N ∑_{j=1}^{d-1} ∑_{k=1}^{d-j}
ln[c_{j,j+k|1,...,j-1}],
*

where

*
c_{j,j+k|1,...,j-1}:=c_{j,j+k|1:(j-1)}(F(u_{i,j}|u_{i,1},...,u_{i,j-1}),F(u_{i,j+k}|u_{i,1},...,u_{i,j-1})|θ_{j,j+k|1,...,j-1})
*

denote pair-copulas with parameter(s) *θ_{j,j+k|1,...,j-1}*.

Similarly, the log-likelihood of a *d*-dimensional D-vine copula is

*
loglik:=l_{DVine}(θ|u)=
∑_{i=1}^N ∑_{j=1}^{d-1} ∑_{k=1}^{d-j}
ln[c_{k,k+j|k+1,...,k+j-1}],
*

again with pair-copula densities denoted by

*
c_{k,k+j|k+1,...,k+j-1}:=
*

*
c_{k,k+j|k+1,...,k+j-1}(F(u_{i,k}|u_{i,k+1},...,u_{i,k+j-1}),F(u_{i,k+j}|u_{i,k+1},...,u_{i,k+j-1})|θ_{k,k+j|k+1,...,k+j-1}).
*

Conditional distribution functions in both expressions are obtained recursively using the relationship

*
h(u|v,θ) := F(u|v) =
\partial C_{uv_j|v_{-j}}(F(u|v_{-j}),F(v_j|v_{-j})) / \partial F(v_j|v_{-j}),
*

where *C_{uv_j|v_{-j}}* is a bivariate copula distribution function with parameter(s) *θ*
and *v_{-j}* denotes a vector with the *j*-th component *v_j* removed.
The notation of h-functions is introduced for convenience. For more details see Aas et al. (2009).

Note that both log-likelihoods can also be written as *loglik=∑_{k=1}^{d(d-1)/2}ll_{k}*,
where *ll_{k}* are the individual contributions to the log-likelihood of each pair-copula.

### Value

`loglik` |
The calculated log-likelihood value of the C- or D-vine copula model. |

`ll` |
An array of individual contributions to the log-likelihood
for each pair-copula. Note: |

`vv` |
The stored transformations (h-functions) which may be used for posterior updates. |

### Author(s)

Carlos Almeida, Ulf Schepsmeier

### References

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

### See Also

`BiCopHfunc`

, `CDVineMLE`

, `CDVineAIC`

, `CDVineBIC`

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ```
## Example 1: 3-dimensional D-vine model with Gaussian pair-copulas
data(worldindices)
Data = as.matrix(worldindices)[,1:3]
fam1 = c(1,1,1)
par1 = c(0.2,0.3,0.4)
# calculate the log-likelihood
logLik1 = CDVineLogLik(Data,fam1,par1,type=2)
# check the above formula
sum(logLik1$ll)
logLik1$loglik
## Example 2: 6-dimensional C-vine model with Student t pair-copulas
## with 5 degrees of freedom
data(worldindices)
Data = as.matrix(worldindices)
dd = dim(Data)[2]*(dim(Data)[2]-1)/2
fam2 = rep(2,dd)
par2 = rep(0.5,dd)
nu2 = rep(5,dd)
# calculate the log-likelihood
logLik2 = CDVineLogLik(Data,fam2,par2,nu2,type=1)
logLik2$loglik
## Example 3: 4-dimensional C-vine model with mixed pair-copulas
fam3 = c(5,1,3,14,3,2)
par3 = c(0.9,0.3,0.2,1.1,0.2,0.7)
nu3 = c(0,0,0,0,0,7)
# calculate the log-likelihood
logLik3 = CDVineLogLik(Data[,1:4],fam3,par3,nu3,type=2)
logLik3$loglik
``` |