
R6 Class for mobility models
nomad_model_.RdA nomad mobility model
Methods
Method new()
Create a new nomad mobility model
Usage
nomad_model_$new(model, data_name, data_ref = NULL, data_fields = NULL)Arguments
modelmobility::mobility()modeldata_nameThe model's name to link to
nomad::mobility_dbdata_refOptional internal reference to shared package model data.
data_fieldsOptional character vector of shared data fields.
Method predict()
Arguments
newdataa list containing new data to used in model prediction. If
NULL(the default) the function will simulate the model with the data used for fitting. Seemobility::predict()nsimnumber of simulations (default = 1)
seedoptional integer specifying the call to
set.seedprior to model simulation (default =NULL)...further arguments passed to or from other methods
Details
When nsim = 1, the prediction matrix is calculated
using the mean point estimate of parameter values. If nsim > 1
then returns and array that contains nsim number of simulated
replications using independent, zero-truncated normal approximations
to the parameter summaries. See predict.nomad_model() for limitations.
Method remove_model_data()
Usage
nomad_model_$remove_model_data(
M = FALSE,
D = FALSE,
N_orig = FALSE,
N_dest = FALSE,
S = FALSE,
save_model_checks = FALSE,
...
)Arguments
MMobility Data
DDistance Data
N_origPopulation Origin Data
N_destPopulation Destination Data
SRadiation intervening opportunity matrix
save_model_checksLogical to save model check results. Default = FALSE
...further arguments passed to
png()for saving model check plot Get model object
Method get_model()
Arguments
hydrateIf
TRUE, attach any shared package data referenced by this model before returning it.
Returns
Underlying mobility::mobility() model
Get data name