[R] nls.control( ) has no influence on nls( ) !

Joerg van den Hoff j.van_den_hoff at fzd.de
Mon Apr 16 11:15:23 CEST 2007

On Mon, Apr 16, 2007 at 09:03:27AM +0200, Martin Maechler wrote:
> >>>>> "Yuchen" == Yuchen Luo <realityrandom at gmail.com>
> >>>>>     on Sun, 15 Apr 2007 12:18:23 -0700 writes:
>     Yuchen> Dear Friends.
>     Yuchen> I tried to use nls.control() to change the 'minFactor' in nls( ), but it
>     Yuchen> does not seem to work.
> yes, you do not seem to use it correctly.
> No reason to jump to the conclusion that you give in the subject
> of this posting ... which is hilariously wrong!
> You don't really think that a quality software like R has had nls()
> and nls.control(), and nls.control() would never have worked for all
> those years and tens of thousands of users ???
> Please get to your senses, and first read the posting guide (*)
> - and then try again, so we can help you further!
> Regards,
> Martin Maechler, ETH Zurich
>     Yuchen> I used nls( ) function and encountered error message "step factor
>     Yuchen> 0.000488281 reduced below 'minFactor' of 0.000976563". I then tried the
>     Yuchen> following:
>     Yuchen> 1) Put "nls.control(minFactor = 1/(4096*128))" inside the brackets of nls,
>     Yuchen> but the same error message shows up.
>     Yuchen> 2) Put "nls.control(minFactor = 1/(4096*128))" as a separate command before
>     Yuchen> the command that use nls( ) function, again, the same thing happens,
>     Yuchen> although the R responds to the nls.control( ) function immediately:

you need to provide a list for the `control' argument of `nls',  i.e. you need
to use something like:

nls(other_arguments, control = nls.control(minFactor = 1/4096))

nls.control() only helps in so far, as that it always returns the complete list
of three components needed for the `control' argument of `nls'. you can equally
well use an explicit list instead.

>     Yuchen> ---------------------------------
>     Yuchen> $maxiter
>     Yuchen> [1] 50
>     Yuchen> $tol
>     Yuchen> [1] 1e-05
>     Yuchen> $minFactor
>     Yuchen> [1] 1.907349e-06
>     Yuchen> --------------------------------------
>     Yuchen> I am wondering how may I change the minFactor to a smaller value? The manual
>     Yuchen> that comes with the R software about nls( )  is very sketchy --- the only
>     Yuchen> relevant example I see is a separate command like 2).
>     Yuchen> A more relevent question might be, is lower the 'minFactor'  the only
>     Yuchen> solution to the problem? What are the other options?

check your model?
check your data?
change start values ("wrong" minimum)?
use another algorithm (cf. nls manpage)?

>     Yuchen> Best Wishes
>     Yuchen> Yuchen Luo

a final remark (off-topic?), concerning the response of m. maechler (but I
notice this attitude continously on the list): this is supposed to be a help
list, neither a boot camp nor a thought-police school, right?. 
concerning the question at hand, the one word response


would have been justifiable (it usually _is_ in the manpage), if not overly
helpful, probably. but the actual response is worded such that --
would it be directed at me -- I would judge it simply offensive: "get to your
senses" is not what one should be told, simply because ond did not grasp how to
use the `control' argument and/or because in the subject (contrary to the body) of
the mail 'has no influence' is used instead of `seems to have no influence'.

I really do think that if someone deems a certain question really stupid, it
would be wise simply to keep 'radio silence' (i.e. ignore it), which probably
is the best corrective anyway. the 'how dare you' responses are annoying, to
say the least.

for heavens sake...

More information about the R-help mailing list