Skip to content

Commit df70347

Browse files
committed
Merge branch 'cam-master' into misc-style
2 parents 4245f96 + 1e55d2d commit df70347

File tree

9 files changed

+266
-163
lines changed

9 files changed

+266
-163
lines changed

Chapter1_Introduction/Chapter1_Introduction.ipynb

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@
973973
"### References\n",
974974
"\n",
975975
"\n",
976-
"- [1] Gelman, Andrew. N.p.. Web. 22 Jan 2013. [N is never large enough](http://andrewgelman.com/2005/07/n_is_never_large).\n",
976+
"- [1] Gelman, Andrew. N.p.. Web. 22 Jan 2013. [N is never large enough](http://andrewgelman.com/2005/07/31/n_is_never_larg/).\n",
977977
"- [2] Norvig, Peter. 2009. [The Unreasonable Effectiveness of Data](http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35179.pdf).\n",
978978
"- [3] Patil, A., D. Huard and C.J. Fonnesbeck. 2010. \n",
979979
"PyMC: Bayesian Stochastic Modelling in Python. Journal of Statistical \n",
@@ -1002,6 +1002,22 @@
10021002
" font-family: \"Computer Modern\";\n",
10031003
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunss.otf');\n",
10041004
" }\n",
1005+
" @font-face {\n",
1006+
" font-family: \"Computer Modern\";\n",
1007+
" font-weight: bold;\n",
1008+
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsx.otf');\n",
1009+
" }\n",
1010+
" @font-face {\n",
1011+
" font-family: \"Computer Modern\";\n",
1012+
" font-style: oblique;\n",
1013+
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsi.otf');\n",
1014+
" }\n",
1015+
" @font-face {\n",
1016+
" font-family: \"Computer Modern\";\n",
1017+
" font-weight: bold;\n",
1018+
" font-style: oblique;\n",
1019+
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunso.otf');\n",
1020+
" }\n",
10051021
" div.cell{\n",
10061022
" width:800px;\n",
10071023
" margin-left:16% !important;\n",
@@ -1041,13 +1057,28 @@
10411057
" .warning{\n",
10421058
" color: rgb( 240, 20, 20 )\n",
10431059
" } \n",
1044-
"</style>\n"
1060+
"</style>\n",
1061+
"<script>\n",
1062+
" MathJax.Hub.Config({\n",
1063+
" TeX: {\n",
1064+
" extensions: [\"AMSmath.js\"]\n",
1065+
" },\n",
1066+
" tex2jax: {\n",
1067+
" inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
1068+
" displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
1069+
" },\n",
1070+
" displayAlign: 'center', // Change this to 'center' to center equations.\n",
1071+
" \"HTML-CSS\": {\n",
1072+
" styles: {'.MathJax_Display': {\"margin\": 4}}\n",
1073+
" }\n",
1074+
" });\n",
1075+
"</script>\n"
10451076
],
10461077
"metadata": {},
10471078
"output_type": "pyout",
10481079
"prompt_number": 1,
10491080
"text": [
1050-
"<IPython.core.display.HTML at 0x10f034850>"
1081+
"<IPython.core.display.HTML at 0x103dff550>"
10511082
]
10521083
}
10531084
],

Chapter2_MorePyMC/MorePyMC.ipynb

