imputeTS (version 1.7)

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
  • "random" - Imputation by Random Sample
  • "kalman" - Imputation by Kalman Smoothing and State Space Models
  • "ma" - Imputation by Weighted Moving Average
...
Additional parameters for these algorithms that can be passed through. Look at na.interpolation, na.locf, na.random, na.mean for parameter options.

Value

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

See Also

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

Examples

Run this code
#Example 1: Perform seasonal imputation using algorithm = "interpolation"
na.seadec(tsAirgap, algorithm = "interpolation")

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

Run the code above in your browser using DataCamp Workspace