impute_rolling_AR1_Gaussian {imputeFin}R Documentation

Impute missing values of time series on a rolling window basis based on a Gaussian AR(1) model

Description

Impute inner missing values (excluding leading and trailing ones) of time series on a rolling window basis. This is a wrapper of the function impute_AR1_Gaussian.

Usage

impute_rolling_AR1_Gaussian(
  y,
  rolling_window = 252,
  random_walk = FALSE,
  zero_mean = FALSE,
  remove_outliers = FALSE,
  outlier_prob_th = 0.001,
  tol = 1e-10,
  maxiter = 100
)

Arguments

y

Time series object coercible to either a numeric vector or numeric matrix (e.g., zoo or xts) with missing values denoted by NA.

rolling_window

Rolling window length (default is 252).

random_walk

Logical value indicating if the time series is assumed to be a random walk so that phi1 = 1 (default is FALSE).

zero_mean

Logical value indicating if the time series is assumed zero-mean so that phi0 = 0 (default is FALSE).

remove_outliers

Logical value indicating whether to detect and remove outliers.

outlier_prob_th

Threshold of probability of observation to declare an outlier (default is 1e-3).

tol

Positive number denoting the relative tolerance used as stopping criterion (default is 1e-8).

maxiter

Positive integer indicating the maximum number of iterations allowed (default is 100).

Value

Same as impute_AR1_Gaussian for the case n_samples = 1 and return_estimates = FALSE.

Author(s)

Daniel P. Palomar

See Also

plot_imputed, impute_AR1_Gaussian

Examples

library(imputeFin)
data(ts_AR1_Gaussian) 
y_missing <- ts_AR1_Gaussian$y_missing
y_imputed <- impute_rolling_AR1_Gaussian(y_missing)
plot_imputed(y_imputed)


[Package imputeFin version 0.1.2 Index]