On Wed, 5 Oct 2011, Simon Ouellette wrote:
Hi,
I was just wondering what estimation method is used exactly in the
Johansen_stage_1 function (the first step, VAR estimation, of the
Johansen test) of lib/var.c. From looking at the code, it seems like
it might be the 2-step Least Squares method -- but I'm not clear on
where in the code the fitted values are plugged in, it's almost as if
X is never changed between the first and second OLS. Also the comment
refers to log-likelihood.
So is it 2SLS, or is it some maximum likelihood method like FIML? (or
something else)
It isn't 2SLS; it's just plain OLS --- which in this special case happens
to be a simple way to get FIML (for the VEC model the unrestricted ML
estimator can be computed in closed form, and OLS is a nice and simple way
to do it). And yes, the 2nd time ols is executed the regressors are
exactly the same.
In practice, the C function johansen_stage_1 is nearly a step-by-step C
translation[*] of the algorithm described in section 2.2 of Johansen
(1995) "Likelihood-based inference in cointegrated vector autoregressive
models", Oxford University Press. If you're even remotely interested in
time-series analysis, that book is a classic must-read.
It's nice having people who read the source and ask questions. It feels
good!
[*] Looking at the code, it occurs to me that it may be possible to make
it computationally a bit more efficient, possibly at the expense of
readability, but I don't think that anyboby has ever complained about the
"vecm" command being slow, right?
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti