View source: R/cgeneric_pc_prec_correl.R
cgeneric_pc_prec_correl | R Documentation |
inla.cgeneric
to implement the PC-prior of a
precision matrix as inverse of a correlation matrix.Build an inla.cgeneric
to implement the PC-prior of a
precision matrix as inverse of a correlation matrix.
cgeneric_pc_prec_correl(
n,
lambda,
theta.base,
debug = FALSE,
useINLAprecomp = TRUE,
libpath = NULL
)
n |
integer to define the size of the matrix |
lambda |
numeric (positive), the penalization rate parameter |
theta.base |
numeric vector with the model parameters at the base model |
debug |
integer, default is zero, indicating the verbose level. Will be used as logical by INLA. |
useINLAprecomp |
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. |
libpath |
string, default is NULL, with the path to the shared object. |
The precision matrix parametrization step 1:
Q0 = \left[
\begin{array}{ccccc}
1 & & & & \\
\theta_1 & 1 & & & \\
\theta_2 & \theta_n & & & \\
\vdots & & \ldots & \ddots & \\
\theta_{n-1} & \theta_{2n-3} \ldots & \theta_m & 1
\end{array}
\right]
step 2: V = Q0^{-1}
step 3: S = diag(V)^{1/2}
step 4: C = SVS
step 5: Q = C^{-1}
p(Q|\lambda) = p(\theta[1:m] | lambda) =
p_C(C(Q)) | Jacobian C(Q) |
where p_C is the PC-prior for correlation, see section 6.2 of Simpson et. al. (2017), which is based on the hypersphere decomposition.
The hypershere decomposition, as proposed in
Rapisarda, Brigo and Mercurio (2007)
consider \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
B[i,j] = \left\{\begin{array}{cc}
cos(x[i,j]) & j=1 \\
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 \end{array}\right.
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]
a inla.cgeneric
, cgeneric()
object.
Daniel Simpson, H\aa vard Rue, Andrea Riebler, Thiago G. Martins and Sigrunn H. S\o rbye (2017). Penalising Model Component Complexity: A Principled, Practical Approach to Constructing Priors Statistical Science 2017, Vol. 32, No. 1, 1–28. <doi 10.1214/16-STS576>
Rapisarda, Brigo and Mercurio (2007). Parameterizing correlations: a geometric interpretation. IMA Journal of Management Mathematics (2007) 18, 55-73. <doi 10.1093/imaman/dpl010>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.