extending dated series by one observation (a scalar)

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

Fregensburg
Posts: 38
Joined: Tue Jan 21, 2014 4:04 am

extending dated series by one observation (a scalar)

Postby Fregensburg » Wed Apr 23, 2014 6:52 am

Dear Eviews experts,

I'd really appreciate if you could help me with this:
I have a series y. I have a scalar s, which I got from combining some forecasts. I want to extend y by one observation -the scalar. I've searched manuals and forum but couldn't find a way.
Side note:
I cannot use actual dates in the program lines -whatever they are- because I have to put this in a loop to back-test some awful forecasting models (basically cutting short the dependent variable to a year ago, keeping all regressors to their most recent sample size, and adding each one-step ahead forecast to the dependent variable in a recursive fashion. Utterly pointless, but I have to do it).

Thanks very much!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: extending dated series by one observation (a scalar)

Postby EViews Gareth » Wed Apr 23, 2014 12:54 pm

Does the workfile already contain that date? (i.e. is the series long enough to contain that value, and currently has NA)?
Follow us on Twitter @IHSEViews

Fregensburg
Posts: 38
Joined: Tue Jan 21, 2014 4:04 am

Re: extending dated series by one observation (a scalar)

Postby Fregensburg » Wed Apr 23, 2014 2:44 pm

Hi Gareth,

Yes, it does, I over-provided, so plenty of NAs up front.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: extending dated series by one observation (a scalar)

Postby EViews Gareth » Wed Apr 23, 2014 2:57 pm

Code: Select all

!date = @ilast(x)
%date = @otod(!date+1)
smpl {%date} {%date}
x = myscalar

or something along those lines.
Follow us on Twitter @IHSEViews

Fregensburg
Posts: 38
Joined: Tue Jan 21, 2014 4:04 am

Re: extending dated series by one observation (a scalar)

Postby Fregensburg » Thu Apr 24, 2014 2:18 am

that was basically no effort for you, was it? you should try and learn an instrument, I bet you'd pick it up in no time. a tip: electric guitars are very satisfactory.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 40 guests