ISmCensus2.Output

Fore Syntax

Output: Array;

Fore.NET Syntax

Output: System.Array;

Description

The Output property returns the string array that contains the output file generated by the SEATS external programs x11ss.exe and1q2.exe.

Comments

The output file is formed by the program:

Fore Example

To execute the example, add links to the Stat, Io system assemblies.

Sub UserProc;
Var
    Census2: SmCensus2;
    res, i: Integer;
    s: Array[36Of Double;
    W: Array[7Of Double;
    TextW: ITextWriter;
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] := 762.3903317;
    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] := 1114.124119;
    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;
    Census2.ModelPeriod.FirstPoint := 1;
    Census2.ModelPeriod.LastPoint := 36;
    Census2.MissingData.Method := MissingDataMethod.LinTrend;
    Census2.SeasonalComponent.Mode := SeasonalityType.Multiplicative;
    Census2.SeasonalComponentCycleType := SeasonalityCycleType.Month;
    W[0] := 0.50; W[4] := 1.00;
    W[1] := 1.00; W[5] := 1.00;
    W[2] := 1.00; W[6] := 1.00;
    W[3] := 1.00;
    Census2.DailyWeights := W;
    Census2.TraidingDaysAdjustment := TraidingDaysAdj.Auto;
    Census2.StartPeriod.Year := 1;
    Census2.StartPeriod.MonthOrQuarter := 1;
    Census2.Holday := Census2HolidayAdjType.C2hatEaster;
    Census2.SSAnalysis := False;
    res := Census2.Execute;
    If res<>0 Then
        Debug.WriteLine(census2.Errors);
        Else
            // saving to file:
            TextW := File.OpenTextWriter("C:\Stat_test\Massiv.txt"True);
            For i := 0 To Census2.Output.Length - 1 Do
                TextW.WriteLnString(Census2.Output[i]);
            End For;
    End If;
End Sub UserProc;

After executing the example the output file, that contains calculations by set parameters, is formed.

Fore.NET Example

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

Imports System.IO;
Imports Prognoz.Platform.Interop.Stat;

Public Shared Sub Main(Params: StartParams);
Var
    Census2: SmCensus2;
    res, i: integer;
    s: Array[36Of double;
    W: Array[7Of double;
    NormDailyWeights, Output: System.Array;
    TextW: StreamWriter;
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] := 762.3903317;
    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] := 1114.124119;
    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;
    Census2.ModelPeriod.FirstPoint := 1;
    Census2.ModelPeriod.LastPoint := 36;
    Census2.MissingData.Method := MissingDataMethod.mdmLinTrend;
    Census2.SeasonalComponent.Mode := SeasonalityType.sstMultiplicative;
    Census2.SeasonalComponentCycleType := SeasonalityCycleType.sctMonth;
    W[0] := 0.50; W[4] := 1.00;
    W[1] := 1.00; W[5] := 1.00;
    W[2] := 1.00; W[6] := 1.00;
    W[3] := 1.00;
    Census2.DailyWeights := W;
    Census2.TraidingDaysAdjustment := TraidingDaysAdj.tdaAuto;
    Census2.StartPeriod.Year := 1;
    Census2.StartPeriod.MonthOrQuarter := 1;
    Census2.Holday := Census2HolidayAdjType.C2hatEaster;
    Census2.SSAnalysis := False;
    res := Census2.Execute();
    If res<>0 Then
        System.Diagnostics.Debug.WriteLine(census2.Errors);
        Else
            // saving to file:
            Output := Census2.Output;
            TextW := File.CreateText("C:\Massiv.txt");
            For i := 0 To Census2.Output.Length - 1 Do
                TextW.WriteLine(Output[i]);
            End For;
    End If;
End Sub;

See also:

ISmCensus2