| plotFit | R Documentation |
This function simulates the model under theta, generates observation
and plot them against the data. Since simulation and observation processes
can be stochastic, nReplicates can be plotted.
plotFit(
fitmodel,
theta,
initState,
data,
nReplicates = 1,
summary = TRUE,
alpha = min(1, 10/nReplicates),
allVars = FALSE,
nonExtinct = NULL,
observation = TRUE,
plot = TRUE
)
fitmodel |
a |
theta |
named numeric vector. Values of the parameters. Names should
match |
initState |
named numeric vector. Initial values of the state
variables. Names should match |
data |
data frame. Observation times and observed data. The time column
must be named |
nReplicates |
numeric, number of replicated simulations. |
summary |
logical. If |
alpha |
transparency of the trajectories (between 0 and 1). |
allVars |
logical, if |
nonExtinct |
character vector. Names of the infected states which must
be non-zero so the epidemic is still ongoing. When the names of these
states are provided, the extinction probability is plotted by computing the
proportion of faded-out epidemics over time. An epidemic has faded-out
when all the infected states (whose names are provided) are equal to 0.
This is only relevant for stochastic models. In addition, if |
observation |
logical, if |
plot |
if |
if plot == FALSE, a list of 2 elements is returned:
simulations data.frame of nReplicates
simulated observations.
plot the plot of the fit.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.