normalizelogweights: Compute normalized probabilities.

normalizelogweightsR Documentation

Compute normalized probabilities.

Description

Compute normalized probabilities from unnormalized log-probabilities.

Usage

  normalizelogweights(logw)

Arguments

logw

Vector of unnormalized log-probabilities.

Details

Guards against underflow or overflow by adjusting the log-probabilities so that the largest probability is 1.

Value

Normalized probabilities such that the sum is equal to 1.

Author(s)

Peter Carbonetto peter.carbonetto@gmail.com

References

P. Carbonetto and M. Stephens (2012). Scalable variational inference for Bayesian variable selection in regression, and its accuracy in genetic association studies. Bayesian Analysis 7, 73–108.

Examples

  logw <- rnorm(6)
  w    <- normalizelogweights(logw)

varbvs documentation built on June 7, 2023, 5:43 p.m.