tsnarmimp {dfms} | R Documentation |
Remove and Impute Missing Values in a Multivariate Time Series
Description
This function imputes missing values in a stationary multivariate time series using various methods, and removes cases with too many missing values.
Usage
tsnarmimp(
X,
max.missing = 0.8,
na.rm.method = c("LE", "all"),
na.impute = c("median.ma.spline", "median.ma", "median", "rnorm"),
ma.terms = 3L
)
Arguments
X |
a | |||||||||||||||||
max.missing |
numeric. Proportion of series missing for a case to be considered missing. | |||||||||||||||||
na.rm.method |
character. Method to apply concerning missing cases selected through | |||||||||||||||||
na.impute |
character. Method to impute missing values for the PCA estimates used to initialize the EM algorithm. Note that data are standardized (scaled and centered) beforehand. Available options are:
| |||||||||||||||||
ma.terms |
the order of the (2-sided) moving average applied in |
Value
The imputed matrix X_imp
, with attributes:
"missing" |
a missingness matrix |
"rm.rows" |
and a vector of indices of rows (cases) with too many missing values that were removed. |
Examples
library(xts)
str(tsnarmimp(BM14_M))