Run leapfrog model fit from initial state
run_model_from_state(
parameters,
configuration,
initial_state,
simulation_start_year,
output_years = seq(1970, 2030)
)Projection parameters
The model configuration to run, see
list_model_configurations() for available configurations
The model will run from this initial state
Start the model simulation from a particular year
Which years of the model to return from the simulation,
defaults to all years from 1970 to 2030. Also used to control what years
the simulation is run for. If output only 2030, simulation will be run
from projection_start_year passed in the parameters list.
List of model outputs, where the last dimension of each element is
time, e.g. p_totpop state variable has dimensions 81 x 2. If
output_years specified has length 61 then the p_totpop output
will have dimensions 81 x 2 x 61.
pjnz <- system.file(
"pjnz/bwa_aim-adult-art-no-special-elig_v6.13_2022-04-18.PJNZ",
package = "frogger", mustWork = TRUE)
parameters <- prepare_leapfrog_parameters(pjnz, use_coarse_age_groups = TRUE)
out_first_half_years <- run_model(parameters, "HivCoarseAgeStratification", 1970:2000)
out_second_half_years <- run_model_from_state(
parameters,
"HivCoarseAgeStratification",
get_time_slice(out_first_half_years, 31),
2000,
2001:2030)