.cross_check_sim_input | R Documentation |
There are two types of cross-checking:
If the onset-to-event distribution is specified but the corresponding risk
is not specified (i.e. NULL
) the function will error (stop()
).
If the onset-to-event distribution is not specified (i.e. NULL
) but the
corresponding risk is specified the function will throw a warning
(warning()
).
The difference in condition handling is because in the case that the
onset-to-event is NULL
the simulation can safely ignore the corresponding
risk, while throwing a warning, as there are no events. In other words, if
the onset-to-hospitalisation is not specified, no infected individuals will
go to hospital and the date_admission
column in the line list will all be
NA
s. However, if the onset-to-event is specified and the corresponding
risk is NULL
then the proportion of individuals infected that are
hospitalised or die cannot be calculated and therefore the simulation
cannot run. It is in this latter case that the cross-checking throws an
error.
.cross_check_sim_input(
onset_to_hosp,
onset_to_death,
hosp_risk,
hosp_death_risk,
non_hosp_death_risk
)
onset_to_hosp |
A The function can be defined or anonymous. The function must return a vector
of An The default is an anonymous function with a lognormal distribution random
number generator ( If |
onset_to_death |
A The function can be defined or anonymous. The function must return a vector
of An The default is an anonymous function with a lognormal distribution random
number generator ( If For hospitalised cases, the function ensures the onset-to-death time is
greater than the onset-to-hospitalisation time. After many (1000) attempts,
if an onset-to-death time (from |
hosp_risk |
Either a single |
hosp_death_risk |
Either a single |
non_hosp_death_risk |
Either a single |
Invisibly return the onset_to_hosp
argument. The function is
called for its side-effects, which will error or warn if the input is
invalid.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.