Database Reference
In-Depth Information
@Override
public double error( double y) {
return super .error(y)/s[t];
}
This is then corrected in the computation of the seasonal update. The
seasonal update is divided by the sum of the level and trend terms in the
same way as the level and trend updates were divided by the seasonal
update:
@Override
public double update( double y) {
double z = level() + trend();
double e = super .update(y)*s[t];
s[t] = s[t] + (1-a)*g*e/z;
t = (t + 1) % s.length;
return e;
}
Although the initial seasonal components of the additive forecast should
roughlycanceleachotherout,theseasonalcomponentsofthemultiplicative
forecast should sum to roughly the length of the period. Both the models
tend to work fairly well, but it is often the case that the multiplicative model
fits real-world data a bit better than its additive counterpart.
Regression Methods
The same ideas as the exponential smoothing approach can also be used
with a regression model. Although the choice of variables for regression is
virtually infinite, assuming enough data has been collected to support the
chosen variables, one place to start is simply the k most recent observations.
public void streamingRegressionTest() {
int k = 14;
double [] x = new double [k];
double y;
double t = 0.0;
MersenneTwisterFast twist = new
MersenneTwisterFast();
MillerUpdatingRegression rm = new
Search WWH ::




Custom Search