inla.cgeneric
class, short cgeneric
,
to define a INLA::cgeneric()
latent modelThis organize data needed on the C interface for building latent models, which are characterized from a given model parameters \(\theta\) and the the following model elements.
graph
to define the non-zero precision matrix pattern.
only the upper triangle including the diagonal is needed.
The order should be by line.
Q
vector where the
first element (N) is the size of the matrix,
second element (M) is the number of non-zero elements in the upper part (including) diagonal
the remaining (M) elements are the actual precision (upper triangle plus diagonal) elements whose order shall follow the graph definition.
mu
the mean vector,
initial
vector with
first element as the number of the parameters in the model
remaining elements should be the initials for the model parameters.
log.norm.const
log of the normalizing constant.
log.prior
log of the prior for the model parameters.
See details in INLA::cgeneric()
cgeneric(model, ...)# S3 method for default
cgeneric(model, debug = FALSE, useINLAprecomp = TRUE, libpath = NULL, ...)
# S3 method for character
cgeneric(model, ...)
cgeneric_get(
model,
cmd = c("graph", "Q", "initial", "mu", "log_prior"),
theta,
optimize = TRUE
)
initial(model)
# S3 method for inla.cgeneric
initial(model)
mu(model, theta)
# S3 method for inla.cgeneric
mu(model, theta)
prior(model, theta)
# S3 method for inla.cgeneric
prior(model, theta)
graph(model, ...)
# S3 method for inla.cgeneric
graph(model, ...)
Q(model, ...)
# S3 method for inla.cgeneric
prec(model, ...)
# S3 method for graphpcor
cgeneric(...)
# S4 method for inla.cgeneric,inla.cgeneric
kronecker(X, Y, FUN = "*", make.dimnames = FALSE, ...)
# S3 method for treepcor
cgeneric(...)
a inla.cgeneric
, cgeneric()
object.
depends on cmd
an object inla.cgeneric
object.
arguments passed on.
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.
an string to specify which model element to get
numeric vector with the model parameters.
If missing, the initial()
will be used.
logical. If missing or FALSE, the graph and precision are as a sparse matrix. If TRUE, graph only return the row/col indexes and precision return only the elements as a vector.
inla.cgeneric
or inla.rgeneric
inla.cgeneric
or inla.rgeneric
see kronecker
see kronecker
cgeneric(default)
: This calls INLA::inla.cgeneric.define()
cgeneric(character)
: Method for when model
is a character.
E.g. cgeneric(model = "generic0")
calls cgeneric_generic0
cgeneric(graphpcor)
: The cgeneric
method for graphpcor
uses cgeneric_graphpcor()
cgeneric(treepcor)
: The cgeneric
method for treepcor
, uses cgeneric_treepcor()
cgeneric_get()
: cgeneric_get
is an internal function used by
graph
, prec
, initial
, mu
or prior
methods for inla.cgeneric
initial()
: Retrieve the initial model parameter(s).
initial(inla.cgeneric)
: Retrive the initial parameter(s) of an inla.cgeneric
model.
mu()
: Evaluate the mean.
mu(inla.cgeneric)
: Evaluate the mean for an inla.cgeneric
model.
prior()
: Evaluate the log-prior.
prior(inla.cgeneric)
: Evaluate the prior for an inla.cgeneric
model
graph()
: Retrieve the graph
graph(inla.cgeneric)
: Retrieve the graph of an inla.cgeneric
object
Q()
: Evaluate prec()
on a model
prec(inla.cgeneric)
: Evaluate prec()
on an inla.cgeneric
object
kronecker(X = inla.cgeneric, Y = inla.cgeneric)
: Kronecker (product) between two inla.cgeneric
models as
a method for kronecker()
INLA::cgeneric()