Skip to content

Commit c5985c0

Browse files
committed
deploy: 064c47b
1 parent 299b83f commit c5985c0

200 files changed

Lines changed: 9387 additions & 9393 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

_notebooks/aiyagari.ipynb

Lines changed: 89 additions & 89 deletions
Large diffs are not rendered by default.

_notebooks/ak2.ipynb

Lines changed: 75 additions & 75 deletions
Large diffs are not rendered by default.

_notebooks/ak_aiyagari.ipynb

Lines changed: 111 additions & 111 deletions
Large diffs are not rendered by default.

_notebooks/ar1_bayes.ipynb

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "c89dbc03",
5+
"id": "20960adc",
66
"metadata": {},
77
"source": [
88
"$$\n",
@@ -13,15 +13,15 @@
1313
},
1414
{
1515
"cell_type": "markdown",
16-
"id": "62b09d5e",
16+
"id": "381c31e6",
1717
"metadata": {},
1818
"source": [
1919
"# Posterior Distributions for AR(1) Parameters"
2020
]
2121
},
2222
{
2323
"cell_type": "markdown",
24-
"id": "a304833c",
24+
"id": "34a963c2",
2525
"metadata": {},
2626
"source": [
2727
"# GPU\n",
@@ -39,7 +39,7 @@
3939
{
4040
"cell_type": "code",
4141
"execution_count": null,
42-
"id": "f6332f2e",
42+
"id": "b9010665",
4343
"metadata": {
4444
"hide-output": false
4545
},
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "markdown",
53-
"id": "a6a920eb",
53+
"id": "71da1db4",
5454
"metadata": {},
5555
"source": [
5656
"In addition to what’s included in base Anaconda, we need to install the following packages"
@@ -59,7 +59,7 @@
5959
{
6060
"cell_type": "code",
6161
"execution_count": null,
62-
"id": "b4ff82b3",
62+
"id": "0924a9ea",
6363
"metadata": {
6464
"hide-output": false
6565
},
@@ -70,7 +70,7 @@
7070
},
7171
{
7272
"cell_type": "markdown",
73-
"id": "73e111dd",
73+
"id": "b06f4c65",
7474
"metadata": {},
7575
"source": [
7676
"We’ll begin with some Python imports."
@@ -79,7 +79,7 @@
7979
{
8080
"cell_type": "code",
8181
"execution_count": null,
82-
"id": "5e6a6083",
82+
"id": "8762ec4c",
8383
"metadata": {
8484
"hide-output": false
8585
},
@@ -103,7 +103,7 @@
103103
},
104104
{
105105
"cell_type": "markdown",
106-
"id": "5bc0a3d9",
106+
"id": "8916928b",
107107
"metadata": {},
108108
"source": [
109109
"This lecture uses Bayesian methods offered by [pymc](https://www.pymc.io/projects/docs/en/stable/) and [numpyro](https://num.pyro.ai/en/stable/) to make statistical inferences about two parameters of a univariate first-order autoregression.\n",
@@ -199,7 +199,7 @@
199199
{
200200
"cell_type": "code",
201201
"execution_count": null,
202-
"id": "a6772af3",
202+
"id": "6c1b4f41",
203203
"metadata": {
204204
"hide-output": false
205205
},
@@ -229,7 +229,7 @@
229229
{
230230
"cell_type": "code",
231231
"execution_count": null,
232-
"id": "43af321b",
232+
"id": "e8eccad4",
233233
"metadata": {
234234
"hide-output": false
235235
},
@@ -241,7 +241,7 @@
241241
},
242242
{
243243
"cell_type": "markdown",
244-
"id": "21fc537d",
244+
"id": "66eb762c",
245245
"metadata": {},
246246
"source": [
247247
"Now we shall use Bayes’ law to construct a posterior distribution, conditioning on the initial value of $ y_0 $.\n",
@@ -253,7 +253,7 @@
253253
},
254254
{
255255
"cell_type": "markdown",
256-
"id": "4beb06c2",
256+
"id": "d0bbc011",
257257
"metadata": {},
258258
"source": [
259259
"## PyMC Implementation\n",
@@ -265,7 +265,7 @@
265265
{
266266
"cell_type": "code",
267267
"execution_count": null,
268-
"id": "94af6f1e",
268+
"id": "995b8240",
269269
"metadata": {
270270
"hide-output": false
271271
},
@@ -288,7 +288,7 @@
288288
},
289289
{
290290
"cell_type": "markdown",
291-
"id": "2d084ac8",
291+
"id": "55bda8ed",
292292
"metadata": {},
293293
"source": [
294294
"[pmc.sample](https://www.pymc.io/projects/docs/en/v5.10.0/api/generated/pymc.sample.html#pymc-sample) by default uses the NUTS samplers to generate samples as shown in the below cell:"
@@ -297,7 +297,7 @@
297297
{
298298
"cell_type": "code",
299299
"execution_count": null,
300-
"id": "cd8f6060",
300+
"id": "c2a7209b",
301301
"metadata": {
302302
"hide-output": false
303303
},
@@ -310,7 +310,7 @@
310310
{
311311
"cell_type": "code",
312312
"execution_count": null,
313-
"id": "ea0efa6b",
313+
"id": "a1008de5",
314314
"metadata": {
315315
"hide-output": false
316316
},
@@ -322,7 +322,7 @@
322322
},
323323
{
324324
"cell_type": "markdown",
325-
"id": "a0750806",
325+
"id": "fb64cdfb",
326326
"metadata": {},
327327
"source": [
328328
"Evidently, the posteriors aren’t centered on the true values of $ .5, 1 $ that we used to generate the data.\n",
@@ -337,7 +337,7 @@
337337
{
338338
"cell_type": "code",
339339
"execution_count": null,
340-
"id": "4311e4ec",
340+
"id": "c38e4773",
341341
"metadata": {
342342
"hide-output": false
343343
},
@@ -351,7 +351,7 @@
351351
},
352352
{
353353
"cell_type": "markdown",
354-
"id": "bea0937f",
354+
"id": "c490428b",
355355
"metadata": {},
356356
"source": [
357357
"Now we shall compute a posterior distribution after seeing the same data but instead assuming that $ y_0 $ is drawn from the stationary distribution.\n",
@@ -368,7 +368,7 @@
368368
{
369369
"cell_type": "code",
370370
"execution_count": null,
371-
"id": "2c614f34",
371+
"id": "7b795d53",
372372
"metadata": {
373373
"hide-output": false
374374
},
@@ -394,7 +394,7 @@
394394
{
395395
"cell_type": "code",
396396
"execution_count": null,
397-
"id": "44888f20",
397+
"id": "ab5d8a51",
398398
"metadata": {
399399
"hide-output": false
400400
},
@@ -409,7 +409,7 @@
409409
{
410410
"cell_type": "code",
411411
"execution_count": null,
412-
"id": "dc2644e4",
412+
"id": "74d3581f",
413413
"metadata": {
414414
"hide-output": false
415415
},
@@ -422,7 +422,7 @@
422422
{
423423
"cell_type": "code",
424424
"execution_count": null,
425-
"id": "3086dd8b",
425+
"id": "da5ab38a",
426426
"metadata": {
427427
"hide-output": false
428428
},
@@ -436,7 +436,7 @@
436436
},
437437
{
438438
"cell_type": "markdown",
439-
"id": "ddc4d825",
439+
"id": "3c478bf0",
440440
"metadata": {},
441441
"source": [
442442
"Please note how the posterior for $ \\rho $ has shifted to the right relative to when we conditioned on $ y_0 $ instead of assuming that $ y_0 $ is drawn from the stationary distribution.\n",
@@ -453,7 +453,7 @@
453453
},
454454
{
455455
"cell_type": "markdown",
456-
"id": "2314bcf5",
456+
"id": "aff1167c",
457457
"metadata": {},
458458
"source": [
459459
"## Numpyro Implementation"
@@ -462,7 +462,7 @@
462462
{
463463
"cell_type": "code",
464464
"execution_count": null,
465-
"id": "9f5311c8",
465+
"id": "67585e1e",
466466
"metadata": {
467467
"hide-output": false
468468
},
@@ -498,7 +498,7 @@
498498
{
499499
"cell_type": "code",
500500
"execution_count": null,
501-
"id": "92f2a1b6",
501+
"id": "1c9db67a",
502502
"metadata": {
503503
"hide-output": false
504504
},
@@ -519,7 +519,7 @@
519519
{
520520
"cell_type": "code",
521521
"execution_count": null,
522-
"id": "0a3796c3",
522+
"id": "19124396",
523523
"metadata": {
524524
"hide-output": false
525525
},
@@ -539,7 +539,7 @@
539539
{
540540
"cell_type": "code",
541541
"execution_count": null,
542-
"id": "980f5c1e",
542+
"id": "7b591724",
543543
"metadata": {
544544
"hide-output": false
545545
},
@@ -551,7 +551,7 @@
551551
{
552552
"cell_type": "code",
553553
"execution_count": null,
554-
"id": "afdb1d1e",
554+
"id": "0c7e3970",
555555
"metadata": {
556556
"hide-output": false
557557
},
@@ -562,7 +562,7 @@
562562
},
563563
{
564564
"cell_type": "markdown",
565-
"id": "b5419775",
565+
"id": "f91eb564",
566566
"metadata": {},
567567
"source": [
568568
"Next, we again compute the posterior under the assumption that $ y_0 $ is drawn from the stationary distribution, so that\n",
@@ -577,7 +577,7 @@
577577
{
578578
"cell_type": "code",
579579
"execution_count": null,
580-
"id": "0332cb5e",
580+
"id": "7e9c98b5",
581581
"metadata": {
582582
"hide-output": false
583583
},
@@ -602,7 +602,7 @@
602602
{
603603
"cell_type": "code",
604604
"execution_count": null,
605-
"id": "6216c7ec",
605+
"id": "1012bc14",
606606
"metadata": {
607607
"hide-output": false
608608
},
@@ -622,7 +622,7 @@
622622
{
623623
"cell_type": "code",
624624
"execution_count": null,
625-
"id": "d7539555",
625+
"id": "689f566f",
626626
"metadata": {
627627
"hide-output": false
628628
},
@@ -634,7 +634,7 @@
634634
{
635635
"cell_type": "code",
636636
"execution_count": null,
637-
"id": "3dfca9d7",
637+
"id": "3ad9be56",
638638
"metadata": {
639639
"hide-output": false
640640
},
@@ -645,7 +645,7 @@
645645
},
646646
{
647647
"cell_type": "markdown",
648-
"id": "db562412",
648+
"id": "dd1f6943",
649649
"metadata": {},
650650
"source": [
651651
"Look what happened to the posterior!\n",
@@ -660,7 +660,7 @@
660660
}
661661
],
662662
"metadata": {
663-
"date": 1771505064.4662316,
663+
"date": 1771505815.2329173,
664664
"filename": "ar1_bayes.md",
665665
"kernelspec": {
666666
"display_name": "Python",

0 commit comments

Comments
 (0)