Back to Community
how to use Alphalens with economic indicators data

Is there any code examples how to use Alphalens with macroeconomic indicators or with custom factors in self service data which are not linked to a specific equity ticker?

2 responses

Alphalens is designed to provide insight into the predictive value of a 'factor'. Specifically, the predictive value in determining forward returns of a portfolio of equities. The factor being analyzed needs to output a series with a numerical value associated with each equity. This value is interpreted as the 'dollar weight' which the equity has in the portfolio. All the Alphalens statistics for information content, returns, turnover, etc, are centered on the resulting portfolio of equities. It's really trying to give insight into how well a portfolio would perform if it were driven by this single factor.

So, the question "how to use Alphalens with macroeconomic indicators or with custom factors in self service data which are not linked to a specific equity ticker"... By definition Alphalens expects a factor which associates values to equities. The returns on those equities, weighted by the factor values, are what Alphalens uses to analyze the factor. The mapping is significant because it uses the returns on those associated equities. If one had a macro indicator and mapped it to SPY one would get different results then if it was mapped to APPL. Because of this, Alphalens cannot really be used like that.

However, what is the goal? What question was Alphalens expected to answer? Perhaps there are other tools which could help.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Dan, the idea is to find if a stock or group of stocks is sensitive to a selected factor as well as a lag sensitivity. For example, some stocks are interest sensitive and other not so it would be interesting to see how each factor affects different stocks returns and time of the cause - effect relationship.