[18844] in s-news-athena
RE: [S] nls() fails in a loop
daemon@ATHENA.MIT.EDU (Venables, Bill (CMIS, Cleveland))
Wed Aug 4 03:48:36 1999
Message-Id: <D16979FB73F3D11195510000F8030FB91058F0@roper.qld.cmis.csiro.au>
From: "Venables, Bill (CMIS, Cleveland)" <Bill.Venables@cmis.CSIRO.AU>
To: "'ROS Mathieu'" <mim78@cict.fr>
Cc: s-news@wubios.wustl.edu
Date: Wed, 4 Aug 1999 17:39:19 +1000
Mime-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
> -----Original Message-----
> From: ROS Mathieu [mailto:mim78@cict.fr]
> Sent: Wednesday, August 04, 1999 5:14 PM
> To: s-news@wubios.wustl.edu
> Subject: [S] nls() fails in a loop
>
>
>
> hello Splus users,
> I'm using nls() in a cross-validation loop (no way to avoid
> it now...)
> with 180 iterations but with my initial values
> (start(a=-50,b=10,c=-0,009)) it stops after some iterations
You probably meant to type c=-0.009. Did you type c=-0,009?
(Using `c' as a parameter name is often not a good idea as it can clash with
a function name, but this is not your problem here.)
> with a 'step factor reduced below minimum' error.
> How can I handle this problem without entering new starting
> points at each step ?
You cannot automate a solution with complete certainty, as with non-linear
regression a solution may not even exist for some subsets of the data.
There are a couple of things you might do to reduce the size of the problem,
though.
1. Don't begin every cv fit with the original rough initial values. Always
use the best available initial values you have, for example, from the
primary fit using all the data.
2. Learn how to use algorithm="plinear" and do so as often as possible. In
extremis you may even want to supply first derivatives for the non-linear
parameters, though this is *really* tedious to get right and hardly ever
necessary. In my experience the "plinear" algorithm usually works pretty
well on its own (but if you don't have any linear parameters, of course, you
don't have this option).
3. As an absolute last resort, and with great care and attention, cautiously
approach the restart() function. It is designed to step over failing
calculations in exactly this sort of context, but it is not for the faint
hearted. You can do a lot of damage with this one...
> any help will be appreciated
>
> Mathieu
>
> ----------------------------------------------------------------
> Mathieu Ros
> mathieuros@bigfoot.com
> DESS ingenierie mathematique (biostatistiques)
> Universite Joseph Fourier, Grenoble
> ----------------------------------------------------------------
> La prevision est difficile, surtout quand elle concerne l'avenir
>
> --------------------------------------------------------------
> ---------
> This message was distributed by s-news@wubios.wustl.edu. To
> unsubscribe
> send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
> message: unsubscribe s-news
>
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news