# How can I replicate Vanguard's Total Stock Market Index using their S&P 500 and extended stock market funds?

I want to approximate the total United States stock market with part of my 401(k). I have access to two low-cost index mutual funds: VIIIX, which tracks the S&P 500 (large cap), and VIEIX, which tracks the S&P Completion Index (small/medium cap).

What relative weights should I use for these two funds to be equivalent to something like VTSMX? How would one determine this aside from just going with 50:50?

The market cap of the S&P 500 and the S&P Completion Index is \$14.7 trillion and \$3.4 trillion, respectively. Does it make sense to use that ratio?

That ratio is a decent approximation of the market cap distribution in VTSMX, although it's not perfect because the two funds you have access to, VIIIX and VIEIX, overlap somewhat in their holdings. The S&P 500 and the completion index don't. Using the S&P 500 and the completion index as relative weights gives you (14.7+3.4)/14.7 = 81.2% and 1-0.812 = 18.8% for VIIIX and VIEIX, respectively.

We can verify that this is close to the best allocation using either of the two methods below. Based on that, it's safe to say that an allocation of 81% to VIIIX and 19% to VIEIX should replicate VTSMX pretty well. Remember that because of expense ratios (among other factors), the returns to your replicated portfolio may not match the returns to the target portfolio exactly.

According to Morningstar, VTSMX has the market cap distribution shown in the first column.

``````Market Cap           % of Portfolio      Benchmark       Category Avg.
Giant                        41.42           44.96             53.38
Large                        30.50           33.25             28.92
Medium                       19.47           20.04             15.70
Small                        6.20             1.74              1.85
Micro                        2.41             0.02              0.15
``````

Morningstar places VTSMX in the Large Blend category, so the category averages in the right-hand column are for that category. The benchmark index is the Russell 1000 index.

VIIIX and VIEIX have these distributions:

``````Market Cap           % (VIIIX)    % (VIEIX)
Giant                    51.28         0.43
Large                    36.20         5.38
Medium                   12.43        48.06
Small                     0.09        32.62
Micro                     0.00        13.51
``````

We want to find allocations for VIIIX and VIEIX, i.e. two percentages that sum to 1, that give us a portfolio with a market cap distribution as close to that of VTSMX as possible. There are several methods that would work for this; both return the same solution:

### Method 1: Goal-seeking in Excel

Using the goal-seek feature of Excel, I found that allocating 80.5712423979149% of your portfolio to VIIIX and the remainder (19.4287576%) to VIEX yields this distribution (shown in the "replicated" column), which is pretty close. The second data column is VTSMX, the fund you're trying to replicate.

``````Market Cap           % (replicated)       % (VTSMX)       "% Error"
Giant                  41.40                 41.42         0.0471
Large                  30.21                 30.50         0.9441
Medium                 19.35                 19.47         0.6037
Small                  6.41                  6.20          3.3899
Micro                  2.62                  2.41          8.9139
``````

This gives me the allocation of approximately 81% to VIIIX and 19% to VIEIX that I listed in the short answer above. The percent error, which is calculated as the absolute value of the difference between the allocations divided by the allocation in VTSMX, increases as market capitalization decreases, but that shouldn't bother you. Since allocation decreases as market cap decreases, even though the error grows as market cap decreases, that error represents an increasingly small amount of the fund's actual value.

This isn't a perfect system, because I'm abusing the notion of "weighted percent errors" a little here, but hopefully the idea is clear.

### Method 2: Matrices

In this specific case, matrices provide a much more robust, and arguably logical, strategy. From a mathematical perspective, this is the problem we're trying to solve: where `w1` and `w2` are the percentage allocations of VIIIX and VIEIX, respectively, that you want in your 401K portfolio. At first glance, it looks like you can simply solve the last equation for `w2` and substitute that value into any of the first four equations to solve for `w1`; unfortunately, if you try this strategy with the fourth equation, you get a value of `w1 = 4.2816`, but if you try this with the third equation, you get `w1 = 0.87716`. If you try using the value of `w1` that came from the fourth equation in any of the other equations (besides the fifth one, in which it doesn't matter) you'll find it won't work. The same goes for the `w1` that came from the third equation, or the second, or the first.

It seems we have a problem. All is not lost, however. If you've ever taken an algebra course, you can see that the system of equations above looks like this matrix equation: I labeled the numerical matrix on the left-hand side of the equation `A` to save space. The linear algebra theory probably isn't exciting to everyone as it is to me, so I'll keep it short. Since `A` is a 5x2 matrix with rank 2, it therefore has a left inverse, which we can calculate like this: With our left-inverse in hand, we can quickly find the solution to the matrix equation like this: which gives us the same solution that we found with Excel. It's also important to understand that this is the "best" solution to the problem; in other words, we have found the weights of VIIIX and VIEIX that replicates the market cap distribution of VTSMX as closely as possible.

If you've ever taken a statistics or econometrics course, you might recognize the calculation and application of the left-inverse as the ordinary least squares (OLS) estimation of the weights; that means that in this case, "closest" implies that the weights we found minimize the sum of the squares of the differences ("errors" or "residuals") between our replicated portfolio and VTSMX.

