Factor Models 101

A technique for approximating the covariance matrix.

Problem

The number of unique terms in a covariance matrix is given by:

N⏟variance terms+N2−N2⏟covariance terms=N2+N2\begin{align} \underbrace{N}_{\text{variance terms}}+\underbrace{\frac{N^2-N}{2}}_{\text{covariance terms}} = \frac{N^2+N}{2} \end{align}

It isn't feasible to calculate these reliably. Therefore a portfolio strategy based on a naive approximation of the covariance matrix won't be reliable.

Factor Models to the Rescue

Single Factor Model (Intuition)

Consider the time-series regression for stock ii.

ri,t=ai+bi⏟factor loading(rm,t−rf,t)⏟factor+ui,t\begin{align} r_{i,t} = a_i + \underbrace{b_i}_{\text{factor loading}}\underbrace{(r_m,t -r_{f,t})}_{\text{factor}} + u_{i,t} \end{align}

Note that variance of return for the stock can be described by:

Var(ri,t)=Var(ai+bi(rm,t−rf,t)+ui,t)=bi2Var(rm,t−rf,t)+Var(ui,t)\begin{align} Var(r_{i,t}) &= Var(a_i + b_i(r_{m,t} -r_{f,t}) + u_{i,t}) \\ &= b_i^2 Var(r_{m,t} -r_{f,t}) + Var(u_{i,t}) \end{align}

Furthermore the covariance for stocks ii and jj is given by:

Cov(ri,t,rj,t)=Cov[(ai+bi(rm,t−rf,t)+ui,t),(aj+bj(rm,t−rf,t)+uj,t)]=bibjVar(rm,t−rf,t)+Cov(uj,t,ui.t)=bibjVar(rm,t−rf,t)\begin{align} Cov(r_{i,t}, r_{j,t}) &= Cov\big[(a_i + b_i(r_{m,t} -r_{f,t}) + u_{i,t}), (a_j + b_j(r_{m,t} -r_{f,t}) + u_{j,t})\big] \\ &= b_ib_jVar(r_{m,t} - r_{f,t}) + Cov(u_{j,t},u_{i.t}) \\ &= b_ib_jVar(r_{m,t} - r_{f,t}) \end{align}

The last line follows only if the error terms are truly independent between stocks.

Assuming this is true, the covariance between two stocks is known.

How many terms do we need to approximate? Just bib_i and Var(ui)Var(u_i) for all ii and the estimate for (rm,t−rf)(r_{m,t} - r_f).

N⏟bi+N⏟Var(ui)+1⏟(rm,t−rf)=2N+1\begin{align} \underbrace{N}_{b_i} + \underbrace{N}_{Var(u_i)} + \underbrace{1}_{(r_{m,t} - r_f)} = 2N +1 \end{align}

The goal is to construct a factor model that yields Cov(uj,t,ui.t)=0Cov(u_{j,t},u_{i.t}) = 0.

Approximation

Time series regressions assume constant loadings. We don't like this assumption so we instead emphasize a cross sectional approach.

For the cross-sectional regression, let there be NN stocks and KK factors of interest. Gather NN returns on the day. Additionally, collect KK characteristics for each stock. These characteristics should be chosen in a way that they are good approximations for the loading on the factor of interest. These KK characteristics from NN stocks form an N×KN\times K matrix.

We now run a regression of the following form, solving for ftf_t.

[r1r2⋮rn]⏟Day t Returns=[b1,1b1,2…b1,kb2,1b2,2…b2,k⋮⋮⋱⋮bn,1bn,2…bn,k]⏟Proxied loadings[f1f2⋮fk]⏟Factor Sensitivities+[u1u2⋮un]rt=Btft+ut\begin{align} \underbrace{\begin{bmatrix}r_1 \\ r_2 \\ \vdots \\ r_n \end{bmatrix}}_{\text{Day $t$ Returns}} &= \underbrace{\begin{bmatrix} b_{1,1} & b_{1,2} & \dots & b_{1,k} \\ b_{2,1} & b_{2,2} & \dots & b_{2,k} \\ \vdots & \vdots & \ddots & \vdots \\ b_{n,1} & b_{n,2} & \dots & b_{n,k} \end{bmatrix}}_{\text{Proxied loadings}} \underbrace{\begin{bmatrix} f_1 \\ f_2 \\ \vdots \\ f_k \end{bmatrix}}_{\text{Factor Sensitivities}} + \begin{bmatrix} u_1 \\ u_2 \\ \vdots \\ u_n \end{bmatrix} \\ \pmb r_t &= B_t \pmb f_t + \pmb u_t \end{align}

Interpreting ftf_t

Normalize the columns of BtB_t (excluding the dummy variable columns) to be mean 00 and unit variance. Furthermore, append a column of 1s. Define this new matrix:

B~t=[1Normed(Bt)]\begin{align} \tilde B_t = \begin{bmatrix} \pmb{1} & \text{Normed}(B_t) \end{bmatrix} \end{align}

Let the normalized BtB_t with an appended column of 1\pmb1s equal B~t\tilde B_t.

If we run the regression:

rt=B~tft+ut\begin{align} \pmb r_t &= \tilde B_t \pmb f_t + \pmb u_t \end{align}

We can do some analysis to find that fkf_k describes the returns to the portfolio where the weight on stock ii in the portfolio is given by b~i,k/N\tilde b_{i,k}/N. Succinctly:

fk=∑i=1Nrib~i,k/N\begin{align} f_k &= \sum_{i=1}^N r_{i} \tilde b_{i,k} / N \end{align}

Technically the result is actually:

fk=∑i=1Nrib¨i,k/N\begin{align} f_k &= \sum_{i=1}^N r_{i} \ddot b_{i,k} / N \end{align}

Where b¨k\ddot b_k is the unique variation in b~\tilde b.

The coefficient corresponding to the vector of ones, f1f_1, has bi=1 ∀i∈Nb_i=1\ \forall i \in N. Plugging this into the formula for fkf_k we see the constant represents the return of the equal weighted portfolio. Thus, f1f_1 is referred to as the country factor. Factors that aren't composed of dummy variables are called style factors.

rt=Btft+ut\begin{align} \pmb r_t = B_t \pmb f_t + \pmb u_t \end{align}

The return to asset rir_i is given by bi′ft+ui\pmb b_i' \pmb f_t + u_i.

Forecasting ftf_t

  1. Collect TT approximations for the vector ft\pmb f_t.
  2. Compute the factor covariance matrix using an exponential weighted average. The formula looks like this:
Σ^f,T=EMA[(ft−fˉt)(ft−fˉt)′]\begin{align} \hat \Sigma_{f,T} = \text{EMA}\left[(\pmb f_t - \pmb {\bar f_t})(\pmb f_t - \pmb {\bar f_t})^\prime\right] \end{align}
  1. Recall that that each index of the cross-sectional residual vector utu_t corresponds to a particular asset. Collect these residuals for a particular asset and approximate its variance using an exponentially weighted average. Gather the approximations to form the diagonal matrix Υ^T\hat \Upsilon_T.
  2. Finally:
V^T+1=BT+1Σ^f,TBT+1′+Υ^T\begin{align} \hat V_{T+1} = B_{T+1} \hat \Sigma_{f,T} B_{T+1}^\prime + \hat \Upsilon_T \end{align}

In case the last equation doesn't look familiar:

Var(rt)=Var(Btft+ut)=BtVar(ft)Bt′+Var(ut)=BT+1Σ^f,TBT+1′+Υ^T\begin{align} Var(\pmb r_t) &= Var(B_t \pmb f_t + \pmb u_t) \\ &= B_t Var(\pmb f_t)B_t^\prime + Var(\pmb u_t) \\ &= B_{T+1} \hat \Sigma_{f,T} B_{T+1}^\prime + \hat \Upsilon_T \end{align}

Industry Factors

Let there be JJ industry factors and SS style factors. Then the linear regression problem is:

ri=f1⏟Country Factor+∑jbj,i⏟Industry Dummy  fj⏟Return to Industry Factor+∑sbs,i⏟Style  fs⏟Exposure+ui\begin{align} r_i = \underbrace{f_1}_{\text{Country Factor}} + \sum_j \underbrace{b_{j,i}}_{\text{Industry Dummy\ \ }} \underbrace{f_j}_{\text{Return to Industry Factor}} + \sum_s \underbrace{b_{s,i}}_{\text{Style\ \ }}\underbrace{f_s}_{\text{Exposure}} + u_i \end{align}

The dummy variable trap leads to an unidentified solution to the least squares problem. Therefore, the problem is usually formed as constrained so that the market cap weighted industry factor returns sum to 00:

∑jmjfj=0\begin{align} \sum_j m_j f_j =0 \end{align}

Where the market cap weighting is:

mj=∑i∈jmcapiTotal(mcap)\begin{align} m_j = \cfrac{ \sum_{i \in j} mcap_i}{\text{Total}(mcap)} \end{align}

Obviously, constrained optimization influences our interpretation of ftf_t.

Problem Setup

Our goal is to solve a constrained weighted least squares problem where we weight the variances of returns appropriately.

Usually our weight matrix is Ω=σ2diag(1/mcapi)\Omega = \sigma^2 \text{diag}(1/mcap_i).

Formally, the problem being solved is:

arg max⁡ft (rt−B~tft)′Ω−1(rt−B~tft)  s.t.  Cft=d\begin{align} \argmax_{\pmb f_t} \ (\pmb r_t - \tilde B_t \pmb f_t)^\prime \Omega^{-1}(\pmb r_t - \tilde B_t \pmb f_t)\ \ s.t.\ \ C\pmb f_t = \pmb d \end{align}

Where ft∈RK×1\pmb f_t \in \mathbb{R}^{K \times 1}, rt∈RN×1\pmb r_t \in \mathbb R^{N \times 1}, Bt∈RN×KB_t \in \mathbb R^{N \times K}, C∈RP×KC \in \mathbb R^{P \times K}, d∈RP×1\pmb d \in \mathbb R^{P \times 1}, and Ω∈RN×N\Omega \in \mathbb R^{N \times N}. Note that P=1+J+SP=1+J+S where JJ is the number of industries and SS is the number of style factors.

Final point to emphasize is that the column of CC describing the constraint must correspond to the columns of BtB_t. We've described the problem as imposing the constraint mj=∑i∈jmcapiTotal(mcap) m_j = \cfrac{ \sum_{i \in j} mcap_i}{\text{Total}(mcap)}.

If this were the desired goal, given a B~\tilde B matrix that has this form:

B~=[11(ind1)…1(indJ)s1…sS]\begin{align} \tilde B = \begin{bmatrix} \pmb{1} & \pmb{1}(\text{ind}_1) & \dots & \pmb{1}(\text{ind}_J) & \pmb s_1 & \dots & \pmb s_S \end{bmatrix} \end{align}

Which would imply a CC of this form:

C=[0m1…mJ0…0]\begin{align} C = \begin{bmatrix} 0 & m_1 & \dots & m_J & 0 & \dots & 0 \end{bmatrix} \end{align}

Solution

After solving the associated Lagrangian for ft\pmb f_t we see

ft=Wtrt\begin{align} \pmb f_t = W_t \pmb r_t \end{align}

Where the linear estimator WtW_t is:

Wt=(I−Q)(B~t′Ω−1B~t)−1B~t′Ω−1\begin{align} W_t = (I - Q)(\tilde B_t^\prime \Omega^{-1}\tilde B_t)^{-1} \tilde B_t^\prime \Omega^{-1} \end{align}

and

Q=(B~t′Ω−1B~t)−1C′(C(B~t′Ω−1B~t)−1C′)−1C\begin{align} Q = (\tilde B_t^\prime \Omega^{-1} \tilde B_t)^{-1} C'(C(\tilde B_t' \Omega^{-1} \tilde B_t)^{-1} C')^{-1} C \end{align}

Perhaps a slightly easier way to read these formula is to define A=B~t′Ω−1B~tA = \tilde B_t^\prime \Omega^{-1} \tilde B_t.

Now:

W=(I−Q)A−1B~t′Ω−1Q=A−1C′(CA−1C′)−1C\begin{align} W &= (I-Q)A^{-1}\tilde B_t' \Omega^{-1} \\ \\ Q &= A^{-1} C' (CA^{-1}C')^{-1}C \end{align}

Interpreting WtW_t

Hopefully giving the linear estimator that maps rt↦ft\pmb r_t \mapsto \pmb f_t the name WtW_t and that it has NN columns is suggestive that WtW_t has something to do with the weights of a portfolio. In fact, each row of WtW_t gives the weights of assets in the portfolio which generates the return to the corresponding row in ft\pmb f_t. Recall that Wt∈RK×NW_t \in \mathbb R^{K \times N}:

fk⏟Portfolio Return=wk′⏟Portfolio Weightsrt⏟Asset Returns\begin{align} \underbrace{f_k}_{\text{Portfolio Return}} = \underbrace{\pmb w_k^\prime}_{\text{Portfolio Weights}} \quad\underbrace{\pmb r_t}_{\text{Asset Returns}} \end{align}