Description Usage Arguments Details Author(s) Examples
Plots the original time serie along with 2-5 predictive models.
1 2 3 |
originalTS |
A |
p_1 |
A |
p_2 |
A |
p_3 |
A |
p_4 |
A |
p_5 |
A |
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". |
This function aims to ease the comparation between different predictive models by plotting them into the same graphic.
Alberto Vico Moreno
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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.