Macro for Moving Average

Beta releases, announcements and anything else that doesn't fit below. Please read the <B>Welcome</B> topic.

Moderator: DPlotAdmin

Post Reply
Simon
Posts: 4
Joined: Wed May 11, 2005 4:29 pm

Macro for Moving Average

Post by Simon »

Hi, I see that there is a "Moving Average" command under the "Generate" Menu, but what is the macro for that command? I searched the help file and the forum, and I couldn't find it.

And what's the difference between "moving average" and the "Average Points" option of the "Decimate Points" command. I notice they yield different results.

Thanks in advance.

- Simon
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

RunPlugin("Moving Average")

Unfortunately there is currently no way to specify plugin parameters, so this won't actually save you much time: you'll get the plugin dialog box prompting you for the interval and (if there is more than 1 curve) the curve you want to operate on.

The Moving Average plugin behaves more or less the same way that Excel's Moving Average command in the Analysis ToolPak does. The only difference is that Excel returns N/A for the first N-1 points (where N is the interval), while DPlot returns the average of the first i points, where i is the point index less than N. As with the Excel command, this option is mostly useful for showing trends over some period of time, and reduces the visual effect of outliers. In other words, if DPlot sales drop precipitously in one month I can take comfort in doing a Moving Average and looking at things over a 6-month average.

The "Average Points" option under "Decimate Points" also averages Y values, but it (as "Decimate Points" implies) throws out N-1 out of N points. The difference you see in amplitudes is due to "Average Points" averaging the *surrounding* N points, not the trailing N points.
Visualize Your Data
support@dplot.com
Post Reply