Explained: ISlSerie;
Explained: Prognoz.Platform.Interop.Stat.ISlSerie;
The Explained property returns the explained series.
The number of observations in the explained series cannot be smaller than the number of estimated parameters.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
po: SmPhillipsOuliarisTest;
can, fra, ger: Array[43] Of Double;
kernel: Array[2] Of Double;
res, i: Integer;
d: Integer = 2;
Begin
po := New SmPhillipsOuliarisTest.Create;
// Values of variables:
can[00] := 6209; can[01] := 6385; can[02] := 6752; can[03] := 6837;
can[04] := 6495; can[05] := 6907; can[06] := 7349; can[07] := 7213;
can[08] := 7061; can[09] := 7180; can[10] := 7132; can[11] := Double.Nan;
can[12] := 7473; can[13] := 7722; can[14] := 8088; can[15] := Double.Nan;
can[16] := 8941; can[17] := 9064; can[18] := 9380; can[19] := 9746;
can[20] := 9907; can[21] := 10333; can[22] := 10863; can[23] := Double.Nan;
can[24] := 12242; can[25] := 12227; can[26] := 12910; can[27] := 13049;
can[28] := 13384; can[29] := 14036; can[30] := 14242; can[31] := 14704;
can[32] := 13802; can[33] := 14197; can[34] := 15010; can[35] := 15589;
fra[00] := 4110; fra[01] := 4280; fra[02] := 4459; fra[03] := 4545;
fra[04] := 4664; fra[05] := 4861; fra[06] := 5195; fra[07] := 5389;
fra[08] := 5463; fra[09] := 5610; fra[10] := 5948; fra[11] := 6218;
fra[12] := 6521; fra[13] := 6788; fra[14] := 7222; fra[15] := 7486;
fra[16] := 7832; fra[17] := 8153; fra[18] := 8468; fra[19] := 9054;
fra[20] := 9499; fra[21] := 9866; fra[22] := 10217; fra[23] := 10763;
fra[24] := 10683; fra[25] := 10494; fra[26] := 10938; fra[27] := 11198;
fra[28] := 11546; fra[29] := 11865; fra[30] := 11781; fra[31] := 11681;
fra[32] := 11903; fra[33] := 11900; fra[34] := 11986; fra[35] := 12206;
ger[00] := 3415; ger[01] := 3673; ger[02] := 4013; ger[03] := 4278;
ger[04] := 4577; ger[05] := 5135; ger[06] := 5388; ger[07] := 5610;
ger[08] := 5787; ger[09] := 6181; ger[10] := 6633; ger[11] := 6910;
ger[12] := 7146; ger[13] := 7248; ger[14] := 7689; ger[15] := 8046;
ger[16] := 8143; ger[17] := 8064; ger[18] := 8556; ger[19] := 9177;
ger[20] := 9705; ger[21] := 9923; ger[22] := 10268; ger[23] := 10681;
ger[24] := 10448; ger[25] := 10366; ger[26] := 10958; ger[27] := 11292;
ger[28] := 11726; ger[29] := 12172; ger[30] := 12058; ger[31] := 11804;
ger[32] := 11682; ger[33] := 12001; ger[34] := 12300; ger[35] := 12535;
// Sample period:
po.ModelPeriod.FirstPoint := 1;
po.ModelPeriod.LastPoint := 35;
// Explained series:
po.Explained.Value := can;
// Cointegration regressors:
po.CointegratingRegressors.Clear;
po.CointegratingRegressors.Add.Value := fra;
// Deterministic regressors:
po.DeterministicRegressors.Clear;
po.DeterministicRegressors.Add.Value := ger;
// Missing data treatment:
po.MissingData.Method := MissingDataMethod.Casewise;
// Trend specification:
po.TrendSpecification := TrendSpecificationType.LinearNone;
// Long-term covariance settings:
po.HACOptions.LRCLagSpecification := LRCLagSpecificationType.AutoAIC;
po.HACOptions.NumberOfLags := 1;
po.HACOptions.LRCKernel := LRCKernelType.UserSpecified;
kernel[0] := 1; kernel[1] := 2;
po.HACOptions.KernelVector := kernel;
po.HACOptions.LRCBandwidthMethod := LRCBandwidthMethodType.UserSpecified;
po.HACOptions.BandwidthValue := 1.00;
// Calculate model:
res := po.Execute;
Debug.WriteLine(po.Errors);
For i := 0 To po.WarningsCount-1 Do
Debug.WriteLine(po.Warnings[i]);
End For;
Debug.WriteLine("=== Test statistics ===");
Debug.Indent;
Debug.WriteLine("Tau "+po.TauStat.Statistic.ToString + " " + po.TauStat.Probability.ToString);
Debug.WriteLine("Z "+po.ZStat.Statistic.ToString + " " + po.ZStat.Probability.ToString);
Debug.Unindent;
Debug.WriteLine("=== Model coefficient estimates ===");
Debug.Indent;
For i := 0 To po.ModelCoefficients.Estimate.Length-1 Do
Debug.WriteLine(po.ModelCoefficients.Estimate[i].ToString + " "
+ po.ModelCoefficients.StandardError[i].ToString + " "
+ po.ModelCoefficients.TStatistic[i].ToString + " "
+ po.ModelCoefficients.Probability[i].ToString);
End For;
Debug.Unindent;
Debug.WriteLine("=== Auxiliary regression characteristics ===");
Debug.Indent;
Debug.WriteLine("Determination coefficient: " + po.SummaryStatistics.R2.ToString);
Debug.WriteLine("Adjusted determination coefficient: " + po.SummaryStatistics.AdjR2.ToString);
Debug.WriteLine("Standard regression error: " + po.SummaryStatistics.SE.ToString);
Debug.WriteLine("Durbin-Watson statistic: " + po.SummaryStatistics.DW.ToString);
Debug.Unindent;
End Sub UserProc;
After executing the example the console window displays the following:
Test statistics values.
Estimations of model coefficients.
Auxiliary regression characteristics.
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
po: SmPhillipsOuliarisTest;
can, fra, ger: Array[43] Of double;
kernel: Array Of double;
res, i: integer;
d: integer = 2;
Warnings, Est, StError, TStat, Prob: System.Array;
Begin
po := New SmPhillipsOuliarisTest.Create();
// Values of variables:
can[00] := 6209; can[01] := 6385; can[02] := 6752; can[03] := 6837;
can[04] := 6495; can[05] := 6907; can[06] := 7349; can[07] := 7213;
can[08] := 7061; can[09] := 7180; can[10] := 7132; can[11] := Double.Nan;
can[12] := 7473; can[13] := 7722; can[14] := 8088; can[15] := Double.Nan;
can[16] := 8941; can[17] := 9064; can[18] := 9380; can[19] := 9746;
can[20] := 9907; can[21] := 10333; can[22] := 10863; can[23] := Double.Nan;
can[24] := 12242; can[25] := 12227; can[26] := 12910; can[27] := 13049;
can[28] := 13384; can[29] := 14036; can[30] := 14242; can[31] := 14704;
can[32] := 13802; can[33] := 14197; can[34] := 15010; can[35] := 15589;
fra[00] := 4110; fra[01] := 4280; fra[02] := 4459; fra[03] := 4545;
fra[04] := 4664; fra[05] := 4861; fra[06] := 5195; fra[07] := 5389;
fra[08] := 5463; fra[09] := 5610; fra[10] := 5948; fra[11] := 6218;
fra[12] := 6521; fra[13] := 6788; fra[14] := 7222; fra[15] := 7486;
fra[16] := 7832; fra[17] := 8153; fra[18] := 8468; fra[19] := 9054;
fra[20] := 9499; fra[21] := 9866; fra[22] := 10217; fra[23] := 10763;
fra[24] := 10683; fra[25] := 10494; fra[26] := 10938; fra[27] := 11198;
fra[28] := 11546; fra[29] := 11865; fra[30] := 11781; fra[31] := 11681;
fra[32] := 11903; fra[33] := 11900; fra[34] := 11986; fra[35] := 12206;
ger[00] := 3415; ger[01] := 3673; ger[02] := 4013; ger[03] := 4278;
ger[04] := 4577; ger[05] := 5135; ger[06] := 5388; ger[07] := 5610;
ger[08] := 5787; ger[09] := 6181; ger[10] := 6633; ger[11] := 6910;
ger[12] := 7146; ger[13] := 7248; ger[14] := 7689; ger[15] := 8046;
ger[16] := 8143; ger[17] := 8064; ger[18] := 8556; ger[19] := 9177;
ger[20] := 9705; ger[21] := 9923; ger[22] := 10268; ger[23] := 10681;
ger[24] := 10448; ger[25] := 10366; ger[26] := 10958; ger[27] := 11292;
ger[28] := 11726; ger[29] := 12172; ger[30] := 12058; ger[31] := 11804;
ger[32] := 11682; ger[33] := 12001; ger[34] := 12300; ger[35] := 12535;
// Sample period:
po.ModelPeriod.FirstPoint := 1;
po.ModelPeriod.LastPoint := 35;
// Explained series:
po.Explained.Value := can;
// Cointegration regressors:
po.CointegratingRegressors.Clear();
po.CointegratingRegressors.Add().Value := fra;
// Deterministic regressors:
po.DeterministicRegressors.Clear();
po.DeterministicRegressors.Add().Value := ger;
// Missing data treatment:
po.MissingData.Method := MissingDataMethod.mdmCasewise;
// Trend specification:
po.TrendSpecification := TrendSpecificationType.tstLinearNone;
// Long-term covariance settings:
po.HACOptions.LRCLagSpecification := LRCLagSpecificationType.lrclsAutoAIC;
po.HACOptions.NumberOfLags := 1;
po.HACOptions.LRCKernel := LRCKernelType.lrckUserSpecified;
kernel[0] := 1; kernel[1] := 2;
po.HACOptions.KernelVector := kernel;
po.HACOptions.LRCBandwidthMethod := LRCBandwidthMethodType.lrcbmUserSpecified;
po.HACOptions.BandwidthValue := 1.00;
// Model calculation:
res := po.Execute();
System.Diagnostics.Debug.WriteLine(po.Errors);
Warnings := po.Warnings;
For i := 0 To po.WarningsCount-1 Do
System.Diagnostics.Debug.WriteLine(Warnings[i]);
End For;
System.Diagnostics.Debug.WriteLine("=== Test statistics ===");
System.Diagnostics.Debug.Indent();
System.Diagnostics.Debug.WriteLine("Tau "+po.TauStat.Statistic.ToString() + " " + po.TauStat.Probability.ToString());
System.Diagnostics.Debug.WriteLine("Z "+po.ZStat.Statistic.ToString() + " " + po.ZStat.Probability.ToString());
System.Diagnostics.Debug.Unindent();
System.Diagnostics.Debug.WriteLine("=== Model coefficient estimates
System.Diagnostics.Debug.Indent();
Est := po.ModelCoefficients.Estimate;
StError := po.ModelCoefficients.StandardError;
TStat := po.ModelCoefficients.TStatistic;
Prob := po.ModelCoefficients.Probability;
For i := 0 To po.ModelCoefficients.Estimate.Length-1 Do
System.Diagnostics.Debug.WriteLine(Est[i].ToString() + " " + StError[i].ToString() + " "
+ TStat[i].ToString() + " " + Prob[i].ToString());
End For;
System.Diagnostics.Debug.Unindent();
System.Diagnostics.Debug.WriteLine("=== Auxiliary regression characteristics ===");
System.Diagnostics.Debug.Indent();
System.Diagnostics.Debug.WriteLine("Determination coefficient: " + po.SummaryStatistics.R2.ToString());
System.Diagnostics.Debug.WriteLine("Adjusted determination coefficient: " + po.SummaryStatistics.AdjR2.ToString());
System.Diagnostics.Debug.WriteLine("Standard regression error: " + po.SummaryStatistics.SE.ToString());
System.Diagnostics.Debug.WriteLine("Durbin-Watson statistic: " + po.SummaryStatistics.DW.ToString());
System.Diagnostics.Debug.Unindent();
End Sub;
See also: