Predictions using NARX Network
10 次查看(过去 30 天)
显示 更早的评论
I am trying to build a network to do some long term predictions. My data is comprised of an INPUT and TARGET that spawns over 50 years (about 3500 points of data). At first I used the GUI to quickly get a network using default values. The network response seemed good but the ERROR Correlation and INPUT-ERROR cross correlation seem off( from what I understood from reading around here and the documentation, the peak should be at 0 lag). I tried adjusting the delays according to what I read in other question using the correlations but I don't understand how this works exactly. Where do I look to find the correct number of delays?
Another question I have is for long term predictions.Using the GUI I trained the network using around half of the data available, the network returned a very good approximation (with very little error between output and targets). Then in the next tab I used the TEST NETWORK and used the remaining points to see if it could predict the rest of the data. I would expect that at some point the error between output and target would grow but what I generally get is an excelent result where the output seems to be just a bit shifted under the target. (looks like the network learned everything when it is tested)
How can I correctly form predictions outside of the data I have?
I hope I was clear in my query.
0 个评论
采纳的回答
Greg Heath
2013-5-24
You do not explain how you obtained your correlation functions.
Before you design a NARX, obtain the target-target autocorrelation function and the target-input cross-correlation function. Find the significant delays corresponding to peaks above the 95% confidence level of the cross-correlation of the target with random Gaussian noise
If you use nncorr, search my posts to avoid bugs in the code (e.g., the correct cross correlation function is not symmetric about zero lag).
greg nncorr
greg narxnet
Otherwise use ifft(conj(fft(x)).*fft(t)),or xcorr or crosscorr functions in other toolboxes .
The only thing that should have a peak at zero lag is the target autocorrelation function.
In order to predict future data, you need the preceding values of input and target to fill the delay buffers.
Hope this helps.
Thank you for formally accepting my answer
Greg
3 个评论
Greg Heath
2013-5-30
With NARXNET, if you want to predict beyond your design outputs using just future known inputs, convert your open-loop to a closed-loop.
If the closed-loop doesn't work well on design data, it can be trained on the design data starting from the design that had been converted from open-loop.
Then use the future inputs with the closed-loop design.
Hope this helps.
Thank you for formally accepting my answer
Greg
更多回答(2 个)
Greg Heath
2013-5-31
1. Design multiple open-loop (OL) nets in a double loop over the number of hidden nodes (outer loop) and random weight initializations(inner loop). For examples, search NEWSGROUP and ANSWERS with
greg Hub Ntrials
2. Use divideblock instead of dividerand to preserve correlations
3. Use the validation MSE tr.best_vperf to choose the best design and test MSE tr.best_tperf to estimate performance on unseen data.
4. To use the net on unseen data with only known inputs, convert the OL design to closed-loop (CL).
5. Evaluate the CL net on the design data.
6. If performance is significantly worse than the OL performance, use train to improve the CL performance.
7. Use the CL design with future inputs to predict future outputs.
8. If you know the corresponding future targets, you can evaluate the result.
Hope this helps.
Greg
6 个评论
Greg Heath
2014-5-21
When you train the CL design the command is
[ netc trc Ycs Ecs Xcf Acf ] = train(netc,Xcs,Tcs,Xci,Aci);
where
Ycs = netc(Xcs,Xci,Aci);
Ecs = gsubtract(Tcs,Ycs);
Therefore, if, Xcsnew, the continuation of Xcs, is avavailable, future outputs can be predicted via
Ycsnew = netc(Xcsnew, Xcsf, Acsf);
However, Tcsnew is not, in general, known. Therefore Ecsnew and the corresponding performane estimate cannot be estimated.
Dan
2016-10-1
Xcsf, Acsf = Xcf, Acf ?
what do s and f stand for ( start, finish?)?
Dan
2016-10-1
excellent explanation : http://www.mathworks.com/matlabcentral/answers/14970-neural-network-multi-step-ahead-prediction
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!