pmcmc_predict: Run predictions from PMCMC

View source: R/predict.R

pmcmc_predictR Documentation

Run predictions from PMCMC

Description

Run predictions from the results of pmcmc(). This function can also be called by running predict() on the object, using R's S3 dispatch.

Usage

pmcmc_predict(
  object,
  times,
  prepend_trajectories = FALSE,
  n_threads = NULL,
  seed = NULL
)

Arguments

object

The results of running pmcmc() with return_state = TRUE (without this extra information, prediction is not possible)

times

A vector of time times to return predictions for. The first value must be the final value run in your simulation. An error will be thrown if you get this value wrong, look in object$predict$time (or the error message) for the correct value.

prepend_trajectories

Prepend trajectories from the particle filter to the predictions created here.

n_threads

The number of threads used in the simulation. If not given, we default to the value used in the particle filter that was used in the pmcmc.

seed

The random number seed (see particle_filter). The default value of NULL will seed the dust random number generator from R's random number generator. However, you can pick up from the same RNG stream used in the simulation if you pass in seed = object$predict$seed. However, do not do this if you are gong to run pmcmc_predict() multiple times the result will be identical. If you do want to call predict with this state multiple times you should create a persistant rng state object (e.g., with dust::dust_rng and perform a "long jump" between each call.


mrc-ide/mcstate documentation built on July 3, 2024, 1:34 p.m.