After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 527489 - moving average enhancements
moving average enhancements
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Analytics
1.8.x
Other Linux
: Normal enhancement
: ---
Assigned To: Morten Welinder
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2008-04-11 07:03 UTC by Daniel Vianna
Modified: 2008-09-24 06:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Vianna 2008-04-11 07:03:47 UTC
In the Tools -> Statistical Analysis -> Forecast -> Moving Average function:

I would like to average a series of n cells by a k interval of consecutive cells (as it is presently implemented), but to have the output as n/k cells. That is, if I have n=10 and k=2, I would like to have the output as 5 cells with the corresponding averages.

I also have a question: is the moving average in Gnumeric 'prior' or 'centered'? Can one tweak it?
Comment 1 Andreas J. Guelzow 2008-04-11 14:26:03 UTC
Could you please elaborate on your second paragraph. I sounds to me as if you are simply asking for an average rather than a moving average.
Comment 2 Andreas J. Guelzow 2008-04-11 14:28:48 UTC
Regarding the last comment: what is the difference between "prior" and "centered"? I would think they are just a shift of each otehr, so you can just interpret the output accordingly.
Comment 3 Daniel Vianna 2008-04-11 21:41:39 UTC
'Prior' and 'centered':
http://en.wikipedia.org/wiki/Moving_average

About me wanting a simple average, yes, my description does sound like that. So correcting: I do want the moving average (and not a simple average), but I also need to trim the number of output cells in an orderly fashion, and due to the sheer number of cells I handle in each column (slightly over a thousand), I need it automated.

I wonder if the right approach would be to use the existing Gnumeric moving average, and then another existing (?) function to copy each (say) third cell to an adjoining field. I presently make the moving average/trim in one go, with a proprietary software (which acquires data for me), before exporting it to MS Excel format and then importing it into Gnumeric. I would like to do the same transform AFTER the export, but I'll need some flexibility in Gnumeric to to so, as they are not transparent on how their moving average is done. I'll need to run some tests, so I could match the results I get in that program.
Comment 4 Andreas J. Guelzow 2008-09-11 03:11:15 UTC
Some note: there is really no mathematical difference between centered and prior moving averages. The only difference is in the notation, which index is being used. Since the spreadsheet result does not use any indices and the location of the output is determined by the choice of the output range, it is simple a question of interpreting the results according to one or the other.

If the result are placed next to the input then it will look like a "prior moving average".

-----------------------------------------

Regarding: "I do want the moving average (and not a simple average), but I also
need to trim the number of output cells in an orderly fashion, and due to the
sheer number of cells I handle in each column (slightly over a thousand), I
need it automated."

Well if you have 200 data points, calculate (prior) moving averages for k = 10 and then only look at every 10th data value, then you in fact just have 20 averages of 20 groups of 10 observations. Nothing moving would be left.

So this clearly would not be part of a moving averages tool, but could be achieved by using the sampling tool in connection with the moving averages tool. 
Comment 5 Andreas J. Guelzow 2008-09-20 21:59:30 UTC
I have just committed some improvements regarding the sampling tool. The sampoling tool is now "live". So when you calculate moving averages into a cell region you can use the sampling tool to set-up an extraction of every kth value. Whenever you replcae the original data a new sample is being automatically created.
Comment 6 Andreas J. Guelzow 2008-09-21 22:55:28 UTC
I have just committed a "live" version of the moving averages tool. Together with the "live" version of the sampling tool you can easily set up a spreadsheet into which you can pour the data and get immediate output.

 This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 7 Andreas J. Guelzow 2008-09-22 02:29:34 UTC
You can now also tweak the offet (central, prior and other versions).
Comment 8 Daniel Vianna 2008-09-22 04:32:10 UTC
Cool! :D
Comment 9 Andreas J. Guelzow 2008-09-22 04:44:08 UTC
and automatically create matching graphs (although for your data set sizes that may not be of interest)
Comment 10 Andreas J. Guelzow 2008-09-24 06:09:15 UTC
I have added weighted and cumulative moving averages.