Database Reference
In-Depth Information
double a, double b, double [] s, double g) {
super (level, trend, a, b, s, g);
}
@Override
public double forecast( double x) {
int h = (t + ( int )Math. floor (x-1.0)) % s.length;
return super .forecast(x) + s[h];
}
When initializing the seasonal component, the sum of all the components
should be approximately equal to zero.
For the update step, the error remains the same difference between the
observed value and the forecasted value. The update of the seasonal value
only depends on the error and the values of a and g , so it can be updated
independently of the level and trend values:
@Override
public double update( double y) {
double e = super .update(y);
s[t] = s[t] + g*(1-a)*e;
t = (t + 1) % s.length;
return e;
}
Themultiplicativeforecastissomewhatmorecomplicated.Theforecaststep
multiplies the seasonal value by the output of the Holt forecast:
@Override
public double forecast( double x) {
int h = (t + ( int )Math. floor (x-1.0)) % s.length;
return super .forecast(x)*s[h];
}
Using this forecast, using the normal error between the forecasted value and
the observed value would require that the error term for the level and trend
updates be divided by the seasonal value used for the forecast. To allow the
use of the original Holt forecast update, the error term is stated with this
division already in place:
Search WWH ::




Custom Search