# How are Moving Average and Standard Deviation calculated in MI?

## The number of intervals used can be modified

The **Moving Average** and **Standard Deviation** always are calculated using trailing; i.e., historical) data. The period that is used for the calculation is determined by the **Alert Prior Measurement Value Count **setting in the *Measurement Interval Editor* as shown above.

**EXAMPLE: ** The **Moving Average** for the data point on 8/1 would be based on the 30 days from 7/3 to 8/1, inclusive. The **Moving Average** for 8/1 would be based on the 30 days from 7/2 to 7/31, inclusive.

**NOTE:** We shift the **Standard Deviation** calculation back by one day so that sudden fluctuations can be compared against a stable historical data set. This is to avoid comparing a big fluctuation against a data set that includes the big fluctuation itself! Сurrent data point is excluded from the moving average calculation.