This function operates in two stages. First, it substitutes missings and outliers for the median
Outliers are definited as observations that its distance from median is more than 4 times the IQR (Interquartile Range).
Second, a k_ma
moving average is filtered in each serie, and its values are used to replace outliers and missings in the original data set.
outliers_correction(x, k_ma = 3)
A ts
to be adjusted.
Moving average order.