How to predict future values by using Elman recurrent neural network (ERNN) in MATLAB R2012a?

2 views (last 30 days)
I want to predict future values by 1 step ahead using ERNN. I have a dataset (which I name as 'ba') of size 1x120. But, when I follow the example, it gives me errors. I write as follows:
>> input=ba(1:119); >> target=ba(2:120); >> net=elmannet(1,10); >> [Xs,Xi,Ai,Ts]=preparets (net,input,target); >> net=train(net,Xs,Ts,Xi,Ai);
Error using traingdx (line 108)
Inputs and layer states have different
numbers of samples.
Error in network/train (line 106)
[net,tr] =
feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);
And, I also not sure what the 'layerdelays' in "elmannet(layerdelays,hiddenSizes,trainFcn)" means. I just put 1 because I think that I want to predict future values of 1 step ahead.
  2 Comments
Greg Heath
Greg Heath on 19 Mar 2015
Does it work on the simpleseries example in the documentation ?
[X,T] = simpleseries_dataset;
whos
% Name Size Bytes Class
% T 1x100 12000 cell
% X 1x100 12000 cell
input =T(1:99);
target=T(2:100);
net=elmannet(1,10);
[Xs,Xi,Ai,Ts]=preparets (net,input,target);
net=train(net,Xs,Ts,Xi,Ai);
Greg Heath
Greg Heath on 19 Mar 2015
I forgot to mention that the documentation states that ELMANNET is obsolete and recommends NARXNET instead.

Sign in to comment.

Accepted Answer

Greg Heath
Greg Heath on 19 Mar 2015
help elmannet
doc elmannet

More Answers (0)

Community Treasure Hunt

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

Start Hunting!