Wednesday, January 6, 2016

Portfolio managing tools and the true choice you're making

Most of the stock-market related materials use the following argument to convince their clients that the specific investment strategy works: look, it worked in the past, so let's assume the returns and the risk will be the same in the future. That's all good, but then you get in trouble when you need to compare two strategies from, say, two different providers, and decide how much money to allocate to each of them. Even worse, now they offer you more control and ask "what sectors do you believe in?" or "how much risk, on the scale of 1 to 10, are you willing to take?". Behind these questions is some good math, and supposedly you may just answer them as you normally do, and get not a bad result.

But the choice of the index to follow, or individual instruments to include, is way less educated. In fact, the creators of the online tools just followed what's standard, or made a few arbitrary choices. If you start tuning up too much, then you can get good returns, and even seemingly smaller risks, by cherripicking the stocks that performed well in the past. So to be safe, one needs to draw a line somewhere in the sophistication of the portfolio tool. Even though what it does is just optimizes risk and return, we can't let it optimize too deeply. Also, that would lead to longer runtimes, and user wants the website to show you your ideal portfolio immediately.

As you may have guessed, this is not so good. There's a methodology #2, that allows to protect oneself from overfitting, while actually trying every single slider. That methodology will give you something that's closer to an ideal portfolio, but unfortunately, producing that requires work. So most people stick with methodology #1 - just check how it performs on the past and think about those numbers. It's easy, you can do it in Excel. For my first trading competitions, I tried my algorithm against both methodologies. In #1, everything looked fine, in #2 it was not. But I did not have time to produce a better algorithm, so I submitted whatever I've got. And unsurprisingly, I lost. This algorithm still has not recovered even though half a year has passed. Which means that methodology #1 is useless.
(the blue is after the competition started)


Which would imply that all the portfolio management choices should be either made by doing a lot of work using methodology #2, or taken completely at random because it does not actually matter. All the fancy portfolio management tools make you think that you are in control, while in fact before you have done any work, you aren't.

Now, what does the methodology #2 tell us about the ratio of bonds to stocks, about which index to pick, about whether we should care about all the alternative investment opportunities? Unfortunately, I don't have time to fully explore those questions. Let me set a plan for myself:

First of all, if strategy fails Methodology #1 (look how it performs on the past), then it's definitely a bad strategy, so #1 is not useless after all. It's a good sanity check to start with.

There's a problem with #1, though. Depending on how much time you look back, the choices you make may be different. There's a simple way to estimate whether the time you can look back is enough - the Sharpe ratio parameter is made to tell you just that. In fact,
Nyears = 1/Sharpe^2
is the appropriate amount of time to make an reliable choice of what's the trend.  For various indices, we get 2-9years. For individual stocks, it's more like 25 years. Real estate indices, too. If we look at a longer time period, we can determine the trend even better - that given a simple random process model of the stock market has anything to do with reality.

Since some of the stuff we want to trade only existed for 10-20 years, people usually don't go back further. Also there's an idea that somewhere on time scales of 20+ years a change in economic epochs happen, and whatever was true does not have any predictive power for the other. Of course, there changes happening on all time scales, so such distinction is arbitrary. But we need to start somewhere.

So we want to choose among market instruments that have SR>0.25 on the last 20 years, roughly. Individual stocks are not  expected to comply with this requirement - their Sharpe ratio over the past 20 yrs is heavily fluctuating with really small mean, like 0.1. But pretty much any way of adding them up into index will give the desired SR. Also there are other instruments. So, there are a lot of pre-made indices we can allocate our money in. Methodology #1 tells us to chose an appropriate rate of return and risks (total Sharpe ratio). If you know how many years later you want to use the money from your investment for something (like buying a house, paying for the kids' college, retirement), then the Nyears from formula above should be less than your time scale. Of the remaining options, you just maximize returns. So you end up with some proportion of money allocated in different indices, such that it happened to have sufficiently high SR and highest returns on the past 20 yrs. This is what people use. As an option, you can say that "I'm not gonna need this money for anything" and just put them for highest returns available, which is not a bad strategy since we restricted SR to be >0.25 above anyways. So you don't have to know exactly when you gonna have kids :)

This is kind of backwards. Somebody already created an index by choosing which proportions to use for different companies. Now you are choosing which proportions of your money to have in different indices. A lot of work has been swept under the rug - in principle, different indices could have been made for you, and you'd never know. One of the central ideas of methodology #2 is about making it a fair comparison, where every, even seemingly irrational strategy, gets a chance. The parameters of the model would be individual coefficients. The hyper-parameters would be the exact prescriptions to obtain them based on the observed performance. The distinction between parameters and hyperparameters is arbitrary, of course.

For example, methodology #1 is now just one of the possible points in the space of hyperparameters. It's not so much work, but I haven't come with others yet. The numerical tests are also not done yet. Let's see if I have time for this - the difference is between having a verified 3-7% e.v. interest rate and just doing something that has e.v. 0% Probably it won't be negative by this method, just because to make B&H strategy negative, one really needs those stocks that went extinct. Maybe a careful numerical test will show some strategies to be negative. Anyways, it's about 3-7% of my investment yearly if I decide to invest B&H, so it's probably worth my time.

I probably won't be able to test those portfolio managing programs, because they have very many numbers involved. But at least this is a first step of actually making an intelligent choice.