//In the Name of Allah
var
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Variables of Consumer Equations:
//First Equation Variables
cc${\hat{c}^{c}}$ rd$\hat{r}^{d}$ pi$\hat{\pi}$ lac$\hat{\lambda}^{c}$
m$\hat{m}$
//Second Equation Variables
n$\hat{n}$ w$\hat{w}$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Variables of Entrepreneur Sector
//Thitrd Equation Variables
ce$\hat{c}^{e}$ lae$\hat{\lambda}^{e}$
//Fourth Equation Variables
gae$\hat{\gamma}^{e}$ rb$\hat{r}^{b}$
//Fifth Equation Variables
lv$\hat{lv}$ q$\hat{q}$ rk$\hat{r}^{k}$ b$\hat{b}$
//Sixth Equation Variables
ye$\hat{y}^{e}$ x$\hat{x}$
//7th Equation Variables
ke$\hat{k}^{e}$ kg$\hat{k}^{g}$ a$\hat{a}$
//8th Equation Variables
or$\hat{or}$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Banking Sector
kb$\hat{k}^{b}$
d$\hat{d}$
j$\hat{j}$
u$\hat{u}$
jb$\hat{jb}$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Government Sector
//21th Equation Variables
g$\hat{g}$
//22th Equation Variables
ig$\hat{ig}$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Capital Producer Sector
//24th Equation Variables
psi$\hat{\psi}$
//26th Equation Variables
ip$\hat{ip}$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Monetary Sector
mu$\hat{\mu}$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//28th Equation Variables: Market Clearing Condition
y$\hat{y}$
yobs${y\_obs}$
ipobs${ip\_obs}$
igobs${ig\_obs}$;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
varexo
varlv$\hat{\epsilon}^{lv}$
vara$\varepsilon^{a}$
varg$\varepsilon^{g}$
varor$\varepsilon^{or}$
varig$\varepsilon^{ig}$
varpsi$\varepsilon^{\psi}$
varu$\varepsilon^{u}$
varrd$\varepsilon^{rd}$;
parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Parameters of Consumer Equations:
//First Equation Parameters
bbc${\beta^{c}}$,
csig${\sigma_{c}}^{c}$ (long_name='Consumer Elasticity of Substituition'),
msig${\sigma_{c}}^{m}$ (long_name='Consumer Elasticity of Substituition'),
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Parameters of Entrepreneur Sector
//3th Equation Parameters
csige${\sigma_{e}}^{c}$ (long_name='Entrepreneur Elasticity of Substituition'),
//4th Equation Parameters
bbe$\beta^{e}$,
//6th Equation Parameters
ddk$\delta_{k}$ (long_name='Depreciation rate'),
aa$\alpha$ (long_name='Share of Capital in Production'),
piss$\bar{\pi}$(long_name='steady state of inflation'),
ind_p$ind_p$(long_name='sensivity to inflation'),
ind_d$ind_d$(long_name='sensivity to inflation'),
ind_b$ind_b$(long_name='sensivity to inflation'),
//8th Equation Parameters
teta$\theta$(long_name='share of public capital in production'),
//10th Equation Parameters
rhoa$\rho^{a}$(long_name='Coefficient of Productivity process'),
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Parameters of retail Sector
epsy${\epsilon}^{y}$(long_name='Elasticity of Substitution'),
kap${\kappa^{p}}$(long_name='cost of adjusting price for retail sector'),
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Parameters of Banking Sector
//15th Equation Parameters
kad${\kappa^{d}}$(long_name='cost of adjusting deposit interest rate'),
//16th Equation Parameters
kab${\kappa^{l}}$(long_name='cost of adjusting borrowing interest rate'),
ba$\bar{a}$,
bu$\bar{u}$,
bor$\bar{or}$,
bg$\bar{g}$,
bip$\bar{ip}$,
big$\bar{ig}$,
rhou$\rho^{u}$,
ddb$\delta_{b}$ (long_name='Depreciation of Bank Capital'),
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Parameters of Government Sector
//23th Equation Parameters
rhog$\rho^{g}$,
//24th Equation Parameters
ddg$\delta_{g}$ (long_name='Depreciation of Public Investment'),
rhoig$\rho^{ig}$,
rhoio$\rho^{io}$,
//25th Equation Parameters
rhoo$\rho^{or}$,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Parameters of Producing capital Sector
//28th Equation Parameters
kai$\kappa_{I}$(long_name='cost of adjusting capital'),
//29th Equation Parameters
rhop$\rho^{\psi}$,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Parameters of Monetary Sector
//31th Equation Parameters
rhoy$\rho^{y}$,
rhord$\rho^{rd}$,
rhopi$\rho^{\pi}$,
rhomu$\rho^{mu}$,
//31th Equation Parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//parameters of Lv Equation
rholv$\rho^{lv}$;
bbc=0.997;//R1; (shah hosseini and bahrami (0.979)) (Komeijaniand Tavakolian = 0.987)
csig=1.571;//R1 & R8 (Komeijani and Tavakolian=1.30)
msig=1.2;
csige=1.3;//Gerali et. al (2009)
bbe=0.965;//daliri & mehregan (Brozaza-Brezina, Kolasa and Makarski (2010),Gerali et al (2009) (=0.975)) (=0.9085) (0.9748733913) (=0.978465)
ddk=0.016;//R1 & R-8 (shah hosseini and bahrami (0.031)) (Eskandari, pedram and bostani (1397)=0.027) (hosein tavakolian komijani=0.0426)
ddg=0.027;//sayadmanesh and teimori//tavakolian and komeijani 1391 (R-9=0.0728)
aa=0.47;//tavakolian and komeijani (Dargahi and Hadian (1395) =0.412) (Eskandari, pedram and bostani (1397)=0.47)(0.4278=tavak and komi)
//nu=0.10;//assumption
rholv=0.75;//Gerali et al (2009)
teta=0.098;//Komeijani and Tavakolian(=0.0945)
rhoa=0.76;//R-2
ba=1;
bu=0.0075;
bor=0.07;
bg=0.14;
bip=0.21;
big=0.1;
piss=1.045;//Teimour Rahmani (tarh)(=0.18/4=0.045)
ind_p=0.55;
ind_d=.45;
ind_b=0.35;
ddb=.01;
epsy=10;
kap=100;//gerali et al
kab=3;//Gerali et al (2009) (Farsi: Hosseini and Molabahrami)
kad=4;//Gerali et al (2009)(Farsi: Hosseini and Molabahrami)
kai=0.5;//R.15
rhou=0.2;
kak=1;//Gerali, et. al (2009)
rhog=0.44;//R.22
rhoo=0.72;//R-2,14 (=.55) (.72=R.11)
rhoig=0.65;
rhoio=0.30;
rhop=0.80;//Amiri (1394)
rhoy=0.46;//Shah hosseini & Bahrami
rhord=1.20;//Shah hosseini & Bahrami
rhopi=1.4;//Shah hosseini & Bahrami (daliri & Mehregan=0.60)
rhomu=1.20;//Shah hosseini & Bahrami
model;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Consumer Sector
//Equation 1:Euler Equation
exp(cc) ^ (-csig) = exp(lac) ;
//Equation 2:Supply of Labor
//ssi*exp(n) ^ nsig = exp(w) * exp(lac) ;
exp(n)=0.333;
//Equation 3: Foc Deposit
exp(lac) = bbc * (1 + exp(rd)) * exp(lac(+1)) / exp(pi(+1)) ;
//Equation 4: Money Demand
(exp(m)^-msig)/(exp(cc)^-csig)=exp(rd)/(1+exp(rd));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Entrepreneur Sector
//Equation 5:Entrepreneur Consumption
exp(ce) ^ (-csige) = exp(lae) ;
//Equation 6:Entrepreneur Loan Demand
exp(lae) = exp(gae) * (1 + exp(rb)) + bbe * exp(lae(+1)) * ((1 + exp(rb)) / (exp(pi(+1)))) ;
//Equation 7:Entrepreneur Capital Demand
exp(lae) * exp(q) = exp(lv) * exp (pi(+1)) * exp(q(+1)) * exp(gae) * (1-ddk) + bbe * exp(lae(+1)) * (exp(q(+1)) * (1-ddk) + exp(rk(+1))) ;
//Equation 8:Entrepreneur Labor Demand
exp(w) * exp(n) * exp(x) = (1-aa) * exp(ye) ;
//Equation 9:Production function of Entrepreneur
exp(ye) = exp(a) * (exp(ke(-1)) ^ aa) * (exp(n) ^ (1-aa)) * (exp(kg(-1)) ^ teta) ;
//Equation 10: Macroprudential Policy (process defined for evolution of LTV)
exp(lv) / exp(steady_state (lv)) = ((exp(lv(-1)) / exp(steady_state (lv))) ^ rholv) * exp(varlv) ;
//Equation 11: AR(1) Process for TFP Shock
exp(a) / ba = ((exp(a(-1)) / ba) ^ rhoa) * exp(vara) ;
//Equation 12: Borrowing Constraint of firm
exp(b) * (1 + exp(rb)) = exp(lv) * exp(q(+1)) * exp(pi(+1)) * exp(ke) * (1-ddk);
//Equation 13: Entreprenuer Budget Constraint
exp(ce) + exp(w) * exp(n) + (((1 + exp(rb(-1))) / exp(pi)) * exp(b(-1))) + exp(q) * exp(ke) = (exp(ye) / exp(x)) + exp(b) + exp(q) * (1-ddk) * exp(ke(-1));
//Equation 14: Rent Of Capital
exp(rk) = aa * exp(ye) /(exp(ke(-1)) *exp(x));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Retail Sector
//Equation 15:New Keynsian Philips Curve
0 = 1 - epsy + epsy / exp(x) - kap * (exp(pi)-(exp(pi(-1)) ^ ind_p) * (piss ^ (1-ind_p))) * exp(pi) + bbc * (exp(lac(+1)) / exp(lac)) * kap * (exp(pi(+1))-(exp(pi) ^ ind_p * piss ^(1-ind_p))) * exp(pi(+1)) * (exp(y(+1)) / exp(y));
//Equation 16: Retailor Sector Profit
exp(j) = exp(y)*(1 - (1/exp(x)) - (kap/2) * (exp(pi) - ( exp(pi(-1)) ^ ind_p * piss ^ (1-ind_p) ))^2 ) ;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Banking Sector Equations:
//Equation 17: loan interest rate
exp(rb)=exp(rd)+exp(u);
//Equation 18: Ar(1) Process for markup between loan and deposit interest rate
exp(u) / bu = ((exp(u(-1)) / bu) ^rhou) * exp(varu);
//Equation 19: Bank Balance Shhet Equation
exp(b) = exp(d) + exp(kb);
//Equation 20: KB Evolution
exp(kb) * exp(pi) = (1-ddb) * exp(kb(-1)) + exp(jb(-1)) ;
//Equation 21: Banks Profit
exp(jb) = exp(rb) * exp(b) - exp(rd) * exp(d);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Government Sector Equations:
//Equation 22: Government Expenditure Process
exp(g) / (bg*exp(steady_state(ye))) =(exp(g(-1))/(bg*exp(steady_state(ye)))) ^ rhog * exp(varg);
//Equation 23: Public Investment Process
exp(kg)=(1-ddg) * exp(kg(-1))+ exp(ig);//coeefiicient of ig???
//Equation 24: oil revenue process
(exp(ig)/(big*exp(steady_state(y)))) = (exp(ig(-1))/(big*exp(steady_state(y)))) ^ rhoig * (exp(or(-1))/(bor*exp(steady_state(y)))) ^ (rhoio) * exp(varig);
//Equation 25: oil revenue process
exp(or) / (bor*exp(steady_state(ye))) = ((exp(or(-1)) / (bor*exp(steady_state(ye)))) ^ rhoo) * exp(varor);
//Government budget Constraint
//exp(g)+exp(ig)=exp(or)+exp(m)-exp(m(-1))/exp(pi);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Capital Producer Equations
//Equation 26: Q-Tobin Process
1 = exp(q) * (1 - kai /2 * (exp(ip) * exp(psi) / exp(ip(-1)) -1) ^ 2 - kai*((exp(ip)* exp(psi) / exp(ip(-1)) - 1) *((exp(ip) * exp(psi) / exp(ip(-1)))))) + bbc * kai * ((exp(lae(+1)) / exp(lae)) * exp(q(+1)) * ((exp(ip(+1)) * exp(psi(+1)) / exp(ip) -1)) * exp(psi(+1)) * (exp(ip(+1))/exp(ip)) ^ 2) ;
//Equation 27: Shock to Marginal Efficiency of Investment
exp(psi) / exp(steady_state(psi))=(exp(psi(-1)) / exp(steady_state(psi))) ^ rhop * exp(varpsi);
//Equation 28: Law Of Motion of Capital
exp(ke)=(1-ddk) * exp(ke(-1)) + (1 - (kai/2) * (exp(ip) *exp(psi)/ exp(ip(-1))-1) ^ 2) * exp(ip);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Equation 29: Monetary Sector Equation
(1+exp(rd)) = (1+exp(steady_state (rd)))^(1 - rhord ) * (1+exp(rd(-1)))^rhord * (( exp(pi) / piss ) ^rhopi *
(exp(y)/exp(y(-1)))^rhoy ) ^ ( 1 - rhord ) * (1+varrd) ;
//Equation 30: money growth Equation
exp(mu)=(exp(m)/exp(m(-1)))*exp(pi);
%%%%%%%%%%%%%11%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//Equation 31: entreprenuer and retailer Output relation
exp(y) = exp(ye);
//Equation 32: Market Clearing Condition
exp(y)+ exp(or)= exp(cc) + exp(ce) + exp(g) + exp(ip) + exp(ig);
//z1=rd(-1);
//z2=rb(-1);
yobs = y - steady_state (y);
ipobs = ip - steady_state (ip);
igobs = ig - steady_state (ig);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
steady_state_model;
pi=ln(piss);
mu=ln(exp(pi));
a=0;
ye=ln(4.5);
y=ln(4.5);
u=ln(0.0075);
n=ln(0.333);
//find rd
rd= ln(exp(pi)/bbc - 1);
//find rb
rb=ln(exp(rd)+exp(u));
//find x
x=ln(epsy/(epsy-1));
//find w: Entre Labor Demand
w=ln((1-aa)*exp(ye)/(exp(n)*exp(x)));
//Find ig
ig=ln(big*exp(ye));
//find kg
kg=ln(exp(ig)/ddg);
//Findip
ip=ln(bip*exp(ye));
//find ke
ke=ln((exp(ye)/(exp(a)*(exp(n)^(1-aa))*(exp(kg)^teta)))^(1/aa));
//Find psi
psi=ln(-(((2/kai)*(1-ddk*exp(ke)/exp(ip)))^(1/2))+1);
//Find q
q=ln(1/(1 - kai /2 * (exp(psi)-1) ^ 2 - kai*(exp(psi)- 1) * exp(psi) + bbc * kai * (exp(psi) -1) * exp(psi))) ;
//Find rk
rk=ln((aa)*exp(ye)/(exp(ke)*exp(x)));
//find lv
lv=ln((exp(q)-bbe*(exp(q)*(1-ddk)+exp(rk)))/(exp(pi)*exp(q)*(1-ddk)*((1-bbe*(1+exp(rb))/exp(pi))/(1+exp(rb)))));
//Find b: Entreprenuer Loan Constraint
b=ln((exp(lv)*exp(pi)*exp(q)*exp(ke)*(1-ddk))/(1+exp(rb)));
//find Ce: Entrep Budget Constraint
ce=ln(exp(ye)/exp(x)+exp(b)+(1-ddk)*exp(ke)*exp(q)-exp(w)*exp(n)-exp(ke)*exp(q)-(1+exp(rb))*exp(b)/exp(pi));
//find lae: Foc of entrep for consmption
lae = ln(exp(ce)^-csige);
//find g
g=ln(bg*exp(ye));
//Find or
or=ln(bor*exp(y));
//Find cc
cc=ln(exp(y)+exp(or)-exp(ce)-exp(g)-exp(ig)-exp(ip));
//Find lac: Household FOC
lac = ln(exp(cc)^-csig);
//find Gae:
gae=ln((exp(lae)-exp(lae)*bbe*(1+exp(rb))/exp(pi))/(1+exp(rb)));
//find kb
kb=ln(((exp(rb)-exp(rd))*exp(b))/(exp(pi)-1+ddb-exp(rd)));
//Find d
d=ln(exp(b)-exp(kb));
//find jb
jb=ln(exp(rb)*exp(b)-exp(rd)*exp(d));
//find j
j = ln(exp(y)*(1 - (1/exp(x))));
//find m
m=ln(((exp(rd)/(1+exp(rd)))*exp(cc)^-csig)^(-1/msig));
yobs=0;
ipobs=0;
igobs=0;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//write_latex_dynamic_model;
//write_latex_parameter_table;
//write_latex_definitions;
//collect_latex_files;
//if system(['pdflatex -halt-on-error ' M_.fname '_TeX_binder.TeX'])
// error('TeX-File did not compile.')
//end
steady;
//load z;
shocks;
var varlv;
stderr 0.01;
var vara;
stderr 0.01;
//var varmkb;
//stderr 0.01;
//var varmkd;
//stderr 0.01;
//var varkb;
//stderr 0.01;
//var varg;
//stderr 0.01;
var varor;
stderr 0.01;//STDERROR=0.15 (R.13)
//var varig;
//stderr 0.01;
//var varpsi;
//stderr 0.01;
//var varrd;
//stderr 0.01;//STDERROR=0.14 (R.13)
end;
//model_diagnostics;
varobs yobs ipobs igobs;
check(qz_zero_threshold=1e-20);
estimated_params_init(use_calibration);
end;
estimated_params;
//bbc, beta_pdf, 0.987, 0.02; //Consumer Preference (R.2)
//bbc, beta_pdf, 0.987, 0.01; //Consumer Preference (R.2)
csig, gamma_pdf, 1.571, 0.01; //Consumer Elasticity of Substitution (R.2)
//nsig, gamma_pdf, 2.17, 0.01; //labor elasticity of subsitution (R.2)
aa, gamma_pdf, 0.47, 0.01; //capital Share in production (R.8)
//ddk, beta_pdf, 0.02, 0.01;// Depreciation rate (R.9)
ddg, beta_pdf, 0.027, 0.01;// Depreciation rate (R.9)
rhoa,beta_pdf, 0.76, 0.01; //(R.12) (is it between 0 and 1????)
teta, beta_pdf, 0.098, 0.01;//Elasticity of Subs. between private and Government capital (R.8)
//nu, normal_pdf, 0.10, 0.01;// Loan to value ratio (R.9: Defined a gamma distribution)
rhoo, beta_pdf, 0.72, 0.01; //Autoregressive of oil revenue coeef (R.9)
//rhog, beta_pdf, 0.44, 0.01; //(R.12)
rhopi, gamma_pdf, 1.40, 0.01; //(R.9) (Is itBetween 0 and 1???)
rhord, beta_pdf, 0.80320, 0.01; //Assumption (Is itBetween 0 and 1???)
//rholo,beta_pdf, 0.80, 0.01; //Gerali etal (2009)
//rhode,beta_pdf,0.80,0.01;//Gerali etal (2009)
rhou,beta_pdf, 0.80, 0.01; //Gerali etal (2009)
stderr varlv, inv_gamma_pdf, 0.01, inf; //Standard Error of oil revenue (R.8)
stderr vara, inv_gamma_pdf, 0.01, inf; //Standard Error of oil revenue (R.8)
//stderr varmkb, inv_gamma_pdf, 0.01, inf; //Standard Error of oil revenue (R.8)
//stderr varmkd, inv_gamma_pdf, 0.01, inf; //Standard Error of oil revenue (R.8)
//stderr varkb, inv_gamma_pdf, 0.05, inf; //Standard Error of oil revenue (R.8)
stderr varg, inv_gamma_pdf, 0.01, inf; //Standard Error of oil revenue (R.8)
stderr varig, inv_gamma_pdf, 0.01, inf; //Standard Error of oil revenue (R.8)
stderr varor, inv_gamma_pdf, 0.01, inf; //Standard Error of oil revenue (R.8)
end;
estimated_params_init(use_calibration);
end;
//dynare_sensitivity;
//identification;
//identification(parameter_set=posterior_mode);
//resid;
//identification (advanced=1, max_dim_cova_group=3, prior_mc=250, lik_init=3) ;
estimation(tex,datafile=mydata5,mode_compute=6,mode_check,mh_replic=100000,mh_jscale=0.12,mh_nblocks=3,irf=40,prior_trunc=0) yobs ipobs igobs;
//stoch_simul(tex,hp_filter=1600,order=1,periods=10000,irf=40,qz_zero_threshold);
stoch_simul(irf=40,order=1,pruning,tex);
//write_latex_dynamic_model;
//write_latex_parameter_table;
//write_latex_definitions;
//collect_latex_files;
//if system(['pdflatex -halt-on-error ' M_.fname '_TeX_binder.TeX'])
// error('TeX-File did not compile.')
//end