Distribution Approximation Overlay
The learner overlays an exact law (binomial, Poisson, hypergeometric, t, Cauchy, ...) with its approximating law, moves the parameters (optionally holding np or K/N fixed) and drags an event's endpoints. They see the exact and approximate probabilities with and without the continuity correction, their errors, the largest cdf gap, total variation, an optional Berry-Esseen / Stein-Chen bound, critical values and log-scale tails.
Used in: Introduction to Probability Theory
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | "<Exact> vs <Approx> approximation" | Title bar text. |
| exact | object | string | {"family": "binomial", "params": {"n": 40, "p": 0.3}} | The exact law, any distribution spec: {family, params} (binomial n/p, poisson lambda, hypergeometric N/K/n, student-t df, cauchy location/scale, normal mean/sd, ...) or a string such as "Binomial(40, 0.3)". |
| approx | object | string | "normal" (moment-matched) | The approximating law. A bare family name is tied automatically: normal matches the exact mean and sd, poisson uses lambda = mean, binomial of a hypergeometric uses n and p = K/N. Or give {family, tie: "mean = n*p, var = n*p*(1-p)"} (symbols: exact params, mean, var, sd) or fixed params. |
| sliders | string | (string | {name, min?, max?, step?, initial?, label?})[] | boolean | all exact params | Exact-law parameters the learner can move (e.g. "n", ["n", "p"], [{"name": "N", "min": 20, "max": 2000}]). false hides the sliders. Wide positive ranges use a log slider. |
| holdFixed | string | none | Keep a parameter combination fixed while a slider moves, e.g. "n*p = 3" (p follows n) or "K/N" (K follows N, at its initial ratio). |
| view | string | "pmf" | Initial view: 'pmf' (mass/density overlay), 'cdf' (distribution functions plus the error F - G), 'tails' (P(X > x) on a log scale). |
| views | string[] | ["pmf", "cdf", "tails"] | Views offered in the view switch (one entry hides the switch). |
| event | string | none ("X <= 10" in the bare render) | Event whose probability is compared: "X <= c", "X < c", "X >= c", "X > c", "X = k", "a <= X <= b", "|X| > c", "|X| <= c" (a symbol such as c picks a default). Endpoints are draggable. |
| eventEditable | boolean | true | Show the event-type picker. |
| continuityCorrection | boolean | true | Initial state of the continuity-correction toggle (shown when a lattice exact law is approximated by a continuous law). Both corrected and uncorrected values are always listed. |
| showErrors | boolean | true | Show the error column |approx - exact|. |
| showDistance | boolean | true | Show sup |F - G| (and the corrected lattice error, and total variation when meaningful). |
| bound | string | none | Theoretical bound to compare: 'berry-esseen' (binomial or Poisson exact, C = 0.4748, vs sup |F - G|), 'stein-chen' or 'le-cam' (binomial exact vs Poisson, vs total variation), or an expression in the exact params (C available). |
| boundMetric | string | "kolmogorov" | Distance an expression bound is compared with: 'kolmogorov' (sup |F - G|) or 'tv'. |
| criticalAlpha | number | none | Upper-tail area alpha in (0, 0.5): marks both laws' upper critical values, the exact tail beyond the approximate one and, for symmetric laws, the exact coverage of +/- the approximate critical value. |
| showMoments | boolean | false | Show mean, sd, variance ratio (finite population correction for hypergeometric) and skewness. |
| showRuleOfThumb | boolean | true | Show the rule-of-thumb line (np and n(1-p) >= 5, lambda >= 10, sampling fraction n/N) when it applies. |
| xRange | [number, number] | auto | Override the plot's x window. |
| exactLabel | string | "Exact" | Legend / table name of the exact law. |
| approxLabel | string | "Approx." | Legend / table name of the approximation. |
| controls | string[] | all controls shown | Ids of the hideable controls to show (see the controls registry): the CDF and Tails views (view.cdf, view.tails), the continuity-correction toggle with its corrected rows and shading (toggle.continuity-correction), and the sup |F - G| and total-variation rows (readout.kolmogorov, readout.total-variation). The view the props open on always stays. Core controls always show; absent = everything. Fitted per page by component_scopes.py, not by hand. |
PreviousNext