multiplestepAhead: multiplestepAhead

View source: R/mstep.R

multiplestepAheadR Documentation

multiplestepAhead

Description

multiplestepAhead: : univariate multi-step-ahead forecaster

Arguments

TS:

time series in column format [T,1]

n:

embedding order

H:

horizon

dist:

type of distance: euclidean, cosine for lazy methods

F:

forgetting factor

C:

integer parameter which sets the maximum number of neighbours (C*k) for lazy methods

detrend:

real parameter (in [0,1]) which fixes the size of window used for linear detrending the series (0 corresponds to all series and 1 to ten latest terms). If detrend<0 no detrending is carried out

smooth:

if TRUE, the prediction is obtained by averaging multiple windows with different starting points

engin:

if TRUE, a number of additional features (related to the quantiles) are engineered and added

method:
  • arima: prediction based on the forecast package

  • stat_naive: naive predictor based on the M4 competition code

  • stat_ses_naive: prediction based on the M4 competition code

  • stat_naive2: naive predictor based on the M4 competition code

  • stat_ses: SES predictor based on the M4 competition code

  • stat_holt: Holt predictor based on the M4 competition code

  • stat_damped: prediction based on the M4 competition code

  • stat_theta: Theta predictor based on the M4 competition code

  • stat_comb: prediction based on the M4 competition code

  • direct: direct prediction based on KNN.multioutput function

  • iter: recursive prediction based on KNN.multioutput function

  • lazydirect: locally linear direct prediction based on lazy.pred function

  • clazydirect: locally constant direct prediction based on lazy.pred function

  • lazyiter: recursive prediction based on lazy.pred function

  • lindirect: direct prediction based on linear predictor

  • rfdirect: direct prediction based on Random Forest predictor

  • rfiter: recursive prediction based on Random Forest predictor

  • mimo: MIMO prediction based on KNN.multioutput function

  • mimo.comb: MIMO prediction based on KNN.multioutput function which combines a set of predictors based on different horizons and different starting points

  • mimo.acf: MIMO prediction based on KNN.acf function which combines a set of predictors based on different horizons and different starting points

  • mimo.acf.lin: MIMO prediction based on KNN.acf.lin function which combines a set of predictors based on different horizons and different starting points

  • mimo.pls: MIMO prediction based on KNN.pls function which combines a set of predictors based on different horizons and different starting points

  • mimo.lin.pls: MIMO prediction based on Partial Least Squares which combines a set of predictors based on different horizons and different starting points

  • mimo_rr: MIMO prediction based on linear ridge regression

  • mimo_red: MIMO prediction based on linear reduced rank regression (rrpack)

  • mimo_las: MIMO prediction based on linear lasso regression based on python (reticulate)

  • mimo_cca: MIMO prediction based on linear canonical correlation

  • mimo_red: MIMO prediction based on linear reduced rank regression

  • rnn: prediction based on python (reticulate) implementation of rnn (recurrent neural networks)

  • lstm: prediction based on python (reticulate) implementation of lstm neural networks

  • transf: prediction based on python (reticulate) implementation of transformer neural networks

Details

multiplestepAhead

Wrapper over a set of methods for univariate multi-step-ahead time series forecasting

The python forecasters require the installation of reticulate and several python packages (scikit-learn, tensorflow, keras)

Value

H step ahead predictions

Author(s)

Gianluca Bontempi Gianluca.Bontempi@ulb.be

References

Bontempi G. Ben Taieb S. Conditionally dependent strategies for multiple-step-ahead prediction in local learning, International Journal of Forecasting Volume 27, Issue 3, July–September 2011, Pages 689–699

https://tinyurl.com/sfmlh

Examples

## Multi-step ahead time series forecasting

rm(list=ls())
t=seq(0,400,by=0.1)
N<-length(t)
H<-500 ## horizon prediction
TS<-sin(t)+rnorm(N,sd=0.1)
TS.tr=TS[1:(N-H)]
N.tr<-length(TS.tr)
TS.ts<-TS[(N-H+1):N]
TS.tr=array(TS.tr,c(length(TS.tr),1))
Y.cont=multiplestepAhead(TS.tr,n=3, H=H,method="mimo")

plot(t[(N-H+1):N],TS.ts)
lines(t[(N-H+1):N],Y.cont,col="red")




## Multi-step ahead time series forecasting Santa Fe  chaotic time series A
rm(list=ls())
require(gbcode)
data(A)
TS=A
N<-1000
H<-200
TS.tr=TS[1:N,1]
TS.ts<-TS[(N+1):(N+H),1]
TS.tr=array(TS.tr,c(length(TS.tr),1))
Y.dir=multiplestepAhead(TS.tr,n=12, H=H,method="lazydirect")
Y.mimo.comb=multiplestepAhead(TS.tr,n=12, H=H,method="mimo.comb")
plot((N-H+1):N,TS.ts,type="l",xlab="",ylab="Santa Fe A series")
lines((N-H+1):N,Y.dir,col="red")
lines((N-H+1):N,Y.mimo.comb,col="green")




gbonte/gbcode documentation built on Feb. 27, 2024, 7:38 a.m.