BRAGA

02 Writing02-02 Notes02-02-389

CDF

Published 16 Apr 20263 min read
Contents
  1. 01Deep Breakdown
  2. 02Flowchart
  3. 03Real-world use
  4. 04The formula, piece by piece
  5. 05The formula in words
  6. 06Critical Concepts
  7. 07Step-by-step calculation (tiny example)
  8. 08Code examples
Φ(Z)\Phi(Z)
(1)

(Evaluated via standard normal integration)

Deep Breakdown

What it tells me (Situation Awareness): Φ(Z)\Phi(Z) is the CDF of the standard normal distribution N(0,1)N(0,1) — it has no closed form but is tabulated and available in all statistical software. For any Normal(μ,σ2\mu, \sigma^2), probabilities are computed by standardizing: P(X≤x)=Φ(x−μσ)P(X \leq x) = \Phi\left(\frac{x-\mu}{\sigma}\right). This is the most-used single function in classical statistics.

Flowchart

Normal(μ, σ²)query: P(X ≤ x)Standardize: Z =(x-μ)/σLook up Φ(Z) inz-table orscipy.stats.norm.cdf(Z)P(X ≤ x) = Φ(Z)P(a ≤ X ≤ b) =Φ((b-μ)/σ) -Φ((a-μ)/σ)

Real-world use

Where it is used

Computing z-test p-values, confidence interval bounds, probability of exceeding a threshold, and any Normal probability query. Foundation of hypothesis testing and quality control (Six Sigma).

Problem it solves

Converts a Normal probability query into a table lookup or scipy call — the integral Φ(z)=∫−∞zϕ(t)dt\Phi(z) = \int_{-\infty}^z \phi(t) dt has no closed form but is well-approximated.

How it solves the problem

Uses precomputed tables or approximations like the error function: Φ(z)=12[1+erf(z2)]\Phi(z) = \frac{1}{2}\left[1 + \text{erf}\left(\frac{z}{\sqrt{2}}\right)\right].

Example in a business

Z-test for A/B conversion rates: compute z-statistic, then p=2(1−Φ(∣z∣))p = 2(1 - \Phi(|z|)) for two-tailed test. If p<0.05p < 0.05, reject null.

The formula, piece by piece

Φ(Z)=P(Z≤z)\Phi(Z) = P(Z \leq z) where Z∼N(0,1)Z \sim N(0,1)

  • No algebraic closed form.
  • In terms of error function: Φ(z)=12[1+erf(z2)]\Phi(z) = \frac{1}{2}\left[1 + \text{erf}\left(\frac{z}{\sqrt{2}}\right)\right].
  • Quantile (inverse): Φ−1(p)\Phi^{-1}(p) = norm.ppf(p) in Python.

The formula in words

"Φ(Z)\Phi(Z) is the probability that a standard normal random variable is at or below ZZ." Key values: Φ(1.96)=0.975\Phi(1.96) = 0.975, Φ(−1.96)=0.025\Phi(-1.96) = 0.025, Φ(0)=0.5\Phi(0) = 0.5.

Critical Concepts

  • Φ(−z)=1−Φ(z)\Phi(-z) = 1 - \Phi(z) (symmetry of standard normal).
  • 95% CI uses Φ−1(0.975)=1.96\Phi^{-1}(0.975) = 1.96.
  • Python: from scipy.stats import norm; norm.cdf(z).
  • R: pnorm(z).

Step-by-step calculation (tiny example)

Step 1: Revenue ~N(10000, 2000²), query P(Revenue < 13000)

Step 2: Standardize Z=(13000−10000)/2000=1.5Z = (13000 - 10000)/2000 = 1.5

Step 3: Lookup P(X<13000)=Φ(1.5)≈0.9332P(X < 13000) = \Phi(1.5) \approx 0.9332

Step 4: Interpret 93.3% of days have revenue below $13,000.

Code examples

Beginner example (Python)

python
from scipy.stats import norm
mu, sigma = 10_000, 2_000
x_threshold = 13_000
z = (x_threshold - mu) / sigma
p_below = norm.cdf(z)
print(f"Z = {z:.2f}")
print(f"P(revenue < {x_threshold:,}) = {p_below:.4f} ({p_below*100:.1f}%)")

Beginner example (R)

r
mu <- 10000; sigma <- 2000; x_threshold <- 13000
z <- (x_threshold - mu) / sigma
p_below <- pnorm(z)
cat(sprintf("Z = %.2f | P(X < %d) = %.4f\n", z, x_threshold, p_below))

Professional example (Python)

python
import numpy as np
from scipy.stats import norm

def z_test_two_proportion( conversions_a: int, n_a: int, conversions_b: int, n_b: int, alpha: float = 0.05 ) -> dict[str, float | bool]:
    """Two-proportion z-test for A/B conversion rate comparison. Uses Φ(Z) for p-value computation. Args: conversions_a: Number of conversions in control. n_a: Total users in control. conversions_b: Number of conversions in treatment. n_b: Total users in treatment. alpha: Significance level. Returns: Dict with z-statistic, p-value, and decision. """
    p_a = conversions_a / n_a
    p_b = conversions_b / n_b
    p_pooled = (conversions_a + conversions_b) / (n_a + n_b)
    se_pooled = np.sqrt(p_pooled * (1 - p_pooled) * (1/n_a + 1/n_b))
    z_stat = (p_b - p_a) / se_pooled
    p_value = 2 * (1 - norm.cdf(abs(z_stat)))
    return { "p_a": p_a, "p_b": p_b, "z_stat": z_stat, "p_value": p_value, "significant": p_value < alpha, "relative_lift": (p_b - p_a) / p_a, }
result = z_test_two_proportion(100, 2000, 130, 2000)
print("A/B Test Z-test result:")
for key, val in result.items():
    print(f" {key}: {round(val, 4) if isinstance(val, float) else val}")

Source: domain knowledge

#probability-statistics#statistical-operations-and-random-variables#common-continuous-distributions

Keyboard shortcuts

Single keys, ignored while typing in a field or with Cmd, Ctrl or Alt held.

0
Home
1 2 3 4
Work, Writing, Tools, About
j / k
Next / previous section on this page
n / p
Next / previous project or essay
u
Up one level
l
Deutsch
t
Light or dark theme
?
This list
Esc
Close