SlideShare a Scribd company logo
1 of 55
Download to read offline
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
1
UUSSIINNGG NNEEUURRAALL NNEETTWWOORRKKSS TTOO EEXXPPLLAAIINN BBEEHHAAVVIIOORR
OOFF IINNDDIIAANN MMAARRKKEETTSS
PPGGSSEEMM FFIINNAALL PPRROOJJEECCTT RREEPPOORRTT
Student: Vinay Avasthi
Roll No. 2003152
FFAACCUULLTTYY GGUUIIDDEE:: PPRROOFF.. RRAAHHUULL DDEE
IINNDDIIAANN IINNSSTTIITTUUTTEE OOFF MMAANNAAGGEEMMEENNTT BBAANNGGAALLOORREE
Towards partial fulfillment of the requirements for the Post Graduate Diploma in Software
Enterprise Management of the Indian Institute of Management Bangalore
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
2
TTAABBLLEE OOFF CCOONNTTEENNTTSS
INTRODUCTION........................................................................................................................................... 5
REFERENCES................................................................................................................................................. 5
PRIOR WORK ................................................................................................................................................ 5
SIGNIFICANCE OF THIS PROJECT ..................................................................................................................... 6
VARIABLES EVALUATED ............................................................................................................................... 6
STRATEGY .................................................................................................................................................. 10
FACTORS .................................................................................................................................................... 10
Factor 1 – RBI influence and Core sector............................................................................................... 11
Factor 2 – Foreign Exchange and Crude................................................................................................ 13
Factor 3 – Agriculture, Total Domestic Product ..................................................................................... 13
Factor 4 – Company Financials ............................................................................................................. 13
Factor 5 – Company Ratios.................................................................................................................... 14
Factor 6 – Agriculture, Community services, debt structure with RBI...................................................... 14
Factor 7 – Company Capital structure, profitability ratios and other indicators...................................... 14
Factor 8 – Banking system residuals ...................................................................................................... 14
Factor 9 – Company Liquidity Ratios..................................................................................................... 15
Factor 10 – Company stock performance................................................................................................ 15
Factor 11 – RBI balance sheet debt structure and errors ........................................................................ 15
Factor 12 – RBI balance sheet errors..................................................................................................... 16
Factor 13 – Company indicators (residuals)........................................................................................... 16
Factor 14 – Banking system residuals..................................................................................................... 16
Factor 15 – Company financial ratios, Residuals.................................................................................... 16
Factor 16 – Foreign Exchange, Crude and interest rate, Residuals......................................................... 17
Factor 17 – Company Financial Ratios, Residuals.................................................................................. 17
Factor 18 – Company Financial Ratios, Residuals.................................................................................. 17
Factor 19 – USD Forward Spot rate....................................................................................................... 18
Factor 20 – IDBI lending rate and crude prices...................................................................................... 18
COMPANIES ................................................................................................................................................ 18
CHOICE OF NEURAL NETWORK ........................................................................................................... 20
INPUTS AND OUTPUTS ................................................................................................................................. 20
HIDDEN LAYERS ......................................................................................................................................... 20
TRAINING RESULTS..................................................................................................................................... 21
Next Day Neural Network ...................................................................................................................... 21
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
3
Next Fortnight Neural Network .............................................................................................................. 23
Six Month Neural Network ..................................................................................................................... 25
NEURAL NETWORK PREDICTION......................................................................................................... 27
Next Day Prediction............................................................................................................................... 27
Next Fortnight Prediction....................................................................................................................... 28
Six Month prediction.............................................................................................................................. 29
SIMULATED TRADING ............................................................................................................................. 31
CONCLUSION ............................................................................................................................................. 32
FURTHER WORK .......................................................................................................................................... 32
APPENDIX A FACTOR ANALYSIS................................................................................................... 33
TOTAL VARIANCE EXPLAINED ..................................................................................................................... 33
COMPONENT MATRIX.................................................................................................................................. 36
APPENDIX B NEURAL NET GENERATOR..................................................................................... 40
SOURCE FOR NEURALNETSCREENER ........................................................................................................... 40
SOURCE FOR STOCKMARKETNEURALNETCREATOR ..................................................................................... 46
APPENDIX C SIMULATED TRADE SHEET .................................................................................... 48
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
4
TTAABBLLEE OOFF FFIIGGUURREESS
FIGURE I PERCENTAGE CONTRIBUTION OF FACTORS 11
FIGURE II TRAINING AND VALIDATION ERRORS FOR DIFFERENT NN ARCHITECTURES 21
FIGURE III TRAINING AND VALIDATION ERROR FOR NEXT DAY OPEN PREDICTION 22
FIGURE IV TRAINING AND VALIDATION ERROR FOR NEXT DAY HIGH 22
FIGURE V TRAINING AND VALIDATION ERRORS FOR NEXT DAY LOW PRICE PREDICTION 23
FIGURE IX TRAINING AND VALIDATION ERROR FOR NEXT FORTNIGHT OPEN PREDICTION 23
FIGURE X TRAINING AND VALIDATION ERROR FOR NEXT FORTNIGHT HIGH PREDICTION 24
FIGURE XI TRAINING AND VALIDATION ERROR FOR NEXT FORTNIGHT LOW PREDICTION 24
FIGURE XII TRAINING AND VALIDATION ERROR FOR SIX MONTH LATER OPEN PRICE 25
FIGURE XIII TRAINING AND VALIDATION ERROR FOR SIX MONTH LATER HIGH PRICE 25
FIGURE XIV TRAINING AND VALIDATION ERROR FOR SIX MONTH LATER LOW PRICE 26
FIGURE XV ACTUAL AND PREDICTED STOCK PRICES OF SELECT NIFTY COMPANIES NEXT DAY 27
FIGURE XVI ACTUAL AND PREDICTED STOCK PRICES OF SELECT NIFTY COMPANIES NEXT DAY 28
FIGURE XVII ACTUAL AND PREDICTED STOCK PRICES OF SELECT NIFTY COMPANIES AFTER A FORTNIGHT 28
FIGURE XVIII ACTUAL AND PREDICTED STOCK PRICES OF SELECT NIFTY COMPANIES AFTER A FORTNIGHT 29
FIGURE XIX ACTUAL AND PREDICTED STOCK PRICE AFTER NEXT SIX MONTHS FOR ABB 29
FIGURE XX ACTUAL AND PREDICTED STOCK PRICE AFTER SIX MONTHS FOR SELECT NIFTY COMPANIES 30
FIGURE XXI ACTUAL AND PREDICTED STOCK PRICE AFTER SIX MONTHS FOR SELECT NIFTY COMPANIES 30
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
5
IINNTTRROODDUUCCTTIIOONN
This project evaluates the impact of changes in macro and micro economic variables on
Indian financial markets. The data that is evaluated for this effort contains variables directly
controlled by Reserve Bank of India and other variables like price of crude etc.
The project uses a combination of statistical analysis and artificial intelligence techniques to
generate a model that could be used to predict the behavior of the markets.
References
[1] Yung-Keun Kwon, Sillim-dong, Gwanak-gu, and Sung-Soon Choi, Stock Prediction
Based on Financial Correlation, GECCO’05, June 25–29, 2005, ACM
[2] Shaun-inn Wu and Ruey-Pyng Lu, Combining Artificial Neural Networks and Statistics
for Stock-Market Forecasting, © 1993 ACM
[3] JooneWorld, Java Object Oriented Neural Engine, http://www.jooneworld.com
[4] New Research Initiative, Paper No. 10, Empirical Investigation of Multifactor Asset
Pricing Model Using Artificial Neural Networks, M V Kamath
[5] James V. Hansen and Ray D. Nelson, Neural Networks and Traditional Time Series,
Methods: A Synergistic Combination in State Economic Forecasts, IEEE Transactions
On Neural Networks, VOL. 8, NO. 4, JULY 1997
Prior Work
There has been considerable work in the area of financial forecasting using neural networks.
• [1] uses input data of multiple companies to predict stock price. This model does
not use any data other than the company data. This model depends on the
assumption that the stock price of a company is correlated with the stock price of
other companies in the exchange.
• [2] uses neural networks to forecast S & P 500 index values
• [4] is a specific study done as a student project in National Stock Exchange. This
uses a limited set of RBI controlled variables and uses neural network to predict
the stock market behavior
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
6
Significance of this project
This project is working on basic premise that the trader’s and investor’s behavior in stock
market is controlled by the information that is available to them while they are making trading
decisions. In context of Indian stock market this information is available in following formats.
• Company results
• RBI controlled variables
• Foreign investment numbers
• GDP numbers
• Debt situation in the country
• Crude prices
• Indian interest rates
• US interest rates
Most of this data is available publicly. The assumption that this project makes is that if the
same information is made available to a neural network then after training it would be able to
predict the movement of individual stocks in the market.
Variables Evaluated
Following variables are evaluated as part of constructing this model.
• assetsWithBankingSystem – Total assets with the banking system
• bankCredit – Bank credit in India
• cash – Cash in hand
• investmentAtBookValue – Total bank investments at book value
• liabilitiesToBankingSystem – Total liabilities of banks to banking system
• liabilitiesToOthers – Total liability of banks other than banking system
• curcredit – Current account credit in INR
• curdebit – Current account debit in INR
• capcredit – Capital account credit in INR
• capdebit – Capital account debit in INR
• errcredit – Errors credit
• errdebit – Errors debit
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
7
• balcredit – Balance credit
• baldebit – Balance debit
• monmovcredit – Monetary movements credit
• monmovdebit – Monetary movements debit
• callMoneyHigh – Call money rate, High
• callMoneyLow – Call money rate, Low
• eps – Earning per share of the company
• ceps – Cash earning per share of the company
• bookValue – Book value of the company
• div – Dividend paid per share of the company
• opProfitPerShare – Operating profit per share of the company
• netOperatingIncomePerShare – Net operating income per share of the company
• freeReserves – Free reserves with the company
• opm – Operating profit margin of the company
• gpm – Gross profit margin of the company
• npm – Net profit margin of the company
• ronw – Return on net work of the company
• debtToEquity – Debt to equity ratio of the company
• currentRatio – Current ratio of the company
• quickRatio – Quick ratio of the company
• interestCover – Interest cover of the company
• salesByTotalAssets – Sales by total assets of the company
• salesByFixedAssets – Sales by fixed assets of the company
• salesByCurrentAssets – Sales by current assets of the company
• noOfDaysOfWorkingCapital – No of days of working capital with the company
• cpi – Consumer price index
• br – Bank Rate
• idbiRate – IDBI minimum term lending rate
• maxCMR – Maximum Call Money Rate
• maxPLR – Maximum prime lending rate
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
8
• minPLR – Minimum Prime lending rate
• price – Crude price
• totalINRdebt – Total debt in Indian Rupees
• concessionalDebtAsPercOfTotal – Concessional debt as a percentage of total
• shortTermDebtAsPercOfTotal – Short term debt as a percentage of total
• affConstant – Agriculture, Forestry and Fishing, GDP factor cost, Constant prices
• affCurrent – Agriculture, Forestry and Fishing, GDP factor cost, Current prices
• cspsConstant – Community social and personal services, GDP factor cost,
Constant prices
• cspsCurrent – Community social and personal services, GDP factor cost, Current
prices
• consConstant – Construction, GDP factor cost, Constant prices
• consCurrent – Construction, GDP factor cost, Current prices
• egwsConstant – Electricity, Gas and Water Services, GDP factor cost, Constant
prices
• egwsCurrent – Electricity, Gas and Water Services, GDP factor cost, Current
prices
• firebsConstant – Finance, Insurance, Real Estate and Business services, GDP
factor cost, Constant prices
• firebsCurrent – Finance, Insurance, Real Estate and Business services, GDP factor
cost, Current prices
• manuConstant – Manufacturing, GDP factor cost, Constant prices
• manuCurrent – Manufacturing, GDP factor cost, Current prices
• maqConstant – Mining and quarrying, GDP factor cost, Constant prices
• maqCurrent – Mining and quarrying, GDP factor cost, Current prices
• tdpConstant – Total domestic product, GDP factor cost, Constant prices
• tdpCurrent – Total domestic product, GDP factor cost, Current prices
• thrConstant – Trade, Hotel and Restaurant, GDP factor cost, Constant prices
• thrCurrent – Trade, Hotel and Restaurant, GDP factor cost, Current prices
• aff – Agriculture, Forestry and Fishing, GDP factor cost
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
9
• csps – Community social and personal services, GDP factor cost
• cons – Construction, GDP factor cost
• egws – Electricity, Gas and Water Services, GDP factor cost
• firb – Finance, Insurance, Real Estate and Business services, GDP factor cost
• manuf – Manufacturing, GDP factor cost
• min – Mining, GDP factor cost
• tdp – Total domestic product, GDP factor cost
• thr – Trade, Hotel and Restaurant, GDP factor cost
• currencyWithPublic – Total currency with Public
• m3 – Money supply, also referred to as stock of legal currency in the economy
• timeDepositsWithBank – Total time deposits with the bank
• totalIncome – Total income of RBI
• totalExpenditure – Total expenditure of RBI
• netAvailableBalance – Net available balance in RBI
• surplusToCentralGovernment – Surplus payable to central government from RBI
• totalIssuesLiabilities – Total liabilities, Issues
• totalIssuesAssets – Total assets, Issues
• totalBankingLiabilities – Total liabilities, Banking
• totalBankingAssets – Total assets, Banking
• reserveMoneyLiabilities – Reserve Money, Liabilities
• reserveMoneyAssets – Reserve Money, Assets
• forwardCashSpot – Forward Cash Spot, USD forward premia
• forwardCashOneMonth – Forward Cash one month, USD forward premia
• forwardCashThreeMonth – Forward Cash three months, USD forward premia
• forwardCashSixMonth – Forward Cash six months, USD forward premia
• forwardCash12Month – Forward cash twelve months, USD forward premia
• referenceRate – RBI reference rate for USD
• rate – US interest rate
• quantitiy – Quantity of particular stock traded
• turnover – Total turn over of stock traded
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
10
We would use above macro and micro economic indicators to establish the relationship of
these indicators with following data for each company and sensitive index for a specific day.
• Day open
• Day high
• Day low
For each company and index, the model would be developed to predict prices four time
periods.
• Next day prices – +1d
• Prices after 15 days – +15d
• Prices after six months - +6m
Strategy
Since we are looking at very large number of input variables related to economic indicators
which may have heavy correlation between themselves, we will first use factor analysis to
identify a manageable set of factors that could be used as inputs for the neural network later to
develop the prediction model.
For each company four models would be constructed as follows.
• 1D model, which would predict the prices for next day given the stock price,
turnover and quantity for a day earlier to previous day.
• 15D model, which would predict the prices 15 days down the line.
• 180D model, which would predict the prices six months down the line given the
stock price for a day.
Factors
After the factor analysis of the data, 96 inputs are reduced to 20 inputs with 95% of the
variance explained. These factors are as follows. As we can see from Factor Analysis, first 5
factors contribute 75% of the variance in the data while rest of the 15 factors only adds
approximately 20% of data.
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
11
0.00%
10.00%
20.00%
30.00%
40.00%
50.00%
60.00%
Factor1
Factor2
Factor3
Factor4
Factor5
Factor6
Factor7
Factor8
Factor9
Factor10
Factor11
Factor12
Factor13
Factor14
Factor15
Factor16
Factor17
Factor18
Factor19
Factor20
0.00%
10.00%
20.00%
30.00%
40.00%
50.00%
60.00%
70.00%
80.00%
90.00%
100.00%
Percentage contribution
Cumulative percentage
Figure I Percentage contribution of factors
As we go to later factors, these mostly cover the residual values from initial factors. Figure I
clearly depict the contribution of each of the factors towards the final value and we can see
that the contribution of factors beyond Factor 10 is very low.
Factor 1 – RBI influence and Core sector
First factor signifies RBI’s influence and GDP related to the core sector on the market. It is
very highly correlated to the money supply variables and variables related to the RBI’s
balance sheet. It is also correlated to GDP in construction, manufacturing, agriculture and
forestry.
Variable Correlation
Total bank investments at book value (investmentAtBookValue) 0.991
Money Supply, stock of legal currency in the economy (m3) 0.984
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
12
Total currency with public (currencyWithPublic) 0.983
Construction GDP at factor cost, current prices (consCurrent) 0.983
Bank Credit in India (bankCredit) 0.981
Finance, Insurance, Realestate and Business services, GDP at factor cost, current prices
(firebsCurrent)
0.981
Total time deposits with bank (timeDepositsWithBank) 0.977
Reserve Money Assets (reserveMoneyAssets) 0.977
Finance, Insurance, Realestate and Business services, GDP at factor cost, constant
prices (firebsConstant)
0.972
Current account debit (curdebit) 0.961
Manufacturing, GDP at factor cost, current prices (manuCurrent) 0.961
Construction GDP at factor cost, constant prices (consConstant) 0.955
Total banking liabilities (totalBankingLiabilities) 0.955
Consumer price index (cpi) 0.954
Trade, hotel and Restaurant, Current prices (thrCurrent) 0.946
Total assets (issues) (totalIssuesAssets) 0.945
Electricity, Gas and Water services, GDP at factor cost (Egws) 0.938
Total domestic product (Tdp) 0.937
Maximum prime lending rate (maxPLR) -0.925
Total expenditure of RBI totalExpenditure 0.904
Mining and quarrying, GDP at factor cost, current prices (maqCurrent) 0.878
Surplus payable to central government from RBI(surplusToCentralGovernment) -0.875
Call money rate, Low (callMoneyLow) -0.855
Agriculture, Forestry and Fishing (Aff) 0.846
Monetory movements, debit (Monmovdebit) 0.824
Total debt in INR (totalINRdebt) 0.819
Cash with RBI (Cash) 0.813
Short term debt as percentage of total debt (shortTermDebtAsPercOfTotal) 0.577
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
13
Factor 2 – Foreign Exchange and Crude
The second factor primarily signifies impact of international events on markets. It correlated
highly with crude prices and prices of USD.
Variable Correlation
USD rate 0.542
Crude price 0.555
Tourism, Hotels and Restaurants -0.569
Capital account credit 0.607
Bank rate 0.615
Capital account credit (RBI) 0.691
RBI reference rate -0.811
Factor 3 – Agriculture, Total Domestic Product
Third factor has very high correlation with Agriculture, Forestry and Fishing. It also correlates
well with total domestic product.
Variable Correlation
Agriculture, Forestry and Fishing, GDP at factor cost, Constant prices (affConstant) 0.596
Community social and personal services, GDP at factor cost, constant prices (cspsConstant) 0.595
Total domestic product, constant prices (tdpConstant) 0.577
Agriculture, Forestry and Fishing, GDP at factor cost, Current prices (affCurrent) 0.515
Community social and personal services, GDP at factor cost, current prices (cspsCurrent) 0.502
Concessional debt as a percentage of total debt. (concessionalDebtAsPercOfTotal) -0.498
Factor 4 – Company Financials
Factor 4 seems to have very high correlation with the financials of the company.
Variable Correlation
Cash earnings per share (ceps) 0.903
Operating profit per share (opProfitPerShare) 0.878
Book value of the company (bookValue) 0.770
Free reserves with the company (freeReserves) 0.762
Net operating income per share (netOperatingIncomePerShare) 0.679
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
14
Earnings per share (eps) 0.544
Dividend (div) 0.527
Factor 5 – Company Ratios
Factor 5 correlates well with the financial ratios of the company.
Variable Correlation
Gross profit margin(gpm) 0.859
Operating profit margin (opm) 0.818
Current ratio (currentRatio) 0.712
Number of days of working capital (noOfDaysOfWorkingCapital) 0.649
Quick ratio (quickRatio) 0.552
Factor 6 – Agriculture, Community services, debt structure with RBI
Variables Correlation
Concessional debt as percentage of total (concessionalDebtAsPercOfTotal) 0.616
Agriculture, Forestry and Fishing, GDP factor cost, Current prices (affCurrent) 0.535
Assets with banking system (assetsWithBankingSystem) -0.528
Community social and personal services, GDP factor cost, Constant prices (cspsConstant) -0.452
Factor 7 – Company Capital structure, profitability ratios and other indicators
Variable Correlation
Share capital (shareCapital) 0.802
Total outstanding shares (outstandingShares) 0.786
Sales by total assets (salesByTotalAssets) 0.532
Return on net worth (ronw) -0.505
Sales by fixed assets (salesByFixedAssets) -0.443
Sales by current assets (salesByCurrentAssets) -0.300
Factor 8 – Banking system residuals
Variables Correlation
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
15
Monetary movement of credit (monmovcredit) 0.577
Banks liability to others (liabilitiesToOthers) 0.527
Banks liability to banking system (liabilitiesToBankingSystem) -0.423
Factor 9 – Company Liquidity Ratios
Variable Correlation
Debt to equity (debtToEquity) 0.863
Sales by fixed assets (salesByFixedAssets) 0.772
Quick Ratio (quickRatio) 0.644
Factor 10 – Company stock performance
Variable Correlation
Earning per share (eps) 0.649
Dividend paid (div) 0.444
Interest cover (interestCover) 0.422
Net operating income per share (netOperatingIncomePerShare) -0.373
Book value of the company (bookValue) -0.339
Factor 11 – RBI balance sheet debt structure and errors
Variables Correlation
Errors in credit (errcredit) -0.584
Error in debit (errdebit) 0.539
Concessional debt as percentage of total debt (concessionalDebtAsPercOfTotal) -0.448
IDBI lending rate (idbiRate) 0.395
Short term debt as percentage of total debt (shortTermDebtAsPercOfTotal) 0.276
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
16
Factor 12 – RBI balance sheet errors
Variables Correlation
Error in debit (errdebit) -0.566
Error in credit (errcredit) 0.410
Banks liabilities to banking system (liabilitiesToBankingSystem) -0.292
Short term debt as percentage of total debt (shortTermDebtAsPercOfTotal) 0.289
Factor 13 – Company indicators (residuals)
Variable Correlation
Net profit margin (npm) -0.614
Company identification (companyId) -0.447
Number of days of working capital (noOfDaysOfWorkingCapital) 0.429
Current ratio of company (currentRatio) 0.402
Factor 14 – Banking system residuals
Variable Correlation
Forward Cash Spot (forwardCashSpot) 0.416
Assets with banking system (assetsWithBankingSystem) 0.401
Liabilities with banking system (liabilitiesToBankingSystem) 0.329
Factor 15 – Company financial ratios, Residuals
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
17
Variables Correlation
Sales by current assets (salesByCurrentAssets) 0.540
Return on net worth (ronw) 0.445
Sales by total assets (salesByTotalAssets) 0.249
Factor 16 – Foreign Exchange, Crude and interest rate, Residuals
Variables Correlation
Interest cover (interestCover) 0.300
IDBI lending rate (idbiRate) 0.257
Reference rate of RBI (referenceRate) 0.241
Price of crude (price) 0.235
Forward cash spot (forwardCashSpot) -0.227
Factor 17 – Company Financial Ratios, Residuals
Variables Correlation
Company identifier (companyId) 0.695
Net profit margin (npm) -0.369
Dividend paid (div) 0.236
Sales by current assets (salesByCurrentAssets) 0.201
Sales by total assets (salesByTotalAssets) -0.186
Debt to equity (debtToEquity) -0.133
Factor 18 – Company Financial Ratios, Residuals
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
18
Variables Correlation
interestCover 0.491
salesByTotalAssets 0.299
opProfitPerShare -0.240
eps -0.226
npm 0.199
Factor 19 – USD Forward Spot rate
Variables Correlation
Forward cash spot (forwardCashSpot) 0.489
Banks liabilities to others (liabilitiesToOthers) -0.465
Factor 20 – IDBI lending rate and crude prices
Variables Correlation
Banks liability to others (liabilitiesToOthers) -0.281
Electricity, Gas and Water services, GDP at factor cost, current prices (egwsCurrent) -0.275
IDBI lending rate (idbiRate) 0.252
Crude oil price (price) 0.218
Companies
We would construct the models for majority of the companies in NSE-50 index. These
companies are listed below.
Reliance Industries TISCO SAIL
IPCL State Bank of India ITC
Tata Motors Maruti Udyog Satyam
VSNL Infosys TCS
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
19
ONGC Bharati L & T
Zee HDFC Ranbaxy
M & M BPCL ICICI Bank
Hero Honda Glaxo Colgate
National Aluminum Dabur SCI
Tata Power Sun Pharma Tata Tea
BHEL ABB Grasim
Gujrat Ambuja Cement HCL Tech Tata Chemicals
MTNL Oriental Bank Reliance Energy
GAIL Wipro Punjab National Bank
Bajaj Auto CIPLA Dr. Reddy
ACC HDFC Bank Hindustan Petro
Two companies have been omitted which are part of NSE-50 because enough data is not
available for them.
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
20
CCHHOOIICCEE OOFF NNEEUURRAALL NNEETTWWOORRKK
Inputs and Outputs
As shown in the Factor Analysis, the economic indicators for model related to the company
have been factored into 20 factors that explain most of these numbers. Additional 3 inputs are
company specific and are related to the past stock price data with respect to that company.
• Previous Close
• Previous Turn Over
• Previous Quantity
These make up for the 23 variables that are used as inputs for neural network. Three different
neural networks are used for following three output variables
• High
• Low
• Close
Hidden Layers
It is assumed given the richness of the data that at least 2 hidden layers would be required to
for a meaningful neural network. The neural network will have 23 inputs and will have 1
output.
Different neural networks would be created and a training run would be performed for a 1500
cycles of data set. At the end of sample run the best network would be chosen for further
training.
Neural networks that were evaluated are with
• 1 input layer with 23 inputs
• first hidden layer with nodes 31 to 351
• second hidden layer with nodes 8 to 31
• 1 output layer
Joone[1] package was used to programmatically create multiple neural networks and measure
their training and validation error.
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
21
Figure II Training and validation errors for different NN architectures
As see in Figure II, the neural network with hidden layer 1 of 130 nodes and hidden layer 2 of
17 nodes comes with best error values to be further used. This NN architecture was used to
further train the network with following different data sets.
Daily Prediction Fortnightly Prediction Six Monthly Prediction
Open
High
Low
Open
High
Low
Open
High
Low
Training Results
Next Day Neural Network
Following chart captures training and validation error for next day open, high and low prices
prediction.
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
22
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1C
ycle
700
1500
2300
3100
3900
4700
5500
6300
7100
7900
8700
950010300111001190012700135001430015100159001670017500183001910019900207002150022300
Training Error
Validation Error
Figure III Training and Validation Error for Next Day Open Prediction
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
Cycles
700
1500
2300
3100
3900
4700
5500
6300
7100
7900
8700
9500
10300
11100
11900
12700
13500
14300
15100
15900
16700
17500
18300
19100
19900
20700
21500
22300
23100
23900
24700
Training
Error
Validation
Error
Figure IV Training and Validation Error for Next Day High
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
23
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1C
ycles
600
1300
2000
2700
3400
4100
4800
5500
6200
6900
7600
8300
9000
9700104001110011800125001320013900146001530016000167001740018100188001950020200
Training Error
Validation Error
Figure V Training and Validation Errors for next day low price prediction
Next Fortnight Neural Network
0
0.01
0.02
0.03
0.04
0.05
0.06
Cycle
400
900
1400
1900
2400
2900
3400
3900
4400
4900
5400
5900
6400
6900
7400
7900
8400
8900
9400
99001040010900114001190012400129001340013900
Training
Error
Validation
Error
Figure VI Training and Validation Error for Next Fortnight Open Prediction
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
24
0
0.01
0.02
0.03
0.04
0.05
0.06
Cycle
700
1500
2300
3100
3900
4700
5500
6300
7100
7900
8700
9500
10300
11100
11900
12700
13500
14300
15100
15900
16700
17500
18300
19100
19900
20700
21500
22300
23100
23900
24700
Training
Error
Validation
Error
Figure VII Training and Validation Error for Next Fortnight High Prediction
0
0.01
0.02
0.03
0.04
0.05
0.06
C
ycles
300
700
1100
1500
1900
2300
2700
3100
3500
3900
4300
4700
5100
5500
5900
6300
6700
7100
7500
7900
8300
8700
9100
9500
Training
Error
Validation
Error
Figure VIII Training and Validation Error for Next Fortnight Low Prediction
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
25
Six Month Neural Network
0
0.01
0.02
0.03
0.04
0.05
0.06
Cycles
800
1700
2600
3500
4400
5300
6200
7100
8000
8900
9800
10700
11600
12500
13400
14300
15200
16100
17000
17900
18800
19700
20600
21500
22400
23300
24200
25100
26000
26900
27800
Training
Error
Validation
Error
Figure IX Training and Validation Error for Six Month Later Open Price
0
0.01
0.02
0.03
0.04
0.05
0.06
Cycle
700
1500
2300
3100
3900
4700
5500
6300
7100
7900
8700
9500
10300
11100
11900
12700
13500
14300
15100
15900
16700
17500
18300
19100
19900
20700
21500
22300
23100
23900
24700
Training
Error
Validation
Error
Figure X Training and Validation Error for Six Month Later High Price
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
26
0
0.01
0.02
0.03
0.04
0.05
0.06
Cycles
700
1500
2300
3100
3900
4700
5500
6300
7100
7900
8700
9500
10300
11100
11900
12700
13500
14300
15100
15900
16700
17500
18300
19100
19900
20700
21500
22300
23100
23900
24700
Training
Error
Validation
Error
Figure XI Training and Validation Error for Six Month Later Low Price
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
27
NNEEUURRAALL NNEETTWWOORRKK PPRREEDDIICCTTIIOONN
After training the neural networks based on above criteria, we have tried to predict the stock
price based on the inputs provided. Following sections cover some of the results of the neural
network training. Detailed results are in appendix.
Next Day Prediction
0
200
400
600
800
1000
1200
1400
1600
08/08/2000
08/10/2000
08/12/2000
08/02/2001
08/04/2001
08/06/2001
08/08/2001
08/10/2001
08/12/2001
08/02/2002
08/04/2002
08/06/2002
08/08/2002
08/10/2002
08/12/2002
08/02/2003
08/04/2003
08/06/2003
08/08/2003
08/10/2003
08/12/2003
08/02/2004
ABB open
ABB high
ABB low
ABB Predicted Open
ABB Predicted High
ABB Predicted Low
ACC Open
ACC High
ACC Low
ACC Predicted Open
ACC Predicted High
ACC Predicted Low
BHEL Open
BHEL High
BHEL Low
BHEL Predicted Open
BHEL Predicted High
BHEL Precited Low
CIPLA Open
CIPLA High
CIPLA Low
CIPLA Predicted Open
CIPLA Predicted High
CIPLA Predicted LOW
GAIL Open
GAIL High
GAIL Low
GAIL Predicted Open
GAIL Predicted High
GAIL Predicted LOW
GRASIM Open
GRASIM High
GRASIM Low
GRASIM Predicted Open
GRASIM Predicted High
GRASIM Predicted LOW
HDFC Open
HDFC High
HDFC Low
HDFC Predicted Open
HDFC Predicted High
HDFC Predicted LOW
Figure XII Actual and predicted stock prices of select Nifty companies next day
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
28
0
200
400
600
800
1000
1200
1400
08/08/2000
08/10/2000
08/12/2000
08/02/2001
08/04/2001
08/06/2001
08/08/2001
08/10/2001
08/12/2001
08/02/2002
08/04/2002
08/06/2002
08/08/2002
08/10/2002
08/12/2002
08/02/2003
08/04/2003
08/06/2003
08/08/2003
08/10/2003
08/12/2003
08/02/2004
IPCL Open
IPCL High
IPCL Low
IPCL Predicted Open
IPCL Predicted High
IPCL Predicted Low
ITC Open
ITC High
ITC Low
ITC Predicted Open
ITC Predicted High
ITC Predicted Low
MTNL Open
MTNL High
MTNL Low
MTNL Predicted Open
MTNL Predicted High
MTNL Predicted Low
ONGC Open
ONGC High
ONGC Low
ONGC Predicted Open
ONGC Predicted High
ONGC Predicted Low
SAIL Open
SAIL High
SAIL Low
SAIL Predicted Open
SAIL Predicted High
SAIL Predicted Low
SCI Open
SCI High
SCI Low
SCI Predicted Open
SCI Predicted High
SCI Predicted Low
Figure XIII Actual and predicted stock prices of select Nifty companies next day
Next Fortnight Prediction
0
200
400
600
800
1000
1200
1400
1600
16/08/2000
16/10/2000
16/12/2000
16/02/2001
16/04/2001
16/06/2001
16/08/2001
16/10/2001
16/12/2001
16/02/2002
16/04/2002
16/06/2002
16/08/2002
16/10/2002
16/12/2002
16/02/2003
16/04/2003
16/06/2003
16/08/2003
16/10/2003
16/12/2003
16/02/2004
ABB Open
ABB High
ABB Low
ABB Predicted Open
ABB Predicted High
ABB Predicted Low
ACC Open
ACC High
ACC Low
ACC Predicted Open
ACC Predicted High
ACC Predicted Low
BAJAJ Open
BAJAJ High
BAJAJ Low
BAJAJ Predicted Open
BAJAJ Predicted High
BAJAJ Predicted Low
BHEL Open
BHEL High
BHEL Low
BHEL Predicted Open
BHEL Predicted High
BHEL Predicted Low
CIPLA Open
CIPLA High
CIPLA Low
CIPLA Predicted Open
CIPLA Predicted High
CIPLA Predicted Low
HDFC Open
HDFC High
HDFC Low
HDFC Predicted Open
HDFC Predicted High
HDFC Predicted Low
HERO HONDA Open
HERO HONDA High
HERO HONDA Low
HERO HONDA Predicted Open
HERO HONDA Predicted High
HERO HONDA Predicted Low
Figure XIV Actual and predicted stock prices of select Nifty companies after a fortnight
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
29
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
16/08/2000
16/10/2000
16/12/2000
16/02/2001
16/04/2001
16/06/2001
16/08/2001
16/10/2001
16/12/2001
16/02/2002
16/04/2002
16/06/2002
16/08/2002
16/10/2002
16/12/2002
16/02/2003
16/04/2003
16/06/2003
16/08/2003
16/10/2003
16/12/2003
16/02/2004
ICICI Bank Open
ICICI Bank High
ICICI Bank Low
ICICI Bank Predicted Open
ICICI Bank Predicted High
ICICI Bank Predicted Low
Infosys Open
Infosys High
Infosys Low
Infosys Predicted Open
Infosys Predicted High
Infosys Predicted Low
IPCL Open
IPCL High
IPCL Low
IPCL Predicted Open
IPCL Predicted High
IPCL Predicted Low
ITC Open
ITC High
ITC Low
ITC Predicted Open
ITC Predicted High
ITC Predicted Low
Reliance Open
Reliance High
Reliance Low
Reliance Predicted Open
Reliance Predicted High
Reliance Predicted Low
Reliance Open
Reliance High
Reliance Low
Reliance Predicted Open
Reliance Predicted High
Reliance Predicted Low
Figure XV Actual and predicted stock prices of select Nifty companies after a fortnight
Six Month prediction
200
300
400
500
600
700
800
08/08/2000
08/10/2000
08/12/2000
08/02/2001
08/04/2001
08/06/2001
08/08/2001
08/10/2001
08/12/2001
08/02/2002
08/04/2002
08/06/2002
08/08/2002
08/10/2002
08/12/2002
08/02/2003
08/04/2003
08/06/2003
08/08/2003
08/10/2003
08/12/2003
08/02/2004
ABB High
ABB Predicted
High
Figure XVI Actual and predicted stock price after next six months for ABB
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
30
0
200
400
600
800
1000
1200
1400
1600
1800
08/08/2000
08/10/2000
08/12/2000
08/02/2001
08/04/2001
08/06/2001
08/08/2001
08/10/2001
08/12/2001
08/02/2002
08/04/2002
08/06/2002
08/08/2002
08/10/2002
08/12/2002
08/02/2003
08/04/2003
08/06/2003
08/08/2003
08/10/2003
08/12/2003
08/02/2004
ABB Open
ABB High
ABB Low
ABB Predicted Open
ABB Predicted High
ABB Predicted Low
ACC Open
ACC High
ACC Low
ACC Predicted Open
ACC Predicted High
ACC Predicted Low
Bajaj Open
Bajaj High
Bajaj Low
Bajaj Predicted Open
Bajaj Predicted High
Bajaj Predicted Low
BHEL Open
BHEL High
BHEL Low
BHEL Predicted Open
BHEL Predicted High
BHEL Predicted Low
CIPLA Open
CIPLA High
CIPLA Low
CIPLA Predicted Open
CIPLA Predicted High
CIPLA Predicted Low
HDFC Open
HDFC High
HDFC Low
HDFC Predicted Open
HDFC Predicted High
HDFC Predicted Low
Hero Honda Open
Hero Honda High
Hero Honda Low
Hero Honda Predicted Open
Hero Honda Predicted High
Hero Honda Predicted Low
Figure XVII Actual and predicted stock price after six months for select Nifty companies
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
08/08/2000
08/10/2000
08/12/2000
08/02/2001
08/04/2001
08/06/2001
08/08/2001
08/10/2001
08/12/2001
08/02/2002
08/04/2002
08/06/2002
08/08/2002
08/10/2002
08/12/2002
08/02/2003
08/04/2003
08/06/2003
08/08/2003
08/10/2003
08/12/2003
08/02/2004
ICICI Bank Open
ICICI Bank High
ICICI Bank Low
ICICI Bank Predicted Open
ICICI Bank Predicted High
ICICI Bank Predicted Low
Infosys Open
Infosys High
Infosys Low
Infosys Predicted Open
Infosys Predicted High
Infosys Predicted Low
IPCL Open
IPCL High
IPCL Low
IPCL Predicted Open
IPCL Predicted High
IPCL Predicted Low
ITC Open
ITC High
ITC Low
ITC Predicted Open
ITC Predicted High
ITC Predicted Low
State Bank Open
State Bank High
State Bank Low
State Bank Predicted Open
State Bank Predicted High
State Bank Predicted Low
WIPRO Open
WIPRO High
WIPRO Low
WIPRO Predicted Open
WIPRO Predicted High
WIPRO Predicted Low
Figure XVIII Actual and predicted stock price after six months for select Nifty
companies
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
31
SSIIMMUULLAATTEEDD TTRRAADDIINNGG
As we can see, neural networks are extremely good at tracking the trend but for specific
values there is a margin of error. If we try to predict the stock price after a smaller duration,
the margin of error could be very close of even more than expected profits in a particular
stock. We see that six month prediction model is a good candidate for long term investors
because there is a large opportunity to make profits and hence margin of error does not do too
much damage.
Please see Appendix C for the detailed data related to the simulated trading. We will follow
some very basic rules to do the trade which are as follows.
• We assume, we can buy a stock at a price closer to the closing price of the day
before the six month duration
• We will buy a single share of all the companies which will show a 10% return over
a period of six month based on the predicted high price
• At the end of six month period, the stock is sold at the high price of that day.
As shown in Appendix C, following are the details of the trade.
17.64%157152.727,716.95/%Profit
157152.70-184869.65Profits
184,869.65monthssixofendat thepricesaleStock
-/157,152.70.pricepurchaseStock
==
=
=
= Rs
This simulated trade results in returns of 17.64% over a period of approximately 6 months.
We could come up with more complicated trading methodologies which could get us better
returns e.g. selling the stock earlier if the price exceeds our predicted stock price.
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
32
CCOONNCCLLUUSSIIOONN
This study concludes that there is merit to using neural networks in trying to understand and
predict behavior of markets but with certain caution. Following are important points to be kept
in mind if this model is used for investment decisions.
• Model does not return profitable results in very short duration trades, the investor
should have a investment horizon of more than 6 months for the model to work
properly
• Model does not guarantee that all the trades would be profitable but over all there
is a better chance of profits
• Stocks with less volatility perform better in model based prediction
Further work
This work could be further augmented with following additional items.
• Look at higher duration (1 year and beyond ) models
• Integrate different pieces of software produced to provide a product
• Automate learning of neural networks when new macro economic data is
available.
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
33
AAppppeennddiixx AA FFAACCTTOORR AANNAALLYYSSIISS
All the macro economic data and company financial information is captured by 96 variables
which are put through a factor analysis which reduces it to 20 variables.
Total Variance Explained
Total Variance Explained
Initial Eigenvalues Extraction Sums of Squared LoadingsComponent
Total % of Variance Cumulative % Total % of Variance Cumulative %
1 48.290 50.302 50.302 48.290 50.302 50.302
2 6.825 7.109 57.411 6.825 7.109 57.411
3 5.012 5.221 62.633 5.012 5.221 62.633
4 4.691 4.887 67.519 4.691 4.887 67.519
5 3.976 4.142 71.661 3.976 4.142 71.661
6 2.638 2.747 74.409 2.638 2.747 74.409
7 2.576 2.683 77.092 2.576 2.683 77.092
8 2.356 2.455 79.547 2.356 2.455 79.547
9 2.339 2.437 81.983 2.339 2.437 81.983
10 1.825 1.901 83.885 1.825 1.901 83.885
11 1.752 1.825 85.710 1.752 1.825 85.710
12 1.512 1.575 87.284 1.512 1.575 87.284
13 1.356 1.412 88.697 1.356 1.412 88.697
14 1.091 1.136 89.833 1.091 1.136 89.833
15 0.969 1.009 90.842 0.969 1.009 90.842
16 0.962 1.003 91.845 0.962 1.003 91.845
17 0.861 0.897 92.742 0.861 0.897 92.742
18 0.739 0.770 93.512 0.739 0.770 93.512
19 0.684 0.712 94.224 0.684 0.712 94.224
20 0.633 0.659 94.883 0.633 0.659 94.883
21 0.605 0.630 95.513
22 0.544 0.567 96.080
23 0.445 0.464 96.543
24 0.433 0.451 96.994
25 0.357 0.372 97.366
26 0.326 0.340 97.705
27 0.296 0.308 98.014
28 0.287 0.299 98.313
29 0.188 0.196 98.509
30 0.186 0.194 98.703
31 0.170 0.177 98.879
32 0.151 0.157 99.037
33 0.120 0.125 99.162
34 0.107 0.111 99.273
35 0.104 0.108 99.381
36 0.094 0.098 99.479
37 0.072 0.075 99.554
38 0.067 0.070 99.625
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
34
Total Variance Explained
Initial Eigenvalues Extraction Sums of Squared LoadingsComponent
Total % of Variance Cumulative % Total % of Variance Cumulative %
39 0.055 0.058 99.682
40 0.043 0.045 99.728
41 0.040 0.042 99.769
42 0.038 0.040 99.809
43 0.030 0.031 99.840
44 0.029 0.031 99.870
45 0.023 0.024 99.894
46 0.016 0.016 99.911
47 0.015 0.015 99.926
48 0.012 0.013 99.939
49 0.011 0.011 99.950
50 0.009 0.009 99.959
51 0.007 0.007 99.967
52 0.006 0.006 99.973
53 0.005 0.006 99.978
54 0.005 0.005 99.984
55 0.004 0.004 99.988
56 0.004 0.004 99.992
57 0.003 0.003 99.996
58 0.002 0.002 99.998
59 0.001 0.001 99.999
60 0.001 0.001 100.000
61 0.000 0.000 100.000
62 0.000 0.000 100.000
63 0.000 0.000 100.000
64 0.000 0.000 100.000
65 0.000 0.000 100.000
66 0.000 0.000 100.000
67 0.000 0.000 100.000
68 0.000 0.000 100.000
69 0.000 0.000 100.000
70 0.000 0.000 100.000
71 0.000 0.000 100.000
72 0.000 0.000 100.000
73 0.000 0.000 100.000
74 0.000 0.000 100.000
75 0.000 0.000 100.000
76 0.000 0.000 100.000
77 0.000 0.000 100.000
78 0.000 0.000 100.000
79 0.000 0.000 100.000
80 0.000 0.000 100.000
81 0.000 0.000 100.000
82 0.000 0.000 100.000
83 0.000 0.000 100.000
84 0.000 0.000 100.000
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
35
Total Variance Explained
Initial Eigenvalues Extraction Sums of Squared LoadingsComponent
Total % of Variance Cumulative % Total % of Variance Cumulative %
85 0.000 0.000 100.000
86 0.000 0.000 100.000
87 0.000 0.000 100.000
88 0.000 0.000 100.000
89 0.000 0.000 100.000
90 0.000 0.000 100.000
91 0.000 0.000 100.000
92 0.000 0.000 100.000
93 0.000 0.000 100.000
94 0.000 0.000 100.000
95 0.000 0.000 100.000
96 0.000 0.000 100.000
Extraction Method: Principal Component Analysis.
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
36
Component Matrix
Component Matrix(a)
Component
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
assetsWithBankingSystem 0.001 -0.517 0.036 -0.018 0.006 -0.528 0.076 -0.353 0.092 0.006 -0.032 -0.269 -0.015 0.401 -0.039 -0.081 0.007 -0.016 -0.050 -0.104
bankCredit 0.981 -0.124 -0.007 -0.015 -0.003 -0.019 0.007 0.072 -0.016 -0.012 -0.013 -0.044 0.008 0.058 0.019 0.034 0.011 -0.016 0.012 -0.002
cash 0.813 -0.056 -0.302 -0.026 -0.024 0.091 -0.014 -0.197 0.033 -0.032 0.078 0.197 0.023 -0.006 -0.097 -0.148 -0.030 0.049 0.002 0.038
investmentAtBookValue 0.991 -0.048 -0.052 -0.010 -0.008 0.005 0.004 0.050 -0.011 -0.010 0.002 -0.014 -0.011 -0.022 -0.022 -0.033 -0.006 0.008 0.001 0.021
liabilitiesToBankingSystem -0.455 0.012 -0.131 -0.032 -0.006 -0.526 0.080 -0.423 0.117 0.042 -0.087 -0.292 -0.043 0.329 -0.077 -0.161 -0.011 0.040 0.020 -0.140
liabilitiesToOthers -0.199 0.237 -0.259 -0.049 -0.012 0.106 -0.004 0.527 -0.112 -0.041 0.126 0.033 0.028 0.299 -0.091 -0.129 -0.013 -0.036 -0.465 -0.281
curcredit 0.942 0.136 0.112 0.001 0.001 -0.129 0.027 0.087 -0.005 0.058 -0.169 -0.069 -0.007 0.023 0.021 0.031 0.008 -0.008 0.023 -0.013
curdebit 0.961 0.130 -0.096 -0.033 -0.010 -0.101 0.025 0.056 -0.003 0.008 -0.054 -0.112 -0.002 0.070 0.017 0.036 0.009 -0.029 0.001 0.065
capcredit 0.737 0.607 -0.025 0.001 -0.009 0.208 -0.028 -0.126 0.023 -0.015 0.046 0.045 0.017 -0.010 -0.011 -0.008 -0.004 0.009 0.034 -0.013
capdebit 0.552 0.691 -0.029 -0.002 -0.012 0.235 -0.025 -0.074 0.023 0.053 -0.149 -0.116 -0.015 0.061 -0.019 -0.034 -0.007 0.000 0.034 0.095
errcredit 0.183 0.454 0.183 0.039 0.003 -0.287 0.047 -0.079 0.052 0.249 -0.584 0.410 0.070 -0.048 -0.018 -0.014 -0.012 -0.003 -0.064 0.082
errdebit -0.333 0.065 -0.097 -0.013 -0.005 0.302 -0.045 0.036 -0.033 -0.217 0.539 -0.566 -0.151 -0.150 -0.030 -0.074 -0.015 0.042 0.132 0.057
balcredit 0.905 0.394 0.053 0.002 -0.004 0.030 0.002 -0.018 0.010 0.029 -0.081 -0.008 0.006 0.007 0.006 0.013 0.002 0.000 0.029 -0.012
baldebit 0.824 0.476 -0.070 -0.019 -0.013 0.092 -0.002 -0.013 0.011 0.029 -0.102 -0.143 -0.014 0.068 -0.003 -0.003 0.001 -0.014 0.024 0.092
monmovcredit -0.331 0.360 -0.396 -0.074 -0.018 0.125 -0.002 0.577 -0.123 -0.051 0.134 0.000 0.023 0.093 0.008 0.042 0.009 -0.062 -0.141 0.074
monmovdebit 0.824 0.144 0.270 0.039 0.014 -0.098 0.010 -0.005 0.000 0.019 -0.016 0.260 0.044 -0.111 0.023 0.043 0.005 0.027 0.027 -0.211
callMoneyHigh -0.790 0.348 -0.107 -0.018 0.000 0.044 -0.004 0.229 -0.047 -0.010 0.082 0.096 0.037 0.198 -0.042 -0.066 -0.006 0.002 0.029 0.034
callMoneyLow -0.855 0.325 -0.054 -0.015 0.003 -0.003 0.003 0.192 -0.037 -0.005 0.056 0.027 0.026 0.122 0.007 0.015 0.006 -0.016 -0.026 -0.049
companyId -0.004 -0.001 -0.005 -0.011 0.121 0.060 0.294 0.031 0.227 0.012 0.021 0.098 -0.447 0.069 -0.183 0.156 0.695 0.191 -0.046 0.052
eps 0.168 -0.081 -0.130 0.544 0.203 0.029 -0.061 0.013 0.038 0.649 0.203 -0.051 0.058 -0.017 -0.093 0.013 -0.061 -0.226 0.027 -0.002
ceps 0.057 -0.030 -0.122 0.903 -0.252 0.019 0.120 0.013 0.026 0.165 0.056 -0.007 -0.034 0.008 0.017 -0.005 -0.047 -0.110 0.009 0.000
bookValue -0.047 0.040 -0.067 0.770 -0.458 -0.008 0.180 0.015 0.038 -0.339 -0.096 0.028 -0.074 0.027 0.011 0.044 -0.042 0.036 -0.001 -0.005
div 0.138 0.011 -0.123 0.527 -0.019 0.020 0.046 -0.017 -0.054 0.444 0.156 -0.009 0.049 -0.044 -0.116 -0.024 0.236 0.106 0.000 0.013
opProfitPerShare 0.059 -0.042 -0.130 0.878 -0.005 0.032 0.139 0.040 0.165 0.176 0.058 -0.016 0.003 -0.013 0.043 -0.080 0.022 -0.240 0.025 -0.006
netOperatingIncomePerShare -0.061 0.041 -0.046 0.679 -0.542 -0.013 0.133 0.030 0.109 -0.373 -0.104 0.034 -0.065 0.022 0.114 -0.025 -0.004 0.080 -0.011 0.002
freeReserves -0.049 0.042 -0.066 0.762 -0.453 -0.012 0.197 -0.008 -0.083 -0.328 -0.095 0.017 -0.027 0.026 0.045 0.033 -0.052 0.095 -0.009 -0.004
opm 0.082 0.015 -0.101 0.228 0.818 0.041 0.265 -0.025 -0.067 -0.035 -0.006 0.071 -0.271 0.030 0.166 -0.068 -0.029 -0.050 0.004 -0.013
gpm 0.090 0.014 -0.113 0.276 0.859 0.030 0.190 -0.009 -0.005 -0.031 -0.005 0.054 -0.198 0.022 0.176 -0.083 -0.020 -0.041 0.002 -0.006
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
37
Component Matrix(a)
Component
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
npm 0.136 0.043 -0.087 0.054 0.448 0.013 0.082 -0.053 -0.151 -0.030 0.005 0.156 -0.614 0.101 0.101 0.129 -0.369 0.199 -0.024 0.011
ronw 0.188 0.024 -0.133 0.241 0.282 -0.089 -0.505 -0.004 -0.060 0.256 0.108 0.006 -0.030 0.053 0.445 -0.142 0.078 0.072 -0.021 0.020
debtToEquity -0.008 -0.029 0.001 0.006 0.115 0.027 -0.114 0.175 0.863 -0.046 0.005 0.044 -0.196 0.019 -0.138 0.098 -0.133 -0.126 0.023 -0.014
currentRatio -0.091 0.029 -0.050 0.292 0.712 -0.003 0.152 -0.011 -0.096 -0.280 -0.105 -0.089 0.402 -0.052 -0.021 -0.049 0.090 0.106 -0.019 0.015
quickRation -0.057 0.010 -0.039 0.189 0.552 -0.012 -0.143 0.142 0.644 -0.228 -0.061 -0.038 0.171 -0.014 -0.105 0.064 -0.008 0.073 -0.002 -0.011
interestCover 0.106 -0.033 -0.097 0.389 0.089 -0.014 -0.043 -0.005 -0.118 0.422 0.149 -0.092 0.233 0.052 -0.162 0.300 -0.131 0.491 -0.048 -0.028
salesByTotalAssets 0.008 -0.092 0.055 -0.203 -0.099 0.091 0.532 0.060 0.210 0.117 0.049 -0.071 0.196 0.077 0.249 0.090 -0.186 0.299 -0.098 0.181
salesByFixedAssets 0.097 -0.023 -0.037 0.082 0.092 -0.040 -0.443 0.172 0.772 -0.029 0.005 -0.019 0.110 -0.009 -0.031 0.028 -0.093 0.100 -0.008 0.004
salesByCurrentAssets 0.087 0.024 -0.007 -0.093 -0.380 -0.034 -0.300 0.063 0.319 0.094 0.064 0.030 0.008 -0.008 0.540 -0.322 0.201 0.172 -0.036 0.002
noOfDaysOfWorkingCapital -0.035 0.025 -0.055 0.245 0.649 0.001 0.206 -0.018 -0.124 -0.313 -0.115 -0.085 0.429 -0.067 0.027 -0.129 0.128 -0.007 0.001 0.005
shareCapital -0.012 -0.018 0.064 -0.301 -0.133 0.149 0.802 0.040 0.284 0.196 0.092 0.007 0.071 -0.031 0.071 -0.094 -0.051 -0.075 0.034 -0.068
outstandingShares -0.004 -0.022 0.064 -0.329 -0.100 0.148 0.786 0.040 0.282 0.200 0.093 0.004 0.086 -0.031 0.100 -0.106 -0.026 -0.024 0.025 -0.063
cpi 0.954 -0.202 -0.062 -0.010 -0.008 0.100 -0.012 0.050 -0.019 -0.027 0.026 0.037 0.007 -0.055 0.006 0.022 0.002 -0.008 -0.002 0.027
br -0.705 0.615 -0.225 -0.039 -0.012 -0.096 0.023 -0.068 0.030 0.037 -0.070 -0.054 0.003 -0.004 0.028 0.054 0.006 -0.014 0.055 0.033
idbiRate -0.559 -0.082 -0.156 -0.036 0.003 -0.036 -0.007 -0.311 0.046 -0.139 0.395 0.272 0.141 0.110 0.109 0.257 0.039 -0.147 -0.055 0.252
maxCMR -0.741 0.186 0.010 0.005 0.006 0.081 -0.014 0.197 -0.044 -0.006 0.074 0.090 0.028 0.232 -0.060 -0.109 -0.010 0.025 0.115 0.047
maxPLR -0.925 0.070 -0.074 -0.017 0.005 0.013 -0.007 -0.023 0.000 -0.003 0.019 0.162 0.066 -0.020 0.096 0.167 0.029 -0.023 0.075 -0.109
minPLR -0.873 0.257 -0.032 -0.007 0.004 0.106 -0.016 0.049 -0.011 0.039 -0.099 0.093 0.039 -0.057 0.098 0.153 0.028 0.005 0.142 -0.168
price 0.401 0.555 -0.268 -0.087 -0.014 -0.288 0.065 0.120 0.002 0.050 -0.172 -0.202 0.041 0.204 0.123 0.235 0.048 -0.122 0.066 0.218
totalINRdebt 0.819 -0.336 -0.101 -0.033 -0.001 -0.057 0.003 -0.183 0.023 -0.097 0.215 0.130 0.074 0.026 0.075 0.154 0.027 -0.047 0.037 0.004
concessionalDebtAsPercOfTotal 0.046 0.058 -0.498 -0.070 -0.039 0.616 -0.070 0.154 -0.036 0.104 -0.448 -0.191 -0.006 0.059 0.071 0.108 0.026 -0.033 0.033 0.017
shortTermDebtAsPercOfTotal 0.577 0.305 -0.452 -0.076 -0.023 -0.259 0.043 -0.061 0.015 -0.083 0.276 0.289 0.087 0.092 -0.049 -0.021 -0.011 -0.052 -0.124 0.196
affConstant 0.177 0.311 0.596 0.104 0.029 0.503 -0.093 -0.393 0.061 -0.009 0.039 0.088 0.054 0.231 -0.025 -0.042 -0.002 -0.012 -0.074 0.006
affCurrent 0.318 0.251 0.515 0.091 0.024 0.535 -0.097 -0.408 0.060 -0.033 0.089 0.083 0.060 0.243 -0.021 -0.030 0.000 -0.021 -0.079 0.012
cspsConstant 0.480 0.169 0.595 0.071 0.039 -0.452 0.061 0.295 -0.050 -0.034 0.210 0.018 -0.033 -0.134 -0.021 -0.027 -0.013 -0.002 -0.033 0.096
cspsCurrent 0.675 0.126 0.502 0.059 0.031 -0.371 0.052 0.274 -0.047 -0.021 0.146 0.003 -0.032 -0.122 -0.020 -0.026 -0.012 -0.003 -0.031 0.097
consConstant 0.955 0.026 0.217 0.020 0.011 -0.061 0.009 0.099 -0.020 -0.002 0.012 0.070 0.028 0.071 0.007 0.017 0.006 -0.016 -0.032 -0.013
consCurrent 0.983 0.023 0.138 0.011 0.004 -0.041 0.008 0.078 -0.015 0.006 -0.023 0.014 0.008 0.036 -0.001 0.001 0.003 -0.005 -0.011 -0.006
egwsConstant 0.929 0.077 0.212 0.026 0.006 0.097 -0.010 0.130 -0.026 0.031 -0.118 -0.121 -0.035 -0.046 0.017 0.010 0.005 0.018 0.055 -0.071
egwsCurrent 0.838 0.245 0.074 -0.018 0.010 -0.007 -0.002 -0.002 -0.013 -0.099 0.240 0.041 0.055 0.012 0.112 0.187 0.040 -0.002 0.145 -0.275
firebsConstant 0.972 0.003 0.174 0.011 0.009 -0.088 0.014 0.089 -0.019 -0.020 0.047 -0.014 0.005 0.012 0.019 0.033 0.008 -0.005 0.024 -0.029
firebsCurrent 0.981 -0.088 0.105 0.005 0.002 -0.031 0.008 0.091 -0.017 0.005 -0.044 -0.063 -0.010 0.010 0.011 0.015 0.005 -0.005 0.013 -0.002
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
38
Component Matrix(a)
Component
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
manuConstant 0.929 0.113 0.281 0.028 0.013 -0.121 0.020 0.147 -0.025 0.001 0.013 -0.049 -0.014 -0.015 0.003 0.008 0.001 -0.011 -0.013 0.034
manuCurrent 0.961 0.115 0.173 0.016 0.005 -0.085 0.017 0.122 -0.019 0.011 -0.030 -0.071 -0.024 -0.025 -0.006 -0.012 -0.002 0.002 0.008 0.018
maqConstant 0.825 0.171 0.486 0.050 0.029 -0.024 0.000 0.137 -0.032 -0.029 0.091 -0.049 0.011 0.051 0.048 0.078 0.018 -0.023 0.013 -0.040
maqCurrent 0.878 0.039 0.290 0.010 0.018 -0.016 0.007 0.211 -0.042 0.009 -0.074 -0.163 0.007 0.100 0.096 0.151 0.036 -0.040 0.047 -0.076
tdpConstant 0.742 0.236 0.577 0.083 0.029 0.145 -0.032 -0.087 0.010 -0.016 0.077 0.028 0.019 0.097 -0.013 -0.019 -0.002 -0.011 -0.045 0.024
tdpCurrent 0.863 0.164 0.430 0.060 0.020 0.141 -0.027 -0.067 0.006 -0.017 0.055 -0.001 0.012 0.082 -0.009 -0.012 0.000 -0.011 -0.033 0.022
thrConstant 0.930 0.111 0.333 0.043 0.015 0.063 -0.011 0.024 -0.008 -0.011 0.030 -0.034 -0.003 0.031 -0.001 -0.002 0.001 -0.007 -0.012 0.011
thrCurrent 0.946 0.121 0.279 0.037 0.010 0.078 -0.012 0.002 -0.003 -0.005 0.008 -0.047 -0.010 0.021 -0.009 -0.016 -0.002 -0.001 -0.006 0.012
aff 0.846 -0.485 -0.121 -0.016 -0.013 0.094 -0.010 0.021 -0.009 0.006 -0.089 -0.033 -0.005 0.033 -0.012 -0.016 0.000 -0.016 -0.045 0.068
csps 0.946 -0.213 -0.221 -0.029 -0.018 0.052 -0.003 -0.011 -0.001 -0.010 -0.018 0.041 0.004 0.000 -0.027 -0.040 -0.006 0.011 -0.001 0.008
cons 0.950 -0.167 -0.233 -0.029 -0.019 0.049 -0.003 -0.019 0.001 -0.011 -0.008 0.056 0.002 -0.014 -0.037 -0.056 -0.009 0.019 0.004 0.001
egws 0.938 0.071 -0.295 -0.046 -0.020 -0.009 0.007 -0.030 0.004 -0.031 0.059 0.092 0.025 0.001 -0.010 -0.010 0.000 0.019 0.048 -0.063
firb 0.922 -0.316 -0.186 -0.023 -0.017 0.071 -0.006 -0.001 -0.004 -0.003 -0.046 0.016 -0.001 0.007 -0.026 -0.039 -0.006 0.003 -0.018 0.032
manuf 0.954 -0.125 -0.246 -0.032 -0.020 0.039 -0.001 -0.021 0.001 -0.015 0.004 0.063 0.006 -0.011 -0.032 -0.048 -0.008 0.019 0.012 -0.010
min 0.876 -0.288 -0.194 -0.062 -0.008 -0.010 0.008 0.048 -0.016 -0.035 -0.005 -0.054 0.061 0.167 0.111 0.199 0.046 -0.072 0.023 -0.033
tdp 0.937 -0.266 -0.205 -0.029 -0.017 0.056 -0.004 -0.002 -0.004 -0.009 -0.029 0.023 0.006 0.016 -0.016 -0.021 -0.002 0.001 -0.007 0.015
thr 0.749 -0.569 -0.080 -0.036 -0.004 0.055 -0.003 0.068 -0.020 -0.008 -0.089 -0.111 0.033 0.155 0.087 0.156 0.037 -0.078 -0.034 0.047
currencyWithPublic 0.983 -0.114 -0.038 -0.008 -0.007 0.018 0.001 0.034 -0.008 0.001 -0.035 0.001 -0.001 0.024 -0.018 -0.030 -0.003 0.006 -0.004 0.005
m3 0.984 -0.157 -0.031 -0.011 -0.006 0.013 0.002 0.046 -0.012 -0.009 -0.017 -0.029 -0.004 0.008 -0.001 -0.001 0.002 0.000 0.009 0.000
timeDepositsWithBank 0.977 -0.189 -0.029 -0.012 -0.005 0.012 0.002 0.051 -0.014 -0.017 -0.001 -0.025 0.001 0.003 0.011 0.022 0.006 -0.009 0.007 0.002
totalIncome -0.728 -0.460 0.342 0.070 0.016 0.110 -0.022 0.040 -0.008 0.061 -0.164 -0.130 -0.062 -0.038 -0.045 -0.087 -0.019 -0.011 -0.117 0.164
totalExpenditure 0.904 -0.211 -0.201 -0.003 -0.022 0.098 -0.012 -0.041 0.006 0.011 -0.041 0.082 -0.035 -0.100 -0.111 -0.186 -0.037 0.057 -0.026 0.047
netAvailableBalance -0.875 -0.255 0.326 0.052 0.020 0.043 -0.012 0.045 -0.008 0.041 -0.104 -0.126 -0.032 0.010 0.009 0.008 0.000 -0.030 -0.075 0.102
surplusToCentralGovernment -0.875 -0.255 0.326 0.052 0.020 0.043 -0.012 0.045 -0.008 0.041 -0.104 -0.126 -0.032 0.010 0.009 0.008 0.000 -0.030 -0.075 0.102
totalIssuesLiabilities 0.945 -0.224 -0.218 -0.030 -0.018 0.052 -0.003 -0.009 -0.002 -0.010 -0.020 0.037 0.005 0.005 -0.024 -0.034 -0.005 0.008 -0.002 0.008
totalIssuesAssets 0.945 -0.224 -0.218 -0.030 -0.018 0.052 -0.003 -0.009 -0.002 -0.010 -0.020 0.037 0.005 0.005 -0.024 -0.034 -0.005 0.008 -0.002 0.008
totalBankingLiabilities 0.955 -0.053 -0.267 -0.040 -0.019 0.017 0.003 -0.022 0.001 -0.023 0.027 0.070 0.017 0.003 -0.016 -0.020 -0.002 0.015 0.028 -0.034
totalBankingAssets 0.955 -0.053 -0.267 -0.040 -0.019 0.017 0.003 -0.022 0.001 -0.023 0.027 0.070 0.017 0.003 -0.016 -0.020 -0.002 0.015 0.028 -0.034
reserveMoneyLiabilities 0.977 -0.086 -0.062 -0.011 -0.009 0.010 0.003 0.027 -0.005 0.005 -0.044 -0.005 -0.005 0.034 -0.028 -0.050 -0.005 0.018 0.030 0.004
reserveMoneyAssets 0.977 -0.086 -0.062 -0.011 -0.009 0.010 0.003 0.027 -0.005 0.005 -0.044 -0.005 -0.005 0.034 -0.028 -0.050 -0.005 0.018 0.030 0.004
forwardCashSpot -0.329 -0.215 0.145 0.022 0.015 0.021 -0.008 0.388 -0.088 -0.002 0.052 0.220 0.055 0.416 -0.123 -0.227 -0.018 0.093 0.489 0.110
forwardCashOneMonth -0.743 -0.432 0.150 0.030 0.016 0.051 -0.016 0.271 -0.064 0.026 -0.048 0.204 0.033 0.066 -0.015 -0.041 -0.002 0.023 0.044 -0.005
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
39
Component Matrix(a)
Component
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
forwardCashThreeMonth -0.786 -0.461 0.195 0.036 0.018 0.092 -0.024 0.174 -0.046 0.024 -0.056 0.146 0.026 0.035 0.010 0.000 0.004 0.012 0.036 0.003
forwardCashSixMonth -0.806 -0.470 0.217 0.038 0.019 0.112 -0.027 0.113 -0.033 0.022 -0.064 0.082 0.017 0.029 0.023 0.020 0.008 0.005 0.024 -0.012
referenceRate -0.319 -0.811 0.270 0.022 0.026 0.089 -0.026 0.028 -0.024 -0.021 -0.015 0.076 0.076 0.107 0.142 0.241 0.051 -0.079 -0.013 -0.057
rate -0.799 0.542 -0.130 -0.026 -0.004 -0.114 0.021 -0.096 0.033 0.026 -0.034 -0.060 0.005 0.039 0.028 0.043 0.008 -0.001 0.054 -0.057
Extraction Method: Principal Component Analysis.
a. 20 components extracted.
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
40
AAppppeennddiixx BB NNEEUURRAALL NNEETT GGEENNEERRAATTOORR
Source for NeuralNetScreener
/*
* NeuralNetScreener.java
*
* Created on October 12, 2005, 8:46 PM
*
*/
package com.avasthi.stockneuralnetgenerator;
import java.text.SimpleDateFormat;
import java.util.*;
import java.io.*;
import javax.print.attribute.standard.Finishings;
import org.joone.engine.*;
import org.joone.engine.learning.*;
import org.joone.net.*;
import org.joone.util.DynamicAnnealing;
import org.joone.io.*;
import org.joone.util.*;
import org.joone.engine.weights.*;
/**
*
* @author binny
*/
public class NeuralNetScreener implements org.joone.engine.NeuralNetListener,
org.joone.net.NeuralValidationListener{
String baseFolder_;
int trainingDataPoints_;
int validationDataPoints_;
String trainingFile_;
String validationFile_;
int trainingStart_;
int validationStart_;
int testingStart_;
String inputColumnSelector_;
String outputColumnSelector_;
org.joone.net.NeuralNet net_;
int inputSize_;
int hidden1Size_;
int hidden2Size_;
int outputSize_;
String filename_;
PrintStream pStrm_;
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
41
ObjectOutputStream nnStrm_;
int totCicles_;
/** Creates a new instance of NeuralNetScreener */
public NeuralNetScreener(String baseFolder,
String trainingFile,
String validationFile,
int trainingDataPoints,
int validationDataPoints,
int inputSize,
int hidden1Size,
int hidden2Size,
int outputSize,
int totCicles) {
totCicles_ = totCicles;
baseFolder_ = baseFolder;
trainingFile_ = trainingFile;
validationFile_ = validationFile;
trainingDataPoints_ = trainingDataPoints;
validationDataPoints_ = validationDataPoints;
inputColumnSelector_ = new String("1-23");
outputColumnSelector_ = new String("24-30");
net_ = new org.joone.net.NeuralNet();
inputSize_ = inputSize;
hidden1Size_ = hidden1Size;
hidden2Size_ = hidden2Size;
outputSize_ = outputSize;
String filename = baseFolder + "/stockPrediction." + inputSize_ + "." + hidden1Size_ + "."
+ hidden2Size_ + "." +outputSize_;
System.out.println("File name :" + filename);
try {
filename_ = filename;
FileOutputStream fos = new FileOutputStream(filename + ".txt");
pStrm_ = new PrintStream(fos);
FileOutputStream stream = new FileOutputStream(filename + ".ser");
nnStrm_ = new ObjectOutputStream(stream);
}
catch (Exception ex) {
System.out.println("File count not be opened " + filename);
pStrm_ = System.out;
}
}
/**
* used to build a network
*/
public void buildNetwork(boolean singleOutput, String outputColumn) {
// build the input, hidden and output layer
LinearLayer input = new LinearLayer();
SigmoidLayer hidden1 = new SigmoidLayer();
SigmoidLayer hidden2 = new SigmoidLayer();
SigmoidLayer output = new SigmoidLayer();
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
42
input.setLayerName("input");
hidden1.setLayerName("hidden1");
hidden2.setLayerName("hidden2");
output.setLayerName("output");
input.setRows(inputSize_);
hidden1.setRows(hidden1Size_);
hidden2.setRows(hidden2Size_);
if (singleOutput) {
output.setRows(1);
}
else {
output.setRows(outputSize_);
}
// add the layers to the net.
net_.addLayer(input, NeuralNet.INPUT_LAYER);
net_.addLayer(hidden1, NeuralNet.HIDDEN_LAYER);
net_.addLayer(hidden2, NeuralNet.HIDDEN_LAYER);
net_.addLayer(output, NeuralNet.OUTPUT_LAYER);
// creating the synapses to link the layers
FullSynapse inputHiddenSynapse = new FullSynapse(); // In -> Hid
FullSynapse hiddenHiddenSynapse = new FullSynapse(); // Hid -> Hid
FullSynapse hiddenOutputSynapse = new FullSynapse(); // Hid -> Out
inputHiddenSynapse.setName("InputHidden");
hiddenHiddenSynapse.setName("HiddenHidden");
hiddenOutputSynapse.setName("HiddenOutput");
// wire them
input.addOutputSynapse(inputHiddenSynapse);
hidden1.addInputSynapse(inputHiddenSynapse);
hidden1.addOutputSynapse(hiddenHiddenSynapse);
hidden2.addInputSynapse(hiddenHiddenSynapse);
hidden2.addOutputSynapse(hiddenOutputSynapse);
output.addInputSynapse(hiddenOutputSynapse);
// add the monitor.
Monitor monitor = new Monitor();
monitor.getLearners().add(0, new String("org.joone.engine.BasicLearner"));
monitor.setLearningMode(0);
monitor.setUseRMSE(true);
// adding the monitor to the layers.
input.setMonitor(monitor);
hidden1.setMonitor(monitor);
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
43
hidden2.setMonitor(monitor);
output.setMonitor(monitor);
net_.setMonitor(monitor);
FileInputSynapse trainingInputData = new FileInputSynapse();
trainingInputData.setFileName(trainingFile_);
/* The output values are on the third column of the file */
trainingInputData.setAdvancedColumnSelector(inputColumnSelector_);
trainingInputData.setFirstRow(1);
FileInputSynapse validationInputData = new FileInputSynapse();
validationInputData.setFileName(validationFile_);
/* The output values are on the third column of the file */
validationInputData.setAdvancedColumnSelector(inputColumnSelector_);
validationInputData.setFirstRow(1);
LearningSwitch ils = new LearningSwitch();
ils.addTrainingSet(trainingInputData);
ils.addValidationSet(validationInputData);
input.addInputSynapse(ils);
monitor.setLearningRate(0.8);
monitor.setMomentum(0.3);
monitor.addNeuralNetListener(this);
/* Setting of the file containing the desired responses, provided by a FileInputSynapse */
FileInputSynapse trainingOutputData = new FileInputSynapse();
trainingOutputData.setFileName(trainingFile_);
/* The output values are on the third column of the file */
if (singleOutput) {
trainingOutputData.setAdvancedColumnSelector(outputColumn);
}
else {
trainingOutputData.setAdvancedColumnSelector(outputColumnSelector_);
}
trainingOutputData.setFirstRow(1);
FileInputSynapse validationOutputData = new FileInputSynapse();
validationOutputData.setFileName(validationFile_);
/* The output values are on the third column of the file */
if (singleOutput) {
validationOutputData.setAdvancedColumnSelector(outputColumn);
}
else {
validationOutputData.setAdvancedColumnSelector(outputColumnSelector_);
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
44
}
validationOutputData.setFirstRow(1);
LearningSwitch ols = new LearningSwitch();
ols.addTrainingSet(trainingOutputData);
ols.addValidationSet(validationOutputData);
TeachingSynapse trainer = new TeachingSynapse();
/* We give it the monitor's reference */
trainer.setDesired(ols);
trainer.setMonitor(monitor);
output.addOutputSynapse(trainer);
monitor.setTrainingPatterns(trainingDataPoints_); /* # of rows contained in the input file
*/
monitor.setTotCicles(totCicles_); /* How many times the net must be trained on the input
patterns */
monitor.setLearning(true); /* The net must be trained */
input.start();
hidden1.start();
hidden2.start();
output.start();
monitor.Go(); /* The net starts the training job */
net_.join();
}
public void saveNetwork(int kount) {
try {
FileOutputStream stream = new FileOutputStream(filename_ + "-"+ kount + ".ser");
ObjectOutputStream nnStrm = new ObjectOutputStream(stream);
nnStrm.writeObject(net_);
}
catch (Exception ex) {
System.out.println("Count not save neural network ");
}
}
public static NeuralNet restoreNeuralNet(String fileName) {
NeuralNet nnet = null;
try {
FileInputStream stream = new FileInputStream(fileName);
ObjectInputStream inp = new ObjectInputStream(stream);
nnet = (NeuralNet)inp.readObject();
}
catch (Exception excp) {
excp.printStackTrace();
}
return nnet;
}
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
45
public static void loadAndTestData(String nnFile, String inputFile, int inputDataSize,
String outputFile) {
try {
NeuralNet net = restoreNeuralNet(nnFile);
Layer input = net.getInputLayer();
input.removeAllInputs();
org.joone.io.FileInputSynapse inp = new org.joone.io.FileInputSynapse();
inp.setFileName(inputFile);
inp.setAdvancedColumnSelector("1-23");
inp.setFirstRow(1);
input.addInputSynapse(inp);
Layer output = net.getOutputLayer();
output.removeAllOutputs();
org.joone.io.FileOutputSynapse out = new org.joone.io.FileOutputSynapse();
out.setFileName(outputFile);
output.addOutputSynapse(out);
net.getMonitor().setTotCicles(1);
net.getMonitor().setTrainingPatterns(inputDataSize);
net.getMonitor().setLearning(false);
net.start();
net.getMonitor().Go();
}
catch (Exception ex) {
System.out.println("Count not load neural network ");
}
}
public void netStarted(NeuralNetEvent ev) {
System.out.println("Net Started " +ev.toString());
}
public void netStopped(NeuralNetEvent ev) {
System.out.println("Net Stopped "+ev.toString());
}
public void netStoppedError(NeuralNetEvent ev, String str) {
System.out.println("Net Stopped Error "+ev.toString() + str);
}
public void errorChanged(NeuralNetEvent ev) {
}
/* Validation Event */
public void netValidated(NeuralValidationEvent event) {
// Shows the RMSE at the end of the cycle
NeuralNet NN = (NeuralNet)event.getSource();
pStrm_.println(",Validation Error,"+NN.getMonitor().getGlobalError());
}
public void cicleTerminated(NeuralNetEvent ev) {
Monitor mon = (Monitor)ev.getSource();
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
46
// Prints out the current epoch and the training error
int cycle = mon.getCurrentCicle()+1;
if (cycle % 100 == 0) { // We validate the net every 100 cycles
String msg = new String("Epoch #"+(mon.getTotCicles() - cycle));
msg += ",Training Error,"+mon.getGlobalError();
// Creates a copy of the neural network
net_.getMonitor().setExporting(true);
NeuralNet newNet = net_.cloneNet();
net_.getMonitor().setExporting(false);
// Cleans the old listeners
// This is a fundamental action to avoid that the validating net
// calls the cicleTerminated method of this class
newNet.removeAllListeners();
// Set all the parameters for the validation
NeuralNetValidator nnv = new NeuralNetValidator(newNet);
nnv.addValidationListener(this);
newNet.getMonitor().setValidation(true);
newNet.getMonitor().setValidationPatterns(validationDataPoints_);
nnv.start(); // Validates the
Monitor m = (Monitor) (ev.getSource());
pStrm_.print("Cicle Terminated " + msg);
if (cycle % 1000 == 0) {
saveNetwork(cycle);
}
}
}
}
Source for StockMarketNeuralNetCreator
/*
* StockMarketPredictorGenerator.java
*
* Created on October 12, 2005, 8:44 PM
*/
package com.avasthi.stockneuralnetgenerator;
/**
*
* @author binny
*/
public class StockMarketNeuralNetCreator {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int inputs = 23;
int outputs = 7;
int trainingDataPoints = Integer.parseInt(args[3]);
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
47
int validationDataPoints = Integer.parseInt(args[4]);
int layer1 = Integer.parseInt(args[5]);
int layer2 = Integer.parseInt(args[6]);
int totCicles = 1500;
if (args.length >= 9) {
totCicles = Integer.parseInt(args[8]);
}
try {
System.out.println("Trying neural network with hidden layers "+layer1
+","+layer2);
NeuralNetScreener nns = new NeuralNetScreener(args[0],
args[1],
args[2],
trainingDataPoints,
validationDataPoints,
inputs,
layer1,
layer2,
outputs,
totCicles);
System.out.println("Base Directory" +
args[0] +
" Data File " +
args[1] +
" Number of Items " +
args[2]);
nns.buildNetwork(true, args[7]);
} catch(Exception ex) {
System.out.println(ex.toString());
}
}
}
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
48
AAppppeennddiixx CC SSIIMMUULLAATTEEDD TTRRAADDEE SSHHEEEETT
Company Six Month
Previous
Close
Actual
High
Predicted
High
Number
of
stocks
Money
Spent
Money
Earned
ABB 224.15 233.40 249.07 1 224.15 233.40
ABB 223.30 229.80 247.68 1 223.30 229.80
ABB 214.50 239.00 236.20 1 214.50 239.00
ABB 203.75 275.00 241.43 1 203.75 275.00
ABB 217.35 274.00 257.51 1 217.35 274.00
ABB 218.90 279.00 258.14 1 218.90 279.00
ABB 214.70 268.70 253.57 1 214.70 268.70
ABB 215.95 277.50 255.08 1 215.95 277.50
ACC 88.10 146.80 122.96 1 88.10 146.80
ACC 91.20 147.70 126.54 1 91.20 147.70
ACC 92.75 151.35 127.45 1 92.75 151.35
ACC 92.55 158.00 127.26 1 92.55 158.00
ACC 93.10 157.25 128.70 1 93.10 157.25
Bajaj Auto 345.05 273.90 414.69 1 345.05 273.90
Bajaj Auto 333.55 253.40 384.60 1 333.55 253.40
Bajaj Auto 332.85 255.00 381.82 1 332.85 255.00
Bajaj Auto 333.95 253.95 382.65 1 333.95 253.95
Bajaj Auto 299.95 262.45 340.25 1 299.95 262.45
Bajaj Auto 268.15 263.00 311.37 1 268.15 263.00
Bajaj Auto 278.85 263.95 315.82 1 278.85 263.95
Bajaj Auto 266.80 265.35 306.29 1 266.80 265.35
Bajaj Auto 262.70 277.00 302.86 1 262.70 277.00
BHEL 100.15 144.65 133.46 1 100.15 144.65
BHEL 103.25 143.90 136.66 1 103.25 143.90
BHEL 103.90 149.00 136.00 1 103.90 149.00
BHEL 106.20 147.90 139.92 1 106.20 147.90
BHEL 102.70 153.90 136.66 1 102.70 153.90
CIPLA 707.75 835.00 829.90 1 707.75 835.00
CIPLA 713.20 856.00 815.00 1 713.20 856.00
CIPLA 719.90 828.00 795.56 1 719.90 828.00
CIPLA 726.15 819.00 838.63 1 726.15 819.00
CIPLA 685.05 940.00 785.45 1 685.05 940.00
CIPLA 681.35 935.00 769.63 1 681.35 935.00
Colgate 149.35 175.00 185.11 1 149.35 175.00
Colgate 151.20 174.90 187.13 1 151.20 174.90
Colgate 155.20 175.80 191.40 1 155.20 175.80
Colgate 153.80 176.80 189.79 1 153.80 176.80
Colgate 148.15 179.50 183.55 1 148.15 179.50
Dr. Reddy 1,151.05 1,438.00 1,285.06 1 1,151.05 1,438.00
Dr. Reddy 1,324.35 1,364.00 1,470.96 1 1,324.35 1,364.00
Dr. Reddy 1,307.95 1,384.00 1,445.69 1 1,307.95 1,384.00
Dr. Reddy 1,319.60 1,338.00 1,467.00 1 1,319.60 1,338.00
Dr. Reddy 1,273.40 1,425.00 1,410.40 1 1,273.40 1,425.00
Dr. Reddy 1,235.20 1,467.35 1,530.84 1 1,235.20 1,467.35
Dr. Reddy 1,250.15 1,459.70 1,557.52 1 1,250.15 1,459.70
Dr. Reddy 1,248.05 1,559.90 1,552.79 1 1,248.05 1,559.90
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
49
Dr. Reddy 1,251.10 1,595.00 1,558.54 1 1,251.10 1,595.00
Glaxo 421.00 497.95 464.21 1 421.00 497.95
Glaxo 426.10 470.00 485.66 1 426.10 470.00
Glaxo 436.45 488.90 499.66 1 436.45 488.90
Glaxo 467.40 490.00 566.24 1 467.40 490.00
Glaxo 465.45 487.70 536.36 1 465.45 487.70
Glaxo 479.20 483.00 565.76 1 479.20 483.00
Glaxo 443.25 425.90 523.54 1 443.25 425.90
Glaxo 445.40 416.00 522.84 1 445.40 416.00
Glaxo 450.05 442.00 528.75 1 450.05 442.00
Glaxo 446.75 432.00 524.57 1 446.75 432.00
Glaxo 409.70 461.00 454.13 1 409.70 461.00
GRASIM 216.30 237.00 238.87 1 216.30 237.00
GRASIM 214.55 218.90 236.03 1 214.55 218.90
GRASIM 197.90 273.85 234.42 1 197.90 273.85
GRASIM 202.60 276.00 236.84 1 202.60 276.00
GRASIM 202.30 289.90 234.52 1 202.30 289.90
GRASIM 202.55 268.80 234.92 1 202.55 268.80
GRASIM 204.00 274.00 237.17 1 204.00 274.00
Gujrat Ambuja 128.90 156.10 161.34 1 128.90 156.10
Gujrat Ambuja 132.00 156.45 165.81 1 132.00 156.45
Gujrat Ambuja 136.15 156.75 168.20 1 136.15 156.75
Gujrat Ambuja 130.40 154.90 163.48 1 130.40 154.90
Gujrat Ambuja 133.50 161.45 166.24 1 133.50 161.45
HCL Tech 1,069.90 1,414.00 1,204.31 1 1,069.90 1,414.00
HCL Tech 1,008.15 1,330.00 1,122.29 1 1,008.15 1,330.00
HCL Tech 1,205.10 1,039.00 1,383.05 1 1,205.10 1,039.00
HCL Tech 1,276.20 1,025.00 1,448.52 1 1,276.20 1,025.00
HCL Tech 1,300.35 969.95 1,470.81 1 1,300.35 969.95
HCL Tech 1,072.25 1,240.00 1,192.05 1 1,072.25 1,240.00
HCL Tech 1,031.45 1,233.00 1,157.64 1 1,031.45 1,233.00
HCL Tech 1,072.25 1,239.00 1,302.00 1 1,072.25 1,239.00
HCL Tech 1,110.75 1,273.80 1,316.36 1 1,110.75 1,273.80
HCL Tech 1,149.65 1,274.00 1,403.14 1 1,149.65 1,274.00
HDFC 551.55 509.00 619.13 1 551.55 509.00
HDFC 498.40 548.00 556.63 1 498.40 548.00
HDFC 499.75 541.90 549.77 1 499.75 541.90
HDFC 505.90 540.00 568.14 1 505.90 540.00
HDFC 445.15 496.00 545.60 1 445.15 496.00
HDFC 426.55 489.90 530.12 1 426.55 489.90
HDFC 441.05 500.00 543.99 1 441.05 500.00
HDFC 437.85 489.75 534.10 1 437.85 489.75
HDFC 457.35 525.00 536.29 1 457.35 525.00
HDFC 462.20 528.00 541.49 1 462.20 528.00
HDFC 461.30 533.05 535.51 1 461.30 533.05
HDFC 464.10 545.00 538.17 1 464.10 545.00
HDFC 470.25 557.90 546.57 1 470.25 557.90
HDFC Bank 222.35 253.00 248.68 1 222.35 253.00
HDFC Bank 226.65 249.90 253.80 1 226.65 249.90
HDFC Bank 223.90 249.95 251.66 1 223.90 249.95
HDFC Bank 234.25 245.80 267.26 1 234.25 245.80
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
50
HDFC Bank 243.25 218.90 289.33 1 243.25 218.90
HDFC Bank 241.40 217.90 285.39 1 241.40 217.90
HDFC Bank 241.35 229.90 283.80 1 241.35 229.90
HDFC Bank 240.00 220.00 282.40 1 240.00 220.00
HDFC Bank 250.55 224.60 299.14 1 250.55 224.60
Hind Petro 123.95 123.00 138.84 1 123.95 123.00
Hind Petro 122.70 124.65 137.63 1 122.70 124.65
Hind Petro 122.50 119.90 135.48 1 122.50 119.90
Hind Petro 108.90 125.85 120.10 1 108.90 125.85
Hind Petro 100.05 129.50 137.14 1 100.05 129.50
Hind Petro 103.05 132.65 139.56 1 103.05 132.65
Hind Petro 103.70 139.40 138.28 1 103.70 139.40
Hind Petro 101.50 142.20 136.97 1 101.50 142.20
Hind Petro 106.55 144.85 142.08 1 106.55 144.85
ICICI Bank 109.20 146.30 139.94 1 109.20 146.30
ICICI Bank 117.30 146.50 148.02 1 117.30 146.50
ICICI Bank 118.55 156.00 148.70 1 118.55 156.00
ICICI Bank 115.00 156.25 145.32 1 115.00 156.25
ICICI Bank 109.35 182.00 139.84 1 109.35 182.00
Infosys 7,118.45 8,649.00 8,607.01 1 7,118.45 8,649.00
Infosys 6,656.10 8,469.00 8,653.59 1 6,656.10 8,469.00
Infosys 6,787.20 8,448.00 8,663.92 1 6,787.20 8,448.00
Infosys 6,845.30 8,639.00 8,643.36 1 6,845.30 8,639.00
Infosys 6,761.25 8,825.00 8,371.08 1 6,761.25 8,825.00
Infosys 7,247.80 7,655.00 8,044.18 1 7,247.80 7,655.00
IPCL 63.55 53.95 80.66 1 63.55 53.95
IPCL 63.50 54.25 80.59 1 63.50 54.25
IPCL 61.45 53.50 79.16 1 61.45 53.50
IPCL 57.45 63.30 67.36 1 57.45 63.30
IPCL 56.50 62.50 66.81 1 56.50 62.50
IPCL 56.85 63.70 67.09 1 56.85 63.70
IPCL 55.90 62.35 66.49 1 55.90 62.35
IPCL 55.65 63.85 61.83 1 55.65 63.85
IPCL 53.50 55.95 66.03 1 53.50 55.95
IPCL 56.10 56.00 67.79 1 56.10 56.00
IPCL 54.90 59.90 67.00 1 54.90 59.90
IPCL 54.95 60.50 67.04 1 54.95 60.50
IPCL 45.65 63.25 86.12 1 45.65 63.25
IPCL 49.90 65.70 89.51 1 49.90 65.70
IPCL 50.70 68.90 89.79 1 50.70 68.90
IPCL 50.05 68.00 89.25 1 50.05 68.00
IPCL 49.15 73.50 88.57 1 49.15 73.50
ITC 754.40 785.00 834.70 1 754.40 785.00
ITC 732.15 775.70 916.23 1 732.15 775.70
ITC 736.65 774.90 896.74 1 736.65 774.90
ITC 741.95 766.85 945.87 1 741.95 766.85
ITC 767.00 744.50 896.78 1 767.00 744.50
ITC 759.25 733.00 875.20 1 759.25 733.00
ITC 775.95 729.00 900.83 1 775.95 729.00
ITC 731.00 816.00 860.57 1 731.00 816.00
ITC 733.30 818.80 866.61 1 733.30 818.80
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
51
ITC 709.70 823.00 824.94 1 709.70 823.00
ITC 713.20 801.25 850.66 1 713.20 801.25
M & M 134.85 148.90 166.19 1 134.85 148.90
M & M 140.85 151.05 172.69 1 140.85 151.05
M & M 130.30 155.00 161.64 1 130.30 155.00
M & M 132.55 157.50 163.66 1 132.55 157.50
M & M 128.95 165.70 160.17 1 128.95 165.70
MTNL 139.90 171.80 177.23 1 139.90 171.80
MTNL 138.70 169.80 174.50 1 138.70 169.80
MTNL 138.45 170.90 170.96 1 138.45 170.90
MTNL 137.00 169.50 171.61 1 137.00 169.50
MTNL 140.25 184.30 176.46 1 140.25 184.30
National
Aluminium
52.95 47.00 71.42 1 52.95 47.00
National
Aluminium
52.20 47.50 70.90 1 52.20 47.50
National
Aluminium
52.80 47.20 71.32 1 52.80 47.20
National
Aluminium
48.95 44.00 60.08 1 48.95 44.00
National
Aluminium
49.60 45.90 60.50 1 49.60 45.90
National
Aluminium
49.75 47.00 60.59 1 49.75 47.00
National
Aluminium
49.20 48.35 60.27 1 49.20 48.35
National
Aluminium
48.40 48.00 55.44 1 48.40 48.00
National
Aluminium
43.30 42.25 47.68 1 43.30 42.25
National
Aluminium
42.70 42.75 47.38 1 42.70 42.75
National
Aluminium
42.20 42.45 47.09 1 42.20 42.45
National
Aluminium
41.25 42.50 46.41 1 41.25 42.50
National
Aluminium
40.60 42.90 46.19 1 40.60 42.90
National
Aluminium
41.55 43.50 55.94 1 41.55 43.50
National
Aluminium
42.95 43.45 56.80 1 42.95 43.45
National
Aluminium
42.50 45.00 56.55 1 42.50 45.00
National
Aluminium
42.20 44.75 56.36 1 42.20 44.75
National
Aluminium
39.65 44.65 79.58 1 39.65 44.65
National
Aluminium
41.00 44.85 80.55 1 41.00 44.85
National
Aluminium
41.05 45.90 80.56 1 41.05 45.90
National
Aluminium
40.95 44.65 80.50 1 40.95 44.65
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
52
National
Aluminium
40.10 48.20 79.80 1 40.10 48.20
ONGC 99.80 121.60 132.34 1 99.80 121.60
ONGC 103.40 127.60 135.69 1 103.40 127.60
ONGC 106.75 135.00 138.80 1 106.75 135.00
ONGC 104.40 125.60 136.64 1 104.40 125.60
ONGC 104.40 126.50 136.46 1 104.40 126.50
Oriental Bank 33.70 31.50 60.82 1 33.70 31.50
Oriental Bank 33.75 31.65 60.81 1 33.75 31.65
Oriental Bank 33.35 31.65 60.60 1 33.35 31.65
Oriental Bank 32.25 31.95 51.92 1 32.25 31.95
Oriental Bank 32.10 33.00 51.85 1 32.10 33.00
Oriental Bank 32.05 33.15 51.82 1 32.05 33.15
Oriental Bank 31.90 33.45 51.75 1 31.90 33.45
Oriental Bank 31.65 33.75 47.66 1 31.65 33.75
Oriental Bank 31.50 30.30 43.18 1 31.50 30.30
Oriental Bank 31.00 30.55 42.93 1 31.00 30.55
Oriental Bank 31.40 30.20 43.10 1 31.40 30.20
Oriental Bank 31.30 29.80 39.38 1 31.30 29.80
Oriental Bank 31.60 30.00 39.53 1 31.60 30.00
Oriental Bank 31.70 30.10 39.59 1 31.70 30.10
Oriental Bank 31.20 30.25 42.84 1 31.20 30.25
Oriental Bank 30.85 30.00 42.68 1 30.85 30.00
Oriental Bank 30.15 32.25 50.64 1 30.15 32.25
Oriental Bank 30.05 30.95 50.57 1 30.05 30.95
Oriental Bank 30.15 32.00 50.64 1 30.15 32.00
Oriental Bank 30.35 31.55 50.76 1 30.35 31.55
Oriental Bank 28.75 35.00 73.12 1 28.75 35.00
Oriental Bank 28.55 34.65 72.99 1 28.55 34.65
Oriental Bank 28.75 35.00 73.10 1 28.75 35.00
Oriental Bank 28.70 34.60 73.08 1 28.70 34.60
Oriental Bank 28.60 36.30 72.92 1 28.60 36.30
Ranbaxy Labs 585.90 604.00 658.80 1 585.90 604.00
Ranbaxy Labs 563.90 671.90 623.53 1 563.90 671.90
Ranbaxy Labs 552.15 761.00 611.82 1 552.15 761.00
Ranbaxy Labs 634.55 748.00 698.42 1 634.55 748.00
Ranbaxy Labs 625.05 794.10 709.34 1 625.05 794.10
Ranbaxy Labs 635.50 805.00 700.48 1 635.50 805.00
Reliance 333.75 333.35 389.28 1 333.75 333.35
Reliance 342.25 338.00 388.47 1 342.25 338.00
Reliance 340.80 335.75 403.96 1 340.80 335.75
Reliance 333.90 359.60 374.74 1 333.90 359.60
Reliance 325.60 365.90 393.45 1 325.60 365.90
Reliance 340.45 375.00 392.96 1 340.45 375.00
Reliance 336.80 387.00 399.12 1 336.80 387.00
Reliance 330.40 346.50 363.54 1 330.40 346.50
Reliance 336.90 341.50 372.23 1 336.90 341.50
Reliance 336.55 334.40 372.84 1 336.55 334.40
Reliance 347.90 312.80 387.36 1 347.90 312.80
Reliance 341.30 319.90 431.91 1 341.30 319.90
Reliance 351.90 315.25 389.42 1 351.90 315.25
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
53
Reliance 345.60 322.40 416.36 1 345.60 322.40
Reliance 342.50 322.70 433.72 1 342.50 322.70
Reliance 292.70 335.40 364.22 1 292.70 335.40
Reliance 305.05 339.80 373.69 1 305.05 339.80
Reliance 305.55 344.70 368.49 1 305.55 344.70
Reliance 302.95 340.35 381.83 1 302.95 340.35
Reliance 302.15 346.95 379.50 1 302.15 346.95
SAIL 6.55 5.95 43.97 1 6.55 5.95
SAIL 6.50 6.50 43.90 1 6.50 6.50
SAIL 6.45 6.20 43.85 1 6.45 6.20
SAIL 5.90 6.50 36.70 1 5.90 6.50
SAIL 5.95 6.90 37.07 1 5.95 6.90
SAIL 5.95 6.85 37.12 1 5.95 6.85
SAIL 6.20 6.60 36.35 1 6.20 6.60
SAIL 6.20 6.35 33.57 1 6.20 6.35
SAIL 5.95 5.40 30.81 1 5.95 5.40
SAIL 5.85 5.50 30.81 1 5.85 5.50
SAIL 5.75 5.35 30.61 1 5.75 5.35
SAIL 5.70 5.15 27.82 1 5.70 5.15
SAIL 5.65 5.15 27.73 1 5.65 5.15
SAIL 5.65 5.05 27.81 1 5.65 5.05
SAIL 5.75 5.15 30.53 1 5.75 5.15
SAIL 5.50 5.20 30.10 1 5.50 5.20
SAIL 5.40 5.65 36.07 1 5.40 5.65
SAIL 5.35 5.55 35.96 1 5.35 5.55
SAIL 5.40 7.75 36.24 1 5.40 7.75
SAIL 5.35 5.65 36.15 1 5.35 5.65
SAIL 4.75 6.65 55.69 1 4.75 6.65
SAIL 4.90 6.60 55.83 1 4.90 6.60
SAIL 5.00 7.25 55.90 1 5.00 7.25
SAIL 5.00 6.95 55.89 1 5.00 6.95
SAIL 4.85 7.05 55.72 1 4.85 7.05
Satyam
Computers
335.05 374.60 416.63 1 335.05 374.60
Shipping
Corporation
16.90 15.20 51.02 1 16.90 15.20
Shipping
Corporation
16.40 16.20 50.74 1 16.40 16.20
Shipping
Corporation
15.75 16.25 50.43 1 15.75 16.25
Shipping
Corporation
14.75 18.35 42.72 1 14.75 18.35
Shipping
Corporation
15.00 20.25 42.83 1 15.00 20.25
Shipping
Corporation
14.95 22.90 42.80 1 14.95 22.90
Shipping
Corporation
14.90 19.75 42.79 1 14.90 19.75
Shipping
Corporation
15.85 19.85 39.69 1 15.85 19.85
Shipping
Corporation
17.35 16.30 36.65 1 17.35 16.30
Shipping 17.75 16.25 36.79 1 17.75 16.25
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
54
Corporation
Shipping
Corporation
18.45 16.20 37.06 1 18.45 16.20
Shipping
Corporation
18.65 16.00 33.63 1 18.65 16.00
Shipping
Corporation
18.90 15.90 33.86 1 18.90 15.90
Shipping
Corporation
18.55 15.60 33.74 1 18.55 15.60
Shipping
Corporation
18.35 21.75 36.74 1 18.35 21.75
Shipping
Corporation
17.80 21.00 36.52 1 17.80 21.00
Shipping
Corporation
17.90 22.00 43.63 1 17.90 22.00
Shipping
Corporation
16.45 21.90 42.94 1 16.45 21.90
Shipping
Corporation
16.35 21.50 42.90 1 16.35 21.50
Shipping
Corporation
16.40 21.00 42.92 1 16.40 21.00
Shipping
Corporation
16.65 25.50 64.78 1 16.65 25.50
Shipping
Corporation
17.80 25.70 65.48 1 17.80 25.70
Shipping
Corporation
17.45 27.00 65.26 1 17.45 27.00
Shipping
Corporation
17.75 27.00 65.45 1 17.75 27.00
Shipping
Corporation
17.40 28.50 65.15 1 17.40 28.50
State Bank 230.05 205.00 253.70 1 230.05 205.00
State Bank 205.85 214.45 227.84 1 205.85 214.45
State Bank 155.75 203.00 186.87 1 155.75 203.00
State Bank 157.20 196.75 189.71 1 157.20 196.75
State Bank 159.00 199.00 189.19 1 159.00 199.00
State Bank 158.55 194.20 189.58 1 158.55 194.20
State Bank 163.25 199.50 196.68 1 163.25 199.50
Sun Pharma 466.10 550.00 544.67 1 466.10 550.00
Sun Pharma 456.55 543.00 534.96 1 456.55 543.00
Sun Pharma 451.95 580.00 529.05 1 451.95 580.00
Sun Pharma 435.05 572.00 512.41 1 435.05 572.00
Tata Chemical 42.85 36.30 64.94 1 42.85 36.30
Tata Chemical 42.65 36.50 64.79 1 42.65 36.50
Tata Chemical 41.95 35.95 64.38 1 41.95 35.95
Tata Chemical 41.00 40.70 55.47 1 41.00 40.70
Tata Chemical 41.55 40.90 55.81 1 41.55 40.90
Tata Chemical 39.00 40.95 54.34 1 39.00 40.95
Tata Chemical 38.00 41.00 53.84 1 38.00 41.00
Tata Chemical 37.75 40.60 49.73 1 37.75 40.60
Tata Chemical 37.15 35.25 45.05 1 37.15 35.25
Tata Chemical 36.25 37.65 44.62 1 36.25 37.65
Tata Chemical 36.95 36.30 44.93 1 36.95 36.30
Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005
55
Tata Chemical 36.05 39.10 44.35 1 36.05 39.10
Tata Chemical 35.10 39.00 43.88 1 35.10 39.00
Tata Chemical 34.95 43.05 52.56 1 34.95 43.05
Tata Chemical 36.80 42.80 53.61 1 36.80 42.80
Tata Chemical 35.60 43.10 52.93 1 35.60 43.10
Tata Chemical 34.75 41.90 52.46 1 34.75 41.90
Tata Chemical 35.80 47.30 77.31 1 35.80 47.30
Tata Chemical 37.45 50.15 78.45 1 37.45 50.15
Tata Chemical 38.45 52.40 79.13 1 38.45 52.40
Tata Chemical 37.95 52.25 78.78 1 37.95 52.25
Tata Chemical 37.70 54.25 78.52 1 37.70 54.25
Tata Power 79.35 76.75 91.70 1 79.35 76.75
Tata Power 81.00 75.50 92.91 1 81.00 75.50
Tata Power 80.95 83.40 92.86 1 80.95 83.40
Tata Power 71.85 76.45 79.09 1 71.85 76.45
Tata Power 69.55 74.50 77.34 1 69.55 74.50
Tata Power 68.35 72.75 76.43 1 68.35 72.75
Tata Power 64.15 83.40 99.98 1 64.15 83.40
Tata Power 65.70 85.75 101.20 1 65.70 85.75
Tata Power 67.40 86.95 102.57 1 67.40 86.95
Tata Power 68.30 84.95 103.32 1 68.30 84.95
Tata Power 68.00 91.00 102.96 1 68.00 91.00
Tata Tea 173.00 213.00 205.58 1 173.00 213.00
Tata Tea 171.50 209.80 204.20 1 171.50 209.80
Tata Tea 172.30 211.50 204.32 1 172.30 211.50
Tata Tea 172.30 214.70 204.42 1 172.30 214.70
Tata Tea 168.60 219.90 200.43 1 168.60 219.90
TISCO 95.55 126.90 127.35 1 95.55 126.90
TISCO 98.10 128.25 130.87 1 98.10 128.25
TISCO 99.80 129.45 131.13 1 99.80 129.45
TISCO 99.35 129.80 130.53 1 99.35 129.80
TISCO 96.60 132.40 127.94 1 96.60 132.40
WIPRO 2,515.35 3,460.00 3,292.03 1 2,515.35 3,460.00
WIPRO 2,419.50 3,396.00 3,422.93 1 2,419.50 3,396.00
WIPRO 2,512.10 3,400.00 3,295.55 1 2,512.10 3,400.00
WIPRO 2,450.15 3,395.00 3,406.93 1 2,450.15 3,395.00
WIPRO 2,411.30 3,368.00 3,269.78 1 2,411.30 3,368.00
WIPRO 2,191.80 2,867.40 3,032.81 1 2,191.80 2,867.40
WIPRO 2,280.35 2,941.10 2,978.31 1 2,280.35 2,941.10
WIPRO 2,288.15 3,099.70 3,090.05 1 2,288.15 3,099.70
WIPRO 2,313.40 2,989.90 2,988.22 1 2,313.40 2,989.90
WIPRO 2,348.50 3,048.00 2,922.66 1 2,348.50 3,048.00
Total 157,152.70 184,869.65

