Seas(Index: Integer; [CustomFrequency: MsFrequancy = 0]): Variant;
Seas(Index: integer;
CustomFrequency: Prognoz.Platform.Interop.Ms.MsFrequancy;
Context: Prognoz.Platform.Interop.Fore.IForeRuntimeContext): object;
Index. Periods of the year. Values for the models with the quarterly frequency are within range [1; 4], for the models with monthly frequency - [1; 12].
CustomFrequency. The frequency, values for which are created. Optional parameter.By default, the frequency is undefined and matches the model frequency.
Context. Context. It is applied only in Fore.NET.
The Seas method returns the dummy variable, each element of which determines whether the observation belongs to the specified period in the current year. The year is divided in accordance with series calendar frequency.
The method is available for the models with quarterly or monthly frequency only.
Seas(4)
Suppose that a model has quarterly frequency, start date of the sample period is 01.01.2003, and end date is 31.12.2004. The Seas method determines whether the observation belongs to the fourth quarter. A dummy contains values:
Year |
I quarter of 2003 |
II quarter of 2003 |
III quarter of 2003 |
IV quarter of 2003 |
I quarter of 2004 |
II quarter of 2004 |
III quarter of 2004 |
IV quarter of 2004 |
Value of the output variable |
0,12 |
0,13 |
0,11 |
0,14 |
0,38 |
0,47 |
0,67 |
0,64 |
Seas value |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
Executing the example requires a modeling container with the CONT_MODEL identifier that contains a determinate equation model (quarterly frequency) with the DUMMIES_DETERM identifier. Add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
mb: IMetabase;
MsDescr: IMetabaseObjectDescriptor;
Model: IMsModel;
Transf: IMsFormulaTransform;
Determ: IMsDeterministicTransform;
Begin
mb := MetabaseClass.Active;
MsDescr := mb.ItemById("CONT_MODEL");
Model := mb.ItemByIdNamespace("DUMMIES_DETERM", MsDescr.Key).Edit As IMsModel;
Transf := Model.Transform;
Determ := Transf.FormulaItem(0).Method As IMsDeterministicTransform;
Determ.Expression.AsString := "Seas(4)";
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the dummy is used in the model equation to determine whether observation belongs to the fourth quarter.
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;
MsDescr: IMetabaseObjectDescriptor;
Model: IMsModel;
Transf: IMsFormulaTransform;
Determ: IMsDeterministicTransform;
Begin
mb := Params.Metabase;
MsDescr := mb.ItemById["CONT_MODEL"];
Model := mb.ItemByIdNamespace["DUMMIES_DETERM", MsDescr.Key].Edit() As IMsModel;
Transf := Model.Transform;
Determ := Transf.FormulaItem[0].Method As IMsDeterministicTransform;
Determ.Expression.AsString := "Seas(4)";
(Model As IMetabaseObject).Save();
End Sub;
See also: