Computational Techniques for Stability Analysis of a Class of Dynamic Economic Models

Modern microeconomics and macroeconomics study dynamic phenomena. Dynamics could predict future states of an economy based on its structural characteristics. Dynamic models in discrete time discrete state economic systems may take the form of one single linear difference equation or a system of linear difference equations. In this study we use Xcas and Mathematica as software tools in order to generate results concerning the dynamic properties of the solutions of the difference equation(s) and, determine whether an economic equilibrium exists. Our computational approach does not require solving the difference equation(s) and makes no assumptions for initial conditions. The results provide quantitative information based on the qualitative properties of the mathematical solutions rather than on their quantifiable ones. The relevant output of CAS software is created in a way as to be interpreted without the knowledge of advanced mathematics. The computer codes are fully presented and can be reproduced as they are in computational-based research practice and education.


INTRODUCTION
Dynamic economic analysis is to determine whether, given sufficient time, economic variables tend to converge to certain equilibrium (steady state) values.Time is considered as a discrete variable, meaning that any variable undergoes a change only once within a period of time.Thus, mathematical models used consist of one single or a simultaneous set of n-order linear difference equations.Linearity is not restrictive in economic applications since it may be imposed on a model through means of a first order taylor approximation.
In discrete time discrete state dynamic economic systems, only a subset of elements is given, these are the state variables of the economy such as the capital stock and asset position.Other variables may be free to take any value even in the initial period; these are typically flow variables such as consumption and labor.Classic discrete time discrete state economic models are the Cobweb model with memory of several periods, Samuelson multiplier-acceleration interaction model, inflationunemployment model in discrete time, dynamic market models, macroeconomic and macroeconometric models.
In multi equation models, difference equations are often combined into a single fundamental dynamic equation.A simple second or third order difference equation usually does not suffice to explain cycles and other fluctuation phenomena that economic activity generates.As models become larger their dynamic behavior becomes more difficult and less straightforward.Therefore, a proper usage of computer software off-loads manual solving procedures that require heavy mathematical background.Studies towards this direction are made in textbooks as (Amman et al., 1996;Huang and Crooke, 1997;Tesfatsion and Judd, 2006;Miranda and Fackler, 2004;Varian, 1996) and papers as (Kendrick and Amman, 1999;Al-Rawi et al., 2007).
The study is organized as follows.Materials and Methods section introduces the concepts of stability and asymptotic convergence and sets the theoretical Science Publications AJAS framework that ensures stability for a single, linear, constant coefficient difference equation.In addition, eigendecomposition and asymptotic stability are discussed for multivariable economic models expressed in matrix form.Results' section proposes computer codes for stability conditions for single difference equations and for systems of difference equations in Mathematica and Xcas.Then, asymptotic behavior in convergent cases is predicted.Some applications are used to perform computations' potential into several selected dynamic economic models.Finally, Discussion section concludes the study.

MATERIALS AND METHODS
When the solution of a dynamic economic system follows a restrictive non-explosive path this is what characterizes economic equilibrium.The structure of the mathematical model that insures existence of equilibrium has been studied among others in (Batra, 2006;Blanchard and Kahn, 1980;Folsom et al., 1976;Gu et al., 2003;Hamza and Khalaf-Allah, 2007;Jury, 1974).In economic applications stability appears to be a property with diachronic interest as shown in studies like (Chaumpsaur et al., 1977) up to recent studies of (Ratto, 2008;Gomes, 2010).
The solution that follows a convergent time path is considered stable.Figure 1a-d depict the motion of variables during a given period.Specifically, Fig. 1 a, b depict unstable solutions that belong to models with explosive behaviors.Figure 1c depicts a solution that follows a convergent time path with dampened oscillations; Fig. 1d depicts solutions with a nonoscillatory convergent time path.

Stability conditions for Linear Constant Coefficient Difference Equations
Stability Condition I.The general solution of a n-th order linear difference equation a 0 y t+n-1 +a 2 y t+n-1 +a 2 y t+n- 2 +…a n y t = g (t) consists of two parts, the complementary solution y c and the particular solution y p , so that y t = y c +y p .We are interested in the limiting behavior of the complementary function y c .We say that the general solution is stable if and only if c t lim y 0 →∞ = .Hence as t→∞, the behavior of the general solution of the difference equation is essentially that of the particular function.For a n-th order linear difference equation with constant coefficients, a necessary and sufficient condition for the particular solution to be stable is that Eq. 1: i r 1,i 1,..., n < = (1) where, r i are real or complex roots of the characteristic polynomial a 0 r n +a 1 r n-1 +a 2 r n-2 +…+a n = 0. Stability Conditions II.Next we present a determinental expression of necessary and sufficient stability conditions.
Schur Theorem.The real polynomial f (x) = a 0 x n +a 1 x n-1 + a 2 x n-2 +…+a n = 0 is called Schur stable if its roots x i are |x i |<1.The condition |x i |<1 holds if and only if the n determinants ∆ i (i = 1,…,n) are positive.Given: The determinants ∆ i are Eq.2: For a detailed analysis see (Chiang, 2006;Jury, 1974;Neumann, 1979).

Stability Conditions For Systems Of Linear Constant Coefficient Difference Equations
Stability Conditions III.Consider a system of linear constant coefficient first order difference equation in u k Eq. 3: Where: u k = A vector of date k economic variables A = Some square matrix By extending the vector u k and relabeling some lagged variables we can transform a higher order difference equation system into a first order difference equation (Chiang, 2006).It turns out that the eigenvalues of A help determining whether an equilibrium exists.After k steps there are k multiplications of the transformation A = PDP -1 and the solution of (3) is the solution of Eq. 4:

AJAS
Where: P = A matrix with columns the eigenvectors and characteristic vectors of the matrix A D = The Jordan matrix of A verifying D = P −1 AP (Strang, 1988) 5G p.264) The necessary stability conditions for the system (3) are Eq.5: Where: trA = The trace of the coefficient matrix Α n = The number of variables (Strang, 1988) 5J)

Computations in Mathematica
In Mathematica environment we can easily create the list of the absolute values of the characteristic roots.charvalues function takes as arguments the characteristic polynomial (poly) of the difference equation and its variable (var).charvalues function generates the list of the absolute values of the real or complex characteristic roots of the difference equation: For a direct answer to the stability test (1), we define stabilitytest function in Mathematica, with arguments the characteristic polynomial (poly) of the difference equation and its variable (var).Stabilitytest function returns «stable» for systems with equilibrium state(s) in case where the maximum element of the list of the Science Publications AJAS absolute values of the characteristic roots is less than 1 and «unstable» for systems that have explosive behavior otherwise: stabilitytest [poly_,var_]:=If [Max[Table[Abs [Root[poly,i]],{i,1,Length[Solve[poly ==0,var]],1}]]<1,stable,unstable] steadystate function in Xcas calculates the asymptotic behavior of the system u k+1 = A k u 1 = PD k P -1 u 1 after k=100000 steps.Let us define now steadystate function in Mathematica.Mathematica's steadystate function provides greater calculative precision, since the asymptotic behavior of the system is estimated for power k→∞.
The first argument of steadytate function in Mathematica contains system's coefficient matrix (a) and the second argument system's initial state (initial) in a column matrix form.steadytate function calculates the asymptotic behavior of the system in a column matrix form: Generalizing previous output, we create distributionk function, with arguments system's coefficient matrix (a) and system's initial state (initial).Distributionk function calculates the system state in step/time k, in a column matrix form.Steadystate and distributionk functions in Mathematica are based on the equality A k = PD k P −1 and use Mathematica's built in function JordanDecomposition which calculates a similarity matrix and the Jordan canonical form of a square matrix: Let us examine existence of equilibrium in a number of economic models.

The Cobweb Model
The supply function for period t is where S t Q is the quantity supplied and E t-1 (P t ) is the price that suppliers in period t-1 expected to prevail in period t.Assuming that E t-1 (p t ) = P t-1 -r∆P t-2 where ∆P t-2 = P t-1 -p t-1 -P t-2 is the price change from period t-2 to period t-1 and r is a parameter.If 0≤r≤1, suppliers expect the next price change, E t-1 (p t )-p t-1 , to be in the opposite direction of the previous price change, ∆P t-2 .If -1≤r≤0, suppliers expect the next price change to be in the same direction as the previous price change.The demand function is given by D t t . Substitutions lead to the following second-order difference equation: We will test the stability for several values of g, b, r, a, f.The example is taken from (Hoy et al., 2011)

The Cobweb Model for 3 Periods
The Cobweb model could give a higher order difference equation, i.e.:

A Macroeconometric Model
The following macroeconomic model is a quarterly model constructed by Kmenta and Smith.The equations were estimated with quarterly data over the period 1954-1963.The example is taken from (Pindyck and Rubinfeld, 1998).All the variables except for t and r are measured in billions of 1958 dollars and the variables G, M, TD and t are taken to be exogenous.
The original model by substituting C t-1 , S t-1 , S t-2 , I d t-1 , I r t-1 , I i t-1 , results in the fundamental dynamic equation:

Some Empirical Applications Application 1
Multinational companies in the U.S., Japan and Europe have assets of $4 trillion.At the start, $2 trillion are in the U.S. and $2 trillion in Europe.Each year ½ of the U.S. money stays home, ¼ goes to both Japan and Europe.For Japan and Europe ½ stays home and ½ is sent to the U.S. Find the limiting distribution of the $4 trillion as the world ends.Find the distribution at year k.(The application is taken from (Strang, 1988) ex. 5.3.11 p. 273).
The two macroeconomic models result in the system of difference equations: An initial solution of the system is the solution of the homogeneous system: We conclude that income vector Y t for both economies reaches a steady state as t→∞.

DISCUSSION
Computer packages provide solutions of the characteristic equations, letting the user compute their magnitude which yields to stability conclusions for difference equations.In our study, computer codes that test necessary and sufficient stability conditions in a black box function are proposed.We created stabilitytest and stabilitytest1, stabilitytest2 functions in Mathematica and Xcas correspondingly, to define whether the process of economic adjustment leads to equilibrium.When equilibrium can be accomplished as time passes, the output of our functions is «stable» and otherwise, when the model follows a divergent time path, the output of our functions is «unstable».
By stabilitytest function the stability result comes from checking the magnitude of the characteristic roots of a difference equation.In stabilitytest1 function, stability test is based on Schur's Theorem and the result appears without solving the characteristic equation.stabilitytest2 function was programmed using theory of n-dimensional linear algebra to generate stability conclusions for simultaneous difference equations in matrix form.Programmed functions in Mathematica are aimed at the wide community of Mathematica users.For readers with no access to Mathematica or other commercial software of the kind, computer algebra system Xcas is free to single users and institutions.
The reader can reproduce the results avoiding the serious theoretical and computational difficulty underlying in stability analysis.In addition, the computer codes presented can make an open source material to enrich stability analysis with results like the list of the real or complex characteristic roots in absolute value (charvalues function), the determinants of Schur theorem (schurseries function) and future state of economic systems (steadystate and distributionk functions in case of homogeneous systems).

CONCLUSION
This study aims at prediction of dynamic behavior of a class of discrete time discrete stage economic systems.Specifically, it examines whether they follow a convergent time path or not.In case convergence is assured, the asymptotic state of the system is given, taking into account its initial value.Stability results come from conditions depending on characteristic roots and/or determinental expressions of coefficient matrices of difference equations and not by the initial values of some elements.Steady state predictions apply Jordan Decomposition method.All results are generated by computer codes in both free computer algebra system Xcas and commercial mathematical package Mathematica.