资源描述:
《用小波神经网络来对时间序列进行预测.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、/*Note:YourchoiceisCIDE*/#include"stdio.h"voidmain(){}/*用小波神经网络来对时间序列进行预测*//*%Filename:nprogram.m%Description:Thisfilereadsthedatafrom%itssourceintotheirrespectivematricespriorto%performingwaveletdecomposition.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Clearcommandscreenan
2、dvariables*/clc;clear;/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%userdesiredresolutionlevel(Tested:resolution=2isbest)*/level=menu('Enterdesiredresolutionlevel:','1',...'2(Selectthisfortesting)','3','4');switchlevelcase1,resolution=1;case2,resolution=2;case3,resolution=3
3、;case4,resolution=4;endmsg=['Resolutionleveltobeusedis',num2str(resolution)];disp(msg);/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%userdesiredamountofdatatouse*/data=menu('Chooseamountofdatatouse:','1day','2days','3days','4days',...'5days','6days','1week(Selectthisfortest
4、ing)');switchdatacase1,dataPoints=48;/*%1day=48points*/case2,dataPoints=96;/*%2days=96points*/case3,dataPoints=144;/*%3days=144points*/case4,dataPoints=192;/*%4days=192points*/case5,dataPoints=240;/*%5days=240points*/case6,dataPoints=288;/*%6days=288points*/case7,dataPoints=336
5、;/*%1weeks=336points*/endmsg=['No.ofdatapointstobeusedis',num2str(dataPoints)];disp(msg);/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Menufordatasetselection*/select=menu('UseQLDdataof:','Jan02',...'Feb02','Mar02(Selectthisfortesting)','Apr02','May02');switchselectcase1,de
6、mandFile='DATA200601_QLD1';case2,demandFile='DATA200602_QLD1';case3,demandFile='DATA200603_QLD1';case4,demandFile='DATA200604_QLD1';case5,demandFile='DATA200605_QLD1';end/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ReadingthehistoricalDEMANDdataintotDemandArray*/selectedDe
7、mandFile=[demandFile,'.csv'];[regionArray,sDateArray,tDemandArray,rrpArray,pTypeArray]...=textread(selectedDemandFile,'%s%q%f%f%s','headerlines',1,'delimiter',',');/*%Displayno.ofpointsintheselectedtimeseriesdemanddata*/[demandDataPoints,y]=size(tDemandArray);msg=['Theno.ofpoin
8、tsintheselectedDemanddatais',num2str(demandDataPoints)