stop_chain {BeviMed}R Documentation

Apply the MCMC algorithm in blocks until conditions are met

Description

Sample blocks of a given size until either the estimated log marginal likelihood falls within a given confidence interval, there is sufficient confidence that the evidence model gamma = 1 is at most a certain quantity, or a certain number of blocks have been sampled.

Usage

stop_chain(
  y,
  blocks_remaining,
  start_zs,
  start_logit_omegas,
  start_log_phis,
  temperatures,
  tolerance = 1,
  confidence = 0.95,
  simulations = 1000,
  log_evidence_threshold = -Inf,
  y_log_lik_t_equals_1_traces = matrix(ncol = length(temperatures), nrow = 0),
  full_block_traces = list(),
  verbose = FALSE,
  ...
)

Arguments

y

Logical vector of case (TRUE) control (FALSE) status.

blocks_remaining

Maximum number of blocks left before termination.

start_zs

Initial (logical) z-matrix.

start_logit_omegas

Initial values of logit_omega (numeric vector - one value per chain).

start_log_phis

Initial values of log_phi (numeric vector - one value per chain).

temperatures

Numeric vector of temperatures of power posteriors. One chain will be created for each element of the vector at the corresponding temperature.

tolerance

Maximum width for confidence_interval of log marginal likelihood to allow before stopping the chain.

confidence

Numeric value of statistical confidence with which returning interval should contain the true value.

simulations

Integer value of number of simulations to use in estimation of the confidence interval.

log_evidence_threshold

Numeric value used to determine whether to stop the sampling procedure after successive blocks. If we are confident (to the level of confidence) that the evidence for model gamma = 1 is under this value, sampling is halted.

y_log_lik_t_equals_1_traces

Numeric matrix of log probabilities of y at different temperatures (columns) in different iterations (rows).

full_block_traces

List of outputs of calls to MCMC routine.

verbose

To print execution progress or not.

...

Other arguments passed to call_cpp

Value

An object of class BeviMed.


[Package BeviMed version 5.8 Index]