SlideShare a Scribd company logo
1 of 34
Download to read offline
Using Neural Networks to Explain Behavior of Indian Markets 06-October-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 06-October-2005
2
TTAABBLLEE OOFF CCOONNTTEENNTTSS
INTRODUCTION........................................................................................................................................... 3
VARIABLES EVALUATED ............................................................................................................................... 3
STRATEGY .................................................................................................................................................... 3
FACTORS ...................................................................................................................................................... 3
Factor 1 – RBI influence and Core sector................................................................................................. 3
Factor 2 – Foreign Exchange and Crude.................................................................................................. 3
Factor 3 – Agriculture, Total Domestic Product ....................................................................................... 3
Factor 4 – Company Financials ............................................................................................................... 3
Factor 5 – Company Ratios...................................................................................................................... 3
Factor 6 – Agriculture, Community services, debt structure with RBI........................................................ 3
Factor 7 – Company Capital structure, profitability ratios and other indicators........................................ 3
Factor 8 – Banking system residuals ........................................................................................................ 3
Factor 9 – Company Liquidity Ratios....................................................................................................... 3
Factor 10 – Company stock performance.................................................................................................. 3
Factor 11 – RBI balance sheet debt structure and errors .......................................................................... 3
Factor 12 – RBI balance sheet errors....................................................................................................... 3
Factor 13 – Company indicators (residuals)............................................................................................. 3
Factor 14 – Banking system residuals....................................................................................................... 3
Factor 15 – Company financial ratios, Residuals...................................................................................... 3
Factor 16 – Foreign Exchange, Crude and interest rate, Residuals........................................................... 3
Factor 17 – Company Financial Ratios, Residuals.................................................................................... 3
Factor 18 – Company Financial Ratios, Residuals.................................................................................... 3
Factor 19 – USD Forward Spot rate......................................................................................................... 3
Factor 20 – IDBI lending rate and crude prices........................................................................................ 3
COMPANIES .................................................................................................................................................. 3
CHOICE OF NEURAL NETWORK ............................................................................................................. 3
INPUTS AND OUTPUTS ................................................................................................................................... 3
HIDDEN LAYERS ........................................................................................................................................... 3
APPENDIX – FACTOR ANALYSIS.............................................................................................................. 3
TOTAL VARIANCE EXPLAINED ....................................................................................................................... 3
COMPONENT MATRIX.................................................................................................................................... 3
APPENDIX – NEURAL NET GENERATOR................................................................................................ 3
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
3
SOURCE FOR NEURALNETSCREENER ............................................................................................................. 3
SOURCE FOR STOCKMARKETNEURALNETCREATOR ....................................................................................... 3
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
4
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.
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
• 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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
5
• 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
• 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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
6
• 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
• 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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
7
• 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
We would use above macro and micro economic indicators establish the relationship of these
indicators with following data for each company and sensitive index for a specific day.
• Previous day close
• Day open
• Day high
• Day low
• Day close
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
8
For each company and index, the model would be developed to predict prices four time
periods.
• Next day prices – +1d
• Prices after seven days – + 7d
• 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.
• 7D model, which would predict the prices for next week given the stock price,
turnover and quantity for a week earlier
• 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 Appendix – 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.
As we go to later factors, these mostly cover the residual values from initial factors.
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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
9
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
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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
10
Total debt in INR (totalINRdebt) 0.819
Cash with RBI (Cash) 0.813
Short term debt as percentage of total debt (shortTermDebtAsPercOfTotal) 0.577
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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
11
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
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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
12
Sales by fixed assets (salesByFixedAssets) -0.443
Sales by current assets (salesByCurrentAssets) -0.300
Factor 8 – Banking system residuals
Variables Correlation
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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
13
IDBI lending rate (idbiRate) 0.395
Short term debt as percentage of total debt (shortTermDebtAsPercOfTotal) 0.276
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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
14
Factor 15 – Company financial ratios, Residuals
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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
15
Factor 18 – Company Financial Ratios, Residuals
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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
16
IPCL State Bank of India ITC
Tata Motors Maruti Udyog Satyam
VSNL Infosys TCS
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 06-October-2005
17
CCHHOOIICCEE OOFF NNEEUURRAALL NNEETTWWOORRKK
Inputs and Outputs
As shown in the Appendix – 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 atleast 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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
18
Figure I Training and validation errors for different NN architectures
As see in Figure I, the neural network with hidden layer 1 of 130 nodes and hidden layer 2 of
17 node 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 prices
o High
o Low
o Close
• Weekly prices
o High
o Low
o Close
• Fortnightly prices
o High
o Low
o Close
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
19
• Six Monthly prices
o High
o Low
o Close
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
20
AAPPPPEENNDDIIXX –– FFAACCTTOORR AANNAALLYYSSIISS
All the macro economic data and company financial information is captured by 96 variables
which is 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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
21
Total Variance Explained
Initial Eigenvalues Extraction Sums of Squared LoadingsComponent
Total % of Variance Cumulative % Total % of Variance Cumulative %
38 0.067 0.070 99.625
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
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
22
Total Variance Explained
Initial Eigenvalues Extraction Sums of Squared LoadingsComponent
Total % of Variance Cumulative % Total % of Variance Cumulative %
84 0.000 0.000 100.000
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 06-October-2005
23
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 06-October-2005
24
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 06-October-2005
25
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 06-October-2005
26
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 06-October-2005
27
AAPPPPEENNDDIIXX –– 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_;
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
28
String filename_;
PrintStream pStrm_;
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();
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
29
SigmoidLayer hidden2 = new SigmoidLayer();
SigmoidLayer output = new SigmoidLayer();
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.
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
30
input.setMonitor(monitor);
hidden1.setMonitor(monitor);
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 {
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
31
validationOutputData.setAdvancedColumnSelector(outputColumnSelector_);
}
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();
}
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
32
return nnet;
}
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) {
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
33
Monitor mon = (Monitor)ev.getSource();
// 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;
Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005
34
int outputs = 7;
int trainingDataPoints = Integer.parseInt(args[3]);
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());
}
}
}

