% $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 12]{Stat 609: Mathematical Statistics \\ Lecture 12}
\author[UW-Madison]{Jun Shao}
\institute[Statistics]{%
%  Department of Statistics\\
%  University of Wisconsin\\
%  Madison, WI 53706, USA\\
%~~~\\
  }
\date[2015]{}

\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}
\def\back{\!\!\!\!\!}

%\frame{\titlepage}

\frame {\vspace{-2mm}
\frametitle{Lecture 12: Multivariate transformation}
\vspace{-1mm}
\begin{alertblock}{}
We have considered transformations of a single random variable.

We now consider a vector of transformations of a random vector.

First, we consider the sum of two random variables. 
\end{alertblock}
\vspace{-2mm}
\begin{block}{The pdf of the sum of two random variables (convolution)}
	Let $X$ and $Y$ be random variables having joint pdf $f(x,y)$.
	
	For any $t \in {\cal R}$, \vspace{-3mm}
	\[ P(X+Y \leq t ) = \int\int_{x+y \leq t} f(x,y) dx dy
	= \int_{-\infty}^\infty \left[ \int_{-\infty}^{t-x} f(x,y)dy \right] dx \vspace{-3mm} \]
	Hence, the pdf of the sum $X+Y$ is \vspace{-2mm}
	\[ f_{X+Y}(t) = \frac{d}{dt} P(X+Y \leq t ) =
	\! \int_{-\infty}^\infty \frac{d}{dt} \left[ \int_{-\infty}^{t-x} f(x,y)dy \right] dx
	= \! \int_{-\infty}^\infty  f(x,t-x) dx \vspace{-2mm}
	\]
	Similarly, \vspace{-1mm}
	\[ f_{X+Y}(t) = \int_{-\infty}^\infty  f(t-y,y)  dy\vspace{-2mm}  \]
	The pdf $f_{X+Y}$ is called a convolution.
	
	The interchange of differentiation and integration can be justified.
\end{block}
}
\frame{\vspace{-2mm}
	\begin{block}{}
		If $X$ and $Y$ are independent and $f_X$ and $f_Y$ are their marginal pdf's, then \vspace{-2mm}
		\[ f_{X+Y}(t) = \int_{-\infty}^\infty  f_X(x)f_Y(t-x) dx =\int_{-\infty}^\infty  f_X(t-y)f_Y(y)  dy  \]
	\end{block}\vspace{-2mm}
	\begin{alertblock}{Example}
		If $X \sim uniform(0,1)$ and $Y \sim exponential (0,1)$ are independent, what is the pdf of $X+Y$?
		\vspace{-3mm}
		\beqrs
		f_{X+Y}(t) &=& \int_{-\infty}^\infty f_X(x)f_Y(t-x)dx
		= \int_{0<x<1, x<t } e^{-(t-x)} dx \vspace{2mm} \\
		&=& \left\{ \br{ll}
		\int_0^1 e^{-(t-x)} dx = (e-1)e^{-t} & \quad t> 1 \vspace{2mm} \\
		\int_0^t  e^{-(t-x)} dx = 1- e^{-t} & \quad 0< t \leq 1 \vspace{2mm} \\
		0 & \quad t \leq 0 \er \right.
		\eeqrs
		When $f_X$ or $f_Y$ is 0 in some regions, we need to be careful about the integration limits.
		
		Sometimes, one of the two formulas is easier to work with. \vspace{-3mm}
		\[f_{X+Y}(t)  =  \int_{-\infty}^\infty f_X(t-y)f_Y(y)dy
		= \int_{0<t-y<1, y>0 } e^{-y} dy = ?  \]
	\end{alertblock}
}
\frame{
	\begin{block}{Example}
		Suppose that $(X,Y)$ has the following bivariate normal pdf: \vspace{-2mm}
		\[ f(x,y)=  \frac{\exp \left( - \frac{x^2}{2 (1-\rho^2)}
			+ \frac{\rho xy}{(1-\rho^2)}
			- \frac{y^2}{2 (1-\rho^2)} \right)}{2\pi \sqrt{1-\rho^2}} \quad \quad (x,y) \in {\cal R}^2 \vspace{-2mm}\]
		What is the pdf of $X+Y$? \vspace{-2mm}
		\beqrs
		f_{X+Y} (t) \!\!\!\!\! & = & \!\!\!\!\! \frac{1}{2\pi \sqrt{1-\rho^2}} \int_{-\infty}^\infty
		\exp \left( - \frac{x^2}{2 (1-\rho^2)} + \frac{\rho x(t-x)}{(1-\rho^2)}
		- \frac{(t-x)^2}{2 (1-\rho^2)} \right) \!\! dx \\
		\!\!\!\!\! & = & \!\!\!\!\! \frac{1}{2\pi \sqrt{1-\rho^2}} \int_{-\infty}^\infty
		\exp \left( - \frac{x^2 + 2\rho x^2 +x^2 -2 \rho tx -2tx +t^2}{2 (1-\rho^2)} \right) \!\! dx \\
		\!\!\!\!\! & = & \!\!\!\!\! \frac{1}{2\pi \sqrt{1-\rho^2}} \int_{-\infty}^\infty
		\exp \left( - \frac{(x-t/2)^2}{1-\rho} - \frac{t^2}{4 (1+\rho)} \right) \! dx \\
		\!\!\!\!\! & = & \!\!\!\!\! \frac{1}{2 \sqrt{\pi (1+ \rho)}} \exp \left(  - \frac{t^2}{4 (1+\rho)} \right)
		\eeqrs
		which is $N(0, 2(1+\rho ))$.
	\end{block}
}
\frame{
	\begin{alertblock}{The pmf of the sum of two discrete random variables}
		We now turn to discrete random variables $X$ and $Y$ with joint pmf $f(x,y)$.
		
		By definition, the pmf  of $X+Y$ is \vspace{-2mm}
		\[ f_{X+Y}(t) = P(X+Y = t) = \sum_{x+y \leq t }  f(x,y) = \sum_x f(x, t-x ) = \sum_y f(t-y, y ) \vspace{-2mm} \]
		and if $X$ and $Y$ are independent with marginal pmf's $f_X$ and $f_Y$, then
		\vspace{-2mm}
		\[ f_{X+Y}(t)  =  \sum_x f_X(x)f_Y( t-x ) = \sum_y f_X(t-y)f_Y(y ) \vspace{-2mm} \]
		However, in some cases it is more convenient to work out the probability $P(X+Y = t) $ directly.
	\end{alertblock}
	\vspace{-2mm}
	\begin{block}{Example 4.3.1.}
		Let $X \sim Poisson(\theta )$ and $Y \sim Poisson(\lambda )$ be independent Poisson random variables
		so that the joint pmf  of $(X,Y)$ is \vspace{-2mm}
		\[ f(x,y) = \frac{\theta^xe^{-\theta}}{x!} \frac{\lambda^ye^{-\lambda}}{y!},
		\quad x=0,1,2,..., y =0,1,2,...  \]
	\end{block}}
	\frame{
		\begin{block}{}
			What is the pmf of $U = X+Y$?
			
			Using the formula, for $u=0,1,2,...$ \vspace{-2mm}
			\beqrs
			f_U(u)&=& \sum_y f(u-y, y ) =
			\sum_{y=0}^u \frac{\theta^{u-y}e^{-\theta}}{(u-y)!} \frac{\lambda^y e^{-\lambda}}{y!}\\
			&=& \frac{e^{-(\theta+\lambda)}}{u!}
			\sum_{y=0}^u {u \choose y} \lambda^y \theta^{u-y} = \frac{e^{-(\theta+\lambda)}(\theta + \lambda )^u}{u!}
			\eeqrs
			This is the pmf of $Poisson( \theta + \lambda )$.
			
			What is the joint pmf of  $U=X+Y$ and $Y$.
			\beqrs
			f_{U,Y}(u,y) & = &  P(U=u, Y=y) = P(X+Y=u,Y=y) \\
			&=& P(X=u-y,Y=v)  =   \frac{\theta^{u-y}e^{-\theta}}{(u-y)!} \frac{\lambda^y e^{-\lambda}}{y!}
			\eeqrs
			for $u=y,y+1,y+2,...,$ and $y=0,1,2,...$
			
			$U$ and $Y$ are not independent, because \vspace{-2mm}
			\[ P(U=0,Y=1) = 0 \neq P(U=0)P(Y=1) = e^{-(\theta+\lambda )}
			\lambda e^{-\lambda } \]
		\end{block}
	}
	\frame{\vspace{-2mm} 
		\begin{alertblock}{}
			To deal with a sum of independent random variables, it is convenient to use mgf's.
		\end{alertblock}\vspace{-2mm}
		\begin{block}{Theorem 4.2.12.}
			If $X_1,...,X_n$ are independent random variables with mgf's $M_{X_1}(t)$,...,$M_{X_n}(t)$, then the mgf
			of the sum $T = X_1+\cdots + X_n$ is \vspace{-2.5mm}
			\[ M_T(t) = M_{X_1}(t) \cdots M_{X_n}(t)\vspace{-2.5mm} \]
			and $M_T(t)< \infty $  iff  $M_{X_i}(t) < \infty$, $i=1,...,n$. 
		\end{block}\vspace{-2mm}
		\begin{block}{Proof.}
			By definition, \vspace{-3mm} 
			\beqrs
			M_T(t) \back & = & \back E(e^{tT}) = E( e^{t(X_1+\cdots + X_n)}) = E (e^{tX_1} \cdots e^{tX_n}) \\
			\back & = & \back  
			E (e^{tX_1}) \cdots E(e^{tX_n}) 
			=  M_{X_1}(t) \cdots M_{X_n}(t)
			\eeqrs
			$~~$ \vspace{-8mm} 
			
			where the 4th equality follows from the independence of $X_1,...,X_n$ and Theorem 4.6.12. 
		\end{block}\vspace{-2mm}
		\begin{alertblock}{}
			This result and the uniqueness theorem (Theorem 2.3.11) lead to many useful results concerning the sum of independent random variables.
		\end{alertblock}}
		\frame{
			\begin{block}{Theorem 4.2.14.}
				If $X \sim N(\mu , \sigma^2)$ and $Y \sim N(\gamma , \tau^2) $ are independent, then
				$T =X+Y \sim N(\mu+\gamma , \sigma^2 + \tau^2)$.
			\end{block}\vspace{-2mm}
			\begin{alertblock}{}
				This is easy to show, because the mfg's of $X$ and $Y$ are $M_X(t) = e^{\mu t+ \sigma^2t^2/2}$ and
				$M_Y(t) = e^{\gamma t +\tau^2t^2/2}$, and thus the mgf of $T$ is
				\vspace{-2mm}
				\[ M_X(t) M_Y(t)= e^{\mu t+ \sigma^2t^2/2} e^{\gamma t +\tau^2t^2/2}
				= e^{(\mu+\gamma )t + (\sigma^2 + \tau^2)t^2/2} \vspace{-2mm}\]
				which is the mgf of $ N(\mu+\gamma , \sigma^2 + \tau^2)$.
				
				By the uniqueness theorem, we must have
				$T \sim N(\mu+\gamma , \sigma^2 + \tau^2)$.
				\vspace{1mm}
				
				Note that this result does not apply to the bivariate normal distribution example with $\rho \neq 0$, since in that example $X$ and $Y$ are not independent.
				
			\end{alertblock}\vspace{-2mm}
			\begin{block}{}
				The previous result can be generalized to more than two independent random variables having normal distributions:
				If $X_1,...,X_k$ are independent random variables, $X_i \sim N(\mu_i , \sigma_i^2)$, $i=1,...,k$, then
				the sum $X_1+\cdots + X_k $ $\sim N(\mu_1+\cdots + \mu_k , \sigma_1^2+\cdots + \sigma_k^2)$.
			\end{block}}
			\frame{
				\begin{block}{}
					This type of results is called additivity of distributions; i.e., if $X$ and $Y$ have distributions in a class of distributions and
					$X+Y$ has a distribution also in that class, then the distributions in this class are called additive
					distributions.
				\end{block}\vspace{-2mm}
				\begin{alertblock}{Additivity of the chi-square distributions}
					In Chapter 2 we showed that if $Z \sim N(0,1)$, then $Z^2 \sim $ the chi-square distribution with degree of freedom 1.
					
					A more general result is as follows.
					
					If $X_i \sim N(\mu_i , \sigma_i^2)$, $i=1,...,k$, are independent, then the distribution of
					\vspace{-3mm}
					\[ Y = \left(\frac{X_1-\mu_1}{\sigma_1} \right)^2 + \cdots + \left(\frac{X_k-\mu_k}{\sigma_k}\right)^2 \vspace{-3mm} \]
					is the chi-square distribution with degrees of freedom $k$.
					
					First, $Z_i \sim N(0,1)$, $i=1,...,k$, and $Z_i$'s are independent.
					
					Second, each $Z_i^2 \sim$ chi-square with degree of freedom 1.
					
					Third, the chi-square distribution with degrees of freedom $r$ is the $gamma(r/2, 2)$ distribution.
					
					Finally, the result follows from the next result.
				\end{alertblock}
			}
			\frame{\vspace{-2mm}
				\begin{block}{Additivity of the gamma distributions}
					If $X_i \sim gamma (\alpha_i , \beta )$, $i=1,...,k$, are independent, then
					the sum $T = X_1+ \cdots + X_k \sim gamma( \alpha_1+\cdots + \alpha_k , \beta )$.
					
					This is because the mgf of $X_i$ is $(1-\beta t)^{-\alpha_i}$ when $ t < \beta^{-1}$.
					
					By Theorem 4.2.12, the mgf of $T$ is \vspace{-2.5mm}
					\[ (1-\beta t)^{-\alpha_1} \cdots (1-\beta t)^{-\alpha_k } = (1-\beta t)^{-(\alpha_1+\cdots + \alpha_k) } \quad \quad t< \beta^{-1}\vspace{-2.5mm} \]
					which is the mgf of $gamma( \alpha_1+\cdots + \alpha_k , \beta )$.
				\end{block}
				\vspace{-3mm}
				\begin{alertblock}{A non-additive class of distributions}
					The class of all uniform distributions is not additive.
					
					If $X \sim uniform(0,1)$ and $Y \sim uniform(0,1)$ are independent and $f(x)$ is the indicator function of the interval $(0,1)$, then
					the pdf of $X+Y$ is \vspace{-3mm}
					\[ f_{X+Y}(t) = \int_{-\infty}^\infty f(t-y)f(y) dy = \int_{0 < t-y<1 , 0<y<1} dy \vspace{-3mm} \]
					\[ = \left\{ \br{ll}
					\int_{t-1}^1 dy = 2-t & \quad 1 < t < 2 \vspace{1mm} \\
					\int_0^t dy = t & \quad 0<t<1 \vspace{1mm} \\
					0 & \quad \mbox{otherwise} \er \right. \vspace{-2mm} \]
					which is not a uniform pdf.
				\end{alertblock}
			}
			\frame{\vspace{-2mm}
				\begin{block}{}
					The next result is useful if the mgf is not finite in a neighborhood of 0. 
				\end{block}\vspace{-2mm}
				\begin{alertblock}{Theorem 4.2.12A.} 
					If $X_1,...,X_n$ are independent random variables with chf's $\phi_{X_1}(t)$,...,$\phi_{X_n}(t)$, then the chf
					of the sum $T = X_1+\cdots + X_n$ is \vspace{-2.5mm}
					\[\phi_T(t) = \phi_{X_1}(t) \cdots \phi_{X_n}(t)\quad \quad t \in {\cal R} \]
				\end{alertblock}\vspace{-2mm}
				\begin{block}{Additivity of the Cauchy distribution}
					If $U $ and $V$ are independent random variables having the $ Cauchy(0,1)$ distribution,
					what is the distribution of $U+V$?
					\vspace{1mm}
					
					Since the mgf of a Cauchy distribution is not finite except at 0, we apply Theorem 4.2.12A. 
					\vspace{1mm}
					
					Note that the chf of $Cauchy(0,1)$ is $e^{-|t|}$, $t \in {\cal R}$. 
					\vspace{1mm}
					
					By Theorem 4.2.12A, the chf of $U+V$ is $e^{-|t|}e^{-|t|} = e^{-2|t|}$, $t \in {\cal R}$, which is 
					the chf of $Cauchy(0,2)$. 
					\vspace{1mm}
					
					By the uniqueness theorem, $U+V \sim Cauchy(0,2)$. 
					\vspace{1mm}
					
					Of course, the same result can be derived using the convolution, but the argument is much more complicated (exercise).
				\end{block}}

\frame{\vspace{-2mm}
	\begin{alertblock}{}
		We now consider a more general transformation,  a vector of transformations of a random vector.
	\end{alertblock}\vspace{-2mm}
	\begin{alertblock}{The pdf of a multivariate transformation}
Let $X$ be a $k$-dimensional random vector with a joint pdf $f_X$ and let
$Y=g(X)$, where $g$ is a Borel function from ${\cal R}^k$ to  ${\cal R}^k$
(so that $Y$ is a $k$-dimensional random vector).
Let $A_1,...,A_m$ be disjoint
sets in ${\cal B}^k$ such that $P(X  \in A_1\cup \cdots \cup
A_m)= 1 $ and $g$ on $A_j$ is one-to-one with a
nonvanishing Jacobian, i.e.,
 the determinant $|\partial g(x)/\partial x | \neq
0$ on $ A_j$, $j=1,...,m$.
Then $Y$ has the following joint pdf \vspace{-2mm}
\[ f_Y(x) = \sum_{j=1}^m \bigg| \left| \partial h_j(x)/\partial x
\right| \bigg| \, f_X\left( h_j(x)\right) , \vspace{-2mm}\]
where
$h_j$ is the inverse function of $g$ on $A_j$, and
$\big| | \partial h_j(x)/\partial x
| \big|$ is the absolute value of the determinant of the matrix $\partial h_j(x)/\partial x$,
$j=1,...,m$.
\end{alertblock}
\vspace{-2mm}
\begin{block}{Example}
Let $X=(X_1,X_2)$ be a $2$-dimensional random vector with joint
pdf $f_X$.

Consider first
the transformation $u = g(x_1,x_2) =(u_1,u_2)=(x_1,x_1+x_2)$.
\end{block}
}
\frame{
\vspace{-2mm}
\begin{block}{}
\vspace{-2mm}
\[ \frac{\partial u}{\partial x} = \left( \br{cc}
\frac{\partial u_1}{\partial x_1} & \frac{\partial u_1}{\partial x_2} \vspace{1mm} \\
\frac{\partial u_2}{\partial x_1} & \frac{\partial u_2}{\partial x_2} \er \right)
=\left( \br{cc}
1 & 0 \\
1 & 1 \er \right) \quad\quad \bigg| \frac{\partial u}{\partial x}  \bigg| = 1  \quad \quad \bigg| \frac{\partial x}{\partial u}  \bigg| = 1 \vspace{-2mm} \]
Using the transformation theorem, the joint pdf of $U= g(X) $ is \vspace{-2mm}
\[f_{U}(u_1,u_2) = f_X(u_1,u_2-u_1),\vspace{-2mm} \]
The marginal pdf of $U_2=X_1+X_2$ is the same as that previously derived\vspace{-2mm}
\[ f_{U_2}(u_2) = \int_{-\infty}^\infty f_X(u_1,u_2-u_1)du_1 \vspace{-2mm} .\]
Next, consider the transformation $v=g(x_1,x_2)=(v_1,v_2)=(x_1/x_2,x_2)$.
\vspace{-2mm}
\[ \frac{\partial v}{\partial x} = \left( \br{cc}
\frac{\partial v_1}{\partial x_1} & \frac{\partial v_1}{\partial x_2} \vspace{1mm} \\
 \frac{\partial v_2}{\partial x_1} & \frac{\partial v_2}{\partial x_2} \er \right)
=\left( \br{cc}
\frac{1}{x_2} & -\frac{x_1}{x_2^2} \\
0 & 1 \er \right) \quad\quad \bigg| \frac{\partial v}{\partial x} \bigg|  = \frac{1}{x_2} \quad\quad  \bigg| \frac{\partial x}{\partial v} \bigg|  = v_2 \vspace{-2mm} \]
Using the transformation theorem, the joint pdf of $V= g(X) $ is \vspace{-2mm}
\[ f_{V} (v_1,v_2) = |v_2| f_X(v_1v_2,v_2), \vspace{-2mm} \]
The marginal pdf of $V_1=X_1/X_2$ is\vspace{-2mm}
\[ f_{V_1}(v_1)= \int_{-\infty}^\infty  |v_2|f_X(v_1v_2,v_2)dv_2 .\]
\end{block}}
\frame{
\begin{block}{}
In particular, if $X_1$ and $X_2$ are independent, then\vspace{-2mm}
\[ f_{V_1}(z)= \int_{-\infty}^\infty |v_2|f_{X_1}(v_1v_2)f_{X_2}(v_2)dv_2 \]
Finally, consider the transformation $w\! =\! g(x_1,x_2)\! =\! (w_1,w_2)\! =\! (x_1x_2,x_2)$.
\vspace{-2mm}
\[ \frac{\partial w}{\partial x} = \left( \br{cc}
\frac{\partial w_1}{\partial x_1} & \frac{\partial w_1}{\partial x_2} \vspace{1mm} \\
 \frac{\partial w_2}{\partial x_1} & \frac{\partial w_2}{\partial x_2} \er \right)
=\left( \br{cc}
x_2 & x_1 \\
0 & 1 \er \right) \quad\quad \bigg| \frac{\partial w}{\partial x} \bigg|  = x_2 \quad\quad  \bigg| \frac{\partial x}{\partial w} \bigg|  = \frac{1}{w_2}  \]
Using the transformation theorem, the joint pdf of $W= g(X) $ is \vspace{-2mm}
\[ f_{W} (w_1,w_2) = |w_2|^{-1} f_X(w_1w_2^{-1},w_2), \vspace{-2mm} \]
 The marginal pdf of $W_1=X_1X_2$ is
 \vspace{-2mm}
\[ f_{W_1}(w_1)= \int_{-\infty}^\infty  |w_2|^{-1} f_X(w_1w_2^{-1},w_2)dw_2 .\vspace{-2mm}\]
In particular, if $X_1$ and $X_2$ are independent, then\vspace{-2mm}
\[ f_{W_1}(w_1)= \int_{-\infty}^\infty |w_2|^{-1}f_{X_1}(w_1w_2^{-1})f_{X_2}(w_2)dw_2 \]
\end{block}}
\frame{\vspace{-2mm}
\begin{alertblock}{}
A number of results can be derived from these results.
\end{alertblock}\vspace{-2mm}
\begin{block}{Example 4.3.3 (product of two beta random variables)}
Let $X \sim beta(\alpha , \beta )$ and $Y \sim beta (\alpha + \beta , \gamma )$ be independent so that
the joint pdf is \vspace{-2mm}
\[ f_{X,Y}(y,x) =
\frac{\Gamma (\alpha + \beta )}{\Gamma (\alpha ) \Gamma (\beta )} x^{\alpha -1 } (1-x)^{\beta -1}
\frac{\Gamma (\alpha + \beta + \gamma  )}{\Gamma (\alpha + \beta  ) \Gamma (\gamma )} y^{\alpha + \beta  -1 } (1-y )^{\gamma  -1}\vspace{-2mm}\]
\[  0<x<1, \  \ 0<y<1 \vspace{-2mm} \]
Consider $U = XY$ and $V=X$.

An application of the early result for product gives that \vspace{-2mm}
\[ f_U(u)  =  \int_{-\infty}^\infty |v|^{-1}f(uv^{-1},v)dv \vspace{-2mm} \]
But we need to be careful when the pdf is 0 in some intervals.

Note that the range of $(U,V)$ is the region $0<u <v <1$ (why?).

Thus, \vspace{-3mm}
\[  f_U(u)  =
 \frac{\Gamma (\alpha + \beta + \gamma )}{\Gamma (\alpha ) \Gamma (\beta )\Gamma (\gamma )}  \int_u^1  v^{\alpha -1 } (1-v)^{\beta -1}
\left(\frac{u}{v}\right)^{\alpha + \beta  -1 } \left(1-\frac{u}{v}\right)^{\gamma  -1} \frac{1}{v} dv \vspace{-3mm} \]
for $0<u<1$ ($f_U(u) = 0 $ when $u< 0 $ or $u>1$.)
\end{block}}
\frame{
\begin{block}{}
Making the change of variable $s= (u/v - u)/(1-u)$ so that $dy = -u/[v^2(1-u)]$, $s =0$ when $v = 1$ and $s=1$ when $v=u$, we obtain that
\vspace{-2mm}
\beqrs
f_U(u) \!\!\!\!\! &=& \!\!\!\!\!  \frac{\Gamma (\alpha + \beta + \gamma )}{\Gamma (\alpha ) \Gamma (\beta )\Gamma (\gamma )}
u^{\alpha -1}(1-u)^{\beta + \gamma -1} \int_u^1 \left(\frac{u}{v}-u\right)^{\beta -1}\!\! \left(1-\frac{u}{v}\right)^{\gamma -1}\!\! \frac{u}{v^2} dv \\
\!\!\!\!\! & = & \!\!\!\!\!\frac{\Gamma (\alpha + \beta + \gamma )}{\Gamma (\alpha ) \Gamma (\beta )\Gamma (\gamma )}
u^{\alpha -1}(1-u)^{\beta + \gamma -1} \int_0^1 s^{\beta -1}(1-s)^{\gamma -1} ds \\
\!\!\!\!\! &=& \!\!\!\!\!\frac{\Gamma (\alpha + \beta + \gamma )}{\Gamma (\alpha ) \Gamma (\beta )\Gamma (\gamma )}
u^{\alpha -1}(1-u)^{\beta + \gamma -1} \frac{\Gamma (\beta ) \Gamma (\gamma )}{\Gamma (\beta + \gamma )} \\
\!\!\!\!\! & = & \!\!\!\!\!\frac{\Gamma (\alpha + \beta + \gamma )}{\Gamma (\alpha ) \Gamma (\beta + \gamma )}
u^{\alpha -1}(1-u)^{\beta + \gamma -1} \quad\quad \quad 0<u<1
\eeqrs
Thus, the product $XY \sim beta (\alpha , \beta + \gamma )$.
\end{block}\vspace{-2mm}
\begin{alertblock}{Example}
If $X_i \sim N(0,1)$, $i=1,...,n$, are independent, we want to show that, for every $i =1,...,n$, the random variables $U = X_1^2 + \cdots + X_n^2$ and
$V_i = X_i^2 /U$ are independent, and we want to find the pdf of $V_i$.
\end{alertblock}
}
\frame{\vspace{-2mm}
\begin{alertblock}{}
The joint pdf of $X_1,...,X_n$ is \vspace{-2.5mm}
\[ f_X(x_1,...,x_n) =  \frac{1}{(\sqrt{2\pi})^n} \exp \left( - \frac{1}{2} \sum_{i=1}^n x_i^2 \right) \quad \quad x_i \in {\cal R}, \ i=1,...,n \vspace{-2.5mm} \]
For $Y_i = X_i^2$, $i=1,...,n$, an application of the transformation theorem shows that the joint pdf of $Y_1,...,Y_n$ is \vspace{-2mm}
\[ f_Y(y_1,...,y_n) =
\frac{1}{2^{n/2}\sqrt{y_1\cdots y_n}} \exp \left( - \frac{1}{2} \sum_{i=1}^n y_i \right) \quad \quad y_i >0,  \ i=1,...,n. \vspace{-2mm} \]
Let $U = Y_1+\cdots +Y_n$ and $V_i = Y_i/U$, $i=1,...,n$.
\vspace{1mm}

Then $Y_i = UV_i$, $i=1,...,n-1$, and $Y_n =UV_n =  U(1-V_1-\cdots - V_{n-1})$.  \vspace{-2mm}
\[ \bigg| \frac{\partial (y_1,...,y_n) }{\partial (u,v_1,...,v_{n-1})} \bigg| = \left| \br{ccccc}
v_1 & u & 0 & \cdots & 0 \\
v_2 & 0 & u & \cdots & 0 \\
\cdots & \cdots &\cdots &\cdots &\cdots \\
v_{n-1} & 0 & 0 & \cdots & u \\
v_n & 0 & 0 & \cdots & 0 \er \right| = v_nu^{n-1}  \vspace{-3mm} \]
where $v_n = 1- v_1-\cdots - v_{n-1}$.
\vspace{1mm}

Since $Y_i >0$, $i=1,...,n$, $U >0$ and $0 < V_i < 1$, $i=1,...,n$.  
\end{alertblock}
}
\frame{\vspace{-2mm}
\begin{alertblock}{}
The joint pdf for $U$ and $V_1,...,V_{n-1}$ is \vspace{-3mm}
\[  f_{Y} (uv_1,...,uv_n) v_n u^{n-1} = \frac{1}{2^{n/2}} u^{n/2-1} e^{-u/2} \sqrt{\frac{1-v_1-\cdots -v_{n-1}}{v_1\cdots v_{n-1}}}
\vspace{-3mm} \]
Therefore, we know that $U$ and $(V_1,...,V_{n-1})$ are independent and, hence,
$U$ and $V_i $ are independent for any $i=1,...,n-1$.
\vspace{1mm}

Since $V_n = 1-V_1 - \cdots - V_{n-1}$, $U$ and $V_n$ are independent.
\vspace{1mm}

If $W = U - X_i^2$, then \vspace{-3mm}
\[ V_i = \frac{X_i^2}{U} = \frac{X_i^2}{W+X_i^2} =
\frac{X_i^2/W}{1+X_i^2/W} \vspace{-3mm} \]
Previously we showed that $Z = X_i^2/W$ has pdf \vspace{-3mm}
\[  \frac{\Gamma(n/2)}{
 \Gamma(1/2)\Gamma((n-1)/2)}
 \frac{z^{-1/2}}{(1+z)^{(n-1)/2}},  \quad \quad \quad z>0 \vspace{-2mm} \]
 Then the transformation $V_i = Z/(1+Z)$ gives the following pdf for $V_i$: \vspace{-3mm}
\[  \frac{\Gamma(n/2)}{
 \Gamma(1/2)\Gamma((n-1)/2)}
v^{-1/2} (1-v)^{(n-3)/2},  \quad \quad \quad 0<v<1 \vspace{-2mm} \]
 which is $beta (1/2,(n-1)/2)$.


\end{alertblock}
}
\end{document}


