\documentclass[11pt]{article}
\usepackage{latexsym}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{epsfig}
\usepackage[tight]{subfigure}
\usepackage{algorithmic}
\usepackage{algorithm}

\newcommand{\handout}[5]{
  \noindent
  \begin{center}
  \framebox{
    \vbox{
      \hbox to 5.78in { {#1} \hfill #2 }
      \vspace{4mm}
      \hbox to 5.78in { {\Large \hfill #5  \hfill} }
      \vspace{2mm}
      \hbox to 5.78in { {\em #3 \hfill #4} }
    }
  }
  \end{center}
  \vspace*{4mm}
}

\newcommand{\lecture}[5]{\handout{#1}{#2}{#3}{#4}{#5}}

\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{assumption}[theorem]{Assumption}

% 1-inch margins, from fullpage.sty by H.Partl, Version 2, Dec. 15, 1988.
\topmargin 0pt
\advance \topmargin by -\headheight
\advance \topmargin by -\headsep
\textheight 8.9in
\oddsidemargin 0pt
\evensidemargin \oddsidemargin
\marginparwidth 0.5in
\textwidth 6.5in

\parindent 0in
\parskip 1.5ex
%\renewcommand{\baselinestretch}{1.25}

\begin{document}

\lecture{Statistical Techniques in Robotics (16-831, F08)}{Lecture \#13 (Tuesday October $7^{nd}$)}{Lecturer: Drew Bagnell}{Scribe: Kevin Lipkin}{Bayes' Linear Regression Part 2}


\section{Bayes' Online Learning with Prior}

\begin{itemize}
\item $p_{i}$ = prior
\item Set initial weights to each expert: $w_{i} = Np_{i}$
\item Each expert makes prediction $y_{i}$
\item Predict:
\begin{itemize}
\item 	
Predict 1 If:
\begin{equation}
	\sum_{y=1}{w_{i}} \geq \sum_{y=0}{w_{i}} 
\end{equation}
\item	Else,	Predict 0
\end{itemize}
\item Update:
\begin{itemize}
\item If expert $e_{i}$ made a mistake, $w_{i} = 1/2 w_{i}$
\end{itemize}
\item Analysis of Algorithm:
\begin{itemize}
\item Total weights of the experts W = \sum_{i}${w_{i}}$
\item Weight of the best expert $w^* \leq  W$
\item M is the total number of mistakes predicted by the algorithm, $m^*$ are the number of mistakes made by the best expert:
\begin{equation}
	w^* = 2^{-m^*} N p^*
\end{equation}
\begin{equation}
	W \leq N(\frac{4}{3}) ^{-M}
\end{equation}

\item Thus, since $w^* \leq  W$
\begin{equation}
2^{-m^*} N p^* \leq N(\frac{4}{3}) ^{-M}
\end{equation}

\begin{equation}
-m^* + \log p^* \leq -M c
\end{equation}
Where $c = \log_{2}(4/3)$

\item Therefore, the total mistakes made by the algorithm are bounded by:
\begin{equation}
M \leq \frac{{m^* + \log(\frac{1}{p^*})}}{c}
\end{equation}
\end{itemize}
\item Weighted majority using prior thus has:
\begin{itemize}
\item No dependence on N
\item Because of prior, infinite sets of experts are possible
\item If you see "log n" where n is some discrete set of experts, think hidden uniform distribution
\item Every learning algorithm has a prior - some are more explicit than others
\item Priors in hypothesis space correspond to weights on experts
\end{itemize}
\end{itemize}



\section{General Weighted Majority Update}
\begin{itemize}
\item Bayes' Rule is a special case of weighted majority
\item Predict:
\begin{itemize}
\item Choose expert $i$ in proportion to $\frac{w_{i}}{\sum_{j}{w_{j}}}$
\item Predict the same as what expert $e_{i}$ predicts
\end{itemize}
\item Receive Loss: $l_{t}(i)$
\item Update Weights:
\begin{itemize}
\item $w_{i} = w_{i}e^{-\alpha l_{t}(i)}$
\\or, use first term of Taylor Series expansion:
\item $w_{i} = w_{i}(1-\alpha l_{t}(i))$
\end{itemize}
\item Expert i's prediction is a probability distribution: $p_{i}(y)$
\item Standard loss for making a probabilistic prediction is log-loss:
\begin{equation}
l_{t}(i) = \log{(p_{i}(y_{t}))}
\end{equation}
Where $y_{t}$ is the true observation
\item Plugging the log-loss into the weight update rule:
\begin{equation}
w_{i} = w_{i}e^{-\alpha \log{(p_{i}(y_{t}))}}
\end{equation}
\item This simplifies to:
\begin{equation}
w_{i} = w_{i} [p_{i}(y_{t})]^{\alpha}
\end{equation}
\item Which, when $\alpha = 1$, is Bayes' Rule exactly.  According to Bayes' Rule: $p(i|y) = p(i)p(y|i)$.  In this case, $p(i|y)$ is equivalent to $w_{t+1}$, $p(i)$ is equivalent to $w_{t}$, and $p(i|y)$ is $p_{i}(y_{t})$.
\end{itemize}




\section{Bayes' Linear Regression}
\begin{itemize}
\item $\theta$ = Weight Vector
\item $x_{t}$ = set of features
\item $y_{t}$ = outcome
\item Use Gaussian distribution for likelihood term:
\begin{equation}
p(y|x,\theta) = \frac{1}{z} e^\frac{{-(\theta^{T}x-y)^{2}}}{2\sigma^{2}}
\end{equation}
This is called the Moment Parameterization of a Guassian.
\item Prior term is a multidemensional guassian:
\begin{equation}
p(\theta) = \frac{1}{z} e^{-(\theta-\mu)^{T}\Sigma^{-1}(\theta-\mu)}
\end{equation}
Where $\Sigma$ is positive-definite and symmetric
\item The Natural Parameterization of (11) is:
\begin{equation}
p(\theta) = \frac{1}{z} e^{J^{T}\theta - \frac{1}{2}\theta^{T}P\theta}
\end{equation}
\item $p(\theta|y,x) = p(\theta)p(y|x,\theta)$     = (12)*(10):
\begin{equation}
p(\theta)p(y|x,\theta) =  \frac{1}{z} e^{\frac{{-(\theta^{T}x-y)^{2}}}{2\sigma^{2}}+J^{T}\theta - \frac{1}{2}\theta^{T}P\theta}
\end{equation}
\item Combining like terms leaves us with a form very similar to our prior expression (12).  Thus, we can update the values of J and P:
\begin{equation}
J' = J + \frac{yx^{T}}{\sigma^{2}}
\end{equation}
\begin{equation}
P' = P + \frac{xx^{T}}{\sigma^{2}}
\end{equation}
\end{itemize}



\end{document}
