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

 EXERCISE 7 (4 points) Difficulty: Moderate In this exercise, you will

EXERCISE 7 (4 points) Difficulty: Moderate In this exercise, you will use some of the functions created in the previous exercises to find the equilibrium prices for a sample Leontief "exchange" ("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 n sectors and that we will know how each sector's output is divided (exchanged) among the other sectors of the economy. Starting with a random n-by-n matrix A as an input, we will generate a left stochastic "consumption" matrix L (its columns are 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 [] = economy (n) format format compact A=randi (10,n); Si=sum (A); All of the tasks outlined below have to be included in your function economy. **First, you will modify A to output a left stochastic matrix L by scaling each column of A by the reciprocal of the corresponding entry of the vector S1 (please refer to Exercise 6 of this Project). Do not display L (suppress the output). 11 of **Next, you will generate and display the Exchange table for our economy using the commands: Sector=L; T=array2table (Sector) **Then, you will construct the matrix B for the homogeneous system Bx=0, whose solution, x, gives the equilibrium prices for our economy: its entries x1, x2, ..., xn. The variable xn (with n specified) will be the free variable of the system. For help with constructing B using matrix L, please refer to the first Example in Lecture 6. **Next, we output a basis for the solution set of Bx=0. There will be one vector in the basis, which is the matrix C output by the function homobasis created in Exercise 5 of this project. Include this line in your code: C=homobasis (B); **Finally, you will display the solution x in a (symbolic) parametric-vector form using the free variable xn as a parameter - we will denote it p. The output x has to be coded as below: syms p fprintf('vector of equilibrium prices with parameter prxsi is ',n) x=pc Note: The command syms p creates a symbolic variable p. **Print the functions economy and homobasis in the Live Script. **Run the function economy in | on each of the variables: n=4; n=6; n=; EXERCISE 7 (4 points) Difficulty: Moderate In this exercise, you will use some of the functions created in the previous exercises to find the equilibrium prices for a sample Leontief "exchange" ("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 n sectors and that we will know how each sector's output is divided (exchanged) among the other sectors of the economy. Starting with a random n-by-n matrix A as an input, we will generate a left stochastic "consumption" matrix L (its columns are 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 [] = economy (n) format format compact A=randi (10,n); Si=sum (A); All of the tasks outlined below have to be included in your function economy. **First, you will modify A to output a left stochastic matrix L by scaling each column of A by the reciprocal of the corresponding entry of the vector S1 (please refer to Exercise 6 of this Project). Do not display L (suppress the output). 11 of **Next, you will generate and display the Exchange table for our economy using the commands: Sector=L; T=array2table (Sector) **Then, you will construct the matrix B for the homogeneous system Bx=0, whose solution, x, gives the equilibrium prices for our economy: its entries x1, x2, ..., xn. The variable xn (with n specified) will be the free variable of the system. For help with constructing B using matrix L, please refer to the first Example in Lecture 6. **Next, we output a basis for the solution set of Bx=0. There will be one vector in the basis, which is the matrix C output by the function homobasis created in Exercise 5 of this project. Include this line in your code: C=homobasis (B); **Finally, you will display the solution x in a (symbolic) parametric-vector form using the free variable xn as a parameter - we will denote it p. The output x has to be coded as below: syms p fprintf('vector of equilibrium prices with parameter prxsi is ',n) x=pc Note: The command syms p creates a symbolic variable p. **Print the functions economy and homobasis in the Live Script. **Run the function economy in | on each of the variables: n=4; n=6; n=

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!