86
Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical skills, to the level needed for success in the Royal Holloway economics masters. Why do we need maths/statistics? - to improve your understanding of Economics. - As such everything in the course tailored to try to bring out the relevance of the techniques you will (re)learn help the analysis of Economic issues

Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Embed Size (px)

Citation preview

Page 1: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Economics Masters Refresher Course in Mathematics

• Lecturer: Jonathan Wadsworth

• Teaching Assistant: Tanya Wilson

• Aim: to refresh your maths and statistical skills, to the level needed for success in the Royal Holloway economics masters.

• Why do we need maths/statistics?

- to improve your understanding of Economics.

- As such everything in the course tailored to try to bring out the relevance of the techniques you will (re)learn help the analysis of Economic issues

Page 2: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Economics Masters Refresher Course in Mathematics

• How to do it?

• Lectures 10-1 and classes 2:30-3:30 each day.

• In the afternoons and evening you will be expected to:

– Read the text

– Do the daily problem set.

– Prepare to present your answers to the class the next day.

Page 3: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Vectors and matrices

Learning objectives. By the end of this lecture you should:

– Understand the concept of vectors and matrices

– Understand their relationship to economics

– Understand vector products and the basics of matrix algebra

Introduction

Often interested in analysing the economic relationship between several variables

Use of vectors and matrices can make the analysis of complex linear economic relationships simpler

Page 4: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Lecture 1. Vectors and matrices

1. Definitions

Vectors are a list of numbers or variables – where the order ultimately matters

– E.g. a list of prices, a list of marks in a course test.

– (Pricelabour , Pricecapital )

– (25, 45, 65, 85)

Since this is just a list can store the same information in different ways

Can enter the list either horizontally or vertically

(25, 45, 65, 85) or

85

65

45

25

Page 5: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Dimensions of a vector

If a set of n numbers is presented horizontally it is called a row vector

with dimensions 1 x n

(so the number of rows is always the 1st number in a dimension and the number of columns is always the 2nd number)

Eg

a = (25, 45, 65, 85) is a 1 x 4 row vector

If a set of n numbers is presented vertically it is called a column vector

with dimensions n x 1

Eg

(Note tend to use lower case letters (a b c etc) to name vectors )

Definitions

85

65

45

25

b

Page 6: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Special Types of vector

A null vector or zero vector is a vector consisting entirely of zeros

e.g. (0 0 0) is a 1 x 3 null row vector

A unit vector is a vector consisting entirely of ones denoted by the letter i

e.g. is a 4 x 1 unit column vector

Definitions

1

1

1

1

i

Page 7: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Adding vectors

General rule

If a = (a1, a2 ......an) and b = (b1, b2 ......bn)

then a+b = (a1+ b1, a2 + b2, ......an + bn)

e.g. (0 2 3 ) + ( 1 0 4) = (0+1, 2+0, 3+4) = (1 2 7)

(same rule for addition of column vectors )

Note that the result is a vector with the same dimension 1 x n

Note you can only add two vectors if they have the same dimensions

e.g. you cannot add (0 2 3) and (0 1) (1 x 3 & 1 x 2)

Note also that sometimes adding two vectors may be mathematically ok, but economic nonsense

Eg simply adding factor prices together does not give total input price

More definitions and some rules

Page 8: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Multiplying vectors by a number (a ‘scalar’)

Let x = (x1, …,xn) and a be a scalar, then ax = (ax1, ax2,…,axn)

e.g. a = 2, x = (1 2 3)

ax = (2 4 6)

More definitions and some rules

Page 9: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Multiplying vectors

In general you cannot multiply two row vectors or two column vectors together

Eg a = (1 2) b = (2 3) ?

But there are some special cases where you can

And you can often multiply a column vector by a row vector and vice versa.

We’ll meet them when we do matrices

More on multiplication

Page 10: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Definition: Vector product also known as the dot product or inner product

Let x = (x1, x2, …, xn), y = (y1,…,yn).

The vector product is written x.y and equals x1y1 + x2y2 + …xnyn.

Or

Note that vector products are only possible if the vectors have the same dimensions.

3. Vector products – a special case of vector multiplication

ni

iii yxyx

1

.

Page 11: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Example. Miki buys two apples and three pears from the Spar shop.

Apples cost £0.50 each; pears cost £0.40 each.

How much does she spend in total?

Answer: This can be seen as an example of a vector product

– Write the prices as a vector: p=(0.5, 0.4)

– Write the quantities as a vector q=(2, 3)

– Total Expenditure (=Price*Quantity) is the sum of expenditures on each good

– found by multiplying the first element of the first vector by the first element of the second vector and multiplying the second element of the first vector by the second element of the second vector & adding the results

– Spending = 2x0.5 + 3x0.4 = £2.20

3. Vector products – a special case of vector multiplication

ni

iii yxyx

1

.

Page 12: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

1. What are the dimensions of the following?

2. Can you add the following (if you can, provide the answer)?

3. Find the dot product

Instant Quiz

22

32

10

.

0

0

0

.10421. iiiiii

21&431.144&

0

0

0

.01&14. iiiiii

013&431.

0

1

2

&

1

0

4

.01&14.

iiiiii

Page 13: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Idea: vectors can also be thought of as co-ordinates in a graph.

A n x 1 vector can be a point in n –dimensional space

E.g. x = (5 3) – which might be a consumption vector C= (x1,x2)

Geometry

5

3

x1

x2

A straight line is drawn out from the origin with definite length and definite direction is called a radius vector

Page 14: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Using this idea can give a geometric interpretation of scalar multiplication of a vector, vector addition or a “linear combination of vectors”

Eg If x = (5 3) then 2x = (10 6) and the resulting radius vector will overlap the original but will be twice as long

Geometry

5

3

x1

x2

Similarly multiplication by a negative scalar will extend a radius vector in the opposite quadrant

10

6

Page 15: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Also can think of a vector addition as generating a new radius vector between the 2 original vectors

Eg If u = (1 4) and v = (3 2) then u+v = (4, 6) and the resulting radius vector will look like this

Geometry

1

2

x1

x2

Note that this forms a parallelogram with the 2 vectors as two of its sides3

6

4

4

u+v

u

v

Page 16: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Given this can depict any linear vector sum (or difference) now called a linear combination geometrically

E.g. x = (5 3); y = (2 2) 2x+3y = (16,12)

Linear combinations depicted

5216

12

y

x3

2

Page 17: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Can also think of a geometric representation of vector inner (dot) product

Remember

A geometric representation of this is that the dot product measures how much the 2 vectors lie in the same direction

Special Cases

a) If x.y=constant then the radius vectors overlap

ni

iii yxyx

1

.

Eg x=(1 1) y =(2 2)

So x.y= (1*2 + 1*2) = 4

Page 18: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Can also think of a geometric representation of vector inner (dot) product

Remember

A geometric representation of this is that the dot product measures how much the 2 vectors lie in the same direction

Special Cases

If x.y= 0 then the radius vectors are perpendicular (orthogonal)

ni

iii yxyx

1

.

Eg x=(5 0) y =(0 4)

So x.y= (5*0 + 0*4) = 0

Y=(0,4)

X=(5 0) x ┴ y

Page 19: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Will return to these issues when deal with the idea of linear programming(optimising subject to an inequality rather than an equality constraint)

Page 20: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Linear dependence

A group of vectors are said to be linearly dependent if (and only if) one of them can be expressed as a linear combination of the other

If not the vectors are said to be linearly independent

Equally linear dependence means that there is a linear combination of them involving non-zero scalars that produces a null vector

E.g. are linearly dependent

Proof. Because x=2y or x – 2y = 0

But are linearly independent

Proof. Suppose x – ay = 0 for some a or other. In other words,

Then 2 – a = 0 and also 1 – 3a = 0. So a = 2 and a = 1/3 – a contradiction

1

1

1

;

2

2

2

yx

3

1;

1

2yx

0

0

31

2

31

2

0

0

3

1

1

2

a

a

a

aora

Page 21: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Linear dependence

Generalising, a group of m vectors are said to be linearly dependent if there is a linear combination of (m-1) of the vectors that yields the mth vector

Formally, the second definition:

Let x1 , x2 , …xm be a set of m nx1 vectors

If for some scalars a1, a2, …am-1

a1x1 + a2x2 + … am-1 xm-1 = xm

then the group of vectors are linearly dependent,

But also

a1x1 + a2x2 + … am-1 xm-1 – xm = 0 which is the first definition

Summary. To prove linear dependence find a linear combination that produces the null vector. If you try to find such a linear combination but instead find a contradiction then the vectors are linearly independent

Page 22: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Quiz II

A group of vectors are said to be linearly independent if there is no linear combination of them that produces the null vector

1. are linearly independent. Prove it.

2. are linearly independent. Prove it.

3. What about ?

;1

0;

1

2

yx

3

0;

2

2yx

0

1;

1

0;

1

2zyx

Page 23: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Rank

The rank of a group of vectors is the maximum number of them that are linearly independent

are linearly independent. So the rank of this group of vectors is 2

are linearly dependent, (2x=y) So the rank is 1

Any two vectors in this group are independent (x=y+2z) so the rank is 2

;1

0;

1

2

yx

4

2;

2

1yx

0

1;

1

0;

1

2zyx

Page 24: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Vectors: Summary

Definitions you should now learn:

– Vector, matrix, null vector, scalar, vector product, linear combination, linear dependence, linear independence, rank

• 4 skills you should be able to do:

– Add two nx1 or 1xn vectors– Multiply a vector by a scalar and do the inner (dot) product– Depict 2 dimensional vectors and their addition in a diagram– Find if a group of vectors are linearly dependent or not.

Page 25: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Matrices

1. Introduction

Recall that matrices are tables where the order of columns and rows matters

– E.g. marks in a course test for each question and each student

Andy Ahmad Anka

Qn. 1 44 74 65

Qn. 2 23 56 48

Qn. 3 8 24 44

Page 26: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

1. Storing data

2. Input-output Tables

3. Transition matrices.

(U = unemployed, E = employed, prob. = probability)

Some common types of matrices in applied economics.

US GDP UK GDP PRC GDP

1999 100 80 11

2000 103 82 12

2001 103 84 13

Per kg iron Per kg coal

Kg iron 0.1 0.01

Kg coal 1 0

Hours labour 0.01 0.001

Prob. U in 2011

Prob E in 2011

U in 2010 0.3 0.7

E in 2010 0.1 0.9

Page 27: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Can also derive matrices from economic theory

Eg consider a simple demand and supply system for a good

Supply: Q= - 2 + 3P

Demand: Q=10-2P

Re-arranging

Supply: Q – 3P = - 2

Demand: Q +2P = 10

Or in short-hand Ax = b

where

21

31A

P

Qx

10

2b

Page 28: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

In general any system of m equations with n variables (x1, x2, ...xn)

Can be written in matrix form Ax = b

where

mnmnmm

nn

nn

bxaxaxa

bxaxaxa

bxaxaxa

.....

:

.....

.....

2211

22222121

11212111

mnmm

n

n

aaa

aaa

aaa

A

..

::

..

..

21

22221

11211

nx

x

x

x:2

1

mb

b

b

b

:

:2

1

Page 29: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Dimensions of a matrix

are always defined by the number of rows followed by the number of columns

So

is a matrix with m rows and n columns.

Example

So A is a 2 x 5 matrix (2 rows , 5 columns)

B is 5x2 matrix

Definitions

106237

443314A

mxnA

144

03

63

231

74

B

Page 30: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Can think of vectors as special cases of matrices

Hence a row vector is a 1 x n matrix

B is a 1 by 3 row vector

Similarly a column vector is an n x 1 matrix

So C is a 3 x 1 column vector

( note the content is the same as B. This means that you can store the same information in different ways)

Definitions

101 B

1

0

1

C

Page 31: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Sometimes we wish to refer to individual elements in a matrix

E.g. the number in the third row, second column.

We use the notation aij (or bij etc.) to indicate the appropriate element

i refers to the row

j refers to the column

Example

So a13 = 3 and a21 = 7

If

What is b21 ?

Definitions

2524232221

1514131211

106237

443314

aaaaa

aaaaaA

144

03

63

231

74

B

Page 32: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

The null matrix or zero matrix is a matrix consisting entirely of zeros

A square matrix is one where the number of rows equals the number of columns i.e. nxn

Eg.

For a square matrix, the main (or leading) diagonal is all the elements aij

where i = j

So in the above the main diagonal is (2 1)

Definitions

