Skip to content

Commit 0cff28b

Browse files
committed
deploy: 60235eb
1 parent e89cc93 commit 0cff28b

217 files changed

Lines changed: 9024 additions & 9135 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.
35.1 KB
Loading
27.5 KB
Loading
14.7 KB
Loading

_notebooks/aiyagari.ipynb

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

_notebooks/ak2.ipynb

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

_notebooks/ak_aiyagari.ipynb

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

_notebooks/ar1_bayes.ipynb

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "4c2ff036",
5+
"id": "3acdf11f",
66
"metadata": {},
77
"source": [
88
"# Posterior Distributions for AR(1) Parameters"
99
]
1010
},
1111
{
1212
"cell_type": "markdown",
13-
"id": "753fbd5d",
13+
"id": "608b2d44",
1414
"metadata": {},
1515
"source": [
1616
"# GPU\n",
@@ -28,7 +28,7 @@
2828
{
2929
"cell_type": "code",
3030
"execution_count": null,
31-
"id": "2bcd2529",
31+
"id": "1176f228",
3232
"metadata": {
3333
"hide-output": false
3434
},
@@ -39,7 +39,7 @@
3939
},
4040
{
4141
"cell_type": "markdown",
42-
"id": "ffc6fe58",
42+
"id": "b639ca6b",
4343
"metadata": {},
4444
"source": [
4545
"In addition to what’s included in base Anaconda, we need to install the following packages"
@@ -48,7 +48,7 @@
4848
{
4949
"cell_type": "code",
5050
"execution_count": null,
51-
"id": "2fcba788",
51+
"id": "8b92d31e",
5252
"metadata": {
5353
"hide-output": false
5454
},
@@ -59,7 +59,7 @@
5959
},
6060
{
6161
"cell_type": "markdown",
62-
"id": "c160848c",
62+
"id": "1d0b4ee3",
6363
"metadata": {},
6464
"source": [
6565
"We’ll begin with some Python imports."
@@ -68,7 +68,7 @@
6868
{
6969
"cell_type": "code",
7070
"execution_count": null,
71-
"id": "dd636b52",
71+
"id": "0eef2439",
7272
"metadata": {
7373
"hide-output": false
7474
},
@@ -92,7 +92,7 @@
9292
},
9393
{
9494
"cell_type": "markdown",
95-
"id": "c5a4636c",
95+
"id": "28901b24",
9696
"metadata": {},
9797
"source": [
9898
"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",
@@ -188,7 +188,7 @@
188188
{
189189
"cell_type": "code",
190190
"execution_count": null,
191-
"id": "582a28ea",
191+
"id": "f129e1b4",
192192
"metadata": {
193193
"hide-output": false
194194
},
@@ -218,7 +218,7 @@
218218
{
219219
"cell_type": "code",
220220
"execution_count": null,
221-
"id": "d1596287",
221+
"id": "10017972",
222222
"metadata": {
223223
"hide-output": false
224224
},
@@ -230,7 +230,7 @@
230230
},
231231
{
232232
"cell_type": "markdown",
233-
"id": "e55155d0",
233+
"id": "9bd0be83",
234234
"metadata": {},
235235
"source": [
236236
"Now we shall use Bayes’ law to construct a posterior distribution, conditioning on the initial value of $ y_0 $.\n",
@@ -242,7 +242,7 @@
242242
},
243243
{
244244
"cell_type": "markdown",
245-
"id": "1af65dba",
245+
"id": "9ba227de",
246246
"metadata": {},
247247
"source": [
248248
"## PyMC Implementation\n",
@@ -254,7 +254,7 @@
254254
{
255255
"cell_type": "code",
256256
"execution_count": null,
257-
"id": "3453e8bf",
257+
"id": "ccb42a21",
258258
"metadata": {
259259
"hide-output": false
260260
},
@@ -277,7 +277,7 @@
277277
},
278278
{
279279
"cell_type": "markdown",
280-
"id": "20ced9e4",
280+
"id": "b253e05e",
281281
"metadata": {},
282282
"source": [
283283
"[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:"
@@ -286,7 +286,7 @@
286286
{
287287
"cell_type": "code",
288288
"execution_count": null,
289-
"id": "5c025dba",
289+
"id": "d84d93d0",
290290
"metadata": {
291291
"hide-output": false
292292
},
@@ -299,7 +299,7 @@
299299
{
300300
"cell_type": "code",
301301
"execution_count": null,
302-
"id": "d04f6c90",
302+
"id": "2e81101e",
303303
"metadata": {
304304
"hide-output": false
305305
},
@@ -311,7 +311,7 @@
311311
},
312312
{
313313
"cell_type": "markdown",
314-
"id": "5558841d",
314+
"id": "0d2e5a85",
315315
"metadata": {},
316316
"source": [
317317
"Evidently, the posteriors aren’t centered on the true values of $ .5, 1 $ that we used to generate the data.\n",
@@ -326,7 +326,7 @@
326326
{
327327
"cell_type": "code",
328328
"execution_count": null,
329-
"id": "9dfdd777",
329+
"id": "f6a307d2",
330330
"metadata": {
331331
"hide-output": false
332332
},
@@ -340,7 +340,7 @@
340340
},
341341
{
342342
"cell_type": "markdown",
343-
"id": "9dfb09ea",
343+
"id": "80565ac4",
344344
"metadata": {},
345345
"source": [
346346
"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",
@@ -357,7 +357,7 @@
357357
{
358358
"cell_type": "code",
359359
"execution_count": null,
360-
"id": "8262a6dd",
360+
"id": "25623234",
361361
"metadata": {
362362
"hide-output": false
363363
},
@@ -383,7 +383,7 @@
383383
{
384384
"cell_type": "code",
385385
"execution_count": null,
386-
"id": "d89446b8",
386+
"id": "d8f79724",
387387
"metadata": {
388388
"hide-output": false
389389
},
@@ -398,7 +398,7 @@
398398
{
399399
"cell_type": "code",
400400
"execution_count": null,
401-
"id": "69a4556c",
401+
"id": "93170dab",
402402
"metadata": {
403403
"hide-output": false
404404
},
@@ -411,7 +411,7 @@
411411
{
412412
"cell_type": "code",
413413
"execution_count": null,
414-
"id": "3d0003d0",
414+
"id": "ac7f00c2",
415415
"metadata": {
416416
"hide-output": false
417417
},
@@ -425,7 +425,7 @@
425425
},
426426
{
427427
"cell_type": "markdown",
428-
"id": "c4e688b2",
428+
"id": "94f83b3f",
429429
"metadata": {},
430430
"source": [
431431
"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",
@@ -442,7 +442,7 @@
442442
},
443443
{
444444
"cell_type": "markdown",
445-
"id": "1a15c07c",
445+
"id": "09730117",
446446
"metadata": {},
447447
"source": [
448448
"## Numpyro Implementation"
@@ -451,7 +451,7 @@
451451
{
452452
"cell_type": "code",
453453
"execution_count": null,
454-
"id": "d439bca9",
454+
"id": "31c13fb0",
455455
"metadata": {
456456
"hide-output": false
457457
},
@@ -487,7 +487,7 @@
487487
{
488488
"cell_type": "code",
489489
"execution_count": null,
490-
"id": "824c49ab",
490+
"id": "adb302a5",
491491
"metadata": {
492492
"hide-output": false
493493
},
@@ -508,7 +508,7 @@
508508
{
509509
"cell_type": "code",
510510
"execution_count": null,
511-
"id": "c7a90e6b",
511+
"id": "0c0544ed",
512512
"metadata": {
513513
"hide-output": false
514514
},
@@ -528,7 +528,7 @@
528528
{
529529
"cell_type": "code",
530530
"execution_count": null,
531-
"id": "af313935",
531+
"id": "cf0a6a05",
532532
"metadata": {
533533
"hide-output": false
534534
},
@@ -540,7 +540,7 @@
540540
{
541541
"cell_type": "code",
542542
"execution_count": null,
543-
"id": "e8c0cd59",
543+
"id": "e92d224e",
544544
"metadata": {
545545
"hide-output": false
546546
},
@@ -551,7 +551,7 @@
551551
},
552552
{
553553
"cell_type": "markdown",
554-
"id": "22fa8cd2",
554+
"id": "8179219e",
555555
"metadata": {},
556556
"source": [
557557
"Next, we again compute the posterior under the assumption that $ y_0 $ is drawn from the stationary distribution, so that\n",
@@ -566,7 +566,7 @@
566566
{
567567
"cell_type": "code",
568568
"execution_count": null,
569-
"id": "a3c96c64",
569+
"id": "370c21dd",
570570
"metadata": {
571571
"hide-output": false
572572
},
@@ -591,7 +591,7 @@
591591
{
592592
"cell_type": "code",
593593
"execution_count": null,
594-
"id": "8c9a4d14",
594+
"id": "c7a45f37",
595595
"metadata": {
596596
"hide-output": false
597597
},
@@ -611,7 +611,7 @@
611611
{
612612
"cell_type": "code",
613613
"execution_count": null,
614-
"id": "7534b91d",
614+
"id": "59ddfc53",
615615
"metadata": {
616616
"hide-output": false
617617
},
@@ -623,7 +623,7 @@
623623
{
624624
"cell_type": "code",
625625
"execution_count": null,
626-
"id": "9072cde2",
626+
"id": "f847a997",
627627
"metadata": {
628628
"hide-output": false
629629
},
@@ -634,7 +634,7 @@
634634
},
635635
{
636636
"cell_type": "markdown",
637-
"id": "856b04f8",
637+
"id": "725d0274",
638638
"metadata": {},
639639
"source": [
640640
"Look what happened to the posterior!\n",
@@ -649,7 +649,7 @@
649649
}
650650
],
651651
"metadata": {
652-
"date": 1764647436.8831613,
652+
"date": 1764675747.6672175,
653653
"filename": "ar1_bayes.md",
654654
"kernelspec": {
655655
"display_name": "Python",

0 commit comments

Comments
 (0)