Minasan, Watashiwa Wawan Desu...

NurCell Movies

Friday, February 4, 2011

Rolling Averages, by a Math Moron

My mom's a PHD physicist. My dad, a PHD engineer. By the time I was 13 they'd both given up on any dreams of me being a math genius and instead hoped I'd finally count to 20 without removing my shoes.

So, when I click 'publish' for this post, I'm going to flinch a little, waiting for someone who's actually math-competent to call me out as the fraud that I am. But I'm writing this anyway, because some folks responded to last week's 11 Things Post by saying stuff like "OK, wise ass, explain some of this stuff."

What's a Rolling Average?

A simple rolling average (also called a moving average, if you wanted to know) is the unweighted mean of the last n values.

My first reaction when I read a definition like that was, "Buh?". Maybe it made sense to you, but to me it's total mathinese.

Here's my definition of a simple rolling average: An average of the last n values in a data set, applied row-by-row, so that you get a series of averages.

Buh?

OK, try this example. The column on the right is the rolling average:

rolling-average-image.gif

See how that works? I'm just taking the average of the last 7 rows, all the way down the column. That's a simple rolling average.

And trust me, I stop at 'simple'. If you want to learn more complex rolling averages, read the Wikipedia page.

Why Use a Rolling Average?

A rolling average can help you find trends that would otherwise be hard to detect. Using the data from above, you get a graph that looks like this:

normal-data-graph.gif

That's not terribly helpful as a trend detector. It looks like my website got a case of the hiccups.

Use a rolling average, though, and you start to see a pattern emerge, with peaks happening more and more often:

rolling-average-graph.gif

That's why rolling averages are so useful: Apply them at the right time and you can get an idea of emerging trends, even if those trends are happening because of sudden jumps in your data.

I'll stop there. Math-competent folk, feel free to leave endless comments about how I just mangled your favorite concept...

No comments: