| validate | R Documentation |
For a micsim_model(), runs every check and reports everything it finds at once.
Errors: a rate that raises an error, returns something other than one number
per input, NA or a negative value on a grid of whole ages, calendar years and
durations; a newborn table that has no state for a mother. Warnings: a rate that
is zero everywhere or exceeds 10 per person-year; a transition nobody can reach;
a state nobody can leave. Inf is allowed for forced transitions.
validate(x, ...)
## S3 method for class 'micsim_model'
validate(x, strict = FALSE, ...)
x |
An object to check, here |
... |
Passed to methods. |
strict |
If |
During construction the model already checked that each rate is a function with admissible arguments and that it returns one value per input.
Validation checks the values at the grid points. For example, a rate that passes at whole ages can still fail at a fractional age. Assessing whether the model is suitable for the research question is a separate step.
Because validation returns the model, you can pass it directly to
model |> validate() |> simulate(seed = 234)
x, invisibly, if no error is found. Otherwise an error of class
micsim_invalid_model listing every problem. Warnings are given as one
micsim_model_warning. Both carry $problems, a data frame with one row per finding.
micsim_model(), MicSim-concepts
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.