On Fri, 23 Aug 2019, Sven Schreiber wrote:
Hi,
in the GUI it is easy to get a plot of estimated VAR residuals.
But it seems surprisingly difficult to do the same thing via scripting.
I can save the residuals by $uhat, but that gives me a matrix (not a
variable list), and converting the columns in that matrix to series
fails because of length mismatch.
I know I _could_ adjust the workfile sample to match the effective
sample of the VAR and then the conversion to series would work, but that
feels quite clumsy. (And have to reset the workfile sample afterwards.)
Any recommendations how to achieve that quick and easy?
This should do it:
<hansl>
set verbose off
open denmark.gdt --quiet
list X = LRM LRY IBO IDE
var 4 X --silent
matrix U = $uhat
cnameset(U, varnames(X))
gnuplot --matrix=U --with-lines --time-series --output=display
</hansl>
this could be made nicer with a column for time; unfortunately, I can't
think of any easy automatic way to construct this, other than introducing
a couple of new functions to retrieve the "t1" and "t2" integers that
are
contained in the matrix info.
-------------------------------------------------------
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
-------------------------------------------------------