The DiseasyModelOde module implements common structure and functionality to regression class of models
beyond the model structure provided by ?DiseasyModel.
Most notably, the model module implements the $get_results() method.
This implementation requires the subclass to implement the $rhs() and $initialise_state_vector() methods.
Value
A new instance of the DiseasyModelOde R6 class.
Super classes
diseasy::DiseasyBaseModule -> diseasy::DiseasyModel -> DiseasyModelOde
Methods
Method new()
Merge the user provided mappings with the default mappings during initialisation.
Usage
DiseasyModelOde$new(parameters = NULL, ...)Method get_results()
The primary method used to request model results of a given observable at a given stratification
Usage
DiseasyModelOde$get_results(
observable,
prediction_length,
quantiles = NULL,
stratification = NULL
)Arguments
observable(
character)
The observable to provide data or prediction for.prediction_length(
numeric)
The number of days to predict. The prediction start is defined bylast_queryable_dateof the?DiseasyObservablesR6 class.quantiles(
list(numeric))
If given, results are returned at the quantiles given.stratification(
list(quosures) orNULL)
Userlang::quos(...)to specify stratification. If given, expressions in stratification evaluated to give the stratification level.
Returns
A tibble tibble::tibble with predictions at the level specified by stratification level. In addition to stratification columns, the output has the columns:
- date (Date) specifying the date of the prediction.
- realisation_id (character) giving a unique id for each realization in the ensemble.
- weight (numeric) giving the weight of the realization in the ensemble.
Method initialise_state_vector()
Infer the state_vector from incidence data
Arguments
incidence_dataincidence_data (
data.frame)
Incidence observations as adata.framewith columns -date: The date of the observations -age_group: The age group of the incidence observation (followingdiseasystore::age_labels()format) -variant: The variant of the incidence observation. -incidence: The incidence in the age group at the given date
Method plot()
Plot the predictions from the current model.
Arguments
observable(
character)
The observable to provide data or prediction for.prediction_length(
numeric)
The number of days to predict. The prediction start is defined bylast_queryable_dateof the?DiseasyObservablesR6 class.stratification(
list(quosures) orNULL)
Userlang::quos(...)to specify stratification. If given, expressions in stratification evaluated to give the stratification level.
