Learn R Programming

imputeTS (version 1.5)

na.seadec: Seasonally Decomposed Missing Value Imputation

Description

Removes the seasonal component from the time series, performs imputation on the deseasonalized series and afterwards adds the seasonal component again.

Usage

na.seadec(x, algorithm = "interpolation", ...)

Arguments

x
Numeric Vector (vector) or Time Series (ts) object in which missing values shall be replaced
algorithm
Algorithm to be used after decomposition. Accepts the following input:
  • "interpolation" - Imputation by Interpolation
"locf" - Imputation by Last Observation Carried Forward "mean" - Imputation by Mean Value

Value

  • Vector (vector) or Time Series (ts) object (dependent on given input at parameter x)

item

...

See Also

na.interpolation, na.kalman, na.locf, na.ma, na.mean, na.random, na.replace, na.seasplit

Examples

Run this code
#Prerequisite: Load a time series with missing values
x <- tsAirgap

#Example 1: Perform seasonal imputation using algortihm = "interpolation"
na.seadec(x, algorithm = "interpolation")

#Example 2: Perform seasonal imputation using algortihm = "mean"
na.seadec(x, algorithm = "mean")

Run the code above in your browser using DataLab