>> w = windowize(A, window) >> [Xw,Yw] = windowizeNARX(X,Y,xdelays, ydelays, steps)
windowize
function to make a nonlinear AR predictor with a nonlinear regressor.
The last elements of the resulting matrix will contain the future values of the
timeseries, the others will contain the past inputs.
window
is the relative index of data points in matrix A
, that
are selected to make a window. Each window is put in a row of
matrix W
. The matrix W
contains as many rows as there are different
windows selected in A
.
Schematically, this becomes
>> A = [a1 a2 a3; b1 b2 b3; c1 c2 c3; d1 d2 d3; e1 e2 e3; f1 f2 f3; g1 g2 g3]; >> W = windowize(A, [1 2 3]) W = a1 a2 a3 b1 b2 b3 c1 c2 c3 b1 b2 b3 c1 c2 c3 d1 d2 d3 c1 c2 c3 d1 d2 d3 e1 e2 e3 d1 d2 d3 e1 e2 e3 f1 f2 f3 e1 e2 e3 f1 f2 f3 g1 g2 g3
The function windowizeNARX
converts the timeseries and his exogeneous variables
into a block hankel format useful for training a nonlinear function approximation as a nonlinear ARX model.
>> Xw = windowize(X, window)The length of
window
is denoted by w
.
Outputs  
Xw 
(Nw+1) w matrix of the sequences of windows over X 

Inputs  
X 
N 1 vector with data points 

w 
w 1 vector with the relative indices of one window 
>> [Xw, Yw, xdim, ydim, n] = windowizeNARX(X, Y, xdelays, ydelays) >> [Xw, Yw, xdim, ydim, n] = windowizeNARX(X, Y, xdelays, ydelays, steps)
Outputs  
Xw 
Matrix of the data used for input including the delays  
Yw 
Matrix of the data used for output including the next steps  
xdim (*) 
Number of dimensions in new input  
ydim (*) 
Number of dimensions in new output  
n (*) 
Number of new data points  
Inputs  
X 
N m vector with input data points 

Y 
N d vector with output data points 

xdelays 
Number of lags of X in new input 

ydelays 
Number of lags of Y in new input 

steps (*) 
Number of future steps of Y in new output (by default ) 