How to generate unit root process?

For questions regarding programming in the EViews programming language.

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

migaa
Posts: 11
Joined: Mon Apr 04, 2011 8:23 am

How to generate unit root process?

Postby migaa » Mon Apr 04, 2011 8:43 am

Hi,

I am average user of this program. I've never used the programing thing before.

But now I'd like to generate unit root process and I've written some programing thing myself using the Eviews help.

This is what I did as far.

open D:\Time_series\table.wf1

!yt0=0

for !j=1 to 10

series rn!j=nrnd

next

for !j=1 to 10

series yt!j = 1 + yt!j(-1) + rn!j

next

But "series yt!j = 1 + yt!j(-1) + rn!j" it is not working.

Help me, please.

Thank you in advance.

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

Re: How to generate unit root process?

Postby EViews Gareth » Mon Apr 04, 2011 8:56 am

It isn't clear what you mean by "not working". However, I'll take a guess that you're getting NAs. This is because you haven't seeded the very first value of yt. You need to do something like this:

Code: Select all

!yt0=0 for !j=1 to 10 series rn!j=nrnd next for !j=1 to 10 smpl @first @first series yt!j = !yt0 smpl @first+1 @last series yt!j = 1 + yt!j(-1) + rn!j next

migaa
Posts: 11
Joined: Mon Apr 04, 2011 8:23 am

Re: How to generate unit root process?

Postby migaa » Mon Apr 04, 2011 9:31 am

Thank you very much!

Yes, You're right. I've got "NA"s. Actually, I didn't know how to say.

I've run the code and the results were not exactly as I thought. Because, every first data of the series is zero. The !yt0 in my code is representing the initial (t=0) value of the yt process. My sample is starting from t=1 to t=100. So first data of the series should be the sum of 1 and nr1. In my opinion the code (your code) looks quite well but I don't know where is the problem.

Anyway, Thank you very much.

Best regards,

Miga.B

migaa
Posts: 11
Joined: Mon Apr 04, 2011 8:23 am

Re: How to generate unit root process?

Postby migaa » Mon Apr 04, 2011 10:06 am

Hi again,

I've just realized that there is something wrong in my code, logically.

What I want is
- 100 observation, t=1 to t=100
- yt=1+yt(-1)+rn
- rn is random number generated by nrnd command
- initial value of yt is zero which means yt0=0.

From the above, I will get just one yt series, from y1 to y100.

I wanna do this procedure 1000 times which means I need 1000 yt unit root processes.

What do you think? I am right?

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

Re: How to generate unit root process?

Postby EViews Gareth » Mon Apr 04, 2011 11:21 am

There isn't a 0th time period in EViews. If you want time periods that run from 1 to 100, and to have a 0th time period, then in EViews you're really saying that you have 101 periods. Thus generate a workfile with 101 observations, set the first observation to 0, and then observations 2-101 are your 100 periods.

migaa
Posts: 11
Joined: Mon Apr 04, 2011 8:23 am

Re: How to generate unit root process?

Postby migaa » Mon Apr 04, 2011 12:39 pm

Thank you very much!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest