Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedError: AR has been removed from statsmodels #25

Open
nrcjea001 opened this issue May 18, 2023 · 0 comments
Open

NotImplementedError: AR has been removed from statsmodels #25

nrcjea001 opened this issue May 18, 2023 · 0 comments

Comments

@nrcjea001
Copy link

nrcjea001 commented May 18, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant