Skip to content

Commit df1dfac

Browse files
docs(timeseries): document lpirfs_cholesky in agent card + reference
Surfaces the new identification='lpirfs_cholesky' path in the local_projections agent card (assumption, pre-condition, and the horizon-0-zero Cholesky-ordering failure mode) and fixes the reference example to the real signature (outcome=, horizons int, auto_lag) plus a unit-Cholesky-shock snippet. Pairs with the local_projections feature. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 585e2e7 commit df1dfac

2 files changed

Lines changed: 27 additions & 4 deletions

File tree

docs/reference/timeseries.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,18 @@ sp.cointegration(..., method='phillips_ouliaris')
4848

4949
```python
5050
sp.local_projections(
51-
df, y='gdp', shock='mp_shock',
52-
horizons=range(0, 21),
53-
controls=['infl_lag','r_lag'],
54-
se='driscoll_kraay', # HAC-panel SE
51+
df, outcome='gdp', shock='mp_shock',
52+
horizons=20,
53+
controls=['infl_lag', 'r_lag'],
54+
auto_lag=False, # controls are used verbatim
55+
)
56+
57+
# Match lpirfs::lp_lin with a unit Cholesky shock.
58+
sp.local_projections(
59+
df, outcome='gdp', shock='mp_shock',
60+
horizons=20,
61+
identification='lpirfs_cholesky',
62+
endog_order=['gdp', 'mp_shock'],
5563
)
5664
```
5765

src/statspai/_agent_cards_extra.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,10 +1867,16 @@
18671867
"Controls are passed at their time-t values verbatim "
18681868
"— lag them yourself; the estimator does not re-lag "
18691869
"them",
1870+
"For identification='lpirfs_cholesky', the endogenous "
1871+
"variable order defines the recursive structural shock, "
1872+
"matching lpirfs::lp_lin with shock_type=1",
18701873
],
18711874
"pre_conditions": [
18721875
"Single time-ordered series in a DataFrame with "
18731876
"the outcome and shock columns",
1877+
"For identification='lpirfs_cholesky', endog_order "
1878+
"contains the outcome and shock columns in the intended "
1879+
"Cholesky ordering",
18741880
"Length comfortably exceeds horizons + max lag so "
18751881
"the deepest horizon regression retains enough "
18761882
"usable rows",
@@ -1888,6 +1894,15 @@
18881894
"columns are not formed",
18891895
"alternative": "var",
18901896
},
1897+
{
1898+
"symptom": "The horizon-0 response is zero when the "
1899+
"shock is ordered after the response variable",
1900+
"exception": "(none — Cholesky ordering convention)",
1901+
"remedy": "Use the intended endog_order, or switch "
1902+
"back to identification='direct' if the shock column "
1903+
"is already externally identified",
1904+
"alternative": "var",
1905+
},
18911906
{
18921907
"symptom": "Series too short: the "
18931908
"longest-horizon regression has "

0 commit comments

Comments
 (0)