A STUDY ORIENTED PROJECT REPORT - Aalap Tripathy

5 downloads 669 Views 3MB Size Report
2.3 Implementation in Microsoft Excel. 8. 2.4 Results of Experiment. 15. 2.5 Conclusion & Further Work. 20. 3. Study of Neural Networks. 21. 3.1 Application of ...
A

STUDY ORIENTED PROJECT REPORT ON

DEVELOPING A DYNAMIC FRAMEWORK TO TEST THE RELATIONSHIPS AMONG STOCK MARKET RETURNS, PRODUCTION AND CONSUMPTION IN FINITE TIME (USING EXCEL AND NEURAL NETWORKS)

By Aalap Tripathy

2004P34PS208

For fulfillment of the

Study Oriented Project (BITS GC 323)

Birla Institute of Technology and Science - Pilani Goa Campus Zuari Nagar, Goa

A

STUDY ORIENTED PROJECT REPORT ON

DEVELOPING A DYNAMIC FRAMEWORK TO TEST THE RELATIONSHIPS AMONG STOCK MARKET RETURNS, PRODUCTION AND CONSUMPTION IN FINITE TIME (USING EXCEL AND NEURAL NETWORKS) By Aalap Tripathy

2004P34PS208

Prepared under the supervision of

Dr Debasis Patnaik (Department of Economics)

For partial fulfillment of the requirements of

Study Oriented Project (BITS GC 323)

Birla Institute of Technology and Science - Pilani, Goa Campus Zuari Nagar, Goa 2

Abstract This paper deals with an inverted relationship among stock market returns and finite horizon consumption growth. In the growth model, the objective is to find optimum levels of consumption and capital stock variables given the parameters of production and utility functions. A Neural Networks framework is used to fit secondary data from the stock market and find the production function parameters that permit them.

Objective of the Paper 1. To develop a framework to study a sustainable consumption pattern and provide for a terminal capital stock, made dynamic by a possibility of returns from investment in a stock market. 2. To study the possibility of perturbations in a stock market using Neural Network Modelling and develop a mechanism to predict (within limits of error) the behavior of a target stock price. 3. To relate a Cobb Douglas Production Function with Ramsey’s Growth Model within a finite time constraint so as to locate macro economic equilibrium points in the correspondiong growth processes of production, investment and savings.

Key Words Microsoft Excel, econometrics and estimation

3

Table of Contents

Cover page

i

Title page

ii

Abstract

iii

1. Introduction

`

2. Study of Growth Model

5 6

2.1 Mathematical Modeling

6

2.2 Summary of Problem Statement

8

2.3 Implementation in Microsoft Excel

8

2.4 Results of Experiment

15

2.5 Conclusion & Further Work

20

3. Study of Neural Networks

21

3.1 Application of Neural Nets

21

3.2 Mathematical Modeling of a Stock Market Scenario

23

3.3 Data Used

25

3.4 Implementation in Microsoft Excel

26

3.5 Case Study of Maruti Udyog & Competitors

32

3.6 Conclusion

33

3.7 Further Work

34

Bibliography

35

4

1.

Introduction:

Microsoft Excel contains powerful procedures for solving both linear and nonlinear programming problems. As the Excel interface is such a familiar one and the specification of programming problems in Excel is relatively straightforward, there are times when it is the software of choice for solving certain types of optimization problems. The famous Ramsey model of economic growth is developed and solved using Excel. In particular, we follow the versions developed by Chakravarty (1962) and Taylor and Uhlig (1990). We employ a finite horizon version with a terminal capital stock constraint. The model is first introduced in a mathematical form and then in a computational form. The essential economics of the simple growth model used in this chapter is a trade-off between consumption and investment. More consumption in a time period means more utility in that time period but less investment and therefore less capital stock and less production in future time periods. Thus the key elements of the model are the production function with capital being used to produce output, the capital accumulation relationship with investment creating new capital, and the utility function with consumption resulting in utility.

5

2. Study of Growth Model We study the Ramsey Model of Economic Growth using a finite horizon version with a terminal capital stock constant. The key elements of the model are the production function with capital being used to produce output, the capital accumulation relationship with investment creating new capital, and the utility function with consumption resulting in utility. These models cannot be solved analytically, so numerical methods are required. 2.1 Mathematical

Modelling

The aggregate production function is:

Pt = θ K α t

Æ Eq 1

Where : Pt = output in period t θ = a technology parameter Kt = the capital stock in period t α = exponent of capital in the production function This is the widely used Cobb-Douglas form of a production function except that function usually includes both capital and labor inputs. However, for the sake of simplicity, the production function in this model includes only capital (K). The capital accumulation constraint is given by : Kt+1= Kt + Pt - Ct Æ Eq 2 This means that the capital stock in the next period will be value in the previous period plus the difference between output and consumption. Depreciation in value of the capital stock is ignored. Substituting Eq 1 in Eq 2, we get,

Kt+1= Kt + θK α t - Ct

Æ Eq 3

6

Initial Condition : Terminating Condition :

K0= Size of capital stock in initial period KN >= K* where K* is the minimum amount of capital left for the next generation i.e. K* = a lower bound on the amount of capital required in the terminal period N.

The Utility function used is the “constant elasticity of intertemporal substitution”. This is measuring the degree of substitutability between consumption “today” and “tomorrow” or, in geometric terms, measuring the curvature of the indifference curves corresponding to consumption at any two points in time. For this function, the elasticity of substitution is constant and equal to 1/τ. So, the utility in each period is defined as

U (C t ) =

1 C (1−τ ) t \ (1 − τ )

Æ Eq 4

Where : U(Ct) =the utility in period t as a function of consumption in that period τ = a parameter in the utility function Here, Utility is a function of the Consumption (Ct) and a change in the parameter τ changes the nature of the relationship. Τ Æ 0 makes Utility = Consumption whereas any other value such that 0< τ= K*

We need to choose those levels of consumption over the time periods covered by the model that strike the right balance between consumption and investment Lower consumption = Less Utility = Greater Savings Î Larger Capital Stocks Î Greater production in later years.

2.3

Implementation in Microsoft Excel

The following sample data is used and tabulated in Excel Worksheet as shown : Time Period Consumption Production

0 0.347 0.570

1 0.351 0.576

2 0.355 0.582

3 0.358 0.588

4 0.361 0.594

5 0.364 0.599

6 0.366 0.605

7 0.368 0.611

8 0.370 0.616

9

We are solving for the values of consumption in each period that provide the best trade-off between utility in that period and saving that becomes future capital stocks and permits more production later.

8

The model horizon covers time periods numbered from zero through nine so that zero represents the initial period and nine the terminal period.

1.

The rows below the time period shows a. the consumption, Ct b. production, Pt c. capital stock, Kt d. Utility, U(Ct) in each time period.

2. Total label (as marked), that is, cell L12 is given by SUM(B12:J12) This indicates that this cell contains the sum of the utility values for periods zero through eight that are contained in cells B12 through J12. Each of these values indicates discounted utility for each period. That is we are computing

N −1

∑ β U (C ) t

t

where β tU (C t ) is the term in each

0

cell of the Utility Row. 3. The cell D12 in the utility row is highlighted and the expression that is used to calculate the value in that cell is displayed in the formula bar as = beta^D4*(1/(1-tau))*D5^(1tau). beta^D4 means that beta is raised to the power of the number in cell D4. This makes use of the “naming” capability for constants in Excel and is equivalent to B17^D4. The number in cell D4 is 2 so this term becomes β2, which is the discount factor squared. 9

1 , we (1 + ρ ) can infer that the discount rate ρ is equal to about 0.02. Next consider the term (1/(11 D5 (1−τ ) . The cell D12 contains the tau))*D5^(1-tau) which can be rewritten as (1 − τ ) 1 mathematics β t C 1−τ t which is the discounted utility for period t. Also, the parameter 1−τ tau of the utility function is defined in line 16 of the spreadsheet as being equal to 0.5. Beta is defined in line 17 of the spreadsheet as 0.98. Moreover, since β =

4. In summary, line 12 of the spreadsheet is used to calculate the discounted utility in each period and then to sum those values so as to obtain the total discounted utility in cell L12. Thus the criterion function for the model is contained in line 12.

5. D6 is highlighted and the formula bar contains the expression theta*D9^alpha which is α

that for production, that is, Pt = θ K t since cell D9 contains the capital stock for period t; theta is defined near the bottom of the spreadsheet in line 19 as being equal to 0.3 and alpha is defined in line 18 as being equal to 0.33.

10

α

6. Considering model constraints Kt+1= Kt + θ K t - Cr. Cell D9 marked in the above screenshot shows the formula =C9 + theta*C9^alpha - C5. We can translate the entire α

expression as Kt–1 + Pt–1 – Ct–1 that is Kt–1 + θ K t – Ct–1 since row 9 contains the capital stock figures and row 5 contains the consumption figures. 7. At the end of row 9 in the spreadsheet there is a target capital stock.

11

8. The initial condition for capital stock is specified as above where cell B9 is highlighted. When cell B9 is highlighted the fomula bar does not show a mathematical expression like those in the other cells in line 9, but rather just the number 7. This is the initial capital stock that was specified in the mathematical statement of the models as K0 given. So the initial capital stock is given and it has been specified as equal to 7 in this version of the model. 9. Solving the Model The user must supply a. the time period numbers in row 4, b. the initial capital stock in cell B9, c. the parameter values tau, beta, alpha, and theta in cells B16 through B19, d. the terminal capital stock target in cell L9. 10. Ensuring Excel has the tool for optimization and equation solving installed. Click on Tools Æ Addins Æ Solver Add-in and select ok if solver is not already available in the Tools menu

12

11. Selecting the Tools menu and the Solver option from that menu we get a dialog box as shown below.

12. The first the top line in this box in the section called Set Target Cell. The Edit box to the right of this caption indicates that cell L12 has been chosen, and this corresponds to the total discounted utility on the right-hand side of the utility line in the spreadsheet. Just beneath this the user can specify whether the value in the cell is to be maximized or 13

minimized. In the growth model at hand we are seeking to maximize the total discounted utility so Max is selected.

13. The next line is used to specify cells to be changed while searching for the solution to the model. In the growth model we are solving for the values of consumption in each period that provide the best trade-off between utility in that period and saving that becomes future capital stocks and permits more production later. Therefore, we specify here that the variables to be used in searching for the optimum are those in cells B5 to J5, which are the consumption values. 14. Consider the box labeled Subject to the Constraints, in which appears the constraint K9 >= L9. As cell K9 contains the capital stock for period 9 and cell L9 contains the target capital stock, this constraint requires that the terminal period capital stock computed by the model be greater than or equal to the user-specified target, which in this case is set to 9.1, that is, 30 percent higher than the intitial capital stock. This corresponds to the mathematical constraint in Eq. (5), that is, KN >= K* where KN is the capital stock in the *

terminal period and K is the target capital stock. 15. It is not necessary in the Solver dialog box to specify all of the capital accumulation constraints in line 9 of the spreadsheet as constraints. Rather they are effectively linked together by the mathematical expressions so it is necessary to include only cell K9 when specifying the constraints.

16. Solving To solve the model one selects the Solve button in the Solver dialog box.

14

17. Excel solves the nonlinear programming model that is represented by the growth model. A Newton method or a conjugate gradient method can be used in Excel to solve the model.

18. Clicking on the Options button in the Solver dialog box displays the Solver Options dialog box shown above. Here we can change different parameters like maximum time, number of iterations, precision, tolerance, and convergence—that allow us to control the performance of the nonlinear optimization method used by Excel. The Assume NonNegative option has been selected to constrain the solution values of the model to nonnegative values.

2.4

Results of the Experiment

Î more utility today. Î more saving and more investment today Î more capital stock in the future Îmore output Îmore consumption possibilities in the future. Therefore, the problem is to find just the right level of consumption in each time period given the parameters of the model.

More consumption today Less consumption today

15

The key parameters are β, beta K* θ, theta α, alpha K0 τ, tau

discount factor target capital stock production function parameter production function exponent initial capital stock utility function parameter

0.98 9.1 0.30 0.33 7 0.50

1. Effect of Discount Factor 1 Discount Factor : β = Æ Eq 1 (1 + ρ ) 1 On rearrangement, we get : ρ = − 1 Æ Eq 2

β

β 0.98 0.95

ρ 0.02 0.052

We can claim that for small values : β ≈ 1.00 – ρ β (Discount Factor) 0.99 0.94 …

ρ (Discount Rate) 10% 6% ….

0.1 0.06 … N −1

Considering the criterion function J=

∑β 0

t

1 C (1−τ ) t \ (1 − τ ) t

The discount factor, β, raised to the power t, that is, β varies with β and t as shown below:

ρ Β 0.02 0.98 0.05 0.95

Values of βt corresponding to the Time Periods chosen Time Periods (t) 0 1 2 3 4 5 1.00 0.98 0.96 0.94 0.92 0.90 1.00 0.95 0.90 0.86 0.81 0.77 t

1. When the discount rate is 5 percent (ρ=0.05) the term β becomes smaller much faster (with increasing t) than when the discount rate is 2 percent (ρ=0.02). 16

2. Thus when the discount rate is higher, future utility is “discounted” more heavily, that is, given less weight in the criterion function 3. If the discount rate is 2 percent we have relatively more interest in consumption in future years than when the discount rate is 5 percent. So, β becomes a critical factor. Altering beta is one of the interesting experiments to do with this model. As we increase the discount rate (ρ ) and thus decrease the discount factor (β) we should see more consumption early in the time horizon covered by the model.

β 0.98

Time Period Consumption

0 0.347

1 0.351

2 0.355

3 0.358

4 0.361

5 0.364

6 0.366

7 0.368

8 0.370

0.97

Time Period Consumption

0 0.375

1 0.372

2 0.368

3 0.364

4 0.360

5 0.355

6 0.351

7 0.345

8 0.340

0.99

Time Period Consumption

0 0.320

1 0.331

2 0.341

3 0.351

4 0.361

5 0.371

6 0.382

7 0.392

8 0.402

(From the Excel Model) Effect of Target Capital Stock

1. Model constraint or terminating condition is KN >= K*. It requires that the capital stock in the terminal period be greater than or equal to the target. 2. This can be thought of as a constraint that represents the interest of the next generation. Without such a constraint, the optimal solution to the growth model is to invest little or nothing in the last years covered by the model and to make consumption very high in those periods. Thus a constraint of this sort is normally added to numerical growth models. 17

3. There can possibly be interplay between the choice of discount rate and the choice of the target capital stock. If we choose a high-target capital stock, then changes in the discount rate may not have much effect on the pattern of consumption over time since consumption must in any event be very low in order to ensure that there is enough investment to meet the target capital stock in the terminal period. 4. One of the most straightforward experiments with the model is to increase the initial capital stock. This has the effect of permitting more consumption with less investment, and one would expect to see higher levels of both output and consumption in the model solution. Effect of Changing θ α

Let us alter θ in the Production Equation Pt = θ K t With larger θ, more output (production) can be produced with the same capital stock (Kt) and we should expect to find higher levels of both output and consumption in the model solution. Effect of Changing α

Similarly, altering parameter α in

Pt = θK α t affects the efficiency of the production process.

Effect of Changing τ

The last parameter that can be modified is τ, a parameter in the utility function 1 U (C t ) = C (1−τ ) t . As τ approaches zero the utility function becomes linear (denominator (1 − τ )

\

becomes 1 and power in the numerator approaches 1. So, U becomes linear) and as τ approaches ax ) , so it may be useful one it becomes logarithmic (mathematically log x converges to Lt ∑ x →0 x to think of τ as a parameter that affects the curvature of the utility function or the degree of diminishing marginal utility. The Excel Solver easily converges to a new solution when different values of τ are used as shown in the table below.

Utility tau

1.131973 0.5

1.138667

1.144604

1.150047

1.154926

1.15926

1.163101

1.166504

1.169515

Utility tau

1.585568 0.6

1.589866

1.593289

1.596135

1.598334

1.599911

1.600929

1.601453

1.601537

Utility tau

2.368985 0.7

2.367843

2.365714

2.362938

2.359443

2.355264

2.350475

2.345152

2.339359

(From the Excel Model)

18

Comparision of Theoretical & Numerical Growth Models

In contrast to numerical growth models, theoretical growth models are usually solved for infinite horizons and do not have a terminal capital stock target. As an approximation to this, some numerical growth models are solved for much longer time horizons than the period of interest and the solution is used only for a shorter period. Thus if one is interested in a 20-year period the model might be solved for 40 or 60 years so that the end conditions do not have much effect on the solution paths for the first 20 years. An interesting experiment is to impose a terminal capital stock equal to the initial capital stock (change L9 to 7) and solve the model for different time horizons.

The optimal capital stock path for an experiment like this is shown below. Time Period 0 Æ 9 (10) beta Time Period alpha Consumption theta Production

0.99 0 0.33 0.502 0.3 0.570

1 0.519 0.572

2 0.536 0.573

3 0.553 0.574

4 0.571 0.575

5 0.590 0.575

6 0.609 0.575

7 0.629 0.574

8 0.650 0.572

Capital

7.000

7.068

7.121

7.159

7.180

7.183

7.168

7.133

7.078

Utility tau

1.417 0.5

1.426

1.435

1.444

1.452

1.461

1.470

1.479

1.488

9

7.000

Target 7.000 Total 13.072

19

We can see that optimal values for the capital stock first increase then decrease. If we keep extending the time horizon, we generate a sequence of even higher arches whose top parts become flatter as they get closer to an upper limit value of about 10.5. This behavior is known at the “turnpike property.” To understand this, we have to point out that a model like the one presented here has a steady-state solution—a solution that, given enough time, the consumption and capital stock levels would converge to and stay at forever. It can be shown that for this 1

⎛ 1 − β ⎞ α −1 ⎟⎟ Substituting the corresponding parameter model the steady-state capital stock is K ss = ⎜⎜ ⎝ βαθ ⎠ values we obtain Kss = 10.559. Thus, any finite optimal path tends to reach the steady-state value, stay there or close to it as long as possible, and then leave it to go back to the target capital stock.

2.4 Conclusion & Future Work Determination of steady state capital stock for the growth model has been devised in this SOP. A comparative analysis with change of parameters was also observed. The different results obtained were explained using mathematical reasons.

2.5 Further Study 1. A Newton method for solving Non-linear programming models 2. Conjugate gradient method for solving Non-linear programming models.

20

3. Study of Neural Networks Neural network models are suitable for dealing with problems in which the relationships among the variables are not well known. Examples are problems in which information is incomplete or output results are only approximations, as compared to more structured problems handled, for example, with equation-based models. Neural networks are particularly useful for dealing with data sets whose underlying nonlinearities are not known in advance. Among the many possible applications are forecasting and identification of clusters of data attributes. The example used here is typical of the applications of neural nets to economics and finance—how best to predict the future prices of a stock. The stock used in the is that of the Ford Motor Company, and an attempt is made to predict its future share price by using the share price of a group of related companies—companies that provide inputs to automobile production and companies that produce competing vehicles. The central notion of neural net analysis is that we can use a set of observations from the past to predict future relationships. Thus we use the closing price of Ford stock each week over a 14week period (1997 data) to “train” the model and then use the parameters that emerge from the training to predict the Ford stock price in the 15th through 20th weeks. This is done in an Excel spreadsheet using the Solver that was described earlier in the growth model in Section 1 of this SOP.

3.1 Application of Neural Nets Artificial Neural Networks have three basic components: 1. processing elements (called nodes or neurons) 2. interconnection topology 3. A learning scheme From a computational point of view, a neural network is a parallel distributed processing system. It processes input data through multiple parallel processing elements, which do not store any data or decision results as is done in standard computing. As successive sets of input data are processed, the network processing functions “learn” or “adapt,” assuming specific patterns that reflect the nature of those inputs.

21

The model shown above is known as back-propagation or as a feed-forward model, which is the type most commonly used. This is a simple network with one input layer with three neurons, one intermediate layer with two neurons (usually named the “hidden layer”), and one output layer with just one neuron. A key component of the network is the neuron, an elementary processing unit that, given inputs, generates output.

Activation Function

Combination Function

W1

W2

A single node is composed of two main parts: 1. combination function - The combination function computes the net input to the neuron, usually as a weighted sum of the inputs. 2. activation function – The activation function generates output given the net input. The output of a neuron constrained to be within the interval (0,1). To do so, different functional forms can be used for the activation function, such as logistic functions, sigmoid functions, etc. A threshold may be used to determine when the neuron will “fire” an output as the activation function yields a value above that threshold. Input layer neurons receive data from outside and transmit them to the next layer without processing them. Output layer neurons return data to the outside and are sometimes set to apply their combination functions only.

22

The learning process of the network consists of choosing values of the weights so as to achieve a desired mapping from inputs to outputs. This is done by feeding the network with a set of inputs, comparing the output (or outputs, in case of having more than one network output) to a known target, computing the corresponding error, and sometimes applying an error function. Then weights are modified to improve the performance.

3.2 Mathematical Modelling of The Stock Market for Neural Networks (Originally developed by Joe Breedlove)

The combination function for the output layer can be defined as : q

yt= θ 0 + ∑ θ j atj Æ Eq. 1 j =1

where yt is the output in period t atj is the hidden node value in period t for node j θj’s are parameters (to be determined) There are q hidden nodes. The yt variables are the share price of the Ford Motor Company stock in each of the 14 weeks in 1997 (tabulated in 2.3). The θ’s are among the parameters to be determined. The atj values in time period t at hidden node j, are given by the expression ⎛ qj ⎞ atj=S ⎜⎜ ∑ w ji xit ⎟⎟ Æ Eq 2 ⎝ i =1 ⎠ where xit are the inputs at node i in period t. there are qj inputs at hidden node j. xit are the share prices of the other companies which have a bearing on the target stock (to be determined) wji are the parameters at the jth hidden node for the ith input ⎛ 1 ⎞ S is the sigmoid function S(z)= ⎜ −z ⎟ ⎝1+ e ⎠

Sigmoid is sometimes called the “squasher”. Given any data set of numbers that range from very large negative numbers to very large positive numbers this function maps those numbers to the zero-to-one interval while maintaining their relative sizes.

23

This example contains share prices from the automotive suppliers of Ford in 1997, 1. Bethlehem Steel 2. Owens Glass 3. Goodyear Tire and Rubber and the competing auto makers to Ford, that is, 1. Chrysler Motors 2. General Motors We will predict the share price of the Ford Motor Company over a larger interval basing on the above neural net model.

The effect from the suppliers is aggregated into one hidden node and that from the competitors is aggregated into the second hidden node, as shown above. So for the example at hand we have the following equations :

and

and

z1= w11*x1+ w12*x2+ w13*x3 Æ Eq 3 1 ⎞ ⎛ 1 ⎞ ⎛ =⎜ Æ Eq 4 at1= ⎜ - z1 ⎟ -(w11 *x1 + w 12 *x 2 + w13 *x 3 ) ⎟ ⎠ ⎝1+ e ⎠ ⎝1+ e z2= w21*x4+ w22*x5 Æ Eq 5 1 1 ⎞ ⎛ ⎞ ⎛ =⎜ Æ Eq 6 at2= ⎜ -z 2 ⎟ -(w 21 *x 4 + w 22 *x 5 ) ⎟ ⎠ ⎝1+ e ⎠ ⎝1+ e 24

We are going to compute (estimate) values of y given as yt (Predicted) = θ0 + θ1at1 + θ2at2 Thus the optimization problem in Excel is to find the values of w11, w12, w13, w21, w22, θ0, θ1, θ2 which minimized the error Error = yt – yt(predicted) We will use a Least Mean Square (LMS) algorithm to minimize the sum of the squares of the errors to the least possible values (to be chosen in the Excel Solver later). A Normalization value Norm is thus defined as :

∑ (y n

Norm =

t =1

− y t ( predicted ) )

2

t

Where n is the number of observations made (in the example taken later=14)

3.3 Data

Week

Ford

Bethlehem

Owens

Goodyear

Chrysler

Closing Jan 3 Jan 10 Jan 17 Jan 24 Jan 31 Feb 7 Feb 14 Feb 21 Feb 28 Mar 7 Mar 14 Mar 21 Mar 27 Mar 31

y 321⁄2 331⁄2 33 335⁄8 321⁄8 321⁄4 323⁄4 331⁄8 327⁄8 321⁄4 321⁄8 313⁄4 307⁄8 313⁄8

x1 91⁄4 87⁄8 9 85⁄8 83⁄8 81⁄4 73⁄4 77⁄8 81⁄4 81⁄8 81⁄2 81⁄4 81⁄2 81⁄4

x2 421⁄2 49 485⁄8 455⁄8 465⁄8 451⁄2 443⁄4 433⁄8 423⁄8 425⁄8 421⁄2 407⁄8 401⁄8 401⁄4

x3 523⁄8 541⁄2 55 541⁄4 541⁄2 521⁄2 535⁄8 533⁄4 523⁄4 533⁄8 537⁄8 541⁄2 541⁄4 523⁄8

x4 345⁄8 353⁄4 343⁄8 351⁄4 347⁄8 341⁄8 341⁄2 351⁄8 34 317⁄8 301⁄2 301⁄4 301⁄4 30

General Motors x5 577⁄8 611⁄8 601⁄8 621⁄2 59 563⁄4 583⁄4 581⁄2 577⁄8 565⁄8 58 57 561⁄4 553⁄8

25

3.4 Implementation in Excel (First Developed by Hans Amman and now combined this the Joe Breedlove Share model )

1. The section on the data set beginning in line 17 shows a. fourteen observations consisting of the weekly closing share price yt for Ford shares b. five inputs x1 through x5 for the other stocks. 2. These observations are aggregated using the sigmoid function into the hidden layers at1 and at2 using a formula like = 1 / (1 + Exp(-(D20*D5 + E20*D6 + F20*D7))) where the D5,D6, and D7 are weights that are to be solved for and the D20, E20, and F20 are the observations x1, x2, and x3.

26

3. Column at1 shows the formula =1/(1+EXP(($D20*$D$5+$E20*$D$6+$F20*$D$7))) where D5, D6 and D7 are the weights to be computed and D20, E20 and F20 are the observations (stock values) x1,x2 and x3.

27

4. Similarly Column at2 shows the formula =1/(1+EXP(-($G20*$D$8+$H20*$D$9))) which is similar to the column at1 except that it uses input data for x4 and x5 to compute the second of the two hidden layer values.

5. The Output Layer column as shown above is computed using an expression of the form Output = theta0 + theta1 * at1 + theta2 * at2 where the thetas are weights that are computed in the optimization and are shown in the section on Output weights near the top of the spreadsheet. 6. The Error column in the Data Set section the difference Error = y – Output and the Norm column is the square of the elements in the Error column. The elements in the Norm column are summed up in cell M35 at the bottom of the column.

28

7. To solve the optimization problem, we select Tools:Solver at which point the dialog box shown below appears.

8. Click the solve button to solve the optimization problem and obtain the values in cells D5 to D12. The above dialog box indicates that the optimization problem is to minimize the value in cell C15 (which on inspection is set equal to M35, which in turn is the sum of the elements in the Norm column). The optimization is done by changing the elements in cells D5 through D12 until the minimum of the function is obtained. The following output was obtained : Input vector

weights w11 w12 w13 w21 w22

Output weights

theta0 theta1 theta2

value -2.61 1.306 0.448 0.002 0.003 467.4 367.1 235.8

start -2.695 1.309 -0.486 0.002 0.004 101.559 25.337 187.317

29

9. The column to the right labeled start shows the numbers that were originally used when searching for the optimal parameters. They are not used in the present calculations but are stored there only to indicate which starting values were used. In fact each time the model is solved the numbers in the value column are used as the starting point and an effort is made to find values that decrease the norm. 10. At times the solution procedure converges to a result with a higher norm because neural net estimation problems are sometimes characterized by nonconvexities and may have local optimal solutions that are not the same as the global optimal solution. Sometimes the number of local solutions may be very large. Thus in Excel it may be advisable to use a number of different starting values in order to check for global convergence. When there are many local optima, global optimization algorithms such as genetic algorithms can be used to perform global exploration of the solution space

11. The spreadsheet contains forecast in the section called Predictions. These predictions are made for 6 weeks after the last week for which data were collected to “fit” or “train” the model. 12. An expression as = D10 + D11*I36 + D12*J36 that translates to Output = theta0 + theta1 * at1 + theta2 * at2 is used to make predictions based on the values of related stock values in colmns D36 to H36. These predictions are done from “out of sample” data, that is, the data that are used to fit the model are not used to make the predictions. Rather some elements of the sample are reserved to test the model after it is fitted to a subset of the data.

30

13. Controlling the number of iterations : Most of the times an optimum solution can be reached without making large number of iterations. To reduce the iteration range we select Tools:Solver:Options and the dialog box shown above appears. This can be used to control the number of iterations that the Solver will use in trying to achieve convergence. A convergence value of 0.001 is probably close enough for most 31

requirements but we may require a looser convergence by lowering this setting to 0.01 in order to obtain convergence in 100 iterations. 14. Another important element in the Solver options dialog box is Use Automatic Scaling. In many neural net data sets the various series may be of very different magnitudes. For example, a data set may have numbers going from 0.04 to say 625. In such a case it is wise to check the automatic scaling option. Then Excel Solver will automatically scale the series to roughly the same magnitude and thereby increase the probability to find an optimal set of parameter estimates.

3.5 Experiment on Maruti Udyog and competitors The following data was used to perform an experiment on Maruti Udyog Ltd based on available stock prices : PRICES

Date

Open

High

Low

Close

Volume

Adj Close*

7-Sep-07

883.00

887.25

870.00

872.90

84,500

872.90

6-Sep-07

865.00

884.50

865.00

881.80

141,200

881.80

5-Sep-07

890.00

900.00

865.00

873.05

137,100

873.05

4-Sep-07

882.00

899.00

870.00

893.95

276,500

893.95

3-Sep-07

875.00

902.00

875.00

880.85

187,600

880.85

31-Aug-07

840.10

872.00

840.00

868.20

205,300

868.20

30-Aug-07

842.00

848.95

830.00

833.75

99,200

833.75

29-Aug-07

811.40

838.00

811.40

833.90

129,200

833.90

28-Aug-07

842.00

844.00

821.15

832.45

56,800

832.45

27-Aug-07

801.15

850.00

801.15

830.70

117,600

830.70

24-Aug-07

781.90

801.90

767.00

790.20

304,700

790.20

23-Aug-07

799.00

799.00

765.20

777.10

206,300

777.10

22-Aug-07

770.00

787.50

749.10

766.70

167,700

766.70

21-Aug-07

792.80

794.80

760.00

767.95

52,100

767.95

20-Aug-07

810.00

812.75

780.00

782.20

97,700

782.20

17-Aug-07

794.00

794.00

720.00

780.05

305,400

780.05

16-Aug-07

817.00

817.00

782.05

791.15

76,600

791.15

14-Aug-07

833.85

834.00

818.00

822.20

72,200

822.20

13-Aug-07

820.00

834.90

813.00

830.25

77,900

830.25

10-Aug-07

819.70

819.70

795.00

810.25

184,600

810.25

9-Aug-07

841.00

869.00

821.00

828.80

203,700

828.80

8-Aug-07

834.00

840.00

826.10

837.40

119,400

837.40

32

7-Aug-07

834.80

844.90

821.05

824.70

103,900

824.70

6-Aug-07

836.00

838.80

819.05

825.20

89,000

825.20

3-Aug-07

834.85

856.90

830.05

850.25

158,900

850.25

2-Aug-07

825.00

840.50

820.00

836.30

83,500

836.30

1-Aug-07

835.00

835.00

815.00

821.00

192,800

821.00

31-Jul-07

847.35

854.00

826.15

843.15

135,600

843.15

30-Jul-07

829.65

850.00

821.20

847.35

173,600

847.35

27-Jul-07

830.00

844.00

823.50

829.65

332,500

829.65

26-Jul-07

815.00

857.90

814.15

841.00

704,700

841.00

25-Jul-07

820.00

830.00

807.10

809.60

78,100

809.60

24-Jul-07

841.80

841.80

815.00

819.15

72,400

819.15

23-Jul-07

820.00

839.70

805.50

833.65

93,200

833.65

20-Jul-07

830.00

837.90

820.10

828.00

66,800

828.00

19-Jul-07

819.00

830.25

813.00

826.65

84,400

826.65

18-Jul-07

823.05

829.90

809.00

821.95

65,700

821.95

(Source: Stock Quotes, 2007)

3.6 Conclusion The following results were predicted by the Neural Net Stock Model. The values shown in bold were not included in the Excel Model. The rest of the values were used.

25/7/2007

Actual Predictions 809.6 805.7

8/8/2007 21/8/2007 28/8/2007 4/9/2007 7/9/2007

837.40 767.95 832.45 893.95 872.90

832.80 764.25 831.85 896.12 871.83

1. The neural net model always underestimates from the actual value. No overestimations were observed. However with different data points this might be possible. This issue needs to be addressed with further work 2. The predicted values differed only in the first decimal place. We can safely claim that the neural net model is fairly accurate for estimating stock prices 3. This model may be put to use in wide applications like predicting cricket scores, exam dates. 4. This model has been used to solve problems where the relationships among the variables are not well defined. 33

3.7 Further Work 1.

2.

A study of global optimization algorithms - When there are many local optima, global optimization algorithms such as genetic algorithms can be used to perform global exploration of the solution space A study of neural networks to develop similar models for economic and financial requirements.

34

BIBLIOGRAPHY David A. Kendrick, P. Ruben Mercado, and Hans M. Amman: Computational Economics, Princeton University Press, 2006 Chary, S.N., Production and Operations Management, 3rd Edition, Tata McGraw Hill, 2004 Martinich, Joseph S., Production and Operations Management, Wiley-VCH,1996 Microeconomics (6th Edition), Robert S Pindyck, Daniel L. Rubinfeld, Prem L Mehta Lecture Notes On Solution Methods for Microeconomic Dynamic Stochastic Optimization Problems, Christopher D. Carroll, August 16, 2007, Johns Hopkins University

35

APPENDIX 1. Cobb Douglas Production Function 1.1 Cobb-Douglas production function shows physical output as the result of Douglas labour, capital inputs and a multiplicative factor; that is: Q = ALαKb where Q is output, A, α, b are constants, and L and K are labor and capital, respectively. It was proposed that when α+b = 1, the production function has constant return of scale (CRS) when α+b < 1, the production function has decreasing return of scale (DRS) when α+b > 1, the production function has increasing return of scale (IRS) 1.2 The use of this production function has been abandoned since 1961. 1.3 This was developed by PAUL DOUGLAS and mathematician CHARLES W. COBB. 1.4 This was developed after least squares regression analysis of production functions (over time) as observed by Cobb and Douglas showed that the shares of labour and capital in total output were constant over time. No theoretical reason was provided by them. , where xi is the quantity 1.5 In general, the CD Production function can be represented as of each good consumed during the production process, αi are each the demand elasticity of utility. 1.6 Using Q= KαL1 − α, where K is capital and L is labor makes the model coefficients 1, in mathematical terms this is first order homogenous. This would imply a constant return to scale. 1.7 The CES Production function replaced the Cobb Douglas Production Function. Q = A(aK - b-b + (1 - c)L - b-b) -

1 b

where Q is output, a, b, c are constants, K capital and L labor. 1.5 This was proposed by the Kenneth Arrow, Hollis Chenery, BAGICHA S. MINHAS, and Robert Solow. The name comes from Constant Elasticity of Substitution (CES) function. Source : 36

P H Douglas, 'Are There Laws of Production?', American Economic Review, vol. XXXVIII (March, 1948), 1-41 K Arrow, H Chenery, B Minhas and R Solow, 'Capital-Labor Substitution and Economic Efficiency', Review of Economics and Statistics, (August, 1961)

37

2. Ramsey Growth Model 2.1 Ramsey model consists of two equations 2.1.1 The law of motion for capital accumulation:

where k is capital per worker, c is consumption per worker, f(k) is output per worker, depreciation rate of capital.

is the



This equation states that investment, or increase in capital per worker ( k ) is (=) that part of output (f(k)) which is not consumed (- c), minus the rate of depreciation of capital ( δk ). 2.2.2 The law of saving behavior of households :

where r = rate of return on savings, ρ = rate at which consumption is discounted, dMU= percent •

change in marginal utility, c=consumption i.e. c = growth of consumption. This equation states that rate of return on savings = rate at which consumption is discounted percent change in marginal utility times the growth of consumption. One particular neoclassical production function with constant returns to scale is the CobbDouglas production function, the interest rate, r, will equal the marginal product of capital per worker. y = kα which implies that the interest rate is r = αkα − 1

38