|
Calling Sequence
|
|
Lowess(XY, options)
Lowess(X, Y, options)
L := Lowess(...)
L(x1, x2, ..., xN)
L(M)
|
|
Parameters
|
|
XY
|
-
|
Matrix, Array, DataFrame, or listlist of data convertible to numeric. If XY is a Matrix, DataFrame, or Array, it must have at least two columns. If XY is a listlist, then each inner list is considered one row, with the th of each inner list being the elements of the th column, and the same requirement of at least two columns applies. Each row of XY is interpreted as one data point. If XY has columns, then the first columns contain the values of the independent variables. The last column contains the corresponding values of the dependent variable.
|
X
|
-
|
Vector, list, Matrix, Array, DataSeries, or listlist of data convertible to numeric with the number of rows equal to the length of Y. The columns are interpreted as the values of the independent variables.
|
Y
|
-
|
Vector, list, DataSeries, or Array of data convertible to numeric with length equal to the number of rows in X. The values in Y are the corresponding values of the dependent variable.
|
options
|
-
|
(optional) equation(s) of the form option=value where option is one of fitorder, bandwidth, or iters
|
x1, x2, ..., xN
|
-
|
evaluates L at (x1, x2, ..., xN), where N is equal to or the number of columns in X.
|
M
|
-
|
a matrix with number of columns equal to the number of columns in X or . Returns a Vector where the th element is L evaluated with the th row of M as arguments
|
|
|
|
|
Options
|
|
|
The degree of the polynomial used in each local regression. The default value is .
|
|
The proportion of the input data points used in each local regression. The default value depends on fitorder and the number of input data points.
|
|
The number of iterations when smoothing data of one independent variable. Each iteration makes the data smoother by eliminating outliers, thus making the computation more robust. This option has no effect when the data has more than one independent variable. The default is .
|
|
|
Description
|
|
•
|
The Lowess command creates a function whose values represent the input data smoothed with the lowess algorithm.
|
•
|
Suppose the input data set is of independent variables and has data points, the lowess smoothed value at is computed as follows.
|
–
|
Take the points in that are closest to .
|
–
|
Fit a polynomial of variables and degree to the points using weighted linear least squares, where the weight for a point is computed by applying the tri-cube weight function to the distance between and .
|
•
|
Running one or more iterations, as specified by the iters option, will produce a set of weights to reduce the influence of outliers (that is, make the computation more robust). At each iteration, the weight of a point depends on the residual of the Lowess curve at that point in the previous iteration. These weights are combined with the weights given by the distance, as described previously.
|
•
|
L will return unevaluated if the arguments are non-convertible to numerics. But if the first and only argument is a Matrix with number of columns equal to the number of parameters of L, a Vector will be returned where the th element is the L applied with the th row of the Matrix as arguments.
|
|
|
Examples
|
|
Create a data sample and apply to it some error.
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
Create the function whose graph is the smoothed surface.
>
|
|
Plot the data sample, smoothed surface, and the region between the plane and the surface for and .
>
|
|
>
|
|
>
|
|
>
|
|
Find the volume of the shaded region.
>
|
|
For a two dimensional example we will create another data sample.
>
|
|
>
|
|
>
|
|
Create the function whose graph is the smoothed curve.
>
|
|
Plot the data sample, smoothed curve, and the region between the -axis and the curve for .
>
|
|
>
|
|
>
|
|
>
|
|
Find the area of the shaded region.
>
|
|
And find the maximum.
>
|
|
| (3) |
|
|
Compatibility
|
|
•
|
The Statistics[Lowess] command was introduced in Maple 2015.
|
|
|
|