IMsHodrickPrescottFilterTransform.SmoothingParameter

Syntax

SmoothingParameter: Double;

Description

The SmoothingParameter property determines value of smoothing parameter.

Example

Sub Main;

Var

MB: IMetabase;

CrInf: IMetabaseObjectCreateInfo;

MObj: IMetabaseObject;

Model: IMsModel;

Trans: IMsFormulaTransform;

Varr: IMsVariable;

VarTrans: IMsFormulaTransformVariable;

Tree: IMsFormulaTransformSlicesTree;

Slice: IMsFormulaTransformSlice;

Selector: IMsFormulaTransformSelector;

Formula: IMsFormula;

HPFilter: IMsHodrickPrescottFilterTransform;

Begin

MB := MetabaseClass.Active;

CrInf := Mb.CreateCreateInfo;

CrInf.ClassId := MetabaseObjectClass.KE_CLASS_MSMODEL;

CrInf.Id := "New_HPFilter";

CrInf.Name := "New_HPFilter";

CrInf.Parent := Mb.ItemById("KONT_MODEL");

CrInf.Permanent := False;

MObj := Mb.CreateObject(CrInf).Edit;

Model := MObj As IMsModel;

Trans := Model.Transform;

Varr := MB.ItemByIdNamespace("Var_1", MB.ItemById("KONT_MODEL").Key).Bind As IMsVariable;

Model.Output.Add(Varr);

// loaded variable

Varr := MB.ItemByIdNamespace("Var_2", MB.ItemById("KONT_MODEL").Key).Bind As IMsVariable;

Model.Series.Add(Varr);

VarTrans := Trans.Outputs.Item(0);

Tree := VarTrans.SlicesTree(VarTrans);

Slice := Tree.CreateSlice(1);

Selector := Model.Transform.CreateSelector;

Selector.Slice := Slice;

Formula := Model.Transform.Transform(Selector);

Formula.Kind := MsFormulaKind.HodrickPrescottFilter;

HPFilter := Formula.Method As IMsHodrickPrescottFilterTransform;

HPFilter.SmoothingParameter := 6;

//set the downloaded variable

HPFilter.FittedSerie := Varr As IMsVariableStub;

MObj.Save;

End Sub Main;

After executing the example the model that uses the Hodrick Prescott filter for calculation is created in the modeling container. The output and loaded variables are added and the parameter of smoothing is set to the model.

See also:

IMsHodrickPrescottFilterTransform