亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rbc_eng.m

?? 基于matlab的經濟學方面的一些程序
?? M
字號:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%                The baseline RBC model                       %
%                                                             %
%                                                             %
%             U(C,1-h)=log(C)+theta log(1-h)                  %
%                                                             %
%                    Y=a(K^alpha)(h^(1-a))                    %
%                                                             %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all;                    % Clear the memory
delete rbc.res;               % If it exists, delete the file exo.res
diary rbc.res;                % Open a new file called exo.res that will store 
										% all what is written on the screen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%                     Algorithm Parameters                    %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ncont=5;                  % # of static equations
nback=1;                  % # of Backward endogenous state variables
nshoc=1;                  % # of exogenous shocks
ntotb=nback+nshoc;        % Total # of Backward state variables
nforw=1;                  % # of Forward endogenous state variables
nstat=ntotb+nforw;        % Total # of state variables
long=120;                 % Length of simulated series
trunc=50;                 % Truncature of simulations
slong=long+trunc;         % Length of simulation
nsim=5000;                 % # of simulations
nrep=20;                  % IRF horizon
Mcc=zeros(ncont,ncont);   % Matrix Control-Control
Mcs=zeros(ncont,nstat);   % Matrix Control-State   
Mss0=zeros(nstat,nstat);  % Matrix State-State
Mss1=zeros(nstat,nstat);  % Matrix State-State lagged
Msc0=zeros(nstat,ncont);  % Matrix State-Control     
Msc1=zeros(nstat,ncont);  % Matrix State-Controle lagged
Mse=zeros(nstat,nshoc);   % Matrix State-Shocks           
select=[1:5];             % Selection of variables of interest 
indy=3;                   % Index of Y(t) in the selection
indn=2;                   % Index of h(t) in the selection
indp=5;                   % Index of Y/N(t) in the selection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%             Structural Parameters of the Economy            %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The model is calibrated for the US econmy on Quarterly data
% The numbers are taken from Cooley and Prescott (1995) Chapter 1
%
whoy=0.6;					% Share of wages in total value added 
ykoy=3.32;					% Yearly K/Y
yiok=0.076;					% Yearly I/K
gzy=0.0156;					% Yearly per capita technological rate of growth
gny=0.0120;					% Yearly population rate of growth
hss=0.31;					% People devote 31% of their total time endowment to work
rhoa=0.95;					% Persistence of technological shock
stda=0.0079;				% Standard deviation of technological shock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%                       Steady state                          %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
gamy=(1+gzy)*(1+gny);						% Quarterly total rate of growth
gam=gamy^(1/4);								% Quarterly total rate of growth
alpha=1-whoy;									% elasticity of output w.r.  to capital
dy=1+yiok-(1+gzy)*(1+gny);					% Yearly depreciation rate
by=gamy/(alpha*(1/ykoy)+1-dy);			% Yearly discount factor
delta=1-(1-dy)^(1/4);						% Quarterly depreciation rate
beta=by^(1/4);									% Quarterly discount factor
yok=(gam-beta*(1-delta))/(alpha*beta);	% Model based Y/K (quarterly)
iok=gam+delta-1;								% Model based I/K (quarterly)
ioy=iok/yok;									% Model based I/Y (quarterly)
coy=1-ioy;										% Model based C/Y (quarterly)
theta=(1-hss)*(1-alpha)/(hss*coy);		% Parameter of the disutility of leisure
yss=(yok^(alpha/(alpha-1)))*hss;			% Level of output
css=coy*yss;									% Level of consumption
iss=ioy*yss;									% Level of investment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%                    Matrices Coefficients                    %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Static equations (c h y i p)
%
%
% Consumption
%
cc=-1;
cl=1;
%
% Hours
%
hh=1/(1-hss);
hy=-1;
hc=1;
%
% Production function
%
yy=1;
yh=alpha-1;
yk=alpha;
ya=1;
%
% Investment     
%
ic=-coy;
iy=1;
ii=-ioy;
%
% Productivity
%
py=-1;
ph=1;
pp=1;
%
% Dynamic equations (k a lambda)
%
%
% Accumulation
%
kk=gam;
kkl=delta-1;
kil=gam+delta-1;
%
% Shock
%
aa=1;
aal=-rhoa;
ae=1;      
%
% Euler
%
ll=-1;
lll=1;
lk=alpha*beta*yok/gam;
ly=lk;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%                      Define the matrices                    %
%                                                             %
%                                                             %
%  Mcc X(t) = Mcs S(t)                                        %
%  Mss0 S(t+1) + Mss1 S(t) = Msc0 X(t+1) + Msc1 X(t) + e(t+1) %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Static equations :
%
% c h y i p
% 1 2 3 4 5
%
% Dynamic equations :
%
% k a lambda
% 1 2 3 
%
% Mcc
%
Mcc(1,1)=cc;
Mcc(2,1)=hc;
Mcc(2,2)=hh;
Mcc(2,3)=hy;
Mcc(3,2)=yh;
Mcc(3,3)=yy;
Mcc(4,1)=ic;
Mcc(4,3)=iy;
Mcc(4,4)=ii;
Mcc(5,2)=ph;
Mcc(5,3)=py;
Mcc(5,5)=pp;
%
% Mcs
%
Mcs(1,3)=cl;
Mcs(3,1)=yk;
Mcs(3,2)=ya;
%
% Mss0
%
Mss0(1,1)=kk;
Mss0(2,2)=aa;
Mss0(3,1)=lk;
Mss0(3,3)=ll;
%
% Mss1
%
Mss1(1,1)=kkl;
Mss1(2,2)=aal;
Mss1(3,3)=lll;
%
% Msc0
%
Msc0(3,3)=ly;
%
% Msc1
%
Msc1(1,4)=kil;
%
% Mse
%
Mse(2,1)=ae;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%              Solve the Farmer's system                      %
%                                                             %
%           -1                                                %
% X(t) = Mcc  Mcs S(t)                                        %
%                                                             %
%                      -1             -1                      %
% S(t+1)=(Mss0-Msc0 Mcc  Mcs)(Msc1 Mcc  Mcs-Mss1)S(t)         %
%                       -1                                    %
%        +(Mss0-Msc0 Mcc  Mcs)e(t+1)                          %
%                                                             %
% S(t+1) = W S(t) + R e(t+1)                                  %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% First form the preceeding system
%
M0=inv(Mss0-Msc0*inv(Mcc)*Mcs);
M1=(Mss1-Msc1*inv(Mcc)*Mcs);
W=-M0*M1;
%
% 1) Compute the eigenvalues (MU) and eigenvectors (P) of W
% 2) Compute their modulus (AMU)
% 3) Sort the eigenvalues and rearrange the matrix of eigenvectors accordingly (P)
% 4) Form the inverse of P (Ps)
%
[P,MU] = eig(W);
AMU=diag(abs(MU))';
disp('Eigenvalues / modulus of the system :')
disp('=====================================')
disp(' ');       
disp([diag(MU)';AMU])
flag=sum(AMU>1);
if flag==nforw;
   disp('Blanchard-Kahn conditions checked')
else
   disp('Blanchard-Kahn conditions NOT checked')
end;   
disp(' ');       
[MU,k] = sort(AMU);
P=P(:,k);
Ps=inv(P);
%
% Solves the system using Farmer's method
%
M=[eye(ntotb);-inv(Ps(ntotb+1:nstat,ntotb+1:nstat))*Ps(ntotb+1:nstat,1:ntotb)];
MSS=W(1:ntotb,:)*M;
M2=M0*Mse;
MSE=M2(1:ntotb,nshoc);                                               
PI=inv(Mcc)*Mcs*M;
%
% We are done !!
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%  So we now get :                                            %
%                                                             %
%  X(t)=Pi S(t)                                               %
%                                                             %
%  S(t+1)=MSS S(t) + MSE e(t+1)                               %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp('Policy Functions :')
disp('==================');
disp(' ');       
disp('K(t+1) - A(t+1) as functions of (K(t),A(t)) :');
disp(' ');       
disp(MSS);            
disp('C(t) - h(t) - Y(t) - I(t) - Y(t)/h(t) as functions of (K(t),A(t)) :');
disp(' ');       
disp(PI);
diary off;						% Stop recording output in a file
disp('Hit a Key');pause;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%     Impulse response functions to a technological shock     %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CA=[1];										% initial value of the impulse
REPSA=zeros(ntotb,nrep);				% IRF matrix of state variables
REPSA(:,1)=MSE*CA;						% Initialize the IRF matrix of state variables
for i=2:nrep;								%
    REPSA(:,i)=MSS*REPSA(:,i-1);		% Main loop for IRF
end;											%
REPXA=PI*REPSA;							% IRF matrix of controls
%
% Graphs
%
T=1:nrep;
subplot(221);plot(T,REPXA(1,:));title('IRF(C,A)');
xlabel('Quarters');ylabel('% deviation')
subplot(222);plot(T,REPXA(3,:));title('IRF(Y,A)');
xlabel('Quarters');ylabel('% deviation')
subplot(223);plot(T,REPXA(4,:));title('IRF(I,A)');
xlabel('Quarters');ylabel('% deviation')
subplot(224);plot(T,REPSA(1,:));title('IRF(K,A)');
xlabel('Quarters');ylabel('% deviation')
print -dps irbc1.eps;
pause;close		% wait for you to hit a key and close the graph window
subplot(221);plot(T,REPXA(2,:));title('IRF(H,A)');
xlabel('Quarters');ylabel('% deviation')
subplot(222);plot(T,REPXA(5,:));title('IRF(P,A)');
xlabel('Quarters');ylabel('% deviation')
print -dps irbc2.eps;
pause;close		% wait for you to hit a key and close the graph window
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%                          Simulation                         %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

HP=hpmat(long,1600); % Retrieve the matrix for the HP filter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%                     Loop of Simulation                      %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The deterministic component
%
trend=(1:long)*log(gam);
determ=[1;0;1;1;1]*trend+log([css;hss;yss;iss;yss/hss]*ones(size(trend)));
%
% stochastic Simulation 
%                   
SSIM=zeros(ntotb,slong);				% matrix of simulated state variables
SHP=zeros(nsim,length(select));		% matrix to store simulated standard deviations
SRHP=zeros(nsim,length(select));		% matrix to store simulated relative standard deviations
CHP=zeros(nsim,length(select));		% matrix to store simulated correlations
CHYN=zeros(nsim,1);						% matrix to store simulated employment-productivity correlation
%
% Beginning of Monte-Carlo loop
%
for j=1:nsim;
   disp(sprintf('Simulation : %4.0f',j));
   SHOCK=[stda]*randn(nshoc,slong);                % Draw a random number from N(0,stda)
   SSIM=MSE*SHOCK(1,1);										% Initialize each simulation
   for t=2:slong;												%
      SSIM(:,t)=MSS*SSIM(:,t-1)+MSE*SHOCK(:,t);		% Simulate state variables
   end;															%
   %
   % Retrieve control variables. Note that :
   %		1) we add the deterministic component
   %		2) we throw out the first trunc simulations in order 
   %			to be free of any initial conditions effects
   %
   XSIM=PI(select,:)*SSIM(:,trunc:trunc+long-1)+determ;
   %
   % HP-filter the control variables
	%
   HPSIM=XSIM'-HP\XSIM';
   %
   % Compute and store the moments of interest
   %
   SHP(j,:)=std(HPSIM);
   SRHP(j,:)=SHP(j,:)/std(HPSIM(:,indy));
   VCOV=cov(HPSIM);
   CHP(j,:)=VCOV(indy,:)./sqrt(diag(VCOV)'*VCOV(indy,indy));
   CHYN(j,:)=VCOV(indn,indp)./sqrt(VCOV(indn,indn)*VCOV(indp,indp));
end;                                                         
%
% End of Monte-Carlo loop
%

%
% Now, display the results
%
diary rbc.res;		% restart recording output in the file rbc.res
disp(' ')
disp('Quantitative Evaluation :');
disp('=========================');
disp(' ');
disp(sprintf('Based on %5.0f simulations',nsim));
disp(' ');
disp('Standard Deviation : C - h - Y - I - Y/N');
disp(' ');
disp(100*[mean(SHP);std(SHP)]);
disp('Relative Standard Deviation : C - h - Y - I - Y/N');
disp(' ');
disp([mean(SRHP);std(SRHP)]);
disp('Correlation with Output : C - h - Y - I - Y/N');
disp(' ');
disp([mean(CHP);std(CHP)]);
disp('Correlation Hours - productivity');
disp(' ');
disp([mean(CHYN);std(CHYN)]);
diary off;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品国产一区二区三区不卡 | 午夜精品久久久久| 中文字幕国产一区| 中文字幕 久热精品 视频在线| 欧美成人女星排行榜| 精品99999| 中文字幕第一页久久| 综合久久久久综合| 一个色在线综合| 青青草国产精品亚洲专区无| 毛片一区二区三区| 成人性生交大片免费看在线播放| 成人小视频免费在线观看| 成人激情小说乱人伦| 91免费看`日韩一区二区| 在线视频欧美区| 777精品伊人久久久久大香线蕉| 在线成人小视频| 精品不卡在线视频| 综合久久综合久久| 日本视频中文字幕一区二区三区| 国产综合色在线视频区| 91丝袜高跟美女视频| 欧美日韩一区高清| 国产网红主播福利一区二区| 亚洲欧美视频一区| 美女网站一区二区| 风流少妇一区二区| 欧美色综合网站| 久久精品亚洲乱码伦伦中文 | 欧美一级精品在线| 国产农村妇女毛片精品久久麻豆 | 久久蜜桃av一区精品变态类天堂| 国产精品美女一区二区| 日本不卡一区二区三区| 大白屁股一区二区视频| 91精品国产一区二区| 国产精品入口麻豆九色| 日韩av一级片| 色综合欧美在线| 精品国产乱码久久久久久夜甘婷婷| |精品福利一区二区三区| 蜜臀av一区二区| 在线影视一区二区三区| 久久久久久久久97黄色工厂| 午夜激情久久久| 99久久久国产精品| 久久精品一区八戒影视| 奇米777欧美一区二区| 91在线国产福利| 中文天堂在线一区| 国产主播一区二区三区| 欧美人与禽zozo性伦| 亚洲男女一区二区三区| 国产激情精品久久久第一区二区| 欧美日韩国产不卡| 玉米视频成人免费看| 国产麻豆精品久久一二三| 这里只有精品免费| 五月天丁香久久| 欧美日韩和欧美的一区二区| 亚洲精品国产成人久久av盗摄 | 国产成人在线视频播放| 日韩色视频在线观看| 亚洲va国产va欧美va观看| 91国产福利在线| 亚洲欧美色一区| 色婷婷久久综合| 亚洲美腿欧美偷拍| 色综合久久88色综合天天| ㊣最新国产の精品bt伙计久久| 国产精品99久久久久久似苏梦涵| 日韩免费高清视频| 麻豆91在线观看| 精品国产成人系列| 国产在线视频一区二区| 久久久久久**毛片大全| 国产麻豆午夜三级精品| 国产性色一区二区| 99久久综合精品| 一区二区三区四区激情| 欧美性受xxxx| 奇米精品一区二区三区四区| 精品久久五月天| 成人午夜视频在线观看| 国产精品污www在线观看| 99精品久久只有精品| 亚洲小少妇裸体bbw| 欧美狂野另类xxxxoooo| 秋霞影院一区二区| 久久久国产精华| 91小视频免费看| 视频在线在亚洲| 国产三区在线成人av| 91久久香蕉国产日韩欧美9色| 亚洲综合色噜噜狠狠| 91精品国产全国免费观看| 午夜激情一区二区三区| 久久这里只有精品6| 91蝌蚪porny成人天涯| 亚洲成人黄色小说| 久久久99免费| 在线视频国内一区二区| 美女一区二区三区| 亚洲日本青草视频在线怡红院| 欧美日韩在线播放三区四区| 久久精品72免费观看| 国产精品久久久一本精品 | 国产欧美视频在线观看| 99国产精品99久久久久久| 婷婷综合久久一区二区三区| 久久精品一级爱片| 69堂亚洲精品首页| 成人avav影音| 日韩中文字幕不卡| 国产精品久久久一本精品| 欧美一级在线观看| 色欧美日韩亚洲| 国产精品18久久久久久久久久久久| 一区二区日韩电影| 国产日本欧洲亚洲| 欧美一区二区三区系列电影| 99精品热视频| 国产成人亚洲精品狼色在线| 午夜久久电影网| 亚洲美女视频在线观看| 国产嫩草影院久久久久| 欧美成人精精品一区二区频| 欧美日韩一区在线观看| 91丨九色丨尤物| 成人av资源站| 高清不卡在线观看av| 激情文学综合网| 天天影视网天天综合色在线播放| 国产精品麻豆久久久| 欧美激情一区三区| 久久久亚洲国产美女国产盗摄| 91麻豆精品国产自产在线观看一区| av电影在线观看完整版一区二区| 国产精品一区二区三区网站| 麻豆91精品91久久久的内涵| 性久久久久久久久| 午夜精品久久久久久久99樱桃| 亚洲精品高清视频在线观看| 亚洲人妖av一区二区| 综合激情成人伊人| 国产精品久久久久久久久搜平片| 国产清纯白嫩初高生在线观看91 | 成人毛片在线观看| 国产又粗又猛又爽又黄91精品| 久久国产精品一区二区| 精品一区二区三区久久久| 久久福利资源站| 国产综合久久久久影院| 国产成人在线视频免费播放| 国产精品乡下勾搭老头1| 国产a久久麻豆| 波多野结衣在线aⅴ中文字幕不卡| 丁香激情综合五月| 91丨porny丨首页| 欧美亚洲一区三区| 制服丝袜亚洲精品中文字幕| 欧美v日韩v国产v| 国产性做久久久久久| 国产精品电影一区二区三区| 亚洲另类在线视频| 日日欢夜夜爽一区| 国产一区二区在线看| 成人国产精品免费网站| 在线观看一区日韩| 91精品国产一区二区| 欧美国产激情二区三区| 一区二区三区在线免费| 美女精品自拍一二三四| 成人一区二区三区中文字幕| 日本高清不卡视频| 日韩一区二区三区观看| 中文字幕+乱码+中文字幕一区| 亚洲综合区在线| 精品一区二区三区蜜桃| 91极品美女在线| 精品国产免费久久| 一区二区三区在线免费| 国产一区二区91| 欧美视频一区二区三区| 国产亚洲欧美一级| 亚洲一区二区av电影| 精彩视频一区二区| 欧美专区在线观看一区| 精品美女被调教视频大全网站| 亚洲视频一区在线| 裸体在线国模精品偷拍| 欧美主播一区二区三区| 国产日产精品1区| 日韩黄色免费网站| 91免费看`日韩一区二区| 久久影视一区二区| 日韩国产欧美在线视频| 色婷婷亚洲婷婷| 国产精品久久久久毛片软件|