Nonlinear least squares fit

165 Views Asked by At

enter image description here

I'm trying to find a least squares fit for the data above. When I plotted the data, I got enter image description here

Which doesn't look very linear. Any tips for how to go about finding a least squares fit for this data? I can't seem to find any nice formulas online, like the ones that exist for linear least squares fit.

1

There are 1 best solutions below

0
On

Agree with @Moo's comment. Note that the linearity in linear least squares is w.r.t the parameters and not the variables. As such, you can fit plenty non linear models with it. Specifically your data looks pretty linear in $x$ as well. So I would go with maximum second order polynomial fit, i.e., $$ y=\beta_0+\beta_1x+\beta_2x^2+\epsilon. $$ If you don't have a good theoretical reason to use non-linear fit, I would not bother to use it.