How Much Should Six Months of Returns Shape Your Portfolio?

Finance Published: April 21, 2021
AAPLMSNVDADIAGS

Six Months of Returns, One Month of Reality

Take ten stocks, look at the last six months of daily returns, and decide how to split your money among them for the next month. Then repeat that every month for four years. That is the experiment behind a tidy piece of portfolio research we have been reading, and it uses AAPL, ABBV, A, APD, AA, CF, NVDA, HOG, WMT and AMZN as its test bench, with data running from January 2013 to August 2017.

The setup looks modest, but it asks a question that every investor faces whether they admit it or not. How much of what happened recently should shape what you do next? Six months of history gives you an estimate of each stock's average return and of how the stocks move together. Both estimates are noisy, and the whole business of portfolio optimisation is deciding how much to trust them.

Mean-variance thinking has been around since Harry Markowitz published it in 1952, and the maths has barely changed. What changed is how cheaply anyone can run it. A few lines of R, a convex solver and free price data will produce a month-by-month set of weights in seconds.

We think the interesting part is the comparison between methods. The source walks through the global minimum variance portfolio, the Markowitz mean-variance portfolio, a max Sharpe ratio version, a mean quintile portfolio and a mean divided by diagonal variance portfolio. Each one answers the same question with a different level of faith in the inputs.

Where the Numbers Come From

The data pipeline is worth a close look because the results depend on it. Daily prices are converted to log returns, then grouped by calendar month. A rolling window takes six months as the training set and the following month as the test set, then slides forward one month and does it again.

Inside each training window, two objects get computed: a vector of mean daily returns (called mus) and a covariance matrix (called Sigmas). The weights come from those two inputs and nothing else. The test month is never touched until the weights are fixed, which is the correct way to avoid fooling yourself.

The sample outputs show how small the raw numbers are. In one window the average daily log return ranges from about -0.25% for AAPL to +0.15% for ABBV. Daily variances sit near 0.0004 for AAPL and 0.0003 for ABBV, which works out to daily volatility of roughly 2.0% and 1.8%.

Covariances are smaller still. AAPL and ABBV share a covariance of about 0.000022, a correlation near 0.06. WMT shows slightly negative covariance with AAPL and AMZN in that window. A matrix like this is what an optimiser likes, because low and negative co-movement is where risk reduction lives.

One caution on the mean estimates. A six-month average of daily returns has a huge standard error. If a stock has daily volatility of 2%, then over 126 trading days the standard error of its mean is about 0.18% per day, which is larger than most of the mean estimates in the sample output. The signal is mostly noise, and that fact drives almost everything that follows.

The Minimum Variance Portfolio and Why It Ignores Returns

The global minimum variance portfolio (GMVP) throws the mean vector away entirely. It minimises w'Σw, where w is the weight vector and Σ the covariance matrix, subject to two constraints: no negative weights, and weights that sum to one. In R, the CVXR package states this as a quadratic form, checks that the problem is convex and then runs the optimisation.

Dropping the means sounds reckless until you remember the standard error problem above. Covariances can be estimated far more reliably than means, since squared returns carry information about volatility that signed returns do not. The GMVP therefore uses the best-measured input and ignores the worst-measured one.

The first output from the source shows what this looks like. For the first rebalance in July 2013, the optimiser put roughly 6.0% in AAPL, 3.4% in ABBV, 0% in A, 14.9% in APD, 12.6% in AA and 7.3% in CF, with the remainder spread across the other names. Notice that A got zero. The long-only constraint switches off assets whose risk contribution cannot be offset elsewhere.

There is a pitfall hiding in those weights. Minimum variance portfolios tend to concentrate in whatever looked calm during the training window, and calm windows end. APD, with a daily variance near 0.0001, was the quietest name in the sample and drew the largest weight, but a six-month lull says little about the next six months.

Still, the approach has a good record in practice. Low-volatility strategies have been popular for years, and the GMVP is their cleanest mathematical form. Its weakness is a tendency to drift toward defensive sectors and to churn when the covariance matrix shifts from one window to the next.

Dialing Risk Aversion Up and Down

The Markowitz mean-variance portfolio brings the means back. The objective is to maximise w'μ minus λ times w'Σw, with the same two constraints. The parameter λ sets how much the investor dislikes variance relative to expected return.

The source runs the optimisation across a range of λ values and plots the resulting risk and return pairs. As λ rises, the portfolio takes on less risk and also earns less, which is what the theory promises. At low λ, the optimiser piles everything into the single asset with the highest estimated mean. Raise λ and the weights spread across other names.

That single-asset result deserves a moment. With a mean estimate as noisy as the ones above, "the highest mean" in a window is often just the luckiest stock of the past six months. In the sample, ABBV carried the top average daily return at about 0.15%, and a low-λ optimiser would have sent nearly everything there. Whether ABBV beat the rest the following month is a coin flip with a slight tilt.

