| name | statistical-computing |
| description | Computational tools and algorithms for statistical analysis. Covers simulation, resampling methods (bootstrap, permutation tests), Monte Carlo methods, random number generation, numerical optimization (Newton-Raphson, EM algorithm), cross-validation, and reproducible analysis workflows. Emphasizes the bootstrap revolution and the shift from formula-based to computation-based inference. Use when implementing statistical procedures, running simulations, bootstrapping confidence intervals, performing cross-validation, or building reproducible analysis pipelines. |
| type | skill |
| category | statistics |
| status | stable |
| origin | tibsfox |
| modified | false |
| first_seen | "2026-04-11T00:00:00.000Z" |
| first_path | examples/skills/statistics/statistical-computing/SKILL.md |
| superseded_by | null |
Statistical Computing
Statistical computing transformed the discipline. Before 1970, inference depended on mathematical formulas and tables. The bootstrap (Efron, 1979), permutation tests, and Monte Carlo methods showed that a computer could replace analytical derivations with brute-force resampling -- and often provide more accurate answers with fewer assumptions. This skill covers the computational toolkit that modern statistics depends on.
Agent affinity: efron (bootstrap, computational methods), box (simulation for model checking), george (simulation-based pedagogy)
Concept IDs: stat-probability-foundations, stat-hypothesis-testing, stat-descriptive-statistics
The Bootstrap
The idea
Given a sample of n observations, the bootstrap generates new "samples" by resampling with replacement from the original data. Each bootstrap sample has size n. The distribution of a statistic across many bootstrap samples approximates the sampling distribution of that statistic.
Algorithm (nonparametric bootstrap)
- Observe data x_1, x_2, ..., x_n.
- For b = 1, 2, ..., B (typically B = 1000 to 10000):
a. Draw a sample of size n with replacement from the original data.
b. Compute the statistic of interest T_b (e.g., mean, median, regression coefficient).
- The distribution of T_1, T_2, ..., T_B approximates the sampling distribution of T.
Bootstrap confidence intervals
| Method | Construction | Properties |
|---|
| Percentile | [T_(alpha/2), T_(1-alpha/2)] from bootstrap distribution | Simple; can be biased for skewed distributions |
| Basic (reverse percentile) | [2T_obs - T_(1-alpha/2), 2T_obs - T_(alpha/2)] | Corrects for some bias |
| BCa (bias-corrected and accelerated) | Adjusts percentiles for bias and skewness | Gold standard; requires more computation |
| Studentized | Bootstrap the t-statistic, not the raw estimate | Best coverage properties; most complex |
When to use the bootstrap:
- When the sampling distribution of the statistic has no closed-form formula.
- When the sample size is too small for the CLT to apply.
- When you want to check whether a formula-based interval is trustworthy.
- For statistics that are not simple means (medians, ratios, trimmed means, correlation coefficients).
When the bootstrap fails
- Very small samples (n < 10): not enough data to resample meaningfully.