Generate series, set initial value

For questions regarding programming in the EViews programming language.

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

at-dc
Posts: 2
Joined: Sun Jun 17, 2012 5:15 pm

Generate series, set initial value

Postby at-dc » Sun Jun 17, 2012 5:21 pm

I would like to generate a new series defined as

newvariable = oldvariable + newvariable(-1)

setting the first value of newvariable as x=1. [newvariable(-1) is a first order lag of the series being generated.]

Does anyone know how to do this?

Thanks!

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

Generate series, set initial value

Postby EViews Gareth » Sun Jun 17, 2012 8:40 pm

Code: Select all

Smpl @first @first Series newvariable=1 smpl @first+1 @last Newvariable = oldvariable + newvariable(-1)

at-dc
Posts: 2
Joined: Sun Jun 17, 2012 5:15 pm

Re: Generate series, set initial value

Postby at-dc » Mon Jun 18, 2012 4:13 am

Thank you very much

FASTONE
Posts: 6
Joined: Sun Sep 23, 2012 3:56 pm

Re: Generate series, set initial value

Postby FASTONE » Sat Oct 27, 2012 11:15 pm

what do this commands??
in particular the lines:
smpl @first+1 !nobs+200
series y1 = y1(-1)+nrnd
series dy1 = y1 - y1(-1)
smpl @first+200 !nobs+200
equation eq1.ls dy1 y1(-1)

!nreps = 50000
!nobs = 1000
for !repc=1 to !nreps
smpl @first @first
series y1 = 0
smpl @first+1 !nobs+200
series y1 = y1(-1)+nrnd
series dy1 = y1 - y1(-1)
smpl @first+200 !nobs+200
equation eq1.ls dy1 y1(-1)
t1(!repc)=@tstats(1)
equation eq2.ls dy1 c y1(-1)
t2(!repc)=@tstats(2)
equation eq3.ls dy1 c @trend y1(-1)
t3(!repc)=@tstats(3)
next
smpl @first !nreps
k1=@quantile(t1,0.01)
k2=@quantile(t1,0.05)
k3=@quantile(t1,0.1)
k4=@quantile(t2,0.01)
k5=@quantile(t2,0.05)
k6=@quantile(t2,0.1)
k7=@quantile(t3,0.01)
k8=@quantile(t3,0.05)
k9=@quantile(t3,0.1)

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

Re: Generate series, set initial value

Postby EViews Gareth » Mon Oct 29, 2012 7:49 am

I'm not sure I understand what you're asking.

If you're asking us to explain what every single one of those commands does, I think we'll simply refer you to the Command and Programming Reference, and the Object Reference, where you can look them up :)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests