Lecture 8 · Probability and Estimation · November 4

From Noisy Readings to Reliable Estimates

Which position should a noisy sensor report?

mreading indexfixed state

One stationary object. Several different readings.

state · measurements · inferred answer

Report an estimate and the uncertainty around it.

Mathematics for Robotics · ROB-GY 6013 · NYU Tandon · Jing Zhang · Fall 2026

Probability model; parameter estimation — [1] DL §3.1 · [1] DL §5.5.1 · Course example

Lecture roadmap

From Readings to Estimates

How does the lecture fit together?

$$z=x+\varepsilon$$
$x$
unknown state (m)
$z$
observed reading (m)
$\varepsilon$
random error (m)
1. Model errorAssign probabilitiesDescribe spread2. Use observationsCombine informationUpdate uncertainty3. Estimate parametersCompare methodsPoint estimate4. Report uncertaintyCompare intervalsInterpret 95%

Estimate the fixed state from noisy readings.

Probability distribution; uncertainty — [1] DL §3.1 · Course concept map

Definition and reasoning

Random variables

How does an outcome become a number?

$$x:\Omega\to\mathbb R,\qquad x(\omega)\in\{-1,0,2\}$$
$\Omega$
sample space: all possible outcomes
$\omega$
one outcome
$x$
random error here, not position (cm)
Outcome A → −1 cm
Outcome B → 0 cm
Outcome C → 2 cm

The rule is fixed; the outcome is uncertain.

Random variable; realization — [1] DL §3.2

Definition and reasoning

Probability Mass Function (PMF)

How do probabilities attach to discrete values?

$$p(a)=P(x=a),\qquad p(a)\geq0,\qquad\sum_a p(a)=1$$
$x$
random error (cm)
$a$
possible value (cm)
$p(a)$
probability of $x=a$
$P$
event probability

Probability mass function (PMF) — [1] DL §3.3.1

Definition and reasoning

Probability Mass Function (PMF)

What does the three-point error model predict?

Error values −1, 0, 2 cm; masses ¼, ½, ¼. Find nonnegative-error probability and mean.

$$P(x\geq0)=\tfrac12+\tfrac14=\tfrac34,\qquad \mu=(-1)\tfrac14+0\tfrac12+2\tfrac14=\tfrac14$$
$P$
event probability
$x$
error (cm)
$\mu$
mean error (cm)

Discrete probability; expectation — [1] DL §3.3.1 · [1] DL §3.8 · Course example

Choose, explain, vote

Probability Mass Function (PMF)

Which values belong to the event?

Errors $-1,0,2$ cm have masses $1/2,1/4,1/4$. What is $P(x\geq0)$?

  1. A$1/4$: count only positive errors.
  2. B$1/2$: include zero and positive errors.✓
  3. C$2/3$: two of three possible values.

$P(x\geq0)=p(0)+p(2)=1/4+1/4=1/2$. Total mass is $1$.

Solution 1 / 3

Identify the event

$x$: error (cm); $p(a)=P(x=a)$: probability mass at value $a$.

  1. $x$: error in cm; $p(a)=P(x=a)$: probability mass at $a$.
  2. Possible values: $-1,0,2$; masses: $1/2,1/4,1/4$.
  3. Nonnegative means $x\geq0$, so include $0$ and $2$.

Solution 2 / 3

Add the included masses

$x$: error (cm); $p(a)=P(x=a)$: probability mass at value $a$.

  1. $P(x\geq0)=P(x=0)+P(x=2)$.
  2. $=1/4+1/4=2/4=1/2$.
  3. Check: $P(x<0)+P(x\geq0)=1/2+1/2=1$.

Solution 3 / 3

Choose B

$x$: error (cm); $p(a)=P(x=a)$: probability mass at value $a$.

  1. A excludes zero and answers a different event.
  2. B includes both nonnegative values and their masses.
  3. C treats unequal masses as equal. Count probability, not values.

Event probability; PMF — [1] DL §3.3.1 · Course question

Definition and reasoning

Probability Density Function (PDF)

Why does a continuous event need an area?

$$\begin{gathered}p(t)\geq0,\quad\int_{-\infty}^{\infty}p(t)\,dt=1\\P(a\leq x\leq b)=\int_a^b p(t)\,dt\end{gathered}$$
$x$
random error (cm)
$a,b$
interval endpoints
$t$
integration variable
$p(t)$
density (cm$^{-1}$)
$$P(x=c)=\int_c^c p(t)\,dt=0$$
$c$
fixed error value

Probability density function (PDF) — [1] DL §3.3.2

Definition and reasoning

Probability Density Function (PDF)

Can a valid density be greater than one?

uniform error

$$p(t)=4\ \ (0\leq t\leq .25),\quad P(.05\leq x\leq .15)=4(.15-.05)=.4$$
$t,x$
error (cm)
$p$
density (cm⁻¹)
$P$
interval probability

Uniform density; normalization — [1] DL §3.3.2 · Course example

Choose, explain, vote

Probability Density Function (PDF)

Density is height; probability is area

$x$ is uniform on $[0,.5]$ cm. Which statement is valid?

  1. ADensity $2$ cm$^{-1}$; $P(.1\le x\le.3)=.4$.✓
  2. BDensity $2$ means event probability $2$.
  3. CProbability is $.2$, the interval width alone.

$h(.5)=1\Rightarrow h=2$; mass $=h(.3-.1)=.4$.

Solution 1 / 3

Normalize the density

$x$: error (cm); $h$: uniform density; $t$: integration variable (cm).

  1. $x$: error in cm; $h$: constant density on $[0,.5]$.
  2. Total probability is area: $h(.5-0)=1$.
  3. $h=1/.5=2\ \mathrm{cm}^{-1}$.

Solution 2 / 3

Integrate over the requested interval

$x$: error (cm); $h$: uniform density; $t$: integration variable (cm).

  1. $P(.1\leq x\leq.3)=\int_{.1}^{.3}h\,dt$.
  2. $=2(.3-.1)=2(.2)=.4$.
  3. Density times width has units $\mathrm{cm}^{-1}\mathrm{cm}=1$.

Solution 3 / 3

Choose A

$x$: error (cm); $h$: uniform density; $t$: integration variable (cm).

  1. A gives both the normalized density and event probability.
  2. B confuses density height with probability; probabilities cannot exceed 1.
  3. C omits the height: width alone is not the area.

Density; event probability — [1] DL §3.3.2 · Course question

Definition and reasoning

Moments

How do we average a function of a random value?

$$\mathbb E[g(x)]=\sum_a g(a)p(a)$$
$x$
discrete random variable
$a$
possible value
$g$
function being averaged
$p$
PMF
$$\mathbb E[g(x)]=\int_{-\infty}^{\infty}g(t)p(t)\,dt$$
$x$
continuous random variable
$t$
integration variable
$p$
density
$g$
assume E[|g(x)|] is finite

Expectation of a function — [1] DL §3.8 · Course derivation

Choose, explain, vote

Moments

What does centering remove?

$\operatorname{Var}(x)=\mathbb E[(x-\mu)^2]$. Given $\mu=1/4$ cm and $\mathbb E[x^2]=5/4$ cm$^2$, choose the variance.

  1. A$5/4$: the second moment is always variance.
  2. B$1$: subtract the mean, not its square.
  3. C$19/16$: subtract the squared mean.✓

$\operatorname{Var}(x)=\mathbb E[x^2]-\mu^2=5/4-1/16=19/16$ cm$^2$.

Solution 1 / 3

Expand the centered square

$x$: error; $\mathbb E$: expectation; $\mu=\mathbb E[x]$: mean; $\operatorname{Var}$: variance.

  1. $x$: error; $\mu=\mathbb E[x]=1/4$ cm.
  2. $\mathbb E[x^2]=5/4$ cm$^2$ is the second moment.
  3. $(x-\mu)^2=x^2-2\mu x+\mu^2$.

Solution 2 / 3

Take expectation, then substitute

$x$: error; $\mathbb E$: expectation; $\mu=\mathbb E[x]$: mean; $\operatorname{Var}$: variance.

  1. $\operatorname{Var}(x)=\mathbb E[x^2]-2\mu\mathbb E[x]+\mu^2$.
  2. $\mathbb E[x]=\mu\ \Rightarrow\ \operatorname{Var}(x)=\mathbb E[x^2]-\mu^2$.
  3. $=5/4-(1/4)^2=20/16-1/16=19/16$ cm$^2$.

Solution 3 / 3

Choose C

$x$: error; $\mathbb E$: expectation; $\mu=\mathbb E[x]$: mean; $\operatorname{Var}$: variance.

  1. A leaves the squared mean inside the second moment.
  2. B subtracts a length from a squared length; its units do not match.
  3. C subtracts the squared mean and measures spread around the mean.

Centering; variance — [1] DL §3.8 · Course question

Definition and reasoning

Moments

What is the mean of a random column vector?

$$x=\begin{bmatrix}x_1\\x_2\end{bmatrix},\qquad\mu=\mathbb E[x]=\begin{bmatrix}\mathbb E[x_1]\\\mathbb E[x_2]\end{bmatrix}$$
$x$
random column in R²
$x_i$
component i
$\mu$
mean column in R²

Average corresponding components; preserve the column shape.

Samples use superscripts: $x^{(s)}$. Components use subscripts: $x_i$.

Random vector; mean vector — [1] DL §3.8

Definition and reasoning

Moments

Why does covariance use an outer product?

$$\Sigma=\mathbb E[(x-\mu)(x-\mu)^T],\qquad\Sigma_{ij}=\mathbb E[(x_i-\mu_i)(x_j-\mu_j)]$$
$x,\mu$
random column and mean in Rᵈ
$\Sigma$
population covariance, d × d
$i,j$
coordinate indices

Diagonal: component variance. Off-diagonal: paired deviations.

Covariance matrix — [1] DL §3.8 · Course derivation

Definition and reasoning

Moments

Why is covariance positive semidefinite?

$$a^T\Sigma a=\mathbb E[(a^T(x-\mu))^2]\geq0$$
$a$
fixed direction column in Rᵈ
$x,\mu$
random column and population mean
$\Sigma$
population covariance: PSD means $a^T\Sigma a\geq0$ for every $a$
$$C=\frac{X_c^TX_c}{N-1}\quad(N>1)$$
$C$
sample covariance estimate
$X_c$
N centered sample rows
$N$
number of samples

Positive semidefinite covariance — [1] DL §3.8 · Course derivation

Definition and reasoning

Moments

How do independent signs create correlation?

Independent fair signs U,V: knowing one does not change the other's probabilities. Let $x=(U,U+V)^T$.

$$\mu=\begin{bmatrix}0\\0\end{bmatrix},\qquad\Sigma=\begin{bmatrix}1&1\\1&2\end{bmatrix}$$
$U,V$
independent, equally likely ±1
$x,\mu$
random column and mean
$\Sigma$
population covariance

Independence; covariance — [1] DL §3.7 · [1] DL §3.8 · Course example

Choose, explain, vote

Moments

Independent sources, dependent components

$U,V$ are independent fair signs. Let $x=(U,2U+V)^T$. What is $\operatorname{Cov}(x_1,x_2)$?

  1. A$2$: both components share $U$.✓
  2. B$0$: independent sources imply independent outputs.
  3. C$1$: doubling a coefficient has no effect.

$\mathbb E[U(2U+V)]=2$; $\Sigma=\begin{bmatrix}1&2\\2&5\end{bmatrix}$, $\det\Sigma=1$.

Solution 1 / 4

Separate sources from components

$U,V$: independent fair signs; $x=(U,2U+V)^T$; $\Sigma_{ij}=\operatorname{Cov}(x_i,x_j)$.

  1. $U,V$: independent signs, each equally likely $-1$ or $1$.
  2. $\mathbb E[U]=\mathbb E[V]=(-1+1)/2=0$; hence $\mathbb E[x_1]=\mathbb E[x_2]=0$.
  3. $\mathbb E[U^2]=\mathbb E[V^2]=1$; $\mathbb E[UV]=\mathbb E[U]\mathbb E[V]=0$.

Solution 2 / 4

Compute cross-covariance

$U,V$: independent fair signs; $x=(U,2U+V)^T$; $\Sigma_{ij}=\operatorname{Cov}(x_i,x_j)$.

  1. $\Sigma_{12}=\operatorname{Cov}(x_1,x_2)=\mathbb E[x_1x_2]$.
  2. $=\mathbb E[U(2U+V)]=2\mathbb E[U^2]+\mathbb E[UV]$.
  3. $=2(1)+0=2$.

Solution 3 / 4

Check the complete covariance

$U,V$: independent fair signs; $x=(U,2U+V)^T$; $\Sigma_{ij}=\operatorname{Cov}(x_i,x_j)$.

  1. $\Sigma_{11}=\mathbb E[U^2]=1$.
  2. $\Sigma_{22}=\mathbb E[(2U+V)^2]=4(1)+4(0)+1=5$.
  3. $\Sigma=\begin{bmatrix}1&2\\2&5\end{bmatrix}$; $\det\Sigma=1(5)-2(2)=1$.

Solution 4 / 4

Choose A

$U,V$: independent fair signs; $x=(U,2U+V)^T$; $\Sigma_{ij}=\operatorname{Cov}(x_i,x_j)$.

  1. A retains the shared source U.
  2. B confuses independence of U and V with independence of their outputs.
  3. C ignores the coefficient 2 in the shared contribution.

Independence; covariance — [1] DL §3.7 · [1] DL §3.8 · Course question

Definition and reasoning

Moments

Does zero covariance guarantee independence?

x is uniform on {−1,0,1}; y=x². Is y independent of x?

$$\operatorname{Cov}(x,y)=0,\qquad P(y=0\mid x=0)=1\ne\tfrac13=P(y=0)$$
$x,y$
random scalars
$P$
event probability
$\operatorname{Cov}$
population covariance

Uncorrelatedness; independence — [1] DL §3.8 · [2] UBC Lec.18 p.8 · Course example

Definition and reasoning

Gaussian geometry

What defines a multivariate Gaussian density?

$$p(x)=(2\pi)^{-d/2}|\Sigma|^{-1/2}\exp(-d_M^2/2)$$
$x,\mu$
evaluation point and mean in Rᵈ
$d$
dimension
$\Sigma\succ0$
positive variance in every nonzero direction
$|\Sigma|$
determinant
$p$
density
$d_M^2$
squared Mahalanobis distance
$$d_M^2=(x-\mu)^T\Sigma^{-1}(x-\mu)$$
$\Sigma^{-1}$
inverse covariance
$x-\mu$
centered displacement

Multivariate Gaussian distribution — [1] DL §3.9.3

Lecture 8

Gaussian geometry

Change basis, then standardize

$$\Sigma=Q\Lambda Q^T,\quad z=\Lambda^{-1/2}Q^T(x-\mu)$$
$Q$ orthonormal eigenvectors; $\Lambda$ positive eigenvalues; $x,\mu$ position and mean. Result: $\mathbb E[z]=0$, $\operatorname{Cov}(z)=I$. Plot: $Q=I$, $\Lambda=\operatorname{diag}(4,1)$.

Derivation

Derive the mean and covariance

$\mu=\mathbb E[x]$; $\Sigma=\operatorname{Cov}(x)=Q\Lambda Q^T\succ0$; $Q^TQ=I$; $\Lambda$ positive diagonal. Fixed whitening map $W=\Lambda^{-1/2}Q^T$; $z=W(x-\mu)$; $I$: identity.

  1. $\mathbb E[z]=W(\mathbb E[x]-\mu)=0$ by linearity.
  2. $\operatorname{Cov}(z)=\mathbb E[zz^T]=W\,\mathbb E[(x-\mu)(x-\mu)^T]\,W^T=W\Sigma W^T$.
  3. $=\Lambda^{-1/2}Q^T(Q\Lambda Q^T)Q\Lambda^{-1/2}=\Lambda^{-1/2}\Lambda\Lambda^{-1/2}=I$.
  4. Fixed matrices pass through expectation; $Q^TQ=I$ cancels the basis changes.

Whitening; eigendecomposition — [2] UBC Lec.18 p.5 · Course derivation

Lecture 8

Gaussian geometry

A contour radius becomes an ellipse axis

$$x=\mu+Q\Lambda^{1/2}z,\qquad \|z\|=c$$
$c$ standardized radius; $q_i$: unit eigenvectors (columns of $Q$); $\sqrt{\lambda_i}$: axis scale. Plot of $x-\mu$: $c=1$, $\lambda=(3,1)$, $q_1=(1,1)^T/\sqrt2$, $q_2=(1,-1)^T/\sqrt2$.

Gaussian density contour — [2] UBC Lec.18 p.5 · Course derivation

Lecture 8

Gaussian geometry

Equal lengths can have unequal surprise

$$\Sigma=\begin{bmatrix}2&1\\1&2\end{bmatrix},\quad \mu=\binom1{-1}$$
$\Sigma$ covariance; $\mu$ mean; compare $x=(2,0)^T$ and $y=(2,-2)^T$.

$$d_M^2(x)=\tfrac23,\qquad d_M^2(y)=2$$
$d_M$ covariance-scaled distance.

Mahalanobis distance — [2] UBC Lec.18 p.5 · Course example

Choose, explain, vote

Gaussian geometry

Which direction makes a point less surprising?

$\mu=0$, $\Sigma=\operatorname{diag}(4,1)$; $u=(2,0)^T$, $v=(0,2)^T$. Compare Gaussian densities.

  1. A$p(u)=p(v)$: their Euclidean lengths agree.
  2. B$p(u)>p(v)$: $u$ is one standard deviation away.✓
  3. C$p(u)<p(v)$: higher variance always lowers density.

$d_M^2(u)=1$, $d_M^2(v)=4$; $p(u)/p(v)=e^{3/2}>1$.

Solution 1 / 3

Use the covariance-scaled distance

$\mu$: mean; $\Sigma$: covariance; $p$: density; $d_M$: covariance-scaled distance.

  1. $\mu=0$: mean; $\Sigma=\operatorname{diag}(4,1)$: covariance.
  2. $u=(2,0)^T$, $v=(0,2)^T$ are points in the same Gaussian.
  3. $d_M^2(x)=(x-\mu)^T\Sigma^{-1}(x-\mu)=x_1^2/4+x_2^2$.

Solution 2 / 3

Compare exponents

$\mu$: mean; $\Sigma$: covariance; $p$: density; $d_M$: covariance-scaled distance.

  1. $d_M^2(u)=2^2/4+0^2=1$; $d_M^2(v)=0^2/4+2^2=4$.
  2. $p(x)=c\exp(-d_M^2(x)/2)$; the normalization $c$ is shared.
  3. $p(u)/p(v)=e^{-1/2}/e^{-4/2}=e^{3/2}>1$.

Solution 3 / 3

Choose B

$\mu$: mean; $\Sigma$: covariance; $p$: density; $d_M$: covariance-scaled distance.

  1. A uses ordinary distance and ignores different directional variances.
  2. B: u is one standard deviation away; v is two.
  3. C confuses changing covariance with comparing points in one fixed model.

Mahalanobis distance — [2] UBC Lec.18 p.5 · Course question

Lecture 8

Gaussian geometry

A unit ellipse contains less than half

$$P(d_M^2\le c^2)=1-e^{-c^2/2}\quad(d=2)$$
$c$ contour radius; $d=2$ dimension; the formula assumes a nonsingular Gaussian. Example: $\lambda_1=3,\lambda_2=1$.

$$c_{.95}=\sqrt{-2\log .05}\approx2.44775$$
$c_{.95}$ radius enclosing 95%.

Chi-square distribution; Gaussian probability region — [3] NIST §1.3.6.6.6 · [3] NIST χ² table · Course derivation

Lecture 8

Bayes

Which population does a positive select?

$$\begin{gathered}P(H\mid +)=\frac{P(H\cap +)}{P(+)}\\P(+\mid H)=\frac{P(H\cap +)}{P(H)}\end{gathered}$$
$H$: event; $+$: positive reading; $\cap$: both occur. Each denominator must be positive.

Conditional probability — [1] DL §3.4–3.5 · Course example

Lecture 8

Bayes

Write the joint event in two ways

$$P(H\mid +)=\frac{P(+\mid H)P(H)}{P(+)}$$
$P(H)$ prior; $P(+\mid H)$ likelihood; $P(+)>0$ evidence. $H$: event; $+$: positive reading.

Bayes’ rule — [1] DL §3.11 · Course derivation

Lecture 8

Bayes

Normalize over both sources of positives

$$P(+)=P(+\mid H)P(H)+P(+\mid \neg H)P(\neg H)$$
$\neg H$ complement; the two joint events are disjoint and exhaustive. $H$: event; $+$: positive reading.

Law of total probability; evidence — [1] DL §3.4–3.5 · [1] DL §3.11 · Course derivation

Lecture 8

Bayes

Why can most positive alarms be false?

$$P(H)=.01,\quad P(+\mid H)=.9,\quad P(+\mid\neg H)=.1$$
10,000 model trials: 100 event cases and 9,900 non-event cases.

$$P(H\mid +)=\frac{90}{90+990}=\frac1{12}$$
$H$ event; $+$ positive reading.

Prior probability; posterior probability — [1] DL §3.11 · Course example

Choose, explain, vote

Bayes

How does prevalence change the chance an alarm is true?

$P(H)=.1$, $P(+\mid H)=.9$, $P(+\mid\neg H)=.1$. What is $P(H\mid+)$?

  1. A$.9$: the chance of a true event equals sensor sensitivity.
  2. B$.1$: an observation cannot change the prior.
  3. C$.5$: true and false positives contribute equally.✓

$P(H\mid+)=\dfrac{.9(.1)}{.9(.1)+.1(.9)}=.5$.

Solution 1 / 3

Name the conditional populations

$H$: event; $\neg H$: no event; $+$: positive reading; $P$: probability.

  1. $H$: event; $\neg H$: no event; $+$: positive test.
  2. $P(H)=.1$, $P(\neg H)=1-.1=.9$.
  3. $P(+\mid H)=.9$; $P(+\mid\neg H)=.1$.

Solution 2 / 3

Find all positives, then normalize

$H$: event; $\neg H$: no event; $+$: positive reading; $P$: probability.

  1. $P(H\cap+)=P(+\mid H)P(H)=.9(.1)=.09$.
  2. $P(\neg H\cap+)=P(+\mid\neg H)P(\neg H)=.1(.9)=.09$.
  3. $P(+)=.09+.09=.18$; $P(H\mid+)=.09/.18=.5$.

Solution 3 / 3

Choose C

$H$: event; $\neg H$: no event; $+$: positive reading; $P$: probability.

  1. A reverses the conditioning: sensitivity starts with event cases.
  2. B uses the prior and ignores the positive observation.
  3. C: true and false positives have equal probability mass.

Prior probability; posterior probability — [1] DL §3.11 · Course question

Lecture 8

Break

Pause: probability, density, and conditioning

$$P(X\in A),\qquad p(x),\qquad P(H\mid +)$$
$X$ random quantity; $x$ evaluation value; $A$ event; $p$ density. $H$: event of interest; $+$: positive reading. Conditioning changes the reference population.

Event probability; density; conditional probability — [1] DL §3.3.2 · [1] DL §3.4–3.5 · Course recap

Lecture 8

Gaussian conditioning

A numeric reading updates a curve

$$x\sim\mathcal N(\mu_0,P_0),\quad z=x+\varepsilon,\quad\varepsilon\sim\mathcal N(0,R)$$
$x$: state; $z$: reading; $P_0,R>0$: prior/noise variances; $\varepsilon$ independent of $x$. $p(x)$: prior; $p(z\mid x)$: likelihood at fixed $z$; $p(x\mid z)$: posterior.

Gaussian prior; Gaussian likelihood — [2] UBC Lec.18 p.7

Lecture 8

Gaussian conditioning

Add precisions, then complete the square

$$J(x)=\frac{(x-\mu_0)^2}{2P_0}+\frac{(z-x)^2}{2R},\quad P_1^{-1}=P_0^{-1}+R^{-1},\quad\mu_1=P_1(\mu_0/P_0+z/R)$$
$J$: negative log posterior, up to a constant. Independent Gaussian prior/noise; $P_0,R>0$. $x$: state; $z$: reading. $\mu_0,P_0$: prior mean/variance; $R$: noise variance; $\mu_1,P_1$: posterior mean/variance.

Gaussian posterior; precision — [2] UBC Lec.18 p.7 · [1] DL §3.9.3 · Course derivation

Lecture 8

Gaussian conditioning

The gain weights the innovation

$$\mu_1=\frac{R\mu_0+P_0z}{P_0+R}=\mu_0+K(z-\mu_0),\quad K=\frac{P_0}{P_0+R},\quad P_1=(1-K)P_0$$
$\mu_0,P_0$: prior mean/variance; $z$: reading; $R$: noise variance. $\mu_1,P_1$: posterior mean/variance. Innovation $z-\mu_0$; gain $0<K<1$.

Kalman gain; measurement innovation — [5] Welch–Bishop §1 · [2] UBC Lec.18 p.7 · Course derivation

Lecture 8

Gaussian conditioning

Fuse a prior and a precise reading

$$\mu_0=0,\quad P_0=4,\quad z=3,\quad R=1$$
$\mu_0$: prior mean; $P_0$: prior variance; $z$: reading; $R$: independent noise variance.

$$K=\tfrac45,\qquad\mu_1=2.4,\qquad P_1=.8$$
$K$ gain; $\mu_1,P_1$ posterior mean, variance.

Gaussian conditioning — [2] UBC Lec.18 p.7 · Course example

Choose, explain, vote

Gaussian conditioning

What does a noisier reading change?

Prior $\mathcal N(0,4)$; $z=3$ with independent Gaussian noise, variance $R$: $1\to4$. Compare posterior mean and variance.

  1. AMean moves toward $0$; posterior variance increases.✓
  2. BMean moves toward $3$; posterior variance decreases.
  3. COnly the mean changes; variance ignores sensor noise.

$K=4/(4+4)=1/2$; $\mu_1=1.5$, $P_1=2$ (before: $2.4,.8$).

Solution 1 / 3

State the scalar measurement model

$\mu_0,P_0$: prior mean/variance; $\mu_1,P_1$: posterior mean/variance; $K$: measurement gain.

  1. $x\sim\mathcal N(\mu_0,P_0)$ with $\mu_0=0$, $P_0=4$.
  2. $z=x+\varepsilon=3$; independent noise $\varepsilon\sim\mathcal N(0,R)$.
  3. $K=P_0/(P_0+R)$; $\mu_1=\mu_0+K(z-\mu_0)$; $P_1=(1-K)P_0$.

Solution 2 / 3

Compare the two noise variances

$\mu_0,P_0$: prior mean/variance; $\mu_1,P_1$: posterior mean/variance; $K$: measurement gain.

  1. Old $R=1$: $K=4/5$, $\mu_1=0+(4/5)3=2.4$, $P_1=(1/5)4=.8$.
  2. New $R=4$: $K=4/8=1/2$, $\mu_1=0+(1/2)3=1.5$.
  3. New $P_1=(1-1/2)4=2$; precision check: $P_1^{-1}=1/4+1/4=1/2$.

Solution 3 / 3

Choose A

$\mu_0,P_0$: prior mean/variance; $\mu_1,P_1$: posterior mean/variance; $K$: measurement gain.

  1. A: the mean is closer to 0 and posterior variance rises from .8 to 2.
  2. B reverses both changes: a noisier reading carries less information.
  3. C ignores R in the posterior variance. The sensor value z did not change.

Gaussian conditioning — [2] UBC Lec.18 p.7 · Course question

Lecture 8

Gaussian conditioning

A correlated block predicts another block

$$\mu_{a\mid b}=\mu_a+\Sigma_{ab}\Sigma_{bb}^{-1}(b-\mu_b)$$
Jointly Gaussian $a\in\mathbb R^p$, $b\in\mathbb R^q$; observe $b$. $\mu_a,\mu_b$: means; $\Sigma_{bb}$: invertible covariance of $b$. Cross-covariance: $\Sigma_{ab}=\mathbb E[(a-\mu_a)(b-\mu_b)^T]$.

Conditional Gaussian mean — [2] UBC Lec.18 p.7

Lecture 8

Gaussian conditioning

Conditioning removes predictable variance

$$\Sigma_{a\mid b}=\Sigma_{aa}-\Sigma_{ab}\Sigma_{bb}^{-1}\Sigma_{ba}$$
$a$: unobserved block; $b$: observed block. $\Sigma_{aa}$: covariance of $a$; $\Sigma_{a\mid b}$: covariance after observing $b$. Joint Gaussian, $\Sigma_{bb}\succ0$, $\Sigma_{ba}=\Sigma_{ab}^T$. Plot: $\mu=(1,2)^T$, $\Sigma=\begin{bmatrix}4&2\\2&9\end{bmatrix}$.

Conditional Gaussian covariance — [2] UBC Lec.18 p.7

Choose, explain, vote

Gaussian conditioning

Does the conditional variance change?

Gaussian $(a,b)^T$: $\mu=(1,2)^T$, $\Sigma=\begin{bmatrix}4&2\\2&9\end{bmatrix}$. Observe $b=-1$ instead of $5$.

  1. ABoth conditional mean and variance decrease.
  2. BMean decreases; conditional variance stays fixed.✓
  3. CNeither changes because the joint model is fixed.

