When to choose nls() over loess()?

前端 未结 2 1952
没有蜡笔的小新
没有蜡笔的小新 2020-12-30 08:50

If I have some (x,y) data, I can easily draw straight-line through it, e.g.

f=glm(y~x)
plot(x,y)
lines(x,f$fitted.values)

But for curvy dat

2条回答
  •  醉梦人生
    2020-12-30 09:12

    loess() is non-parametric, meaning you don't get a set of coefficients you can use later - it's not a model, just a fit line. nls() will give you coefficients you could use to build an equation and predict values with a different but similar data set - you can create a model with nls().

提交回复
热议问题