mcframework.stats_engine.markov_error_prob#

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

Markov bound on error probability for target \(\theta\).

Using the squared error of the sample mean, \(\mathrm{MSE}(\bar X) \approx \frac{s^2}{n_\text{eff}} + \text{Bias}^2\), Markov gives

\[\Pr\!\left(\,|\bar X - \theta| \ge \varepsilon\,\right) \;\le\; \frac{\mathrm{MSE}(\bar X)}{\varepsilon^2}.\]

The \(\mathrm{MSE}(\bar X)\) term is delegated to mse_to_target() so the two metrics share a single definition of estimator MSE.

Parameters:
xndarray

Input sample.

ctxStatsContext or Mapping

Requires target and eps. The effective sample size enters the bound through the \(s^2/n_\text{eff}\) variance term.

Returns:
float

Upper bound (non-negative; can exceed 1 when the bound is vacuous).