Skip to content

Instantly share code, notes, and snippets.

@bfarzin
Created November 9, 2018 20:55
Show Gist options
  • Save bfarzin/8d94e9bd42757c353292a3eeab2d83fc to your computer and use it in GitHub Desktop.
Save bfarzin/8d94e9bd42757c353292a3eeab2d83fc to your computer and use it in GitHub Desktop.
Bayesian CR
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"from scipy.stats import norm,invgamma\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"import seaborn as sns"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"data1 = {0: 46.0, 1: -556.0, 2: 637.0, 3: -11992.0, 4: -163.0,\n",
" 5: -281.0, 6: 348.0, 7: -1508.0, 8: 1009.0, 9: -1056.0,\n",
" 10: 1580.0, 11: 2941.0, 12: -1180.0, 13: -21527.0, 14: -16924.0,\n",
" 15: -2151.0, 16: 2606.0, 17: -11803.0, 18: -714.0, 19: 2342.0,\n",
" 20: 2517.0, 21: 1447.0, 22: 1627.0, 23: -1306.0, 24: -2715.0,\n",
" 25: -2279.0}\n",
"data2 = {0: -3601.0, 1: -318.0, 2: -4577.0, 3: 862.0, 4: 490.0,\n",
" 5: -302.0, 6: 878.0, 7: 719.0, 8: 935.0, 9: 645.0,\n",
" 10: -1554.0, 11: 627.0, 12: 8083.0, 13: 2360.0, 14: 843.0,\n",
" 15: 2398.0, 16: 2929.0, 17: 4212.0, 18: 2755.0, 19: 4223.0,\n",
" 20: -897.0, 21: 1412.0, 22: 164.0, 23: -5466.0, 24: 223.0,\n",
" 25: -1201.0, 26: 1191.0}"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ex1_data = pd.Series(data1)\n",
"ex2_data = pd.Series(data2)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def draw_mus_and_sigmas(data,m0,k0,s_sq0,v0,n_samples=10000):\n",
" # number of samples\n",
" N = np.size(data)\n",
" # find the mean of the data\n",
" the_mean = np.mean(data) \n",
" # sum of squared differences between data and mean\n",
" SSD = np.sum( (data - the_mean)**2 ) \n",
"\n",
" # combining the prior with the data - page 79 of Gelman et al.\n",
" # to make sense of this note that \n",
" # inv-chi-sq(v,s^2) = inv-gamma(v/2,(v*s^2)/2)\n",
" kN = float(k0 + N)\n",
" mN = (k0/kN)*m0 + (N/kN)*the_mean\n",
" vN = v0 + N\n",
" vN_times_s_sqN = v0*s_sq0 + SSD + (N*k0*(m0-the_mean)**2)/kN\n",
"\n",
" # 1) draw the variances from an inverse gamma \n",
" # (params: alpha, beta)\n",
" alpha = vN/2\n",
" beta = vN_times_s_sqN/2\n",
" # thanks to wikipedia, we know that:\n",
" # if X ~ inv-gamma(a,1) then b*X ~ inv-gamma(a,b)\n",
" sig_sq_samples = beta*invgamma.rvs(alpha,size=n_samples)\n",
"\n",
" # 2) draw means from a normal conditioned on the drawn sigmas\n",
" # (params: mean_norm, var_norm)\n",
" mean_norm = mN\n",
" var_norm = np.sqrt(sig_sq_samples)/kN\n",
" mu_samples = norm.rvs(mean_norm,scale=var_norm,size=n_samples)\n",
"\n",
" # 3) return the mu_samples and sig_sq_samples\n",
" return mu_samples, sig_sq_samples"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"count 26.000000\n",
"mean -2271.346154\n",
"std 6195.052781\n",
"min -21527.000000\n",
"25% -1990.250000\n",
"50% -418.500000\n",
"75% 1337.500000\n",
"max 2941.000000\n",
"dtype: float64"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ex1_data.describe()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"count 27.000000\n",
"mean 667.888889\n",
"std 2725.633297\n",
"min -5466.000000\n",
"25% -310.000000\n",
"50% 719.000000\n",
"75% 1886.000000\n",
"max 8083.000000\n",
"dtype: float64"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ex2_data.describe()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"mu_samp_1, sig_samp_1 = draw_mus_and_sigmas(ex1_data.values,0,10,6195,100)\n",
"mu_samp_2, sig_samp_2 = draw_mus_and_sigmas(ex2_data.values,0,10,2725,100)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def my_hist(data,label=None):\n",
" weights = np.ones_like(data)/float(len(data))\n",
" plt.hist(data, weights=weights,label=label,alpha=0.5)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"-1640.8321913423276\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfIAAAFXCAYAAABZQMyNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X90VPWd//HX/CAhPwbJkMloEdGmbFizYRvbYt0oWE8U\nU6WHrxUaVFDPqfbbGKUmdaGBDXRXGqtt+eLm9MvhWNz1fD2mKs13pd9SSrdflm+bYGJRxLhdS9rG\nVCRh8oMkM4Exmfv9wzoSSTI3MpPJhzwf53hO7tz53Pue91x8zb0z916HZVmWAACAkZzJLgAAAHx8\nBDkAAAYjyAEAMBhBDgCAwQhyAAAMRpADAGAwW0FeU1Oj0tJSrV69WkePHh31Od///ve1Zs2aCY0B\nAADnJ2aQNzc3q62tTXV1dXr00Ue1devWc57T2tqqV155RQ6Hw/YYAABw/mIGeWNjo4qLiyVJubm5\n6uvrUzAYHPGc7373u6qsrJzQGAAAcP5iBnkgEJDX641OZ2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UdO3bM+spXvpLkipLj5Zdfth566KERj23YsMHat2+fZVmW9YMf\n/MB67rnnrFAoZC1btswaGBiwTp8+bd16663WqVOnrPr6eusf//EfLcuyrF//+tfWN77xjZjrTNih\n9S996Uv61re+Jen9S7eeOnXq7A8PI5778ssva8mSJXK5XPJ6vZo7d65+//vf69ChQ7rxxhslSV/4\nwhf0m9/8ZsT13R0Oh5YuXapDhw4l6mVMitF69d577+nPf/6z8vPzJUk33HCDGhoapnWvLr74YtXW\n1o56zX62qZFG69V7772nd955h21qAs63Zw0NDcksf1KNdV+O6eij/z9qamrSF77wBUkfbhdHjhzR\nokWLlJGRodTUVF111VX67W9/O6KPf/d3f6fDhw/HXF/CDq273e7oJUH/9V//VcuXL4/Oe/LJJ9Xd\n3a3c3FxVVVWdc232OXPmRK/ZnpWVNeKxrq6uc67v3t4e/0sMTqbRetXT06PZs2dHn+P1etXZ2ams\nrKxp26uUlJQx57FNjTRar3p6enTRRRdFp9mmztXU1KT77rtPQ0NDWr9+vbxe73n1bDrdYyIQCOhv\n/uZvotMf3GNjOt4sq7W1VWVlZTp16pQeeOABnT59WjNmzJD0/nbR2dk56r+lj96rxOFwyOl0amho\naNxLbMclyF944QW9+OKLcjgcsixLDodDDz74oIqKivTss8/qzTff1I4dOyRJd999t/Ly8jRv3jx9\n+9vf1rPPPnvO8ka70f0Hyx3tcZPY7VVXV5et5V2ovRqvTx/FNmW/V3ZcyL36wGg9u+WWW/Tggw9q\n6dKleu211/TII4/oRz/6ka3XOFbPprPp+vrnz5+v8vJylZSUqL29XWvXrtXQ0FB0/lh9Gevx0bat\nj4pLkK9cuVIrV6485/EXXnhBBw4c0A9/+EO5XC5Jih4ykKTrr79eP//5z3X11VfrD3/4Q/Txjo4O\n+f3+6HXeMzMzo9dxH+v67qaw2yuv1zviphln92Q69GqsPo2Gbcper6b7NnW2WD379Kc/rZ6eHmVl\nZam3tzf6+Mfp2XQx3n05phO/36+SkhJJ0rx585Sdna033nhD4XBYKSkpI7aVj/5bKiwsjPYxLy8v\n+gEg1g2vEvYdeXt7u3784x+rtrY2ekhBev8Xxh+82a+88ooWLFigq6++Wv/xH/+hoaEhdXR0qLOz\nU5/61KdUVFSkvXv3SpJ+8Ytf6LrrrtMnPvGJUa/vbrLReuV2u/XJT34y+v3IB69/uvfqA2d/emWb\nGt8HvWKbGt9TTz2lF154QZJ07Ngxeb1ezZgx47x7Nl1wj4337dmzR7W1tZKkrq4udXV16bbbbtPP\nf/5zSdK+fft03XXXadGiRXrjjTc0MDCgYDCoV199VZ/5zGdUVFQUfe6vfvUrXX311THXmbBLtG7b\ntk0/+9nPdMkll0QPXe3atUv79+/Xzp07lZmZqZycHH3nO99Ramqqnn32Wb300ktyOBx6+OGHdfXV\nVysUCumRRx5Rb2+vZs2apSeeeEKZmZljXt/dVGP1qq2tTdXV1bIsS3/7t3+r9evXS9K07dX+/fv1\n5JNPqrOzUxkZGcrKytLu3bu1d+9etqmPGKtXra2tbFNj6Ojo0De/+U1J7x/O3LBhgwoKCuLSs+mC\ne2xIwWBQlZWVOnXqlCzL0gMPPKCFCxdq/fr1CofD+sQnPqGamhq5XC794he/0FNPPSWn06k1a9bo\nlltuUSQS0caNG9XW1qbU1FQ99thj8vv9466Ta60DAGAwruwGAIDBCHIAAAxGkAMAYDCCHAAAgxHk\nAAAYjCAHAMBgBDkAAAYjyAEAMNj/B8PjROCy6KFuAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f93fa00cfd0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"my_hist(ex1_data.values,label='Truth')\n",
"my_hist(mu_samp_1,label='Est')\n",
"plt.legend()\n",
"print(np.mean(mu_samp_1))"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"487.1483416209812\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfUAAAFXCAYAAAC7nNf0A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Dt912m5Ys\nWaJTp05p7dq1OnLkiBwOh8rKynTZZZfFu6WznDhxQjfffLPuu+8+XXfddUb1t2fPHu3YsUMJCQn6\n+te/rszMTGP6CwQCWrNmjY4dO6aTJ0/qvvvu05VXXjnq+3v77bd1//33a+XKlVq+fLmOHj067J7O\n9Tp7TtYF8Je//MW69dZbrWAwaL311lvW448/blmWZd15553WH//4R8uyLKuwsNDav3+/1djYaN1y\nyy3WqVOnrNbWVuumm26ygsGg9fjjj1s7duywLMuynnnmGeuRRx65EKUPyYMPPmjdcsst1sGDBy3L\nMqe/3bt3W+vXr7cs64N9uWTJEsuyzOnvXA4ePGj9y7/8i2VZlvXXv/7V+spXvhLniiJ34MAB6+67\n77Ysy7La29utG2+80Vq7dq31q1/9yrIsy3rsscesp59+2goEAtbChQut7u5u6/jx49bNN99sHTt2\nzKqsrLS+853vWJZlWa+88or1wAMPxK2XwTz22GPWkiVLrMrKSmvt2rXWvn37QvNHc3/t7e3WggUL\nrEAgYLW0tFjf/va3jervJz/5ifXYY49ZlmVZTU1N1k033TTq/z4DgYC1cuVKa/369dZPfvITy7Ks\nqOyzgV5nB3NBTr//+te/Vl5enmw2mz71qU+poKBAJ0+e1OHDhzVjxgxJ0vz581VVVaXf//73uuGG\nG+RwOOR2uzVp0iT95S9/0YEDB/SFL3xBkvT5z39eVVVVF6L0iB04cEAul0uf/OQnJcmo/r785S/r\noYcekvTBrYBPv7t+//33jejvXM713IPRYNasWdq6daskKTU1VYFAQDU1NZo/f76kD/dBbW2tZs6c\nqeTkZI0dO1ZXX321/vCHP/Tr/XOf+5wOHToUt17O5d1339Xf/vY3zZs3T5ZlqaamRp///Ocljf7+\nqqqqlJOTo6SkJKWnp+s73/mODh48aEx/brc7dEe9Y8eOye12j/q/z7Fjx+rf//3flZ6eHpo3nH32\n2muvnfN1djAXJNQPHz6sI0eO6Gtf+5ruuusuvf3222pvb9f48eND67jdbjU3N6u1tbXffeMnTpwY\nup98WlpaaN5Iupf8yZMn9aMf/Ug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98Y9/VHd3t/x+v1577TVdc801ysnJ0a9+\n9StJ0v/8z//o2muvjVsvA9myZYueffZZPfPMM1qyZInuu+8+zZkzJ1TzaO8vJydHv//972VZ1gdP\nTgsEjOpvypQpev311yV9cKnB6XTqc5/7nDH9nTbc/3PnysnBXLDbxD7++OP63e9+J0l66KGH9JnP\nfEb19fUqLS2VZVn6zGc+ozVr1kiSfvrTn2rPnj2y2Wz6xje+oWuvvVaBQEDf+ta31NHRodTUVD3y\nyCNnne4eCR566CHdcsstmjVrljH9bdmyRb/85S916aWXhk4J7dy5Uw0NDUb0N5jR+gyDXbt2qby8\nXJdffnlonz388MMqKSlRb2+vPvaxj6msrEwOh0MvvPCCnnjiCdntdt1555360pe+pGAwqJKSEjU0\nNGjs2LHatGmTvF5vvNsaUHl5uS677DJdf/31evDBB43pb9euXXr22Wdls9m0atUqXXXVVcb0FwgE\nVFxcrNbWVvX19emBBx7QFVdcoTVr1oza/mpra7Vu3Tq1tbXJ4XBo/Pjx2rFjh9auXTusns6VI+fC\nvd8BADAEd5QDAMAQhDoAAIYg1AEAMAShDgCAIQh1AAAMQagDAGAIQh0AAEMQ6gAAGOL/AVAxJn/u\nuO5EAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f94453cf290>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"my_hist(ex2_data.values,label='Truth')\n",
"my_hist(mu_samp_2,label='Est')\n",
"plt.legend()\n",
"print(np.mean(mu_samp_2))\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment