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.

Sunday, October 20, 2013

A Random Walk Through Old Stockholm


On October 14, 2013 Eugene Fama, Lars Peter Hansen and Robert Shiller were jointly awarded the Nobel Prize in Economics. Each recipient's award was given for topics of interest to the Random Stock Walker: Fama for his work on the Efficient Market Hypothesis (EMH) which is closely related to the Random Walk Model; Hansen for his work on the Generalized Method of Moments (GMM) estimator (a semi-parametric model related to the non-parametric bootstrap); Shiller for his work on economic bubbles (his approach is closely related to Attractor Theory). The 2013 Nobel Prize in Economics is also interesting because the work of Fama and Shiller seem, on the surface, to contradict each other. In future posts, I'll discuss each researcher's work in detail (also see John Cochrane's blog, here, and the Noah Opinion blog, here, here, here, here, here and here). For right now, here is the Random Walker summary:
  • The strong-form of EMH asserts that all stock prices are a random walk because all information is immediately reflected in the stock price. The random walk is one of the models that is always tested by the Random Stock Walker, essentially as a null-model. Fama has been particularly critical of economic bubbles and Technical Analysis, arguing that in the short-run active management and fundamental analysis add nothing that isn't immediately available in the stock price.
  • The GMM estimator is semi-parametric in that normal theory is not required for every part of the model. The bootstrap is non-parametric and makes no assumptions about the mathematical form of the model error distribution.
  • Shiller used the ex-post rational price (the discounted sum of actual dividends) as the assumed attractor for a stock price. Shiller shows that the actual price varies a lot more than the ex-post rational price. This is a form of fundamental analysis which not only contradicts the EMH but also begs the question of what drives the ex-post rational price. The Random Stock Walker submits a collection of other fundamental models (business-as-usual, US economy, World System, Market Index, etc. along with the Random Walk) to multi-model inference using the Akaike Information Criteria rather than using probabilities drawn from the normal distribution.
From the Random Stock Walker perspective, this is the most interesting Nobel Prize in Economics. The implications for investing (favor low-fee index funds, invest for the long run) are important to understand but incomplete (how does the buy-and-hold strategy relate to stock market bubbles, particularly when the bubble pops just when you need retirement funds). The implications for economic theory are profound (are consumers and investors really profit maximizers or are they just trying to survive in a very uncertain world). The purpose of the Nobel Prize in Economics should be not just to reward achievement but also to draw our attention to a body of work that has important implications for the future development of economics. From the perspective of the Random Stock Walker, the 2013 Nobel Prize did all these things.

The title of this post is derived from a book by Burton Malkiel title A Random Walk Down Wall Street. The Nobel Museum is located in Old Stockholm at Stortorget 2, 103 16 in Stockholm, Sweden. Here's an appropriate if somewhat nerdy question: How long would it take you to find the Nobel Museum if you started at the Myntgatan bridge in Old Stockholm, flipped a coin and used the result to decide which way to turn at each interaction, that is, took a random walk through Old Stockholm?

Tuesday, May 14, 2013

ADR: Should Sony Be Broken Up?



In somewhat of a minor market bombshell announcement (here), Third Point Hedge Fund Investor Daniel Loeb called for the breakup of the multinational conglomerate Sony (the Sony group includes electronics, motion pictures, music and financial services). The argument, discussed in the Bloomberg video above, is that parts of Sony, particularly the US-based Sony Pictures Entertainment, doesn't really fit the rest of the company and should be spun off.

The issue that caught the attention of the Random Stock Walker was whether or not it would be best for Sony to disengage from the US economy. After WWII and until the 1980's (the beginning of Neoliberalism and Globalization), Sony was a dynamic company linked closely to the US market. They originally licensed transistor technology from Bell Laboratories and found a large US market for the Walkman. Sony acquired Columbia Pictures in 1989 and the CBS Record Group in 1989. The argument to divest the US-based business units seems to be based on culture fit. A more interesting question is whether Sony would be more successful as an electronics supplier to the World economy, allowing the company to be driven by the World economy as I have show Apple is (here).
To test the Sony break-up proposal, I ran two state space models. In the first one, the Sony stock price (ADR) was driven by the World economy and, in the second one, below, by the US economy (the testing was a little more far ranging, but these were the two best models). The attractor forecast for a world economy-driven Sony shows exponential growth for the future (the black line is the actual stock value, the dashed red line is the dynamic attractor path created from a free simulation, and the other two lines are the upper and lower 98% bootstrap prediction intervals). Although Sony stock has had some brief "bubble and trough" years around 2008, 2009 and 2001, the stock has generally followed the cyclical path of the world system.

The same can be said for the model driven by the US economy. In fact the attractor tracking seems to be somewhat better. However, the future projection does not look very good. In fact, the attractor path seems to suggest that tracking the US economy too closely is driving much of the cyclicality in Sony stock.

The obvious conclusion from these two simulations is that Sony must link its fortunes with the World economy and make sure it is insulated from cyclical forces transmitted from the US economy. Whether this means spinning off the US entertainment divisions, however, is another matter. Everything depends on how much of their revenue is driven by the world economy, and that would be require a detailed level of analysis that the Random Stock Walker does not pursue!

Monday, May 13, 2013

Are We In A Stock Market Bubble?

In a recent tweet (here), political economist Robert Reich issued a "Wall Street Bubble Alert" referencing a Business Week article (here) in which Goldman Sachs claims that "...the market is at or above where it should be trading." The CNBC technical analysts, however, don't see it that way.



In the video above, technical analyst Michael Harris claims that "..from a trend-channel perspective, this is one of the most beautiful patterns I have seen in some time."

I've duplicated the "trend channel" (sometimes called a price channel) in my forecast at the beginning of the post. The graph of ^GSPC (the S&P 500 index) shows the actual index path (black line), the dynamic attractor path (dashed red line) and the upper and lower 98% bootstrap prediction intervals (dotted green line and dot-dash blue line, respectively). The "trend channel is presented as solid heavy red lines. My attractor forecast shows that the S&P 500 index is above the 98% bootstrap prediction interval and this may be the start of a stock market bubble. Whether we are in for another massive bubble, such as the one centered on 2000, remains to be seen.

Technical analysis focused on trend channels misses all this because the time period considered is restricted to the start of the last upswing. The trend channel, to be clear, is simply constructed by connecting peaks and troughs from the start of the last upswing. That's it. There's nothing more to the trend channel than plotting lines by hand. Since this kind of analysis is quite common on Wall Street, it may actually contribute to the development of a market bubble if it is believed by enough investors. If you follow this type of technical investing model, your dilemma will be "when to get out of the market," that is, when will the bubble burst. Trend channel analysis doesn't have much to say about that issue and neither does attractor analysis, which is saying right now to start selling since the S&P 500 is above the 98% upper bootstrap prediction interval.

It will be an interesting summer in the stock market!