Dynamic Macro Script for Matlab

2 visualizzazioni (ultimi 30 giorni)
Chris Herdelin
Chris Herdelin il 21 Gen 2021
How do I script the Solow Model attached in Matlab?
Specifically, how do I code the endogoenous as well as the exogoeneous variables in the model?
I am having trouble with the syntax. Any help you could give me would be greatly appreciated!
Do I use "syms" to generate the variables of interest?
% Dynamic Macroeconomics
% Chapter 3
%
% Solow Model in discrete time
% _____________________________________ %
% Three permanent shocks are introduced in order to study
% the dynamic behavior of the model
%
  • % 1. A 1 per cent shock to the savings rate (endval of x 1.01)
  • % 2. A 1 per cent shock to total factor productivity (endval of a 1.01)
  • % 3. A 1 per cent shock to population growth (endval of z 1.01)
  • % _____________________________________ %% Endogenous Variables:% y output, k capital, c consumption
% w real wage, r real interest rate, sav savings rate
%
% Exogenous Variables and Shocks
% a total factor productivity, x shock to the savings rate
% z shock to population growth
%
% Parameters
% alpha share of capital in production, delta depreciation rate
% n population growth rate, g rate of technical progress
% s initial savings rate
var y k c w r sav;
varexo a x z;
parameters alpha delta n g s;
alpha=0.333; delta=0.03; n=0.01; g=0.02; s=0.30;
model;
y=a*(k(-1)^alpha);
c=(1-(s*x))*y; k=(1/((1+n*z)*(1+g)))*(((s*x)*y)+(1-delta)*k(-1)); r=(alpha*a*k(-1)^(alpha-1))-delta; w=(1-alpha)*a*k(-1)^(alpha);
sav=s*x;
end; initval; k=5.3;

Risposte (0)

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by