Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: how to train the network for stock data
Replies: 3   Last Post: Dec 13, 2012 10:06 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Murugan Solaiyappan

Posts: 22
Registered: 12/4/10
Re: how to train the network for stock data
Posted: Dec 12, 2012 2:10 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.