RatMath ShelfCourse guide

University: first two years

Mathematical statistics

Use the left and right arrow keys to turn pages.

Course summary

Where RatMath helps

85%

34 of 40 focal problems use RatMath for a calculation or a substantive step.

Direct calculation
30 · 75%
Assisted
4 · 10%
Worked by hand
6 · 15%

Using the packages

Finite-sample tests are particularly useful when a discrete p-value is awkward by hand. The library cannot judge a study design from an array of measurements, and a result should state the null, alternative and sampling unit.

Calculator interface

Start with the sampling unit and design, then expose the chosen reference distribution, test statistic, effect estimate and interval together. Offer exact integer sample-size output and an explicit power curve.

Packages used in the lessons

@ratmath/stats (29 days) · @ratmath/core (5 days) · @ratmath/symbolic (1 days)

How to read the percentages

Each of the 40 focal problems has equal weight. Direct means the displayed package calculation answers the computational question after the inputs are set up. Assisted means it contributes a step and the worked solution supplies essential reasoning, interpretation or selection. Worked by hand means the guide relies on a construction, argument or judgment for that task. The helpful share combines direct and assisted days. Courses and instructors assign different mixes of problems. The percentages describe this syllabus.

Classroom inputs and practical limits

34 of 40 days include a checked executable example. On 11 days the measured size sweep exercises a named API used in the lesson. Each day identifies its tested inputs and the mathematical property checked. Hand-worked days give the input scale and the argument to verify.

Ranges across the five units

Days 1–8 · Estimation. One or two parameters and about 5–200 observations for sample likelihoods; include boundary parameter values.

Unit benchmark · stats.mean, observations. Largest passing sample 100,000 (129 ms, 142.2 MiB peak process RSS). The first sampled passing call above 100 ms used 100,000 (129 ms). The runs did not locate a ceiling for this family.

Days 9–16 · Intervals and tests. One- and two-sample tests, paired observations or small contingency tables; n often 5–100 per group.

Unit benchmark · stats.tTest, observations per sample. Largest passing sample 10,000 (83.32 ms, 88.5 MiB peak process RSS). The runs did not locate a ceiling for this family.

Days 17–24 · Regression and group comparisons. Typically 1–5 predictors and tens to hundreds of rows, or 2–5 groups. Rank and residual degrees of freedom constrain the fit.

Unit benchmark · stats.leastSquares, observations. Largest passing sample 20,000 (276 ms, 132.4 MiB peak process RSS). The first sampled passing call above 100 ms used 20,000 (276 ms). The runs did not locate a ceiling for this family.

Days 25–32 · Ranks and exact inference. Small ordinal or categorical samples, commonly at most a few dozen per group for exact enumeration; ties change the null law.

Unit benchmark · stats.tTest, observations per sample. Largest passing sample 10,000 (83.32 ms, 88.5 MiB peak process RSS). The runs did not locate a ceiling for this family.

Days 33–40 · Design, power and Bayesian inference. Powers and confidence levels commonly 0.8–0.99, nonzero effects and positive target margins; sample size can explode as precision tightens.

Unit benchmark · stats.sampleSize, decimal places in margin. Largest passing sample 10 (117 ms, 89.1 MiB peak process RSS). The first sampled passing call above 100 ms used 10 (117 ms). The runs did not locate a ceiling for this family.

Accuracy notes (3)

Fixed · Large sample sizes preserve the exact ceiling. At margin 10⁻⁹, σ=1 and 95% confidence, n and the ceilings of both bound endpoints now equal 3841458820694125959. The large result is a BigInt. Preserve that type during further calculations.

Fixed · Power at the null is handled explicitly. For μ=μ₀, σ=1 and α=0.05, the continuous known-σ test has power 0.05 for every positive sample size. The planner returns the minimum n=1 for a target of 0.04.

Open · Two distinct categorical tuples can merge. A uniform table on the two arrays [‘a,sb’,‘c’] and [‘a’,‘b,sc’] should give each probability 1/2. The table reports one outcome with probability 1 because the composite string keys collide. Use unambiguous scalar IDs for such labels. Ordinary numeric dice faces have distinct keys.

Measurement method, runtime limits and complete workload results

Lecture and problem-set sequence

Days 1–8 Estimation

Write likelihoods, compute estimates and compare bias and precision.

6 direct calculation · 0 assisted · 2 worked by hand

  1. Day 1 Maximum likelihood: exponential
  2. Day 2 Maximum likelihood: Poisson
  3. Day 3 Unbiased variance
  4. Day 4 Mean and standard deviation
  5. Day 5 Moment generating function
  6. Day 6 A likelihood boundary
  7. Day 7 Squared-error loss
  8. Day 8 Sufficient summaries
Days 9–16 Intervals and tests

Choose paired or independent samples and justify assumptions for an interval or test.

5 direct calculation · 2 assisted · 1 worked by hand

  1. Day 9 Two-sample t test
  2. Day 10 Paired t test
  3. Day 11 Interval for a variance
  4. Day 12 Difference of proportions
  5. Day 13 Confidence interval for a mean
  6. Day 14 One-sample t test
  7. Day 15 Confidence versus prediction
  8. Day 16 Multiple testing
Days 17–24 Regression and group comparisons

Fit models, compare nested explanations and inspect residual structure.

7 direct calculation · 0 assisted · 1 worked by hand

  1. Day 17 One-way ANOVA
  2. Day 18 Inference for a slope
  3. Day 19 Coefficient of determination
  4. Day 20 Multiple regression
  5. Day 21 Correlation
  6. Day 22 Residuals
  7. Day 23 Confounding
  8. Day 24 Residual degrees of freedom
Days 25–32 Ranks and exact inference

Choose rank or count methods, handle ties and interpret a goodness-of-fit statistic.

6 direct calculation · 1 assisted · 1 worked by hand

  1. Day 25 Mann–Whitney test
  2. Day 26 Sign test
  3. Day 27 Fisher's exact test
  4. Day 28 Kolmogorov–Smirnov statistic
  5. Day 29 Spearman's rank correlation
  6. Day 30 Kruskal–Wallis test
  7. Day 31 Goodness of fit
  8. Day 32 Permutation inference
Days 33–40 Design, power and Bayesian inference

Choose a target effect, estimate sample size and update a prior.

6 direct calculation · 1 assisted · 1 worked by hand

  1. Day 33 Power of a z test
  2. Day 34 Sample size
  3. Day 35 Conjugate prior
  4. Day 36 Bayes with urns
  5. Day 37 Central limit theorem
  6. Day 38 Confidence interval for a proportion
  7. Day 39 Posterior predictive probability
  8. Day 40 Power at the null

Start day 1 →