Hi,
I'm pretty new to eViews (actually I started working with it 3 days ago :) ) and i need to make a presentation about break in time-series, so i wrote the following source-code. My Problem is that without the loops the series y, t, adf, .... is filled with values. But when i put the loops in the source-code the series are not filled with values anymore. This leads to the resulting problem that the uroot-test isn't working.
Can anyone help me solve this problem????
Please excuse my english.
Thank you
Mig
!tmax=100
create u 1 !tmax
genr b=1
for !k = 1 to 3
for !j = 1 to 5
vector(b(1)) adf!j!k
next
next
for !k = 1 to 1
for !j = 1 to 1
for !i = 1 to b(1)
smpl 1 1
genr t!j!k=0
genr y!j!k=0
genr epsilon!j!k=0
smpl 2 100
genr t!j!k=t!j!k(-1)+1
series a!j!k=t!j!k>(9+40*(!k-1))
genr epsilon!j!k=@nrnd
genr y!j!k=t!j!k+(-10-10*(!j-1))*a!j!k+epsilon!j!k
freeze(variabel!j!k) y!j!k.uroot(const, info=sic, save=nerd)
adf!j!k(!i)=variabel!j!k(10,4)
next
next
next
Series not filled with values after loop
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Series not filled with values after loop
I don't follow your question. When I run your code, it appears to work fine.
Re: Series not filled with values after loop
Sorry that it is so difficult for me to explain/ for u to read :D
When i run the code all the resulting tables (y11, ..., y53, adf1, ..., adf5, ...) are filled with "NA"s. But there shóuld be values in there... :) When i run the code without the loop (i modify the y, a, adf,... by taking away the "!j!k") the tables are filled with values. What can i do to make this work with loops.
(A loop is a "for..... next" code? at least thats what i refere to with loop :D)
Thank you for such a quick answer
Mig
When i run the code all the resulting tables (y11, ..., y53, adf1, ..., adf5, ...) are filled with "NA"s. But there shóuld be values in there... :) When i run the code without the loop (i modify the y, a, adf,... by taking away the "!j!k") the tables are filled with values. What can i do to make this work with loops.
(A loop is a "for..... next" code? at least thats what i refere to with loop :D)
Thank you for such a quick answer
Mig
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Series not filled with values after loop
Perhaps you posted the wrong code then - the one you posted up there doesn't create a Y53 etc...
Re: Series not filled with values after loop
Oh sorry i see my mistake (i modyfied the loops for a test), yeah the code looks like that:
(when the code works, the b will be 5000 but for obvious reasons i keep it at 10 till then :) )
!tmax=100
create u 1 !tmax
genr b=10
for !k = 1 to 3
for !j = 1 to 5
vector(b(1)) adf!j!k
next
next
for !k = 1 to 3
for !j = 1 to 5
for !i = 1 to b(1)
smpl 1 1
genr t!j!k=0
genr y!j!k=0
genr epsilon!j!k=0
smpl 2 100
genr t!j!k=t!j!k(-1)+1
series a!j!k=t!j!k>(9+40*(!k-1))
genr epsilon!j!k=@nrnd
genr y!j!k=t!j!k+(-10-10*(!j-1))*a!j!k+epsilon!j!k
freeze(variabel!j!k) y!j!k.uroot(const, info=sic, save=nerd)
adf!j!k(!i)=variabel!j!k(10,4)
next
next
next
(when the code works, the b will be 5000 but for obvious reasons i keep it at 10 till then :) )
!tmax=100
create u 1 !tmax
genr b=10
for !k = 1 to 3
for !j = 1 to 5
vector(b(1)) adf!j!k
next
next
for !k = 1 to 3
for !j = 1 to 5
for !i = 1 to b(1)
smpl 1 1
genr t!j!k=0
genr y!j!k=0
genr epsilon!j!k=0
smpl 2 100
genr t!j!k=t!j!k(-1)+1
series a!j!k=t!j!k>(9+40*(!k-1))
genr epsilon!j!k=@nrnd
genr y!j!k=t!j!k+(-10-10*(!j-1))*a!j!k+epsilon!j!k
freeze(variabel!j!k) y!j!k.uroot(const, info=sic, save=nerd)
adf!j!k(!i)=variabel!j!k(10,4)
next
next
next
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Series not filled with values after loop
The only problem I can see with your code is that you're not using the overwrite option in the freeze command. If I add the overwrite command, things appear to be ok, from my perspective:
Code: Select all
freeze(variabel!j!k, mode=overwrite) y!j!k.uroot(const, info=sic, save=nerd)
Re: Series not filled with values after loop
Please excuse my constat questioning, but do the resulting e.g. y11, y12, ... are filled with numbers or "NA"s when u run the code? Cause when i run it, all the resulting series, vectores, ... are only filled with "NA"s, which is my problem... :)
Thank you a thousend times for all the help yet.
Mig
Thank you a thousend times for all the help yet.
Mig
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Series not filled with values after loop
Yep, filled with numbers.
- Attachments
-
- works.png (145.04 KiB) Viewed 5421 times
Re: Series not filled with values after loop
Hmmm.... I use EViews 7 and i get only NA's. Do you have an idea why?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Series not filled with values after loop
What's the build date of your copy (help->about eviews)?
Re: Series not filled with values after loop
OK, I'm really sorry, i just rebooted my computer and now i get numbers, prob i should update my EViews :). But Prob it works now because of the overwrite, so still thank you veryvery much.
<3 Mig
<3 Mig
Who is online
Users browsing this forum: No registered users and 2 guests
