ISmHodrickPrescottFilter.SmoothingParameter

Syntax

SmoothingParameter: Double;

Description

The SmoothingParameter property determines smoothing parameter.

Comments

Smoothing parameter is a time interval used to calculate the elements mean. The greater is the parameter, the smoother is the series.

Value of smoothing parameter should be selected as follows:

Example

Add a link to the Stat system assembly.

Sub UserProc;
Var
    HP: SmHodrickPrescottFilter;
    s: Array[15Of Double;
    res, i: Integer;
Begin
    HP := New SmHodrickPrescottFilter.Create;
    // Set values for variables
    s[00] := 670.2;  s[01] := 576.06;  s[02] := 717.64;
    s[03] := 856.9;  s[04] := 885.4;   s[05] := Double.Nan;
    s[06] := 995.44; s[07] := 1064.74; s[08] := 1033.3;
    s[09] := 780.8;  s[10] := 657.5;   s[11] := Double.Nan;
    s[12] := 678.23; s[13] := 642.41; s[14] := 751.9;
    HP.Serie.Value := s;
    // Set sample period
    HP.ModelPeriod.FirstPoint := 1;
    HP.ModelPeriod.LastPoint := 15;
    // Specify missing data treatment method
    HP.MissingData.Method := MissingDataMethod.SampleAverage;
    // Set smoothing parameter
    HP.SmoothingParameter := 100;
    // Calculate the method  and output the results
    res := HP.Execute;
    If res <> 0 Then
        Debug.WriteLine(HP.Errors);
    Else
        Debug.WriteLine("Modeling series");
        Debug.Indent;
        For i := 0 To HP.Fitted.Length - 1 Do
            Debug.WriteLine(HP.Fitted[i]);
        End For;
        Debug.Unindent;
    End If;
End Sub UserProc;

After executing the example the console window displays modeling series.

See also:

ISmHodrickPrescottFilter