Skip to contents

The DiseasyModelGLM module implements common structure and functionality to GLM regression class of models beyond the model structure provided by DiseasyModelRegression.

Most notably, the model module implements the $fit_regression() and $get_prediction() methods using GLM.

diseasy includes two simple models that uses the DiseasyModelGLM module: DiseasyModelG0 and DiseasyModelG1 These models implements a constant predictor and a exponential model based on the previous 7 and 21 days of observations, respectively.

When making a custom GLM model, the subclass should implement the $update_formula() method. The $update_formula() method should update the formula based on the stratifications. If the model should flexibly adapt to different stratifications, this method should be implemented. See DiseasyModelG0 and DiseasyModelG1 for examples of how this can be done.

Value

A new instance of the DiseasyModelGLM, DiseasyModelG0 or DiseasyModelG1 R6 class.

Methods

Inherited methods


Method new()

Creates a new instance of the DiseasyModelBRM R6 class. This module is typically not constructed directly but rather through DiseasyModelB* classes, such as DiseasyModelB0 and DiseasyModelB1.

Usage

Arguments

...

parameters sent to DiseasyModelRegression R6 constructor.

Details

Helper class for the the DiseasyModelB* R6 classes.

Returns

A new instance of the DiseasyModelBRM R6 class.


Method clone()

The objects of this class are cloneable with this method.

Usage

DiseasyModelBRM$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Super classes

diseasy::DiseasyBaseModule -> diseasy::DiseasyModel -> diseasy::DiseasyModelRegression -> diseasy::DiseasyModelBRM -> diseasy::NA -> DiseasyModelB0

Methods

Inherited methods


Method new()

Usage

Arguments

...

parameters sent to DiseasyModelB_ R6 constructor

Returns

A new instance of the DiseasyModelB0 R6 class.


Method clone()

The objects of this class are cloneable with this method.

Usage

DiseasyModelB0$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Super classes

diseasy::DiseasyBaseModule -> diseasy::DiseasyModel -> diseasy::DiseasyModelRegression -> diseasy::DiseasyModelBRM -> diseasy::NA -> DiseasyModelB1

Methods

Inherited methods


Method new()

Usage

Arguments

...

parameters sent to DiseasyModelB_ R6 constructor

Returns

A new instance of the DiseasyModelB1 R6 class.


Method clone()

The objects of this class are cloneable with this method.

Usage

DiseasyModelB1$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

 model <- DiseasyModelG0$new()

 rm(model)