* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download EC220 - Web del Profesor
Quadratic form wikipedia , lookup
Elementary algebra wikipedia , lookup
Tensor operator wikipedia , lookup
Jordan normal form wikipedia , lookup
Signal-flow graph wikipedia , lookup
System of polynomial equations wikipedia , lookup
History of algebra wikipedia , lookup
Eigenvalues and eigenvectors wikipedia , lookup
Basis (linear algebra) wikipedia , lookup
Matrix (mathematics) wikipedia , lookup
Singular-value decomposition wikipedia , lookup
Bra–ket notation wikipedia , lookup
Cartesian tensor wikipedia , lookup
Perron–Frobenius theorem wikipedia , lookup
Determinant wikipedia , lookup
Non-negative matrix factorization wikipedia , lookup
Orthogonal matrix wikipedia , lookup
Four-vector wikipedia , lookup
Linear algebra wikipedia , lookup
Cayley–Hamilton theorem wikipedia , lookup
Matrix multiplication wikipedia , lookup
EC220. Open Economy Macroeconomics University of Vermont Department of Economics System of Equations and Matrix Algebra This is an aid guide for the math that we will be covering in this particular course. If you are interested in more details, I strongly recommend the following textbook. Chiang, Alpha and Kevin, Wainwright (2005) Fundamental Methods of Mathematical Economics. 4th Edition. McGraw Hill. In order to solve a system of three linear equations, the basic concepts that you need to understand and be able to work with are: a. Linear equations and system of equations b. Matrix and determinants c. Cramer’s rule a. Linear Equations and System of Equations The general form of a linear equation can be written as: ay bx cz 0 (1) where y, x, and z are variables and a, b, and c are called coefficients or parameters because their values are predetermined or given. Variables can be exogenous or endogenous. An endogenous variable is one whose value(s) is(are) determined within the system while an exogenous variable is one whose value is determined outside the system. For instance, in some simple Economic models, exogenous variables might be the money supply, government spending, and taxes. Output, the price level, and the real interest are endogenous variables. A familiar linear equation is the one for a straight line, such as: y a bx For example: y 3 2x (2) A system of linear equations is a set of two or more linear equations. For example: the system the demand and supply form. These equations form a system because there are two equations, there are two unknown variables (Price and Quantity) and each equation has variables that we assumed are exogenous. Another example is the SavingInvestment model. Saving and investment depend on the real interest rate. The equilibrium condition requires that Saving=Investment (loanable funds) and the real interest rate adjust to make them equal. In other words, the two unknown variables are “the funds” (S=I) and the real interest rate. The exogenous variables are (T-G) and “exogenous” investment (Io) (investor preferences, income, productivity, investment tax credits, and so on). More precisely, a general form of a system of equations can be written as: ax by cz d ex fy gz h (3) ix jy kz l For example: 5x 3 y 2 z 0 4y z 3 (4) 3x 2 y 4 z 7 This is a system of 3 equations and 3 unknown variables: x, y, and z. b. Matrices and Determinants Suppose you have two matrices A and B and a column vector V given by: a A = e i b f j c g ; k m n o p B = q r s t ; u v w V = Notice that matrix A has rank 3x3 because it has 3 rows and 3 columns. B’s rank is 3x4 because B is a matrix with 3 rows and 4 columns, and finally V is a column vector with 3 rows and 1 column or 3x1. Two vectors can be multiplied if and only if the number of columns of a ROW vector equals the number of rows of a COLUMN vector (both vectors are compatible). By the same token, two matrices A and B can be multiplied if and only if the number of columns of A equals the number of rows of B (Both matrices are compatible). Using matrices A and B and the column vector V, we see that A has 3 columns, B has 3 rows, and V has 3 rows. According to the previous paragraph, multiplication is possible between matrices A and B and between matrix A and column vector V because A & B and A & V are compatible. By the same logic, the product between B and V is not feasible or not compatible. Let W be a column vector with 3 rows and 1 column or 3x1. Therefore, W3x1 = A3x3V3x1 a W = e i b f j c g k = a b c e f g i j k (5) As you can see, W has 3 elements: a b c , e f g , and i j k . Each one of these elements of W is the sum of the products between the corresponding elements of a row of matrix A and the column vector V. For example: 1 2 3 A = 4 5 6 ; 7 8 9 12 11 10 9 B = 8 7 6 5 ; 4 3 2 1 2 V = 3 4 Then, W = AV 1 2 3 2 W = 4 5 6 3 = 2 6 12 8 15 24 14 24 36 = 20 47 74 7 8 9 4 If we apply the same logic, we can compute the product between A and B. Let C = AB. Notice that C is going to be 3x4. a C = e i b f j c g k m n o p am bq cu an br cu ao bs cw ap bt c q r s t = em fq gu en fr gv eo fs gw ep ft g u v w im jq ku in jr kv io js kw ip jt k (6) For example: 1 2 3 12 11 10 9 12 16 12 11 14 9 10 12 6 9 10 3 C = 4 5 6 8 7 6 5 = 48 40 24 44 35 18 40 30 12 36 25 6 7 8 9 4 3 2 1 84 64 36 77 56 27 70 48 18 63 40 9 40 34 28 22 C = 112 97 82 67 184 160 136 112 A determinant of a matrix |D| is a number associated with a squared matrix and equals the sum of the products of the elements along the main diagonals minus the sum of the products of the elements along the secondary diagonals. Let D be a squared matrix. a D = e i b f j c g k Then, |D| = (afk + bgi + ejc) – (cfi + bek + jga) For example: 2 1 3 D = 4 0 1 then |D| = (0 + 2 + 36) – (0 + 6 + 20) = 38 – 26 = 12 2 3 5 |D| = 12 Now, turning the attention to the system of equations and by making use of matrix multiplication properties, system (3) above can be written in matrix form as: a e i b f j c x d g y h k z l (7) notice that if you multiply the matrix of the coefficients by the column vector of the variables you get the left hand side of the system above. Example: consider the system of equations in (4) 5x 3 y 2 z 0 4y z 3 3x 2 y 4 z 7 Write this system in matrix form: 5 3 2 x 0 0 4 1 y 3 3 2 4 z 7 As you can see, if you multiply the matrix of the coefficients (3x3) by the vector of unknown variables (3x1) you will get a COLUMN vector (3x1) with three elements. Each element is the corresponding left hand side of each equation in system (4) c. Cramer’s Rule In brief, Cramer’s rule is an approach that allows us to solve a system of linear equations. It consists of the following steps: 1. Write the system in matrix form a e i b f j c x d g y h k z l 2. Compute the determinant for the unknown variables coefficient matrix. |D| = (afk + bgi + ejc) – (cfi + bek + jga) 3. Substitute the left hand side column of the coefficient matrix with the right hand side vector of values on the column of the coefficient matrix that correspond to the order of the variable in the vector of unknown variables. For example, if you want to find x, then the substitution is for the first column. For y would be the second column, and so on. For x: d Dx = h l For y: b f j c g k Dy = For z: a d e h i l c g k a Dz = e i b f j d h l 4. Compute the determinants of Dx, Dy, and Dz. |Dx| = (dfk + bgl + hjc) – (cfl + jgd + hbk) |Dy| = (ahk + dgi + elc) – (chi + edk + lga) |Dz| = (afl + bhi + ejd) – (dfi + jha + ebl) 5. Find the value of each variable: divide each variable associated determinant (obtained in 4) by the determinant of the coefficient matrix |D|. x | Dx | |D| y | Dy | |D| z | Dz | |D| Example: Let’s follow the instructions step by step: 1. Write the system of equations in matrix form: 5 3 2 x 0 0 4 1 y 3 3 2 4 z 7 2. Compute the determinant of the coefficient matrix |D| = (–80 – 9 + 0) – (–24 + 10 + 0) = – 89 + 24 – 10 = -75 3. Substitute the left hand side column of the coefficient matrix with the right hand side vector of values on the column of the coefficient matrix that correspond to the order of the variable in vector of unknown variables. For x: For y: For z: 0 3 2 1 Dx = 3 4 7 2 4 5 0 2 0 3 1 Dy = 3 7 4 5 3 0 4 3 Dz = 0 3 2 7 4. Compute their determinants |Dx| = (0 – 21 – 12) – (– 56 + 36 + 0) = – 33 +20 = -13 |Dy| = (-60 + 0 + 0) – (–18 + 35 + 0) = -77 |Dz| = 140 – 27 + 0 – (0 + 0 +30) = 83 5. Find the value of each variable. x = -13/-75 = 0.1733; y = -77/-75 = 1.0267; z = 83/-75 = -1.1067