Dr. Hackney STA Solutions pg 170

Dr. Hackney STA Solutions pg 170 - {j, 1, nsim}]], {i, 1,...

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

View Full Document Right Arrow Icon
Second Edition 10-13 k*If[x > k, 1, 0]; Psi1[x_, k_] = If[Abs[x] <= k, 1, 0]; num =Table[Psi[w1[[j]][[i]], k1], {j, 1, nsim}, {i, 1,n}]; den =Table[Psi1[w1[[j]][[i]], k1], {j, 1, nsim}, {i, 1,n}]; varnaive = Map[Mean, num^2]/Map[Mean, den]^2; naivestat = Table[Table[m1[[i]][[j]] -theta_0/Sqrt[varnaive[[j]]/n], {j, 1, nsim}],{i, 1, ntheta}]; absnaive = Map[Abs, naivestat]; N[Table[Mean[Table[If[absnaive[[i]][[j]] > 1.645, 1, 0], {j, 1, nsim}]], {i, 1, n\theta}]] Calculation of bootstrap variance and test statistic nboot=20; u:=Random[DiscreteUniformDistribution[n]] databoot=Table[data[[jj]][[u]],{jj,1,nsim},{j,1,nboot},{i,1,n}]; m1boot=Table[Table[a/.mest[k1,databoot[[j]][[jj]]], {jj,1,nboot}],{j,1,nsim}]; varboot = Map[Variance, m1boot]; bootstat = Table[Table[m1[[i]][[j]] -theta_0/Sqrt[varboot[[j]]], {j, 1, nsim}], {i, 1, ntheta}]; absboot = Map[Abs, bootstat]; N[Table[Mean[Table[If[absboot[[i]][[j]] > 1.645, 1,0],
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: {j, 1, nsim}]], {i, 1, ntheta}]]\) Calculation of median test - use the score variance at the root density (normal) med = Map[Median, data]; medsd = 1/(n*2*f1[theta_0]); medstat = Table[Table[med[[j]] + \theta[[i]] - theta_0/medsd, {j, 1, nsim}], {i, 1, ntheta}]; absmed = Map[Abs, medstat]; N[Table[Mean[Table[If[\(absmed[[i]][[j]] > 1.645, 1, 0], {j, 1, nsim}]], {i, 1, ntheta}]] 10 . 41 a. The log likelihood is log L = nr log p + n ¯ x log(1-p ) with d dp log L = nr p-n ¯ x 1-p and d 2 dp 2 log L =-nr p 2-n ¯ x (1-p ) 2 , expected information nr p 2 (1-p ) and (Wilks) score test statistic √ n ± r p-n ¯ x 1-p ² q r p 2 (1-p ) = r n r ³ (1-p ) r + p ¯ x √ 1-p ´ . Since this is approximately n(0 , 1), a 1-α confidence set is µ p : ¶ ¶ ¶ ¶ r n r ³ (1-p ) r-p ¯ x √ 1-p ´¶ ¶ ¶ ¶ ≤ z α/ 2 · ....
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