MATLAB: Predict Multiple Time Steps Ahead with NARX Network in Simulink

simulink

I am attempting predict ahead multiple time steps in Simulink with a NARX network.
My assumption is that you can only get one output per Simulink time step, and you can adjust the rate of input and total simulation length to get multiple outputs over the simulation. Is this correct as an analog to this example in Simulink?

Best Answer

  • You can get multiple outputs per Simulink time step by using delay blocks to input the current and N past values to the network.
    For example, if you wish the Simulink block to output 20 data points in the future, you need to provide the network with 20 data points. This can be accomplished by simultaneously providing the network a 20x1 sized signal that contains the current data point, and the last 19 points.
    It may be useful to look at the "buffer" function to format the input appropriately in Simulink.
    Given a time series signal x of dimension 1xM and a similar request of 20 input data points per Simulink time step, we can buffer the input signal into columns of 20 with a command similar to
    >> buffer(x, 20, 19);
    This could be accomplished in both MATLAB and Simulink with the "buffer" function and block respectively. See the following documentation for additional details: