Are Recessions Memoryless?

I'm saving to buy my first home. The stock market has generally been doing well, but I'm thinking about what happens if there's a recession. 

One reason you often hear that there could be a recession is that we're "due for one", or it's just been a while since the last recession. 

This is an interesting notion to me, so I read what people have to say. One intriguing letter, Will the Economic Recoery Die of Old Age,  uses survival analysis to argue that there is no evidence to suggest recessions are correlated to the amount of time since the last recession. I thought it was a really cool and interesting take out of the San Francisco Fed, so I decided to look closely at the author's argument. When I looked at the underlying data, though, I disagreed!

A thought experiment

Let's for a moment think of two competing hypotheses for how recessions might happen over time, which we'll call Universe A and Universe B.

In Universe A, recessions are independent, random events. Every year, there's a 10% chance that one will happen. If you've made it five years without one, your conditional probability of having a recession is no different than if you made it two years without one, or ten. In Universe A it's not about the length of the recovery, recessions happen because of other unrelated factors -- a housing bubble, inflation, etc. Expressing this in code, let's represent this like a coin flip each year; heads for growth, tails for recession

To simulate, we flip this coin many times and see how long the economy maintains runs of growth:

A histogram of n=10,000  simulated growth period looks like this:

Universe B has recessions from business cycle theory that you hear about in a macroeconomics class. They are, cyclical, or time-correlated. Growth periods are like tidal waves; they rise fourth and crash of their own volition.

In Universe B we modify our simulation to incorporate a time parameter:

The larger the time t from the last recession, the less likely you are to have a growth year. And to simulate

Here's the corresponding ten-thousand-trial distribution of this process:

As an aside, the intent of this thought experiment is to develop a mental picture of what these phenomenon might look like. We've set this problem up in a discrete fashion like coin flips. Universe A is a geometric random variable, but the continuous analogue is whether or not recessions do or do not look like an exponential distribution, which is often used to represent times between events, and is a memoryless processes.

Observing recessions

With this framework in mind, let's consider some real data. Here is some recession data from the St. Louis Fed tagging month-by-month if the US economy is in a recession. One important question is how far back can we look to think about recessions today.  Does a recession in the 1850's relate to a possible one in 2018? Here's a plot of a three year moving average of if the US Economy was in a recession or not, for as long as the Fed has published data on this:

I feel fine splitting this up at the Great Depression (the author did at World War II but I see no reason to omit the decade or so in between). Binning this by the "runs" of economic growth in the economy by number of months, we get a histogram like this:

To my eye, this recession histogram looks more like the time-dependent scenario. But let's suppose it wasn't. Proceeding with Universe A hypothesis, the best fit exponential distribution has a probability plot like this:

It's not a good fit (a Gamma distribution is a lot closer), and any nonparametric test would support the notion that this data is not generated from an exponential process. And that's my problem, here. Universe B to me seems like a more plausible hypothesis to me given the recessions we've observed for the last ninety or so years. The author made different considerations, I'm sure, but the underlying mechanics don't seem great to me.

There's a lot more to consider, obviously, but I think this is an interesting question. Please let me know what you think!

Password generator

Even as a judicious password manager user, I'm really good at losing them! Some password generating tools keep a log of some of the recent passwords they've created, and I find this quite useful. So I made a little command line tool that makes me passwords and keeps an encrypted log of past invocations. Here it is.

Sri Lanka, 2018

(Click on the individual enlarged photos to see in higher resolution.  Posthaven's default viewer is a bit grainy.)
Colombo, Nuwara Eliya, and Kandy, Sri Lanka

Chocolate Fudge Recipe

Transcribed from my grandma's recipe card.


  • 4 cups sugar
  • 1/4 pound butter
  • 1 large can pet milk (condensed milk)
  • Two packages of chocolate chips
  • One jar of marshmallow fluff


Bring sugar, butter, and milk to a boil, and boil for 7 or 8 minutes. Stir constantly. Remove from stove and add 2 packages of chocolate chips and 1 pt of marshmallow cream, pinch of salt, mixing together. Pour in baking dish to cool.

Personal notes on setting up Debian 9 on a Dell XPS 13

I've been running Debian 9 on my laptop for the past few days and it works great! This was my first time booting Linux onto a laptop and it was not too bad. I definitely made some first-time mistakes, but after getting set up the machine has been stable and smooth.

Here are some personal notes on my experience and things I wish I knew before starting.

Useful resources

First-time mistakes

  • Choose LTS: Following a guide, I wound up with a test version of Debian. I shrugged at this fact at the time, but the biggest issue with it is that the primary package management sources /etc/apt/sources.list ends up being not the same as what everyone else has, and is a pain to debug and hard to find resources on. You want your package manager to work; it's one of the nicest parts of having a linux machine.
  •  Have a plan for editing BIOS settings. You should know exactly what you're going to change, and why you're going to change it. I probably had 3 or 4 false starts from fiddling too much with them and it can add a lot of time onto the setup.
  • When booting from USB, don't pull out the USB.
  • dd is a dangerous command, but you're going to have to use it to set up your USB. Fortunately I was careful here and didn't wipe my girlfriend's hard drive (hi Nidya!). On a Mac, use the diskutil utilitity for everything and tread lightly.

Weird stuff

  • Do the non-graphical install (there's probably something to this but it's the only one I could make work).
  • USB drives are slightly difficult to run down! CVS carries them at the counter.
  • For some reason, the BIOS menu never found the right-hand-side USB but could boot from the left-hand-side. If having trouble here try to round-robin the inputs.

Getting off Twitter

I'm taking a break from Twitter, a place I love (!), but am finding too easy to obsess over. I have like five legitimate followers so this shouldn't be a big deal, but it feels like one.  Maybe I'll come back later.

If you want to reach out to me online, you can send me a note on Keybase!

Pico de Gallo Recipe

My girlfriend and I make this easy recipe for pico de gallo and it is really good. From Richard Sandoval's New Latin Flavors


  • 12 ounces large tomatoes, seeded and cut into 1/2 inch dice
  • 2 tablespoons finley chopped red onion
  • 1 tablespoon finely chopped fresh cilantro
  • 1 tablespoon fresh lime juice
  • 1 serrano chile, seeded and finely chopped
  • 1 teaspoon soy sauce
  • Kosher salt


Combine all of the ingredients in a medium bowl. Cover them with plastic wrap and refrigerate to chill and blend the flavors, at least 1 and up to 8 hours.

kb, a command line tool for storing passwords

I made a little command line tool for saving passwords: It uses keybase to handle all the encryption.


There's random cases where I have to type in passwords into a terminal (vpns, git repos with ssh disabled, etc.).  This is simple and just stores the ciphertext in a keybase folder, and reads it out of there. I at first looked at a few more polished tools like pass, but I really don't like using GPG unless I need to. It's not hard to add password sharing from here, if there's ever a need. 

Feel free to try it out, make a PR, etc! Maybe someone else will find it useful.