gibbs: Posterior inference for dose-response models

View source: R/gibbs.R

gibbsR Documentation

Posterior inference for dose-response models

Description

Fits the Bayesian hierarchical dose-response model of \insertCiteMiller2014;textualespresso to multiple species using rjags \insertCitePlummer2019espresso, and estimates posterior model probabilities using a Gibbs Variable Selection (GVS) approach \insertCiteOHara2009espresso.

Usage

gibbs(
  dat,
  random.effects = FALSE,
  pseudo.n = 10000,
  mcmc.n = 1000,
  burnin = 1000,
  n.chains = 1,
  thin = 1,
  epsilon.upper = 30
)

Arguments

dat

Input data. Must be an object of class rjtrace or brsdata.

random.effects

Logical. When TRUE, uses a random effect model formulation.

pseudo.n

Number of iterations for the pseudo-priors.

mcmc.n

Number of posterior samples.

burnin

Number of iterations to discard as burn-in.

n.chains

Number of MCMC chains.

thin

Thinning interval.

epsilon.upper

Upper bound on the ε parameter used in the random effect model formulation.

Details

Adapted from original code developed by Dina Sadykova as part of the Mocha project. The function can accommodate species/species groups either as a fixed or a random effect.

Value

A list object of class gvs.

Author(s)

Phil J. Bouchet

References

\insertAllCited

See Also

summary.gvs

Examples

## Not run: 
library(espresso)

# Simulate data for two species
mydat <- simulate_data(n.species = 2, 
                       n.whales = 16, 
                       max.trials = 3, 
                       covariates = list(exposed = c(0, 5), range = 0.5),
                       mu = c(101, 158), 
                       phi = 20, 
                       sigma = 20, 
                       Rc = c(210, 211), 
                       seed = 58697)
summary(mydat)
     
# Model selection by GVS                        
gvs <- gibbs(dat = mydat, 
             random.effects = FALSE, 
             mcmc.n = 1000, 
             burnin = 500)

## End(Not run)

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