More Related Content

Similar to Using Neural Nework to Explain Behavior of Indian Markets

China mechanized farming gardening machines market repo… sample pages
China mechanized farming gardening machines market repo…   sample pagesChina mechanized farming gardening machines market repo…   sample pages
China mechanized farming gardening machines market repo… sample pagesBeijing Zeefer Consulting Ltd.
 
China feeds production equipment market report sample pages
China feeds production equipment market report   sample pagesChina feeds production equipment market report   sample pages
China feeds production equipment market report sample pagesBeijing Zeefer Consulting Ltd.
 
China other synthetic fibre market report sample pages
China other synthetic fibre market report   sample pagesChina other synthetic fibre market report   sample pages
China other synthetic fibre market report sample pagesBeijing Zeefer Consulting Ltd.
 
China transport security management equipment market report sample pages
China transport security management equipment market report   sample pagesChina transport security management equipment market report   sample pages
China transport security management equipment market report sample pagesBeijing Zeefer Consulting Ltd.
 
China transport security management equipment market report sample pages
China transport security management equipment market report   sample pagesChina transport security management equipment market report   sample pages
China transport security management equipment market report sample pagesBeijing Zeefer Consulting Ltd.
 
China polycaprolactam fibre market report sample pages
China polycaprolactam fibre market report   sample pagesChina polycaprolactam fibre market report   sample pages
China polycaprolactam fibre market report sample pagesBeijing Zeefer Consulting Ltd.
 
China vehicles lighting electric signs market report sample pages
China vehicles lighting electric signs market report   sample pagesChina vehicles lighting electric signs market report   sample pages
China vehicles lighting electric signs market report sample pagesBeijing Zeefer Consulting Ltd.
 
China electronic components sets market report sample pages
China electronic components sets market report   sample pagesChina electronic components sets market report   sample pages
China electronic components sets market report sample pagesBeijing Zeefer Consulting Ltd.
 
China electronic components market report sample pages
China electronic components market report   sample pagesChina electronic components market report   sample pages
China electronic components market report sample pagesBeijing Zeefer Consulting Ltd.
 
Sample Global Infrastructure Asset Management Market Report 2022
Sample Global Infrastructure Asset Management Market Report 2022Sample Global Infrastructure Asset Management Market Report 2022
Sample Global Infrastructure Asset Management Market Report 2022Cognitive Market Research
 

Similar to Using Neural Nework to Explain Behavior of Indian Markets (20)

China camera market report sample pages
China camera market report   sample pagesChina camera market report   sample pages
China camera market report sample pages
 
China photoelectron parts market report sample pages
China photoelectron parts market report   sample pagesChina photoelectron parts market report   sample pages
China photoelectron parts market report sample pages
 
China camera market profile sample pages
China camera market profile   sample pagesChina camera market profile   sample pages
China camera market profile sample pages
 
China mechanized farming gardening machines market repo… sample pages
China mechanized farming gardening machines market repo…   sample pagesChina mechanized farming gardening machines market repo…   sample pages
China mechanized farming gardening machines market repo… sample pages
 
China feeds production equipment market report sample pages
China feeds production equipment market report   sample pagesChina feeds production equipment market report   sample pages
China feeds production equipment market report sample pages
 
China nitrilon fibre market report sample pages
China nitrilon fibre market report   sample pagesChina nitrilon fibre market report   sample pages
China nitrilon fibre market report sample pages
 
China integrated circuit market report sample pages
China integrated circuit market report   sample pagesChina integrated circuit market report   sample pages
China integrated circuit market report sample pages
 
China other synthetic fibre market report sample pages
China other synthetic fibre market report   sample pagesChina other synthetic fibre market report   sample pages
China other synthetic fibre market report sample pages
 
China transport security management equipment market report sample pages
China transport security management equipment market report   sample pagesChina transport security management equipment market report   sample pages
China transport security management equipment market report sample pages
 
China transport security management equipment market report sample pages
China transport security management equipment market report   sample pagesChina transport security management equipment market report   sample pages
China transport security management equipment market report sample pages
 
China polycaprolactam fibre market report sample pages
China polycaprolactam fibre market report   sample pagesChina polycaprolactam fibre market report   sample pages
China polycaprolactam fibre market report sample pages
 
