⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 some notation.htm

📁 matlab bootstrap程序设计方法
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0060)http://www-stat.stanford.edu/~susan/courses/s208/node11.html -->
<!--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>Some notation</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="Some notation" name=description>
<META content=web1 name=keywords>
<META content=document name=resource-type>
<META content=global name=distribution>
<META content="MSHTML 6.00.2900.2523" name=GENERATOR>
<META http-equiv=Content-Style-Type content=text/css><LINK 
href="Some notation.files/web1.css" rel=STYLESHEET><LINK href="node12.html" 
rel=next><LINK href="node10.html" rel=previous><LINK href="node6.html" 
rel=up><LINK href="node12.html" rel=next></HEAD>
<BODY bgColor=#ffffff><!--Navigation Panel--><A 
href="http://www-stat.stanford.edu/~susan/courses/s208/node12.html" 
name=tex2html302><IMG height=24 alt=next src="" width=37 align=bottom 
border=0></A> <A 
href="http://www-stat.stanford.edu/~susan/courses/s208/node6.html" 
name=tex2html300><IMG height=24 alt=up src="" width=26 align=bottom 
border=0></A> <A 
href="http://www-stat.stanford.edu/~susan/courses/s208/node10.html" 
name=tex2html294><IMG height=24 alt=previous src="" width=63 align=bottom 
border=0></A> <BR><B>Next:</B> <A 
href="http://www-stat.stanford.edu/~susan/courses/s208/node12.html" 
name=tex2html303>Complete Enumeration</A> <B>Up:</B> <A 
href="http://www-stat.stanford.edu/~susan/courses/s208/node6.html" 
name=tex2html301>Lectures</A> <B>Previous:</B> <A 
href="http://www-stat.stanford.edu/~susan/courses/s208/node10.html" 
name=tex2html295>The bootstrap: Some Examples</A> <BR><BR><!--End of Navigation Panel--><!--Table of Child-Links--><A 
name=CHILD_LINKS><STRONG>Subsections</STRONG></A> 
<UL>
  <LI><A 
  href="http://www-stat.stanford.edu/~susan/courses/s208/node11.html#SECTION00251000000000000000" 
  name=tex2html304>Accuracy of the sample mean</A> 
  <UL>
    <LI><A 
    href="http://www-stat.stanford.edu/~susan/courses/s208/node11.html#SECTION00251100000000000000" 
    name=tex2html305>Mouse example</A> </LI></UL><BR>
  <LI><A 
  href="http://www-stat.stanford.edu/~susan/courses/s208/node11.html#SECTION00252000000000000000" 
  name=tex2html306>The combinatorics of the bootstrap distribution</A> 
  <UL>
    <LI><A 
    href="http://www-stat.stanford.edu/~susan/courses/s208/node11.html#SECTION00252100000000000000" 
    name=tex2html307>How many different bootstrap samples are there?</A> 
    <LI><A 
    href="http://www-stat.stanford.edu/~susan/courses/s208/node11.html#SECTION00252200000000000000" 
    name=tex2html308>Which is the most likely bootstrap sample?</A> 
    <LI><A 
    href="http://www-stat.stanford.edu/~susan/courses/s208/node11.html#SECTION00252300000000000000" 
    name=tex2html309>The <FONT color=#ff0000>multinomial</FONT> distribution</A> 
    </LI></UL></LI></UL><!--End of Table of Child-Links-->
<HR>

<H1><A name=SECTION00250000000000000000>Some notation</A> </H1>From an original 
sample <BR>
<P></P>
<DIV align=center><!-- MATH \begin{displaymath}{\cal X}_n=(X_1,X_2...X_n) \stackrel{iid}{\sim} F\end{displaymath} --><IMG 
height=33 
alt="\begin{displaymath}{\cal X}_n&#10;=(X_1,X_2...X_n) \stackrel{iid}{\sim} F\end{displaymath}" 
src="Some notation.files/img27.png" width=197 border=0> </DIV><BR clear=all>
<P></P>draw a new sample of <IMG height=16 alt=$n$ 
src="Some notation.files/img28.png" width=16 align=bottom border=0> observations 
among the original sample <FONT color=#ff0000>with</FONT> replacement, each 
observation having the same probabilty of being drawn (<IMG height=40 
alt=$=\frac{1}{n}$ src="Some notation.files/img29.png" width=37 align=middle 
border=0>). A bootstrap sample is often denoted <BR>
<P></P>
<DIV align=center><!-- MATH \begin{displaymath}{\cal X}_n^*=X_1^*,X_2^*...X_n^* \stackrel{iid}{\sim} F_n\mbox{ the empirical distribution }\end{displaymath} --><IMG 
height=33 
alt="\begin{displaymath}{\cal X}_n^*&#10;=X_1^*,X_2^*...X_n^* \stackrel{iid}{\sim} F_n&#10;\mbox{ the empirical distribution }\end{displaymath}" 
src="Some notation.files/img30.png" width=408 border=0> </DIV><BR clear=all>
<P></P>
<P>If we are interested in the behaviour of a random variable <!-- MATH $\widehat{\theta}=\theta({\cal X}_n,F)$ --><IMG height=45 
alt="$\widehat{\theta}=\theta({\cal X}_n,F)$" 
src="Some notation.files/img31.png" width=108 align=middle border=0>, then we 
can consider the sequence of <IMG height=16 alt=$B$ 
src="Some notation.files/img32.png" width=20 align=bottom border=0> new values 
obtained through computation of <IMG height=16 alt=$B$ 
src="Some notation.files/img32.png" width=20 align=bottom border=0> new 
bootstrap samples. 
<P>Practically speaking this will need generatation of an integer between 1 and 
n, each of these integers having the same probability. 
<P>Here is an example of a line of <TT>matlab</TT> that does just that: 
<TT>indices=randint(1,n,n)+1; </TT>Or if you have the statistics toolbox, you 
can use: <TT>indices=unidrnd(n,1,n);</TT> 
<P>If we use S we won't need to generate the new observations one by one, the 
following command generates a n-vector with replacement in the vector of indices 
(1...n). 
<P><TT>sample(n,n,replace=T) </TT>
<P>An approximation of the distribution of the estimate <!-- MATH $\widehat{\theta}=\theta({\cal X}_n,F)$ --><IMG height=45 
alt="$\widehat{\theta}=\theta({\cal X}_n,F)$" 
src="Some notation.files/img31.png" width=108 align=middle border=0> is provided 
by the distribution of <BR>
<P></P>
<DIV align=center><!-- MATH \begin{displaymath}\widehat{\theta}^{*b}=\theta({\cal X}_n^{*b},F_n), \  \ b=1..B\end{displaymath} --><IMG 
height=33 
alt="\begin{displaymath}\widehat{\theta}^{*b}=&#10;\theta({\cal X}_n^{*b},F_n),   b=1..B&#10;\end{displaymath}" 
src="Some notation.files/img33.png" width=219 border=0> </DIV><BR clear=all>
<P></P><!-- MATH $G_n^*(t)=P_{F_n}\left(\widehat{\theta}^* \leq t \right)$ --><IMG 
height=47 alt="$G_n^*(t)=P_{F_n}\left(&#10;\widehat{\theta}^* \leq t \right)$" 
src="Some notation.files/img34.png" width=176 align=middle border=0> denotes the 
bootstrap distribution of <!-- MATH $\widehat{\theta}^*$ --><IMG height=21 
alt=$\widehat{\theta}^*$ src="Some notation.files/img35.png" width=21 
align=bottom border=0>, often approximated by <BR>
<P></P>
<DIV align=center><!-- MATH \begin{displaymath}\widehat{G}_n^*(t)=\#\{\widehat{\theta}^*\leq t\}/B\end{displaymath} --><IMG 
height=33 
alt="\begin{displaymath}&#10;\widehat{G}_n^*(t)=&#10;\char93 \{\widehat{\theta}^*&#10;\leq t&#10;\}/B\end{displaymath}" 
src="Some notation.files/img36.png" width=176 border=0> </DIV><BR clear=all>
<P></P>
<P><I><!-- MATH $\fbox{The Bootstrap Algorithm}$ --><IMG height=46 
alt="\fbox{The Bootstrap Algorithm}" src="Some notation.files/img37.png" 
width=225 align=middle border=0> </I>
<P>
<OL>
  <LI>Compute the original estimate from the original data. <!-- MATH $\widehat{\theta}=\theta({\cal X}_n)$ --><IMG height=45 
  alt="$\widehat{\theta}=\theta({\cal X}_n)$" 
  src="Some notation.files/img38.png" width=85 align=middle border=0> 
  <LI>For b=1 to B do : %B is the number of bootstrap samples 
  <OL>
    <LI>Create a resample <IMG height=35 alt="${\cal X}_b^*$" 
    src="Some notation.files/img39.png" width=29 align=middle border=0> 
    <LI>Compute <!-- MATH $\widehat{\theta}^*_b=\theta({\cal X}_b^*)$ --><IMG 
    height=45 alt="$\widehat{\theta}^*_b=\theta({\cal X}_b^*)$" 
    src="Some notation.files/img40.png" width=94 align=middle border=0> </LI></OL>
  <LI>Compare <!-- MATH $\widehat{\theta}^*_b$ --><IMG height=45 
  alt=$\widehat{\theta}^*_b$ src="Some notation.files/img41.png" width=21 
  align=middle border=0> to <!-- MATH $\widehat{\theta}$ --><IMG height=21 
  alt=$\widehat{\theta}$ src="Some notation.files/img42.png" width=14 
  align=bottom border=0>. </LI></OL>
