New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Factor-to-factor correlations and regressions #1307
Conversation
70a4e6d
to
54f434e
Compare
8d4faba
to
63a7111
Compare
63a7111
to
06b7789
Compare
@@ -626,7 +632,9 @@ def rank(self, method='ordinal', ascending=True, mask=NotSpecified): | |||
return Rank(self, method=method, ascending=ascending, mask=mask) | |||
|
|||
@expect_types( | |||
target=Slice, correlation_length=int, mask=(Filter, NotSpecifiedType), | |||
target=(FactorProxy, LoadableTerm, Slice), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to fix: If the wrong type of term is given here, expect_types
says something like "this parameter was expected to be of type FactorProxy or..." which is confusing since we actually mean Factor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, thinking this should be BoundColumn
instead of LoadableTerm
?
# spearmanr returns the R-value and the P-value. | ||
out[i] = spearmanr(factor_data[:, i], slice_data_column)[0] | ||
def compute(self, today, assets, out, base_data, target_data): | ||
if target_data.shape[1] > 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaner here might be:
target_date = np.broadcast_to(target_data, base_data.shape)
for i in range(len(out)):
...
The same pattern could be used pretty much everywhere in this file.
c9058e8
to
0df579d
Compare
0df579d
to
a8486c5
Compare
Opening in favor of #1300
test_engine.py
totest_statistical.py