On Sun, 15 Apr 2018, Allin Cottrell wrote:
> However, jack's longrunvar() function has an additional
factor 1/T in the
> result, and it seems to me this is correct (thus, missing in lrcovar as of
> now).
Yes, I was thinking the magnitude looked off, and 1/T would be the
difference. It seems that gets applied at a later stage (than HAC_XOX) in the
process of constructing a HAC covariance matrix in libgretl. But it would of
course be easy to apply it within lrcovar().
> Another difference is that lrcovar(X) corresponds to longrunvar(X, 1),
> assuming demeaned data. The question is whether to make the user
> responsible for demeaning or to offer it as an option.
Easy enough to make it an option if that's desirable.
Both things now in git. Sven could you check if the following is the
behaviour you had in mind?
<hansl>
set seed 878685
X = mnormal(40,3)
A = lrcovar(X)
B = lrcovar(X, 1)
C = lrcovar(X, 0)
D = lrcovar(cdemean(X))
print A B C D
</hansl>
<output>
A (3 x 3)
0.88410 0.19238 0.12571
0.19238 0.62436 0.033675
0.12571 0.033675 1.5064
B (3 x 3)
0.88410 0.19238 0.12571
0.19238 0.62436 0.033675
0.12571 0.033675 1.5064
C (3 x 3)
0.87837 0.20538 0.11327
0.20538 0.59977 0.054805
0.11327 0.054805 1.4896
D (3 x 3)
0.87837 0.20538 0.11327
0.20538 0.59977 0.054805
0.11327 0.054805 1.4896
</output>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------