X: a T x n numeric data matrix (incl. ts or xts objects) or data frame of stationary time series.
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 max.missing: "LE" only removes cases at the beginning or end of the sample, whereas "all" always removes missing cases.
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:
"median"
simple series-wise median imputation.
"rnorm"
imputation with random numbers drawn from a standard normal distribution.
"median.ma"
values are initially imputed with the median, but then a moving average is applied to smooth the estimates.
"median.ma.spline"
"internal" missing values (not at the beginning or end of the sample) are imputed using a cubic spline, whereas missing values at the beginning and end are imputed with the median of the series and smoothed with a moving average.
ma.terms: the order of the (2-sided) moving average applied in na.impute methods "median.ma" and "median.ma.spline".
Returns
The imputed matrix X_imp, with attributes: - "missing": a missingness matrix W matching the dimensions of X_imp.
"rm.rows": and a vector of indices of rows (cases) with too many missing values that were removed.