Learn R Programming

imputeTS (version 2.7)

na.seasplit: Seasonally Splitted Missing Value Imputation

Description

Splits the times series into seasons and afterwards performs imputation separately for each of the resulting time series datasets (each containing the data for one specific season).

Usage

na.seasplit(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 splits. 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.seadec

Examples

Run this code
# NOT RUN {
#Example 1: Perform seasonal splitted imputation using algorithm = "interpolation"
na.seasplit(tsAirgap, algorithm = "interpolation")

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

#Example 3: Same as example 1, just written with pipe operator
tsAirgap %>% na.seasplit(algorithm = "interpolation")

# }

Run the code above in your browser using DataLab