obs_proportional: Observation with proportional error

View source: R/observation.R

obs_proportionalR Documentation

Observation with proportional error

Description

This building block declares an observation model with a proportional residual error model (y = f + f ε_1).

Usage

obs_proportional(prediction, name, var_prop = 0.1)

Arguments

prediction

A definition of the model prediction

name

A name for the observation (automatically derived if missing)

var_prop

Variance of the proportional error

Details

Observation models specify the observed variable, how an observation is expected to diverge from the model (i.e, the residual unexplained variability model), and parameter values. The observation model type is selected through the function name. The observed variable as well as the parameters are specified as function arguments.

Specifying predictions

The actual prediction from the model is the first argument of the function. It can be specified in a number of different ways:

  • A name of a variable in the model: obs_additive("effect")

  • A compartment concentration: obs_additive(~C["central"])

  • An equation: obs_additive(~base+slp*time)

If the definition contains a variable name on the left-hand side (as in conc~C["central"]), the variable will appear in the generated model code. This can be useful to make the model code more readable if the prediction is defined as a long equation.

Observation names

The observation name can be specified via the name= argument and is automatically derived if the argument is left empty. Adding an observation model with an already existing name will replace the previous definition.

Error variance

The variance of the error components are specified via the var_add= and var_prop= arguments of the function.

Value

A building block of type 'observation'

See Also

Other observation models: obs_additive(), obs_combined()

Examples

# additve RUV model for observing the variable WT
m <- model() +
  prm_log_normal("wt") +
  obs_additive(~wt)

# EMAX dose-response model with proportional RUV
m2 <- model() +
  input_variable("dose") +
  prm_no_var("emax") +
  prm_no_var("ed50") +
  obs_proportional(effect~emax*dose/(ed50+dose))

sebastianueckert/assemblerr documentation built on Sept. 30, 2022, 9:12 a.m.