Questions tagged [loess]

LOESS (or LOWESS) stands for locally weighted scatterplot smoothing. It is a form of local (k-nearest neighbor) kernel regression

LOESS (or LOWESS) stands for locally weighted scatterplot smoothing.

It is a form of nonparametric regression (nonparametric in the sense of having an unspecified smooth form of underlying relationship between x and y, not the sense of being distribution-free). Specifically, it uses local (k-nearest neighbor) polynomial- (usually linear-) kernel regression. It also implements a robustness step where large outliers are downweighted.

Both terms were coined by Bill Cleveland, who developed them in the late 70s and into the 1980s; LOWESS is the older term, but LOWESS and LOESS are very similar and could be thought of as two implementations of the same concept.

Use this tag for questions relating to both LOESS and LOWESS.

Reference: Wikipedia Local regression

97 questions
41
votes
2 answers

Difference between LOESS and LOWESS

What is the difference between LOESS (locally estimated scatterplot smoothing) and LOWESS (locally weighted scatterplot smoothing)? From Wikipedia I can only see that LOESS is a generalization of LOWESS. Do they have slightly different parameters?
pir
  • 4,626
  • 10
  • 38
  • 73
31
votes
2 answers

Comparing smoothing splines vs loess for smoothing?

I wish to better understand the pros/cons for using either loess or a smoothing splines for smoothing some curve. Another variation of my question is if there is a way to construct a smoothing spline in a way that will yield the same results as…
Tal Galili
  • 19,935
  • 32
  • 133
  • 195
31
votes
7 answers

How do I decide what span to use in LOESS regression in R?

I am running LOESS regression models in R, and I want to compare the outputs of 12 different models with varying sample sizes. I can describe the actual models in more details if it helps with answering the question. Here are the sample sizes:…
Think Blue Crew
23
votes
1 answer

Explanation of what Nate Silver said about loess

In a question I asked recently, I was told that it was a big "no-no" to extrapolate with loess. But, in Nate Silver's most recent article on FiveThirtyEight.com he discussed using loess for making election predictions. He was discussing the…
a.powell
  • 1,047
  • 7
  • 19
19
votes
2 answers

If variable kernel widths are often good for kernel regression, why are they generally not good for kernel density estimation?

This question is prompted by discussion elsewhere. Variable kernels are often used in local regression. For example, loess is widely used and works well as a regression smoother, and is based on a kernel of variable width that adapts to data…
Rob Hyndman
  • 51,928
  • 23
  • 126
  • 178
18
votes
1 answer

How to calculate prediction intervals for LOESS?

I have some data that I fitted using a LOESS model in R, giving me this: The data has one predictor and one response, and it is heteroscedastic. I also added confidence intervals. The problem is that the intervals are confidence intervals for the…
Gimelist
  • 579
  • 6
  • 17
17
votes
1 answer

How to get an R-squared for a loess fit?

How to calculate R-squared ($r^2$) statistic in R for loess and/or predict function output? For example for this data: cars.lo <- loess(dist ~ speed, cars) cars.lp <- predict(cars.lo, data.frame(speed = seq(5, 30, 1)), se = TRUE) cars.lp has two…
Yuriy Petrovskiy
  • 4,081
  • 7
  • 25
  • 30
16
votes
6 answers

Finding inflection points in R from smoothed data

I have some data that I smooth using loess. I'd like to find the inflection points of the smoothed line. Is this possible? I'm sure someone has made a fancy method to solve this...I mean...after all, it's R! I'm fine with changing the smoothing…
user164846
  • 395
  • 2
  • 4
  • 9
15
votes
4 answers

LOESS that allows discontinuities

Is there a modelling technique like LOESS that allows for zero, one, or more discontinuities, where the timing of the discontinuities are not known apriori? If a technique exists, is there an existing implementation in R?
Jeromy Anglim
  • 42,044
  • 23
  • 146
  • 250
15
votes
1 answer

GAM vs LOESS vs splines

Context: I want to draw a line in a scatterplot that doesn't appear parametric, therefore I am using geom_smooth() in ggplot in R. It automatically returns geom_smooth: method="auto" and size of largest group is >=1000, so using gam with formula: y…
12
votes
2 answers

Why is stl function giving significant seasonal variation with random data

I plotted with following code with stl (Seasonal Decomposition of Time Series by Loess) function: plot(stl(ts(rnorm(144), frequency=12), s.window="periodic")) It shows signficant seasonal variation with random data put in code above (rnorm…
rnso
  • 8,893
  • 14
  • 50
  • 94
12
votes
1 answer

How do I find a p-value of smooth spline / loess regression?

I have some variables and I am interested to find non-linear relationships between them. So I decided to fit some spline or loess, and print nice plots (see the code below). But, I also want to have some statistics that gives me an idea how much…
Tomas
  • 5,735
  • 11
  • 52
  • 93
10
votes
2 answers

Statistics on LOESS smoothing

I'm trying to make sense of a data set which contains thousands of independent measurements of intensity in the form of a scatterplot. These measurements are dependent on two major variables: treatment and genotype, so I represented them on a grid.…
bc_
  • 101
  • 3
9
votes
2 answers

Why so much difference in SE areas in these graphs

I am using ggplot with Python for showing regression/correlation. With method='lm' (means "linear model"), I get following graph: And with method='loess', I get following: The width of SE area is much wider with loess method than with lm method.…
rnso
  • 8,893
  • 14
  • 50
  • 94
8
votes
3 answers

Trend or no trend?

I have a quarterly time series and test for stationarity with an augmented Dickey-Fuller test using R. adf.test(myseries) # returns # Dickey-Fuller = -3.9828, Lag order = 4, p-value = 0.01272 # alternative hypothesis: stationary so the H0 is…
hans0l0
  • 2,065
  • 4
  • 25
  • 31
1
2 3 4 5 6 7