Moving Averages


For more information, see the online learning platform

Moving average is a calculation to analyze data points by creating a series of averages of different subsets of a data set. The moving average is also known as rolling mean and is calculated by averaging data within k time window. A common practice is to use moving average to smooth noisy data. It can be used for numeric and symbolic variables.  

To create moving average: 

  1. Click Transform > Moving Average in the menu.
  2. Enter a name for the new variable set. 

    Variable set

    Note that a Moving Average creates a Variable set, containing several new variables. Therefore, to check your moving average variables you can go to the third icon on the left bar.

  3. Enter prefix, default: MOV_AVG_
  4. Enter Window left, positive integer value, default value: 10.

    Window left

    It specifies left size of the window for the moving average or the number of previous rows to include in the moving average calculation for each given record. This may be a positive or negative integer.

    For more information, Window left

  5. Enter Window right, positive integer value, default value: 10. For more information, Window right

    Window Right

    It specifies right size of the window for the moving average or the number of next rows to include in the moving average calculation for each given record. This may be a positive or negative integer.

  6. Select a Record Set (optional). Moving average will only be calculated on values within the record set.
  7. Select Input variables or variable set. 
  8. Click Save.

Average calculation

The average is calculated based on the values for the Window Left + Current Row + Window Right. 

Example:

  1. Create a Moving Average for Meal Feed A & B variables using a window of 12 previous rows.
  2. Trend comparing MOV_AVG_Meal_feed_B and the original variable Meal_feed_B.