AllowForecastBeforeIdent: Boolean;
AllowForecastBeforeIdent: boolean;
The AllowForecastBeforeIdent property determines whether forecasting period is available before sample period.
Available values:
True. Forecasting period can be before sample period.
False. Forecasting period can be only after sample period.
Executing the example requires that the repository contains a modeling container with the MS identifier containing a model with the MODEL_FREEDIM identifier.
Add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Model: IMsModel;
Period: IMsModelPeriod;
Begin
// Get current repository
MB := MetabaseClass.Active;
// Get the model
Model := MB.ItemByIdNamespace("MODEL_FREEDIM", MB.ItemById("MS").Key).Edit As IMsModel;
// Get model periods
Period := Model.Period;
// Determine that forecasting period can be before sample period
Period.AllowForecastBeforeIdent := True;
// Set sample period dates
Period.IdentificationStartDate := DateTime.ComposeDay(2005, 1, 1);
Period.IdentificationEndDate := DateTime.ComposeDay(2015, 12, 31);
// Set forecasting period dates
Period.ForecastStartDate := DateTime.ComposeDay(2000, 1, 1);
Period.ForecastEndDate := DateTime.ComposeDay(2004, 12, 31);
// Determine that on modeling problem calculation model periods are used
Model.UseModelPeriod := True;
// Save changes
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the forecasting period, which is before sample period, is set for the model.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Ms;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Model: IMsModel;
Period: IMsModelPeriod;
Begin
// Get current repository
MB := Params.Metabase;
// Get the model
Model := MB.ItemByIdNamespace["MODEL_FREEDIM", MB.ItemById["MS"].Key].Edit() As IMsModel;
// Get model periods
Period := Model.Period;
// Determine that forecasting period can be before sample period
Period.AllowForecastBeforeIdent := True;
// Set sample period dates
Period.IdentificationStartDate := DateTime.Parse("01.01.2005");
Period.IdentificationEndDate := DateTime.Parse("31.12.2015");
// Set forecasting period dates
Period.ForecastStartDate := DateTime.Parse("01.01.2000");
Period.ForecastEndDate := DateTime.Parse("31.12.2004");
// Determine that on modeling problem calculation model periods are used
Model.UseModelPeriod := True;
// Save changes
(Model As IMetabaseObject).Save();
End Sub;
See also: