Is your feature request related to a problem? Please describe.
The TimeSeriesModel.fit_arch method is currently 95+ lines long with multiple conditional branches, making it difficult to understand, test, and maintain.
Describe the solution you'd like
Extract the model creation logic into separate factory methods:
- Extract GARCH model creation into
_create_garch_model()
- Extract EGARCH model creation into
_create_egarch_model()
- Extract TGARCH model creation into
_create_tgarch_model()
- Extract common parameter validation into
_validate_arch_params()
Describe alternatives you've considered
- Strategy pattern for model creation
- Builder pattern for complex model configurations
Additional context
This refactoring will:
- Improve code readability
- Enable unit testing of individual model creation logic
- Make it easier to add new model types in the future
- Follow the Single Responsibility Principle
Part of codebase quality improvement initiative identified in refactoring analysis.
Is your feature request related to a problem? Please describe.
The
TimeSeriesModel.fit_archmethod is currently 95+ lines long with multiple conditional branches, making it difficult to understand, test, and maintain.Describe the solution you'd like
Extract the model creation logic into separate factory methods:
_create_garch_model()_create_egarch_model()_create_tgarch_model()_validate_arch_params()Describe alternatives you've considered
Additional context
This refactoring will:
Part of codebase quality improvement initiative identified in refactoring analysis.