Skip to content
Prev 8829 / 398502 Next

log(0) problem in max likelihood estimation

On Tue, 9 Jan 2001, Bill Simpson wrote:

            
Calculate your log-likelihood correctly!   0*log(0) is 0, not NaN.
It is an example of good S programming on page 94 of V&R3.

More generally, I think you should be using the full 5-arg form of pnorm,
since

pnorm(x, 3, 1, FALSE, TRUE)

is a lot more accurate than your calculation.