views:

347

answers:

3

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  A: 

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.

Shane
Thanks, I check into that and see if it works out!
christian miner
+1  A: 

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.

Michael Dunn
correct, it doesn't give you a mathematical formula, but it gives you a graph. I want to find a formula for the graph given.
christian miner
You can't. Loess uses an iterative local approach and is data-driven, see the reference papers for details.
Dirk Eddelbuettel
+2  A: 

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

Rob Hyndman