Wednesday, February 24, 2016

Meeting the school money investors

Private schools are non-profit, but they have a lot of money from undergrads paying tuition, and money from fellowships and grants. Also donations from the alumni. Quite a significant portion of this "profit" is not immediately spent on the needs of the school, but is instead invested. The scale of this investment is billions of dollars times how big the school is and how long has it been around. On the east coast, it is really funny to observe competition between Harvard and Yale - who can make most returns this calendar year, or in a three-year interval? Both have of order 50 billion.

Of course it's not a fair comparison - each school has different needs. There are other indicators they like to compare themselves to. The non-profit part allows them to pay no taxes. What's the most interesting is how the investment decisions are made, and what kind of choices are available on that level. Of course this is not as big as it gets, but it's big enough to open most doors for them. More below.

The people in charge are called something like "board of trustees". They are about 12 people who are old and experienced in investment. Some are professors, some have business background. A few consultants who do not have a say in the final decision making are also present on their meetings, e.g. a consultant on China market. I assume that a lot of paperwork is handled by secretaries or their equivalents. What this organization's daily job is can be described as a lot of paperwork, and some very qualitative analysis of the bigger picture. They do look on quantitative performance measures, but then they are mostly talking to make sense of it. School provides this organization with budget needs (amount to be subtracted from the fund's value at the end of calendar year). There don't seem to be any other constraints.

The actual buy and sell decision are made by money managers, who sign an agreement with the above people. These managers are different companies like hedge funds, and also independent venture capitalists etc. Each one specializes in one or two areas. The board of trustees does not tell them what to do, just asks them what they usually do, and then if their plans align with board of trustees big picture view, they are hired. Then board of trustees monitors their activity, and if it deviates from the expectations, or they just plain lose money. 10% every year get fired, and it leads to a lot of annoying paperwork for the board.

2b/100 = 20m$ per manager. This opens all the doors of hedge funds.


Monday, February 8, 2016

Market is down again

If we believe that investing is still a good idea, then now is the time to move the money there. Of course, one may also be happy about not having investment and keeping the dollars while people who invested are losing money day after day. But this reason to be proud of yourself will disappear as soon as some part of the market shoots up. And it certainly will, problem is, we never know which one. But what do we know?

Under quite a detailed scrutiny, market still looks like a random Markov process. In fact, the more one looks the more indications there are that there are no correlations whatsoever. Correction: you can find correlations, but only such that do not tell you anything about the sign of the price change.

Now, any strategy that can be coded by working with the price data and is a simple looking-back decision making program seems to return essentially random results. There are some that are skewed to perform better, and the dispersion is so big that on some stocks it would seem to perform really well, but it's all just noise. From what we can see, consequence of individual action on the stock market is pretty much 50/50 for most of them, except for particularly stupid ones. In fact, it is hard to find a consistently losing strategy (with 0 fees) because one would invert it (sell instead of buy) and turn it into winning strategy.

The things that are easy algorithmically do not neccessarily coincide with what people actually do while trading by hand. Algorithmically, almost every code that you write makes 100s of operations, while we usually are much more lazy and just want to buy once. So we have confirmed the 50/50 picture for algorithms like trendfollowing and mean-reversion, but these results do not help much in thinking about actually making a trade yourself this one time. So what would be the algorithms that shed some light on the effectiveness of most common trading practices? I hope to list a few things that I have tested here. I have two main interests:


  1. Stop-loss. In B&H strategy, one may take an active position and check how much is the portfolio worth every few days. If he sees that it is down by the last year's earnings, he might impulsively withdraw everything and wait for some time. I'd like to know how it affects the long-term returns (and e.v.) and what wait time and threshold to pick. Also maybe there are stocks that consistently reward traders who use this strategy.
  2. In picking which stocks to invest, one may focus on best performers and worst performers.
  3. The SR is the main instrument in thinking about stock as a random process, but for some of them it does not obey the naive sqrt(Ndays) dependence. In such way one can choose top SR and worst SR stocks, and maybe expect different strategies to work on them.


Thursday, February 4, 2016

Machine learning US investment options

As we remarked in the previous post, assessing the financial promise of a given company or other market instrument is a task for a professional. An amateur may point out one or two obvious things, but will have to guess in pretty much all the major questions. So the natural thought would be to seek out professionals.

