Description Usage Arguments Details Value Author(s) See Also Examples
This function uses a fitted mobility.model
object to simulate a connectivity matrix based on estimated parameters.
1 |
object |
a |
newdata |
a list containing new data to used in model prediction. If
|
nsim |
number of simulations (default = 1). |
seed |
optional integer specifying the call to |
... |
further arguments passed to or from other methods |
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.
a vector, matrix, or array containing predited or simulated mobility values.
John Giles
Other model:
check()
,
compare()
,
fit_jags()
,
fit_prob_travel()
,
mobility()
,
residuals()
,
summary()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | mod <- mobility(data=mobility_matrices,
model='gravity',
type='transport')
mod <- mobility(data=mobility_matrices,
model='departure-diffusion',
type='power',
hierarchical=TRUE)
predict(object=mod)
n <- 5
ids <- letters[1:n]
# Distance matrix
D <- get_distance_matrix(x=rnorm(n, -100, 2),
y=rnorm(n, 20, 1),
id=ids)*111.35
# Vector of population sizes
N <- rnbinom(n, size=5, mu=5000)
names(N) <- ids
# Predict mobility model using new data
predict(object=mod, newdata=list(D=D, N=N))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.