Arbitrage Pricing Theory Model with R

Last Update: December 15, 2020

Asset pricing models consist of estimating asset expected return through its expected risk premium linear relationship with factors portfolios expected risk premiums and macroeconomic factors.

This topic is part of Investment Portfolio Analysis with R course. Feel free to take a look at Course Curriculum.

This tutorial has an educational and informational purpose and doesn’t constitute any type of trading or investment advice. All content, including code and data, is presented for personal educational use exclusively and with no guarantee of exactness of completeness. Past performance doesn’t guarantee future results. Please read full Disclaimer.

An example of asset pricing models is arbitrage pricing theory APT [1] which consists of estimating asset expected return through its expected risk premium linear relationship with market portfolio expected risk premium and macroeconomic factors.

1. Formula notation.

1.1. Arbitrage pricing theory APT asset risk premium formula notation.

• Note: macroeconomic factor not fixed and only included for educational purposes.

$r_{a,t}-r_{f,t}=\alpha_{a}+\beta1(r_{m,t}-r_{f,t})+\beta2(\Delta&space;CPI_{t})+e_{t}$

Where $r_{a,t}-r_{f,t}$ = asset realized risk premiums, $r_{a,t}$ = asset realized returns, $r_{f,t}$ = realized risk free returns, $\alpha_{a}$ = asset average realized excess return, $\beta1$ = asset market beta coefficient, $r_{m,t}-r_{f,t}$ = market realized risk premiums, $r_{m,t}$ = market realized returns, $\beta2$ = asset macroeconomic factor beta coefficient, $\Delta&space;CPI_{t}$ = realized consumer price index percentage changes macroeconomic factor, $e_{t}$ = linear regression residuals or forecasting errors.

1.2. Arbitrage pricing theory APT model formula notation.

• Note: APT formula recasting using expected returns (ex-ante) instead of average realized returns (ex-post). For full reference, please read The Arbitrage Theory of Capital Asset Pricing [1].

$E(r_{a})=E(r_{f})+\beta1(E(r_{m})-E(r_{f}))+\beta2(E(\Delta&space;CPI))$

Where $E(r_{a})$ = asset expected return, $E(r_{f})$ = expected risk-free return, $\beta1$ = asset market beta coefficient, $E(r_{m})-E(r_{f})$ = market expected risk premium, $E(r_{m})$ = market expected return, $\beta2$ = asset macroeconomic factor beta coefficient, $E(\Delta&space;CPI)$ = expected percentage change in consumer price index macroeconomic factor.

2. R script code example.

library('xts')

2.2. APT multiple factors model data reading.

• Data: S&P 500® index replicating ETF (ticker symbol: SPY) adjusted close prices and market portfolio [3] monthly arithmetic returns risk premiums, U.S. consumer price index monthly arithmetic change (2007-2016).
data <- read.csv("APT-Multiple-Factors-Model-Data.txt",header=T)
data <- xts(data[,2:4],order.by=as.Date(data[,1]))


2.3. APT multiple factors model multiple linear regression calculation and output.

In:
summary(lm(data$SPY.RF~data$MKT.RF+data$CPI))  Out: Call: lm(formula = data$SPY.RF ~ data$MKT.RF + data$CPI)

Residuals:
Min         1Q     Median         3Q        Max
-0.0102618 -0.0027180 -0.0003804  0.0026426  0.0101587

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)  4.202e-05  3.976e-04   0.106    0.916
data$MKT.RF 9.715e-01 8.036e-03 120.892 <2e-16 *** data$CPI    -1.420e-01  1.144e-01  -1.241    0.217
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.003938 on 117 degrees of freedom
Multiple R-squared:  0.9922,	Adjusted R-squared:  0.992
F-statistic:  7425 on 2 and 117 DF,  p-value: < 2.2e-16

3. References

[1] Stephen Ross. “The Arbitrage Theory of Capital Asset Pricing”. Journal of Economic Theory. 1976.

[2] Jeffrey A. Ryan and Joshua M. Ulrich. “xts: eXtensible Time Series”. R package version 0.12.1. 2020

[3] Eugene F. Fama and Kenneth F. French. “Common Risk Factors in the Returns on Stocks and Bonds,” Journal of Financial Economics. 1993.