Skip to main content

predictive_standard_deviation

Function predictive_standard_deviation 

Source
pub fn predictive_standard_deviation(
    moments: &MultinomialPredictiveMoments,
) -> Result<Array2<f64>, EstimationError>
Expand description

Per-class posterior standard deviation of the probability, from the moments above: sd(p_c) = sqrt(E[p_c²] − E[p_c]²).

A materially negative variance is refused rather than clamped: E[p_c²] and E[p_c] come from two different ratios, so a negative difference means the two expansions disagree by more than the quantity being reported, which is exactly the situation in which a clamped sd = 0 would be a lie.