Opened 4 years ago

Closed 3 years ago

#1718 closed New feature (wontfix)

Moving average in graphs for trend identification

Reported by: awendt Owned by:
Priority: low Milestone: Future releases
Component: Core Keywords: wishlist
Cc: Sensitive: no

Description (last modified by vipsoft)

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!

Change History (6)

comment:1 follow-up: Changed 4 years ago by vipsoft (robocoder)

  • Description modified (diff)
  • Milestone set to Features requests 1.x or 2.x

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.

comment:2 in reply to: ↑ 1 Changed 4 years ago by awendt

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!

comment:3 Changed 4 years ago by ian

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.

comment:4 Changed 4 years ago by awendt

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.

comment:5 Changed 4 years ago by ian

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.

comment:6 Changed 3 years ago by matt (mattab)

  • Keywords wishlist added
  • Resolution set to wontfix
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.