Run Pilot Chain for Posterior Estimation
.run_pilot_chain(
pf_wrapper,
y,
pilot_m,
pilot_n,
pilot_reps,
init_fn,
transition_fn,
log_likelihood_fn,
log_priors,
proposal_sd,
obs_times = NULL,
param_transform = NULL,
pilot_init_params = NULL,
verbose = FALSE,
...
)A list containing:
A numeric vector of the posterior mean of the parameters.
A matrix of the posterior covariance (or variance if only one parameter).
The estimated target number of particles for the PMMH algorithm.
A matrix containing the chain of parameter values throughout the pilot run.
A vector containing the log-likelihood values associated with each iteration of the pilot chain.
An integer specifying the number of iterations for the pilot chain.
An integer specifying the number of particles for the particle filter.
An integer specifying the number of repetitions for the pilot run.
A list of functions representing the log-priors for each model parameter.
A numeric vector specifying the standard deviations for the random walk proposal distribution for each parameter.
A character vector specifying the parameter transformations when proposing parameters using a random walk. Currently only supports "log" for log-transformation, "logit" for logit transformation, and "identity" for no transformation. Default is `NULL`, which correspond to no transformation ("identity).
A numeric vector of initial parameter values. If `NULL`, it will default to a vector of ones. Default is `NULL`.
Additional arguments passed to the particle filter function.
This function runs a pilot chain to estimate the posterior mean and covariance of the model parameters using a particle filter. The chain is run for `pilot_m` iterations, with each iteration proposing new parameters and evaluating their likelihood and prior. The chain is then used to estimate the posterior mean and covariance, which are used to tune the number of particles for the Particle Marginal Metropolis Hastings (PMMH) algorithm.