mcframework.utils.z_crit#
- mcframework.utils.z_crit(confidence: float) float[source]#
Two-sided normal critical value \(z_{\alpha/2}\).
For a given confidence level \(1-\alpha\), this returns the upper \(1-\alpha/2\) quantile of the standard normal, i.e. \(z_{\alpha/2} = \Phi^{-1}(1-\alpha/2)\).
- Parameters:
- confidence
float Confidence level in
(0, 1)(e.g.0.95).
- confidence
- Returns:
float\(z_{\alpha/2}\).
- Raises:
ValueErrorIf
confidenceis not in(0, 1).
Examples
>>> round(z_crit(0.95), 2) 1.96