impute_AR1_Gaussian {imputeFin} | R Documentation |
Impute missing values of time series based on a Gaussian AR(1) model
Description
Impute inner missing values (excluding leading and trailing ones)
of time series by drawing samples from the conditional distribution
of the missing values given the observed data based on a Gaussian
AR(1) model as estimated with the function fit_AR1_Gaussian
.
Outliers can be detected and removed.
Usage
impute_AR1_Gaussian(
y,
n_samples = 1,
random_walk = FALSE,
zero_mean = FALSE,
remove_outliers = FALSE,
outlier_prob_th = 0.001,
verbose = TRUE,
return_estimates = FALSE,
tol = 1e-10,
maxiter = 100
)
Arguments
y |
Time series object coercible to either a numeric vector or numeric matrix
(e.g., |
n_samples |
Positive integer indicating the number of imputations (default is |
random_walk |
Logical value indicating if the time series is assumed to be a random walk so that |
zero_mean |
Logical value indicating if the time series is assumed zero-mean so that |
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 |
verbose |
Logical value indicating whether to output messages (default is |
return_estimates |
Logical value indicating if the estimates of the model parameters
are to be returned (default is |
tol |
Positive number denoting the relative tolerance used as stopping criterion (default is |
maxiter |
Positive integer indicating the maximum number of iterations allowed (default is |
Value
By default (i.e., for n_samples = 1
and return_estimates = FALSE
),
the function will return an imputed time series of the same class and dimensions
as the argument y
with one new attribute recording the locations of missing
values (the function plot_imputed
will make use of such information
to indicate the imputed values), as well as locations of outliers removed.
If n_samples > 1
, the function will return a list consisting of n_sample
imputed time series with names: y_imputed.1, y_imputed.2, etc.
If return_estimates = TRUE
, in addition to the imputed time series y_imputed
,
the function will return the estimated model parameters:
phi0 |
The estimate for |
phi1 |
The estimate for |
sigma2 |
The estimate for |
Author(s)
Junyan Liu and Daniel P. Palomar
References
R. J. Little and D. B. Rubin, Statistical Analysis with Missing Data, 2nd ed. Hoboken, N.J.: John Wiley & Sons, 2002.
J. Liu, S. Kumar, and D. P. Palomar, "Parameter estimation of heavy-tailed AR model with missing data via stochastic EM," IEEE Trans. on Signal Processing, vol. 67, no. 8, pp. 2159-2172, 15 April, 2019.
See Also
plot_imputed
, fit_AR1_Gaussian
, impute_AR1_t
Examples
library(imputeFin)
data(ts_AR1_Gaussian)
y_missing <- ts_AR1_Gaussian$y_missing
y_imputed <- impute_AR1_Gaussian(y_missing)
plot_imputed(y_imputed)