$\mu_{a\mid b}=1+\frac29(-1-2)=\frac13$; $\Sigma_{a\mid b}=4-\frac49=\frac{32}9$.

Solution 1 / 4

Read the Gaussian blocks

$a,b$: scalar components; $\mu$: means; $\Sigma$: covariance blocks; $a\mid b$: a conditioned on b.

  1. $a$: unobserved scalar; $b$: observed scalar.
  2. $\mu_a=1$, $\mu_b=2$; $\Sigma_{aa}=4$, $\Sigma_{ab}=\Sigma_{ba}=2$, $\Sigma_{bb}=9$.
  3. $\mu_{a\mid b}=\mu_a+\Sigma_{ab}\Sigma_{bb}^{-1}(b-\mu_b)$.

Solution 2 / 4

Update the center

$a,b$: scalar components; $\mu$: means; $\Sigma$: covariance blocks; $a\mid b$: a conditioned on b.

  1. Old $b=5$: $\mu_{a\mid b}=1+(2/9)(5-2)=1+2/3=5/3$.
  2. New $b=-1$: $\mu_{a\mid b}=1+(2/9)(-1-2)=1-2/3=1/3$.
  3. The innovation $b-\mu_b$ changed; the mean decreases.

Solution 3 / 4

Compute the unchanged variance

$a,b$: scalar components; $\mu$: means; $\Sigma$: covariance blocks; $a\mid b$: a conditioned on b.

  1. $\Sigma_{a\mid b}=\Sigma_{aa}-\Sigma_{ab}\Sigma_{bb}^{-1}\Sigma_{ba}$.
  2. $=4-2(1/9)2=36/9-4/9=32/9$.
  3. This expression contains covariance blocks, not the observed value b.

Solution 4 / 4

Choose B

$a,b$: scalar components; $\mu$: means; $\Sigma$: covariance blocks; $a\mid b$: a conditioned on b.

  1. A wrongly changes the width when only the observed value changes.
  2. B changes the mean and keeps the conditional variance fixed.
  3. C ignores the changed innovation. Constant width here uses joint Gaussianity.

Conditional Gaussian distribution — [2] UBC Lec.18 p.7 · Course question

Lecture 8

Estimation

Maximum Likelihood Estimation (MLE)

$$\begin{gathered}b=A\theta+\varepsilon,\quad\varepsilon\sim\mathcal N(0,\sigma^2I)\\L(\theta;b)=p(b\mid\theta),\quad\hat\theta_{MLE}\in\operatorname*{argmax}_{\theta}L(\theta;b)\end{gathered}$$
$b\in\mathbb R^N$: fixed data; $A\in\mathbb R^{N\times p}$: known; $\theta\in\mathbb R^p$: unknown; $\sigma^2>0$: known variance. $L$: likelihood; argmax: maximizer(s).

Gaussian linear regression; maximum likelihood — [1] DL §5.5.1

Lecture 8

Estimation

Gaussian products become a squared loss

$$-\log p(b\mid\theta)=\frac N2\log(2\pi\sigma^2)+\frac{\|b-A\theta\|^2}{2\sigma^2}$$
$A$ known; $b$ observed; $\theta$ unknown; independent errors, each $\mathcal N(0,\sigma^2)$, $\sigma^2>0$.

Negative log-likelihood; least squares — [1] DL §5.5.1 · Course derivation

Lecture 8

Estimation

The familiar normal equation returns

$$A^TA\hat\theta=A^Tb,\qquad A^T(b-A\hat\theta)=0$$
$A\in\mathbb R^{N\times p}$: known design; $b\in\mathbb R^N$: data; $\theta\in\mathbb R^p$: parameters. Independent equal-variance Gaussian errors make $\hat\theta$ the MLE. Full column rank gives uniqueness; residual is orthogonal to columns.

Normal equations; least squares — [1] DL §5.1.4 · Course derivation

Lecture 8

Estimation

Fit three readings with two coefficients

$$A=\begin{bmatrix}1&0\\1&1\\1&2\end{bmatrix},\quad b=\begin{bmatrix}1\\2\\2\end{bmatrix}$$
$\theta=(\text{intercept},\text{slope})^T$; $r=b-A\hat\theta$.

$$\hat\theta=\binom{7/6}{1/2},\quad r=\begin{bmatrix}-1/6\\1/3\\-1/6\end{bmatrix}$$
$\hat\theta$ estimate; $r$ observed minus fitted.

Least-squares estimate — [1] DL §5.1.4 · Course example

Lecture 8

Estimation

Maximum a Posteriori Estimation (MAP)

$$J(\theta)=\tfrac12\|b-A\theta\|^2+\tfrac{\lambda^2}{2}\|\theta-\mu_0\|^2,\quad\lambda^2=\sigma^2/\tau^2$$
$\theta\sim\mathcal N(\mu_0,\tau^2I)$ isotropic prior: variance $\tau^2$ in every unit direction; $\sigma^2$ noise variance; $\lambda^2$ relative strength.

Maximum a posteriori (MAP); quadratic regularization — [1] DL §5.6.1 · Course derivation

Lecture 8

Estimation

The prior changes the normal equation

$$(A^TA+\lambda^2I)\hat\theta=A^Tb+\lambda^2\mu_0$$
Example: $A=\begin{bmatrix}1&0\\1&1\\1&2\end{bmatrix}$, $b=(1,2,2)^T$, $\mu_0=0$, $\lambda^2=1$.

$$\hat\theta_{MAP}=\binom{4/5}{3/5},\quad\|b-A\hat\theta\|^2=\tfrac25$$
$\hat\theta_{MAP}=(\text{intercept},\text{slope})^T$: posterior mode; $\|b-A\hat\theta\|^2$: squared residual norm.

MAP normal equations; ridge regularization — [1] DL §5.6.1 · [1] DL §5.1.4 · Course derivation

Choose, explain, vote

Estimation

What makes the MAP estimate unique?

$A=\begin{bmatrix}1&1\\2&2\end{bmatrix}$, $b=(1,2)^T$; $J=\tfrac12\|b-A\theta\|^2+\tfrac12\|\theta\|^2$.

  1. AThe prior makes the two data columns independent.
  2. BGaussian noise makes every data fit unique.
  3. CThe prior adds curvature along the data null space.✓

Least squares: $\theta_1+\theta_2=1$. MAP: $(A^TA+I)\theta=A^Tb$ gives $\theta_1=\theta_2=5/11$.

Solution 1 / 5

Identify the data null space

$\theta$: parameter column; $A$: data matrix; $b$: data column; $r=b-A\theta$; $I$: $2\times2$ identity.

  1. $\theta=(\theta_1,\theta_2)^T$: parameters; $b=(1,2)^T$: readings.
  2. $A=\begin{bmatrix}1&1\\2&2\end{bmatrix}$; $r=b-A\theta$: residual.
  3. $A\theta=(\theta_1+\theta_2)(1,2)^T$; zero residual requires $\theta_1+\theta_2=1$.

Solution 2 / 5

Add the stated prior penalty

$\theta$: parameter column; $A$: data matrix; $b$: data column; $r=b-A\theta$; $I$: $2\times2$ identity.

  1. $J$: scaled negative-log posterior; $J=\tfrac12\|r\|^2+\tfrac12\|\theta\|^2$, with $\lambda^2=\sigma^2/\tau^2=1$.
  2. $\nabla J=A^T(A\theta-b)+\theta=0$.
  3. $A^TA=\begin{bmatrix}5&5\\5&5\end{bmatrix}$, $A^Tb=(5,5)^T$; hence $(A^TA+I)\theta=A^Tb$.

