Skip to content

Commit 557aa94

Browse files
committed
deploy: 042e2ff
1 parent af9d277 commit 557aa94

310 files changed

Lines changed: 12557 additions & 12548 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/affine_risk_prices.ipynb

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

_notebooks/aiyagari.ipynb

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

_notebooks/ak2.ipynb

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

_notebooks/ak_aiyagari.ipynb

Lines changed: 113 additions & 113 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": "492c603b",
5+
"id": "76edc254",
66
"metadata": {},
77
"source": [
88
"$$\n",
@@ -13,15 +13,15 @@
1313
},
1414
{
1515
"cell_type": "markdown",
16-
"id": "c9174d55",
16+
"id": "f2e7c6ff",
1717
"metadata": {},
1818
"source": [
1919
"# Posterior Distributions for AR(1) Parameters"
2020
]
2121
},
2222
{
2323
"cell_type": "markdown",
24-
"id": "1b35cf83",
24+
"id": "10cd8d32",
2525
"metadata": {},
2626
"source": [
2727
"# GPU\n",
@@ -39,7 +39,7 @@
3939
{
4040
"cell_type": "code",
4141
"execution_count": null,
42-
"id": "1d20718f",
42+
"id": "869961fc",
4343
"metadata": {
4444
"hide-output": false
4545
},
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "markdown",
53-
"id": "e99889cf",
53+
"id": "35bb07b8",
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": "35448d27",
62+
"id": "caff5467",
6363
"metadata": {
6464
"hide-output": false
6565
},
@@ -70,7 +70,7 @@
7070
},
7171
{
7272
"cell_type": "markdown",
73-
"id": "cc1b1723",
73+
"id": "78bebf16",
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": "1d871034",
82+
"id": "30ba54e6",
8383
"metadata": {
8484
"hide-output": false
8585
},
@@ -103,7 +103,7 @@
103103
},
104104
{
105105
"cell_type": "markdown",
106-
"id": "9814f4ea",
106+
"id": "0e306b82",
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": "0811ab8b",
202+
"id": "4f8a1810",
203203
"metadata": {
204204
"hide-output": false
205205
},
@@ -229,7 +229,7 @@
229229
{
230230
"cell_type": "code",
231231
"execution_count": null,
232-
"id": "bf347d83",
232+
"id": "d5c42c18",
233233
"metadata": {
234234
"hide-output": false
235235
},
@@ -241,7 +241,7 @@
241241
},
242242
{
243243
"cell_type": "markdown",
244-
"id": "aff1c06d",
244+
"id": "b7c88d3b",
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": "f5e9259d",
256+
"id": "17466caf",
257257
"metadata": {},
258258
"source": [
259259
"## PyMC Implementation\n",
@@ -265,7 +265,7 @@
265265
{
266266
"cell_type": "code",
267267
"execution_count": null,
268-
"id": "8291b7c6",
268+
"id": "7299fa1b",
269269
"metadata": {
270270
"hide-output": false
271271
},
@@ -288,7 +288,7 @@
288288
},
289289
{
290290
"cell_type": "markdown",
291-
"id": "6ff91453",
291+
"id": "beb566f7",
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": "cb352a71",
300+
"id": "af8c58f5",
301301
"metadata": {
302302
"hide-output": false
303303
},
@@ -310,7 +310,7 @@
310310
{
311311
"cell_type": "code",
312312
"execution_count": null,
313-
"id": "d5b58e39",
313+
"id": "0cdc0d00",
314314
"metadata": {
315315
"hide-output": false
316316
},
@@ -322,7 +322,7 @@
322322
},
323323
{
324324
"cell_type": "markdown",
325-
"id": "7131dd66",
325+
"id": "b89cf500",
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": "91d6d808",
340+
"id": "05eb2dcf",
341341
"metadata": {
342342
"hide-output": false
343343
},
@@ -351,7 +351,7 @@
351351
},
352352
{
353353
"cell_type": "markdown",
354-
"id": "82919756",
354+
"id": "e278380d",
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": "a5286de4",
371+
"id": "ef4112cd",
372372
"metadata": {
373373
"hide-output": false
374374
},
@@ -394,7 +394,7 @@
394394
{
395395
"cell_type": "code",
396396
"execution_count": null,
397-
"id": "6b64a6f3",
397+
"id": "6725d3b0",
398398
"metadata": {
399399
"hide-output": false
400400
},
@@ -409,7 +409,7 @@
409409
{
410410
"cell_type": "code",
411411
"execution_count": null,
412-
"id": "f455a3ea",
412+
"id": "0886972e",
413413
"metadata": {
414414
"hide-output": false
415415
},
@@ -422,7 +422,7 @@
422422
{
423423
"cell_type": "code",
424424
"execution_count": null,
425-
"id": "398b46a1",
425+
"id": "9d2a328c",
426426
"metadata": {
427427
"hide-output": false
428428
},
@@ -436,7 +436,7 @@
436436
},
437437
{
438438
"cell_type": "markdown",
439-
"id": "93d24fa6",
439+
"id": "8d7c72d0",
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": "c8de54e6",
456+
"id": "352b8c08",
457457
"metadata": {},
458458
"source": [
459459
"## Numpyro Implementation"
@@ -462,7 +462,7 @@
462462
{
463463
"cell_type": "code",
464464
"execution_count": null,
465-
"id": "6f3a8ed2",
465+
"id": "2e8f8bf7",
466466
"metadata": {
467467
"hide-output": false
468468
},
@@ -498,7 +498,7 @@
498498
{
499499
"cell_type": "code",
500500
"execution_count": null,
501-
"id": "cf8f427d",
501+
"id": "df1c6a9a",
502502
"metadata": {
503503
"hide-output": false
504504
},
@@ -519,7 +519,7 @@
519519
{
520520
"cell_type": "code",
521521
"execution_count": null,
522-
"id": "8c1f2e76",
522+
"id": "64fd94d4",
523523
"metadata": {
524524
"hide-output": false
525525
},
@@ -539,7 +539,7 @@
539539
{
540540
"cell_type": "code",
541541
"execution_count": null,
542-
"id": "8f83a30d",
542+
"id": "ba679ae9",
543543
"metadata": {
544544
"hide-output": false
545545
},
@@ -551,7 +551,7 @@
551551
{
552552
"cell_type": "code",
553553
"execution_count": null,
554-
"id": "62548f26",
554+
"id": "31bdf728",
555555
"metadata": {
556556
"hide-output": false
557557
},
@@ -562,7 +562,7 @@
562562
},
563563
{
564564
"cell_type": "markdown",
565-
"id": "9645d714",
565+
"id": "60a2649e",
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": "f141fe08",
580+
"id": "dfc69b4f",
581581
"metadata": {
582582
"hide-output": false
583583
},
@@ -602,7 +602,7 @@
602602
{
603603
"cell_type": "code",
604604
"execution_count": null,
605-
"id": "b3d8d9e6",
605+
"id": "a64f57ce",
606606
"metadata": {
607607
"hide-output": false
608608
},
@@ -622,7 +622,7 @@
622622
{
623623
"cell_type": "code",
624624
"execution_count": null,
625-
"id": "68a444c0",
625+
"id": "913aee28",
626626
"metadata": {
627627
"hide-output": false
628628
},
@@ -634,7 +634,7 @@
634634
{
635635
"cell_type": "code",
636636
"execution_count": null,
637-
"id": "ff301b03",
637+
"id": "b612eaf4",
638638
"metadata": {
639639
"hide-output": false
640640
},
@@ -645,7 +645,7 @@
645645
},
646646
{
647647
"cell_type": "markdown",
648-
"id": "c7556842",
648+
"id": "6c43c282",
649649
"metadata": {},
650650
"source": [
651651
"Look what happened to the posterior!\n",
@@ -660,7 +660,7 @@
660660
}
661661
],
662662
"metadata": {
663-
"date": 1772867702.5119815,
663+
"date": 1772937187.319557,
664664
"filename": "ar1_bayes.md",
665665
"kernelspec": {
666666
"display_name": "Python",

0 commit comments

Comments
 (0)