SmoothingParameterMode: HPSmoothingParameterModeType;
The SmoothingParameterMode property determines the method of setting smoothing parameter.
Depending on the SmoothingParameterMode value, use different properties to adjust smoothing parameter:
SmoothingParameterMode = HPSmoothingParameterModeType.SetByFrequencyRule. The smoothing parameter is determined by the degree value: IMsHodrickPrescottFilterTransform.Power.
SmoothingParameterMode = HPSmoothingParameterModeType.EditDirectly. The smoothing parameter is determined by lambda value: IMsHodrickPrescottFilterTransform.SmoothingParameter.
Executing the example requires that the repository contains a modeling container with the OBJ_MS identifier containing a model with the MODEL identifier. The model uses the Hodrick Prescott filter for calculation. It is also necessary to add links to the Ms, Metabase and Stat system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
MsDescrKey: Integer;
Model: IMsModel;
ModelTrans: IMsFormulaTransform;
Formula: IMsFormula;
HPFilter: IMsHodrickPrescottFilterTransform;
Begin
Mb := MetabaseClass.Active;
MsDescrKey := Mb.ItemById("OBJ_MS").Key;
// Get model
Model := MB.ItemByIdNamespace("MODEL", MsDescrKey).Edit As IMsModel;
ModelTrans := Model.Transform;
// Set up model calculation parameters
Formula := ModelTrans.FormulaItem(0);
HPFilter := Formula.Method As IMsHodrickPrescottFilterTransform;
HPFilter.SmoothingParameterMode := HPSmoothingParameterModeType.SetByFrequencyRule;
HPFilter.Power := 3;
// Save model calculation parameters
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the smoothing parameter is determined by degree value.
See also: