A nomad mobility model

Methods


Method new()

Create a new nomad mobility model

Usage

nomad_model_$new(model, data_name)

Arguments

model

mobility::mobility() model

data_name

The model's name to link to nomad::mobility_db

Returns

A new nomad_model object. Prediction and simulation method for 'mobility.model' class

This function uses a fitted mobility.model object to simulate a connectivity matrix based on estimated parameters.


Method predict()

Usage

nomad_model_$predict(newdata, nsim, seed, ...)

Arguments

newdata

a 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. See mobility::predict()

nsim

number of simulations (default = 1)

seed

optional integer specifying the call to set.seed prior 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 based on the posterior distributions of each parameter.

Returns

a vector, matrix, or array containing predicted or simulated mobility values. Check coordinates

This function uses a fitted mobility.model object to simulate a connectivity matrix based on estimated parameters.


Method check_coordinates()

Usage

nomad_model_$check_coordinates(newdata)

Arguments

newdata

List of newdata that is passed to mobility::predict Remove data model was trained on


Method remove_model_data()

Usage

nomad_model_$remove_model_data(
  M = FALSE,
  D = FALSE,
  N_orig = FALSE,
  N_dest = FALSE,
  save_model_checks = FALSE,
  ...
)

Arguments

M

Mobility Data

D

Distance Data

N_orig

Population Origin Data

N_dest

Population Destination Data

save_model_checks

Logical to save model check results. Default = FALSE

...

further arguments passed to png() for saving model check plot Get model object


Method get_model()

Usage

nomad_model_$get_model()

Returns

Underlying mobility::mobility() model Get data name


Method get_data_name()

Usage

nomad_model_$get_data_name()

Returns

Data name Get check results


Method get_check_res()

Usage

nomad_model_$get_check_res()

Returns

Results of model check Set check results


Method set_check_res()

Usage

nomad_model_$set_check_res(check_res)

Arguments

check_res

Results of model check Get the model's name


Method get_model_name()

Usage

nomad_model_$get_model_name()

Returns

Model name