<< Click to Display Table of Contents >> Strategy - Rolling Average |
![]() ![]() ![]() |
There are 2 methods for working out a rolling average.
The best solution is to use an ActiveX control which has been specifically developed to calculate a rolling average.
Calculating a Rolling Average using an ActiveX Control:
There is an ActiveX control called SVRollAv1 which takes inputs/outputs from SpecView and does the calculations. It also handles the case of bad values.
Calculating a Rolling Average using SpecView's Strategy Controller:
However, it is possible to do a fairly straightforward rolling average using SpecView's Strategy Controller.
However, this has its limitations; firstly to do a rolling average of values taken once a minute over an hour would require 60 User Variables and the associated Strategy to 'ripple' the values down and total them up.
Secondly, that method doesn't handle the case where some values are 'bad', for example when comms are lost - which would adversely affect the calculated average.
A typical requirement is to see the average of a variable over a period of time.
This is a simple example of a rolling average over the last 10 minutes.
Readings are taken once a minute, and the average (mean) of the last 10 values is calculated & displayed.
Note that for the first ten minutes of the run the average will be incorrect because the sample size is less than 10.
Below are the SpecView user variables, together with the Strategy Controller events and actions, which will need to be defined.