On Tue, 19 May 2015, Allin Cottrell wrote:
On Mon, 18 May 2015, Paulo Grahl wrote:
> Hello,
> I have the following piece of code in my script:
>
> loop t=(jsample+2)..tend
> loop foreach i ylist
> $i[t]=$ihat[t]
> endloop
> endloop
>
> where jsample and tend are scalars and ylist is a list with a few time
> series, say "hires" and "quits".
> I had generated hireshat and quitshat with the forecasts for the end of the
> sample. The idea of the loop is to included the forecasts into the original
> time series "hires" and "quits".
> It all worked fine when I last run the code (about 3 months ago). Now, I
> get an error message saying that
> $i[t] = $ihat[t] is a syntax error.
>
> Has anything changed in how the script understands $i[t] ??
Yes, but inadvertantly. Sorry we didn't catch that before the 1.10.1 release.
It's now fixed in CVS and the snapshots for Windows and Mac.
But there's a simple workaround for use with the 1.10.1 release: preface the
$i expression with "genr":
genr $i[t] = whatever
Unrelated to the problem, but wouldn't it be easier to skip one of the
loops? I mean, like in
<hansl>
scalar tbegin = jsample+2
smpl tbegin tend --restrict --replace
loop foreach i ylist
series $i = $ihat
endloop
smpl full
</hansl>
-------------------------------------------------------
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
-------------------------------------------------------