IStatMethod.Warnings

Fore Syntax

Warnings: Array;

Fore.NET Syntax

Warnings: System.Array;

Description

The Warnings property returns the warnings that occurred at method calculation.

Comments

Warnings are returned as an array of strings. Use the IStatMethod.WarningsCount property to get the number of elements in this array.

Fore Example

To execute the example, add a link to the Stat system assembly.

Sub UserProc;
Var
    HP: SmHodrickPrescottFilter;
    s: Array[15Of Double;
    res: Integer;
    j: Integer;
Begin
    // Set values for variables
    s[00] := 670.2; s[08] := 1033.3;
    s[01] := 576.06; s[09] := 780.8;
    s[02] := 717.64; s[10] := 657.5;
    s[03] := 856.9; s[11] := 654.5;
    s[04] := 885.4; s[12] := 678.23;
    s[05] := 1011; s[13] := 642.41;
    s[06] := 995.44; s[14] := 751.9;
    s[07] := 1064.74;
    HP := New SmHodrickPrescottFilter.Create;
    //Set source series
    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;
    // Determine number of periods in the year
    HP.Frequency := 12;
    // Determine method of setting smoothing parameter
    HP.SmoothingParameterMode := HPSmoothingParameterModeType.EditDirectly;
    // Set smoothing parameter
    HP.SmoothingParameter := 5000000000000000000;
    // Execute calculation and display results
    res := HP.Execute;
    If res <> 0 Then
        Debug.WriteLine(HP.Errors);
    Else
        If HP.WarningsCount > 0 Then
            Debug.WriteLine("Warnings");
            For j := 0 To HP.WarningsCount - 1 Do
                Debug.WriteLine(HP.Warnings[j]);
            End For;
        End If;
        Debug.WriteLine("Modeling series");
        For j := 0 To HP.Fitted.Length - 1 Do
            Debug.WriteLine(HP.Fitted[j]);
        End For;
    End If;
End Sub UserProc;

After executing the example the console window displays the modeling series and the warnings that occurred at the method calculation.

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: Integer;
    j: Integer;
Begin
    // Set values for variables
    s[00] := 670.2; s[08] := 1033.3;
    s[01] := 576.06; s[09] := 780.8;
    s[02] := 717.64; s[10] := 657.5;
    s[03] := 856.9; s[11] := 654.5;
    s[04] := 885.4; s[12] := 678.23;
    s[05] := 1011; s[13] := 642.41;
    s[06] := 995.44; s[14] := 751.9;
    s[07] := 1064.74;
    HP := New SmHodrickPrescottFilter.Create();
    //Set source series
    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;
    // Determine number of periods in the year
    HP.Frequency := 12;
    // Determine method of setting smoothing parameter
    HP.SmoothingParameterMode := HPSmoothingParameterModeType.hpspmtEditDirectly;
    // Set smoothing parameter
    HP.SmoothingParameter := 5000000000000000000;
    // Execute calculation and display results
    res := HP.Execute();
    If res <> 0 Then
        System.Diagnostics.Debug.WriteLine(HP.Errors);
    Else
        If HP.WarningsCount > 0 Then
            System.Diagnostics.Debug.WriteLine("Warnings");
            For j := 0 To HP.WarningsCount - 1 Do
                System.Diagnostics.Debug.WriteLine(HP.Warnings.GetValue(j));
            End For;
        End If;
        System.Diagnostics.Debug.WriteLine("Modeling series");
        For j := 0 To HP.Fitted.Length - 1 Do
            System.Diagnostics.Debug.WriteLine(HP.Fitted.GetValue(j));
        End For;
    End If;
End Sub;

See also:

IStatMethod