danvk / dygraphs

Interactive visualizations of time series using JavaScript and the HTML canvas tag
http://dygraphs.com
Other
3.17k stars 605 forks source link

Summaries other than rolling average #318

Open danvk opened 9 years ago

danvk commented 9 years ago

From danvdk on August 19, 2009 02:28:42

Rolling average has its problems. It would be nice to support other ways of aggregating data, e.g. centered moving average, replacing N data points w/ {min, mean, max}, etc.

Original issue: http://code.google.com/p/dygraphs/issues/detail?id=9

danvk commented 9 years ago

From raoulwis...@gmail.com on April 07, 2010 10:43:59

And maybe add the possibility to use more fine-grained rolling average periods instead of days (eg hours, minutes, seconds)?

danvk commented 9 years ago

From da...@google.com on April 07, 2010 13:07:17

re: raoulwissink: The rolling period is in terms of points, not in terms of time. So if your data is hourly and you set the rolling period to 10, you'll get a 10-hour average.

danvk commented 9 years ago

From raoulwis...@gmail.com on April 07, 2010 13:46:40

Hi Dan, thanks for the quick reply :) I probably was mislead by the provided examples, as they all deal with datasets spanning over multiple days. Dumb enough I didn't even try values bigger than 1 (day) as my data spans over several hours, not days...

danvk commented 9 years ago

From gary.oik...@gmail.com on November 10, 2011 11:03:31

I would really love to see something that can smooth noisy data, yet still preserve the observed minimums and maximums. So something like a rolling minimum or rolling maximum would be interesting.

I'd be cool if one could visualize the smooted average and yet still see the underlying raw value.

Anyways, just my 2 cents...

Thanks.

danvk commented 9 years ago

From tjstans...@gmail.com on November 28, 2011 11:21:13

I would find the min/max support very useful as well since I'm using the errorBars to show min/ave/max. When we use rolling averages, the min/max get averaged, which isn't really what we want.

Todd

danvk commented 9 years ago

From differe...@gmail.com on December 22, 2013 10:41:34

I vote for polar moving average. It's easy to implement and is useful for example for wind direction graphs. http://en.wikipedia.org/wiki/Mean_of_circular_quantities

taismi commented 8 years ago

Rolling average is problematic. It causes delay which is interger number of rollPeriod/2. This could be fixed for odd rollPeriods. For even roll periods there is always delay 1 but that would be acceptable.

Average is not very good filter (sinc function in frequency domain). For example butterworth filter would be better. Butterworth filter is easy to convert from lowpass to highpass, bandstop and bandpass filter. For lowpass filter you need only two parameters. One is cuttoff frequency and other is order of the filter.

taismi commented 8 years ago

Maybe there could be filter functions like there is plotter functions. 'filter: filterfunction' like plotter: plotfunction'. Filter function could be set per series and dygraphs would give one dimensional array on data points to be processed by filters.