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?
Kshitij Singh answered .
2025-11-20
[net tr Ys Es Xf Af ] = train(net,Xs,Ts,Xi,Ai);
The electricity power consumption is a non-linear process. Artificial Neural Networks have the capability to predict future data based on the data fed for training as it can recognize the pattern in it. This will in turn enable us to maintain a good power management..
https://www.matlabsolutions.com/matlab-projects/electricity-load-forecasting-using-neural-network-in-matlab.php