# Welcome to Randal Douc's wiki

A collaborative site on maths but not only!

• Theatre
• Research
• Teaching

### Miscellanous

world:kullback

$$\newcommand{\arginf}{\mathrm{arginf}} \newcommand{\argmin}{\mathrm{argmin}} \newcommand{\argmax}{\mathrm{argmax}} \newcommand{\asconv}[1]{\stackrel{#1-a.s.}{\rightarrow}} \newcommand{\Aset}{\mathsf{A}} \newcommand{\b}[1]{{\mathbf{#1}}} \newcommand{\ball}[1]{\mathsf{B}(#1)} \newcommand{\bbQ}{{\mathbb Q}} \newcommand{\bproof}{\textbf{Proof :}\quad} \newcommand{\bmuf}[2]{b_{#1,#2}} \newcommand{\card}{\mathrm{card}} \newcommand{\chunk}[3]{{#1}_{#2:#3}} \newcommand{\condtrans}[3]{p_{#1}(#2|#3)} \newcommand{\convprob}[1]{\stackrel{#1-\text{prob}}{\rightarrow}} \newcommand{\Cov}{\mathbb{C}\mathrm{ov}} \newcommand{\cro}[1]{\langle #1 \rangle} \newcommand{\CPE}[2]{\PE\lr{#1| #2}} \renewcommand{\det}{\mathrm{det}} \newcommand{\dimlabel}{\mathsf{m}} \newcommand{\dimU}{\mathsf{q}} \newcommand{\dimX}{\mathsf{d}} \newcommand{\dimY}{\mathsf{p}} \newcommand{\dlim}{\Rightarrow} \newcommand{\e}[1]{{\left\lfloor #1 \right\rfloor}} \newcommand{\eproof}{\quad \Box} \newcommand{\eremark}{</WRAP>} \newcommand{\eqdef}{:=} \newcommand{\eqlaw}{\stackrel{\mathcal{L}}{=}} \newcommand{\eqsp}{\;} \newcommand{\Eset}{ {\mathsf E}} \newcommand{\esssup}{\mathrm{essup}} \newcommand{\fr}[1]{{\left\langle #1 \right\rangle}} \newcommand{\falph}{f} \renewcommand{\geq}{\geqslant} \newcommand{\hchi}{\hat \chi} \newcommand{\Hset}{\mathsf{H}} \newcommand{\Id}{\mathrm{Id}} \newcommand{\img}{\text{Im}} \newcommand{\indi}[1]{\mathbf{1}_{#1}} \newcommand{\indiacc}[1]{\mathbf{1}_{\{#1\}}} \newcommand{\indin}[1]{\mathbf{1}\{#1\}} \newcommand{\itemm}{\quad \quad \blacktriangleright \;} \newcommand{\jointtrans}[3]{p_{#1}(#2,#3)} \newcommand{\ker}{\text{Ker}} \newcommand{\klbck}[2]{\mathrm{K}\lr{#1||#2}} \newcommand{\law}{\mathcal{L}} \newcommand{\labelinit}{\pi} \newcommand{\labelkernel}{Q} \renewcommand{\leq}{\leqslant} \newcommand{\lone}{\mathsf{L}_1} \newcommand{\lrav}[1]{\left|#1 \right|} \newcommand{\lr}[1]{\left(#1 \right)} \newcommand{\lrb}[1]{\left[#1 \right]} \newcommand{\lrc}[1]{\left\{#1 \right\}} \newcommand{\lrcb}[1]{\left\{#1 \right\}} \newcommand{\ltwo}[1]{\PE^{1/2}\lrb{\lrcb{#1}^2}} \newcommand{\Ltwo}{\mathrm{L}^2} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mcbb}{\mathcal B} \newcommand{\mcf}{\mathcal{F}} \newcommand{\meas}[1]{\mathrm{M}_{#1}} \newcommand{\norm}[1]{\left\|#1\right\|} \newcommand{\normmat}[1]{{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert #1 \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}} \newcommand{\nset}{\mathbb N} \newcommand{\N}{\mathcal{N}} \newcommand{\one}{\mathsf{1}} \newcommand{\PE}{\mathbb E} \newcommand{\pminfty}{_{-\infty}^\infty} \newcommand{\PP}{\mathbb P} \newcommand{\projorth}[1]{\mathsf{P}^\perp_{#1}} \newcommand{\Psif}{\Psi_f} \newcommand{\pscal}[2]{\langle #1,#2\rangle} \newcommand{\pscal}[2]{\langle #1,#2\rangle} \newcommand{\psconv}{\stackrel{\PP-a.s.}{\rightarrow}} \newcommand{\qset}{\mathbb Q} \newcommand{\revcondtrans}[3]{q_{#1}(#2|#3)} \newcommand{\rmd}{\mathrm d} \newcommand{\rme}{\mathrm e} \newcommand{\rmi}{\mathrm i} \newcommand{\Rset}{\mathbb{R}} \newcommand{\rset}{\mathbb{R}} \newcommand{\rti}{\sigma} \newcommand{\section}[1]{==== #1 ====} \newcommand{\seq}[2]{\lrc{#1\eqsp: \eqsp #2}} \newcommand{\set}[2]{\lrc{#1\eqsp: \eqsp #2}} \newcommand{\sg}{\mathrm{sgn}} \newcommand{\supnorm}[1]{\left\|#1\right\|_{\infty}} \newcommand{\thv}{{\theta_\star}} \newcommand{\tmu}{ {\tilde{\mu}}} \newcommand{\Tset}{ {\mathsf{T}}} \newcommand{\Tsigma}{ {\mathcal{T}}} \newcommand{\ttheta}{{\tilde \theta}} \newcommand{\tv}[1]{\left\|#1\right\|_{\mathrm{TV}}} \newcommand{\unif}{\mathrm{Unif}} \newcommand{\weaklim}[1]{\stackrel{\mathcal{L}_{#1}}{\rightsquigarrow}} \newcommand{\Xset}{{\mathsf X}} \newcommand{\Xsigma}{\mathcal X} \newcommand{\Yset}{{\mathsf Y}} \newcommand{\Ysigma}{\mathcal Y} \newcommand{\Var}{\mathbb{V}\mathrm{ar}} \newcommand{\zset}{\mathbb{Z}} \newcommand{\Zset}{\mathsf{Z}}$$

2017/10/07 23:39 ·

# Kullback-Leibler divergence for normal distributions

Let $\mu_0,\mu_1 \in \rset^p$ and $\Sigma_0,\Sigma_1 \in \rset^{p \times p}$ where $\Sigma_0,\Sigma_1$ are symmetric definite positive. Then, $$\klbck{\N(\mu_0,\Sigma_0)}{\N(\mu_1,\Sigma_1)}=-\frac{p}{2} + \frac{(\mu_0-\mu_1)^T \Sigma_1^{-1} (\mu_0-\mu_1) }{2} + \frac{Tr\lr{\Sigma_1^{-1} \Sigma_0}}{2} - \frac{1}{2} \log \frac{\mathrm{det} \Sigma_0}{\mathrm{det} \Sigma_1}$$

## Proof

Assume that $X_0\sim \N(\mu_0,\Sigma_0)$ then $X_0= \mu_0 + \Sigma_0^{1/2} U_0$ where $U_0\sim \N(0,I_p)$ \begin{align*} \klbck{\N(\mu_0,\Sigma_0)}{\N(\mu_1,\Sigma_1)}&= \PE\lrb{\log \frac{\rme^{-(X_0-\mu_0)^T \Sigma_0^{-1} (X_0-\mu_0) / 2}}{\rme^{-(X_0-\mu_1)^T \Sigma_1^{-1} (X_0-\mu_1) / 2}}} - \frac{1}{2} \log \frac{\mathrm{det} \Sigma_0}{\mathrm{det} \Sigma_1} \\ & = \PE\lrb{-\frac{U_0^T U_0}{2}}+\frac{1}{2} \PE\lrb{(\mu_0-\mu_1 + \Sigma_0^{1/2}U_0)^T \Sigma_1^{-1} (\mu_0-\mu_1 + \Sigma_0^{1/2}U_0)} - \frac{1}{2} \log \frac{\mathrm{det} \Sigma_0}{\mathrm{det} \Sigma_1} \\ &= -\frac{p}{2} + \frac{(\mu_0-\mu_1)^T \Sigma_1^{-1} (\mu_0-\mu_1) }{2} + \frac 1 2 \PE\lrb{U_0^T \Sigma_0^{1/2} \Sigma_1^{-1} \Sigma_0^{1/2} U_0} - \frac{1}{2} \log \frac{\mathrm{det} \Sigma_0}{\mathrm{det} \Sigma_1}\\ &= -\frac{p}{2} + \frac{(\mu_0-\mu_1)^T \Sigma_1^{-1} (\mu_0-\mu_1) }{2} + \frac 1 2 \PE\lrb{U_0^T \Sigma_0^{1/2} \Sigma_1^{-1} \Sigma_0^{1/2} U_0} - \frac{1}{2} \log \frac{\mathrm{det} \Sigma_0}{\mathrm{det} \Sigma_1}\\ &= -\frac{p}{2} + \frac{(\mu_0-\mu_1)^T \Sigma_1^{-1} (\mu_0-\mu_1) }{2} + \frac{Tr\lr{\Sigma_1^{-1} \Sigma_0}}{2} - \frac{1}{2} \log \frac{\mathrm{det} \Sigma_0}{\mathrm{det} \Sigma_1} \end{align*} where in the last line, we have used that

\begin{align*} \PE\lrb{U_0^T \Sigma_0^{1/2} \Sigma_1^{-1} \Sigma_0^{1/2} U_0}&=\lr{\PE\lrb{Tr\lr{U_0^T \Sigma_0^{1/2} \Sigma_1^{-1} \Sigma_0^{1/2} U_0}}}=Tr\lr{\PE\lrb{\Sigma_1^{-1} \Sigma_0^{1/2} U_0 U_0^T \Sigma_0^{1/2} }} \\ &=Tr\lr{\Sigma_1^{-1} \Sigma_0^{1/2} \PE\lrb{U_0 U_0^T} \Sigma_0^{1/2} }=Tr\lr{\Sigma_1^{-1} \Sigma_0} \end{align*}