View source: R/cgeneric_generic0.R
cgeneric_generic0 | R Documentation |
inla.cgeneric
to implement a
model whose precision has a conditional
precision parameter. See details.
This uses the cgeneric interface that can be used as a
model in a INLA
f()
model component.Build an inla.cgeneric
to implement a
model whose precision has a conditional
precision parameter. See details.
This uses the cgeneric interface that can be used as a
model in a INLA
f()
model component.
cgeneric_generic0(
R,
param,
constr = TRUE,
scale = TRUE,
debug = FALSE,
useINLAprecomp = TRUE,
libpath = NULL
)
cgeneric_iid(
n,
param,
constr = FALSE,
scale = TRUE,
debug = FALSE,
useINLAprecomp = TRUE,
libpath = NULL
)
R |
the structure matrix for the model definition. |
param |
length two vector with the parameters
where |
constr |
logical indicating if it is to add a sum-to-zero constraint. Default is TRUE. |
scale |
logical indicating if it is to scale the mnodel. See detais. |
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. |
n |
size of the model |
The precision matrix is defined as
Q = \tau R
where the structure matrix R is supplied by the user
and \tau
is the precision parameter.
Following Sørbie and Rue (2014), if scale = TRUE
the model is scaled so that
Q = \tau s R
where s
is the geometric mean of the diagonal
elements of the generalized inverse of R
.
s = \exp{\sum_i \log((R^{-})_{ii})/n}
If the model is scaled, the geometric mean of the
marginal variances, the diagonal of Q^{-1}
, is one.
Therefore, when the model is scaled,
\tau
is the marginal precision,
otherwise \tau
is the conditional precision.
a inla.cgeneric
, cgeneric()
object.
cgeneric_iid()
: The cgeneric_iid()
uses the cgeneric_generic0
with the structure matrix as the identity.
Sigrunn Holbek Sørbye and Håvard Rue (2014). Scaling intrinsic Gaussian Markov random field priors in spatial modelling. Spatial Statistics, vol. 8, p. 39-51.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.