Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions lectures/_static/lecture_specific/hansen_singleton_1982/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Data — `hansen_singleton_1982`

Vendored input data for the **Hansen–Singleton (1982)** lecture
(`lectures/hansen_singleton_1982.md`).

The lecture reads `hansen_singleton_1982_data.csv` directly from GitHub instead
of querying the data providers while the book builds. This keeps the build
reproducible and removes its dependence on live FRED / Ken French endpoints
(which can be slow, rate-limited, or temporarily unavailable).

## Sources

| Quantity | Provider | Code / dataset |
| --- | --- | --- |
| Civilian noninstitutional population, 16+ | FRED | `CNP16OV` |
| Real PCE: nondurable goods (chain-type quantity index) | FRED | `DNDGRA3M086SBEA` |
| PCE: nondurable goods (chain-type price index) | FRED | `DNDGRG3M086SBEA` |
| Monthly market excess return `Mkt-RF` and risk-free rate `RF` | Ken French data library | `F-F_Research_Data_Factors` |

- FRED — <https://fred.stlouisfed.org/>
- Ken French data library — <https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html>

## Sample

Monthly, **1959-02 to 1978-12** (239 observations), matching the Hansen–Singleton
(1982) ND + VWR sample. One extra prior month is pulled to form the first
in-sample growth rate.

## File: `hansen_singleton_1982_data.csv`

Month-end `date` index plus:

| Column | Definition |
| --- | --- |
| `gross_real_return` | gross real market return, `(1 + (Mkt-RF + RF)/100) / gross_inflation_cons` |
| `gross_cons_growth` | gross growth of per-capita real nondurable consumption |

where `gross_inflation_cons` is the month-over-month gross inflation of the PCE
nondurables price deflator (`DNDGRG3M086SBEA`). It is used to deflate the
nominal return but is not itself a column of this CSV.

## Regenerating

```bash
python make_data.py
```

`make_data.py` needs only the standard library and pandas (both ship with
Anaconda).

> **The committed CSV is a frozen snapshot.** FRED revises historical series and
> the Ken French library is updated over time, so regenerating may produce small
> differences from the committed values. Update the CSV deliberately, in its own
> commit, when you intend to refresh the data.
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
date,gross_real_return,gross_cons_growth
1959-02-28,1.0109579062397553,1.0006229224411516
1959-03-31,1.00571436382525,1.0180902221035215
1959-04-30,1.037975704918033,0.9817704517570749
1959-05-31,1.0206154266958425,1.0184807553981456
1959-06-30,0.997762130888052,0.9958074219092394
1959-07-31,1.0332284787350057,0.993247983171137
1959-08-31,0.9862179047619046,1.001525294171654
1959-09-30,0.9525118058948054,1.00821529850278
1959-10-31,1.0133797259977257,0.9992750451488477
1959-11-30,1.02031276849642,0.9946087169562763
1959-12-31,1.0277770065075922,1.004162246542396
1960-01-31,0.9350211841390549,0.9964357385736891
1960-02-29,1.0144448970724023,0.9893925342902301
1960-03-31,0.9853802764976959,1.0163173699295078
1960-04-30,0.9786453316092882,1.017764785481483
1960-05-31,1.0343458146930415,0.9709179722539227
1960-06-30,1.0234206480133703,1.0085616910776072
1960-07-31,0.9760739799763161,1.0025345810761046
1960-08-31,1.029428143294484,0.99079410331375
1960-09-30,0.9410440365002685,0.996384087876349
1960-10-31,0.9934469213868494,1.008487858402606
1960-11-30,1.044505804453463,0.998696477646169
1960-12-31,1.0473899061533538,0.9853033898833323
1961-01-31,1.0641837217984962,1.0048685493734337
1961-02-28,1.0366024043074953,1.0060859901137909
1961-03-31,1.0330478230674713,1.011079709815748
1961-04-30,1.0092366983309182,0.9981161184493256
1961-05-31,1.0267367533304685,1.0027101407890602
1961-06-30,0.9728199730965832,1.002476272282421
1961-07-31,1.026840189873418,0.9909863637951827
1961-08-31,1.0265493942318,1.0038014943010605
1961-09-30,0.9809888298728473,1.0049599207987134
1961-10-31,1.0289144491593705,1.0005889440900915
1961-11-30,1.045943817810721,1.0078399370066953
1961-12-31,1.0013294402322954,1.0046414973238167
1962-01-31,0.9621478982122725,0.9998486478698215
1962-02-28,1.0156832745349584,0.9968025400551506
1962-03-31,0.9947746099593928,1.0099083657192807
1962-04-30,0.9340541975374449,0.9959690580913071
1962-05-31,0.9170709260741926,1.0038630150586507
1962-06-30,0.9186180622393326,0.9888965939087042
1962-07-31,1.0686570555108608,1.004257045558508
1962-08-31,1.0208077663671373,1.0032008132019383
1962-09-30,0.9390012372442236,1.008872742785775
1962-10-31,1.0046497376093295,0.9902798033248339
1962-11-30,1.1110766885802141,1.0035193294325306
1962-12-31,1.0147671803592304,1.0014352218681717
1963-01-31,1.0481125807476441,1.001428214563085
1963-02-28,0.9775236125072746,0.9915834699129015
1963-03-31,1.036389952762592,1.0078801105544286
1963-04-30,1.0489919005102042,0.9956865775751438
1963-05-31,1.0186465686534685,0.9989658846886131
1963-06-30,0.9784570076658737,1.0050600698980607
1963-07-31,0.9946981519507188,1.000088934489468
1963-08-31,1.0506999422268908,1.008744726271068
1963-09-30,0.9914783159227603,0.9882926288372472
1963-10-31,1.0264046658591814,0.9941407674824702
1963-11-30,0.9918539775115595,1.003306442060827
1963-12-31,1.018524179855361,1.0094163852654314
1964-01-31,1.0219723597618302,0.9969309553486984
1964-02-29,1.0177810463659147,1.0103641242285242
1964-03-31,1.017465629080274,1.0048580805656955
1964-04-30,1.0036379124895571,0.9958384002706671
1964-05-31,1.0183483290622877,1.019303124872573
1964-06-30,1.0136325521920666,0.9989575150840528
1964-07-31,1.0186986244268446,1.0077285243985779
1964-08-31,0.9891215350922932,1.0072981181249718
1964-09-30,1.0265952692867542,0.9906379404291648
1964-10-31,1.008218629539197,1.0047084123320786
1964-11-30,1.0011356879829885,0.9826758836425177
1964-12-31,1.0019410439645797,1.0251178687188183
1965-01-31,1.0370722222222222,0.993420687639879
1965-02-28,1.0080778922304467,1.0098922458637234
1965-03-31,0.9878478595404079,0.9842224236080818
1965-04-30,1.0314834672435103,1.0148702669060463
1965-05-31,0.9920809487139997,1.003708609359037
1965-06-30,0.9392863331299572,0.9867187240607261
1965-07-31,1.0173448223272838,1.0169657327375092
1965-08-31,1.0331209600978442,0.9985898079603674
1965-09-30,1.033437932618683,1.0100855351490021
1965-10-31,1.027159983695929,1.031222998180067
1965-11-30,1.0019237940158763,0.9926644342395888
1965-12-31,1.0088823100303954,1.0031400596884208
1966-01-31,1.0072241849197536,1.0030154325138518
1966-02-28,0.9845428829190056,1.0025556170670897
1966-03-31,0.9742078627020555,1.0005930499735936
1966-04-30,1.021336986573844,1.0087165432532905
1966-05-31,0.9483431557989048,0.9912941713789765
1966-06-30,0.9881211970570689,1.00766318282403
1966-07-31,0.9865624323115901,1.0086434828390984
1966-08-31,0.9182677010360139,0.9885676485039826
1966-09-30,0.9899812192723696,1.0035629859147115
1966-10-31,1.041768339389178,0.9947317349453374
1966-11-30,1.0175501840852192,1.0026958464253002
1966-12-31,1.004757447748013,0.9975934450405057
1967-01-31,1.0866530295590693,1.0048229877833104
1967-02-28,1.0108036808009422,1.0052226050463773
1967-03-31,1.0445689700898777,1.00083279682869
1967-04-30,1.0425608343160377,1.0027883252312702
1967-05-31,0.9585927786499215,0.9969769901187401
1967-06-30,1.0229355226506378,1.0019075616143613
1967-07-31,1.0447114907285733,0.9878937593061994
1967-08-31,0.9903404945454546,1.0053931198406931
1967-09-30,1.0319484760522495,1.0073852460033181
1967-10-31,0.9718775125628141,0.9829686324961886
1967-11-30,1.0035662061329613,1.0089850965808387
1967-12-31,1.033054040792765,1.013531234047572
1968-01-31,0.9586732832463992,0.996618192741401
1968-02-29,0.9626763822688275,1.0034102821507809
1968-03-31,1.0037470630202143,1.0144003772849155
1968-04-30,1.0909715308396148,0.9927375972057049
1968-05-31,1.0231285188158084,1.0023733703506579
1968-06-30,1.0090607132761706,1.0117684709448878
1968-07-31,0.9751435403551628,1.007210916081518
1968-08-31,1.0130833933498575,0.9997056149271085
1968-09-30,1.0421195260751936,0.9885652798055251
1968-10-31,1.003737031191979,1.0001906700265046
1968-11-30,1.055511409395973,1.0121418411010206
1968-12-31,0.964018356683775,0.9850571280382645
1969-01-31,0.9889133014001473,1.0082139433036967
1969-02-28,0.9453468955677268,1.0078666002342456
1969-03-31,1.0268519363857187,0.9975673833773808
1969-04-30,1.014136540126692,0.9971018638456864
1969-05-31,1.0000262257127293,1.0075298934862833
1969-06-30,0.9260949497679867,0.9851917552258751
1969-07-31,0.9311470263724436,1.0048978054068127
1969-08-31,1.0496402792696027,1.0091713231994486
1969-09-30,0.9718027792624265,0.9878632302339346
1969-10-31,1.0556596297614809,1.0120173869077764
1969-11-30,0.9618071687759981,0.9932846657059041
1969-12-31,0.9741939652518143,0.9985286940605688
1970-01-31,0.9212316015419659,1.0112022620493186
1970-02-28,1.0529872993719471,0.9918189353702483
1970-03-31,0.9953170527417878,1.0027697854897362
1970-04-30,0.8890496685298322,0.9902986375379047
1970-05-31,0.9343163135593221,1.0069967730099987
1970-06-30,0.9469810955590116,1.0000796481595717
1970-07-31,1.0708379418729819,0.9970257158016894
1970-08-31,1.0493963217896323,1.0008126665645092
1970-09-30,1.0423570419218087,1.0046092184891302
1970-10-31,0.9778801100260139,0.9975297864731273
1970-11-30,1.0499492585648544,1.0011273292953267
1970-12-31,1.058937765120925,1.0124788876843573
1971-01-31,1.0539815499254845,0.9951243762978286
1971-02-28,1.0165775612661676,0.9985130749361691
1971-03-31,1.0412760627916844,0.9873714034196678
1971-04-30,1.0299738476488232,1.0083586571050156
1971-05-31,0.9593924993686338,0.9932845622433929
1971-06-30,0.9981365955842305,1.0051700066447553
1971-07-31,0.9584173951268526,0.991440910682584
1971-08-31,1.0379071267816953,0.998618699830775
1971-09-30,0.9932372145263945,1.002297245019121
1971-10-31,0.9581448303078138,0.9943196841276655
1971-11-30,0.9981049217744947,1.0085871519718006
1971-12-31,1.0857983972240584,1.0000851203496202
1972-01-31,1.0239623281468675,0.9795919590714202
1972-02-29,1.0249978642445072,1.0057831401155264
1972-03-31,1.0092303401137805,1.0176466007666984
1972-04-30,1.0062942303754965,1.002537882028125
1972-05-31,1.014321677092277,1.0090974304940825
1972-06-30,0.978640011448197,0.9979709716441202
1972-07-31,0.9909672557003257,1.0044556152379327
1972-08-31,1.0329503309913495,1.0019206535386223
1972-09-30,0.9847214674460794,1.0030088650530669
1972-10-31,1.0067647697566862,1.015012111236451
1972-11-30,1.0463335538184007,0.9957679937499486
1972-12-31,1.0065508830110277,0.9976564431715872
1973-01-31,0.9646849504165014,1.0054534426599542
1973-02-28,0.9472085626670861,1.0029914982298926
1973-03-31,0.9779890500193873,0.989248586225157
1973-04-30,0.9384658711583471,0.9942346637985785
1973-05-31,0.9691159728575784,0.9965352430069263
1973-06-30,0.9814309245604084,1.0019997690857858
1973-07-31,1.0551640866873064,1.017181918623719
1973-08-31,0.9462215797625194,0.9667306001463677
1973-09-30,1.0534230820252044,1.0144124866136586
1973-10-31,0.9898111517100264,0.9934181638693607
1973-11-30,0.8654669068376685,1.0037280242950093
1973-12-31,1.0000506584098514,0.9908907468835305
1974-01-31,0.9875830190659436,0.9956525119112044
1974-02-28,0.98031451668151,0.9910821959505793
1974-03-31,0.9595848668280871,0.9896974308812007
1974-04-30,0.9478784373956594,1.0007275502562654
1974-05-31,0.9495931537598203,0.9973613030939844
1974-06-30,0.97195321299639,0.9975897053862942
1974-07-31,0.9204789669340637,1.004966234283919
1974-08-31,0.8991692737968946,0.9973952658120752
1974-09-30,0.8792332560723923,0.989318272633984
1974-10-31,1.1588045494699646,0.9969716375104358
1974-11-30,0.9518714294651237,0.9898766288310575
1974-12-31,0.9642454181784351,0.9845061814135657
1975-01-31,1.1373505850029328,1.0081651656309403
1975-02-28,1.0579404276954363,1.001536828811441
1975-03-31,1.0313355872105572,1.0052761564076116
1975-04-30,1.0471811753817677,0.9935362730578393
1975-05-31,1.0539289649441383,1.0331915679240886
1975-06-30,1.0453038992788168,0.993308307847106
1975-07-31,0.9271832920866783,0.9969921925239672
1975-08-31,0.9711535316543092,1.0035698292820647
1975-09-30,0.9614013160261409,0.9952147892289859
1975-10-31,1.0520194918535728,0.9890868041021199
1975-11-30,1.0265333709131903,1.0073759465907024
1975-12-31,0.9857875950190781,1.0021354245060932
1976-01-31,1.1243044882773283,1.0142100453652187
1976-02-29,1.0109178776914407,0.994119885230983
1976-03-31,1.0298266412940058,1.0037780407827317
1976-04-30,0.9905959747528877,1.011408985199085
1976-05-31,0.9858094425180048,0.9915899111107992
1976-06-30,1.0405823588441898,1.0134757714559979
1976-07-31,0.9903584962803963,0.995576046841543
1976-08-31,0.994202673029629,1.0020517454497475
1976-09-30,1.0206372806250363,0.9993560142074526
1976-10-31,0.9753222238342569,1.0053898361696996
1976-11-30,1.0035523611351946,0.9967222024565706
1976-12-31,1.0565306057814117,1.007819656591786
1977-01-31,0.9587727991746904,0.9968859272175131
1977-02-28,0.9716811046347121,0.9941048911407744
1977-03-31,0.9870324205420342,0.993808284687326
1977-04-30,0.9989612347270488,1.004466953570016
1977-05-31,0.9835700231320196,0.9990643544993814
1977-06-30,1.0456919101746605,0.9926203877235478
1977-07-31,0.9846248341074982,1.008972476016858
1977-08-31,0.9840791441491121,0.9936099082340789
1977-09-30,1.0002761537614275,1.0019378571638178
1977-10-31,0.9572044980800877,1.013567427204734
1977-11-30,1.0379116837832683,1.0100645126409113
1977-12-31,1.0035811916648578,0.9924702747962896
1978-01-31,0.9407902963503254,0.9909629361948763
1978-02-28,0.9886968052410225,1.0131171043457206
1978-03-31,1.0258074850860062,1.0061359586059442
1978-04-30,1.074129084499576,0.9917395346788931
1978-05-31,1.013486002469071,1.0049967361563237
1978-06-30,0.9808226302483777,0.9998135892775268
1978-07-31,1.0521110326933056,0.9959300072415749
1978-08-31,1.0400536933581626,1.0033159988277387
1978-09-30,0.9873057466529351,1.0104543799417738
1978-10-31,0.8813554851242205,0.9911387220819502
1978-11-30,1.0281085688148,1.009087222697169
1978-12-31,1.0113599312297732,1.0089199884598332
Loading
Loading