node19.htm

来自「matlab bootstrap程序设计方法」· HTM 代码 · 共 458 行

HTM
458
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with LaTeX2HTML 2002-2 (1.70)original version by:  Nikos Drakos, CBLU, University of Leeds* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from:  Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>Confidence Intervals</TITLE><META NAME="description" CONTENT="Confidence Intervals"><META NAME="keywords" CONTENT="web1"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META NAME="Generator" CONTENT="LaTeX2HTML v2002-2"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="web1.css"><LINK REL="next" HREF="node20.html"><LINK REL="previous" HREF="node18.html"><LINK REL="up" HREF="node6.html"><LINK REL="next" HREF="node20.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html411"  HREF="node20.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/home/depot/swtree/depot/latex2html-2002-2/latex2html-2002-2/icons/next.png"></A> <A NAME="tex2html409"  HREF="node6.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/home/depot/swtree/depot/latex2html-2002-2/latex2html-2002-2/icons/up.png"></A> <A NAME="tex2html403"  HREF="node18.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/home/depot/swtree/depot/latex2html-2002-2/latex2html-2002-2/icons/prev.png"></A>   <BR><B> Next:</B> <A NAME="tex2html412"  HREF="node20.html">The Smoothed Bootstrap</A><B> Up:</B> <A NAME="tex2html410"  HREF="node6.html">Lectures</A><B> Previous:</B> <A NAME="tex2html404"  HREF="node18.html">Bootstrapping a Principal Component</A><BR><BR><!--End of Navigation Panel--><!--Table of Child-Links--><A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A><UL><LI><A NAME="tex2html413"  HREF="node19.html#SECTION002131000000000000000">Studentized Confidence Intervals</A><UL><LI><A NAME="tex2html414"  HREF="node19.html#SECTION002131100000000000000">Correlation Coefficient Example</A></UL><BR><LI><A NAME="tex2html415"  HREF="node19.html#SECTION002132000000000000000">Transformations of the parameter</A><UL><LI><A NAME="tex2html416"  HREF="node19.html#SECTION002132100000000000000">The delta method</A><UL><LI><A NAME="tex2html417"  HREF="node19.html#SECTION002132110000000000000">One dimension</A></UL></UL></UL><!--End of Table of Child-Links--><HR><H1><A NAME="SECTION002130000000000000000">Confidence Intervals</A></H1><BODY bgcolor="#FFFFFF">We call the unknown parameter <IMG WIDTH="14" HEIGHT="17" ALIGN="BOTTOM" BORDER="0" SRC="img10.png" ALT="$\theta$"> and our estimate<IMG WIDTH="14" HEIGHT="22" ALIGN="BOTTOM" BORDER="0" SRC="img212.png" ALT="$\hat{\theta}$">.Suppose that we had an ideal (unrealistic) situationin which we knew the distribution of<!-- MATH $\hat{\theta}-\theta$ --><IMG WIDTH="46" HEIGHT="45" ALIGN="MIDDLE" BORDER="0" SRC="img261.png" ALT="$\hat{\theta}-\theta$">, we will be interested especially in itsquantiles :denote the <!-- MATH $\mbox{${\frac{\alpha}{2}}$\  }$ --><IMG WIDTH="23" HEIGHT="35" ALIGN="MIDDLE" BORDER="0" SRC="img262.png" ALT="$\mbox{${\frac{\alpha}{2}}$ }$"> quantile by <!-- MATH $\underline{\delta}$ --><IMG WIDTH="14" HEIGHT="35" ALIGN="MIDDLE" BORDER="0" SRC="img263.png" ALT="$\underline{\delta}$"> and the <!-- MATH $1-\mbox{${\frac{\alpha}{2}}$\  }$ --><IMG WIDTH="56" HEIGHT="35" ALIGN="MIDDLE" BORDER="0" SRC="img264.png" ALT="$1-\mbox{${\frac{\alpha}{2}}$ }$"> quantile by <IMG WIDTH="14" HEIGHT="19" ALIGN="BOTTOM" BORDER="0" SRC="img265.png" ALT="$\bar{\delta}$">.<P>By definition we have:<!-- MATH $P(\hat{\theta}-\theta \leq \underline{\delta})=\frac{\alpha}{2}$ --><IMG WIDTH="148" HEIGHT="45" ALIGN="MIDDLE" BORDER="0" SRC="img266.png" ALT="$P(\hat{\theta}-\theta \leq \underline{\delta})=\frac{\alpha}{2}$"><P><!-- MATH $P(\hat{\theta}-\theta \leq  \bar{\delta} )= 1-\frac{\alpha}{2}$ --><IMG WIDTH="180" HEIGHT="45" ALIGN="MIDDLE" BORDER="0" SRC="img267.png" ALT="$P(\hat{\theta}-\theta \leq \bar{\delta} )= 1-\frac{\alpha}{2}$"><P><OL><LI>Would n't we get the same answer withoutcentering with regards to <IMG WIDTH="14" HEIGHT="22" ALIGN="BOTTOM" BORDER="0" SRC="img212.png" ALT="$\hat{\theta}$"> ?<P>What we called <!-- MATH $\mbox{$\underline{\delta}$}$ --><IMG WIDTH="14" HEIGHT="35" ALIGN="MIDDLE" BORDER="0" SRC="img268.png" ALT="$\mbox{$\underline{\delta}$}$"> and <IMG WIDTH="14" HEIGHT="19" ALIGN="BOTTOM" BORDER="0" SRC="img265.png" ALT="$\bar{\delta}$"> were the ideal quantilesfrom which we build the confidence interval :<!-- MATH $[\hat{\theta}-\bar{\delta},\hat{\theta}-\mbox{$\underline{\delta}$}]$ --><IMG WIDTH="107" HEIGHT="45" ALIGN="MIDDLE" BORDER="0" SRC="img269.png" ALT="$[\hat{\theta}-\bar{\delta},\hat{\theta}-\mbox{$\underline{\delta}$}]$">.Estimated by :using <!-- MATH $\bar{\delta}^*$ --><IMG WIDTH="21" HEIGHT="19" ALIGN="BOTTOM" BORDER="0" SRC="img270.png" ALT="$\bar{\delta}^*$"> the <!-- MATH $1-\mbox{${\frac{\alpha}{2}}$\  }$ --><IMG WIDTH="56" HEIGHT="35" ALIGN="MIDDLE" BORDER="0" SRC="img264.png" ALT="$1-\mbox{${\frac{\alpha}{2}}$ }$">th quantileof <!-- MATH $\hat{\theta}^*-\hat{\theta}$ --><IMG WIDTH="54" HEIGHT="45" ALIGN="MIDDLE" BORDER="0" SRC="img271.png" ALT="$\hat{\theta}^*-\hat{\theta}$">,the <IMG WIDTH="14" HEIGHT="22" ALIGN="BOTTOM" BORDER="0" SRC="img212.png" ALT="$\hat{\theta}$">'s do NOT cancel out.We can show why.</LI><LI>Would these intervals be the sameif we took the distributionof <!-- MATH $\hat{\theta}^*$ --><IMG WIDTH="21" HEIGHT="22" ALIGN="BOTTOM" BORDER="0" SRC="img272.png" ALT="$\hat{\theta}^*$"> to mimick simply that of the <IMG WIDTH="14" HEIGHT="22" ALIGN="BOTTOM" BORDER="0" SRC="img212.png" ALT="$\hat{\theta}$">'s ?<P>NO ! </LI></OL><P><H2><A NAME="SECTION002131000000000000000">Studentized Confidence Intervals</A></H2><P><H3><A NAME="SECTION002131100000000000000">Correlation Coefficient Example</A></H3><PRE>function out=corr(orig)%Correlation coefficientc1=corrcoef(orig);out=c1(1,2);%------------------------------------------function interv=boott(orig,theta,B,sdB,alpha)%Studentized bootstrap confidence intervals%     theta0=feval(theta,orig);     [n,p]=size(orig);      thetab=zeros(B,1);      sdstar=zeros(B,1);      thetas=zeros(B,1);           for b=1:B        indices=randint(1,n,n)+1;        samp=orig(indices,:);        thetab(b)=feval(theta,samp);%Compute the bootstrap se,se*           sdstar(b)=feval('btsd',samp,theta,n,sdB);%Studentized statistic      thetas(b)=(thetab(b)-theta0)/sdstar(b);      end      se=sqrt(var(thetab));Pct=100*(alpha/2);lower=prctile(thetas,Pct);upper=prctile(thetas,100-Pct);interv=[(theta0-upper*se) (theta0 - lower*se)];%----------------------------------------------function out=btsd(orig,theta,n,NB)%Compute the bootstrap estimate%of the stad error of the estimator%defined by the function theta%NB number of bootstrap simulationsthetab=zeros(NB,1);  for b=(1:NB)      indices=randint(1,n,n)+1;      samp=orig(indices,:);      thetab(b)=feval(theta,samp);  endout=sqrt(var(thetab));%----------------------------------------------&gt;&gt; boott(law15,'corr',1000,30,.05)ans =   -0.4737    1.0137%----------------------------------------------&gt;&gt; boott(law15,'corr',2000,30,.05)ans =   -0.2899    0.9801%----------------------</PRE><H2><A NAME="SECTION002132000000000000000">Transformations of the parameter</A></H2><PRE>function out=transcorr(orig)%transformed correlation coefficientc1=corrcoef(orig);rho=c1(1,2);out=.5*log((1+rho)/(1-rho));&gt;&gt; transcorr(law15)ans =    1.0362&gt;&gt; tanh(1.03)ans =    0.7739&gt;&gt; boott(law15,'transcorr',100,30,.05) ans =   -0.7841    1.7940&gt;&gt; tanh(ans)ans =   -0.6550    0.9462&gt;&gt; boott(law15,'transcorr',1000,30,.05)ans =    0.0473    1.7618&gt;&gt; tanh(ans)ans =    0.0473    0.9427&gt;&gt; transcorr(law15)                    ans =    1.0362&gt;&gt; 2/sqrt(12)ans =    0.5774&gt;&gt; 1.0362 - 0.5774ans =    0.4588&gt;&gt; 1.0362 + 0.5774    ans =    1.6136&gt;&gt; tanh([.4588 1.6136])ans =    0.4291    0.9237%%%%%%%%%%%%%%%True confidence Intervals%&gt;&gt; prctile(res100k,[5 95]) ans =    0.5307    0.9041</PRE><P><H3><A NAME="SECTION002132100000000000000">The delta method</A></H3>Very often we have a new random variable <IMG WIDTH="20" HEIGHT="16" ALIGN="BOTTOM" BORDER="0" SRC="img163.png" ALT="$Y$"> function ofone or several other random variables, and we want tofind the expectation and variance of <IMG WIDTH="20" HEIGHT="16" ALIGN="BOTTOM" BORDER="0" SRC="img163.png" ALT="$Y$"> if we knowthat of <IMG WIDTH="22" HEIGHT="16" ALIGN="BOTTOM" BORDER="0" SRC="img162.png" ALT="$X$">. For <IMG WIDTH="14" HEIGHT="33" ALIGN="MIDDLE" BORDER="0" SRC="img180.png" ALT="$g$"> a linear function thisis easy, the next best thing is to givethe best linear approximation to <IMG WIDTH="14" HEIGHT="33" ALIGN="MIDDLE" BORDER="0" SRC="img180.png" ALT="$g$"> and this is done through thedelta method.<H4><A NAME="SECTION002132110000000000000">One dimension</A></H4>We use a first order Taylor expansion of Y around <IMG WIDTH="100" HEIGHT="37" ALIGN="MIDDLE" BORDER="0" SRC="img273.png" ALT="$\mu_X=E(X)$"> <BR><P></P><DIV ALIGN="CENTER"><!-- MATH \begin{displaymath}Y=g(X)\simeq g(\mu_X)+(X-\mu_X)g'(\mu_X)\end{displaymath} --><IMG WIDTH="308" HEIGHT="33" BORDER="0" SRC="img274.png" ALT="\begin{displaymath}Y=g(X)\simeq g(\mu_X)+(X-\mu_X)g'(\mu_X)\end{displaymath}"></DIV><BR CLEAR="ALL"><P></P>Thus <BR><P></P><DIV ALIGN="CENTER"><!-- MATH \begin{displaymath}\mu_Y\simeq g(\mu_X) \qquad \sigma_Y^2 \simeq \sigma_X^2[g'(\mu_X)]^2\end{displaymath} --><IMG WIDTH="274" HEIGHT="33" BORDER="0" SRC="img275.png" ALT="\begin{displaymath}\mu_Y\simeq g(\mu_X) \qquad \sigma_Y^2 \simeq\sigma_X^2[g'(\mu_X)]^2\end{displaymath}"></DIV><BR CLEAR="ALL"><P></P>we know this is not true unless gis linear, using the Taylor expansion to second order:<BR><P></P><DIV ALIGN="CENTER"><!-- MATH \begin{displaymath}Y=g(X)\simeq g(\mu_X)+(X-\mu_X)g'(\mu_X)+\frac{1}{2}(X-\mu_X)^2g''(\mu_X)\end{displaymath} --><IMG WIDTH="488" HEIGHT="45" BORDER="0" SRC="img276.png" ALT="\begin{displaymath}Y=g(X)\simeq g(\mu_X)+(X-\mu_X)g'(\mu_X)+\frac{1}{2}(X-\mu_X)^2g''(\mu_X)\end{displaymath}"></DIV><BR CLEAR="ALL"><P></P>Taking expectations we get <BR><P></P><DIV ALIGN="CENTER"><!-- MATH \begin{displaymath}E(Y)\simeq g(\mu_X)+\frac{1}{2}\sigma_X^2g''(\mu_X)\end{displaymath} --><IMG WIDTH="231" HEIGHT="45" BORDER="0" SRC="img277.png" ALT="\begin{displaymath}E(Y)\simeq g(\mu_X)+\frac{1}{2}\sigma_X^2g''(\mu_X)\end{displaymath}"></DIV><BR CLEAR="ALL"><P></P><P><HR><!--Navigation Panel--><A NAME="tex2html411"  HREF="node20.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/home/depot/swtree/depot/latex2html-2002-2/latex2html-2002-2/icons/next.png"></A> <A NAME="tex2html409"  HREF="node6.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/home/depot/swtree/depot/latex2html-2002-2/latex2html-2002-2/icons/up.png"></A> <A NAME="tex2html403"  HREF="node18.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/home/depot/swtree/depot/latex2html-2002-2/latex2html-2002-2/icons/prev.png"></A>   <BR><B> Next:</B> <A NAME="tex2html412"  HREF="node20.html">The Smoothed Bootstrap</A><B> Up:</B> <A NAME="tex2html410"  HREF="node6.html">Lectures</A><B> Previous:</B> <A NAME="tex2html404"  HREF="node18.html">Bootstrapping a Principal Component</A><!--End of Navigation Panel--><ADDRESS>Susan Holmes2004-05-19</ADDRESS></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?