There are a few services available with regards to investment:


  1. Portfolio management. There are some calculations based on the past prices and a list of assumptions, which lead to a prescription how much money one should commit to a given type of investment. The central idea is that of diversification: all things cannot fail at once. Or in more mathematical terms, average of N independent random variables will have 1/sqrt(N) smaller standard deviation than each one individually. This slightly improves the performance as compared to s&p 500, and there are plenty of websites that offer this kind of portfolios with formulas hard-coded in: betterment.com, Acorn. Note that such services do not improve the expectation value of your returns, they trade the expectation value for "protection from risk", in other words, apparent reduction in standard deviation of your returns. They save you the nerves during the market crashes. Nobody knows what happens with the actual probability, if that can even be defined (see below). Nice thing about those websites is that they seem to do the rebalancing for you, which also gives a slight improvement over buy&hold of fixed number of shares.
  2. Mutual funds. Those ones will ask you 1$ commission or 0.3%, and attempt to do something that they often do not completely disclose, but possibly more complicated than just portfolio allocation and rebalancing. You can choose the area of the market - there are plenty of mutual funds available for each one. Then the "professionals" who manage the mutual funds decide what to buy and when. Hopefully they can not only improve over blind allocation of portfolio managers, but also time their purchases (or play with the derivatives). However, all of that zoo does not bring them easy victory - as one sees in the websites that show mutual fund's performance, many of them jump like crazy on the scale of 1 year, and it's hard to say conclusively whether their strategy still works. Also, some of them have large barriers to entry (100K$, still not as large as hedge funds)
Most of the intuition in the comparison comes from the simple random process. Such random process would have fixed mean M size of each step, and a much bigger random noise determined by standard deviation S. Let step happen over 1 day. Then after 252 days (roughly 1 year of trading days) the mean/deviation of total returns will be amplified as sqrt(252)*M/S. This number is called Sharpe ratio (roughly). The general logic is that we want to choose a portfolio with the biggest M, but almost all the time the apparent Sharpe ratio of such portfolio will be too small. The mnemonic is that 1/Sharpe^2 is the number of years of data that we need to be confident in our choice. For individual instruments as well as the most of the simple strategies, Sharpe<1, which implies that we need >1 year of uniform data to confirm that our algorithm is working at all. But the problem is, the data on the stock market is strongly non-uniform, especially for B&H strategies. The events every few month strongly influence all the market and change the sentiment about the companies and other instruments. Of course, there are short term changes as well, but the hope is that they repeat often enough so that our training can take them into account. But the month/year scale events tend to be unique and unpredictable. So, in short, our conclusion is that past data alone does not provide sufficient evidence for reliability of any B&H strategy. If that argument was not enough, there's also selection bias that is carefully accounted in Quantopian.com environment, but not in any of the cheesy portfolio allocation formulas.

Still, it's a good sanity check to find out what's your strategy's Sharpe ratio. It's very random, though. Somewhat more stable number is achieved via training-test splitting, optimizing of paramenters on the training and endless crossvalidation on test. We expect that "speculation" strategies can be reliably assessed in this way as they are the ones about timing the purchases, which should be a universal technique largely independent on long-term trends of the market. But B&H strategies are not expected to provide particularly insightful numbers even after the laborious crossvalidation. We will cover a few results for a best performer/worst performer strategies in the next post.

In conclusion, I'd like to note that the above Sharpe ratio analysis relies on the assumption of simple random process, which is in one way definitely not true for the stock market instruments. If the mean M and the dispersion S were as they are measured from the data, typical stock would travel of order S*sqrt(N) from it's origin over N days for N<252/Sharpe^2. But a real stock hardly ever travels that far. If one estimates the anticorrelation coefficient sum(Xi -M) (Xj-M) = sum -0.5(Xi -M)^2 +  0.5(sum Xj- NM)^2 = NS^2, it's almost maximally possible...

Wednesday, February 3, 2016

What to do with the money in US?

A typical choice is either mortgage or retirement fund. Or anything in stock market really. I would like to assess real estate at some point, but currently I don't have enough money to think about it. The low-cost real estate options like REITs don't seem to be very interesting. There's an ongoing REIT in California right now called RichUncles, that seem to be doing some pyramid scheme instead. Its executives spend disproportional amount of money on publicity and high dividends, which makes one suspect they are using their shareholders money for that. Of course, we will only know at their liquidation event that will happen in a few years. They will either be able to pay everybody back, or not. No way to predict. They do publish some sort of financial reports and list of buildings that they buy, but there are not so many figures in those reports, and no plots whatsoever.

