On Wed, 3 Dec 2008, Allin Cottrell wrote:
I think I'm finished with Durbin-Watson for the moment
[...]
As you know, I'm not a big fan of the DW statistic, but I admit this has
its usefulness, so thank you for your work.
* 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"?
Granted, since we have that function internally, the cost of exposing it
as a genr function is close to zero. IMHO, on the other hand, we should
keep our namespace as clean as possible, so genr functions should only be
provided when both the following conditions are met:
1) the C implementation is substantially more efficient than a
user-written function
2) its purpose is reasonably general.
Now, I can't think at the moment of any context (other than DW) in which
such a function may be needed, but there may be well some. Ideas, anyone?
* 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?
I guess the --dw-pval option should suffice in most cases, if not all.
* 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?
I quite like this one.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti