I think I'm finished with Durbin-Watson for the moment: there's
now a --dw-pval option to OLS and fixed effects estimation, which
tells gretl to compute the p-value for the D-W statistic (using
the Imhof method), hence making this statistic more useful (albeit
at the cost of computations which could be quite time-consuming
for big datasets).
In the course of developing this I added 3 functions (and
documented 2 of them). But I wonder if it's worth keeping any of
them and I'd like to hear people's preferences. (To my mind, we
don't want to multiply functions unnecessarily, since this makes
it harder to find what you're looking for.) The functions in
question are:
* dwmat (takes one scalar argument, n): produces a tridiagonal
Durbin-Watson matrix of order n. This can be done with standard
matrix functions but it's a bit fiddly. Would anyone like to see
this kept as a public function in "genr"?
* dwpval (two matrix arguments, u and X): computes the p-value for
the Durbin watson statistic given a column vector of residuals, u,
and a regressor matrix, X. Probably too specialized to keep, if
we now have the --dw-pval option?
* imhof (matrix m, scalar x): computes Prob(u'Au < x) for a
quadratic form in standard normal variates, u. If the argument m
is a square matrix it is taken to be 'A', otherwise if it's a
column vector it is taken to be the precomputed eigenvalues of A
(otherwise error). This is not documented at present, but it's
more general than the other 2 functions and maybe is worth
documenting and keeping?
Allin