Skip to content

Commit e3d2eba

Browse files
committed
review
1 parent 4387443 commit e3d2eba

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

doc/example/distributions.ipynb

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@
2323
},
2424
{
2525
"cell_type": "code",
26-
"execution_count": null,
2726
"id": "initial_id",
2827
"metadata": {
2928
"collapsed": true
3029
},
31-
"outputs": [],
3230
"source": [
3331
"import matplotlib.pyplot as plt\n",
3432
"import numpy as np\n",
@@ -115,7 +113,9 @@
115113
"\n",
116114
" if ax is None:\n",
117115
" plt.show()"
118-
]
116+
],
117+
"outputs": [],
118+
"execution_count": null
119119
},
120120
{
121121
"cell_type": "markdown",
@@ -125,17 +125,17 @@
125125
},
126126
{
127127
"cell_type": "code",
128-
"execution_count": null,
129128
"id": "4f09e50a3db06d9f",
130129
"metadata": {},
131-
"outputs": [],
132130
"source": [
133131
"plot_single(Prior(UNIFORM, (0, 1)))\n",
134132
"plot_single(Prior(NORMAL, (0, 1)))\n",
135133
"plot_single(Prior(LAPLACE, (0, 1)))\n",
136134
"plot_single(Prior(LOG_NORMAL, (0, 1)))\n",
137135
"plot_single(Prior(LOG_LAPLACE, (1, 0.5)))"
138-
]
136+
],
137+
"outputs": [],
138+
"execution_count": null
139139
},
140140
{
141141
"cell_type": "markdown",
@@ -145,18 +145,18 @@
145145
},
146146
{
147147
"cell_type": "code",
148-
"execution_count": null,
149148
"id": "f6192c226f179ef9",
150149
"metadata": {},
151-
"outputs": [],
152150
"source": [
153151
"plot(Prior(NORMAL, (10, 2), transformation=LIN))\n",
154152
"plot(Prior(NORMAL, (10, 2), transformation=LOG))\n",
155153
"\n",
156154
"# Note that the log-normal distribution is different\n",
157155
"# from a log-transformed normal distribution:\n",
158156
"plot(Prior(LOG_NORMAL, (10, 2), transformation=LIN))"
159-
]
157+
],
158+
"outputs": [],
159+
"execution_count": null
160160
},
161161
{
162162
"cell_type": "markdown",
@@ -166,14 +166,14 @@
166166
},
167167
{
168168
"cell_type": "code",
169-
"execution_count": null,
170169
"id": "34c95268e8921070",
171170
"metadata": {},
172-
"outputs": [],
173171
"source": [
174172
"plot(Prior(LOG_NORMAL, (10, 2), transformation=LOG))\n",
175173
"plot(Prior(PARAMETER_SCALE_NORMAL, (10, 2)))"
176-
]
174+
],
175+
"outputs": [],
176+
"execution_count": null
177177
},
178178
{
179179
"cell_type": "markdown",
@@ -183,10 +183,8 @@
183183
},
184184
{
185185
"cell_type": "code",
186-
"execution_count": null,
187186
"id": "5ca940bc24312fc6",
188187
"metadata": {},
189-
"outputs": [],
190188
"source": [
191189
"# different, because transformation!=LIN\n",
192190
"plot(Prior(UNIFORM, (0.01, 2), transformation=LOG10))\n",
@@ -195,7 +193,9 @@
195193
"# same, because transformation=LIN\n",
196194
"plot(Prior(UNIFORM, (0.01, 2), transformation=LIN))\n",
197195
"plot(Prior(PARAMETER_SCALE_UNIFORM, (0.01, 2), transformation=LIN))"
198-
]
196+
],
197+
"outputs": [],
198+
"execution_count": null
199199
},
200200
{
201201
"cell_type": "markdown",
@@ -205,10 +205,8 @@
205205
},
206206
{
207207
"cell_type": "code",
208-
"execution_count": null,
209208
"id": "4ac42b1eed759bdd",
210209
"metadata": {},
211-
"outputs": [],
212210
"source": [
213211
"plot(Prior(NORMAL, (0, 1), bounds=(-2, 2)))\n",
214212
"plot(Prior(UNIFORM, (0, 1), bounds=(0.1, 0.9)))\n",
@@ -222,7 +220,15 @@
222220
" transformation=LOG10,\n",
223221
" )\n",
224222
")"
225-
]
223+
],
224+
"outputs": [],
225+
"execution_count": null
226+
},
227+
{
228+
"metadata": {},
229+
"cell_type": "markdown",
230+
"source": "This results in a constant shift in the probability density, compared to the non-truncated version (https://en.wikipedia.org/wiki/Truncated_distribution), such that the probability density still sums to 1.",
231+
"id": "67de0cace55617a2"
226232
},
227233
{
228234
"cell_type": "markdown",
@@ -232,10 +238,8 @@
232238
},
233239
{
234240
"cell_type": "code",
235-
"execution_count": null,
236241
"id": "581e1ac431860419",
237242
"metadata": {},
238-
"outputs": [],
239243
"source": [
240244
"plot(Prior(NORMAL, (10, 1), bounds=(6, 11), transformation=\"log10\"))\n",
241245
"plot(\n",
@@ -249,7 +253,9 @@
249253
"plot(Prior(LAPLACE, (10, 2), bounds=(6, 14)))\n",
250254
"plot(Prior(LOG_LAPLACE, (1, 0.5), bounds=(0.5, 8)))\n",
251255
"plot(Prior(LOG_NORMAL, (2, 1), bounds=(0.5, 8)))"
252-
]
256+
],
257+
"outputs": [],
258+
"execution_count": null
253259
}
254260
],
255261
"metadata": {

0 commit comments

Comments
 (0)