Coder Social home page Coder Social logo

dsge_mod's People

Contributors

asavagar avatar johannespfeifer avatar wmutschl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dsge_mod's Issues

Gali (2007) - Government Spending - Consumption

Hallo Johannes,
Ich arbeite momentan am Paper "Understanding the effects of government spending on consumption" (Gali, Valles, Lopez-Salido - 2007). Ich habe einige Probleme, die IRFs zu replizieren.
Ich hatte mal im DynareForum gelesen, dass du schon an diesem Code (Mod.File) gearbeitet hattest.
Ich wäre dankbar für jede Hilfe, falls du dazu was hast.
Viele Grüße,
Louis

Hier der aktuelle Code:

var g ${g}$ (long_name='Government Spending')
c ${c}$ (long_name='Consumption Spending')
y ${y}$ (long_name='Output')
i ${i}$ (long_name='Investment')
k ${k}$ (long_name='Capital')
w ${w}$ (long_name='Real Wage')
n ${n}$ (long_name='Hours')
r ${r}$ (long_name='Nominal Interest Rate')
b ${b}$ (long_name='Bonds')
r_k ${r^{k}}$ (long_name='Return to Capital')
pi ${\pi}$ (long_name='Inflation')
q ${q}$ (long_name='Tobins Q')
mu_phat ${\hat{\mu^{p}}}$ (long_name='Price Markup')
t ${t}$ (long_name='Lump Sum Taxes')
kshare ${s^K}$ (long_name='Capital Share')
labshare ${s^N}$ (long_name='Labor Share')
lp ${lp}$ (long_name='Labour Productivity')
nu ${\nu}$ (long_name='Monetary Policy Shock Process')
;

varexo
epsG ${\epsilon^{G}}$ (long_name='Government Spending shock')
epsnu ${\epsilon^\nu}$ (long_name='Monetary Policy Shock')
;

parameters
betta ${\beta}$ (long_name='Discount Factor')
alp ${\alpha}$ (long_name='Capital Share')
delta ${\delta}$ (long_name='Depreciation Rate')
mu_p ${\mu^{p}}$ (long_name='SS Markup')
eta ${\eta}$ (long_name='Elasticity of Investment with respect to q')
lambda ${\lambda}$ (long_name='Share of RoT Consumers')
theta ${\theta}$ (long_name='Calvo Price Probability')
varphi ${\varphi}$ (long_name='Elasticity of Wages with respect to Hours')
phi_pi ${\phi_{\pi}}$ (long_name='Taylor rule elasticity of interest rate to inflation')
phi_g ${\phi_{g}}$ (long_name='Weight on Government Spending in Fiscal Rule')
phi_b ${\phi_{b}}$ (long_name='Weight on Debt in Fiscal Rule')
rho_g ${\rho_{g}}$ (long_name='Persistence of Government Spending')
rho_nu ${\rho_{\nu}}$ (long_name='Persistence of Monetary Policy Shock')
zzeta ${\zeta}$ (long_name='Elasticity of Substitution between Differentiated Goods')

//The following are composite parameters
Gamma ${\Gamma}$ (long_name='Euler Equation Parameter 1')
sigma ${\sigma}$ (long_name='Euler Equation Parameter 2')
Theta_n ${\Theta_{n}}$ (long_name='Euler Equation Parameter 3')
Theta_t ${\Theta_{t}}$ (long_name='Euler Equation Parameter 4')
lambda_p ${\lambda_{p}}$ (long_name='NKPC slope')

//The following parameters are steady state relationships
rho ${\rho}$ (long_name='Steady State Interest Rate')
gamma_g ${\gamma_{g}}$ (long_name='Share of Government Spending in Output in SS')
gamma_i ${\gamma_{i}}$ (long_name='Share of Investment in Output in SS')
gamma_c ${\gamma_{c}}$ (long_name='Share of Consumption in Output in SS')
% Nss ${\bar H}$ (long_name='Steady State Hours')
% MCss ${\bar MC}$ (long_name='Steady State Marginal Costs')
% Rss ${\bar R}$ (long_name='Steady State Real Interest Rate')
% RKss ${\bar RK}$ (long_name='Steady State Rental Rate of Capital')
% Kss ${\bar K}$ (long_name='Steady State Capital Stock')
% Yss ${\bar Y}$ (long_name='Steady State Real Output')
% Css ${\bar C}$ (long_name='Steady State Consumption')
% Wss ${\bar W}$ (long_name='Steady State Real Wages')
% LSss ${\bar{s}^{h}}$ (long_name='Steady State Labor Share')

;

betta=0.99;
mu_p=1.2;
delta=0.025;
alp=1/3;
lambda=0.5;
theta=0.75;
varphi=0.2;
eta=1.0;
phi_pi=1.5;
phi_g=0.1;
phi_b=0.33;
gamma_g=0.2;
rho_g=0.9;
rho_nu=0.9;
zzeta=6; %elasticity of substitution between differentiated goods, yielding mu_p

// SS Relationships

rho=(1/betta)-1; %p.246
gamma_c=1-gamma_g-((deltaalp)/((rho+delta)(mu_p))); %Modified (cf. 2004 paper)
gamma_i=1-gamma_g-gamma_c;

// Perfectly competitive labour markets
lambda_p=((1-bettatheta)(1-theta))/theta;
Gamma=1/(mu_pvarphigamma_c+(1-alp)(1-lambda(1+varphi))); %p.244
sigma=(1-lambda)Gamma(mu_pvarphigamma_c+(1-alp)); %p.244
Theta_n=lambdaGamma(1-alp)(1+varphi)varphi; %p.244
Theta_t=lambda
Gamma
mu_p*varphi; %p.244

// Imperfectly competitive labour markets
lambda_p=((1-bettatheta)(1-theta))/theta;
PHI = 1/(gamma_cmu_p - lambda(1-alp));
sigma=gamma_cPHI(1-lambda)mu_p;
Theta_n=lambda
PHI*(1-alp)(1+varphi);
Theta_t=lambda
PHI*mu_p;

model(linear);

// Households
[name='1. Tobins Q']
q=bettaq(+1)+(1-betta(1-delta))r_k(+1)-(r-pi(+1));
[name='2. Investment']
i-k(-1)=eta
q;
[name='3. Capital Accumulation']
k=deltai+(1-delta)k(-1);
[name='4. Euler Equation (aggregate)']
c=c(+1)-sigma
(r-pi(+1))-Theta_n
(n(+1)-n)+Theta_t*(t(+1)-t); //(not sure whether this is really correct, particularly t and not t_r)
[name='5. Wage Schedule (competitive)']
w=c+varphi*n;

// Firms
[name='6. NKPC']
pi=bettapi(+1)-lambda_pmu_phat;
[name='7. Markup (1)']
mu_phat=y-n-w;
[name='8. Markup (2)']
mu_phat=y-k-r_k;
[name='9. Production Function']
y=(1-alp)n+alpk(-1);

// Market Clearing
[name='10. Market Clearing']
y=gamma_cc+gamma_ii+g; %surely there's a gamma_g missing before g in the paper?!
%If I add gamma_g, then I need to adapt the fiscal rule etc as well!

// Policy
[name='11. Taylor Rule']
r=phi_pipi+nu;
%r=Rss+phi_pi
pi; %leads to non-0 SS values
[name='12. Debt']
%b=(1+rho)(1-phi_b)b(-1)+(1+rho)(1-phi_g)g;
b=(1+rho)
(b(-1)+g-t);
[name='13. FP Rule']
t=phi_b
b(-1)+phi_g*g;

// Factor Shares
[name='14. Capital Share']
kshare = r_k+k(-1)-y;
[name='15. Labor Share']
labshare = w+n-y;
[name='16. Labor Productivity']
lp=y-n;

// Shock Processes
[name='17. Government Spending Shock']
g=rho_gg(-1)+epsG;
%Or with a news shock specification...
%g=rho_g
g(-1)+epsG(-4);
[name='18. Monetary Policy Shock']
nu=rho_nu*nu(-1)+epsnu;

end;

shocks;
var epsG; stderr 1;
end;

resid(1);
steady;
check;

stoch_simul(order=1,irf=20,periods=1000);

Parameters not initialized

Hi, professor. I was having a discussion with you at the Dynare Forum, but by some reason the website is not working. So I will send some doubts here for both the CET 2016 problem that I was having and the replication of Gali_2015_chapter_7.mod:

Dear Prof. Pfeifer, thank you so much for your kind response.

I have 2 questions after trying your suggestion:

  1. My problem running the CET 2016 model persists, even though I ran dynare_config before calling dynare cet.mod as you suggested. I don’t know exactly what the output after running this should’ve been, but I got this:

`>> dynare_config

ans =

'/Applications/Dynare/4.6.4/matlab/‘`

Indeed, the problem with the data.m file is not showing up, but now all I got for every file in the folder is:

`Error using cet_steadystate
Too many input arguments.

Error in evaluate_steady_state_file (line 49)
[ys,params1,check] = h_steadystate(ys_init, exo_ss,M,options);

Error in evaluate_steady_state (line 210)
[ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, options,steadystate_check_flag);

Error in resid (line 66)
evaluate_steady_state(oo_.steady_state,M_,options_,oo_,0);

Error in cet.driver (line 1103)
resid;

Error in dynare (line 293)
evalin('base',[fname '.driver']) ;`

