Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

EXERCISE 7 (4 points) Difficulty: Moderate In this exercise, you will use some codes created in the previous exercises to find the equilibrium prices for

image text in transcribed

EXERCISE 7 (4 points) Difficulty: Moderate In this exercise, you will use some codes created in the previous exercises to find the equilibrium prices for a sample Leontief "exchange" (or "input-output") model. You may also need to review Section 1.6 of the textbook and Module 6 of the Lecture Notes. We assume that economy is divided into 4 sectors and that we know how each sector's output is divided (exchanged) among the other sectors of the economy. Starting with a random 4-by-4 matrix A as an input, we will generate a left stochastic "consumption" matrix L (its columns are the probability vectors) and use this matrix to create the "exchange" table between the sectors. After that, we will find the equilibrium prices by solving a homogeneous system. **Write a function in MATLAB that begins with function [C,x] = economy (A) It will take a matrix A=randi(100,4,4) as an input. All of the tasks outlined below have to be coded in your function. **First, you will modify A to create a left stochastic matrix L by scaling each column of A by the reciprocal of the corresponding entry of the vector 81=sum (A, 1) (refer to Exercise 6 of this project on a subject of scaling a matrix A (with positive entries) to a left stochastic matrix L). **Next, you will generate and display the Exchange table for our economy using the set of commands: n=([1:4])'; Q=[L,n]; T=array2table (Q, ... 'VariableNames', {'Sectorl', 'Sector2', 'Sector3', 'Sector4', 'n'}) **Then, you will construct the matrix B in the homogeneous system Br=0 for finding the solution x whose entries are the equilibrium prices xl, x2, x3, x4 (x4 will be the free variable). For help on constructing B, please refer to the first Example in Lecture 6. A basis for the solution set of the equation Br=0 is your output matrix C. To find C, you should run the function c=homobasis (B); created in Exercise 5 of this project (include the line above in your code). Display C. **Finally, you will display the solution x in a (symbolic parametric vector form with the message which indicates that x is the vector of the equilibrium prices for our economy. The output x has to be coded as: syms x4 x=x4* Note: The command syms x4 creates a symbolic variable x4. **Type the functions economy and homobasis in the Live Script. **Input the matrix A=randi (100,4,4) **Run the function [C,x] = economy (A) EXERCISE 7 (4 points) Difficulty: Moderate In this exercise, you will use some codes created in the previous exercises to find the equilibrium prices for a sample Leontief "exchange" (or "input-output") model. You may also need to review Section 1.6 of the textbook and Module 6 of the Lecture Notes. We assume that economy is divided into 4 sectors and that we know how each sector's output is divided (exchanged) among the other sectors of the economy. Starting with a random 4-by-4 matrix A as an input, we will generate a left stochastic "consumption" matrix L (its columns are the probability vectors) and use this matrix to create the "exchange" table between the sectors. After that, we will find the equilibrium prices by solving a homogeneous system. **Write a function in MATLAB that begins with function [C,x] = economy (A) It will take a matrix A=randi(100,4,4) as an input. All of the tasks outlined below have to be coded in your function. **First, you will modify A to create a left stochastic matrix L by scaling each column of A by the reciprocal of the corresponding entry of the vector 81=sum (A, 1) (refer to Exercise 6 of this project on a subject of scaling a matrix A (with positive entries) to a left stochastic matrix L). **Next, you will generate and display the Exchange table for our economy using the set of commands: n=([1:4])'; Q=[L,n]; T=array2table (Q, ... 'VariableNames', {'Sectorl', 'Sector2', 'Sector3', 'Sector4', 'n'}) **Then, you will construct the matrix B in the homogeneous system Br=0 for finding the solution x whose entries are the equilibrium prices xl, x2, x3, x4 (x4 will be the free variable). For help on constructing B, please refer to the first Example in Lecture 6. A basis for the solution set of the equation Br=0 is your output matrix C. To find C, you should run the function c=homobasis (B); created in Exercise 5 of this project (include the line above in your code). Display C. **Finally, you will display the solution x in a (symbolic parametric vector form with the message which indicates that x is the vector of the equilibrium prices for our economy. The output x has to be coded as: syms x4 x=x4* Note: The command syms x4 creates a symbolic variable x4. **Type the functions economy and homobasis in the Live Script. **Input the matrix A=randi (100,4,4) **Run the function [C,x] = economy (A)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

5. Who should facilitate the focus group?

Answered: 1 week ago