Skip to content

all normed keywords changed to density #533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Chapter1_Introduction/Ch1_Introduction_PyMC2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@
"ax.set_autoscaley_on(False)\n",
"\n",
"plt.hist(lambda_1_samples, histtype='stepfilled', bins=30, alpha=0.85,\n",
" label=\"posterior of $\\lambda_1$\", color=\"#A60628\", normed=True)\n",
" label=\"posterior of $\\lambda_1$\", color=\"#A60628\", density=True)\n",
"plt.legend(loc=\"upper left\")\n",
"plt.title(r\"\"\"Posterior distributions of the variables\n",
" $\\lambda_1,\\;\\lambda_2,\\;\\tau$\"\"\")\n",
Expand All @@ -813,7 +813,7 @@
"ax = plt.subplot(312)\n",
"ax.set_autoscaley_on(False)\n",
"plt.hist(lambda_2_samples, histtype='stepfilled', bins=30, alpha=0.85,\n",
" label=\"posterior of $\\lambda_2$\", color=\"#7A68A6\", normed=True)\n",
" label=\"posterior of $\\lambda_2$\", color=\"#7A68A6\", density=True)\n",
"plt.legend(loc=\"upper left\")\n",
"plt.xlim([15, 30])\n",
"plt.xlabel(\"$\\lambda_2$ value\")\n",
Expand Down
20 changes: 10 additions & 10 deletions Chapter2_MorePyMC/Ch2_MorePyMC_PyMC2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
"\n",
"\n",
"samples = [lambda_1.random() for i in range(20000)]\n",
"plt.hist(samples, bins=70, normed=True, histtype=\"stepfilled\")\n",
"plt.hist(samples, bins=70, density=True, histtype=\"stepfilled\")\n",
"plt.title(\"Prior distribution for $\\lambda_1$\")\n",
"plt.xlim(0, 8);"
]
Expand Down Expand Up @@ -826,7 +826,7 @@
"figsize(12.5, 4)\n",
"plt.title(\"Posterior distribution of $p_A$, the true effectiveness of site A\")\n",
"plt.vlines(p_true, 0, 90, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
"plt.hist(mcmc.trace(\"p\")[:], bins=25, histtype=\"stepfilled\", normed=True)\n",
"plt.hist(mcmc.trace(\"p\")[:], bins=25, histtype=\"stepfilled\", density=True)\n",
"plt.legend();"
]
},
Expand Down Expand Up @@ -979,7 +979,7 @@
"\n",
"plt.xlim(0, .1)\n",
"plt.hist(p_A_samples, histtype='stepfilled', bins=25, alpha=0.85,\n",
" label=\"posterior of $p_A$\", color=\"#A60628\", normed=True)\n",
" label=\"posterior of $p_A$\", color=\"#A60628\", density=True)\n",
"plt.vlines(true_p_A, 0, 80, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
"plt.legend(loc=\"upper right\")\n",
"plt.title(\"Posterior distributions of $p_A$, $p_B$, and delta unknowns\")\n",
Expand All @@ -988,13 +988,13 @@
"\n",
"plt.xlim(0, .1)\n",
"plt.hist(p_B_samples, histtype='stepfilled', bins=25, alpha=0.85,\n",
" label=\"posterior of $p_B$\", color=\"#467821\", normed=True)\n",
" label=\"posterior of $p_B$\", color=\"#467821\", density=True)\n",
"plt.vlines(true_p_B, 0, 80, linestyle=\"--\", label=\"true $p_B$ (unknown)\")\n",
"plt.legend(loc=\"upper right\")\n",
"\n",
"ax = plt.subplot(313)\n",
"plt.hist(delta_samples, histtype='stepfilled', bins=30, alpha=0.85,\n",
" label=\"posterior of delta\", color=\"#7A68A6\", normed=True)\n",
" label=\"posterior of delta\", color=\"#7A68A6\", density=True)\n",
"plt.vlines(true_p_A - true_p_B, 0, 60, linestyle=\"--\",\n",
" label=\"true delta (unknown)\")\n",
"plt.vlines(0, 0, 60, color=\"black\", alpha=0.2)\n",
Expand Down Expand Up @@ -1353,7 +1353,7 @@
"source": [
"figsize(12.5, 3)\n",
"p_trace = mcmc.trace(\"freq_cheating\")[:]\n",
"plt.hist(p_trace, histtype=\"stepfilled\", normed=True, alpha=0.85, bins=30,\n",
"plt.hist(p_trace, histtype=\"stepfilled\", density=True, alpha=0.85, bins=30,\n",
" label=\"posterior distribution\", color=\"#348ABD\")\n",
"plt.vlines([.05, .35], [0, 0], [5, 5], alpha=0.3)\n",
"plt.xlim(0, 1)\n",
Expand Down Expand Up @@ -1479,7 +1479,7 @@
"source": [
"figsize(12.5, 3)\n",
"p_trace = mcmc.trace(\"freq_cheating\")[:]\n",
"plt.hist(p_trace, histtype=\"stepfilled\", normed=True, alpha=0.85, bins=30,\n",
"plt.hist(p_trace, histtype=\"stepfilled\", density=True, alpha=0.85, bins=30,\n",
" label=\"posterior distribution\", color=\"#348ABD\")\n",
"plt.vlines([.05, .35], [0, 0], [5, 5], alpha=0.2)\n",
"plt.xlim(0, 1)\n",
Expand Down Expand Up @@ -1910,12 +1910,12 @@
"plt.subplot(211)\n",
"plt.title(r\"Posterior distributions of the variables $\\alpha, \\beta$\")\n",
"plt.hist(beta_samples, histtype='stepfilled', bins=35, alpha=0.85,\n",
" label=r\"posterior of $\\beta$\", color=\"#7A68A6\", normed=True)\n",
" label=r\"posterior of $\\beta$\", color=\"#7A68A6\", density=True)\n",
"plt.legend()\n",
"\n",
"plt.subplot(212)\n",
"plt.hist(alpha_samples, histtype='stepfilled', bins=35, alpha=0.85,\n",
" label=r\"posterior of $\\alpha$\", color=\"#A60628\", normed=True)\n",
" label=r\"posterior of $\\alpha$\", color=\"#A60628\", density=True)\n",
"plt.legend();"
]
},
Expand Down Expand Up @@ -2074,7 +2074,7 @@
"prob_31 = logistic(31, beta_samples, alpha_samples)\n",
"\n",
"plt.xlim(0.995, 1)\n",
"plt.hist(prob_31, bins=1000, normed=True, histtype='stepfilled')\n",
"plt.hist(prob_31, bins=1000, density=True, histtype='stepfilled')\n",
"plt.title(\"Posterior distribution of probability of defect, given $t = 31$\")\n",
"plt.xlabel(\"probability of defect occurring in O-ring\");"
]
Expand Down
20 changes: 10 additions & 10 deletions Chapter2_MorePyMC/Ch2_MorePyMC_PyMC3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
"\n",
"\n",
"samples = lambda_1.random(size=20000)\n",
"plt.hist(samples, bins=70, normed=True, histtype=\"stepfilled\")\n",
"plt.hist(samples, bins=70, density=True, histtype=\"stepfilled\")\n",
"plt.title(\"Prior distribution for $\\lambda_1$\")\n",
"plt.xlim(0, 8);"
]
Expand Down Expand Up @@ -894,7 +894,7 @@
"figsize(12.5, 4)\n",
"plt.title(\"Posterior distribution of $p_A$, the true effectiveness of site A\")\n",
"plt.vlines(p_true, 0, 90, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
"plt.hist(burned_trace[\"p\"], bins=25, histtype=\"stepfilled\", normed=True)\n",
"plt.hist(burned_trace[\"p\"], bins=25, histtype=\"stepfilled\", density=True)\n",
"plt.legend();"
]
},
Expand Down Expand Up @@ -1049,7 +1049,7 @@
"\n",
"plt.xlim(0, .1)\n",
"plt.hist(p_A_samples, histtype='stepfilled', bins=25, alpha=0.85,\n",
" label=\"posterior of $p_A$\", color=\"#A60628\", normed=True)\n",
" label=\"posterior of $p_A$\", color=\"#A60628\", density=True)\n",
"plt.vlines(true_p_A, 0, 80, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
"plt.legend(loc=\"upper right\")\n",
"plt.title(\"Posterior distributions of $p_A$, $p_B$, and delta unknowns\")\n",
Expand All @@ -1058,13 +1058,13 @@
"\n",
"plt.xlim(0, .1)\n",
"plt.hist(p_B_samples, histtype='stepfilled', bins=25, alpha=0.85,\n",
" label=\"posterior of $p_B$\", color=\"#467821\", normed=True)\n",
" label=\"posterior of $p_B$\", color=\"#467821\", density=True)\n",
"plt.vlines(true_p_B, 0, 80, linestyle=\"--\", label=\"true $p_B$ (unknown)\")\n",
"plt.legend(loc=\"upper right\")\n",
"\n",
"ax = plt.subplot(313)\n",
"plt.hist(delta_samples, histtype='stepfilled', bins=30, alpha=0.85,\n",
" label=\"posterior of delta\", color=\"#7A68A6\", normed=True)\n",
" label=\"posterior of delta\", color=\"#7A68A6\", density=True)\n",
"plt.vlines(true_p_A - true_p_B, 0, 60, linestyle=\"--\",\n",
" label=\"true delta (unknown)\")\n",
"plt.vlines(0, 0, 60, color=\"black\", alpha=0.2)\n",
Expand Down Expand Up @@ -1428,7 +1428,7 @@
"source": [
"figsize(12.5, 3)\n",
"p_trace = burned_trace[\"freq_cheating\"][15000:]\n",
"plt.hist(p_trace, histtype=\"stepfilled\", normed=True, alpha=0.85, bins=30, \n",
"plt.hist(p_trace, histtype=\"stepfilled\", density=True, alpha=0.85, bins=30, \n",
" label=\"posterior distribution\", color=\"#348ABD\")\n",
"plt.vlines([.05, .35], [0, 0], [5, 5], alpha=0.3)\n",
"plt.xlim(0, 1)\n",
Expand Down Expand Up @@ -1559,7 +1559,7 @@
"source": [
"figsize(12.5, 3)\n",
"p_trace = burned_trace[\"freq_cheating\"]\n",
"plt.hist(p_trace, histtype=\"stepfilled\", normed=True, alpha=0.85, bins=30, \n",
"plt.hist(p_trace, histtype=\"stepfilled\", density=True, alpha=0.85, bins=30, \n",
" label=\"posterior distribution\", color=\"#348ABD\")\n",
"plt.vlines([.05, .35], [0, 0], [5, 5], alpha=0.2)\n",
"plt.xlim(0, 1)\n",
Expand Down Expand Up @@ -1968,12 +1968,12 @@
"plt.subplot(211)\n",
"plt.title(r\"Posterior distributions of the variables $\\alpha, \\beta$\")\n",
"plt.hist(beta_samples, histtype='stepfilled', bins=35, alpha=0.85,\n",
" label=r\"posterior of $\\beta$\", color=\"#7A68A6\", normed=True)\n",
" label=r\"posterior of $\\beta$\", color=\"#7A68A6\", density=True)\n",
"plt.legend()\n",
"\n",
"plt.subplot(212)\n",
"plt.hist(alpha_samples, histtype='stepfilled', bins=35, alpha=0.85,\n",
" label=r\"posterior of $\\alpha$\", color=\"#A60628\", normed=True)\n",
" label=r\"posterior of $\\alpha$\", color=\"#A60628\", density=True)\n",
"plt.legend();"
]
},
Expand Down Expand Up @@ -2132,7 +2132,7 @@
"prob_31 = logistic(31, beta_samples, alpha_samples)\n",
"\n",
"plt.xlim(0.995, 1)\n",
"plt.hist(prob_31, bins=1000, normed=True, histtype='stepfilled')\n",
"plt.hist(prob_31, bins=1000, density=True, histtype='stepfilled')\n",
"plt.title(\"Posterior distribution of probability of defect, given $t = 31$\")\n",
"plt.xlabel(\"probability of defect occurring in O-ring\");"
]
Expand Down
12 changes: 6 additions & 6 deletions Chapter2_MorePyMC/Ch2_MorePyMC_TFP.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@
"\n",
"# Visualize our stepwise prior distribution\n",
"plt.figure(figsize(12.5, 5))\n",
"plt.hist(lambda_1_, bins=70, normed=True, histtype=\"stepfilled\")\n",
"plt.hist(lambda_1_, bins=70, density=True, histtype=\"stepfilled\")\n",
"plt.title(r\"Prior distribution for $\\lambda_1$\")\n",
"plt.xlim(0, 8);"
],
Expand Down Expand Up @@ -1503,7 +1503,7 @@
"plt.figure(figsize(12.5, 4))\n",
"plt.title(\"Posterior distribution of $p_A$, the true effectiveness of site A\")\n",
"plt.vlines(prob_true, 0, 90, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
"plt.hist(burned_prob_A_trace_, bins=25, histtype=\"stepfilled\", normed=True)\n",
"plt.hist(burned_prob_A_trace_, bins=25, histtype=\"stepfilled\", density=True)\n",
"plt.legend();"
],
"execution_count": 20,
Expand Down Expand Up @@ -1829,7 +1829,7 @@
"\n",
"plt.xlim(0, .1)\n",
"plt.hist(burned_prob_A_trace_, histtype='stepfilled', bins=25, alpha=0.85,\n",
" label=\"posterior of $p_A$\", color=TFColor[0], normed=True)\n",
" label=\"posterior of $p_A$\", color=TFColor[0], density=True)\n",
"plt.vlines(true_prob_A_, 0, 80, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
"plt.legend(loc=\"upper right\")\n",
"plt.title(\"Posterior distributions of $p_A$, $p_B$, and delta unknowns\")\n",
Expand All @@ -1838,13 +1838,13 @@
"\n",
"plt.xlim(0, .1)\n",
"plt.hist(burned_prob_B_trace_, histtype='stepfilled', bins=25, alpha=0.85,\n",
" label=\"posterior of $p_B$\", color=TFColor[2], normed=True)\n",
" label=\"posterior of $p_B$\", color=TFColor[2], density=True)\n",
"plt.vlines(true_prob_B_, 0, 80, linestyle=\"--\", label=\"true $p_B$ (unknown)\")\n",
"plt.legend(loc=\"upper right\")\n",
"\n",
"ax = plt.subplot(313)\n",
"plt.hist(burned_delta_trace_, histtype='stepfilled', bins=30, alpha=0.85,\n",
" label=\"posterior of delta\", color=TFColor[6], normed=True)\n",
" label=\"posterior of delta\", color=TFColor[6], density=True)\n",
"plt.vlines(true_prob_A_ - true_prob_B_, 0, 60, linestyle=\"--\",\n",
" label=\"true delta (unknown)\")\n",
"plt.vlines(0, 0, 60, color=\"black\", alpha=0.2)\n",
Expand Down Expand Up @@ -2796,7 +2796,7 @@
"source": [
"plt.figure(figsize(12.5, 6))\n",
"p_trace_ = freq_cheating_samples_\n",
"plt.hist(p_trace_, histtype=\"stepfilled\", normed=True, alpha=0.85, bins=30, \n",
"plt.hist(p_trace_, histtype=\"stepfilled\", density=True, alpha=0.85, bins=30, \n",
" label=\"posterior distribution\", color=TFColor[3])\n",
"plt.vlines([.1, .40], [0, 0], [5, 5], alpha=0.2)\n",
"plt.xlim(0, 1)\n",
Expand Down
2 changes: 1 addition & 1 deletion Chapter3_MCMC/Ch3_IntroMCMC_PyMC2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@
"posterior_std_means = std_trace.mean(axis=0)\n",
"posterior_p_mean = mcmc.trace(\"p\")[:].mean()\n",
"\n",
"plt.hist(data, bins=20, histtype=\"step\", normed=True, color=\"k\",\n",
"plt.hist(data, bins=20, histtype=\"step\", density=True, color=\"k\",\n",
" lw=2, label=\"histogram of data\")\n",
"y = posterior_p_mean * norm.pdf(x, loc=posterior_center_means[0],\n",
" scale=posterior_std_means[0])\n",
Expand Down
2 changes: 1 addition & 1 deletion Chapter3_MCMC/Ch3_IntroMCMC_PyMC3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@
"posterior_std_means = std_trace.mean(axis=0)\n",
"posterior_p_mean = trace[\"p\"].mean()\n",
"\n",
"plt.hist(data, bins=20, histtype=\"step\", normed=True, color=\"k\",\n",
"plt.hist(data, bins=20, histtype=\"step\", density=True, color=\"k\",\n",
" lw=2, label=\"histogram of data\")\n",
"y = posterior_p_mean * norm.pdf(x, loc=posterior_center_means[0],\n",
" scale=posterior_std_means[0])\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,10 +601,10 @@
"for i in range(len(submissions)):\n",
" j = submissions[i]\n",
" posteriors.append(posterior_upvote_ratio(votes[j, 0], votes[j, 1]))\n",
" plt.hist(posteriors[i], bins=18, normed=True, alpha=.9,\n",
" plt.hist(posteriors[i], bins=18, density=True, alpha=.9,\n",
" histtype=\"step\", color=colours[i % 5], lw=3,\n",
" label='(%d up:%d down)\\n%s...' % (votes[j, 0], votes[j, 1], contents[j][:50]))\n",
" plt.hist(posteriors[i], bins=18, normed=True, alpha=.2,\n",
" plt.hist(posteriors[i], bins=18, density=True, alpha=.2,\n",
" histtype=\"stepfilled\", color=colours[i], lw=3, )\n",
"\n",
"plt.legend(loc=\"upper left\")\n",
Expand Down Expand Up @@ -654,10 +654,10 @@
"\n",
"for i in range(len(submissions)):\n",
" j = submissions[i]\n",
" plt.hist(posteriors[i], bins=20, normed=True, alpha=.9,\n",
" plt.hist(posteriors[i], bins=20, density=True, alpha=.9,\n",
" histtype=\"step\", color=colours[i], lw=3,\n",
" label='(%d up:%d down)\\n%s...' % (votes[j, 0], votes[j, 1], contents[j][:50]))\n",
" plt.hist(posteriors[i], bins=20, normed=True, alpha=.2,\n",
" plt.hist(posteriors[i], bins=20, density=True, alpha=.2,\n",
" histtype=\"stepfilled\", color=colours[i], lw=3, )\n",
" v = np.sort(posteriors[i])[int(0.05 * N)]\n",
" # plt.vlines( v, 0, 15 , color = \"k\", alpha = 1, linewidths=3 )\n",
Expand Down
2 changes: 1 addition & 1 deletion Chapter5_LossFunctions/Ch5_LossFunctions_PyMC2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
"plt.plot(x, stats.norm.pdf(x, 35000, 7500), c=\"k\", lw=2,\n",
" label=\"prior dist. of suite price\")\n",
"\n",
"_hist = plt.hist(price_trace, bins=35, normed=True, histtype=\"stepfilled\")\n",
"_hist = plt.hist(price_trace, bins=35, density=True, histtype=\"stepfilled\")\n",
"plt.title(\"Posterior of the true price estimate\")\n",
"plt.vlines(mu_prior, 0, 1.1 * np.max(_hist[0]), label=\"prior's mean\",\n",
" linestyles=\"--\")\n",
Expand Down
2 changes: 1 addition & 1 deletion Chapter5_LossFunctions/Ch5_LossFunctions_TFP.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@
"plt.plot(prices_, prior_, c=\"k\", lw=2,\n",
" label=\"prior dist. of suite price\")\n",
"\n",
"hist = plt.hist(posterior_price_predictive_samples_, bins=35, normed=True, histtype=\"stepfilled\")\n",
"hist = plt.hist(posterior_price_predictive_samples_, bins=35, density=True, histtype=\"stepfilled\")\n",
"plt.title(\"Posterior of the true price estimate\")\n",
"plt.vlines(mu_prior, 0, 1.1 * np.max(hist[0]), label=\"prior's mean\",\n",
" linestyles=\"--\")\n",
Expand Down
6 changes: 3 additions & 3 deletions Chapter6_Priorities/Ch6_Priors_PyMC2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@
" returns[:, i] = _returns\n",
" plt.subplot(2, 2, i+1)\n",
" plt.hist(_returns, bins=20,\n",
" normed=True, histtype=\"stepfilled\",\n",
" density=True, histtype=\"stepfilled\",\n",
" color=colors[i], alpha=0.7)\n",
" plt.title(_stock + \" returns\")\n",
" plt.xlim(-0.15, 0.15)\n",
Expand Down Expand Up @@ -1258,7 +1258,7 @@
"\n",
"for i in range(4):\n",
" plt.hist(mu_samples[:, i], alpha=0.8 - 0.05 * i, bins=30,\n",
" histtype=\"stepfilled\", normed=True,\n",
" histtype=\"stepfilled\", density=True,\n",
" label=\"%s\" % list(stock_returns.keys())[i])\n",
"\n",
"plt.vlines(mu_samples.mean(axis=0), 0, 500, linestyle=\"--\", linewidth=.5)\n",
Expand Down Expand Up @@ -1302,7 +1302,7 @@
"for i in range(4):\n",
" plt.subplot(2, 2, i + 1)\n",
" plt.hist(mu_samples[:, i], alpha=0.8 - 0.05 * i, bins=30,\n",
" histtype=\"stepfilled\", normed=True, color=colors[i],\n",
" histtype=\"stepfilled\", density=True, color=colors[i],\n",
" label=\"%s\" % list(stock_returns.keys())[i])\n",
" plt.title(\"%s\" % list(stock_returns.keys())[i])\n",
" plt.xlim(-0.15, 0.15)\n",
Expand Down
4 changes: 2 additions & 2 deletions Chapter6_Priorities/Ch6_Priors_PyMC3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@
"\n",
"for i in range(4):\n",
" plt.hist(mu_samples[:,i], alpha = 0.8 - 0.05*i, bins = 30,\n",
" histtype=\"stepfilled\", normed=True, \n",
" histtype=\"stepfilled\", density=True, \n",
" label = \"%s\" % stock_returns.columns[i])\n",
"\n",
"plt.vlines(mu_samples.mean(axis=0), 0, 500, linestyle=\"--\", linewidth = .5)\n",
Expand Down Expand Up @@ -1302,7 +1302,7 @@
"for i in range(4):\n",
" plt.subplot(2,2,i+1)\n",
" plt.hist(mu_samples[:,i], alpha = 0.8 - 0.05*i, bins = 30,\n",
" histtype=\"stepfilled\", normed=True, color = colors[i],\n",
" histtype=\"stepfilled\", density=True, color = colors[i],\n",
" label = \"%s\" % stock_returns.columns[i])\n",
" plt.title(\"%s\" % stock_returns.columns[i])\n",
" plt.xlim(-0.15, 0.15)\n",
Expand Down
4 changes: 2 additions & 2 deletions Chapter6_Priorities/Ch6_Priors_TFP.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2313,7 +2313,7 @@
"\n",
"for i in range(4):\n",
" plt.hist(mu_samples_[:,i], alpha = 0.8 - 0.05*i, bins = 30,\n",
" histtype=\"stepfilled\", color=colors[i], normed=True, \n",
" histtype=\"stepfilled\", color=colors[i], density=True, \n",
" label = \"%s\" % stock_returns.columns[i])\n",
"\n",
"plt.vlines(mu_samples_.mean(axis=0), 0, 500, linestyle=\"--\", linewidth = .5)\n",
Expand Down Expand Up @@ -2373,7 +2373,7 @@
"for i in range(4):\n",
" plt.subplot(2,2,i+1)\n",
" plt.hist(mu_samples_[:,i], alpha = 0.8 - 0.05*i, bins = 30,\n",
" histtype=\"stepfilled\", normed=True, color = colors[i],\n",
" histtype=\"stepfilled\", density=True, color = colors[i],\n",
" label = \"%s\" % stock_returns.columns[i])\n",
" plt.title(\"%s\" % stock_returns.columns[i])\n",
" plt.xlim(-0.15, 0.15)\n",
Expand Down
4 changes: 2 additions & 2 deletions sandbox/CommitDataForChapter1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"ax.set_autoscaley_on(False)\n",
"\n",
"plt.hist(lambda_1_samples, histtype='stepfilled', bins=30, alpha=0.85,\n",
" label=\"posterior of $\\lambda_1$\", color=\"#A60628\", normed=True)\n",
" label=\"posterior of $\\lambda_1$\", color=\"#A60628\", density=True)\n",
"plt.legend(loc=\"upper left\")\n",
"plt.title(r\"Posterior distributions of the variables \\\n",
" $\\lambda_1,\\;\\lambda_2,\\;\\tau$\")\n",
Expand All @@ -171,7 +171,7 @@
"ax.set_autoscaley_on(False)\n",
"\n",
"plt.hist(lambda_2_samples, histtype='stepfilled', bins=30, alpha=0.85,\n",
" label=\"posterior of $\\lambda_2$\", color=\"#7A68A6\", normed=True)\n",
" label=\"posterior of $\\lambda_2$\", color=\"#7A68A6\", density=True)\n",
"plt.legend(loc=\"upper left\")\n",
"\n",
"plt.xlabel(\"$\\lambda_2$ value\")\n",
Expand Down
Loading