MovingSlope

This function computes the linear regression of a signal within a certain time window (that moves throughout the data set and can be defined by the user by defining the time range backwards and the time range forward).

The function hereby uses a numeric regression calculation to determine the slope of the best fitting linear equation and return this slope as an output for every time step of the signal.

Syntax

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

Example

 MovingSlope("produced water per time increment" in "STB", 5, 5)

As you see in the following table the MovingSlope with 5 data point back and 5 data point forward in time produces following output based on the 'original signal' as input:

 

Date/Time

 

Original Signal

 

MovingSlope

5 datapoint backwards

5 datapoint forward

6/16/2012 4:00

426.7955243

0.010149171

6/16/2012 4:15

426.7756509

0.023758484

6/16/2012 4:30

426.7918676

0.030249502

6/16/2012 4:45

426.8823314

0.033346864

6/16/2012 5:00

427.0103162

0.035691204

6/16/2012 5:15

426.9797906

0.038132381

6/16/2012 5:30

427.0568994

0.023135543

6/16/2012 5:45

427.1100012

0.005800146