State Space Models

All state space models are written and estimated in the R programming language. The models are available here with instructions and R procedures for manipulating the models here here.

Thursday, January 12, 2017

Is the Trump Rally a "Sugar High"?

Controversy has erupted between stock analyst Jim Cramer and economist Larry Summers over how to interpret the "Trump Rally," a surge in the stock market that started after Donald Trump won the November presidential election in the US. Jim Cramer has argued (here) that business conditions in the US are improving and, as long as that continues, the Trump Rally should continue. Larry Summers, on the other hand (here), has argued that post-election stock market surges (especially when right-wing candidates win) are driven by expectations of a bright new future that never materializes.

The Random Stock Walker finds these controversies interesting for what they reveal about how the stock market works and how irrational factors might drive stock performance. The graph above displays the attractor path for the S&P500 from 2014 through 2018 (red dashed line) and the 98% bootstrap prediction intervals (green and blue dashed lines). The actual path of the S&P 500 is displayed in black. The start of the "Trump Rally" is displayed as a solid vertical red line in November of 2016. The attractor path is the free-simulation of the S&P500 state space model starting in 1950, a path that is not influenced by the random fluctuations that have driven the stock market over the late 20th and early 21st Century. Some of those random fluctuations are on clear display starting in 2014. 

Conventional stock market technical analysis, however, boils down to drawing projection lines and confidence intervals based on optimistic predictions of future stock prices and short-run behavior of indexes. For example all through 2014, the market boom led analysts to make irrationally exuberant projections (solid arrow starting at the end of 2014) for the future. When the stock market failed to perform as expected, all of 2015 was viewed as a complete disappointment based on a long list of negative factors (China's slowdown, the Greek Debt Crisis, the weak EU Stimulus plan and broader anticipated slow downs in emerging markets). All these negative developments are quite beside the point: the market was in a bubble, well above the upper 98% bootstrap prediction interval until it finally returned to the attractor path, with a slight over-correction late in 2015. Performance was then within what might be expected from random fluctuations until the middle of 2016. 

Yes, there was a Trump Rally. Yes it could go on for a long time. No, it is not justified by better business conditions. The attractor path for the S&P500 is driven by the state of the US economy. It suggests that there will be another correction at some point in the future. Again, any correction will be attributed to random events in the world-system and may well have been triggered by such events. However, the short-run, straight-line optimistic predictions of stock analysts are wrong and have always been wrong. Optimist stock forecasts increase sales. Sales benefit analysts and their employers. They are not reliable predictions of the future.

If you are an investor, what should you do about the Trump Rally? First, you should not be buying based on the news. If you are looking at a stock that is driven by the S&P500, the Trump Rally is pushing it above it's attractor path. You are buying high and you can expect the stock to decline. If you are a trader, should you be selling? Yes, gradually. It's time to take profits and wait for the return to the attractor path when you can get back in again. If you are a long-term investor, wait it out. In all cases, you will need to estimate a state space model for your stock and plot the attractor path to know whether there is anything to consider in the Trump rally.

In future posts I'll look at individual stocks that have been mentioned in discussions of the Trump Rally. If you have any stocks you are interested in, let me know. We can take a quick look at the attractor paths.

Wednesday, December 7, 2016

$FB: Buy and Hold Forever?

Dec 7, 2016: Fox Business News just published (here) a very optimistic article on Facebook stock (FB) saying "..by nearly any measure...FB...has unlimited upside as the world transitions to digital." Glowing optimistic forecasts about technology stocks always interest the Random Stock Walker given their gee-whiz appeal, so lets run FB through our models.

The Random Stock Walker forecast through next year is displayed above (the black line is the stock price, the green dashed line is the upper 98% bootstrap prediction interval, the dashed red line is the attractor path, and the dashed blue line is the lower 98% bootstrap prediction interval). The attractor graph looks pretty good with small deviations around the attractor path (time to take earnings above the attractor path, time to buy below the attractor path). With the stock below the lower prediction interval right now, it would seem to be a good time to buy.
However, if we extend the forecast out to 2060, things do not look so good. The upside (upper 98% prediction interval) does indeed look great, but the downside (lower 98% prediction interval) is essentially zero. In other words, there is an equal chance that if you buy FB right now, at anytime in the future it could be worthless. One can invent any number of reason why this might happen but wide variability prediction intervals (high risk) is an essential feature of most tech stocks.

NOTE: One positive side of the FB state-space prediction model is that the stock price is being driven by growth in the world system. A negative side, as has been mentioned above, is that FB is a tech stock.

Monday, September 26, 2016

$TWTR: When Will It Be Acquired?

UPDATE SEP 27, 2016: My sources and the media (here) say that there are multiple potential bidders for Twitter (Google GOOGL, Salesforce CRM, Disney DIS, Verizon VZ, MicroSoft MFST and even Apple AAPL). My sources also warn me that acquisitions with multiple buyers are not things that can be predicted since there are many other factors (end-of-year tax write-offs, etc.) in addition to sheer randomness--a lesson for all forecasters.

SEP 26, 2016: The Random Stock Walker has been keeping his ear to the ground and hears word from knowledgeable and interesting people (who may just be trying to distract him from other research) that Twitter is about to be sold (TWTR is the stock symbol link where you will find that analysts are being very public about a Google takeover). My first question is when might this happen?

The time plot above displays the attractor path for TWTR (the dashed red line) and the 98% bootstrap prediction intervals (green and red dashed line). Currently, TWTR stock is in an area of improbably high valuation (above the upper 98% prediction interval). If we look at when the prediction intervals will hit zero (a better time to buy the company rather than right now) you can see that the model is predicting either a sale (or a collapse of the stock and maybe the company) sometime in 2017.

Let's now wait until next year and see how good the Random Stock Walker Models actually are.