sample_pmcmc | R Documentation |
Sample from the posterior probability results produced by run_mcmc_chain
to select parameter set. For each parmater set sampled, run particle
filter with num_particles
and sample 1 trajectory
sample_pmcmc( pmcmc_results, burnin = 0, n_chains, log_likelihood = calc_loglikelihood, n_trajectories = 10, n_particles = 100, forecast_days = 0 )
pmcmc_results |
output of |
burnin |
integer; Number of iterations to discard from the start of MCMC run. Default = 0 |
n_chains |
number of chains that considered. Should inherent from pmcmc. |
log_likelihood |
function to calculate log likelihood, must take named parameter vector as input, allow passing of implicit arguments corresponding to the main function arguments. Returns a named list, with entries: - $log_likelihood, a single numeric - $sample_state, a numeric vector corresponding to the state of a single particle, chosen at random, at the final time point for which we have data. If NULL, calculated using the function calc_loglikelihood. |
n_trajectories |
interger; Number of trajectories to be returned. Integer. Default = 10. |
n_particles |
integer; Number of particles to be considered in the particle filter. Default = 100 |
forecast_days |
integer; number of days being forecast. Default = 0 |
A 3-dimensional array of trajectories (time, state, tranjectories).
The parameters chosen when sampling from the pmcmc
posteriors
A list of model inputs.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.