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.

Tuesday, July 8, 2014

Fiction or Forecast: Gold Will Hit $1,450 an Ounce This Year?


The Random Stock Walker just read a Tweet from The Street on How Gold Will Surge to $1450 an Ounce Before the End of the Year. This immediately caught my attention and the results of looking at this question are interesting. If you have been following this blog you know that our algorithm has not found many random walks among the stocks we've looked at (possibly contrary to Fama and Malkiel). Here, however, we have found a few random walks (someone tell the Chicago School).

In the video above, Scott Carter, CEO of Lear Capital, tells The Street that the US economy is not as strong as investors might think and that, as a result, equities and bonds will not perform very well leaving gold an attractive investment that will drive up the price. Mr. Carter is not advocating going out and buying gold bullion but rather, as the article notes (here), GLD (the SPDR Gold Trust ETF), IAU (the iShares Gold Trust ETF) and SGOL (the ETFS Gold Trust).

On the other hand, the Market News attached to the Gold ETFs doesn't sound great: Can Gold ETF's Continue to Shine?, Gold ETFs Gather Assets, But Market Remains Murky, Tarnished Gold ETFS Try to Glimmer, etc. In another article (here), analyst Chad Morganlander of Stifel's Washington Crossing Advisors says that "For the next six to 12 months, gold will be down roughly 5 to 7 percent." Not exactly a collection of rousing endorsements. Can the Random Stack Walker add anything to the confusion?



The two time plots above present forecasts for GLD and SGOL. The dashed red line is the forecasted path for the stock price and the blue and green dashed lines are the lower and upper 98% bootstrap confidence intervals for the forecast. The actual stock price is the sold black line. The forecasts for these two ETFs are resoundingly negative. What is perhaps more interesting is that the best step-ahead prediction model for SGOL and GLD is a random walk. The best attractor models (see the note below) for both GLD and SGOL are driven by the state of the World System (generated by the WL20 model). Unfortunately, both ETFs are negatively related to an important state variable for the World System which is dominated by Oil Prices. Since the WL20 model predicts oil prices to increase with Peak Oil, the increase is going to have a strong negative effect on GLD and SGOL.


IAU, on the other hand, is not a random walk. Both the step-ahead and attractor models for IAU are being driven by the World System (the WL20 model) but the price of IAU is strongly related to Oil Prices. From the time plot above, IAU went through a phenomenal crash towards the end of 2010. Investors would tend to be cautious of a stock with this level of volatility. However, the crash is well predicted by the WL20 model.


The time plot above shows the attractor path for IAU which begins decreasing in 2009 even though the stock price keeps climbing until 2011 when it crashes. For the future, IAU is predicted to take off around 2015 even though it is quite flat right now.

What does the Random Stock Walker analysis have to say for the investor? (1) Gold ETFs behave differently. (2) The best reason to invest in these ETFs is not as a hedge against US economy performance or government policy but rather as a hedge against oil prices. (3) You might have to either ride IAU through future world-system crashes or be prepared to sell the stock when the attractor path diverges from the stock price as it did in 2009 (this is a particularly great example of a sell-high and buy-low strategy based on an attractor path). (4) It's unlikely that Gold will reach $1,450 and, if it does, it's a bubble.

NOTE: A step-ahead prediction is basically the standard regression model you learned in Stat 101 applied to time series data. The next period's stock price is predicted from last period's stock price plus possibly some exogenous variables. The random walk model is P(t) = P(t-1) + E(t-1), that is, the current stock price is last period's stock price plus random error, E. The regression coefficients on the Random Walk model are a = 0 and b=1. The residuals (errors in E) are computed from P(t) - [a + B P(t-1)] = E(t-1). In the attractor model, the residuals are P(t) - P*(t) = E where P*(t) is the simulated time path of the model starting from time zero (around 2005 for the ETFs). This is called a free simulation since the P(t-1) values are not used as they are in the standard regression model. Not many models can meet this test, that is, generate a reasonable attractor path (the dashed red line in the last graphic above). Best models were chosen using the AIC criterion. The Random Stock Walker models for GLD, SGOL and IAU can all be downloaded here with instructions for their use available here.

Tuesday, April 8, 2014

The NASDAQ Bubble Pops!



CNBC commentator Jim Cramer finds the current NASDAQ "sell-off" dramatic and extraordinary. Cramer hasn't "...seen this sort of thing since the NASDAQ peaked in the year 2000." Since the NASDAQ index is primarily composed of tech stocks, Cramer thinks there are too many tech IPOs chasing too few dollars. What's going on?


If you're one of the investors that think the NASDAQ has been primed to take off since 2013, you probably thought the heavy red line in the graphic above would describe the growth path in 2014 and you would have been shocked by the sell-off. If you were a traditional chartist, plotting highs and lows, you might have thought the correction had to happen eventually, so you are not all that surprised. But would any of these investors have thought the NASDAQ was in a bubble as did economist Robert J. Shiller (here)? Many stock analysts were arguing that the NASDAQ was definitely not in a bubble.

The dotted green and blue lines above are the 98% bootstrap confidence intervals in the NASDAQ composite index (^IXIC) dynamic attractor path (the dashed red line). The dynamic attractor path is being driven but the US economy and the US economy has not been growing at a rate that would support NASDAQ 4000 until sometime well into 2015 (Cramer hints at this when he says that "...some actual growth in the economy...opens up the possibility of much higher earnings of traditional techs..." Of course, the opposite is also true with low growth!).


Taking a little longer perspective, as Jim Cramer tried to do when recalling the 1997-2000 dot-com bubble, it is easy to spot the stock bubbles from the NASDAQ dynamic attractor path (above). It is also easy to see how wrong analysts can be when drawing take-off lines on graphs. Also notice that the long-run forecast for the NASDAQ is not really great after 2020. Your intuition about attractor paths should tell you why: the forecast for the US economy is not that great!

Returning to Jim Cramer's observation that "too many IPOs are chasing to few dollars," IPO activity might be one signal at the beginning of a bubble and the shortage of investment funds might be another signal that the bubble is going to pop.