shabbychef / qbound

code for the quality bounds paper.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bounds on Portfolio Quality

Build Status

This repo holds the code to rebuild the paper, "Bounds on Portfolio Quality." There are a few ways to build the paper:

  1. Build it locally on your computer via knitr and R. This will require the following packages: knitr, devtools, doFuture, doRNG, dplyr, ggplot2, hypergeo, knitr, LambertW, quantmod, SharpeR, tidyr, xtable, and aqfb.data, which is available from github via
install_github("shabbychef/aqfb_data")

Then you can build via

knitr::knit('qbound.Rnw')
  1. The doc can be built via docker, which constructs an environment containing the proper packages. This is most simply achieved via a makefile target:
$ make docker_doc

The doc will be deposited in output/qbound.pdf.

  1. The doc can be built via docker with the docker image pulled from docker hub:
$ docker pull shabbychef/qbound
$ mkdir ./output
$ docker run -it --rm -v $(pwd)/output:/srv/output:rw --entrypoint="make" shabbychef/qbound "doc"

The doc will be deposited in output/qbound.pdf. You can control the build speed/resolution tradeoff with the environment variable RUNTIME_PARAM as follows:

$ docker pull shabbychef/qbound
$ mkdir ./output
$ docker run -it --rm -v $(pwd)/output:/srv/output:rw -e RUNTIME_PARAM=50 --entrypoint="make" shabbychef/qbound "doc"

Testing

The simulations in this document can take several hours, but can take advantage of multicore machines. To speed up the build with fewer simulations, either adjust the variable RUNTIME_PARAM in the qbound.Rnw to default to a number bigger than 1, something like 50, say, to get an approximately 50x speedup in simulation runtime. This can be controlled via the environment variable of the same name:

$ RUNTIME_PARAM=50 make docker_doc

Published Version

The version that I had sent to an MDPI journal can be made via a separate target:

$ make docker_mdpi
# or
$ docker pull shabbychef/qbound
$ mkdir ./output
$ docker run -it --rm -v $(pwd)/output:/srv/output:rw -e RUNTIME_PARAM=50 --entrypoint="make" shabbychef/qbound "mdpi"

Don't ask why I never paid to have the article published in that journal.

Screencast

Watch me stumble around building the doc: asciicast.

About

code for the quality bounds paper.

License:GNU General Public License v3.0


Languages

Language:TeX 51.5%Language:PostScript 44.9%Language:R 2.6%Language:Makefile 0.6%Language:Shell 0.3%Language:Dockerfile 0.2%