Source-linked AI summary

Comparison of different Methods for Univariate Time Series Imputation in R

Steffen Moritz, Alexis Sardá, Thomas Bartz-Beielstein, Martin Zaefferer, Jörg Stork

arXiv:1510.03924v1stat.APcs.OH

TL;DR

The paper examines how to impute univariate time series when standard methods relying on inter-attribute correlations are not directly applicable. It reviews R implementations and experimentally compares them across time-series datasets and missing-data ratios. Seasonal interpolation methods were most effective in most assessed scenarios, while applicability varied across R packages.

  • Problem

    Standard imputation methods often rely on inter-attribute correlations, but univariate time series must use temporal dependencies and have received limited comparative study.

  • Method

    The paper surveys univariate time-series imputation and compares R package implementations experimentally on datasets with different time-series characteristics and missing-data ratios.

  • Results

    Seasonal Kalman-filter interpolation from zoo or linear interpolation on seasonally loess-decomposed data from forecast were most effective in most assessed scenarios.

  • Takeaways & Limitations

    Univariate time series require special treatment that uses time dependencies rather than relying directly on covariates.

  • Takeaways & Limitations

    Amelia and mtsdi were designed for multivariate data and produced errors when given univariate inputs.

Abstract

from arXiv · show

Missing values in datasets are a well-known problem and there are quite a lot of R packages offering imputation functions. But while imputation in general is well covered within R, it is hard to find functions for imputation of univariate time series. The problem is, most standard imputation techniques can not be applied directly. Most algorithms rely on inter-attribute correlations, while univariate time series imputation needs to employ time dependencies. This paper provides an overview of univariate time series imputation in general and an in-detail insight into the respective implementations within R packages. Furthermore, we experimentally compare the R functions on different time series using four different ratios of missing data. Our results show that either an interpolation with seasonal kalman filter from the zoo package or a linear interpolation on seasonal loess decomposed data from the forecast package were the most effective methods for dealing with missing data in most of the scenarios assessed in this paper.

Introduction

Univariate time-series imputation is difficult because standard methods depend on inter-attribute correlations, whereas these series must use temporal dependencies. The paper surveys R implementations and evaluates them across datasets representing different time-series characteristics.

  • Univariate time series lack additional attributes that standard imputation algorithms commonly use, so effective methods must exploit time-series characteristics.
  • The paper addresses a limited literature on univariate time-series imputation by reviewing methods and providing practical R examples.
  • Data Characteristics: The experiments use four datasets selected to represent combinations of trend, seasonality, and near-white-noise behavior.
  • Data Characteristics: Trend and seasonal effects matter for imputation, motivating decomposition and other methods that account for time-series structure.
  • Data Characteristics: The selected series are airpass with trend and seasonality, SP with trend only, beersales with seasonality, and google with neither trend nor seasonality.

Missing Data

The paper characterizes missingness mechanisms and evaluates imputation by artificially removing values from complete series. For univariate series, time acts as an implicit variable, and temporal structure can support estimation when covariates are unavailable.

  • Missing-data mechanisms are categorized as MCAR, MAR, and NMAR according to whether missingness depends on time, other variables, or the missing values themselves.
  • For univariate time series, time is treated as an implicit variable, making MAR depend on observation time while making MAR and MCAR nearly equivalent.
  • Imputation performance is evaluated by removing values from complete series, then comparing imputed values with the known original values.
  • Simulation of Missing Data: The simulation function is based on six hundred real-life sensor series whose missing observations resulted from unspecified transmission problems.
  • Simulation of Missing Data: The experiments implement the missing-data simulator for univariate time series using an exponential-distribution rate parameter and an optional random seed.

Univariate time series imputation

Univariate time-series imputation must exploit temporal dependencies because standard methods generally rely on correlations among multiple attributes. The paper organizes available R approaches by how they use time information and identifies which packages and methods support univariate data.

  • Motivation: Univariate imputation cannot directly use the inter-attribute correlations on which many standard algorithms depend.Effective methods therefore need to exploit temporal dependencies in the series.
  • Algorithm categories: Univariate methods either ignore temporal structure, use time-series characteristics directly, or create lagged variables for multivariate algorithms.Examples include mean or median imputation, seasonal structural models, and lag/lead transformations.
  • R package support: Amelia and mtsdi are designed for multivariate data and return errors when given univariate input.Their time-series options do not make their imputation functions applicable to a single-column series.
  • R package support: VIM, mice, and imputeR do not accept univariate input directly, although mice can be bypassed by adding an arbitrary complete second column.This workaround addresses input checking rather than adding meaningful information to the time series.
  • R package support: forecast and zoo were the only identified packages that both accept univariate data and provide advanced time-series support.The zoo package includes functions such as na.StructTS(), na.locf(), na.approx(), and na.spline().
  • Methods tested: The experiments used out-of-the-box functions, including lagged-data imputation, while custom Kalman/ARIMA and forecast/backcast solutions were not tested.The lagged-data approach creates lags and then applies a multivariate imputation algorithm; zoo also provides overall-mean, last-observation, and seasonal-Kalman alternatives.
  • Baseline methods: Overall-mean imputation is fast but reduces variance and performs poorly when the series has a strong trend.It is the only tested function described as ignoring the time-series characteristics.
  • Time-series methods: Last-observation-carried-forward uses the most recent observed value and can work well when adjacent observations are similar, but struggles with strong seasonality.Daily temperature is given as an example where neighboring observations are likely to be similar.

Experiments

The experiments compare R imputation functions on simulated univariate time-series gaps across four missingness rates and multiple datasets. Seasonal interpolation methods perform best on seasonal series, while performance varies with the series structure and computation time.

  • Experimental design: The evaluation deletes values from complete series, imputes the incomplete data, and compares imputed values with the originals.Missingness is simulated under MCAR, and the experiments use four rates: 0.1, 0.3, 0.5, and 0.7, with 25 random seeds per rate.
  • Evaluation: MAPE and RMSE are both used because percentage error can better reflect accuracy than absolute error for strongly trending series.The figures report one result per series variation and missingness rate; colors encode missingness rates.
  • Dataset results: For the seasonal airpass series, na.StructTS and na.interp perform best, while mean imputation performs worst.The authors attribute the advantage of the leading methods to their ability to handle seasonality and report similar MAPE and RMSE conclusions.
  • Dataset results: For beersales, na.interp slightly outperforms na.StructTS, while na.approx and ar.irmi follow closely and locf and na.aggregate lag.The comparison suggests a small gain from applying linear interpolation after seasonal loess decomposition; MAPE and RMSE agree.
  • Dataset results: For nearly white-noise google data, interpolation methods and na.locf perform best, while na.StructTS and ar.irmi are worst because of high outliers.na.approx and na.interp produce identical results because the series has no seasonality.
  • Dataset results: For the trend-only SP series, na.approx performs best, whereas seasonal adaptation in na.interp and StructTS produces poorer results.Mean imputation is again the worst choice, and the running-time comparison finds na.interp preferable to the slower StructTS despite similar imputation results.
Loading 1510.03924v1…