More Related Content

Viewers also liked

A EUCIP Core bevezetéséről diákszemmel
A EUCIP Core bevezetéséről diákszemmelA EUCIP Core bevezetéséről diákszemmel
A EUCIP Core bevezetéséről diákszemmelITStudy Ltd.
 
Fragmented Nutrition And Shared Knowledge - Carlo D'Alesio
Fragmented Nutrition And Shared Knowledge - Carlo D'AlesioFragmented Nutrition And Shared Knowledge - Carlo D'Alesio
Fragmented Nutrition And Shared Knowledge - Carlo D'AlesioNetwork Society Research
 
実社会で進められているサービスとLOD
実社会で進められているサービスとLOD実社会で進められているサービスとLOD
実社会で進められているサービスとLODHiroyuki Sato
 
Inburgeren In Lelystad
Inburgeren In LelystadInburgeren In Lelystad
Inburgeren In LelystadFlevotaal
 
Tapasztalatok és ajánlások - EUCIP Core vizsgák Magyarországon
Tapasztalatok és ajánlások - EUCIP Core vizsgák MagyarországonTapasztalatok és ajánlások - EUCIP Core vizsgák Magyarországon
Tapasztalatok és ajánlások - EUCIP Core vizsgák MagyarországonITStudy Ltd.
 
Workshop vluchtelingen en asielzoekers - versie sept 2015
Workshop vluchtelingen en asielzoekers - versie sept 2015Workshop vluchtelingen en asielzoekers - versie sept 2015
Workshop vluchtelingen en asielzoekers - versie sept 2015Tumult vzw
 
EUCIP Core vizsga - PLAN - Tervezés modul
EUCIP Core vizsga - PLAN - Tervezés modulEUCIP Core vizsga - PLAN - Tervezés modul
EUCIP Core vizsga - PLAN - Tervezés modulITStudy Ltd.
 
Pont levant de la team AST 4
Pont levant de la team AST 4Pont levant de la team AST 4
Pont levant de la team AST 4Bernard Alexandre
 

Viewers also liked (10)

A EUCIP Core bevezetéséről diákszemmel
A EUCIP Core bevezetéséről diákszemmelA EUCIP Core bevezetéséről diákszemmel
A EUCIP Core bevezetéséről diákszemmel
 
Fragmented Nutrition And Shared Knowledge - Carlo D'Alesio
Fragmented Nutrition And Shared Knowledge - Carlo D'AlesioFragmented Nutrition And Shared Knowledge - Carlo D'Alesio
Fragmented Nutrition And Shared Knowledge - Carlo D'Alesio
 
実社会で進められているサービスとLOD
実社会で進められているサービスとLOD実社会で進められているサービスとLOD
実社会で進められているサービスとLOD
 
Inburgeren In Lelystad
Inburgeren In LelystadInburgeren In Lelystad
Inburgeren In Lelystad
 
Destructeur
DestructeurDestructeur
Destructeur
 
Tapasztalatok és ajánlások - EUCIP Core vizsgák Magyarországon
Tapasztalatok és ajánlások - EUCIP Core vizsgák MagyarországonTapasztalatok és ajánlások - EUCIP Core vizsgák Magyarországon
Tapasztalatok és ajánlások - EUCIP Core vizsgák Magyarországon
 
Workshop vluchtelingen en asielzoekers - versie sept 2015
Workshop vluchtelingen en asielzoekers - versie sept 2015Workshop vluchtelingen en asielzoekers - versie sept 2015
Workshop vluchtelingen en asielzoekers - versie sept 2015
 
EUCIP Core vizsga - PLAN - Tervezés modul
EUCIP Core vizsga - PLAN - Tervezés modulEUCIP Core vizsga - PLAN - Tervezés modul
EUCIP Core vizsga - PLAN - Tervezés modul
 
Pont levant de la team AST 4
Pont levant de la team AST 4Pont levant de la team AST 4
Pont levant de la team AST 4
 
Educa e innova
Educa e innovaEduca e innova
Educa e innova
 

Similar to vinay-project-report

Ngmn recommendation on_son_and_o_m_requirements
Ngmn recommendation on_son_and_o_m_requirementsNgmn recommendation on_son_and_o_m_requirements
Ngmn recommendation on_son_and_o_m_requirementsAhmedMIbra
 
Poultry and Broiler Farming - Manufacturing Plant, Detailed Project Report, P...
Poultry and Broiler Farming - Manufacturing Plant, Detailed Project Report, P...Poultry and Broiler Farming - Manufacturing Plant, Detailed Project Report, P...
Poultry and Broiler Farming - Manufacturing Plant, Detailed Project Report, P...Ajjay Kumar Gupta
 
Fisheries and Aquaculture Sector in India: Business Opportunities in Fisherie...
Fisheries and Aquaculture Sector in India: Business Opportunities in Fisherie...Fisheries and Aquaculture Sector in India: Business Opportunities in Fisherie...
Fisheries and Aquaculture Sector in India: Business Opportunities in Fisherie...Ajjay Kumar Gupta
 
PVC Wires and Cables - Manufacturing Plant, Detailed Project Report, Profile,...
PVC Wires and Cables - Manufacturing Plant, Detailed Project Report, Profile,...PVC Wires and Cables - Manufacturing Plant, Detailed Project Report, Profile,...
PVC Wires and Cables - Manufacturing Plant, Detailed Project Report, Profile,...Ajjay Kumar Gupta
 
The Textile and Apparel Sector in India: A Booming Industry worth Investing In!
The Textile and Apparel Sector in India: A Booming Industry worth Investing In!The Textile and Apparel Sector in India: A Booming Industry worth Investing In!
The Textile and Apparel Sector in India: A Booming Industry worth Investing In!Ajjay Kumar Gupta
 
