Can we use the parents' heights?
What we need:
Running example: $X_1$ a parent's height and $X_2$ the adult child's height, in standard deviations from their means, jointly Gaussian with correlation $\rho=0.5$ (illustrative, not measured data).
Here $\bmu=(1,1)^T$. The arrow $\bx-\bmu$ is the pair's deviation from the center.
Every point and the mean move by the same amount: $\E[\bX+\bb]=\bmu+\bb=(-2,2)^T$. The deviations $\bx-\bmu$ stay the same.
For $\bX=(X_1,X_2)^T$ with mean $\bmu=(\mu_1,\mu_2)^T$:
\[\mK=\E[(\bX-\bmu)(\bX-\bmu)^T]\]Take the expectation entry by entry:
\[\mK=\begin{pmatrix}\textcolor{#A0521B}{\var(X_1)}&\textcolor{#6A3D9A}{\cov(X_1,X_2)}\\\textcolor{#6A3D9A}{\cov(X_2,X_1)}&\textcolor{#A0521B}{\var(X_2)}\end{pmatrix}\]The off-diagonal entry averages the product of the two deviations; with $\bmu=\bzero$ that product is $x_1x_2$.
The positive products outweigh the negative ones in this model.
Example: $X_i$ counts face $i$ in 36 fair, independent rolls, and $\sum_{i=1}^6 X_i=36$.
Given $X_1=x_1$, the other $36-x_1$ rolls land on faces 2 to 6 with probability $\frac15$ each, so each of those counts averages $\frac{36-x_1}{5}$ (amber line).
For each value of $X_1$, one illustrative draw of the other five counts.
Write each count as a sum over the rolls: $I_k(i)=1$ if roll $k$ shows face $i$, else 0, so $X_i=\sum_{k=1}^{36}I_k(i)$ and $\E[I_k(i)]=\frac16$.
For $i\ne j$: $\cov(X_i,X_j)=\sum_{k}\sum_{l}\cov(I_k(i),I_l(j))$.
Different rolls ($k\ne l$) are independent, so those terms are 0.
Same roll ($k=l$): one roll cannot show both faces, so $I_k(i)I_k(j)=0$ and $\cov(I_k(i),I_k(j))=0-\frac16\cdot\frac16=-\frac1{36}$.
Only the 36 same-roll terms remain: $\cov(X_i,X_j)=36\cdot\big(-\frac1{36}\big)=-1$. In general, with $n$ rolls and face probabilities $p_i$, it is $-np_ip_j$.
$\var(X_i)$ the same way: only the same-roll terms remain, each $\var(I_k(i))=\frac16\cdot\frac56$, so $\var(X_i)=36\cdot\frac16\cdot\frac56=5$.
Check: the counts always total 36, so
\[0=\var\Big(\sum_{i=1}^6X_i\Big)=6\cdot5+30\,\cov(X_i,X_j),\]giving $\cov(X_i,X_j)=-1$ again (30 ordered pairs $i\ne j$).
Die counts in 36 rolls: $\var(X_i)=5$ and $\cov(X_i,X_j)=-1$. With $\bone=(1,\ldots,1)^T$,
\[\mK=6\mI-\bone\bone^T.\]Each row of $\mK$ sums to $5-5=0$, so $\mK\bone=\bzero$ and $\mK$ is singular: it has no inverse.
Start from $\cov(\bX)=\mI$. Stretch by $\sqrt{1.5}$ along $x_1$ and by $\sqrt{0.5}$ along $x_2$.
Rotate by $45^\circ$: $\cov(\bY)=\mA\mA^T$ has the running model's covariance.
Expectation is linear, so $\E\bY=\mA\,\E\bX+\bb=\mA\bmu+\bb$. The shift cancels in the deviation, $\bY-\E\bY=\mA(\bX-\bmu)$, so
\[\htmlClass{dk1}{\cov(\bY)=\E\big[\mA(\bX-\bmu)(\bX-\bmu)^T\mA^T\big]=\mA\,\cov(\bX)\,\mA^T.}\]In $(x_1,x_2)$ order, stretch by $\mathsf D=\mathrm{diag}(\sqrt{1.5},\sqrt{0.5})$, then rotate by $\mathsf R$. With $\cov(\bX)=\mI$, $\cov(\bY)=\mA\mA^T$:
\[\htmlClass{dk2}{\begin{aligned}\mA=\mathsf R\mathsf D&=\tfrac1{\sqrt2}\begin{pmatrix}1&-1\\1&1\end{pmatrix}\begin{pmatrix}\sqrt{1.5}&0\\0&\sqrt{0.5}\end{pmatrix}=\begin{pmatrix}\frac{\sqrt3}2&-\frac12\\[2pt]\frac{\sqrt3}2&\frac12\end{pmatrix}\\ \mA\mA^T&=\begin{pmatrix}\frac34+\frac14&\frac34-\frac14\\[2pt]\frac34-\frac14&\frac34+\frac14\end{pmatrix}=\begin{pmatrix}1&0.5\\0.5&1\end{pmatrix}.\end{aligned}}\]With $\ba=\bone$, $Y$ is the total. For the die counts, $\mK\bone=\bzero$ (previous slide), so
\[\var\Big(\sum_{i=1}^6X_i\Big)=\bone^T\mK\bone=\bone^T\bzero=0.\]Roll a fair die 36 times, independently. $Y_1$ counts prime faces; $Y_2$ counts odd faces. Thus $\bY=\mA\bX$, where $\cov(\bX)=\mK=6\mI-\bone\bone^T$.
90 seconds, in pairs.
(a) Find the two expected counts, $\E\bY$.
Each row of $\mA$ selects three faces, and each face is expected 6 times.
(b) Predict the sign of $\cov(Y_1,Y_2)$. Then compute $\cov(\bY)$.
With $\mK=6\mI-\bone\bone^T$:
\[\begin{aligned}\cov(\bY)&=\mA\mK\mA^T=6\,\mA\mA^T-(\mA\bone)(\mA\bone)^T\\ &=6\begin{pmatrix}3&2\\2&3\end{pmatrix}-\begin{pmatrix}3\\3\end{pmatrix}\begin{pmatrix}3&3\end{pmatrix}=\begin{pmatrix}9&3\\3&9\end{pmatrix}\end{aligned}\]$\mA\mA^T$ holds the inner products of the rows: each row selects 3 faces, and the rows share faces 3 and 5, which makes the covariance positive. The correlation is $3/9=1/3$.
One dimension, $X\sim\cN(\mu,\sigma^2)$:
\[p_X(x)=\frac{1}{\sqrt{2\pi}\,\sigma}\,e^{-z^2/2},\qquad z=\frac{x-\mu}{\sigma}\]$|z|$ is the distance from the mean in standard deviations, and the density falls exponentially in $z^2$.
Several dimensions: the Mahalanobis distance
\[\Delta(\bx,\bmu)=\sqrt{(\bx-\bmu)^T\mK^{-1}(\bx-\bmu)}\]$\mK$ controls the geometry of the distance: the shape and tilt of its ellipses.
Diagonal covariance, uncorrelated coordinates:
\[\mK=\begin{pmatrix}\sigma_1^2&0\\0&\sigma_2^2\end{pmatrix},\qquad\mK^{-1}=\begin{pmatrix}1/\sigma_1^2&0\\0&1/\sigma_2^2\end{pmatrix}\]Allowing off-diagonal entries in $\mK$ rotates the axes as well.
$\mK$ then defines its own axes, along its eigenvectors $\bu_1,\bu_2$, with variances $\lambda_1,\lambda_2$ along them (its eigenvalues). With $y_1,y_2$ the coordinates of $\bx-\bmu$ along them,
\[\Delta^2=\frac{y_1^2}{\lambda_1}+\frac{y_2^2}{\lambda_2}.\]This is the one-dimensional density with $z^2$ replaced by $\Delta^2$ and $\sigma$ by $|\mK|^{1/2}$, for positive definite $\mK$.
Written in terms of $\mK$,
\[p_{\bX}(\bx)=\frac{1}{(2\pi)^{d/2}|\mK|^{1/2}}\,e^{-\frac12(\bx-\bmu)^T\mK^{-1}(\bx-\bmu)}.\]The running model, $|\mK|=0.75$.
Why $|\mK|^{1/2}$ takes the place of $\sigma$: rotating to coordinates along the axes $\mK$ defines, $\by=\mU^T(\bx-\bmu)$ with $\mU=(\bu_1,\dots,\bu_d)$ its orthonormal eigenvectors, changes no volume and gives $\Delta^2=\sum_i y_i^2/\lambda_i$. The determinant is the product of the eigenvalues, $|\mK|=\prod_i\lambda_i$, so the density is a product of one-dimensional Gaussian densities with variances $\lambda_i$:
\[\htmlClass{dk1}{\frac{1}{(2\pi)^{d/2}|\mK|^{1/2}}\,e^{-\Delta^2/2}=\prod_{i=1}^d\frac{1}{\sqrt{2\pi\lambda_i}}\,e^{-y_i^2/2\lambda_i}.}\]Running model: $|\mK|=1\cdot1-0.5^2=0.75=1.5\times0.5$.
Running model: $\bmu=\bzero$, $\mK=\begin{pmatrix}1&0.5\\0.5&1\end{pmatrix}$. In $(x_1,x_2)$ order, A is $(2,2)$ and B is $(-2,2)$, both $\sqrt8$ from the mean.
With $\mK^{-1}=\frac13\begin{pmatrix}4&-2\\-2&4\end{pmatrix}$, $\Delta^2=\frac13\,(4x_1^2-4x_1x_2+4x_2^2)$, so
\[\begin{aligned}\Delta_A^2&=\tfrac13\,(16-16+16)=\tfrac{16}{3},\\ \Delta_B^2&=\tfrac13\,(16+16+16)=16.\end{aligned}\]For a $2\times2$ matrix, $\begin{pmatrix}a&b\\b&c\end{pmatrix}^{-1}=\frac{1}{ac-b^2}\begin{pmatrix}c&-b\\-b&a\end{pmatrix}$. Here $|\mK|=1-0.25=0.75$, so $\mK^{-1}=\frac{1}{0.75}\begin{pmatrix}1&-0.5\\-0.5&1\end{pmatrix}=\frac13\begin{pmatrix}4&-2\\-2&4\end{pmatrix}$.
From the density with $d=2$ and $|\mK|^{1/2}=\sqrt{0.75}$:
\[\htmlClass{dk2}{\begin{aligned}p_{\bX}(A)&=\frac{e^{-(16/3)/2}}{2\pi\sqrt{0.75}}\approx0.0128\\ p_{\bX}(B)&=\frac{e^{-16/2}}{2\pi\sqrt{0.75}}\approx6.2\times10^{-5}\\ \frac{p_{\bX}(A)}{p_{\bX}(B)}&=e^{(16-16/3)/2}=e^{16/3}\approx207\end{aligned}}\]| unit $\ba$ | $\var(\ba^T\bX)=\ba^T\mK\ba$ |
|---|---|
| $(1,0)^T$ | 1 |
| $(1,1)^T/\sqrt2$ | 1.5 |
| $(-1,1)^T/\sqrt2$ | 0.5 |
$\bX$ is jointly Gaussian, so $\ba^T\bX$ is Gaussian, and its mean and variance determine it.
Put the single row $\mA=\ba^T$ into $\E[\mA\bX]=\mA\bmu$ and $\cov(\mA\bX)=\mA\mK\mA^T$: the mean is $\ba^T\bmu$ and the variance is $\ba^T\mK\ba$.
For $\ba=(a_1,a_2)^T$ and the running $\mK$,
\[\htmlClass{dk2}{\ba^T\mK\ba=a_1^2+a_2^2+2(0.5)\,a_1a_2=1+a_1a_2}\]for a unit vector, since $a_1^2+a_2^2=1$. Hence
\[\htmlClass{dk2}{\begin{aligned}(1,0)^T&:\ 1+0=1\\ (1,1)^T/\sqrt2&:\ 1+\tfrac12=1.5\\ (-1,1)^T/\sqrt2&:\ 1-\tfrac12=0.5\end{aligned}}\]$1+a_1a_2$ is largest at $a_1=a_2=1/\sqrt2$: the bell is widest along $(1,1)^T$.
For the running model,
\[X_1+X_2\sim\cN(0,\underbrace{1+1+2(0.5)}_{3}).\]This is $\ba^T\bX$ with $\ba=(1,1)^T$, of length $\sqrt2$: the variance is $2\times1.5=3$.
The arrow is $\ba/\|\ba\|$, the direction of $\ba$, and the ticks mark $\ba^T\bx$ in the units of the axis on the right.
All three models have $X_1\sim\cN(0,1)$ and $X_2\sim\cN(0,1)$, with $\mK=\begin{pmatrix}1&\rho\\\rho&1\end{pmatrix}$.
The covariance determines the tilt. The marginal variances stay at 1.
Each marginal is Gaussian: $X_i=\be_i^T\bX$ is a linear combination.
| $\rho$ | tilt | $\var(X_1)$ | $\var(X_2)$ |
|---|---|---|---|
| $-0.5$ | down | 1 | 1 |
| 0 | none | 1 | 1 |
| 0.5 | up | 1 | 1 |
Gaussian marginals alone do not make a vector jointly Gaussian.
The density of $X\sim\uni(-1,1)$ is symmetric about 0, so its odd moments vanish: $\E[X]=\int_{-1}^1\tfrac12x\,dx=0$ and $\E[X^3]=\int_{-1}^1\tfrac12x^3\,dx=0$. With $Y=X^2$,
\[\htmlClass{dk1}{\cov(X,Y)=\E[XY]-\E[X]\E[Y]=\E[X^3]-\E[X]\E[X^2]=0.}\]Jointly Gaussian with $\rho=0$ means $\mK=\mathrm{diag}(\sigma_1^2,\sigma_2^2)$. Then $\mK^{-1}=\mathrm{diag}(1/\sigma_1^2,1/\sigma_2^2)$ and $|\mK|=\sigma_1^2\sigma_2^2$, so the exponent is a sum and the density a product:
\[\htmlClass{dk1}{\begin{aligned}p_{\bX}(\bx)&=\frac{1}{2\pi\sigma_1\sigma_2}\exp\Big(-\frac{(x_1-\mu_1)^2}{2\sigma_1^2}-\frac{(x_2-\mu_2)^2}{2\sigma_2^2}\Big)\\&=\frac{e^{-(x_1-\mu_1)^2/2\sigma_1^2}}{\sqrt{2\pi}\,\sigma_1}\cdot\frac{e^{-(x_2-\mu_2)^2/2\sigma_2^2}}{\sqrt{2\pi}\,\sigma_2}=p_{X_1}(x_1)\,p_{X_2}(x_2).\end{aligned}}\]The joint density is the product of the marginals, so $X_1$ and $X_2$ are independent. Here $\mK=\mI$: $\sigma_1=\sigma_2=1$.
First, let's see this visually and then we will do the derivation.
Here $\bmu=\bzero$ and $\mK=\begin{pmatrix}1&0.5\\0.5&1\end{pmatrix}$. Fix $X_1=x_1$ and renormalize the joint density along that slice.
| $x_1$ | mean | variance |
|---|---|---|
| 0 | 0 | 0.75 |
| 1 | 0.5 | 0.75 |
| 2 | 1 | 0.75 |
Standardized model: $X_1,X_2$ jointly Gaussian with mean 0, variance 1, and $\cov(X_1,X_2)=\rho=0.5$. Subtract from $X_2$ the part that moves with $X_1$, $Y=X_2-\rho X_1$:
\[\begin{aligned}\cov(Y,X_1)&=\cov(X_2,X_1)-\rho\var(X_1)=\rho-\rho=0\\ \var(Y)&=\var(X_2)-2\rho\cov(X_2,X_1)+\rho^2\var(X_1)=1-\rho^2\end{aligned}\]$(Y,X_1)$ is a linear map of $(X_1,X_2)$, so it is jointly Gaussian; with zero covariance, $Y\sim\cN(0,1-\rho^2)$ is independent of $X_1$. Given $X_1=x_1$, $X_2=\rho x_1+Y$, so
\[X_2\mid X_1=x_1\sim\cN(\rho x_1,\,1-\rho^2).\]Mean $\rho x_1=0.5\,x_1$: 0, 0.5 and 1 for $x_1=0,1,2$.
Variance $1-\rho^2=1-0.25=0.75$, the same for every $x_1$.
Fix $x_1$ and complete the square, $x_2^2-2\rho x_1x_2+x_1^2=(x_2-\rho x_1)^2+(1-\rho^2)x_1^2$; factors of $x_1$ alone are constants:
\[p(x_2\mid x_1)\propto\exp\Big(-\frac{(x_2-\rho x_1)^2}{2(1-\rho^2)}\Big).\]| $\rho$ | mean | variance |
|---|---|---|
| $-0.5$ | $-1$ | 0.75 |
| 0 | 0 | 1 |
| 0.5 | 1 | 0.75 |
| 0.9 | 1.8 | 0.19 |
The peak moves to $\rho x_1$: up for $\rho>0$, down for $\rho<0$. The width depends only on $|\rho|$: $\rho=\pm0.5$ give the same variance 0.75.
The conditional mean $\rho x_1$ is a line through the origin with slope $\rho$. Follow it as $x_1$ moves from $-2.5$ to $2.5$.
| $x_1$ | $\E[X_2\mid X_1=x_1]$ |
|---|---|
| $-2$ | $-1$ |
| 0 | 0 |
| 2 | 1 |
Heights in cm: mother $M$ and daughter $D$, both $\cN(163,6^2)$, jointly Gaussian with $\rho=0.5$. Illustrative values near adult height statistics.
A mother of 175 cm, 2 SD above the mean:
\[\htmlClass{dk1}{\E[D\mid M=175]=163+0.5\cdot12=169}\]Galton, F. (1886). Regression towards mediocrity in hereditary stature. J. Anthropological Institute 15, 246–263.
Standardize: $Z_X=(X-\mu_X)/\sigma_X$ and $Z_Y=(Y-\mu_Y)/\sigma_Y$ are jointly Gaussian with variance 1 and correlation $\rho$, so $\E[Z_Y\mid Z_X=z]=\rho z$. Observing $X=x$ is observing $Z_X=(x-\mu_X)/\sigma_X$:
\[\begin{aligned}\E[Y\mid X=x]&=\mu_Y+\sigma_Y\,\E\Big[Z_Y\,\Big|\,Z_X=\frac{x-\mu_X}{\sigma_X}\Big]\\&=\mu_Y+\rho\,\frac{\sigma_Y}{\sigma_X}\,(x-\mu_X).\end{aligned}\]Daughters given mothers: $\mu_Y=\mu_X=163$, $\sigma_Y=\sigma_X=6$, and $x-\mu_X=175-163=12$. So $\E[D\mid M=175]=163+0.5\cdot12=169$.
Mothers given daughters: the roles swap, and with equal standard deviations the slope is again $0.5$; $169-163=6$, so $\E[M\mid D=169]=163+0.5\cdot6=166$.
Minimize $f(a,b)=\E[(Y-a-bX)^2]$, a convex quadratic in $(a,b)$, by setting both partial derivatives to zero:
\[\begin{aligned}\frac{\partial f}{\partial a}&=-2\,\E[Y-a-bX]=0\quad\Rightarrow\quad a=\E Y-b\,\E X\\ \frac{\partial f}{\partial b}&=-2\,\E[X(Y-a-bX)]=0\end{aligned}\]Substitute $a$ into the second condition: $\E\big[X\big((Y-\E Y)-b(X-\E X)\big)\big]=0$, that is, $\cov(X,Y)-b\var(X)=0$. So
\[\htmlClass{dk1}{b=\frac{\cov(X,Y)}{\var(X)}=\frac{\rho\,\sigma_X\sigma_Y}{\sigma_X^2}=\rho\,\frac{\sigma_Y}{\sigma_X}.}\]Mothers ($X$) and daughters ($Y$): $\rho=0.5$ and $\sigma_X=\sigma_Y=6$, so $b=0.5$ cm per cm, the slope of $\E[D\mid M=m]$ on the previous slide.
$\bX_a\in\mathbb R^2$: the child's height and weight.
$\bX_b\in\mathbb R^4$: both parents' heights and weights.
With one coordinate in each block, this is the running model: $\mK_{ab}\mK_{bb}^{-1}=\rho=0.5$ and $\mK_{a|b}=1-\rho^2=0.75$.
Set $\mathsf C=\mK_{ab}\mK_{bb}^{-1}$ and $\bY=\bX_a-\mathsf C\bX_b$. By the linear-transformation rules, with $\mK_{ba}=\mK_{ab}^T$,
\[\begin{aligned}\cov(\bY,\bX_b)&=\mK_{ab}-\mathsf C\mK_{bb}=\mathsf 0\\ \cov(\bY)&=\mK_{aa}-\mathsf C\mK_{ba}-\mK_{ab}\mathsf C^T+\mathsf C\mK_{bb}\mathsf C^T\\&=\mK_{aa}-\mK_{ab}\mK_{bb}^{-1}\mK_{ba}.\end{aligned}\]$(\bY,\bX_b)$ is jointly Gaussian with zero cross-covariance, so $\bY$ is independent of $\bX_b$, with mean $\bmu_a-\mathsf C\bmu_b$. Given $\bX_b=\bx_b$, $\bX_a=\bY+\mathsf C\bx_b$ is Gaussian with
mean $\bmu_a-\mathsf C\bmu_b+\mathsf C\bx_b=\bmu_a+\mK_{ab}\mK_{bb}^{-1}(\bx_b-\bmu_b)$,
covariance $\cov(\bY)=\mK_{aa}-\mK_{ab}\mK_{bb}^{-1}\mK_{ba}$; adding the constant $\mathsf C\bx_b$ does not change it.
One standardized coordinate in each block: $\mK_{aa}=\mK_{bb}=1$ and $\mK_{ab}=\rho$, so $\mathsf C=\rho=0.5$ and $\mK_{a|b}=1-\rho^2=0.75$.
So far the distribution was known, and we predicted unobserved quantities from observed ones.
Suppose we observe the points on the right, iid from $\cN(\btheta,\mK)$ with $\btheta$ and $\mK$ unknown.
Four illustrative samples.
Maximize over $\btheta$:
\[\ell(\btheta,\mK)=\frac n2\ln|\mK^{-1}|-\frac12\sum_{i}(\bx_i-\btheta)^T\mK^{-1}(\bx_i-\btheta)+c\]Four illustrative samples.
Substitute $\hat\btheta_{\mle}=\bar\bx$ and maximize over the precision matrix $\Lambda=\mK^{-1}$:
\[\ell(\Lambda)=\frac n2\ln|\Lambda|-\frac12\sum_{i}(\bx_i-\bar\bx)^T\Lambda(\bx_i-\bar\bx)+c\]Four illustrative samples.
Differentiate entry by entry, treating the $\Lambda_{ij}$ as free variables.
$\bx^T\Lambda\bx=\sum_{i,j}x_i\Lambda_{ij}x_j$, so $\partial(\bx^T\Lambda\bx)/\partial\Lambda_{ij}=x_ix_j$, the $(i,j)$ entry of $\bx\bx^T$.
Expand $|\Lambda|$ along row $i$: $|\Lambda|=\sum_j\Lambda_{ij}C_{ij}$, where the cofactor $C_{ij}$ does not involve $\Lambda_{ij}$. So $\partial|\Lambda|/\partial\Lambda_{ij}=C_{ij}$. The inverse is the transposed cofactor matrix over the determinant, so for symmetric $\Lambda$
\[\htmlClass{dk2}{\frac{\partial\ln|\Lambda|}{\partial\Lambda_{ij}}=\frac{C_{ij}}{|\Lambda|}=(\Lambda^{-1})_{ji}=(\Lambda^{-1})_{ij}.}\]Apply the first fact to each residual $\bx_i-\bar\bx$ and set the gradient to $\mathsf 0$:
\[\htmlClass{dk3}{\frac n2\hat\Lambda^{-1}=\frac12\sum_{i=1}^n(\bx_i-\bar\bx)(\bx_i-\bar\bx)^T.}\]Multiply by $2/n$ and use $\hat\mK_{\mle}=\hat\Lambda^{-1}$. The log-determinant is concave and the other term is linear in $\Lambda$, so this stationary point is the maximum.
Residuals $\bx_i-\bar\bx$ of the four samples, and their outer products $(\bx_i-\bar\bx)(\bx_i-\bar\bx)^T$:
The two residuals along the tilt supply the off-diagonal 4. The fitted $\Delta=1$ ellipse follows the tilt.
The samples are independent with true mean $\btheta^*$ and true covariance $\mK^*$. Residuals are measured from $\bar\bx$, which is fit to the same samples, so they run shorter than deviations from $\btheta^*$.
So $\E\big[\hat\mK_{\mle}\big]=\frac{n-1}n\,\mK^*$. Dividing by $n-1$ instead is unbiased:
\[\boxed{\frac1{n-1}\sum_{i=1}^n(\bx_i-\bar\bx)(\bx_i-\bar\bx)^T}\]Here $\tfrac13\begin{pmatrix}6&4\\4&6\end{pmatrix}=\begin{pmatrix}2&4/3\\4/3&2\end{pmatrix}$: the same shape, a larger ellipse.
For samples in $\mathbb R^d$ with $n\le d$, the sample covariance is necessarily singular: a nonsingular Gaussian fit needs enough independent directions.
Write $\bx_i-\bar\bx=(\bx_i-\btheta^*)-(\bar\bx-\btheta^*)$ and expand each outer product. Since $\sum_i(\bx_i-\btheta^*)=n(\bar\bx-\btheta^*)$, each of the two cross sums is $-n(\bar\bx-\btheta^*)(\bar\bx-\btheta^*)^T$, and the last term adds $n(\bar\bx-\btheta^*)(\bar\bx-\btheta^*)^T$:
\[\htmlClass{dk1}{\begin{aligned}\sum_i(\bx_i-\bar\bx)(\bx_i-\bar\bx)^T&=\sum_i(\bx_i-\btheta^*)(\bx_i-\btheta^*)^T\\&\quad-n(\bar\bx-\btheta^*)(\bar\bx-\btheta^*)^T.\end{aligned}}\]Each term of the first sum has mean $\cov(\bx_i)=\mK^*$, so the sum has mean $n\mK^*$.
The second term: $\bar\bx-\btheta^*=\frac1n\sum_i(\bx_i-\btheta^*)$, so
\[\htmlClass{dk2}{(\bar\bx-\btheta^*)(\bar\bx-\btheta^*)^T=\frac1{n^2}\sum_{i}\sum_{j}(\bx_i-\btheta^*)(\bx_j-\btheta^*)^T.}\]For $i\neq j$ the samples are independent, so $\E\big[(\bx_i-\btheta^*)(\bx_j-\btheta^*)^T\big]=\E[\bx_i-\btheta^*]\,\E[\bx_j-\btheta^*]^T=\mathsf 0$. The $n$ terms with $i=j$ each have mean $\mK^*$:
\[\htmlClass{dk2}{\E\big[(\bar\bx-\btheta^*)(\bar\bx-\btheta^*)^T\big]=\frac1{n^2}\cdot n\mK^*=\frac1n\mK^*.}\]The posterior is $\cpo{\cN(\hat\btheta_n,\mS_n)}$. The data mean has covariance $\mK/n$, so the data precision is $n\mK^{-1}$.
Log prior plus log likelihood, up to constants; then expand with $(\ba-\bb)^T\mA(\ba-\bb)=\ba^T\mA\ba-2\ba^T\mA\bb+\bb^T\mA\bb$ for symmetric $\mA$, use $\sum_i\bx_i=n\bar\bx$, and collect powers of $\btheta$:
\[\begin{aligned}\ln p(\btheta\mid\bx_1^n)&=-\tfrac12(\btheta-\bmu_0)^T\mS_0^{-1}(\btheta-\bmu_0)\\ &\quad-\tfrac12\textstyle\sum_{i=1}^n(\bx_i-\btheta)^T\mK^{-1}(\bx_i-\btheta)+c\\ &=-\tfrac12\,\btheta^T\htmlClass{dk1}{(\mS_0^{-1}+n\mK^{-1})}\,\btheta+\btheta^T\htmlClass{dk2}{(\mS_0^{-1}\bmu_0+n\mK^{-1}\bar\bx)}+c'.\end{aligned}\]A Gaussian $\cN(\boldsymbol m,\mS)$ has $\ln p(\btheta)=-\tfrac12\,\btheta^T\mS^{-1}\btheta+\btheta^T\mS^{-1}\boldsymbol m+c''$. Matching the two:
Quadratic terms: $\mS_n^{-1}=\mS_0^{-1}+n\mK^{-1}$.
Linear terms: $\mS_n^{-1}\hat\btheta_n=\mS_0^{-1}\bmu_0+n\mK^{-1}\bar\bx$. Multiply by $\mS_n$.
Given $\bTheta$, the $\bX_i$ are independent with covariance $\mK$, so $\cov(\bar\bX\mid\bTheta)=\frac{1}{n^2}\,n\mK=\mK/n$.
Every matrix is diagonal, so each coordinate updates on its own. The prior precision is $\mS_0^{-1}=\mathrm{diag}(1,\tfrac14)$ and the data precision is $n\mK^{-1}=(\mK/n)^{-1}=\mathrm{diag}(\tfrac14,1)$.
Add the precisions and invert:
\[\htmlClass{dk1}{\mS_n^{-1}=\mathrm{diag}\big(1+\tfrac14,\ \tfrac14+1\big)=\tfrac54\,\mI,\qquad\mS_n=0.8\,\mI.}\]With $\bmu_0=\bzero$,
\[\htmlClass{dk2}{\begin{aligned}\hat\btheta_n&=\mS_n\big(\mS_0^{-1}\bmu_0+n\mK^{-1}\bar\bx\big)\\&=0.8\Big(\bzero+\begin{pmatrix}\tfrac14\cdot2\\1\cdot2\end{pmatrix}\Big)=0.8\begin{pmatrix}0.5\\2\end{pmatrix}=\begin{pmatrix}0.4\\1.6\end{pmatrix}.\end{aligned}}\]Each coordinate averages the prior mean 0 and the data mean 2, weighted by their shares of the precision: the data get $\frac{1/4}{5/4}=0.2$ in coordinate 1 and $\frac{1}{5/4}=0.8$ in coordinate 2.
Same prior; individual observations have $\mK=\begin{pmatrix}4&0\\0&1\end{pmatrix}$, and the data mean stays at $\bar\bx=(2,2)^T$ while $n$ grows.
| $n$ | $\hat\btheta_n$ | $\mS_n$ |
|---|---|---|
| 1 | $(0.4,\,1.6)^T$ | $\mathrm{diag}(0.8,\,0.8)$ |
| 4 | $(1,\,32/17)^T$ | $\mathrm{diag}(0.5,\,4/17)$ |
Per observation $\mK^{-1}=\mathrm{diag}(\tfrac14,1)$, so the data precision is $n\mK^{-1}=\mathrm{diag}(\tfrac n4,n)$. The prior has $\bmu_0=\bzero$ and $\mS_0^{-1}=\mathrm{diag}(1,\tfrac14)$. The matrices are diagonal, so coordinate by coordinate, with $\bar\bx=(2,2)^T$,
\[\begin{aligned}(\mS_n)_{11}&=\frac{1}{1+n/4},&(\hat\btheta_n)_1&=(\mS_n)_{11}\cdot\frac n4\cdot2\\ (\mS_n)_{22}&=\frac{1}{1/4+n},&(\hat\btheta_n)_2&=(\mS_n)_{22}\cdot n\cdot2\end{aligned}\]$n=1$: $(\mS_n)_{11}=(\mS_n)_{22}=\frac1{5/4}=0.8$, and $\hat\btheta_n=(0.8\cdot\frac12,\ 0.8\cdot2)^T=(0.4,\,1.6)^T$.
$n=4$: $(\mS_n)_{11}=\frac12$ and $(\mS_n)_{22}=\frac1{17/4}=\frac4{17}$, so $\hat\btheta_n=(\frac12\cdot2,\ \frac4{17}\cdot8)^T=(1,\,\frac{32}{17})^T$.