Skip to content
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

Merged
merged 1 commit into from Jul 19, 2016
Merged

Conversation

dmichalowicz
Copy link
Contributor

@dmichalowicz dmichalowicz commented Jun 28, 2016

Opening in favor of #1300

  • Allow correlations/regressions to be computed between two 2D factors by doing computations asset-wise
  • Moves all correlation/regression related tests from test_engine.py to test_statistical.py

@coveralls
Copy link

coveralls commented Jun 28, 2016

Coverage Status

Coverage decreased (-0.03%) to 82.956% when pulling 70a4e6d on sid-to-sid-2 into 43f4c3a on master.

@coveralls
Copy link

coveralls commented Jun 28, 2016

Coverage Status

Coverage increased (+0.03%) to 83.012% when pulling 54f434e on sid-to-sid-2 into c89e957 on master.

@coveralls
Copy link

coveralls commented Jun 28, 2016

Coverage Status

Coverage increased (+0.03%) to 83.014% when pulling 8d4faba on sid-to-sid-2 into c89e957 on master.

@coveralls
Copy link

coveralls commented Jun 29, 2016

Coverage Status

Coverage increased (+0.03%) to 83.014% when pulling 63a7111 on sid-to-sid-2 into c89e957 on master.

@coveralls
Copy link

coveralls commented Jul 5, 2016

Coverage Status

Coverage increased (+0.03%) to 83.031% when pulling 06b7789 on sid-to-sid-2 into 459366c on master.

@coveralls
Copy link

coveralls commented Jul 5, 2016

Coverage Status

Coverage increased (+0.03%) to 83.031% when pulling 761ac81 on sid-to-sid-2 into 459366c on master.

@@ -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),
Copy link
Contributor Author

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

Copy link
Contributor Author

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?

@coveralls
Copy link

coveralls commented Jul 7, 2016

Coverage Status

Coverage increased (+0.03%) to 83.031% when pulling bb7f392 on sid-to-sid-2 into 459366c on master.

@coveralls
Copy link

coveralls commented Jul 13, 2016

Coverage Status

Coverage increased (+0.02%) to 83.025% when pulling def9ec3 on sid-to-sid-2 into 459366c on master.

# 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:
Copy link
Contributor

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.

@coveralls
Copy link

coveralls commented Jul 19, 2016

Coverage Status

Coverage increased (+0.01%) to 83.691% when pulling a8486c5 on sid-to-sid-2 into dffdf0a on master.

@coveralls
Copy link

coveralls commented Jul 19, 2016

Coverage Status

Coverage increased (+0.01%) to 83.691% when pulling a8486c5 on sid-to-sid-2 into dffdf0a on master.

@dmichalowicz dmichalowicz merged commit b364b0f into master Jul 19, 2016
@dmichalowicz dmichalowicz deleted the sid-to-sid-2 branch July 19, 2016 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants