Loess Fit and Resulting Equation

坚强是说给别人听的谎言 提交于 2019-11-26 23:16:24

问题


I'm a developer up in Portland, OR. I'm wondering if anyone can assist:

I'm working on Loess fit models using R, once I have the fit accomplished, I'm looking to back-out the equation of the fitted non-linear curve, wondering if there is a way to determine this equation in R? I've been looking but can't find any literature. For me, the graph of the function is great, but without the equation of the graph, I'm kinda dead in the water.


回答1:


Loess doesn't give you an equation [1]. If you just want to get the values returned by the loess function you use predict(loess.object, new.data)

[1] From wikipedia:

Another disadvantage of LOESS is the fact that it does not produce a regression function that is easily represented by a mathematical formula. This can make it difficult to transfer the results of an analysis to other people. In order to transfer the regression function to another person, they would need the data set and software for LOESS calculations.




回答2:


There is no formula. Loess is a nonparametric method. It can't be expressed as a simple equation.




回答3:


You cannot extract the formula from LOESS itself. However, you could simply run another method on the points found by LOESS. If it's a simple 2D graph then it shouldn't be that hard to find a good formula. One method for doing this is symbolic regression (see wiki).

Be aware that this is probably not optimal and it might be better to simply use another method than LOESS.




回答4:


You want to recover the formula from a loess object? You might be able to do something like this:

> cars.lo <- loess(dist ~ speed, cars)
> formula(unclass(cars.lo)$terms)
dist ~ speed

Edit: Sorry...I think that I misinterpreted what you wanted. There is no simple way to express the loess model in the form of an equation.



来源:https://stackoverflow.com/questions/1785118/loess-fit-and-resulting-equation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!