IsTrend: Boolean;
IsTrend: boolean;
The IsTrend property determines how an explanatory series is set, as an automatically generated time series or generated by the user.
Available values:
True. Default value. The explanatory series is an automatically generated time series. The first series point is set via the ICurveEstimationExplanatory.ReferencePoint property.
False. The explanatory series is set by the user via the ICurveEstimationExplanatory.Serie property.
To execute the example, add a link to the Stat system assembly.
Sub Main;
Var
trend: SmCurveEstimation;
d0: Double;
status, i: Integer;
ar: Array[25] Of Double;
Begin
trend := New SmCurveEstimation.Create;
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;
trend.Explanatory.IsTrend := True; // explanatory series - automatically generated time series
trend.Explanatory.ReferencePoint := 99; // the first point of explanatory time series
trend.ModelPeriod.LastPoint := 20;
trend.ForecastLastPoint := 30;
trend.SeasonalComponent.Mode := SeasonalityType.Additive;
trend.SeasonalComponent.Cycle := 4;
status := trend.Execute;
If status <> 0 Then
Debug.WriteLine(trend.Errors);
Else
For i := 0 To 10 Do
d0 := trend.DependenceForms.Item(i).CriterionValue;
Debug.WriteLine(trend.DependenceForms.Item(i).Name + ": " + d0.ToString);
End For;
End If;
End Sub Main;
After executing the example the console window displays the following results:
Linear: 0.97313512972825955
Quadratic: 0.99853888260620438
Polynomial: 0.99862028141069137
Compound: 0.99520880118290411
Growth: 0.99520880118290367
Logarithmic: 0.96515890582692698
Hyperbolic: 0.98683741835754846
Exponential: 0.99520880118290367
Inverse: 0.95615061432260506
Power: 0.99166441790463866
Logistic: 0.18896590355019971
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Sub Main(Params: StartParams);
Var
trend: SmCurveEstimation;
d0: Double;
status, i: Integer;
ar: Array[25] Of Double;
Begin
trend := New SmCurveEstimation.Create();
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;
trend.Explanatory.IsTrend := True; // explanatory series - automatically generated time series
trend.Explanatory.ReferencePoint := 99; // the first point of explanatory time series
trend.ModelPeriod.LastPoint := 20;
trend.ForecastLastPoint := 30;
trend.SeasonalComponent.Mode := SeasonalityType.sstAdditive;
trend.SeasonalComponent.Cycle := 4;
status := trend.Execute();
If status <> 0 Then
System.Diagnostics.Debug.WriteLine(trend.Errors);
Else
For i := 0 To 10 Do
d0 := trend.DependenceForms.Item[i].CriterionValue;
System.Diagnostics.Debug.WriteLine(trend.DependenceForms.Item[i].Name + ": " + d0.ToString());
End For;
End If;
End Sub;
See also: