Predict using new external input for narx model
3 views (last 30 days)
Show older comments
Hi every one ,i want to test my narx network with new exogenous input to forecast the 59 futures values,i applied this code https://www.mathworks.com/help/deeplearning/ref/narxnet.html but its give me error when i use this function ypred=netc(xnew,xic,aic) ,and when i use this function ypred=netc(xnew) its give me the same value of all the columns i don't know what to do,please help me if you don't mide .thanks in advance
0 Comments
Answers (1)
Raag
on 11 Mar 2025
Hi Wissal,
When predicting with a NARX network using new external inputs, it's important to prepare the input data so that the network’s internal states are properly updated. Instead of calling:
ypred = netc(xnew, xic, aic)
or
ypred = netc(xnew)
directly which may lead to errors or uniform outputs, you should use the ‘preparets’ function to format your new input data and initialize the network's delay states. For example:
% Prepare the new external input (xnew) along with empty target sequences
[xnewPrepared, xic, aic] = preparets(netc, xnew, {});
% Predict using the prepared inputs and initial conditions
ypred = netc(xnewPrepared, xic, aic);
This approach ensures that the ‘NARX’ network is provided with correctly formatted data and properly initialized states, avoiding errors and preventing the output from being constant across columns.
For a better understanding of the above solution, refer to the following MATLAB documentation:
0 Comments
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!