Skip to content

Commit 00f83e1

Browse files
committed
chapter 6 mc -> pm
1 parent 876220d commit 00f83e1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Chapter6_Priorities/Priors.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,14 @@
236236
"cell_type": "code",
237237
"collapsed": false,
238238
"input": [
239-
"import pymc as mc\n",
239+
"import pymc as pm\n",
240240
"\n",
241241
"n = 4\n",
242242
"for i in range( 10 ):\n",
243243
" ax = plt.subplot( 2, 5, i+1)\n",
244244
" if i >= 5:\n",
245245
" n = 15\n",
246-
" plt.imshow( mc.rwishart( n+1, np.eye(n) ), interpolation=\"none\", \n",
246+
" plt.imshow( pm.rwishart( n+1, np.eye(n) ), interpolation=\"none\", \n",
247247
" cmap = plt.cm.hot ) \n",
248248
" \n",
249249
" ax.axis(\"off\")\n",
@@ -1056,15 +1056,15 @@
10561056
"cell_type": "code",
10571057
"collapsed": false,
10581058
"input": [
1059-
"import pymc as mc\n",
1059+
"import pymc as pm\n",
10601060
"\n",
10611061
"n_observations = 100 #we will truncate the the most recent 100 days.\n",
10621062
"\n",
10631063
"prior_mu = np.array( [ x[0] for x in expert_prior_params.values() ] )\n",
10641064
"prior_std = np.array( [ x[1] for x in expert_prior_params.values() ] )\n",
10651065
"\n",
1066-
"inv_cov_matrix = mc.Wishart( \"inv_cov_matrix\", n_observations, diag(prior_std**2) )\n",
1067-
"mu = mc.Normal( \"returns\", prior_mu, 1, size = 4 )"
1066+
"inv_cov_matrix = pm.Wishart( \"inv_cov_matrix\", n_observations, diag(prior_std**2) )\n",
1067+
"mu = pm.Normal( \"returns\", prior_mu, 1, size = 4 )"
10681068
],
10691069
"language": "python",
10701070
"metadata": {},
@@ -1183,10 +1183,10 @@
11831183
"cell_type": "code",
11841184
"collapsed": false,
11851185
"input": [
1186-
"obs = mc.MvNormal( \"observed returns\", mu, inv_cov_matrix, observed = True, value = returns )\n",
1186+
"obs = pm.MvNormal( \"observed returns\", mu, inv_cov_matrix, observed = True, value = returns )\n",
11871187
"\n",
1188-
"model = mc.Model( [obs, mu, inv_cov_matrix] )\n",
1189-
"mcmc = mc.MCMC()\n",
1188+
"model = pm.Model( [obs, mu, inv_cov_matrix] )\n",
1189+
"mcmc = pm.MCMC()\n",
11901190
"\n",
11911191
"mcmc.sample( 150000, 100000, 3 )"
11921192
],
@@ -1435,7 +1435,7 @@
14351435
"beta = stats.beta\n",
14361436
"\n",
14371437
"x = np.linspace(0.00, 1, 125)\n",
1438-
"data = mc.rbernoulli(p, size=500)\n",
1438+
"data = pm.rbernoulli(p, size=500)\n",
14391439
"\n",
14401440
"figure()\n",
14411441
"for i,N in enumerate([0,4,8, 32,64, 128, 500]):\n",

0 commit comments

Comments
 (0)