% U S _ S T A T E . M % ################### %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % CREATION AND VERIFICATION OF THE STATE MODEL OF U.S. ECONOMY % % ************************************************************ % % % % Restructuring of the quantified Econometric Model in the form : % % x_t = A0*x_t + A1*x_t-1 + B1*u_t + C1*z_t % % into the form of Matrix State Model : % % x_t = As*x_t-1 + B*u_t + C*z_t % % and to the form of Difference Matrix State Model : % % x_t - x_t-1 = A*x_t-1 + B*u_t + C*z_t % % % % Author: Osvald Vasicek % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% load us_small n=max(size(smallus1)); tp=(1955+1/4:1/4:1955+n/4)'; t=tp(5:n); t_graf=t-1; GNPr=smallus1(:,2)+smallus1(:,6)+smallus1(:,7)+smallus1(:,4)... +smallus3(:,2)+smallus4(:,2); % Units of Variables : % ******************** % CC, GNP, IIN, INR, IR, TAX,... % G, TR, YD, GNPP, WLTH, XM [ billions of 1982 dollars ] % GNPn [ billions nominal dollars ] % INF, RL, RS, UR, WINF, RGM, POIL [ percent per annum ] % t [ quarter ] % Variable Name Definition % ************* ********** % O u t p u t s % time t CC = smallus1(5:n,2); % Consumption GNP = GNPr(5:n); % Gross National Product, real GNPn= smallus1(5:n,3); % Gross National Product, nominal IIN = smallus1(5:n,4); % Inventory Investment INF = 100*smallus1(5:n,5); % Inflation Rate INR = smallus1(5:n,6); % Nonresidential Investment IR = smallus1(5:n,7); % Residential Investment RL = smallus2(5:n,2); % Long-term Interest Rate RS = smallus2(5:n,3); % Short-term Interest Rate TAX = smallus2(5:n,4); % Tax Revenue UR = smallus2(5:n,5); % Unemployment Rate WINF= 100*smallus2(5:n,6); % Rate of Growth of Wage Rate YD = smallus2(5:n,7); % Disposable Income % I n p u t s G = smallus3(5:n,2); % Government Spending GNPP= smallus3(5:n,3); % Potential GNP RGM = 100*smallus3(5:n,4); % Growth Rate of Money Supply POIL= 100*smallus3(5:n,5); % Growth Rate of Oil Prices TR = smallus3(5:n,6); % Transfer Payments WLTH= smallus3(5:n,7); % Houshold Wealth XM = smallus4(5:n,2); % Net Exports % L a g g e d O u t p u t s % time t-1 CC_1 = smallus1(4:n-1,2); GNP_1 = GNPr(4:n-1); IIN_1 = smallus1(4:n-1,4); INF_1 = 100*smallus1(4:n-1,5); INR_1 = smallus1(4:n-1,6); IR_1 = smallus1(4:n-1,7); RL_1 = smallus2(4:n-1,2); RS_1 = smallus2(4:n-1,3); TAX_1 = smallus2(4:n-1,4); UR_1 = smallus2(4:n-1,5); WINF_1= 100*smallus2(4:n-1,6); YD_1 = smallus2(4:n-1,7); % time t-2 INF_2 = 100*smallus1(3:n-2,5); RL_2 = smallus2(3:n-2,2); UR_2 = smallus2(3:n-2,5); % time t-3 INF_3 = 100*smallus1(2:n-3,5); RL_3 = smallus2(2:n-3,2); UR_3 = smallus2(2:n-3,5); % time t-4 RL_4 = smallus2(1:n-4,2); % D i f f e r e n c e s dCC = CC-CC_1; dGNP = GNP-GNP_1; dYD = YD-YD_1; % One sized Vector for Level Constant const=ones(size(G)); % P a r a m e t e r s o f t h e E c o n o m e t r i c M o d e l % ********************************************************************* %(Parameters were estimated by the Least squares Method "OLS") % % TAX_t = t0 + t1*GNP_t %___________________________________________________________________ tax0=-137.074; tax1=0.272; % (-7.54) (41.29) % R2=0.995 s=12.087 DW=2.203 ^ro =0.748 % % C_t = c0 + c1*(YD_t-TR_t) + c2*TR_t + c3*WLTH_t + c4*RS_t + c5*C_t-1 %___________________________________________________________________ c0=-11.161; c1=0.155; c2=0.262; c3=9.716; c4=-2.590; c5=0.739; % (-1.01) (4.94) (5.15) (3.40) (-5.06) (15.34) % R2=0.999 s=10.839 DW=1.86 % % INR_t = inr0 + inr1*GNP_t + inr2*RL_t-4 + inr3*INR_t-1 %___________________________________________________________________ inr0=-22.418; inr1=0.037; inr2=-1.174; inr3=0.776; % (-5.18) (6.24) (-2.82) (18.68) % R2=0.994 s=7.186 DW=1.237 % % IR_t = ir0 + ir1*YD_t +ir2*RS_t-1 %___________________________________________________________________ ir0=-23.046; ir1=0.069; ir2=-1.005; % (-0.47) (3.85) (-2.11) % R2=0.960 s=6.735 DW=1.209 ^ro=0.952 % % IIN_t = iin0 + iin1*(GNP_t-GNP_t-1) + iin2*(C_t-C_t-1) + iin3*IIN_t-1 %______________________________________________________________________ iin0=3.582; iin1=0.509; iin2=-0.647; iin3=0.726; % (2.25) (10.97) (-6.39) (15.73) % R2=0.770 s=9.374 DW=2.234 % % RS_t = rs0 + rs1*YD_t + rs2*(d_M_t/M_t-1) + rs3*(INF_t-1+INF_t-2+INF_t-3) %__________________________________________________________________________ rs0=-0.805; rs1=0.002; rs2=-0.116; rs3=0.105; % (-0.49) (3.51) (-4.38) (2.58) % R2=0.856 s=1.166 DW=2.371 ^p=0.745 % % RL_t = rl0 + rl1*Rs_t + rl2*RL_t-1 %____________________________________________________________________ rl0=0.249; rl1=0.214; rl2=0.793; % (2.21) (7.03) (26.89) % R2=0.975 s=0.475 DW=2.103 % % INF_t= inf0+ inf1*WINF_t+ inf2*YD_t+ inf3*POIL_t+ inf4*(INF_t-1+INF_t-2) %__________________________________________________________________________ inf0=-1.231; inf1=0.521; inf2=0.001; inf3=0.011; inf4=0.187; % (-2.03) (5.58) (2.21) (2.26) (3.95) % R2=0.723 s=1.540 DW=2.294 % % WINF_t = winf0 + winf1*INF_t + winf2*UR_t-3 %___________________________________________________________________ winf0=1.793; winf1=0.795; winf2=-0.039; % (2.30) (11.36) (-0.34) % R2=0.537 s=2.047 DW=2.054 % % UR_t = ur0 + ur1*(YD_t-YD_t-1) + ur2*(GNP_t-GNPP_t) %___________________________________________________________________ ur0=6.394; ur1=0.003; ur2=-0.013; % (14.39) (2.95) (-10.12) % R2=0.967 s=0.296 DW=1.833 ^p=0.938 % 1. E k o n o m e t r i c E q u a t i o n s - structural form %****************************************************************** GNP_e = CC + INR + IR + IIN + G + XM; % ( 1 ) YD_e = GNP - TAX + TR; % ( 2 ) TAX_e = tax0 + tax1*GNP; % ( 3 ) C_e = c0 + c1*(YD-TR) + c2*TR + c3*WLTH + c4*RS+c5*CC_1; % ( 4 ) INR_e = inr0 + inr1*GNP + inr2*RL_4 + inr3*INR_1; % ( 5 ) IR_e = ir0 + ir1*YD + ir2*RS_1; % ( 6 ) IIN_e = iin0 + iin1*dGNP + iin2*dCC + iin3*IIN_1; % ( 7 ) RS_e = rs0 + rs1*YD + rs2*RGM + rs3*(INF_1+INF_2+INF_3); % ( 8 ) RL_e = rl0 + rl1*RS + rl2*RL_1; % ( 9 ) INF_e = inf0 + inf1*WINF + inf2*YD + inf3*POIL + inf4*(INF_1+INF_2); % ( 10 ) WINF_e = winf0 + winf1*INF + winf2*UR_3; % ( 11 ) UR_e = ur0 + ur1*dYD + ur2*(GNP-GNPP); % ( 12 ) % 2. M a t r i x E c o n o m e t r i c M o d e l % x_t=A0*x_t + A1*x_t-1 + B1*u_t + C1*z_t % ********************************************** % Exogenous, Input, State Vector and Initial Condition % ------------------------------------------------------ % Finish Step nf = 29; %...length(G); %...100; length(G); %...100; %...length(G); % i.e., 4.Q / 1987 % Initial Step ns = 9; %...60; %...105 i.e., I.Q / 1982; %....5 i.e., I.Q /1957; % Length of Simulated Interval nr=length((ns:nf)'); % Calendar time of modelled Interval t_e=t(ns-4:nf-4); % Corection of " i d e n t i f i c a t i o n s t r e e t " tax0 = tax0 + mean(TAX(ns:nf) - TAX_e(ns:nf)); c0 = c0 + mean(CC(ns:nf) - C_e(ns:nf)); inr0 = inr0 + mean(INR(ns:nf) - INR_e(ns:nf)); ir0 = ir0 + mean(IR(ns:nf) - IR_e(ns:nf)); iin0 = iin0 + mean(IIN(ns:nf) - IIN_e(ns:nf)); rs0 = rs0 + mean(RS(ns:nf) - RS_e(ns:nf)); rl0 = rl0 + mean(RL(ns:nf) - RL_e(ns:nf)); inf0 = inf0 + mean(INF(ns:nf) - INF_e(ns:nf)); winf0 = winf0 + mean(WINF(ns:nf) - WINF_e(ns:nf)); ur0 = ur0 + mean(UR(ns:nf) - UR_e(ns:nf)); disp(' '); disp(' '); disp(' Start and Finish Time of Simulation'); disp(' ***********************************'); disp([' t_s = ', num2str(tp(ns))]) disp([' t_f = ', num2str(tp(nf))]) disp(' '); pause(3) disp(' Corected Initial Level Constants'); disp(' ********************************'); disp([' tax0 = ', num2str(tax0)]); disp([' c0 = ', num2str(c0)]); disp([' inr0 = ', num2str(inr0)]); disp([' ir0 = ', num2str(ir0)]); disp([' iin0 = ', num2str(iin0)]); disp([' rs0 = ', num2str(rs0)]); disp([' rl0 = ', num2str(rl0)]); disp([' inf0 = ', num2str(inf0)]); disp([' winf0 = ', num2str(winf0)]); disp([' ur0 = ', num2str(ur0)]); pause(3) % Historical Exogenous Trajectory { z_t, t = ts, ts+1, ..., tf } % 1 2 3 4 z= [const(ns:nf) POIL(ns:nf) XM(ns:nf) GNPP(ns:nf)]; % Historical Control Trajectory { u_t, t = ts, ts+1, ..., tf } % 1 2 3 4 u=[G(ns:nf) RGM(ns:nf) TR(ns:nf) WLTH(ns:nf)]; % Historical State Trajectory { x_t, t = ts, ts+1, ..., tf } % 1 2 3 4 5 6 % 7 8 9 10 11 12 % 13 14 15 % 16 17 18 % 19 % --------------------------------------------------------------------- x=[GNP(ns:nf) YD(ns:nf) TAX(ns:nf) CC(ns:nf) INR(ns:nf) IR(ns:nf)... IIN(ns:nf) RS(ns:nf) RL(ns:nf) INF(ns:nf) WINF(ns:nf) UR(ns:nf)... RL_1(ns:nf) INF_1(ns:nf) UR_1(ns:nf)... RL_2(ns:nf) INF_2(ns:nf) UR_2(ns:nf)... RL_3(ns:nf)]; % Historical Lagged State Trajectory { x_t-1, t-1 = ts-1, ts, ..., tf-1 } % 1 2 3 4 5 6 % 7 8 9 10 11 12 % 13 14 15 % 16 17 18 % 19 % ----------------------------------------------------------------------------- x_1=[GNP_1(ns:nf) YD_1(ns:nf) TAX_1(ns:nf) CC_1(ns:nf) INR_1(ns:nf) IR_1(ns:nf)... IIN_1(ns:nf) RS_1(ns:nf) RL_1(ns:nf) INF_1(ns:nf) WINF_1(ns:nf) UR_1(ns:nf)... RL_2(ns:nf) INF_2(ns:nf) UR_2(ns:nf)... RL_3(ns:nf) INF_3(ns:nf) UR_3(ns:nf)... RL_4(ns:nf)]; % Initial State Vector x_t0, t0 = ts % 1 2 3 4 5 6 % 7 8 9 10 11 12 % 13 14 15 % 16 17 18 % 19 % ---------------------------------------------------- x0= [GNP(ns) YD(ns) TAX(ns) CC(ns) INR(ns) IR(ns)... IIN(ns) RS(ns) RL(ns) INF(ns) WINF(ns) UR(ns)... RL_1(ns) INF_1(ns) UR_1(ns)... RL_2(ns) INF_2(ns) UR_2(ns)... RL_3(ns)]; % Parameter Matrix of Econometric Model A0, A1, B1, C1 %-------------------------------------------------------- % M a t r i x A0 (parameters of endogenous variables / states) % ------------------------------------------------------------ % 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 % GNP YD TAX CC INR IR IIN RS RL INF WINF UR RL_1 INF_1 UR_1 RL_2 INF_2 UR_2 RL_3 % ________________________________________________________________________________ A0 =[ 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 %1. GNP 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %2. YD tax1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %3. TAX 0 c1 0 0 0 0 0 c4 0 0 0 0 0 0 0 0 0 0 0 %4. CC inr1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %5. INR 0 ir1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %6. IR iin1 0 0 iin2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %7. IIN 0 rs1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %8. RS 0 0 0 0 0 0 0 rl1 0 0 0 0 0 0 0 0 0 0 0 %9. RL 0 inf2 0 0 0 0 0 0 0 0 inf1 0 0 0 0 0 0 0 0 %10.INF 0 0 0 0 0 0 0 0 0 winf1 0 0 0 0 0 0 0 0 0 %11.WINF ur2 ur1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %12.UR 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %13.RL_1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %14.INF_1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %15.UR_1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %16.RL_2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %17.INF_2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %18.UR_2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]; %19.RL_3 % M a t r i x A1 (parameters of lagged endogenous variables / lagged states) % -------------------------------------------------------------------------- %1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 %GNP_1 YD_1 TAX_1 CC_1 INR_1 IR_1 IIN_1 RS_1 RL_1 INF_1 WINF_1 UR_1 RL_2 INF_2 UR_2 RL_3 INF_3 UR_3 RL_4 % _______________________________________________________________________________________________________ A1 =[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %1. GNP 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %2. YD 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %3. TAX 0 0 0 c5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %4. CC 0 0 0 0 inr3 0 0 0 0 0 0 0 0 0 0 0 0 0 inr2 %5. INR 0 0 0 0 0 0 0 ir2 0 0 0 0 0 0 0 0 0 0 0 %6. IR -iin1 0 0 -iin2 0 0 iin3 0 0 0 0 0 0 0 0 0 0 0 0 %7. IIN 0 0 0 0 0 0 0 0 0 rs3 0 0 0 rs3 0 0 rs3 0 0 %8. RS 0 0 0 0 0 0 0 0 rl2 0 0 0 0 0 0 0 0 0 0 %9. RL 0 0 0 0 0 0 0 0 0 inf4 0 0 0 inf4 0 0 0 0 0 %10.INF 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 winf2 0 %11.WINF 0 -ur1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 %12.UR 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 %13.RL_1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 %14.INF_1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 %15.UR_1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 %16.RL_2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 %17.INF_2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 %18.UR_2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 ];%19.RL_3 % M a t r i x B1 (parameters of autonomous exogogenous / control variable) % ------------------------------------------------------------------------ % 1 2 3 4 % G RGM TR WLTH % ______________________ B1 =[ 1 0 0 0 %1. GNP 0 0 1 0 %2. YD 0 0 0 0 %3. TAX 0 0 (-c1+c2) c3 %4. CC 0 0 0 0 %5. INR 0 0 0 0 %6. IR 0 0 0 0 %7. IIN 0 rs2 0 0 %8. RS 0 0 0 0 %9. RL 0 0 0 0 %10.INF 0 0 0 0 %11.WINF 0 0 0 0 %12.UR 0 0 0 0 %13.RL_1 0 0 0 0 %14.INF_1 0 0 0 0 %15.UR_1 0 0 0 0 %16.RL_2 0 0 0 0 %17.INF_2 0 0 0 0 %18.UR_2 0 0 0 0 ];%19.RL_3 % M a t r i x C1 (param. of pure exogenous / noncontrol variable) % --------------------------------------------------------------- % 1 2 3 4 plot(t,UR,'r');hold on % const POIL XM GNPP % ________________________ C1 =[ 0 0 1 0 %1. GNP 0 0 0 0 %2. YD tax0 0 0 0 %3. TAX c0 0 0 0 %4. CC inr0 0 0 0 %5. INR ir0 0 0 0 %6. IR iin0 0 0 0 %7. IIN rs0 0 0 0 %8. RS rl0 0 0 0 %9. RL inf0 inf3 0 0 %10.INF winf0 0 0 0 %11.WINF ur0 0 0 -ur2 %12.UR 0 0 0 0 %13.RL_1 0 0 0 0 %14.INF_1 0 0 0 0 %15.UR_1 0 0 0 0 %16.RL_2 0 0 0 0 %17.INF_2 0 0 0 0 %18.UR_2 0 0 0 0 ];%19.RL_3 % 3. M a t r i x E c o n o m e t r i c M o d e l nn = 19; % dimension of endogenous / state vector x_t r = 4; % dimension of autonomous exogenous / control vector u_t s = 4; % dimension of pure exogenous / noncontrol initial vector z_t % Initial Condition x_e(1,1:nn)=x0; % Matrix Econometric Model for t=2:nr, disp('t_e='); disp(t); x_e(t,1:nn)=[A0*x(t,1:nn)'+A1*x(t-1,1:nn)'+B1*u(t,1:r)'+C1*z(t,1:s)']'; end % 3. M a t r i x S t a t e M o d e l % x_t = As*x_t-1 + B*u_t + C*z_t % *********************************** % Diagonal One sized Matrix Io=eye(nn); % Parameter Matrix of Econometric Model A, B, C %------------------------------------------------ % M a t r i x As ( parameters of l a g g e d s t a t e s x_t-1 ) As=inv(Io - A0)*A1; % M a t r i x B ( parameters of c o n t r o l i n p u t s u_t ) B=inv(Io - A0)*B1; % M a t r i x C ( parameters of e x o g e n. i n p u t z_t ) C=inv(Io - A0)*C1; % M a t r i x S t a t e M o d e l % ----------------------------------- % Initial Condition x_s(1,1:nn)=x0; for t=2:nr, disp('t_s='); disp(t); x_s(t,1:nn) = [ As * x_s(t-1,1:nn)' + B * u(t,1:r)' + C * z(t,1:s)']'; end % 4. M a t r i x D i f f e r e n c e S t a t e M o d e l % x_t-x_t-1 = A*x_t-1 + B*u_t + C*z_t % ****************************************************** % M a t r i x A ( parameters of l a g g e d s t a t e x_t-1) A= As-Io; % Matrix Difference State Model % ----------------------------- % Initial Condition x_ss(1,1:nn)=x0; for t=2:nr, disp('t_ss='); disp(t); d_x_ss(t,1:nn) =[ A * x_ss(t-1,1:nn)' + B * u(t,1:r)' + C * z(t,1:s)']'; x_ss(t,1:nn) = x_ss(t-1,1:nn)+d_x_ss(t,1:nn); end disp(' '); disp(' '); disp(' '); disp('>>>---> Model of Controlled System for " L Q O C " is Ready ! <---<<< '); disp(' '); disp(' '); disp(' Start and Finish Time of Simulation'); disp(' ***********************************'); disp([' t_s = ', num2str(tp(ns))]) disp([' t_f = ', num2str(tp(nf))]) disp(' '); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% t=tp(5:n); ZDAT= [const POIL XM GNPP]; UDAT= [G RGM TR WLTH]; XDAT= [GNP YD TAX CC INR IR IIN RS RL INF WINF UR RL_1 INF_1 UR_1... RL_2 INF_2 UR_2 RL_3]; save us_state GNP YD TAX CC INR IR IIN RS RL INF WINF UR RL_1 INF_1 UR_1... RL_2 INF_2 UR_2 RL_3... const POIL XM GNPP... G RGM TR WLTH... ZDAT UDAT XDAT t... A B C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% t_e = t_e; t_s = t_e; t=t_graf; set(0,'DefaultAxesFontSize',8); set(0,'DefaultLineLineWidth',1); %<---<<< figure(1) clf set(gcf,'Name','Historical Simulation of Model States x1(t), ..., x12(t)'); to = t(ns:nf); subplot(4,3,1) plot(t(ns:nf),GNP_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,1),'b-.'); hold on plot(t(ns:nf),GNP(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,1),'k'); hold off legend('ecnmtr','M-ecnmtr','data','diff state') axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(GNP(ns:nf)),min(GNP_e(ns:nf)),min(x_e(1:nr,1)),min(x_ss(1:nr,1))])-100.,... max([max(GNP(ns:nf)),max(GNP_e(ns:nf)),max(x_e(1:nr,1)),max(x_ss(1:nr,1))])+100]); title('Gross National Product GNP'); ylabel('[ billions of 1982 USD ]'); grid subplot(4,3,2) plot(t(ns:nf),YD_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,2),'b-.'); hold on plot(t(ns:nf),YD(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,2),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(YD(ns:nf)),min(YD_e(ns:nf)),min(x_e(1:nr,2)),min(x_ss(1:nr,2))])-50,... max([max(YD(ns:nf)),max(YD_e(ns:nf)),max(x_e(1:nr,2)),max(x_ss(1:nr,2))])+50]); title('Disposable Income YD'); ylabel('[ billions of 1982 USD ]'); grid subplot(4,3,3) plot(t(ns:nf),TAX_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,3),'b-.'); hold on plot(t(ns:nf),TAX(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,3),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(TAX(ns:nf)),min(TAX_e(ns:nf)),min(x_e(1:nr,3)),min(x_ss(1:nr,3))])-50,... max([max(TAX(ns:nf)),max(TAX_e(ns:nf)),max(x_e(1:nr,3)),max(x_ss(1:nr,3))])+50]); title('Tax Revenue TAX'); ylabel('[ billions of 1982 USD ]'); grid subplot(4,3,4) plot(t(ns:nf),C_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,4),'b-.'); hold on plot(t(ns:nf),CC(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,4),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(CC(ns:nf)),min(C_e(ns:nf)),min(x_e(1:nr,4)),min(x_ss(1:nr,4))])-50,... max([max(CC(ns:nf)),max(C_e(ns:nf)),max(x_e(1:nr,4)),max(x_ss(1:nr,4))])+50]); title('Consumption C'); ylabel('[ billions of 1982 USD ]'); grid subplot(4,3,5) plot(t(ns:nf),INR_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,5),'b-.'); hold on plot(t(ns:nf),INR(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,5),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(INR(ns:nf)),min(INR_e(ns:nf)),min(x_e(1:nr,5)),min(x_ss(1:nr,5))])-5,... max([max(INR(ns:nf)),max(INR_e(ns:nf)),max(x_e(1:nr,5)),max(x_ss(1:nr,5))])+5]); title('Nonresidential Investment INR'); ylabel('[ billions of 1982 USD ]'); grid subplot(4,3,6) plot(t(ns:nf),IR_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,6),'b-.'); hold on plot(t(ns:nf),IR(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,6),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(IR(ns:nf)),min(IR_e(ns:nf)),min(x_e(1:nr,6)),min(x_ss(1:nr,6))])-5,... max([max(IR(ns:nf)),max(IR_e(ns:nf)),max(x_e(1:nr,6)),max(x_ss(1:nr,6))])+5]); title('Residential Investment IR'); ylabel('[ billions of 1982 USD ]'); grid subplot(4,3,7) plot(t(ns:nf),IIN_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,7),'b-.'); hold on plot(t(ns:nf),IIN(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,7),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(IIN(ns:nf)),min(IIN_e(ns:nf)),min(x_e(1:nr,7)),min(x_ss(1:nr,7))])-5,... max([max(IIN(ns:nf)),max(IIN_e(ns:nf)),max(x_e(1:nr,7)),max(x_ss(1:nr,7))])+5]); title('Inventory Investment IIN'); ylabel('[ billions of 1982 USD ]'); grid subplot(4,3,8) plot(t(ns:nf),RS_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,8),'b-.'); hold on plot(t(ns:nf),RS(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,8),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(RS(ns:nf)),min(RS_e(ns:nf)),min(x_e(1:nr,8)),min(x_ss(1:nr,8))])-0.3,... max([max(RS(ns:nf)),max(RS_e(ns:nf)),max(x_e(1:nr,8)),max(x_ss(1:nr,8))])+0.3]); title('Short-term Interest Rate RS'); ylabel('[ percent per year ]'); grid subplot(4,3,9) plot(t(ns:nf),RL_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,9),'b-.'); hold on plot(t(ns:nf),RL(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,9),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(RL(ns:nf)),min(RL_e(ns:nf)),min(x_e(1:nr,9)),min(x_ss(1:nr,9))])-0.15,... max([max(RL(ns:nf)),max(RL_e(ns:nf)),max(x_e(1:nr,9)),max(x_ss(1:nr,9))])+0.15]); title('Long-term Interest Rate RL'); ylabel('[ percent per year]'); grid subplot(4,3,10) plot(t(ns:nf),INF_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,10),'b-.'); hold on plot(t(ns:nf),INF(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,10),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(INF(ns:nf)),min(INF_e(ns:nf)),min(x_e(1:nr,10)),min(x_ss(1:nr,10))])-0.5,... max([max(INF(ns:nf)),max(INF_e(ns:nf)),max(x_e(1:nr,10)),max(x_ss(1:nr,10))])+0.5]); title('Inflation Rate INF'); ylabel('[ percent per year ]'); grid subplot(4,3,11) plot(t(ns:nf),WINF_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,11),'b-.'); hold on plot(t(ns:nf),WINF(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,11),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(WINF(ns:nf)),min(WINF_e(ns:nf)),min(x_e(1:nr,11)),min(x_ss(1:nr,11))])-1,... max([max(WINF(ns:nf)),max(WINF_e(ns:nf)),max(x_e(1:nr,11)),max(x_ss(1:nr,11))])+1]); title('Rate of Growth of Wage Rate WINF'); ylabel('[ percent per year ]'); grid subplot(4,3,12) plot(t(ns:nf),UR_e(ns:nf),'g:'); hold on plot(t_e,x_e(1:nr,12),'b-.'); hold on plot(t(ns:nf),UR(ns:nf),'r'); hold on plot(t_s,x_ss(1:nr,12),'k'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25... min([min(UR(ns:nf)),min(UR_e(ns:nf)),min(x_e(1:nr,12)),min(x_ss(1:nr,12))])-0.50,... max([max(UR(ns:nf)),min(UR_e(ns:nf)),max(x_e(1:nr,12)),max(x_ss(1:nr,12))])+0.50]); title('Unemployment Rate UR'); ylabel('[ percent ]'); grid figure(2) clf set(gcf,'Name','Historical Control and Exogenous Variables i.e. u1(t), ..., u4(t) end z1(t), ..., z3(t) '); subplot(3,3,1) plot(t(ns:nf),G(ns:nf),'r'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25 min(G(ns:nf))-5 max(G(ns:nf))+5]); title('Government Spending G'); ylabel('[ billions of 1982 USD ]'); grid subplot(3,3,2) plot(t(ns:nf),RGM(ns:nf),'r'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25 min(RGM(ns:nf))-0.5 max(RGM(ns:nf))+0.5]); title('Growth Rate of Money Supply RGM'); ylabel('[ percent per year ]'); grid subplot(3,3,3) plot(t(ns:nf),TR(ns:nf),'r'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25 min(TR(ns:nf))-1 max(TR(ns:nf))+1]); title('Transfer Payments TR'); ylabel('[ billions of 1982 USD ]'); grid subplot(3,3,4) plot(t(ns:nf),WLTH(ns:nf),'r'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25 min(WLTH(ns:nf))-0.15 max(WLTH(ns:nf))+0.15]); title('Household Wealth WLTH'); ylabel('[ billions of 1982 USD ]'); grid subplot(3,3,7) plot(t(ns:nf),POIL(ns:nf),'g'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25 min(POIL(ns:nf))-1 max(POIL(ns:nf))+1]); title('Growth Rate of Oil Price POIL'); ylabel('[ percent per year ]'); grid subplot(3,3,8) plot(t(ns:nf),XM(ns:nf),'g'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25 min(XM(ns:nf))-2.5 max(XM(ns:nf))+2.5]); title('Net Exports XM'); ylabel('[ billions of 1982 USD ]'); grid subplot(3,3,9) plot(t(ns:nf),GNPP(ns:nf),'g'); hold off axis([min(t(ns:nf))-0.25 max(t(ns:nf))+0.25 min(GNPP(ns:nf))-25 max(GNPP(ns:nf))+25]); title('Potential Gross National Product GNPP'); ylabel('[ billions of 1982 USD ]'); grid