Learn R Programming

perARMA (version 1.4)

predictperYW: Prediction for PAR model

Description

Procedure predictperYW provideds the LMS forecast of a PAR(p) series. The Yule-Walker method is first use to estimate the LMS prediction coefficients using all the observed data in x. Additionally, procedure predseries plots the predicted values of the series with real future values of the series (provided that such real data is available).

Usage

predictperYW(x, T, p, missval, start,...)
predseries(real, x, T, p, start,...)

Arguments

x
input time series.
T
period of PC-T structure.
p
order of autoregression, it is assumed constant over time.
missval
notation for missing values.
start
index of forecast value of the series; there are two possible scenarios: start - procedure predictperYW enables to predict values of some piece of existing series (using Yule-Walker coefficients). In this case it is a
real
the real future values of x series (historical data).
...
other arguments that will be connected with plot: realcol is a color of konwn values and predcol is a color of predicted values on the plot. By default parameters are fixed to realcol="blue", predcol="red"

Value

  • procedure predictperYW for start plots values of x[start:end] and xp[start:end], where xp are predicted values; for start>length(x) function returns and plots two series:
  • xinput series together with predicted values added.
  • newpredicted part of the series only.
  • Procedure predseries plots predicted and real values of the series on the same plot.

References

Box, G. E. P., Jenkins, G. M., Reinsel, G. (1994), Time Series Analysis, 3rd Ed., Prentice-Hall, Englewood Cliffs, NJ. Brockwell, P. J., Davis, R. A. (1991), Time Series: Theory and Methods, 2nd Ed., Springer: New York. Gladyshev, E. G., (1961), Periodically Correlated Random Sequences, Sov. Math., 2, 385-388.

Examples

Run this code
data(volumes)
permest_out<-permest(t(volumes),24, 0.05, NaN,'volumes', pp=0)
xd=permest_out$xd
dev.set(which=1)
predictperYW(xd,24,2,NaN,956,end=980)

dev.set(which=1)
predictperYW(xd[1:980],24,2,NaN,1004)

data(volumes.sep)
dev.set(which=1)
realdata=c(volumes,volumes.sep)
predseries(realdata,t(volumes[1:980]),24,2,1004)

Run the code above in your browser using DataLab