Hi, is anyone known how to use Eviews 7 to estimate the realized volatility?
Currently I have nearly 50,000 1mins high frequency data, and I need to compare the RV and GARCH model. For my data, each trading day contains four trading hours, and 240mins per day. Is that there has hourly RV and daily RV estimation?
Many Thanks
how to estimate realized volatility using intraday data
Moderators: EViews Gareth, EViews Moderator
Re: how to estimate realized volatility using intraday data
Hi, can anyone write a code to calculate the following, I attached it in the word document. And this is the fomular to calculate the realized volatility.
- Attachments
-
- New Microsoft Office Word 文档.docx
- (12.05 KiB) Downloaded 1317 times
Re: how to estimate realized volatility using intraday data
You can use the "Frequency Conversion" tools:
Code: Select all
wfcreate(wf=example,page=intraday) 5min(1-5, 8AM-5PM) 1/2/2012 12/31/2012
series r = nrnd/100
series r2 = r^2
pagecreate(page=daily) d5 2012 2012
copy(c=s) intraday\r2 daily\r2Re: how to estimate realized volatility using intraday data
thank you trubador.
:D
:D
Re: how to estimate realized volatility using intraday data
hi, I do not quite understand the floowing Eviews sentence
"series r = nrnd/100" what does this sentence mean?
I attached the data in this reply, can you have a look and help me to estimate the daily realized volatility by using 5 mins interval close price?
thanks a lot
"series r = nrnd/100" what does this sentence mean?
I attached the data in this reply, can you have a look and help me to estimate the daily realized volatility by using 5 mins interval close price?
thanks a lot
- Attachments
-
- data_analysis.xls
- (82 KiB) Downloaded 1108 times
Re: how to estimate realized volatility using intraday data
It is a hypothetical return series that I created using EViews' random number generator. It is generated for expositional purposes. You should use your own series instead.
Re: how to estimate realized volatility using intraday data
hi, turbador,
Thank you for your reply, but I still think the above program is not fully correct. In order to get realized volatility from daily high frequency data, I think we need to use "if language" to contorl the daily time rolling. The steps to calculate RV are the following:
1: calculate log return, in 5 mins interval, which equlas r=log(close)-log(close(-1));
2: calculate the r squart, r2=r*r
3, then sum up each daily's r2, for example, if there are 4 hours trading time, then for each day there has 48 r squart, then sum up these 48 r2 value, it will give the daily realized volatility.
4. move to next day, and run the above 1-3 again.
5. store all these daily value in a new series.
how to program it?
All the Best
Thank you for your reply, but I still think the above program is not fully correct. In order to get realized volatility from daily high frequency data, I think we need to use "if language" to contorl the daily time rolling. The steps to calculate RV are the following:
1: calculate log return, in 5 mins interval, which equlas r=log(close)-log(close(-1));
2: calculate the r squart, r2=r*r
3, then sum up each daily's r2, for example, if there are 4 hours trading time, then for each day there has 48 r squart, then sum up these 48 r2 value, it will give the daily realized volatility.
4. move to next day, and run the above 1-3 again.
5. store all these daily value in a new series.
how to program it?
All the Best
Re: how to estimate realized volatility using intraday data
hi, I try to program the realized volatility as the following ( assume these are 500 days need to be estimated):
!start=0
if !start>=0 and !start<500, then
smpl 1/04/2013+!start 1/04/2013+!start
r=log(close)-log(close(-1))
r2=r*r
v =sum(r2)
save series volatility
!start+1
else
!start >=500
endif
but I am not sure how to perform the followings in eviews:
1: how to sum up the daily r squart, can I use command " sum(r2)"
2: how to save the daily realized volatility, can I use " save series volatility"
!start=0
if !start>=0 and !start<500, then
smpl 1/04/2013+!start 1/04/2013+!start
r=log(close)-log(close(-1))
r2=r*r
v =sum(r2)
save series volatility
!start+1
else
!start >=500
endif
but I am not sure how to perform the followings in eviews:
1: how to sum up the daily r squart, can I use command " sum(r2)"
2: how to save the daily realized volatility, can I use " save series volatility"
Re: how to estimate realized volatility using intraday data
hi, here is the new version:
!start=0
if !start>=0 and !start<500 then
series r
smpl 1/04/2013+!start 1/04/2013+!start
r=log(close)-log(close(-1))
series r2
r2=r*r
series v
v =@sum(r2)
save series volatility
!start=!start+1
else
!start>=500
endif
but the " if cycle" does not work, meanwhile, it gives 48 same realized volatility values per day. I need to merge these 48 values into 1 value, while means delete other 47 values, and put the date from intraday to daily.
!start=0
if !start>=0 and !start<500 then
series r
smpl 1/04/2013+!start 1/04/2013+!start
r=log(close)-log(close(-1))
series r2
r2=r*r
series v
v =@sum(r2)
save series volatility
!start=!start+1
else
!start>=500
endif
but the " if cycle" does not work, meanwhile, it gives 48 same realized volatility values per day. I need to merge these 48 values into 1 value, while means delete other 47 values, and put the date from intraday to daily.
Re: how to estimate realized volatility using intraday data
It seems like we need to use "while" or "for" command,
The key problems are two:
1. how to sum up the daily r squart value.
2. how to store the estimated daily realized volatility.
The key problems are two:
1. how to sum up the daily r squart value.
2. how to store the estimated daily realized volatility.
-
JoaoAraujo
- Posts: 2
- Joined: Sun Sep 07, 2014 7:51 am
Re: how to estimate realized volatility using intraday data
Hi James,
Good afternoon.
Have you worked this problem out ?
I'm facing same problem, but my sample is not under date basis :(.
I have 840 days with 79 prices a day and trying to simulate RV as you were...
Appreciate if you solved the issue and could share.
Good afternoon.
Have you worked this problem out ?
I'm facing same problem, but my sample is not under date basis :(.
I have 840 days with 79 prices a day and trying to simulate RV as you were...
Appreciate if you solved the issue and could share.
Who is online
Users browsing this forum: No registered users and 2 guests