<P>
<H2><A name=SECTION00251000000000000000>Accuracy of the sample mean</A> 
</H2>Using the linearity of the mean and the fact that the sample is iid we have 
<BR>
<P></P>
<DIV align=center><!-- MATH \begin{displaymath}\widehat{se}(\bar{x})= \sqrt{\frac{s^2}{n}}\end{displaymath} --><IMG 
height=55 
alt="\begin{displaymath}&#10;\widehat{se}(\bar{x})= \sqrt{\frac{s^2}{n}}\end{displaymath}" 
src="Some notation.files/img43.png" width=103 border=0> </DIV><BR clear=all>
<P></P>where <IMG height=19 alt=$s^2$ src="Some notation.files/img44.png" 
width=21 align=bottom border=0> is the usual estimate of the variance obtained 
from the sample. 
<P>If we were given <IMG height=16 alt=$B$ src="Some notation.files/img32.png" 
width=20 align=bottom border=0> true samples, and their associated estimates <!-- MATH $\hat{\theta^{*b}}$ --><IMG height=23 alt=$\hat{\theta^{*b}}$ 
src="Some notation.files/img45.png" width=27 align=bottom border=0>, we could 
compute the usual variance estimate for this sample of <IMG height=16 alt=$B$ 
src="Some notation.files/img32.png" width=20 align=bottom border=0> values, 
namely: <BR>
<P></P>
<DIV align=center><!-- MATH \begin{displaymath}\widehat{se}_{boot}(s)=\{ \sum_{b=1}^B[s(\mbox{${\cal X}$}^{*b})-s(\mbox{${\cal X}$}^{*.})]^2/(B-1)\}^{\frac{1}{2}}\end{displaymath} --><IMG 
height=59 
alt="\begin{displaymath}\widehat{se}_{boot}(s)=\{ \sum_{b=1}^B&#10;[s(\mbox{${\cal X}$}^{*b})-s(\mbox{${\cal X}$}^{*.})]^2/(B-1)&#10;\}^{\frac{1}{2}}&#10;\end{displaymath}" 
src="Some notation.files/img46.png" width=357 border=0> </DIV><BR clear=all>
<P></P>where <BR>
<P></P>
<DIV align=center><!-- MATH \begin{displaymath}s(\mbox{${\cal X}$}^{*.})]=\frac{1}{B}\sum_{b=1}^B s(\mbox{${\cal X}$}^{*b})\end{displaymath} --><IMG 
height=59 
alt="\begin{displaymath}s(\mbox{${\cal X}$}^{*.})]=\frac{1}{B}\sum_{b=1}^B s(\mbox{${\cal X}$}^{*b})\end{displaymath}" 
src="Some notation.files/img47.png" width=179 border=0> </DIV><BR clear=all>
<P></P>
<P>
<H3><A name=SECTION00251100000000000000>Mouse example</A> </H3>Here are some 
computations for the mouse data(page 11 of text) <IMG 
src="Some notation.files/Mouse-8sm.jpg" width=200 ,> 
<P>
<TABLE width=300>
  <TBODY>
  <TR>
    <TD><B>Treatment Group</B> <PRE>treat=[94 38 23 197 99 16 141]'
treat =
    94
    38
    23
   197
    99
    16
   141
&gt;&gt; median(treat)         
ans =    94
&gt;&gt; mean(treat)
ans =   86.8571
&gt;&gt; var(treat)
ans =   4.4578e+03

⌨️ 快捷键说明

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