normalize_weight: Normalize vector of log-weights

Description Usage Arguments Value Examples

View source: R/normalize_weight.R

Description

Takes a vector of real values, and return the vector of normalized exponentiated values, as well as average of the exponentiated unnormalized values.

Usage

1
normalize_weight(logweights)

Arguments

logweights

is a vector of n real values

Value

a vector of n non-negative values summing to one

Examples

1
2
3
4
N <- 1000
logweights <- rnorm(N)
normalize_weight_results <- normalize_weight(logweights)
normalized_weights <- normalize_weight_results$nw

pierrejacob/PET documentation built on May 25, 2019, 11:35 p.m.