Skip to content

[ENH] Remove all dependencies on statsmodels #3652

Description

@TonyBagnall

Describe the feature or idea you want to propose

I would like to move all estimators away from statsmodels so we can remove the soft dependency. We are implementing our own versions of forecasters and

AutoCorrelationSeriesTransformer is not currently behavior-identical to statsmodels.acf, so replacements need regression tests rather than direct substitution. Basically involves replacing

Current usage inventory

Direct runtime imports

  • aeon/transformations/collection/_ar_coefficient.py

    • Uses statsmodels.regression.linear_model.burg.
  • aeon/transformations/collection/shapelet_based/_rsast.py

    • Uses statsmodels.tsa.stattools.acf and pacf, including confidence intervals.
  • aeon/transformations/series/_acf.py

    • StatsModelsACF wraps statsmodels.tsa.stattools.acf.
    • StatsModelsPACF wraps statsmodels.tsa.stattools.pacf.
  • aeon/visualisation/series/_series.py

    • plot_correlations uses statsmodels.graphics.tsaplots.plot_acf and plot_pacf.
  • examples/forecasting/iterative.ipynb

    • Directly imports and runs statsmodels.tsa.exponential_smoothing.ets.ETSModel.

Downstream estimators and dependency tags

  • ARCoefficientTransformer
  • RSTSF
  • RSAST
  • RSASTClassifier
  • RISTClassifier
  • RISTRegressor
  • StatsModelsACF
  • StatsModelsPACF

Describe your proposed solution

RIST depends on statsmodels through its default ARCoefficientTransformer. Sorting out AR, ACF and PACF will allow most to go, and also need to reimplement burg, but all this is not too taxing. So to do

  • Implement ARCoefficientTransformer with native code (replace tatsmodels.regression.linear_model.burg), will sort out RIST ad RTSTSF
  • Implement check ACF and implement PACF, will sort out RSAST
  • plot_correlations is more involved, will need to either deprecate it or reimplement native functions

then do all the tidying up related

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature, improvement request or other non-bug code enhancementmaintenanceContinuous integration, unit testing & package distribution

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions