Comments (3)
This idea makes complete sense to me. The way we are currently doing it is with a pandas timerule, I'm kind of debating whether we want to eschew pandas timerules all together in the package, and just focus on a number of periods analysis. Right now there is kind of a mix, not sure how i feel about that
from alphalens.
The current rule used by the tear sheet is time_rule='D'. That means it works fine If we pass daily factors/data to the tear sheet (because it won't do any resampling at all) but it will result in surprising graph if we pass minutely/weekly (anything that is not daily) data.
It seems to me it would make sense to make the resampling an option (used only by aware users) and let the code that follows the resampling decides the autocorrelation period:
In factor_rank_autocorrelation function:
autocorr = asset_factor_rank.corrwith(asset_factor_rank.shift(1), axis=1)
shift(1) should be changed to shift(period) where period becomes a function argument. In this way the feature is available when calling the function directly (at least). Later it can be decided how to enable this option via tear sheet (probably via tear sheet function argument or simply calling factor_rank_autocorrelation for each day/period)
from alphalens.
That sounds good I'd go ahead and submit a PR.
from alphalens.
Related Issues (20)
- freq error: freq must be Day, BDay or CustomBusinessDay HOT 1
- How can I build my confidence that my strategy returns better HOT 1
- ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'' HOT 6
- cumulative_returns calculation no longer adjusts for periods > 1?
- When I use "bins" instead of "quantiles", it went wrong
- UnboundLocalError: local variable 'period_len' referenced before assignment HOT 1
- Problem:create_event_returns_tear_sheet
- Dropped 45.5% entries from factor data: 45.5% in forward returns computation and 0.0% in binning phase (set max_loss=0 to see potentially suppressed Exceptions)
- Anyone can explain how the factors are bined? HOT 2
- Alphalens
- MissingDataError: exog contains inf or nans HOT 2
- importing alphalens 0.3.6 gets error "No module named 'pandas.util._decorators'" HOT 1
- AttributeError: 'Int64Index' object has no attribute 'tz' HOT 2
- Is alphalens still used? HOT 1
- got error: Error: No such keys(s): 'mode.use_inf_as_null'
- data = al.utils.get_clean_factor_and_forward_returns(cs_df.stack(), pricing, quantiles=5, bins=None, periods=[1])
- Unable to work with pyfolio integration
- invalid index to scalar variable @ mode(days_diffs).mode[0] HOT 11
- cant install alphalens from pip because of outdated configparser method call
- STOP USING WRITING READING
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alphalens.