1. Trang chủ
  2. » Tài Chính - Ngân Hàng

Basic Mathematics for Economists - Rosser - Chapter 15 doc

45 303 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 45
Dung lượng 304,43 KB

Nội dung

15 Matrix algebra Learning objectives After completing this chapter students should be able to: • Formulate multi-variable economic models in matrix format. • Add and subtract matrices. • Multiply matrices by a scalar value and by another matrix. • Calculate determinants and cofactors. • Derive the inverse of a matrix. • Use the matrix inverse to solve a system of simultaneous equations both manually and using a spreadsheet. • Derive the Hessian matrix of second-order derivatives and use it to check the second-order conditions in an unconstrained optimization problem. • Derive the bordered Hessian matrix and use it to check the second-order conditions in a constrained optimization problem. 15.1 Introduction to matrices and vectors Suppose that you are responsible for hiring cars for your company’s staff to use. The weekly hire rates for the five different sizes of car that are available are: Compact: £139, Intermediate: £160, Large: £205, 7-Seater People Carrier: £340 and Luxury limousine: £430. For next week you know that your car hire requirements will be: 4 Compact, 3 Intermediate, 12 Large, 2 People Carrier and 1 Luxury limousine. How would you work out the total car hire bill? If you worked out total expenditure as 4 ×£139 + 3 × £160 +12 × £205 + 2 ×£340 + 1 × £430 = £4,606 then you would be correct. Youwould have also already done a matrix multiplication problem, although you may not have realized it! Before we look at the formal theory of matrices, let us continue with this example for a while longer. If you know that your car hire requirements will change from week to week, it can help make calculations clearer if the number of cars required in each category are set out in tabular form,asinTable15.1. © 1993, 2003 Mike Rosser Table 15.1 Cars required Week 1 Week 2 Week 3 Compact 4 7 2 Intermediate 3 5 5 Large 12 9 5 People carrier 2 1 3 Luxury limousine 1 1 2 The total car hire bill for each week can then be calculated by multiplying the number of cars to be hired in each category by the corresponding price. A matrix is defined as an array of numbers (or algebraic symbols) set out in rows and columns. Therefore, the car hire requirements for the 3-week period in this example can be set out as the matrix A =       472 355 12 9 5 213 112       where each row corresponds to a size of car and each column corresponds to a week. The usual notation system is to denote matrices by a capital letter in bold type, as for matrix A above, and to enclose the elements of a matrix in a set of squared brackets, i.e. [ ]. Matrices may also be specified with algebraic terms instead of numbers. Each entry is usually known as an ‘element’. The elements in each matrix must form a complete rectangle, without any blank spaces. For example, if there are 5 rows and 3 columns there must be 3 elements in each row and 5 elements in each column. An element may be zero though. The size of a matrix is called its ‘order’. The order is specified as: (number of rows) × (number of columns) For example, the matrix A above has 5 rows and 3 columns and so its order is 5 ×3. Matrices with only one column or row are known as vectors. These are usually represented by lower case letters, in bold. For example, the set of car rental prices we started this chapter with can be specified (in £) as the 1 × 5 row vector p =  139 160 205 340 430  and the car hire requirements in week 1 can be specified as the 5 ×1 column vector q =       4 3 12 2 1       Matrix addition and subtraction Matrices that have the same order can be added together, or subtracted. The addition, or subtraction, is performed on each of the corresponding elements. © 1993, 2003 Mike Rosser Example 15.1 A retailer sells two products, Q and R, in two shops A and B. The number of items sold for the last 4 weeks in each shop are shown in the two matrices A and B below, where the columns represent weeks and the rows correspond to products Q and R, respectively. A =  5 4 12 7 10 12 9 14  and B =  89 34 818215  Derive a matrix for total sales for this retailer for these two products over the last 4 weeks. Solution Total sales for each week will simply be the sum of the corresponding elements in matrices A and B. For example, in week 1 the total sales of product Q will be 5 plus 8. Total combined sales for Q and R can therefore be represented by the matrix T = A +B =  5 4 12 7 10 12 9 14  +  89 34 818215  =  5 + 84+ 912+ 37+ 4 10 +812+ 18 9 + 21 14 +5  =  13 13 15 11 18 30 30 19  An element of a matrix can be a negative number, as in the solution to the example below. Example 15.2 If A =  12 30 815  and B =  735 48  what is A − B? Solution A − B =  12 30 815  −  735 48  =  12 −730− 35 8 − 415− 8  =  5 −5 47  Scalar multiplication There are two forms of multiplication that can be performed on matrices. A matrix can be multiplied by a specific value, such as a number (scalar multiplication) or by another matrix (matrix multiplication). Scalar multiplication simply involves the multiplication of eachelementinamatrixbythescalarvalue,asinExample15.3.Matrixmultiplicationis rather more complex and is explained later, in Section 15.2. © 1993, 2003 Mike Rosser Example 15.3 The number of units of a product sold by a retailer for the last 2 weeks are shown in matrix A below, where the columns represent weeks and the rows correspond to the two different shop units that sold them. A =  12 30 815  If each item sells for £4, derive a matrix for total sales revenue for this retailer for these two shop units over this two-week period. Solution Total revenue is calculated by multiplying each element in matrix of sales quantities A by the scalar value 4, the price that each unit is sold at. Thus total revenue can be represented (in £) by the matrix R = 4A =  4 × 12 4 ×30 4 × 84× 15  =  48 120 32 60  The scalar value that a matrix is multiplied by may be an algebraic term rather than a specific number value. For example, if the product price in Example 15.3 above was specified as p instead of £4 then the total revenue matrix would become R =  12p 30p 8p 15p  Scalar division works in the same way as scalar multiplication, but with each element divided by the relevant scalar value. Example 15.4 If the set of car rental prices in the vector p =  139 160 205 340 430  includes VAT (Value Added Tax) at 17.5% and your company can claim this tax back, what is the vector v of prices without this tax? Solution First of all we need to find the scalar value used to scale down the original vector element values. As the tax rate is 17.5% then the quoted prices will be 117.5% times the basic price. Therefore a quoted price divided by 1.175 will be the basic price and so the vector of prices (in £) without the tax will be v =  1 1.175  p =  1 1.175   139 160 205 340 430  =  1 1.175  139  1 1.175  160  1 1.175  205  1 1.175  340  1 1.175  430  =  118.30 136.17 174.47 289.36 365.96  © 1993, 2003 Mike Rosser Test Yourself, Exercise 15.1 1. A firm uses 3 different inputs K, L and R to make two final products X and Y. Each unit of X produced requires 2 units of K, 8 units of L and 23 units of R. Each unit of Y produced requires 3 units of K, 5 units of L and 26 units of R. Set up these input requirements in matrix format. 2. ‘A vector is a special form of matrix but a matrix is not a special form of vector’. Is this statement true? 3. For the pairs of matrices below say whether it is possible to add them together and then, where it is possible, derive the matrix C = A + B. (a) A =  235 18 15  and B =  435 98  (b) A =  53 81  and B =  702 881  (c) A =       10 3 12 6 1       and B =       4 0 2 −9 1       4. A company sells 4 products and the sales revenue (in £m.) from each product sold through the company’s three retail outlets in a year are given in the matrix R =   7314 6382.5 41.22 0   If profit earned is always 20% of sales revenue, use scalar multiplication to derive a matrix showing profit on each product for each retail outlet. 15.2 Basic principles of matrix multiplication If one matrix is multiplied by another matrix, the basic rule is to multiply elements along the rows of the first matrix by the corresponding elements down the columns of the second matrix. The easiest way to understand how this operation works is to first work through some examples that only involve matrices with one row or column, i.e. vectors. Returning to our car hire example, consider the two vectors p =  139 160 205 340 430  and q =       4 3 12 2 1       The row vector p contains the prices of hire cars in each category and the column vector q contains the quantities of cars in each category that your company wishes to hire for the week. © 1993, 2003 Mike Rosser At the start of this chapter we worked out the total car hire bill as 139 × 4 + 160 × 3 + 205 × 12 + 340 × 2 + 430 × 1 = £4,606 In terms of these two vectors, what we have done is multiply the first element in the row vector p by the first element in the column vector q. Then, going across the row, the second element of p is multiplied by the second element down the column of q. The same procedure is followed for the other elements until we get to the end of the row and the bottom of the column. Now consider the situation where the car hire prices are still shown by the vector p =  139 160 205 340 430  but there are now three weeks of different car hire requirements, shown by the columns of matrix A =       472 355 12 9 5 213 112       To calculate the total car hire bill for each of the three weeks, we need to find the vector t = pA This should have the order 1 × 3, as there will be one element (i.e. the bill) for each of the three weeks. The first element of t is the bill for the first week, which we have already found in the example above. The car hire bill for the second week is worked out using the same method, but this time the elements across the row vector p multiply the elements down the second column of matrix A, giving 139 × 7 + 160 × 5 + 205 × 9 + 340 × 1 + 430 × 1 = £4,388 The third element is calculated in the same manner, but working down the third column of A. The result of this matrix multiplication exercise is therefore t = pA =  139 160 205 340 430        472 355 12 9 5 213 112       =  4606 4388 3983  The above examples have shown how the basic principle of matrix multiplication involves the elements across a row vector multiplying the elements down the columns of the matrix being multiplied, and then summing all the products obtained. If the first matrix has more than one row (i.e. it is not a vector) then the same procedure is followed across each row. This means that the number of rows in the final product matrix will correspond to the number of rows in the first matrix. © 1993, 2003 Mike Rosser Example 15.5 Multiply the two matrices A =  23 81  and B =  752 481  Solution Using the method explained above, the product matrix will be AB =  23 81  752 481  =  2 ×7 + 3 × 42× 5 +3 ×82× 2 + 3 × 1 8 × 7 + 1 × 48×5 + 1 × 88× 2 + 1 × 1  =  26 34 7 60 48 17  You now may be wondering what happens if the number of elements along the rows of the first matrix (or vector) does not equal the number of elements in the columns of the matrix that it is multiplying. The answer to this question is that it is not possible to multiply two matrices if the number of columns in the first matrix does not equal the number of rows in the second matrix. Therefore, if a matrix A has order m × n and another matrix B has order r ×s, then the multiplication AB can only be performed if n = r, in which case the resulting matrix C = AB will have order (m × s). This principle is illustrated in Example 15.5 above. Matrix A has order 2 ×2 and matrix B has order 2 × 3 and so the product matrix AB has order 2 × 3. Some other examples of how the order of different matrices affects the order of the product matrix when they are multiplied are given in Table 15.2. Table 15.2 ABOrder of product matrix AB 5 × 33×25×2 1 × 88×11×1 3 × 52×4 Matrix multiplication not possible 3 × 44×33×3 4 × 34×3 Matrix multiplication not possible Test Yourself, Exercise 15.2 1. Given the vector v =  25  and matrix A =  62 37  find the product matrix vA. 2. For the pairs of matrices below say if it is possible to derive the product matrix C = AB and, when this is possible, calculate the elements of this product matrix. (a) A =  210 715  and B =  42 98  © 1993, 2003 Mike Rosser (b) A =  53 81  and B =  702 12 8 1  (c) A =       9 3 12 6 1       and B =       4 0 2 −9 1       3. A company’s input requirements over the next four weeks for the three inputs X, Y and Z are given (in numbers of units of each input) by the matrix R =   20.51 7 6382.5 4520   The company can buy these inputs from two suppliers, whose prices for the three inputs X, Y and Z are in given (in £) by the matrix P =  462 581  where the two rows represent the suppliers and the three columns represent the input prices. Use matrix multiplication to derive a matrix that will give the total input bill for the next four weeks for both suppliers. 15.3 Matrix multiplication – the general case Now that the basic principles have been explained with some straightforward examples, we can set out a general formula for matrix multiplication that can be applied to more complex matrix multiplication exercises. The general m × n matrix with any number of rows m and columns n can be written as A =      a 11 a 12 ··· a 1n a 21 a 22 ··· a 2n . . . . . . . . . . . . a m1 a m2 ··· a mn      For each element a ij the subscript i denotes the row number and the subscript j denotes the column number. For example a 11 = element in row 1, column 1 a 12 = element in row 1, column 2 a 1n = element in row 1, column n a mn = element in row m, column n © 1993, 2003 Mike Rosser If this general m ×n matrix A multiplies the general n ×r matrix B then the product will be the m × r matrix C. Thus we can write AB =      a 11 a 12 ··· a 1n a 21 a 22 ··· a 2n . . . . . . . . . . . . a m1 a m2 ··· a mn           b 11 b 12 ··· b 1r b 21 b 22 ··· b 2r . . . . . . . . . . . . b n1 b n2 ··· b nr      =      c 11 c 12 ··· ··· c 1r c 21 c 22 ··· ··· c 2r . . . . . . . . . . . . . . . c m1 c m2 ··· ··· c mr      = C where c 11 =a 11 b 11 +a 12 b 21 + ···+a 1n b n1 c 12 =a 11 b 12 +a 12 b 22 + ···+a 1n b n2 . . . . . . . . . . . . c mr =a m1 b 1r +a m2 b 2r + ···+a mn b nr Example 15.6 Find the product matrix C = AB when A =   4212 6020 18 5   and B =   10 0.51 7 6382.5 4420   Solution Using the general matrix multiplication formula, the elements of the first two rows of the product matrix C can be calculated as: c 11 = 4 × 10 + 2 × 6 + 12 × 4 = 40 + 12 + 48 = 100 c 12 = 4 × 0.5 + 2 × 3 + 12 × 4 = 2 + 6 +48 = 56 c 13 = 4 × 1 + 2 × 8 + 12 × 2 = 4 +16 + 24 = 44 c 14 = 4 × 7 + 2 × 2.5 + 12 × 0 = 28 +5 +0 = 33 c 21 = 6 × 10 + 0 × 6 + 20 × 4 = 60 + 0 + 80 = 140 c 22 = 6 × 0.5 + 0 × 3 + 20 × 4 = 3 + 0 + 80 = 83 c 23 = 6 × 1 + 0 × 8 + 20 × 2 = 6 + 0 + 40 = 46 c 24 = 6 × 7 + 0 × 2.5 + 20 × 0 = 42 + 0 + 0 = 42 © 1993, 2003 Mike Rosser Now try and calculate the elements of the final row yourself. You should get the values c 31 = 78,c 32 = 44.5,c 33 = 75,c 34 = 27 The complete product matrix will therefore be C = AB =   100 56 44 33 140 83 46 42 78 44.57527   Although the calculations for matrix multiplication of small matrices can be done manually fairly quickly, it is now becoming obvious that for large matrices the calculations will be very tedious and time-consuming. Several economics applications involving matrix multiplication do not actually require you to calculate all the elements of the product matrix. For occasions when you do need to calculate all these elements, an Excel spreadsheet can be used. Using Excel for matrix multiplication The best way to explain how to use the Excel MMULT formula to multiply two matrices A and B is to work through an example. Example 15.7 Given the two matrices A =  843 456  and B =   0.80.30.1 0.50.20.4 0.30.20.1   find the product matrix AB using an Excel spreadsheet. Solution (a) Enter the values of matrices A and B on a spreadsheet. For example, put the elements of A in cells (A2; C3) and the elements of B in cells (E2; G4). You can also enter labels for the matrix names in the rows of cells above. (b) Highlight the cells where you want the calculated AB matrix to go. Since the order of A is 2 × 3 and the order of B is 3 × 3 the product matrix AB must have order 2 × 3. You therefore need to highlight a block of cells with 2 rows and 3 columns, such as (A6; C7). (c) With this cell range still highlighted, enter the formula = MMULT(A2;C3,E2;G4) or use whatever cells range applies for your matrices to be multiplied, or use mouse to mark out matrices to be multiplied with dotted lines. (d) Hold down the CNTRL and SHIFT keys together and press ENTER (if you do not do this then the formula will not treat all the highlighted cells as part of an array, i.e. a matrix). YourspreadsheetandthecomputedproductmatrixABshouldnowbeasshowninTable15.3. In the simple example above you can check the answers manually. However, once you are satisfied that you can use the Excel MMULT formula properly then you can use it for more complex examples where manual computation would be too time-consuming. © 1993, 2003 Mike Rosser [...]... 9 8 39 1 -7 0 7 0.11969 -0 .0504 -1 E-17 0.06457 -0 .1339 -5 E-18 0.32077 -0 .1805 -0 .0512 0.05788 -0 . 0156 -0 .0118 -0 .0634 0.03194 0.03343 -0 .0253 0.0331 -0 .0137 -0 .1339 0.08268 -1 E-17 -0 .0591 0.11024 4.5E-18 G H b 21 593 317 35 678 391 A ^-1 *b = x solution 5 values 2 12 1 8 4 Estimating the parameters of an economic model One important use of the matrix method of solution for a set of unknown variables is... exponent format displayed in Excel For example the number −1E − 17 is −1 divided by 1017 Table 15. 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B Example 15. 17 A MATRIX 4 1 8 9 24 41 6 5 9 11 28 49 Inverse A ^-1 -0 .0453 0.08783 0.02431 -0 .0509 0.03398 -0 .0162 -0 .0723 0.03416 0.03184 -0 .0257 0.00247 0.02302 © 1993, 2003 Mike Rosser C D E F 2 23 9 0 39 4 -1 7 15 3 -1 23 5 -5 11 0 3 15 9 8 39 1 -7 0 7 0.11969 -0 .0504... matrix is C = −14 −2 15 9 −2 4 2 5   25 −14 15 9  Therefore the adjoint matrix will be AdjA = CT =  15 −2 −12 12 −2 The inverse matrix The formula for A−1 , the inverse of matrix A, can now be stated as A−1 = AdjA |A| as long as the determinant |A| is non-singular, i.e it must not be zero Example 15. 15  2 Find the inverse matrix A−1 for matrix A = 3 4 © 1993, 2003 Mike Rosser 4 5 2  3 0 5... ∂x∂y 2 These second-order conditions can be expressed more succinctly in matrix format For clarity the abbreviated format for specifying second-order partial derivatives is also used, e.g fxx represents ∂ 2 f/∂x 2 , fxy represents ∂ 2 f/∂x∂y, etc © 1993, 2003 Mike Rosser The Hessian matrix The Hessian matrix contains all the second-order partial derivatives of a function, set out in the format shown in... with only two variables encountered in Chapter 10 If one tries to find a maximum or minimum for the two variable function f(x, y) then the FOC (first-order conditions) for both a maximum and a minimum require that ∂f =0 ∂x and ∂f =0 ∂y SOC (second-order conditions) require that ∂ 2f 0 ∂y 2 for a minimum and, for both a maximum and a minimum ∂... take the above formula for the matrix inverse as given and there is no need for you to work through the proof of this result for the general case However, we can show how the inverse formula can be derived for the case of a 2 × 2 matrix = a c b d This inverse can be specified as A−1 = e g f h Assume that we wish to invert the matrix A where e, f, g and h are numbers that the inverse formula will calculate... Exercise 15. 8, use Cramer’s rule to find the values of the unknown variables in questions 1 and 2 (Check that these are the same as those found by the matrix inverse method.) 3 15. 10 Second-order conditions and the Hessian matrix Matrix algebra can help derive the second-order conditions for optimization exercises involving any number of variables To explain how, first consider the second-order conditions for. .. along the second row, will be 10 |A| = 4 5 3 0 2 6 5 = −4(6 − 12) + 0 − 5(20 − 15) = 24 − 25 = −1 2 The matrix inverse will therefore be   −10 6 15  17 10 −26  10 8 −5 −12 AdjA A−1 = = −17 = |A| −1 −8 −6 10 5  15 26  12 To solve for the vector of unknowns x we calculate      10 −6 15 76 (10 × 76) − (6 × 41) − (15 × 34) 26  41 = (−17 × 76) + (10 × 41) + (26 × 34) x = A−1 b = −17 10... variables A typical vector format for a function is q = βx where β is the vector of coefficients for the exogenous explanatory variables in vector x For example, assume that the demand for oil in time t is the linear function t t t t t q t = β0 + β1 x1 + β2 x2 + β3 x3 + β4 x4 + β5 x5 © 1993, 2003 Mike Rosser where the superscript t denotes the time period (rather than an exponent) for all variables and x1... matrix formulation x = A−1 b we first have to derive the matrix inverse A−1 The first step is to derive the cofactor matrix, © 1993, 2003 Mike Rosser which will be  (0 − 10) −(8 − 25) C = −(6 − 12) (20 − 30) (15 − 0) −(50 − 24)   −10 (8 − 0) −(20 − 15)  =  6 15 (0 − 12) 17 −10 −26  8 −5  −12 The adjoint matrix will be the transpose of the cofactor matrix and so  −10 AdjA = CT =  17 8 6 −10 −5  15 . units that sold them. A =  12 30 815  If each item sells for £4, derive a matrix for total sales revenue for this retailer for these two shop units over this two-week period. Solution Total revenue. 7 10 12 9 14  and B =  89 34 818 215  Derive a matrix for total sales for this retailer for these two products over the last 4 weeks. Solution Total sales for each week will simply be the sum. of eachelementinamatrixbythescalarvalue,asinExample15.3.Matrixmultiplicationis rather more complex and is explained later, in Section 15. 2. © 1993, 2003 Mike Rosser Example 15. 3 The number of units of a product sold by a retailer for the

Ngày đăng: 06/07/2014, 07:20

TỪ KHÓA LIÊN QUAN