calibrate | R Documentation |
Calibrate via particle filter grid search using time series of deaths
calibrate( data, R0_min, R0_max, R0_step, R0_prior = NULL, first_start_date, last_start_date, day_step, Meff_min = 1, Meff_max = 1, Meff_step = 0.1, squire_model = explicit_model(), Rt_func = function(R0_change, R0, Meff) { exp(log(R0) - Meff * (1 - R0_change)) }, pars_obs = NULL, forecast = 0, n_particles = 100, reporting_fraction = 1, treated_deaths_only = FALSE, replicates = 100, date_R0_change = NULL, R0_change = NULL, date_ICU_bed_capacity_change = NULL, baseline_ICU_bed_capacity = NULL, ICU_bed_capacity = NULL, date_hosp_bed_capacity_change = NULL, baseline_hosp_bed_capacity = NULL, hosp_bed_capacity = NULL, date_contact_matrix_set_change = NULL, baseline_contact_matrix = NULL, contact_matrix_set = NULL, country = NULL, population = NULL, dt = 0.1, ... )
data |
Deaths data to fit to. See |
R0_min |
Minimum value of R0 in the search |
R0_max |
Maximum value of R0 in the search |
R0_step |
Step to increment R0 between min and max |
R0_prior |
Prior for R0. Default = NULL, which is a flat prior. Should be provided as a list with first argument the distribution function and the second the function arguments (excluding quantiles which are worked out based on R0_min and R0_max), e.g. 'list("func" = dnorm, args = list("mean"= 3.5, "sd"= 3))'. |
first_start_date |
Earliest start date as 'yyyy-mm-dd' |
last_start_date |
Latest start date as 'yyyy-mm-dd' |
day_step |
Step to increment date in days |
Meff_min |
Minimum value of Meff (Movement effect size) in the search.
Default = 1, which is the same as |
Meff_max |
Maximum value of Meff (Movement effect size) in the search.
Default = 1, which is the same as |
Meff_step |
Step to increment Meff (Movement effect size) between min and max. Default = 0.1 |
squire_model |
A squire model. Default = |
Rt_func |
Function for converting R0, Meff and R0_change. Function must
have names arguments of R0, Meff and R0_change. Default is linear relationship
on the log scale given by |
pars_obs |
list of parameters to use for the comparison function. |
forecast |
Number of days to forecast forward. Default = 0 |
n_particles |
Number of particles. Positive Integer. Default = 100 |
reporting_fraction |
Reporting fraction. Numeric for what proportion of
the total deaths the reported deaths represent. E.g. 0.5 results in
the model calibrating to twice the deaths provided by |
treated_deaths_only |
Boolean for whether likelihood is based only on deaths that occur from healthcare systems, i.e. are treated. Default = FALSE, which uses all deaths. |
replicates |
Replicates to be run. Default = 100 |
date_R0_change |
Calendar dates at which R0_change occurs. Defaut = NULL, i.e. no change in R0 |
R0_change |
Numeric vector for relative changes in R0. Default = NULL, i.e. no change in R0 |
date_ICU_bed_capacity_change |
Calendar dates at which ICU bed
capacity changes set in |
baseline_ICU_bed_capacity |
The starting number of ICU beds before the epidemic started. Default = NULL, which will use the hospital beds data for the country provided. If no country is provided then this is 3/100 of hospital beds |
ICU_bed_capacity |
Number of ICU beds at each date specified in
|
date_hosp_bed_capacity_change |
Calendar dates at which hospital bed
capacity changes set in |
baseline_hosp_bed_capacity |
The starting number of hospital beds before the epidemic started. Default = NULL, which will use the hospital beds data for the country provided. If no country is provided then this is 5/1000 of the population |
hosp_bed_capacity |
Number of hospital beds at each date specified in
|
date_contact_matrix_set_change |
Calendar dates at which the contact matrices
set in |
baseline_contact_matrix |
The starting contact matrix prior to any changes due to interventions or otherwise. Default = NULL, which will use the contact matrix associated with the coutnry provided. |
contact_matrix_set |
List of contact matrices to be used from the dates
provided in |
country |
Character for country beign simulated. WIll be used to
generate |
population |
Population vector (for each age group). Default = NULL,
which will cause population to be sourced from |
dt |
Time Step. Default = 0.1 |
... |
Further aguments for the model parameter function. If using the
|
List of dated squire simulations
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.