AsForecasting: Boolean;
AsForecasting: boolean;
The AsForecasting property determines whether to calculate forecast values.
Available values:
True. Method calculates forecast values.
False. Method does not calculate forecast values.
Executing the example requires that the repository contains a modeling container with the MS identifier, containing a model with the MODEL_EXPLSM identifier. This model must be calculated by the Exponential Smoothing method.
Add links to the Metabase, Ms, Stat system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Model: IMsModel;
Formula: IMsFormula;
ExpSmooph: IMsExponentialSmoothingTransform;
SeasonalComp: ISeasonal;
Parameters: IExponentialSmoothingParameters;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get model
Model := (Mb.ItemByIdNamespace("MODEL_EXPLSM", MB.GetObjectKeyById("MS"))).Edit As IMsModel;
// Get calculation parameters
Formula := Model.Transform.FormulaItem(0);
ExpSmooph := Formula.Method As IMsExponentialSmoothingTransform;
// Set significance of confidence limits
ExpSmooph.ConfidenceLevel := 0.99;
// Set missing data treatment method
ExpSmooph.MissingData.Method := MissingDataMethod.LinTrend;
// Specify that method calculates forecast values
ExpSmooph.AsForecasting := True;
// Set model trend type
ExpSmooph.TrendComponent := TrendType.Exponential;
// Set seasonal component parameters
SeasonalComp := ExpSmooph.SeasonalComponent;
SeasonalComp.Cycle := 5;
SeasonalComp.Mode := SeasonalityType.Multiplicative;
// Set values of method parameters
Parameters := ExpSmooph.Parameters;
Parameters.Alpha := 0.06;
Parameters.Delta := 0.06;
Parameters.Gamma := 0.01;
// Save changes
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the following is set for the model: confidence limit significance, missing data treatment method, trend type, seasonal component and parameter values. The model calculates forecast values.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Model: IMsModel;
Formula: IMsFormula;
ExpSmooph: IMsExponentialSmoothingTransform;
SeasonalComp: ISeasonal;
Parameters: IExponentialSmoothingParameters;
Begin
// Get repository
MB := Params.Metabase;
// Get model
Model := (Mb.ItemByIdNamespace["MODEL_EXPLSM", MB.GetObjectKeyById("MS")]).Edit() As IMsModel;
// Get calculation parameters
Formula := Model.Transform.FormulaItem[0];
ExpSmooph := Formula.Method As IMsExponentialSmoothingTransform;
// Set significance of confidence limits
ExpSmooph.ConfidenceLevel := 0.99;
// Set missing data treatment method
ExpSmooph.MissingData.Method := MissingDataMethod.mdmLinTrend;
// Specify that method calculates forecast values
ExpSmooph.AsForecasting := True;
// Set model trend type
ExpSmooph.TrendComponent := TrendType.tdtExponential;
// Set seasonal component parameters
SeasonalComp := ExpSmooph.SeasonalComponent;
SeasonalComp.Cycle := 5;
SeasonalComp.Mode := SeasonalityType.sstMultiplicative;
// Set values of method parameters
Parameters := ExpSmooph.Parameters;
Parameters.Alpha := 0.06;
Parameters.Delta := 0.06;
Parameters.Gamma := 0.01;
// Save changes
(Model As IMetabaseObject).Save();
End Sub;
See also: