My more recent code samples are individual .tar.gz files. The older ones (which are not indicative of my current coding skills but may still be useful) are all in one .tar.gz file, though I provide a link for each individually.
More recent code samples:
- Point-Mass Mixture Random Effects Model – A python sampler class to estimate the Bayesian point mass mixture random effect model from my paper A Point-Mass Mixture Random Effects Model for Pitching Metrics. The .tar.gz contaings 5 files:
- bb-main.py – the main function that runs the sampler
- bb.py – class and function definitions
- BABIP.csv – the data file
- pitching_column_info.csv – index file needed because we were doing all runs concurrently on the Wharton Grid
- BABIP.sh a shell script for running the sampler under some default parameters for BABIP (batting average on balls in play)
A companion manuscript, A Bayesian Variable Selection Approach to Major League Baseball Hitting Metrics, is currently under review.
Finance Related Code:
- Black-Scholes Python Library – This library has all of the commonly used greeks. Look in the code for a full list.
- Binomial Tree – This code prices European and American Options. This code also contains examples of the usage of both this code and 1).
- American Option Valuation code – I wrote this code just after learning python so its readability is very poor and it is not object oriented. Not a high priority for me to go back and clean it up right now. This code requires bs.py from above, which has Standard Black-Scholes Greeks. It also requires scipy for some numerical integration and optimization function calls. Hope you find it useful even with all these restrictions.
Bioinformatics Related Code:
- Code for populating the frame field in a .gff file.
- RSCU code – This code contains a python class and a few functions on it to read in a fasta file and count the occurence of different codons as well as some other misc. functions.