f.RdFunction used for defining of smooth and spatial terms within inla model
formulae. The function does not evaluate anything - it
exists purely to help set up a model. The function specifies one
smooth function in the linear predictor (see inla.list.models()) as
$$w\ f(x)$$
f(
...,
model = "iid",
copy = NULL,
scopy = NULL,
same.as = NULL,
n = NULL,
nrep = NULL,
replicate = NULL,
ngroup = NULL,
group = NULL,
control.group = inla.set.control.group.default(),
control.scopy = inla.set.control.scopy.default(),
hyper = NULL,
initial = NULL,
prior = NULL,
param = NULL,
fixed = NULL,
season.length = NULL,
constr = NULL,
extraconstr = list(A = NULL, e = NULL),
values = NULL,
cyclic = NULL,
diagonal = NULL,
graph = NULL,
graph.file = NULL,
cdf = NULL,
quantiles = NULL,
Cmatrix = NULL,
rankdef = NULL,
Z = NULL,
nrow = NULL,
ncol = NULL,
nu = NULL,
bvalue = NULL,
spde.prefix = NULL,
spde2.prefix = NULL,
spde2.transform = c("logit", "log", "identity"),
spde3.prefix = NULL,
spde3.transform = c("logit", "log", "identity"),
mean.linear = inla.set.control.fixed.default()$mean,
prec.linear = inla.set.control.fixed.default()$prec,
compute = TRUE,
of = NULL,
precision = 10^8,
range = NULL,
adjust.for.con.comp = TRUE,
order = NULL,
scale = NULL,
rgeneric = NULL,
cgeneric = NULL,
scale.model = NULL,
args.slm = list(rho.min = NULL, rho.max = NULL, X = NULL, W = NULL, Q.beta = NULL),
args.ar1c = list(Z = NULL, Q.beta = NULL),
args.intslope = list(subject = NULL, strata = NULL, covariates = NULL),
vb.correct = TRUE,
locations = NULL,
debug = FALSE,
A.local = NULL
)Name of the covariate and, possibly of the weights vector. NB: order counts!!!! The first specified term is the covariate and the second one is the vector of weights (which can be negative).
A string indicating the chosen model. The
default is iid. See
names(inla.models()$latent) for a list of possible
alternatives and inla.doc() for detailed docs.
The name of the model-component to copy
The name of the model-component to smooth-copy (where the copy-function is a spline)
Can be used with copy="..". same.as="A" says
that this copy should use the same scaling parameter as another
copy "A"
An optional argument which defines the dimension
of the model if this is different from
length(sort(unique(covariate)))
Number of replications, if not given, then nrep=max(replications)
A vector of which replications to use.
Number of groups, if not given, then ngroup=max(group)
A vector of which groups to use.
Controls the use of group
Controls the use of scopy
Specification of the hyperparameter, fixed or
random, initial values, priors and its parameters. See
?inla.models for the list of hyparameters for each
model and its default options or
use inla.doc() for
detailed info on the family and
supported prior distributions.
THIS OPTION IS OBSOLETE, DO NOT USE
THIS OPTION IS OBSOLETE, DO NOT USE
THIS OPTION IS OBSOLETE, DO NOT USE
THIS OPTION IS OBSOLETE; DO NOT USE
Length of the seasonal component for model="seasonal"
A boolean variable indicating whater to set a sum to 0 constraint on the term. By default the sum to 0 constraint is imposed on all intrinsic models ("iid","rw1","rw1","besag", etc..).
This argument defines extra linear
constraints. The argument is a list with two elements, a
matrix A and a vector e, which defines the
extra constraint Ax = e; for example
extraconstr = list(A = A, e=e). The number of
columns of A must correspond to the length of this
f-model. Note that this constraint comes
additional to the sum-to-zero constraint defined if
constr = TRUE.
An optional vector giving all values
assumed by the covariate for which we want estimated the
effect. It must be a numeric vector, a vector of factors
or NULL.
A boolean specifying wheather the model is cyclical. Only valid for "rw1" and "rw2" models, is cyclic=T then the sum to 0 constraint is removed. For the correct form of the grah file see Martino and Rue (2008).
An extra constant added to the diagonal of the precision matrix to prevent numerical issues.
Defines the graph-object either as a file with
a graph-description, an inla.graph-object, or as a
(sparse) symmetric matrix .
THIS OPTION IS OBSOLETE, DO NOT USE
THIS OPTION IS OBSOLETE, DO NOT USE
A vector of maximum 10 quantiles, \(p(0), p(1),\dots\) to compute for each posterior marginal. The function returns, for each posterior marginal, the values \(x(0), x(1),\dots\) such that $$\mbox{Prob}(X<x(p))=p$$
The specification of the precision matrix
for the generic, generic3 or z models (up to a scaling constant).
Cmatrix is either a
(dense) matrix, a matrix created using
Matrix::sparseMatrix(), or a filename which stores the
non-zero elements of Cmatrix, in three columns:
i, j and Qij. In case of the generic3 model,
it is a list of such specifications.
A number defining the rank deficiency of the model, with sum-to-zero constraint and possible extra-constraints taken into account. See details.
The matrix for the z-model
Number of rows for 2d-models
Number of columns for 2d-models
Smoothing parameter for the Matern2d-model,
possible values are c(0, 1, 2, 3)
The boundary conditions for model rw2d, 0 means use
the correct subspace (default), while 1 means condition on 0's outside
Internal use only
Internal use only
Internal use only
Internal use only
Internal use only
Prior mean for model="linear"
Prior precision for model="linear"
A boolean variable indicating whether the
marginal posterior distribution for the nodes in the
f() model should be computed or not. This is
usefull for large models where we are only interested in
some posterior marginals.
Internal use only
The precision for the artificial noise added when creating a copy of a model and others.
A vector of size two giving the lower and
upper range for the scaling parameter beta in the
model COPY, CLINEAR, MEC and MEB.
If low = high then the identity mapping
is used.
If TRUE (default), adjust some of the models (currently: besag, bym, bym2 and besag2) if the number of connected components in graph is larger than 1. If FALSE, do nothing.
Defines the order of the model: for
model ar this defines the order p, in AR(p). Not
used for other models at the time being.
A scaling vector. Its meaning depends on the model.
A object of class inla.rgeneric.f,
which defines the model. Not needed if a inla.rgeneric model
object is supplied as the model argument. (EXPERIMENTAL!)
A object of class inla.cgeneric.f,
which defines the model. Not needed if a inla.cgeneric model
object is supplied as the model argument. (EXPERIMENTAL!)
Logical. If TRUE then scale the RW1 and RW2 and BESAG and BYM and BESAG2 and RW2D models so the their (generlized) variance is 1. Default value is inla.getOption("scale.model.default")
Required arguments to the model="slm"; see the documentation for further details.
Required arguments to the model="ar1c"; see the documentation for further details.
A list with the subject (factor), strata (factor) and covariates (numeric) for the intslope model; see the documentation for further details,
Add this model component to the list of nodes to be used for the (potential) vb correction? If TRUE do, and do not if FALSE. Can also be a vector of nodes to add in the correction-set.
A matrix with locations for the model dmatern. This also defines n.
Enable local debug output
Local A-matrix (experimental and in development, do not use)
TODO
There is no default value for rankdef, if it
is not defined by the user then it is computed by the rank
deficiency of the prior model (for the generic model, the
default is zero), plus 1 for the sum-to-zero constraint if the
prior model is proper, plus the number of extra
constraints. Oops: This can be wrong, and then the user
must define the rankdef explicitly.