Dr. Hackney STA Solutions pg 190

Dr. Hackney STA Solutions pg 190 - 11-18 Solutions Manual...

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 11-18 Solutions Manual for Statistical Inference 2 which is the usual bivariate normal likelihood except that we replace Sxx with Sxx + 0 . So the MLEs are the usual ones, and the EM iterations are x(t+1) n X ^ X ^ (t+1) = X + (t) ^ = x(t) = = (t) X Y (t) (t) (yn - y ) 2(t+1) (t+1) ^ Sxx + (1 - 2(t) )^X ^ n (t) Sxy (t) (t) 2(t) . 2(t+1) (Sxx + (1 - 2(t) )^X ^ Here is R code for the EM algorithm: )Syy nsim<-20; xdata0<-c(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) ydata0<-(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,2.6, 2.9,4,3.3,3,3.4,2.9,1.9,3.9,4.2) nx<-length(xdata0); ny<-length(ydata0); #initial values from mles on the observed data# xmean<-18.24167;xvar<-0.9597797;ymean<-2.370833;yvar<- 0.8312327; rho<- -0.9700159; for (j in 1:nsim) { #This is the augmented x (O2) data# xdata<-c(xdata0,xmean+rho*(4.2-ymean)/(sqrt(xvar*yvar))) xmean<-mean(xdata); Sxx<-(ny-1)*var(xdata)+(1-rho^2)*xvar xvar<-Sxx/ny rho<-cor(xdata,ydata0)*sqrt((ny-1)*var(xdata)/Sxx) } The algorithm converges very quickly. The MLEs are X = 18.24, ^ Y = 2.37, ^ X = .969, ^2 Y = .831, ^2 = -0.969. ^ ...
View Full Document

Ask a homework question - tutors are online