The JSON config file should have 9 entries:
stochastic: a boolean value
theta: matrix (row major)
wf: vector
H: vector
MOI: matrix (row major)
b: scalar
c: scalar
r: scalar
sigma: scalar
For interpretation of the entries, please read setup_humans_MOI.
Value
a named list
Examples
# to see an example of proper JSON input, run the following
library(jsonlite)
n <- 6 # number of human population strata
p <- 5 # number of patches
theta <- matrix(rexp(n*p), nrow = n, ncol = p)
theta <- theta / rowSums(theta)
H <- rep(10, n)
MOI <- matrix(0, nrow = 10, ncol = n)
MOI[1, ] <- H
par <- list(
"stochastic" = FALSE,
"theta" = theta,
"wf" = rep(1, n),
"H" = H,
"MOI" = MOI,
"b" = 0.55,
"c" = 0.15,
"r" = 1/200,
"sigma" = 1
)
toJSON(par, pretty = TRUE)
#> {
#> "stochastic": [false],
#> "theta": [
#> [0.3343, 0.1328, 0.0575, 0.4622, 0.0132],
#> [0.0129, 0.6613, 0.167, 0.0265, 0.1322],
#> [0.3156, 0.1031, 0.2141, 0.3636, 0.0036],
#> [0.1652, 0.1665, 0.4538, 0.1542, 0.0602],
#> [0.2229, 0.0216, 0.0691, 0.2459, 0.4405],
#> [0.5604, 0.0019, 0.1993, 0.1353, 0.103]
#> ],
#> "wf": [1, 1, 1, 1, 1, 1],
#> "H": [10, 10, 10, 10, 10, 10],
#> "MOI": [
#> [10, 10, 10, 10, 10, 10],
#> [0, 0, 0, 0, 0, 0],
#> [0, 0, 0, 0, 0, 0],
#> [0, 0, 0, 0, 0, 0],
#> [0, 0, 0, 0, 0, 0],
#> [0, 0, 0, 0, 0, 0],
#> [0, 0, 0, 0, 0, 0],
#> [0, 0, 0, 0, 0, 0],
#> [0, 0, 0, 0, 0, 0],
#> [0, 0, 0, 0, 0, 0]
#> ],
#> "b": [0.55],
#> "c": [0.15],
#> "r": [0.005],
#> "sigma": [1]
#> }