Hello,
what could be the good way to calculate the correlation between two quantities in the quantopian pipeline ?
I was trying
class PriceFactCorr(CustomFactor):
inputs = [alphaone.article_sentiment, USEquityPricing.open]
window_length = 100
def compute(self, today, assets, out, sentiment, open_price):
out[:] = np.corrcoef(sentiment, open_price)[0, 1]
but it gives all Nans
Equity(693 [AZO]) NaN
Equity(1374 [CDE]) NaN
Equity(1582 [CL]) NaN
......
Did someone found a good solutions?
Thanks
Francesco