Skip to content
Prev 8884 / 398502 Next

log(0) problem in max likelihood estimation

You can use the "log" and "lower.tail" options to get around these
numeric difficulties; essentially, "log" returns the log-probability
calculation directly from pnorm().
  You're right that this is a fairly standard problem in maximizing
likelihoods.

py<-function(b,x,...) pnorm((x-b[1])/b[2],log=TRUE,...)
loglike<-function(b) -sum( yes*py(b,x) + no*py(b,x,lower.tail=FALSE))
out<-nlm(loglike,p=c(3,1),hessian=TRUE)
On Tue, 9 Jan 2001, Bill Simpson wrote: