// // RBC model // var y,c,i,k,n,lb,a,w,r; // Name of the variables varexo ea; // Name of the exogenous variable parameters beta,nu,sigma,chi, // Preferences alpha,delta, // Technology ra,sa,Ass; // Technology Shock beta = 0.99; // Discount factor sigma = 2; // Intertemporal elasticity of subst. nu = 2; // Inverse of labor supply elasticity alpha = 0.35; // capital elasticity delta = 0.025; // depreciation rate ra = 0.95; // Persistence of Technology Shock sa = 0.01; // Std. dev. of Technology Shock Ass= 1; // Steady state of technology // Assisting steady state rs = (1-beta*(1-delta))/beta; ksy = alpha/rs; isy = delta*ksy; csy = 1-isy; ns = 1/3; ys = ksy^(alpha/(1-alpha))*ns; cs = csy*ys; is = isy*ys; ks = ksy*ys; ws = (1-alpha)*ys/ns; lbs = cs^(-sigma); // Although chi is a parameter, it has to be set such that nss=1/3 chi = lbs*ws*ns^(-nu); // Equations of the model model; exp(-sigma*c)=exp(lb); // Consumption chi*exp(nu*n)=exp(lb+w); // Labor supply exp(lb)=beta*exp(lb(+1))*(exp(r(+1))+(1-delta)); //Euler equation exp(k)=exp(i)+(1-delta)*exp(k(-1)); //capital accumulation exp(y)=exp(c)+exp(i); //market clearing exp(y)=exp(a+alpha*k(-1)+(1-alpha)*n); // Production function exp(w)=(1-alpha)*exp(a+y-n); //labor demand exp(r)=alpha*exp(a+y-k(-1)); //capital demand a=(1-ra)*log(Ass)+ra*a(-1)+ea; // Supply Shock in levels end; initval; ea = 0; a = log(Ass); y = log(ys); c = log(cs); i = log(is); k = log(ks); n = log(ns); lb = log(lbs); w = log(ws); r = log(rs); end; steady; check; // Declaring the shocks shocks; var ea; stderr sa; end; // Launch solving procedure stoch_simul(order=1,irf=20,hp_filter=1600) y,c,i,k,n,a;