-
-
Save riqbal-k/8981edd3ec784b27bd246b2313d0e99e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Microsoft montly and daily log returns | |
ms.monthly.r<-Return.calculate(ms.monthly, method = "log") | |
ms.daily.r<-Return.calculate(ms.z, method = "log") | |
head(ms.monthly.r) | |
head(ms.daily.r) | |
#S and P montly and daily log returns | |
sp.monthly.r<-Return.calculate(sp.monthly, method = "log") | |
sp.daily.r<-Return.calculate(sp.z, method = "log") | |
head(sp.monthly.r) | |
head(sp.daily.r) | |
#daily and monhtly log returns for merged data | |
ms.sp.dp.r<-Return.calculate(ms.sp.dp, method = "log") | |
ms.sp.dm.r<-Return.calculate(ms.sp.dm, method = "log") | |
head(ms.sp.dp.r) | |
tail(ms.sp.dm.r) | |
To calculate simple returns, just replace "log" with "simple" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment