Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

''' Activity 05: Solve the following model by hand and using Python C = 160 + 0.6*Yd I = 150 G = 150 T =

''' Activity 05: Solve the following model by hand and using Python

C = 160 + 0.6*Yd I = 150 G = 150 T = 100 '''

from scipy.optimize import fsolve def fn1(vars,*args): C, Yd, T, I, G, Y = vars eq01 = C - ( c0 + c1*Yd ) # Consumption Function eq02 = Yd - ( Y - T ) # Disposable Income eq03 = T - T_bar # Tax Function eq04 = I - I_bar # Investment Function eq05 = G - G_bar # Government Expenditure eq06 = Y - ( C + I + G ) # Equilibrium Condition return [eq01,eq02,eq03,eq04,eq05,eq06] # Exogenous Variables G_bar = 150 I_bar = 150 T_bar = 100

# Parameters c0 = 160 # Autonomous Consumption c1 = 0.6 # Marginal Propensity to Consume

C, Yd, T, I, G, Y = \ fsolve(fn1, (1,1,1,1,1,1), \ args=(G_bar,I_bar,T_bar,c0,c1))

from datetime import datetime now = datetime.now() print('------------------------------------------') print(" Started: ", now) print('------------------------------------------') print('Name: Bob Han) print('Editor: Notepad++') print('*** Endogenous Variables ***') # T, I, G, Y print("01 Consumption: %5.2f" % (C)) print("02 Disposable Income: %5.2f" % (Yd)) print("03 Income: %5.2f" % (Y)) print(' ') print('*** Exogenous Variables ***') print("01 G_bar: %5.2f" % (G_bar)) print("02 T_bar: %5.2f" % (T_bar)) print("03 I_bar: %5.2f" % (I_bar))

now2 = datetime.now() print('------------------------------------------') print(" Ended: ", now2) print('------------------------------------------')

with open('Activity05.txt', 'w') as f: f.write(' ' "01 Consumption: %5.2f" % (C)) f.write(' ' "02 Disposable Income: %5.2f" % (Yd))

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

Mastering Apache Cassandra 3 X An Expert Guide To Improving Database Scalability And Availability Without Compromising Performance

Authors: Aaron Ploetz ,Tejaswi Malepati ,Nishant Neeraj

3rd Edition

1789131499, 978-1789131499

More Books

Students also viewed these Databases questions

Question

Does every State in the US have there own set of Property Rules?

Answered: 1 week ago

Question

1-4 How will MIS help my career?

Answered: 1 week ago