CalibrationSet {cvasi}R Documentation

Calibration set

Description

A calibration set combines a scenario, observed data, and an optional weighting factor into one object. The calibration set is used to fit model parameters to observed data using calibrate().

Usage

caliset(scenario, data, weight = 1.0)

Arguments

scenario

a scenario describing conditions during the experiment

data

a data.frame with observed data in long format containing two columns: the 1st column with numeric time points and 2nd column with numeric data to fit to.

weight

optional numeric weight to be applied to this dataset's error term during fitting, default values is 1.0.

Details

A calibration set usually represents a single experiment or trial. Multiple experimental replicates can be combined into a single set, if model parameters are identical between trials. If model parameters were modified during a trial, e.g. a pump failure occurred or flow rates changed, this can be represented by using a scenario sequence instead of a basic scenario. Please refer to sequence() for details.

Weighting

If more than one calibration set is used for fitting, then an optional weighting factor can be used to scale the error term of the affected set.

Value

caliset() returns a calibration set object

Examples

library(dplyr)

# Get observed biomass during control experiment by Schmitt et al. (2013)
observed <- Schmitt2013 %>%
  filter(ID == "T0") %>%
  select(t, BM=obs)

# Create a scenario that represents conditions during experiment
scenario <- metsulfuron %>%
  set_param(c(k_phot_fix=TRUE, k_resp=0, Emax=1)) %>%
  set_init(c(BM=12)) %>%
  set_noexposure()

# Create a calibration set
cs <- caliset(scenario, observed)

# Fit parameter 'k_phot_max' to observed biomass growth from experiment
calibrate(
  cs,
  par=c(k_phot_max=1),
  output="BM",
  method="Brent", # Brent is recommended for one-dimensional optimization
  lower=0,        # lower parameter boundary
  upper=0.5       # upper parameter boundary
) -> fit
fit$par


[Package cvasi version 1.1.3 Index]