Dr. Hackney STA Solutions pg 195

Dr. Hackney STA Solutions pg 195 -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Second Edition 12-5 12 . 29 The argument for the median is a special case of Example 12 . 4 . 3, where we take x i = 1 so σ 2 x = 1. The asymptotic distribution is given in (12 . 4 . 5) which, for σ 2 x = 1, agrees with Example 10 . 2 . 3. 12 . 31 The LAD estimates, from Example 12 . 4 . 2 are ˜ α = 18 . 59 and ˜ β = - . 89. Here is Mathematica code to bootstrap the standard deviations. (Mathematica is probably not the best choice here, as it is somewhat slow. Also, the minimization seemed a bit delicate, and worked better when done iteratively.) Sad is the sum of the absolute deviations, which is minimized iteratively in bmin and amin. The residuals are bootstrapped by generating random indices u from the discrete uniform distribution on the integers 1 to 23. 1 . First enter data and initialize Needs["Statistics‘Master‘"] Clear[a,b,r,u] a0=18.59;b0=-.89;aboot=a0;bboot=b0; y0={1,1.2,1.1,1.4,2.3,1.7,1.7,2.4,2.1,2.1,1.2,2.3,1.9,2.4,
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2.6,2.9,4,3.3,3,3.4,2.9,1.9,3.9}; x0={20,19.6,19.6,19.4,18.4,19,19,18.3,18.2,18.6,19.2,18.2, 18.7,18.5,18,17.4,16.5,17.2,17.3,17.8,17.3,18.4,16.9}; model=a0+b0*x0; r=y0-model; u:=Random[DiscreteUniformDistribution[23]] Sad[a_,b_]:=Mean[Abs[model+rstar-(a+b*x0)]] bmin[a_]:=FindMinimum[Sad[a,b],{b,{.5,1.5}}] amin:=FindMinimum[Sad[a,b/.bmin[a][[2]]],{a,{16,19}}] 2 . Here is the actual bootstrap. The vectors aboot and bboot contain the bootstrapped values. B=500; Do[ rstar=Table[r[[u]],{i,1,23}]; astar=a/.amin[[2]]; bstar=b/.bmin[astar][[2]]; aboot=Flatten[{aboot,astar}]; bboot=Flatten[{bboot,bstar}], {i,1,B}] 3 . Summary Statistics Mean[aboot] StandardDeviation[aboot] Mean[bboot] StandardDeviation[bboot] 4 . The results are Intercept: Mean 18 . 66, SD . 923 Slope: Mean-. 893, SD . 050....
View Full Document

This note was uploaded on 02/03/2012 for the course STA 1014 taught by Professor Dr.hackney during the Spring '12 term at UNF.

Ask a homework question - tutors are online