elbo: Compute the evidence lower bound (ELBO)

Description Usage Arguments Value Details

View source: R/elbo.R

Description

Compute the evidence lower bound (ELBO)

Usage

1
elbo(Y, delta, X, fit, nrep = 10000, center = TRUE)

Arguments

Y

Failure times.

delta

Censoring indicator, 0: censored, 1: uncensored.

X

Design matrix.

fit

Fit model.

nrep

Number of Monte Carlo samples.

center

Should the design matrix be centered.

Value

Returns a list containing:

mean

The mean of the ELBO.

sd

The standard-deviation of the ELBO.

expected.likelihood

The expectation of the likelihood under the variational posterior.

kl

The KL between the variational posterior and prior.

Details

The evidence lower bound (ELBO) is a popular goodness of fit measure used in variational inference. Under the variational posterior the ELBO is given as

ELBO = E_{\tilde{Π}}[\log L_p(β; Y, X, δ)] - KL(\tilde{Π} \| Π)

where \tilde{Π} is the variational posterior, Π is the prior, L_p(β; Y, X, δ) is Cox's partial likelihood. Intuitively, within the ELBO we incur a trade-off between how well we fit to the data (through the expectation of the log-partial-likelihood) and how close we are to our prior (in terms of KL divergence). Ideally we want the ELBO to be as small as possible.


survival.svb documentation built on Jan. 17, 2022, 5:07 p.m.