A while back, I had to explain to two high school kids what the parameters in a Gaussian filter are all about, and so I made a thing. For anybody who doesn’t know, a Gaussian is essentially a bog standard normal curve. It’s shape is more or less defined by two things: mu (also known as the mean) and sigma (also known as the standard deviation).

In this situation, we were looking at building a normal curve around days. The mu controls how many days get factored into the computation (which is why it’s also called the window), whereas the sigma says how important each day is. Days closer to the center (mu) are far more important when the sigma is low (narrow), but all days are treated more or less equally when the sigma is wide (high).

This curve then gets multiplied with the first 30 days of a dataset and that number is averaged to produce a value for day 30, and then the process is repeated for days 1-31, then 2-32 and so on in what’s called a rolling_window. This technique is often used to account for variability in the data and observations that are sometimes highly related. Here it’s used to pull structure out of a really spiky rain pattern and-and yes a larger window will almost always yield a smoother pattern: (Note: MA stands for moving average)