I'm encountering the following error when running a full backtest between the dates 2007-04-01 and 2010-05-01:
ValueError: NaN or Inf values provided to FactorExposure for argument 'loadings'.
Rows/Columns with NaNs:
row=Equity(32620 [PFF]) col='momentum'
row=Equity(32620 [PFF]) col='short_term_reversal'
row=Equity(32620 [PFF]) col='size'
row=Equity(32620 [PFF]) col='value'
row=Equity(32620 [PFF]) col='volatility'
Rows/Columns with Infs:
None
There was a runtime error on line 194.
I've copied the algorithm in the getting started tutorial and dropped in my custom alpha factor and a factor for filtering out securities with nans and infs as a mask for it. I've verified that my pipeline output is nan free over the test period via the research interface. In any case the error seems to suggest that it is the Factor values that are causing problems. The 2010-04-01 to 2013-05-01 window works fine without throwing any errors.
Line 194 is : version=opt.Newest
This is within:
factor_risk_constraints = opt.experimental.RiskModelExposure(
context.risk_factor_betas,
version=opt.Newest
)
As a side note I thought Q1500US and QTradableStocksUS excluded etfs (I've reproduced this with both universes as base)?