pred.compareModels: Compare different predictions

Description Usage Arguments Details Author(s) Examples

Description

Plots the original time serie along with 2-5 predictive models.

Usage

1
2
3
pred.compareModels(originalTS, p_1, p_2, p_3 = NULL, p_4 = NULL,
  p_5 = NULL, legendNames = NULL, colors = NULL, legend = TRUE,
  legendPosition = NULL, yAxis = "Values", title = "Predictions")

Arguments

originalTS

A ts object

p_1

A ts object

p_2

A ts object

p_3

A ts object. Default is NULL.

p_4

A ts object. Default is NULL.

p_5

A ts object. Default is NULL.

legendNames

String vector with the names for the legend. Has to be same length as number of time series we are plotting(including the original one). Default is NULL.

colors

Vector with the colors. Has to be same length as number of time series we are plotting(including the original one). Default is NULL.

legend

A logical. Do we want a legend? Default is TRUE.

legendPosition

A string with the position of the legend (bottomright, topright, ...). Default is NULL.

yAxis

A string. Name for the y axis. "Values" as default.

title

A string. Title for the plot. Default is "Predictions".

Details

This function aims to ease the comparation between different predictive models by plotting them into the same graphic.

Author(s)

Alberto Vico Moreno

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(AirPassengers)
#pre-processing
p <- prep(AirPassengers)
#modelling
arima.modl <- modl(p)
cart.modl <- modl(p,method='dataMining',algorithm='rpart')
#predicting
arima.pred <- pred(arima.modl,n.ahead=30)
cart.pred <- pred(cart.modl,n.ahead=45)
#post-processing
arima.pred <- postp(arima.pred,p)
cart.pred <- postp(cart.pred,p)
#visual comparison
pred.compareModels(AirPassengers,arima.pred$predictions,cart.pred$predictions
,legendNames=c('AirPassengers','ARIMA','CART'),yAxis='Passengers',legendPosition = 'topleft')

predtoolsTS documentation built on May 2, 2019, 5:54 a.m.