Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aa54c8e

Browse files
Merge pull request #533 from toppare/fix-all-hist-with-normed
all `normed` keywords changed to `density`
2 parents 629d1ba + 18b0e76 commit aa54c8e

File tree

14 files changed

+46
-46
lines changed

14 files changed

+46
-46
lines changed

‎Chapter1_Introduction/Ch1_Introduction_PyMC2.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@
803803
"ax.set_autoscaley_on(False)\n",
804804
"\n",
805805
"plt.hist(lambda_1_samples, histtype='stepfilled', bins=30, alpha=0.85,\n",
806-
" label=\"posterior of $\\lambda_1$\", color=\"#A60628\", normed=True)\n",
806+
" label=\"posterior of $\\lambda_1$\", color=\"#A60628\", density=True)\n",
807807
"plt.legend(loc=\"upper left\")\n",
808808
"plt.title(r\"\"\"Posterior distributions of the variables\n",
809809
" $\\lambda_1,\\;\\lambda_2,\\;\\tau$\"\"\")\n",
@@ -813,7 +813,7 @@
813813
"ax = plt.subplot(312)\n",
814814
"ax.set_autoscaley_on(False)\n",
815815
"plt.hist(lambda_2_samples, histtype='stepfilled', bins=30, alpha=0.85,\n",
816-
" label=\"posterior of $\\lambda_2$\", color=\"#7A68A6\", normed=True)\n",
816+
" label=\"posterior of $\\lambda_2$\", color=\"#7A68A6\", density=True)\n",
817817
"plt.legend(loc=\"upper left\")\n",
818818
"plt.xlim([15, 30])\n",
819819
"plt.xlabel(\"$\\lambda_2$ value\")\n",