13

32

000

000

000

A

Page 33: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

The identity matrix is a square matrix consisting of zeros except for the leading diagonal which consists of 1s:

We write I for the identity matrix

If we wish to identify its size (number of rows or columns) we write In

Definitions

10000

01000

00100

00010

00001

I

Page 34: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

A diagonal matrix is a square matrix with aik = 0 whenever i ≠ k

And so consists of zeros everywhere except for the main diagonal which consists of non-zero numbers

(so the identity matrix is a special case of a diagonal matrix since it has just ones along the main diagonal)

Definitions

100000

01000

00400

00010

00002

A

Page 35: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Trace of a matrix

is the sum of the elements on the main (leading) diagonal of any square matrix

So tr(A) = 2+1+4-1-10 = -4

100000

01000

00400

00010

00002

A

Page 36: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

1. What are the dimensions of A?

2. What is a21?

3. Is B a square matrix?

4. What is the largest element on the main diagonal of B?

5. What is the value of the largest element on the main diagonal of B?

Mini quiz

030

712

601

B

0037

3314A

Page 37: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

The transpose of a matrix A is obtained by by turning rows into columns and vice versa

swapping aij for aji for all i and j

We write the transpose as A’ or AT ( A “prime”)

A symmetric matrix is one where A’ = A

A positive matrix is one where all of the elements are strictly positive

A non-negative matrix is one where all of the elements are either positive or zero

More Definitions

'13

32AA

076

310

021

030

712

601

AsoA

Page 38: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Useful Properties of Transposes

1. (A’)’ = A

- The transpose of a transpose is the original matrix

2. (A + B)’ = A’ + B’

- The transpose of a sum is the sum of the transposes

3. (AB)’ = B’A’

- The transpose of a product is the product of the transposes in reverse order

Eg. Given

Find (AB)’ and B’A’

1 2

3 4A

0 1

6 7B

Page 39: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

A negative matrix is one where none of the elements are positive

A strictly negative matrix is one where all of the elements are strictly negative

C is strictly positive and symmetric; B is negative; A is neither positive nor negative.

More Definitions

13

32C

030

712

601

A

0

1

1

332

B

Page 40: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Adding matrices

- add each element from the corresponding place in the matrices.

i.e. if A and B are m x n matrices, then A+B is the m x n matrix where

cij= aij+bij for i = 1,..,m and j = 1,…,n.

You can only add two matrices if they have the same dimensions.

e.g. you cannot add A and B

Some rules

0037

3314A

030

712

601

B

040

724

601

;

030

712

601

;

010

012

002

BABA

Page 41: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Multiplying by a scalar

When you multiply by a scalar (e.g. 3, 23.1 or -2), then you multiply each element of the matrix by that scalar

Example 1: what is 4A if

Example 2: what is xB if

Matrix Multiplication

0037

3314A

001228

12124164A

030

712

601

B

030

72

60

x

xxx

xx

xB

Page 42: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Matrix MultiplicationIn general multiplication of 2 or more matrices has some special rules

1. The first rule is that the order of multiplication matters.

In general AxB (or AB) is not the same as BA

(so this is very different to multiplying numbers where the order doesn’t matter – e.g. 3x4 = 4x3 = 12 )

Asides:

• Addition, multiplication, matrix multiplication etc. are examples of operators

• An operator is said to be commutative if x operator y = y operator x

for any x and y (the order of multiplication does not matter)

• Addition is commutative: x+y = y+x; multiplication is commutative; subtraction is not commutative (2-1 ≠ 1-2)

• Matrix multiplication is commutative but matrix multiplication is not

Page 43: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

2. The second rule is that you can only multiply two matrices if they are conformable

• Two matrices are conformable if the number of columns for the first matrix is the same as the number of rows for the second matrix

• If the matrices are not conformable they cannot be multiplied.

• Example 1: does AB exist?

– Answer: A is a 2x4 matrix. B is a 3x3.

– So A has 4 columns and B has 3 rows.

– Therefore AB does not exist. A and B are not conformable.

Multiplying two matrices

0037

3314A

030

712

601

B

Page 44: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Example 2: does AB exist?

–Answer: A is a 2x5 matrix. B is a 5x2. So A has 5 columns and B has 5 rows. A and B are conformable.

–Therefore AB exists.

–How to find it?

Multiplying two matrices

10627

03314A

11

03

63

31

04

B

Page 45: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Finding AB

– A and B are conformable. So C = AB exists and will be a 2 x 2 matrix

(no. of rows of A by no. Columns of B)

To calculate it:

i. To get the first element on the first row of C take the first row of A and multiply each element in turn against its corresponding element in the first column of B. Add the result.

– Example: c11 = (4x4) + (-1x-1) + (3x3) + (3x3) + (0x1) = 35

ii. To get the remaining elements in the first row: repeat this procedure with the first row of A multiplying each column of B in turn.

Multiplying two matrices

10627

03314A

11

03

63

31

04

B

2221

1211

cc

ccABC

Page 46: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

So top left hand element is

And top right hand element is

Multiplying two matrices

..

.)1)(0()3)(3()3)(3()1)(1()4)(4(

11

03

63

31

04

10627

03314AB

..

)1)(0()0)(3()6)(3()3)(1()0)(4(35

11

03

63

31

04

10627

03314AB

Page 47: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Suppose A is an mxn matrix and and B is an nxr matrix with typical elements aik and bkj respectively

then AB =C where element cij is :

Note that the result is an mxr matrix

Multiplying two matrices - formally

nk

kkjikij bac

1

Page 48: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Example 2: calculate AB

– First we note that A is 1x4 and B is 4x2

– so C=AB exists and is a 1x2 matrix

– The first element c11 = (1)(1)+(0)(2)+(2)(1)+(0)(0)= 3

– The second element c12 = (1)(0)+(0)(0)+(2)(3)+(0)(1)= 6

– So C = (3 6)

Another example

0201A

10

31

02

01

B

Page 49: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Can you multiply the following matrices? If so, what is the dimension of the result?

1. BA

2. BC

3. AA’

4. A’A

5. CC

Quiz.

0201A

10

31

02

01

B

11

22C

Page 50: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Answers

Finding CC (sometimes written C2).

33

55

1.12.11.12.1

1.22.21.22.2

11

22

11

22CC

0201A

Page 51: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Recall:

1. A square matrix has the same number of rows and columns – it’s nxn

2. The identity matrix is a square matrix with 1s in the leading diagonal and 0s everywhere else.

E.g.

Multiplying square matrices by the identity matrix

10

01I

Page 52: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

The usefulness of the identity matrix is similar to that of the number 1 in number algebra

Since IA = AI = A

- if multiply a matrix by the identity matrix the product is the original matrix

Eg

(leave it to you to show AI=A)

A 1 2

3 4

IA 1 0

0 1

1 2

3 4

(1*1) (0* 3) (1*2) (0* 4)

(0*1) (1* 3) (0*2) (1* 4)

1 2

3 4

A

Page 53: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

1. If A is a square matrix then IA = AI = A

NB. This only applies to square matrices

A general result for square matrices

nnn

n

nnn

n

aa

aaa

IA

aa

aaa

AIf

1

11211

1

11211

10

001

A

aa

aa

aaaaaa

aaaaaa

nnn

n

nnnn

nnnn

1

111

12112111

12112111

100100

001001

Page 54: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

This result can be useful sometimes to help solve matrix algebra

Since if AI = A

Then

AIB = (AI) B = A (BI) = AB

-The inclusion of the identity matrix does not affect the matrix product result (since like multiplying by “1”

(will see example of this in econometrics EC5040)

Also note that

-An identity matrix squared is equal itself

Any matrix with this property AA = A

Is said to be idempotent

2n nI I

Page 55: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Idea:

In standard multiplication every number has an inverse

(except maybe zero unless you count infinity)

The inverse of 3 is 1/3; the inverse of 27 is 1/27, the inverse of -1.1 = -1/1.1

Also a number times its inverse equals 1: x(1/x) = 1

and the inverse times the number equals 1: (1/x)x = 1

and the inverse of the inverse is the original number 1/(1/x) = x

Inverses for (square) matrices

Page 56: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

The rules for the inverse of a matrix are similar (but not identical)

If A is an nxn matrix then the inverse of A, written A-1 , is an nxn matrix such that:

1. AA-1 = I

2. A-1A = I

Notes:

1. This means that A is the inverse of A-1

2. But...

3. A-1 may not always exist

Inverses for (square) matrices

Page 57: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

1. Suppose and

Then

So given AA-1=I it must be that in this case B=A-1

An Inverse matrix example

11

03A

13/1

03/1B

10

01

)1)(1()0)(1()3/1)(1()3/1)(1(

)1)(0()0)(3()3/1)(0()3/1)(3(

13/1

03/1

11

03AB

Page 58: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

In general need to introduce some more terminology before can invert a matrix

1. Only square matrices can be inverted.

Not all square matrices can be inverted however

2. A matrix that can be inverted is said to be nonsingular

(so squareness is a necessary but not sufficient condition to invert)

3. The sufficient condition is that the columns (or rows since it is square) be linearly dependent

- think of this as being separate equations so the equations must be independent (n equations and n unknowns) if a solution is to be found

Page 59: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Eg

So that the 1st row of A is twice that of the 2nd row and there is linear dependence

One equation is redundant (no extra information) and the system reduces to a single equation with 2 unknowns

So no unique solution for x1 and x2 exists

1 1

2 2

1 2 1

1 2 2

10 4

5 2

10 4

5 2

x dAx d

x d

x x d

x x d

Page 60: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Rank of a matrix

The idea of vector rank can be easily extended to a matrix

The rank of a matrix is the maximum number of linearly independent rows or columns

If the matrix is square the maximum number of independent rows must be the same as the maximum number of independent columns

If the matrix is not square then the rank is equal to the smaller of the maximum number of rows or columns, ρ<=min(rows, cols)

If a matrix of order n is also of rank n, the matrix is said to be of full rank

Important: Only full rank matrices can be inverted

Matrix ranks are closely linked to the concept of determinants

Page 61: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Let A be an nxn matrix then the determinant of A is a unique number (scalar), defined as:

(1)

Notes: In each term there are three components:

1. (-1)1+j

2. a1j

3. Det(A1j)

4. What does this mean?

Start with a 2 x 2 matrix

which gives a single number (scalar) as the answer – as do all determinants

Can you see how this relates to equation (1) ?

Determinants

1 11

1

det( ) ( 1) det( )j n

j jj

j

A A a A

11 12

21 22

11 22 12 21

a aA

a a

A a a a a

Page 62: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Eg

What is the determinant of

So matrices that are not full rank – have linear dependent rows/columns - have zero determinants (will come back to this) and are singular

Determinants

10 4

8 5A

(10*5) (4*8) 18A

3 5

0 1B

2 6

8 24C

Page 63: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

The determinant of a matrix is defined iteratively

1. An nxn is calculated as the sum of terms involving the determinants of nx(n-1)x(n-1) (ie n!) matrices

2. Each (n-1)x(n-1) matrix determinant is the sum of terms involving n-1 determinants of (n-2)x(n-2) matrices and so on

3. Since we know how to calculate the determinant of a 2x2 matrix we can always use this definition to find the determinant of an nxn matrix

4. In practice we shall not go above 3x3 matrices (unless using a computer program) but we need to know the general formula for an inverse

Determinants.

Page 64: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

General properties of determinants

1) If B = A’, then det. B = det. A

2) If B is constructed from A by swapping two rows, then det. B = -det. A

3) If B is constructed from A by swapping two columns, then det. B = -det. A

4) If B is constructed from A by multiplying one row (or column) by a constant, c, then det. B = c det. A

5) If B is constructed from A by adding a multiple of one row to another, then det. B = det. B

1 2

3 4A

1 3

2 4B

Page 65: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Determinants of triangular matrices

1 2 3

0 4 5

0 0 6

A

6 0 0

5 4 0

1 2 3

B

Are examples of – respectively – an upper triangular and a lower triangular matrix

(zeros below or above the main diagonal)

The determinant of either an upper or lower triangular matrix is equal to the product of the elements on the main diagonal

Eg det.A = 1(24-0) - 2(0) + 3(0) = 24 = 1*4*6

Page 66: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

For a 3 x 3 matrix, using

Question: What is the determinant of

Determinants

0 2 1

0 0 1

1 0 2

A

11 12 13

21 22 23

31 32 33

22 23 21 23 21 2211 12 13

32 33 31 33 31 32

a a a

A a a a

a a a

a a a a a aA a a a

a a a a a a

1 11

1

det( ) ( 1) det( )j n

j jj

j

A A a A

Page 67: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Method 1: Laplace expansion of an n x n matrix.

Can generalise this rule for the determinant of any n by n matrix

As part of this method, you need to know the following:

1. Minor M

2. Co-factor C

(which are also essential to invert a matrix)

11 1 1

1 1

( 1)j n j n

jj j j ij

j j

A a M a C

Page 68: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

There is a minor Mij for each element aij in the square matrix.

1. To find it construct a new matrix by deleting the row i and deleting the column j.

2. Then find the determinant of what’s left

3. E.g. M11

4. Example M12

nxn Matrix inversion - minors

nnn

n

nnn

n

aa

aa

Mso

aa

aa

A

1

222

11

1

111

;

.6423697

64;

987

654

321

.. 12

MsoAei

1 2 3

A= 4 5 6

7 8 9

1 2 3

Delete row and column

4 5 6

7 8 9

Page 69: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

The cofactor is Cij is a minor with a pre-assigned algebraic sign given to it

1.For each element aij, work out the minor

2.Then multiply it by (-1)i+j

3.In simpler language: if i+j is even then Cij = Mij

4.If i+j is odd, then Cij = -Mij

5.The co-factor matrix is just

6.The adjoint matrix is C’ – i.e. the transpose of C.

N xn matrix inversion: Co-factor and adjoint matrices

nnn

n

cc

cc

C

1

111

Page 70: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

1. The inverse matrix, A-1 is just

So

i) find the determinant

– if it is non-zero, the matrix is non-singular so its inverse exists

ii) Find the cofactors of all the elements of A and arrange them in the cofactor matrix

iii) Transpose this matrix to get the adjoint matrix

iv) Divide the adjoint matrix by the determinant to get the inverse

Co-factor, adjoint matrices and the inverse matrix

1 1 1.A adj A C

A A

Page 71: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

1. If find A-1

Use the formula

First find the determinant

which is non-zero so can continue

Now find matrix of cofactors, which in the 2 x 2 case is a set of 1 X 1 determinants

Example 1 (2 x 2 matrix)

22 211

12 1111 22 12 21

1 a aA

a aa a a a

10

12A

11 22 12 21 (2)(1) (1)(0) 2A a a a a

11 12

21 22

1 0

1 2

C CC

C C

1 1 1.A adj A C

A A

Page 72: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Now transpose the matrix of cofactors to get the adjoint matrix

Now using the formula above

which is non-zero so can continue

then

NB. Always check that the answer is right by looking if AA-1 = I

Example 1 (2 x 2 matrix)

11 21

12 22

1 1. '

0 2

C Cadj A C

C C

11 22 12 21 (2)(1) (1)(0) 2A a a a a

1 1 1 1/ 2 1/ 21

0 2 0 12A

10

01

2000

2202

2

1

20

11

10

12

2

11AA

1 1 1.A adj A C

A A

Page 73: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

While

Example 2: 3 x 3 matrix

54

20

64

30

65

3287

20

97

30

98

3287

54

97

64

98

65

;

987

654

320

MsoA

;

8123

14216

363

801201512

1402102418

353264845

M

;

8143

12216

363

;

8123

14216

363

CC

11 11 12 12 1 1 (0)( 3) (2)(6) (3)( 3) 3n nA a c a c a c

Page 74: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Example continued

8143

12216

363

3

1;

987

654

3201AsoA

Page 75: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

1. In each case find the matrix of minors

2. Find the determinant

3. Find the inverse and check it.

Quiz

0 2 1

0 0 1

1 0 2

B

3 2

1 0A

Page 76: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical
Page 77: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

The term is called the determinant of A, often written det.(A). Vertical lines surrounding the original matrix entries also means ‘determinant of A’.

The matrix part of the solution is called the ‘adjoint of A’ written adj. A. The elements of the adj.A are called co-factors. So,

Some more jargon

1121

1222

21122211

1

aa

aa

aaaaB

21122211 aaaa

11 12

21 22

det .a a

A Aa a

AadjA

B ..det

1

1121

1222.aa

aaAadj

Page 78: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

2x2 Matrix Inversion Quiz

Suppose

1. What is det. A?

2. What is A-1

3. What is det. B?

4. Can you find B-1

11

13A

11

22B

Page 79: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Summary

11 Definitions you should now memorise:

Matrix dimensions, null matrix, identity matrix, transpose, symmetric matrix, square matrix, leading diagonal, nonnegative, positive, nonpositive, and negative matrices.

5 skills you should be able to do:

– Add two nxm matrices

– Multiply a matrix by a scalar

– Transpose a matrix.

– Identify the element aij in any matrix

– Understand and have practised matrix multiplication

Page 80: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

For home study: Method - the Gaussian approach.

• In a row operation multiples of one row are added or subtracted from multiples of another row to produce a new matrix.

• Example: transform A by replacing row 1 by the sum of row 1 and row 2:

• A row operation can be represented by matrix multiplication. A’ = BA where

;

200

120

121

A

;

200

120

001

200

120

112201

'

A

;

100

010

011

B

Page 81: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

Method 2: the Gaussian method.

• Suppose, by a series of m row operations we transform A into I, the identity matrix.

• Let Bi indicate the series of matrices in this sequence of m row operations:

• BmBm-1…B1A = I.

• Let C = BmBm-1…B1 so that CA = I.

• It follows that, by the definition of the inverse that C = A-1.

• Since C = CI we can find C by taking the row operations conducted on A and conducting them in parallel on I.

• Method. Begin with the extended matrix [A I]:

• Carry out row operations on the extended matrix until it has the form [I C]

• C = A-1

;

100

010

001

200

120

121

''

A

Page 82: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

1. Use the Gaussian method to find the inverse and check it works.

Quiz

;

202

100

124

A

Page 83: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

5. An odd example.

• In Cafeland there are only two goods: x1 = latte, x2 = muffin.

• Peculiarly, it is not possible to buy and sell the goods separately.

• Instead the following combinations are available

– x: Latte lover : x1 = 2, x2 = 1.

– y: Muffintopia: x1 = 0, x2 = 3.

Any fraction of these combinations can be bought and sold

Joan wishes to own and consume exactly one latte and one muffin. Can she buy to achieve her goal?

Answer:

She buys 1/2 of latte lover combo and 1/6 of muffintopia combo.

This mix of vectors is called a linear combination.

More formally, if x and y are n x 1 vectors and a and b are scalars,

ax + by is a linear combination.

Joan’s purchase is (1/2)x + (1/6)y

Page 84: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

The example again

• In Cafeland there are only two goods: x1 = latte, x2 = muffin.

• Peculiarly, it is not possible to buy and sell the goods separately.

• Instead the following combinations are available

– x: Latte lover : x1 = 2, x2 = 1.

– y: Muffintopia: x1 = 0, x2 = 3.

Any fraction of these combinations can be bought and sold

Can Joan construct any combination of latte and muffin out of x and y?

Any combination: So formally, is there an a and a b such that:

Or

;3

0;

1

2

yx

2

1

x

x

3

0

1

2

2

1 babyaxx

x

ba

a

x

x

3

2

2

1

Page 85: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

The example again

I.e. two equations in two unknowns:

x1 = 2a and

x2 = a+3b

Or

0.5x1 = a

and so

x2 = a + 3b = 0.5x1 + 3b or

x2 –0.5x1= 3b or

b = (x2 -0.5x1)/3

For instance if x1 = 1 and x2 = 1, then a = 0.5 and b = 1/6

ba

a

x

x

3

2

2

1

Page 86: Economics Masters Refresher Course in Mathematics Lecturer: Jonathan Wadsworth Teaching Assistant: Tanya Wilson Aim: to refresh your maths and statistical

10. Vector Space

• The set of vectors generated by the various linear combinations of 2 vectors is called a 2-dimensional vector space

• Consider a space with n dimensions

• It follows that a single nx1 vector is a point in that space

• A group of nx1 vectors is said to form a basis for the space if any point in that space can be represented as a linear combination of the vectors in the group.

• In the example, formed a basis for 2 dimensional space.

• These vectors are also said to span 2 dimensional space• In other words if a group of vectors form a basis for an n-dimensional

space that’s the same as saying that they span the n-dimensional space.

;3

0;

1

2

yx