Lawn Tennis Balls Manufacturing Business | Start Your Own Lawn Tennis Balls B...
Lawn Tennis Balls Manufacturing Business | Start Your Own Lawn Tennis Balls B...Lawn Tennis Balls Manufacturing Business | Start Your Own Lawn Tennis Balls B...
Lawn Tennis Balls Manufacturing Business | Start Your Own Lawn Tennis Balls B...Ajjay Kumar Gupta
 
Penetration Testing Procedures & Methodologies.pdf
Penetration Testing Procedures & Methodologies.pdfPenetration Testing Procedures & Methodologies.pdf
Penetration Testing Procedures & Methodologies.pdfHimalaya raj Sinha
 
Start Your Own Business of Fiberglass Transparent LPG Cylinder with Our Step-...
Start Your Own Business of Fiberglass Transparent LPG Cylinder with Our Step-...Start Your Own Business of Fiberglass Transparent LPG Cylinder with Our Step-...
Start Your Own Business of Fiberglass Transparent LPG Cylinder with Our Step-...Ajjay Kumar Gupta
 
Ngen mvpn with pim implementation guide 8010027-002-en
Ngen mvpn with pim implementation guide   8010027-002-enNgen mvpn with pim implementation guide   8010027-002-en
Ngen mvpn with pim implementation guide 8010027-002-enNgoc Nguyen Dang
 
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009webhostingguy
 
The Agriculture Sector in India: Industry Overview and Business Opportunities...
The Agriculture Sector in India: Industry Overview and Business Opportunities...The Agriculture Sector in India: Industry Overview and Business Opportunities...
The Agriculture Sector in India: Industry Overview and Business Opportunities...Ajjay Kumar Gupta
 
The Indian Pharmaceuticals Sector: Investment Opportunities in Drugs, Medicin...
The Indian Pharmaceuticals Sector: Investment Opportunities in Drugs, Medicin...The Indian Pharmaceuticals Sector: Investment Opportunities in Drugs, Medicin...
The Indian Pharmaceuticals Sector: Investment Opportunities in Drugs, Medicin...Ajjay Kumar Gupta
 
Manual part 49990268420
Manual part 49990268420Manual part 49990268420
Manual part 49990268420Tamojyoti Bose
 
Supply Chain Collaboration: The Key to Success in a Global Economy
Supply Chain Collaboration: The Key to Success in a Global EconomySupply Chain Collaboration: The Key to Success in a Global Economy
Supply Chain Collaboration: The Key to Success in a Global EconomyFindWhitePapers
 
Detailed Project Report on Silk Reeling Unit Manufacturing Unit Setup
Detailed Project Report on Silk Reeling Unit Manufacturing Unit SetupDetailed Project Report on Silk Reeling Unit Manufacturing Unit Setup
Detailed Project Report on Silk Reeling Unit Manufacturing Unit SetupIMARC Group
 
Resource Paper of Enterprise-Wide Deployment of EDM
Resource Paper of Enterprise-Wide Deployment of EDMResource Paper of Enterprise-Wide Deployment of EDM
Resource Paper of Enterprise-Wide Deployment of EDMGlen Alleman
 
White Paper: Indoor Positioning in Industry & Logistics
White Paper: Indoor Positioning in Industry & LogisticsWhite Paper: Indoor Positioning in Industry & Logistics
White Paper: Indoor Positioning in Industry & Logisticsinfsoft GmbH
 
Beginers Guide To Seo
Beginers Guide To SeoBeginers Guide To Seo
Beginers Guide To SeoW.Peterson
 
Start Production of Potato Chips And Extruded Snack Food (Kurkure Type)
Start Production of Potato Chips And Extruded Snack Food (Kurkure Type)Start Production of Potato Chips And Extruded Snack Food (Kurkure Type)
Start Production of Potato Chips And Extruded Snack Food (Kurkure Type)Ajjay Kumar Gupta
 

Similar to vinay-project-report (20)

Ngmn recommendation on_son_and_o_m_requirements
Ngmn recommendation on_son_and_o_m_requirementsNgmn recommendation on_son_and_o_m_requirements
Ngmn recommendation on_son_and_o_m_requirements
 
Poultry and Broiler Farming - Manufacturing Plant, Detailed Project Report, P...
Poultry and Broiler Farming - Manufacturing Plant, Detailed Project Report, P...Poultry and Broiler Farming - Manufacturing Plant, Detailed Project Report, P...
Poultry and Broiler Farming - Manufacturing Plant, Detailed Project Report, P...
 
Fisheries and Aquaculture Sector in India: Business Opportunities in Fisherie...
Fisheries and Aquaculture Sector in India: Business Opportunities in Fisherie...Fisheries and Aquaculture Sector in India: Business Opportunities in Fisherie...
Fisheries and Aquaculture Sector in India: Business Opportunities in Fisherie...
 
PVC Wires and Cables - Manufacturing Plant, Detailed Project Report, Profile,...
PVC Wires and Cables - Manufacturing Plant, Detailed Project Report, Profile,...PVC Wires and Cables - Manufacturing Plant, Detailed Project Report, Profile,...
PVC Wires and Cables - Manufacturing Plant, Detailed Project Report, Profile,...
 
The Textile and Apparel Sector in India: A Booming Industry worth Investing In!
The Textile and Apparel Sector in India: A Booming Industry worth Investing In!The Textile and Apparel Sector in India: A Booming Industry worth Investing In!
The Textile and Apparel Sector in India: A Booming Industry worth Investing In!
 
Lawn Tennis Balls Manufacturing Business | Start Your Own Lawn Tennis Balls B...
Lawn Tennis Balls Manufacturing Business | Start Your Own Lawn Tennis Balls B...Lawn Tennis Balls Manufacturing Business | Start Your Own Lawn Tennis Balls B...
Lawn Tennis Balls Manufacturing Business | Start Your Own Lawn Tennis Balls B...
 
Penetration Testing Procedures & Methodologies.pdf
Penetration Testing Procedures & Methodologies.pdfPenetration Testing Procedures & Methodologies.pdf
Penetration Testing Procedures & Methodologies.pdf
 
Start Your Own Business of Fiberglass Transparent LPG Cylinder with Our Step-...
Start Your Own Business of Fiberglass Transparent LPG Cylinder with Our Step-...Start Your Own Business of Fiberglass Transparent LPG Cylinder with Our Step-...
Start Your Own Business of Fiberglass Transparent LPG Cylinder with Our Step-...
 
Ngen mvpn with pim implementation guide 8010027-002-en
Ngen mvpn with pim implementation guide   8010027-002-enNgen mvpn with pim implementation guide   8010027-002-en
Ngen mvpn with pim implementation guide 8010027-002-en
 
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
 
The Agriculture Sector in India: Industry Overview and Business Opportunities...
The Agriculture Sector in India: Industry Overview and Business Opportunities...The Agriculture Sector in India: Industry Overview and Business Opportunities...
The Agriculture Sector in India: Industry Overview and Business Opportunities...
 
The Indian Pharmaceuticals Sector: Investment Opportunities in Drugs, Medicin...
The Indian Pharmaceuticals Sector: Investment Opportunities in Drugs, Medicin...The Indian Pharmaceuticals Sector: Investment Opportunities in Drugs, Medicin...
The Indian Pharmaceuticals Sector: Investment Opportunities in Drugs, Medicin...
 
rowland proj
rowland projrowland proj
rowland proj
 
Manual part 49990268420
Manual part 49990268420Manual part 49990268420
Manual part 49990268420
 
