configure_rjMCMC.Rd
Define several parameters required to configure the rjMCMC sampler.
configure_rjMCMC( dat, model.select = TRUE, covariate.select = FALSE, function.select = TRUE, biphasic = FALSE, proposal.mh = list(t.ij = 10, mu.i = 5, mu = 2, phi = 5, sigma = 5, nu = 5, tau = 5, alpha = 2, mu.ij = 5, psi = 1, omega = 2, psi.i = 2, k.ij = 0.5), proposal.rj = list(rj = 5, dd = 10, cov = 3), priors = list(covariates = c(0, 30), alpha = c(110, 160), sigma = c(1, 45), phi = c(1, 45), omega = c(0.5, 5), tau = c(1, 45), psi = c(0, 1)), p.split = 0.5, p.merge = 0.5, bootstrap = TRUE, n.rep = 100 )
dat | Input BRS data. Must be an object of class |
---|---|
model.select | Logical. If |
covariate.select | Logical. Set to |
function.select | Logical. Set to |
biphasic | Logical. Specifies which functional form to impose. Monophasic dose-response curves are returned when |
proposal.mh | Named list specifying the standard deviations of the proposal distributions used in the Metropolis-Hastings sampler. |
proposal.rj | Named list specifying the standard deviations of the proposal distributions used in the reversible jump sampler. Must contain two elements: |
priors | Named list giving the means and standard deviations for Normal priors and the lower and upper bounds for Uniform priors. Relevant parameters for the monophasic model are as follows: |
p.split | Probability of choosing to split a group of species when initiating a split-merge move. This parameter is constrained to be |
p.merge | Probability of choosing to merge two groups of species when initiating a split-merge move. This parameter is constrained to be |
bootstrap | Logical, defaults to TRUE. Whether to perform bootstrap clustering. As this step can be time-consuming, setting this argument to |
n.rep | Number of replicate bootstrap datasets used for clustering (see |
A list object of class rjconfig
identical to the input brsdata
object, with an additional config
element composed of:
var | Empirical estimates of φ and σ |
prop | Standard deviations of MCMC proposal distributions |
clust | Outputs from the cluster analysis |
boot | Species group assignments for each bootstrap dataset |
mlist | Unique species group assignments |
prior | Mean and standard deviation of the Normal priors placed on covariates |
... | Other elements pulled from the brsdata object |
The function performs three actions:
Returns empirical estimates of between-whale (φ) and within-whale between-exposure (σ) variation, which are needed to generate starting values for the MCMC chains
Defines the means and standard deviations of relevant proposal distributions and priors
Performs a cluster analysis using n.rep
bootstrap replicates of the input data, in order to initialise between-model jumps. The analysis is run using Mclust
(Scrucca et al. 2016)
on both (1) species means and (2) raw observations. These respectively provide estimates of the probability distributions of (1) unique groupings, and (2) numbers of groups, where the latter ranges from n = 1
when all species belong to the same group, to n = n.species
when each species is treated individually.
Scrucca L, Fop M, Murphy TB, Raftery AE (2016). “mclust 5: Clustering, classification and density estimation using Gaussian finite mixture models.” The R Journal, 8(1), 289--317. https://doi.org/10.32614/RJ-2016-021.
Phil J. Bouchet
if (FALSE) { library(espresso) # Import the example data, excluding species # with less than 5 observations mydat <- read_data(file = NULL, min.N = 5) summary(mydat) # Configure the rjMCMC sampler mydat.config <- configure_rjMCMC(dat = mydat, model.select = TRUE, covariate.select = FALSE, function.select = FALSE, n.rep = 100) summary(mydat.config) }