parametrize

Takes a distribution function (CDF or PDF/PMF) as a template argument, and parameters as function arguments in the order that they appear in the function declaration and returns a delegate that binds the supplied parameters to the distribution function. Assumes the non-parameter argument is the first argument to the distribution function.

double delegate(
ParameterTypeTuple!(distrib)[0]
)
parametrize
(
alias distrib
)
(
ParameterTypeTuple!(distrib)[1..$] parameters
)

Examples

auto stdNormal = parametrize!(normalCDF)(0.0L, 1.0L);

stdNormal is now a delegate for the normal(0, 1) distribution.

Meta