Skip to contents

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

Inherited methods


Method new()

Merge the user provided mappings with the default mappings during initialisation.

Usage

DiseasyModelOde$new(parameters = NULL, ...)

Arguments

parameters

(list())
List of parameters given to the model.

...

Parameters sent to DiseasyModel R6 constructor.


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 by last_queryable_date of the ?DiseasyObservables R6 class.

quantiles

(list(numeric))
If given, results are returned at the quantiles given.

stratification

(list(quosures) or NULL)
Use rlang::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

Usage

DiseasyModelOde$initialise_state_vector(incidence_data)

Arguments

incidence_data

incidence_data (data.frame)
Incidence observations as a data.frame with columns - date: The date of the observations - age_group: The age group of the incidence observation (following diseasystore::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.

Usage

DiseasyModelOde$plot(observable, prediction_length, 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 by last_queryable_date of the ?DiseasyObservables R6 class.

stratification

(list(quosures) or NULL)
Use rlang::quos(...) to specify stratification. If given, expressions in stratification evaluated to give the stratification level.


Method clone()

The objects of this class are cloneable with this method.

Usage

DiseasyModelOde$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

  # This module should not be constructed directly but should instead be used to
  # inherit from when creating a new model class.