Solution 3 / 5

Solve the two equations

$\theta$: parameter column; $A$: data matrix; $b$: data column; $r=b-A\theta$; $I$: $2\times2$ identity.

  1. $6\theta_1+5\theta_2=5$; $5\theta_1+6\theta_2=5$.
  2. Subtract: $\theta_1-\theta_2=0$; substitute: $11\theta_1=5$.
  3. $\hat\theta_{MAP}=(5/11,5/11)^T$; $r=(1/11,2/11)^T$.

Solution 4 / 5

Why the minimizer is unique

$\theta$: parameter column; $A$: data matrix; $b$: data column; $r=b-A\theta$; $I$: $2\times2$ identity.

  1. For any nonzero column $v$, $v^T(A^TA+I)v=\|Av\|^2+\|v\|^2>0$.
  2. For the data-null direction $v=(1,-1)^T$, $Av=0$ but $\|v\|^2=2$.
  3. Thus the total objective has positive curvature even where the data loss is flat.

Solution 5 / 5

Choose C

$\theta$: parameter column; $A$: data matrix; $b$: data column; $r=b-A\theta$; $I$: $2\times2$ identity.

  1. A is false: A still has identical columns and rank 1.
  2. B is false: Gaussian noise alone does not identify their separate coefficients.
  3. C is correct: the stated Gaussian prior supplies curvature in the null direction.

MAP estimate; positive definiteness — [1] DL §5.6.1 · Course question

Choose, explain, vote

Integrated board

Calibration: choose the likelihood

$b=(1,2,3)^T$, $b_i=\theta+\varepsilon_i$, $\varepsilon_i\overset{iid}{\sim}\mathcal N(0,1)$. Which data objective fits this model?

  1. A$\frac12\sum_i(b_i-\theta)^2$✓
  2. B$\sum_i|b_i-\theta|$
  3. C$\frac12\sum_i(b_i-\theta)^2+\frac12\theta^2$

$-\log p(b\mid\theta)=C+\frac12\sum_i(b_i-\theta)^2$; $\hat\theta_{MLE}=\bar b=2$.

Solution 1 / 4

Define the calibration model

$b_i$: reading $i$; $\theta$: offset; $\varepsilon_i$: noise; $J_{data}$: data objective; $C$: constant in $\theta$.

  1. $b=(1,2,3)^T$: observed readings; $\theta$: unknown common offset.
  2. $b_i=\theta+\varepsilon_i$; independent $\varepsilon_i\sim\mathcal N(0,1)$.
  3. $p(b_i\mid\theta)=(2\pi)^{-1/2}\exp[-(b_i-\theta)^2/2]$.

Solution 2 / 4

From likelihood to objective

$b_i$: reading $i$; $\theta$: offset; $\varepsilon_i$: noise; $J_{data}$: data objective; $C$: constant in $\theta$.

  1. Independence: $p(b\mid\theta)=\prod_{i=1}^3p(b_i\mid\theta)$.
  2. $-\log p(b\mid\theta)=C+\tfrac12\sum_{i=1}^3(b_i-\theta)^2$.
  3. $C$ is independent of $\theta$; minimizing leaves $J_{data}=\tfrac12\sum_i(b_i-\theta)^2$.

Solution 3 / 4

Expand every square

$b_i$: reading $i$; $\theta$: offset; $\varepsilon_i$: noise; $J_{data}$: data objective; $C$: constant in $\theta$.

  1. $2J_{data}=(1-\theta)^2+(2-\theta)^2+(3-\theta)^2$.
  2. $=(1-2\theta+\theta^2)+(4-4\theta+\theta^2)+(9-6\theta+\theta^2)$.
  3. $=3\theta^2-12\theta+14$.

Solution 4 / 4

Minimize and choose A

$b_i$: reading $i$; $\theta$: offset; $\varepsilon_i$: noise; $J_{data}$: data objective; $C$: constant in $\theta$.

  1. $J_{data}^{\prime}=3\theta-6=0\Rightarrow\hat\theta_{MLE}=2$; $J_{data}^{\prime\prime}=3>0$.
  2. A follows from independent Gaussian noise.
  3. B uses absolute residuals, a different noise model. C already adds a prior penalty.

Gaussian likelihood; maximum likelihood — [1] DL §5.5.1 · Course example

Choose, explain, vote

Integrated board

Calibration: combine data and prior

Readings $(1,2,3)$; independent normal noise, variance $1$; prior $\theta\sim\mathcal N(0,1)$. Find posterior mean and precision.

  1. ACenter stays at $2$; prior changes only uncertainty.
  2. BCenter moves toward $0$; precision becomes $4$.✓
  3. CCenter moves toward $0$; variances add to $4$.

$J_{post}=2(\theta-1.5)^2+2.5$; $\theta\mid b\sim\mathcal N(1.5,1/4)$.

Solution 1 / 4

Keep the data and state the prior

$\theta$: offset; $J_{post}$: posterior objective; $\mu_1,P_1$: posterior mean/variance; precision $=1/P_1$.

  1. $b=(1,2,3)^T$; independent noise variance $1$; $\theta$: offset.
  2. $J_{data}=\tfrac12(3\theta^2-12\theta+14)$; $\theta\sim\mathcal N(0,1)$.
  3. Negative log prior adds $\theta^2/2$, up to a constant.

Solution 2 / 4

Collect the posterior quadratic

$\theta$: offset; $J_{post}$: posterior objective; $\mu_1,P_1$: posterior mean/variance; precision $=1/P_1$.

  1. $J_{post}=\tfrac12(3\theta^2-12\theta+14)+\tfrac12\theta^2$.
  2. $=2\theta^2-6\theta+7=2(\theta^2-3\theta)+7$.
  3. $\theta^2-3\theta=(\theta-3/2)^2-9/4$.

Solution 3 / 4

Complete the square and read variance

$\theta$: offset; $J_{post}$: posterior objective; $\mu_1,P_1$: posterior mean/variance; precision $=1/P_1$.

  1. $J_{post}=2(\theta-3/2)^2-9/2+7=2(\theta-1.5)^2+2.5$.
  2. Gaussian quadratic: $(\theta-\mu_1)^2/(2P_1)$; hence $\mu_1=1.5$, $1/(2P_1)=2$.
  3. $P_1=1/4$; precision $P_1^{-1}=4$; $\theta\mid b\sim\mathcal N(1.5,1/4)$.

Solution 4 / 4

Choose B and check the weights

$\theta$: offset; $J_{post}$: posterior objective; $\mu_1,P_1$: posterior mean/variance; precision $=1/P_1$.

  1. Data precision $3$ plus prior precision $1$ gives $4$.
  2. Posterior mean $=(3\cdot2+1\cdot0)/4=1.5$; MAP equals this Gaussian mean.
  3. B is correct. A ignores the prior shift. C adds variances instead of precisions.

Gaussian posterior; MAP estimate — [2] UBC Lec.18 p.7 · [1] DL §5.6.1 · Course example

Choose, explain, vote

Intervals

Calibration: confidence coverage

Three iid $B_i\mid\theta\sim\mathcal N(\theta,1)$; $\bar B$: mean. $C(B)=\bar B\pm1.96/\sqrt3$. Interpret 95% confidence.

  1. AThis realized interval has 95% posterior mass.
  2. B95% of future individual readings lie inside it.
  3. CRepeated intervals cover fixed $\theta$ 95% of the time.✓

