Forecast: IForecast;
The Forecast property determines parameters of the form forecasting series without seasonality.
The last forecast point and significance of confidence bounds are set in the ISmCurveEstimation.ForecastLastPoint and ISmCurveEstimation.ForecastConfidenceLevel properties respectively.
Add a link to the Stat system assembly.
Sub UserProc;
Var
trend: SmCurveEstimation;
d0: Double;
status, i: Integer;
ar: Array Of Double;
Forms: IDependenceForms;
Dep: IDependenceForm;
Forecast: IForecast;
Begin
// Create object to find dependency form
trend := New SmCurveEstimation.Create;
// Set values of explanatory series
ar := New Double[25];
ar[00] := 4110; ar[01] := 4280; ar[02] := 4459;
ar[03] := 4545; ar[04] := 4664; ar[05] := 4861;
ar[06] := 5195; ar[07] := 5389; ar[08] := 5463;
ar[09] := 5610; ar[10] := 5948; ar[11] := 6218;
ar[12] := 6521; ar[13] := 6788; ar[14] := 7222;
ar[15] := 7486; ar[16] := 7832; ar[17] := 8153;
ar[18] := 8468; ar[19] := 9054; ar[20] := 9499;
ar[21] := 9866; ar[22] := 10217; ar[23] := 10763;
ar[24] := 10683;
trend.Explained.Value := ar;
// Set automatic generation of explanatory series
trend.Explanatory.IsTrend := True;
// Set end point of identification period
trend.ModelPeriod.LastPoint := 20;
// Set end point of forecasting series
trend.ForecastLastPoint := 30;
// Determine seasonality type
trend.SeasonalComponent.Mode := SeasonalityType.additive;
// Determine seasonality period
trend.SeasonalComponent.Cycle := 4;
// Run calculation and output results
status := trend.Execute;
If status <> 0 Then
Debug.WriteLine(trend.Errors);
Else
Forms := trend.DependenceForms;
Dep := Forms.Item(1);
d0 := Dep.CriterionValue;
Debug.WriteLine("Dependency form " + Dep.DisplayName);
Debug.WriteLine("Criterion value " + ": " + d0.ToString);
Forecast := Dep.Forecast;
Debug.WriteLine("=== Forecasting series ===");
For i := trend.ModelPeriod.LastPoint To Forecast.Value.Length - 1 Do
d0 := Forecast.Value[i];
Debug.WriteLine(i.ToString + ": " + d0.ToString);
End For;
End If;
End Sub UserProc;
After executing the example, the console window will display: dependency form, criterion value and forecasting series values with seasonality.
See also: