This is a wrapper function of MCMCsummary that calculates summary statistics for each parameter in a mobility.model object. Summary statistics are calculated for all parameters across each chain along with convergance diagnosics like the Gelman-Rubin convergence diagnostic and (Rhat) and samples auto-correlation foreach parameter. If the model object contains deviance and penalty parameters, then Deviance Information Criterion (DIC) is calculated and appended to the summary.

summary(object, probs, ac_lags, ...)

Arguments

object

a mobility.model object (can also accept a mcmc.list object)

probs

numeric vector giving the quantiles to calculate for each parameter (default = c(0.025, 0.5, 0.975))

ac_lags

numeric vector of lags over which to calculate autocorrelation of samples within chains (default = c(2,5,10))

...

further arguments passed to or from other methods

Value

a dataframe with summary statistics

See also

Author

John Giles

Examples

mod <- mobility(data=mobility_matrices, model='gravity', type='transport', DIC=TRUE)
#> ::Fitting transport 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: 32 #> Total graph size: 417 #> #> Initializing model #> #> NOTE: Stopping adaptation #> #>
summary(mod)
#> mean sd Q2.5 Q97.5 Rhat n.eff AC5 #> gamma 1.816561e-01 6.120037e-04 1.803954e-01 1.827982e-01 1.00 1089 0.04 #> theta 1.541606e-05 6.110462e-08 1.530066e-05 1.553273e-05 1.00 1882 -0.02 #> DIC 4.931091e+04 1.863001e+00 4.930903e+04 4.931594e+04 1.02 1028 0.05 #> deviance 4.930703e+04 1.863001e+00 4.930515e+04 4.931206e+04 1.02 1028 0.05 #> pD 1.939190e+00 NA NA NA NA NA NA #> AC10 #> gamma 0.02 #> theta -0.01 #> DIC 0.01 #> deviance 0.01 #> pD NA