inla.cgeneric
object to implement the
LKG prior for the correlation matrix.Build an inla.cgeneric
object to implement the
LKG prior for the correlation matrix.
cgeneric_LKJ(n, eta, debug = FALSE, useINLAprecomp = TRUE, libpath = NULL)
a inla.cgeneric
, cgeneric()
object.
integer to define the size of the matrix
numeric greater than 1, the parameter
integer, default is zero, indicating the verbose level. Will be used as logical by INLA.
logical, default is TRUE, indicating if it is to be used the shared object pre-compiled by INLA. This is not considered if 'libpath' is provided.
string, default is NULL, with the path to the shared object.
The parametrization uses the hypershere decomposition, as proposed in Rapisarda, Brigo and Mercurio (2007). consider \(\theta[k] \in [0, \infty], k=1,...,m=n(n-1)/2\) from \(\theta[k] \in [0, \infty], k=1,...,m=n(n-1)/2\) compute \(x[k] = pi/(1+exp(-theta[k]))\) organize it as a lower triangle of a \(n \times n\) matrix $$ | cos(x[i,j]) , j=1$$ $$B[i,j] = | cos(x[i,j])prod_{k=1}^{j-1}sin(x[i,k]), 2 <= j <= i-1$$ $$ | prod_{k=1}^{j-1}sin(x[i,k]) , j=i$$ $$ | 0 , j+1 <= j <= n $$ Result $$\gamma[i,j] = -log(sin(x[i,j]))$$ $$KLD(R) = \sqrt(2\sum_{i=2}^n\sum_{j=1}^{i-1} \gamma[i,j]$$
Rapisarda, Brigo and Mercurio (2007). Parameterizing correlations: a geometric interpretation. IMA Journal of Management Mathematics (2007) 18, 55-73. <doi 10.1093/imaman/dpl010>