commit 72c9aecff94745aae83882a40c4a2f801870b780
parent fa9b897a877b7ab65b5f4c1fe3cd307614b78bf8
Author: Erik Loualiche <[email protected]>
Date: Mon, 10 Jun 2019 11:43:52 -0400
Dates for plot were not treated as quarters
only update picture not the data
Diffstat:
8 files changed, 25 insertions(+), 37 deletions(-)
diff --git a/Makefile b/Makefile
@@ -41,6 +41,7 @@ clean:
rm -rf ./output/*
rm -rf ./log/*.log*
rm -rf ./tmp/*
+ rm -rf readme.md
##
## --------------------------------------------------------------------------------------------------------
diff --git a/docs/index.html b/docs/index.html
@@ -12,10 +12,6 @@
</head>
-
-
-
-
<body>
<div id="wrapper">
<div id="header">
@@ -25,16 +21,7 @@
<div class="post">
</div>
-
-
-
-<!-- <H3>
-Erik Loualiche
-</H3> -->
-<!-- <IMG SRC="../output/predict.png"> -->
- <img src = "https://raw.githubusercontent.com/eloualiche/RiskPremium/master/output/predict.png" width = "705" height = "528" />
- <!-- alt = "Picture of a happy monkey" /> -->
-
+<img src = "https://raw.githubusercontent.com/eloualiche/RiskPremium/master/output/predict.png" width = "705" height = "528" />
<PRE>
@@ -50,11 +37,9 @@ UPDATED DATA FOR
<A HREF="https://github.com/eloualiche/RiskPremium/releases">Download older versions of the data</A>
-<HR> </HR>
+<HR> </HR>
</PRE>
-</div>
-</body>
-</html>
+</div> </body> </html>
diff --git a/log/R-session-info.log.R b/log/R-session-info.log.R
@@ -10,7 +10,7 @@
language (EN)
collate en_US.UTF-8
tz America/New_York
- date 2019-06-04
+ date 2019-06-10
package * version date source
alfred * 0.1.6 2018-04-06 CRAN (R 3.5.1)
@@ -75,7 +75,7 @@
language (EN)
collate en_US.UTF-8
tz America/New_York
- date 2019-06-04
+ date 2019-06-10
package * version date source
assertthat 0.2.0 2017-04-11 CRAN (R 3.5.1)
diff --git a/log/import_predictors.log.R b/log/import_predictors.log.R
@@ -48,7 +48,7 @@ Type 'q()' to quit R.
Log file for code executed at
> message(format(Sys.time(), "%a %b %d %X %Y"))
-Tue Jun 04 15:34:39 2019
+Mon Jun 10 11:42:28 2019
> ##################################################################################
>
>
@@ -237,4 +237,4 @@ Packages ----------------------------------------------------------------------
>
> proc.time()
user system elapsed
- 1.595 0.245 2.532
+ 1.670 0.187 2.484
diff --git a/log/rp_measure.log.R b/log/rp_measure.log.R
@@ -36,7 +36,7 @@ Type 'q()' to quit R.
Log file for code executed at
> message(format(Sys.time(), "%a %b %d %X %Y"))
-Tue Jun 04 15:34:42 2019
+Mon Jun 10 11:42:31 2019
> ##################################################################################
>
>
@@ -195,21 +195,22 @@ Notes: ***Significant at the 1 percent level.
>
> ##################################################################################
> # PLOT
-> dt_plot <- dt_exp_rmrf[, .(date=as.Date(ISOdate(str_sub(dateym,1, 4), str_sub(dateym, 5, 6), 1)),
+> dt_plot <- dt_exp_rmrf[, .(
++ date=as.Date(ISOdate(str_sub(dateym,1, 4), 3*as.integer(str_sub(dateym, 5, 6)), 1)),
+ dp, cay, rf, rmrf_y3, exp_rmrf)]
> dt_plot[]
date dp cay rf rmrf_y3 exp_rmrf
- 1: 1952-01-01 0.05812871 0.01646544 0.0157 0.17701996 0.201294617
- 2: 1952-02-01 0.05899675 0.02551783 0.0154 0.19964326 0.222836429
- 3: 1952-03-01 0.05817138 0.01633620 0.0159 0.18092953 0.200926735
- 4: 1952-04-01 0.05847809 0.02542006 0.0157 0.21473395 0.220859636
- 5: 1953-01-01 0.05472504 0.02543387 0.0196 0.21110181 0.206163415
+ 1: 1952-03-01 0.05812871 0.01646544 0.0157 0.17701996 0.201294617
+ 2: 1952-06-01 0.05899675 0.02551783 0.0154 0.19964326 0.222836429
+ 3: 1952-09-01 0.05817138 0.01633620 0.0159 0.18092953 0.200926735
+ 4: 1952-12-01 0.05847809 0.02542006 0.0157 0.21473395 0.220859636
+ 5: 1953-03-01 0.05472504 0.02543387 0.0196 0.21110181 0.206163415
---
-252: 2014-04-01 0.02159773 -0.02747550 0.0003 0.08441447 0.025044998
-253: 2015-01-01 0.02090927 -0.03462231 0.0003 0.12632351 0.008287874
-254: 2015-02-01 0.02098770 -0.03462943 0.0002 0.09072934 0.008601014
-255: 2015-03-01 0.02111608 -0.02656083 0.0003 0.08734601 0.025601134
-256: 2015-04-01 0.02109137 -0.03519129 0.0002 0.08565438 0.007723565
+252: 2014-12-01 0.02159773 -0.02747550 0.0003 0.08441447 0.025044998
+253: 2015-03-01 0.02090927 -0.03462231 0.0003 0.12632351 0.008287874
+254: 2015-06-01 0.02098770 -0.03462943 0.0002 0.09072934 0.008601014
+255: 2015-09-01 0.02111608 -0.02656083 0.0003 0.08734601 0.025601134
+256: 2015-12-01 0.02109137 -0.03519129 0.0002 0.08565438 0.007723565
>
>
> p0 <- dt_plot[, .(date, dp, cay, rf, rmrf_y3) ] %>%
@@ -239,4 +240,4 @@ Notes: ***Significant at the 1 percent level.
>
> proc.time()
user system elapsed
- 2.823 0.230 3.229
+ 2.672 0.240 2.992
diff --git a/output/predict.png b/output/predict.png
Binary files differ.
diff --git a/readme.md b/readme.md
@@ -16,7 +16,7 @@ We use the dividend-price ratio, cay and the three-month T-bill to predict futur
1. Measuring Dividend Price ratio uses CRSP Monthly Index files available on [WRDS](https://wrds-web.wharton.upenn.edu/wrds/ds/crsp/stock_a/stkmktix.cfm)
- `msi.sas7bdat` downloaded from `/wrds/crsp/sasdata/a_stock/msi.sas7bdat`
- - See the calculations to account for reinvested dividends in this [note](./doc/dividendpriceratio.pdf) on how
+ - See the calculations to account for reinvested dividends in this [note](./docs/dividendpriceratio.pdf) on how
2. Measuring the risk-free rate from H15 release available on [FRED](https://fred.stlouisfed.org/series/TB3MS
)
3. Measuring cay from Lettau's [website](http://faculty.haas.berkeley.edu/lettau/data_cay.html). *Last downloaded on May 29 2019*
diff --git a/src/rp_measure.R b/src/rp_measure.R
@@ -76,7 +76,8 @@ fwrite(dt_exp_rmrf, "./output/predict.csv")
##################################################################################
# PLOT
-dt_plot <- dt_exp_rmrf[, .(date=as.Date(ISOdate(str_sub(dateym,1, 4), str_sub(dateym, 5, 6), 1)),
+dt_plot <- dt_exp_rmrf[, .(
+ date=as.Date(ISOdate(str_sub(dateym,1, 4), 3*as.integer(str_sub(dateym, 5, 6)), 1)),
dp, cay, rf, rmrf_y3, exp_rmrf)]
dt_plot[]