Lines changed: 15 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,75 +2516,21 @@
25162516
" font-family: \"Computer Modern\";\n",
25172517
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunss.otf');\n",
25182518
" }\n",
2519-
" div.cell{\n",
2520-
" width:800px;\n",
2521-
" margin-left:16% !important;\n",
2522-
" margin-right:auto;\n",
2523-
" }\n",
2524-
" h1 {\n",
2525-
" font-family: Helvetica, serif;\n",
2526-
" }\n",
2527-
" h4{\n",
2528-
" margin-top:12px;\n",
2529-
" margin-bottom: 3px;\n",
2530-
" }\n",
2531-
" div.text_cell_render{\n",
2532-
" font-family: Computer Modern, \"Helvetica Neue\", Arial, Helvetica, Geneva, sans-serif;\n",
2533-
" line-height: 145%;\n",
2534-
" font-size: 130%;\n",
2535-
" width:800px;\n",
2536-
" margin-left:auto;\n",
2537-
" margin-right:auto;\n",
2538-
" }\n",
2539-
" .CodeMirror{\n",
2540-
" font-family: \"Source Code Pro\", source-code-pro,Consolas, monospace;\n",
2541-
" }\n",
2542-
" .prompt{\n",
2543-
" display: None;\n",
2519+
" @font-face {\n",
2520+
" font-family: \"Computer Modern\";\n",
2521+
" font-weight: bold;\n",
2522+
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsx.otf');\n",
25442523
" }\n",
2545-
" .text_cell_render h5 {\n",
2546-
" font-weight: 300;\n",
2547-
" font-size: 22pt;\n",
2548-
" color: #4057A1;\n",
2549-
" font-style: italic;\n",
2550-
" margin-bottom: .5em;\n",
2551-
" margin-top: 0.5em;\n",
2552-
" display: block;\n",
2524+
" @font-face {\n",
2525+
" font-family: \"Computer Modern\";\n",
2526+
" font-style: oblique;\n",
2527+
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsi.otf');\n",
25532528
" }\n",
2554-
" \n",
2555-
" .warning{\n",
2556-
" color: rgb( 240, 20, 20 )\n",
2557-
" } \n",
2558-
"</style>\n",
2559-
"<script>\n",
2560-
" MathJax.Hub.Config({\n",
2561-
" TeX: {\n",
2562-
" extensions: [\"AMSmath.js\"]\n",
2563-
" },\n",
2564-
" tex2jax: {\n",
2565-
" inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
2566-
" displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
2567-
" },\n",
2568-
" displayAlign: 'center', // Change this to 'center' to center equations.\n",
2569-
" \"HTML-CSS\": {\n",
2570-
" styles: {'.MathJax_Display': {\"margin\": 4}}\n",
2571-
" }\n",
2572-
" });\n",
2573-
"</script>"
2574-
],
2575-
"metadata": {},
2576-
"output_type": "pyout",
2577-
"prompt_number": 105,
2578-
"text": [
2579-
"<IPython.core.display.HTML at 0x10f024850>"
2580-
]
2581-
},
2582-
{
2583-
"html": [
2584-
"<style>\n",
25852529
" @font-face {\n",
25862530
" font-family: \"Computer Modern\";\n",
2587-
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunss.otf');\n",
2531+
" font-weight: bold;\n",
2532+
" font-style: oblique;\n",
2533+
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunso.otf');\n",
25882534
" }\n",
25892535
" div.cell{\n",
25902536
" width:800px;\n",
@@ -2640,17 +2586,17 @@
26402586
" styles: {'.MathJax_Display': {\"margin\": 4}}\n",
26412587
" }\n",
26422588
" });\n",
2643-
"</script>"
2589+
"</script>\n"
26442590
],
26452591
"metadata": {},
26462592
"output_type": "pyout",
2647-
"prompt_number": 106,
2593+
"prompt_number": 1,
26482594
"text": [
2649-
"<IPython.core.display.HTML at 0x10f108e50>"
2595+
"<IPython.core.display.HTML at 0x10cc9f550>"
26502596
]
26512597
}
26522598
],
2653-
"prompt_number": 106
2599+
"prompt_number": 1
26542600
},
26552601
{
26562602
"cell_type": "code",

Chapter3_MCMC/IntroMCMC.ipynb

Lines changed: 87 additions & 53 deletions
Large diffs are not rendered by default.

Chapter4_TheGreatestTheoremNeverTold/LawOfLargeNumbers.ipynb

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,22 @@
11031103
" font-family: \"Computer Modern\";\n",
11041104
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunss.otf');\n",
11051105
" }\n",
1106+
" @font-face {\n",
1107+
" font-family: \"Computer Modern\";\n",
1108+
" font-weight: bold;\n",
1109+
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsx.otf');\n",
1110+
" }\n",
1111+
" @font-face {\n",
1112+
" font-family: \"Computer Modern\";\n",
1113+
" font-style: oblique;\n",
1114+
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsi.otf');\n",
1115+
" }\n",
1116+
" @font-face {\n",
1117+
" font-family: \"Computer Modern\";\n",
1118+
" font-weight: bold;\n",
1119+
" font-style: oblique;\n",
1120+
" src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunso.otf');\n",
1121+
" }\n",
11061122
" div.cell{\n",
11071123
" width:800px;\n",
11081124
" margin-left:16% !important;\n",
@@ -1157,16 +1173,17 @@
11571173
" styles: {'.MathJax_Display': {\"margin\": 4}}\n",
11581174
" }\n",
11591175
" });\n",
1160-
"</script>"
1176+
"</script>\n"
11611177
],
1178+
"metadata": {},
11621179
"output_type": "pyout",
1163-
"prompt_number": 32,
1180+
"prompt_number": 1,
11641181
"text": [
1165-
"<IPython.core.display.HTML at 0x1155d1210>"
1182+
"<IPython.core.display.HTML at 0x10d46b550>"
11661183
]
11671184
}
11681185
],
1169-
"prompt_number": 32
1186+
"prompt_number": 1
11701187
},
11711188
{
11721189
"cell_type": "markdown",

Chapter5_LossFunctions/LossFunctions.ipynb

Lines changed: 34 additions & 5 deletions
Large diffs are not rendered by default.

Chapter6_Priorities/Priors.ipynb

Lines changed: 54 additions & 25 deletions
Large diffs are not rendered by default.

ExamplesFromChapters/Chapter3/ClusteringWithGaussians.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import numpy as np
12
import pymc as pm
23

34

@@ -8,7 +9,7 @@
89

910
assignment = pm.Categorical("assignment", [p, 1-p], size = data.shape[0] )
1011

11-
taus = 1.0/mc.Uniform( "stds", 0, 100, size= 2)**2 #notice the size!
12+
taus = 1.0/pm.Uniform( "stds", 0, 100, size= 2)**2 #notice the size!
1213
centers = pm.Normal( "centers", [150, 150], [0.001, 0.001], size =2 )
1314

1415
"""

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ this book, though it comes with some dependencies.
9595
2. The second, preferred, option is to use the nbviewer.ipython.org site, which display IPython notebooks in the browser ([example](http://nbviewer.ipython.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Chapter1_Introduction/Chapter1_Introduction.ipynb)).
9696
The contents are updated synchronously as commits are made to the book. You can use the Contents section above to link to the chapters.
9797

98-
3. **PDF versions are available! Look in the PDF/ directory.** PDFs are the least-prefered method to read the book, as pdf's are static and non-interactive. If PDFs are desired, they can be created dynamically using Chrome's builtin print-to-pdf feature or using the [nbconvert](https://github.com/ipython/nbconvert) utility.
98+
3. PDFs are the least-prefered method to read the book, as pdf's are static and non-interactive. If PDFs are desired, they can be created dynamically using the [nbconvert](https://github.com/ipython/nbconvert) utility.
9999

100100

101101
Installation and configuration
@@ -109,7 +109,7 @@ If you would like to run the IPython notebooks locally, (option 1. above), you'l
109109
- For Linux/OSX users, you should not have a problem installing the above, [*except for Matplotlib on OSX*](http://www.penandpants.com/2012/02/24/install-python/).
110110
- For Windows users, check out [pre-compiled versions](http://www.lfd.uci.edu/~gohlke/pythonlibs/) if you have difficulty.
111111
- also recommended, for data-mining exercises, are [PRAW](https://github.com/praw-dev/praw) and [requests](https://github.com/kennethreitz/requests).
112-
- New to Python or IPython, and help with the namespaces? Check out (this answer)[http://stackoverflow.com/questions/12987624/confusion-between-numpy-scipy-matplotlib-and-pylab].
112+
- New to Python or IPython, and help with the namespaces? Check out [this answer](http://stackoverflow.com/questions/12987624/confusion-between-numpy-scipy-matplotlib-and-pylab).
113113

114114
- In the styles/ directory are a number of files that are customized for the notebook.
115115
These are not only designed for the book, but they offer many improvements over the

styles/custom.css

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
font-family: "Computer Modern";
44
src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunss.otf');
55
}
6+
@font-face {
7+
font-family: "Computer Modern";
8+
font-weight: bold;
9+
src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsx.otf');
10+
}
11+
@font-face {
12+
font-family: "Computer Modern";
13+
font-style: oblique;
14+
src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsi.otf');
15+
}
16+
@font-face {
17+
font-family: "Computer Modern";
18+
font-weight: bold;
19+
font-style: oblique;
20+
src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunso.otf');
21+
}
622
div.cell{
723
width:800px;
824
margin-left:16% !important;
@@ -57,4 +73,4 @@
5773
styles: {'.MathJax_Display': {"margin": 4}}
5874
}
5975
});
60-
</script>
76+
</script>

0 commit comments

Comments
 (0)