-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 15da1d3
Showing
13 changed files
with
2,521 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# .gitignore file for RiskPremium Repo | ||
|
||
|
||
## STANDARD EXCLUSIONS | ||
archive | ||
doc/*.lyx | ||
tmp | ||
.Rhistory | ||
|
||
# Specific files | ||
doc/dividendpriceratio.tex | ||
input/msi.sas7bdat |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# | ||
# Makefile for PREDICTING THE EQUITY RISK PREMIUM | ||
# | ||
# Created on June 04th 2019 | ||
# Last modified on April 04th 2019 | ||
# -------------------------------------------------------------------------------------------------------- | ||
|
||
|
||
# -------------------------------------------------------------------------------------------------------- | ||
all: output/predict.csv readme.md | ||
|
||
## DOWNLOAD THE DATA FROM WRDS | ||
input/msi.sas7bdat: | ||
rsync -aPvzh --stats --human-readable eloualic@wrds-cloud.wharton.upenn.edu:/wrds/crsp/sasdata/a_stock/msi.sas7bdat ./input/ | ||
|
||
## GENERATE PREDICTORS | ||
tmp/predict.csv: src/import_predictors.R input/cay_current.csv input/msi.sas7bdat | ||
R CMD BATCH $(R_OPTS) src/import_predictors.R log/import_predictors.log.R | ||
|
||
## RUN REGRESSIONS | ||
output/predict.csv: src/rp_measure.R tmp/predict.csv | ||
R CMD BATCH $(R_OPTS) src/rp_measure.R log/rp_measure.log.R | ||
@echo | ||
|
||
## OUTPUT RESULTS | ||
readme.md: src/readme_in.md | ||
cat src/readme_in.md tmp/reg_update.txt > readme.md | ||
|
||
|
||
# -------------------------------------------------------------------------------------------------------- | ||
.PHONY : help | ||
help : Makefile | ||
@sed -n 's/^##//p' $< | ||
|
||
## clean | ||
.PHONY : clean | ||
clean: | ||
rm -rf ./output/* | ||
rm -rf ./log/*.log* | ||
rm -rf ./tmp/* | ||
|
||
|
||
# -------------------------------------------------------------------------------------------------------- | ||
SHELL := /bin/bash | ||
R_OPTS := --vanilla | ||
# DATE := `date '+%Y-%m-%d %H:%M:%S'` | ||
# -------------------------------------------------------------------------------------------------------- | ||
|
||
|
||
|
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,265 @@ | ||
cay = c - 0.274092 a - 0.757866 y - 0.668337,,,, | ||
date,c (pce),a,y,cay | ||
195201,9.093943022,10.89614146,8.918819854,0.016465442 | ||
195202,9.109441501,10.91332962,8.921109123,0.025517831 | ||
195203,9.109911598,10.91016439,8.934989259,0.016336205 | ||
195204,9.140163235,10.9044185,8.964998095,0.025420057 | ||
195301,9.148163376,10.9046518,8.975451626,0.025433872 | ||
195302,9.150421745,10.90494552,8.98510858,0.020293056 | ||
195303,9.143581997,10.90331512,8.978187927,0.019145117 | ||
195304,9.132202022,10.907309,8.966159289,0.015786553 | ||
195401,9.131671469,10.91469342,8.956056168,0.020888805 | ||
195402,9.140594975,10.93119337,8.955027313,0.026069547 | ||
195403,9.149442411,10.95242406,8.958497606,0.026467811 | ||
195404,9.165444913,10.95832073,8.977145303,0.026721624 | ||
195501,9.183421078,10.96577967,8.985189913,0.036556615 | ||
195502,9.198399462,10.98746022,9.006578672,0.029382724 | ||
195503,9.206077973,11.0016164,9.022344419,0.021232813 | ||
195504,9.213812065,11.00508517,9.032231011,0.020523432 | ||
195601,9.211124499,11.02292656,9.039134587,0.007713701 | ||
195602,9.210367791,11.02172803,9.046445912,0.001744495 | ||
195603,9.207929696,11.01615645,9.045127353,0.001832813 | ||
195604,9.216725697,11.02684477,9.057048929,-0.001335726 | ||
195701,9.219311188,11.0207387,9.056424703,0.00339647 | ||
195702,9.217018897,11.03509493,9.057792745,-0.003867536 | ||
195703,9.220409587,11.01926643,9.056413137,0.00490717 | ||
195704,9.216247359,11.01815791,9.047622236,0.007711104 | ||
195801,9.198650421,11.02012461,9.025951142,0.005998902 | ||
195802,9.203004305,11.03273056,9.028212681,0.005183657 | ||
195803,9.214993784,11.05453525,9.050381576,-0.005604405 | ||
195804,9.223772473,11.06531833,9.061566431,-0.008257894 | ||
195901,9.237750549,11.06425802,9.068623771,0.000662285 | ||
195902,9.24919894,11.07358769,9.081403293,-0.000131677 | ||
195903,9.255385248,11.06791808,9.072734609,0.014178326 | ||
195904,9.252060138,11.07410467,9.074606563,0.007738833 | ||
196001,9.253608042,11.06805709,9.082157357,0.005221836 | ||
196002,9.26261099,11.07082935,9.084637186,0.011585551 | ||
196003,9.254361234,11.05829105,9.081170485,0.009399733 | ||
196004,9.251158553,11.07462387,9.075063352,0.006348754 | ||
196101,9.246989913,11.09238214,9.078539145,-0.005321467 | ||
196102,9.257891441,11.10176696,9.090861514,-0.006330947 | ||
196103,9.258562229,11.10883746,9.0994503,-0.014107274 | ||
196104,9.274147203,11.12758655,9.112454759,-0.013516911 | ||
196201,9.281170964,11.12453843,9.119944599,-0.011333983 | ||
196202,9.289848491,11.07663785,9.127901722,0.004442257 | ||
196203,9.294063341,11.08612269,9.12864332,0.005495361 | ||
196204,9.304056808,11.12497023,9.132052211,0.002257557 | ||
196301,9.307537586,11.13768783,9.138805307,-0.002865398 | ||
196302,9.313882859,11.14940837,9.145263502,-0.004627073 | ||
196303,9.323597482,11.1567618,9.152125976,-0.002128803 | ||
196304,9.328003189,11.14654213,9.163154721,-0.003280283 | ||
196401,9.344422752,11.15648275,9.180394168,-0.002650558 | ||
196402,9.358705881,11.17165803,9.203122706,-0.009752038 | ||
196403,9.373330185,11.18188743,9.213454258,-0.005761464 | ||
196404,9.372572971,11.19138857,9.22047668,-0.014444917 | ||
196501,9.391828237,11.20079364,9.229393776,-0.004525471 | ||
196502,9.400179741,11.19438194,9.23621442,0.000414293 | ||
196503,9.413875851,11.21570161,9.262423615,-0.011596207 | ||
196504,9.438383996,11.23784825,9.280347602,-0.006742255 | ||
196601,9.450521586,11.22879504,9.283078773,0.00580688 | ||
196602,9.450412581,11.23167552,9.291180586,-0.001231731 | ||
196603,9.458675946,11.20980995,9.304989129,0.002559774 | ||
196604,9.459731329,11.22964745,9.31661014,-0.010629308 | ||
196701,9.463080119,11.2599121,9.328372315,-0.024489963 | ||
196702,9.47419313,11.26796528,9.334936187,-0.020558797 | ||
196703,9.476455642,11.28382615,9.34197588,-0.027978763 | ||
196704,9.479712322,11.29210333,9.35219703,-0.034737055 | ||
196801,9.501100165,11.28565887,9.368791618,-0.024159319 | ||
196802,9.513919755,11.3174011,9.384773919,-0.032152456 | ||
196803,9.529855698,11.32283333,9.386556097,-0.019056095 | ||
196804,9.531685299,11.3558811,9.393368629,-0.0314476 | ||
196901,9.540706511,11.34873219,9.393601755,-0.02064361 | ||
196902,9.544846342,11.33674814,9.402166081,-0.019709664 | ||
196903,9.546838308,11.32754025,9.421532936,-0.029871379 | ||
196904,9.551857852,11.31612127,9.427573346,-0.026299811 | ||
197001,9.555588798,11.30800141,9.435120551,-0.02606305 | ||
197002,9.557070325,11.27779909,9.446494839,-0.024923509 | ||
197003,9.562417883,11.30112561,9.453555778,-0.031320803 | ||
197004,9.556243786,11.31444669,9.446534994,-0.03582528 | ||
197101,9.572140525,11.34252696,9.464193942,-0.04100823 | ||
197102,9.578390311,11.34904906,9.477877564,-0.046916453 | ||
197103,9.583245527,11.3508479,9.479283361,-0.043619693 | ||
197104,9.596613644,11.36684145,9.48714297,-0.040591807 | ||
197201,9.60733659,11.38893603,9.493359568,-0.040636151 | ||
197202,9.623877967,11.39808769,9.502280698,-0.033364191 | ||
197203,9.636656286,11.41250548,9.511438081,-0.031477741 | ||
197204,9.657160612,11.45220389,9.544794092,-0.047133812 | ||
197301,9.673146569,11.44165197,9.552607919,-0.034177498 | ||
197302,9.670476517,11.43148607,9.554786985,-0.035712602 | ||
197303,9.671561989,11.44676171,9.553365704,-0.037736915 | ||
197304,9.66615756,11.41513596,9.555776661,-0.036300172 | ||
197401,9.655367874,11.3884445,9.542257457,-0.029528202 | ||
197402,9.656733803,11.35804642,9.538842855,-0.017242602 | ||
197403,9.658307039,11.31750067,9.537613278,-0.00362426 | ||
197404,9.640943453,11.31759034,9.532559794,-0.017182557 | ||
197501,9.647233593,11.34471265,9.529639223,-0.016113014 | ||
197502,9.66144099,11.3759404,9.575220221,-0.045009185 | ||
197503,9.672642375,11.35024605,9.558080699,-0.013775729 | ||
197504,9.680587883,11.35923272,9.564032157,-0.0128038 | ||
197601,9.698247651,11.37989014,9.576465494,-0.010228867 | ||
197602,9.705298555,11.40083398,9.578728733,-0.010633726 | ||
197603,9.7132779,11.40079459,9.583943099,-0.006595377 | ||
197604,9.723569972,11.40744405,9.587170836,-0.000572058 | ||
197701,9.732634727,11.40229681,9.586525163,0.010392845 | ||
197702,9.735715047,11.41223576,9.594931216,0.004378317 | ||
197703,9.742408692,11.41412017,9.606842485,0.001528312 | ||
197704,9.754513479,11.41909689,9.616215953,0.005165188 | ||
197801,9.757974002,11.42290407,9.620361016,0.00444079 | ||
197802,9.776567408,11.43590267,9.628067013,0.013631273 | ||
197803,9.777772964,11.44784755,9.634199783,0.006915016 | ||
197804,9.782865402,11.44826422,9.640661703,0.006995976 | ||
197901,9.785369493,11.46459169,9.64493673,0.001784946 | ||
197902,9.782151997,11.46903958,9.635758922,0.004303872 | ||
197903,9.78896039,11.4746545,9.64008956,0.006291217 | ||
197904,9.788520387,11.4787099,9.639518311,0.005172593 | ||
198001,9.784168631,11.46581975,9.637938516,0.005551196 | ||
198002,9.758644053,11.47911599,9.624709445,-0.013591904 | ||
198003,9.766351278,11.49416493,9.633750456,-0.016861347 | ||
198004,9.776824951,11.49947944,9.639567622,-0.012252971 | ||
198101,9.779988792,11.49063308,9.631640176,-0.000656473 | ||
198102,9.777590983,11.49969988,9.628248459,-0.002968948 | ||
198103,9.778871656,11.48807957,9.636837718,-0.005012755 | ||
198104,9.768738186,11.49758988,9.637168813,-0.018003848 | ||
198201,9.773209612,11.49327422,9.634776023,-0.010536118 | ||
198202,9.774702033,11.49374649,9.636037356,-0.010129066 | ||
198203,9.779854646,11.49555555,9.641142679,-0.009341453 | ||
198204,9.795460172,11.50888087,9.64245033,0.001620691 | ||
198301,9.803107523,11.52713057,9.646222473,0.001407171 | ||
198302,9.820665335,11.54137907,9.653524725,0.009525456 | ||
198303,9.835560102,11.53759447,9.661215102,0.019629272 | ||
198304,9.848878565,11.53367048,9.676359102,0.022546142 | ||
198401,9.855388831,11.53940942,9.68728119,0.01920593 | ||
198402,9.867534011,11.54467285,9.696931307,0.022594949 | ||
198403,9.872761659,11.55918601,9.704032062,0.018463237 | ||
198404,9.88345611,11.56750044,9.712655947,0.020343021 | ||
198501,9.898488374,11.5823805,9.707510143,0.035196616 | ||
198502,9.905724652,11.5955534,9.726408807,0.024499652 | ||
198503,9.922152744,11.59703641,9.724678914,0.04183229 | ||
198504,9.922232815,11.61821794,9.733890235,0.029125732 | ||
198601,9.928690012,11.64098657,9.742559775,0.022771886 | ||
198602,9.937700006,11.66550953,9.753106667,0.017067207 | ||
198603,9.953153728,11.66682632,9.759486415,0.027325011 | ||
198604,9.957147996,11.6900389,9.764428053,0.021211805 | ||
198701,9.955352274,11.71463683,9.770863578,0.007796727 | ||
198702,9.967043265,11.72209977,9.760549821,0.025258639 | ||
198703,9.976080238,11.73377207,9.772620924,0.021948048 | ||
198704,9.975713685,11.71264618,9.781884123,0.02035166 | ||
198801,9.991318888,11.72720929,9.791848989,0.0244132 | ||
198802,9.996584169,11.73866181,9.802246478,0.018659534 | ||
198803,10.00247137,11.7391973,9.805017202,0.022300122 | ||
198804,10.01136348,11.75040357,9.811086437,0.023521022 | ||
198901,10.01394598,11.75735918,9.813593082,0.022297344 | ||
198902,10.01639485,11.76502223,9.808274391,0.026676691 | ||
198903,10.02356015,11.78328304,9.814206661,0.024340993 | ||
198904,10.02523292,11.78874599,9.821502177,0.018987378 | ||
199001,10.03150506,11.77463537,9.829383624,0.023154046 | ||
199002,10.03150975,11.77667157,9.834607106,0.018641932 | ||
199003,10.03201171,11.7501074,9.831016412,0.029146169 | ||
199004,10.02090554,11.75330996,9.822741424,0.023433537 | ||
199101,10.01433646,11.77055194,9.826353257,0.009401295 | ||
199102,10.01952025,11.76564996,9.832568647,0.01121824 | ||
199103,10.02081015,11.76650627,9.834469095,0.010833146 | ||
199104,10.01712873,11.78087365,9.842781557,-0.003085985 | ||
199201,10.03278453,11.77283903,9.864394625,-0.001607785 | ||
199202,10.03627232,11.76729622,9.871235387,-0.001785133 | ||
199203,10.04337018,11.77143483,9.872072588,0.003543874 | ||
199204,10.05174296,11.78438831,9.872193745,0.008274394 | ||
199301,10.05260963,11.78694234,9.872812219,0.007972312 | ||
199302,10.05849071,11.78897584,9.872101019,0.013835014 | ||
199303,10.06605217,11.79713598,9.872970156,0.018501155 | ||
199304,10.07168123,11.80412286,9.875450905,0.020335099 | ||
199401,10.08038614,11.80022918,9.876893038,0.02901429 | ||
199402,10.08518826,11.80110832,9.884129548,0.028091141 | ||
199403,10.08968246,11.80571975,9.88426323,0.031220071 | ||
199404,10.09734495,11.8066921,9.893020736,0.031979031 | ||
199501,10.09731361,11.81682945,9.899520711,0.024243013 | ||
199502,10.10336739,11.83153899,9.8977941,0.027573572 | ||
199503,10.10931723,11.84909313,9.901669109,0.025775226 | ||
199504,10.11320747,11.86340259,9.900369687,0.026728157 | ||
199601,10.1199712,11.8745521,9.906721011,0.025622442 | ||
199602,10.12792172,11.88268004,9.911811541,0.027487219 | ||
199603,10.13068163,11.88645461,9.915562095,0.026370129 | ||
199604,10.13532035,11.88632621,9.915799986,0.030863757 | ||
199701,10.14318998,11.88980276,9.923356998,0.032053288 | ||
199702,10.14484719,11.93121766,9.929170954,0.017952815 | ||
199703,10.15849147,11.96017668,9.937031558,0.017702389 | ||
199704,10.16720433,11.96608249,9.948547923,0.016068651 | ||
199801,10.17489449,12.01254958,9.964672588,-0.001197769 | ||
199802,10.18964956,12.02630292,9.974413762,0.002405112 | ||
199803,10.19958963,11.9958962,9.981973224,0.014950352 | ||
199804,10.21116279,12.05245712,9.990220574,0.004770242 | ||
199901,10.21813313,12.06172338,10.00274893,-0.000294038 | ||
199902,10.23009627,12.08780941,10.00296239,0.00435737 | ||
199903,10.23821033,12.07568155,10.0078263,0.01210938 | ||
199904,10.24979767,12.14026909,10.01971176,-0.003013774 | ||
200001,10.26233479,12.15720076,10.03791521,-0.008913269 | ||
200002,10.2694224,12.14271986,10.04171313,-0.000734884 | ||
200003,10.27638779,12.14934751,10.05166958,-0.003131727 | ||
200004,10.2826011,12.11922747,10.05089517,0.011924126 | ||
200101,10.28454678,12.0873339,10.0603439,0.015450696 | ||
200102,10.28472993,12.11025112,10.05709475,0.011814846 | ||
200103,10.28577574,12.07535793,10.07518348,0.008715752 | ||
200104,10.29838432,12.10736056,10.06687763,0.018847405 | ||
200201,10.29920813,12.11580307,10.08882832,0.000721509 | ||
200202,10.30208131,12.08489156,10.09405137,0.008108901 | ||
200203,10.30652707,12.04583726,10.09142369,0.025250542 | ||
200204,10.30943212,12.06504858,10.09287082,0.021793208 | ||
200301,10.31174246,12.05884604,10.0934358,0.025375429 | ||
200302,10.32058751,12.09951197,10.10663255,0.013072913 | ||
200303,10.3327313,12.11440231,10.12029388,0.01078192 | ||
200304,10.33809562,12.15499933,10.12157896,0.004045023 | ||
200401,10.34583709,12.18919964,10.12552835,-0.000580633 | ||
200402,10.35011626,12.20425906,10.13427643,-0.007059009 | ||
200403,10.35715682,12.21487031,10.14052669,-0.007663768 | ||
200404,10.36487844,12.25082082,10.13977699,-0.009227707 | ||
200501,10.37037354,12.26130352,10.13853826,-0.005667035 | ||
200502,10.37904409,12.28133253,10.14118177,-0.004489698 | ||
200503,10.38423624,12.29756162,10.14208304,-0.004428843 | ||
200504,10.38547664,12.31532248,10.14182325,-0.007859664 | ||
200601,10.3944317,12.3468612,10.15843946,-0.02014197 | ||
200602,10.39750439,12.33675399,10.15446617,-0.011287754 | ||
200603,10.40072973,12.33424748,10.15454816,-0.00743754 | ||
200604,10.40830622,12.35813575,10.16681388,-0.015704402 | ||
200701,10.41134062,12.35993622,10.18025256,-0.023348222 | ||
200702,10.41249315,12.35670729,10.17369105,-0.016337918 | ||
200703,10.41436583,12.34628121,10.17237359,-0.010609077 | ||
200704,10.41307766,12.31598199,10.17217643,-0.003443059 | ||
200801,10.40880394,12.26670361,10.17468416,0.003889482 | ||
200802,10.40830693,12.23281512,10.20402443,-0.009554972 | ||
200803,10.39862277,12.18592322,10.17120029,0.01848986 | ||
200804,10.38416607,12.12478317,10.18190463,0.012678682 | ||
200901,10.37871477,12.10344198,10.18479766,0.010884289 | ||
200902,10.37212113,12.115207,10.20254324,-0.012382822 | ||
200903,10.37586775,12.1318288,10.19199891,-0.005200904 | ||
200904,10.37346646,12.13658912,10.18954029,-0.007043664 | ||
201001,10.37681194,12.1460016,10.19010436,-0.006705542 | ||
201002,10.38306817,12.12679745,10.20189441,-0.004120902 | ||
201003,10.38752014,12.14825147,10.20493464,-0.007853384 | ||
201004,10.39569147,12.18068245,10.20416992,-0.007991569 | ||
201101,10.39901344,12.19114276,10.21122653,-0.01288464 | ||
201102,10.39933665,12.18645873,10.20277696,-0.004873942 | ||
201103,10.40167307,12.14367807,10.20158648,0.010090533 | ||
201104,10.40306707,12.163639,10.19354456,0.012108104 | ||
201201,10.40744238,12.19319683,10.20578649,-0.000895883 | ||
201202,10.40748035,12.19245159,10.20737567,-0.001858043 | ||
201203,10.40814172,12.21732615,10.20503977,-0.006244276 | ||
201204,10.40896328,12.22598983,10.21774391,-0.017425398 | ||
201301,10.41215242,12.26147785,10.18439318,0.001312162 | ||
201302,10.41264013,12.28316096,10.19208326,-0.009971338 | ||
201303,10.41531169,12.31008855,10.19449664,-0.016509419 | ||
201304,10.42169125,12.33817751,10.19550457,-0.018592692 | ||
201401,10.424797,12.34558322,10.20302759,-0.023218232 | ||
201402,10.43160729,12.35979604,10.20844901,-0.024412266 | ||
201403,10.43919365,12.35937058,10.21586838,-0.022332177 | ||
201404,10.44947895,12.38002573,10.22875616,-0.027475502 | ||
201501,10.45684875,12.40146138,10.24015827,-0.034622307 | ||
201502,10.46256543,12.40470186,10.24653883,-0.034629428 | ||
201503,10.46734812,12.38549823,10.24914833,-0.02656083 | ||
201504,10.47190889,12.40427123,10.25976458,-0.035191286 | ||
201601,10.47478362,12.40512783,10.25672492,-0.030247686 | ||
201602,10.48246925,12.40920055,10.26212304,-0.027769407 | ||
201603,10.48743766,12.42801793,10.26372071,-0.029169505 | ||
201604,10.4927175,12.44184314,10.25415362,-0.02042846 | ||
201701,10.49589657,12.45703895,10.25927611,-0.0252966 | ||
201702,10.50230614,12.47080687,10.26441263,-0.026553501 | ||
201703,10.50568767,12.48331976,10.26573817,-0.027606225 |
Oops, something went wrong.