Skip to contents

This is an experimental function to perform variational inference for binomial logistic regression models.

Usage

vb_logistic_n(
  X,
  y,
  n,
  mu0,
  Sigma0,
  mu_init,
  Sigma_init,
  tol = 1e-08,
  maxiter = 1000L,
  maxiter_jj = 25L,
  alg = "jj",
  verbose = FALSE
)

Arguments

X

The design matrix

y

The response vector

n

The trial vector

mu0

The prior mean for beta paramter

Sigma0

The prior variance for beta parameter

mu_init

Initial value for mu for optimisation.

Sigma_init

Initial value for Sigma for optimisation.

tol

The tolerance level to assess convergence

maxiter

The maximum number of iterations

maxiter_jj

The maximum number of Jaakkola-Jordan iterations to initialise estimation

alg

The algorithm used for final estimation of variational parameters. Must be one of jj, sj, or kmw.

verbose

Print trace of the lower bound to console. Default is FALSE.

Value

A list containing:

converged

Indicator for algorithm convergence.

jj_converged

Indicator for convergence of initial Jaakkola-Jordan iterations.

elbo

Vector of the ELBO sequence.

mu

The optimised value of mu.

Sigma

The optimised value of Sigma.

Details

By default, the algorithm always intialises with Jaakkola-Jordan updates until convergence or maxiter_jj.