Fitting linear mixed effects model with latent Whittle-Matern models.
rspde_lme(
formula,
loc,
loc_time = NULL,
data,
model = NULL,
repl = NULL,
which_repl = NULL,
optim_method = "L-BFGS-B",
use_data_from_graph = TRUE,
starting_values_latent = NULL,
start_sigma_e = NULL,
start_alpha = NULL,
alpha = NULL,
start_nu = NULL,
nu = NULL,
nu_upper_bound = 4,
rspde_order = NULL,
parallel = FALSE,
n_cores = parallel::detectCores() - 1,
optim_controls = list(),
improve_hessian = FALSE,
hessian_args = list()
)
A list containing the fitted model.
Formula object describing the relation between the response variables and the fixed effects. If the response variable is a matrix, each column of the matrix will be treated as a replicate.
A vector with the names of the columns in data
that contain the
observation locations, or a matrix
or a data.frame
containing the
observation locations. If the model is of class metric_graph
, the locations
must be either a matrix
or a data.frame
with two columns, or a character
vector with the names of the two columns. The first column being the number of
the edge, and the second column being the normalized position on the edge.
If the model is a 2d model, loc
must be either a matrix
or data.frame
with two columns or a character vector with the name of the two columns that
contain the location, the first entry corresponding to the x
entry and the
second corresponding to the y
entry.
For spatio-temporal models, the name of the column in data
that
is the time variable, or a matrix
or vector
containing the observation time
points.
A data.frame
containing the data to be used.
Object generated by matern.operators()
, spde.matern.operators()
or spacetime.operators()
. If NULL
, simple linear regression will be performed.
Vector indicating the replicate of each observation.
If NULL
it will assume there is only one replicate. If the model is generated from graphs from
metric_graph
class and use_data_from_graph
is TRUE
, repl
needs to be the name of the
column inside the metric graph data that contains the replicate. If NULL
it will assume there is only
one replicate.
Which replicates to use? If NULL
all replicates will be used.
The method to be used with optim
function.
Logical. Only for models generated from graphs from
metric_graph
class. In this case, should the data, the locations and the
replicates be obtained from the graph object?
A vector containing the starting values for the
latent model. If the latent model is generated by matern.operators()
, then
the vector should be on the form c(tau,kappa). If the model is generated by
spde.matern.operators()
, the vector should contain the nonstationary parameters.
If the model is generated by spacetime.operators()
, the vector should be on
the form c(kappa,sigma,gamma,rho).
Starting value for the standard deviation of the measurement error.
Starting value for the smoothness parameter of spatial
models. Will be used if start_nu
is not given. Not used for spatio-temporal
models.
If NULL
, the smoothness parameter will be estimated for spatial
models, otherwise it is kept fixed at the provided value. Will be used if nu
is not given. Not used for spatio-temporal models.
returned as component of the returned value.
Starting value for the smoothness parameter of spatial models. Not used for spatio-temporal models.
If NULL
, the smoothness parameter will be estimated for spatial
models, otherwise the smoothness parameter will be kept fixed at the provided
value. Not used for spatio-temporal models.
A parameter that limits the maximum value that nu can assume. Not used for spatio-temporal models.
The order of the rational approximation to be used while fitting the model. If not given, the order from the model object will be used. Not used for spatio-temporal models.
logical. Indicating whether to use optimParallel or not.
Number of cores to be used if parallel is true.
Additional controls to be passed to optim
or optimParallel
.
Should a more precise estimate of the hessian be obtained? Turning on might increase the overall time.
List of controls to be used if improve_hessian
is TRUE
.
The list can contain the arguments to be passed to the method.args
argument
in the numDeriv::hessian
function. See the help of the hessian
function in
numDeriv
package for details. Observe that it only accepts the "Richardson"
method for now, the method "complex" is not supported.