How to forecast with Neural Network?
I’m using MATLAB R2011a. I’m trying to predict next 100 points of time-serie X by means of neural net. Firstly, I create input time series Xtra and feedback time series Ytra:
lag = 50;
Xu = windowize(X,1:lag+1); %Re-arrange the data points into a Hankel matrix
Xtra = Xu(:,1:lag); %input time series
Ytra = Xu(:,end); %feedback time series
Then I train neural net with this code:
inputSeries = tonndata(Xtra,false,false);
targetSeries = tonndata(Ytra,false,false);% Create a Nonlinear Autoregressive Network with External Input
inputDelays = 1:2;
feedbackDelays = 1:2;
hiddenLayerSize = 10;
net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize);% Prepare the Data for Training and Simulation
[inputs,inputStates,layerStates,targets] = preparets(net,inputSeries,{},targetSeries);% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;% Train the Network
[net,tr] = train(net,inputs,targets,inputStates,layerStates);% Test the Network
outputs = net(inputs,inputStates,layerStates);
errors = gsubtract(targets,outputs);
performance = perform(net,targets,outputs)
And then I would like to predict next 100 points of my initial time-serie X, what should I do?
ANSWER
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
0. Incorrect use of the word ‘lag’
1. It is rare that the default input parameters (ID,FD,H) are sufficient. They can be improved by using a subset of significant lags determined from the auto and cross-correlation functions and then searching over a range of H values. The smallest acceptable value of H should be used.
2. The default ‘dividerand’ should be overwritten (e.g., ‘divideblock’) to optimize the effectiveness of the significant correlation lags found in 1.
3. Train using the syntax
[net tr Ys Es Xf Af ] = train(net,Xs,Ts,Xi,Ai);
to use Xf and Af as intial conditions for continuation data
4. After closing the loop, test the CL net on the original data. If performance is not good compared to the OL performance, train the CL net beginning with the weights obtained with the OL training.
SEE COMPLETE ANSWER CLICK THE LINK
https://www.matlabsolutions.com/resources/how-to-forecast-with-neural-network-.php