Finding a curve to match data

前端 未结 6 1961
名媛妹妹
名媛妹妹 2020-12-13 22:20

I\'m looking for a non-linear curve fitting routine (probably most likely to be found in R or Python, but I\'m open to other languages) which would take x,y data and fit a c

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 23:02

    Your first model is actually linear in the three parameters and can be fit in R using

     fit <- lm(y ~ x + I(x^2), data=X)
    

    which will get you your three parameters.

    The second model can also be fit using nls() in R with the usual caveats of having to provide starting values etc. The statistical issues in optimization are not necessarily the same as the numerical issues -- you cannot just optimize any functional form no matter which language you choose.

提交回复
热议问题