Description Usage Arguments Value Author(s) References See Also Examples
View source: R/estimate_impute_AR1_Gaussian.R
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.
1 2 3 4 5 6 7 8 9 10 11 12 |
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 |
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:
|
The estimate for |
|
The estimate for |
|
The estimate for |
Junyan Liu and Daniel P. Palomar
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.
plot_imputed
, fit_AR1_Gaussian
, impute_AR1_t
1 2 3 4 5 | library(imputeFin)
data(ts_AR1_Gaussian)
y_missing <- ts_AR1_Gaussian$y_missing
y_imputed <- impute_AR1_Gaussian(y_missing)
plot_imputed(y_imputed)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.