function to calculate moving average
Moving_average(x, periods = 5, NA_RM = TRUE)
A data frame contain the variable for calculation
An odd number of the periods in MA. The default is 5, i.e., 2 lags and 2 leads
If TRUE, remove NA in calculating mean, otherwise returning NA
A data frame