Supply Chain Collaboration: The Key to Success in a Global Economy
Supply Chain Collaboration: The Key to Success in a Global EconomySupply Chain Collaboration: The Key to Success in a Global Economy
Supply Chain Collaboration: The Key to Success in a Global Economy
 
Detailed Project Report on Silk Reeling Unit Manufacturing Unit Setup
Detailed Project Report on Silk Reeling Unit Manufacturing Unit SetupDetailed Project Report on Silk Reeling Unit Manufacturing Unit Setup
Detailed Project Report on Silk Reeling Unit Manufacturing Unit Setup
 
Resource Paper of Enterprise-Wide Deployment of EDM
Resource Paper of Enterprise-Wide Deployment of EDMResource Paper of Enterprise-Wide Deployment of EDM
Resource Paper of Enterprise-Wide Deployment of EDM
 
White Paper: Indoor Positioning in Industry & Logistics
White Paper: Indoor Positioning in Industry & LogisticsWhite Paper: Indoor Positioning in Industry & Logistics
White Paper: Indoor Positioning in Industry & Logistics
 
Beginers Guide To Seo
Beginers Guide To SeoBeginers Guide To Seo
Beginers Guide To Seo
 
Start Production of Potato Chips And Extruded Snack Food (Kurkure Type)
Start Production of Potato Chips And Extruded Snack Food (Kurkure Type)Start Production of Potato Chips And Extruded Snack Food (Kurkure Type)
Start Production of Potato Chips And Extruded Snack Food (Kurkure Type)
 

vinay-project-report

  • 1. Using Neural Networks to Explain Behavior of Indian Markets 06-October-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 06-October-2005 2 TTAABBLLEE OOFF CCOONNTTEENNTTSS INTRODUCTION........................................................................................................................................... 3 VARIABLES EVALUATED ............................................................................................................................... 3 STRATEGY .................................................................................................................................................... 3 FACTORS ...................................................................................................................................................... 3 Factor 1 – RBI influence and Core sector................................................................................................. 3 Factor 2 – Foreign Exchange and Crude.................................................................................................. 3 Factor 3 – Agriculture, Total Domestic Product ....................................................................................... 3 Factor 4 – Company Financials ............................................................................................................... 3 Factor 5 – Company Ratios...................................................................................................................... 3 Factor 6 – Agriculture, Community services, debt structure with RBI........................................................ 3 Factor 7 – Company Capital structure, profitability ratios and other indicators........................................ 3 Factor 8 – Banking system residuals ........................................................................................................ 3 Factor 9 – Company Liquidity Ratios....................................................................................................... 3 Factor 10 – Company stock performance.................................................................................................. 3 Factor 11 – RBI balance sheet debt structure and errors .......................................................................... 3 Factor 12 – RBI balance sheet errors....................................................................................................... 3 Factor 13 – Company indicators (residuals)............................................................................................. 3 Factor 14 – Banking system residuals....................................................................................................... 3 Factor 15 – Company financial ratios, Residuals...................................................................................... 3 Factor 16 – Foreign Exchange, Crude and interest rate, Residuals........................................................... 3 Factor 17 – Company Financial Ratios, Residuals.................................................................................... 3 Factor 18 – Company Financial Ratios, Residuals.................................................................................... 3 Factor 19 – USD Forward Spot rate......................................................................................................... 3 Factor 20 – IDBI lending rate and crude prices........................................................................................ 3 COMPANIES .................................................................................................................................................. 3 CHOICE OF NEURAL NETWORK ............................................................................................................. 3 INPUTS AND OUTPUTS ................................................................................................................................... 3 HIDDEN LAYERS ........................................................................................................................................... 3 APPENDIX – FACTOR ANALYSIS.............................................................................................................. 3 TOTAL VARIANCE EXPLAINED ....................................................................................................................... 3 COMPONENT MATRIX.................................................................................................................................... 3 APPENDIX – NEURAL NET GENERATOR................................................................................................ 3
  • 3. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 3 SOURCE FOR NEURALNETSCREENER ............................................................................................................. 3 SOURCE FOR STOCKMARKETNEURALNETCREATOR ....................................................................................... 3
  • 4. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 4 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. 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 • 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
  • 5. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 5 • 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 • 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
  • 6. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 6 • 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 • 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
  • 7. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 7 • 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 We would use above macro and micro economic indicators establish the relationship of these indicators with following data for each company and sensitive index for a specific day. • Previous day close • Day open • Day high • Day low • Day close
  • 8. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 8 For each company and index, the model would be developed to predict prices four time periods. • Next day prices – +1d • Prices after seven days – + 7d • 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. • 7D model, which would predict the prices for next week given the stock price, turnover and quantity for a week earlier • 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 Appendix – 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. As we go to later factors, these mostly cover the residual values from initial factors. 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
  • 9. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 9 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 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
  • 10. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 10 Total debt in INR (totalINRdebt) 0.819 Cash with RBI (Cash) 0.813 Short term debt as percentage of total debt (shortTermDebtAsPercOfTotal) 0.577 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
  • 11. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 11 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 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
  • 12. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 12 Sales by fixed assets (salesByFixedAssets) -0.443 Sales by current assets (salesByCurrentAssets) -0.300 Factor 8 – Banking system residuals Variables Correlation 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
  • 13. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 13 IDBI lending rate (idbiRate) 0.395 Short term debt as percentage of total debt (shortTermDebtAsPercOfTotal) 0.276 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
  • 14. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 14 Factor 15 – Company financial ratios, Residuals 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
  • 15. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 15 Factor 18 – Company Financial Ratios, Residuals 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
  • 16. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 16 IPCL State Bank of India ITC Tata Motors Maruti Udyog Satyam VSNL Infosys TCS 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.
  • 17. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 17 CCHHOOIICCEE OOFF NNEEUURRAALL NNEETTWWOORRKK Inputs and Outputs As shown in the Appendix – 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 atleast 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
  • 18. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 18 Figure I Training and validation errors for different NN architectures As see in Figure I, the neural network with hidden layer 1 of 130 nodes and hidden layer 2 of 17 node 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 prices o High o Low o Close • Weekly prices o High o Low o Close • Fortnightly prices o High o Low o Close
  • 19. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 19 • Six Monthly prices o High o Low o Close
  • 20. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 20 AAPPPPEENNDDIIXX –– FFAACCTTOORR AANNAALLYYSSIISS All the macro economic data and company financial information is captured by 96 variables which is 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
  • 21. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 21 Total Variance Explained Initial Eigenvalues Extraction Sums of Squared LoadingsComponent Total % of Variance Cumulative % Total % of Variance Cumulative % 38 0.067 0.070 99.625 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
  • 22. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 22 Total Variance Explained Initial Eigenvalues Extraction Sums of Squared LoadingsComponent Total % of Variance Cumulative % Total % of Variance Cumulative % 84 0.000 0.000 100.000 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.
  • 23. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 23 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
  • 24. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 24 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
  • 25. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 25 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
  • 26. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 26 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.
  • 27. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 27 AAPPPPEENNDDIIXX –– 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_;
  • 28. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 28 String filename_; PrintStream pStrm_; 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();
  • 29. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 29 SigmoidLayer hidden2 = new SigmoidLayer(); SigmoidLayer output = new SigmoidLayer(); 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.
  • 30. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 30 input.setMonitor(monitor); hidden1.setMonitor(monitor); 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 {
  • 31. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 31 validationOutputData.setAdvancedColumnSelector(outputColumnSelector_); } 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(); }
  • 32. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 32 return nnet; } 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) {
  • 33. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 33 Monitor mon = (Monitor)ev.getSource(); // 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;
  • 34. Using Neural Networks to Explain Behavior of Indian Markets 06-October-2005 34 int outputs = 7; int trainingDataPoints = Integer.parseInt(args[3]); 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()); } } }