ISmHodrickPrescottFilter.SmoothingParameter

Fore Syntax

SmoothingParameter: Double;

Fore.NET 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:

Fore 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.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Stat;

Public Shared Sub Main(Params: StartParams);
Var
    HP: SmHodrickPrescottFilter;
    s: Array[15Of Double;
    res, i: Integer;
    Fitted: System.Array;
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.mdmSampleAverage;
    // Set smoothing parameter
    HP.SmoothingParameter := 100;
    // Calculate the method  and output the results
    res := HP.Execute();
    If res <> 0 Then
        System.Diagnostics.Debug.WriteLine(HP.Errors);
    Else
        System.Diagnostics.Debug.WriteLine("Modeling series");
        System.Diagnostics.Debug.Indent();
        Fitted := HP.Fitted;
        For i := 0 To HP.Fitted.Length - 1 Do
            System.Diagnostics.Debug.WriteLine(Fitted[i]);
        End For;
        System.Diagnostics.Debug.Unindent();
    End If;
End Sub;

See also:

ISmHodrickPrescottFilter