update_rjMCMC: Update sampler

View source: R/update_rjMCMC.R

update_rjMCMCR Documentation

Update sampler

Description

Update the Markov chain(s) associated with an existing rjMCMC sampler.

Usage

update_rjMCMC(rjdat, n.iter = 1000)

Arguments

rjdat

Input rjMCMC sampler. Must be an object of class rjmcmc, as returned by run_rjMCMC.

n.iter

Number of posterior samples.

Author(s)

Phil J. Bouchet

See Also

run_rjMCMC

Examples

## Not run: 
library(espresso)

# Import the example data, excluding species with sample sizes < 5
# and considering the sonar covariate
mydat <- read_data(file = NULL, min.N = 5, covariates = "sonar") 
summary(mydat)

# Configure the sampler
mydat.config <- configure_rjMCMC(dat = mydat,
                                 model.select = TRUE,
                                 covariate.select = FALSE,
                                 proposal.mh = list(t.ij = 10, mu.i = 10, 
                                                    mu = 7, phi = 10, sigma = 10),
                                 proposal.rj = list(dd = 20, cov = 7),
                                 prior.covariates = c(0, 30),
                                 n.rep = 100)
summary(mydat.config)

# Run the reversible jump MCMC
rj <- run_rjMCMC(dat = mydat.config,
                 n.chains = 2,
                 n.burn = 100,
                 n.iter = 100,
                 do.update = FALSE)
                     
rj.update <- update_rjMCMC(rjdat = rj, n.iter = 500)

## End(Not run)

pjbouchet/espresso documentation built on July 27, 2024, 12:31 p.m.