So what we did with the code is as follows. First, we have created a time-series example (from the ARIMA model). After that we have decoupled/sliced the time-series example into inputs of the form (sw previous points, next point) for all pairs except the last one (with the next point as the last point of the time-series example). The parameter sw is used to define the "sliding window". I won't debate here what is the proper size for the sliding-window but just note that due to Elman networks having memory the sliding-window of size one is more than a reasonable approach (also, take a look at this postpost).