Factor Modeling

Cross-sectional equity modeling

Max Margenot

Lead - Data Science at Quantopian

This presentation is for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation for any security; nor does it constitute an offer to provide investment advisory or other services by Quantopian, Inc. ("Quantopian"). Nothing contained herein constitutes investment advice or offers any opinion with respect to the suitability of any security, and any views expressed herein should not be taken as advice to buy, sell, or hold any security or as an endorsement of any security or company. In preparing the information contained herein, Quantopian, Inc. has not taken into account the investment needs, objectives, and financial circumstances of any particular investor. Any views expressed and data illustrated herein were prepared based upon information, believed to be reliable, available to Quantopian, Inc. at the time of publication. Quantopian makes no guarantees as to their accuracy or completeness. All information is subject to change and may quickly become unreliable for various reasons, including changes in market conditions or economic circumstances.

Background

  • Me

What is a Factor?

Some value assigned to a security in a universe.

They come in two flavors, Alpha and Risk.

Popularity of Factor Models

"Smart Beta" Portfolios

  • 87% of institutional investors incorporating factors into investment process*

  • 67% of into risk management process*

  • 53% of into investment strategies*

*"The rise of factor investing." BlackRock. 7 Apr. 2017

Goals of Factor Models

Diversify with specific premia.

Analyze risk.

Increase returns.

Common Factor Portfolios

Most factors fall into one of five categories:

  • Value

  • Momentum

  • Quality

  • Volatility

  • Growth

Portfolio Construction

Cross-Sectional Equity:

  • Rank all securities in your universe from lowest factor exposure to highest.

  • Go long on the top percentile.

  • Go short on the bottom percentile.

Cross-sectional equity modeling

The Universe

Sufficient liquidity.

No "hard-to-trade" securities.

Example Factor: Momentum

In [ ]:
class Momentum(CustomFactor):
    """ Momentum factor """
    inputs = [USEquityPricing.close,
              Returns(window_length=126)]
    window_length = 252

    def compute(self, today, assets, out, prices, returns):
        out[:] = ((prices[-21] - prices[-252])/prices[-252] -
                  (prices[-1] - prices[-21])/prices[-21]) / np.nanstd(returns, axis=0)

Example Factor: Momentum

Mean returns by quantile for Momentum

Example Factor: Momentum

Cumulative returns by quantile for Momentum

Example Factor: Momentum

Cumulative returns for momentum

Why Use This Method?

Predicting prices is hard.

With factor modeling, we capture the relative value of the long and short baskets.

Key implied assumption is that the expected return of each security is proportional to its factor value.

The Quant Workflow

Quant Equity Workflow

Alpha and Risk

Typical form of constructing any sort of factor portfolio.

How do we distinguish between Alpha and Risk?

Portfolio Diversification

Company-level risks disappear, but larger common factors remain.

We can define these common factors however we like.

Capital Asset Pricing Model

Uses the market at large as a single common risk factor:

$$ r_p = \alpha + \beta_{m} r_{m} $$

Fama-French Factors

Add additional common factors to the base CAPM:

$$ r_p = \alpha + \beta_{m} r_{m} + \beta_{hml} r_{hml} + \beta_{smb} r_{smb} $$

General Factors

We can extend this as far as we want:

$$ r_p = \alpha + \beta_0 r_0 + \cdots + \beta_n r_n $$

Quantopian Risk Model

Quantopian 16-factor risk model

Sectors

Quantopian sector exposures

Styles

Quantopian style exposures

Performance Attribution

Returns split into common and specific returns

Alpha

Alpha is what remains after you have removed all common factor risk.

It can only be defined in terms of what you don't want.

Finding Alpha

A very difficult problem.

To find a reliable source of alpha, you must have a clearly defined set of common factor risks.

Alpha decays.

Twitter

@clean_utensils

Github

@mmargenot

Quantopian

max@quantopian.com

Enter the Quantopian Daily Contest at www.quantopian.com/contest

This presentation is for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation for any security; nor does it constitute an offer to provide investment advisory or other services by Quantopian, Inc. ("Quantopian"). Nothing contained herein constitutes investment advice or offers any opinion with respect to the suitability of any security, and any views expressed herein should not be taken as advice to buy, sell, or hold any security or as an endorsement of any security or company. In preparing the information contained herein, Quantopian, Inc. has not taken into account the investment needs, objectives, and financial circumstances of any particular investor. Any views expressed and data illustrated herein were prepared based upon information, believed to be reliable, available to Quantopian, Inc. at the time of publication. Quantopian makes no guarantees as to their accuracy or completeness. All information is subject to change and may quickly become unreliable for various reasons, including changes in market conditions or economic circumstances.