Olympic Smoothing
olympicSmoothing( integer numberToAverageOver,
boolean onlyValidValues,
boolean useReduced)
Derive a new time series from the Olympic smoothing of numberToAverageOver values in the current time series. numberToAverageOver must be and odd integer and greater than. Similar to centered moving average smoothing, except that the minimum and maximum values over the averaging interval are excluded from the computation.
If onlyValidValues is set to true, then if any values in the averaging interval are missing, the point in the resultant time series is set to missing. If onlyValidValues is set to false and there are missing values in the averaging interval, a smoothed point is still computed using the remaining valid values in the interval. If there are no valid values in the averaging interval, the point in the resultant time series is set to missing.
If useReduced is set to true, then moving average values can be still be computed at the beginning and end of the time series even if there are less than numberToAverageOver values in the interval. If useReduced is set to false, then the first and last numberToAverageOver/2 points of the resultant time series are set to missing.
Parameters:
numberToAverageOver – An integer specifying the number of values to average
over for computing the smoothed time series. Must be an odd integer greater than 2.
onlyValidValues – Either Constants.TRUE, or Constants.FALSE, specifying
whether all values in the averaging interval must be valid for the computed point in the
resultant time series to be valid.
useReduced - Either Constants.TRUE, or Constants.FALSE, specifying whether
to allow points at the beginning and end of the smoothed time series to be computed from
a reduced ( less than numberToAverageOver ) number of values. Otherwise, set the first
and last numberToAverageOver/2 points of the new time series to missing.
Example:
avgData = tsData.olympicSmoothing(
5,
1)
Returns: A new TimeSeriesMath object.
Generated Exceptions: Throws
a HecMathException if the numberToAverageOver is less than 3 or not odd.