|
|
Re: how to train the network for stock data
Posted:
Dec 12, 2012 2:10 AM
|
|
Dear Greg Sir,
Thanks for your immediate reply, With the help of your guidance I change my code, % Loading Data load ti_out_t.data; P=ti_out_t(1:189,1:12); T=ti_out_t(1:189,13:24); a1=ti_out_t(190:271,1:12); s1=ti_out_t(190:271,13:24); % Normalising data [pn,minp,maxp,tn,mint,maxt]=premnmx(P',T'); [an1,mina1,maxa1,sn1,mins1,maxs1]=premnmx(a1',s1'); %network creation net=newff(minmax(pn),[24 12],{'tansig','tansig'},'traingdm'); net.trainParam.epochs=3000; net.trainParam.lr=0.3; net.trainParam.mc=0.6; % Train the network net=train(net,pn,tn); y1=sim(net,an1) % Un normalise the data t1=postmnmx(y1',mins1,maxs1); [t1 s1] plot(t1,'r') hold; plot(s); title ('Comparision') d=[t1-s].^2; [m b r]=postreg(t1',s1')
When i executing the above code, displays the following error, ??? Error using ==> times Matrix dimensions must agree.
Error in ==> postmnmx at 68 p = p.*((maxp0-minp0)*oneQ) + minp0*oneQ;
Error in ==> nn_taiwan_12input at 14 t1=postmnmx(y1',mins1,maxs1);
I can't understand the error. Please help me sir,
the structure of ti_out_t.data (271Rows and 24 Columns (12 column for input and 12 column for output) 1)0.00 0.00 0.00 0.00 0.00 0.00 0.07 1.00 0.93 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.28 1.00 0.72 0.00 0.00 0.00 2)0.00 0.00 0.00 0.00 0.00 0.00 0.28 1.00 0.72 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.77 1.00 0.23 0.00 0.00 0.00 0.00 3)0.00 0.00 0.00 0.00 0.00 0.77 1.00 0.23 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.42 1.00 0.58 0.00 . . . . 271
I have problem with postprocessing work and also how can i predict the stock value for the new data.
|
|