A simple model of the determination of the GDP with Mathematica
A simple model of the determination of the GDP with Mathematica
Jamel Saadaoui
University of Strasbourg, BETA,CNRS
https://www.jamelsaadaoui.com/
In this blog, I will show how to build a simple model of the determination of the GDP with government and trade. The idea is to find the equilibrium GDP, where desired aggregate expenditures are equal to the level of good and services produced. To this end, I will use Mathematica 12.3 and the chapter 16 of the following book: https://global.oup.com/ukhe/product/economics-9780198791034, that I use in my lecture of Principles of Macroeconomics at the University of Strasbourg. Let me explain, step by step, the notebook I reproduced below.
In this blog, I will show how to build a simple model of the determination of the GDP with government and trade. The idea is to find the equilibrium GDP, where desired aggregate expenditures are equal to the level of good and services produced. To this end, I will use Mathematica 12.3 and the chapter 16 of the following book: https://global.oup.com/ukhe/product/economics-9780198791034, that I use in my lecture of Principles of Macroeconomics at the University of Strasbourg. Let me explain, step by step, the notebook I reproduced below.
I. The simple model with a tax rate on GDP
I. The simple model with a tax rate on GDP
First, I have to clear the symbols to be sure that the previous registered symbol will not interfere with your model . Use (*something*) to insert the comment "something" :
In[]:=
ClearAll["Global`*"](*completelyclearglobalsymbolstostartfresh*)
Then, I will use a first version of the model, with a tax rate. I name the equation 'eq' and I declare that my model can be reduced to one equation, where the GPD is in function of a consumption function, exogenous investment, exogenous government expenditures, exogenous exports, and an import function.
Then, I will use a first version of the model, with a tax rate. I name the equation 'eq' and I declare that my model can be reduced to one equation, where the GPD is in function of a consumption function, exogenous investment, exogenous government expenditures, exogenous exports, and an import function.
YC+F+G+(X-M)
(
1
)C+(1-t)Y
c
0
c
1
(
2
)MY
m
1
(
3
)
I use 'f' for the investment to not confuse with imaginary numbers and for the french "formation brute de capital fixe". You have to use "Ctrl+Enter" to execute the command. The above line gives this the following output:
I use 'f' for the investment to not confuse with imaginary numbers and for the french "formation brute de capital fixe". You have to use "Ctrl+Enter" to execute the command. The above line gives this the following output:
In[]:=
eq=y==c0+c1*(1-t)*y+f+g+x-m1*y(*fstandsfortheinvestment*)
Out[]=
yc0+f+g+x-m1y+c1(1-t)y
Then, I solve the model and I store the result in an object ‘PIB’ (the french acronym for GDP):
In[]:=
PIB=Solve[eq,y]
Out[]=
y
c0+f+g+x
1-c1+m1+c1t
You can also use a Wolfram|Alpha query to obtain a similar result:
You can also use a Wolfram|Alpha query to obtain a similar result:
In[]:=
solve {Y=c0+c1*(1-t)*Y+F+G+X-m*Y} for Y
Now, I want to compute the algebraic value of the multiplier effect of this model. By definition, the multiplier is the value of a change in the GDP after an increase in an exogenous expenditure. In this example, I choose to evaluate the value of change in the GDP after an increase in exogenous government spending. I store the value in an object called 'Multiplier'. The numerical value will depend on the value of the parameters of your models.
Now, I want to compute the algebraic value of the multiplier effect of this model. By definition, the multiplier is the value of a change in the GDP after an increase in an exogenous expenditure. In this example, I choose to evaluate the value of change in the GDP after an increase in exogenous government spending. I store the value in an object called 'Multiplier'. The numerical value will depend on the value of the parameters of your models.
In[]:=
Multiplier=D[PIB,g]
Out[]=
0
1
1-c1+m1+c1t
You can also use a Wolfram | Alpha query to obtain a similar result :
You can also use a Wolfram | Alpha query to obtain a similar result :
In[]:=
D[(c0 + F + G + X)/(1 - c1 (1 - t) + m), F]
In the chapter 16 of the book, we can read that the multiplier is positively linked with the marginal propensity to consume and is negatively linked with the tax rate and the marginal propensity to import. I will derive the value of the multiplier relatively to these three last variables. The partial derivative of the multiplier effect relative to marginal propensity to import is indeed negative:
In the chapter 16 of the book, we can read that the multiplier is positively linked with the marginal propensity to consume and is negatively linked with the tax rate and the marginal propensity to import. I will derive the value of the multiplier relatively to these three last variables. The partial derivative of the multiplier effect relative to marginal propensity to import is indeed negative:
Besides, the partial derivative of the multiplier effect relative to the tax rate is also negative :
Finally, the partial derivative of the multiplier effect relative to the marginal propensity to consume is positive.
Finally, the partial derivative of the multiplier effect relative to the marginal propensity to consume is positive.
II. A little numerical exercise
II. A little numerical exercise
Now, we run a numerical example to determine (a) the equilibrium GDP, (b) the size of the multiplier effect, and (c) the sign of the three partial derivatives by choosing vales for the exogenous variables and the parameters:
I use '; ' to hide the output for the parameters . We found the equilibrium value for the GDP (2786.9), the size of the multiplier (1.63934), and the excepted signs for the partial derivative.
III. The simple model with lump-sum taxes
III. The simple model with lump-sum taxes
I can use a version of the model with lump-sum taxes to evaluate the balanced budget multiplier (a simultaneous and equivalent increase in public consumption and in taxes).
The above lines give the following output:
The above lines give the following output:
IV. A second little numerical exercise
IV. A second little numerical exercise
To simplify, I use a version of this model with lump-sum taxes where the propensity to import is equal to zero and evaluate the balanced budget multiplier:
After an increase in public expenditures and in taxes, we can observe that the balanced budget multiplier is equal to one since the equilibrium GDP moves from 8000 to 8001 ('g' moved from 100 to 101 and 't' moved from 100 to 101), as in the balanced budget multiplier (Haavelmo, 1945):
After an increase in public expenditures and in taxes, we can observe that the balanced budget multiplier is equal to one since the equilibrium GDP moves from 8000 to 8001 ('g' moved from 100 to 101 and 't' moved from 100 to 101), as in the balanced budget multiplier (Haavelmo, 1945):
Bibliographic references
Bibliographic references
Lipsey, R., & Chrystal, A. (2020). Economics. Oxford University Press. https://global.oup.com/ukhe/product/economics-9780198791034
Haavelmo, T. (1945). Multiplier Effects of a Balanced Budget. Econometrica, 13(4), 311–318. https://doi.org/10.2307/1906924