nls2 treats vectored initial values as single elements, unlike nls
问题 I noticed that I can fit parameter vector, as below, using nls . This let's me decide the number of parameters I want to fit. As in the example below; where I am fitting y = k + a_1 x^2 + a_2 x^3 + a_3 x^3 . I can simply change the number of initial values, which change the number of co-efficients to estimate. But, this approach doesn't work with nls2 . It just treats fits the y = k + a_1 * x , three times! My questions is how to get nls2 to determine the number of parameters to fit based on