|
23 | 23 | }, |
24 | 24 | { |
25 | 25 | "cell_type": "code", |
26 | | - "execution_count": null, |
27 | 26 | "id": "initial_id", |
28 | 27 | "metadata": { |
29 | 28 | "collapsed": true |
30 | 29 | }, |
31 | | - "outputs": [], |
32 | 30 | "source": [ |
33 | 31 | "import matplotlib.pyplot as plt\n", |
34 | 32 | "import numpy as np\n", |
|
115 | 113 | "\n", |
116 | 114 | " if ax is None:\n", |
117 | 115 | " plt.show()" |
118 | | - ] |
| 116 | + ], |
| 117 | + "outputs": [], |
| 118 | + "execution_count": null |
119 | 119 | }, |
120 | 120 | { |
121 | 121 | "cell_type": "markdown", |
|
125 | 125 | }, |
126 | 126 | { |
127 | 127 | "cell_type": "code", |
128 | | - "execution_count": null, |
129 | 128 | "id": "4f09e50a3db06d9f", |
130 | 129 | "metadata": {}, |
131 | | - "outputs": [], |
132 | 130 | "source": [ |
133 | 131 | "plot_single(Prior(UNIFORM, (0, 1)))\n", |
134 | 132 | "plot_single(Prior(NORMAL, (0, 1)))\n", |
135 | 133 | "plot_single(Prior(LAPLACE, (0, 1)))\n", |
136 | 134 | "plot_single(Prior(LOG_NORMAL, (0, 1)))\n", |
137 | 135 | "plot_single(Prior(LOG_LAPLACE, (1, 0.5)))" |
138 | | - ] |
| 136 | + ], |
| 137 | + "outputs": [], |
| 138 | + "execution_count": null |
139 | 139 | }, |
140 | 140 | { |
141 | 141 | "cell_type": "markdown", |
|
145 | 145 | }, |
146 | 146 | { |
147 | 147 | "cell_type": "code", |
148 | | - "execution_count": null, |
149 | 148 | "id": "f6192c226f179ef9", |
150 | 149 | "metadata": {}, |
151 | | - "outputs": [], |
152 | 150 | "source": [ |
153 | 151 | "plot(Prior(NORMAL, (10, 2), transformation=LIN))\n", |
154 | 152 | "plot(Prior(NORMAL, (10, 2), transformation=LOG))\n", |
155 | 153 | "\n", |
156 | 154 | "# Note that the log-normal distribution is different\n", |
157 | 155 | "# from a log-transformed normal distribution:\n", |
158 | 156 | "plot(Prior(LOG_NORMAL, (10, 2), transformation=LIN))" |
159 | | - ] |
| 157 | + ], |
| 158 | + "outputs": [], |
| 159 | + "execution_count": null |
160 | 160 | }, |
161 | 161 | { |
162 | 162 | "cell_type": "markdown", |
|
166 | 166 | }, |
167 | 167 | { |
168 | 168 | "cell_type": "code", |
169 | | - "execution_count": null, |
170 | 169 | "id": "34c95268e8921070", |
171 | 170 | "metadata": {}, |
172 | | - "outputs": [], |
173 | 171 | "source": [ |
174 | 172 | "plot(Prior(LOG_NORMAL, (10, 2), transformation=LOG))\n", |
175 | 173 | "plot(Prior(PARAMETER_SCALE_NORMAL, (10, 2)))" |
176 | | - ] |
| 174 | + ], |
| 175 | + "outputs": [], |
| 176 | + "execution_count": null |
177 | 177 | }, |
178 | 178 | { |
179 | 179 | "cell_type": "markdown", |
|
183 | 183 | }, |
184 | 184 | { |
185 | 185 | "cell_type": "code", |
186 | | - "execution_count": null, |
187 | 186 | "id": "5ca940bc24312fc6", |
188 | 187 | "metadata": {}, |
189 | | - "outputs": [], |
190 | 188 | "source": [ |
191 | 189 | "# different, because transformation!=LIN\n", |
192 | 190 | "plot(Prior(UNIFORM, (0.01, 2), transformation=LOG10))\n", |
|
195 | 193 | "# same, because transformation=LIN\n", |
196 | 194 | "plot(Prior(UNIFORM, (0.01, 2), transformation=LIN))\n", |
197 | 195 | "plot(Prior(PARAMETER_SCALE_UNIFORM, (0.01, 2), transformation=LIN))" |
198 | | - ] |
| 196 | + ], |
| 197 | + "outputs": [], |
| 198 | + "execution_count": null |
199 | 199 | }, |
200 | 200 | { |
201 | 201 | "cell_type": "markdown", |
|
205 | 205 | }, |
206 | 206 | { |
207 | 207 | "cell_type": "code", |
208 | | - "execution_count": null, |
209 | 208 | "id": "4ac42b1eed759bdd", |
210 | 209 | "metadata": {}, |
211 | | - "outputs": [], |
212 | 210 | "source": [ |
213 | 211 | "plot(Prior(NORMAL, (0, 1), bounds=(-2, 2)))\n", |
214 | 212 | "plot(Prior(UNIFORM, (0, 1), bounds=(0.1, 0.9)))\n", |
|
222 | 220 | " transformation=LOG10,\n", |
223 | 221 | " )\n", |
224 | 222 | ")" |
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" |
226 | 232 | }, |
227 | 233 | { |
228 | 234 | "cell_type": "markdown", |
|
232 | 238 | }, |
233 | 239 | { |
234 | 240 | "cell_type": "code", |
235 | | - "execution_count": null, |
236 | 241 | "id": "581e1ac431860419", |
237 | 242 | "metadata": {}, |
238 | | - "outputs": [], |
239 | 243 | "source": [ |
240 | 244 | "plot(Prior(NORMAL, (10, 1), bounds=(6, 11), transformation=\"log10\"))\n", |
241 | 245 | "plot(\n", |
|
249 | 253 | "plot(Prior(LAPLACE, (10, 2), bounds=(6, 14)))\n", |
250 | 254 | "plot(Prior(LOG_LAPLACE, (1, 0.5), bounds=(0.5, 8)))\n", |
251 | 255 | "plot(Prior(LOG_NORMAL, (2, 1), bounds=(0.5, 8)))" |
252 | | - ] |
| 256 | + ], |
| 257 | + "outputs": [], |
| 258 | + "execution_count": null |
253 | 259 | } |
254 | 260 | ], |
255 | 261 | "metadata": { |
|
0 commit comments