InitCorrection: InitCorrectionType;
InitCorrection: Prognoz.Platform.Interop.Stat.InitCorrectionType;
The InitCorrection property determines the type of initial correction.
The default value is "Without Initial Correction".
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
sp: SmUnivariateSpectrumAnalysis;
d0: Double;
res, i: Integer;
s96: Array[96] Of Double;
Begin
// values s96
s96[0] := 670.2000183; s96[24] := 826.6160466; s96[48] := 785.0711692; s96[72] := 980.5658132;
s96[1] := 576.0680563; s96[25] := 762.3903317; s96[49] := 761.0719932; s96[73] := 866.2215033;
s96[2] := 717.6484268; s96[26] := 931.5707266; s96[50] := 947.4974517; s96[74] := 1126.795343;
s96[3] := 856.9105808; s96[27] := 1026.666524; s96[51] := 1051.614521; s96[75] := 922.6756188;
s96[4] := 885.4609516; s96[28] := 1114.124119; s96[52] := 1038.031434; s96[76] := 1213.484115;
s96[5] := 1011.846431; s96[29] := 1099.626392; s96[53] := 1269.669118; s96[77] := 1429.951109;
s96[6] := 995.4496292; s96[30] := 1189.16892; s96[54] := 1250.568896; s96[78] := 1393.155889;
s96[7] := 1064.74221; s96[31] := 1092.343791; s96[55] := 1242.964721; s96[79] := 1397.839534;
s96[8] := 1033.324656; s96[32] := 1087.503861; s96[56] := 1359.910672; s96[80] := 1560.629719;
s96[9] := 780.8584552; s96[33] := 971.6522721; s96[57] := 1059.43263; s96[81] := 1262.559587;
s96[10] := Double.Nan; s96[34] := 826.2502823; s96[58] := 829.5055086; s96[82] := 1106.38667;
s96[11] := Double.Nan; s96[35] := 789.6322825; s96[59] := 922.226722; s96[83] := 1220.496902;
s96[12] := Double.Nan; s96[36] := 797.0210578; s96[60] := 889.6157109; s96[84] := 1084.077822;
s96[13] := 642.4128544; s96[37] := 770.0206; s96[61] := 889.6514481; s96[85] := Double.Nan;
s96[14] := 751.9611194; s96[38] := 832.1481674; s96[62] := 1055.365032; s96[86] := 1356.982208;
s96[15] := Double.Nan; s96[39] := 1014.565844; s96[63] := 1035.479751; s96[87] := 1302.578692;
s96[16] := 884.5042879; s96[40] := 980.4343089; s96[64] := 1123.232398; s96[88] := 1261.796503;
s96[17] := 1008.308908; s96[41] := 1195.843135; s96[65] := 1080.150853; s96[89] := 1523.625843;
s96[18] := 1108.363628; s96[42] := 1117.405835; s96[66] := 1084.516221; s96[90] := 1432.15598;
s96[19] := 1072.737175; s96[43] := 1142.834834; s96[67] := 1243.115787; s96[91] := 1429.168126;
s96[20] := 1019.183752; s96[44] := 1239.704489; s96[68] := 1430.027497; s96[92] := 1631.452101;
s96[21] := 895.5601672; s96[45] := 964.1215552; s96[69] := 1104.694113; s96[93] := 1202.222633;
s96[22] := 811.0306101; s96[46] := 795.3455; s96[70] := 931.8794214; s96[94] := 1200.217811;
s96[23] := 756.601764; s96[47] := 977.5900449; s96[71] := 1122.668569; s96[95] := 1263.781915;
sp := New SmUnivariateSpectrumAnalysis.Create;
sp.Serie.Value := s96;
sp.ModelPeriod.FirstPoint := 1;
sp.ModelPeriod.LastPoint := 96;
sp.MissingData.Method := MissingDataMethod.SampleAverage;
sp.DataProportion := 0.1;
sp.LagWindow := LagWindowType.Rectangular;
sp.InitCorrection := InitCorrectionType.TrendCorrection;
sp.CutOffPoint := 23;
sp.FastFourierTransformOrder := 256;
res := sp.Execute;
If res<>0 Then
Debug.WriteLine(sp.Errors);
Else
For i := 1 To sp.Spectrum.Length Do
d0 := sp.Spectrum[i-1];
Debug.WriteLine(i.ToString + ", " + d0.ToString);
End For;
End If;
End Sub UserProc;
Executing this example shows spectral concentration in the console window.
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
sp: SmUnivariateSpectrumAnalysis;
d0: double;
res, i: integer;
s96: Array[96] Of double;
Spect: System.Array;
Begin
// values s96
s96[0] := 670.2000183; s96[24] := 826.6160466; s96[48] := 785.0711692; s96[72] := 980.5658132;
s96[1] := 576.0680563; s96[25] := 762.3903317; s96[49] := 761.0719932; s96[73] := 866.2215033;
s96[2] := 717.6484268; s96[26] := 931.5707266; s96[50] := 947.4974517; s96[74] := 1126.795343;
s96[3] := 856.9105808; s96[27] := 1026.666524; s96[51] := 1051.614521; s96[75] := 922.6756188;
s96[4] := 885.4609516; s96[28] := 1114.124119; s96[52] := 1038.031434; s96[76] := 1213.484115;
s96[5] := 1011.846431; s96[29] := 1099.626392; s96[53] := 1269.669118; s96[77] := 1429.951109;
s96[6] := 995.4496292; s96[30] := 1189.16892; s96[54] := 1250.568896; s96[78] := 1393.155889;
s96[7] := 1064.74221; s96[31] := 1092.343791; s96[55] := 1242.964721; s96[79] := 1397.839534;
s96[8] := 1033.324656; s96[32] := 1087.503861; s96[56] := 1359.910672; s96[80] := 1560.629719;
s96[9] := 780.8584552; s96[33] := 971.6522721; s96[57] := 1059.43263; s96[81] := 1262.559587;
s96[10] := Double.Nan; s96[34] := 826.2502823; s96[58] := 829.5055086; s96[82] := 1106.38667;
s96[11] := Double.Nan; s96[35] := 789.6322825; s96[59] := 922.226722; s96[83] := 1220.496902;
s96[12] := Double.Nan; s96[36] := 797.0210578; s96[60] := 889.6157109; s96[84] := 1084.077822;
s96[13] := 642.4128544; s96[37] := 770.0206; s96[61] := 889.6514481; s96[85] := Double.Nan;
s96[14] := 751.9611194; s96[38] := 832.1481674; s96[62] := 1055.365032; s96[86] := 1356.982208;
s96[15] := Double.Nan; s96[39] := 1014.565844; s96[63] := 1035.479751; s96[87] := 1302.578692;
s96[16] := 884.5042879; s96[40] := 980.4343089; s96[64] := 1123.232398; s96[88] := 1261.796503;
s96[17] := 1008.308908; s96[41] := 1195.843135; s96[65] := 1080.150853; s96[89] := 1523.625843;
s96[18] := 1108.363628; s96[42] := 1117.405835; s96[66] := 1084.516221; s96[90] := 1432.15598;
s96[19] := 1072.737175; s96[43] := 1142.834834; s96[67] := 1243.115787; s96[91] := 1429.168126;
s96[20] := 1019.183752; s96[44] := 1239.704489; s96[68] := 1430.027497; s96[92] := 1631.452101;
s96[21] := 895.5601672; s96[45] := 964.1215552; s96[69] := 1104.694113; s96[93] := 1202.222633;
s96[22] := 811.0306101; s96[46] := 795.3455; s96[70] := 931.8794214; s96[94] := 1200.217811;
s96[23] := 756.601764; s96[47] := 977.5900449; s96[71] := 1122.668569; s96[95] := 1263.781915;
sp := New SmUnivariateSpectrumAnalysis.Create();
sp.Serie.Value := s96;
sp.ModelPeriod.FirstPoint := 1;
sp.ModelPeriod.LastPoint := 96;
sp.MissingData.Method := MissingDataMethod.mdmSampleAverage;
sp.DataProportion := 0.1;
sp.LagWindow := LagWindowType.lwtRectangular;
sp.InitCorrection := InitCorrectionType.icTrendCorrection;
sp.CutOffPoint := 23;
sp.FastFourierTransformOrder := 256;
res := sp.Execute();
If res<>0 Then
System.Diagnostics.Debug.WriteLine(sp.Errors);
Else
Spect := sp.Spectrum;
For i := 1 To sp.Spectrum.Length Do
d0 := Spect[i-1] As double;
System.Diagnostics.Debug.WriteLine(i.ToString() + ", " + d0.ToString());
End For;
End If;
End Sub;
See also: