Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Runtime Error During Backtest

Hi all,

I've formulated my own factor which looks quite promising to me (Risk adjusted IC 0.17 - 0.18 (1d -5d) , with annual alpha 0.083 - 0.057 (1d - 5d)) and I'd like to dig deeper into its potential value. Going further with the analysis I've taken the Long-Short Equity Algo from the Lecture Sample (I think lecture 37).

After building the algo and running for the first 5 months (starting on 01/01/2007), the algo stops due to runtime error on line 282:

 # Add the RiskModelExposure constraint to make use of the  
    # default risk model constraints  
    neutralize_risk_factors = opt.experimental.RiskModelExposure(  
        risk_model_loadings=risk_loadings,  
        version=0  

With the error saying:

ValueError: NaN or Inf values provided to FactorExposure for argument 'loadings'.  
Rows/Columns with NaNs:  
row=Equity(33655 [HYG]) col='momentum'  
row=Equity(33655 [HYG]) col='short_term_reversal'  
row=Equity(33655 [HYG]) col='size'  
row=Equity(33655 [HYG]) col='value'  
row=Equity(33655 [HYG]) col='volatility'  
Rows/Columns with Infs:  
None  
There was a runtime error on line 282.  

Any first guesses why this error pops up? I'm using the factset estimates dataset in the algo.

Thanks for your help!

Best Regards,
John