Given two or more mobility.model objects, this function will parse out model information and goodness of fit metrics produced by the check function and return them side by side for comparison.

compare(object)

Arguments

object

a list of mobility.model objects

Value

a dataframe where the rows contain basic model information along with goodness of fit metrics for each model

See also

Author

John Giles

Examples

mods <- list( mobility(data=mobility_matrices, model='gravity', type='power', DIC=TRUE), mobility(data=mobility_matrices, model='radiation', type='basic'), mobility(data=mobility_matrices, model='departure-diffusion', type='power', DIC=TRUE) )
#> ::Fitting power gravity model for 10 origins and 10 destinations::
#> Compiling model graph #> Resolving undeclared variables #> Allocating nodes #> Graph information: #> Observed stochastic nodes: 70 #> Unobserved stochastic nodes: 34 #> Total graph size: 439 #> #> Initializing model #> #> NOTE: Stopping adaptation #> #>
#> ::Fitting basic radiation model for 10 origins and 10 destinations::
#> ::Fitting power departure-diffusion model for 10 origins and 10 destinations::
#> Compiling model graph #> Resolving undeclared variables #> Allocating nodes #> Graph information: #> Observed stochastic nodes: 70 #> Unobserved stochastic nodes: 34 #> Total graph size: 970 #> #> Initializing model #> #> NOTE: Stopping adaptation #> #>
compare(mods)
#> model type hierarchical DIC RMSE MAPE #> model1 gravity power NA 44776.47 1271.8884 7.207580 #> model2 radiation basic NA NA 1115.3580 2.083781 #> model3 departure-diffusion power FALSE 18513.19 798.0103 1.933492 #> R2 #> model1 0.7578442 #> model2 0.6583450 #> model3 0.8147401