search for: ycen2

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

Did you mean: scen2
2009 May 22
0
EM algorithm mixture of multivariate
...1<-mu01 mu2<-mu02 sd1<-sd01 sd2<-sd02 for (iter in 1:itermax) { #passo E for (i in 1:n) { tau[i,1]<-(alpha*f1[i])/p[i] tau[i,2]<-((1-alpha)*f2[i])/p[i] } #passo M alpha= mean(tau[,1]) mu1=colSums(tau[,1]*y)/sum(tau[,1]) mu2=colSums(tau[,2]*y)/sum(tau[,2]) ycen1<-(y-mu1) ycen2<-(y-mu2) cov1<-matrix(0,2,2) cov2<-matrix(0,2,2) for (i in 1:n){ cov1<-cov1+ (tau[i,1]*(ycen1[i,])%*%t(ycen1[i,])) cov2<-cov2+ (tau[i,2]*(ycen2[i,])%*%t(ycen2[i,])) } # w1<-sqrt(tau[,1]) # w2<-sqrt(tau[,2]) # ywei1<-w1*ycen1 # ywei2<-w2*ycen2 sd1<-cov1/sum(tau[,1])...
2009 May 22
0
EM algorithm mixture of multivariate gaussian
...1<-mu01 mu2<-mu02 sd1<-sd01 sd2<-sd02 for (iter in 1:itermax) { #passo E for (i in 1:n) { tau[i,1]<-(alpha*f1[i])/p[i] tau[i,2]<-((1-alpha)*f2[i])/p[i] } #passo M alpha= mean(tau[,1]) mu1=colSums(tau[,1]*y)/sum(tau[,1]) mu2=colSums(tau[,2]*y)/sum(tau[,2]) ycen1<-(y-mu1) ycen2<-(y-mu2) cov1<-matrix(0,2,2) cov2<-matrix(0,2,2) for (i in 1:n){ cov1<-cov1+ (tau[i,1]*(ycen1[i,])%*%t(ycen1[i,])) cov2<-cov2+ (tau[i,2]*(ycen2[i,])%*%t(ycen2[i,])) } # w1<-sqrt(tau[,1]) # w2<-sqrt(tau[,2]) # ywei1<-w1*ycen1 # ywei2<-w2*ycen2 sd1<-cov1/sum(tau[,1])...