\documentclass[notitlepage]{article} \usepackage{../../Math556} \usepackage{listings} \usepackage{numprint} \usepackage{enumerate} \usepackage{multirow} \usepackage{bbm} \usepackage{bbold} \usepackage{mathtools} \usepackage{amsfonts,amsmath,amssymb} \usepackage{tikz} \usepackage{forest} \usetikzlibrary{shadows,fit,backgrounds} \forestset{ declare toks={level label}{}, declare toks register={level labels}, level labels={}, declare count register={leveller}, leveller'=0, level split/.style={ temptoksa={#1}, split register={temptoksa}{:}{tempcounta,level label split}, }, level label split/.style={ temptoksb={#1}, temptoksc={}, split register={temptoksb}{,}{temptoksc, level label splitter}, tikz+/.wrap 2 pgfmath args={ \node (label leveller ##1) [anchor=east, align=right, font=\sffamily] at (level ##1.west -| westpoint) {##2}; }{tempcounta}{temptoksc}, before computing xy/.wrap pgfmath arg={ tikz+={ \node [anchor=north east, align=right, font=\rmfamily] at (label leveller ##1.north -| west of westpoint) {LEVEL ##1}; }, }{tempcounta}, }, level label splitter/.style={ temptoksc+={\\#1}, }, label levels/.style={ tikz+={ \coordinate (westpoint) at ([xshift=-15pt]current bounding box.west); }, before packing={ tikz+={ \coordinate (west of westpoint) at ([xshift=-15pt]current bounding box.west); }, }, before drawing tree={ tikz+={ \scoped[on background layer]{\node [left color=blue!50!cyan!25!white, right color=blue!50!cyan!25!white, middle color=blue!50!cyan, inner sep=10pt, rounded corners, draw=blue!50!cyan, draw opacity=.5, fill opacity=.15, fit=(current bounding box)] {};} }, }, delay={ for tree breadth-first={ if level label={}{}{ if={(level())>(leveller)}{ leveller/.option=level, alias/.wrap pgfmath arg={level ##1}{level()}, if level labels={}{}{ level labels+={;}, }, level labels+/.option=level, level labels+={:}, }{}, level labels+/.option=level label, level labels+={,}, }, }, }, before typesetting nodes={ if level labels={}{}{ split register={level labels}{;}{level split}, }, }, } } \setlength{\parindent}{0pt} \def\E{\Expect} \lstloadlanguages{R} \definecolor{keywordcolor}{rgb}{0,0.6,0.6} \definecolor{delimcolor}{rgb}{0.461,0.039,0.102} \definecolor{Rcommentcolor}{rgb}{0.101,0.043,0.432} \lstdefinestyle{Rsettings}{ basicstyle=\ttfamily, breaklines=true, showstringspaces=false, keywords={if, else, function, theFunction, tmp}, % Write as many keywords otherkeywords={}, commentstyle=\itshape\color{Rcommentcolor}, keywordstyle=\color{keywordcolor}, moredelim=[s][\color{delimcolor}]{"}{"}, } \lstset{basicstyle=\ttfamily, numbers=none, literate={~} {$\sim$}{2}} \begin{document} <>= library(knitr) # global chunk options opts_chunk$set(cache=TRUE, autodep=TRUE) options(scipen=999) options(repos=c(CRAN="https://cloud.r-project.org/")) inline_hook <- function (x) { if (is.numeric(x)) { # ifelse does a vectorized comparison # If integer, print without decimal; otherwise print two places res <- ifelse(x == round(x), sprintf("%.6f", x), sprintf("%.6f", x) ) paste(res, collapse = ", ") } } knit_hooks$set(inline = inline_hook) @ \begin{center} \textsclarge{MATH 556: Mathematical Statistics I} \vspace{0.1 in} \textsc{Convergence In Distribution: Worked Examples} \end{center} \noindent \textbf{EXAMPLE 1: }Continuous random variable $X_n$ with support $\mathbb{X}\equiv \left( 0,n\right]$ for $n>0$ and cdf \begin{equation*} F_{X_{n}}(x)=1-\left( 1-\frac{x}{n}\right) ^{n}\qquad 00$ \begin{equation*} F_{X_{n}}\left( x\right) \lra 1-e^{-x}\qquad \therefore \qquad F_{X_{n}}\left( x\right) \lra F_{X}\left( x\right) =1-e^{-x} \end{equation*} and hence \begin{equation*} X_{n}\CiD X \qquad \end{equation*} with $X\sim Exponential(1)$. <>= library(plotrix) redblue<-colorRampPalette(c("cyan","blue")) N<-20 rbc<-redblue(N) nvec<-c(1:N) xvec<-seq(0,8,by=0.01) par(mar=c(4,4,1,1)) plot(xvec,xvec*0,type='n',ylim=range(0,1),xlab='x',ylab=expression(F[X[n]](x))) for(i in 1:N){ xv<-pmin(xvec,nvec[i]) yvec<-1-(1-xv/nvec[i])^nvec[i] lines(xvec,yvec,col=rbc[i]) } lines(xvec,pexp(xvec,1),col='red',lwd=2) color.legend(6,0.0,6.5,0.8,paste('n =',1:N),rbc,gradient="y",cex=0.5) legend(7,0.8,c('Limit'),lwd=2,lty=1,col='red',cex=0.5) @ \pagebreak \noindent \textbf{EXAMPLE 2: \ }Continuous random variable $X_n$ with support $\mathbb{X}\equiv \left( 0,\infty \right) $ and cdf \begin{equation*} F_{X_{n}}(x)=\left( 1-\frac{1}{1+nx}\right) ^{n}\qquad 00$ \begin{equation*} F_{X_{n}}\left( x\right) \lra e^{-1/x}\qquad \therefore \qquad F_{X_{n}}\left( x\right) \lra F_{X}\left( x\right) =e^{-1/x} \end{equation*} as \begin{equation*} \lim_{n\lra \infty }\left( 1-\frac{1}{1+nx}\right) ^{n}=\lim_{n\lra \infty }\left( 1-\frac{1}{nx}\right) ^{n}=\lim_{n\lra \infty }\left( 1-\frac{1/x}{n}\right) ^{n} \end{equation*} and for any $z$ \begin{equation*} \lim_{n\lra \infty }\left( 1+\dfrac{z}{n}\right) ^{n}=e^{z} \end{equation*} <>= N<-20 nvec<-c(1:N) xvec<-seq(0,10,by=0.01) par(mar=c(4,4,1,1)) plot(xvec,xvec*0,type='n',ylim=range(0,1),xlab='x',ylab=expression(F[X[n]](x))) for(i in 1:N){ yvec<-(1-1/(1+nvec[i]*xvec))^nvec[i] lines(xvec,yvec,col=rbc[i]) } fx<-exp(-1/xvec) lines(xvec,fx,col='red',lwd=2) color.legend(8,0.0,8.5,0.8,paste('n =',1:N),rbc,gradient="y",cex=0.5) legend(9,0.8,c('Limit'),lwd=2,lty=1,col='red',cex=0.5) @ \pagebreak \noindent \textbf{EXAMPLE 3: }Continuous random variable $X_n$ with support $% \mathbb{X}\equiv \left[ 0,1\right] $ and cdf \begin{equation*} F_{X_{n}}(x)=x-\sin \left( 2n\pi x\right)/(2n\pi)\qquad 0\leq x\leq 1 \end{equation*} and standard cdf behaviour outside of this support. \ Then as $n\lra \infty $, and for all $0\leq x\leq 1$ \begin{equation*} F_{X_{n}}\left( x\right) \lra x\qquad \therefore \qquad F_{X_{n}}\left( x\right) \lra F_{X}\left( x\right) =x \end{equation*} and hence \begin{equation*} X_{n}\CiD X\qquad \text{where } X\sim Uniform(0,1) \end{equation*} <>= N<-20 nvec<-c(1:N) xvec<-seq(0,1,by=0.001) par(mar=c(4,4,1,1)) plot(xvec,xvec*0,type='n',ylim=range(0,1),xlab='x',ylab=expression(F[X[n]](x))) for(i in 1:N){ yvec<-xvec-sin(2*nvec[i]*pi*xvec)/(2*nvec[i]*pi) lines(xvec,yvec,col=rbc[i]) } lines(xvec,xvec,col='red',lwd=2) color.legend(0.8,0.0,0.85,0.6,paste('n =',1:N),rbc,gradient="y",cex=0.5) legend(0.9,0.6,c('Limit'),lwd=2,lty=1,col='red',cex=0.5) @ \noindent \textbf{NOTE}: \ for the pdf \begin{equation*} f_{X_{n}}(x)=1-\cos \left( 2n\pi x\right) \qquad 0\leq x\leq 1 \end{equation*} and for all $x$ there \textbf{is no limiting value }$n\lra \infty $. \ \pagebreak \noindent \textbf{EXAMPLE 4: }Continuous random variable $X_n$ with support $\mathbb{X}\equiv \left[ 0,1\right] $ and cdf \begin{equation*} F_{X_{n}}(x)=1-\left( 1-x\right) ^{n}\qquad 0\leq x\leq 1 \end{equation*} and standard cdf behaviour outside of this support. \ Then as $n\lra \infty $, and for $x\in \mathbb{R}$ \begin{equation*} F_{X_{n}}\left( x\right) \lra \left\{ \begin{array}{ll} 0 & x\leq 0\medskip \\ 1 & x>0 \end{array} \right. . \end{equation*} This limiting form is \textbf{not} continuous at $x=0$, as $x=0$ is not a point of continuity, and the \textbf{ordinary definition of convergence in} \textbf{distribution cannot be applied}. \ However, it is clear that for $% \epsilon >0$ , \begin{equation*} P_{X_n}\left[ \left| X_n\right| <\epsilon \right] =1-\left( 1-\epsilon \right) ^{n}\lra 1\text{ as }n\lra \infty \end{equation*} so it is still correct to say \begin{equation*} X_{n}\CiD X\qquad \text{where }P_X\left[ X=0\right] =1 \end{equation*} so the limiting distribution is \textbf{degenerate at }$x=0$. \ <>= N<-20;nvec<-5*c(1:N) xvec<-seq(0,1,by=0.001) par(mar=c(4,4,1,1)) plot(xvec,xvec*0,type='n',ylim=range(0,1),xlab='x',ylab=expression(F[X[n]](x))) for(i in 1:N){ yvec<-1-(1-xvec)^nvec[i] lines(xvec,yvec,col=rbc[i]) } lines(c(0,1),c(1,1),col='red',lwd=2);points(0,1,pch=19,col='red') color.legend(0.8,0.0,0.85,0.6,paste('n =',5*c(1:N)),rbc,gradient="y",cex=0.5) legend(0.9,0.6,c('Limit'),lwd=2,lty=1,col='red',cex=0.5) @ \pagebreak \noindent \textbf{EXAMPLE 5: }Continuous random variable $X_n$ with support $\mathbb{X}\equiv \left( 0,\infty \right) $ and cdf \begin{equation*} F_{X_{n}}(x)=\left( \frac{x}{1+x}\right) ^{n}\qquad x>0 \end{equation*} and zero otherwise. \ Then as $n\lra \infty $, and for $x>0$ \begin{equation*} F_{X_{n}}\left( x\right) \lra 0 \end{equation*} Thus there is \textbf{no limiting distribution}. <>= N<-20 nvec<-c(1:N) xvec<-seq(0,10,by=0.01) par(mar=c(4,4,1,1)) plot(xvec,xvec*0,type='n',ylim=range(0,1),xlab='x',ylab=expression(F[X[n]](x))) for(i in 1:N){ yvec<-(xvec/(1+xvec))^nvec[i] lines(xvec,yvec,col=rbc[i]) } lines(c(0,10),c(0,0),col='red',lwd=2) @ \noindent Now let $V_{n}=X_{n}/n$. \ Then $\mathbb{V}\equiv \left( 0,\infty \right) $ and the cdf of $V_{n}$ is \begin{equation*} F_{V_{n}}(v)=P_{V_n}\left[ V_{n}\leq v\right] =P_{X_n} \left[ X_{n}/n\leq v\right] =P_{X_n}\left[ X_{n}\leq nv\right] =F_{X_{n}}(nv)=\left(\frac{nv}{1+nv}\right) ^{n}\qquad v>0 \end{equation*} and as $n\lra \infty $, for all $v>0$ \begin{equation*} F_{V_{n}}\left( v\right) \lra e^{-1/v}\qquad \therefore \qquad F_{V_{n}}\left( v\right) \lra F_{V}\left( v\right) =e^{-1/v} \end{equation*} and the limiting distribution of $V_{n}$ does exist. <>= N<-20 nvec<-c(1:N) xvec<-seq(0,10,by=0.01) par(mar=c(4,4,1,1)) plot(xvec,xvec*0,type='n',ylim=range(0,1),xlab='x',ylab=expression(F[X[n]](x))) for(i in 1:N){ yvec<-(nvec[i]*xvec/(1+nvec[i]*xvec))^nvec[i] lines(xvec,yvec,col=rbc[i]) } fx<-exp(-1/xvec) lines(xvec,fx,col='red',lwd=2) color.legend(8,0.0,8.5,0.8,paste('n =',1:N),rbc,gradient="y",cex=0.5) legend(9,0.8,c('Limit'),lwd=2,lty=1,col='red',cex=0.5) @ \pagebreak \noindent \textbf{EXAMPLE 6: }Continuous random variable $X_n$ with support $\mathbb{X}\equiv \left( 0,\infty \right) $ and cdf \begin{equation*} F_{X_{n}}(x)=\frac{\exp (nx)}{1+\exp (nx)}\qquad x\in \mathbb{R} \end{equation*} and zero otherwise. \ Then as $n\lra \infty $ \begin{equation*} F_{X_{n}}(x)\lra \left\{ \begin{array}{ll} 0 & x<0\medskip \\ \dfrac{1}{2} & x=0\medskip \\ 1 & x>0 \end{array} \right. \qquad x\in \mathbb{R} \end{equation*} This limiting form is \textbf{not} a cdf, as it is not right continuous at $x=0$. \ However, as $x=0$ is not a point of continuity, and the ordinary definition of convergence in distribution does not apply. \ However, it is clear that for $\epsilon >0$, \begin{equation*} P_{X_n}\left[ \left| X_n \right| <\epsilon \right] =\frac{\exp (n\epsilon )}{1+\exp (n\epsilon )}-\frac{\exp (-n\epsilon )}{1+\exp (-n\epsilon )}\lra 1 \text{ as }n\lra \infty \end{equation*} so it is still correct to say $X_{n}\CiD X$ where $P_X \left[ X=0 \right] = 1$, and the limiting distribution is \textbf{degenerate at }$x=0$. <>= N<-20;nvec<-c(1:N);xvec<-seq(-10,10,by=0.01) par(mar=c(4,4,1,1)) plot(xvec,xvec*0,type='n',ylim=range(0,1),xlab='x',ylab=expression(F[X[n]](x))) for(i in 1:N){ yvec<-(exp(nvec[i]*xvec)/(1+exp(nvec[i]*xvec))) lines(xvec,yvec,col=rbc[i]) } lines(c(-10,0),c(0,0),col='red',lwd=2) lines(c(0,10),c(1,1),col='red',lwd=2);points(0,1,pch=19,col='red') color.legend(7,0.0,8,0.6,paste('n =',c(1:N)),rbc,gradient="y",cex=0.5) legend(8.5,0.6,c('Limit'),lwd=2,lty=1,col='red',cex=0.5) @ \end{document}