Lecture 08
September 24, 2025

Text: VSRIKRISH to 22333
Uncertainty can come from:
Two (broad) types of uncertainties:

Source: XKCD 2440
Probability is a language for expressing uncertainty.
The axioms of probability are straightforward:
Probability distributions associate a probability to every event under consideration (the event space) and have to follow these axioms.
A continuous distribution \(\mathcal{D}\) has a probability density function (PDF) \(f_\mathcal{D}(x) = p(x | \theta)\).
The probability of \(x\) occurring in an interval \((a, b)\) is \[\mathbb{P}[a \leq x \leq b] = \int_a^b f_\mathcal{D}(x)dx.\]
Important: \(\mathbb{P}(x = x^*)\) is zero!
Discrete distributions have probability mass functions (PMFs) which are defined at point values, e.g. \(p(x = x^*) \neq 0\).
If \(\mathcal{D}\) is a distribution with PDF \(f_\mathcal{D}(x)\), the cumulative density function (CDF) of \(\mathcal{D}\) is \(F_\mathcal{D}(x)\):
\[F_\mathcal{D}(x) = \int_{-\infty}^x f_\mathcal{D}(u)du.\]
Since \[F_\mathcal{D}(x) = \int_{-\infty}^x f_\mathcal{D}(u)du,\]
if \(f_\mathcal{D}\) is continuous at \(x\), the Fundamental Theorem of Calculus gives: \[f_\mathcal{D}(x) = \frac{d}{dx}F_\mathcal{D}(x).\]
The quantile function is the inverse of the CDF:
\[q(\alpha) = F^{-1}_\mathcal{D}(\alpha)\]
So \[x_0 = q(\alpha) \iff \mathbb{P}_\mathcal{D}(X < x_0) = \alpha.\]
Specifying a distribution is making an assumption about observations and any applicable constraints.
Examples: If your observations are…
A distribution implicitly answers questions like:
The tails of distributions represent the probability of high-impact outcomes.
Key consideration: Small changes to these (low) probabilities can greatly influence risk.
There is no right answer to this, no matter what a statistical test tells you.
For example, suppose our data are counts of events:
We often don’t want to just know if a particular event \(A\) has a certain probability, but also how other events (call them \(B\)) might depend on that outcome.
In other words:
We want the conditional probability of \(B\) given \(A\), denoted \(\mathbb{P}(B|A)\).
We can write conditional probabilities in terms of unconditional probabilities:
\[\mathbb{P}(B|A) = \frac{\mathbb{P}(BA)}{\mathbb{P}(A)}.\]
Monte Carlo simulation: Propagating random samples through a model to estimate a value (usually an expectation or a quantile).
Monte Carlo is a broad method, which can be used to:
Goal: Estimate \(\mathbb{E}_f\left[h(x)\right]\), \(x \sim f(x)\)
Monte Carlo principle:
How can we use MC to estimate \(\pi\)?
Hint: Think of \(\pi\) as an expected value…
Finding \(\pi\) by sampling random values from the unit square and computing the fraction in the unit circle. This is an example of Monte Carlo integration.
\[\frac{\text{Area of Circle}}{\text{Area of Square}} = \frac{\pi}{4}\]
What is the probability of rolling 4 dice for a total of 19?
Can simulate dice rolls and find the frequency of 19s among the samples.
Would like to estimate the CDF \(F\) with some approximation \(\hat{F}_n\), then compute \(\hat{z}^\alpha_n = \hat{F}_n^{-1}(\alpha)\) as an estimator of the \(\alpha\)-quantile \(z^\alpha\).
Given samples \(\hat{\mathbf{y}} = y_1, \ldots, y_n \sim F\), define \[\hat{F}_n(y) = \frac{1}{n} \sum_{i=1}^n \mathbb{I}(y_i \leq y)\] and \(\hat{z}^\alpha_n = \hat{F}_n^{-1}(\alpha)\).
This type of estimation can be repeated with any simulation model that has a stochastic component.
For example, consider our dissolved oxygen model. Suppose that we have a probability distribution for the inflow DO.
How could we compute the probability of DO falling below the regulatory standard somewhere downstream?
Monday: Monte Carlo Lab (clone before class, maybe instantiate environment too)
Wednesday: Why Does Monte Carlo Work?