|
18 | 18 | "%config InlineBackend.figure_format = 'retina'" |
19 | 19 | ] |
20 | 20 | }, |
| 21 | + { |
| 22 | + "cell_type": "markdown", |
| 23 | + "metadata": {}, |
| 24 | + "source": [ |
| 25 | + "In this notebook, I would like to write an estimation model for beak shape. " |
| 26 | + ] |
| 27 | + }, |
21 | 28 | { |
22 | 29 | "cell_type": "code", |
23 | 30 | "execution_count": null, |
|
52 | 59 | "scandens_idx = df[df['species'] == 'scandens'].index" |
53 | 60 | ] |
54 | 61 | }, |
| 62 | + { |
| 63 | + "cell_type": "markdown", |
| 64 | + "metadata": {}, |
| 65 | + "source": [ |
| 66 | + "# Model : Naive Division of Posteriors\n", |
| 67 | + "\n", |
| 68 | + "- Estimate posterior for depth and length independently.\n", |
| 69 | + "- Use posterior samples to estimate distribution for shape." |
| 70 | + ] |
| 71 | + }, |
55 | 72 | { |
56 | 73 | "cell_type": "code", |
57 | 74 | "execution_count": null, |
|
186 | 203 | "plt.tight_layout()" |
187 | 204 | ] |
188 | 205 | }, |
189 | | - { |
190 | | - "cell_type": "code", |
191 | | - "execution_count": null, |
192 | | - "metadata": {}, |
193 | | - "outputs": [], |
194 | | - "source": [ |
195 | | - "plt.hist(samples['beak_depth'].flatten())\n", |
196 | | - "plt.hist(samples['beak_length'].flatten())" |
197 | | - ] |
198 | | - }, |
199 | 206 | { |
200 | 207 | "cell_type": "code", |
201 | 208 | "execution_count": null, |
|
210 | 217 | "ax.plot(x, y)" |
211 | 218 | ] |
212 | 219 | }, |
| 220 | + { |
| 221 | + "cell_type": "markdown", |
| 222 | + "metadata": {}, |
| 223 | + "source": [ |
| 224 | + "Ok, looks like this is not the right model. Dividing PPC samples is definitely not the right approach here.\n", |
| 225 | + "\n", |
| 226 | + "Maybe jointly modelling the observed beak and length distributions is the right thing to do?" |
| 227 | + ] |
| 228 | + }, |
213 | 229 | { |
214 | 230 | "cell_type": "code", |
215 | 231 | "execution_count": null, |
|
237 | 253 | "cell_type": "markdown", |
238 | 254 | "metadata": {}, |
239 | 255 | "source": [ |
| 256 | + "# Model: Joint Distribution\n", |
| 257 | + "\n", |
240 | 258 | "Going to try a new model: we explicity model depth and length jointly, as a multivariate gaussian." |
241 | 259 | ] |
242 | 260 | }, |
|
357 | 375 | "cell_type": "markdown", |
358 | 376 | "metadata": {}, |
359 | 377 | "source": [ |
| 378 | + "# Model: Regress Depth on Length\n", |
| 379 | + "\n", |
360 | 380 | "Maybe the right way to compute shape is to regress depth on length, and compute the slope. After all, that's all that depth/length really is.\n", |
361 | 381 | "\n", |
362 | 382 | "We will assume a model: $y=mx$, no intercept." |
|
409 | 429 | "source": [ |
410 | 430 | "I have the model mis-specified - I get the posterior distribution over the slope, but not the distribution of shapes. I guess shapes and slopes are kind of different. \n", |
411 | 431 | "\n", |
412 | | - "Let's try just estimating shape directly." |
| 432 | + "Let's try just estimating shape directly.\n", |
| 433 | + "\n", |
| 434 | + "# Model: Estimate on Shape Parameter" |
413 | 435 | ] |
414 | 436 | }, |
415 | 437 | { |
|
0 commit comments