I am a new user of EViews, now doing a project which need to calculate the day of the week & monthly return and standard deviation base on index.
Up on now, I have calculated the daily return by:
drl=log(y/y(-1))
For the monthly return, I don't know how can I change the equation so that I can get result.
Would you please advise what should I do?
Thank you in advance.
Monthly return and standard deviation
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
Monthly return and standard deviation
- Attachments
-
- project q1.wf1
- (158.01 KiB) Downloaded 364 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Monthly return and standard deviation
How are you defining monthly return?
Re: Monthly return and standard deviation
the monthly return is:
Log (closing of current/closing of last month)
In other words, only compare the closing of each month, then get the return in % by log.
I really don't know how to take the last obs of each month in calculation.
Please kindly help.
Log (closing of current/closing of last month)
In other words, only compare the closing of each month, then get the return in % by log.
I really don't know how to take the last obs of each month in calculation.
Please kindly help.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Monthly return and standard deviation
I'd probably do it by making a new monthly page in the workfile, then coping the data over using "last" as the frequency conversion method.
If you want it in the same page, something like:
will get you the last observation of the month.
If you want it in the same page, something like:
Code: Select all
genr(r) lastmonth = @recode(@month(-1)=@month, lastmonth(1), y(-1))
Re: Monthly return and standard deviation
Dear Gareth
Thank you for your quick respond.
I am thinking if I can get the monthly return simply by counting the total of the daily return in "drl", I therefore created a group "mrl" which included "month" and 'drl"
Would you please advise for calculating the standard deviation? If I want to do it by the formula:
Standard Deviation of daily return of the month X Square roof of No. of trade day of the month
Would you please advise how should I write the formula in EViews?
Thank you very much!
Ricky
Thank you for your quick respond.
I am thinking if I can get the monthly return simply by counting the total of the daily return in "drl", I therefore created a group "mrl" which included "month" and 'drl"
Would you please advise for calculating the standard deviation? If I want to do it by the formula:
Standard Deviation of daily return of the month X Square roof of No. of trade day of the month
Would you please advise how should I write the formula in EViews?
Thank you very much!
Ricky
- Attachments
-
- project q1.wf1
- (188.61 KiB) Downloaded 324 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Monthly return and standard deviation
Code: Select all
series yearmonth = @datefloor(@date, "mm")
show @stdevsby(drl, yearmonth)*@sqrt(@maxsby(@day, yearmonth))
Re: Monthly return and standard deviation
Hello, Gareth, thank you for your help
Who is online
Users browsing this forum: No registered users and 2 guests
