### Basic Examples

Basic Examples

In[]:=

Loess is useful when data is noisy but has an underlying trend:

data=Table[{i,Sin[i]+RandomReal[0.3]},{i,0,2π,0.05}];ListPlot[data]

In[]:=

Out[]=

Find an estimated value for the data at x=2 using the nearest 12 data points:

[data,12,2]

In[]:=

1.05451

Out[]=

Find an estimated value for the data at x=2 using the nearest 10% of the data:

[data,Scaled[0.10],2]

In[]:=

1.04627

Out[]=

ListPlotTablex,

[data,40,x],{x,0,2π,0.2}

In[]:=

Out[]=

### Scope

Scope

In[]:=

Loess can handle higher dimensional data:

data=Flatten[Table[{i,j,Sin[i+Sin[j]]+RandomReal[0.3]},{i,0,2π,0.1},{j,0,2π,0.1}],{1,2}];ListPlot3D[data]

In[]:=

Out[]=

[data,30,{4,4}]

In[]:=

0.0537497

Out[]=

ListPlot3DFlattenTablex,y,

[data,20,{x,y}],{x,0,6,0.2},{y,0,6,0.2},{1,2}

In[]:=

Out[]=

### Options

Options

In[]:=

By default Loess fits straight lines to subsets of data, but you can increase the interpolation order to capture different detail:

data=Table[{i,Sin[i]+RandomReal[0.3]},{i,0,2π,0.2}];ListPlot[data]

In[]:=

Lowess fitting involves weighting the local data. Typically points further from the estimated point are given less weight:

### Possible Issues

Possible Issues

In[]:=

If you intend to use Loess to predict many values from the same data, then it is more efficient to find all values in a single request:

This method:

Is faster than this method: