pmwg0.2.7 package

Particle Metropolis Within Gibbs

accept_progress_bar

An altered version of the utils:txtProgressBar that shows acceptance r...

accept_rate

Return the acceptance rate for new particles across all subjects

as_mcmc

Return a CODA mcmc object with the required samples

augment_sampler_epsilon

Augment existing sampler object to have subject specific epsilon stora...

check_adapted

Check whether the adaptation phase has successfully completed

check_efficient

Check for efficient proposals if necessary

check_run_stage_args

Test the arguments to the run_stage function for correctness

conditional_parms

Obtain the efficent mu and sigma from the adaptation phase draws

create_efficient

Create distribution parameters for efficient proposals

extend_sampler

Extend the main data store with empty space for new samples

extract_samples

Extract relevant samples from the list for conditional dist calc

gen_particles

Generate proposal particles

gibbs_step

Gibbs step of the Particle Metropolis within Gibbs sampler

gibbs_step_err

Error handler for the gibbs_step call

init

Initialise values for the random effects

is.pmwgs

Test whether object is a pmwgs

last_sample

Create a list with the last samples in the pmwgs object

new_sample

Generate particles and select one to be the new sample

new_sample_err

Error handler forany error in new_sample function call(s)

numbers_from_proportion

Check and normalise the number of each particle type from the mix_prop...

particle_draws

Generate a cloud of particles from a multivariate normal distribution

particle_select_err

Error handler for the particle selection call

pmwg-package

pmwg: Particle Metropolis Within Gibbs.

pmwgs

Create a PMwG sampler and return the created object

relabel_samples

Relabel requested burn-in samples as adaptation

riwish

The Inverse Wishart Distribution

run_stage

Run a stage of the PMwG sampler

rwish

The Wishart Distribution

sample_store

Create a new list for storage samples in the pmwgs object

set_epsilon

Set default values for epsilon

set_mix

Set default values for mix

set_proposal

Setup the proposal distribution arguments (if in sample stage)

test_sampler_adapted

Test that the sampler has successfully adapted

trim_na

Trim the unneeded NA values from the end of the sampler

unwind

Unwinds variance matrix to a vector

update_epsilon

Update the subject specific scaling parameters (epsilon)

update_progress_bar

A function that updates the accept_progress_bar with progress and acce...

wind

Winds a variance vector back to a vector

Provides an R implementation of the Particle Metropolis within Gibbs sampler for model parameter, covariance matrix and random effect estimation. A more general implementation of the sampler based on the paper by Gunawan, D., Hawkins, G. E., Tran, M. N., Kohn, R., & Brown, S. D. (2020) <doi:10.1016/j.jmp.2020.102368>. An HTML tutorial document describing the package is available at <https://university-of-newcastle-research.github.io/samplerDoc/> and includes several detailed examples, some background and troubleshooting steps.

  • Maintainer: Gavin Cooper
  • License: GPL-3
  • Last published: 2024-01-31