Learn R Programming

nowcasting (version 0.0.82)

outliers_correction: Outliers Correction

Description

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.

Usage

outliers_correction(x, k_ma = 3)

Arguments

x

A ts to be adjusted.

k_ma

Moving average order.