| inla {INLA} | R Documentation |
Bayesian analysis of structured additive models
Description
inla performs a full Bayesian analysis of additive models using
Integrated Nested Laplace approximation
Usage
inla(
formula = NULL,
family = "gaussian",
contrasts = NULL,
data = NULL,
quantiles = c(0.025, 0.5, 0.975),
E = NULL,
offset = NULL,
scale = NULL,
weights = NULL,
Ntrials = NULL,
strata = NULL,
lp.scale = NULL,
link.covariates = NULL,
verbose = inla.getOption("verbose"),
lincomb = NULL,
selection = NULL,
control.compute = list(),
control.predictor = list(),
control.family = list(),
control.inla = list(),
control.fixed = list(),
control.mode = list(),
control.expert = list(),
control.hazard = list(),
control.lincomb = list(),
control.update = list(),
control.lp.scale = list(),
control.pardiso = list(),
control.stiles = list(),
control.taucs = list(),
control.numa = list(),
only.hyperparam = FALSE,
inla.call = inla.getOption("inla.call"),
inla.arg = inla.getOption("inla.arg"),
num.threads = inla.getOption("num.threads"),
keep = inla.getOption("keep"),
working.directory = inla.getOption("working.directory"),
silent = inla.getOption("silent"),
inla.mode = inla.getOption("inla.mode"),
safe = inla.getOption("safe"),
debug = inla.getOption("debug"),
.parent.frame = environment(formula)
)
Arguments
formula |
A |
family |
A string indicating the likelihood family. The default is
|
contrasts |
Optional contrasts for the fixed effects; see |
data |
A data frame or list containing the variables in the model. The data frame MUST be provided |
quantiles |
A vector of quantiles,
|
E |
Known component in the mean for the Poisson likelihoods defined as
where
is the linear
predictor. If not provided it is set to |
offset |
This argument is used to specify an a-priori known and fixed
component to be included in the linear predictor during fitting. This
should be |
scale |
Fixed (optional) scale parameters of the precision for Gaussian
and Student-T response models. Default value is |
weights |
Fixed (optional) weights parameters of the likelihood, so the
|
Ntrials |
A vector containing the number of trials for the
|
strata |
Fixed (optional) strata indicators for tstrata likelihood model and similar. The documentation for each likelihood will inform if this argument is required. |
lp.scale |
A vector with same length as the predictor going into the
likelihood with either |
link.covariates |
A vector or matrix with covariates for link functions |
verbose |
Boolean indicating if the |
lincomb |
Used to define linear combination of nodes in the latent
field. The posterior distribution of such linear combination is computed by
the |
selection |
This is a similar argument to the one in
|
control.compute |
See |
control.predictor |
See |
control.family |
See |
control.inla |
See |
control.fixed |
See |
control.mode |
See |
control.expert |
See |
control.hazard |
See |
control.lincomb |
See |
control.update |
See |
control.lp.scale |
See |
control.pardiso |
See |
control.stiles |
See |
control.taucs |
See |
control.numa |
See |
only.hyperparam |
If |
inla.call |
The path to, or the name of, the |
inla.arg |
A string indicating ALL arguments to the 'inla' program and do not include default arguments. (This is an expert option and not intended for normal usage.) |
num.threads |
Maximum number of threads the |
keep |
A boolean variable indicating that the working files (ini file,
data files and results files) should be kept. If TRUE and no
|
working.directory |
A string giving the name of an non-existing
directory where to store the model-files. Sometimes this argument is
required if the temporary directory returned with |
silent |
If equal to 1L or TRUE, then the |
inla.mode |
Run |
safe |
If |
debug |
If |
.parent.frame |
Internal use only |
Value
inla returns an object of class "inla". This is a
list containing at least the following arguments:
summary.fixed |
Matrix containing the mean and standard deviation (plus, possibly quantiles and cdf) of the the fixed effects of the model. |
marginals.fixed |
A list containing the posterior marginal densities of the fixed effects of the model. |
summary.random |
List of matrices
containing the mean and standard deviation (plus, possibly quantiles and
cdf) of the the smooth or spatial effects defined through |
marginals.random |
A list containing the posterior marginal densities
of the random effects defined through |
summary.hyperpar |
A matrix containing the mean and sd (plus, possibly quantiles and cdf) of the hyperparameters of the model |
marginals.hyperpar |
A list containing the posterior marginal densities of the hyperparameters of the model. |
summary.linear.predictor |
A matrix containing the mean and sd (plus,
possibly quantiles and cdf) of the linear predictors |
marginals.linear.predictor |
If |
summary.fitted.values |
A matrix containing the mean and sd (plus, possibly quantiles and cdf) of
the fitted values |
marginals.fitted.values |
If
|
summary.lincomb |
If |
marginals.lincomb |
If |
selection |
Provide
the approximated joint distribution for the |
dic |
If
|
cpo |
If |
po |
If |
residuals |
If |
waic |
If
|
mlik |
If |
neffp |
Expected effective number of parameters in the model. The standard deviation of the expected number of parameters and the number of replicas for parameter are also returned |
mode |
A list of
two elements: |
call |
The matched call. |
formula |
The formula supplied |
nhyper |
The number of hyperparameters in the model |
cpu.used |
The cpu time used by the |
Author(s)
Havard Rue hrue@r-inla.org and Sara Martino