run_rjMCMC: Reversible jump MCMC

View source: R/run_rjMCMC.R

run_rjMCMCR Documentation

Reversible jump MCMC

Description

Run the rjMCMC algorithm on dose-response data.

Usage

run_rjMCMC(dat, n.chains = 3, n.burn = 1000, n.iter = 1000, do.update = FALSE)

Arguments

dat

A configured rjMCMC object of class rjconfig, as returned by configure_rjMCMC.

n.chains

Number of MCMC chains.

n.burn

Number of MCMC iterations to use as burn-in.

n.iter

Number of posterior samples.

do.update

Logical. If TRUE, updates an existing rjMCMC object.

Value

A list object of class rjmcmc.

Note

A progress bar is used to monitor code execution on Mac and Linux operating systems. This feature does not currently work on Windows.

Author(s)

Phil J. Bouchet

See Also

configure_RJMCMC plot.rjtrace update_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,
                                 function.select = FALSE,
                                 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)

## End(Not run)

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