Got the first part: by the ln transformation one can get along with the minus with the inv,Am 09.11.2012 12:36, schrieb Riccardo (Jack) Lucchetti:
On Sat, 3 Nov 2012, Pindar wrote:Thanks for that explanation.
Update 2:
There is a small bug in the SVAR package when writing the free parameters into the model (in the last step).
Just run the hansl snippet.
Not really a bug. The vector containing the unrestricted parameters only is implicitly defined by the relationship (allow me to use LaTeX)
\[
\theta = S \gamma + s
\]
where $\theta$ contains the total vector of parameters and $\gamma$ the unrestricted ones. Now, in the SVAR package the matrix $S$ is automatically defined via the constraint matrices in implicit form $R \theta = d$ through the relationships $RS = 0$ and $Rs = d$. This means that $S$ is defined up to post-multiplication by an arbitrary invertible matrix. As a consequence, you can change the ordering of the columns of $S$ in any way you want, but of course this will affect the ordering of the elements of $\gamma$; this fact, however, is observationally inconsequential.
In terms of estimating the SVAR a have another question:
Why is it this equation ll=-0.5*(tr(inv(C*C')*Sigma)-ln(det(inv(C*C')))) that works
and not this equation ll=-0.5*(tr(inv(C*C')*Sigma)-ln(det(C*C'))) which one finds in Luetkepohl on p. 372 ?
Btw, if one wants to estimate the C- and VAR- parameters jointly (not using the concentrated ll)
should it be possible with numeric derivatives? I didn't succeed with the VAR in MLE form with 'deriv' statement...
Just this:
<hansl>
matrix A=vec(zeros(n,p*n))
mle llm=-n*T/2*ln(2*$pi)-T/2*ln(det(vcv))-0.5*tr(vcv*T*inv(vcv))
matrix U=mY[p+1:T,]'-mshape(A,n,p*n)*mreg[p+1:T,]'
matrix vcv=U*U'/T
params A
end mle
<hansl>
I found 2 typos in the help pdf for the SVAR package, and the references are only "?" (a bibtex problem):
1. p10 under 2.4: it's $\frac { n(n-1) }{ 2 } $ restrictions
2. p. 21 under SVAR.cumulate: Stores into the model
Done, thanks.
a) In his book on page 367 (section 9.1.3) the Rd matrix (following the notation of Jack) seems to me wrong.
It is, there's a typo for the R matrix with the constarints for the A matrix. Element [5,2] of R should be 0 instead of 1. Typical copy-n-paste mishap. I guess you ought to tell Helmut for the next edition of his book.
--------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti@univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
--------------------------------------------------
_______________________________________________ Gretl-users mailing list Gretl-users@lists.wfu.edu http://lists.wfu.edu/mailman/listinfo/gretl-users