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, June 28, 2011

First Solar: A Good Test For Technical Analysis

In April (here) and November of 2010 (here) and again yesterday (here), analysts have been warning investors to short solar, particularly First Solar (FSLR). The consensus appears to be that political problems threaten solar subsidies, technological problems threaten existing production processes and competitive pressure is forcing the smart money to leave solar. Since the average investor can't beat the smart money, it's time to be short FSLR.

Reading the political, technical and market analysis is enough to make me queasy. Interestingly, my best forecast paints a different picture (with a lot of uncertainty). Watching FSLR over the next few years could be an interesting test case of whether statistical methods are adequate for investment analysis.
The graphics above displays my stock forecast for FSLR. The best model, selected using the AIC criteria, showed the FSLR stock price being driven by the state of the world economy. The forecast is for positive future growth.
The attractor model (displayed above) is also driven by the world economy and produces a similar forecast. The attractor model also suggests that the price peak in 2008 was driven by an investment bubble.

The problem with the forecast is that there is not much differentiation between competitor models (the random walk, the business-as-usual model or the models using FSLR volume or the state of the US economy as input variables). The confidence intervals around all the AIC statistics (created by bootstrap resampling) are all within the same range, 266 to 280. In other words, even though the AIC criteria will select a model, we can't be very sure it's the right model.

In spite of a positive forecast, the statistical results suggest not investing in FSLR simply due to uncertainty. It will be interesting to follow the stock and see where it goes over the next year.

Wednesday, June 22, 2011

FedEx: Cramer Was Right!














On tonight's MadMoney (here) analyst Jim Cramer suggested that FedX (FDX), given its better than expected profits in 2011, is doing three things right: (1) Expanding outside the U.S., (2) Expanded its aircraft fleet and improved its technology and (3) Positioning itself as the "Internet play on transportation".

To the Random Stock Walker, this commentary suggests that FDX should be strongly driven by fundamentals in the world economy. In fact, the world-economy model did win out over all the other competitors (see below).
The forecast out to 2015 indicates continued growth or, at worst (the lowest 98% confidence interval) value maintenance.
In the graphic above, the FDX attractor is plotted with confidence intervals. The stock is currently just slightly above the attractor value (91.44 at close today). It's being overwhelmingly rated a BUY by analysts (here). Price targets should keep climbing over 100 for the next few years.

TECHNICAL NOTE: FDX is one of the unusual stocks where the forecasting model and the attractor model were both driven by the same input variables, in this case the state of the world economy. The bootstrap confidence intervals P[96.83, AIC=102.1,106.7] for the AIC criterion measure are clearly better than any other model (random walk, business-as-usual, US economy, Sp500 or FDX volume) with AICs all above 1200.

Wednesday, June 15, 2011

SBUX: A Cup of Cold Joe















Analysts are trying to form an opinion on Starbucks (SBUX). Jim Cramer, in the video above and here, talks through some of the technical analysis but still feels that (1) customers connect with the company, (2) there is tremendous international upside and (3) the smart money will soon be back in because SBUX is "a story that's working".

Cramer mentions Dan Fitzpatrick's negative view of the stock based on technical analysis (here):

Over on Fast money Tim Seymour is really bullish on Starbucks (SBUX) he thinks this is one that you gotta be owning as well on so I'm looking here at the daily chart. Fifty day moving average really seems pretty relevant here the stock has always been above that for the last several months. Tight little consolidation. In here. And finally -- break out to the upside with prior resistance here. Really kind of -- in support affect the stock's been trading up above that level you can even say it's and another little trading box so. We've got a series of steps higher we look at the weekly chart -- you can really see this nice uptrend. Let the bottom line is the stocks penetrating along this upper Bollinger band here. Difficult to kind of trade the stock because it's and -- low volatility so here's what you do you just take a little bit -- stock. Right here right now if the stock pulls back to the fifty day moving average let's zoom in there and we take a look at that. The stock pulls back to this fifty day moving average of maybe a couple bucks cheaper than it is right now that's when you buy some more so one way or another year involved with the stock breaks out here you got a little bit -- happy. If it pulls back you can get a little bit more your happy. And if it breaks all the way down here well guess what the only reason you have bought that second amount is if the stock showed signs of bouncing so you're kind of happy that you didn't buy more...

The average analyst recommendation from Market Watch (here) is OVERWEIGHT with an average price target of 41. What does the Random Stock Walker think?


Given Cramer's comments, I expected to find the SBUX attractor being driven by the world economy, but the best attractor model (above) was driven weakly by the SP500. SBUX has had some wide excursions above (2005) and below (2009) its attractor but has always returned to a narrow range between 20 and 40. A sell target above 40 is probably reasonable given error bands for the attractor (see below).
For the future, however, the forecast is mildly downward stabilizing between 30 and 35. I don't see much upside in this stock unless SBUX can link more directly to the world economy.

TECHNICAL NOTE: The SP500 input model had good power against all the alternative models tested (random walk, business-as-usual, US economy, World economy, and SBUX volume as an input variable). The AIC was 80.76 [77.6, 84.57] while the AICs for all the other models were above 680. My future forecast for the SP500 shows slow growth through 2012, which differs from the forecast being provided by the Financial Forecast Center (here).

The attractor confidence intervals are presented below. Notice that the step-ahead forecast confidence intervals (above) and the attractor confidence intervals are very different as are the forecast and attractor fitted values (dashed red lines). The attractor values are based on a "free simulation" starting at the beginning of the sample while the forecast values are based on one-month step-ahead predictions. The attractor values clearly demonstrate the periods when SBUX was either over- or under-valued relative to the SP500 i.e., the "bubbles". The future forecasts are similar only in that SBUX is currently very close to its long-run attractor value.