DS701 Session 6 — Wed Sep 23, 2026
The lecture fits a probability model to data in the same four steps twice — for Boston July temperatures and for the Prussian horse-kick counts. List the four steps, and for each dataset name the distribution family chosen and give one phrase saying why that family fits the shape of the data.
In one or two sentences, what does it mean for \(\hat\mu\) and \(\hat\sigma^2\) to be the maximum likelihood estimates of a Gaussian’s parameters, and what do those estimates turn out to be? Why does maximizing the log-likelihood give the same answer as maximizing the likelihood?
From 2,821 July days the lecture reports a 95% confidence interval for the mean July temperature of \([23.12, 23.35]\) °C, with \(\hat\mu = 23.2\) °C and \(\hat\sigma = 3.2\) °C. A friend reads this as “so 95% of July days in Boston are between 23.12 and 23.35 °C.” Explain what is wrong with that reading, and use the two fitted numbers to say roughly what range does contain about 95% of individual July days.

Fitting is cheap. Checking is what makes it a model rather than an assumption.



The Gaussian log-likelihood of the July data as \(\mu\) varies (\(\sigma\) fixed) — it peaks exactly at the sample mean.
The recipe, for any model:
\[ \ell(\mu,\sigma^2) = -\tfrac{N}{2}\log(2\pi\sigma^2) - \tfrac{1}{2\sigma^2}\textstyle\sum_n (x_n-\mu)^2 \] \[ \frac{\partial \ell}{\partial \mu} = \frac{1}{\sigma^2}\sum_n (x_n-\mu) = 0 \;\Rightarrow\; \hat\mu = \frac{1}{N}\sum_n x_n \]
.std() uses \(N-1\) — negligible for large \(N\)).df.mean(), df.cov().You will see MLE again — twice.

\(\Sigma = \begin{bmatrix}1&0\\0&1\end{bmatrix}\)

\(\Sigma = \begin{bmatrix}1&0.8\\0.8&1\end{bmatrix}\)

\(\Sigma = \begin{bmatrix}1&-0.8\\-0.8&1\end{bmatrix}\)

\[ \bar{x} \;\pm\; z_{1-\alpha/2}\,\frac{s}{\sqrt{n}}, \qquad z_{0.975} \approx 1.96 \]

Each bar is the interval from one dataset; most cover the true mean, a few miss.
Goal: run the recipe yourself on a month of Boston temperatures (Gaussian, MLE by hand and with scipy) and on the horse-kick counts (Poisson), check each fit and use it — then, as the stretch, treat your fitted Poisson as a known population and watch the Law of Large Numbers, the Central Limit Theorem, and the coverage of your own 95% confidence intervals.
numpy, pandas, matplotlib, scipy only.The activity notebook goes live on the day of the lecture. Colab is optional — you can also open it on GitHub and run it locally.
Full lecture notes: Probabilistic Modeling: Fitting Distributions to Data