plot_imputed: Plot imputed time series.

Description Usage Arguments Author(s) Examples

View source: R/plot_imputed.R

Description

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

Usage

1
2
3
4
5
6
7
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).

Author(s)

Daniel P. Palomar

Examples

1
2
3
4
5
6
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)

imputeFin documentation built on Feb. 20, 2021, 9:07 a.m.