Which brings us back to the stock market. Stock market is huge! There are about 7000 instruments on Quantopian.com with  minute data available to analyze: companies, including recent IPOs, and ETFs - a placeholder companies which track some of the government bonds and commodities. What do all of these words mean?
IPO - a moment when company's stock becomes available on the market, as well as the company that recently has done that.
ETF - as explained above.
government bonds - have something to do with the bank interest rates and government borrowing money from citizens.
Commodities - stuff like oil price and gold.

Here's the comparison of all of that stuff over the past year (TLT is bonds, UUP is dollar futures(?), DBC is commodities, S&P 500 is "the market") :
We see that all of them went down, but in somewhat different fashion. Now what investors tend to say is that when the market is low, we need to buy in and hope for it to go up. There are also more advanced talks about rebalancing: one holds a combination of stocks and bonds, and as the stocks go down, buys more stocks and sells more bonds. There are no instructions as to when exactly should one do that. Doing that now sounds like a good idea: bonds are on the uptrend, and the stocks are really cheap. But then, one may argue that waiting for another day, month, year will give one an even better deal as today's trend continues. Nobody really knows when is it gonna revert.

Another direction of work is to try to "outperform the indices". If one carefully picks companies, avoiding the ones with dumb people in the leadership, and the ones with too smart leaders who drain money from stockholders. Avoiding also those that are overpriced, just because every single trader on a stock market wants to buy a bit of Netflix, Google, etc. And avoiding those that have ok leadership, but just not very profitable market (e.g. one-trick companies who only produce one product). After all this avoidance, there's really not much left. Not clear if this is a good strategy as the ability of non-business people to assess financial reports and leadership decisions (as well as the sentiment of institutional investors) is obviously limited. 

Now, in the internet at the end of any such article there's a solution proposed, and a link redirecting the reader to put their money in. I don't have such link at the moment, but I promise that as soon as I set it up I'll share it here. (I hope you see the irony in this paragraph)

So what to do with the money?

There are many many choices available. As I'm a foreigner in US, I always have an option of storing up to 15k$ in a bank account in my home country with about 3% interest rate. Any larger sum will be subject to the risk of bank collapsing (which happens daily in that country), but <15k$ is reimbursed in that case by our government. If you have more money - that just means more paperwork as you need to open more than one account.

Another unique thing about my country is that I can be a venture capitalist there, but not here (here you need to possess 1M$ to become an angel investor). I did not find any good startups there though.

Finally, the currency was doing something very interesting in my home country, and all the savings that I had in my own currency were halved. Bitcoin wasn't doing too bad but it seems to get illegal soon.

So let's discuss US and what one can do here. First, note that I look at three parameters: performance in the past (and here one should mention more than one timescale), risk (how many big jumps up and down are there), and sentiment (is there any impending doom on that financial instrument). Of course that's not enough for complete analysis, only for the first step. I'll try to outline the complete analysis in my further posts. The above three choices are as follows:
1) bank  - performance +3% yr, risk = 0, impending doom = quite substantial since I'm pessimistic about my country. Also, a lot of hassle with actually opening those accounts.
2) startup - performance +50% last yr, risk = ? illiquid, so no data, impending doom = almost certain. Most of the startups don't return on the investment in any way. It only makes sense if you can invest in a 100 of them at once, which I can't as I don't have 1M$ after all.
3) my home currency - performance -50% last yr, risk = 20% (I don't expect bigger jumps than that), impending doom = that's the problem with the currencies, isn't it? Unless you wanna speculate, none of the currencies just grows indefinitely. If I keep my money in dollars in a can for 10 or a 100 years, I don't expect to be rich just because of that. Don't think that ever happened in history. One think that I can do with dollars is to go to the country where the currency is doing really poorly and enjoy my life there. I think the rules of Forex trading allow one to short a currency - that is, try to win money on the assumption that a given country gonna collapse through the floor. That idea seems strangely appealing to a pessimistic person. The fact that I'm holding my money in dollars is already a first step towards that.
4) bitcoin - performance +100% last yr, risk = 30%, impending doom = pretty sure that it will get forbidden by all major governments. It seems that the recent growth was partly due to a Russian con artists' operations in Africa in India.