MATLAB: NARX network cannot learn identity relation

Deep Learning Toolboxnarx

Consider the simple network below, where targets are simply the inputs. I was expecting the network learn this relation perfectly but unfortunately this is not the case.
Can someone please clarify why this doesnt work?
X = rand(1,1000);
T = X;
net = narxnet(1:2,1:2,10);
[x,xi,ai,t] = preparets(net,con2seq(X),{},con2seq(T));
[net,tr] = train(net,x,t,xi,ai);

Best Answer

For meaningful examples, always use the MATLAB EXAMPLE DATA obtained from
help nndatasets
doc nndatasets
Your example is a case of a single series target without an exogeneous external input. Therefore, the appropriate time-series function would be NARNET.
For meaningful examples, always use data with a deterministic I/O relationship. A random time series is not correlated to anything but a zero delay copy of itself. That would mean a narnet with a zero feedback delay. However, for obvious reasons, zero feedback delays are not allowed in time series.
Hope this helps
Thank you for formally accepting my answer
Greg