spline(X, Y, resampleRule, [closed='left'], [origin='start_day'], [outputX=false])


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 (optional) are the same as the parameters closed and origin of function resample.

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


Resample X based on the specified resampleRule, closed and origin. Perform cubic spline 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.


spline([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);

// output