fill_ts_na: This function imputates values to Not Available (NA) elements...

View source: R/preparation.R

fill_ts_naR Documentation

This function imputates values to Not Available (NA) elements of a time series, based on the outliers estimation made the functions implemented in Outlier Detection module block of this library.

Description

This function imputates values to Not Available (NA) elements of a time series, based on the outliers estimation made the functions implemented in Outlier Detection module block of this library.

Usage

fill_ts_na(
  data,
  outliersMinMax,
  outliersZScore,
  outliersCalendarModel,
  methodFillNA = "linearInterpolation",
  maxGap = NULL,
  fillMask = NULL
)

Arguments

data

<data.frame> with Not Available elements to be filled. Columns: 'time', 'value'.

outliersMinMax

detect_ts_min_max_outliers() output.

outliersZScore

detect_ts_zscore_outliers() output.

outliersCalendarModel

detect_ts_calendar_model_outliers() output.

methodFillNA

<string> argument specifying the methodology for filling the NA elements. Possible values are: - calendarModel: The predicted values estimated by the calendar model are used to fulfill the NA elements. - backward: The previous known element of the timeseries is considered. - forward: The next known element of the timeseries is considered. - linearInterpolation: A linear interpolation is done between using previous and next known elements regarding each data gap.

maxGap

<string> in ISO 8601 format representing the window (e.g. "PT4H", "PT30M", "PT72H", "P2D",...). It defines the maximum period allowed. Therefore, gaps with greater period are not considered in the imputation. By default, it doesn't exists a limitation of the gap longitude.

fillMask

<array> of booleans defining the time periods where the imputation can be done. By default, all elements of the timeseries can be filled.

Value

<data.frame> with filled elements.


biggproject/biggr documentation built on Oct. 2, 2024, 11:13 p.m.