4 * Forecaster Configuration File
6 * FORECASTER(name,init,params,free,update,forecaster)
7 * name -- a print string to be associated with the forecaster
8 * init -- initialization function
9 * params -- string to be passed to init as initial parameters
10 * free -- free routine to be called to release forecaster spec. state
11 * update -- update routine for forecaster
12 * forecaster -- forecaster routine
14 * To add a forecaster to the system, both a FORECASTER specifier and
15 * an include file need to be specified. forecasters.h contains include
16 * files for each forecasting package.
18 * Each forecaster consists of a (char *)init() routine, a (void)free()
19 * routine, a (void)update() routine, and an (int)forecaster()
22 * char * Init(fbuff series,
26 * series -- a pointer to the actual data series
27 * time_stamps -- a pointer to the time stamp series
28 * params -- string passed as initial parameters
30 * returns a local state record that will be passed to
31 * all subsequent calls
33 * void Free(char *state)
35 * state -- local state to be deallocated when forecaster]
38 * void Update(char *state,
42 * state -- local forecaster state
43 * ts -- time stamp for new value to be added
44 * value -- value to be added to the forecaster state
46 * int Forecaster(char *state,
49 * state -- local forecaster state
50 * forecast -- out parameter through which forecast is passed
52 * returns a 1 if forecast can be made and a 0 if the
53 * foreacster fails for some reason
55 * a header file for each package shoould include external definitions
60 * last value predictor
62 FORECASTER("Last Value",
70 * running tabulation of the mean
72 FORECASTER("Running Mean",
80 * exp smooth predictor with 0.05 gain
82 FORECASTER("5% Exp Smooth",
90 * exp smooth predictor with 0.10 gain
92 FORECASTER("10% Exp Smooth",
100 * exp smooth predictor with 0.15 gain
102 FORECASTER("15% Exp Smooth",
110 * exp smooth predictor with 0.20 gain
112 FORECASTER("20% Exp Smooth",
120 * exp smooth predictor with 0.30 gain
122 FORECASTER("30% Exp Smooth",
130 * exp smooth predictor with 0.40 gain
132 FORECASTER("40% Exp Smooth",
140 * exp smooth predictor with 0.50 gain
142 FORECASTER("50% Exp Smooth",
150 * exp smooth predictor with 0.75 gain
152 FORECASTER("75% Exp Smooth",
160 * median predictor with window = 31
162 FORECASTER("Median Window 31",
170 * median predictor with window = 5
172 FORECASTER("Median Window 5",
180 * sliding window with window = 31 -- Trim Median with alpha = 0.0
182 FORECASTER("Sliding Median Window 31",
190 * sliding window with window = 5 -- Trim Median with alpha = 0.0
192 FORECASTER("Sliding Median Window 5",
200 * trimmed median with window = 31, alpha = 0.30
202 FORECASTER("30% Trimmed Median Window 31",
210 * trimmed median with window = 51, alpha = 0.30
212 FORECASTER("30% Trimmed Median Window 51",
220 * adaptive median with win=10, min_win=5, max_win=21, and a adjustment
223 FORECASTER("Adaptive Median Window 5-21",
231 * adaptive median with win=30, min_win=21, max_win=51, and a adjustment
234 FORECASTER("Adaptive Median Window 21-51",
236 "30.0 21.0 51.0 5.0",