Precompute weights for integration of density over observed bins
Source:R/prepare_data.R
precompute_weights.Rd
We have a set of weight bins with boundaries w_bin_boundaries
and need
an efficient way to integrate a probability density to determine a
probability for each bin. The probability density is available at the set
of weights given in the vector w
. We want to use linear interpolation
for the density between these values. Because the values in w
do not
align with the values in w_bin_boundaries
we need to split each bin into
segments. In this function we want to
precompute the weights with which we need to add up the density values to
approximate the integral over each bin.