联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp2

您当前位置:首页 >> Python编程Python编程

日期:2021-01-16 11:42

ECON 457 - A01

Computational Economics?

UVIC - Department of Economics

Spring Term 2020/21

Assignment 1

Due on Brightspace before 11pm January 29th 2021

Please create and submit a pdf file, making sure that it’s readable and unlocked.

The file name has to follow this template: 457 PS1 Surname Name StudentNumber.pdf

You can cooperate with other students, but no group submissions will be accepted

If you do cooperate, please list the other students’ names in the cover page

No “Photocopy”answers will be accepted

No late submissions will be accepted

NOTE: YOU MUST INCLUDE THE ASSIGNMENT COVER PAGE

(Failure to do so will entail a 5-point deduction from the grade received)

Remarks: Your answers have to be submitted in a “report” format. Relying on Jupyter is the easiest

option. The codes you developed have to be included as well in the pdf file. Devote some time to give the

graphs, plots and tables a format easy to understand. Also the way you present your answers matters for

the final grade. Even if a question is mainly technical, briefly explain what you are doing, stressing the

economic meaning of the various steps whenever possible. Being able to convey your thoughts effectively is

an asset also in real life.

Question 1: Plotting functions with discrete grids (40 Marks)

Use Python to create the following graphs:

(a) Plot the function f(x) = 1/(1 ? x

2

) on the interval [?2, 2] using a grid of 11 evenly spaced points.

(b) Plot the same function considered in part (a) on the interval [?2, 2], now using a grid of 200 evenly

spaced points. Comment on the accuracy of the results.

(c) Plot, in the same graph, these two trigonometric functions: f(x) = sin(2x) and g(x) = 2cos(x).

Consider the interval [0, 2π] and use a grid of 5 evenly spaced points. Redo the same plot using 101 points.

Comment.

(d) Create a figure with two panels. One panel should display the function f(x) = ln(x) on the interval

(0, 5], while the other one should display the derivative of the same function. For both plots use an evenly

spaced grid with 101 points.

?The material contained in this document is copyrighted

c , property of the University of Victoria, meant exclusively for

the use of students enrolled in ECON 457, and it cannot be shared without the author’s explicit consent.

Question 2: Market Equilibrium (60 Marks)

Consider the market for a homogeneous good (say, a flu vaccine). The demand function is qd(p) = pε,

where ε < 0 stands for the elasticity of demand. The supply function is q

s(p) = βpη, where β > 0 is a

constant, and η > 0 stands for the elasticity of supply. Write Python codes to analyze this market in the

following cases.

(a) Set β = 1 and consider the following values for the elasticities: ε = ?2 and η = 3. Plot the two

indirect functions (note: the price has to be on the y-axis). Report the equilibrium price and quantity.

(b) Now set β = 2 and consider the following values for the elasticities: ε = {?2; ?0.5} and η = {1; 3}.

Write a do-loop where at each iteration the equilibrium price and quantity are computed and displayed (for

all four combinations). Report these four combinations in a table and comment.

(c) Now consider a different demand function, namely qd(p) = e?p ? 0.01p. The supply function is qs(p) = p4. Adapt the code we discussed in class to find the numerical solution of the market equilibrium

(note: the procedure might fail when using a poor initial guess). Plot the two indirect functions on the

interval [?2, 2] and comment. Would it be a good idea to use p0 = ?1.43 as the initial guess? Why or why

not? Find the numerical solution of the market equilibrium, report it and comment.

2


版权所有:留学生编程辅导网 2018 All Rights Reserved 联系方式:QQ:99515681 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。