I know NLS is used to fit nonlinear equations, but I don't understand why it won't work with a simple linear one. I mean, the theory should still hold, right? But, when I try to do something simple like the following, it won't converge.
y = c(1,2,3,4,5);
x = c(5,4,3,2,1);
summary(nls(y ~ A*x + B, start=list(A=-1,B=6)));
I mean, I gave it the actual parameters that A and B should be. Any idea why this won't work? And, if it is in fact because it is linear, does anyone know why that won't work based on theory or how this specific function is written? Sorry for the annoyance, I'm just trying to understand what's going on. Thanks and I appreciate the help!