% $Header: /cvsroot/latex-beamer/latex-beamer/examples/beamerexample5.tex,v 1.22 2004/10/08 14:02:33 tantau Exp $

\documentclass[11pt]{beamer}
\usepackage{amscd}

%\usetheme{Madrid} % Darmstadt, Boadilla


\mode<presentation> {
  \usetheme{Madrid}
  \setbeamercovered{transparent}
}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsbsy,alltt,amsmath,times}
\usepackage{epsfig, color, graphicx, rotate, colordvi}
%\usepackage{fancybox,fancyhdr,times,subfigure}
\usepackage{hyperref, mathptmx}


\setbeamercovered{dynamic}

\newcommand{\Lang}[1]{\operatorname{\text{\textsc{#1}}}}

\newcommand{\Class}[1]{\operatorname{\mathchoice
  {\text{\sf \small #1}}
  {\text{\sf \small #1}}
  {\text{\sf #1}}
  {\text{\sf #1}}}}

\newcommand{\NumSAT}      {\text{\small\#SAT}}
\newcommand{\NumA}        {\#_{\!A}}

\newcommand{\barA}        {\,\bar{\!A}}

\newcommand{\Nat}{\mathbb{N}}
\newcommand{\Set}[1]{\{#1\}}

\newtheorem{thm}{Result}%[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{defn}[thm]{Definition}
\newtheorem{exam}{Example}%[section]
\newtheorem{rem}{Remark}

\newcommand{\cred}{\textcolor {red}}
\newcommand{\cblue}{\textcolor {blue}}
\newcommand{\cgreen}{\textcolor {green}}

\def\ul{\underline}

\def\sign{\;{\rm sign}}
\def\rank{\;{\rm rank}}
\def\disp{\displaystyle}
\def\sn{\sqrt{n}}
\def\Pr{\mathrm{P}}

\def\Cov{\;{\rm Cov}}
\def\L{\underline L}
\def\LL{\overline L}

\def\balpha{{\boldsymbol{\alpha}}}
\def\cal{\mathcal}
\def\conas{\stackrel{a.s.} {\longrightarrow}}         % conv. a.s.
\def\conp{\stackrel{\cal P} {\longrightarrow}}        % conv. in probability
\def\conD{\stackrel{\mathcal{L}} {\longrightarrow}}        % conv. in distribution
\def\conw{\stackrel{\mathcal{L}} {\rightarrow}}        % conv. in distribution
\def\hat{\widehat}
%\def\endproof{\begin{flushright}$\lozenge$\end{flushright}}
\def\Proof{\noindent{\it Proof }}
\def\endproof{\hfill{$\Box$}}
\newcommand{\wcon}{\stackrel{\mathcal{L}}{\longrightarrow}}
\def\Var{\mbox{var}}
\def\br{\begin{array}}
\def\er{\end{array}}

%%%%%%%%%%%%%%% MY DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Put your own definitions
%
\def\VaR{{\rm VaR}}
\def\E{{\rm E}}
\def\beqrs{\begin{eqnarray*}}           %\beqrs
\def\eeqrs{\end{eqnarray*}}             %\eeqrs

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pgfdeclaremask{tu}{beamer-tu-logo-mask}
\pgfdeclaremask{computer}{beamer-computer-mask}
\pgfdeclareimage[interpolate=true,mask=computer,height=2cm]{computerimage}{beamer-computer}
\pgfdeclareimage[interpolate=true,mask=computer,height=2cm]{computerworkingimage}{beamer-computerred}
\pgfdeclareimage[mask=tu,height=.5cm]{logo}{beamer-tu-logo}

\logo{\pgfuseimage{logo}}

\title[Stat 609 Lecture 17]{Stat 609: Mathematical Statistics \\ Lecture 17}
\author[UW-Madison]{Jun Shao}
\institute[Statistics]{%
%  Department of Statistics\\
%  University of Wisconsin\\
%  Madison, WI 53706, USA\\
%~~~\\
  }
\date[2014]{}

\colorlet{redshaded}{red!25!bg}
\colorlet{shaded}{black!25!bg}
\colorlet{shadedshaded}{black!10!bg}
\colorlet{blackshaded}{black!40!bg}

\colorlet{darkred}{red!80!black}
\colorlet{darkblue}{blue!80!black}
\colorlet{darkgreen}{green!80!black}

\def\radius{0.96cm}
\def\innerradius{0.85cm}

\def\softness{0.4}
\definecolor{softred}{rgb}{1,\softness,\softness}
\definecolor{softgreen}{rgb}{\softness,1,\softness}
\definecolor{softblue}{rgb}{\softness,\softness,1}

\definecolor{softrg}{rgb}{1,1,\softness}
\definecolor{softrb}{rgb}{1,\softness,1}
\definecolor{softgb}{rgb}{\softness,1,1}

\newcommand{\Bandshaded}[2]{
  \color{shadedshaded}
  \pgfmoveto{\pgfxy(-0.5,0)}
  \pgflineto{\pgfxy(-0.6,0.1)}
  \pgflineto{\pgfxy(-0.4,0.2)}
  \pgflineto{\pgfxy(-0.6,0.3)}
  \pgflineto{\pgfxy(-0.4,0.4)}
  \pgflineto{\pgfxy(-0.5,0.5)}
  \pgflineto{\pgfxy(4,0.5)}
  \pgflineto{\pgfxy(4.1,0.4)}
  \pgflineto{\pgfxy(3.9,0.3)}
  \pgflineto{\pgfxy(4.1,0.2)}
  \pgflineto{\pgfxy(3.9,0.1)}
  \pgflineto{\pgfxy(4,0)}
  \pgfclosepath
  \pgffill

  \color{black}
  \pgfputat{\pgfxy(0,0.7)}{\pgfbox[left,base]{#1}}
  \pgfputat{\pgfxy(0,-0.1)}{\pgfbox[left,top]{#2}}
}

\newcommand{\Band}[2]{
  \color{shaded}
  \pgfmoveto{\pgfxy(-0.5,0)}
  \pgflineto{\pgfxy(-0.6,0.1)}
  \pgflineto{\pgfxy(-0.4,0.2)}
  \pgflineto{\pgfxy(-0.6,0.3)}
  \pgflineto{\pgfxy(-0.4,0.4)}
  \pgflineto{\pgfxy(-0.5,0.5)}
  \pgflineto{\pgfxy(4,0.5)}
  \pgflineto{\pgfxy(4.1,0.4)}
  \pgflineto{\pgfxy(3.9,0.3)}
  \pgflineto{\pgfxy(4.1,0.2)}
  \pgflineto{\pgfxy(3.9,0.1)}
  \pgflineto{\pgfxy(4,0)}
  \pgfclosepath
  \pgffill

  \color{black}
  \pgfputat{\pgfxy(0,0.7)}{\pgfbox[left,base]{#1}}
  \pgfputat{\pgfxy(0,-0.1)}{\pgfbox[left,top]{#2}}
}

\newcommand{\BaenderNormal}
{%
  \pgfsetlinewidth{0.4pt}
  \color{black}
  \pgfputat{\pgfxy(0,5)}{\Band{input tapes}{}}
  \pgfputat{\pgfxy(0.35,4.6)}{\pgfbox[center,base]{$\vdots$}}
  \pgfputat{\pgfxy(0,4)}{\Band{}{}}

  \pgfxyline(0,5)(0,5.5)
  \pgfxyline(1.2,5)(1.2,5.5)
  \pgfputat{\pgfxy(0.25,5.25)}{\pgfbox[left,center]{$w_1$}}

  \pgfxyline(0,4)(0,4.5)
  \pgfxyline(1.8,4)(1.8,4.5)
  \pgfputat{\pgfxy(0.25,4.25)}{\pgfbox[left,center]{$w_n$}}
  \ignorespaces}

\newcommand{\BaenderZweiNormal}
{%
  \pgfsetlinewidth{0.4pt}
  \color{black}
  \pgfputat{\pgfxy(0,5)}{\Band{Zwei Eingabebänder}{}}
  \pgfputat{\pgfxy(0,4.25)}{\Band{}{}}

  \pgfxyline(0,5)(0,5.5)
  \pgfxyline(1.2,5)(1.2,5.5)
  \pgfputat{\pgfxy(0.25,5.25)}{\pgfbox[left,center]{$u$}}

  \pgfxyline(0,4.25)(0,4.75)
  \pgfxyline(1.8,4.25)(1.8,4.75)
  \pgfputat{\pgfxy(0.25,4.5)}{\pgfbox[left,center]{$v$}}
  \ignorespaces}

\newcommand{\BaenderHell}
{%
  \pgfsetlinewidth{0.4pt}
  \color{black}
  \pgfputat{\pgfxy(0,5)}{\Bandshaded{input tapes}{}}
  \color{shaded}
  \pgfputat{\pgfxy(0.35,4.6)}{\pgfbox[center,base]{$\vdots$}}
  \pgfputat{\pgfxy(0,4)}{\Bandshaded{}{}}

  \color{blackshaded}
  \pgfxyline(0,5)(0,5.5)
  \pgfxyline(1.2,5)(1.2,5.5)
  \pgfputat{\pgfxy(0.25,5.25)}{\pgfbox[left,center]{$w_1$}}

  \pgfxyline(0,4)(0,4.5)
  \pgfxyline(1.8,4)(1.8,4.5)
  \pgfputat{\pgfxy(0.25,4.25)}{\pgfbox[left,center]{$w_n$}}
  \ignorespaces}

\newcommand{\BaenderZweiHell}
{%
  \pgfsetlinewidth{0.4pt}
  \color{black}
  \pgfputat{\pgfxy(0,5)}{\Bandshaded{Zwei Eingabebänder}{}}%
  \color{blackshaded}
  \pgfputat{\pgfxy(0,4.25)}{\Bandshaded{}{}}
  \pgfputat{\pgfxy(0.25,4.5)}{\pgfbox[left,center]{$v$}}
  \pgfputat{\pgfxy(0.25,5.25)}{\pgfbox[left,center]{$u$}}%

  \pgfxyline(0,5)(0,5.5)
  \pgfxyline(1.2,5)(1.2,5.5)

  \pgfxyline(0,4.25)(0,4.75)
  \pgfxyline(1.8,4.25)(1.8,4.75)
  \ignorespaces}

\newcommand{\Slot}[1]{%
  \begin{pgftranslate}{\pgfpoint{#1}{0pt}}%
    \pgfsetlinewidth{0.6pt}%
    \color{structure}%
    \pgfmoveto{\pgfxy(-0.1,5.5)}%
    \pgfbezier{\pgfxy(-0.1,5.55)}{\pgfxy(-0.05,5.6)}{\pgfxy(0,5.6)}%
    \pgfbezier{\pgfxy(0.05,5.6)}{\pgfxy(0.1,5.55)}{\pgfxy(0.1,5.5)}%
    \pgflineto{\pgfxy(0.1,4.0)}%
    \pgfbezier{\pgfxy(0.1,3.95)}{\pgfxy(0.05,3.9)}{\pgfxy(0,3.9)}%
    \pgfbezier{\pgfxy(-0.05,3.9)}{\pgfxy(-0.1,3.95)}{\pgfxy(-0.1,4.0)}%
    \pgfclosepath%
    \pgfstroke%
  \end{pgftranslate}\ignorespaces}

\newcommand{\SlotZwei}[1]{%
  \begin{pgftranslate}{\pgfpoint{#1}{0pt}}%
    \pgfsetlinewidth{0.6pt}%
    \color{structure}%
    \pgfmoveto{\pgfxy(-0.1,5.5)}%
    \pgfbezier{\pgfxy(-0.1,5.55)}{\pgfxy(-0.05,5.6)}{\pgfxy(0,5.6)}%
    \pgfbezier{\pgfxy(0.05,5.6)}{\pgfxy(0.1,5.55)}{\pgfxy(0.1,5.5)}%
    \pgflineto{\pgfxy(0.1,4.25)}%
    \pgfbezier{\pgfxy(0.1,4.25)}{\pgfxy(0.05,4.15)}{\pgfxy(0,4.15)}%
    \pgfbezier{\pgfxy(-0.05,4.15)}{\pgfxy(-0.1,4.2)}{\pgfxy(-0.1,4.25)}%
    \pgfclosepath%
    \pgfstroke%
  \end{pgftranslate}\ignorespaces}

\newcommand{\ClipSlot}[1]{%
  \pgfrect[clip]{\pgfrelative{\pgfxy(-0.1,0)}{\pgfpoint{#1}{4cm}}}{\pgfxy(0.2,1.5)}\ignorespaces}

\newcommand{\ClipSlotZwei}[1]{%
  \pgfrect[clip]{\pgfrelative{\pgfxy(-0.1,0)}{\pgfpoint{#1}{4.25cm}}}{\pgfxy(0.2,1.25)}\ignorespaces}


\AtBeginSection[]{\frame{\frametitle{Outline}\tableofcontents[current]}}

\begin{document}

%\frame{\titlepage}

\frame {
\frametitle{Chapter 4: Multiple Random Variables\\
Lecture 17: Joint and marginal distributions}\vspace{-2mm}
\begin{alertblock}{}
So far we focus on the distribution of a single random variable. 
\vspace{1mm}

In applications we need to consider a set of random variables jointly. 
\vspace{1mm}

In some cases we study relationships among random variables.
\end{alertblock}\vspace{-2mm}
\begin{block}{Definition 4.1.1.}
For an integer $n$, $X = (X_1,...,X_n)$ is called
an $n$-dimensional random vector iff each $X_i$ is a random variable.
\end{block}\vspace{-2mm}
\begin{block}{Joint cdf's}
The joint cdf of an $n$-dimensional random vector $X$ is a function $F_X$ in ${\cal R}^n$ such that \vspace{-2mm}
\[ \br{lll}
 F_X(x_1,...,x_n) &= P\left( {\displaystyle \bigcap_{i=1}^n} \{ X_i \leq x_i \} \right)&
\ \ x_i \in {\cal R} \vspace{2mm} \\
&=  P( X_1 \leq x_1,...,X_n \leq x_n) & \ \ i=1,...,n \er
\]
\end{block}}
\frame{\vspace{-2mm}
\begin{alertblock}{Properties of cdf's} 
\begin{itemize}
\item
$F_X$ is nondecreasing and right-continuous in any of its $n$ arguments.
\item
For any $i=1,...,n$ and fixed $x_1,...,x_{i-1},x_{i+1},...,x_n$, \vspace{-2mm} 
\[ \lim_{x_i \rightarrow -\infty} F(x_1,...,x_{i-1},x_i,x_{i+1},...,x_n) =0 \vspace{-2mm} \]
\[ \lim_{x_i \rightarrow \infty, \ i=1,...,n} F(x_1,...,x_n) =1\]
\end{itemize}
\end{alertblock}\vspace{-2mm}
\begin{block}{Marginal cdf's}<2->
For a random vector $X= (X_1,...,X_n)$ and any $i$, the cdf of $X_i$ is called the marginal cdf of $X_i$ and is equal to \vspace{-2mm}
\[ F_{X_i}(x_i) = \lim_{x_j \rightarrow \infty, \ j=1,...,i-1,i+1,...,n}
 F_X(x_1,...,x_n) \vspace{-2mm} \]
 Knowing the joint cdf $F_X$ we can obtain $n$ marginal cdf's, but
in general, knowing $F_{X_1},...,F_{X_n}$ is not enough to determine
the joint cdf $F_X$.
\end{block}\vspace{-2mm}
\begin{alertblock}{}<3->
Similar to the univariate case, we mainly consider two types of random vectors, discrete random vectors and continuous random vectors.
\end{alertblock}}
\frame{\vspace{-2mm}
\begin{block}{Definition 4.1.3 (Discrete joint pmf)}
A random vector $X=(X_1,...,X_n)$ is discrete iff each $X_i$ is discrete. \\
The joint pmf of $X$ is \vspace{-2mm}
\[ f_X(x_1,...,x_n) = P(X_1=x_1,...,X_n=x_n), \vspace{-2mm} \]
which is positive only for countably many $(x_1,...,x_n) \in {\cal R}^n$. 
\end{block}
\vspace{-2mm}
\begin{alertblock}{}<2->
\begin{itemize}
\item
For any event $A \subset {\cal R}^n$,\vspace{-2mm}
\[ P(X\in A) = \sum_{(x_1,...,x_n)\in A} f_{X}(x_1,...,x_n) \vspace{-2mm}\]
\item
For any $i$, the marginal pmf of $X_i$ is\vspace{-2mm}
\[ f_{X_i} (x_i) = \sum_{x_1,...,x_{i-1},x_i,...,x_n} f_X(x_1,...,x_n) \vspace{-2mm} \]
\item
For any function $g(x_1,...,x_n)$,
the expected value of $g(X_1,...,X_n)$ is\vspace{-2mm}
\[ E[g(X_1,...,X_n)] = \sum_{x_1,...,x_n} g(x_1,...,x_n)f_X(x_1,...,x_n) \vspace{-3mm} \]
\item
If $n=2$ and each $X_i$ takes finitely many values, then 
the joint and marginal pmf's can be listed in 
 a $2\times 2$ table. 
\end{itemize}
\end{alertblock}}
\frame{ \vspace{-2mm}
\begin{alertblock}{}
\begin{center}
Values and joint and marginal pmf's of a 2-dimensional random vector \\
\vspace{2mm}
\begin{tabular}{c|cccc|c}
value & $x_{21}$ & $x_{22}$ & $\cdots$ & $x_{2c}$ & marginal \\ \hline
$x_{11}$ & $p_{11}$ & $p_{12}$ & $\cdots$ & $p_{1c} $ & $p_{1 \cdot}$ \\
$x_{12}$ & $p_{21}$ & $p_{22}$ &  $\cdots$ & $p_{2c} $ & $p_{2 \cdot }$ \\
$\cdots$ &  $\cdots$ &  $\cdots$ &  $\cdots$ &  $\cdots$ &  $\cdots$ \\
$x_{1r}$ & $p_{r1}$ & $p_{r2}$ &  $\cdots$ & $p_{rc} $ & $p_{r\cdot}$ \\ \hline
marginal & $p_{\cdot 1}$ & $p_{\cdot 2}$ & $\cdots$ & $p_{\cdot c}$ &  1 \\
\end{tabular}\\
\vspace{4mm}
$p_{ij} =P(X_1 =i , X_2=j)$, $p_{i \cdot}=P(X_1=i)$, $p_{\cdot j}(X_2=j)$.
\end{center}
 \end{alertblock}\vspace{-2mm}
 \begin{block}{Example:  Multinomial distribution}<2->
An experiment has  $r$ possible outcomes $A_1,...,A_r$ with $P(A_i) = p_i$, $i=1,...,r$, $p_1+\cdots + p_r =1$.
 
We independently repeat the experiment $n$ times. 

If $X_i $ is the number of times $A_i$ is the result in $n$ experiments, $i=1,...,r$, then 
$X =(X_1,...,X_r)$ has joint pmf \vspace{-2mm} 
\[ P(X_1=x_1,...,X_r=x_r) = \frac{n!}{x_1! \cdots x_r!} p_1^{x_1} \cdots p_r^{x_r} 
\quad \quad 0 \leq x_j , \ \ \sum_{i=1}^r x_i =n \] 
\end{block}}
\frame{
\begin{alertblock}{Multivariate hypergeometric distribution}
A bag contains $N$ balls with $r$ different colors. 

$N_i =$ the number of balls for color $i$, $N_1+\cdots +N_r = N$. 

We randomly select $n$ balls from the bag. 

If  $X_i  $ is the number of selected balls having color $i$, $i=1,...,r$, then 
$X =(X_1,...,X_r)$ has joint pmf \vspace{-2mm}
\[ P(X_1=x_1,...,X_r=x_r) = \frac{{N_1 \choose x_1} \cdots {N_r \choose x_r}}{{N \choose n}} 
\quad \quad 0 \leq x_j , \ \ \sum_{i=1}^r x_i =n \]
\end{alertblock}\vspace{-2mm}
\begin{block}{}<2->
What are the marginal pmf's for the multinomial and
multivariate hypergeometric distributions? 
\end{block}\vspace{-2mm}
\begin{alertblock}{Definition 4.1.10 (continuous pdf)}<3->
A random vector $X=(X_1,...,X_n)$ has a continuous joint pdf if there exists a nonnegative function $f_X$
 on ${\cal R}^n$ such that \vspace{-2mm}
\[  P(X \in A) = {\int \cdots \int}_{(x_1,...,x_n) \in A} f_{X}(x_1,...,x_n)dx_1\cdots dx_n \]
\end{alertblock}}
\frame{
\begin{alertblock}{}
\begin{itemize}
\item
If $X=(X_1,...,X_n) $ has joint pdf $f_X$, a short notation is \vspace{-2mm}
\[ P(X \in A) = \int_A f_X(x)dx \quad \quad x=(x_1,...,x_n) \vspace{-2mm} \]
\item
If the joint pdf $f_X$ exists, then\vspace{-2mm}
\[ F_X(x_1,...,x_n) = \int_{-\infty}^{x_1}\cdots \int_{-\infty}^{x_n} f_X(t_1,...,t_n)
dt_1\cdots dt_n \vspace{-2mm} \]
\item
If the joint cdf $F_X$ is differentiable, then the joint $f_X$ exists and\vspace{-2mm}
\[ f_X(x_1,...,x_n) = \frac{\partial^n F_X(x_1,...,x_n)}{\partial x_1\cdots \partial x_n},
\quad \quad (x_1,...,x_n)\in{\cal R}^n \vspace{-2mm}\]
\item
If the joint pdf $f_X$ exists, then the $i$th margianl pdf $f_{X_i}$ exists and \vspace{-2mm}
\[ f_{X_i}(x_i) = \int_{-\infty}^\infty \cdots
\int_{-\infty}^\infty f_X(x_1,...,x_n)dx_1\cdots dx_{i-1}dx_{i+1}\cdots dx_n\vspace{-2mm} \]
\item
If the joint pdf $f_X$ exists, then for any function $g(x_1,...,x_n)$,
the expected value of $g(X_1,...,X_n)$ is\vspace{-2mm}
\[ E[g(X_1,...,X_n)] = \int_{-\infty}^\infty  \cdots
\int_{-\infty}^\infty  g(x_1,...,x_n) f_X(x_1,...,x_n)dx_1\cdots dx_n  \]
\end{itemize}
\end{alertblock}}
\frame{
\begin{block}{}
{\bf Examples} (ppt Chap3, 20-40)
\vspace{2mm}

Bivariate normal distribution
{\large
\[ f_X(x,y)=  \frac{1}{2\pi \sigma_1\sigma_2 \sqrt{1-\rho^2}}
\exp \left( - \frac{(x - \mu_1)^2}{2 \sigma_1^2(1-\rho^2)}
+ \frac{\rho (x-\mu_1)(y-\mu_2)}{\sigma_1\sigma_2(1-\rho^2)}
- \frac{(y - \mu_2 )^2}{2 \sigma_2^2(1-\rho^2)} \right)
\]}
where $\mu_1 \in {\cal R}$, $\mu_2\in {\cal R}$, $\sigma_1>0$, $\sigma_2>0$, and
$-1 < \rho < 1$ are constants.

$n$-dimensional multivariate normal distribution
{\large
\[  f_X(x) = \frac{1}{(2\pi)^{n/2} |\Sigma |^{1/2}}
\exp\left( - \frac{( x-\mu)^T \Sigma^{-1} (x-\mu )}{2}\right) , \quad x \in {\cal R}^n ,\]}
where
$\mu \in {\cal R}^n$,
$\Sigma$ is a positive definite $n\times n$ matrix,
$|\Sigma |$ is the determinant of $\Sigma$
and $c^T$ denotes the transpose of a column vector $c$.

\end{block}
}
\end{document}
 (ppt Chap3, 1-17)


