I am facing a strange issue. Is probably stupid but I don't see it and would appreciate help. Consider the following code
x<-seq(100, 1000, 100)
b<-0.3
y<-x^-b
Now let's suppose I want to fit a model and I use, for illustration purposes the following code
df <- data.frame(x = x, y = y)
nlf <- nls(y~p1*x^-p2 , data = df, start=list(p1=1,p2=1), trace = TRUE)
I get a quick convergence to the right results (as you can check). But I also get an error
5.392604e-33 : 1.0 0.3
5.392604e-33 : 1.0 0.3
5.392604e-33 : 1.0 0.3
Error in nls(y ~ p1 * x^-p2, data = df, start = list(p1 = 1, p2 = 1), :
Iterationenzahl überschritt Maximum 50
Can anyone explain it? Thanks in advance.