To check the working of NARX neural network for time series prediction
2 次查看(过去 30 天)
显示 更早的评论
Hi all, i am using NARX neural network to train my model. for the training of neural network, my data train is 31*468 double , data test is 31*168 and target train is 1*468 whereas target test is 1*168 But i am encountering the error as "
>> [inputStates,Xi,Ai,targetStates] = preparets(net,data_train,{},target_train)
Index in position 2 exceeds array bounds (must not exceed 1).
Error in preparets (line 293)
xi = xx(:,FBS+((1-net.numInputDelays):0));
My NARX net configuration is :
trainFcn = 'trainlm';
inputDelays = 1:2;
feedbackDelays = 1:2;
hiddenLayerSize = 10;
net.performFcn = 'mse';
net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize,'open',trainFcn);
[inputStates,Xi,Ai,targetStates] = preparets(net,data_train,{},target_train)
net = train(net,Xs,Ts,Xi,Ai);
view(net)
net.divideFcn = 'divideblock'; % Divide data in blocks
net.divideMode = 'time'; % Divide up every value
net.trainFcn = 'trainlm'; % Levenberg-Marquardt
[net,tr] = train(net,data_train,target_train,inputStates,layerStates)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/374496/image.jpeg)
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!