Confidence Interval Coverage Simulator
The learner draws many samples and sees each one's interval stacked against the true value, with a running coverage count and its Monte Carlo error; procedures (z, t, bootstrap, signed-rank, chi-squared, Wald/Wilson/exact, prediction, tolerance) can be compared on the same samples, with sliders for n, level and p and an exact coverage-versus-p curve for proportions.
Used in: Introduction to Statistics
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | Title bar text. Default depends on the procedures. |
| population | string | object | {"family": "normal", "params": {"mean": 50, "sd": 12}} | Population every sample is drawn from: any distribution spec the sampling core parses ("N(50, 144)", "exponential", {family, params}, a mixture). For proportion procedures only its p (and binomial n) is read. |
| populations | array | — | Several populations (specs, each optionally with a "label") the learner picks from; overrides population. |
| procedure | string | "t" | Interval procedure: z, t, z-with-s, bootstrap-percentile, signed-rank, chi-squared-variance, prediction, tolerance, wald, wilson, wilson-cc, agresti-coull, clopper-pearson, jeffreys. prediction targets one new observation; tolerance must contain a proportion `content` of the population. |
| procedures | string[] | — | Up to 4 procedures shown side by side on the SAME samples (all continuous-data or all proportion); overrides procedure. |
| statistic | string | "mean" | Statistic the bootstrap-percentile interval is built for (mean or median); its target follows. |
| level | number | 0.95 | Confidence level 1 − α (for tolerance: the confidence γ). |
| content | number | 0.9 | Tolerance interval content P (the population proportion it must contain). |
| n | number | 10 | Sample size (proportion procedures: number of trials; default 20). |
| nValues | number[] | — | Sample sizes the learner switches between (toggle above the plots). |
| p | number | 0.3 | True proportion for proportion procedures. |
| parameters | array | — | Sliders [{name, min, max, initial, step?, label?}] for name in n, level, p, content. |
| replicates | number | 40 | Number of samples drawn on load (the learner draws more; capped by a work budget). |
| maxRows | number | 50 | Most recent intervals drawn as rows (coverage counts every sample). |
| view | string | "intervals" | intervals (stacked repeated intervals) or coverage-curve (exact coverage against the true p; proportion procedures only). |
| pRange | [number, number] | [0.01, 0.99] | Range of p on the coverage curve. |
| showSuccessFailure | boolean | false | Shade where np ≥ 10 and n(1 − p) ≥ 10 on the coverage curve. |
| bootstrapB | number | 400 | Bootstrap resamples per interval. |
| showSample | boolean | true | Show the latest sample, its intervals and (bootstrap) its resampling histogram. |
| seed | number | string | 1 | Seed of the simulation (same seed, same samples). |
| controls | string[] | all controls shown | Ids of the hideable readouts and toggles to show (see the controls registry: readout.mc-se, readout.miss-rate, readout.exact-coverage, view.coverage-curve). Core controls always show. Page building fills this from the subject's topic scope. |
PreviousNext