normalize_log_posterior: Normalize log-posterior via simple numerical integration

Description Usage Arguments Value

View source: R/05-posthoc-quantities.R

Description

Simple implementation of the trapezoid rule for integration. The key is that this function accepts grid points and LOGGED function values and computes the integral in a numerically stable manner, using matrixStats::logSumExp().

For a single hyperparameter, the function works on uniform and non-uniform grids. For a multidimensional hyperparameter, the function only works on a uniform grid (in all dimensions).

Usage

1

Arguments

pp

logged function values

tt

grid points at which these function values were computed, as a NIGrid object

Value

A number giving the LOG of the integral of the function used to compute pp. This is the log-normalizing constant.


awstringer1/casecrossover documentation built on March 11, 2021, 4:41 a.m.