WeightedMovingAvg

Weighted moving average of a freely definable range.

The function calculates the weighted moving average of the elements within the range defined by the user via number of data points. In case of entering zero data points before and after the output is a copy of the input.

Syntax

 WeightedMovingAvg(expression, # of data points before)
  • expression: signal expression
  • # of data points before - integer number of points in the signal expression before the current date in the aggregation range

Example

 WeightedMovingAvg("produced water per time increment" in "STB", 1)

As you see in the following table the WeightedMovingAvg with 1 data point back in time produces following output based on the 'original signal' as input:

 

Date/Time

 

Original Signal

 

WeightedMovingAvg
1 datapoint backwards in time

01.02.2007 00:00

46.9012535

46.9012535

01.03.2007 00:00

375.8459772

156.5494947

01.04.2007 00:00

302.07587

351.2559415

01.05.2007 00:00

333.0783935

312.4100445

01.06.2007 00:00

321.9492825

329.3686898

01.07.2007 00:00

358.6753488

334.1913046

01.08.2007 00:00

353.7467425

357.03248

01.09.2007 00:00

347.2282632

351.5739161