Skip to contents

Return simulations of the trajectory of the output variables of a dynamical model simulator.

Usage

mp_trajectory(model, include_initial = FALSE)

mp_trajectory_sd(model, conf.int = FALSE, conf.level = 0.95)

mp_trajectory_ensemble(model, n, probs = c(0.025, 0.975))

mp_trajectory_sim(model, n, probs = c(0.025, 0.25, 0.5, 0.75, 0.975))

Arguments

model

A dynamical model simulator produced by mp_simulator.

include_initial

Should the initial values of the simulation be included in the output? If TRUE this will include outputs for time == 0 associated with the initial values. See mp_initial for another approach to getting the initial values.

conf.int

Should confidence intervals be produced?

conf.level

If conf.int is TRUE, what confidence level should be used? For example, the default of 0.95 corresponds to 95% confidence intervals.

n

Number of random trajectories to simulate.

probs

Numeric vector of probabilities corresponding to quantiles for summarizing the results over the random realizations.

Functions

  • mp_trajectory_sd(): Simulate a trajectory that includes uncertainty information provided by the sdreport function in TMB with default settings.

  • mp_trajectory_ensemble(): Simulate a trajectory that includes uncertainty information provided by repeatedly sampling from a normal approximation to the distribution of the fitted parameters, and generating one trajectory for each of these samples. The quantiles of the empirical distribution of these trajectories can be used to produce a confidence interval for the fitted trajectory.

  • mp_trajectory_sim(): Generate quantiles over n realizations of the trajectory. Instead of a value column in the output data frame, there is one column for each of the quantiles defined in probs.