Moving Averages - The First Step To Forecasting Your Blog’s Health
A Moving Average, or MA, is an important metric (measure) in statistical analysis of real-world data. MAs are actually used to analyze stocks and indexes in the stock market. In fact, I used MMAs (Multiple Moving Averages) in 2000 to correctly predict 3 of 4 significant stock market turns. But you can also use MAs to analyze your web traffic, ad clicks, click-thru rates, and ad revenue. I use MAs on a daily basis to watch my blog trends, and to make a prediction of what might happen in both the short-term and the long-term. So far, MAs have stood me in good stead. I’ll get into weblog forecasting in the near future. First, I’ll show you how to calculate and graph an MA.
An MA provides a moving or rolling average of a specific metric. For the sake of argument, let’s say that we want to analyze web traffic, specifically pageviews. Suppose we have a set of numbers representing legitimate pageviews for every day for the past 6 months - say 183 days. The simplest MA uses a window of 7 days. The notation for this is 7d MA. You can use different windows of time, but let’s leave that discussion for another article.
To calculate the 7d MA, we need to slide a 7d window across the 183 days of data, and calculate the sum and average for every 7 day window. For example, to calculate the first 7d average, we sum days 1 to 7 and divide by 7: MA1 = Sum(a1..a7)/7 = Sum(S1)/7 = (∑ai (i=1..7))/7. The value S1 is actually the subset of numbers for days 1 to 7. The second MA is calculated by taking the average of pageviews for days 2 to 8: MA2 = Sum(a2..a8)/7 = Sum(S2)/7 = (∑ai (i=2..8))/7. The third MA is the average pageviews for days 3 to 9: MA3 = Sum(a3..a9)/7 = Sum(S3)/7 = (∑ai (i=3..9))/7.
By now, you should see the pattern. We’re always summing 7 days of pageviews (or whatever) and calculating the average. Had the window been 28d, we’d always be summing 28 days of the metric and calculating the average. Since in this example, we only have 183 days of data, the final MA will be the average of pageviews for days 177 to 183: MA177 = Sum(a177..a183)/7 = Sum(S177)/7 = (∑ai (i=177..183))/7.
Notice that we’ll only have 177 MA values for the graph. If we are comparing the MA values against the originally daily traffic, there’ll be a gap at the beginning of the 7d MA graph of 6 values (window size minus one). Somewhere on this page, you’ll see an example 7d MA graph plotted against the original daily traffic. You’ll be able to tell the difference because the 7d MA curve will be smoother than the daily curve. In fact, as you increase the MA window size, the resulting MA curve gets smooother and smoother. Unless weird things are happening on your blog(s). But more on that later.
(c) Copyright 2006-present, Raj Kumar Dash, http://www.mathgurusonline.com/
Technorati Tags: mathblog, math blog, moving averages, rolling averages





[…] A Multiple Moving Average, or MMA, is a collection of Moving Averages (MAs), plotted together to simultaneously show short- and long-term trends. As with MAs, MMAs can be used to detect trends in any type of real-world data. They’re used in the stock market, but I use them to analyze my website and weblog metrics (traffic, revenue, etc.). […]
[…] The answer is to use a bit of forecasting, as discussed in the last several posts, and to approximate the amount of bandwidth currently being used daily or monthly. Then you can approximate when you might exceed your current hosting plan under normal traffic growth. (Please first read my previous “forecasting” posts, if you have not already done so.) […]
[…] The free MMA spreadsheet from my last post can be used in a number of ways. It’s currently set up with MA (Moving Average) windows of 7d, 14, 28d and multiples of 28 days. In the stock market, there’s a tendency to use windows of 100 d and 200 d. Why? Well keep reading. […]
[…] Web analytics is the study of website metrics. It’s about watching the trends of metrics day by day or week by week, charting the daily changes, determining average performance (Moving Averages, Multiple Moving Averages), devising trendline analyses (using advanced statistical methods), trying to determine why the metrics are the way they are, and what you might do about it. This ties in directly with the next step in the process, optimization. […]