-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in nls_multstart(speed ~ sharpeschoolhigh_1981(temp = temperature, : There must be as many parameter starting bounds as there are parameters #17
Comments
Hi Alann Sorry I have only just seen this, was on holiday last week. The issue will come from you having Why are you using Cheers |
Hi Dan, Thank you very much for the reply, appreciate it. First I check if I had I also checked if i had NA for the I changed the In any case, I am also happy to share part of the code and data to reproduce the error Thanks again for the response |
Happy to have a look at the code if you send them across. Feel free to email them if you do not want them publicly available yet. Cheers |
@AlannRath : another possibiliity is that you could have a column in your data (or environment if you're not using the data argument) with the same name as one of the parameters that you're estimating? The model figures out how many parameters you want to estimate based on what it doesn't find available to it. Actually, @padpadpadpad , I run into this problem reasonably often, and I usually solve it by going debugging to figure out how many models the model is estimating, and compare that to how many I have in the lower and upper. Do you reckon it's worthwhile making a more informative error message here, where we state which parameters the model is considering as known, and which it thinks it's estimating, compared to how many parameters are in the upper and lower vectors? It would be a bit of a chunky error message, but it would certainly make these issues quicker and easier to debug... If you think this sounds reasonable, I can give it a try sometime in the coming week or two... Cheers, |
Yea that does sound useful. This is probably something I used to do all the time too. It feels relatively simple to do a check early on in the function call comparing columns/the environment to those in the formula/lower and upper vectors. Could put a check at an early part of nls_multstart when we are setting things up. |
Hey everyone, (first post here 馃槂 )
I have been running the same script once or twice already but this time, for some reason it does not work.
I have a very simple dataset with the speed of individuals at different temperature and I want to draw and fit a thermal response curve following the sharpe-Schoolfield model
`start_vals <- get_start_vals(speed$temp, speed$medianSpeed, model_name = 'sharpeschoolhigh_1981')
low_lims <- get_lower_lims(speed$temp, speed$medianSpeed, model_name = 'sharpeschoolhigh_1981')
upper_lims <- get_upper_lims(speed$temp, speed$medianSpeed, model_name = 'sharpeschoolhigh_1981')`
So this step works fine, but then I do:
fit <- nls_multstart(speed~sharpeschoolhigh_1981(temp = temperature, r_tref,e,eh,th, tref = 15), data = speed, iter = 500, start_lower = start_vals - 10, start_upper = start_vals + 10, lower = low_lims, upper = upper_lims, supp_errors = 'Y')
As simple as that. However, I still have the issue
Error in nls_multstart(speed ~ sharpeschoolhigh_1981(temp = temperature, : There must be as many parameter starting bounds as there are parameters
I tried to look at my start_vals vector and I got NA for 'eh'. I don't know if there is any issue related to that.
Any help would be more than welcome,
Thanks
Alann
The text was updated successfully, but these errors were encountered: