|
338 | 338 | "source": [ |
339 | 339 | "fig, [ax1, ax2] = plt.subplots(nrows=1, ncols=2, sharex=True)\n", |
340 | 340 | "\n", |
341 | | - "x, y = ECDF(samples['drug']) # Want ECDF of drug-treatment PPC samples\n", |
| 341 | + "x, y = ECDF(samples['drug'].flatten()) # Want ECDF of drug-treatment PPC samples\n", |
342 | 342 | "ax1.plot(x, y, label='ppc')\n", |
343 | 343 | "x, y = ECDF(df[drug_filter]['iq']) # Want ECDF of drug-treatment data\n", |
344 | 344 | "ax1.plot(x, y, label='data')\n", |
|
347 | 347 | "ax1.set_xlabel('IQ')\n", |
348 | 348 | "ax1.set_ylabel('Cumulative Fraction')\n", |
349 | 349 | "\n", |
350 | | - "x, y = ECDF(samples['placebo']) # Want ECDF of placebo-treatment PPC samples\n", |
| 350 | + "x, y = ECDF(samples['placebo'].flatten()) # Want ECDF of placebo-treatment PPC samples\n", |
351 | 351 | "ax2.plot(x, y, label='ppc')\n", |
352 | 352 | "x, y = ECDF(df[placebo_filter]['iq']) # Want ECDF of placebo-treatment data\n", |
353 | 353 | "ax2.plot(x, y, label='data')\n", |
|
378 | 378 | "metadata": {}, |
379 | 379 | "outputs": [], |
380 | 380 | "source": [ |
381 | | - "az.plot_posterior(trace=trace, var_names=['diff_means', 'effect_size'])" |
| 381 | + "az.plot_posterior(trace, var_names=['diff_means', 'effect_size'])" |
382 | 382 | ] |
383 | 383 | }, |
384 | 384 | { |
|
489 | 489 | "metadata": {}, |
490 | 490 | "outputs": [], |
491 | 491 | "source": [ |
492 | | - "traces = az.traceplot(trace_alt)" |
| 492 | + "traces = az.plot_trace(trace_alt)" |
493 | 493 | ] |
494 | 494 | }, |
495 | 495 | { |
|
522 | 522 | ], |
523 | 523 | "metadata": { |
524 | 524 | "kernelspec": { |
525 | | - "display_name": "Python 3", |
| 525 | + "display_name": "bayesian-modelling-tutorial", |
526 | 526 | "language": "python", |
527 | | - "name": "python3" |
| 527 | + "name": "bayesian-modelling-tutorial" |
528 | 528 | }, |
529 | 529 | "language_info": { |
530 | 530 | "codemirror_mode": { |
|
536 | 536 | "name": "python", |
537 | 537 | "nbconvert_exporter": "python", |
538 | 538 | "pygments_lexer": "ipython3", |
539 | | - "version": "3.6.8" |
| 539 | + "version": "3.7.2" |
540 | 540 | }, |
541 | 541 | "toc": { |
542 | 542 | "base_numbering": 1, |
|
0 commit comments