clc
clear all
close all


% set parameters
% Deep parameters
betas = 0.99; % Patient household's discount factor in steady state 
betapp = 0.95; % Patient household's discount factor
epsilon = 3; % Elasticity of substitution between goods 
j = 0.1; % Housing preference factor
m = 0.55; % Loan-to-value limit
eta = 1.0; % Frisch elasticity
chi = 0.33; % Patient household's labor share 
theta = 0.75; % Probability of keeping prices fixed
rhoA = 0.8; % Technology shock persistence
rhobeta = 0.8; %Preference shock presistence 

% Composite parameters 
Omega = (m*j*(betas-1))/(1-(betas-betapp)*m-betapp);
mcs = (epsilon - 1)/epsilon; % mark-down in steady state

% Monetary Policy parameters 
rY = 0.0; % Output smoothing parameter
rpi = 0.27; % Coefficient on lagged inflation 
rR = 0.73; % Interest smoothing parameter
sR = 0.29;

% Solving for steady state stuff
cppe = mcs*(1-chi)/(1-Omega); % Impatient households consumption in steady state
cpe = 1-cppe; % Patient households consumption in steady state

% steady state of non-linear model
Ys = 1; % normalization
Hs = 1; % normalization
Lps = (chi*mcs/cpe)^(eta/(1+eta)); % Patient households labor in steady state
Lpps = ((1-chi)*mcs/cppe)^(eta/(1+eta)); % Impatient households labor in steady state
As = 1/(Lps^chi*Lpps^(1-chi)); % Technology level in steady state
rrb = (1/betas); % Gross interest rate in steady state

save BAmodel_param betas betapp epsilon j m eta chi theta rhoA rhobeta Omega mcs Ys Hs As rrb rY rpi rR sR
   
dynare BA_model_zlb noclearall nolog