‎Chapter2_MorePyMC/Ch2_MorePyMC_PyMC2.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
"\n",
361361
"\n",
362362
"samples = [lambda_1.random() for i in range(20000)]\n",
363-
"plt.hist(samples, bins=70, normed=True, histtype=\"stepfilled\")\n",
363+
"plt.hist(samples, bins=70, density=True, histtype=\"stepfilled\")\n",
364364
"plt.title(\"Prior distribution for $\\lambda_1$\")\n",
365365
"plt.xlim(0, 8);"
366366
]
@@ -826,7 +826,7 @@
826826
"figsize(12.5, 4)\n",
827827
"plt.title(\"Posterior distribution of $p_A,ドル the true effectiveness of site A\")\n",
828828
"plt.vlines(p_true, 0, 90, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
829-
"plt.hist(mcmc.trace(\"p\")[:], bins=25, histtype=\"stepfilled\", normed=True)\n",
829+
"plt.hist(mcmc.trace(\"p\")[:], bins=25, histtype=\"stepfilled\", density=True)\n",
830830
"plt.legend();"
831831
]
832832
},
@@ -979,7 +979,7 @@
979979
"\n",
980980
"plt.xlim(0, .1)\n",
981981
"plt.hist(p_A_samples, histtype='stepfilled', bins=25, alpha=0.85,\n",
982-
" label=\"posterior of $p_A$\", color=\"#A60628\", normed=True)\n",
982+
" label=\"posterior of $p_A$\", color=\"#A60628\", density=True)\n",
983983
"plt.vlines(true_p_A, 0, 80, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
984984
"plt.legend(loc=\"upper right\")\n",
985985
"plt.title(\"Posterior distributions of $p_A,ドル $p_B,ドル and delta unknowns\")\n",
@@ -988,13 +988,13 @@
988988
"\n",
989989
"plt.xlim(0, .1)\n",
990990
"plt.hist(p_B_samples, histtype='stepfilled', bins=25, alpha=0.85,\n",
991-
" label=\"posterior of $p_B$\", color=\"#467821\", normed=True)\n",
991+
" label=\"posterior of $p_B$\", color=\"#467821\", density=True)\n",
992992
"plt.vlines(true_p_B, 0, 80, linestyle=\"--\", label=\"true $p_B$ (unknown)\")\n",
993993
"plt.legend(loc=\"upper right\")\n",
994994
"\n",
995995
"ax = plt.subplot(313)\n",
996996
"plt.hist(delta_samples, histtype='stepfilled', bins=30, alpha=0.85,\n",
997-
" label=\"posterior of delta\", color=\"#7A68A6\", normed=True)\n",
997+
" label=\"posterior of delta\", color=\"#7A68A6\", density=True)\n",
998998
"plt.vlines(true_p_A - true_p_B, 0, 60, linestyle=\"--\",\n",
999999
" label=\"true delta (unknown)\")\n",
10001000
"plt.vlines(0, 0, 60, color=\"black\", alpha=0.2)\n",
@@ -1353,7 +1353,7 @@
13531353
"source": [
13541354
"figsize(12.5, 3)\n",
13551355
"p_trace = mcmc.trace(\"freq_cheating\")[:]\n",
1356-
"plt.hist(p_trace, histtype=\"stepfilled\", normed=True, alpha=0.85, bins=30,\n",
1356+
"plt.hist(p_trace, histtype=\"stepfilled\", density=True, alpha=0.85, bins=30,\n",
13571357
" label=\"posterior distribution\", color=\"#348ABD\")\n",
13581358
"plt.vlines([.05, .35], [0, 0], [5, 5], alpha=0.3)\n",
13591359
"plt.xlim(0, 1)\n",
@@ -1479,7 +1479,7 @@
14791479
"source": [
14801480
"figsize(12.5, 3)\n",
14811481
"p_trace = mcmc.trace(\"freq_cheating\")[:]\n",
1482-
"plt.hist(p_trace, histtype=\"stepfilled\", normed=True, alpha=0.85, bins=30,\n",
1482+
"plt.hist(p_trace, histtype=\"stepfilled\", density=True, alpha=0.85, bins=30,\n",
14831483
" label=\"posterior distribution\", color=\"#348ABD\")\n",
14841484
"plt.vlines([.05, .35], [0, 0], [5, 5], alpha=0.2)\n",
14851485
"plt.xlim(0, 1)\n",
@@ -1910,12 +1910,12 @@
19101910
"plt.subplot(211)\n",
19111911
"plt.title(r\"Posterior distributions of the variables $\\alpha, \\beta$\")\n",
19121912
"plt.hist(beta_samples, histtype='stepfilled', bins=35, alpha=0.85,\n",
1913-
" label=r\"posterior of $\\beta$\", color=\"#7A68A6\", normed=True)\n",
1913+
" label=r\"posterior of $\\beta$\", color=\"#7A68A6\", density=True)\n",
19141914
"plt.legend()\n",
19151915
"\n",
19161916
"plt.subplot(212)\n",
19171917
"plt.hist(alpha_samples, histtype='stepfilled', bins=35, alpha=0.85,\n",
1918-
" label=r\"posterior of $\\alpha$\", color=\"#A60628\", normed=True)\n",
1918+
" label=r\"posterior of $\\alpha$\", color=\"#A60628\", density=True)\n",
19191919
"plt.legend();"
19201920
]
19211921
},
@@ -2074,7 +2074,7 @@
20742074
"prob_31 = logistic(31, beta_samples, alpha_samples)\n",
20752075
"\n",
20762076
"plt.xlim(0.995, 1)\n",
2077-
"plt.hist(prob_31, bins=1000, normed=True, histtype='stepfilled')\n",
2077+
"plt.hist(prob_31, bins=1000, density=True, histtype='stepfilled')\n",
20782078
"plt.title(\"Posterior distribution of probability of defect, given $t = 31$\")\n",
20792079
"plt.xlabel(\"probability of defect occurring in O-ring\");"
20802080
]

‎Chapter2_MorePyMC/Ch2_MorePyMC_PyMC3.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@
442442
"\n",
443443
"\n",
444444
"samples = lambda_1.random(size=20000)\n",
445-
"plt.hist(samples, bins=70, normed=True, histtype=\"stepfilled\")\n",
445+
"plt.hist(samples, bins=70, density=True, histtype=\"stepfilled\")\n",
446446
"plt.title(\"Prior distribution for $\\lambda_1$\")\n",
447447
"plt.xlim(0, 8);"
448448
]
@@ -894,7 +894,7 @@
894894
"figsize(12.5, 4)\n",
895895
"plt.title(\"Posterior distribution of $p_A,ドル the true effectiveness of site A\")\n",
896896
"plt.vlines(p_true, 0, 90, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
897-
"plt.hist(burned_trace[\"p\"], bins=25, histtype=\"stepfilled\", normed=True)\n",
897+
"plt.hist(burned_trace[\"p\"], bins=25, histtype=\"stepfilled\", density=True)\n",
898898
"plt.legend();"
899899
]
900900
},
@@ -1049,7 +1049,7 @@
10491049
"\n",
10501050
"plt.xlim(0, .1)\n",
10511051
"plt.hist(p_A_samples, histtype='stepfilled', bins=25, alpha=0.85,\n",
1052-
" label=\"posterior of $p_A$\", color=\"#A60628\", normed=True)\n",
1052+
" label=\"posterior of $p_A$\", color=\"#A60628\", density=True)\n",
10531053
"plt.vlines(true_p_A, 0, 80, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
10541054
"plt.legend(loc=\"upper right\")\n",
10551055
"plt.title(\"Posterior distributions of $p_A,ドル $p_B,ドル and delta unknowns\")\n",
@@ -1058,13 +1058,13 @@
10581058
"\n",
10591059
"plt.xlim(0, .1)\n",
10601060
"plt.hist(p_B_samples, histtype='stepfilled', bins=25, alpha=0.85,\n",
1061-
" label=\"posterior of $p_B$\", color=\"#467821\", normed=True)\n",
1061+
" label=\"posterior of $p_B$\", color=\"#467821\", density=True)\n",
10621062
"plt.vlines(true_p_B, 0, 80, linestyle=\"--\", label=\"true $p_B$ (unknown)\")\n",
10631063
"plt.legend(loc=\"upper right\")\n",
10641064
"\n",
10651065
"ax = plt.subplot(313)\n",
10661066
"plt.hist(delta_samples, histtype='stepfilled', bins=30, alpha=0.85,\n",
1067-
" label=\"posterior of delta\", color=\"#7A68A6\", normed=True)\n",
1067+
" label=\"posterior of delta\", color=\"#7A68A6\", density=True)\n",
10681068
"plt.vlines(true_p_A - true_p_B, 0, 60, linestyle=\"--\",\n",
10691069
" label=\"true delta (unknown)\")\n",
10701070
"plt.vlines(0, 0, 60, color=\"black\", alpha=0.2)\n",
@@ -1428,7 +1428,7 @@
14281428
"source": [
14291429
"figsize(12.5, 3)\n",
14301430
"p_trace = burned_trace[\"freq_cheating\"][15000:]\n",
1431-
"plt.hist(p_trace, histtype=\"stepfilled\", normed=True, alpha=0.85, bins=30, \n",
1431+
"plt.hist(p_trace, histtype=\"stepfilled\", density=True, alpha=0.85, bins=30, \n",
14321432
" label=\"posterior distribution\", color=\"#348ABD\")\n",
14331433
"plt.vlines([.05, .35], [0, 0], [5, 5], alpha=0.3)\n",
14341434
"plt.xlim(0, 1)\n",
@@ -1559,7 +1559,7 @@
15591559
"source": [
15601560
"figsize(12.5, 3)\n",
15611561
"p_trace = burned_trace[\"freq_cheating\"]\n",
1562-
"plt.hist(p_trace, histtype=\"stepfilled\", normed=True, alpha=0.85, bins=30, \n",
1562+
"plt.hist(p_trace, histtype=\"stepfilled\", density=True, alpha=0.85, bins=30, \n",
15631563
" label=\"posterior distribution\", color=\"#348ABD\")\n",
15641564
"plt.vlines([.05, .35], [0, 0], [5, 5], alpha=0.2)\n",
15651565
"plt.xlim(0, 1)\n",
@@ -1968,12 +1968,12 @@
19681968
"plt.subplot(211)\n",
19691969
"plt.title(r\"Posterior distributions of the variables $\\alpha, \\beta$\")\n",
19701970
"plt.hist(beta_samples, histtype='stepfilled', bins=35, alpha=0.85,\n",
1971-
" label=r\"posterior of $\\beta$\", color=\"#7A68A6\", normed=True)\n",
1971+
" label=r\"posterior of $\\beta$\", color=\"#7A68A6\", density=True)\n",
19721972
"plt.legend()\n",
19731973
"\n",
19741974
"plt.subplot(212)\n",
19751975
"plt.hist(alpha_samples, histtype='stepfilled', bins=35, alpha=0.85,\n",
1976-
" label=r\"posterior of $\\alpha$\", color=\"#A60628\", normed=True)\n",
1976+
" label=r\"posterior of $\\alpha$\", color=\"#A60628\", density=True)\n",
19771977
"plt.legend();"
19781978
]
19791979
},
@@ -2132,7 +2132,7 @@
21322132
"prob_31 = logistic(31, beta_samples, alpha_samples)\n",
21332133
"\n",
21342134
"plt.xlim(0.995, 1)\n",
2135-
"plt.hist(prob_31, bins=1000, normed=True, histtype='stepfilled')\n",
2135+
"plt.hist(prob_31, bins=1000, density=True, histtype='stepfilled')\n",
21362136
"plt.title(\"Posterior distribution of probability of defect, given $t = 31$\")\n",
21372137
"plt.xlabel(\"probability of defect occurring in O-ring\");"
21382138
]

‎Chapter2_MorePyMC/Ch2_MorePyMC_TFP.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@
679679
"\n",
680680
"# Visualize our stepwise prior distribution\n",
681681
"plt.figure(figsize(12.5, 5))\n",
682-
"plt.hist(lambda_1_, bins=70, normed=True, histtype=\"stepfilled\")\n",
682+
"plt.hist(lambda_1_, bins=70, density=True, histtype=\"stepfilled\")\n",
683683
"plt.title(r\"Prior distribution for $\\lambda_1$\")\n",
684684
"plt.xlim(0, 8);"
685685
],
@@ -1503,7 +1503,7 @@
15031503
"plt.figure(figsize(12.5, 4))\n",
15041504
"plt.title(\"Posterior distribution of $p_A,ドル the true effectiveness of site A\")\n",
15051505
"plt.vlines(prob_true, 0, 90, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
1506-
"plt.hist(burned_prob_A_trace_, bins=25, histtype=\"stepfilled\", normed=True)\n",
1506+
"plt.hist(burned_prob_A_trace_, bins=25, histtype=\"stepfilled\", density=True)\n",
15071507
"plt.legend();"
15081508
],
15091509
"execution_count": 20,
@@ -1829,7 +1829,7 @@
18291829
"\n",
18301830
"plt.xlim(0, .1)\n",
18311831
"plt.hist(burned_prob_A_trace_, histtype='stepfilled', bins=25, alpha=0.85,\n",
1832-
" label=\"posterior of $p_A$\", color=TFColor[0], normed=True)\n",
1832+
" label=\"posterior of $p_A$\", color=TFColor[0], density=True)\n",
18331833
"plt.vlines(true_prob_A_, 0, 80, linestyle=\"--\", label=\"true $p_A$ (unknown)\")\n",
18341834
"plt.legend(loc=\"upper right\")\n",
18351835
"plt.title(\"Posterior distributions of $p_A,ドル $p_B,ドル and delta unknowns\")\n",
@@ -1838,13 +1838,13 @@
18381838
"\n",
18391839
"plt.xlim(0, .1)\n",
18401840
"plt.hist(burned_prob_B_trace_, histtype='stepfilled', bins=25, alpha=0.85,\n",
1841-
" label=\"posterior of $p_B$\", color=TFColor[2], normed=True)\n",
1841+
" label=\"posterior of $p_B$\", color=TFColor[2], density=True)\n",
18421842
"plt.vlines(true_prob_B_, 0, 80, linestyle=\"--\", label=\"true $p_B$ (unknown)\")\n",
18431843
"plt.legend(loc=\"upper right\")\n",
18441844
"\n",
18451845
"ax = plt.subplot(313)\n",
18461846
"plt.hist(burned_delta_trace_, histtype='stepfilled', bins=30, alpha=0.85,\n",
1847-
" label=\"posterior of delta\", color=TFColor[6], normed=True)\n",
1847+
" label=\"posterior of delta\", color=TFColor[6], density=True)\n",
18481848
"plt.vlines(true_prob_A_ - true_prob_B_, 0, 60, linestyle=\"--\",\n",
18491849
" label=\"true delta (unknown)\")\n",
18501850
"plt.vlines(0, 0, 60, color=\"black\", alpha=0.2)\n",
@@ -2796,7 +2796,7 @@
27962796
"source": [
27972797
"plt.figure(figsize(12.5, 6))\n",
27982798
"p_trace_ = freq_cheating_samples_\n",
2799-
"plt.hist(p_trace_, histtype=\"stepfilled\", normed=True, alpha=0.85, bins=30, \n",
2799+
"plt.hist(p_trace_, histtype=\"stepfilled\", density=True, alpha=0.85, bins=30, \n",
28002800
" label=\"posterior distribution\", color=TFColor[3])\n",
28012801
"plt.vlines([.1, .40], [0, 0], [5, 5], alpha=0.2)\n",
28022802
"plt.xlim(0, 1)\n",

‎Chapter3_MCMC/Ch3_IntroMCMC_PyMC2.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@
801801
"posterior_std_means = std_trace.mean(axis=0)\n",
802802
"posterior_p_mean = mcmc.trace(\"p\")[:].mean()\n",
803803
"\n",
804-
"plt.hist(data, bins=20, histtype=\"step\", normed=True, color=\"k\",\n",
804+
"plt.hist(data, bins=20, histtype=\"step\", density=True, color=\"k\",\n",
805805
" lw=2, label=\"histogram of data\")\n",
806806
"y = posterior_p_mean * norm.pdf(x, loc=posterior_center_means[0],\n",
807807
" scale=posterior_std_means[0])\n",

‎Chapter3_MCMC/Ch3_IntroMCMC_PyMC3.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@
785785
"posterior_std_means = std_trace.mean(axis=0)\n",
786786
"posterior_p_mean = trace[\"p\"].mean()\n",
787787
"\n",
788-
"plt.hist(data, bins=20, histtype=\"step\", normed=True, color=\"k\",\n",
788+
"plt.hist(data, bins=20, histtype=\"step\", density=True, color=\"k\",\n",
789789
" lw=2, label=\"histogram of data\")\n",
790790
"y = posterior_p_mean * norm.pdf(x, loc=posterior_center_means[0],\n",
791791
" scale=posterior_std_means[0])\n",

‎Chapter4_TheGreatestTheoremNeverTold/Ch4_LawOfLargeNumbers_PyMC2.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,10 @@
601601
"for i in range(len(submissions)):\n",
602602
" j = submissions[i]\n",
603603
" posteriors.append(posterior_upvote_ratio(votes[j, 0], votes[j, 1]))\n",
604-
" plt.hist(posteriors[i], bins=18, normed=True, alpha=.9,\n",
604+
" plt.hist(posteriors[i], bins=18, density=True, alpha=.9,\n",
605605
" histtype=\"step\", color=colours[i % 5], lw=3,\n",
606606
" label='(%d up:%d down)\\n%s...' % (votes[j, 0], votes[j, 1], contents[j][:50]))\n",
607-
" plt.hist(posteriors[i], bins=18, normed=True, alpha=.2,\n",
607+
" plt.hist(posteriors[i], bins=18, density=True, alpha=.2,\n",
608608
" histtype=\"stepfilled\", color=colours[i], lw=3, )\n",
609609
"\n",
610610
"plt.legend(loc=\"upper left\")\n",
@@ -654,10 +654,10 @@
654654
"\n",
655655
"for i in range(len(submissions)):\n",
656656
" j = submissions[i]\n",
657-
" plt.hist(posteriors[i], bins=20, normed=True, alpha=.9,\n",
657+
" plt.hist(posteriors[i], bins=20, density=True, alpha=.9,\n",
658658
" histtype=\"step\", color=colours[i], lw=3,\n",
659659
" label='(%d up:%d down)\\n%s...' % (votes[j, 0], votes[j, 1], contents[j][:50]))\n",
660-
" plt.hist(posteriors[i], bins=20, normed=True, alpha=.2,\n",
660+
" plt.hist(posteriors[i], bins=20, density=True, alpha=.2,\n",
661661
" histtype=\"stepfilled\", color=colours[i], lw=3, )\n",
662662
" v = np.sort(posteriors[i])[int(0.05 * N)]\n",
663663
" # plt.vlines( v, 0, 15 , color = \"k\", alpha = 1, linewidths=3 )\n",

‎Chapter5_LossFunctions/Ch5_LossFunctions_PyMC2.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@
297297
"plt.plot(x, stats.norm.pdf(x, 35000, 7500), c=\"k\", lw=2,\n",
298298
" label=\"prior dist. of suite price\")\n",
299299
"\n",
300-
"_hist = plt.hist(price_trace, bins=35, normed=True, histtype=\"stepfilled\")\n",
300+
"_hist = plt.hist(price_trace, bins=35, density=True, histtype=\"stepfilled\")\n",
301301
"plt.title(\"Posterior of the true price estimate\")\n",
302302
"plt.vlines(mu_prior, 0, 1.1 * np.max(_hist[0]), label=\"prior's mean\",\n",
303303
" linestyles=\"--\")\n",

‎Chapter5_LossFunctions/Ch5_LossFunctions_TFP.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@
722722
"plt.plot(prices_, prior_, c=\"k\", lw=2,\n",
723723
" label=\"prior dist. of suite price\")\n",
724724
"\n",
725-
"hist = plt.hist(posterior_price_predictive_samples_, bins=35, normed=True, histtype=\"stepfilled\")\n",
725+
"hist = plt.hist(posterior_price_predictive_samples_, bins=35, density=True, histtype=\"stepfilled\")\n",
726726
"plt.title(\"Posterior of the true price estimate\")\n",
727727
"plt.vlines(mu_prior, 0, 1.1 * np.max(hist[0]), label=\"prior's mean\",\n",
728728
" linestyles=\"--\")\n",

‎Chapter6_Priorities/Ch6_Priors_PyMC2.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@
11841184
" returns[:, i] = _returns\n",
11851185
" plt.subplot(2, 2, i+1)\n",
11861186
" plt.hist(_returns, bins=20,\n",
1187-
" normed=True, histtype=\"stepfilled\",\n",
1187+
" density=True, histtype=\"stepfilled\",\n",
11881188
" color=colors[i], alpha=0.7)\n",
11891189
" plt.title(_stock + \" returns\")\n",
11901190
" plt.xlim(-0.15, 0.15)\n",
@@ -1258,7 +1258,7 @@
12581258
"\n",
12591259
"for i in range(4):\n",
12601260
" plt.hist(mu_samples[:, i], alpha=0.8 - 0.05 * i, bins=30,\n",
1261-
" histtype=\"stepfilled\", normed=True,\n",
1261+
" histtype=\"stepfilled\", density=True,\n",
12621262
" label=\"%s\" % list(stock_returns.keys())[i])\n",
12631263
"\n",
12641264
"plt.vlines(mu_samples.mean(axis=0), 0, 500, linestyle=\"--\", linewidth=.5)\n",
@@ -1302,7 +1302,7 @@
13021302
"for i in range(4):\n",
13031303
" plt.subplot(2, 2, i + 1)\n",
13041304
" plt.hist(mu_samples[:, i], alpha=0.8 - 0.05 * i, bins=30,\n",
1305-
" histtype=\"stepfilled\", normed=True, color=colors[i],\n",
1305+
" histtype=\"stepfilled\", density=True, color=colors[i],\n",
13061306
" label=\"%s\" % list(stock_returns.keys())[i])\n",
13071307
" plt.title(\"%s\" % list(stock_returns.keys())[i])\n",
13081308
" plt.xlim(-0.15, 0.15)\n",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /