Calibrator: An R6 class to calibrate a model to data

CalibratorR Documentation

An R6 class to calibrate a model to data

Description

An R6 class to calibrate a model to data

An R6 class to calibrate a model to data

Details

Like a simulator, to calibrate the model to a dataset, a calibrator expects the known and unknown initial conditions and the parameter values, and the data to calibrate to. In addition, it also expects a mapping from model solutions to observation variables.

Public fields

the

names of all parameters

Active bindings

the

names of all parameters

Methods

Public methods


Method new()

initializer

Usage
Calibrator$new(
  model,
  time,
  data,
  ...,
  cumulative = FALSE,
  mapping = character()
)
Arguments
model

the model to calibrate

time

either a numeric vector containing the times (including the initial time) of the ODE solution that corresponds to the data, or a character value giving the name of the column in data that corresponds to time.

data

a data.frame object containign the data for the calibration

...

each argument is a formula defining the maps between the data columns and the model variables. Please see the details section.

Details

A mapping is a named argument, where name is the data colummn name, and value corresponds to the model variables (or an expression to calculate from the model variables.) Calibrate the model to data


Method calibrate()

Usage
Calibrator$calibrate(initial.values, parms, ...)
Arguments
initial.values

the initial values for the model. The parameters that need to be estimate should be NA, those that do not need to be estimated must contain a finite value.

parms

the parameter values of the model. The parameters that need to be estimate should be NA, those that do not need to be estimated must contain a finite value.

...

extra arguments to be passed to calibrators


Method clone()

The objects of this class are cloneable with this method.

Usage
Calibrator$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


junlingm/REpiSim documentation built on Nov. 28, 2023, 2:35 a.m.