# How to deal with missing returns?

I'm backtesting a strategy that forms stock portfolios on a monthly basis.

It sometimes happen that a stock chosen on month t does not have return data on month t+1, so I can't correctly calculate the portfolio performance.

I've managed to find out why some of those returns are missing (i.e acquisitions and ticker changes), but for most cases I could not find a reason. Is there a standard way/smart way to deal with this issue?

Thanks!

If you know the price levels of the two neigbouring data points, as well as their returns, then you can directly imply the missing return. However, I suspect this is not what you have, and it is quite an obscure corner case anyway. In addition, in real life you could easily have several missing values in sequence.

The naive, but not necessarily bad methods would be

1. Set the missing return to 0.0 or the risk-free interest rate (or strategy neutral value).

2. Skip missing months for all assets. However, might lead lack of remaining data.

Other more sophisticated ways to impute the values can be using e.g. regression, or methods that finds the most likely values based on the observed returns. One intuitive way to think about this is that you can estimate how all the assets move together (covariance/correlation), and then on a month where you have missing data, you observe most assets, and calculate the likely missing asset values based on the covariance/correlation matrix. (See Maximum Likelihood / Expected Maximization Algorithm in the stackexchange link)

For more detailed info and more advanced methods:

Handling Missing values in stocks returns when estimating the co variance matrix

https://en.wikipedia.org/wiki/Imputation_(statistics)

• Thanks for your suggestions, Pontus. I'm somewhat reluctant in estimating those missing returns via regression or some other method. I guess I'll have to build my very own database by fixing issues such as this one. – krcruz Jun 1 '20 at 1:38
• @krcruz: if you strategy doesnt break if you omit a month or by setting it to 0 (or a value such that your strategy will neither lose or make money), and your strategy isnt sensitive to a few missing values, then this is a cheap option. Obviously, manually creating corrections is the ultimate method, but it can be labour intensive. – Pontus Hultkrantz Jun 1 '20 at 19:03

To backtest, you should use only the information that would have been available to you when the portfolio would have been constructed.

Suppose your strategy picked some stock X, but some of the things you mentioned happen during the month:

• X changes its name (and therefore ticker symbol); or X switches from one exchange to another. This doesn't affect the return. Just make sure you concatenate the time series from different tickers or exchanges properly.

• X files for bankruptcy, is delisted, and its stock becomes worthless. You definitely should not exclude it from your backtest if your strategy would not have known at the beginning of the period. You should use -100% return.

• X is reorganized orspun off or merged with something - if you had 1 share of X at the beginning of the month, you would have ended up with some amounts of some other shares. You definitely should figure out what your return would have been in order to test your strategy.

• Hello Dimitri, thank you for your kind answer. My main issue is when the stock doesn't seem to fit in any of those three situations you mentioned, to which case it seems like some shortcoming of the database itself. How can I treat those cases? – krcruz May 26 '20 at 0:51
• You definitely should investigate what happened in each individual case, which may not be easy. I actually ran into this problem a similar backtesting project once (long ago). The strategy bought stock X. In a few weeks, the company was taken private. It took A LOT of work to find exactly what shareholders received when they tendered the stock, but it was worth the effort and made the whole strategy look better than it would have if I were lazy and just excluded this stock from the universe. – Dimitri Vulis May 26 '20 at 0:58
• Could be that trading was halted during that day for corporate actions. I thought maybe using 0% return for that stock during the day with missing return, unless the situation fits one of Dimitri’s points. Out of curiosity, if you look at the stock price chart in any public website, how did stock price behave during the date with missing data? – user28909 May 26 '20 at 14:41
• I'm specifically backtesting for brazilian markets, so we don't have any trade day halt because of corporate actions. Also, since I'm using monthly, it would be unlikely for a stock to not trade during a whole month because of corporate actions. As for the second part of your comment, it is hard to say since I'm using monthly returns. I've identified that most problems are from really old dates returns, which I'm considering to be an evidence that the database itself has some issues. Thanks for your comment. – krcruz May 26 '20 at 20:40
• I'll try a last data provider and if the problem persists I'll do as Dimitri said and analyze each specific case. – krcruz May 26 '20 at 20:43