plot_prediction_samples: Plot multiple splits from list with forecast results

Description Usage Arguments Value Examples

View source: R/plot_prediction.R

Description

Plot results from cv_arima (by ggplot2)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plot_prediction_samples(
  splits,
  col_date = "index",
  col_value = "value",
  col_group = "key",
  title = NULL,
  date_type = "datetime",
  ncol = 3L,
  scale = NULL,
  PI = FALSE,
  col_pi_high = "hi95",
  col_pi_low = "lo95"
)

Arguments

splits

list of prediction data.frames

col_date

Date column, default to "index"

col_value

Value column, default to "value"

col_group

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

title

diagram title

date_type

string vector - one of "datetime", "date" or "character"

ncol

Number of columns

scale

NULL or two Date values to scale x-axis

PI

add prediction interval?

col_pi_high

Upper confidence bound

col_pi_low

Lower confidence bound

Value

ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data <- tsRNN::fc_arima
plot_prediction_samples(
  splits = list(data, data),
  ncol = 2L
)

# with Prediction Interval
plot_prediction_samples(
  splits = list(data, data),
  ncol = 2L,
  PI = TRUE
)

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