Learn R Programming

CDVine (version 1.4)

CDVineLogLik: 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

CDVineLogLik(data, family, par, 
             par2=rep(0,dim(data)[2]*(dim(data)[2]-1)/2), type)

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 0 = independence copula 1 = Gaussian copula 2 = Student t copula (t-copula) 3 = Clayton copula 4 = Gumbel copula
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: par2 = rep(0,dim(data)[2]*(dim(data)[2]-1)/2)).
type
Type of the vine model: 1 or "CVine" = C-vine 2 or "DVine" = D-vine

Value

  • loglikThe calculated log-likelihood value of the C- or D-vine copula model.
  • llAn array of individual contributions to the log-likelihood for each pair-copula. Note: loglik = sum(ll).
  • vvThe stored transformations (h-functions) which may be used for posterior updates.

Details

Let $\boldsymbol{u}=(\boldsymbol{u}_1^\prime,...,\boldsymbol{u}_N^\prime)^\prime$ be $d$-dimensional observations with $\boldsymbol{u}_i=(u_{i,1},...,u_{i,d})^\prime\in[0,1]^d,\ i=1,...,N$. Then the log-likelihood of a C-vine copula is given by $$\texttt{loglik}:=l_{CVine}\left(\boldsymbol{\theta}|\boldsymbol{u}\right)= \sum_{i=1}^N \sum_{j=1}^{d-1} \sum_{k=1}^{d-j} \ln\left[c_{j,j+k|1,...,j-1}\right],$$ 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})|\boldsymbol{\theta}_{j,j+k|1,...,j-1})$$ denote pair-copulas with parameter(s) $\boldsymbol{\theta}_{j,j+k|1,...,j-1}$. Similarly, the log-likelihood of a $d$-dimensional D-vine copula is $$\texttt{loglik}:=l_{DVine}\left(\boldsymbol{\theta}|\boldsymbol{u}\right)= \sum_{i=1}^N \sum_{j=1}^{d-1} \sum_{k=1}^{d-j} \ln\left[c_{k,k+j|k+1,...,k+j-1}\right],$$ 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})|\boldsymbol{\theta}_{k,k+j|k+1,...,k+j-1}).$$ Conditional distribution functions in both expressions are obtained recursively using the relationship $$h(u|\boldsymbol{v},\boldsymbol{\theta}) := F(u|\boldsymbol{v}) = \frac{\partial C_{uv_j|\boldsymbol{v}_{-j}}(F(u|\boldsymbol{v}_{-j}),F(v_j|\boldsymbol{v}_{-j}))}{\partial F(v_j|\boldsymbol{v}_{-j})},$$ where $C_{uv_j|\boldsymbol{v}_{-j}}$ is a bivariate copula distribution function with parameter(s) $\boldsymbol{\theta}$ and $\boldsymbol{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 $\texttt{loglik}=\sum_{k=1}^{d(d-1)/2}ll_{k}$, where $ll_{k}$ are the individual contributions to the log-likelihood of each pair-copula.

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

Run this code
## 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

Run the code above in your browser using DataLab