楼主: ahnulxy
9486 5

用Matlab画经典RBC模型的相位图 [推广有奖]

已卖:2108份资源

学科带头人

3%

还不是VIP/贵宾

-

威望
1
论坛币
13161 个
通用积分
2411.1590
学术水平
137 点
热心指数
166 点
信用等级
96 点
经验
49384 点
帖子
874
精华
2
在线时间
1511 小时
注册时间
2008-11-4
最后登录
2025-12-1

楼主
ahnulxy 发表于 2014-2-20 12:02:16 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
相位图
% This Matlab m file actually plot the phase diagram for classical RBC model.
% This code is written by Xiangyang Li, Ph.D in SUFE, School of Finance
% xli21@nd.edu
clear;
%set in quarterly frequency
alpha=.36;
beta =.99;
sigma =2;
delta=.025;
%steady states and the golden capital stock.
ks = (alpha/(1/beta - 1 + delta))^(1/(1-alpha));
kgold = (alpha/delta)^(1/(1-alpha));
cs = ks^alpha - delta*ks;
%draw the isocline
kv=0:.1:200;
cv=0:.1:6;
% the capital isocline
plot(kv,kv.^alpha-delta*kv,'-r','LineWidth',2);
hold on;
% the consumption isocline
plot(ks*ones(size(cv)),cv,'-b','LineWidth',2);
plot(kgold*ones(size(cv)),cv,'-g');
%1. suppose we start from the point c_t = 2 and k_t =20, to see what happend
T = 52;
C=zeros(1,T);
K=zeros(1,T);
C(1)=2;
K(1) = 20;
for ii = 1:T
    %resources constraint
    K(ii+1) = K(ii)^alpha + (1 -delta)*K(ii)  - C(ii);
    %FOC of the problem
    C(ii+1) =( C(ii)^(-sigma)/(alpha*K(ii+1)^(alpha -1) + (1-delta) ))^(-1/sigma);
end
plot(K,C,'-k');
%2. suppose we start from the point c_t = 1 and k_t =20, to see what happend
T = 120;
C=zeros(1,T);
K=zeros(1,T);
C(1)=1;
K(1) = 20;
for ii = 1:T
    K(ii+1) = K(ii)^alpha + (1 -delta)*K(ii)  - C(ii);
    C(ii+1) =( C(ii)^(-sigma)/(alpha*K(ii+1)^(alpha -1) + (1-delta) ))^(-1/sigma);
end
plot(K,C,'-m');
%3. suppose we start from the point c_t = 4.5 and k_t =70, to see what happend
T = 70;
C=zeros(1,T);
K=zeros(1,T);
C(1)=4.5;
K(1) = 120;
for ii = 1:T
    K(ii+1) = K(ii)^alpha + (1 -delta)*K(ii)  - C(ii);
    C(ii+1) =( C(ii)^(-sigma)/(alpha*K(ii+1)^(alpha -1) + (1-delta) ))^(-1/sigma);
end
plot(K,C,'-c');
%4. suppose we start from the point c_t = 3.5 and k_t =90, to see what happend
T = 370;
C=zeros(1,T);
K=zeros(1,T);
C(1)=3.1;
K(1) = 80;
for ii = 1:T
    K(ii+1) = K(ii)^alpha + (1 -delta)*K(ii)  - C(ii);
    C(ii+1) =( C(ii)^(-sigma)/(alpha*K(ii+1)^(alpha -1) + (1-delta) ))^(-1/sigma);
end
plot(K,C,'-r');

%5. plot the policy function, policy function coefficient is obtained
%by solving the RBC model.
pol=0.462886778502290;
K=10:0.1:110;
C=pol*K*cs/ks + cs*(1-pol);
plot(K,C,'-k','LineWidth',2);
hold off;
legend('captial isocline', 'consumption isocline', ...
    'capital gold','explosive path 1', 'explosive path 2',...
'explosive path 3', 'explosive path 4','Saddle Path');







二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:MATLAB matla atlab Mat Atl 经典 模型 RBC

已有 2 人评分经验 学术水平 热心指数 信用等级 收起 理由
accumulation + 100 + 1 + 1 + 1 精彩帖子
日新少年 + 1 + 1 + 1 精彩帖子

总评分: 经验 + 100  学术水平 + 2  热心指数 + 2  信用等级 + 2   查看全部评分

本帖被以下文库推荐

琅琅教育 www.longlongedu.com  
人生最大的杯具:白天看中国股市,晚上看中国足球!

沙发
xiao苏苏 发表于 2014-3-20 17:14:53
thank you!

藤椅
gssdzc 在职认证  发表于 2015-6-21 08:52:40
非常感谢分享

板凳
日新少年 学生认证  发表于 2015-10-10 13:59:56
谢谢楼主,太精彩了

报纸
xcwhss 发表于 2017-5-17 10:56:57
真是很厉害哦!

地板
zcsllin 发表于 2019-9-9 10:44:16

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2025-12-5 13:45