% US_Macrodat.m % ************* % PART 3: M U L T I - E Q U A T I O N S M O D E L S % APPENDIX 14.1 A Small Macroeconomic Model % ============================================================== % Robert S. Pindyck & Daniel L. Rubinfeld % Econometric Models & Economic Forecast, 4/e % McGraw-Hill, 1998 % ISBN 0-07-050208-0 % % Data to accompany Econometric Models & Economic Forecast, 4/e % (c) Irwin/McGraw-Hill, 1998 % Disk 1 of 1 % ISBN 0-07-848043-4 % ============================================================== % Endogenous Variables % ~~~~~~~~~~~~~~~~~~~~ % 1. C Personal consumption expenditures (SAAR, BIL.FXD.1992$) % 2. GDP Gross domestic product (SAAR, BIL.FXD.1992$) % 3. INFL Rate of growth of CPI (SA, % P.Q. annualized) % 4. INR Nonresidential fixed investment (SAAR, BIL.FXD.1992$) % 5. INV Changes in bsiness inventories (SAAR, BIL.FXD.1992$) % 6. IR Residential fixed investment (SAAR, BIL.FXD.1992$) % 7. M Imports of goods and services (SAAR, BIL.FXD.1992$) % 8. RL Average yield on AAA corporate bonds (% P.A.) % 9. RS Interest rate on 3-month Treasury bills (% P.A.) % 10. TAX Personal and indirect bussiness tax payments (SAAR, BIL.FXD.1992$) % 11. UR Civilian unemployment rate (SA, %) % 12. WINF Wage inflation (SA, % P.A. annualized) % 13. YPD Disposable personal income (SAAR, BIL.FXD.1992$) % Exogenous Variables % ~~~~~~~~~~~~~~~~~~~ % 1. G Gaverment purchases of goods an services (SAAR, BIL.FXD.1992$) % 2. GDPPOT Potential GDP (SAAR, BIL.FXD.1992$) % 3. M2 Money stock (nominal) (SA, BIL. $) % 4. NETWRTH Household net worth (SAAR, BIL.FXD.1992$) % 5. OIL Rate of growth of oil price (SA, % P.A. annualized) % 6. PRFT Corporate profits (SAAR, BIL.FXD.1992$) % 7. PROD Rate of growth of labor productivity (SA, % P.A. annualized) % 8. TR Transfer payments to persons (SAAR, BIL.FXD.1992$) % 9. X Exports of goods and services (SAAR, BIL.FXD.1992$) % 10. M2_P Money stock (real) (SAAR, BIL.FXD.1992$) % t Time (quarter) close all clear all clc load US_Macrodat % maximal lag maxl = 5; %maximal lagged variable - 5 quartals last = 0; % Lagged Endogenous Variables % ~~~~~~~~~~~~~~~~~~~~~~~~~~~ C_1 = C(maxl+1-1:end-1-last); C_2 = C(maxl+1-2:end-2-last); GDP_1 = GDP(maxl+1-1:end-1-last); GDP_2 = GDP(maxl+1-2:end-2-last); INFL_1 = INFL(maxl+1-1:end-1-last); IR_1 = IR(maxl+1-1:end-1-last); INR_1 = INR(maxl+1-1:end-1-last); INV_1 = INV(maxl+1-1:end-1-last); INV_2 = INV(maxl+1-2:end-2-last); M_1 = M(maxl+1-1:end-1-last); RL_1 = RL(maxl+1-1:end-1-last); RL_2 = RL(maxl+1-2:end-2-last); RL_4 = RL(maxl+1-4:end-4-last); RL_5 = RL(maxl+1-5:end-5-last); RS_1 = RS(maxl+1-1:end-1-last); RS_2 = RS(maxl+1-2:end-2-last); TAX_1 = TAX(maxl+1-1:end-1-last); UR_1 = UR(maxl+1-1:end-1-last); UR_2 = UR(maxl+1-2:end-2-last); WINF_1 = WINF(maxl+1-1:end-1-last); YPD_1 = YPD(maxl+1-1:end-1-last); YPD_2 = YPD(maxl+1-2:end-2-last); % Endogenous Variables % ~~~~~~~~~~~~~~~~~~~~ C = C(maxl+1:end-last); GDP = GDP(maxl+1:end-last); INFL = INFL(maxl+1:end-last); INR = INR(maxl+1:end-last); INV = INV(maxl+1:end-last); IR = IR(maxl+1:end-last); M = M(maxl+1:end-last); RL = RL(maxl+1:end-last); RS = RS(maxl+1:end-last); TAX = TAX(maxl+1:end-last); UR = UR(maxl+1:end-last); WINF = WINF(maxl+1:end-last); YPD = YPD(maxl+1:end-last); dM = M-M_1; dUR = UR-UR_1; % Lagged Exogenous Variables % ~~~~~~~~~~~~~~~~~~~~~~~~~~~ GDPPOT_1 = GDPPOT(maxl+1-1:end-1-last); M2_1 = M2(maxl+1-1:end-1-last); NETWRTH_1 = NETWRTH(maxl+1-1:end-1-last); M2_P_1 = M2_P(maxl+1-1:end-1-last); % Exogenous Variables % ~~~~~~~~~~~~~~~~~~~ G = G(maxl+1:end-last); GDPPOT = GDPPOT(maxl+1:end-last); M2 = M2(maxl+1:end-last); NETWRTH = NETWRTH(maxl+1:end-last); OIL = OIL(maxl+1:end-last); PRFT = PRFT(maxl+1:end-last); PROD = PROD(maxl+1:end-last); TR = TR(maxl+1:end-last); X = X(maxl+1:end-last); M2_P = M2_P(maxl+1:end-last); %Another Variables t = t(maxl+1:end-last); n = length(t); %Another Endogenous Variables dGDP_C = (GDP-C)-(GDP_1-C_1); %d[GDP(t)-C(t)] dGDP_C_1 = (GDP_1-C_1)-(GDP_2-C_2); %d[GDP(t-1)-C(t-1)] dlogGDP_GDPPOT = (log(GDP)-log(GDP_1))-(log(GDPPOT)-log(GDPPOT_1)); %[logGDP(t)-logGDP(t-1)]-[logGDPPOT(t)-logGDPPOT(t-1)] %Another Exogenous Variables konst = ones(n,1); set(0,'DefaultAxesFontSize',7.5); set(0,'DefaultLineLineWidth',1.0); %%%%%%%%%%%%%%%%%%%%%%%% % ENDOGENOUS VARIABLES % %%%%%%%%%%%%%%%%%%%%%%%% figure set(gcf,'Name','Endogenous variables') subplot(5,3,1) plot(t,C,'b') axis([min(t)-0.5, max(t)+0.5, min(C), max(C)]) title('Personal consumption expenditures') ylabel('C_{ t}'); grid subplot(5,3,2) plot(t,GDP,'b') hold on plot(t,GDPPOT,'r:') hold on axis([min(t)-0.5, max(t)+0.5, min(GDP), max(GDP)]) title('Gross domestic product') ylabel('GDP_{ t}'); legend('GDP','GDPPOT') grid subplot(5,3,3) plot(t,INFL,'b') axis([min(t)-0.5, max(t)+0.5, min(INFL), max(INFL)]) title('Rate of growth of CPI') ylabel('INFL_{ t} (SA, % P.A. annualized)'); grid subplot(5,3,4) plot(t,INR,'b') title('Nonresidential fixed investment') ylabel('INR_{ t}'); axis([min(t)-0.5, max(t)+0.5, min(INR), max(INR)]) grid subplot(5,3,5) plot(t,INV,'b') title('Changes in business inventories') ylabel('INV_{ t}'); axis([min(t)-0.5, max(t)+0.5, min(INV), max(INV)]) grid subplot(5,3,6) plot(t,IR,'b') title('Residential fixed investment') ylabel('IR_{ t}'); axis([min(t)-0.5, max(t)+0.5, min(IR), max(IR)]) grid subplot(5,3,7) plot(t,M,'b') title('Imports of goods and services') ylabel('M_{ t}'); axis([min(t)-0.5, max(t)+0.5, min(M), max(M)]) grid subplot(5,3,8) plot(t,RL,'b') title('Average yield on AAA corporate bonds') ylabel('RL_{ t} (% P.A.)'); axis([min(t)-0.5, max(t)+0.5, min(RL), max(RL)]) grid subplot(5,3,9) plot(t,RS,'b') title('Interest rate on 3-month Treasury bills') ylabel('RS_{ t} (% P.A.)'); axis([min(t)-0.5, max(t)+0.5, min(RS), max(RS)]) grid subplot(5,3,10) plot(t,TAX,'b') title('Personal and indirect bussiness tax payments') ylabel('TAX_{ t}'); axis([min(t)-0.5, max(t)+0.5, min(TAX), max(TAX)]) grid subplot(5,3,11) plot(t,UR,'b') title('Civilian unemployment rate') ylabel('UR_{ t} (SA, %)'); xlabel('t (quarter)'); axis([min(t)-0.5, max(t)+0.5, min(UR), max(UR)]) grid subplot(5,3,12) plot(t, WINF,'b') title('Wage inflation') ylabel('WINF_{ t} (SA, % P.A. annualized)'); xlabel('t (quarter)'); axis([min(t)-0.5, max(t)+0.5, min(WINF), max(WINF)]) grid subplot(5,3,13) plot(t, YPD,'b',t,GDP,'r:') title('Disposable personal income') ylabel('YPD_{ t}'); xlabel('t (quarter)'); legend('YPD','GDP'); axis([min(t)-0.5, max(t)+0.5, min(YPD), max(YPD)]) grid %%%%%%%%%%%%%%%%%%%%%%% % EXOGENOUS VARIABLES % %%%%%%%%%%%%%%%%%%%%%%% figure set(gcf,'Name','Exogenous variables') subplot(4,3,1) plot(t,G,'r') axis([min(t)-0.5, max(t)+0.5, min(G), max(G)]) ylabel('G_{ t}') title('Gaverment purchases of goods an services') grid subplot(4,3,2) plot(t,GDPPOT,'r') axis([min(t)-0.5, max(t)+0.5, min(GDPPOT), max(GDPPOT)]) ylabel('GDPPOT_{ t}') title('Potential GDP'); grid subplot(4,3,3) plot(t,M2,'r') axis([min(t)-0.5, max(t)+0.5, min(M2), max(M2)]) ylabel('M2_{ t} (SA, BIL. $)') title('Money stock') grid subplot(4,3,4) plot(t,NETWRTH,'r') axis([min(t)-0.5, max(t)+0.5, min(NETWRTH), max(NETWRTH)]) ylabel('NETWRTH_{ t}') title('Household net worth') grid subplot(4,3,5) plot(t,OIL,'r') axis([min(t)-0.5, max(t)+0.5, min(OIL), max(OIL)]) ylabel('OIL_{ t} (SA, % P.A. annualized)') title('Rate of growth of oil price') grid subplot(4,3,6) plot(t,PRFT,'r') axis([min(t)-0.5, max(t)+0.5, min(PRFT), max(PRFT)]) ylabel('PRFT_{ t}') title('Corporate profits') grid subplot(4,3,7) plot(t,PROD,'r') axis([min(t)-0.5, max(t)+0.5, min(PROD), max(PROD)]) ylabel('PROD_{ t} (SA, % P.A. annualized)') title('Rate of growth of labor productivity') grid subplot(4,3,8) plot(t,TR,'r') axis([min(t)-0.5, max(t)+0.5, min(TR), max(TR)]) ylabel('TR_{ t}') xlabel('t (quarter)'); title('Transfer payments to persons') grid subplot(4,3,9) plot(t,X,'r') axis([min(t)-0.5, max(t)+0.5, min(X), max(X)]) ylabel('X_{ t}') xlabel('t (quarter)'); title('Exports of goods and services') grid subplot(4,3,10) plot(t,M2_P,'r') axis([min(t)-0.5, max(t)+0.5, min(M2_P), max(M2_P)]) ylabel('[M2/P]_{ t}') xlabel('t (quarter)'); title('Real money stock') grid %eq. A14.3 disp('*************'); disp('*A14.3 Taxes*'); disp('*************'); y = TAX; yendog = [GDP]; xexog = [konst]; xall = [konst G X PRFT TR NETWRTH M2 PROD OIL GDPPOT C_1 RL_4 YPD_1 RS_1 INV_1 RL_1 UR_2 INFL_1 M_1 GDP_1]; res_TAX = tsls(y,yendog,xexog,xall); vnames_TAX = strvcat('TAX','GDP','konstanta'); prt_reg(res_TAX,vnames_TAX); %eq. A14.4 disp('*******************'); disp('*A14.4 Consumption*'); disp('*******************'); y = C; yendog = [YPD RS]; xexog = [konst NETWRTH C_1]; xall = [konst G X PRFT TR NETWRTH M2 PROD OIL GDPPOT C_1 RL_4 YPD_1 RS_1 INV_1 RL_1 UR_2 INFL_1 M_1 GDP_1]; res_C = tsls(y,yendog,xexog,xall); vnames_C = strvcat('C','YPD','RS','konstanta','NETWRTH','C_1'); prt_reg(res_C,vnames_C); %eq. A14.5 disp('***************'); disp('*A14.5 Imports*'); disp('***************'); y = dM; yendog = [YPD]; xexog = [konst]; xall = [konst G X PRFT TR NETWRTH M2 PROD OIL GDPPOT C_1 RL_4 YPD_1 RS_1 INV_1 RL_1 UR_2 INFL_1 M_1 GDP_1]; res_dM = tsls(y,yendog,xexog,xall); vnames_dM = strvcat('dM','YPD','konstanta'); prt_reg(res_dM,vnames_dM); %eq. A14.6 disp('**********************************'); disp('*A14.6 Investment - Nonresidental*'); disp('**********************************'); y = INR; yendog = [GDP]; xexog = [konst RL_4]; xall = [konst G X PRFT TR NETWRTH M2 PROD OIL GDPPOT C_1 RL_4 YPD_1 RS_1 INV_1 RL_1 UR_2 INFL_1 M_1 GDP_1]; res_INR = tsls(y,yendog,xexog,xall); vnames_INR = strvcat('INR','GDP','konstanta','RL_4'); prt_reg(res_INR,vnames_INR); %eq. A14.7 disp('*******************************'); disp('*A14.7 Investment - Residental*'); disp('*******************************'); y = IR; %yendog = []; xexog = [konst YPD_1 RS_1]; %xall = [konst C G GDP GDPPOT INFL INR INV IR M M2 NETWRTH RL X IR_1 RS_2 YPD_2]; %res_IR = tsls(y,yendog,xexog,xall); res_IR = ols(y,xexog); vnames_IR = strvcat('IR','konstanta','YPD_1','RS_1'); prt_reg(res_IR,vnames_IR); %eq. A14.8 disp('*******************'); disp('*A14.8 Inventories*'); disp('*******************'); y = INV; yendog = [dGDP_C]; xexog = [konst INV_1]; xall = [konst G X PRFT TR NETWRTH M2 PROD OIL GDPPOT C_1 RL_4 YPD_1 RS_1 INV_1 RL_1 UR_2 INFL_1 M_1 GDP_1]; res_INV = tsls(y,yendog,xexog,xall); vnames_INV = strvcat('INV','dGDP_C','konstanta','INV_1'); prt_reg(res_INV,vnames_INV); %eq. A14.9 disp('*************************************'); disp('*A14.9 Interest Rate - Treasury Bill*'); disp('*************************************'); y = RS; yendog = [YPD INFL]; xexog = [konst M2]; xall = [konst G X PRFT TR NETWRTH M2 PROD OIL GDPPOT C_1 RL_4 YPD_1 RS_1 INV_1 RL_1 UR_2 INFL_1 M_1 GDP_1]; res_RS = tsls(y,yendog,xexog,xall); vnames_RS = strvcat('RS','YPD','INFL','konstanta','M2'); prt_reg(res_RS,vnames_RS); %eq. A14.10 disp('*********************************'); disp('*A14.10 Interest Rate - AAA Bonds*'); disp('*********************************'); y = RL; yendog = [RS]; xexog = [konst RL_1]; xall = [konst G X PRFT TR NETWRTH M2 PROD OIL GDPPOT C_1 RL_4 YPD_1 RS_1 INV_1 RL_1 UR_2 INFL_1 M_1 GDP_1]; res_RL = tsls(y,yendog,xexog,xall); vnames_RL = strvcat('RL','RS','konstanta','RL_1'); prt_reg(res_RL,vnames_RL); %eq. A14.11 disp('*********************'); disp('*A14.11 Unemployment*'); disp('*********************'); y = dUR; yendog = [dlogGDP_GDPPOT]; xexog = [konst]; xall = [konst G X PRFT TR NETWRTH M2 PROD OIL GDPPOT C_1 RL_4 YPD_1 RS_1 INV_1 RL_1 UR_2 INFL_1 M_1 GDP_1]; res_dUR = tsls(y,yendog,xexog,xall); vnames_dUR = strvcat('dUR','dlogGDP_GDPPOT','konstanta'); prt_reg(res_dUR,vnames_dUR); %eq. A14.12 disp('***********************'); disp('*A14.12 Wage Inflation*'); disp('***********************'); y = WINF; yendog = [INFL]; xexog = [konst UR_2 PROD]; xall = [konst G X PRFT TR NETWRTH M2 PROD OIL GDPPOT C_1 RL_4 YPD_1 RS_1 INV_1 RL_1 UR_2 INFL_1 M_1 GDP_1]; res_WINF = tsls(y,yendog,xexog,xall); vnames_WINF = strvcat('WINF','INFL','konstanta','UR_2','PROD'); prt_reg(res_WINF,vnames_WINF); %eq. A14.13 disp('**********************'); disp('*A14.13 CPI Inflation*'); disp('**********************'); y = INFL; yendog = [WINF]; xexog = [konst C_1 OIL INFL_1]; xall = [konst G X PRFT TR NETWRTH M2 PROD OIL GDPPOT C_1 RL_4 YPD_1 RS_1 INV_1 RL_1 UR_2 INFL_1 M_1 GDP_1]; res_INFL = tsls(y,yendog,xexog,xall); vnames_INFL = strvcat('INFL','WINF','konstanta','C_1','OIL','INFL_1'); prt_reg(res_INFL,vnames_INFL); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ENDOGENOUS VARIABLES - actual vs. predicted % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% res_M.yhat = res_dM.yhat + M_1; res_GDP.yhat = res_C.yhat + res_INR.yhat + res_IR.yhat + res_INV.yhat + G + X - res_M.yhat; res_YPD.yhat = res_GDP.yhat - PRFT + TR - res_TAX.yhat; res_UR.yhat = res_dUR.yhat + UR_1; %Simulation simBB*simYY = simCC*simXX => simYY = inv(simBB)*simCC*simXX %nacteni parametru (cislovani dle Pindyck-Rubinfeld (a(ij)...i-ta rovnice, j-ty parametr a31 = res_TAX.beta(2); a32 = res_TAX.beta(1); a41 = res_C.beta(3); a42 = res_C.beta(1); a43 = res_C.beta(4); a44 = res_C.beta(2); a45 = res_C.beta(5); a51 = res_dM.beta(2); a52 = res_dM.beta(1); a61 = res_INR.beta(2); a62 = res_INR.beta(1); a63 = res_INR.beta(3); a71 = res_IR.beta(1); a72 = res_IR.beta(2); a73 = res_IR.beta(3); a81 = res_INV.beta(2); a82 = res_INV.beta(1); a83 = res_INV.beta(3); a91 = res_RS.beta(3); a92 = res_RS.beta(1); a93 = res_RS.beta(4); a94 = res_RS.beta(2); a101 = res_RL.beta(2); a102 = res_RL.beta(1); a103 = res_RL.beta(3); a111 = res_dUR.beta(2); a112 = res_dUR.beta(1); a121 = res_WINF.beta(2); a122 = res_WINF.beta(1); a123 = res_WINF.beta(3); a124 = res_WINF.beta(4); a131 = res_INFL.beta(2); a132 = res_INFL.beta(1); a133 = res_INFL.beta(3); a134 = res_INFL.beta(4); a135 = res_INFL.beta(5); %matice pro prevod na redukovanou formu simBB =[1 0 0 -1 0 -1 -1 -1 0 0 0 0 1 0 -1 1 1 0 0 0 0 0 0 0 0 0 0 0 -a32 0 1 0 0 0 0 0 0 0 0 0 0 0 0 -a42 0 1 0 0 0 0 -a44 0 0 0 0 0 0 -a52 0 0 1 0 0 0 0 0 0 0 0 0 -a62 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 -a82 0 -a92 0 0 0 0 0 0 1 0 0 -a94 0 0 0 0 0 0 0 0 0 0 -a102 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -a122 0 0 0 0 0 0 0 0 0 0 0 0 -a132 1 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 -1 0 0 1 0 0 0 0 0 0 0 0 0 1]; simCC = [0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a41 0 0 0 0 a43 0 0 0 a45 0 0 0 0 0 0 0 0 0 a51 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a61 0 0 0 0 0 0 0 0 0 a63 0 0 0 0 0 0 0 0 a71 0 0 0 0 0 0 0 0 0 0 a72 a73 0 0 0 0 0 0 a81 0 0 0 0 0 0 0 0 0 0 0 0 a83 0 0 0 0 0 a91 0 0 0 0 0 a93 0 0 0 0 0 0 0 0 0 0 0 0 a101 0 0 0 0 0 0 0 0 0 0 0 0 0 a103 0 0 0 0 a121 0 0 0 0 0 0 a124 0 0 0 0 0 0 0 a123 0 0 0 a131 0 0 0 0 0 0 0 a134 a133 0 0 0 0 0 0 a135 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 -1]; %deklarace simulovanych promennych simGDP = zeros(n,1); simYPD = zeros(n,1); simTAX = zeros(n,1); simC = zeros(n,1); simdM = zeros(n,1); simINR = zeros(n,1); simIR = zeros(n,1); simINV = zeros(n,1); simRS = zeros(n,1); simRL = zeros(n,1); simWINF = zeros(n,1); simINFL = zeros(n,1); simM = zeros(n,1); simdGDP_C = zeros(n,1); simUR = zeros(n,1); %zacate simulace for i=1:n, %definice zpozdenych promennych pro pripad, kdy jeste nebudou k %dispozici prislusne nasimulovane hodnoty if i<2 simC_1(i) = C_1(i); simYPD_1(i) = YPD_1(i); simRS_1(i) = RS_1(i); simINV_1(i) = INV_1(i); simRL_1(i) = RL_1(i); simUR_1(i) = UR_1(i); simINFL_1(i) = INFL_1(i); simM_1(i) = M_1(i); simGDP_1(i) = GDP_1(i); else simC_1(i) = simC(i-1); simYPD_1(i) = simYPD(i-1); simRS_1(i) = simRS(i-1); simINV_1(i) = simINV(i-1); simRL_1(i) = simRL(i-1); simUR_1(i) = simUR(i-1); simINFL_1(i) = simINFL(i-1); simM_1(i) = simM(i-1); simGDP_1(i) = simGDP(i-1); end if i<3 simUR_2(i) = UR_2(i); else simUR_2(i) = simUR(i-2); end if i<5 simRL_4(i) = RL_4(i); else simRL_4(i) = simRL(i-4); end % vektor predeterminovanych promennych v case i simXX = [1;G(i);X(i);PRFT(i);TR(i);NETWRTH(i);M2(i);PROD(i);OIL(i);simC_1(i);simRL_4(i);simYPD_1(i);simRS_1(i);simINV_1(i);simRL_1(i);simUR_2(i);simINFL_1(i);simM_1(i);simGDP_1(i)]; % simulace pres redukovanou formu simYY = inv(simBB)*simCC*simXX; % simYY = [simGDP(i);simYPD(i);simTAX(i);simC(i);simdM(i);simINR(i);simIR(i);simINV(i);simRS(i);simRL(i);simWINF(i);simINFL(i);simM(i);simdGDP_C(i)] simGDP(i) = simYY(1); simYPD(i) = simYY(2); simTAX(i) = simYY(3); simC(i) = simYY(4); simdM(i) = simYY(5); simINR(i) = simYY(6); simIR(i) = simYY(7); simINV(i) = simYY(8); simRS(i) = simYY(9); simRL(i) = simYY(10); simWINF(i) = simYY(11); simINFL(i) = simYY(12); simM(i) = simYY(13); simdGDP_C = simYY(14); % separatni simulace miry nezamestnanosti kvuli nelinearite promenne dlogGDP_GDPPOT simdUR(i) = a111+a112*(log(simGDP(i))-log(simGDP_1(i))-log(GDPPOT(i))+log(GDPPOT_1(i))); simUR(i) = simdUR(i)+simUR_1(i); end %konec simulace figure set(gcf,'Name','Endogenous variables') subplot(2,2,1) plot(t,C,'b',t,res_C.yhat,'g',t,simC,'r') axis([min(t)-0.5, max(t)+0.5, min(C), max(C)]) title('Personal consumption expenditures') ylabel('C_{ t}'); legend('actual','predicted','simulated') grid subplot(2,2,2) plot(t,GDP,'b',t,res_GDP.yhat,'g',t,simGDP,'y') hold on plot(t,GDPPOT,'r:') hold on axis([min(t)-0.5, max(t)+0.5, min(GDP), max(GDP)]) title('Gross domestic product') ylabel('GDP_{ t}'); legend('GDP','GDPpred','GDPsim','GDPPOT') grid subplot(2,2,3) plot(t,INR,'b',t,res_INR.yhat,'g',t,simINR,'r') title('Nonresidential fixed investment') ylabel('INR_{ t}'); legend('actual','predicted','simulated') axis([min(t)-0.5, max(t)+0.5, min(INR), max(INR)]) grid subplot(2,2,4) plot(t,IR,'b',t,res_IR.yhat,'g',t,simIR,'r') title('Residential fixed investment') ylabel('IR_{ t}'); legend('actual','predicted','simulated') axis([min(t)-0.5, max(t)+0.5, min(IR), max(IR)]) grid figure set(gcf,'Name','Endogenous variables') subplot(2,2,1) plot(t,INV,'b',t,res_INV.yhat,'g',t,simINV,'r') title('Changes in business inventories') ylabel('INV_{ t}'); legend('actual','predicted','simulated') axis([min(t)-0.5, max(t)+0.5, min(INV), max(INV)]) grid subplot(2,2,2) plot(t,RL,'b',t,res_RL.yhat,'g',t,simRL,'r') title('Average yield on AAA corporate bonds') ylabel('RL_{ t} (% P.A.)'); legend('actual','predicted','simulated') axis([min(t)-0.5, max(t)+0.5, min(RL), max(RL)]) grid subplot(2,2,3) plot(t,RS,'b',t,res_RS.yhat,'g',t,simRS,'r') title('Interest rate on 3-month Treasury bills') ylabel('RS_{ t} (% P.A.)'); legend('actual','predicted','simulated') axis([min(t)-0.5, max(t)+0.5, min(RS), max(RS)]) grid subplot(2,2,4) plot(t,UR,'b',t,res_UR.yhat,'g',t,simUR,'r') title('Civilian unemployment rate') ylabel('UR_{ t} (SA, %)'); xlabel('t (quarter)'); legend('actual','predicted','simulated') axis([min(t)-0.5, max(t)+0.5, min(UR), max(UR)]) grid figure set(gcf,'Name','Endogenous variables') subplot(2,2,1) plot(t,INFL,'b',t,res_INFL.yhat,'g',t,simINFL,'r') axis([min(t)-0.5, max(t)+0.5, min(INFL), max(INFL)]) title('Rate of growth of CPI') ylabel('INFL_{ t} (SA, % P.A. annualized)'); legend('actual','predicted','simulated') grid subplot(2,2,2) plot(t,TAX,'b',t,res_TAX.yhat,'g',t,simTAX,'r') title('Personal and indirect bussiness tax payments') ylabel('TAX_{ t}'); legend('actual','predicted','simulated') axis([min(t)-0.5, max(t)+0.5, min(TAX), max(TAX)]) grid subplot(2,2,3) plot(t,WINF,'b',t,res_WINF.yhat,'g',t,simWINF,'r') title('Wage inflation') ylabel('WINF_{ t} (SA, % P.A. annualized)'); xlabel('t (quarter)'); legend('actual','predicted','simulated') axis([min(t)-0.5, max(t)+0.5, min(WINF), max(WINF)]) grid subplot(2,2,4) plot(t,YPD,'b',t,GDP,'r:',t,res_YPD.yhat,'g',t,simYPD,'y') title('Disposable personal income') ylabel('YPD_{ t}'); xlabel('t (quarter)'); legend('YPD','GDP','YPDpred','YPDsim'); axis([min(t)-0.5, max(t)+0.5, min(YPD), max(YPD)]) grid figure set(gcf,'Name','Endogenous variables') plot(t,M,'b',t,res_M.yhat,'g',t,simM,'r') title('Imports of goods and services') ylabel('M_{ t}'); legend('actual','predicted','simulated') axis([min(t)-0.5, max(t)+0.5, min(M), max(M)]) grid