MATLAB: Is it possible to run a NARX neural network with less than 10 timesteps

MATLABnarxneural network

Hi,
I have four input variables and one target variable for each year from 2011 to 2019, which gives me 9 timesteps. I then want to predict a value for 2020 using a NARX neural network. However, I cannot create the network because I get a "Data has less than 10 timesteps." warning. Is it possible to create a NARX NN with 9 timesteps?
Thanks,
James

Best Answer

  • If you are creating nerual network from nnstart then you would require atleast 10 timesteps.
    Alternatively if you can follow the example Train NARX Network and Predict on New Data & write a MATLAB script as below then I think you can create and train the network.
    [X,T] = simpleseries_dataset;
    Xnew = X(10:100);
    X = X(1:9);
    T = T(1:9);
    net = narxnet(1:2,1:2,10);
    [Xs,Xi,Ai,Ts] = preparets(net,X,{},T);
    net = train(net,Xs,Ts,Xi,Ai);
    view(net)