Am 16.04.2018 um 17:00 schrieb Allin Cottrell:
On Mon, 16 Apr 2018, Sven Schreiber wrote:
> Yes, it's a bit complex to track this down (at least for me).
I'm
> looking at qr_make_vcv and it seems that (only) the diagonal is
> multiplied with pmod->sigma. My best guess so far is that that's where
> the factor 1/T (or its square root) comes in and that actually only
> the diagonal of that matrix is really usable.
If you're computing a HAC vcv manually you don't want the "XOX" matrix
divided by T, since that is handled by the sandwiching with inv(X'X).
Hmm, but look at section 19.3 of the gretl guide. I take it that we
refer to X'\Omega X = Sigma as the XOX matrix (leaving hats aside). This
_is_ divided by T because all the Gammas that it is made of have the 1/T
factor. And consequently Sigma is explicitly referred to as the long-run
covariance (of X'u), irrespective of whether it's sandwiched or not.
In contrast, in HAC_XOX I only see running sums, not the 1/T factor that
makes those things an average. (But I'm not good at reading the gretl C
code, so I may have missed something.)
(And you don't need demeaning if X and u are supposed to be
orthogonal.)
Right.
In current git lrcovar divides by T and assumes demeaning is needed
by
default, so here's how one would replicate the built-in calculation.
Very good, thanks.
cheers,
sven