I want to run some simulation studies of (linear) factor models and for that reasons I am wondering about the features such a simulation should contain - every suggestion is welcome, I'll do my best to update my code accordingly to provide some general usable framework at the end of the day. Citations are welcome, too!

The question is related to this question, however, I think due to the presence of factors and predictors the setup is sufficiently different to ask a separate question.

This is my approach:

Underlying assumptions and statistical model for the returns

I want to work with linear factor models of the form \begin{align}E[r_t] =& \beta(z_t) E[f_t] \\ \beta(z_t) =& \beta_0 + \beta_1z_t \end{align} which essentially implies a model for the returns which are driven by the factor returns (I'll go for market excess returns, so it is a CAPM model) and the factor-loadings are time-varying, where the dynamics come from some macro-risk variable $z_t$ which may predict business cycles (I'll go for the aggregated dividend yield). Substituting yields $$E[r_t] = \beta_0 E[f_t] + \beta_1(z_t \times f_t) $$ Based on this framework I first estimate appropriate parameters $\beta$ (and prevailing mispricing $\alpha$) using some test asset. In my case I used some B/M and Size portfolio sorts from Kenneth Frenchs Homepage to get estimates (based on simple OLS) $\hat{\alpha}$ and $\hat{\beta}$ which I'll assume to be fixed (probably one could base the simulation on sampled values of these parameters as well). One could also adjust for time-series characteristics by estimating $\hat{\alpha}$ and $\hat{\beta}$ based on some sub-samples of the data, employing rolling windows, state-space models, etc.

The following code is running the regressions. I gathered the FF Market Data and Portfolio-Sort returns (from Kenneth Frenchs Homepage), the dividend yield time-series (from Goyal Welchs Homepage) and combined everything in one data.frame available on a gist:


# Read-in data (contains asset returns, market (factor) returns ---------
# and dividend yield (predictive variable)) -----------------------------

x <- getURL("https://gist.githubusercontent.com/voigtstefan/
data <- read_csv(x)

The linear model is fitted as follows to get estimates of $\hat \alpha$ and $\hat\beta$:

# Fit linear model on predictive variables and market factor -------------
fit <- lm(Returns~dy+Market,data)

Simulate (noisy) factor returns

In a next step I simulate factor returns which are distributed similar to the initial market returns. I only matched the first two moment of this distribution, but probably one could either adjust for the presence of fat tails (estimate a student-t), adjust for time-series aspects (estimate time-varying volatilities).

I want to see how factor models react to the inclusion of new factors which do not have explanatory power. In other words, I'll feed the model with additional simulated factors but the simulated returns itself are only driven by, say, the market data.

# Simulate factors ------------------------------
seed.init <- 1 # For reproducability
sim.factor <- matrix(rnorm(nrow(data),

Simulate returns

Now that I have simulated factors, I can simulate returns by employing the statistical model explained above: I use the predictors (which I do not simulate) and the simulated market returns to sample returns from the regression equation. The factor loadings are replaced with the estimated coefficients.

I gathered (factor) market-returns and

we simulate return time-series by running a time-series regression of the portfolio sorts based on B/M and Size on two explanatory variables: market returns and the dividend yield as predictive variable. In a second step I use the estimated parameters to simulate time-series of 150 years of monthly data. I compute the HJ-measure based on the usual moment conditions (with and without conditioning information) for models which always include the market factor but in addition by adding randomly generated \textit{factors} which are independent from the returns and the market factor. In addition I compute the corresponding model likelihoods of the unrestricted version of our Bayesian model.

# Simulate returns ------------------------------
sim.returns <- cbind(1,data$dy,sim.factor)%*%coef(fit) + 

sim.data <- data.frame(returns = sim.returns, factor = sim.factor, dy =  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.