Q_IS_BRR: Q Importance Sampling Step

View source: R/BRR_fusion.R

Q_IS_BRRR Documentation

Q Importance Sampling Step

Description

Q Importance Sampling weighting for Bayesian robust regression

Usage

Q_IS_BRR(
  particle_set,
  m,
  time,
  dim,
  data_split,
  nu,
  sigma,
  prior_means,
  prior_variances,
  C,
  proposal_cov,
  precondition_matrices,
  inv_precondition_matrices,
  diffusion_estimator,
  beta_NB = 10,
  gamma_NB_n_points = 2,
  seed = NULL,
  n_cores = parallel::detectCores(),
  cl = NULL,
  level = 1,
  node = 1,
  print_progress_iters = 1000
)

Arguments

particle_set

particles set prior to Q importance sampling step

m

number of sub-posteriors to combine

time

time T for fusion algorithm

dim

dimension of the predictors (= p+1)

data_split

list of length m where each item is a list of length 4 where for c=1,...,m, data_split[[c]]$y is the vector for y responses and data_split[[c]]$X is the design matrix for the covariates for sub-posterior c

nu

degrees of freedom in t-distribution

sigma

scale parameter in t-distribution

prior_means

prior for means of predictors

prior_variances

prior for variances of predictors

C

overall number of sub-posteriors

proposal_cov

proposal covariance of Gaussian distribution for Fusion

precondition_matrices

list of length m, where precondition_matrices[[c]] is the precondition matrix for sub-posterior c

inv_precondition_matrices

list of length m, where inv_precondition_matrices[[c]] is the inverse precondition matrix for sub-posterior c

diffusion_estimator

choice of unbiased estimator for the Exact Algorithm between "Poisson" (default) for Poisson estimator and "NB" for Negative Binomial estimator

beta_NB

beta parameter for Negative Binomial estimator (default 10)

gamma_NB_n_points

number of points used in the trapezoidal estimation of the integral found in the mean of the negative binomial estimator (default is 2)

seed

seed number - default is NULL, meaning there is no seed

n_cores

number of cores to use

cl

an object of class "cluster" for parallel computation in R. If none is passed, then one is created and used within this function

level

indicates which level this is for the hierarchy (default 1)

node

indicates which node this is for the hierarchy (default 1)

print_progress_iters

number of iterations between each progress update (default is 1000). If NULL, progress will only be updated when importance sampling is finished

Value

An updated particle set


rchan26/hierarchicalFusion documentation built on Sept. 11, 2022, 10:30 p.m.