Prediction of time series with NAR neural network in MATLAB timeseries prediction

Source: Internet
Author: User

For details, please refer to: http://lab.fs.uni-lj.si/lasin/wp/IMIT_files/neural/nn05_narnet/

Format compact% Data SETTINGSN = 249; % Number of Samplesnu = 224; % Number of learning Samplesy = data;% Input your data% prepare training Datayt = Con2seq (Y (1:nu) ');% prepare Test datayv = Con2seq (Y (nu+1:end) ');% Choose a Training function% for a list of all Training functions type:help nntrain% ' TRAINLM ' I s usually fastest.% ' TRAINBR ' takes longer but may is better for challenging problems.% ' TRAINSCG ' uses less memory.  Ntstool falls back to this in the low memory SITUATIONS.TRAINFCN = ' TRAINLM '; % levenberg-marquardt% Create a nonlinear autoregressive networkfeedbackdelays = 1:5;hiddenlayersize = 40;net = narnet (fee Dbackdelays,hiddenlayersize, ' open ', TRAINFCN);  [Xs,xi,ai,ts] = Preparets (NET,{},{},YT);% train NET with prepared training Datanet = train (net,xs,ts,xi,ai);% View trained net% Close feedback for recursive predictionnet = Closeloop (net);% view Closeloop version of a NetView (net);%%%recursive Prediction on test data% prepare test data for network Simulationyini = YT (End-max (feedbackdelays) +1:end);  % initial values from training data% combine initial values and test data ' YV ' [xs,xi,ai] = Preparets (Net,{},{},[yini yv]);

Prediction of time series with NAR neural network in MATLAB timeseries prediction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.