代写接单-ECON 711 Macroeconomic Theory and Policy The University of Auckland Semester 1, 2022

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top

ECON 711 Macroeconomic Theory and Policy The University of Auckland Semester 1, 2022 

Module 3-1 Stochastic Growth and Real Business Cycle Models Handout II: Solving a Real Business Cycle Model 1 The Model Consider the following extension of the Stochastic Neoclassical Growth model extensively used in the Real Business Cycles (RBC) literature. Consider a production economy, inhabited by a representative agent who maximizes his/her expected discounted utility over infinite horizon. The Planners Problem: in the U.S. data. �� γ 1−γ��1−σ ct (1−lt) ∞ max �� �� βtπ��st��u��ct ��st��,lt ��st���� {ct(st),lt(st),it(st)}∞t=0,st∈St t=0 st∈St ct ��st�� + it ��st�� = zt ��st�� f ��kt ��st−1�� , lt ��st���� , (1) kt+1 ��st�� = (1 − δ) kt ��st−1�� + it ��st�� , (2) ct��st��≥0, it��st��≥0forallt, allst ∈St, (3) with k0 and z0 given. We choose the functional forms for preferences and technology and the set of parameters values associated with these forms to match the characteristics of the long run behavior of aggregates observed −1 , The parameter α represents the capital share in output and zt denotes total factor productivity (TFP) shock. Following the tradition of the RBC literature we will assume that productivity shock follows an AR(1) process in logs: logzt =ρlogzt−1 +εt, where {εt}∞t=0 is a sequence of normally distributed random variables with zero mean and variance σε2. u(ct, lt) = 1 − σ The economy is endowed with production technology represented by a Cobb-Douglas production function f(k ,l ) = kαl1−α, tttt 1 1.1 The optimality conditions The Lagrangian for the agent’s problem is given by ∞ �� �� βtπ��st��u��ct ��st��,lt ��st���� t=0 st∈St ∞ −�� �� λt(st)��kt+1��st��−(1−δ)kt��st−1��−zt��st��f��kt��st−1��,lt��st����+ct��st���� L = t=0 st∈St The first order conditions are βtπ��st��∂u(ct(st),lt(st))−λt(st)=0, forallt, allst ∈St. (4) ∂ct (st) tt ����t−1��t�� βtπ��st��∂u(ct(s),lt(s))+λt(st)zt��st��∂f kt s ,lt(s) =0 ∂lt (st) ∂lt (st) t �� t �� ��t ��∂f(kt+1(st),lt+1(st,st+1)) �� −λt(s)+ After rearranging the terms the f.o.c become st+1 ∈S λt(s,st+1) zt+1 s,st+1 ∂kt+1(st) +1−δ =0 t t t t�� ����t−1��t���� ∂u(ct(s),lt(s))+∂u(ct(s),lt(s)) zt��st��∂f kt s ,lt(s) =0, ∂lt (st) βtπ ��st�� ∂u (ct (st) , lt (st)) ∂ct (st) ∂lt (st) = �� βt+1π ��st, st+1�� ∂u (ct+1 (st, st+1) , lt+1 (st, st+1)) × ∂ct (st) ∂u(ct (st),lt (st)) ∂ct (st) st+1∈S �� �� t ∂ct+1 (st, st+1) �� ∂f (kt+1 (st),lt+1 (st,st+1)) �� = zt+1 s,st+1 β �� π(st+1 | st)∂u(ct+1 (st,st+1),lt+1 (st,st+1)) × ∂kt+1(st) +1−δ , ∂ct+1 (st, st+1) st+1∈S �� �� t zt+1 s,st+1 �� ∂f (kt+1 (st),lt+1 (st,st+1)) �� ∂kt+1(st) +1−δ , To summarize, in addition to the equation of motion for capital (2), the resourse constraint (1), the initial conditions and the non-negativity constraints (3), the sequences of optimal allocations {ct,it,lt,kt+1}∞t=0 must satisfy the following system of stochastic difference equations: ∂u(ct,lt) ��∂u(ct+1,lt+1) �� ∂f(kt+1,lt+1) ���� ∂c =βEt ∂c zt+1 ∂k +1−δ , t t+1 t+1 ∂u(ct,lt) + ∂u(ct,lt)z ∂f(kt,lt) = 0. ∂l ∂c t ∂l ttt Given the chosen functional forms, the first order conditions can be written as: cγ(1−σ)−1 (1 − l )(1−γ)(1−σ) = βE ��cγ(1−σ)−1 (1 − l )(1−γ)(1−σ) ��αz kα−1l1−α + 1 − δ���� , t t t t+1 t+1 (1−γ) ct =(1−α)z kαl−α. γ1−l ttt t 2 t+1 t+1 t+1 2 Calibration Following the tradition of the real business cycle literature we choose the functional forms and the set of parameters values associated with these forms to match the characteristics of the long run behavior of aggregates observed in the U.S. data. The time period is a quarter of a year. Capital share α is set to 0.36. Parameters β and δ are chosen so that the model economy exhibits the same average capital to output and investment to output ratios as observed in the postwar U.S. economy. Following Cooley and Prescott (1995) we assume that the average investment to output ratio in the portwar US data is 0.25 while the capital to output ratio on quarterly basis is around 10. From the equation of motion for capital we have δ = iss/kss = iss/yss = 0.025 kss /yss where subscript ss denotes the value of the corresponding variable in the deterministic steady state. The Euler eqation in the deterministic steady state is and therefore ��α−11−α �� ��yss �� 1=β αkss lss +1−δ =β αk +1−δ . ss ��−1 In the benchmark model economy, the preferences are of the form �� yss + 1 − δ = 0.989. β = α k u(ct, lt) = 1 − σ , where σ represents the curvature of the utility function, while γ denotes the share of consumption (relative to leisure) in a composite consumer good. The share of consumption in the composite good, γ, is pinned down from the labor supply equation in the deterministic steady state. We assume that time devoted to market activities equals 1/3 and that investment/output ratio is 0.25. In the steady state, the labor supply equation reads as: ss ��ctγ(1−lt)1−γ��1−σ −1 c =(1−α) γ (1−l )kαl−α ss (1−γ) ss ss ss or defining css = yss − iss and dividing by yss we have 1−iss =(1−α) γ (1−lss) yss (1−γ) lss The curvature of the utility function σ is set to 2. (5) (6) from which we get γ = 0.369. The parameters are summarized in Table 1. Preferences: Technology: Productivity: Table 1: Parameterization of the model Discount factor Consumption share Curvature of the utility function Capital income share Depreciation rate Autocorrelation coefficient St. dev. of innovations to productivity 3 β = 0.989 γ = 0.369 σ=2 α = 0.36 δ = 0.025 ρ = 0.95 σε = 0.007 3 Solution 3.1 Numerical Solution with Parameterized Expectation Approach The optimal allocations in this economy, {ct, it, lt, kt+1}∞t=0 , must satisfy the following system of stochastic difference equations: ����c t tc t+1 t+1t+1t+1 �� (1 − l )(1−γ)(1−σ) = βE (1 − l )(1−γ)(1−σ) ��αz kα−1l1−α + 1 − δ�� c =(1−α) γ kαz(1−l)l−α �� c (θ) ��γ(1−σ)−1 Y (θ) ≡ t+1 (1 − l (θ))(1−γ)(1−σ) �� αz kα−1(θ) (l t+1 t+1 t+1 (θ))1−α + 1 − δ �� . t ct(θ) t+1 Let S(θ) be the result of the following regression: t+1 t (7) (8) (9) (10) ��γ(1−σ)−1 t 1−γtt tt i =zkαl1−α−c, ttttt kt+1 =(1−δ)kt +it. The initial step of the PEA is to substitute the conditional expectations in (7) by the flexible functional forms that depend on the state variables and some coefficients: Ψ(θ; kt(θ), zt) = exp(θ1 + θ2 log kt(θ) + θ3 log zt). Use of the exponential polynomial guarantees that the left hand side of (7) would be positive. Increasing the degree of the polynomial would allow to approximate the solution with arbitrary accuracy1. The algorithm for solving the model takes the following steps: (I) Fix the initial conditions and draw a series of {zt}Tt=1 that obeys the law of motion for the exogenous state variable. The number of periods T in the truncated series should be sufficiently large. (II) For a given θ substitute the conditional expectations in (7) to yield: (1−lt)(1−γ)(1−σ) =βΨ(θ;kt(θ),zt). (11) (III) Using the realizations of zt obtain recursively from (11) and (8)-(10) a series of the endogenous variables {ct(θ), it(θ), lt(θ), kt+1(θ)}Tt=0 for this particular parameterization, θ. (IV) The next step involves running a non-linear least squares regression. The role of the dependent variables will be performed by the expressions inside the conditional expectation in the RHS of (7). In particular, the ’dependent variable’, Yt(θ), would take form Yt(θ) = exp(ξ1 + ξ2 log kt(θ) + ξ3 log zt) + ηt, where ηt is a disturbance term. (V) The final step involves using an iterative algorithm to find the fixed point of S, and the set of coefficients θf =S(θf)whichwouldgivethesolutionfortheendogenousvariables{ct(θf),it(θf),lt(θf),kt(θf)}. See MATLAB code reported in Appendix. 1The fact that PEA can provide arbirtary accuracy if the approximation function is refined and a proof of convergence to the correct solution are given in Marcet and Marshall (1994). In practice the choice of degree of the exponential polynomial can be guided by the test for accuracy in simulations proposed by den Haan and Marcet (1994). Some practical issues on dealing with higher-order polynomials in the approximation function are discussed in den Haan and Marcet (1990). 4 3.2 3.2.1 Predictions of the Model Impulse Responses Figure 1: IRFs 3.2.2 Second Moments This subsection reports the second moments of the logged series detrended with HP filter (λ = 1600) : Volatility Correlation Consumption Investment Employment (σx/σy) with Output 0.4025 0.9708 2.8569 0.9939 0.4116 0.9876 5 References den Haan, W. J., and A. Marcet (1990): “Solving the Stochastic Growth Model by Parameterizing Expectations,” Journal of Business and Economic Statistics, 8(1), 31–34. (1994): “Accuracy in Simulations,” Review of Economic Studies, 61(1), 3–17. Marcet, A., and D. A. Marshall (1994): “Solving Nonlinear Rational Expectations Models by Param- eterized Expectations: Convergence to Stationary Solutions,” Discussion paper, Federal Reserve Bank of Minneapolis. 6 A Example RBC: MATLAB Code %% General description % % This is the code for a Stochastic Growth Model with Endogenous Labor Supply % The solution method used is the Polynomial PEA, % First order polynomials for approximation of the expectations are admitted. % Non-linear regression is performed by nlinfit.m procedure from the Statistics toolbox. % % File: RBC.m; % Procedures used: psiFun.m; % Revision 2.7 (20.1.2022); % %% References: % % [1] den Haan, W.J. and A. Marcet, (1990) ’Solving the Stochastic Growth Model by % Parameterized Expectations’, Journal of Business & Economic Statistics, Vol.8, 31-34. % %% Initialization clear TT = 10000; tol = 1e-6; nu = 0.5; crit = 1; niter =1; Imax = 200; % Number of periods for the simulations % Tolerance level % Updating parameter % Initialization of a critical value % Initialization of iteration counters % Max allowed number of iterations % Allocation of memory for the arrays k = zeros(TT+1,1); c = zeros(TT,1); z = zeros(TT+1,1); Y = zeros(TT,1); l = zeros(TT,1); x = zeros(TT,1); %% Parameterization of the model sigma =2; beta = 0.989; gamma = 0.369; delta = 0.025; alpha = 0.36; rho = 0.95; se = 0.007; % Utility function curvature % Discount factor % Consumption share in the composite good % Quarterly depreciation rate % Factor share of capital % Autocorrelation coefficient % St. dev. of innovations to productivity %% Initial Values for the State Variables k(1) = 12.05; % Initial values for capital stock z(1) = 1; % Initial values for the TFP 7 % Fixing the random sequence randn(’state’,0); % Drawing a realization of the stochastic process for productivity shocks eps = se*randn(TT+1,1); for i = 2:TT+1 z(i)= exp(rho*log(z(i-1)) + eps(i)); end r1 = (1:(TT-1)); r2 = (2:TT); % Initial Guess for theta theta = [0.3746 -0.0435 0.1748]’; %% The main iterative procedure while (crit>tol) % Generating the series for a given parameter vector theta for i=1:TT pol = [exp(1) k(i) z(i)]; l(i) = 1 - (beta* exp( log(pol)*theta ))^(1/((1-sigma)*(1-gamma))); c(i) = gamma/(1-gamma) * (1-alpha) * z(i) * k(i)^alpha * (1-l(i)) * l(i)^(-alpha); Y(i) = z(i)*k(i)^alpha*l(i)^(1-alpha); x(i) = Y(i) - c(i); k(i+1) = (1-delta) * k(i) + x(i); end % ’Dependent’ variable for the simulated series MUs = ((c(r2)./c(r1))).^(gamma*(1-sigma)-1) .* (1-l(r2)).^((1-gamma)*(1-sigma)); R = alpha.* z(r2).*((l(r2))./k(r2)).^(1-alpha)+(1-delta)*ones(TT-1,1); YY = MUs.*R; % Regressors for the first order polynomial XX = log([exp(ones(TT-1,1)) k(r1) z(r1)]); % NLLS regression Gtheta = nlinfit(XX, YY, ’psiFun’, theta); % Calculaing the convergence criterion crit = max(abs(Gtheta-theta)); %Generating a new theta theta = (1-nu)*theta + nu* Gtheta; % Display iterations 8 disp ([’Iter.: ’ int2str(niter) ’ Crit.Val.: ’ num2str(crit) ]); % Count Iterations niter = niter + 1; % Check if the number of iterations exceeded Imax if (niter>Imax); crit = tol; end end %(The main iterative procedure) %% Second Moments data = [Y(1:TT) c(1:TT) x(1:TT) l(1:TT)]; log_data = log(data); cc_data = log_data - hpfilter(log_data,1600); % Volatilities sigma_y = 100*std(cc_data(:,1)); sigma_r = std(cc_data(:,2:4))./std(cc_data(:,1)); % St.dev of C,X,L reltive to st.dev(Y) % Comovements Corr_mat = corr(cc_data); % Correlation matrix Corr_y = Corr_mat(2:4,1); % Correlations of C,X,L with Y %% Impulse Response Functions TT = 1000; % the length of the vector of realizations for solving the model z = zeros(TT+1,1); % Initial Values for the State Variables k(1) = 12.05; % Initial values for capital stock z(1) = 1; % Initial values for the TFP eps = zeros(TT+1,1); eps(51) = se; for i = 2:TT+1 z(i,:)= exp(rho*log(z(i-1,:))’ + eps(i,:)’)’; end % Generating the series for a given parameter vector theta for i=1:TT pol = [exp(1) k(i) z(i)]; 9 % Extract cyclical components % St. dev of (cyclical components of) Output l(i) = 1 - (beta* exp( log(pol)*theta ))^(1/((1-sigma)*(1-gamma))); c(i) = gamma/(1-gamma) * (1-alpha) * z(i) * k(i)^alpha * (1-l(i)) * l(i)^(-alpha); Y(i) = z(i)*k(i)^alpha*l(i)^(1-alpha); x(i) = Y(i) - c(i); k(i+1) = (1-delta) * k(i) + x(i); end figure1 = figure(’Color’,[1 1 1]); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% subplot1 = subplot(2,2,1,’Parent’,figure1,’FontSize’,16, ’FontName’,’Courier New’); hold all; box on; axis([0 100 0 3]) plot1 = plot(100*x(50:150)./x(50)-100,’Parent’,subplot1); set(plot1,’LineWidth’,2,’LineStyle’,’-’,’DisplayName’,’RBC model’,’Color’,’blue’); % Create title xlabel(’Quarters’); ylabel(’% dev. from steady state’); title(’Investment’); hold off; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% subplot2 = subplot(2,2,2,’Parent’,figure1,’FontSize’,16, ’FontName’,’Courier New’); hold all; box on; axis([0 100 0 0.5]) plot2 = plot(100*c(50:150)./c(50)-100,’Parent’,subplot2); set(plot2,’LineWidth’,2,’LineStyle’,’-’,’DisplayName’,’RBC model’,’Color’,’blue’); % Create title xlabel(’Quarters’); ylabel(’% dev. from steady state’); title(’Consumption’); hold off; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% subplot3 = subplot(2,2,3,’Parent’,figure1,’FontSize’,16, ’FontName’,’Courier New’); hold all; box on; axis([0 100 0 0.5]) plot3 = plot(100*l(50:150)./l(50)-100,’Parent’,subplot3); set(plot3,’LineWidth’,2,’LineStyle’,’-’,’DisplayName’,’RBC model’,’Color’,’blue’); % Create title xlabel(’Quarters’); ylabel(’% dev. from steady state’); title(’Employment’); 10 hold off; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% subplot4 = subplot(2,2,4,’Parent’,figure1,’FontSize’,16, ’FontName’,’Courier New’); hold all; box on; axis([0 100 0 1.2]) plot4 = plot(100*Y(50:150)./Y(50)-100,’Parent’,subplot4); set(plot4,’LineWidth’,2,’LineStyle’,’-’,’DisplayName’,’RBC model’,’Color’,’blue’); % Create title xlabel(’Quarters’); ylabel(’% dev. from steady state’); title(’Output’); hold off; %% psiFun.m % A function called from RBC.m % Calculates the objective function for non-linear regression function y = psiFun(beta,x) y=exp(x*beta); 11 

51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468