Skip to content

[Core] AR Deprecated affecting heterogeneity function #43

Description

@ceap29

What happened + What you expected to happen

The heterogeneity function is currently broken. The function returns NaN values for all outputs (arch_acf, garch_acf, arch_r2, garch_r2).
Root Cause:
The function uses statsmodels.tsa.ar_model.AR, which was deprecated and then removed in statsmodels 0.14.0. It has been replaced with statsmodels.tsa.ar_model.AutoReg with a different API.

Current behavior:

from tsfeatures import heterogeneity
import numpy as np

data = np.random.randn(500)
result = heterogeneity(data)
# Returns: {'arch_acf': nan, 'garch_acf': nan, 'arch_r2': nan, 'garch_r2': nan}

Versions / Dependencies

Python3.11
macOS: 15.4.1
tsfeatures: 0.4.5

Reproduction script

Current behavior:

from tsfeatures import heterogeneity
import numpy as np

data = np.random.randn(500)
result = heterogeneity(data)
# Returns: {'arch_acf': nan, 'garch_acf': nan, 'arch_r2': nan, 'garch_r2': nan}

Issue Severity

High: It blocks me from completing my task.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions