Lowess - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

CurveFitting

 Lowess
 produces lowess smoothed functions

 Calling Sequence Lowess(xydata, opts) Lowess(xdata, ydata, opts)

Parameters

 xydata - list, listlist, Array, DataFrame, or Matrix of the form $\left[\left[{x}_{0,1},{x}_{0,2},\dots ,{x}_{0,M-1},{y}_{0}\right],\left[{x}_{1,1},{x}_{1,2},\dots ,{x}_{1,M-1},{y}_{1}\right],\dots ,\left[{x}_{N,1},{x}_{N,2},\dots ,{x}_{N,M-1},{y}_{N}\right]\right]$; data points of $M$ dimensions xdata - list, listlist, Array, DataSeries, or Matrix of the form $\left[\left[{x}_{0,1},{x}_{0,2},\dots ,{x}_{0,M-1}\right],\left[{x}_{1,1},{x}_{1,2},\dots ,{x}_{1,M-1}\right],\dots ,\left[{x}_{N,1},{x}_{N,2},\dots ,{x}_{N,M-1}\right]\right]$; independent values of data points of $M$ dimensions ydata - list, Array, DataSeries, or Vector of the form $\left[{y}_{1},{y}_{2},\dots ,{y}_{N}\right]$; dependent values of data points opts - (optional) one or more equations of the form fitorder=n, bandwidth=r, or iters=nonnegint

Description

 • The Lowess command creates a function whose values represent the result of the lowess data smoothing algorithm applied to the input data.
 • This command calls Statistics[Lowess]. See its help page for more examples and a detailed description.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$

Create a data sample and apply to it some error.

 > $X≔\mathrm{Sample}\left(\mathrm{Uniform}\left(0,\mathrm{Pi}\right),200\right)$
 > $\mathrm{Yerror}≔\mathrm{Sample}\left(\mathrm{Normal}\left(0,0.1\right),200\right)$
 > $Y≔\mathrm{map}\left(\mathrm{sin},X\right)+\mathrm{Yerror}$

Create the function whose graph is the smoothed curve.

 > $L≔\mathrm{CurveFitting}:-\mathrm{Lowess}\left(X,Y,\mathrm{fitorder}=1,\mathrm{bandwidth}=0.3\right):$

Plot the data sample, smoothed curve, and the region between the $x$-axis and the curve for $\frac{\mathrm{\pi }}{8}\le x\le 3\frac{\mathrm{\pi }}{8}$.

 > $P≔\mathrm{ScatterPlot}\left(X,Y\right)$
 > $Q≔\mathrm{plot}\left(L\left(x\right),x=0..\mathrm{Pi}\right)$
 > $R≔\mathrm{plots}:-\mathrm{shadebetween}\left(L\left(x\right),0,x=\frac{\mathrm{Pi}}{8}..\frac{3\mathrm{Pi}}{8},\mathrm{showboundary}=\mathrm{false},\mathrm{positiveonly}\right)$
 > $\mathrm{plots}:-\mathrm{display}\left(P,Q,R\right)$

Find the area of the shaded region.

 > $\mathrm{int}\left(L,\frac{\mathrm{Pi}}{8}..\frac{3\mathrm{Pi}}{8},\mathrm{numeric},\mathrm{ε}=0.01\right)$
 ${0.538403465288975}$ (1)

And find the maximum.

 > $\mathrm{Optimization}:-\mathrm{Maximize}\left(L,\mathrm{map}\left(\mathrm{unapply},\left\{-x,x-\mathrm{Pi}\right\},x\right),\mathrm{optimalitytolerance}=0.001\right)$
 $\left[{1.00180213049401101}{,}\left[\begin{array}{c}1.5815245900666368\end{array}\right]\right]$ (2)

Compatibility

 • The CurveFitting[Lowess] command was introduced in Maple 2015.
 • For more information on Maple 2015 changes, see Updates in Maple 2015.