# fitting an exponential function using least squares vs. generalized linear model vs. nonlinear least squares

I have a data set that represents exponential decay. I would like to fit an exponential function $y = Be^{ax}$ to this data. I've tried log transforming the response variable and then using least squares to fit a line; using a generalized linear model with a log link function and a gamma distribution around the response variable; and using nonlinear least squares. I get a different answer for my two coefficients with each method, although they are all similar. Where I have confusion is I'm not sure which method is the best to use and why. Can someone please compare and contrast these methods? Thank you.

• Given that you have equal degrees of freedom, and these are all within the classes of GLMs, I would use the model with the highest likelihood. – probabilityislogic Mar 13 '13 at 12:20