clc; clear all; close all

%% This code computes the steady state of a NK model for a small-open economy
% Author: Valerio Nispi Landi
% First version: 22/10/2018
% This version: 04/04/2021

%% Structural Parameters (quarterly calibration)
sigma=1;                      % relative risk aversion
beta=0.99;                    % discount factor
alpha=0.33;                   % elasticity of production wrt capital
epsilon=6;                    % elasticity of substitution btw differentiated goods
phi=3;                        % inverse of Frisch elasticity
gamma=0.5;                    % trade openness
lambdacc = 0.2 ;
xi =18.47;
kappa =0.35;
zeta=0.65;
theta = 0.75;
tau=0.25;
atss=1;
anss=1;
piss=1;
rss=1/beta;
yss=(1-alpha)*gamma+(gamma)-0.0013559;

%% Parameters not affecting the steady state
phipi=1.5;                % mp response to inflation
phiy=0.0125;              % mp response to output
rhoat=0.9;                 % tfp persistence
rhoan=0.9;                 % public spending persistence
rhoy=0.9;                 % foreign demand shock persistence persistence
rhom=0.8;                 % monetary policy inertia
rhopt=0.85;
rhopf=0.85;
calvo=0.66;               % price rigidity in calvo framework
% adjusment cost coefficient to have the same linear Phillips Curve of the Calvo framework 
% complicated
kappaP=(epsilon-1)*calvo/(piss^2*(1-calvo)*(1-beta*calvo)); % adjusment 

%% Save parameters
save  par beta alpha tau theta  rhopt phi yss gamma anss  atss kappa piss rss epsilon ...
         phipi phiy   rhoan rhoat  rhoy rhom xi lambdacc kappaP zeta 