search for: sumtempcc

Displaying 2 results from an estimated 2 matches for "sumtempcc".

2012 Jul 03
2
EM algorithm to find MLE of coeff in mixed effects model
...w} sumXiXi=matrix(rowSums(sapply(data.list,function(s){t(s$Xi)%*%(s$Xi)})),ncol=ncol(Xi)) tempbb=c() for (j in 1:n) { tempbb=cbind(tempbb,Eh2new(data.list[[j]],weights.m=weights.mat)) } beta.new=solve(sumXiXi)%*%rowSums(tempbb) if (ECM==T){beta.old=beta.new} #update psi tempcc=array(NA,c(2,2,n)) sumtempcc=matrix(0,2,2) for (j in 1:n) { tempcc[,,j]=Eh1new(data.list[[j]],weights.m=weights.mat) sumtempcc=sumtempcc+tempcc[,,j] } psi.new=sumtempcc/n #stop if(sum(abs(beta.old-beta.new))+sum(abs(psi.old-psi.new))+sum(abs(var.old-var.new))<0.01) {print("converge, stop");break;} #update var.o...
2012 Jul 03
0
need help EM algorithm to find MLE of coeff in mixed effects model
...} sumXiXi=matrix(rowSums(sapply(data.list,function(s){t(s$Xi)%*%(s$Xi)})),ncol=ncol(Xi)) tempbb=c() for (j in 1:n) { tempbb=cbind(tempbb,Eh2new(data.list[[j]],weights.m=weights.mat)) } beta.new=solve(sumXiXi)%*%rowSums(tempbb) if (ECM==T){beta.old=beta.new} #update psi tempcc=array(NA,c(2,2,n)) sumtempcc=matrix(0,2,2) for (j in 1:n) { tempcc[,,j]=Eh1new(data.list[[j]],weights.m=weights.mat) sumtempcc=sumtempcc+tempcc[,,j] } psi.new=sumtempcc/n #stop if(sum(abs(beta.old-beta.new))+sum(abs(psi.old-psi.new))+sum(abs(var.old-var.new))<0.01) {print("converge, stop");break;} #update var.o...