get_subnational_modelinputs {mcmsupply} | R Documentation |
Get JAGS model inputs
Description
Get JAGS model inputs
Usage
get_modelinputs(
startyear = 1990,
endyear = 2030.5,
nsegments = 12,
raw_data,
varcov_array_filepath = NULL
)
Arguments
startyear |
The year you wish to begin your predictions from. Default is 1990. |
endyear |
The year you wish to finish your predictions. Default is 2030.5. |
nsegments |
The number of knots you wish to use in your basis functions. Default is 12. |
raw_data |
The list of arguments and family planning source data from the 'get_data' function. |
varcov_array_filepath |
Path to calculated variance-covariance array associated with the custom supplied FP source data. Default is NULL. Covariance data should be a .RDS file. |
Value
A list of modelling inputs for the JAGS model.
Tstar is the year index for the most recent survey in each province.
Kstar is the knot index that aligns with Tstar.
B.ik are the basis functions.
n_years are total number of years
n_obs are the total number of observations
K are the number of knots.
H is K-1. Used in the calculation of first order differences of spline coefficients.
P_count is the number of subnational provinces/regions.
M_count is the number of modern contraceptive methods.
matchsubnat is the subnational province indexing to match the observed data to the predictions.
matchcountry is the country indexing to match the observed data to the predictions.
matchmethod is the method indexing to match the observed data to the predictions.
matchyears is the year indexing to match the observed data to the predictions.
Examples
raw_data <- get_data(national=FALSE, local=TRUE, mycountry="Nepal")
jagsdata <- get_modelinputs(startyear=1990, endyear=2030.5, nsegments=12, raw_data)