https://github.com/rgiordan/LinearResponseVariationalBayes.py
Raw File
Tip revision: 0de256d2d2126a29f4c589aa9dc3ec70a8f70f7f authored by Ryan Giordano on 22 September 2017, 19:54:10 UTC
Moment parameter for UVN
Tip revision: 0de256d
mvn.lyx
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\begin_inset FormulaMacro
\newcommand{\mbe}{\mathbb{E}}
{\mathbb{E}}
\end_inset


\end_layout

\begin_layout Standard
\begin_inset Formula 
\begin{align*}
\log P\left(Y\vert\mu,\Sigma\right) & =-\frac{1}{2}\sum_{n}\left(Y_{n}-\mu\right)^{T}\Sigma^{-1}\left(Y_{n}-\mu\right)-\frac{1}{2}N\log\left|\Sigma\right|+C\\
 & =-\frac{1}{2}\sum_{n}\mathrm{trace}\left(\Sigma^{-1}Y_{n}Y_{n}^{T}\right)+\sum_{n}\mathrm{trace}\left(\Sigma^{-1}Y_{n}\mu^{T}\right)-N\frac{1}{2}\mathrm{trace}\left(\Sigma^{-1}\mu\mu^{T}\right)-\frac{1}{2}N\log\left|\Sigma\right|+C\\
\log P\left(\mu\right) & =-\frac{1}{2}\mathrm{trace}\left(\Sigma_{\mu}^{-1}\mu\mu^{T}\right)+C\\
\log P\left(\Sigma\right) & =-\frac{1}{2}\mathrm{trace}\left(V\Sigma^{-1}\right)-\nu\log\left|\Sigma\right|
\end{align*}

\end_inset


\end_layout

\begin_layout Standard
Suppose we have an approximate posterior, 
\begin_inset Formula $q\left(\mu\vert Y\right)$
\end_inset

 .
 We wish to calculate an expectation with respect to the true posterior
\begin_inset Formula 
\begin{align*}
\mbe\left[g\left(\mu\right)\vert Y\right] & =\int P\left(\mu\vert Y\right)g\left(\mu\right)d\mu\\
P\left(\mu\vert Y\right) & \propto P\left(Y\vert\mu\right)P\left(\mu\right).
\end{align*}

\end_inset


\end_layout

\begin_layout Standard
Suppose we knew the true 
\begin_inset Formula $\mu_{0}$
\end_inset

 that generated 
\begin_inset Formula $Y$
\end_inset

.
 We could then draw 
\begin_inset Formula $B$
\end_inset

 new datasets,
\begin_inset Formula 
\begin{align*}
Y_{b} & \sim P\left(Y_{b}\vert\mu_{0}\right),\textrm{ for }b=1,...,B.
\end{align*}

\end_inset


\end_layout

\begin_layout Standard
For each of these, we could draw from 
\begin_inset Formula $\mu_{s}\sim q\left(\mu\vert Y_{b}\right)$
\end_inset

.
 This is an over-dispersed version of 
\begin_inset Formula $q\left(\mu\vert Y\right)$
\end_inset

, with,
\begin_inset Formula 
\begin{align*}
P\left(\mu_{s}\vert\mu_{0}\right) & =\int q\left(\mu\vert Y_{b}\right)P\left(Y_{b}\vert\mu_{0}\right)dY_{b}.
\end{align*}

\end_inset


\end_layout

\begin_layout Standard
An importance sampling estimate of 
\begin_inset Formula $\mbe\left[g\left(\mu\right)\vert Y\right]$
\end_inset

 is then
\begin_inset Formula 
\begin{align*}
\mbe\left[g\left(\mu\right)\vert Y\right] & \approx\sum_{s}g\left(\mu_{s}\right)\tilde{w}_{s}\\
w_{b} & =\frac{P\left(Y\vert\mu_{s}\right)P\left(\mu_{s}\right)}{\int q\left(\mu_{s}\vert Y_{b}\right)P\left(Y_{b}\vert\mu_{0}\right)dY_{b}}\\
\tilde{w}_{b} & =\frac{w_{b}}{\sum_{b'}w_{b'}}
\end{align*}

\end_inset


\end_layout

\begin_layout Standard
Of course, we do not know the denominator of 
\begin_inset Formula $w_{b}$
\end_inset

.
 However, we can approximate it with a non-parametric bootstrap:
\end_layout

\begin_layout Standard
\begin_inset Formula 
\begin{align*}
\int q\left(\mu_{s}\vert Y_{b}\right)P\left(Y_{b}\vert\mu_{0}\right)dY_{b} & \approx\frac{1}{B}\sum_{b}q\left(\mu_{s}\vert Y_{b}\right)\\
Y_{b} & \sim\mathrm{Bootstrap}\left(Y\right)
\end{align*}

\end_inset


\end_layout

\begin_layout Standard
This is a bit fuzzy, since the bootstrap distribution does not approximate
 the distribution under the true 
\begin_inset Formula $\mu_{0}$
\end_inset

.
 Typically you use it with pivots.
 This seems tricky and let us not get hung up on it for now.
 Note that is is important to draw again from an approximation to the posterior
 so that we are doing importance sampling on a mixture of distributions
 in the 
\begin_inset Formula $\mu$
\end_inset

 space.
 Point estimates will not, I think, do in general, since the sample space
 of the bootstrap (the data, 
\begin_inset Formula $Y$
\end_inset

) is generally different from the sample space of 
\begin_inset Formula $\mu$
\end_inset

, so importance sampling does not make sense.
\end_layout

\begin_layout Standard
A (under-dispersed) variational approximation to the normal model is given
 by
\begin_inset Formula 
\begin{align*}
\bar{Y} & =\frac{1}{N}\sum Y_{n}\\
\Lambda & :=N\Sigma^{-1}+\Sigma_{\mu}^{-1}\\
q\left(\mu\vert Y\right) & =\prod_{k}q\left(\mu_{k}\right)\\
q\left(\mu_{k}\vert Y\right) & =\mathcal{N}\left(\mu_{k};\left(N\Lambda^{-1}\Sigma^{-1}\bar{Y}\right)_{k},1/\Lambda_{kk}\right)
\end{align*}

\end_inset


\end_layout

\end_body
\end_document
back to top