Dear R-Helpers, I try to fit my x and y vector-data with a power law using a the following command: test <- nls(y ~ A*x^B, xy, start=list(A=0.5,B=0.8)) and I get the error message: Error in numericDeriv(form[[3]], names(ind), env) : Missing value or an Infinity produced when evaluating the model Does anybody know whats wrong? (it?s probably a simple newbie-error) Thanks in advance Thomas H.
Dear R-helpers, dear Andrew Andrew C. Ward schrieb:>Dear Thomas, > >I wonder if you have any NAs in xy$x or xy$y. >The Dataframe looks like the following: > xy x y 1 3.0 121.50951 2 2.0 30.61258 3 4.0 323.14837 4 8.2 3709.92471 For testing reasons I calculated y by: > y <- 2.9 x^3.4>Also, I think >you could take logs of your equation and end up with a >linear expression? >if I use: plot (x,y) abline lm ( log(y)~log(x),xy) the line does not seem to fit the plotted datapoints at all. While the fitted exponent seems to be okay, the obtained intercept value is wrong. Thanks for your answer. Thomas H.> >