How does stats::loess treat boundary points?

Dear community,

For each point in a vector, the LOESS smoothing method fits a 0th/1st/2nd degree polynomial through that point and its alpha nearest neighbours. However, it is not easily documented what the function stats::loess does with points at the start and end of a vector: does it simply include fewer points in the polynomial fit? Does it still include alpha points, but no longer symmetrically distributed around the point of interest (my vector is evenly spaced)? Does it "mirror" the points, like the savgol filter in scipy can do?

This post pointed me to the source-code of the stats::loess function and the underlying fortran code but I'm at a loss how to extract the answer to my question from there.

Any help would be greatly appreciated!

It does not mirror the time series at the end, you can see this by the fact that the confidence intervals tend to get wide at the ends. I'm pretty sure the window stays the same size at the ends so that it just includes fewer points (since there are no points on one side).

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.