Function wt::product_distribution(const distribution1d_t *, const distribution1d_t *)

Function Documentation

inline product_distribution_ret_t<std::unique_ptr<distribution1d_t>> wt::product_distribution(const distribution1d_t *f, const distribution1d_t *g)

Computes the normalized product distribution of two independent distributions: \( h(x) = \frac{ f(x)g(x) }{ R_0 } \), where \( f,g \) are the input PDFs, and \( R_0 = \int \mathrm dx f(x)g(x) \) is the normalization factor. The returned distribution will always be one of the following:

  1. wt::discrete_distribution_t<wt::vec2_t>

  2. wt::piecewise_linear_distribution_t

  3. wt::uniform_distribution_t

Depending on the input, the computed distribution may not be exact. Also returns the normalization factor \( R_0 \). See wt::product_distribution_ret_t.