On 23.08.19 12:49, Riccardo (Jack) Lucchetti wrote:
On Fri, 23 Aug 2019, Riccardo (Jack) Lucchetti wrote:
> On Fri, 23 Aug 2019, Sven Schreiber wrote:
>>
>> 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.
OK now that Allin has fixed the $system.t1 (and t2) bug, we can get
those numbers. However, it's not clear to me how these can be used to
get the associated time period labels showing up on the x-axis. (Side
question: How to inject such t1 and t2 info into an existing matrix?)
Obviously you get the time labeling for free if you work with series and
lists. So here's a little function that does it that way. (Current git
is needed because of the bug fixed just recently.)
<hansl>
function void plotsysres(bundle sys)
start = sys.t1 # requires 2019d / current git
stop = sys.t2
smpl start stop
strings nn = varnames(sys.ylist)
list L
loop i=1..cols(sys.uhat) -q
L += genseries(nn[i], sys.uhat[,i])
endloop
gnuplot L --with-lines --time-series --output=display
end function
open denmark.gdt --quiet
list X = LRM LRY IBO IDE
var 4 X --silent
plotsysres($system)
</hansl>
But I repeat, all this is quite clumsy IMHO. My proposal would be that
the data in $uhat (or $system.uhat) should also be retrievable as a
list, with automatic names in the pattern <var1>_res or something like
that, similar to how lags and differences and other pre-defined name
patterns are handled.
thanks
sven