There is a problem with calculating the steady state, but I really don’t want to make any changes in the function available… Do you have any suggestion?

  1. I am also trying to run your code for the Gali book available in your GitHub (file attached). When running it, I encountered the following problem:

Warning: Some of the parameters have no value (lambda_p, lambda_w) when using stoch_simul. If these parameters are not initialized in a steadystate file or a steady_state_model-block, Dynare may not be able to solve the model... Total computing time : 0h00m05s Note: 31 warning(s) encountered in the preprocessor Note: warning(s) encountered in MATLAB/Octave code

but there is indeed a steady_state_model-block (lines 221-224). What do you thing is the issue here?

Thank you very much!

SMM Dynare Toolbox with Binomial draws

Hi,

I am trying to estimate by SMM with the relatively new Dynare toolbox a model with two binomial draws (a couple of random draws into the model will do the job). In fact, the binomial parameters, say p and q, are those among I would like to be estimated. Nonetheless, to the best of my understanding Dynare only supports normal shocks for the estimations.

Is there a way to generate random draws as opposed to Normal ones for the estimation in the SMM toolbox?

Alternatively, I was thinking whether there is a Dynare-implementable method to transform normal to random shocks (into the model part of the code) so that I can proceed with the SMM estimation.

Any help will be highly appreciated!

can not find function

Dear Professor Pfeifer

today ,i download the newest DSGE_mod.zip file;
but the program has wrong. the matlab console reminder these messages:

Unrecognized function or variable 'Create_1_by_4_vola_figures'.

Error in BP2020_CES.driver (line 663)
Create_1_by_4_vola_figures

Error in dynare (line 293)
evalin('base',[fname '.driver']) ;

Error in run_model_IRF_generation_order_4 (line 22)
dynare BP2020_CES -Dsticky_prices=1 -Dsticky_wages=1

With the highest respect

                                                        Sincerely yours,
                                                       Daniel Tulips Liu

                                                       BeiJing,China.

dynare help

Dear all,
I am trying to extend the model in dynare! If I only want a single one with all two or three shocks at once, what I should do? I want to interpret all three shocks for, for example monetary , fiscal and oil price, at once.
Thanks a lot in advance
fhosseini

mode_file Smets and Wouters

The mode_file is taken for granted as input in the Smets & Wouters code. If I understand correctly it's obtained from M_.params and M_.Sigma_e from an initial run of the model without the Metropolis-Hastings algo. Then that is saved as a mode-file and used as input in the code with mode_file option and mode_compute = 0 with MH.

However, it's not clear how this mode_file is retrieved. I.e. which of the mode_compute options is used to retrieve the mode_file. I experimented a bit and believe it uses the default mode_compute = 4, which I would suggest is added to the documentation (if I didn't miss this) or as a step programatically.

SGU_2003.mod, line 263

In Model 3, Equation (29) on page 171 of the original paper JIE published version, the authors use the specification $+\frac{\psi_3}{2}(d-\bar{d})^2$, while the code currently implements $+\psi_3(d-\bar{d})^2$ without the division by 2.
I suspect this to be a typo.

Best,

Camilo

Unmatched asset returns

Hi Professor, I have trying to replicate results in the paper and found your code is extremely helpful, especially for people like me who just start to use Dynare. So I got exact same IRF figures as what's shown in the paper. But for the asset returns data, it doesn't seem like quite right. I don't know if that's because we use second approximation instead of log linear asset pricing here. Here is the results I get based on your code and mod file. Numbers in the parenthesis is the results in the paper while those without parenthesis are from the code.
screenshot 2018-11-19 at 7 51 47 pm

Another silly problem is, could you tell me or give me some hints on how to do log-linear asset pricing and calculate returns moments as in the paper? I searched a pile of papers and codes. None of them is using this approach and no one is writing it explicitly on how to actually do that. Any answer or recommendation would be helpful!!! I also built another model by substituting variable with exp(x). It produces same IRF. So it should be log-linear type of model, right? Then, how I am supposed to calculate expected risk free rate and so on?

Many thanks!!!!!

Gali and Monacelli (2005) mod file error

Hi Johannes,

In Gali and Monacelli (5005) mod file, there is an error in the line 341. I'm using MatLab 2020a and Dynare 4.6.3. The variable var_string is a cell array, and var_string(var_iter) returns a cell, which results in an error. I believe a fix would be to replace var_string{var_iter} by var_string{var_iter}.

Best,
Eduardo

Ascari Sbordone 2014_ Issue in line 172

Dear Sir, I am running the file Ascari Sbordone 2014 using code available at the website. It shows the following error

Error using dynare (line 172)
dynare:: can't open Ascari.mod

please comments
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.