R/mugupdate.R

mugupdate <-
function(G,zmat,w,x,p,mug,n){
	for(g in 1:G){
#   zw <- 
#		mug[g,] <- colSums(c(zmat[,g])*c(w[,g])*x)/sum(c(zmat[,g])*c(w[,g]))
    
#		mug[g,] <- colSums(zmat[,g]*w[,g]*x)/sum(zmat[,g]*w[,g])
#	  zw <- zmat[,g]*w[,g]
#	  mug[g,] <- .colSums(zw*as.matrix(x),n,p)/sum(zw)
	  mug[g,] <- .colSums(zmat[,g]*w[,g]*as.matrix(x),n,p)/sum(zmat[,g]*w[,g])
	}
	mug
}

Try the mmtfa package in your browser

Any scripts or data that you put into this service are public.

mmtfa documentation built on May 2, 2019, 1:45 p.m.