1 ch. 4 linear models & matrix algebra matrix algebra can be used: a. to express the system of...
TRANSCRIPT
1
Ch. 4 Linear Models & Matrix Algebra
• Matrix algebra can be used:• a. To express the system of
equations in a compact manner.• b. To find out whether solution
to a system of equations exist.• c. To obtain the solution if it
exists.
2
4.1 Matrices and VectorsMatrices as ArraysVectors as Special Matrices
• Matrix is a rectangle array of parameter, coefficients, etc.
• A general form matrix Ax = d,
mn
n
n
mn
n
n
mm d
d
d
x
x
x
ax
ax
ax
axa
axa
axa
2
1
2
22
2
211
22121
2111
3
Step 1: Write in matrix format:
mn
n
n
mn
n
n
mm d
d
d
x
x
x
a
a
a
aa
aa
aa
2
1
2
21
2221
211
A x = d
A = parameter matrixx = variable column vectord = constant column vectorA general form matrix Ax = d, solve for x;
4
1
21
22221
11211
nnnn
n
n
aaa
aaa
aaa
nx
x
x
2
1
nd
d
d
2
1
Solving for X
x = A-1 d ,
where A-1 is the inverse (matrix) of A
5
Inverse A-1of Matrix of A
• Inverse of A is A-1 • AA-1 = A-1A = I• We are interested in
A-1 because x=A-1d
6
Derivation of matrix inverse formula
A-1 = adjoint A / |A|, where
|A| = ai1ci1 + …. + aincin (Determinant)
And, adjoint A = transposed cofactor matrix of A
7
Determinant, Cofactor, and Minor
3231
222113
3331
232112
3332
232211
aa
aaM
aa
aaM
aa
aaM
333231
232221
131211
aaa
aaa
aaa
A
ijji
ij MC 1
n
jjj CaA
111
8
How to get Determinant of A?
jj
j
n
j
n
jjj MaCaA
11
111
11 )1(
By Laplace Expansion of cofactors, and minors in case the first row is used.
9
• Pattern of the signs for cofactor minors
:1__ jionfocus
10
Adjoint of A: the transposed cofactor matrix
mmm
n
n
nxn
aaa
aaa
aaa
A
21
22221
11211
mnmmi
n
x
CCC
CCC
CCC
C
2
22221
11211
Aadj
CCC
CCC
CCC
C
nnnn
m
m
nxn
21
22212
12111
11
Calculating Adjoint is hard!
Is there any easier way to solve for x or specifically one of x, that is, xi ?
12
Cramer's Rule for each of x, say, x1 : “The easy way”
A
Ax i
i
•The numerator represents a determinant of A in which the ith column is replaced by the vector of constants, i.e., no need to invert A!
13
Solving for x1 using Cramer’s rule
• Find the determinant |A|• Find the determinant |A1|
where di is the constant vector substituted for the 1st col.• X1 = |A1|/|A|• Repeat for X2 by substituting the constant vector for the 2nd
col. And solving for |A2| and so on as necessary
mmm
n
n
nxn
aaa
aaa
aaa
A
21
22221
11211
nnnn
n
n
nxn
aad
aad
aad
A
2
2222
1121
1
14
1
21
22221
11211
nnnn
n
n
aaa
aaa
aaa
nn dx
dx
dx
/
/
/
22
11
1
12
/
/
1
dd
dd
n
Solving for x1 / d1
15
What about Comparative Statics?
333231
232221
131211
aaa
aaa
aaa
A