Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
ARMA problem

I've used exactly the same code in both research and algorithms, but in algorithms, it doesn't work for ARMA function.

           from statsmodels.tsa.arima_model import ARMA 

            degree = {}  
            for x in range(0,5):  
                for y in range(0,5):  
                    try:  
                        arma = ARMA(result, (x,y)).fit()  
                        degree[str(x) + str(y)] = arma.bic  
                    except:  
                        continue  
            dic= sorted(degree.iteritems(), key = lambda d:d[1])  
            p = int(dic[0][0][0])  
            q = int(dic[0][0][1])  

In the algorithms environment, it produced an error "Something went wrong. Sorry for the inconvenience. Try using the built-in debugger to analyze your code. If you would like help, send us an email.". However, in research, it worked well. Anyone can tell me why?? Thanks

7 responses

ARMA model is not enabled in both research and algorith ...

I've tried on research, it did work on my side. However, I don't understand why ARMA model is not enabled. It's a useful model...

I have the same issue. Any news from Q on support for this. I would think support for time series analysis is a must for algorithm implementation.

Are you sure it's not just their "pre-execution compilation" crashing the code with null data or something? Sometimes I have to add anif not data[context.spy]: pass or something similar, so that complicated code doesn't get exercised until we are actually running the backtest.

Thank you for identifying this bug! I've taken a look into the issue, and ARMA modeling is enabled in Research and the Algorithm IDE. However, calling the .fit() ARMA function does indeed trigger an error as you mentioned. I can see the error on the backend - it's deep in the FORTRAN bindings. I have made our engineers aware of the problem. Unfortunately, I haven't been able to find a workaround.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

I am having the same problem with the Algorithm IDE. Any news on fixing this bug?

Hey guys,

We have a workaround for this problem! If you call the .fit() function passing disp=0 to it, you will avoid this error message.

So it will look like arma = ARMA(result, (x,y)).fit(disp=0). Let me know if this still gives you problems!