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 forecast, forecastlpacf or a vector of forecasts.

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 accuracy.

test

Argument supplied to accuracy to determine which summary measures are returned.

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 forecastobj. If forecastobj is lpacf it can be calculated for any confidence level. If forecastobj is of class forecast then the level needs to match the one given when the forecast was calculated. A number between 1 and 100.

col

Specifies the colour of forecasts on the plot, see par for details.

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 plot, points and segments.

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

forecastlpacf,accuracy

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)

[Package forecastLSW version 1.0 Index]