femiguez / nlraa

Nonlinear Regression for Agricultural Applications
https://femiguez.github.io/nlraa-docs/index.html
22 stars 2 forks source link

nlsLMList lower= and upper= #20

Closed ggrothendieck closed 1 year ago

ggrothendieck commented 1 year ago

Although nlsLMList supports algorithm="port" it does not support lower= and upper= arguments so you still can't use bounds.

femiguez commented 1 year ago

Thanks for the report! I'll fix that shortly

femiguez commented 1 year ago

Thanks again for the feedback. I think this is fixed now.

ggrothendieck commented 1 year ago

There is one other problem. This is a problem in nlsList itself but maybe you want to fix it. Ben Bolker discovered that port ignores the names in lower and upper and just assumes they are in the same order as start. Perhaps you could add an error message if they both have names but the names are not in the same order. Alternately reorder them and issue a warning.

femiguez commented 1 year ago

Thanks again! It looks like minpack.lm::nlsLM also ignores the names, at least for upper and lower. I think the problem would be with nls, because nlsList does not have an 'algorithm', 'lower' or 'upper' arguments.

ggrothendieck commented 1 year ago

See https://bugs.r-project.org/show_bug.cgi?id=18415 Maybe the R core people will fix it?

femiguez commented 1 year ago

Thanks! I attempted a response to the SO question using nlsLMList. As long as the parameters are in the right order, it works. Names are effectively ignored (in the previous version). In my package I chose to throw an error if the named arguments are not in the correct order.