plot_prediction: Plot time series (incl. forecasts) for single cross...

Description Usage Arguments Value Examples

View source: R/plot_prediction.R

Description

E.g. plot result for selected split from cv_arima (by ggplot2)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
plot_prediction(
  data,
  col_date = "index",
  col_value = "value",
  col_group = "key",
  title = NULL,
  size = 0.6,
  alpha = 0.8,
  legend = "bottom",
  scale = NULL,
  PI = FALSE,
  col_pi_high = "hi95",
  col_pi_low = "lo95"
)

Arguments

data

data.frame containing "index" (Date), "value" (numeric) and key (character - "actual" and "predict")

col_date

Date column in data, default to "index"

col_value

Value column in data, default to "value"

col_group

Group column in data, default to "key" ("actual" and "predict") - see example

title

plot title

size

line size

alpha

line alpha value

legend

legend position

scale

NULL or two Date values to scale x-axis

PI

add prediction interval?

col_pi_high

Upper confidence bound in data

col_pi_low

Lower confidence bound in data

Value

ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_prediction(
  data = tsRNN::fc_arima,
  title = "ARIMA Forecast versus actual data"
)

# With Prediction Interval
plot_prediction(
  data = tsRNN::fc_arima,
  title = "ARIMA Forecast with prediction interval",
  PI = TRUE
)

thfuchs/tsRNN documentation built on April 17, 2021, 11:03 p.m.