Learn R Programming

PSF (version 0.5)

plot.psf: Plot actual and forecasted values of an univariate time series

Description

Takes an univariate time series and a vector with forecasted values.

Usage

# S3 method for psf
plot(x, predictions = c(), cycle = 24, ...)

Arguments

x

The trained PSF model generated by psf() function.

predictions

A vector with previously computed forecasted values.

cycle

The number of values that conform a cycle in the time series (e.g. 24 hours per day, 12 month per year, and so on). Only used when input data is not in time series (ts) format.

Additional graphical parameters given to plot function.

Examples

Run this code
# NOT RUN {
## Train a PSF model from the univariate time series 'nottem' (package:datasets).
p <- psf(nottem)

## Forecast the next 12 values of such time series.
pred <- predict(p, n.ahead = 12)

## Plot forecasted values.
plot(p, pred)
# }

Run the code above in your browser using DataLab