Skip to content

NotImplementedError: AR has been removed from statsmodels #25

@nrcjea001

Description

@nrcjea001

In the heterogeneity function, "AR" function is being used but this has now been replaced with statsmodels.tsa.ar_model.AutoReg. Thanks to update

I'm no expert but I have suggested fix as follows:

from statsmodels.tsa.ar_model import AutoReg
...
    try:
        x_whitened = AutoReg(x, lags=order_ar, trend='c').fit().resid
    except:
        try:
            x_whitened = AutoReg(x, lags=order_ar, trend='n').fit().resid
        except:
            output = {
                'arch_acf': np.nan,
                'garch_acf': np.nan,
                'arch_r2': np.nan,
                'garch_r2': np.nan
            }

            return output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions