multiplestepAhead | R Documentation |
multiplestepAhead: : univariate multi-step-ahead forecaster
TS: |
time series in column format [T,1] |
n: |
embedding order |
H: |
horizon |
dist: |
type of distance: |
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: |
|
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)
H step ahead predictions
Gianluca Bontempi Gianluca.Bontempi@ulb.be
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
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.