Lowess - Maple Help

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{_rtable}}}_{{36893628610850497588}}$ (1)
 > $\mathrm{Yerror}≔\mathrm{Sample}\left(\mathrm{Normal}\left(0,0.1\right),200\right)$
 ${{\mathrm{_rtable}}}_{{36893628610756024788}}$ (2)
 > $Y≔\mathrm{map}\left(\mathrm{sin},X\right)+\mathrm{Yerror}$
 ${{\mathrm{_rtable}}}_{{36893628610756012980}}$ (3)

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{\epsilon }=0.01\right)$
 ${0.538403465288975}$ (4)

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]$ (5)
 > 

Compatibility

 • The CurveFitting[Lowess] command was introduced in Maple 2015.