Extraction of established terms in local polynomial loess function (in R) (does NOT predict ())

How can I extract what parameters the loess function applied for the polynomial function being used, for a specific x of my data?

For example, in:

 cars.lo <- loess(dist ~ speed, cars)
 cars.lo

      

That it comes in handy when cars.lo $ x == 5?

Update : I want the parameters of the polynomial function, not the prediction (prediction) of the loess.

I ask him to get an estimate of the slope at this point.

Thanks, Tal

+2


a source to share


3 answers


I would calculate the predicted values ​​in x, x + eps, x-eps and then put in the quadratic result. It's not very efficient in computer time, but if you don't need to do it very often, it is very efficient during programming.



+2


a source


I would say



predict(cars.lo, data.frame(speed=5))
[1] 7.797353

      

+1


a source


I think that you will be on your own. I would start by reading the references in lowess

and then read the source for the C function lowess

. I recommend starting there instead loess

, because it is an older and slightly simpler algorithm that may be easier to adapt to your needs.

0


a source







All Articles