plotFit.Rd
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
)
a fitmodel
object
named numeric vector. Values of the parameters. Names should
match fitmodel$thetaNames
.
named numeric vector. Initial values of the state
variables. Names should match fitmodel$stateNames
.
data frame. Observation times and observed data. The time column
must be named "time"
and the observation column must be named
"obs"
.
numeric, number of replicated simulations.
logical. If TRUE
, the mean, median as well as the 50th
and 95th percentile of the trajectories are plotted (default). If
FALSE
, all individual trajectories are plotted (transparency can be
set with alpha
).
transparency of the trajectories (between 0 and 1).
logical, if FALSE
only the observations are plotted.
Otherwise, all state variables are plotted.
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 summary
== TRUE
, the summaries of the trajectories conditioned on non-extinction
are shown. Default to NULL
.
logical, if TRUE
simulated observation are
generated by rTrajObs
.
if TRUE
the plot is displayed, and returned otherwise.
if plot == FALSE
, a list of 2 elements is returned:
simulations
data.frame
of nReplicates
simulated observations.
plot
the plot of the fit.