Page 1 of 1

How to generate unit root process?

Posted: Mon Apr 04, 2011 8:43 am
by migaa
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.

Re: How to generate unit root process?

Posted: Mon Apr 04, 2011 8:56 am
by EViews Gareth
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

Re: How to generate unit root process?

Posted: Mon Apr 04, 2011 9:31 am
by migaa
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

Re: How to generate unit root process?

Posted: Mon Apr 04, 2011 10:06 am
by migaa
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?

Re: How to generate unit root process?

Posted: Mon Apr 04, 2011 11:21 am
by EViews Gareth
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.

Re: How to generate unit root process?

Posted: Mon Apr 04, 2011 12:39 pm
by migaa
Thank you very much!