arimainterp: Interpolation of unknown values using automatic ARIMA fitting...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/arimainterp.R

Description

The function predicts nonconsecutive blocks of N unknown values of a single time series using the arimapred function and an interpolation approach.

Usage

1
2
3
4
5
6
7
8
arimainterp(
  TimeSeries,
  n.ahead,
  extrap = TRUE,
  xreg = NULL,
  newxreg = NULL,
  se.fit = FALSE
)

Arguments

TimeSeries

A matrix, or data frame which contains a set of time series used for fitting ARIMA models. Each column corresponds to one time series. Each time series in TimeSeries is assumed to be a sequence of known values of the single time series that intercalates blocks of unknown values. The time series values in column 1 are lagged values of the ones in column 2, and the values in these two columns are assumed to be intercalated by the first block of N unknown values to be predicted. This is also valid for columns 2 and 3, and so forth.

n.ahead

A numeric value (N) with the number of consecutive unknown values of each block which is to be predicted of TimeSeries, that is, the length of the blocks of N unknown values.

extrap

A Boolean parameter which defines whether one of the blocks of N unknown values to be predicted follows the last sequence of known values in TimeSeries. If extrap is TRUE, the last block of N unknown values will be extrapolated from the last time series in TimeSeries.

xreg

A list of vectors, matrices, data frames or times series of external regressors used for fitting the ARIMA models. The first component of the list contains external regressors for the first time series in TimeSeries and therefore must have the same number of rows as this respective time series. This is also valid for the second component, and so forth. Ignored if NULL.

newxreg

A list of vectors, matrices, data frames or times series with further values of xreg to be used for prediction of the blocks of N unknown values. Each component of the list must have at least n.ahead rows. Ignored if NULL.

se.fit

If se.fit is TRUE, the standard errors of the predictions are returned.

Details

In order to avoid error accumulation, when possible, the function provides the separate prediction of each half of the blocks of unknown values using their past and future known values, respectively. If extrap is TRUE, this strategy is not possible for the last of the blocks of unknown values, for whose prediction the function uses only its past values. By default the function omits any missing values found in TimeSeries.

Value

A vector of time series of predictions, or if se.fit is TRUE, a vector of lists, each one with the components pred, the predictions, and se, the estimated standard errors. Both components are time series. See the predict.Arima function in the stats package and the function arimapred.

Author(s)

Rebecca Pontes Salles

References

H. Cheng, P.-N. Tan, J. Gao, and J. Scripps, 2006, "Multistep-Ahead Time Series Prediction", In: W.-K. Ng, M. Kitsuregawa, J. Li, and K. Chang, eds., Advances in Knowledge Discovery and Data Mining, Springer Berlin Heidelberg, p. 765-774.

See Also

arimapred, marimapred

Examples

1
2
data(CATS)
arimainterp(CATS[,c(2:3)],n.ahead=20,extrap=TRUE)

TSPred documentation built on Jan. 21, 2021, 5:10 p.m.