Skip to contents

vbnopt and vinfer are one procedure under two names; one is implemented, the other re-exports it. The procedure is from Jordan, Ghahramani, Jaakkola and Saul (1999), Machine Learning 37(2):183-233, doi:10.1023/A:1007665907178 – maximise ELBO(q) = E_q[log p(x,z)] - E_q[log q(z)] over a factorised q by the coordinate update log q\*_j = E_{q_{-j}}[log p(x,z)] + const. "ELBO max" and "mean-field" are two names for one thing: the factorisation is the constraint, the ELBO is the objective.

Usage

Vbnopt(
  log_p = "normal-gamma",
  q = "meanfield",
  x = NULL,
  mu0 = 0,
  lambda0 = 0,
  a0 = 0,
  b0 = 0,
  max_iter = 200,
  tol = 1e-12
)

Arguments

log_p

Name of the joint; only "normal-gamma" is implemented.

q

Variational family; only "meanfield" is implemented.

x

Observed sample.

mu0, lambda0, a0, b0

Normal-Gamma prior hyperparameters.

max_iter

Maximum coordinate sweeps.

tol

Stop when E[tau] moves by less than this.

Value

As Vinfer.

References

Jordan, M.I., Ghahramani, Z., Jaakkola, T.S. and Saul, L.K. (1999). Machine Learning 37(2):183-233. doi:10.1023/A:1007665907178.

Examples

Vbnopt("normal-gamma", "meanfield", c(1, 2, 3, 4, 5))$e_tau
#> [1] 0.5