View source: R/BRR_generalised_BF.R
rho_j_BRR | R Documentation |
rho_j Importance Sampling weighting for Bayesian robust regression
rho_j_BRR( particle_set, m, time_mesh, dim, data_split, nu, sigma, prior_means, prior_variances, C, precondition_matrices, inv_precondition_matrices, Lambda, resampling_method = "multi", ESS_threshold = 0.5, sub_posterior_means = NULL, adaptive_mesh = FALSE, adaptive_mesh_parameters = NULL, record = FALSE, 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 )
particle_set |
particles set prior to Q importance sampling step |
m |
number of sub-posteriors to combine |
time_mesh |
time mesh used in Bayesian Fusion |
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 |
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 |
Lambda |
inverse of the sum of the inverse precondition matrices (which can be computed using inverse_sum_matrices(inv_precondition_matrices)) |
sub_posterior_means |
matrix with m rows and d columns, where sub_posterior_means[c,] is the sub-posterior mean of sub-posterior c |
adaptive_mesh |
logical value to indicate if an adaptive mesh is used (default is FALSE) |
adaptive_mesh_parameters |
list of parameters used for adaptive mesh |
record |
logical value indicating if variables such as E[nu_j], chosen, mesh_terms and k4_choice should be recorded at each iteration and returned (see return variables for this function) - default is FALSE |
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 |
A list with components:
updated particle set after the iterative rho_j steps
proposal samples for the last time step
elapsed time of each step of the algorithm
effective sample size of the particles after each step
conditional effective sample size of the particles after each step
boolean value to indicate if particles were resampled after each time step
If record is set to TRUE, additional components will be returned:
approximation of the average variation of the trajectories at each time step
which term was chosen if using an adaptive mesh at each time step
the evaluated terms in deciding the mesh at each time step
which of the roots of k4 were chosen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.