urgent please, rolling window

For questions regarding programming in the EViews programming language.

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

Sara Elsayed
Posts: 8
Joined: Thu Jul 24, 2014 12:03 pm

urgent please, rolling window

Postby Sara Elsayed » Thu Jul 31, 2014 6:38 am

Dear all,
I am trying to do a rolling window for variance ratio test, and I read a lot of programming topics and I reached to following codes but it doesn't work, I got NA in all metrics, why??
I want to do rolling for MVR but with wildbootstrap probabilities, so my problem here is about test specification, Here you are codes, please help me clarify what is the problem

!width = 20
!lastfirst = @obsrange-!width+1
matrix(!lastfirst, 2) vratio
!doprob=0
!probchoice=0
!result =0
%problist ="default wildbootstrap"
%probOpt =""
!result = @uidialog("check",!doprob, "View prob options?")
if !result=-1 then 'if user cancelled, then stop program
stop
endif

if !doprob =1 then
!result = @uilist(!probChoice, "test specification probabilities ", %problist) ' put up prob dialog
if !result=-1 then 'if user cancelled, then stop program
stop
endif

if !probChoice = 2 then
%proOpt = "prob=wildbootstrap"
endif
endif

for !i=1 to !lastfirst
smpl @first+!i-1 @first+!i-1+!width-1
freeze(bb) R.vratio {%probOpt} 2 4 8 16
vratio(!i, 1) = @val(bb(11, 3))
vratio(!i, 2) = @val(bb(11, 5))

if (@isobject("bb")) then
delete bb
endif

next

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

Re: urgent please, rolling window

Postby EViews Gareth » Thu Jul 31, 2014 7:46 am

We'd need the workfile, I think.

Sara Elsayed
Posts: 8
Joined: Thu Jul 24, 2014 12:03 pm

Re: urgent please, rolling window

Postby Sara Elsayed » Thu Jul 31, 2014 10:25 am

Thanks for your reply.


here you are the work-file, and the variable to be used here is called r_efgi, instad of just R in the codes below.
Can I have also another questions,
1- If I need to use window width of 260 and to move 4 observation each time not one observation, how can I change the codes?
I can't understand how to get the proper number of sub-samples or window that related to my observation number, I read papers use 260, so is it okay to use it or it depends on my observation?!
2- How can I plot the p-values of each test against the last time points of moving sub-samples windows? because i want to see how efficiency(RW hypothesis) improve through time.

I would be glad if you can help me as I have short time constrains
Attachments
efgi.wf1
(51.32 KiB) Downloaded 190 times

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

Re: urgent please, rolling window

Postby EViews Gareth » Thu Jul 31, 2014 10:34 am

The line:

Code: Select all

freeze(bb) R_efgi.vratio {%probOpt} 2 4 8 16
should be:

Code: Select all

freeze(bb) R_efgi.vratio({%probOpt}) 2 4 8 16
And the line:

Code: Select all

%proOpt = "prob=wildbootstrap"
Should be:

Code: Select all

%proOpt = "probcalc=wildboot"

Sara Elsayed
Posts: 8
Joined: Thu Jul 24, 2014 12:03 pm

Re: urgent please, rolling window

Postby Sara Elsayed » Thu Jul 31, 2014 11:16 am

Thanks for your reply
However, For this command
freeze(bb) R_efgi.vratio ({%probOpt }) 2 4 8 16
I got error message of illegal specification

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

Re: urgent please, rolling window

Postby EViews Gareth » Thu Jul 31, 2014 11:18 am

You have a space.

Sara Elsayed
Posts: 8
Joined: Thu Jul 24, 2014 12:03 pm

Re: urgent please, rolling window

Postby Sara Elsayed » Thu Jul 31, 2014 12:11 pm

Unfortunately, I got the same final result NA in both columns.

I tried theses codes instead

!width =260
!lastfirst = @obsrange-!width+1
matrix(!lastfirst, 2) vratio

for !i=1 to !lastfirst
smpl @first+!i-1 @first+!i-1+!width-1
freeze(aa) r_msci.vratio(probcalc=wildboot, btreps=10000) 2 4 8 16
vratio(!i, 1) = @val(aa(11, 3))
vratio(!i, 2) = @val(aa(11, 5))

if (@isobject("aa")) then
delete aa
endif

next

It seems it works, but I feel that there is something wrong, because when I compare p-values which changes only after 3 digit after dot like this (0.0002), to plots of graph of old paper which can reach far to 0.6, I could not get the same result. I don't know what is the problem?! Is it in my codes? again I am testing joint VR with wildbootstraping with hetero

if I want to step by 4 observation
Can I just change this command ?
smpl @first+!i-1 @first+!i-1+!width-4

Sara Elsayed
Posts: 8
Joined: Thu Jul 24, 2014 12:03 pm

Re: urgent please, rolling window

Postby Sara Elsayed » Fri Aug 01, 2014 6:48 am

please, Can I have another column in the matrix that includes the end point to each sub-sample rolled as I must plot the p-values through time, please can you help me?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests