The OpenD Programming Language

uniformDiscreteLPMF

Computes the discrete uniform log probability distribution function (LPDF)

@safe pure nothrow @nogc
double
uniformDiscreteLPMF
(
const size_t x
,
const size_t lower = 0
,
const size_t upper = 1
)

Parameters

x size_t

value to evaluate LPDF

lower size_t

lower bound

upper size_t

upper bound

Examples

import mir.math.common: log;
import mir.test: shouldApprox;

1.uniformDiscreteLPMF.shouldApprox == -log(2.0);
2.uniformDiscreteLPMF(1, 3).shouldApprox == -log(3.0);

See Also

Meta