Built-in functions : forcst function

forcst(<input>,<time>,<horizon>[,<initial>])

New in v6.6

The forcst function performs simple trend extrapolation. Here's how it works. First, forcst calculates the trend in input, based upon the value of input, the first order exponential average of input, and the averaging time. (Think of the averaging time as the time over which you wish to calculate a trend.) Then forcst extrapolates the trend into the future - you specify the distance into the future by providing a value for horizon. If you do not specify initial, forcst substitutes 0 for the initial value of the trend in input.

The forcst function is equivalent to the structural diagram and equations shown in this figure:

Put diagram here

Compartment   Average input : 

    Initial value = input-(averaging*initial) (real)
Flow   change in average : 
    change in average =         (input-Average_input)/averaging (1/day) 
 Variable   averaging : 
    averaging =         Variable parameter (day) 
 Variable   forecast : 
    forecast =         input*(1+trend*horizon) (real) 
Variable   horizon : 
    horizon =         Variable parameter (day) 
 Variable   initial : 
    initial =         Variable parameter (real) 
Variable   input : 
    input =         Variable parameter (real) 
Variable   trend : 
    trend =         (input-Average_input)/(Average_input*averaging) (1/day) 

Example:

Sales_Forecast = FORCST(Sales,10,15,0) produces a forecast of sales 15 time units into the future. The forecast is based on current sales, and the trend in sales over the last 10 time units. The initial growth trend in sales is set to 0.