\documentclass{beamer} \usepackage{verbatim} \usecolortheme{seagull} \usepackage{pstricks,pst-node,pst-tree,amscd,amsfonts,verbatim,geometry,bbm} \usepackage{fancyvrb,fancybox} \usepackage{color} \usepackage{xcolor} \usepackage{colortbl} \usepackage{graphicx} %\RequirePackage{etex} %\usepackage{etex} %\usepackage{xypic} \usepackage[all,color]{xy} \usepackage{natbib} \usepackage{enumitem} \usepackage{tkz-graph} \usepackage{tikz} \usetikzlibrary{arrows,automata} \usetikzlibrary{graphs,arrows.meta} \usetikzlibrary{positioning} \usepackage{caption} \captionsetup[figure]{labelfont={it},textfont={color=black,it},labelformat={default},labelsep=period,name={}} \usepackage[latin1]{inputenc} \usepackage{undertilde} \usepackage{bm} \usepackage{amssymb} \usepackage{amsmath} %\usepackage{lastpage} \usepackage{rotating} \usepackage{multirow} \usepackage{graphicx} \usepackage{bbm} \usepackage{bbold} \usepackage{upgreek} \usepackage{fancybox} \usepackage{fancyhdr} \usepackage{amsfonts} \usepackage{dsfont} %\usepackage{arydshln} \usepackage{listings} \usepackage{courier} \lstloadlanguages{R} \usepackage[scaled=.85]{DejaVuSerifCondensed} \usepackage[T1]{fontenc} \usefonttheme{serif} \DeclareFontFamily{OT1}{pzc}{} \DeclareFontShape{OT1}{pzc}{m}{it}{<-> s * [1.30] pzcmi7t}{} \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it} %\theoremstyle{myNote} %\newtheorem{myNote}{Note} \usepackage{mathtools} \usepackage{bookmark} \usepackage{amsthm} \usepackage{ulem} \usepackage{soul} \usepackage{hanging} \setbeamertemplate{footnote}{\hangpara{2em}{1}\makebox[2em][l]{\insertfootnotemark}\footnotesize\insertfootnotetext\par} \addtobeamertemplate{footnote}{}{\vspace{5ex}} \hypersetup{% unicode =false, % non-Latin characters in Acrobat’s bookmarks pdftoolbar=true, % show Acrobat’s toolbar? pdfmenubar=true, % show Acrobat’s menu? %bookmarks=false, bookmarksopen=false } \usepackage{calc} \newsavebox\CBox \newcommand\hcancel[2][0.25pt]{% \ifmmode\sbox\CBox{$#2$}\else\sbox\CBox{#2}\fi% \makebox[0pt][l]{\usebox\CBox}% \rule[0.5\ht\CBox-#1/2]{\wd\CBox}{#1}} \newcommand{\msout}[1]{\text{\sout{\ensuremath{#1}}}} \makeatletter \newcommand*{\shifttext}[2]{% \settowidth{\@tempdima}{#2}% \makebox[\@tempdima]{\hspace*{#1}#2}% } \makeatother \newcommand\oldmyzeta[1]{{\textcolor{red}{\protect\mathpzc{z}_{#1}} \shifttext{-10pt}{\raisebox{0.1ex}{\tiny{\sim}}}}} \newcommand\firstmyzeta[1]{\textcolor{black}{{\protect\mathpzc{z}_{#1}}}} \newcommand\myzeta[1]{{\textcolor{mcgillred}{{\protect\textsf{z}_{#1}}}}} \newcommand\tildemyzeta[1]{\textcolor{mcgillred}{{\protect\widetilde{\textsf{z}}_{#1}}}} \theoremstyle{plain} \newtheorem{thm}{Theorem} % reset theorem numbering for each chapter \theoremstyle{definition} \newtheorem{defn}[thm]{Definition} % definition numbers are dependent on theorem numbers \newtheorem{Note}{Note} % same for example numbers \setbeamertemplate{theorems}[numbered] \def\R{\mathbb{R}} \def\U{\mathcal{U}} \def\u{\upsilon} \def\Ind{\mathds{1}} \def\transpose{\top} \def\Xvec{{\skew0\bm{X}}} \def\Xveca{{\skew0\bm{X}}_1} \def\Xvecb{{\skew0\bm{X}}_2} \def\Yvec{{\skew0\bm{Y}}} \def\xvec{{\skew0\bm{x}}} \def\xveca{{\skew0\bm{x}}_1} \def\xvecb{{\skew0\bm{x}}_2} \def\mvec{{\skew0\bm{m}}} \def\muvec{{\skew0\bm{\mu}}} \def\cvec{{\skew0\mathbf{c}}} \def\Xbar{\overline{X}} \def\xbar{\overline{x}} \def\ybar{\overline{y}} \def\yhat{\widehat{y}} \def\betahat{\widehat{\beta}} \def\betavec{\utilde{\beta}} \def\betahatvec{\skew3\widehat{\utilde{\beta}}} \def\sigmahat{\widehat{\sigma}} \def\ehat{\widehat{e}} \def\zhat{\widehat{z}} \def\nhat{\widehat{n}} \def\xbarA{\overline{x}_A} \def\xbarB{\overline{x}_B} \def\calR{\mathcal{R}} \def\calS{\mathcal{S}} \def\calE{{\mathcal{S}_{e}}} \def\calB{\mathcal{B}} \def\calU{\mathcal{U}} \def\calI{\mathcal{I}} \def\B{\mathcal{B}} \def\Qbb{\mathbb{Q}} \def\Pbb{\mathbb{P}} \def\E{\mathbb{E}} \def\Ehat{\widehat{\mathbbm{E}}} \def\Var{\mathbb{V}ar} \def\Cov{\mathbb{C}ov} \def\Corr{\mathbb{C}orr} \def\bhatint{\widehat{\beta}_0} \def\bhatsl{\widehat{\beta}_1} \def\d{\:\textrm{d}} \def\ps{{\textsf{e}}} \def\bs{{\textsf{b}}} \def\bX{\bm{X}} \def\Ident{\mathbf{I}} \def\One{\mathbf{1}} \def\Zero{\mathbf{0}} \def\bY{\mathbf{Y}} \def\by{\mathbf{y}} \newcommand\xbarBi[1]{\overline{x^{\text{\tiny{(B)}}}_{#1}}} \newcommand\xbarib[1]{\overline{x^{\text{\tiny{(B)}}}_{#1}}} \def\Fstat{\frac{(SSE_R - SSE_C)/(k-g)}{SSE_C/(n-k-1)}} \def\approxsim{\sim \! \! \! : \;} \def\hsp{\vspace{0.1 in}} \def\fsp{\vspace{0.2 in}} %\def\dfrac#1#2{{\displaystyle {#1 #2}}}% \def\dint{\mathop{\displaystyle \int}}% \def\dsum{\mathop{\displaystyle \sum}}% \newcommand\betaZ{$\beta_{1}$} \newcommand\betaA[1]{$\beta_{#1}^{(A)}$} \newcommand\betaB[1]{$\beta_{#1}^{(B)}$} \newcommand\gammaAB[1]{$\gamma_{#1}^{(AB)}$} \def\SST{\mathit{SST}} \def\MST{\mathit{MST}} \def\SSE{\mathit{SSE}} \def\MSE{\mathit{MSE}} \def\SSB{\mathit{SSB}} \def\MSB{\mathit{MSB}} \def\SSI{\mathit{SSI}} \def\MSI{\mathit{MSI}} \def\SS{\mathit{SS}} \def\Ztilde{{\widetilde Z}} \def\ztilde{{\widetilde z}} \def\bmu{\boldsymbol\mu} \newcounter{Lecture} \def\calA{\mathcal{A}} \renewcommand{\thelecture}{\arabic{lecture}} \newcommand\xbari[1]{\overline{x}_{#1}} \newcommand\subsectnum[1]{\textbf{\arabic{section}.\arabic{subsection}} \textbf{\uppercase{#1}}} \newcommand\textsclarge[1]{\fontshape{sc}\fontsize{14}{15} \selectfont{#1}} \renewcommand\emph[1]{\textcolor{mcgillred}{\textit{#1}}} \def\Exp{\mathcal{E}} \def\Ex{\mathcal{E}} \def\Exzero{\mathcal{E}_0} \def\Obs{\mathcal{O}} \def\Ob{\mathcal{O}} \def\bt{\mathbf{t}} \usepackage{tikz} \newcommand*\circled[1]{\tikz[baseline=(char.base)]{ \node[shape=circle,draw,inner sep=1pt] (char) {#1};}} \def\WideSpacing{\itemsep=2.0ex\topsep=0.5ex\partopsep=0.0ex\parskip=0.0ex\parsep=0.0ex} \makeatletter \let\orig@Enumerate =\enumerate \newenvironment{enumerateWide}{\orig@Enumerate\WideSpacing}{\endlist} \makeatother \definecolor{midgray}{rgb}{0.75,0.75,0.75} \definecolor{lightgray}{rgb}{0.85,0.85,0.85} \definecolor{darkgray}{rgb}{0.654,0.724,0.795} \definecolor{lightdarkgray}{rgb}{0.727,0.805,0.883} \definecolor{purpleblue}{rgb}{0.50,0.50,1.00} \definecolor{lightblue}{rgb}{0.90,0.90,1.00} \definecolor{kugreen}{RGB}{50,93,61} \definecolor{kugreenlys}{RGB}{132,158,139} \definecolor{kugreenlyslys}{RGB}{173,190,177} \definecolor{kugreenlyslyslys}{RGB}{214,223,216} \definecolor{mcgillred}{rgb}{.926,0.105,0.184} \definecolor{mcgillreddark}{rgb}{0.617,0.035,0.094} \definecolor{mcgillredlight}{rgb}{0.926,0.153,0.241} \definecolor{verylightred}{rgb}{1,0.95,0.95} \definecolor{darkgreen}{rgb}{0.008, 0.294, 0.188} \definecolor{lightgreen}{rgb}{0.75,1.0,0.75} \definecolor{verylightgreen}{rgb}{0.90,1.0,0.90} \definecolor{darkblue}{rgb}{0.00, 0.00, 0.444} \definecolor{lightblue}{rgb}{0.933,0.933,1.00} \definecolor{psyc}{rgb}{0.87, 0.0, 1.0} \definecolor{mayablue}{rgb}{0.45, 0.76, 0.98} \definecolor{paleblue}{rgb}{0.69, 0.93, 0.93} \definecolor{spirodiscoball}{rgb}{0.06, 0.75, 0.99} \definecolor{lightcyan}{rgb}{0.88, 1.0, 1.0} \definecolor{frenchblue}{rgb}{0.0, 0.45, 0.73} \definecolor{bubbles}{rgb}{0.91, 1.0, 1.0} \definecolor{azurewm}{rgb}{0.94, 1.0, 1.0} \definecolor{airforceblue}{rgb}{0.36, 0.54, 0.66} \definecolor{darkmidnightblue}{rgb}{0.0, 0.2, 0.4} \definecolor{darkpastelblue}{rgb}{0.47, 0.62, 0.8} \definecolor{bleudefrance}{rgb}{0.19, 0.55, 0.91} \definecolor{babyblue}{rgb}{0.54, 0.81, 0.94} \setbeamercolor{background}{bg=red!15!white} \setbeamercovered{transparent} \setbeamercolor{title in sidebar}{fg=lightgray} \setbeamercolor{sidebar}{bg=lightgray,fg=purpleblue} \setbeamercolor{author in sidebar}{fg=lightgray} \setbeamercolor{section in sidebar}{fg=white,bg=mcgillred} \setbeamercolor{title}{fg=white,bg=mcgillred} \setbeamercolor{author}{use=structure,fg=black,bg=darkgray} \setbeamercolor{part name}{fg=black,bg=blue!30!white} \setbeamercolor{institute}{use=structure,fg=black,bg=lightdarkgray} \setbeamercolor{frametitle}{fg=white,bg=mcgillred} \setbeamercolor{subsection in sidebar}{fg=purpleblue} \setbeamercolor{block title}{use=structure,fg=black,bg=blue!30!white} \setbeamercolor{block body}{use=structure,fg=black,bg=blue!20!white} \setbeamertemplate{navigation symbols}{} \usepackage{relsize} \def\mybull{{\scriptsize{$\blacktriangleright$}}} \setlist[itemize]{label=\mybull} \setbeamercovered{transparent} \mode \setbeamertemplate{part page} { \begin{centering} %\begin{beamercolorbox}[sep=16pt,center]{author} % \usebeamerfont{part title}\partname~\insertpartnumber \par %\end{beamercolorbox} \vskip1em\par \begin{beamercolorbox}[sep=16pt,center]{institute} \usebeamerfont{part title} \insertpart\par \end{beamercolorbox} \end{centering} } \makeatletter \AtBeginPart{% \beamer@tocsectionnumber=0\relax \setcounter{section}{0} \numberwithin{section}{part} {% start a group to keep the template change local \setbeamertemplate{background canvas}{% \color{white}\rule{\paperwidth}{\paperheight}% }% \setbeamercolor{frametitle}{fg=white,bg=white} \setbeamertemplate{footline}{ \leavevmode% \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm plus1fill,rightskip=.3cm]{author in head/foot}% \usebeamerfont{author in head/foot} \end{beamercolorbox}% \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}% \usebeamerfont{title in head/foot}\hfill\insertpagenumber \end{beamercolorbox}}% \vskip0pt% } %\addtocounter{framenumber}{-1} \begin{frame}[noframenumbering,c]{\partpage}\end{frame}% }% end group } \makeatother \setbeamercolor{author in head/foot}{bg=white, fg=mcgillred} \setbeamercolor{title in head/foot}{bg=white, fg=mcgillred} \setbeamertemplate{footline} {% %\rule{\paperwidth}{0.025cm} \leavevmode% \hbox{\begin{beamercolorbox}[left, wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm]{title in head/foot}% \usebeamerfont{author in head/foot}\insertpartnumber.\insertsectionnumber: \insertsection \end{beamercolorbox}% \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}% \usebeamerfont{title in head/foot}\hfill\insertpagenumber \end{beamercolorbox}}% \vskip0pt% } %\usecolortheme[named=kugreen]{structure} %\useinnertheme{circles} %\setbeamercovered{transparent} %\setbeamertemplate{blocks}[rounded][shadow=true] \setbeamertemplate{blocks}[default] \setbeamerfont{itemize/enumerate subbody}{size=\footnotesize} \setbeamertemplate{itemize items}[circle] \newenvironment<>{Ex}[1]{% \begin{actionenv}#2% \def\insertblocktitle{Example: #1}% \par% \mode{% \setbeamercolor{block title}{use=structure,fg=darkmidnightblue,bg=babyblue} \setbeamercolor{block body}{use=structure,fg=black,bg=bubbles} \setbeamertemplate{itemize item}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths$\bullet$}} }% \usebeamertemplate{block begin}\justifying} {\par\usebeamertemplate{block end}\end{actionenv}} \newenvironment<>{Thm}[1]{% \begin{actionenv}#2% \def\insertblocktitle{Theorem: #1}% \par% \mode{% \setbeamercolor{block title}{use=structure,fg=white,bg=darkgreen} \setbeamercolor{block body}{use=structure,fg=black,bg=lightgreen} \setbeamercolor{itemize item}{fg=orange!20!black} \setbeamertemplate{itemize item}[circle] }% \usebeamertemplate{block begin}\justifying} {\par\usebeamertemplate{block end}\end{actionenv}} \newenvironment<>{Nt}[1]{% \begin{actionenv}#2% \def\insertblocktitle{Note}% \par% \mode{% \setbeamercolor{block title}{use=structure,fg=white,bg=darkblue} \setbeamercolor{block body}{use=structure,fg=black,bg=azurewm} \setbeamercolor{itemize item}{fg=orange!20!black} \setbeamertemplate{itemize item}[circle] }% \usebeamertemplate{block begin}\justifying} {\par\usebeamertemplate{block end}\end{actionenv}} \newcounter{myNote} \newcommand{\myNote}{\arabic{myNote}} \setcounter{myNote}{1} \renewcommand*{\thefootnote}{[\arabic{footnote}]} \renewenvironment<>{Note}{% \begin{actionenv}% \def\insertblocktitle{Note \myNote.}% \par% \mode{% \setbeamercolor{block title}{use=structure,fg=white,bg=darkblue} \setbeamercolor{block body}{use=structure,fg=black,bg=lightblue} \setbeamercolor{itemize item}{fg=orange!20!black} \setbeamertemplate{itemize item}[circle] }% \usebeamertemplate{block begin}\addtocounter{myNote}{1}\justifying} {\par\usebeamertemplate{block end}\end{actionenv}} \date{ } % % The following info should normally be given in you main file: % \usepackage{tikz} \newcommand{\topline}{% \tikz[remember picture,overlay] {% \draw[midgray] ([yshift=-1cm]current page.north west) -- ([yshift=-1cm,xshift=\paperwidth]current page.north west);}} \setbeamertemplate{frametitle}{% \nointerlineskip \begin{beamercolorbox}[sep=0.3cm,ht=1.8em,wd=\paperwidth,rightskip=0cm]{frametitle}% \usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle} \vbox{}\vskip-2ex% \strut\insertframetitle\strut \vskip-1.2ex% \end{beamercolorbox}% } \newcommand\mypart[1]{#1} %\setbeamertemplate{frametitle continuation}[from %second][(\lowercase{\insertcontinuationcountroman})] \setbeamertemplate{frametitle continuation}[from second][] \setbeamertemplate{section in toc}{\insertpartnumber.\inserttocsectionnumber\hspace*{1em}\inserttocsection} \title{Normal approximations} \author{Dr David A. Stephens} \institute{ Department of Mathematics \& Statistics\\ McGill University\\ Montreal, QC, Canada. \vspace{0.1 in} \texttt{david.stephens@mcgill.ca}\\ \texttt{\texttt{www.math.mcgill.ca/dstephens/SISCER2020/}} } \titlegraphic{\includegraphics[width=1.93cm,height=2cm]{McGillLogo}} \setbeamertemplate{itemize item}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths$\bullet$}} \setbeamertemplate{itemize subitem}{\tiny\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleright$}} \usepackage{etoolbox} %\usepackage{setspace} %\addtocontents{toc}{\protect\setstretch{0.9}} \usepackage{ragged2e} \apptocmd{\frame}{}{\justifying}{} % Allow optional arguments after frame. %\usepackage[bookmarks=true]{hyperref} \lstset{basicstyle=\ttfamily\tiny, numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=5pt} \begin{document} \setbeamercolor{author in head/foot}{bg=white, fg=mcgillred} \setbeamercolor{title in head/foot}{bg=white, fg=mcgillred} { \setbeamertemplate{footline} {% \leavevmode% \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm plus1fill,rightskip=.3cm]{author in head/foot}% \usebeamerfont{author in head/foot} \end{beamercolorbox}% \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}% \usebeamerfont{title in head/foot}\hfill\insertpagenumber \end{beamercolorbox}}% \vskip0pt% } <>= library(knitr) # global chunk options opts_chunk$set(cache=TRUE, autodep=TRUE, size = "tiny") options(scipen=5) options(repos=c(CRAN="https://cloud.r-project.org/")) @ <>= myrnd <- function(x,d) {formatC(x, format="f", digits=d)} library(shape) library(diagram) set.seed(10101) @ %\frame{\titlepage} \begin{frame}[fragile,allowframebreaks]\frametitle{Using the Normal Approximation in Bayesian inference} We consider a Taylor approximation of the function \[ \ell(y;\theta) = \log f_Y(y;\theta) \qquad \theta \in \R^d \] with respect to $\theta$ around $\theta_0$. \begin{align*}\label{eq:Taylor1} \ell(y;\theta) & \bumpeq \ell(y;\theta_0) + \dot{\ell}(y;\theta_0)^\top (\theta-\theta_0) + \frac{1}{2} (\theta-\theta_0)^\top \ddot{\ell} (y;\theta_0) (\theta-\theta_0) \end{align*} where \[ \dot{\ell} (y;\theta) = \frac{\partial \ell(y;\theta)}{\partial \theta} \qquad \ddot{\ell} (y;\theta) = \frac{\partial^2 \ell(y;\theta)}{\partial \theta \partial \theta^\top} \] are $(d \times 1)$ and $(d \times d)$ respectively. \framebreak Evaluating for each of $y_1,\ldots,y_n$ and summing the result, we have \[ \ell_n(\theta) \bumpeq \ell_n(\theta_0) + \dot{\ell}_n(\theta_0)^\top (\theta-\theta_0) + \frac{1}{2} (\theta-\theta_0)^\top \ddot{\ell}_n (\theta_0) (\theta-\theta_0) \] Assuming that for $n$ large we can replace $\theta_0$ by $\widehat{\theta}_n$, we have \begin{align*} \ell_n(\theta) & \bumpeq \ell_n(\widehat{\theta}_n) + \dot{\ell}_n(\widehat{\theta}_n)^\top (\theta-\widehat{\theta}_n) + \frac{1}{2} (\theta-\widehat{\theta}_n)^\top \ddot{\ell}_n (\widehat{\theta}_n) (\theta-\widehat{\theta}_n)\\[6pt] & = \ell_n(\widehat{\theta}_n) + \frac{1}{2} (\theta-\widehat{\theta}_n)^\top \ddot{\ell}_n (\widehat{\theta}_n) (\theta-\widehat{\theta}_n) \end{align*} as $\ell_n(\widehat{\theta}_n) = \mathbf{0}_d$. \framebreak This tells us that the likelihood can be approximated in the vicinity of $\widehat{\theta}_n$ by a quadratic: \begin{align*} \ell_n(\widehat{\theta}_n) - \ell_n(\theta) & = -\frac{1}{2} (\theta-\widehat{\theta}_n)^\top \ddot{\ell}_n (\widehat{\theta}_n) (\theta-\widehat{\theta}_n) \\[6pt] & = \frac{1}{2} (\theta-\widehat{\theta}_n)^\top \left\{-\ddot{\ell}_n (\widehat{\theta}_n)\right\} (\theta-\widehat{\theta}_n) \end{align*} where this quantity is non-negative, as $\widehat{\theta}_n$ is a maximizer of $\ell_n$. \framebreak A quadratic approximation for the likelihood at $\theta$ around $\widehat \theta_n$ is \begin{align*} \exp\{\ell_n(\theta) \} & \bumpeq \exp\{\ell_n(\widehat \theta_n) \} \exp\left\{\frac{1}{2} (\widehat \theta_n-\theta)^\top \ddot{\ell}_n (\widehat \theta_n) (\widehat \theta_n -\theta) \right\} \\[6pt] & \varpropto \exp\left\{-\frac{1}{2} (\theta - \widehat \theta_n)^\top \{ - \ddot{\ell}_n (\widehat \theta_n) \} (\theta - \widehat \theta_n) \right\}. \end{align*} Note that we can also write the right-hand side as proportional to \[ \exp\left\{-\frac{1}{2} (\widehat \theta_n-\theta)^\top \{ - \ddot{\ell}_n (\widehat \theta_n) \} (\widehat \theta_n - \theta) \right\}. \] \framebreak Treating $\theta$ as a proposed true data generating parameter, and assuming that $n$ is large enough so that $\widehat \theta_n$ is close to $\theta$, this essentially corresponds to the \emph{frequentist} assumption that \[ \widehat \theta_n | \theta \approxsim Normal_{d}\left(\theta,\left\{ - \ddot{\ell}_n (\theta) \right\}^{-1} \right) \] or equivalently that \[ \sqrt{n} (\widehat \theta_n - \theta) \approxsim Normal_{d}\left(\mathbf{0}_d,\left\{ - \frac{1}{n} \ddot{\ell}_n (\theta) \right\}^{-1} \right). \] which allows the construction of frequentist \emph{confidence intervals}. \framebreak In the frequentist calculation, it is often assumed that as $n$ is large \[ - \frac{1}{n} \ddot{\ell}_n (\theta) \bumpeq \mathcal{I}_n(\theta) \] where \[ \mathcal{I}_n(\theta) = \E_{Y|\theta} \left[ - \left. \frac{\partial^2 \ell(Y;\bt)}{\partial \bt \ \partial \bt^\top} \right|_{\bt = \theta};\theta \right] \] is the Fisher information. \framebreak In the \emph{Bayesian} version, the posterior can be approximated by noting that \[ \pi_n(\theta) \propto \exp\{\ell_n(\theta)\} \pi_0(\theta) \] and assuming that $n$ is large so that $\pi_0(\theta)$ can be treated as constant in the neighbourhood of $\widehat \theta_n$, so that \[ \pi_n(\theta) \equiv Normal_{d}\left(\widehat \theta_n,\left\{ - \ddot{\ell}_n (\widehat \theta_n) \right\}^{-1} \right). \] which allows the construction of Bayesian \emph{credible intervals}. \end{frame} \begin{frame}[fragile,allowframebreaks]\frametitle{Example} Suppose that a Bayesian model is built for realizations for an infinitely exchangeable binary sequence. \medskip \begin{itemize} \item $Y_i|\theta \sim Bernoulli(\theta)$ \item $f_Y(y;\theta) = \theta^y (1-\theta)^{1-y}$ for $y=0,1$ \item Log-mass function and derivatives: \begin{align*} \ell(y;\theta) & = y \log \theta + (1-y) \log (1-\theta)\\[6pt] \dot{\ell}(y;\theta) & = \frac{y}{\theta} - \frac{1-y}{1-\theta} \\[6pt] \ddot{\ell}(y;\theta) & = -\frac{y}{\theta^2} - \frac{1-y}{(1-\theta)^2} \end{align*} \framebreak \item Derivative of the log-likelihood \[ \dot{\ell}_n(\theta) = \frac{s_n}{\theta} - \frac{t_n}{(1-\theta)} \] where \[ s_n = \sum_{i=1}^n y_i \qquad t_n = \sum_{i=1}^n (1-y_i) \] yields the maximum likelihood estimate \[ \widehat{\theta}_n = \frac{s_n}{s_n + t_n} = \frac{s_n}{n} \] \framebreak \item This leads to \begin{align*} \ddot{\ell}_n(\widehat{\theta}_n) & = - \left[ \frac{s_n}{\widehat{\theta}_n^2} + \frac{t_n}{(1-\widehat{\theta}_n)^2} \right] = - \left[ \frac{n \widehat{\theta}_n }{\widehat{\theta}_n^2} + \frac{n(1-\widehat{\theta}_n)}{(1-\widehat{\theta}_n)^2} \right] \\[6pt] & = - \frac{n}{\widehat{\theta}_n (1-\widehat{\theta}_n)} \end{align*} \item We also have that \begin{align*} \mathcal{I}_n(\theta) & = \E_{Y|\theta} \left[ \frac{Y}{\theta^2} + \frac{1-Y}{(1-\theta)^2} ;\theta \right] = \frac{\theta}{\theta^2} + \frac{1-\theta}{(1-\theta)^2} \\[6pt] & = \frac{1}{\theta (1-\theta)} \end{align*} \framebreak \item $(1-\gamma)$\% confidence interval: recall that a confidence interval is the \emph{random} interval $[L_n,U_n]$ such that \[ P_{Y|\theta}[ \theta \in [L_n,U_n] ; \theta] = 1-\gamma. \] that is, \emph{for each given $\theta$}, \[ P_{Y|\theta}[ L_n \leq \theta \leq R_n ; \theta] = 1-\gamma. \] To obtain the interval, we usually construct a \emph{pivotal quantity}, that is some quantity \[ T_n(\theta) \] whose distribution does not depend on $\theta$. \framebreak Here we use \[ T_n(\theta) = \dfrac{\widehat{\theta}_n - \theta}{\sqrt{\dfrac{\widehat{\theta}_n (1-\widehat{\theta}_n)}{n}}} \] and deduce from the asymptotic theory that for any $\theta$ \[ T_n(\theta) \approxsim Normal(0,1). \] Hence for an \emph{equal-tailed} interval, we have \[ [L_n, U_n] : \quad \widehat{\theta}_n \pm z_{1-\gamma/2} \sqrt{\frac{\widehat{\theta}_n (1-\widehat{\theta}_n)}{n}} \] where $z_{a}$ is the $a$th quantile of the standard Normal distribution. \framebreak Note that this is a \emph{frequentist} statement: \begin{itemize} \item Suppose we \emph{know} $\theta$; \item \emph{if} the data are generated from $f_Y(y;\theta)$, \item \emph{then} the interval $[L_n,U_n]$ will contain $\theta$ with probability $1-\gamma$ under the $f_Y(y;\theta)$ model. \medskip \item The quantities $L_n$ and $U_n$ are functions of the data random variables through the \emph{estimator}; \item we estimate the interval by computing numerical values $l_n$ and $u_n$ which are functions of the \emph{estimate}. \end{itemize} \medskip Specifically, this is \emph{not} a probability statement about the unknown $\theta$; in the frequentist formulation, such a probability statement is not possible, as the unknown $\theta$ is \emph{not a random quantity}. \framebreak \item $(1-\gamma)$\% credible interval: by the approximation theory \[ \pi_n(\theta) \bumpeq Normal\left(\widehat \theta_n, \frac{\widehat{\theta}_n (1-\widehat{\theta}_n)}{n} \right). \] Hence we can make the \emph{Bayesian} statement for the unknown $\theta$: in light of the data and the model specification that \[ P_{\pi_n}[\theta \in [l_n,u_n]] = 1-\gamma. \] where $l_n$ and $u_n$ are quantities computed from the \emph{estimate}. \end{itemize} \framebreak But if we consider the standardized parameter \[ \phi = \frac{\sqrt{n}(\theta - \widehat{\theta}_n)}{\sqrt{\widehat{\theta}_n (1-\widehat{\theta}_n)}} \] then it is clear that \[ \pi_n(\phi) \bumpeq Normal(0,1) \] revealing that the Bayesian credible interval will be the same as the frequentist interval. \framebreak Numerical example: $n=20$, $\theta_0=0.65$. <>= set.seed(39) n<-20 th0<-0.65 y<-rbinom(n,1,th0) sn<-sum(y) tn<-sum(1-y) c(sn,tn) #Data th.n<-sn/(sn+tn) th.n #MLE log.like<-function(xv,sv,tv){ return(sv*log(xv)+tv*log(1-xv)) } thv<-seq(0.50,0.85,by=0.001) ll.n<-log.like(thv,sn,tn) par(mar=c(4,4,4,2)) plot(thv,ll.n,type='l', xlab=expression(theta),ylab=expression(l[n](theta))) title('Log-likelihood') abline(v=th.n,lty=2,col='red') @ <>= #Quadratic approximation max.val<-log.like(th.n,sn,tn) qln<-max.val-0.5*(thv-th.n)^2/(th.n*(1-th.n)/n) par(mar=c(4,4,4,2)) plot(thv,ll.n,type='l', xlab=expression(theta),ylab=expression(l[n](theta))) title('Log-likelihood and quadratic approximation') lines(thv,qln,col='red') abline(v=th.n,lty=2,col='red') legend(0.5,-12.3,c('Exact','Approximate'),lty=1,col=c('black','red')) @ Assuming a $\pi_0(\theta) \equiv Uniform(0,1)$, we have that \[ \pi_n(\theta) \equiv Beta(s_n+1,t_n+1) \] and using the quadratic approximation we have \[ \pi_n(\theta) \bumpeq Normal(\widehat{\theta}_n,\widehat{\theta}_n (1-\widehat{\theta})/n) \] \framebreak <>= #Posterior and approximation thfull<-seq(0,1,by=0.001) pi.n<-dbeta(thfull,sn+1,tn+1) qlnfull<--0.5*(thfull-th.n)^2/(th.n*(1-th.n)/n) const<-1/sqrt(2*pi*(th.n*(1-th.n)/n)) par(mar=c(4,4,4,2)) plot(thfull,pi.n,type='l', xlab=expression(theta),ylab=expression(pi[n](theta))) title('Posterior and quadratic approximation') lines(thfull,exp(qlnfull)*const,col='red') abline(v=th.n,lty=2,col='red') legend(0,4,c('Exact','Approximate'),lty=1,col=c('black','red')) @ Equal-tail intervals: for $\gamma=0.05$, and a 95\% interval <<>>= #Exact qbeta(c(0.025,0.975),sn+1,tn+1) #Approximate qnorm(c(0.025,0.975),th.n,sqrt(th.n*(1-th.n)/n)) @ that is \begin{align*} \textrm{Exact} : & \ [\Sexpr{myrnd(qbeta(c(0.025,0.975),sn+1,tn+1),4)}] \\[6pt] \textrm{Approximate} : & \ [\Sexpr{myrnd(qnorm(c(0.025,0.975),th.n,sqrt(th.n*(1-th.n)/n)),4)}] \end{align*} \framebreak Larger sample size: $n=200$, $\theta_0=0.65$. <>= set.seed(39) n<-200 th0<-0.65 y<-rbinom(n,1,th0) sn<-sum(y) tn<-sum(1-y) c(sn,tn) #Data th.n<-sn/(sn+tn) th.n #MLE thv<-seq(0.50,0.85,by=0.001) ll.n<-log.like(thv,sn,tn) par(mar=c(4,4,4,2)) plot(thv,ll.n,type='l', xlab=expression(theta),ylab=expression(l[n](theta))) title('Log-likelihood') abline(v=th.n,lty=2,col='red') @ <>= #Quadratic approximation max.val<-log.like(th.n,sn,tn) qln<-max.val-0.5*(thv-th.n)^2/(th.n*(1-th.n)/n) par(mar=c(4,4,4,2)) plot(thv,ll.n,type='l', xlab=expression(theta),ylab=expression(l[n](theta))) title('Log-likelihood and quadratic approximation') lines(thv,qln,col='red') abline(v=th.n,lty=2,col='red') legend(0.5,-140,c('Exact','Approximate'),lty=1,col=c('black','red')) @ <>= #Posterior and approximation thfull<-seq(0,1,by=0.001) pi.n<-dbeta(thfull,sn+1,tn+1) qlnfull<--0.5*(thfull-th.n)^2/(th.n*(1-th.n)/n) const<-1/sqrt(2*pi*(th.n*(1-th.n)/n)) par(mar=c(4,4,4,2)) plot(thfull,pi.n,type='l', xlab=expression(theta),ylab=expression(pi[n](theta))) title('Posterior and quadratic approximation') lines(thfull,exp(qlnfull)*const,col='red') abline(v=th.n,lty=2,col='red') legend(0,12,c('Exact','Approximate'),lty=1,col=c('black','red')) @ Equal-tail intervals: for $\gamma=0.05$, and a 95\% interval <>= #Exact qbeta(c(0.025,0.975),sn+1,tn+1) #Approximate qnorm(c(0.025,0.975),th.n,sqrt(th.n*(1-th.n)/n)) @ that is \begin{align*} \textrm{Exact} : & \ [\Sexpr{myrnd(qbeta(c(0.025,0.975),sn+1,tn+1),4)}] \\[6pt] \textrm{Approximate} : & \ [\Sexpr{myrnd(qnorm(c(0.025,0.975),th.n,sqrt(th.n*(1-th.n)/n)),4)}] \end{align*} \end{frame} \end{document}