DurbinWatsonProbabilities(DW: Double; N: Integer; K: Integer; Var pL: Double; Var pU: Double);
DurbinWatsonProbabilities(DW: double; N: integer; K: integer; var pL: double; var pU: double);
DW. Durbin-Watson statistic.
N. Number of observations.
K. Number of model variables including constant.
pL. Probability value of the lower limit of the Durbin-Watson statistics range.
pU. Probability value of the upper limit of the Durbin-Watson statistics range.
The DurbinWatsonProbabilities method calculates probability values of Durbin-Watson statistics range bounds.
After executing the method the pL and pU parameters take probability values of the lower and upper limits of the Durbin-Watson statistics range.
If the statistic DW > 2, probabilities are calculated for the value DW' = 4 - DW, and there is negative residuals autocorrelation.
If N ≤ 60, probabilities are calculated by the Pan’s algorithm, if N > 60, they are calculated by normal approximation.
Interpretation of results:
Let α is a set significance level (1, 2.5 or 5%):
If pl≤ α, zero hypothesis is rejected, there is residuals autocorrelation.
If pl > α, and pu ≤ α there is uncertainty.
If pl > α, zero hypothesis is not rejected, there is no autocorrelation.
Add a link to the Stat system assembly.
Sub UserProc;
Var
Stat: Statistics;
N, K, alpha: Integer;
DW, pU, pL: Double;
Begin
Stat := New Statistics.Create;
// Set number of observations
N := 20;
// Set number of model variables
K := 5;
// Set Durbin-Watson statistics value
DW := 1.6;
// Calculate probability values of the lower and upper bounds of the Durbin-Watson statistics range
Stat.DurbinWatsonProbabilities(DW, N, K, pL, pU);
// Output lower and upper range bounds
Debug.WriteLine("Probability of the lower range bound: " + pL.ToString);
Debug.WriteLine("Probability of the upper range bound: " + pU.ToString);
//Check hypothesis on the significance level 5%
alpha := 5;
Debug.WriteLine("Check hypothesis:");
If( pL <= alpha/100 )Then
Debug.WriteLine("Zero hypothesis is rejected, autocorrelation coefficient p <> 0, there is residuals autocorrelation");
End If;
If(( pL > alpha/100 )And( pU <= alpha/100 ))Then
Debug.WriteLine(" Uncertainty ");
End If;
If( pU > alpha/100 )Then
Debug.WriteLine("Zero hypothesis is accepted, autocorrelation coefficient p = 0, there is not residuals autocorrelation");
End If;
End Sub UserProc;
After executing the example the console window displays probability values of the lower and upper bounds of the Durbin-Watson statistics range, the hypothesis about residuals autocorrelation is checked.
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
Stat: Statistics;
N, K, alpha: Integer;
DW, pU, pL: Double;
Begin
Stat := New Statistics.Create();
// Set number of observations
N := 20;
// Set number of model variables
K := 5;
// Set Durbin-Watson statistics value
DW := 1.6;
// Calculate probability values of the lower and upper bounds of the Durbin-Watson statistics range
Stat.DurbinWatsonProbabilities(DW, N, K, Var pL, Var pU);
// Output lower and upper range bounds
System.Diagnostics.Debug.WriteLine("Probability of the lower range bound: " + pL);
System.Diagnostics.Debug.WriteLine("Probability of the upper range bound: " + pU);
//Check hypothesis on the significance level 5%
alpha := 5;
System.Diagnostics.Debug.WriteLine("Check hypothesis:");
If (pL <= alpha / 100) Then
System.Diagnostics.Debug.WriteLine("Zero hypothesis is rejected, " +
"autocorrelation coefficient p <> 0, there is residual autocorrelation" );
End If;
If ((pL > alpha / 100) And (pU <= alpha / 100)) Then
System.Diagnostics.Debug.WriteLine(" Uncertainty ");
End If;
If (pU > alpha / 100) Then
System.Diagnostics.Debug.WriteLine("Zero hypothesis is accepted, " +
"correlation coefficient p = 0, no residual autocorrelation" );
End If;
End Sub;
See also: