Hi, I'm trying to build a modified regression, but am having issues due to quantopian's security setup. Basically I thought I can lift the code from http://www.zipline.io/_modules/zipline/pipeline/factors/statistical.html#RollingLinearRegression, paste it into my file (using the proper imports), and then perform the desired modifications on the function
def regress(y, x):
regr_results = linregress(y=y, x=x)
# `linregress` returns its results in the following order:
# slope, intercept, r-value, p-value, stderr
alpha[i] = regr_results[1]
beta[i] = regr_results[0]
r_value[i] = regr_results[2]
p_value[i] = regr_results[3]
stderr[i] = regr_results[4]
However I cannot import the modules used, nor can I call the method super
. How should I go about this?
Basically what I am trying to do is design a CostumFactor
which will also give me the price data for sid(8554) (SPY) for the desired window length... how can I do this?