j1-template 2022.3.0 → 2022.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/modules/navigator/generator.html +1 -1
  3. data/assets/data/cookieconsent.html +4 -4
  4. data/assets/data/nbinteract.html +128 -0
  5. data/assets/data/quicklinks.html +15 -0
  6. data/assets/data/translator.html +15 -15
  7. data/assets/themes/j1/adapter/js/cookieConsent.js +1 -1
  8. data/assets/themes/j1/adapter/js/mmenu.js +25 -3
  9. data/assets/themes/j1/adapter/js/navigator.js +2 -2
  10. data/assets/themes/j1/adapter/js/nbinteract.js +412 -113
  11. data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +27 -54
  12. data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
  13. data/assets/themes/j1/core/js/template.js +14 -3
  14. data/assets/themes/j1/core/js/template.min.js +1 -1
  15. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  16. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +1 -0
  17. data/assets/themes/j1/modules/nbInteract/js/nbinteract/nbinteract-core.js +1 -1
  18. data/assets/themes/j1/modules/nbInteract/js/nbinteract/nbinteract-core.js.map +1 -1
  19. data/assets/themes/j1/modules/nbInteract/js/nbinteract/nbinteract-core.min.js +1 -1
  20. data/lib/j1/version.rb +1 -1
  21. data/lib/starter_web/Gemfile +1 -1
  22. data/lib/starter_web/_config.yml +1 -1
  23. data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +55 -42
  24. data/lib/starter_web/_data/modules/defaults/navigator.yml +4 -0
  25. data/lib/starter_web/_data/modules/defaults/nbinteract.yml +99 -1
  26. data/lib/starter_web/_data/modules/defaults/translator.yml +24 -12
  27. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  28. data/lib/starter_web/package.json +1 -1
  29. data/lib/starter_web/pages/public/jupyter/docs/j1-nbinteract-doc.adoc +20 -6
  30. data/lib/starter_web/pages/public/jupyter/docs/nbi-widget-manual.adoc +6 -6
  31. data/lib/starter_web/pages/public/jupyter/docs/nbinteract-doc.adoc +24 -19
  32. data/lib/starter_web/pages/public/jupyter/examples/j1-circular-times-table.adoc +14 -16
  33. data/lib/starter_web/pages/public/jupyter/examples/j1-interactive-widgets.adoc +8 -5
  34. data/lib/starter_web/pages/public/jupyter/examples/j1-odes-in-python.adoc +11 -8
  35. data/lib/starter_web/pages/public/jupyter/examples/j1-testing-plotly.adoc +12 -4
  36. data/lib/starter_web/pages/public/jupyter/examples/j1_climate-change-forecast.adoc +8 -8
  37. data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_circular_times_table-checkpoint.ipynb +12387 -0
  38. data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_interactive_widgets-checkpoint.ipynb +26 -26
  39. data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_odes_in_python-checkpoint.ipynb +10 -10
  40. data/lib/starter_web/pages/public/jupyter/notebooks/j1/factor_by_factor.mp4 +0 -0
  41. data/lib/starter_web/pages/public/jupyter/notebooks/j1/j1_circular_times_table.ipynb +10 -13
  42. data/lib/starter_web/pages/public/jupyter/notebooks/j1/j1_interactive_widgets.ipynb +26 -26
  43. data/lib/starter_web/pages/public/jupyter/notebooks/j1/j1_odes_in_python.ipynb +15 -15
  44. data/lib/starter_web/pages/public/jupyter/notebooks/j1/line_by_line.mp4 +0 -0
  45. data/lib/starter_web/pages/public/jupyter/notebooks/j1/point_by_point.mp4 +0 -0
  46. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_examples_central_limit_theorem-checkpoint.ipynb +247 -0
  47. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_recipes_graphing-checkpoint.ipynb +18 -18
  48. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/nbi_docs_examples_central_limit_theorem.ipynb +1 -2
  49. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/nbi_docs_recipes_graphing.ipynb +18 -18
  50. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_circular_times_table.html +6 -9
  51. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_interactive_widgets.html +919 -919
  52. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_odes_in_python.html +10 -10
  53. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_graphing.html +473 -473
  54. data/lib/starter_web/pages/public/jupyter/services/jupyterhub.adoc +6 -7
  55. data/lib/starter_web/pages/public/se/se-fake.adoc +47 -0
  56. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  57. data/lib/starter_web/utilsrv/package.json +1 -1
  58. metadata +9 -2
@@ -104,7 +104,7 @@
104
104
  "cell_type": "markdown",
105
105
  "metadata": {},
106
106
  "source": [
107
- "### Equation"
107
+ "### Equation (Home Economy)"
108
108
  ]
109
109
  },
110
110
  {
@@ -184,7 +184,7 @@
184
184
  "cell_type": "markdown",
185
185
  "metadata": {},
186
186
  "source": [
187
- "### Evaluation\n",
187
+ "### Evaluation (Home Economy)\n",
188
188
  "\n",
189
189
  "Finally, the code for the interaction, here the *interact* function from *ipywidgets* is used. A separate slider is used for each parameter with the default parameters set for a nice default visualization, with a description and the style and layout is used from the initialization cells.\n"
190
190
  ]
@@ -197,7 +197,7 @@
197
197
  {
198
198
  "data": {
199
199
  "application/vnd.jupyter.widget-view+json": {
200
- "model_id": "398bded40362405f887c34e1e5a286c2",
200
+ "model_id": "3f7dc7b99bb74da48e10f83a8b66006d",
201
201
  "version_major": 2,
202
202
  "version_minor": 0
203
203
  },
@@ -268,7 +268,7 @@
268
268
  "cell_type": "markdown",
269
269
  "metadata": {},
270
270
  "source": [
271
- "### Equation"
271
+ "### Equation (Homes and ACs)"
272
272
  ]
273
273
  },
274
274
  {
@@ -343,7 +343,7 @@
343
343
  "cell_type": "markdown",
344
344
  "metadata": {},
345
345
  "source": [
346
- "### Evaluation"
346
+ "### Evaluation (Homes and ACs)"
347
347
  ]
348
348
  },
349
349
  {
@@ -354,7 +354,7 @@
354
354
  {
355
355
  "data": {
356
356
  "application/vnd.jupyter.widget-view+json": {
357
- "model_id": "7b2efc55994c46df96bc20ef70695541",
357
+ "model_id": "b102506a870b44f18d178438d5bf0288",
358
358
  "version_major": 2,
359
359
  "version_minor": 0
360
360
  },
@@ -432,7 +432,7 @@
432
432
  "cell_type": "markdown",
433
433
  "metadata": {},
434
434
  "source": [
435
- "### Equation"
435
+ "### Equation (Stock Control)"
436
436
  ]
437
437
  },
438
438
  {
@@ -502,7 +502,7 @@
502
502
  "cell_type": "markdown",
503
503
  "metadata": {},
504
504
  "source": [
505
- "### Evaluation"
505
+ "### Evaluation (Stock Control)"
506
506
  ]
507
507
  },
508
508
  {
@@ -513,7 +513,7 @@
513
513
  {
514
514
  "data": {
515
515
  "application/vnd.jupyter.widget-view+json": {
516
- "model_id": "10e1c36ac5624de29d44457eb99567a0",
516
+ "model_id": "de7523f0853448639b480c9a17b5d870",
517
517
  "version_major": 2,
518
518
  "version_minor": 0
519
519
  },
@@ -585,7 +585,7 @@
585
585
  "cell_type": "markdown",
586
586
  "metadata": {},
587
587
  "source": [
588
- "### Equation"
588
+ "### Equation (Useful life)"
589
589
  ]
590
590
  },
591
591
  {
@@ -686,7 +686,7 @@
686
686
  "cell_type": "markdown",
687
687
  "metadata": {},
688
688
  "source": [
689
- "### Evaluation"
689
+ "### Evaluation (Useful life)"
690
690
  ]
691
691
  },
692
692
  {
@@ -699,7 +699,7 @@
699
699
  {
700
700
  "data": {
701
701
  "application/vnd.jupyter.widget-view+json": {
702
- "model_id": "b99aec4c67464c42a75af50162cb6433",
702
+ "model_id": "fe6b79b4a4fc488c83080fd2f6785ad8",
703
703
  "version_major": 2,
704
704
  "version_minor": 0
705
705
  },
@@ -790,7 +790,7 @@
790
790
  "cell_type": "markdown",
791
791
  "metadata": {},
792
792
  "source": [
793
- "### Equation"
793
+ "### Equation (Foxes and Rabbits)"
794
794
  ]
795
795
  },
796
796
  {
@@ -870,7 +870,7 @@
870
870
  "cell_type": "markdown",
871
871
  "metadata": {},
872
872
  "source": [
873
- "### Evaluation"
873
+ "### Evaluation (Foxes and Rabbits)"
874
874
  ]
875
875
  },
876
876
  {
@@ -883,7 +883,7 @@
883
883
  {
884
884
  "data": {
885
885
  "application/vnd.jupyter.widget-view+json": {
886
- "model_id": "8432a49d585548b1841907d05dda3222",
886
+ "model_id": "40479c2ee12141a295fe6561410b3591",
887
887
  "version_major": 2,
888
888
  "version_minor": 0
889
889
  },
@@ -0,0 +1,247 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "# HIDDEN\n",
10
+ "from datascience import *\n",
11
+ "%matplotlib inline\n",
12
+ "import matplotlib.pyplot as plots\n",
13
+ "plots.style.use('fivethirtyeight')\n",
14
+ "import math\n",
15
+ "import numpy as np\n",
16
+ "from scipy import stats\n",
17
+ "import ipywidgets as widgets\n",
18
+ "import nbinteract as nbi"
19
+ ]
20
+ },
21
+ {
22
+ "cell_type": "markdown",
23
+ "metadata": {},
24
+ "source": [
25
+ "### The Central Limit Theorem\n",
26
+ "Very few of the data histograms that we have seen in this course have been bell shaped.\n",
27
+ "When we have come across a bell shaped distribution, it has almost invariably been an\n",
28
+ "empirical histogram of a statistic based on a random sample.\n"
29
+ ]
30
+ },
31
+ {
32
+ "cell_type": "markdown",
33
+ "metadata": {},
34
+ "source": [
35
+ "**The Central Limit Theorem says that the probability distribution of the sum or average of a large random sample drawn with replacement will be roughly normal, *regardless of the distribution of the population from which the sample is drawn*.**\n",
36
+ "\n",
37
+ "As we noted when we were studying Chebychev's bounds, results that can be applied to random samples *regardless of the distribution of the population* are very powerful, because in data science we rarely know the distribution of the population.\n",
38
+ "\n",
39
+ "The Central Limit Theorem makes it possible to make inferences with very little knowledge about the population, provided we have a large random sample. That is why it is central to the field of statistical inference."
40
+ ]
41
+ },
42
+ {
43
+ "cell_type": "markdown",
44
+ "metadata": {},
45
+ "source": [
46
+ "#### Proportion of Purple Flowers\n",
47
+ "\n",
48
+ "Recall Mendel's probability model for the colors of the flowers of a species of pea plant. The model says that the flower colors of the plants are like draws made at random with replacement from {Purple, Purple, Purple, White}.\n",
49
+ "\n",
50
+ "In a large sample of plants, about what proportion will have purple flowers? We would expect the answer to be about 0.75, the proportion purple in the model. And, because proportions are means, the Central Limit Theorem says that the distribution of the sample proportion of purple plants is roughly normal.\n",
51
+ "\n",
52
+ "We can confirm this by simulation. Let's simulate the proportion of purple-flowered plants in a sample of 200 plants."
53
+ ]
54
+ },
55
+ {
56
+ "cell_type": "code",
57
+ "execution_count": 2,
58
+ "metadata": {},
59
+ "outputs": [
60
+ {
61
+ "data": {
62
+ "text/html": [
63
+ "<table border=\"1\" class=\"dataframe\">\n",
64
+ " <thead>\n",
65
+ " <tr>\n",
66
+ " <th>Color</th>\n",
67
+ " </tr>\n",
68
+ " </thead>\n",
69
+ " <tbody>\n",
70
+ " <tr>\n",
71
+ " <td>Purple</td>\n",
72
+ " </tr>\n",
73
+ " <tr>\n",
74
+ " <td>Purple</td>\n",
75
+ " </tr>\n",
76
+ " <tr>\n",
77
+ " <td>Purple</td>\n",
78
+ " </tr>\n",
79
+ " <tr>\n",
80
+ " <td>White </td>\n",
81
+ " </tr>\n",
82
+ " </tbody>\n",
83
+ "</table>"
84
+ ],
85
+ "text/plain": [
86
+ "Color\n",
87
+ "Purple\n",
88
+ "Purple\n",
89
+ "Purple\n",
90
+ "White"
91
+ ]
92
+ },
93
+ "execution_count": 2,
94
+ "metadata": {},
95
+ "output_type": "execute_result"
96
+ }
97
+ ],
98
+ "source": [
99
+ "colors = make_array('Purple', 'Purple', 'Purple', 'White')\n",
100
+ "\n",
101
+ "model = Table().with_column('Color', colors)\n",
102
+ "\n",
103
+ "model"
104
+ ]
105
+ },
106
+ {
107
+ "cell_type": "code",
108
+ "execution_count": 3,
109
+ "metadata": {},
110
+ "outputs": [
111
+ {
112
+ "data": {
113
+ "text/plain": [
114
+ "array([0.765, 0.695, 0.69 , 0.76 , 0.78 ])"
115
+ ]
116
+ },
117
+ "execution_count": 3,
118
+ "metadata": {},
119
+ "output_type": "execute_result"
120
+ }
121
+ ],
122
+ "source": [
123
+ "props = make_array()\n",
124
+ "\n",
125
+ "num_plants = 200\n",
126
+ "repetitions = 1000\n",
127
+ "\n",
128
+ "for i in np.arange(repetitions):\n",
129
+ " sample = model.sample(num_plants)\n",
130
+ " new_prop = np.count_nonzero(sample.column('Color') == 'Purple')/num_plants\n",
131
+ " props = np.append(props, new_prop)\n",
132
+ "props[:5]"
133
+ ]
134
+ },
135
+ {
136
+ "cell_type": "code",
137
+ "execution_count": 4,
138
+ "metadata": {},
139
+ "outputs": [
140
+ {
141
+ "data": {
142
+ "application/vnd.jupyter.widget-view+json": {
143
+ "model_id": "67c0c138c5c846efba2c9e32338801d0",
144
+ "version_major": 2,
145
+ "version_minor": 0
146
+ },
147
+ "text/plain": [
148
+ "VBox(children=(interactive(children=(Output(),), _dom_classes=('widget-interact',)), Figure(axes=[Axis(label='…"
149
+ ]
150
+ },
151
+ "metadata": {},
152
+ "output_type": "display_data"
153
+ }
154
+ ],
155
+ "source": [
156
+ "opts = {\n",
157
+ " 'title': 'Distribution of sample proportions',\n",
158
+ " 'xlabel': 'Sample Proportion',\n",
159
+ " 'ylabel': 'Percent per unit',\n",
160
+ " 'xlim': (0.64, 0.84),\n",
161
+ " 'ylim': (0, 25),\n",
162
+ " 'bins': 20,\n",
163
+ "}\n",
164
+ "nbi.hist(props, options=opts)"
165
+ ]
166
+ },
167
+ {
168
+ "cell_type": "markdown",
169
+ "metadata": {},
170
+ "source": [
171
+ "There's that normal curve again, as predicted by the Central Limit Theorem, centered at around 0.75 just as you would expect.\n",
172
+ "\n",
173
+ "How would this distribution change if we increased the sample size? We can copy our sampling code into a function and then use interaction to see how the distribution changes as the sample size increases.\n",
174
+ "\n",
175
+ "We will keep the number of `repetitions` the same as before so that the two columns have the same length."
176
+ ]
177
+ },
178
+ {
179
+ "cell_type": "code",
180
+ "execution_count": 5,
181
+ "metadata": {},
182
+ "outputs": [],
183
+ "source": [
184
+ "def empirical_props(num_plants):\n",
185
+ " props = make_array()\n",
186
+ " for i in np.arange(repetitions):\n",
187
+ " sample = model.sample(num_plants)\n",
188
+ " new_prop = np.count_nonzero(sample.column('Color') == 'Purple')/num_plants\n",
189
+ " props = np.append(props, new_prop)\n",
190
+ " return props"
191
+ ]
192
+ },
193
+ {
194
+ "cell_type": "code",
195
+ "execution_count": 6,
196
+ "metadata": {},
197
+ "outputs": [
198
+ {
199
+ "data": {
200
+ "application/vnd.jupyter.widget-view+json": {
201
+ "model_id": "539198ed74234f20ac5d449a617305f8",
202
+ "version_major": 2,
203
+ "version_minor": 0
204
+ },
205
+ "text/plain": [
206
+ "VBox(children=(interactive(children=(ToggleButtons(description='num_plants', options=(100, 200, 400, 800), val…"
207
+ ]
208
+ },
209
+ "metadata": {},
210
+ "output_type": "display_data"
211
+ }
212
+ ],
213
+ "source": [
214
+ "nbi.hist(empirical_props, options=opts,\n",
215
+ " num_plants=widgets.ToggleButtons(options=[100, 200, 400, 800]))"
216
+ ]
217
+ },
218
+ {
219
+ "cell_type": "markdown",
220
+ "metadata": {},
221
+ "source": [
222
+ "All of the above distributions are approximately normal but become more narrow as the sample size increases. For example, the proportions based on a sample size of 800 are more tightly clustered around 0.75 than those from a sample size of 200. Increasing the sample size has decreased the variability in the sample proportion."
223
+ ]
224
+ }
225
+ ],
226
+ "metadata": {
227
+ "kernelspec": {
228
+ "display_name": "Python 3",
229
+ "language": "python",
230
+ "name": "python3"
231
+ },
232
+ "language_info": {
233
+ "codemirror_mode": {
234
+ "name": "ipython",
235
+ "version": 3
236
+ },
237
+ "file_extension": ".py",
238
+ "mimetype": "text/x-python",
239
+ "name": "python",
240
+ "nbconvert_exporter": "python",
241
+ "pygments_lexer": "ipython3",
242
+ "version": "3.7.9"
243
+ }
244
+ },
245
+ "nbformat": 4,
246
+ "nbformat_minor": 1
247
+ }
@@ -74,7 +74,7 @@
74
74
  },
75
75
  {
76
76
  "cell_type": "code",
77
- "execution_count": 4,
77
+ "execution_count": 13,
78
78
  "metadata": {
79
79
  "scrolled": false
80
80
  },
@@ -82,7 +82,7 @@
82
82
  {
83
83
  "data": {
84
84
  "application/vnd.jupyter.widget-view+json": {
85
- "model_id": "749b9aab6e1947d8934f06b45825dbdb",
85
+ "model_id": "a5636ca1591943a39bbe131a1cf79eaa",
86
86
  "version_major": 2,
87
87
  "version_minor": 0
88
88
  },
@@ -95,7 +95,7 @@
95
95
  }
96
96
  ],
97
97
  "source": [
98
- "nbi.hist(hist_response_function, mean=(0, 10), sd=(0, 2.0, 0.2))"
98
+ "nbi.hist(hist_response_function, mean=(0, 10), sd=(0.2, 2.0, 0.2))"
99
99
  ]
100
100
  },
101
101
  {
@@ -107,13 +107,13 @@
107
107
  },
108
108
  {
109
109
  "cell_type": "code",
110
- "execution_count": 5,
110
+ "execution_count": 11,
111
111
  "metadata": {},
112
112
  "outputs": [
113
113
  {
114
114
  "data": {
115
115
  "application/vnd.jupyter.widget-view+json": {
116
- "model_id": "d937484a6c874c248224ae1a07be0222",
116
+ "model_id": "3b52fe08cd764b73bad8f2a92477d955",
117
117
  "version_major": 2,
118
118
  "version_minor": 0
119
119
  },
@@ -131,7 +131,7 @@
131
131
  " 'xlim': (0, 15),\n",
132
132
  " 'ylim': (0, 0.4),\n",
133
133
  "}\n",
134
- "nbi.hist(hist_response_function, options=options, mean=(0, 10), sd=(0, 2.0, 0.2))"
134
+ "nbi.hist(hist_response_function, options=options, mean=(0, 10), sd=(0.2, 2.0, 0.2))"
135
135
  ]
136
136
  },
137
137
  {
@@ -149,7 +149,7 @@
149
149
  {
150
150
  "data": {
151
151
  "application/vnd.jupyter.widget-view+json": {
152
- "model_id": "dd38adef9d944bc692ab821c5fd9ce8e",
152
+ "model_id": "f86ec97cd7ca493280a1815edd8f0ae9",
153
153
  "version_major": 2,
154
154
  "version_minor": 0
155
155
  },
@@ -185,18 +185,18 @@
185
185
  },
186
186
  {
187
187
  "cell_type": "code",
188
- "execution_count": 7,
188
+ "execution_count": 14,
189
189
  "metadata": {},
190
190
  "outputs": [
191
191
  {
192
192
  "data": {
193
193
  "application/vnd.jupyter.widget-view+json": {
194
- "model_id": "f0cd2c3db7754af293d9d5bd60f348fa",
194
+ "model_id": "00316ec6767f4b879a61bef75599f78e",
195
195
  "version_major": 2,
196
196
  "version_minor": 0
197
197
  },
198
198
  "text/plain": [
199
- "VBox(children=(interactive(children=(IntSlider(value=5, description='n', max=10), IntSlider(value=5, descripti…"
199
+ "VBox(children=(interactive(children=(IntSlider(value=6, description='n', max=10, min=3), IntSlider(value=5, de…"
200
200
  ]
201
201
  },
202
202
  "metadata": {},
@@ -214,7 +214,7 @@
214
214
  " 'ylim': (0, 20),\n",
215
215
  "}\n",
216
216
  "\n",
217
- "nbi.bar(categories, heights, n=(0, 10), offset=(1, 10), options=opts)"
217
+ "nbi.bar(categories, heights, n=(3, 10), offset=(1, 10), options=opts)"
218
218
  ]
219
219
  },
220
220
  {
@@ -245,12 +245,12 @@
245
245
  {
246
246
  "data": {
247
247
  "application/vnd.jupyter.widget-view+json": {
248
- "model_id": "ddff91ef6f6048a19b4b605feda4c5f1",
248
+ "model_id": "6b6494e0a17c4e2e8477509d44b1432e",
249
249
  "version_major": 2,
250
250
  "version_minor": 0
251
251
  },
252
252
  "text/plain": [
253
- "VBox(children=(Label(value='y = 0.99x + 0.54'), Figure(animation_duration=250, axes=[Axis(scale=LinearScale(ma…"
253
+ "VBox(children=(Label(value='y = 0.94x + 0.66'), Figure(animation_duration=250, axes=[Axis(scale=LinearScale(ma…"
254
254
  ]
255
255
  },
256
256
  "metadata": {},
@@ -285,7 +285,7 @@
285
285
  },
286
286
  {
287
287
  "cell_type": "code",
288
- "execution_count": 9,
288
+ "execution_count": 15,
289
289
  "metadata": {
290
290
  "scrolled": false
291
291
  },
@@ -293,12 +293,12 @@
293
293
  {
294
294
  "data": {
295
295
  "application/vnd.jupyter.widget-view+json": {
296
- "model_id": "c3d2e8896c424020b49d2e774d4c3b3e",
296
+ "model_id": "847b13ca28274786b3209932e3a74f77",
297
297
  "version_major": 2,
298
298
  "version_minor": 0
299
299
  },
300
300
  "text/plain": [
301
- "VBox(children=(interactive(children=(IntSlider(value=100, description='n', max=200), Output()), _dom_classes=(…"
301
+ "VBox(children=(interactive(children=(IntSlider(value=105, description='n', max=200, min=10), Output()), _dom_c…"
302
302
  ]
303
303
  },
304
304
  "metadata": {},
@@ -309,7 +309,7 @@
309
309
  "def x_values(n): return np.random.choice(100, n)\n",
310
310
  "def y_values(xs): return np.random.choice(100, len(xs))\n",
311
311
  "\n",
312
- "nbi.scatter(x_values, y_values, n=(0,200))"
312
+ "nbi.scatter(x_values, y_values, n=(10,200))"
313
313
  ]
314
314
  },
315
315
  {
@@ -336,7 +336,7 @@
336
336
  {
337
337
  "data": {
338
338
  "application/vnd.jupyter.widget-view+json": {
339
- "model_id": "17d1cc84daf9467f97e504d484e24485",
339
+ "model_id": "b23113b7d9f54ca0844bc5874ca92137",
340
340
  "version_major": 2,
341
341
  "version_minor": 0
342
342
  },
@@ -22,8 +22,7 @@
22
22
  "cell_type": "markdown",
23
23
  "metadata": {},
24
24
  "source": [
25
- "### The Central Limit Theorem",
26
- "\n",
25
+ "### The Central Limit Theorem\n",
27
26
  "Very few of the data histograms that we have seen in this course have been bell shaped.\n",
28
27
  "When we have come across a bell shaped distribution, it has almost invariably been an\n",
29
28
  "empirical histogram of a statistic based on a random sample.\n"
@@ -74,7 +74,7 @@
74
74
  },
75
75
  {
76
76
  "cell_type": "code",
77
- "execution_count": 4,
77
+ "execution_count": 13,
78
78
  "metadata": {
79
79
  "scrolled": false
80
80
  },
@@ -82,7 +82,7 @@
82
82
  {
83
83
  "data": {
84
84
  "application/vnd.jupyter.widget-view+json": {
85
- "model_id": "749b9aab6e1947d8934f06b45825dbdb",
85
+ "model_id": "a5636ca1591943a39bbe131a1cf79eaa",
86
86
  "version_major": 2,
87
87
  "version_minor": 0
88
88
  },
@@ -95,7 +95,7 @@
95
95
  }
96
96
  ],
97
97
  "source": [
98
- "nbi.hist(hist_response_function, mean=(0, 10), sd=(0, 2.0, 0.2))"
98
+ "nbi.hist(hist_response_function, mean=(0, 10), sd=(0.2, 2.0, 0.2))"
99
99
  ]
100
100
  },
101
101
  {
@@ -107,13 +107,13 @@
107
107
  },
108
108
  {
109
109
  "cell_type": "code",
110
- "execution_count": 5,
110
+ "execution_count": 11,
111
111
  "metadata": {},
112
112
  "outputs": [
113
113
  {
114
114
  "data": {
115
115
  "application/vnd.jupyter.widget-view+json": {
116
- "model_id": "d937484a6c874c248224ae1a07be0222",
116
+ "model_id": "3b52fe08cd764b73bad8f2a92477d955",
117
117
  "version_major": 2,
118
118
  "version_minor": 0
119
119
  },
@@ -131,7 +131,7 @@
131
131
  " 'xlim': (0, 15),\n",
132
132
  " 'ylim': (0, 0.4),\n",
133
133
  "}\n",
134
- "nbi.hist(hist_response_function, options=options, mean=(0, 10), sd=(0, 2.0, 0.2))"
134
+ "nbi.hist(hist_response_function, options=options, mean=(0, 10), sd=(0.2, 2.0, 0.2))"
135
135
  ]
136
136
  },
137
137
  {
@@ -149,7 +149,7 @@
149
149
  {
150
150
  "data": {
151
151
  "application/vnd.jupyter.widget-view+json": {
152
- "model_id": "dd38adef9d944bc692ab821c5fd9ce8e",
152
+ "model_id": "f86ec97cd7ca493280a1815edd8f0ae9",
153
153
  "version_major": 2,
154
154
  "version_minor": 0
155
155
  },
@@ -185,18 +185,18 @@
185
185
  },
186
186
  {
187
187
  "cell_type": "code",
188
- "execution_count": 7,
188
+ "execution_count": 14,
189
189
  "metadata": {},
190
190
  "outputs": [
191
191
  {
192
192
  "data": {
193
193
  "application/vnd.jupyter.widget-view+json": {
194
- "model_id": "f0cd2c3db7754af293d9d5bd60f348fa",
194
+ "model_id": "00316ec6767f4b879a61bef75599f78e",
195
195
  "version_major": 2,
196
196
  "version_minor": 0
197
197
  },
198
198
  "text/plain": [
199
- "VBox(children=(interactive(children=(IntSlider(value=5, description='n', max=10), IntSlider(value=5, descripti…"
199
+ "VBox(children=(interactive(children=(IntSlider(value=6, description='n', max=10, min=3), IntSlider(value=5, de…"
200
200
  ]
201
201
  },
202
202
  "metadata": {},
@@ -214,7 +214,7 @@
214
214
  " 'ylim': (0, 20),\n",
215
215
  "}\n",
216
216
  "\n",
217
- "nbi.bar(categories, heights, n=(0, 10), offset=(1, 10), options=opts)"
217
+ "nbi.bar(categories, heights, n=(3, 10), offset=(1, 10), options=opts)"
218
218
  ]
219
219
  },
220
220
  {
@@ -245,12 +245,12 @@
245
245
  {
246
246
  "data": {
247
247
  "application/vnd.jupyter.widget-view+json": {
248
- "model_id": "ddff91ef6f6048a19b4b605feda4c5f1",
248
+ "model_id": "6b6494e0a17c4e2e8477509d44b1432e",
249
249
  "version_major": 2,
250
250
  "version_minor": 0
251
251
  },
252
252
  "text/plain": [
253
- "VBox(children=(Label(value='y = 0.99x + 0.54'), Figure(animation_duration=250, axes=[Axis(scale=LinearScale(ma…"
253
+ "VBox(children=(Label(value='y = 0.94x + 0.66'), Figure(animation_duration=250, axes=[Axis(scale=LinearScale(ma…"
254
254
  ]
255
255
  },
256
256
  "metadata": {},
@@ -285,7 +285,7 @@
285
285
  },
286
286
  {
287
287
  "cell_type": "code",
288
- "execution_count": 9,
288
+ "execution_count": 15,
289
289
  "metadata": {
290
290
  "scrolled": false
291
291
  },
@@ -293,12 +293,12 @@
293
293
  {
294
294
  "data": {
295
295
  "application/vnd.jupyter.widget-view+json": {
296
- "model_id": "c3d2e8896c424020b49d2e774d4c3b3e",
296
+ "model_id": "847b13ca28274786b3209932e3a74f77",
297
297
  "version_major": 2,
298
298
  "version_minor": 0
299
299
  },
300
300
  "text/plain": [
301
- "VBox(children=(interactive(children=(IntSlider(value=100, description='n', max=200), Output()), _dom_classes=(…"
301
+ "VBox(children=(interactive(children=(IntSlider(value=105, description='n', max=200, min=10), Output()), _dom_c…"
302
302
  ]
303
303
  },
304
304
  "metadata": {},
@@ -309,7 +309,7 @@
309
309
  "def x_values(n): return np.random.choice(100, n)\n",
310
310
  "def y_values(xs): return np.random.choice(100, len(xs))\n",
311
311
  "\n",
312
- "nbi.scatter(x_values, y_values, n=(0,200))"
312
+ "nbi.scatter(x_values, y_values, n=(10,200))"
313
313
  ]
314
314
  },
315
315
  {
@@ -336,7 +336,7 @@
336
336
  {
337
337
  "data": {
338
338
  "application/vnd.jupyter.widget-view+json": {
339
- "model_id": "17d1cc84daf9467f97e504d484e24485",
339
+ "model_id": "b23113b7d9f54ca0844bc5874ca92137",
340
340
  "version_major": 2,
341
341
  "version_minor": 0
342
342
  },