Skip to contents

Add observations to a model

Usage

obs(...)

Arguments

...

Numeric values to be added as observations after the current time t. They would be added as events with evid = 0 and amt = 0 at the specified future time points. The time points are relative to the current model time t (i.e., obs(12) adds an observation at t + 12). If this is a ui model, you can also specify observations with obs(seq(0, 24, by=0.5)) to add observations every 0.5 time units from t to t+24 since it will resolve to the obs() inside of the final rxode2 model.

Value

This function is only meaningful inside an rxode2 model; it returns NULL invisibly if called from R directly (after signaling an error).

Details

Behavior inside a model

obs() is evaluated at every output time point (when the solver is exactly at a scheduled event time). The pushed event is inserted into the individual's event timeline and the solver visits it now or at the specified future time.

The number of events that may be pushed per individual is limited by the maxExtra argument of rxSolve(). When maxExtra = 0 (the default) there is no limit. Exceeding the limit causes an error.

Past-time pushes (where time < t) are silently ignored and counted; a warning is issued after solving.

Author

Matthew L. Fidler