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 commentaires

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.

Connectez-vous pour commenter.

 Réponse acceptée

help elmannet
doc elmannet

1 commentaire

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by