10182

# How Loess Works

Loess (or lowess, Locally Weighted Scatterplot Smoothing) is a scatterplot smoother, which provides a flexible method for nonparametric regression.
Elements in the graphic:
• blue points: data points under the smoother
• black points: data points not under the smoother
• black curve: the loess smoother
• dark red dot: the loess fit at the current position
• dark red line or curve: the loess curve with parameters fixed at those corresponding to the red dot
• purple bars: window shape and the corresponding loess weights, with scale indicated on the right axis
Controls:
, the position at which the point on the loess curve is calculated. As you slide , notice how the window width changes. The number of points in the window, whose positions are indicated by the green bars, remains constant.
, the fraction of data under the smoother. As increases, the window width increases and more smoothing is done.
indicates the degree of the local polynomial.

### DETAILS

Given bivariate observations , , the basic model that can be fitted may be written as
, ,
where and is a local polynomial of degree , which may be written as
.
The parameters are estimated by weighted least squares for each value of . The weight function weights the data, , so that data values near to have greater weight than those farther away from . Following [1], we use the tricube weight function,
with to define the local neighborhood weights for the data at the point .
Here and controls the amount of smoothing (larger values of result in more smoothing). As , for each , and the local linear model reduces to the standard parametric polynomial regression. For , is the distance to the nearest neighbor, where ( is the integer part function). Hence, , where denotes the largest value of , . For , . It follows that as , the local linear model reduces to a parametric polynomial regression of degree .
In practice we work with local constant loess, ; local linear, , or local quadratic, .
[1] W. S. Cleveland, Visualizing Data, New Jersey: Summit, 1993.

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

#### Related Topics

 RELATED RESOURCES
 The #1 tool for creating Demonstrations and anything technical. Explore anything with the first computational knowledge engine. The web's most extensive mathematics resource. An app for every course—right in the palm of your hand. Read our views on math,science, and technology. The format that makes Demonstrations (and any information) easy to share and interact with. Programs & resources for educators, schools & students. Join the initiative for modernizing math education. Walk through homework problems one step at a time, with hints to help along the way. Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet. Knowledge-based programming for everyone.