function to calculate moving average

MA.n(x, periods = 5)

Arguments

x

A data frame contain the variable for calculation

periods

An odd number of the periods in MA. The default is 5, i.e., 2 lags and 2 leads

Value

A data frame