Negative log-likelihood for Hüsler-Reiss graphical models
likelihood.Rd
The penalised negative loglikelihood of the Hüsler-Reiss graphical models can be written as follow : $$ L_{\mathcal P}^{(n)}(\Theta, \lambda) = \underbrace{-\log(|\Theta|_+) - \frac 12 \text{tr}(\hat \Gamma^{(n)}\Theta)}_{L^{(n)}(\Theta)} + \lambda \underbrace{\sum_{i<j} w_{ij} d^2_{ij}(\Theta)}_{\mathcal P(\Theta)} $$ where \(|\cdot|_+\) is the generalised determinant, \(n\) is the sample size, \(\hat \Gamma^{(n)}\) an estimation of the variogram matrix \(\Gamma\) and \(w_{ij}>0\) the weights.
Value
For neg_likelihood()
, it produces a function with two parameters :
R the \(K \times K\) clusters matrix
clusters a list of indices associated to a partition of \(V\) and compute the value of the non penalised negative log-likelihood \(L^{(n)}(\Theta)\).
For penalty()
, it produces a function with two parameters :
R the \(K \times K\) clusters matrix
clusters a list of indices associated to a partition of \(V\) and compute the value of the penalty \(\mathcal P(\Theta)\).
For neg_likelihood_pen()
, it produces a function with three parameters :
R : the \(K \times K\) clusters matrix
clusters : a list of indices associated to a partition of \(V\)
lambda : a positive number, the weight of the penalty. and compute the value of the penalised negative log-likelihood \(L_{\mathcal P}^{(n)}(\Theta, \lambda)\).
Details
We use the block matrix structure to compute the likelihood here (see build_theta()
and
extract_R_matrix()
), that is why we use two parameters for the computation
instead of only one matrix \(\Theta\).
Examples
############################################################
# INITIALIZATION
############################################################
# Block matrix structure
R <- matrix(c(0.5, -1,
-1, -1), nr = 2)
clusters <- list(c(1,3), c(2,4))
# Weight matrix
W <- matrix(c(0, 1, 1, 1,
1, 0, 1, 1,
1, 1, 0, 1,
1, 1, 1, 0), nc = 4)
# Random variogram
gamma <- matrix(c(0, 2, 1, 0,
2, 0, 4, 1,
1, 4, 0, 7,
0, 1, 7, 0), nc = 4)
# Regularization parameter
lambda <- 2.5
############################################################
# NEGATIVE LOG-LIKEHOOD
############################################################
nllh <- neg_likelihood(gamma)
nllh(R, clusters)
#> [1] 10.72741
############################################################
# PENALTY
############################################################
pen <- penalty(W)
pen(R, clusters)
#> [1] 18
############################################################
# PENALISED NEGATIVE LOG-LIKELIHOOD
############################################################
nllh_pen <- neg_likelihood_pen(gamma, W)
nllh_pen(R, clusters, lambda)
#> [1] 55.72741