Documentation/Calc Functions/FORECAST.ETS.PI.ADD

From The Document Foundation Wiki
Jump to navigation Jump to search

Function name:



Statistical Analysis


Calculates the prediction interval(s) for additive forecast based on the historical data using ETS (Exponential Triple Smoothing) or EDS (Exponential Double Smoothing) algorithms. EDS is used when argument period_length is 0, otherwise ETS is used.


FORECAST.ETS.PI.ADD(target, values, timeline, [confidence_level], [period_length], [data_completion], [aggregation])


Returns a real number which is the prediction interval(s) for the additive forecast calculated using ETS or EDS algorithms for the given arguments.


target is a date, time, or numeric single value or range. The data point/range for which to calculate a forecast.

values is a numeric array or range. values are the historical values, for which you want to forecast the next points.

timeline is a real number or dates or time array or a reference to the range to cells containing them. The timeline (x-value) range for historical values.

Note pin.svg

The timeline doesn't have to be sorted, the function will sort it for calculations. The timeline values must have a consistent step between them.

confidence_level is a numeric value between 0 and 1 (exclusive), default is 0.95. A value indicating a confidence level for the calculated prediction interval.

period_length is a numeric value >= 0, the default is 1. A positive integer indicating the number of samples in a period.

Note pin.svg

A value of 1 indicates that Calc is to determine the number of samples in a period automatically. A value of 0 indicates no periodic effects, a forecast is calculated with EDS algorithms. For all other positive values, forecasts are calculated with ETS algorithms.

data_completion is a logical value TRUE or FALSE, a numeric 1 or 0, default is 1 (TRUE). A value of 0 (FALSE) will add missing data points with zero as historical value. A value of 1 (TRUE) will add missing data points by interpolating between the neighboring data points.

Note pin.svg

Although the timeline requires a constant step between data points, the function supports up to 30% missing data points and will add these data points.

aggregation is a numeric value from 1 to 7, with default 1. The aggregation parameter indicates which method will be used to aggregate identical time values:

Aggregation Function
Note pin.svg

Although the timeline requires a constant step between data points, the function will aggregate multiple points which have the same timestamp.

For example, with a 90% Confidence level, a 90% prediction interval will be computed (90% of future points are to fall within this radius from forecast).

Note pin.svg

Note on prediction intervals: there is no exact mathematical way to calculate this for forecasts, there are various approximations. Prediction intervals tend to be increasingly 'over-optimistic' when increasing the distance of the forecast-X from the observation data set.

For ETS, Calc uses an approximation based on 1000 calculations with random variations within the standard deviation of the observation data set (the historical values).

  • If a constant step can't be identified in the sorted timeline, the function will return a numeric (#NUM!) error.
  • If the ranges of the timeline and historical values aren't of the same size, the function will return an error value.
  • If the timeline contains less than 2 periods of data, the function will return a value (#VALUE!) Error.
  • If confidence_level values are <= 0 or >= 1, the function will return the #NUM! error.
  • For values of period_length that is not a positive whole number, the function will return a numeric (#NUM!) Error.

Additional details:

  • Exponential Smoothing is a method to smooth real values in time series in order to forecast probable future values.
  • Exponential Triple Smoothing (ETS) is a set of algorithms in which both trend and periodical (seasonal) influences are processed. Exponential Double Smoothing (EDS) is an algorithm like ETS, but without the periodical influences. EDS produces linear forecasts.
  • FORECAST.ETS.PI.ADD calculates with the model:
  • For more details on exponential smoothing algorithms, visit Wikipedia.


The table below contains a timeline and its associated values:

1 Timeline Values
2 01/01/2013 112
3 01/02/2013 118
4 01/03/2013 132
5 01/04/2013 100
6 01/05/2013 121
7 01/06/2013 135
8 01/07/2013 148
9 01/08/2013 148
10 01/09/2013 136
11 01/10/2013 119
12 01/11/2013 104
13 01/12/2013 118
Formula Description Returns
=FORECAST.ETS.PI.ADD(DATE(2014;1;1);Values;Timeline;0.9;1;TRUE();1) with Values and Timeline as the named ranges from the table above The prediction interval for additive forecast for January 2014 based on Values and Timeline named ranges above, 90% (=0.9) confidence level, with one sample per period, no missing data, and AVERAGE as aggregation. 18.8061295551355
=FORECAST.ETS.PI.MULT(DATE(2014;1;1);Values;Timeline;0.9;4;5;7) with Values and Timeline as the named ranges from the table above The function returns an error value since data_completion cannot be anything except 0,FALSE,1 or TRUE. Err:502
=FORECAST.ETS.PI.MULT(DATE(2014;1;1);Values;Timeline;0.9;1.5;TRUE();7) with Values and Timeline as the named ranges from the table above The function returns a numeric error since period_length is not a positive whole number. #NUM!

Related LibreOffice functions:









ODF standard:


Equivalent Excel functions: