Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 Murugan Solaiyappan Posts: 53 Registered: 12/4/10
Re: how to train the network for stock data
Posted: Dec 12, 2012 2:10 AM

Dear Greg Sir,

With the help of your guidance I change my code,
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);

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.

Date Subject Author
11/27/12 Murugan Solaiyappan
11/29/12 Greg Heath
12/12/12 Murugan Solaiyappan
12/13/12 Greg Heath