predictperYW function

Prediction for PAR model

Prediction for PAR model

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

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

Returns

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.

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.

Author(s)

Wioletta Wojtowicz

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)
  • Maintainer: Karolina Marek
  • License: GPL (>= 2.0)
  • Last published: 2023-11-17

Useful links