Neural network inputs and Outputs with different time delay

5 views (last 30 days)
It is possible to configure and train a NN with diffrent time delays in the MATLAB neural network tool box such as:
Y(t)=F(x(t),x(t-4),x(t-7),y(t-1),y(t-3)) with F the model.
or
Y(t)=F(x1(t-1),x2(t-2),x4(t-4))
Unfortunately NARX work only with same time delay for all inputs and outputs
Thanks

Accepted Answer

Greg Heath
Greg Heath on 8 Oct 2013
Incorrect.
The number and values of ID and FD are independent.
Simple example:
close all, clear all, clc, plt=0
[X,T] = simplenarx_dataset;
net = narxnet(1,1:2,10);
view(net)
[Xs,Xi,Ai,Ts] = preparets(net,X,{},T);
whos
rng(0)
[net tr Ys Es Xf Yf] = train(net,Xs,Ts,Xi,Ai);
view(net)
whos
ts = cell2mat(Ts);
MSE00 = var(ts,1) % 0.099154
ys = cell2mat(Ys);
es = cell2mat(Es);
R2 = 1-mse(es)/MSE00 % 1
plt=plt+1,figure(plt)
hold on
plot(ts,'o','LineWidth',2)
plot(ys,'r--','LineWidth',2)
Hope this helps.
Thank you for formally accepting my answer
Greg
  7 Comments
Greg Heath
Greg Heath on 13 Oct 2013
>Using auto/cross-correlation functions to determine the lags is useful for linear systems but for nonlinear systems with high complexity it does not work.
Bull.
Can you illustrate this with one of the many MATLAB timeseries datasets at
help nndatasets
Greg
Greg Heath
Greg Heath on 13 Oct 2013
Very often using an underpowered model for input variable selection works surprisingly well.

Sign in to comment.

More Answers (2)

Greg Heath
Greg Heath on 10 Oct 2014
I think the above discussions are somewhat confusing. My main points are
1. Use the target auto and target/input cross-correlation functions to determine the significant lags.
2. In a MIMO system the significant lags may be different for different inputs and input/target
combinations.
3. However,
a. all inputs must have the same nonnegative lags (which may be nonconsecutive)
b. All output feedback must have the same positive lags (which may be nonconsecutive)
Hope this helps,
Greg
  2 Comments
Platon
Platon on 13 Oct 2014
The line code : net = narxnet([1 3 6],[2 5],10) will create a net with 3 TD for each input such as In(t-1), In(t-3) and In(t-6) and 2 TD for the output such as Out(t-2) and Out(t-5). This is what I was asking for. But as you said perhaps it is more relevant to use the same lags (this is another question).
Greg Heath
Greg Heath on 14 Oct 2014
No you misunderstood.
For a MIMO model all inputs must have the same set of input delays, e.g., ID = [ 1 3 6 ]. However, you might want to look at the significant lags for each crosscorrelation function of each input/output combination. Then choose a subset of those.
Correspondingly, for a MIMO model all targets must have the same set of feedback delays, e.g., FD = [ 2 6 ]. However, you might want to look at the significant lags for each target autocorrelation function of each target. Then choose a subset of those.

Sign in to comment.


Yu-hsuan Lo
Yu-hsuan Lo on 9 Jul 2018
Edited: Yu-hsuan Lo on 9 Jul 2018
Still now,
I can't ensure that the Input delay set like [1 3 6] is equal to the result :
y(t) = f{ x(t-1) , x(t-2) , x(t-3) }.
Because the data treated by 'preparets' is the same when the delay seeting is [1 3 6] , [ 6 ] or [3 6], and the data feed into my NN model(NARX) are the same, like
NARX = train(NARX,Xs,Ts,Xi).
So, will my NARX(below) work what I want : y(t) = f { y(t-1) , x(t-3) } ?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!