mcmc_h: MH Sampler of the Proposal Distribution of...

View source: R/mcmc-h.R

mcmc_hR Documentation

MH Sampler of the Proposal Distribution of Coefficients/Active Bases

Description

The proposal distribution Q_beta is the asymptotic distribution of the IQR estimator limited to the finite support of possible solutions enumerated by the active basis. This MH sampler returns draws from the proposal distribution by

Usage

mcmc_h(
  iterations,
  h_opt,
  beta_D_opt,
  beta_X_opt,
  residuals_opt,
  theta,
  varcov_mat,
  Y,
  X,
  D,
  Phi,
  discard_burnin,
  manual_burnin = 1,
  unique_beta_quota = rep(0, ncol(D)),
  largest_min = rep(Inf, ncol(D)),
  smallest_max = rep(-Inf, ncol(D)),
  max_iterations = Inf,
  label_function = function(idx, total = iterations) {
     print(paste("MCMC-H IDX:",
    idx, "/", total))
 },
  label_skip = floor(iterations/5),
  label_bool = TRUE,
  always_accept = FALSE
)

Arguments

iterations

Number of iterations

residuals_opt

Residuals from IQR-QR problem

theta

Tuning parameter

varcov_mat

Variance-covariance matrix

Y, X, D, Phi

Data

discard_burnin

If TRUE, remove first few samples that have the same coefficients

unique_beta_quota

Vector of length p_D; minimum number of unique beta (defaults to 0)

largest_min

Vector of length p_D; sample from MCMC must contain beta_D below corresponding value of largest_min; defaults to Inf

smallest_max

Vector of length p_D; sample from MCMC must contain beta_D above corresponding value of smallest_max; defaults to -Inf

max_iterations

Total number of iterations before stopping the program; defaults to Inf, but set to a lower number when using largest_min or smallest_max

always_accept

If FALSE (default), sample from proposal_h. Else, sample from target_h.

initial_h

Initial active basis indices

initial_beta_D, initial_beta_X

Initial coefficients, e.g., IQR point estimate

Details

  1. Proposing an active basis h_star according to Q_h, which puts more weight on indices with smaller residuals

  2. Computing coefficients beta_star (see h_to_beta)

  3. Computing the acceptance probability

  4. Accept/Reject in the usual MH manner

Value

named list

  1. beta: data frame where each row is a vector of coefficients (one row per iteration)

  2. h: data frame where each row is a vector of indices in the active basis (one row per iteration)

  3. record: binary vector, 1 if that iteration's proposal was accepted

  4. stationary_begin: all iterations prior to this number were discarded


omkarakatta/ivqr documentation built on Aug. 20, 2022, 11:04 p.m.