Learn R Programming

perARMA (version 1.3)

predictperYW: Prediction for PAR model

Description

For known T, procedure predictperYW provideds the LMS forecast of k future periods (beyond the last point in x) 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, k,...)
predseries(real,x,T,p,...)

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.
k
number of periods for prediction.
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

  • function returns and plots two series:
  • xinput series with predicted values added.
  • newonly predicted part of the series.
  • Function 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,2)

data(volumes.sep)
dev.set(which=1)
predseries(volumes.sep,t(volumes),24,2)

Run the code above in your browser using DataLab