Matrices Lecture - Econometrics - Unil
Matrices Lecture - Econometrics - Unil
David Staubli
[email protected]
2024
1 / 18
Matrices: terminology
We have (A′ )′ = A.
2 / 18
Vector multiplication
Consider two n × 1 vectors a and b such that:
a1 b1
a2 b2
a = . and b = .
.. ..
an bn
The inner product of a and b is given by:
X
n
a′ b = a1 b1 + a2 b2 + . . . + an bn = ai bi . (a scalar)
i=1
where
a′ b = b′ a.
Similarly,
X
n
a′ a = a2i .
i=1
3 / 18
Matrix multiplication
4 / 18
Some useful matrix algebra rules
Some matrix algebra rules since we need them to derive the OLS
estimator and its properties
A + B = B + A;
(A + B)′ = A′ + B′ ;
If A is n × m, then AIm = A and In A = A;
A(BC) = (AB)C;
(A + B)C = AC + BC; and
(AB)′ = B′ A′ .
In general, AB ̸= BA.
5 / 18
Symmetry, transpose and inverse of a matrix
We have: (A′ )′ = A.
If the matrix B exists, then it is the inverse of A if
B = A−1 .
We have,
A−1 A = I.
6 / 18
Rank and idempotence of a matrix
7 / 18
Trace of a matrix
X
K
tr(A) = akk .
k=1
8 / 18
Differentiating with respect to a vector
Let c and a be two k × 1 column vectors, then the product of c′ (the
transpose of c) and a is given by y = c′ a:
c1 a1
X
K
c = ... , a = ... , y = c′ a = c1 a1 + · · · + cK aK = ci ai
|{z}
i=1
cK aK scalar
| {z } | {z }
K×1 K×1
9 / 18
Differentiating with respect to a vector (2)
Make sure the derivative has the same dimensions as the vector with
respect to which we differentiate.
Taking the derivative of y with respect to c′ , we get:
dy
′
= dy
dc · · · dy
dc = a1 · · · aK = a′
dc 1 K
10 / 18
Differentiating with respect to a vector (3)
c1 a11 a12
c= , A= .
c2 a12 a22
| {z } | {z }
2×1 2×2
11 / 18
Differentiating with respect to a vector (4)
12 / 18
Differentiating with respect to a vector (5)
13 / 18
Review statistics
14 / 18
Review statistics (2)
= E(X) + E(Y)
E(AX) = AE(X)
15 / 18
Review statistics (3)
16 / 18
Review statistics (4)
V ar(Y1 ) ··· Cov(Y1 , Yn )
. .. ..
V ar(Y) = .
. . .
Cov(Yn , Y1 ) · · · V ar(Yn )
17 / 18
Review statistics (5)
18 / 18