search for: sigb

Displaying 3 results from an estimated 3 matches for "sigb".

Did you mean: sig
2008 Nov 19
1
mle2 simple question - sigma?
...regression library(bbmle) RegData<-data.frame(c(0.3,0.9,0.6),c(1.7,1.1,1.5)) names(RegData)<-c("x", "y") linregfun = function(a,b,sigma) { Y.pred = a+b*x -sum(dnorm(y,mean=Y.pred,sd=sigma,log=TRUE)) } SigA<-mle2(linregfun, start=list(a=0.5, b=2), data=RegData) #Or SigB<-mle2(y~dnorm(mean=a+b*x,sd=sigma),start=list(a=0.5, b=2), data=RegData) I get: #Messages #SigA>>Error in dnorm(y, mean = Y.pred, sd = sigma, log = TRUE) : # element 3 is empty; # the part of the args list of '.Internal' being evaluated was: # (x, mean, sd, log) #SigB>>...
2012 Jul 03
2
EM algorithm to find MLE of coeff in mixed effects model
...gth(data.list.wob)) { truelog=truelog+loglike(data.list.wob[[i]],vvar,beta,psi) } truelog loglikeseq=c() loglikeseq[1]=sum(sapply(data.list.wob,loglike)) ECM=F for (m in 1:300) { Sig.hat=Zi%*%psi.old%*%t(Zi)+var.old*diag(nrow(Zi)) W.hat=psi.old-psi.old%*%t(Zi)%*%solve(Sig.hat)%*%Zi%*%psi.old Sigb=psi.old-psi.old%*%t(Zi)%*%solve(Sig.hat)%*%Zi%*%psi.old det(Sigb)^(-0.5) Y.minus.X.beta=t(t(y.m)-c(Xi%*%beta.old)) miu.m=t(apply(Y.minus.X.beta,MARGIN=1,function(s,B=psi.old%*%t(Zi)%*%solve(Sig.hat)) { B%*%s } )) ### each row is the miu_i tmp1=permutations(length(gausspar$no...
2012 Jul 03
0
need help EM algorithm to find MLE of coeff in mixed effects model
...gth(data.list.wob)) { truelog=truelog+loglike(data.list.wob[[i]],vvar,beta,psi) } truelog loglikeseq=c() loglikeseq[1]=sum(sapply(data.list.wob,loglike)) ECM=F for (m in 1:300) { Sig.hat=Zi%*%psi.old%*%t(Zi)+var.old*diag(nrow(Zi)) W.hat=psi.old-psi.old%*%t(Zi)%*%solve(Sig.hat)%*%Zi%*%psi.old Sigb=psi.old-psi.old%*%t(Zi)%*%solve(Sig.hat)%*%Zi%*%psi.old det(Sigb)^(-0.5) Y.minus.X.beta=t(t(y.m)-c(Xi%*%beta.old)) miu.m=t(apply(Y.minus.X.beta,MARGIN=1,function(s,B=psi.old%*%t(Zi)%*%solve(Sig.hat)) {...