R/ELBO.R

Defines functions ELBO

#' ELBO
#' @description returns a Monte Carlo or quasi-Monte Carlo estimate of the ELBO
#' @param lambda samples of theta from approximating distribution Q
#' @param LogPostLike  log posterior likelihood function
#' @param control_pars list of algo control parameters
#' @param S number of samples to use for the approximation
#' @param ... additional parameters for LogPostLike
#' @noRd
ELBO <- function(lambda, LogPostLike, control_pars, S, ...) {
  # Monte Carlo approximation ELBO
  out <- KLHat(lambda, LogPostLike, control_pars, S, ...) * -1
  return(out)
}

Try the DEBBI package in your browser

Any scripts or data that you put into this service are public.

DEBBI documentation built on May 17, 2022, 5:08 p.m.