Skip to content

Commit b8ed85c

Browse files
Add Three Lectures on Long-term Risk and Learning (#889)
* Tom's May 8 edits of new lecture * Tom's April 9 edits of new and old lectures * Tom's addition of a lecture * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * Update rng usage in lln_clt.md (#874) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix assorted issues in prob_meaning lecture (#878) * Fix typos, spelling, notation errors, and swapped bounds in prob_meaning - Fix spelling: probabilties, probabililty (x6), statististian - Fix doubled word: "to to help" - Fix variance formula: remove erroneous factor of n (rho is Bernoulli, not binomial) - Fix notation: P_{k,i} → rho_{k,i} to match definition - Fix subject-verb agreement: "means converges" → "mean converges" - Fix swapped upper/lower bounds in part (e) ppf calls - Fix compare() to include k=0 - Fix LaTeX: replace * with \cdot for multiplication - Fix log(I) range: text said 2 to 7, code has 2 to 6 - Fix imprecise wording: f_k^I approximates Prob(X=k|θ), not θ - Clarify vague exercise pm_ex1 part 3 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Improve code quality: naming, PEP 8, line length, grid resolution - Rename class frequentist → Frequentist (PEP 8) - Rename Bay_stat → bayes (snake_case for instances) - Rename ii → i/post, num → n_obs, num_list → n_obs_list, kk → k, K → head_counts, comp → table, step_num → n_obs, npt → n_thetas, nn → n_ns, nI → n_Is - Replace (sample <= θ) * 1 with .astype(int) for consistency - Shorten docstrings to fit within 80 characters - Break long code lines (plot calls, list comprehensions, titles) - Increase θ grid from 100 to 1000 points for smoother density plots - Use f-strings with comma formatting for plot labels Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Restructure Bayesian section: derive posterior before exercise - Add back-reference to prob_matrix lecture for Bayes' Law intro - Derive the n-step posterior Beta(α+k, β+n-k) before the exercise, so the exercise solution code no longer precedes its own derivation - Replace the duplicated derivation after the exercise with a concise summary referencing the formula above - Remove duplicate "Now pretend..." sentence before part (c) - Replace "this quantecon lecture" cross-references with actual titles for better PDF rendering Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Replace prettytable with pandas DataFrame in compare() Drop the prettytable dependency — pandas is already imported and renders nicely in Jupyter notebooks. The compare() method now returns a DataFrame instead of printing a PrettyTable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Fix exercise pm_ex2 parts (a) and (b) to match their solutions The question asked for the likelihood of "a sample of length n from a binomial" but the solution gave the single-flip Bernoulli case. Reword both the questions and solution headers so parts (a) and (b) are explicitly about a single coin flip. The general n-step case is already derived in the lecture text before the exercise. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add reproducible random seeds using modern NumPy API Both classes now accept an rng parameter and use rng.random() instead of np.random.rand(). Each code cell passes a seeded np.random.default_rng() for reproducible output across builds. Also remove "typically" from the hump-shape sentence, since with fixed seeds the behavior is deterministic. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Clean up posterior PDF plots - Rename title from "P.D.F" to "PDF" - Simplify legend labels: "n = 0 (prior)", "n = 1", etc. - Remove n = 30, 70, 300, 500 from observation list to reduce clutter in the first PDF plot Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Remove repeated question text from exercise solutions Solutions for parts (c)-(h) no longer duplicate the question text as a header — they just use the part label. This follows the QuantEcon convention. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Use p(θ) for density notation and break up solution derivation - Change P(θ) to p(θ) throughout and note it is a density - Replace the single aligned equation block in the solution for part (b) with three separate display equations, each introduced by explanatory text (Bayes' Law, substitution, collecting powers) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Final review polish: notation, plotting style, consistency - Use **bold** instead of __bold__ for binomial distribution - Use IID instead of i.i.d. - Fix double "with" in exercise (c) wording - Rename quantile variables from p_1/p_2 to q_1/q_2 to avoid clash with p(θ) density notation - Fix "means and variances statistics" → "mean and standard deviation" - Standardize N → n in post-exercise text to match pre-exercise - Update "exceeds 500" → "exceeds 1000" to match revised n_obs_list - Standardize frequentist plots to use ax. methods instead of plt. - Remove dead self.k assignment in Frequentist.binomial() Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Adopt new style guide notation conventions Replace \textrm{Prob}(...) with \mathbb{P}{...} and E[...] with \mathbb{E}[...] following QuantEcon.manual#84. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Update rng usage in stats_examples.md (#873) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * Tom's May 31 edits of long-run risk lecture * updates * updates * updates * updates * updates * updates * Tom's June 5 edits of long run risk model * update --------- Co-authored-by: thomassargent30 <ts43@nyu.edu>
1 parent d9ceae5 commit b8ed85c

7 files changed

Lines changed: 6385 additions & 35 deletions

File tree

lectures/_static/quant-econ.bib

Lines changed: 247 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ @article{Epstein_Zin1989
203203
volume = {57},
204204
number = {4},
205205
pages = {937--969},
206-
year = {1989}
206+
year = {1989},
207+
doi = {10.2307/1913778}
207208
}
208209

209210
@article{Epstein_Zin1991,
@@ -213,7 +214,8 @@ @article{Epstein_Zin1991
213214
volume = {99},
214215
number = {2},
215216
pages = {263--286},
216-
year = {1991}
217+
year = {1991},
218+
doi = {10.1086/261750}
217219
}
218220

219221
@article{Duffie_Epstein1992a,
@@ -292,7 +294,8 @@ @article{Kreps_Porteus1978
292294
volume = {46},
293295
number = {1},
294296
pages = {185--200},
295-
year = {1978}
297+
year = {1978},
298+
doi = {10.2307/1913656}
296299
}
297300

298301
@article{Lucas_Stokey1984,
@@ -302,7 +305,8 @@ @article{Lucas_Stokey1984
302305
volume = {32},
303306
number = {1},
304307
pages = {139--171},
305-
year = {1984}
308+
year = {1984},
309+
doi = {10.1016/0022-0531(84)90079-6}
306310
}
307311

308312
@book{Karlin_Taylor1981,
@@ -2133,17 +2137,6 @@ @book{Lucas1987
21332137
publisher = {Oxford Blackwell}
21342138
}
21352139

2136-
@article{Hans_Scheink_2009,
2137-
author = {Lars Peter Hansen and Jose A. Scheinkman},
2138-
title = {Long-Term Risk: An Operator Approach},
2139-
journal = {Econometrica},
2140-
year = {2009},
2141-
volume = {77},
2142-
number = {1},
2143-
pages = {177-234},
2144-
month = {01}
2145-
}
2146-
21472140
@book{Whittle1963,
21482141
title = {Prediction and regulation by linear least-square methods},
21492142
author = {Whittle, Peter},
@@ -2841,6 +2834,53 @@ @article{MarcetMarimon1994
28412834
year = {2019}
28422835
}
28432836

2837+
@article{MarcetSargent1989jet,
2838+
author = {Marcet, Albert and Sargent, Thomas J.},
2839+
title = {Convergence of Least Squares Learning Mechanisms in
2840+
Self-Referential Linear Stochastic Models},
2841+
journal = {Journal of Economic Theory},
2842+
year = {1989},
2843+
volume = {48},
2844+
number = {2},
2845+
pages = {337--368},
2846+
publisher = {Elsevier},
2847+
doi = {10.1016/0022-0531(89)90032-X}
2848+
}
2849+
2850+
@article{Ljung1977,
2851+
author = {Ljung, Lennart},
2852+
title = {Analysis of Recursive Stochastic Algorithms},
2853+
journal = {IEEE Transactions on Automatic Control},
2854+
year = {1977},
2855+
volume = {22},
2856+
number = {4},
2857+
pages = {551--575},
2858+
doi = {10.1109/TAC.1977.1101561}
2859+
}
2860+
2861+
@article{Evans1985,
2862+
author = {Evans, George W.},
2863+
title = {Expectational Stability and the Multiple Equilibria Problem
2864+
in Linear Rational Expectations Models},
2865+
journal = {Quarterly Journal of Economics},
2866+
year = {1985},
2867+
volume = {100},
2868+
number = {4},
2869+
pages = {1217--1233},
2870+
doi = {10.2307/1885681}
2871+
}
2872+
2873+
@article{FourgeaudGourieroux1986,
2874+
author = {Fourgeaud, Claude and Gourieroux, Christian and Pradel, Jacqueline},
2875+
title = {Learning Procedures and Convergence to Rationality},
2876+
journal = {Econometrica},
2877+
year = {1986},
2878+
volume = {54},
2879+
number = {4},
2880+
pages = {845--868},
2881+
doi = {10.2307/1912839}
2882+
}
2883+
28442884
@article{MarcetSargent1989,
28452885
author = {Marcet, Albert and Sargent, Thomas J},
28462886
journal = {Journal of Political Economy},
@@ -3063,29 +3103,26 @@ @article{Schelling1969
30633103
}
30643104

30653105
@article{Bansal_Yaron_2004,
3066-
author = {Ravi Bansal and Amir Yaron},
3067-
title = {{Risks for the Long Run: A Potential Resolution of Asset Pricing Puzzles}},
3068-
journal = {Journal of Finance},
3069-
year = 2004,
3070-
volume = {59},
3071-
number = {4},
3072-
pages = {1481-1509},
3073-
month = {08},
3074-
keywords = {},
3075-
doi = {},
3076-
abstract = { We model consumption and dividend growth rates as containing (1) a small long-run predictable component, and (2) fluctuating economic uncertainty (consumption volatility). These dynamics, for which we provide empirical support, in conjunction with Epstein and Zin's (1989) preferences, can explain key asset markets phenomena. In our economy, financial markets dislike economic uncertainty and better long-run growth prospects raise equity prices. The model can justify the equity premium, the risk-free rate, and the volatility of the market return, risk-free rate, and the price-dividend ratio. As in the data, dividend yields predict returns and the volatility of returns is time-varying. Copyright 2004 by The American Finance Association.},
3077-
url = {https://ideas.repec.org/a/bla/jfinan/v59y2004i4p1481-1509.html}
3106+
author = {Bansal, Ravi and Yaron, Amir},
3107+
title = {Risks for the Long Run: A Potential Resolution of Asset Pricing Puzzles},
3108+
journal = {Journal of Finance},
3109+
year = {2004},
3110+
volume = {59},
3111+
number = {4},
3112+
pages = {1481--1509},
3113+
doi = {10.1111/j.1540-6261.2004.00670.x}
30783114
}
30793115

30803116
@article{hansen2008consumption,
3081-
title = {Consumption strikes back? Measuring long-run risk},
3082-
author = {Hansen, Lars Peter and Heaton, John C and Li, Nan},
3083-
journal = {Journal of Political economy},
3117+
title = {Consumption Strikes Back? Measuring Long-Run Risk},
3118+
author = {Hansen, Lars Peter and Heaton, John C. and Li, Nan},
3119+
journal = {Journal of Political Economy},
30843120
volume = {116},
30853121
number = {2},
30863122
pages = {260--302},
30873123
year = {2008},
3088-
publisher = {The University of Chicago Press}
3124+
publisher = {The University of Chicago Press},
3125+
doi = {10.1086/588200}
30893126
}
30903127

30913128
@article{Hansen_2007,
@@ -3166,7 +3203,9 @@ @article{Townsend1983
31663203
title = {Forecasting the Forecasts of Others},
31673204
journal = {Journal of Political Economy},
31683205
volume = {91},
3169-
pages = {546-588}
3206+
number = {4},
3207+
pages = {546--588},
3208+
doi = {10.1086/261166}
31703209
}
31713210

31723211
@article{tobin1992old,
@@ -3859,3 +3898,179 @@ @article{grossman1976
38593898
pages = {573--585},
38603899
year = {1976}
38613900
}
3901+
3902+
@incollection{BrayKreps1987,
3903+
author = {Bray, Margaret M. and Kreps, David M.},
3904+
title = {Rational Learning and Rational Expectations},
3905+
booktitle = {Arrow and the Ascent of Modern Economic Theory},
3906+
editor = {Feiwel, George R.},
3907+
publisher = {Palgrave Macmillan},
3908+
address = {London},
3909+
year = {1987},
3910+
pages = {597--625},
3911+
doi = {10.1007/978-1-349-07239-2_19}
3912+
}
3913+
3914+
@article{Bray1982,
3915+
author = {Bray, Margaret M.},
3916+
title = {Learning, Estimation, and the Stability of Rational Expectations},
3917+
journal = {Journal of Economic Theory},
3918+
year = {1982},
3919+
volume = {26},
3920+
number = {2},
3921+
pages = {318--339},
3922+
doi = {10.1016/0022-0531(82)90007-2}
3923+
}
3924+
3925+
@article{BraySavin1986,
3926+
author = {Bray, Margaret M. and Savin, N. E.},
3927+
title = {Rational Expectations Equilibria, Learning and Model Specification},
3928+
journal = {Econometrica},
3929+
year = {1986},
3930+
volume = {54},
3931+
number = {5},
3932+
pages = {1129--1160},
3933+
doi = {10.2307/1912325}
3934+
}
3935+
3936+
@article{Radner1979,
3937+
author = {Radner, Roy},
3938+
title = {Rational Expectations Equilibrium: Generic Existence and the Information Revealed by Prices},
3939+
journal = {Econometrica},
3940+
year = {1979},
3941+
volume = {47},
3942+
number = {3},
3943+
pages = {655--678},
3944+
doi = {10.2307/1910413}
3945+
}
3946+
3947+
@article{Jordan1982,
3948+
author = {Jordan, James S.},
3949+
title = {The Generic Existence of Rational Expectations Equilibrium in the Higher Dimensional Case},
3950+
journal = {Journal of Economic Theory},
3951+
year = {1982},
3952+
volume = {26},
3953+
number = {2},
3954+
pages = {224--243},
3955+
doi = {10.1016/0022-0531(82)90002-3}
3956+
}
3957+
3958+
@article{Jordan1982b,
3959+
author = {Jordan, James S.},
3960+
title = {Admissible Market Data Structures: A Complete Characterization},
3961+
journal = {Journal of Economic Theory},
3962+
year = {1982},
3963+
volume = {28},
3964+
number = {1},
3965+
pages = {19--31},
3966+
doi = {10.1016/0022-0531(82)90089-8}
3967+
}
3968+
3969+
@article{Admati1985,
3970+
author = {Admati, Anat R.},
3971+
title = {A Noisy Rational Expectations Equilibrium for Multi-Asset Securities Markets},
3972+
journal = {Econometrica},
3973+
year = {1985},
3974+
volume = {53},
3975+
number = {3},
3976+
pages = {629--657},
3977+
doi = {10.2307/1911659}
3978+
}
3979+
3980+
@article{GrossmanStiglitz1980,
3981+
author = {Grossman, Sanford J. and Stiglitz, Joseph E.},
3982+
title = {On the Impossibility of Informationally Efficient Markets},
3983+
journal = {American Economic Review},
3984+
year = {1980},
3985+
volume = {70},
3986+
number = {3},
3987+
pages = {393--408},
3988+
doi = {10.2307/1805228}
3989+
}
3990+
3991+
@article{AndersonSonnenschein1982,
3992+
author = {Anderson, Robert M. and Sonnenschein, Hugo},
3993+
title = {On the Existence of Rational Expectations Equilibrium},
3994+
journal = {Journal of Economic Theory},
3995+
year = {1982},
3996+
volume = {26},
3997+
number = {2},
3998+
pages = {261--278},
3999+
doi = {10.1016/0022-0531(82)90004-7}
4000+
}
4001+
4002+
@article{BlumeEasley1982,
4003+
author = {Blume, Lawrence E. and Easley, David},
4004+
title = {Learning to be Rational},
4005+
journal = {Journal of Economic Theory},
4006+
year = {1982},
4007+
volume = {26},
4008+
number = {2},
4009+
pages = {340--351},
4010+
doi = {10.1016/0022-0531(82)90008-4}
4011+
}
4012+
4013+
@article{Frydman1982,
4014+
author = {Frydman, Roman},
4015+
title = {Towards an Understanding of Market Processes: Individual Expectations, Learning, and Convergence to Rational Expectations Equilibrium},
4016+
journal = {American Economic Review},
4017+
year = {1982},
4018+
volume = {72},
4019+
number = {4},
4020+
pages = {652--668}
4021+
}
4022+
4023+
@article{Grossman1981,
4024+
author = {Grossman, Sanford J.},
4025+
title = {An Introduction to the Theory of Rational Expectations under Asymmetric Information},
4026+
journal = {Review of Economic Studies},
4027+
year = {1981},
4028+
volume = {48},
4029+
number = {4},
4030+
pages = {541--559},
4031+
doi = {10.2307/2297195}
4032+
}
4033+
4034+
@techreport{ArrowGreen1973,
4035+
author = {Arrow, Kenneth J. and Green, Jerry R.},
4036+
title = {Notes on Expectations Equilibria in Bayesian Settings},
4037+
year = {1973},
4038+
type = {Working Paper},
4039+
number = {33},
4040+
institution = {Institute for Mathematical Studies in the Social Sciences, Stanford University}
4041+
}
4042+
4043+
@article{Kreps1977,
4044+
author = {Kreps, David M.},
4045+
title = {A Note on Fulfilled Expectations Equilibria},
4046+
journal = {Journal of Economic Theory},
4047+
year = {1977},
4048+
volume = {14},
4049+
number = {1},
4050+
pages = {32--43},
4051+
doi = {10.1016/0022-0531(77)90083-7}
4052+
}
4053+
4054+
@article{Breeden1979,
4055+
author = {Breeden, Douglas T.},
4056+
title = {An Intertemporal Asset Pricing Model with Stochastic
4057+
Consumption and Investment Opportunities},
4058+
journal = {Journal of Financial Economics},
4059+
year = {1979},
4060+
volume = {7},
4061+
number = {3},
4062+
pages = {265--296},
4063+
doi = {10.1016/0304-405X(79)90016-3}
4064+
}
4065+
4066+
@book{Nummelin_1984,
4067+
author = {Nummelin, Esa},
4068+
title = {General Irreducible {Markov} Chains and Non-Negative
4069+
Operators},
4070+
series = {Cambridge Tracts in Mathematics},
4071+
number = {83},
4072+
publisher = {Cambridge University Press},
4073+
address = {Cambridge},
4074+
year = {1984},
4075+
doi = {10.1017/CBO9780511526237}
4076+
}

lectures/_toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,11 @@ parts:
142142
- file: ge_arrow
143143
- file: harrison_kreps
144144
- file: morris_learn
145+
- file: rational_learning_re
146+
- file: ls_learning
145147
- file: affine_risk_prices
146148
- file: ross_recovery
149+
- file: long_run_risk_operator
147150
- file: misspecified_recovery
148151
- caption: Data and Empirics
149152
numbered: true

lectures/imp_sample.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,12 @@ We next study the bias and efficiency of the Monte Carlo and importance sampling
264264
The code below produces distributions of estimates using both Monte Carlo and importance sampling methods.
265265

266266
```{code-cell} ipython3
267-
@jit(parallel=True)
268267
def simulate(p_a, p_b, q_a, q_b, N_simu, T=1):
269268
270269
μ_L_p = np.empty(N_simu)
271270
μ_L_q = np.empty(N_simu)
272271
273-
for i in prange(N_simu):
272+
for i in range(N_simu):
274273
μ_L_p[i] = estimate(p_a, p_b, p_a, p_b, T=T)
275274
μ_L_q[i] = estimate(p_a, p_b, q_a, q_b, T=T)
276275

0 commit comments

Comments
 (0)