Page 1 of 1

Dynare++ with idiosyncratic shocks

PostPosted: Mon Oct 20, 2014 12:17 pm
by msh855
Hi,

I have this model, where all the explanations are provided as comments. Can somoeone suggest whether the particular mdoel is possible to be solved by dynare/dynare++. And if not, how I can modified to be able to solve it ?

Code: Select all
var list;

varexo  e;
       
parameters  list;


%% All assets at time {t+1} are decided at time t for the agents. Hence all assets are predetermined.

model;

\\consumers - Stationary Model

varrho=(v(+1)*R(+1))^(1-gamma);                            % Aux. Variable for Epstein-zin preferences                   
v=(1+(beta^(1/mu))*varrho^(par))^(1/((1/mu)-1));  % Recursive equation for the value function
u=v^(1-(1/mu));                                                     % Marginal propensity to consume out of wealth

\\portfolio choice - Static

(v(+1))^(1-gamma)*R(+1))^(-gamma)*(Rk(+1)-Rf(+1))=0;                          % 1st FOC for portfolio choice
(v(+1))^(1-gamma)*R(+1))^(-gamma)*(1+rh(+1)-delta+ eta(+1)-Rf(+1))=0;  % 2nd FOC for portfolio choice 

// definitions

R(+1)=(1-theta1(+1)-theta2(+1))*Rf(+1)+theta1(+1)*Rk(+1)+theta2(+1)*Rh(+1);   % Gross returns - I take the expected value for dynare to understand eta=0 in SS 

Rf=1+rf;                                                  % Gross risk-free return
Rk=(1+rk-delta);                                          % Gross Risky returns from capital along the cycle           
Rh=1+rh-delta+eta;                                        % Gross Risky returns from Human Capital
premium=rf-rk;                                            % Risk premium   
theta1=k(-1)/s(-1);                                       % Share of Phyisical capital asset - theta1(+1) is known in t
theta2=1/s(-1);                                           % Share of Human Capital asset - theta2(+1) is known in t
s=b+k+1;                                                  % Wealth

//supply-side

 y=A*k(-1)^alpha;                                        % output
rk=A*alpha*k(-1)^(alpha-1);                              % real returns to physical capital   
rh=A*(1-alpha)*k(-1)^alpha;                              % real returns to human capital   

//government
b*(1+gr)+tauk*rk(-1)*k(-1)+tauh*rh(-1)=(1+rf)*b(-1)+g(-1);            %Government budget constraint
g=pi*y;                                                               %government spending rule

//expected growth rate

gr(+1)=R(+1)(1-u);

//exogenous shocks
log(A)=rho*log(A(-1))+(1-rho)*logAA +e;       % AR(1) for aggregate shocks
eta=sigmat*e;                                 % IID normally distributed
                                              % idiosyncratic shock with zero mean and time varying variance sigmat^2
                                              % Assumption, the idiosyncratic shock is indepedant from the aggregate
 
sigmat^2=(sigma*(1-elas*ln(A)))^2]            % the rule for variance 
end;


%% Steady state Definition

% 1. Deterministic Macroeconomic Steady state => Aggregate Shocks are switched-off and TFP normalized to 1
% 2. Individual shocks are still present ==> eta process switches from Heteroskedastic to homoskedastic with sigmat^2=sigma^2

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Hence the model is isomorphic to a one agent model with two types of shocks
% where the one type of shock (Aggregate) switches-off while the idiosyncratic still operates
% from the assumptions of the model we know - AGGREGATE variables are deterministic and the distribution is not a relevant state variable
% In terms of assets, the model switches from three different types of assets along the Business Cyle to two
% types of assets in the Steady State, since Rf=Rk
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



Let's suppose, that I can solve the model myself in the SS by my own program. Can Dynaree++ use my steady state file in order to calculate the transitional dynamics (aka impulse responses etc etc.)