Open padpadpadpad opened 6 years ago
Dear Dan,
I should probably have alerts for github issues, didn't catch this until now.
More than happy for you to do this conversion, it would be great.
nlsLM
which seems to be already much more robust to starting values than nls
. nls2
?As you can see from issues (as a to-do list for myself), likely stepping away from nls towards mle or other likelihood approaches as almost by definition the error is not normally distributed (bounded by 0, often strong upper limits, or strong skews of error distribution at high and low mean values).
Hi Etienne
Thanks for getting back to me. No problem with it being so long, I have not really had the time to work on anything like this anyway. When I have time I will try get all the thermal performance curves into stand alone functions.
Really like the look of the amend_ouput()
function so would definitely retain that possibility. Just need a bit of time and motivation to make it happen.
In answer to your bullet points:
nls_multstart()
uses nlsLM
but does tries multiple start values to try further improve robustness to start valuesnls2
. I developed it without knowing nls2
existed. I have found it to be slightly more robust than nls2
(i.e. it will more easily give reproducible parameter estimates over a large number of curves), but they both do a pretty good job.I have not played much with maximum likelihood but if it allows more flexibility in specifying error distributions that seems like an excellent idea.
I have started experimenting with Bayesian non-linear regression with brms
in R, it does seem to allow the fitting of non-linear mixed effects models much easier.
Cheers Dan
Hi Etienne
Really liked the paper alongside which this R package was published. I recently published an R package, nls.multstart, to fit non-linear regression using
minpack::nlsLM()
that allows multiple start values to make sure you get the best fit across non-linear curves. This guarantees the same parameter estimates as they can be sensitive to the start values due to different local minima.When doing this for thermal responses, I use a function for the thermal response curve. For example, for the Sharpe-Schoofield curve, I use:
And then fit it to data using:
I was wondering whether an approach like nlsMicrobio but for thermal response curves might work here, where the functions are standalone to use in any nls() function rather than being fit within
eq4()
etc.Just wondering if you'd be open to this suggestion instead of me reinventing the wheel in a new package? If you are happy for me to do this I am happy to make in roads to this over the next couple of weeks.
Many thanks Dan