Skip to content

Commit 7ee87d5

Browse files
Morten Taborclaude
andcommitted
Add GETS indicator saturation (SIS/IIS/MIS/TIS) with example notebook
Implements the Autometrics/GETS algorithm for detecting structural breaks via general-to-specific model selection with indicator saturation. New features: - gets_search(): bounded iterative GETS reduction with multi-path search - isat(): indicator saturation with SIS (level shifts), IIS (outliers), MIS (coefficient shifts), TIS (broken trends), and user indicators - Split-half block procedure for large indicator sets - Dual representation: shifts <-> regime levels with SE propagation via the delta method - 3 visualization functions: plot_sis_coefficients, plot_mis_coefficients, plot_regime_levels - .isat() convenience methods on OLS, AR, ADL models - Example notebook 05 demonstrating all features including comparison with Bai-Perron and Markov switching 166 new tests (1069 total), lint clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 71e658f commit 7ee87d5

21 files changed

+5216
-1
lines changed

examples/05_gets_indicator_saturation.ipynb

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

src/regimes/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
CUSUMTest,
5151
DiagnosticsResults,
5252
DiagnosticTestResult,
53+
GETSResults,
5354
MarkovADL,
5455
MarkovADLResults,
5556
MarkovAR,
@@ -82,11 +83,15 @@
8283
RollingOLS,
8384
RollingOLSResults,
8485
RollingResultsBase,
86+
SaturationResults,
8587
SequentialRestrictionResults,
8688
SequentialRestrictionTest,
89+
TerminalModel,
8790
TimeSeriesModelBase,
8891
adl_summary_by_regime,
8992
ar_summary_by_regime,
93+
gets_search,
94+
isat,
9095
plot_actual_fitted,
9196
plot_break_confidence,
9297
plot_breaks,
@@ -95,14 +100,17 @@
95100
plot_diagnostics,
96101
plot_f_sequence,
97102
plot_ic,
103+
plot_mis_coefficients,
98104
plot_parameter_time_series,
99105
plot_params_over_time,
106+
plot_regime_levels,
100107
plot_regime_means,
101108
plot_regime_shading,
102109
plot_residual_acf,
103110
plot_residual_distribution,
104111
plot_rolling_coefficients,
105112
plot_scaled_residuals,
113+
plot_sis_coefficients,
106114
plot_smoothed_probabilities,
107115
plot_transition_matrix,
108116
summary_by_regime,
@@ -128,6 +136,7 @@
128136
"CovType",
129137
"DiagnosticTestResult",
130138
"DiagnosticsResults",
139+
"GETSResults",
131140
"MarkovADL",
132141
"MarkovADLResults",
133142
"MarkovAR",
@@ -160,12 +169,16 @@
160169
"RollingOLS",
161170
"RollingOLSResults",
162171
"RollingResultsBase",
172+
"SaturationResults",
163173
"SequentialRestrictionResults",
164174
"SequentialRestrictionTest",
175+
"TerminalModel",
165176
"TimeSeriesModelBase",
166177
"__version__",
167178
"adl_summary_by_regime",
168179
"ar_summary_by_regime",
180+
"gets_search",
181+
"isat",
169182
"plot_actual_fitted",
170183
"plot_break_confidence",
171184
"plot_breaks",
@@ -174,14 +187,17 @@
174187
"plot_diagnostics",
175188
"plot_f_sequence",
176189
"plot_ic",
190+
"plot_mis_coefficients",
177191
"plot_parameter_time_series",
178192
"plot_params_over_time",
193+
"plot_regime_levels",
179194
"plot_regime_means",
180195
"plot_regime_shading",
181196
"plot_residual_acf",
182197
"plot_residual_distribution",
183198
"plot_rolling_coefficients",
184199
"plot_scaled_residuals",
200+
"plot_sis_coefficients",
185201
"plot_smoothed_probabilities",
186202
"plot_transition_matrix",
187203
"summary_by_regime",

src/regimes/api.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@
44
classes and functions in the regimes package.
55
"""
66

7-
# Models
87
# Diagnostics
98
from regimes.diagnostics import DiagnosticsResults, DiagnosticTestResult
109

10+
# GETS model selection and indicator saturation
11+
from regimes.gets import (
12+
GETSResults,
13+
SaturationResults,
14+
TerminalModel,
15+
gets_search,
16+
isat,
17+
)
18+
1119
# Markov switching models
1220
from regimes.markov import (
1321
MarkovADL,
@@ -104,6 +112,11 @@
104112
plot_smoothed_probabilities,
105113
plot_transition_matrix,
106114
)
115+
from regimes.visualization.gets import (
116+
plot_mis_coefficients,
117+
plot_regime_levels,
118+
plot_sis_coefficients,
119+
)
107120

108121
__all__ = [
109122
"ADL",
@@ -125,6 +138,7 @@
125138
"CovType",
126139
"DiagnosticTestResult",
127140
"DiagnosticsResults",
141+
"GETSResults",
128142
"MarkovADL",
129143
"MarkovADLResults",
130144
"MarkovAR",
@@ -157,11 +171,15 @@
157171
"RollingOLS",
158172
"RollingOLSResults",
159173
"RollingResultsBase",
174+
"SaturationResults",
160175
"SequentialRestrictionResults",
161176
"SequentialRestrictionTest",
177+
"TerminalModel",
162178
"TimeSeriesModelBase",
163179
"adl_summary_by_regime",
164180
"ar_summary_by_regime",
181+
"gets_search",
182+
"isat",
165183
"plot_actual_fitted",
166184
"plot_break_confidence",
167185
"plot_breaks",
@@ -170,14 +188,17 @@
170188
"plot_diagnostics",
171189
"plot_f_sequence",
172190
"plot_ic",
191+
"plot_mis_coefficients",
173192
"plot_parameter_time_series",
174193
"plot_params_over_time",
194+
"plot_regime_levels",
175195
"plot_regime_means",
176196
"plot_regime_shading",
177197
"plot_residual_acf",
178198
"plot_residual_distribution",
179199
"plot_rolling_coefficients",
180200
"plot_scaled_residuals",
201+
"plot_sis_coefficients",
181202
"plot_smoothed_probabilities",
182203
"plot_transition_matrix",
183204
"summary_by_regime",

src/regimes/gets/__init__.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""GETS model selection and indicator saturation.
2+
3+
This subpackage implements the Autometrics algorithm (Doornik, 2009) for
4+
automated general-to-specific model selection, including indicator saturation
5+
for detecting structural breaks.
6+
"""
7+
8+
from regimes.gets.indicators import (
9+
impulse_indicators,
10+
multiplicative_indicators,
11+
step_indicators,
12+
trend_indicators,
13+
)
14+
from regimes.gets.representation import (
15+
ParameterRegime,
16+
RegimeLevelsRepresentation,
17+
ShiftsRepresentation,
18+
levels_to_shifts,
19+
shifts_to_levels,
20+
)
21+
from regimes.gets.results import GETSResults, TerminalModel
22+
from regimes.gets.saturation import SaturationResults, isat
23+
from regimes.gets.selection import gets_search
24+
25+
__all__ = [
26+
"GETSResults",
27+
"ParameterRegime",
28+
"RegimeLevelsRepresentation",
29+
"SaturationResults",
30+
"ShiftsRepresentation",
31+
"TerminalModel",
32+
"gets_search",
33+
"impulse_indicators",
34+
"isat",
35+
"levels_to_shifts",
36+
"multiplicative_indicators",
37+
"shifts_to_levels",
38+
"step_indicators",
39+
"trend_indicators",
40+
]

0 commit comments

Comments
 (0)