loess(X, Y, resampleRule, [closed='left'], [origin='start_day'], [outputX=false], [bandwidth=0.3], [robustnessIter=4], [accuracy=1e-12])


X is a strictly increasing vector of temporal type.

Y is a numeric vector of the same length as X.

resampleRule is a string. See the parameter rule of function resample for the optional values.

closed and origin are the same as the parameters closed and origin of function resample.

outputX is a Boolean value indicating whether to output the resampled X. The default value is false.

bandwidth is a numeric scalar in (0,1]. when computing the loess fit at a particular point, this fraction of source points closest to the current point is taken into account for computing a least-squares regression.

robustnessIter is a postive interger indicating how many robustness iterations are done.

accuracy is a number greater than 1. If the median residual at a certain robustness iteration is less than this amount, no more iterations are done.


Resample X based on the specified resampleRule, closed and origin. Implement Local Regression Algorithm (Loess) for interpolation on Y based on the resampled X.

If outputX is unspecified, return a vector of Y after the interpolation.

If outputX=true, return a tuple where the first element is the vector of resampled X and the second element is a vector of Y after the interpolation.


loess([2016.02.14 00:00:00, 2016.02.15 00:00:00, 2016.02.16 00:00:00], [1.0, 2.0, 4.0], resampleRule=`60min, bandwidth=1)

// output