Q_IS_BLR: Q Importance Sampling Step

View source: R/BLR_fusion.R

Q_IS_BLRR Documentation

Q Importance Sampling Step

Description

Q Importance Sampling weighting for Bayesian logistic regression

Usage

Q_IS_BLR(
  particle_set,
  m,
  time,
  dim,
  data_split,
  prior_means,
  prior_variances,
  C,
  proposal_cov,
  precondition_matrices,
  inv_precondition_matrices,
  cv_location = "hypercube_centre",
  diffusion_estimator,
  beta_NB = 10,
  gamma_NB_n_points = 2,
  local_bounds = TRUE,
  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, data_split[[c]]$full_data_count is the unique rows of the full data set with their counts and data_split[[c]]$design_count is the unique rows of the design matrix and their counts

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

cv_location

string to determine what the location of the control variate should be. Must be either 'mode' where the MLE estimator will be used or 'hypercube_centre' (default) to use the centre of the simulated hypercube

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)

local_bounds

logical value indicating if local bounds for the phi function are used (default is TRUE)

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.