$\sqrt3(\bar B-\theta)\sim\mathcal N(0,1)$; $P_\theta(\theta\in C(B))\approx.95$.

Solution 1 / 4

Define the random interval

$B$: random data; $\bar B$: sample mean; $\theta$: fixed offset; $C(B)$: confidence interval; $Z$: standardized mean.

  1. $\theta$: fixed true offset; $B_i$: random reading before observation.
  2. $B_i\mid\theta\sim\mathcal N(\theta,1)$ independently; $\bar B=(B_1+B_2+B_3)/3$.
  3. $C(B)$: confidence interval computed anew for each random dataset.

Solution 2 / 4

Standardize the sample mean

$B$: random data; $\bar B$: sample mean; $\theta$: fixed offset; $C(B)$: confidence interval; $Z$: standardized mean.

  1. $\mathbb E_\theta[\bar B]=\theta$; $\operatorname{Var}_\theta(\bar B)=(1+1+1)/9=1/3$.
  2. $Z=(\bar B-\theta)/(1/\sqrt3)\sim\mathcal N(0,1)$.
  3. $P_\theta(-1.96\leq Z\leq1.96)\approx.95$.

Solution 3 / 4

Rearrange to isolate the fixed offset

$B$: random data; $\bar B$: sample mean; $\theta$: fixed offset; $C(B)$: confidence interval; $Z$: standardized mean.

  1. $-1.96/\sqrt3\leq\bar B-\theta\leq1.96/\sqrt3$.
  2. $\bar B-1.96/\sqrt3\leq\theta\leq\bar B+1.96/\sqrt3$.
  3. Thus $C(B)=\bar B\pm1.96/\sqrt3$ and $P_\theta(\theta\in C(B))\approx.95$.

Solution 4 / 4

Choose C

$B$: random data; $\bar B$: sample mean; $\theta$: fixed offset; $C(B)$: confidence interval; $Z$: standardized mean.

  1. C: repeated random intervals cover the same fixed offset about 95% of the time.
  2. A needs a posterior distribution; confidence alone provides none.
  3. B concerns individual future readings, whose noise variance is 1, not 1/3.

Confidence interval; coverage probability — [3] NIST §7.1.4 · Course example

Choose, explain, vote

Intervals

Calibration: what does credibility describe?

Observed $b=(1,2,3)^T$; $\theta\mid b\sim\mathcal N(1.5,.25)$. A 95% credible interval describes which probability?

  1. A95% posterior mass for $\theta$, with $b$ fixed.✓
  2. B95% coverage for every fixed true offset.
  3. C95% probability for a future noisy reading.

$I(b)=1.5\pm1.96(.5)$; $P(\theta\in I(b)\mid b)\approx.95$.

Solution 1 / 3

Fix the data and use the posterior

$b$: fixed data; $\theta$: offset; $\mu_1,P_1$: posterior mean/variance; $I(b)$: credible interval; $Z$: standardized offset.

  1. $b=(1,2,3)^T$: observed data, now fixed; $\theta$: offset.
  2. $\theta\mid b\sim\mathcal N(\mu_1,P_1)$ with $\mu_1=1.5$, $P_1=.25$.
  3. Posterior standard deviation $\sqrt{P_1}=\sqrt{.25}=.5$.

Solution 2 / 3

Standardize, then undo the scaling

$b$: fixed data; $\theta$: offset; $\mu_1,P_1$: posterior mean/variance; $I(b)$: credible interval; $Z$: standardized offset.

  1. $Z=(\theta-1.5)/.5\mid b\sim\mathcal N(0,1)$.
  2. $P(-1.96\leq Z\leq1.96\mid b)\approx.95$.
  3. $1.5-1.96(.5)\leq\theta\leq1.5+1.96(.5)$ gives $I(b)=[.52,2.48]$.

Solution 3 / 3

Choose A

$b$: fixed data; $\theta$: offset; $\mu_1,P_1$: posterior mean/variance; $I(b)$: credible interval; $Z$: standardized offset.

  1. A: $P(\theta\in I(b)\mid b)\approx.95$ under this posterior.
  2. B is a repeated-sampling claim for every fixed offset; it does not follow here.
  3. C includes new measurement noise; this interval describes the offset only.

Posterior credible interval — [4] MIT 18.05 §2 · Course example

Choose, explain, vote

Intervals

Calibration: why do the intervals differ?

Prior $\theta\sim\mathcal N(0,1)$. Confidence $C(b)=2\pm1.96/\sqrt3$; credible $I(b)=1.5\pm1.96(.5)$. Why different?

  1. ANarrower credible interval means better coverage.
  2. BThe zero-centered prior adds information.✓
  3. CThe physical sensor became less noisy.

$C\approx[.8684,3.1316]$; $I\approx[.5200,2.4800]$. Prior precision $1$ adds to data precision $3$.

Solution 1 / 3

Identify the two information sources

$C$: confidence interval; $I$: credible interval; $\bar b$: sample mean; precision: inverse variance.

  1. $b=(1,2,3)^T$; $\bar b=2$; noise variance $1$; prior $\mathcal N(0,1)$.
  2. $C$: confidence interval; sampling standard error $1/\sqrt3$.
  3. $I$: credible interval; posterior mean $(3\cdot2+1\cdot0)/4=1.5$, variance $1/4$.
  4. Data precision $=1/(1/3)=3$; prior precision $=1/1=1$.

Solution 2 / 3

Compute and compare endpoints

$C$: confidence interval; $I$: credible interval; $\bar b$: sample mean; precision: inverse variance.

  1. $C=2\pm1.96/\sqrt3\approx2\pm1.1316=[.8684,3.1316]$.
  2. $I=1.5\pm1.96\sqrt{1/4}=1.5\pm.98=[.52,2.48]$.
  3. $1.5<2$ and $.98<1.1316$: the prior shifts the center and reduces posterior width.

Solution 3 / 3

Choose B

$C$: confidence interval; $I$: credible interval; $\bar b$: sample mean; precision: inverse variance.

  1. B: one unit of prior precision adds to three units from the data.
  2. A: narrower does not prove better repeated-sampling coverage.
  3. C: the physical noise variance remains 1; only the information used changed.

Confidence interval; credible interval — [3] NIST §7.1.4 · [4] MIT 18.05 §2 · [1] DL §5.6.1 · Course comparison

Choose, explain, vote

Transfer

Calibration: new data, new prior

Readings $b=(2,3)^T$ estimate offset $\theta$; iid noise $\mathcal N(0,1)$; prior $\theta\sim\mathcal N(4,1)$. Which is valid?

  1. AThe prior changes the data-only MLE.
  2. BThe prior center can be ignored in MAP.
  3. CMAP moves above the data mean; MLE stays fixed.✓

$\hat\theta_{MLE}=2.5$, $\theta\mid b\sim\mathcal N(3,1/3)$. $C=2.5\pm1.96/\sqrt2$; $I=3\pm1.96/\sqrt3$.

Solution 1 / 5

Set up the new data-only problem

$\theta$: offset; $J$: objective; $\mu_1,P_1$: posterior mean/variance; $C$: confidence; $I$: credible interval.

  1. $b=(2,3)^T$; $\theta$: offset; independent noise variance $1$.
  2. $J_{data}=\tfrac12[(2-\theta)^2+(3-\theta)^2]$.
  3. $=\tfrac12[(4-4\theta+\theta^2)+(9-6\theta+\theta^2)]=\tfrac12(2\theta^2-10\theta+13)$.

