graph_lme {MetricGraph} | R Documentation |
Metric graph linear mixed effects models
Description
Fitting linear mixed effects model in metric graphs. The random effects can be Gaussian Whittle-Matern fields, discrete Gaussian Markov random fields based on the graph Laplacian, as well as Gaussian random fields with isotropic covariance functions.
Usage
graph_lme(
formula,
graph,
model = list(type = "linearModel"),
which_repl = NULL,
optim_method = "L-BFGS-B",
possible_methods = c("Nelder-Mead", "L-BFGS-B"),
model_options = list(),
BC = 0,
previous_fit = NULL,
fix_coeff = FALSE,
parallel = FALSE,
n_cores = parallel::detectCores() - 1,
optim_controls = list(),
improve_hessian = FALSE,
hessian_args = list(),
check_euclidean = TRUE
)
Arguments
formula |
Formula object describing the relation between the response variables and the fixed effects. |
graph |
A |
model |
The random effects model that will be used (it also includes the
option of not having any random effects). It can be either a character,
whose options are 'lm', for linear models without random effects; 'WM1' and
'WM2' for Whittle-Matern models with |
which_repl |
Vector or list containing which replicates to consider in
the model. If |
optim_method |
The method to be used with |
possible_methods |
Which methods to try in case the optimization fails or the hessian is not positive definite. The options are 'Nelder-Mead', 'L-BFGS-B', 'BFGS', 'CG' and 'SANN'. By default only 'Nelder-Mead' and 'L-BFGS-B' are considered. |
model_options |
A list containing additional options to be used in the model. Currently, it is possible to fix parameters during the estimation or change the starting values of the parameters. The general structure of the elements of the list is |
BC |
For |
previous_fit |
An object of class |
fix_coeff |
If using a previous fit, should all coefficients be fixed at the starting values? |
parallel |
logical. Indicating whether to use |
n_cores |
Number of cores to be used if parallel is true. |
optim_controls |
Additional controls to be passed to |
improve_hessian |
Should a more precise estimate of the hessian be obtained? Turning on might increase the overall time. |
hessian_args |
List of controls to be used if |
check_euclidean |
Check if the graph used to compute the resistance distance has Euclidean edges? The graph used to compute the resistance distance has the observation locations as vertices. |
Value
A list containing the fitted model.