# 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:

- Click
**Transform**>**Moving Average**in the menu. 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.

- Enter prefix, default:
`MOV_AVG_`

Enter

**Window left**,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.

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.

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

Average calculation

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

### Example:

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