Skip to content

Commit e646ecb

Browse files
committed
deploy: 4d82554
1 parent 15597b4 commit e646ecb

File tree

235 files changed

+8700
-9548
lines changed

Some content is hidden

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

235 files changed

+8700
-9548
lines changed

_notebooks/aiyagari.ipynb

Lines changed: 87 additions & 87 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: 109 additions & 109 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": "c6359506",
5+
"id": "76c66ed6",
66
"metadata": {},
77
"source": [
88
"# Posterior Distributions for AR(1) Parameters"
99
]
1010
},
1111
{
1212
"cell_type": "markdown",
13-
"id": "4d2a9a1d",
13+
"id": "e7e3c20a",
1414
"metadata": {},
1515
"source": [
1616
"# GPU\n",
@@ -25,7 +25,7 @@
2525
{
2626
"cell_type": "code",
2727
"execution_count": null,
28-
"id": "47f1b111",
28+
"id": "6952715b",
2929
"metadata": {
3030
"hide-output": false
3131
},
@@ -36,7 +36,7 @@
3636
},
3737
{
3838
"cell_type": "markdown",
39-
"id": "bb3fa457",
39+
"id": "ff09b312",
4040
"metadata": {},
4141
"source": [
4242
"In addition to what’s included in base Anaconda, we need to install the following packages"
@@ -45,7 +45,7 @@
4545
{
4646
"cell_type": "code",
4747
"execution_count": null,
48-
"id": "6639366f",
48+
"id": "65fce6ae",
4949
"metadata": {
5050
"hide-output": false
5151
},
@@ -56,7 +56,7 @@
5656
},
5757
{
5858
"cell_type": "markdown",
59-
"id": "13f2c2e2",
59+
"id": "1e509cf6",
6060
"metadata": {},
6161
"source": [
6262
"We’ll begin with some Python imports."
@@ -65,7 +65,7 @@
6565
{
6666
"cell_type": "code",
6767
"execution_count": null,
68-
"id": "b8576371",
68+
"id": "d90052f5",
6969
"metadata": {
7070
"hide-output": false
7171
},
@@ -89,7 +89,7 @@
8989
},
9090
{
9191
"cell_type": "markdown",
92-
"id": "9f8aedb4",
92+
"id": "cc197b7b",
9393
"metadata": {},
9494
"source": [
9595
"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",
@@ -185,7 +185,7 @@
185185
{
186186
"cell_type": "code",
187187
"execution_count": null,
188-
"id": "35aa76e8",
188+
"id": "0813473f",
189189
"metadata": {
190190
"hide-output": false
191191
},
@@ -215,7 +215,7 @@
215215
{
216216
"cell_type": "code",
217217
"execution_count": null,
218-
"id": "fe5008bf",
218+
"id": "6829658b",
219219
"metadata": {
220220
"hide-output": false
221221
},
@@ -227,7 +227,7 @@
227227
},
228228
{
229229
"cell_type": "markdown",
230-
"id": "76facd42",
230+
"id": "60d4136b",
231231
"metadata": {},
232232
"source": [
233233
"Now we shall use Bayes’ law to construct a posterior distribution, conditioning on the initial value of $ y_0 $.\n",
@@ -239,7 +239,7 @@
239239
},
240240
{
241241
"cell_type": "markdown",
242-
"id": "b7715545",
242+
"id": "5e68f3fe",
243243
"metadata": {},
244244
"source": [
245245
"## PyMC Implementation\n",
@@ -251,7 +251,7 @@
251251
{
252252
"cell_type": "code",
253253
"execution_count": null,
254-
"id": "0d794aae",
254+
"id": "091eb321",
255255
"metadata": {
256256
"hide-output": false
257257
},
@@ -274,7 +274,7 @@
274274
},
275275
{
276276
"cell_type": "markdown",
277-
"id": "59a95a8e",
277+
"id": "6b656c43",
278278
"metadata": {},
279279
"source": [
280280
"[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:"
@@ -283,7 +283,7 @@
283283
{
284284
"cell_type": "code",
285285
"execution_count": null,
286-
"id": "c43150a6",
286+
"id": "de186b5e",
287287
"metadata": {
288288
"hide-output": false
289289
},
@@ -296,7 +296,7 @@
296296
{
297297
"cell_type": "code",
298298
"execution_count": null,
299-
"id": "8c58eb17",
299+
"id": "2cb0a0af",
300300
"metadata": {
301301
"hide-output": false
302302
},
@@ -308,7 +308,7 @@
308308
},
309309
{
310310
"cell_type": "markdown",
311-
"id": "a567f1c4",
311+
"id": "0c365670",
312312
"metadata": {},
313313
"source": [
314314
"Evidently, the posteriors aren’t centered on the true values of $ .5, 1 $ that we used to generate the data.\n",
@@ -323,7 +323,7 @@
323323
{
324324
"cell_type": "code",
325325
"execution_count": null,
326-
"id": "b414dbe0",
326+
"id": "9e300ad3",
327327
"metadata": {
328328
"hide-output": false
329329
},
@@ -337,7 +337,7 @@
337337
},
338338
{
339339
"cell_type": "markdown",
340-
"id": "820a0465",
340+
"id": "94bf6a88",
341341
"metadata": {},
342342
"source": [
343343
"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",
@@ -354,7 +354,7 @@
354354
{
355355
"cell_type": "code",
356356
"execution_count": null,
357-
"id": "3de10c77",
357+
"id": "21952b7f",
358358
"metadata": {
359359
"hide-output": false
360360
},
@@ -380,7 +380,7 @@
380380
{
381381
"cell_type": "code",
382382
"execution_count": null,
383-
"id": "908b298b",
383+
"id": "567297c7",
384384
"metadata": {
385385
"hide-output": false
386386
},
@@ -395,7 +395,7 @@
395395
{
396396
"cell_type": "code",
397397
"execution_count": null,
398-
"id": "918200c5",
398+
"id": "eb60c1e9",
399399
"metadata": {
400400
"hide-output": false
401401
},
@@ -408,7 +408,7 @@
408408
{
409409
"cell_type": "code",
410410
"execution_count": null,
411-
"id": "9de45d8a",
411+
"id": "0e3601fd",
412412
"metadata": {
413413
"hide-output": false
414414
},
@@ -422,7 +422,7 @@
422422
},
423423
{
424424
"cell_type": "markdown",
425-
"id": "0c0441b4",
425+
"id": "779a53d1",
426426
"metadata": {},
427427
"source": [
428428
"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",
@@ -439,7 +439,7 @@
439439
},
440440
{
441441
"cell_type": "markdown",
442-
"id": "cc5ab54f",
442+
"id": "8ad8727a",
443443
"metadata": {},
444444
"source": [
445445
"## Numpyro Implementation"
@@ -448,7 +448,7 @@
448448
{
449449
"cell_type": "code",
450450
"execution_count": null,
451-
"id": "59295ee8",
451+
"id": "cb8feedd",
452452
"metadata": {
453453
"hide-output": false
454454
},
@@ -484,7 +484,7 @@
484484
{
485485
"cell_type": "code",
486486
"execution_count": null,
487-
"id": "f6fcb67f",
487+
"id": "5d482f7c",
488488
"metadata": {
489489
"hide-output": false
490490
},
@@ -505,7 +505,7 @@
505505
{
506506
"cell_type": "code",
507507
"execution_count": null,
508-
"id": "2e8e3c05",
508+
"id": "4ed5935f",
509509
"metadata": {
510510
"hide-output": false
511511
},
@@ -525,7 +525,7 @@
525525
{
526526
"cell_type": "code",
527527
"execution_count": null,
528-
"id": "fe205262",
528+
"id": "dedf4306",
529529
"metadata": {
530530
"hide-output": false
531531
},
@@ -537,7 +537,7 @@
537537
{
538538
"cell_type": "code",
539539
"execution_count": null,
540-
"id": "b3aa5224",
540+
"id": "3c02af17",
541541
"metadata": {
542542
"hide-output": false
543543
},
@@ -548,7 +548,7 @@
548548
},
549549
{
550550
"cell_type": "markdown",
551-
"id": "74f5b94b",
551+
"id": "a52700dc",
552552
"metadata": {},
553553
"source": [
554554
"Next, we again compute the posterior under the assumption that $ y_0 $ is drawn from the stationary distribution, so that\n",
@@ -563,7 +563,7 @@
563563
{
564564
"cell_type": "code",
565565
"execution_count": null,
566-
"id": "e3eb3899",
566+
"id": "b142ab27",
567567
"metadata": {
568568
"hide-output": false
569569
},
@@ -588,7 +588,7 @@
588588
{
589589
"cell_type": "code",
590590
"execution_count": null,
591-
"id": "cb2b4931",
591+
"id": "b55ea30f",
592592
"metadata": {
593593
"hide-output": false
594594
},
@@ -608,7 +608,7 @@
608608
{
609609
"cell_type": "code",
610610
"execution_count": null,
611-
"id": "4a46d4a0",
611+
"id": "3620d727",
612612
"metadata": {
613613
"hide-output": false
614614
},
@@ -620,7 +620,7 @@
620620
{
621621
"cell_type": "code",
622622
"execution_count": null,
623-
"id": "1cdfc066",
623+
"id": "67bf8a04",
624624
"metadata": {
625625
"hide-output": false
626626
},
@@ -631,7 +631,7 @@
631631
},
632632
{
633633
"cell_type": "markdown",
634-
"id": "a13d08ea",
634+
"id": "c38f52d9",
635635
"metadata": {},
636636
"source": [
637637
"Look what happened to the posterior!\n",
@@ -646,7 +646,7 @@
646646
}
647647
],
648648
"metadata": {
649-
"date": 1763691523.9891539,
649+
"date": 1763717903.4266343,
650650
"filename": "ar1_bayes.md",
651651
"kernelspec": {
652652
"display_name": "Python",

0 commit comments

Comments
 (0)