Solution 2 / 5

Minimize, then add the new prior

$\theta$: offset; $J$: objective; $\mu_1,P_1$: posterior mean/variance; $C$: confidence; $I$: credible interval.

  1. $J_{data}^{\prime}=2\theta-5=0\Rightarrow\hat\theta_{MLE}=2.5$; $J_{data}^{\prime\prime}=2>0$.
  2. Prior $\mathcal N(4,1)$ adds $\tfrac12(\theta-4)^2=\tfrac12(\theta^2-8\theta+16)$.
  3. $J_{post}=\tfrac12(3\theta^2-18\theta+29)$.

Solution 3 / 5

Complete the posterior square

$\theta$: offset; $J$: objective; $\mu_1,P_1$: posterior mean/variance; $C$: confidence; $I$: credible interval.

  1. $3\theta^2-18\theta+29=3(\theta^2-6\theta)+29$.
  2. $=3[(\theta-3)^2-9]+29=3(\theta-3)^2+2$.
  3. $J_{post}=\tfrac32(\theta-3)^2+1$; $\mu_1=3$, $1/(2P_1)=3/2\Rightarrow P_1=1/3$.

Solution 4 / 5

Compute both interval constructions

$\theta$: offset; $J$: objective; $\mu_1,P_1$: posterior mean/variance; $C$: confidence; $I$: credible interval.

  1. $C$: confidence; mean $2.5$, sampling standard error $1/\sqrt2$.
  2. $C=2.5\pm1.96/\sqrt2\approx[1.1141,3.8859]$.
  3. $I$: credible; posterior mean $3$, standard deviation $1/\sqrt3$; $I=3\pm1.96/\sqrt3\approx[1.8684,4.1316]$.

Solution 5 / 5

Choose C

$\theta$: offset; $J$: objective; $\mu_1,P_1$: posterior mean/variance; $C$: confidence; $I$: credible interval.

  1. C: $\hat\theta_{MAP}=3>2.5$, while the data-only MLE remains $2.5$.
  2. A incorrectly puts prior information into the data-only MLE.
  3. B drops the prior center 4 and its linear term. Confidence and credibility retain different meanings.

MLE; MAP; confidence and credible intervals — [1] DL §§5.5–5.6 · [3] NIST §7.1.4 · [4] MIT 18.05 §2 · Course question

Choose, explain, vote

Intervals

What does the sensor promise?

A specification says “$\pm2$ cm, 95%.” Which conclusion is justified without another definition?

  1. AIt is a confidence interval for the offset.
  2. BIt is a credible interval for the offset.
  3. CNone: ask what quantity and probability model it describes.✓

Offset uncertainty, future-reading error and repeated coverage are different claims.

Solution 1 / 3

Identify what the specification omits

$C(B)$: confidence interval; $I(b)$: credible interval; $\varepsilon_{new}$: future-reading error.

  1. The statement “$\pm2$ cm, 95%” supplies a width and a percentage.
  2. $\theta$: offset; $B$: repeated random dataset; $b$: observed dataset.
  3. No target quantity or probability construction is specified.

Solution 2 / 3

Compare three possible meanings

$C(B)$: confidence interval; $I(b)$: credible interval; $\varepsilon_{new}$: future-reading error.

  1. Confidence: $P_\theta(\theta\in C(B))\approx.95$ for a stated repeated-data procedure.
  2. Credibility: $P(\theta\in I(b)\mid b)\approx.95$ under a stated posterior.
  3. Future-error bound: $P(|\varepsilon_{new}|\leq2\ \mathrm{cm})\approx.95$ under a stated error model.

Solution 3 / 3

Choose C

$C(B)$: confidence interval; $I(b)$: credible interval; $\varepsilon_{new}$: future-reading error.

  1. A assumes an unstated repeated-sampling procedure.
  2. B assumes an unstated prior and posterior.
  3. C: ask which quantity is bounded and which model or procedure supplies 95%.

Confidence; credibility; predictive uncertainty — [3] NIST §7.1.4 · [4] MIT 18.05 §2 · [1] DL §5.6, Eq.5.68 · Course question

Choose, explain, vote

Synthesis

Which modeling bridge is valid?

Zero-mean iid Gaussian noise; isotropic Gaussian prior. Which chain gives the negative-log posterior?

  1. AIndependence gives squares; Gaussian noise gives sums.
  2. BGaussian noise gives squares; independence gives sums.✓
  3. CA Gaussian prior removes the data residual term.

$-\log p(\theta\mid b)=C+\|b-A\theta\|^2/(2\sigma^2)+\|\theta-\mu_0\|^2/(2\tau^2)$.

Solution 1 / 4

State the model and symbols

$i$: reading index; $I$: identity matrix; $C$: constant in $\theta$; $J$: negative-log posterior, up to constants.

  1. $b=A\theta+\varepsilon$: data column $b$, design matrix $A$, parameter column $\theta$.
  2. $\varepsilon_i$ are independent $\mathcal N(0,\sigma^2)$ noises; $r=b-A\theta$: residual.
  3. Prior $\theta\sim\mathcal N(\mu_0,\tau^2I)$; $\mu_0$: prior mean; $\sigma^2,\tau^2>0$: variances.

Solution 2 / 4

Separate the square from the sum

$i$: reading index; $I$: identity matrix; $C$: constant in $\theta$; $J$: negative-log posterior, up to constants.

  1. One Gaussian factor: $p(b_i\mid\theta)=(2\pi\sigma^2)^{-1/2}e^{-r_i^2/(2\sigma^2)}$.
  2. Independence gives $p(b\mid\theta)=\prod_i p(b_i\mid\theta)$.
  3. $-\log p(b\mid\theta)=C+\sum_i r_i^2/(2\sigma^2)=C+\|b-A\theta\|^2/(2\sigma^2)$.

Solution 3 / 4

Add the prior through Bayes rule

$i$: reading index; $I$: identity matrix; $C$: constant in $\theta$; $J$: negative-log posterior, up to constants.

  1. $p(\theta\mid b)\propto p(b\mid\theta)p(\theta)$; logarithms turn this product into a sum.
  2. $J=\|b-A\theta\|^2/(2\sigma^2)+\|\theta-\mu_0\|^2/(2\tau^2)$.
  3. Multiply all of $J$ by $\sigma^2$: $\tfrac12\|r\|^2+\tfrac{\lambda^2}{2}\|\theta-\mu_0\|^2$, where $\lambda^2=\sigma^2/\tau^2$.

Solution 4 / 4

Choose B

$i$: reading index; $I$: identity matrix; $C$: constant in $\theta$; $J$: negative-log posterior, up to constants.

  1. B: the Gaussian exponent supplies squares; independence and logarithms supply the sum.
  2. A reverses the two reasons.
  3. C discards the likelihood. A prior adds a penalty while retaining the residual term.

Gaussian likelihood; independence; MAP regularization — [1] DL §§5.5–5.6 · [1] DL §3.7 · Course question

Lecture 8

References

Sources and optional extensions

  1. [1] Goodfellow et al. Deep Learning. MIT Press, 2016.
  2. [2] UBC CS340. Multivariate Gaussian Distributions and LDA. 2011.
  3. [3] NIST/SEMATECH. e-Handbook of Statistical Methods.
  4. [4] Orloff & Bloom. Probability Intervals. MIT 18.05, 2022.
  5. [5] Welch & Bishop. An Introduction to the Kalman Filter. 2004.
← → · o overview · p print