ISmCensus2.MissingData

Fore Syntax

MissingData: IMissingData;

Fore.NET Syntax

MissingData: Prognoz.Platform.Interop.Stat.SlMissingData;

Description

The MissingData property determines missing data treatment parameters.

Comments

Method of missing data treatment MissingDataMethod.Casewise cannot be used.

Fore Example

Add a link to the Stat system assembly.

Sub UserProc;
Var 
    Census2: SmCensus2;
    s: Array[36Of Double;
    Av: Array[12Of Double;
    res, i: Integer;
Begin
    Census2 := New SmCensus2.Create;
    // Set explained series values
    s[0] := 670.2000183; s[12] := Double.Nan; s[24] := 826.6160466;
    s[1] := 576.0680563; s[13] := 642.418544; s[25] := Double.Nan;
    s[2] := 717.6484268; s[14] := Double.Nan; s[26] := 931.5707266;
    s[3] := 856.9105808; s[15] := Double.Nan; s[27] := 1026.666524;
    s[4] := 885.4609516; s[16] := 884.504279; s[28] := Double.Nan;
    s[5] := 1011.846431; s[17] := 1008.30908; s[29] := 1099.626392;
    s[6] := 995.4496292; s[18] := 1108.36628; s[30] := 1189.16892;
    s[7] := 1064.742231; s[19] := 1072.77175; s[31] := 1092.343791;
    s[8] := 1033.324656; s[20] := 1019.18752; s[32] := 1087.503861;
    s[9] := 780.8584552; s[21] := 895.560672; s[33] := 971.6522721;
    s[10] := 657.503313; s[22] := 811.036101; s[34] := 826.2502823;
    s[11] := 654.547579; s[23] := 756.617764; s[35] := 789.6322825;
    Census2.Serie.Value := s;
    // Define parameters of sample period
    Census2.ModelPeriod.FirstPoint := 1;
    Census2.ModelPeriod.LastPoint := 36;
     // Set missing data treatment method
    Census2.MissingData.Method := MissingDataMethod.LinTrend;
    // Define parameters of seasonal component and seasonality type
    Census2.SeasonalComponent.Mode := SeasonalityType.Multiplicative;
    Census2.SeasonalComponentCycleType := SeasonalityCycleType.Month;
    // Define moving average
    Av[0] := 0.02; Av[2] := 0.20;
    Av[1] := 0.10; Av[3] := 0.50;
    Census2.MovingAverage := Av;
    // Define working days adjustments
    Census2.TraidingDaysAdjustment := TraidingDaysAdj.Auto;
    // Define parameters for period start
    Census2.StartPeriod.Year := 1;
    Census2.StartPeriod.MonthOrQuarter := 1;
    // Set Sigma level
    Census2.SigmaLevel.Lower := 0.9;
    Census2.SigmaLevel.Upper := 2;  
    // Calculate method
    res := Census2.Execute;
    If res <> 0 Then
        Debug.WriteLine(census2.Errors);
        Else
            Debug.WriteLine("=== Prior adjusted series ===");
            Debug.Indent;
            For i := 0 To Census2.Results.B1.Length - 1 Do
                Debug.WriteLine(Census2.Results.B1[i]);
            End For;
            Debug.Unindent;
            Debug.WriteLine("=== Seasonal component ===");
            Debug.Indent;
            For i := 0 To Census2.Results.D10.Length - 1 Do
                Debug.WriteLine(Census2.Results.D10[i]);
            End For;
            Debug.Unindent;
        End If;
End Sub UserProc;

After executing the example the console window displays calculation results for the X11 method:

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 
    Census2: SmCensus2;
    s: Array[36Of Double;
    Av: Array[12Of Double;
    res, i: Integer;
    B1, D10: System.Array;
Begin
    Census2 := New SmCensus2.Create();
    // Set explained series values
    s[0] := 670.2000183; s[12] := Double.Nan; s[24] := 826.6160466;
    s[1] := 576.0680563; s[13] := 642.418544; s[25] := Double.Nan;
    s[2] := 717.6484268; s[14] := Double.Nan; s[26] := 931.5707266;
    s[3] := 856.9105808; s[15] := Double.Nan; s[27] := 1026.666524;
    s[4] := 885.4609516; s[16] := 884.504279; s[28] := Double.Nan;
    s[5] := 1011.846431; s[17] := 1008.30908; s[29] := 1099.626392;
    s[6] := 995.4496292; s[18] := 1108.36628; s[30] := 1189.16892;
    s[7] := 1064.742231; s[19] := 1072.77175; s[31] := 1092.343791;
    s[8] := 1033.324656; s[20] := 1019.18752; s[32] := 1087.503861;
    s[9] := 780.8584552; s[21] := 895.560672; s[33] := 971.6522721;
    s[10] := 657.503313; s[22] := 811.036101; s[34] := 826.2502823;
    s[11] := 654.547579; s[23] := 756.617764; s[35] := 789.6322825;
    Census2.Serie.Value := s;
    // Define parameters of sample period
    Census2.ModelPeriod.FirstPoint := 1;
    Census2.ModelPeriod.LastPoint := 36;
     // Set missing data treatment method
    Census2.MissingData.Method := MissingDataMethod.mdmLinTrend;
    // Define parameters of seasonal component and seasonality type
    Census2.SeasonalComponent.Mode := SeasonalityType.sstMultiplicative;
    Census2.SeasonalComponentCycleType := SeasonalityCycleType.sctMonth;
    // Define moving average
    Av[0] := 0.02; Av[2] := 0.20;
    Av[1] := 0.10; Av[3] := 0.50;
    Census2.MovingAverage := Av;
    // Define working days adjustments
    Census2.TraidingDaysAdjustment := TraidingDaysAdj.tdaAuto;
    // Define parameters for period start
    Census2.StartPeriod.Year := 1;
    Census2.StartPeriod.MonthOrQuarter := 1;
    // Set Sigma level
    Census2.SigmaLevel.Lower := 0.9;
    Census2.SigmaLevel.Upper := 2;  
    // Calculate method
    res := Census2.Execute();
    If res <> 0 Then
        System.Diagnostics.Debug.WriteLine(census2.Errors);
        Else
            System.Diagnostics.Debug.WriteLine("=== Prior adjusted series ===");
            System.Diagnostics.Debug.Indent();
            B1 := Census2.Results.B1;
            For i := 0 To Census2.Results.B1.Length - 1 Do
                System.Diagnostics.Debug.WriteLine(B1[i]);
            End For;
            System.Diagnostics.Debug.Unindent();
            System.Diagnostics.Debug.WriteLine("=== Seasonal component ===");
            System.Diagnostics.Debug.Indent();
            D10 := Census2.Results.D10;
            For i := 0 To Census2.Results.D10.Length - 1 Do
                System.Diagnostics.Debug.WriteLine(D10[i]);
            End For;
            System.Diagnostics.Debug.Unindent();
        End If;
End Sub;

See also:

ISmCensus2