[R] nls diagnostics?

Gabor Grothendieck ggrothendieck at gmail.com
Mon May 26 04:54:43 CEST 2008


On Sun, May 25, 2008 at 9:32 PM, Katharine Mullen <kate at few.vu.nl> wrote:
> Dear Spencer,
>
> I just saw your post.
>
> If the singular gradient happens during or after iteration one (that is,
> not at the initial estimates), then calling summary on the nls output
> would give standard error estimates on the parameters useful for
> diagnostics.  You could also call chol2inv(xx$m$Rmat())  where xx is the
> object returned by nls to get an estimate of the inverse of the hessian;
> you could use this estimate to proceed with the diagnostics you were
> discussing.

Try this:

> library(nls2)
> DF1 <- data.frame(y=1:9, one=rep(1,9))
> xx <- nls2(y~(a+2*b)*one, DF1, start = c(a=1, b=1), algorithm = "brute-force")
> eigen(chol2inv(xx$m$Rmat()))
$values
[1] 5.070602e+31 0.000000e+00

$vectors
           [,1]       [,2]
[1,] -0.8944272 -0.4472136
[2,]  0.4472136 -0.8944272



More information about the R-help mailing list