Skip to content

[Core] AR Deprecated affecting heterogeneity function #43

@ceap29

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    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