That core of CAPM is distinguishing between stock returns that derive from broad market movements and those that do not.
For example, if we consider ExxonMobil (ticker symbol XOM) and the index S&P 500 (ticker symbol SPX) we can fit a regression line through the scatter plot of the daily returns of XOM and SPX to find the linear equation that best captures its pattern, i.e.
$Return (XOM) = beta*Return(SPX)+alpha$
where alpha is the Y-intercept of the regression line, and beta is its slope.
We can interpret these alphas and betas as follows:
Same return decomposition can be applied to portfolios instead of a single stock and fund manager can derive return from beta and alpha. When returns are based primarily on an upward general market we call this buying beta. On the other hand, returns resulting from investment skill are known as seeking alpha. Hence, CAPM allows the most basic disaggregation of an investment’s performance into two parts:
Hedge funds are so called because the first hedge fund, Albert Winslow Jones’ fund formed in 1949, strove for absolute positive returns through hedging, i.e. making contrary bets that would pay off if their main bet failed. These hedges would at a minimum reduce losses, and in the best case could produce absolute positive returns (i.e., returns above zero even if the general market direction was downward). In exchange, these hedges posed a drag on returns when the market headed upward.
Typically, hedge funds are looking for portfolio allocation with
Alphalens is a Python Library for performance analysis of predictive (alpha) stock factors. Here we evaluate two possible factors:
In [3]:
from quantopian.pipeline import Pipeline
from quantopian.research import run_pipeline
from quantopian.pipeline.filters.morningstar import Q1500US
from quantopian.pipeline.data.sentdex import sentiment
from quantopian.pipeline.data.morningstar import asset_classification
from quantopian.pipeline.data.morningstar import operation_ratios
import alphalens
In [2]:
def make_pipeline():
testing_factor = operation_ratios.revenue_growth.latest
universe = (Q1500US() & testing_factor.notnull())
testing_factor = testing_factor.rank(mask=universe,method='average')
pipe = Pipeline(columns={'testing_factor':testing_factor},screen=universe)
return pipe
In [3]:
result = run_pipeline(make_pipeline(),start_date='2015-01-01',end_date='2016-01-01')
In [4]:
type(result)
Out[4]:
In [5]:
result.head()
Out[5]:
In [6]:
assets = result.index.levels[1].unique()
pricing = get_pricing(assets,start_date='2015-01-01',end_date='2016-01-01')
In [7]:
len(assets)
Out[7]:
In [8]:
alphalens.tears.create_factor_tear_sheet(factor=result['testing_factor'],
prices=pricing['open_price'],
quantiles=2,
periods=(3,10,30))
In [1]:
def make_pipeline():
testing_factor = operation_ratios.operation_margin.latest
universe = (Q1500US() & testing_factor.notnull())
testing_factor = testing_factor.rank(mask=universe,method='average')
pipe = Pipeline(columns={'testing_factor':testing_factor},screen=universe)
return pipe
In [4]:
result = run_pipeline(make_pipeline(),start_date='2015-01-01',end_date='2016-01-01')
In [5]:
assets = result.index.levels[1].unique()
pricing = get_pricing(assets,start_date='2015-01-01',end_date='2016-01-01')
In [6]:
alphalens.tears.create_factor_tear_sheet(factor=result['testing_factor'],
prices=pricing['open_price'],
quantiles=2,
periods=(3,10,30))
In [ ]: