0% found this document useful (0 votes)
43 views5 pages

MAST10008 Accelerated Mathematics 1 - Lab 5

This document provides an introduction to linear algebra techniques for modeling economic systems using a Leontief input-output model. It presents a closed economy model consisting of k industries, where each industry produces one product and consumes products from the other industries. It defines the production input coefficients matrix E and shows that there exists a non-zero price vector p satisfying the system of equations Ep=p, ensuring each industry can recoup its production costs. MATLAB exercises are provided to familiarize the reader with vector and matrix operations, comparison operators, and conditional programming using if statements.

Uploaded by

vanessa8pangestu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views5 pages

MAST10008 Accelerated Mathematics 1 - Lab 5

This document provides an introduction to linear algebra techniques for modeling economic systems using a Leontief input-output model. It presents a closed economy model consisting of k industries, where each industry produces one product and consumes products from the other industries. It defines the production input coefficients matrix E and shows that there exists a non-zero price vector p satisfying the system of equations Ep=p, ensuring each industry can recoup its production costs. MATLAB exercises are provided to familiarize the reader with vector and matrix operations, comparison operators, and conditional programming using if statements.

Uploaded by

vanessa8pangestu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

MAST10008 Accelerated Mathematics 1 - Lab 5

1. Introduction

The techniques of linear algebra are core techniques used in modelling economic systems. Today we look at a
simple economic model based on the work of Nobel Laureate Wassily Leontief.
Before starting the exercises, start MATLAB and load this week’s m-files:
• Open the Lab Materials folder: Start menu → Computer → Lab-materials (L:) → MAST10008
• Drag the folder 10008lab5 into MATLAB’s Current Folder window
• Right-click on 10008lab5 in the Current Folder window and choose Add to Path → Selected folder and
subfolders.

2. The model: Closed Input-Output (Leontief) Model

Consider an economy (e.g., for a country or region) consisting of k industries I1 , . . . Ik . Each industry Ii produces
one type of product, Ti . To produce its product, each industry consumes some of the products produced by the
other industries, including itself (for instance, a farm needs to keep aside some of the grain it produces to plant
next year).
We will assume that the economy is closed - no products are exported or imported - and that the total amount
of each product produced annually is fixed. Let
ei,j = the proportion of the total annual production of Tj which is used for producing product Ti .
For example, if e2,3 = 0.4 then 40% of the total amount of product T3 produced annually is used in the
production of product T2 . The optimal situation is that each industry produces enough of its product to supply
all the industries’ needs, and no extra (which would go to waste). In this case, we have
k
X
ei,j = e1,j + e2,j + . . . + ek,j = 1.
i=1

Let
pi = the total value (in $) of the annual production of product Ti .
Then the cost to industry Ii of its annual production of Ti will be
total cost = ei,1 p1 + ei,2 p2 + . . . ei,k pk
If the industry is to recoup its costs then the total price it charges for its annual production, pi , must equal the
production costs:
pi = ei,1 p1 + ei,2 p2 + . . . ei,k pk .

This must hold for all industries, so we have a system of equations:


e1,1 p1 + e1,2 p2 + . . . e1,k pk = p1
..
.
ek,1 p1 + ek,2 p2 + . . . ek,k pk = pk
or as a matrix equation:
   
e1,1 e1,2 ... e1,k p1
 ..  .. 
(1) Ep = p where E =  .  and p =  .  .

ek,1 ek,2 ... ek,k pk

Can we find prices pi for each industry to charge so that this is satisfied?
We start with a simple case for you to do by hand.

1
2

Exercise 1. (Pen and Paper Exercise)


Consider a simple economy with two industries, agriculture (A) and labour (L). Suppose that the matrix E
is " #
1 2
2 3
E= 1 1
2 3
This says that the agriculture industry consumes half of the agriculture production and 2/3 of the labour
production; the other half of agriculture production and 1/3 of labour are used by the labour industry.
(a) Solve the equation Ep = p by hand to find p. Hence give possible prices for each unit of agriculture
and labour which would satisfy the equation (1).
Hint: Start with Ep − p = 0 or (E − I)p = 0 and then use row-reduction to solve a system of equations.
There may be more than one possible solution!

In this case, we managed to find a solution. Can we always find such a solution, in the general case? This
theorem guarantees that we can.
 
e1,1 e1,2 . . . e1,k
Theorem 1. Let E =  ...  be a k × k matrix such that
 

ek,1 ek,2 . . . ek,k


(1) ei,j ≥ 0 for 1 ≤ i, j ≤ k; and
Pk
(2) i=1 ei,j = e1,j + e2,j + . . . + ek,j = 1 for 1 ≤ j ≤ k.
 
p1
 .. 
Then there is a non-zero vector p =  .  with pi ≥ 0 for 1 ≤ i ≤ k satisfying Ep = p.
pk

A matrix that satisfies conditions (1) and (2) of the theorem is called a exchange matrix or input-output
matrix.
What does condition (1) say about the matrix E? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

What does condition (2) say about the matrix E? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


Our next task is to write a program to help us calculate a solution p from a general exchange matrix E. But
before we do so, we need to learn some more MATLAB commands.
3

 
1 5 2
Exercise 2. Enter the vector v = [1 5 2] and the matrix A = 0 2 −1.
3 0 −1

Vector and matrix functions.


(a) Try the command sum(v) . What did it do? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) Try the command sum(A) . What did it do? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) Try the commands max(v), min(v), max(A) and min(A). What do they do?
......................................................................................................

(d) Use the commands above to calculate:


i. the maximum entry in the matrix A. What command did you use? . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ii. the sum of all the entries in the matrix A. What command did you use? . . . . . . . . . . . . . . . . . . . . . . .
Comparison operators.
Enter the following matrix in MATLAB:  
0 5 2
B = 0 1 −1
3 0 −2
In MATLAB, there are different forms of ‘=’. We have already seen the assignment operator: when you typed
B = [1 2 3; 0 1 -1; 3 2 1], MATLAB interpreted this as a command to define or assign the value of the
matrix B. What if we want to check if two matrices are equal?
(e) To check if two matrices (or vectors, or numbers) are equal, we can use the isequal command. Try it:
i. Enter isequal(A,B) What was the output? What does this mean?
.................................................................................................
Note that MATLAB uses 1 to represent true and 0 to represent false.
ii. Enter isequal(A,B+eye(3)) What was the output? What does this mean?
.................................................................................................
iii. Enter isequal(1+1,2) and isequal(1+1,3) What does this mean?
.................................................................................................
iv. Enter isequal(1,0.999) and isequal(1,0.99999999999999999) (that’s 17 nines).
What’s going on?!
.................................................................................................
(f) Another comparison operator is ‘==’ (double-equal). Try it: enter A == B . What was the result? Can
you see what it is doing?
......................................................................................................
Lesson: use ‘=’ for assignment, use ‘isequal’ to test for equality. Don’t use ‘==’ for matrices unless you know
what you are doing.
4

Conditional programming - the ‘if ’ statement


Sometimes you want MATLAB to do something only if a certain condition is satisfied. The “if” command
allows you to do that.
Create a new m-file and enter the following commands.
i=6;j=7;
if i==6
’hello world.’
elseif i>=14
’I like bananas.’
elseif (j==7)&(i∼=3)
’I am happy!’
else
’Luke, I am your father.’
end

Note that ∼= means not equal, and & means and.


Save your m-file as ‘myif.m’ under My Documents → MATLAB, and run it by typing myif.
(g) By adjusting the value of i in the first line, see if you can obtain each of the possible messages.

Exercise 3. Now we will write a program to help us solve the equation Ep = p.


Create a new m-file and save it as ‘mysolve.m’ under My Documents → MATLAB . Using the commands we
have learned above (and perhaps those from previous weeks), write a function called mysolve that:
1. Takes a matrix E as its argument.
2. Checks that the matrix E is square. If it’s not square, then a suitable message should be displayed on
the screen and steps 3-5 below do not happen.
3. Checks that each of the entries in the matrix is ≥ 0. That is, the matrix satisfies condition (1) of an
exchange matrix. If not, then a message should be displayed on the screen and steps 4-5 do not happen.
4. Checks that each column of the matrix sums to 1. That is, the matrix satisfies condition (2) of an
exchange matrix. If not, then a message should be displayed on the screen and step 5 does not happen.
5. Output a row-reduced matrix that will allow you to find the vector p guaranteed by the theorem.
To get you started, here are the first two lines of your function:
function B=mysolve(E)
[m,n] = size(E); % m=number of rows in E, n= number of columns in E
Tip: Test your program regularly as you go! Test that each step is working properly before you move on to
the next step. The file test_matrices.m in the 10008lab5 folder contains some matrices which you can use
for testing if you wish. You should also check your function on the matrix in Exercise 1.
5

3. Technology Exercise 1 from Anton and Rorres, page 648, exploration

If you have time: Consider the following sequence of exchange matrices {E2 , E3 , E4 , . . . , En } where
0 12 13
 
1
 
0 2
E2 = E3 = 1 0 13 
1 12
0 12 13

1 1 1 1
 
 1 1 1
 0 2 3 4 5
0 2 3 4 1 1 1 1
1 1 1 0 3 4 5
0 3 4 E
 1 1 1
E4 = 
0 1
0 1 5 0
= 2 0
1
4 5
1
2 4 0 0 0
1 1 3 5
0 0 3 4 1 1
0 0 0 4 5

and so on.
(a) Use MATLAB to show that E22 > 02 , E33 > 03 ,E44 > 04 and E55 > 05 (where > 0n means that each
element is positive). Make the conjecture that although Enn > 0n is true, Enk > 0n is not true for
k = 1, 2, . . . , n − 1.
(b) Use MATLAB to determine the vectors pn such that En pn = pn (for n = 2, 3, 4, 5, 6) and then see if
you can discover a pattern that would allow you to compute pn+1 easily from pn . Test your discovery
by first constructing p8 from  
2520
3360
 
1890
 
 672 
p7 =  
 175 
 
 36 
7
and then check to see whether E8 p8 = p8 .

You might also like