forecastpanel {forecastLSW} | R Documentation |
Function to produce a plot of data forecasts.
Description
This function produces a plot of the data forecast with confidence intervals (if supplied) and, if supplied, against the truth. Optionally, summaries of the forecast fit are returned.
Usage
forecastpanel(forecastobj,truth=NULL,add=FALSE,summary=TRUE,test="all",move=0,
conf.level=95,col="red",pch=c(17,19,95),...)
Arguments
forecastobj |
Either an object of class |
truth |
The true values of the signal that has been forecast. |
add |
If FALSE a new plot is created, otherwise points are added to the active graphics device. |
summary |
If TRUE a summary of the forecast fit is supplied, see |
test |
Argument supplied to |
move |
If move does not equal 0 then this is the amount to move the points+confidence intervals for the forecasts to the left (if negative) and to the right (if positive) to offset the plotted location (0) to potentially make the graphic clearer. |
conf.level |
Confidence level used for the |
col |
Specifies the colour of forecasts on the plot, see |
pch |
Length 3 vector specifying the plotting character (pch) of the truth, forecast and CI in that order. |
... |
Additional arguments can be supplied which will be passed to |
Details
Plots the forecast data, confidence intervals and true signal if supplied. If summary=TRUE
then the output of accuracy
is returned.
Value
If summary=TRUE
then the output of accuracy
is returned.
Author(s)
Rebecca Killick
See Also
Examples
# first generate a time-varying process
x=tvar2sim()
# forecast the last 12 data points using the lpacf
ans<-forecastlpacf(x[1:500],h=12,forecast.type='recursive')
# then plot it and get summaries to see how we did
## Not run: plot(ans,truth=x[501:512],move=0.05)