A practical reading of λ is as a dial for how much you trust your forecasts. A high value says the means are unreliable, so lean on diversification. A low value says you believe the forecast and accept concentration. Most professional implementations sit at the high end, which pushes the Markowitz portfolio toward the GMVP anyway.

Some readers will recall that Markowitz portfolios were once called "error maximisers" for this reason. They amplify estimation mistakes by loading up on whichever input looks best. The cure is shrinkage, constraints or a larger λ, and the long-only rule in the source already acts as a mild form of it.

What This Means for Real Holdings Like AAPL, NVDA, MS, GS and DIA

Although the source universe leans on industrials and materials, the same logic applies to a portfolio most readers would recognise. Suppose a holder owns AAPL and NVDA for growth, MS and GS for financials, and DIA as a broad Dow Jones exposure. Five holdings, one of which is itself a basket of thirty.

Covariance estimates for that set would show high correlation between MS and GS, probably above 0.8 in most six-month windows, since both react to the same rate and capital markets news. AAPL and NVDA would correlate somewhere around 0.6 to 0.7. DIA would correlate strongly with the financials and moderately with the tech pair. A minimum variance optimiser looking at that matrix would hand DIA a large weight, because it already contains diversification, and would split the financial slot between MS and GS unevenly based on whichever was calmer.

Run a rough scenario. Say the six-month window shows daily volatility of 2.2% for NVDA, 1.8% for AAPL, 1.9% for MS, 2.0% for GS and 1.0% for DIA. A long-only optimiser might produce something like 55% DIA, 15% AAPL, 10% NVDA, 10% MS and 10% GS. Portfolio volatility would land near 1.0% daily, hardly higher than DIA alone, so the extra four positions are mostly there for the optimiser's tidy weights rather than for risk reduction.

That is the first risk. When one holding is a diversified fund, a variance minimiser will lean on it, and the result looks like an index fund with garnish. Turnover is the second risk. Monthly rebalancing on shifting covariances means weights jump, and trading costs and taxes eat into the paper gains.

Constraints offer the opportunity. Add a maximum weight of, say, 30% per name, and the optimiser must spread risk across AAPL, NVDA, MS and GS in a way that reflects their different drivers. That portfolio gives up a little volatility reduction in exchange for exposure to the growth and financial themes the holder wanted in the first place.

A Caution on the Max Sharpe Section

Near the end, the author flags something honest. After an update to the tidyr package, the max Sharpe ratio section stopped working; the author made minor repairs and calls the resulting weights plot incorrect. Readers should treat that portion as unfinished.

We mention it because it is a good reminder about replication. Quantitative research in R or Python depends on package versions, and a silent change in how a function nests or unnests data can corrupt results without raising an error. Weights in the plot looked wrong, which is how the author caught the problem.

For anyone running these models, the lesson is practical. Pin package versions, check that weights sum to one and respect the constraints, and compare outputs against a simple baseline such as equal weighting. If a sophisticated model gives weights that look absurd next to 10% each, investigate before trusting it.

We also see a few quirks worth fixing before reuse. Newer tidyr deprecates the nest(-year_month) call, the data window ends in August 2017, and the author commented out several names in the symbols list. Anyone adapting it to current data should update the date range and test on a small universe first.

Putting the Methods to Work

Start with the question of what you believe. If you have no view on expected returns, and most of us have no reliable one, the GMVP or a heavily risk-averse Markowitz setting is the honest choice. If you hold a view, encode it as a tilt on top of a minimum variance base, not as a free-running optimisation.

For the rebalancing frequency, monthly is common in research but expensive in practice. A quarterly cycle with a tolerance band, such as only trading when a weight drifts more than 5 percentage points from target, cuts turnover sharply. Backtests of this kind usually show most of the benefit surviving.

Estimation window matters too. Six months is short, and a covariance matrix built on 126 daily observations for ten assets has 55 distinct parameters to pin down. Longer windows of a year or two, or shrinkage estimators that pull the matrix toward a simple structure, tend to give steadier weights. Test both before committing.

A sensible workflow looks like this. Pull at least three years of daily data for your holdings, such as AAPL, NVDA, MS, GS and DIA. Compute the covariance matrix, solve the GMVP with a 30% cap, and compare the weights to what you hold today. The gap between the two tells you where your current portfolio carries risk you did not intend.

Then check the out-of-sample behaviour the way the source does. Fix the weights on a training window, measure the next month, roll forward, and tally realised volatility against equal weighting. If the optimised version does not lower realised risk by a meaningful margin, say 10% or more, the added complexity is not paying for itself.

Finally, keep the tax and cost side in view. Optimisation output is a target, and the path to it passes through bid-ask spreads and capital gains. For taxable accounts, move toward the target gradually with new contributions, and save the sharper rebalancing for retirement accounts where trades carry no tax.