Skip to content
Prev 383127 / 398502 Next

nls problem

Roundoff/cancelation error: compare the following.  The first is equivalent
to your function, the last to fitted().
[,1]      [,2]       [,3]         [,4]       [,5]       [,6]
    [,7]       [,8]       [,9]     [,10]
[1,] -0.01635965 0.1076024 0.07477337 -0.007166685 -0.1337865 -0.2851877
-0.4804638 -0.6865135 -0.9870137 -1.398027
[,1]        [,2]       [,3]       [,4]       [,5]       [,6]
  [,7]      [,8]      [,9]     [,10]
[1,] -0.2196286 -0.09864071 -0.1345213 -0.2180792 -0.3463237 -0.4991861
-0.6959856 -0.903394 -1.205598 -1.618608
[,1]        [,2]       [,3]       [,4]       [,5]      [,6]
 [,7]       [,8]      [,9]     [,10]
[1,] -0.2208705 -0.09989926 -0.1357969 -0.2193638 -0.3476174 -0.500488
-0.697296 -0.9047119 -1.206926 -1.619947

Note that your model is linear and could be fitted with
   lm(data=aedf, Flux ~ pH + I(pH^2))
   lm(data=aedf, Flux ~ poly(pH, 2))
The latter uses a more stable parameterization.

Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Apr 2, 2020 at 4:15 AM Troels Ring <tring at gvdnet.dk> wrote: