The problem seems to be recurrent because of all the similar questions I've read about it, and it's as follows:
I am training an ANN using 8 predictors and 1 vector as a target for a time series data with 5,000 time steps. The case is very similar (if not exactly to the MATLAB webinar of forecasting electricity in Australia). In that example, the fitting tool was applied to train the model and compared with Regression Trees. I did the same and the response was pretty good. The problem comes out when trying to apply NARX instead of either fitnet or feedforwardnet. Given a matrix train_x = [4000 x 8] to train my network (4,000 time steps 8 predictors), then I want to forecast data using a different set of predictors (a matrix test_x =[2000 x 8] using "net" function like this:
test = net(test_x')';
or similarly using sim function like this:
test = sim(net, train_x')'
Then, I got the following error:
"Error using network/sim (line 266) Number of inputs does not match net.numInputs."
But when testing after training the network using "fitnet" or "feedforwardnet", like this:
test = sim(net, train_x')';
I got the answer I was looking for.
What would be the cause of my error? Your feedback would be highly appreciated.
Sincerely, Jorge Pesantez