Info
This question is closed. Reopen it to edit or answer.
I keep getting null results from NARX simulation.
1 view (last 30 days)
Show older comments
Hi, I want to predict 16 timesteps using only the predicted inputs (not the targets). I got results when I use the function preparets with the targets preparets(net,testSeries,{},targetSeries);, but only getting null results when using it without it. i.e. preparets(net,testSeries,{});
The code follows:
inputSeries_5 = num2cell([acumulatedPrecipitation;temperature5cm]); targetSeries_5 = num2cell(soilMoisture5cm); testSeries_5=num2cell([[acumulatedPrecipitation,precipitationForecast];[temperature5cm,temperatureForecast5cm]]);
inputDelays = 1:16; feedbackDelays = 1:16; hiddenLayerSize = 10; net_5_Cm = narxnet(inputDelays,feedbackDelays,hiddenLayerSize); net_5_Cm.numInputs=3;
[inputs_5,inputStates_5,layerStates_5,targets_5] = preparets(net_5_Cm,inputSeries_5,{},targetSeries_5);
net_5_Cm.divideParam.trainRatio = 70/100; net_5_Cm.divideParam.valRatio = 15/100; net_5_Cm.divideParam.testRatio = 15/100;
net_5_Cm.trainParam.showWindow=0; view(net_5_cm);
[net_5_Cm,tr] = train(net_5_Cm,inputs_5,targets_5,inputStates_5,layerStates_5);
[xs,xis,ais,ts] = preparets(net_5_Cm,testSeries_5,{}); outputs_5 = net_5_Cm(xs,xis,ais);
Previsao5=[soilMoisture5cm(1:16),cell2mat(outputs_5)];
saida_5=outputs_5((end-16):end);
1 Comment
Greg Heath
on 4 Jan 2016
VERY DIFFICULT TO FOLLOW YOUR NOTATION! Are you able to
1. Simplify your notation
2. Apply your code to a MATLAB dataset
help nndatasets
doc nndatasets
Thanks,
Greg
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!