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

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

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);
I forgot to mention that the documentation states that ELMANNET is obsolete and recommends NARXNET instead.

Sign in to comment.

 Accepted Answer

help elmannet
doc elmannet

1 Comment

I have followed the example (program written as above), but I still got the errors. What was going wrong?

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!