draw_logit_samples {PosteriorBootstrap}R Documentation

Draw adaptive non-parametric learning samples for logistic regression

Description

draw_logit_samples returns samples of the parameter of interest in a logistic regression.

Usage

draw_logit_samples(
  x,
  y,
  concentration,
  n_bootstrap = 100,
  posterior_sample = NULL,
  gamma_mean = NULL,
  gamma_vcov = NULL,
  threshold = 1e-08,
  num_cores = 1,
  show_progress = FALSE
)

Arguments

x

The features of the data.

y

The outcomes of the data (either 0 or 1).

concentration

The parameter c in the paper (page 3, formula 3),

n_bootstrap

The number of bootstrap samples required.

posterior_sample

The function can take samples from the posterior to generate non-parametric-learning samples, or it can take NULL and the posterior is assumed normal N(gamma_mean, gamma_vcov). If provided, the posterior sample must have a number of columns equal to the number of covariates and a number of rows equal or larger than the 'n_bootstrap' (as the algorithm draws a new sample based on a single draw of the posterior sample).

gamma_mean

In case posterior_sample is NULL, the mean for the centering model (equation 9, page 4).

gamma_vcov

In case posterior_sample is NULL, the variance-covariance of the centering model for gamma (equation 9, page 4).

threshold

The threshold of stick remaining below which the function stops looking for more stick-breaks. It correspondes to epsilon in the paper, at the bottom of page 5 and in algorithm 2 in page 12.

num_cores

Number of processor cores for the parallel run of the algorithm. See mc.cores in mclapply for details.

show_progress

Boolean whether to show the progress of the algorithm in a progress bar.

Details

This function implements the non-parametric-learning algorithm, which is algorithm 2 in page 12 in the paper. It uses a mixture of Dirichlet processes and stick-breaking to find the number of posterior samples and logistic regression to find the randomized parameter of interest. For examples, see the vignette.

Value

A matrix of bootstrap samples for the parameter of interest.


[Package PosteriorBootstrap version 0.1.2 Index]