mcframework.stats_engine.mse_to_target#

mcframework.stats_engine.mse_to_target(x: ndarray, ctx: StatsContext) float[source]#

Mean squared error of \(\bar X\) relative to a target \(\theta\).

Approximated by

\[\mathrm{MSE}(\bar X) \approx \frac{s^2}{n} + (\bar X - \theta)^2.\]
Parameters:
xndarray

Input sample.

ctxStatsContext or Mapping

Requires target.

Returns:
float

Estimated mean squared error relative to target.