plot_imputed function

Plot imputed time series.

Plot imputed time series.

Plot single imputed time series (as returned by functions impute_AR1_Gaussian and impute_AR1_t), highlighting the imputed values in a different color.

plot_imputed( y_imputed, column = 1, title = "Imputed time series", color_imputed = "red", type = c("ggplot2", "simple") )

Arguments

  • y_imputed: Imputed time series (can be any object coercible to a numeric vector or a numeric matrix). If it has the attribute "index_miss" (as returned by any of the imputation functions impute_AR1_Gaussian and impute_AR1_t), then it will highlight the imputed values in a different color.
  • column: Positive integer indicating the column index to be plotted (only valid if the argument y_imputed is coercible to a matrix with more than one column). Default is 1.
  • title: Title of the plot (default is "Imputed time series").
  • color_imputed: Color for the imputed values (default is "red").
  • type: Type of plot. Valid options: "ggplot2" and "simple". Default is "ggplot2" (the package ggplot2 must be installed).

Examples

library(imputeFin) data(ts_AR1_t) y_missing <- ts_AR1_t$y_missing y_imputed <- impute_AR1_t(y_missing) plot_imputed(y_missing, title = "Original time series with missing values") plot_imputed(y_imputed)

Author(s)

Daniel P. Palomar