While the matrix/OLS method seems more complicated, I include it because it may be much quicker computationally than using Excel if you attempt to replicate a portfolio using more than two funds. The matrix/OLS method also scales very well in situations where more than two funds are used in the replication. Also, in this case, we had the relative weights of the S&P 500 and the Completion Index to use as guides, but once we start adding more funds with potentially more overlapping holdings between them, calculating a simple ratio may not work nearly as well. In the more complex case, however, even a simple linear regression may not work, and you would need to use methods of constrained regression and linear/quadratic programming to make this work (if it works at all).

### Result/portfolio comparison

If you substitute the weights `w1` and `w2` you found, either in Excel or using matrices, into the left-hand side of the original system of equations or the matrix equation (in statistical parlance, you're calculating the linear predicted values) you can see that your replicated portfolio doesn't match the market cap allocation in VTSMX exactly; specifically, it over-allocates to giant, small, and micro cap stocks while under-allocating to large and medium cap companies.

I was curious how the replicated portfolio would perform against VTSMX, so I ran a quick simulation in MATLAB to compare the performance of each portfolio. First, I made a few assumptions:

1. At the start of a ten-year period, you invest \$10,000 in each portfolio. For each month in the same period, you invest an additional \$1,000.
2. I de-annualized the average annual return for giant/mega, large, medium/mid, small, and micro cap stocks using the formula `1 + annual = (1 + monthly)^12`. Another option would be to find a set of weights that hit the average 10-year return for VTSMX.
3. I calculated the weighted expense ratio for the replicated portfolio in the same way I calculated the predicted values. Using the expense ratios of VIIIX (0.02%) and VIEIX (0.12%), this gives me a weighted expense ratio of 0.039%.
4. I ignored inflation, since it should apply equally to both VTSMX and the replicated portfolio
5. I ignored transaction costs; I think this is a safe assumption to make when purchasing mutual funds.

The results of the simulation: As you can see, the replicated portfolio closely matches VTSMX. The final value of the VTSMX portfolio is \$185,561.89; for the replicated portfolio, it's \$185,992.72.

The replicated portfolio outperforms the VTSMX portfolio partly because the replicated portfolio is comprised of institutional shares, which have much lower expense ratios than the investor shares the VTSMX uses (the market cap distribution also makes a difference). Even if you invested in the VTSAX, the Admiral Shares equivalent of VTSMX, which has a much lower expense ratio of 0.05%, the weighted expense ratio is still lower at 0.039318 and your return still outpaces the benchmark fund (VTASX in this case). The final results are \$185,580.43 and \$185,992.72 for VTSAX and the replicated portfolio, respectively. The distance has narrowed, but it's not enough for the Vanguard fund to beat your portfolio.

### Caveats

Although these average returns may not accurately represent the holdings in VTSMX or your replicated portfolio and the average returns statistics for each market cap may represent slightly different holdings than those of the Vanguard funds, these nuances don't pose a problem in this example because I'm using the same benchmark to estimate the returns on VTSMX and the replicated portfolio.

### Code

Here is the MATLAB code for the simulation; I made the chart in Excel.

``````clear

%% Funds available for replication
VIIIX = [51.28;36.2;12.43;0.09;0] / 100;
VIEIX = [0.43;5.38;48.06;32.62;13.51] / 100;
expVIIIX = 0.02/100;
expVIEIX = 0.12/100;

%% Replication target
VTSMX = [41.42;30.5;19.47;6.2;2.41] / 100;
expVTSMX = 0.17/100;

%% Calculation of weights w1 and w2
A = [VIIIX VIEIX];
w = A \ VTSMX;

%% Market cap distribution, weighted expense ratio of replicated portfolio
REPPORT = A * w;
expREPPORT = [expVIIIX expVIEIX] * w;

%% De-annualized average returns and expense ratios
avgAnnRet = [0.0646;0.0572;0.0624;0.0848;0.0616];
avgMonRet = (1 + avgAnnRet).^(1/12) - 1;
expMonVTSMX   = (1 + expVTSMX)^(1/12) - 1;
expMonREPPORT = (1 + expREPPORT)^(1/12) - 1;

%% Simulation
% Parameters
startYear  = 2010;
endYear    = 2020;
initialInv = 10000;
monthlyInv = 1000;

% Initial investments, weighted by market cap
valVTSMX = initialInv * VTSMX;
valREPPORT = initialInv * REPPORT;

data = zeros((endYear - startYear)*12+1, 2);

for month=startYear:1/12:endYear
valVTSMX   = monthlyInv * VTSMX + valVTSMX.*(1+avgMonRet);
valREPPORT = monthlyInv * REPPORT + valREPPORT.*(1+avgMonRet);
data(round(12*(month-startYear))+1, :) = [sum(valVTSMX)*(1-expMonVTSMX), ...
sum(valREPPORT)*(1-expMonREPPORT)];
end

xlswrite('returns.xls', data, 'Data', 'A2');
``````
• That's what I call a comprehensive answer! Thanks! May 15 '13 at 18:32
• @CraigW Happy to help; are you at ease with my change to the question's title? May 15 '13 at 18:40
• Title looks good to me. May 15 '13 at 19:04
• @Jeremy Unfortunately, this bit of math is (almost, but not quite) specific to this question. For a larger number of funds, or a more complicated replication goal, a simple matrix equation/linear regression may not return a solution that makes sense, e.g. some of the allocation ratios may be negative. May 17 '13 at 20:43
• @CraigW I added a simulation of the returns to VTSMX and the replicated portfolio in your 401K, and the results are pretty close. The lower expense ratios of the institutional shares (among other factors) allows your portfolio to outperform VTSMX. May 30 '13 at 22:20