bug in logLik.nls (PR#2295)

bates@stat.wisc.edu bates@stat.wisc.edu
Fri, 15 Nov 2002 19:18:18 +0100 (MET)


lutz@stat.math.ethz.ch writes:

> logLik.nls does not count the df's correct. I get df=1 although I
> fit a probit-model with 3 parameters.
> 
> Example:
> x <- c(-2.3, -2.0, -1.3, -1.0, -0.7, -0.3, 0.0, 0.3)
> y <- c(80, 80, 54, 43, 24, 18, 12, 12)
> 
> fit.nls <- nls(y ~ diff * pnorm(beta * (x - alpha)),
>                    start=c(alpha=-1, beta=-1, diff=100))
> 
> logLik.nls(fit.nls)
> # `log Lik.' -21.43369 (df=1)

You are correct.  Thanks for the report.  Fix now committed.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._