predictperYW {perARMA}R Documentation

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_t, p, missval, start,...)
predseries(real, x, T_t, p, start,...)

Arguments

x

input time series.

T_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<length(x) - procedure predictperYW enables to predict values of some piece of existing series (using Yule-Walker coefficients). In this case it is also necessary to define end value, as we want to predict values x[start:end] and compare them with known observations.
start>length(x) - procedure predictperYW enables to predict future values of the series. In this scenario forecast of length start-length(x) is performed to find values xp[length(x)+1:start]. In this case one can use also predseries procedure to compare predicted future of the series with real data (if such data is available, see examples section).

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<length(x) 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:

x

input series together with predicted values added.

new

predicted part of the series only.

Procedure predseries plots predicted and real values of the series on the same plot.

Author(s)

Wioletta Wojtowicz

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

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)

[Package perARMA version 1.7 Index]