MATLAB: [ PLEASE HELP !!!! ( Neural Network Time Series Tools ) “forecasting” ]

neural network

hello everyone..
this my problem…
i am using "nonlinear Autoregressive" for forecasting time series on Neural Time Series Tools..
I have enter my data to predicted in day periode and i have train my data..
and this simple script generated…
**************************************************************************
% Solve an Autoregression Time-Series Problem with a NAR Neural Network
% Script generated by NTSTOOL
% Created Sat Sep 08 23:46:26 EEST 2012
%

% This script assumes this variable is defined:
%
% Book1 - feedback time series.
targetSeries = tonndata(Book1,false,false);
% Create a Nonlinear Autoregressive Network
feedbackDelays = 1:2;
hiddenLayerSize = 10;
net = narnet(feedbackDelays,hiddenLayerSize);
% Prepare the Data for Training and Simulation
% The function PREPARETS prepares timeseries data for a particular network,
% shifting time by the minimum amount to fill input states and layer states.
% Using PREPARETS allows you to keep your original time series data unchanged, while
% easily customizing it for networks with differing numbers of delays, with
% open loop or closed loop feedback modes.
[inputs,inputStates,layerStates,targets] = preparets(net,{},{},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)
% View the Network
view(net)
% Plots
% Uncomment these lines to enable various plots.
%figure, plotperform(tr)
%figure, plottrainstate(tr)
%figure, plotresponse(targets,outputs)
%figure, ploterrcorr(errors)
%figure, plotinerrcorr(inputs,errors)
% Closed Loop Network
% Use this network to do multi-step prediction.
% The function CLOSELOOP replaces the feedback input with a direct
% connection from the outout layer.
netc = closeloop(net);
[xc,xic,aic,tc] = preparets(netc,{},{},targetSeries);
yc = netc(xc,xic,aic);
perfc = perform(net,tc,yc)
% Early Prediction Network
% For some applications it helps to get the prediction a timestep early.
% The original network returns predicted y(t+1) at the same time it is given y(t+1).
% For some applications such as decision making, it would help to have predicted
% y(t+1) once y(t) is available, but before the actual y(t+1) occurs.
% The network can be made to return its output a timestep early by removing one delay
% so that its minimal tap delay is now 0 instead of 1. The new network returns the
% same outputs as the original network, but outputs are shifted left one timestep.
nets = removedelay(net);
[xs,xis,ais,ts] = preparets(nets,{},{},targetSeries);
ys = nets(xs,xis,ais);
closedLoopPerformance = perform(net,tc,yc)
**************************************************************************
i have run my script but the result just statistical data, not predicting
and my question…
how script to predict the next day from my Data ??
thank..

Best Answer

I have appllied your openloop code, with revisions, to the simplenar_data set.
As a result, I have a few comments:
1. ALWAYS initialize the random number generator so that you can reproduce previous runs.
2. Standardize (zscore) the data so that outlers are more easily recognized and MSE estimates are invariant to the original scale of the data.
3. Plot the running mean of the absolute value of the series autocorrelation function so that you can estimate a reasonable range for candidate values of the number of feedback delays.
4. Take into consideration the ratio of number of training equations Neq, to the number of estimated weights, Nw, so that you can better estimate a reasonable range for candidate values of the number of hidden nodes.
5. Choose the divideblock division option so that training, validation and test subsets are contiguous and evenly spaced.
6. The best of multiple designs are chosen by validation design set performance.
7. The unbiased predicted performance on nondesign data is estimated using the test set with the best design.
8. In addition to varying delays, hidden nodes and initial weights, you may wish to estimate the least amount of training data that is necessary to obtain a good design..