# Netflix Post-mortem – How to detect Bubbles

October 26, 2011
By

(This article was first published on DataPunks.com » R, and kindly contributed to R-bloggers)

Bubbles. I’m no expert in behavioral economics, but bubbles seem to be well understood (after they occur) although they seem hard to detect (at least in the eyes of outsiders and late bubble participants). This post won’t tell you how to avoid bubbles, but might give you some insight.

I came across Minsky’s explanation of bubbles (vulgarized), hidden in a comment from this post from The Big Picture, and the part about market invasion by outsiders stuck to my head (see right quote).

Increasing prices are not enough for a bubble. Every financial crisis needs rocket fuel and there is only one thing that this rocket burns – cheap credit. Without it, there can be no speculation. Without it, the consequences of the displacement peter out and the sector returns to normal.When a bubble starts, the market is invaded by outsiders. Without cheap credit, the outsiders can’t join in.

Question: How do we detect if outsiders has invaded the market (from a measurement point of view)?

Obviously, this depends on the context and the way transactions are performed. Let’s look at two recent bubbles: the real estate bubble, and the most recent Netflix bubble.

For the first case, the real estate case, we’ll be looking at “Loans Secured by Real Estate“, available by the Federal Reserve Bank of St. Louis. By visual inspection, it looks like it behaved exponentially after 1995. One can convinced himself of this with the following half-baked code:

 ```o <- read.csv('data/loans.csv') o <- ts(cumsum(o[,2]), start=1985, frequency=4) plot(log(o))```

It looks like the cumulated amount of secured loans started exponentially a bit before 1995 up to just before 2010. Again, nothing is really precise in this post. One could use nonlinear fitting to see where things really started and went bust. If it really did expand exponentially, the bubble wasn’t anywhere near sustainable. Note that this doesn’t argue whether we can have a “soft-landing” or a bubble bust.

For the second case, the Netflix 2011 bubble, let’s look at the cumulated volume in NFLX, and we can see the linear growth changed drastically in April 2010, a period we can attribute to the inclusion of outsiders (due to media over-coverage or some other factor).

 ```library(quantmod) getSymbols('NFLX') plot((cumsum(Vo(NFLX))))```

The second increased in linear growth might be attributed to the recent dump of the stock. To continue this analysis, one could use R for piecewise linear fitting.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...