Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Moving average in graphs for trend identification #1718

Closed
anonymous-piwik-user opened this Issue · 6 comments

3 participants

@anonymous-piwik-user

Hi, I'd like to see a simple moving average line in some graphs, mainly visitors.

Rationale: On daily graphs, peaks are not uncommon. Those make it hard to see if the overall trend goes up or down.

Enter The Moving Average Indicator.

I suggest a 5-day moving average, this would result in 6 more data points that will have to be rendered in the default 30-day-view.

Thanks for your consideration!
Keywords: wishlist

@robocoder
Collaborator

A 5-day moving average means that each day we also compute the average over the last 5 days. On a 30 day view, that's 26 or 30 data points, depending on the implementation.

Where period != day, the moving average is less useful because aggregation also has a smoothing effect on data.

Such a feature would be nicer if OFC had the ability to smooth a line via bezier curves / cubic splines.

@anonymous-piwik-user

Replying to vipsoft:

A 5-day moving average means that each day we also compute the average over the last 5 days.

You're right, my bad. Thanks for checking the numbers.

Where period != day, the moving average is less useful because aggregation also has a smoothing effect on data.

Exactly!

Such a feature would be nicer if OFC had the ability to smooth a line via bezier curves / cubic splines.

Oooh, that would be cool!

@anonymous-piwik-user

Here's another wrinkle. I have several sites where the weekday usage is several times the weekend usage. A straight 5-day moving average, which would be a great idea for many sites, would be misleading in this case. It would fit my use case here much better if it was possible to exclude certain days from the 5-day average - i.e. use the last 5 weekdays and just skip over the weekends. Or better yet, have one moving average for just the weekdays and another for just the weekends.

@anonymous-piwik-user

I don't think excluding specific days is the right way to go here. After all, I am suggesting a SMA to flatten peaks and see a smooth trend over time, without re-introducing separate data points.

@anonymous-piwik-user

The complication in my case is that I basically have two smooth trends over time: the weekday trend and the weekend trend. This might be out of scope; if so, I can just not use the moving average feature for these sites.

Actually, the other moving average that would be useful would be to see both the most recent, say, Tuesday's number, and the moving average of the past 5 Tuesdays. Just food for thought.

@mattab
Owner

I don't think we will implement this in core, but if a patch comes in we will definitely consider.

@anonymous-piwik-user anonymous-piwik-user added this to the Future releases milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.