search for: dipr

Displaying 1 result from an estimated 1 matches for "dipr".

Did you mean: dipl
2002 Oct 02
0
Alternative to slow double for() loop
...peed things up. The program looks like this: for (j in 1:m) { for (i in 1:n) { times<-comp.list[[j]][which(comp.list[[j]]$V1==i),] T<-ncol(times) Y<-times$V2 Y<-data.matrix(Y) cova<-subset(times, select=V3:V16) cova<-data.matrix(cova) pr<-exp(cova%*%beta)/(1+exp(cova%*%beta)) dipr<-diag(c(pr[1,1], pr[2,1])) dipr1<-dipr-(pr%*%t(pr)) A<-diag(c(dipr1[1,1],dipr1[2,2])) D<-t(cova)%*%A V<-A u1<-D%*%solve(V)%*%(Y-pr) u<-u+u1 usq<-usq+(u1%*%t(u1)) dvd<-dvd+D%*%solve(V)%*%t(D) u.list[[j]]<-u usq.list[[j]]<-usq dvd.list[[j]]<-dvd }} where j are a n...