China furniture market report sample pages
China furniture market report   sample pagesChina furniture market report   sample pages
China furniture market report sample pages
 
China lignite mining market report sample pages
China lignite mining market report   sample pagesChina lignite mining market report   sample pages
China lignite mining market report sample pages
 
China cement products market report sample pages
China cement products market report   sample pagesChina cement products market report   sample pages
China cement products market report sample pages
 
China vehicles lighting electric signs market report sample pages
China vehicles lighting electric signs market report   sample pagesChina vehicles lighting electric signs market report   sample pages
China vehicles lighting electric signs market report sample pages
 
China electronic components sets market report sample pages
China electronic components sets market report   sample pagesChina electronic components sets market report   sample pages
China electronic components sets market report sample pages
 
China electronic components market report sample pages
China electronic components market report   sample pagesChina electronic components market report   sample pages
China electronic components market report sample pages
 
Sample BIPV Modules Market Report 2022
Sample  BIPV Modules Market Report 2022 Sample  BIPV Modules Market Report 2022
Sample BIPV Modules Market Report 2022
 
Sample Global Infrastructure Asset Management Market Report 2022
Sample Global Infrastructure Asset Management Market Report 2022Sample Global Infrastructure Asset Management Market Report 2022
Sample Global Infrastructure Asset Management Market Report 2022
 
Sample Global Infrastructure Asset
Sample Global Infrastructure Asset Sample Global Infrastructure Asset
Sample Global Infrastructure Asset
 

Recently uploaded

Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreelreely ones
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsUXDXConf
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxEasyPrinterHelp
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 

Recently uploaded (20)

Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 

Using Neural Nework to Explain Behavior of Indian Markets

  • 1. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 1 UUSSIINNGG NNEEUURRAALL NNEETTWWOORRKKSS TTOO EEXXPPLLAAIINN BBEEHHAAVVIIOORR OOFF IINNDDIIAANN MMAARRKKEETTSS PPGGSSEEMM FFIINNAALL PPRROOJJEECCTT RREEPPOORRTT Student: Vinay Avasthi Roll No. 2003152 FFAACCUULLTTYY GGUUIIDDEE:: PPRROOFF.. RRAAHHUULL DDEE IINNDDIIAANN IINNSSTTIITTUUTTEE OOFF MMAANNAAGGEEMMEENNTT BBAANNGGAALLOORREE Towards partial fulfillment of the requirements for the Post Graduate Diploma in Software Enterprise Management of the Indian Institute of Management Bangalore
  • 2. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 2 TTAABBLLEE OOFF CCOONNTTEENNTTSS INTRODUCTION........................................................................................................................................... 5 REFERENCES................................................................................................................................................. 5 PRIOR WORK ................................................................................................................................................ 5 SIGNIFICANCE OF THIS PROJECT ..................................................................................................................... 6 VARIABLES EVALUATED ............................................................................................................................... 6 STRATEGY .................................................................................................................................................. 10 FACTORS .................................................................................................................................................... 10 Factor 1 – RBI influence and Core sector............................................................................................... 11 Factor 2 – Foreign Exchange and Crude................................................................................................ 13 Factor 3 – Agriculture, Total Domestic Product ..................................................................................... 13 Factor 4 – Company Financials ............................................................................................................. 13 Factor 5 – Company Ratios.................................................................................................................... 14 Factor 6 – Agriculture, Community services, debt structure with RBI...................................................... 14 Factor 7 – Company Capital structure, profitability ratios and other indicators...................................... 14 Factor 8 – Banking system residuals ...................................................................................................... 14 Factor 9 – Company Liquidity Ratios..................................................................................................... 15 Factor 10 – Company stock performance................................................................................................ 15 Factor 11 – RBI balance sheet debt structure and errors ........................................................................ 15 Factor 12 – RBI balance sheet errors..................................................................................................... 16 Factor 13 – Company indicators (residuals)........................................................................................... 16 Factor 14 – Banking system residuals..................................................................................................... 16 Factor 15 – Company financial ratios, Residuals.................................................................................... 16 Factor 16 – Foreign Exchange, Crude and interest rate, Residuals......................................................... 17 Factor 17 – Company Financial Ratios, Residuals.................................................................................. 17 Factor 18 – Company Financial Ratios, Residuals.................................................................................. 17 Factor 19 – USD Forward Spot rate....................................................................................................... 18 Factor 20 – IDBI lending rate and crude prices...................................................................................... 18 COMPANIES ................................................................................................................................................ 18 CHOICE OF NEURAL NETWORK ........................................................................................................... 20 INPUTS AND OUTPUTS ................................................................................................................................. 20 HIDDEN LAYERS ......................................................................................................................................... 20 TRAINING RESULTS..................................................................................................................................... 21 Next Day Neural Network ...................................................................................................................... 21
  • 3. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 3 Next Fortnight Neural Network .............................................................................................................. 23 Six Month Neural Network ..................................................................................................................... 25 NEURAL NETWORK PREDICTION......................................................................................................... 27 Next Day Prediction............................................................................................................................... 27 Next Fortnight Prediction....................................................................................................................... 28 Six Month prediction.............................................................................................................................. 29 SIMULATED TRADING ............................................................................................................................. 31 CONCLUSION ............................................................................................................................................. 32 FURTHER WORK .......................................................................................................................................... 32 APPENDIX A FACTOR ANALYSIS................................................................................................... 33 TOTAL VARIANCE EXPLAINED ..................................................................................................................... 33 COMPONENT MATRIX.................................................................................................................................. 36 APPENDIX B NEURAL NET GENERATOR..................................................................................... 40 SOURCE FOR NEURALNETSCREENER ........................................................................................................... 40 SOURCE FOR STOCKMARKETNEURALNETCREATOR ..................................................................................... 46 APPENDIX C SIMULATED TRADE SHEET .................................................................................... 48
  • 4. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 4 TTAABBLLEE OOFF FFIIGGUURREESS FIGURE I PERCENTAGE CONTRIBUTION OF FACTORS 11 FIGURE II TRAINING AND VALIDATION ERRORS FOR DIFFERENT NN ARCHITECTURES 21 FIGURE III TRAINING AND VALIDATION ERROR FOR NEXT DAY OPEN PREDICTION 22 FIGURE IV TRAINING AND VALIDATION ERROR FOR NEXT DAY HIGH 22 FIGURE V TRAINING AND VALIDATION ERRORS FOR NEXT DAY LOW PRICE PREDICTION 23 FIGURE IX TRAINING AND VALIDATION ERROR FOR NEXT FORTNIGHT OPEN PREDICTION 23 FIGURE X TRAINING AND VALIDATION ERROR FOR NEXT FORTNIGHT HIGH PREDICTION 24 FIGURE XI TRAINING AND VALIDATION ERROR FOR NEXT FORTNIGHT LOW PREDICTION 24 FIGURE XII TRAINING AND VALIDATION ERROR FOR SIX MONTH LATER OPEN PRICE 25 FIGURE XIII TRAINING AND VALIDATION ERROR FOR SIX MONTH LATER HIGH PRICE 25 FIGURE XIV TRAINING AND VALIDATION ERROR FOR SIX MONTH LATER LOW PRICE 26 FIGURE XV ACTUAL AND PREDICTED STOCK PRICES OF SELECT NIFTY COMPANIES NEXT DAY 27 FIGURE XVI ACTUAL AND PREDICTED STOCK PRICES OF SELECT NIFTY COMPANIES NEXT DAY 28 FIGURE XVII ACTUAL AND PREDICTED STOCK PRICES OF SELECT NIFTY COMPANIES AFTER A FORTNIGHT 28 FIGURE XVIII ACTUAL AND PREDICTED STOCK PRICES OF SELECT NIFTY COMPANIES AFTER A FORTNIGHT 29 FIGURE XIX ACTUAL AND PREDICTED STOCK PRICE AFTER NEXT SIX MONTHS FOR ABB 29 FIGURE XX ACTUAL AND PREDICTED STOCK PRICE AFTER SIX MONTHS FOR SELECT NIFTY COMPANIES 30 FIGURE XXI ACTUAL AND PREDICTED STOCK PRICE AFTER SIX MONTHS FOR SELECT NIFTY COMPANIES 30
  • 5. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 5 IINNTTRROODDUUCCTTIIOONN This project evaluates the impact of changes in macro and micro economic variables on Indian financial markets. The data that is evaluated for this effort contains variables directly controlled by Reserve Bank of India and other variables like price of crude etc. The project uses a combination of statistical analysis and artificial intelligence techniques to generate a model that could be used to predict the behavior of the markets. References [1] Yung-Keun Kwon, Sillim-dong, Gwanak-gu, and Sung-Soon Choi, Stock Prediction Based on Financial Correlation, GECCO’05, June 25–29, 2005, ACM [2] Shaun-inn Wu and Ruey-Pyng Lu, Combining Artificial Neural Networks and Statistics for Stock-Market Forecasting, © 1993 ACM [3] JooneWorld, Java Object Oriented Neural Engine, http://www.jooneworld.com [4] New Research Initiative, Paper No. 10, Empirical Investigation of Multifactor Asset Pricing Model Using Artificial Neural Networks, M V Kamath [5] James V. Hansen and Ray D. Nelson, Neural Networks and Traditional Time Series, Methods: A Synergistic Combination in State Economic Forecasts, IEEE Transactions On Neural Networks, VOL. 8, NO. 4, JULY 1997 Prior Work There has been considerable work in the area of financial forecasting using neural networks. • [1] uses input data of multiple companies to predict stock price. This model does not use any data other than the company data. This model depends on the assumption that the stock price of a company is correlated with the stock price of other companies in the exchange. • [2] uses neural networks to forecast S & P 500 index values • [4] is a specific study done as a student project in National Stock Exchange. This uses a limited set of RBI controlled variables and uses neural network to predict the stock market behavior
  • 6. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 6 Significance of this project This project is working on basic premise that the trader’s and investor’s behavior in stock market is controlled by the information that is available to them while they are making trading decisions. In context of Indian stock market this information is available in following formats. • Company results • RBI controlled variables • Foreign investment numbers • GDP numbers • Debt situation in the country • Crude prices • Indian interest rates • US interest rates Most of this data is available publicly. The assumption that this project makes is that if the same information is made available to a neural network then after training it would be able to predict the movement of individual stocks in the market. Variables Evaluated Following variables are evaluated as part of constructing this model. • assetsWithBankingSystem – Total assets with the banking system • bankCredit – Bank credit in India • cash – Cash in hand • investmentAtBookValue – Total bank investments at book value • liabilitiesToBankingSystem – Total liabilities of banks to banking system • liabilitiesToOthers – Total liability of banks other than banking system • curcredit – Current account credit in INR • curdebit – Current account debit in INR • capcredit – Capital account credit in INR • capdebit – Capital account debit in INR • errcredit – Errors credit • errdebit – Errors debit
  • 7. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 7 • balcredit – Balance credit • baldebit – Balance debit • monmovcredit – Monetary movements credit • monmovdebit – Monetary movements debit • callMoneyHigh – Call money rate, High • callMoneyLow – Call money rate, Low • eps – Earning per share of the company • ceps – Cash earning per share of the company • bookValue – Book value of the company • div – Dividend paid per share of the company • opProfitPerShare – Operating profit per share of the company • netOperatingIncomePerShare – Net operating income per share of the company • freeReserves – Free reserves with the company • opm – Operating profit margin of the company • gpm – Gross profit margin of the company • npm – Net profit margin of the company • ronw – Return on net work of the company • debtToEquity – Debt to equity ratio of the company • currentRatio – Current ratio of the company • quickRatio – Quick ratio of the company • interestCover – Interest cover of the company • salesByTotalAssets – Sales by total assets of the company • salesByFixedAssets – Sales by fixed assets of the company • salesByCurrentAssets – Sales by current assets of the company • noOfDaysOfWorkingCapital – No of days of working capital with the company • cpi – Consumer price index • br – Bank Rate • idbiRate – IDBI minimum term lending rate • maxCMR – Maximum Call Money Rate • maxPLR – Maximum prime lending rate
  • 8. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 8 • minPLR – Minimum Prime lending rate • price – Crude price • totalINRdebt – Total debt in Indian Rupees • concessionalDebtAsPercOfTotal – Concessional debt as a percentage of total • shortTermDebtAsPercOfTotal – Short term debt as a percentage of total • affConstant – Agriculture, Forestry and Fishing, GDP factor cost, Constant prices • affCurrent – Agriculture, Forestry and Fishing, GDP factor cost, Current prices • cspsConstant – Community social and personal services, GDP factor cost, Constant prices • cspsCurrent – Community social and personal services, GDP factor cost, Current prices • consConstant – Construction, GDP factor cost, Constant prices • consCurrent – Construction, GDP factor cost, Current prices • egwsConstant – Electricity, Gas and Water Services, GDP factor cost, Constant prices • egwsCurrent – Electricity, Gas and Water Services, GDP factor cost, Current prices • firebsConstant – Finance, Insurance, Real Estate and Business services, GDP factor cost, Constant prices • firebsCurrent – Finance, Insurance, Real Estate and Business services, GDP factor cost, Current prices • manuConstant – Manufacturing, GDP factor cost, Constant prices • manuCurrent – Manufacturing, GDP factor cost, Current prices • maqConstant – Mining and quarrying, GDP factor cost, Constant prices • maqCurrent – Mining and quarrying, GDP factor cost, Current prices • tdpConstant – Total domestic product, GDP factor cost, Constant prices • tdpCurrent – Total domestic product, GDP factor cost, Current prices • thrConstant – Trade, Hotel and Restaurant, GDP factor cost, Constant prices • thrCurrent – Trade, Hotel and Restaurant, GDP factor cost, Current prices • aff – Agriculture, Forestry and Fishing, GDP factor cost
  • 9. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 9 • csps – Community social and personal services, GDP factor cost • cons – Construction, GDP factor cost • egws – Electricity, Gas and Water Services, GDP factor cost • firb – Finance, Insurance, Real Estate and Business services, GDP factor cost • manuf – Manufacturing, GDP factor cost • min – Mining, GDP factor cost • tdp – Total domestic product, GDP factor cost • thr – Trade, Hotel and Restaurant, GDP factor cost • currencyWithPublic – Total currency with Public • m3 – Money supply, also referred to as stock of legal currency in the economy • timeDepositsWithBank – Total time deposits with the bank • totalIncome – Total income of RBI • totalExpenditure – Total expenditure of RBI • netAvailableBalance – Net available balance in RBI • surplusToCentralGovernment – Surplus payable to central government from RBI • totalIssuesLiabilities – Total liabilities, Issues • totalIssuesAssets – Total assets, Issues • totalBankingLiabilities – Total liabilities, Banking • totalBankingAssets – Total assets, Banking • reserveMoneyLiabilities – Reserve Money, Liabilities • reserveMoneyAssets – Reserve Money, Assets • forwardCashSpot – Forward Cash Spot, USD forward premia • forwardCashOneMonth – Forward Cash one month, USD forward premia • forwardCashThreeMonth – Forward Cash three months, USD forward premia • forwardCashSixMonth – Forward Cash six months, USD forward premia • forwardCash12Month – Forward cash twelve months, USD forward premia • referenceRate – RBI reference rate for USD • rate – US interest rate • quantitiy – Quantity of particular stock traded • turnover – Total turn over of stock traded
  • 10. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 10 We would use above macro and micro economic indicators to establish the relationship of these indicators with following data for each company and sensitive index for a specific day. • Day open • Day high • Day low For each company and index, the model would be developed to predict prices four time periods. • Next day prices – +1d • Prices after 15 days – +15d • Prices after six months - +6m Strategy Since we are looking at very large number of input variables related to economic indicators which may have heavy correlation between themselves, we will first use factor analysis to identify a manageable set of factors that could be used as inputs for the neural network later to develop the prediction model. For each company four models would be constructed as follows. • 1D model, which would predict the prices for next day given the stock price, turnover and quantity for a day earlier to previous day. • 15D model, which would predict the prices 15 days down the line. • 180D model, which would predict the prices six months down the line given the stock price for a day. Factors After the factor analysis of the data, 96 inputs are reduced to 20 inputs with 95% of the variance explained. These factors are as follows. As we can see from Factor Analysis, first 5 factors contribute 75% of the variance in the data while rest of the 15 factors only adds approximately 20% of data.
  • 11. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 11 0.00% 10.00% 20.00% 30.00% 40.00% 50.00% 60.00% Factor1 Factor2 Factor3 Factor4 Factor5 Factor6 Factor7 Factor8 Factor9 Factor10 Factor11 Factor12 Factor13 Factor14 Factor15 Factor16 Factor17 Factor18 Factor19 Factor20 0.00% 10.00% 20.00% 30.00% 40.00% 50.00% 60.00% 70.00% 80.00% 90.00% 100.00% Percentage contribution Cumulative percentage Figure I Percentage contribution of factors As we go to later factors, these mostly cover the residual values from initial factors. Figure I clearly depict the contribution of each of the factors towards the final value and we can see that the contribution of factors beyond Factor 10 is very low. Factor 1 – RBI influence and Core sector First factor signifies RBI’s influence and GDP related to the core sector on the market. It is very highly correlated to the money supply variables and variables related to the RBI’s balance sheet. It is also correlated to GDP in construction, manufacturing, agriculture and forestry. Variable Correlation Total bank investments at book value (investmentAtBookValue) 0.991 Money Supply, stock of legal currency in the economy (m3) 0.984
  • 12. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 12 Total currency with public (currencyWithPublic) 0.983 Construction GDP at factor cost, current prices (consCurrent) 0.983 Bank Credit in India (bankCredit) 0.981 Finance, Insurance, Realestate and Business services, GDP at factor cost, current prices (firebsCurrent) 0.981 Total time deposits with bank (timeDepositsWithBank) 0.977 Reserve Money Assets (reserveMoneyAssets) 0.977 Finance, Insurance, Realestate and Business services, GDP at factor cost, constant prices (firebsConstant) 0.972 Current account debit (curdebit) 0.961 Manufacturing, GDP at factor cost, current prices (manuCurrent) 0.961 Construction GDP at factor cost, constant prices (consConstant) 0.955 Total banking liabilities (totalBankingLiabilities) 0.955 Consumer price index (cpi) 0.954 Trade, hotel and Restaurant, Current prices (thrCurrent) 0.946 Total assets (issues) (totalIssuesAssets) 0.945 Electricity, Gas and Water services, GDP at factor cost (Egws) 0.938 Total domestic product (Tdp) 0.937 Maximum prime lending rate (maxPLR) -0.925 Total expenditure of RBI totalExpenditure 0.904 Mining and quarrying, GDP at factor cost, current prices (maqCurrent) 0.878 Surplus payable to central government from RBI(surplusToCentralGovernment) -0.875 Call money rate, Low (callMoneyLow) -0.855 Agriculture, Forestry and Fishing (Aff) 0.846 Monetory movements, debit (Monmovdebit) 0.824 Total debt in INR (totalINRdebt) 0.819 Cash with RBI (Cash) 0.813 Short term debt as percentage of total debt (shortTermDebtAsPercOfTotal) 0.577
  • 13. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 13 Factor 2 – Foreign Exchange and Crude The second factor primarily signifies impact of international events on markets. It correlated highly with crude prices and prices of USD. Variable Correlation USD rate 0.542 Crude price 0.555 Tourism, Hotels and Restaurants -0.569 Capital account credit 0.607 Bank rate 0.615 Capital account credit (RBI) 0.691 RBI reference rate -0.811 Factor 3 – Agriculture, Total Domestic Product Third factor has very high correlation with Agriculture, Forestry and Fishing. It also correlates well with total domestic product. Variable Correlation Agriculture, Forestry and Fishing, GDP at factor cost, Constant prices (affConstant) 0.596 Community social and personal services, GDP at factor cost, constant prices (cspsConstant) 0.595 Total domestic product, constant prices (tdpConstant) 0.577 Agriculture, Forestry and Fishing, GDP at factor cost, Current prices (affCurrent) 0.515 Community social and personal services, GDP at factor cost, current prices (cspsCurrent) 0.502 Concessional debt as a percentage of total debt. (concessionalDebtAsPercOfTotal) -0.498 Factor 4 – Company Financials Factor 4 seems to have very high correlation with the financials of the company. Variable Correlation Cash earnings per share (ceps) 0.903 Operating profit per share (opProfitPerShare) 0.878 Book value of the company (bookValue) 0.770 Free reserves with the company (freeReserves) 0.762 Net operating income per share (netOperatingIncomePerShare) 0.679
  • 14. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 14 Earnings per share (eps) 0.544 Dividend (div) 0.527 Factor 5 – Company Ratios Factor 5 correlates well with the financial ratios of the company. Variable Correlation Gross profit margin(gpm) 0.859 Operating profit margin (opm) 0.818 Current ratio (currentRatio) 0.712 Number of days of working capital (noOfDaysOfWorkingCapital) 0.649 Quick ratio (quickRatio) 0.552 Factor 6 – Agriculture, Community services, debt structure with RBI Variables Correlation Concessional debt as percentage of total (concessionalDebtAsPercOfTotal) 0.616 Agriculture, Forestry and Fishing, GDP factor cost, Current prices (affCurrent) 0.535 Assets with banking system (assetsWithBankingSystem) -0.528 Community social and personal services, GDP factor cost, Constant prices (cspsConstant) -0.452 Factor 7 – Company Capital structure, profitability ratios and other indicators Variable Correlation Share capital (shareCapital) 0.802 Total outstanding shares (outstandingShares) 0.786 Sales by total assets (salesByTotalAssets) 0.532 Return on net worth (ronw) -0.505 Sales by fixed assets (salesByFixedAssets) -0.443 Sales by current assets (salesByCurrentAssets) -0.300 Factor 8 – Banking system residuals Variables Correlation
  • 15. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 15 Monetary movement of credit (monmovcredit) 0.577 Banks liability to others (liabilitiesToOthers) 0.527 Banks liability to banking system (liabilitiesToBankingSystem) -0.423 Factor 9 – Company Liquidity Ratios Variable Correlation Debt to equity (debtToEquity) 0.863 Sales by fixed assets (salesByFixedAssets) 0.772 Quick Ratio (quickRatio) 0.644 Factor 10 – Company stock performance Variable Correlation Earning per share (eps) 0.649 Dividend paid (div) 0.444 Interest cover (interestCover) 0.422 Net operating income per share (netOperatingIncomePerShare) -0.373 Book value of the company (bookValue) -0.339 Factor 11 – RBI balance sheet debt structure and errors Variables Correlation Errors in credit (errcredit) -0.584 Error in debit (errdebit) 0.539 Concessional debt as percentage of total debt (concessionalDebtAsPercOfTotal) -0.448 IDBI lending rate (idbiRate) 0.395 Short term debt as percentage of total debt (shortTermDebtAsPercOfTotal) 0.276
  • 16. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 16 Factor 12 – RBI balance sheet errors Variables Correlation Error in debit (errdebit) -0.566 Error in credit (errcredit) 0.410 Banks liabilities to banking system (liabilitiesToBankingSystem) -0.292 Short term debt as percentage of total debt (shortTermDebtAsPercOfTotal) 0.289 Factor 13 – Company indicators (residuals) Variable Correlation Net profit margin (npm) -0.614 Company identification (companyId) -0.447 Number of days of working capital (noOfDaysOfWorkingCapital) 0.429 Current ratio of company (currentRatio) 0.402 Factor 14 – Banking system residuals Variable Correlation Forward Cash Spot (forwardCashSpot) 0.416 Assets with banking system (assetsWithBankingSystem) 0.401 Liabilities with banking system (liabilitiesToBankingSystem) 0.329 Factor 15 – Company financial ratios, Residuals
  • 17. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 17 Variables Correlation Sales by current assets (salesByCurrentAssets) 0.540 Return on net worth (ronw) 0.445 Sales by total assets (salesByTotalAssets) 0.249 Factor 16 – Foreign Exchange, Crude and interest rate, Residuals Variables Correlation Interest cover (interestCover) 0.300 IDBI lending rate (idbiRate) 0.257 Reference rate of RBI (referenceRate) 0.241 Price of crude (price) 0.235 Forward cash spot (forwardCashSpot) -0.227 Factor 17 – Company Financial Ratios, Residuals Variables Correlation Company identifier (companyId) 0.695 Net profit margin (npm) -0.369 Dividend paid (div) 0.236 Sales by current assets (salesByCurrentAssets) 0.201 Sales by total assets (salesByTotalAssets) -0.186 Debt to equity (debtToEquity) -0.133 Factor 18 – Company Financial Ratios, Residuals
  • 18. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 18 Variables Correlation interestCover 0.491 salesByTotalAssets 0.299 opProfitPerShare -0.240 eps -0.226 npm 0.199 Factor 19 – USD Forward Spot rate Variables Correlation Forward cash spot (forwardCashSpot) 0.489 Banks liabilities to others (liabilitiesToOthers) -0.465 Factor 20 – IDBI lending rate and crude prices Variables Correlation Banks liability to others (liabilitiesToOthers) -0.281 Electricity, Gas and Water services, GDP at factor cost, current prices (egwsCurrent) -0.275 IDBI lending rate (idbiRate) 0.252 Crude oil price (price) 0.218 Companies We would construct the models for majority of the companies in NSE-50 index. These companies are listed below. Reliance Industries TISCO SAIL IPCL State Bank of India ITC Tata Motors Maruti Udyog Satyam VSNL Infosys TCS
  • 19. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 19 ONGC Bharati L & T Zee HDFC Ranbaxy M & M BPCL ICICI Bank Hero Honda Glaxo Colgate National Aluminum Dabur SCI Tata Power Sun Pharma Tata Tea BHEL ABB Grasim Gujrat Ambuja Cement HCL Tech Tata Chemicals MTNL Oriental Bank Reliance Energy GAIL Wipro Punjab National Bank Bajaj Auto CIPLA Dr. Reddy ACC HDFC Bank Hindustan Petro Two companies have been omitted which are part of NSE-50 because enough data is not available for them.
  • 20. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 20 CCHHOOIICCEE OOFF NNEEUURRAALL NNEETTWWOORRKK Inputs and Outputs As shown in the Factor Analysis, the economic indicators for model related to the company have been factored into 20 factors that explain most of these numbers. Additional 3 inputs are company specific and are related to the past stock price data with respect to that company. • Previous Close • Previous Turn Over • Previous Quantity These make up for the 23 variables that are used as inputs for neural network. Three different neural networks are used for following three output variables • High • Low • Close Hidden Layers It is assumed given the richness of the data that at least 2 hidden layers would be required to for a meaningful neural network. The neural network will have 23 inputs and will have 1 output. Different neural networks would be created and a training run would be performed for a 1500 cycles of data set. At the end of sample run the best network would be chosen for further training. Neural networks that were evaluated are with • 1 input layer with 23 inputs • first hidden layer with nodes 31 to 351 • second hidden layer with nodes 8 to 31 • 1 output layer Joone[1] package was used to programmatically create multiple neural networks and measure their training and validation error.
  • 21. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 21 Figure II Training and validation errors for different NN architectures As see in Figure II, the neural network with hidden layer 1 of 130 nodes and hidden layer 2 of 17 nodes comes with best error values to be further used. This NN architecture was used to further train the network with following different data sets. Daily Prediction Fortnightly Prediction Six Monthly Prediction Open High Low Open High Low Open High Low Training Results Next Day Neural Network Following chart captures training and validation error for next day open, high and low prices prediction.
  • 22. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 22 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1C ycle 700 1500 2300 3100 3900 4700 5500 6300 7100 7900 8700 950010300111001190012700135001430015100159001670017500183001910019900207002150022300 Training Error Validation Error Figure III Training and Validation Error for Next Day Open Prediction 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 Cycles 700 1500 2300 3100 3900 4700 5500 6300 7100 7900 8700 9500 10300 11100 11900 12700 13500 14300 15100 15900 16700 17500 18300 19100 19900 20700 21500 22300 23100 23900 24700 Training Error Validation Error Figure IV Training and Validation Error for Next Day High
  • 23. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 23 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1C ycles 600 1300 2000 2700 3400 4100 4800 5500 6200 6900 7600 8300 9000 9700104001110011800125001320013900146001530016000167001740018100188001950020200 Training Error Validation Error Figure V Training and Validation Errors for next day low price prediction Next Fortnight Neural Network 0 0.01 0.02 0.03 0.04 0.05 0.06 Cycle 400 900 1400 1900 2400 2900 3400 3900 4400 4900 5400 5900 6400 6900 7400 7900 8400 8900 9400 99001040010900114001190012400129001340013900 Training Error Validation Error Figure VI Training and Validation Error for Next Fortnight Open Prediction
  • 24. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 24 0 0.01 0.02 0.03 0.04 0.05 0.06 Cycle 700 1500 2300 3100 3900 4700 5500 6300 7100 7900 8700 9500 10300 11100 11900 12700 13500 14300 15100 15900 16700 17500 18300 19100 19900 20700 21500 22300 23100 23900 24700 Training Error Validation Error Figure VII Training and Validation Error for Next Fortnight High Prediction 0 0.01 0.02 0.03 0.04 0.05 0.06 C ycles 300 700 1100 1500 1900 2300 2700 3100 3500 3900 4300 4700 5100 5500 5900 6300 6700 7100 7500 7900 8300 8700 9100 9500 Training Error Validation Error Figure VIII Training and Validation Error for Next Fortnight Low Prediction
  • 25. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 25 Six Month Neural Network 0 0.01 0.02 0.03 0.04 0.05 0.06 Cycles 800 1700 2600 3500 4400 5300 6200 7100 8000 8900 9800 10700 11600 12500 13400 14300 15200 16100 17000 17900 18800 19700 20600 21500 22400 23300 24200 25100 26000 26900 27800 Training Error Validation Error Figure IX Training and Validation Error for Six Month Later Open Price 0 0.01 0.02 0.03 0.04 0.05 0.06 Cycle 700 1500 2300 3100 3900 4700 5500 6300 7100 7900 8700 9500 10300 11100 11900 12700 13500 14300 15100 15900 16700 17500 18300 19100 19900 20700 21500 22300 23100 23900 24700 Training Error Validation Error Figure X Training and Validation Error for Six Month Later High Price
  • 26. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 26 0 0.01 0.02 0.03 0.04 0.05 0.06 Cycles 700 1500 2300 3100 3900 4700 5500 6300 7100 7900 8700 9500 10300 11100 11900 12700 13500 14300 15100 15900 16700 17500 18300 19100 19900 20700 21500 22300 23100 23900 24700 Training Error Validation Error Figure XI Training and Validation Error for Six Month Later Low Price
  • 27. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 27 NNEEUURRAALL NNEETTWWOORRKK PPRREEDDIICCTTIIOONN After training the neural networks based on above criteria, we have tried to predict the stock price based on the inputs provided. Following sections cover some of the results of the neural network training. Detailed results are in appendix. Next Day Prediction 0 200 400 600 800 1000 1200 1400 1600 08/08/2000 08/10/2000 08/12/2000 08/02/2001 08/04/2001 08/06/2001 08/08/2001 08/10/2001 08/12/2001 08/02/2002 08/04/2002 08/06/2002 08/08/2002 08/10/2002 08/12/2002 08/02/2003 08/04/2003 08/06/2003 08/08/2003 08/10/2003 08/12/2003 08/02/2004 ABB open ABB high ABB low ABB Predicted Open ABB Predicted High ABB Predicted Low ACC Open ACC High ACC Low ACC Predicted Open ACC Predicted High ACC Predicted Low BHEL Open BHEL High BHEL Low BHEL Predicted Open BHEL Predicted High BHEL Precited Low CIPLA Open CIPLA High CIPLA Low CIPLA Predicted Open CIPLA Predicted High CIPLA Predicted LOW GAIL Open GAIL High GAIL Low GAIL Predicted Open GAIL Predicted High GAIL Predicted LOW GRASIM Open GRASIM High GRASIM Low GRASIM Predicted Open GRASIM Predicted High GRASIM Predicted LOW HDFC Open HDFC High HDFC Low HDFC Predicted Open HDFC Predicted High HDFC Predicted LOW Figure XII Actual and predicted stock prices of select Nifty companies next day
  • 28. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 28 0 200 400 600 800 1000 1200 1400 08/08/2000 08/10/2000 08/12/2000 08/02/2001 08/04/2001 08/06/2001 08/08/2001 08/10/2001 08/12/2001 08/02/2002 08/04/2002 08/06/2002 08/08/2002 08/10/2002 08/12/2002 08/02/2003 08/04/2003 08/06/2003 08/08/2003 08/10/2003 08/12/2003 08/02/2004 IPCL Open IPCL High IPCL Low IPCL Predicted Open IPCL Predicted High IPCL Predicted Low ITC Open ITC High ITC Low ITC Predicted Open ITC Predicted High ITC Predicted Low MTNL Open MTNL High MTNL Low MTNL Predicted Open MTNL Predicted High MTNL Predicted Low ONGC Open ONGC High ONGC Low ONGC Predicted Open ONGC Predicted High ONGC Predicted Low SAIL Open SAIL High SAIL Low SAIL Predicted Open SAIL Predicted High SAIL Predicted Low SCI Open SCI High SCI Low SCI Predicted Open SCI Predicted High SCI Predicted Low Figure XIII Actual and predicted stock prices of select Nifty companies next day Next Fortnight Prediction 0 200 400 600 800 1000 1200 1400 1600 16/08/2000 16/10/2000 16/12/2000 16/02/2001 16/04/2001 16/06/2001 16/08/2001 16/10/2001 16/12/2001 16/02/2002 16/04/2002 16/06/2002 16/08/2002 16/10/2002 16/12/2002 16/02/2003 16/04/2003 16/06/2003 16/08/2003 16/10/2003 16/12/2003 16/02/2004 ABB Open ABB High ABB Low ABB Predicted Open ABB Predicted High ABB Predicted Low ACC Open ACC High ACC Low ACC Predicted Open ACC Predicted High ACC Predicted Low BAJAJ Open BAJAJ High BAJAJ Low BAJAJ Predicted Open BAJAJ Predicted High BAJAJ Predicted Low BHEL Open BHEL High BHEL Low BHEL Predicted Open BHEL Predicted High BHEL Predicted Low CIPLA Open CIPLA High CIPLA Low CIPLA Predicted Open CIPLA Predicted High CIPLA Predicted Low HDFC Open HDFC High HDFC Low HDFC Predicted Open HDFC Predicted High HDFC Predicted Low HERO HONDA Open HERO HONDA High HERO HONDA Low HERO HONDA Predicted Open HERO HONDA Predicted High HERO HONDA Predicted Low Figure XIV Actual and predicted stock prices of select Nifty companies after a fortnight
  • 29. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 29 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 16/08/2000 16/10/2000 16/12/2000 16/02/2001 16/04/2001 16/06/2001 16/08/2001 16/10/2001 16/12/2001 16/02/2002 16/04/2002 16/06/2002 16/08/2002 16/10/2002 16/12/2002 16/02/2003 16/04/2003 16/06/2003 16/08/2003 16/10/2003 16/12/2003 16/02/2004 ICICI Bank Open ICICI Bank High ICICI Bank Low ICICI Bank Predicted Open ICICI Bank Predicted High ICICI Bank Predicted Low Infosys Open Infosys High Infosys Low Infosys Predicted Open Infosys Predicted High Infosys Predicted Low IPCL Open IPCL High IPCL Low IPCL Predicted Open IPCL Predicted High IPCL Predicted Low ITC Open ITC High ITC Low ITC Predicted Open ITC Predicted High ITC Predicted Low Reliance Open Reliance High Reliance Low Reliance Predicted Open Reliance Predicted High Reliance Predicted Low Reliance Open Reliance High Reliance Low Reliance Predicted Open Reliance Predicted High Reliance Predicted Low Figure XV Actual and predicted stock prices of select Nifty companies after a fortnight Six Month prediction 200 300 400 500 600 700 800 08/08/2000 08/10/2000 08/12/2000 08/02/2001 08/04/2001 08/06/2001 08/08/2001 08/10/2001 08/12/2001 08/02/2002 08/04/2002 08/06/2002 08/08/2002 08/10/2002 08/12/2002 08/02/2003 08/04/2003 08/06/2003 08/08/2003 08/10/2003 08/12/2003 08/02/2004 ABB High ABB Predicted High Figure XVI Actual and predicted stock price after next six months for ABB
  • 30. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 30 0 200 400 600 800 1000 1200 1400 1600 1800 08/08/2000 08/10/2000 08/12/2000 08/02/2001 08/04/2001 08/06/2001 08/08/2001 08/10/2001 08/12/2001 08/02/2002 08/04/2002 08/06/2002 08/08/2002 08/10/2002 08/12/2002 08/02/2003 08/04/2003 08/06/2003 08/08/2003 08/10/2003 08/12/2003 08/02/2004 ABB Open ABB High ABB Low ABB Predicted Open ABB Predicted High ABB Predicted Low ACC Open ACC High ACC Low ACC Predicted Open ACC Predicted High ACC Predicted Low Bajaj Open Bajaj High Bajaj Low Bajaj Predicted Open Bajaj Predicted High Bajaj Predicted Low BHEL Open BHEL High BHEL Low BHEL Predicted Open BHEL Predicted High BHEL Predicted Low CIPLA Open CIPLA High CIPLA Low CIPLA Predicted Open CIPLA Predicted High CIPLA Predicted Low HDFC Open HDFC High HDFC Low HDFC Predicted Open HDFC Predicted High HDFC Predicted Low Hero Honda Open Hero Honda High Hero Honda Low Hero Honda Predicted Open Hero Honda Predicted High Hero Honda Predicted Low Figure XVII Actual and predicted stock price after six months for select Nifty companies 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 08/08/2000 08/10/2000 08/12/2000 08/02/2001 08/04/2001 08/06/2001 08/08/2001 08/10/2001 08/12/2001 08/02/2002 08/04/2002 08/06/2002 08/08/2002 08/10/2002 08/12/2002 08/02/2003 08/04/2003 08/06/2003 08/08/2003 08/10/2003 08/12/2003 08/02/2004 ICICI Bank Open ICICI Bank High ICICI Bank Low ICICI Bank Predicted Open ICICI Bank Predicted High ICICI Bank Predicted Low Infosys Open Infosys High Infosys Low Infosys Predicted Open Infosys Predicted High Infosys Predicted Low IPCL Open IPCL High IPCL Low IPCL Predicted Open IPCL Predicted High IPCL Predicted Low ITC Open ITC High ITC Low ITC Predicted Open ITC Predicted High ITC Predicted Low State Bank Open State Bank High State Bank Low State Bank Predicted Open State Bank Predicted High State Bank Predicted Low WIPRO Open WIPRO High WIPRO Low WIPRO Predicted Open WIPRO Predicted High WIPRO Predicted Low Figure XVIII Actual and predicted stock price after six months for select Nifty companies
  • 31. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 31 SSIIMMUULLAATTEEDD TTRRAADDIINNGG As we can see, neural networks are extremely good at tracking the trend but for specific values there is a margin of error. If we try to predict the stock price after a smaller duration, the margin of error could be very close of even more than expected profits in a particular stock. We see that six month prediction model is a good candidate for long term investors because there is a large opportunity to make profits and hence margin of error does not do too much damage. Please see Appendix C for the detailed data related to the simulated trading. We will follow some very basic rules to do the trade which are as follows. • We assume, we can buy a stock at a price closer to the closing price of the day before the six month duration • We will buy a single share of all the companies which will show a 10% return over a period of six month based on the predicted high price • At the end of six month period, the stock is sold at the high price of that day. As shown in Appendix C, following are the details of the trade. 17.64%157152.727,716.95/%Profit 157152.70-184869.65Profits 184,869.65monthssixofendat thepricesaleStock -/157,152.70.pricepurchaseStock == = = = Rs This simulated trade results in returns of 17.64% over a period of approximately 6 months. We could come up with more complicated trading methodologies which could get us better returns e.g. selling the stock earlier if the price exceeds our predicted stock price.
  • 32. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 32 CCOONNCCLLUUSSIIOONN This study concludes that there is merit to using neural networks in trying to understand and predict behavior of markets but with certain caution. Following are important points to be kept in mind if this model is used for investment decisions. • Model does not return profitable results in very short duration trades, the investor should have a investment horizon of more than 6 months for the model to work properly • Model does not guarantee that all the trades would be profitable but over all there is a better chance of profits • Stocks with less volatility perform better in model based prediction Further work This work could be further augmented with following additional items. • Look at higher duration (1 year and beyond ) models • Integrate different pieces of software produced to provide a product • Automate learning of neural networks when new macro economic data is available.
  • 33. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 33 AAppppeennddiixx AA FFAACCTTOORR AANNAALLYYSSIISS All the macro economic data and company financial information is captured by 96 variables which are put through a factor analysis which reduces it to 20 variables. Total Variance Explained Total Variance Explained Initial Eigenvalues Extraction Sums of Squared LoadingsComponent Total % of Variance Cumulative % Total % of Variance Cumulative % 1 48.290 50.302 50.302 48.290 50.302 50.302 2 6.825 7.109 57.411 6.825 7.109 57.411 3 5.012 5.221 62.633 5.012 5.221 62.633 4 4.691 4.887 67.519 4.691 4.887 67.519 5 3.976 4.142 71.661 3.976 4.142 71.661 6 2.638 2.747 74.409 2.638 2.747 74.409 7 2.576 2.683 77.092 2.576 2.683 77.092 8 2.356 2.455 79.547 2.356 2.455 79.547 9 2.339 2.437 81.983 2.339 2.437 81.983 10 1.825 1.901 83.885 1.825 1.901 83.885 11 1.752 1.825 85.710 1.752 1.825 85.710 12 1.512 1.575 87.284 1.512 1.575 87.284 13 1.356 1.412 88.697 1.356 1.412 88.697 14 1.091 1.136 89.833 1.091 1.136 89.833 15 0.969 1.009 90.842 0.969 1.009 90.842 16 0.962 1.003 91.845 0.962 1.003 91.845 17 0.861 0.897 92.742 0.861 0.897 92.742 18 0.739 0.770 93.512 0.739 0.770 93.512 19 0.684 0.712 94.224 0.684 0.712 94.224 20 0.633 0.659 94.883 0.633 0.659 94.883 21 0.605 0.630 95.513 22 0.544 0.567 96.080 23 0.445 0.464 96.543 24 0.433 0.451 96.994 25 0.357 0.372 97.366 26 0.326 0.340 97.705 27 0.296 0.308 98.014 28 0.287 0.299 98.313 29 0.188 0.196 98.509 30 0.186 0.194 98.703 31 0.170 0.177 98.879 32 0.151 0.157 99.037 33 0.120 0.125 99.162 34 0.107 0.111 99.273 35 0.104 0.108 99.381 36 0.094 0.098 99.479 37 0.072 0.075 99.554 38 0.067 0.070 99.625
  • 34. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 34 Total Variance Explained Initial Eigenvalues Extraction Sums of Squared LoadingsComponent Total % of Variance Cumulative % Total % of Variance Cumulative % 39 0.055 0.058 99.682 40 0.043 0.045 99.728 41 0.040 0.042 99.769 42 0.038 0.040 99.809 43 0.030 0.031 99.840 44 0.029 0.031 99.870 45 0.023 0.024 99.894 46 0.016 0.016 99.911 47 0.015 0.015 99.926 48 0.012 0.013 99.939 49 0.011 0.011 99.950 50 0.009 0.009 99.959 51 0.007 0.007 99.967 52 0.006 0.006 99.973 53 0.005 0.006 99.978 54 0.005 0.005 99.984 55 0.004 0.004 99.988 56 0.004 0.004 99.992 57 0.003 0.003 99.996 58 0.002 0.002 99.998 59 0.001 0.001 99.999 60 0.001 0.001 100.000 61 0.000 0.000 100.000 62 0.000 0.000 100.000 63 0.000 0.000 100.000 64 0.000 0.000 100.000 65 0.000 0.000 100.000 66 0.000 0.000 100.000 67 0.000 0.000 100.000 68 0.000 0.000 100.000 69 0.000 0.000 100.000 70 0.000 0.000 100.000 71 0.000 0.000 100.000 72 0.000 0.000 100.000 73 0.000 0.000 100.000 74 0.000 0.000 100.000 75 0.000 0.000 100.000 76 0.000 0.000 100.000 77 0.000 0.000 100.000 78 0.000 0.000 100.000 79 0.000 0.000 100.000 80 0.000 0.000 100.000 81 0.000 0.000 100.000 82 0.000 0.000 100.000 83 0.000 0.000 100.000 84 0.000 0.000 100.000
  • 35. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 35 Total Variance Explained Initial Eigenvalues Extraction Sums of Squared LoadingsComponent Total % of Variance Cumulative % Total % of Variance Cumulative % 85 0.000 0.000 100.000 86 0.000 0.000 100.000 87 0.000 0.000 100.000 88 0.000 0.000 100.000 89 0.000 0.000 100.000 90 0.000 0.000 100.000 91 0.000 0.000 100.000 92 0.000 0.000 100.000 93 0.000 0.000 100.000 94 0.000 0.000 100.000 95 0.000 0.000 100.000 96 0.000 0.000 100.000 Extraction Method: Principal Component Analysis.
  • 36. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 36 Component Matrix Component Matrix(a) Component 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 assetsWithBankingSystem 0.001 -0.517 0.036 -0.018 0.006 -0.528 0.076 -0.353 0.092 0.006 -0.032 -0.269 -0.015 0.401 -0.039 -0.081 0.007 -0.016 -0.050 -0.104 bankCredit 0.981 -0.124 -0.007 -0.015 -0.003 -0.019 0.007 0.072 -0.016 -0.012 -0.013 -0.044 0.008 0.058 0.019 0.034 0.011 -0.016 0.012 -0.002 cash 0.813 -0.056 -0.302 -0.026 -0.024 0.091 -0.014 -0.197 0.033 -0.032 0.078 0.197 0.023 -0.006 -0.097 -0.148 -0.030 0.049 0.002 0.038 investmentAtBookValue 0.991 -0.048 -0.052 -0.010 -0.008 0.005 0.004 0.050 -0.011 -0.010 0.002 -0.014 -0.011 -0.022 -0.022 -0.033 -0.006 0.008 0.001 0.021 liabilitiesToBankingSystem -0.455 0.012 -0.131 -0.032 -0.006 -0.526 0.080 -0.423 0.117 0.042 -0.087 -0.292 -0.043 0.329 -0.077 -0.161 -0.011 0.040 0.020 -0.140 liabilitiesToOthers -0.199 0.237 -0.259 -0.049 -0.012 0.106 -0.004 0.527 -0.112 -0.041 0.126 0.033 0.028 0.299 -0.091 -0.129 -0.013 -0.036 -0.465 -0.281 curcredit 0.942 0.136 0.112 0.001 0.001 -0.129 0.027 0.087 -0.005 0.058 -0.169 -0.069 -0.007 0.023 0.021 0.031 0.008 -0.008 0.023 -0.013 curdebit 0.961 0.130 -0.096 -0.033 -0.010 -0.101 0.025 0.056 -0.003 0.008 -0.054 -0.112 -0.002 0.070 0.017 0.036 0.009 -0.029 0.001 0.065 capcredit 0.737 0.607 -0.025 0.001 -0.009 0.208 -0.028 -0.126 0.023 -0.015 0.046 0.045 0.017 -0.010 -0.011 -0.008 -0.004 0.009 0.034 -0.013 capdebit 0.552 0.691 -0.029 -0.002 -0.012 0.235 -0.025 -0.074 0.023 0.053 -0.149 -0.116 -0.015 0.061 -0.019 -0.034 -0.007 0.000 0.034 0.095 errcredit 0.183 0.454 0.183 0.039 0.003 -0.287 0.047 -0.079 0.052 0.249 -0.584 0.410 0.070 -0.048 -0.018 -0.014 -0.012 -0.003 -0.064 0.082 errdebit -0.333 0.065 -0.097 -0.013 -0.005 0.302 -0.045 0.036 -0.033 -0.217 0.539 -0.566 -0.151 -0.150 -0.030 -0.074 -0.015 0.042 0.132 0.057 balcredit 0.905 0.394 0.053 0.002 -0.004 0.030 0.002 -0.018 0.010 0.029 -0.081 -0.008 0.006 0.007 0.006 0.013 0.002 0.000 0.029 -0.012 baldebit 0.824 0.476 -0.070 -0.019 -0.013 0.092 -0.002 -0.013 0.011 0.029 -0.102 -0.143 -0.014 0.068 -0.003 -0.003 0.001 -0.014 0.024 0.092 monmovcredit -0.331 0.360 -0.396 -0.074 -0.018 0.125 -0.002 0.577 -0.123 -0.051 0.134 0.000 0.023 0.093 0.008 0.042 0.009 -0.062 -0.141 0.074 monmovdebit 0.824 0.144 0.270 0.039 0.014 -0.098 0.010 -0.005 0.000 0.019 -0.016 0.260 0.044 -0.111 0.023 0.043 0.005 0.027 0.027 -0.211 callMoneyHigh -0.790 0.348 -0.107 -0.018 0.000 0.044 -0.004 0.229 -0.047 -0.010 0.082 0.096 0.037 0.198 -0.042 -0.066 -0.006 0.002 0.029 0.034 callMoneyLow -0.855 0.325 -0.054 -0.015 0.003 -0.003 0.003 0.192 -0.037 -0.005 0.056 0.027 0.026 0.122 0.007 0.015 0.006 -0.016 -0.026 -0.049 companyId -0.004 -0.001 -0.005 -0.011 0.121 0.060 0.294 0.031 0.227 0.012 0.021 0.098 -0.447 0.069 -0.183 0.156 0.695 0.191 -0.046 0.052 eps 0.168 -0.081 -0.130 0.544 0.203 0.029 -0.061 0.013 0.038 0.649 0.203 -0.051 0.058 -0.017 -0.093 0.013 -0.061 -0.226 0.027 -0.002 ceps 0.057 -0.030 -0.122 0.903 -0.252 0.019 0.120 0.013 0.026 0.165 0.056 -0.007 -0.034 0.008 0.017 -0.005 -0.047 -0.110 0.009 0.000 bookValue -0.047 0.040 -0.067 0.770 -0.458 -0.008 0.180 0.015 0.038 -0.339 -0.096 0.028 -0.074 0.027 0.011 0.044 -0.042 0.036 -0.001 -0.005 div 0.138 0.011 -0.123 0.527 -0.019 0.020 0.046 -0.017 -0.054 0.444 0.156 -0.009 0.049 -0.044 -0.116 -0.024 0.236 0.106 0.000 0.013 opProfitPerShare 0.059 -0.042 -0.130 0.878 -0.005 0.032 0.139 0.040 0.165 0.176 0.058 -0.016 0.003 -0.013 0.043 -0.080 0.022 -0.240 0.025 -0.006 netOperatingIncomePerShare -0.061 0.041 -0.046 0.679 -0.542 -0.013 0.133 0.030 0.109 -0.373 -0.104 0.034 -0.065 0.022 0.114 -0.025 -0.004 0.080 -0.011 0.002 freeReserves -0.049 0.042 -0.066 0.762 -0.453 -0.012 0.197 -0.008 -0.083 -0.328 -0.095 0.017 -0.027 0.026 0.045 0.033 -0.052 0.095 -0.009 -0.004 opm 0.082 0.015 -0.101 0.228 0.818 0.041 0.265 -0.025 -0.067 -0.035 -0.006 0.071 -0.271 0.030 0.166 -0.068 -0.029 -0.050 0.004 -0.013 gpm 0.090 0.014 -0.113 0.276 0.859 0.030 0.190 -0.009 -0.005 -0.031 -0.005 0.054 -0.198 0.022 0.176 -0.083 -0.020 -0.041 0.002 -0.006
  • 37. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 37 Component Matrix(a) Component 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 npm 0.136 0.043 -0.087 0.054 0.448 0.013 0.082 -0.053 -0.151 -0.030 0.005 0.156 -0.614 0.101 0.101 0.129 -0.369 0.199 -0.024 0.011 ronw 0.188 0.024 -0.133 0.241 0.282 -0.089 -0.505 -0.004 -0.060 0.256 0.108 0.006 -0.030 0.053 0.445 -0.142 0.078 0.072 -0.021 0.020 debtToEquity -0.008 -0.029 0.001 0.006 0.115 0.027 -0.114 0.175 0.863 -0.046 0.005 0.044 -0.196 0.019 -0.138 0.098 -0.133 -0.126 0.023 -0.014 currentRatio -0.091 0.029 -0.050 0.292 0.712 -0.003 0.152 -0.011 -0.096 -0.280 -0.105 -0.089 0.402 -0.052 -0.021 -0.049 0.090 0.106 -0.019 0.015 quickRation -0.057 0.010 -0.039 0.189 0.552 -0.012 -0.143 0.142 0.644 -0.228 -0.061 -0.038 0.171 -0.014 -0.105 0.064 -0.008 0.073 -0.002 -0.011 interestCover 0.106 -0.033 -0.097 0.389 0.089 -0.014 -0.043 -0.005 -0.118 0.422 0.149 -0.092 0.233 0.052 -0.162 0.300 -0.131 0.491 -0.048 -0.028 salesByTotalAssets 0.008 -0.092 0.055 -0.203 -0.099 0.091 0.532 0.060 0.210 0.117 0.049 -0.071 0.196 0.077 0.249 0.090 -0.186 0.299 -0.098 0.181 salesByFixedAssets 0.097 -0.023 -0.037 0.082 0.092 -0.040 -0.443 0.172 0.772 -0.029 0.005 -0.019 0.110 -0.009 -0.031 0.028 -0.093 0.100 -0.008 0.004 salesByCurrentAssets 0.087 0.024 -0.007 -0.093 -0.380 -0.034 -0.300 0.063 0.319 0.094 0.064 0.030 0.008 -0.008 0.540 -0.322 0.201 0.172 -0.036 0.002 noOfDaysOfWorkingCapital -0.035 0.025 -0.055 0.245 0.649 0.001 0.206 -0.018 -0.124 -0.313 -0.115 -0.085 0.429 -0.067 0.027 -0.129 0.128 -0.007 0.001 0.005 shareCapital -0.012 -0.018 0.064 -0.301 -0.133 0.149 0.802 0.040 0.284 0.196 0.092 0.007 0.071 -0.031 0.071 -0.094 -0.051 -0.075 0.034 -0.068 outstandingShares -0.004 -0.022 0.064 -0.329 -0.100 0.148 0.786 0.040 0.282 0.200 0.093 0.004 0.086 -0.031 0.100 -0.106 -0.026 -0.024 0.025 -0.063 cpi 0.954 -0.202 -0.062 -0.010 -0.008 0.100 -0.012 0.050 -0.019 -0.027 0.026 0.037 0.007 -0.055 0.006 0.022 0.002 -0.008 -0.002 0.027 br -0.705 0.615 -0.225 -0.039 -0.012 -0.096 0.023 -0.068 0.030 0.037 -0.070 -0.054 0.003 -0.004 0.028 0.054 0.006 -0.014 0.055 0.033 idbiRate -0.559 -0.082 -0.156 -0.036 0.003 -0.036 -0.007 -0.311 0.046 -0.139 0.395 0.272 0.141 0.110 0.109 0.257 0.039 -0.147 -0.055 0.252 maxCMR -0.741 0.186 0.010 0.005 0.006 0.081 -0.014 0.197 -0.044 -0.006 0.074 0.090 0.028 0.232 -0.060 -0.109 -0.010 0.025 0.115 0.047 maxPLR -0.925 0.070 -0.074 -0.017 0.005 0.013 -0.007 -0.023 0.000 -0.003 0.019 0.162 0.066 -0.020 0.096 0.167 0.029 -0.023 0.075 -0.109 minPLR -0.873 0.257 -0.032 -0.007 0.004 0.106 -0.016 0.049 -0.011 0.039 -0.099 0.093 0.039 -0.057 0.098 0.153 0.028 0.005 0.142 -0.168 price 0.401 0.555 -0.268 -0.087 -0.014 -0.288 0.065 0.120 0.002 0.050 -0.172 -0.202 0.041 0.204 0.123 0.235 0.048 -0.122 0.066 0.218 totalINRdebt 0.819 -0.336 -0.101 -0.033 -0.001 -0.057 0.003 -0.183 0.023 -0.097 0.215 0.130 0.074 0.026 0.075 0.154 0.027 -0.047 0.037 0.004 concessionalDebtAsPercOfTotal 0.046 0.058 -0.498 -0.070 -0.039 0.616 -0.070 0.154 -0.036 0.104 -0.448 -0.191 -0.006 0.059 0.071 0.108 0.026 -0.033 0.033 0.017 shortTermDebtAsPercOfTotal 0.577 0.305 -0.452 -0.076 -0.023 -0.259 0.043 -0.061 0.015 -0.083 0.276 0.289 0.087 0.092 -0.049 -0.021 -0.011 -0.052 -0.124 0.196 affConstant 0.177 0.311 0.596 0.104 0.029 0.503 -0.093 -0.393 0.061 -0.009 0.039 0.088 0.054 0.231 -0.025 -0.042 -0.002 -0.012 -0.074 0.006 affCurrent 0.318 0.251 0.515 0.091 0.024 0.535 -0.097 -0.408 0.060 -0.033 0.089 0.083 0.060 0.243 -0.021 -0.030 0.000 -0.021 -0.079 0.012 cspsConstant 0.480 0.169 0.595 0.071 0.039 -0.452 0.061 0.295 -0.050 -0.034 0.210 0.018 -0.033 -0.134 -0.021 -0.027 -0.013 -0.002 -0.033 0.096 cspsCurrent 0.675 0.126 0.502 0.059 0.031 -0.371 0.052 0.274 -0.047 -0.021 0.146 0.003 -0.032 -0.122 -0.020 -0.026 -0.012 -0.003 -0.031 0.097 consConstant 0.955 0.026 0.217 0.020 0.011 -0.061 0.009 0.099 -0.020 -0.002 0.012 0.070 0.028 0.071 0.007 0.017 0.006 -0.016 -0.032 -0.013 consCurrent 0.983 0.023 0.138 0.011 0.004 -0.041 0.008 0.078 -0.015 0.006 -0.023 0.014 0.008 0.036 -0.001 0.001 0.003 -0.005 -0.011 -0.006 egwsConstant 0.929 0.077 0.212 0.026 0.006 0.097 -0.010 0.130 -0.026 0.031 -0.118 -0.121 -0.035 -0.046 0.017 0.010 0.005 0.018 0.055 -0.071 egwsCurrent 0.838 0.245 0.074 -0.018 0.010 -0.007 -0.002 -0.002 -0.013 -0.099 0.240 0.041 0.055 0.012 0.112 0.187 0.040 -0.002 0.145 -0.275 firebsConstant 0.972 0.003 0.174 0.011 0.009 -0.088 0.014 0.089 -0.019 -0.020 0.047 -0.014 0.005 0.012 0.019 0.033 0.008 -0.005 0.024 -0.029 firebsCurrent 0.981 -0.088 0.105 0.005 0.002 -0.031 0.008 0.091 -0.017 0.005 -0.044 -0.063 -0.010 0.010 0.011 0.015 0.005 -0.005 0.013 -0.002
  • 38. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 38 Component Matrix(a) Component 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 manuConstant 0.929 0.113 0.281 0.028 0.013 -0.121 0.020 0.147 -0.025 0.001 0.013 -0.049 -0.014 -0.015 0.003 0.008 0.001 -0.011 -0.013 0.034 manuCurrent 0.961 0.115 0.173 0.016 0.005 -0.085 0.017 0.122 -0.019 0.011 -0.030 -0.071 -0.024 -0.025 -0.006 -0.012 -0.002 0.002 0.008 0.018 maqConstant 0.825 0.171 0.486 0.050 0.029 -0.024 0.000 0.137 -0.032 -0.029 0.091 -0.049 0.011 0.051 0.048 0.078 0.018 -0.023 0.013 -0.040 maqCurrent 0.878 0.039 0.290 0.010 0.018 -0.016 0.007 0.211 -0.042 0.009 -0.074 -0.163 0.007 0.100 0.096 0.151 0.036 -0.040 0.047 -0.076 tdpConstant 0.742 0.236 0.577 0.083 0.029 0.145 -0.032 -0.087 0.010 -0.016 0.077 0.028 0.019 0.097 -0.013 -0.019 -0.002 -0.011 -0.045 0.024 tdpCurrent 0.863 0.164 0.430 0.060 0.020 0.141 -0.027 -0.067 0.006 -0.017 0.055 -0.001 0.012 0.082 -0.009 -0.012 0.000 -0.011 -0.033 0.022 thrConstant 0.930 0.111 0.333 0.043 0.015 0.063 -0.011 0.024 -0.008 -0.011 0.030 -0.034 -0.003 0.031 -0.001 -0.002 0.001 -0.007 -0.012 0.011 thrCurrent 0.946 0.121 0.279 0.037 0.010 0.078 -0.012 0.002 -0.003 -0.005 0.008 -0.047 -0.010 0.021 -0.009 -0.016 -0.002 -0.001 -0.006 0.012 aff 0.846 -0.485 -0.121 -0.016 -0.013 0.094 -0.010 0.021 -0.009 0.006 -0.089 -0.033 -0.005 0.033 -0.012 -0.016 0.000 -0.016 -0.045 0.068 csps 0.946 -0.213 -0.221 -0.029 -0.018 0.052 -0.003 -0.011 -0.001 -0.010 -0.018 0.041 0.004 0.000 -0.027 -0.040 -0.006 0.011 -0.001 0.008 cons 0.950 -0.167 -0.233 -0.029 -0.019 0.049 -0.003 -0.019 0.001 -0.011 -0.008 0.056 0.002 -0.014 -0.037 -0.056 -0.009 0.019 0.004 0.001 egws 0.938 0.071 -0.295 -0.046 -0.020 -0.009 0.007 -0.030 0.004 -0.031 0.059 0.092 0.025 0.001 -0.010 -0.010 0.000 0.019 0.048 -0.063 firb 0.922 -0.316 -0.186 -0.023 -0.017 0.071 -0.006 -0.001 -0.004 -0.003 -0.046 0.016 -0.001 0.007 -0.026 -0.039 -0.006 0.003 -0.018 0.032 manuf 0.954 -0.125 -0.246 -0.032 -0.020 0.039 -0.001 -0.021 0.001 -0.015 0.004 0.063 0.006 -0.011 -0.032 -0.048 -0.008 0.019 0.012 -0.010 min 0.876 -0.288 -0.194 -0.062 -0.008 -0.010 0.008 0.048 -0.016 -0.035 -0.005 -0.054 0.061 0.167 0.111 0.199 0.046 -0.072 0.023 -0.033 tdp 0.937 -0.266 -0.205 -0.029 -0.017 0.056 -0.004 -0.002 -0.004 -0.009 -0.029 0.023 0.006 0.016 -0.016 -0.021 -0.002 0.001 -0.007 0.015 thr 0.749 -0.569 -0.080 -0.036 -0.004 0.055 -0.003 0.068 -0.020 -0.008 -0.089 -0.111 0.033 0.155 0.087 0.156 0.037 -0.078 -0.034 0.047 currencyWithPublic 0.983 -0.114 -0.038 -0.008 -0.007 0.018 0.001 0.034 -0.008 0.001 -0.035 0.001 -0.001 0.024 -0.018 -0.030 -0.003 0.006 -0.004 0.005 m3 0.984 -0.157 -0.031 -0.011 -0.006 0.013 0.002 0.046 -0.012 -0.009 -0.017 -0.029 -0.004 0.008 -0.001 -0.001 0.002 0.000 0.009 0.000 timeDepositsWithBank 0.977 -0.189 -0.029 -0.012 -0.005 0.012 0.002 0.051 -0.014 -0.017 -0.001 -0.025 0.001 0.003 0.011 0.022 0.006 -0.009 0.007 0.002 totalIncome -0.728 -0.460 0.342 0.070 0.016 0.110 -0.022 0.040 -0.008 0.061 -0.164 -0.130 -0.062 -0.038 -0.045 -0.087 -0.019 -0.011 -0.117 0.164 totalExpenditure 0.904 -0.211 -0.201 -0.003 -0.022 0.098 -0.012 -0.041 0.006 0.011 -0.041 0.082 -0.035 -0.100 -0.111 -0.186 -0.037 0.057 -0.026 0.047 netAvailableBalance -0.875 -0.255 0.326 0.052 0.020 0.043 -0.012 0.045 -0.008 0.041 -0.104 -0.126 -0.032 0.010 0.009 0.008 0.000 -0.030 -0.075 0.102 surplusToCentralGovernment -0.875 -0.255 0.326 0.052 0.020 0.043 -0.012 0.045 -0.008 0.041 -0.104 -0.126 -0.032 0.010 0.009 0.008 0.000 -0.030 -0.075 0.102 totalIssuesLiabilities 0.945 -0.224 -0.218 -0.030 -0.018 0.052 -0.003 -0.009 -0.002 -0.010 -0.020 0.037 0.005 0.005 -0.024 -0.034 -0.005 0.008 -0.002 0.008 totalIssuesAssets 0.945 -0.224 -0.218 -0.030 -0.018 0.052 -0.003 -0.009 -0.002 -0.010 -0.020 0.037 0.005 0.005 -0.024 -0.034 -0.005 0.008 -0.002 0.008 totalBankingLiabilities 0.955 -0.053 -0.267 -0.040 -0.019 0.017 0.003 -0.022 0.001 -0.023 0.027 0.070 0.017 0.003 -0.016 -0.020 -0.002 0.015 0.028 -0.034 totalBankingAssets 0.955 -0.053 -0.267 -0.040 -0.019 0.017 0.003 -0.022 0.001 -0.023 0.027 0.070 0.017 0.003 -0.016 -0.020 -0.002 0.015 0.028 -0.034 reserveMoneyLiabilities 0.977 -0.086 -0.062 -0.011 -0.009 0.010 0.003 0.027 -0.005 0.005 -0.044 -0.005 -0.005 0.034 -0.028 -0.050 -0.005 0.018 0.030 0.004 reserveMoneyAssets 0.977 -0.086 -0.062 -0.011 -0.009 0.010 0.003 0.027 -0.005 0.005 -0.044 -0.005 -0.005 0.034 -0.028 -0.050 -0.005 0.018 0.030 0.004 forwardCashSpot -0.329 -0.215 0.145 0.022 0.015 0.021 -0.008 0.388 -0.088 -0.002 0.052 0.220 0.055 0.416 -0.123 -0.227 -0.018 0.093 0.489 0.110 forwardCashOneMonth -0.743 -0.432 0.150 0.030 0.016 0.051 -0.016 0.271 -0.064 0.026 -0.048 0.204 0.033 0.066 -0.015 -0.041 -0.002 0.023 0.044 -0.005
  • 39. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 39 Component Matrix(a) Component 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 forwardCashThreeMonth -0.786 -0.461 0.195 0.036 0.018 0.092 -0.024 0.174 -0.046 0.024 -0.056 0.146 0.026 0.035 0.010 0.000 0.004 0.012 0.036 0.003 forwardCashSixMonth -0.806 -0.470 0.217 0.038 0.019 0.112 -0.027 0.113 -0.033 0.022 -0.064 0.082 0.017 0.029 0.023 0.020 0.008 0.005 0.024 -0.012 referenceRate -0.319 -0.811 0.270 0.022 0.026 0.089 -0.026 0.028 -0.024 -0.021 -0.015 0.076 0.076 0.107 0.142 0.241 0.051 -0.079 -0.013 -0.057 rate -0.799 0.542 -0.130 -0.026 -0.004 -0.114 0.021 -0.096 0.033 0.026 -0.034 -0.060 0.005 0.039 0.028 0.043 0.008 -0.001 0.054 -0.057 Extraction Method: Principal Component Analysis. a. 20 components extracted.
  • 40. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 40 AAppppeennddiixx BB NNEEUURRAALL NNEETT GGEENNEERRAATTOORR Source for NeuralNetScreener /* * NeuralNetScreener.java * * Created on October 12, 2005, 8:46 PM * */ package com.avasthi.stockneuralnetgenerator; import java.text.SimpleDateFormat; import java.util.*; import java.io.*; import javax.print.attribute.standard.Finishings; import org.joone.engine.*; import org.joone.engine.learning.*; import org.joone.net.*; import org.joone.util.DynamicAnnealing; import org.joone.io.*; import org.joone.util.*; import org.joone.engine.weights.*; /** * * @author binny */ public class NeuralNetScreener implements org.joone.engine.NeuralNetListener, org.joone.net.NeuralValidationListener{ String baseFolder_; int trainingDataPoints_; int validationDataPoints_; String trainingFile_; String validationFile_; int trainingStart_; int validationStart_; int testingStart_; String inputColumnSelector_; String outputColumnSelector_; org.joone.net.NeuralNet net_; int inputSize_; int hidden1Size_; int hidden2Size_; int outputSize_; String filename_; PrintStream pStrm_;
  • 41. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 41 ObjectOutputStream nnStrm_; int totCicles_; /** Creates a new instance of NeuralNetScreener */ public NeuralNetScreener(String baseFolder, String trainingFile, String validationFile, int trainingDataPoints, int validationDataPoints, int inputSize, int hidden1Size, int hidden2Size, int outputSize, int totCicles) { totCicles_ = totCicles; baseFolder_ = baseFolder; trainingFile_ = trainingFile; validationFile_ = validationFile; trainingDataPoints_ = trainingDataPoints; validationDataPoints_ = validationDataPoints; inputColumnSelector_ = new String("1-23"); outputColumnSelector_ = new String("24-30"); net_ = new org.joone.net.NeuralNet(); inputSize_ = inputSize; hidden1Size_ = hidden1Size; hidden2Size_ = hidden2Size; outputSize_ = outputSize; String filename = baseFolder + "/stockPrediction." + inputSize_ + "." + hidden1Size_ + "." + hidden2Size_ + "." +outputSize_; System.out.println("File name :" + filename); try { filename_ = filename; FileOutputStream fos = new FileOutputStream(filename + ".txt"); pStrm_ = new PrintStream(fos); FileOutputStream stream = new FileOutputStream(filename + ".ser"); nnStrm_ = new ObjectOutputStream(stream); } catch (Exception ex) { System.out.println("File count not be opened " + filename); pStrm_ = System.out; } } /** * used to build a network */ public void buildNetwork(boolean singleOutput, String outputColumn) { // build the input, hidden and output layer LinearLayer input = new LinearLayer(); SigmoidLayer hidden1 = new SigmoidLayer(); SigmoidLayer hidden2 = new SigmoidLayer(); SigmoidLayer output = new SigmoidLayer();
  • 42. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 42 input.setLayerName("input"); hidden1.setLayerName("hidden1"); hidden2.setLayerName("hidden2"); output.setLayerName("output"); input.setRows(inputSize_); hidden1.setRows(hidden1Size_); hidden2.setRows(hidden2Size_); if (singleOutput) { output.setRows(1); } else { output.setRows(outputSize_); } // add the layers to the net. net_.addLayer(input, NeuralNet.INPUT_LAYER); net_.addLayer(hidden1, NeuralNet.HIDDEN_LAYER); net_.addLayer(hidden2, NeuralNet.HIDDEN_LAYER); net_.addLayer(output, NeuralNet.OUTPUT_LAYER); // creating the synapses to link the layers FullSynapse inputHiddenSynapse = new FullSynapse(); // In -> Hid FullSynapse hiddenHiddenSynapse = new FullSynapse(); // Hid -> Hid FullSynapse hiddenOutputSynapse = new FullSynapse(); // Hid -> Out inputHiddenSynapse.setName("InputHidden"); hiddenHiddenSynapse.setName("HiddenHidden"); hiddenOutputSynapse.setName("HiddenOutput"); // wire them input.addOutputSynapse(inputHiddenSynapse); hidden1.addInputSynapse(inputHiddenSynapse); hidden1.addOutputSynapse(hiddenHiddenSynapse); hidden2.addInputSynapse(hiddenHiddenSynapse); hidden2.addOutputSynapse(hiddenOutputSynapse); output.addInputSynapse(hiddenOutputSynapse); // add the monitor. Monitor monitor = new Monitor(); monitor.getLearners().add(0, new String("org.joone.engine.BasicLearner")); monitor.setLearningMode(0); monitor.setUseRMSE(true); // adding the monitor to the layers. input.setMonitor(monitor); hidden1.setMonitor(monitor);
  • 43. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 43 hidden2.setMonitor(monitor); output.setMonitor(monitor); net_.setMonitor(monitor); FileInputSynapse trainingInputData = new FileInputSynapse(); trainingInputData.setFileName(trainingFile_); /* The output values are on the third column of the file */ trainingInputData.setAdvancedColumnSelector(inputColumnSelector_); trainingInputData.setFirstRow(1); FileInputSynapse validationInputData = new FileInputSynapse(); validationInputData.setFileName(validationFile_); /* The output values are on the third column of the file */ validationInputData.setAdvancedColumnSelector(inputColumnSelector_); validationInputData.setFirstRow(1); LearningSwitch ils = new LearningSwitch(); ils.addTrainingSet(trainingInputData); ils.addValidationSet(validationInputData); input.addInputSynapse(ils); monitor.setLearningRate(0.8); monitor.setMomentum(0.3); monitor.addNeuralNetListener(this); /* Setting of the file containing the desired responses, provided by a FileInputSynapse */ FileInputSynapse trainingOutputData = new FileInputSynapse(); trainingOutputData.setFileName(trainingFile_); /* The output values are on the third column of the file */ if (singleOutput) { trainingOutputData.setAdvancedColumnSelector(outputColumn); } else { trainingOutputData.setAdvancedColumnSelector(outputColumnSelector_); } trainingOutputData.setFirstRow(1); FileInputSynapse validationOutputData = new FileInputSynapse(); validationOutputData.setFileName(validationFile_); /* The output values are on the third column of the file */ if (singleOutput) { validationOutputData.setAdvancedColumnSelector(outputColumn); } else { validationOutputData.setAdvancedColumnSelector(outputColumnSelector_);
  • 44. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 44 } validationOutputData.setFirstRow(1); LearningSwitch ols = new LearningSwitch(); ols.addTrainingSet(trainingOutputData); ols.addValidationSet(validationOutputData); TeachingSynapse trainer = new TeachingSynapse(); /* We give it the monitor's reference */ trainer.setDesired(ols); trainer.setMonitor(monitor); output.addOutputSynapse(trainer); monitor.setTrainingPatterns(trainingDataPoints_); /* # of rows contained in the input file */ monitor.setTotCicles(totCicles_); /* How many times the net must be trained on the input patterns */ monitor.setLearning(true); /* The net must be trained */ input.start(); hidden1.start(); hidden2.start(); output.start(); monitor.Go(); /* The net starts the training job */ net_.join(); } public void saveNetwork(int kount) { try { FileOutputStream stream = new FileOutputStream(filename_ + "-"+ kount + ".ser"); ObjectOutputStream nnStrm = new ObjectOutputStream(stream); nnStrm.writeObject(net_); } catch (Exception ex) { System.out.println("Count not save neural network "); } } public static NeuralNet restoreNeuralNet(String fileName) { NeuralNet nnet = null; try { FileInputStream stream = new FileInputStream(fileName); ObjectInputStream inp = new ObjectInputStream(stream); nnet = (NeuralNet)inp.readObject(); } catch (Exception excp) { excp.printStackTrace(); } return nnet; }
  • 45. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 45 public static void loadAndTestData(String nnFile, String inputFile, int inputDataSize, String outputFile) { try { NeuralNet net = restoreNeuralNet(nnFile); Layer input = net.getInputLayer(); input.removeAllInputs(); org.joone.io.FileInputSynapse inp = new org.joone.io.FileInputSynapse(); inp.setFileName(inputFile); inp.setAdvancedColumnSelector("1-23"); inp.setFirstRow(1); input.addInputSynapse(inp); Layer output = net.getOutputLayer(); output.removeAllOutputs(); org.joone.io.FileOutputSynapse out = new org.joone.io.FileOutputSynapse(); out.setFileName(outputFile); output.addOutputSynapse(out); net.getMonitor().setTotCicles(1); net.getMonitor().setTrainingPatterns(inputDataSize); net.getMonitor().setLearning(false); net.start(); net.getMonitor().Go(); } catch (Exception ex) { System.out.println("Count not load neural network "); } } public void netStarted(NeuralNetEvent ev) { System.out.println("Net Started " +ev.toString()); } public void netStopped(NeuralNetEvent ev) { System.out.println("Net Stopped "+ev.toString()); } public void netStoppedError(NeuralNetEvent ev, String str) { System.out.println("Net Stopped Error "+ev.toString() + str); } public void errorChanged(NeuralNetEvent ev) { } /* Validation Event */ public void netValidated(NeuralValidationEvent event) { // Shows the RMSE at the end of the cycle NeuralNet NN = (NeuralNet)event.getSource(); pStrm_.println(",Validation Error,"+NN.getMonitor().getGlobalError()); } public void cicleTerminated(NeuralNetEvent ev) { Monitor mon = (Monitor)ev.getSource();
  • 46. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 46 // Prints out the current epoch and the training error int cycle = mon.getCurrentCicle()+1; if (cycle % 100 == 0) { // We validate the net every 100 cycles String msg = new String("Epoch #"+(mon.getTotCicles() - cycle)); msg += ",Training Error,"+mon.getGlobalError(); // Creates a copy of the neural network net_.getMonitor().setExporting(true); NeuralNet newNet = net_.cloneNet(); net_.getMonitor().setExporting(false); // Cleans the old listeners // This is a fundamental action to avoid that the validating net // calls the cicleTerminated method of this class newNet.removeAllListeners(); // Set all the parameters for the validation NeuralNetValidator nnv = new NeuralNetValidator(newNet); nnv.addValidationListener(this); newNet.getMonitor().setValidation(true); newNet.getMonitor().setValidationPatterns(validationDataPoints_); nnv.start(); // Validates the Monitor m = (Monitor) (ev.getSource()); pStrm_.print("Cicle Terminated " + msg); if (cycle % 1000 == 0) { saveNetwork(cycle); } } } } Source for StockMarketNeuralNetCreator /* * StockMarketPredictorGenerator.java * * Created on October 12, 2005, 8:44 PM */ package com.avasthi.stockneuralnetgenerator; /** * * @author binny */ public class StockMarketNeuralNetCreator { /** * @param args the command line arguments */ public static void main(String[] args) { int inputs = 23; int outputs = 7; int trainingDataPoints = Integer.parseInt(args[3]);
  • 47. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 47 int validationDataPoints = Integer.parseInt(args[4]); int layer1 = Integer.parseInt(args[5]); int layer2 = Integer.parseInt(args[6]); int totCicles = 1500; if (args.length >= 9) { totCicles = Integer.parseInt(args[8]); } try { System.out.println("Trying neural network with hidden layers "+layer1 +","+layer2); NeuralNetScreener nns = new NeuralNetScreener(args[0], args[1], args[2], trainingDataPoints, validationDataPoints, inputs, layer1, layer2, outputs, totCicles); System.out.println("Base Directory" + args[0] + " Data File " + args[1] + " Number of Items " + args[2]); nns.buildNetwork(true, args[7]); } catch(Exception ex) { System.out.println(ex.toString()); } } }
  • 48. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 48 AAppppeennddiixx CC SSIIMMUULLAATTEEDD TTRRAADDEE SSHHEEEETT Company Six Month Previous Close Actual High Predicted High Number of stocks Money Spent Money Earned ABB 224.15 233.40 249.07 1 224.15 233.40 ABB 223.30 229.80 247.68 1 223.30 229.80 ABB 214.50 239.00 236.20 1 214.50 239.00 ABB 203.75 275.00 241.43 1 203.75 275.00 ABB 217.35 274.00 257.51 1 217.35 274.00 ABB 218.90 279.00 258.14 1 218.90 279.00 ABB 214.70 268.70 253.57 1 214.70 268.70 ABB 215.95 277.50 255.08 1 215.95 277.50 ACC 88.10 146.80 122.96 1 88.10 146.80 ACC 91.20 147.70 126.54 1 91.20 147.70 ACC 92.75 151.35 127.45 1 92.75 151.35 ACC 92.55 158.00 127.26 1 92.55 158.00 ACC 93.10 157.25 128.70 1 93.10 157.25 Bajaj Auto 345.05 273.90 414.69 1 345.05 273.90 Bajaj Auto 333.55 253.40 384.60 1 333.55 253.40 Bajaj Auto 332.85 255.00 381.82 1 332.85 255.00 Bajaj Auto 333.95 253.95 382.65 1 333.95 253.95 Bajaj Auto 299.95 262.45 340.25 1 299.95 262.45 Bajaj Auto 268.15 263.00 311.37 1 268.15 263.00 Bajaj Auto 278.85 263.95 315.82 1 278.85 263.95 Bajaj Auto 266.80 265.35 306.29 1 266.80 265.35 Bajaj Auto 262.70 277.00 302.86 1 262.70 277.00 BHEL 100.15 144.65 133.46 1 100.15 144.65 BHEL 103.25 143.90 136.66 1 103.25 143.90 BHEL 103.90 149.00 136.00 1 103.90 149.00 BHEL 106.20 147.90 139.92 1 106.20 147.90 BHEL 102.70 153.90 136.66 1 102.70 153.90 CIPLA 707.75 835.00 829.90 1 707.75 835.00 CIPLA 713.20 856.00 815.00 1 713.20 856.00 CIPLA 719.90 828.00 795.56 1 719.90 828.00 CIPLA 726.15 819.00 838.63 1 726.15 819.00 CIPLA 685.05 940.00 785.45 1 685.05 940.00 CIPLA 681.35 935.00 769.63 1 681.35 935.00 Colgate 149.35 175.00 185.11 1 149.35 175.00 Colgate 151.20 174.90 187.13 1 151.20 174.90 Colgate 155.20 175.80 191.40 1 155.20 175.80 Colgate 153.80 176.80 189.79 1 153.80 176.80 Colgate 148.15 179.50 183.55 1 148.15 179.50 Dr. Reddy 1,151.05 1,438.00 1,285.06 1 1,151.05 1,438.00 Dr. Reddy 1,324.35 1,364.00 1,470.96 1 1,324.35 1,364.00 Dr. Reddy 1,307.95 1,384.00 1,445.69 1 1,307.95 1,384.00 Dr. Reddy 1,319.60 1,338.00 1,467.00 1 1,319.60 1,338.00 Dr. Reddy 1,273.40 1,425.00 1,410.40 1 1,273.40 1,425.00 Dr. Reddy 1,235.20 1,467.35 1,530.84 1 1,235.20 1,467.35 Dr. Reddy 1,250.15 1,459.70 1,557.52 1 1,250.15 1,459.70 Dr. Reddy 1,248.05 1,559.90 1,552.79 1 1,248.05 1,559.90
  • 49. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 49 Dr. Reddy 1,251.10 1,595.00 1,558.54 1 1,251.10 1,595.00 Glaxo 421.00 497.95 464.21 1 421.00 497.95 Glaxo 426.10 470.00 485.66 1 426.10 470.00 Glaxo 436.45 488.90 499.66 1 436.45 488.90 Glaxo 467.40 490.00 566.24 1 467.40 490.00 Glaxo 465.45 487.70 536.36 1 465.45 487.70 Glaxo 479.20 483.00 565.76 1 479.20 483.00 Glaxo 443.25 425.90 523.54 1 443.25 425.90 Glaxo 445.40 416.00 522.84 1 445.40 416.00 Glaxo 450.05 442.00 528.75 1 450.05 442.00 Glaxo 446.75 432.00 524.57 1 446.75 432.00 Glaxo 409.70 461.00 454.13 1 409.70 461.00 GRASIM 216.30 237.00 238.87 1 216.30 237.00 GRASIM 214.55 218.90 236.03 1 214.55 218.90 GRASIM 197.90 273.85 234.42 1 197.90 273.85 GRASIM 202.60 276.00 236.84 1 202.60 276.00 GRASIM 202.30 289.90 234.52 1 202.30 289.90 GRASIM 202.55 268.80 234.92 1 202.55 268.80 GRASIM 204.00 274.00 237.17 1 204.00 274.00 Gujrat Ambuja 128.90 156.10 161.34 1 128.90 156.10 Gujrat Ambuja 132.00 156.45 165.81 1 132.00 156.45 Gujrat Ambuja 136.15 156.75 168.20 1 136.15 156.75 Gujrat Ambuja 130.40 154.90 163.48 1 130.40 154.90 Gujrat Ambuja 133.50 161.45 166.24 1 133.50 161.45 HCL Tech 1,069.90 1,414.00 1,204.31 1 1,069.90 1,414.00 HCL Tech 1,008.15 1,330.00 1,122.29 1 1,008.15 1,330.00 HCL Tech 1,205.10 1,039.00 1,383.05 1 1,205.10 1,039.00 HCL Tech 1,276.20 1,025.00 1,448.52 1 1,276.20 1,025.00 HCL Tech 1,300.35 969.95 1,470.81 1 1,300.35 969.95 HCL Tech 1,072.25 1,240.00 1,192.05 1 1,072.25 1,240.00 HCL Tech 1,031.45 1,233.00 1,157.64 1 1,031.45 1,233.00 HCL Tech 1,072.25 1,239.00 1,302.00 1 1,072.25 1,239.00 HCL Tech 1,110.75 1,273.80 1,316.36 1 1,110.75 1,273.80 HCL Tech 1,149.65 1,274.00 1,403.14 1 1,149.65 1,274.00 HDFC 551.55 509.00 619.13 1 551.55 509.00 HDFC 498.40 548.00 556.63 1 498.40 548.00 HDFC 499.75 541.90 549.77 1 499.75 541.90 HDFC 505.90 540.00 568.14 1 505.90 540.00 HDFC 445.15 496.00 545.60 1 445.15 496.00 HDFC 426.55 489.90 530.12 1 426.55 489.90 HDFC 441.05 500.00 543.99 1 441.05 500.00 HDFC 437.85 489.75 534.10 1 437.85 489.75 HDFC 457.35 525.00 536.29 1 457.35 525.00 HDFC 462.20 528.00 541.49 1 462.20 528.00 HDFC 461.30 533.05 535.51 1 461.30 533.05 HDFC 464.10 545.00 538.17 1 464.10 545.00 HDFC 470.25 557.90 546.57 1 470.25 557.90 HDFC Bank 222.35 253.00 248.68 1 222.35 253.00 HDFC Bank 226.65 249.90 253.80 1 226.65 249.90 HDFC Bank 223.90 249.95 251.66 1 223.90 249.95 HDFC Bank 234.25 245.80 267.26 1 234.25 245.80
  • 50. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 50 HDFC Bank 243.25 218.90 289.33 1 243.25 218.90 HDFC Bank 241.40 217.90 285.39 1 241.40 217.90 HDFC Bank 241.35 229.90 283.80 1 241.35 229.90 HDFC Bank 240.00 220.00 282.40 1 240.00 220.00 HDFC Bank 250.55 224.60 299.14 1 250.55 224.60 Hind Petro 123.95 123.00 138.84 1 123.95 123.00 Hind Petro 122.70 124.65 137.63 1 122.70 124.65 Hind Petro 122.50 119.90 135.48 1 122.50 119.90 Hind Petro 108.90 125.85 120.10 1 108.90 125.85 Hind Petro 100.05 129.50 137.14 1 100.05 129.50 Hind Petro 103.05 132.65 139.56 1 103.05 132.65 Hind Petro 103.70 139.40 138.28 1 103.70 139.40 Hind Petro 101.50 142.20 136.97 1 101.50 142.20 Hind Petro 106.55 144.85 142.08 1 106.55 144.85 ICICI Bank 109.20 146.30 139.94 1 109.20 146.30 ICICI Bank 117.30 146.50 148.02 1 117.30 146.50 ICICI Bank 118.55 156.00 148.70 1 118.55 156.00 ICICI Bank 115.00 156.25 145.32 1 115.00 156.25 ICICI Bank 109.35 182.00 139.84 1 109.35 182.00 Infosys 7,118.45 8,649.00 8,607.01 1 7,118.45 8,649.00 Infosys 6,656.10 8,469.00 8,653.59 1 6,656.10 8,469.00 Infosys 6,787.20 8,448.00 8,663.92 1 6,787.20 8,448.00 Infosys 6,845.30 8,639.00 8,643.36 1 6,845.30 8,639.00 Infosys 6,761.25 8,825.00 8,371.08 1 6,761.25 8,825.00 Infosys 7,247.80 7,655.00 8,044.18 1 7,247.80 7,655.00 IPCL 63.55 53.95 80.66 1 63.55 53.95 IPCL 63.50 54.25 80.59 1 63.50 54.25 IPCL 61.45 53.50 79.16 1 61.45 53.50 IPCL 57.45 63.30 67.36 1 57.45 63.30 IPCL 56.50 62.50 66.81 1 56.50 62.50 IPCL 56.85 63.70 67.09 1 56.85 63.70 IPCL 55.90 62.35 66.49 1 55.90 62.35 IPCL 55.65 63.85 61.83 1 55.65 63.85 IPCL 53.50 55.95 66.03 1 53.50 55.95 IPCL 56.10 56.00 67.79 1 56.10 56.00 IPCL 54.90 59.90 67.00 1 54.90 59.90 IPCL 54.95 60.50 67.04 1 54.95 60.50 IPCL 45.65 63.25 86.12 1 45.65 63.25 IPCL 49.90 65.70 89.51 1 49.90 65.70 IPCL 50.70 68.90 89.79 1 50.70 68.90 IPCL 50.05 68.00 89.25 1 50.05 68.00 IPCL 49.15 73.50 88.57 1 49.15 73.50 ITC 754.40 785.00 834.70 1 754.40 785.00 ITC 732.15 775.70 916.23 1 732.15 775.70 ITC 736.65 774.90 896.74 1 736.65 774.90 ITC 741.95 766.85 945.87 1 741.95 766.85 ITC 767.00 744.50 896.78 1 767.00 744.50 ITC 759.25 733.00 875.20 1 759.25 733.00 ITC 775.95 729.00 900.83 1 775.95 729.00 ITC 731.00 816.00 860.57 1 731.00 816.00 ITC 733.30 818.80 866.61 1 733.30 818.80
  • 51. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 51 ITC 709.70 823.00 824.94 1 709.70 823.00 ITC 713.20 801.25 850.66 1 713.20 801.25 M & M 134.85 148.90 166.19 1 134.85 148.90 M & M 140.85 151.05 172.69 1 140.85 151.05 M & M 130.30 155.00 161.64 1 130.30 155.00 M & M 132.55 157.50 163.66 1 132.55 157.50 M & M 128.95 165.70 160.17 1 128.95 165.70 MTNL 139.90 171.80 177.23 1 139.90 171.80 MTNL 138.70 169.80 174.50 1 138.70 169.80 MTNL 138.45 170.90 170.96 1 138.45 170.90 MTNL 137.00 169.50 171.61 1 137.00 169.50 MTNL 140.25 184.30 176.46 1 140.25 184.30 National Aluminium 52.95 47.00 71.42 1 52.95 47.00 National Aluminium 52.20 47.50 70.90 1 52.20 47.50 National Aluminium 52.80 47.20 71.32 1 52.80 47.20 National Aluminium 48.95 44.00 60.08 1 48.95 44.00 National Aluminium 49.60 45.90 60.50 1 49.60 45.90 National Aluminium 49.75 47.00 60.59 1 49.75 47.00 National Aluminium 49.20 48.35 60.27 1 49.20 48.35 National Aluminium 48.40 48.00 55.44 1 48.40 48.00 National Aluminium 43.30 42.25 47.68 1 43.30 42.25 National Aluminium 42.70 42.75 47.38 1 42.70 42.75 National Aluminium 42.20 42.45 47.09 1 42.20 42.45 National Aluminium 41.25 42.50 46.41 1 41.25 42.50 National Aluminium 40.60 42.90 46.19 1 40.60 42.90 National Aluminium 41.55 43.50 55.94 1 41.55 43.50 National Aluminium 42.95 43.45 56.80 1 42.95 43.45 National Aluminium 42.50 45.00 56.55 1 42.50 45.00 National Aluminium 42.20 44.75 56.36 1 42.20 44.75 National Aluminium 39.65 44.65 79.58 1 39.65 44.65 National Aluminium 41.00 44.85 80.55 1 41.00 44.85 National Aluminium 41.05 45.90 80.56 1 41.05 45.90 National Aluminium 40.95 44.65 80.50 1 40.95 44.65
  • 52. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 52 National Aluminium 40.10 48.20 79.80 1 40.10 48.20 ONGC 99.80 121.60 132.34 1 99.80 121.60 ONGC 103.40 127.60 135.69 1 103.40 127.60 ONGC 106.75 135.00 138.80 1 106.75 135.00 ONGC 104.40 125.60 136.64 1 104.40 125.60 ONGC 104.40 126.50 136.46 1 104.40 126.50 Oriental Bank 33.70 31.50 60.82 1 33.70 31.50 Oriental Bank 33.75 31.65 60.81 1 33.75 31.65 Oriental Bank 33.35 31.65 60.60 1 33.35 31.65 Oriental Bank 32.25 31.95 51.92 1 32.25 31.95 Oriental Bank 32.10 33.00 51.85 1 32.10 33.00 Oriental Bank 32.05 33.15 51.82 1 32.05 33.15 Oriental Bank 31.90 33.45 51.75 1 31.90 33.45 Oriental Bank 31.65 33.75 47.66 1 31.65 33.75 Oriental Bank 31.50 30.30 43.18 1 31.50 30.30 Oriental Bank 31.00 30.55 42.93 1 31.00 30.55 Oriental Bank 31.40 30.20 43.10 1 31.40 30.20 Oriental Bank 31.30 29.80 39.38 1 31.30 29.80 Oriental Bank 31.60 30.00 39.53 1 31.60 30.00 Oriental Bank 31.70 30.10 39.59 1 31.70 30.10 Oriental Bank 31.20 30.25 42.84 1 31.20 30.25 Oriental Bank 30.85 30.00 42.68 1 30.85 30.00 Oriental Bank 30.15 32.25 50.64 1 30.15 32.25 Oriental Bank 30.05 30.95 50.57 1 30.05 30.95 Oriental Bank 30.15 32.00 50.64 1 30.15 32.00 Oriental Bank 30.35 31.55 50.76 1 30.35 31.55 Oriental Bank 28.75 35.00 73.12 1 28.75 35.00 Oriental Bank 28.55 34.65 72.99 1 28.55 34.65 Oriental Bank 28.75 35.00 73.10 1 28.75 35.00 Oriental Bank 28.70 34.60 73.08 1 28.70 34.60 Oriental Bank 28.60 36.30 72.92 1 28.60 36.30 Ranbaxy Labs 585.90 604.00 658.80 1 585.90 604.00 Ranbaxy Labs 563.90 671.90 623.53 1 563.90 671.90 Ranbaxy Labs 552.15 761.00 611.82 1 552.15 761.00 Ranbaxy Labs 634.55 748.00 698.42 1 634.55 748.00 Ranbaxy Labs 625.05 794.10 709.34 1 625.05 794.10 Ranbaxy Labs 635.50 805.00 700.48 1 635.50 805.00 Reliance 333.75 333.35 389.28 1 333.75 333.35 Reliance 342.25 338.00 388.47 1 342.25 338.00 Reliance 340.80 335.75 403.96 1 340.80 335.75 Reliance 333.90 359.60 374.74 1 333.90 359.60 Reliance 325.60 365.90 393.45 1 325.60 365.90 Reliance 340.45 375.00 392.96 1 340.45 375.00 Reliance 336.80 387.00 399.12 1 336.80 387.00 Reliance 330.40 346.50 363.54 1 330.40 346.50 Reliance 336.90 341.50 372.23 1 336.90 341.50 Reliance 336.55 334.40 372.84 1 336.55 334.40 Reliance 347.90 312.80 387.36 1 347.90 312.80 Reliance 341.30 319.90 431.91 1 341.30 319.90 Reliance 351.90 315.25 389.42 1 351.90 315.25
  • 53. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 53 Reliance 345.60 322.40 416.36 1 345.60 322.40 Reliance 342.50 322.70 433.72 1 342.50 322.70 Reliance 292.70 335.40 364.22 1 292.70 335.40 Reliance 305.05 339.80 373.69 1 305.05 339.80 Reliance 305.55 344.70 368.49 1 305.55 344.70 Reliance 302.95 340.35 381.83 1 302.95 340.35 Reliance 302.15 346.95 379.50 1 302.15 346.95 SAIL 6.55 5.95 43.97 1 6.55 5.95 SAIL 6.50 6.50 43.90 1 6.50 6.50 SAIL 6.45 6.20 43.85 1 6.45 6.20 SAIL 5.90 6.50 36.70 1 5.90 6.50 SAIL 5.95 6.90 37.07 1 5.95 6.90 SAIL 5.95 6.85 37.12 1 5.95 6.85 SAIL 6.20 6.60 36.35 1 6.20 6.60 SAIL 6.20 6.35 33.57 1 6.20 6.35 SAIL 5.95 5.40 30.81 1 5.95 5.40 SAIL 5.85 5.50 30.81 1 5.85 5.50 SAIL 5.75 5.35 30.61 1 5.75 5.35 SAIL 5.70 5.15 27.82 1 5.70 5.15 SAIL 5.65 5.15 27.73 1 5.65 5.15 SAIL 5.65 5.05 27.81 1 5.65 5.05 SAIL 5.75 5.15 30.53 1 5.75 5.15 SAIL 5.50 5.20 30.10 1 5.50 5.20 SAIL 5.40 5.65 36.07 1 5.40 5.65 SAIL 5.35 5.55 35.96 1 5.35 5.55 SAIL 5.40 7.75 36.24 1 5.40 7.75 SAIL 5.35 5.65 36.15 1 5.35 5.65 SAIL 4.75 6.65 55.69 1 4.75 6.65 SAIL 4.90 6.60 55.83 1 4.90 6.60 SAIL 5.00 7.25 55.90 1 5.00 7.25 SAIL 5.00 6.95 55.89 1 5.00 6.95 SAIL 4.85 7.05 55.72 1 4.85 7.05 Satyam Computers 335.05 374.60 416.63 1 335.05 374.60 Shipping Corporation 16.90 15.20 51.02 1 16.90 15.20 Shipping Corporation 16.40 16.20 50.74 1 16.40 16.20 Shipping Corporation 15.75 16.25 50.43 1 15.75 16.25 Shipping Corporation 14.75 18.35 42.72 1 14.75 18.35 Shipping Corporation 15.00 20.25 42.83 1 15.00 20.25 Shipping Corporation 14.95 22.90 42.80 1 14.95 22.90 Shipping Corporation 14.90 19.75 42.79 1 14.90 19.75 Shipping Corporation 15.85 19.85 39.69 1 15.85 19.85 Shipping Corporation 17.35 16.30 36.65 1 17.35 16.30 Shipping 17.75 16.25 36.79 1 17.75 16.25
  • 54. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 54 Corporation Shipping Corporation 18.45 16.20 37.06 1 18.45 16.20 Shipping Corporation 18.65 16.00 33.63 1 18.65 16.00 Shipping Corporation 18.90 15.90 33.86 1 18.90 15.90 Shipping Corporation 18.55 15.60 33.74 1 18.55 15.60 Shipping Corporation 18.35 21.75 36.74 1 18.35 21.75 Shipping Corporation 17.80 21.00 36.52 1 17.80 21.00 Shipping Corporation 17.90 22.00 43.63 1 17.90 22.00 Shipping Corporation 16.45 21.90 42.94 1 16.45 21.90 Shipping Corporation 16.35 21.50 42.90 1 16.35 21.50 Shipping Corporation 16.40 21.00 42.92 1 16.40 21.00 Shipping Corporation 16.65 25.50 64.78 1 16.65 25.50 Shipping Corporation 17.80 25.70 65.48 1 17.80 25.70 Shipping Corporation 17.45 27.00 65.26 1 17.45 27.00 Shipping Corporation 17.75 27.00 65.45 1 17.75 27.00 Shipping Corporation 17.40 28.50 65.15 1 17.40 28.50 State Bank 230.05 205.00 253.70 1 230.05 205.00 State Bank 205.85 214.45 227.84 1 205.85 214.45 State Bank 155.75 203.00 186.87 1 155.75 203.00 State Bank 157.20 196.75 189.71 1 157.20 196.75 State Bank 159.00 199.00 189.19 1 159.00 199.00 State Bank 158.55 194.20 189.58 1 158.55 194.20 State Bank 163.25 199.50 196.68 1 163.25 199.50 Sun Pharma 466.10 550.00 544.67 1 466.10 550.00 Sun Pharma 456.55 543.00 534.96 1 456.55 543.00 Sun Pharma 451.95 580.00 529.05 1 451.95 580.00 Sun Pharma 435.05 572.00 512.41 1 435.05 572.00 Tata Chemical 42.85 36.30 64.94 1 42.85 36.30 Tata Chemical 42.65 36.50 64.79 1 42.65 36.50 Tata Chemical 41.95 35.95 64.38 1 41.95 35.95 Tata Chemical 41.00 40.70 55.47 1 41.00 40.70 Tata Chemical 41.55 40.90 55.81 1 41.55 40.90 Tata Chemical 39.00 40.95 54.34 1 39.00 40.95 Tata Chemical 38.00 41.00 53.84 1 38.00 41.00 Tata Chemical 37.75 40.60 49.73 1 37.75 40.60 Tata Chemical 37.15 35.25 45.05 1 37.15 35.25 Tata Chemical 36.25 37.65 44.62 1 36.25 37.65 Tata Chemical 36.95 36.30 44.93 1 36.95 36.30
  • 55. Using Neural Networks to Explain Behavior of Indian Markets 11-November-2005 55 Tata Chemical 36.05 39.10 44.35 1 36.05 39.10 Tata Chemical 35.10 39.00 43.88 1 35.10 39.00 Tata Chemical 34.95 43.05 52.56 1 34.95 43.05 Tata Chemical 36.80 42.80 53.61 1 36.80 42.80 Tata Chemical 35.60 43.10 52.93 1 35.60 43.10 Tata Chemical 34.75 41.90 52.46 1 34.75 41.90 Tata Chemical 35.80 47.30 77.31 1 35.80 47.30 Tata Chemical 37.45 50.15 78.45 1 37.45 50.15 Tata Chemical 38.45 52.40 79.13 1 38.45 52.40 Tata Chemical 37.95 52.25 78.78 1 37.95 52.25 Tata Chemical 37.70 54.25 78.52 1 37.70 54.25 Tata Power 79.35 76.75 91.70 1 79.35 76.75 Tata Power 81.00 75.50 92.91 1 81.00 75.50 Tata Power 80.95 83.40 92.86 1 80.95 83.40 Tata Power 71.85 76.45 79.09 1 71.85 76.45 Tata Power 69.55 74.50 77.34 1 69.55 74.50 Tata Power 68.35 72.75 76.43 1 68.35 72.75 Tata Power 64.15 83.40 99.98 1 64.15 83.40 Tata Power 65.70 85.75 101.20 1 65.70 85.75 Tata Power 67.40 86.95 102.57 1 67.40 86.95 Tata Power 68.30 84.95 103.32 1 68.30 84.95 Tata Power 68.00 91.00 102.96 1 68.00 91.00 Tata Tea 173.00 213.00 205.58 1 173.00 213.00 Tata Tea 171.50 209.80 204.20 1 171.50 209.80 Tata Tea 172.30 211.50 204.32 1 172.30 211.50 Tata Tea 172.30 214.70 204.42 1 172.30 214.70 Tata Tea 168.60 219.90 200.43 1 168.60 219.90 TISCO 95.55 126.90 127.35 1 95.55 126.90 TISCO 98.10 128.25 130.87 1 98.10 128.25 TISCO 99.80 129.45 131.13 1 99.80 129.45 TISCO 99.35 129.80 130.53 1 99.35 129.80 TISCO 96.60 132.40 127.94 1 96.60 132.40 WIPRO 2,515.35 3,460.00 3,292.03 1 2,515.35 3,460.00 WIPRO 2,419.50 3,396.00 3,422.93 1 2,419.50 3,396.00 WIPRO 2,512.10 3,400.00 3,295.55 1 2,512.10 3,400.00 WIPRO 2,450.15 3,395.00 3,406.93 1 2,450.15 3,395.00 WIPRO 2,411.30 3,368.00 3,269.78 1 2,411.30 3,368.00 WIPRO 2,191.80 2,867.40 3,032.81 1 2,191.80 2,867.40 WIPRO 2,280.35 2,941.10 2,978.31 1 2,280.35 2,941.10 WIPRO 2,288.15 3,099.70 3,090.05 1 2,288.15 3,099.70 WIPRO 2,313.40 2,989.90 2,988.22 1 2,313.40 2,989.90 WIPRO 2,348.50 3,048.00 2,922.66 1 2,348.50 3,048.00 Total 157,152.70 184,869.65