LOESS Regression

This procedure fits the model y = f(x1,...,xk) + e nonparametrically; i.e., without assuming a parametric form for f(x1,...,xk) such as f(x1,...,xk) = b0 + b1x1 + ...+ bkxkHere is a nice expository paper on it.

The method is to use data in a "local neighborhood" of (x1,...,xk) to estimate E(Y) = f(x1,...,xk) via weighted least squares in the local neighborhoods. The weights are chosen relative to distance from the point (x1,...,xk).

The method can be tuned to produces a smoother graph by (i) allowing a larger neighborhood, and (ii) tuning the weight parameters.

Example 1: Car Sales Data

 OPTIONS LS=80;
 DATA lance;
     INPUT MONTH NSOLD PPGGAS INTRATE;
datalines;
1  22.1 1.39 12.1
2  15.4 1.44 12.2
3  11.7 1.45 12.3
4  10.3 1.32 14.2
5  11.4 1.35 15.8
6   7.5 1.28 16.3
7  13.0 1.26 16.5
8  12.8 1.26 14.7
9  14.6 1.25 13.4
10 18.9 1.24 12.9
11 19.3 1.20 11.2
12 30.1 1.20 10.9
13 28.2 1.18 10.3
14 25.6 1.10  9.7
15 37.5 1.11  9.6
16 36.1 1.14  9.1
17 39.8 1.17  7.8
18 44.3 1.18  8.3
;
proc loess;
    model nsold=intrate/details;
run;

 

The data are graphed as follows. I have superimposed the parametric inverse model NSold-hat = b0 + b1(1/IntRate) for comparison.

wpe5.jpg (20715 bytes)

 

Example 2 (From the SAS documentation):

These data show a high degree of nonlinearity. It would be difficult to specify a particular parametric functional form for it.

 

LOESS to the rescue! These graphs show two LOESS fits, where the second one is chosen to be more smooth.