External steady state file with linear model

Hi,
I have a question.
I wanted to calibrate a model in its loglinearized form using an external steady state.

I am calibrating several parameters to match certain targets using a fun.m file.
When the mode was not loglinearized, I called the parameters from the '<example_steady state.m> file in the <example.mod> file as
x = STEADY_STATE(x); as each x-parameter was declared as endogenous variable.

In the loglinearized version do I follow the same steps. (i.e declare parameters that are calibrated as endogenous variables, and call them via the command x = STEADY_STATE(x) ??

1 Like

I am not following. What do you mean with

?

If x is a variable, it cannot be a parameter. STEADY_STATE(x) will be a parameter.

If you are asking how to access the steady state levels of the original level variables when you are dealing with a log-linearized model: you define e.g. a parameter x_ss and set this parameter to the steady state value for the level of x computed in the steady state file. The model variable xhat must be set to 0 in the steady state file. Basically, you only use the steady state file to access the nonlinear steady state values of the original model.

Thanks a lot for your comment Mr. Pfeifer. It’s exactly what I am asking. So the way I understand th proposed solution is: when i have a loglinearized mod file use the same steady state.m and fun.m files I was using when I had a *.mod file in levels but now call only the ss value of the variables with x_ss=STEADYSTATE (x) inside th model (linear) … end; block. Then I have to declare both x & xhat as endogenous variables and x_ss as parameter. Amy right?

First, that is not my name.

Second, that is not what I was saying. You can only use the steady_state()-operator on variables and in a log-linearized model you level variables are not defined as variables. Rather define x_ss in the mod_file

Then in the steady state file set x_ss to its steady state value

and set the variable x that is percentage deviations of x from its steady state to 0:

In every run of your model, Dynare will update the parameter x_ss from the deep parameters of the model. An example for a steady state file is the NK_baseline.mod in the Dynare examples folder

  1. Apologies for misspelling the name. I was writing from my Phone last night, and the software of the phone end up displaying sth else from what I intend to write. Obviously for this case I probably have not corrected it.

  2. Thank you very much for your helpful comments. This is how I am proceeding. (and I did looked at the example with NK baseline model) .

The extra issue I got is that I am calibrating some of the parameters (mu, Theta, psi etc) in the steady state file. When the model was in level, they were declared as endogenous variables and called in the model block of FILE.mod as : mu = STEADY_STATE(mu) in order to convert tem into fixed values ( and use them as parameters). They were calibrated to account for nonlinearities in the the FUN.m file.

Now that the model is linear, are these to-be-calibrated parameters declared as endogenous again ?

and in case so, do I call them in the model(linear) block in the same way { mu = STEADY_STATE(mu) }, which implies the steady state value will not be zero , while zero for other ‘‘x’’ (loglinearized) variables ?

Regards

I get this message when I run my linear Model with external steady state .
The parameters for DYNARE says ''no value ‘’ (as seen below) are functions of parameters which I am trying to calibrate (mup). So obviously Dynare did not read the value of the calibrated parameters (mu,Theta,psi).
Any help would be highly appreciated (I am attaching the files).

Warning: Some of the parameters have no value (PSTARss, MC, DELTA, RK, IY, CY, varrho, YWss, Yss, Iss, Kss, Gss, Css, W) when
using steady. If these parameters are not initialized in a steadystate file, Dynare may not be able to solve the model... 
> In test_for_deep_parameters_calibration at 46
  In steady at 33
  In NKlinear at 382
  In dynare at 180 
Warning: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using Levenberg-Marquardt algorithm
instead. 
> In fsolve at 285
  In NKlinear_steadystate at 30
  In evaluate_steady_state_file at 49
  In evaluate_steady_state at 58
  In steady_ at 54
  In steady at 81
  In NKlinear at 382
  In dynare at 180 
Warning: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using Levenberg-Marquardt algorithm
instead. 
> In fsolve at 285
  In NKlinear_steadystate at 30
  In evaluate_steady_state_file at 49
  In evaluate_steady_state at 58
  In resid at 55
  In steady at 90
  In NKlinear at 382
  In dynare at 180 

**Never ever name a variable just i. ** Use invest. Your steady state file uses a loop index named i as well! You are overwriting all results.

Moreover, use a correct steady state file! Your’s is missing the

for iter = 1:length(M_.params) %update parameters set in the file eval( 'M_.params(' num2str(iter) ') = ' M_.param_names(iter,:) ';' ]) end
at the bottom. Again, see the NK_baseline.mod

Finally, you cannot use

KYW = STEADY_STATE(KYW); mup = STEADY_STATE(mup); muY = STEADY_STATE(muY);

Those three objects are parameters, not variables.

Thanks a lot for the response Prof. Johannes. I did add the extra lines and the relevant substitution.

It still does not give values to the SS parameters which are function of deep parameters ( though I am loading them).
Could it be that I am missing some command in the beginning of the steadystate file or in the …fun.m file?

Warning: Some of the parameters have no value (varrho, RK, W, IY, CY, YWss, Yss, Iss, Kss, Gss, Css, PSTARss, MC, DELTA, KYW, mup, muY) when using
steady. If these parameters are not initialized in a steadystate file, Dynare may not be able to solve the model... 
> In test_for_deep_parameters_calibration at 46
  In steady at 33
  In NKlinear at 374
  In dynare at 180 
Warning: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using Levenberg-Marquardt algorithm instead. 
> In fsolve at 285
  In NKlinear_steadystate at 30
  In evaluate_steady_state_file at 49
  In evaluate_steady_state at 58
  In steady_ at 54
  In steady at 81
  In NKlinear at 374
  In dynare at 180 

Though it does calculate the value of SS parameters it still gives some warnings as if not doing so (I edited this text after several trials) .

And should I bother for this warning also ? Why should it be a warning that is using another algorithm ? is sth wrong with it ?

Warning: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using Levenberg-Marquardt algorithm instead. 

Many many Thanks Prof. Pfeifer.

Read the message carefully:

But you are initializing them in the steady state file. So no reason to worry here.

The other warning regarding fsolve is also harmless. You can get rid of it by adding to optimset the option

'Algorithm','levenberg-marquardt'

There are still two additional issues:

  1. lambda isn’t present at the current period in the model.
  2. The Blanchard-Kahn conditions are not satisfied. The is most probably still a timing error

Many Thanks Prof. Johannes,

I works fine now. very much appreciated.
It’s weird though when dynare says :

There are 12 eigenvalue(s) larger than 1 in modulus 
for 12 forward-looking variable(s)

The rank condition ISN'T verified!
...
...
then
...
Error using print_info (line 48)
Blanchard Kahn conditions are not satisfied: indeterminacy due to rank failure

There should be a way to fix it.

Why is that weird? When your model does not satisfy the rank condition, it does not help when the BK conditions are satisfied. Does model_diagnostics return anything?

the problem with lambda. You already mentioned that before .

>> model_diagnostics(M_,options_,oo_)
The following endogenous variables aren't present at the current period in the model:
lambda   
Undefined function 'BggGKlinear_steadystate' for input arguments of type 'double'.

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

Error in evaluate_steady_state (line 58)
        [ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, ...

Error in model_diagnostics (line 65)
[dr.ys,params,check1]=evaluate_steady_state(oo.steady_state,M,options,oo,1);

Is it fine to write in the model(linear) block (i.e. is it the samething?) :

lambda = - rr; 
... instead of....
lambda(+1) = - rr (+1) ; 

Correction: Many many Thanks Prof. Johannes. I think I fixed by doing what I just wrote above.

My last question: I have a vector called

mycalib     = [KYW, APS, PSI, mup,        ThetaB, sigmaB, xiB, sigmaE, xiE,muY]

in my steady state file:

FILENAME_steadystate.m     

How can I import these values in my dynare file called: ?

FILENAME.mod 

what are the commands for that. I have been searching for days, I can not get the syntax right. (Ps. It will help me get around with this warning that SS parameters are not initialized (although the are) . Just the idea that it shows up seems bothering.

No,

is not the same as

The latter is E_t(lambda(+1))=E_t(-rr(+1)), i.e. the equation then only has to hold in expectations. As lambda does not enter any equation, you can just delete this equation and get rid of lambda.

Just forget about the warning. There is no way around it. It is designed exactly for this purpose of warning a user that these parameters have to be defined in the steady state file, which you do.

Alright. Many thanks Prof.
then the problem with the BK condition is there. back to square 1.

If you had a running nonlinear version, finding the problem should not be too difficult.

Thanks again.
I had a problem with the results (economic view) of the nonlinear version.

I could fix the linear version too following your advice in another post:

But again it was an arbitrary solution. For example the Financial accelerator of BGG says in paper says

 RK(+1) = rho(+1)  + R(+1) 

where ‘‘rho’’ is a premium on interest rate

I had to make the lags of these equal to zero to make BK satisfy … Is it right ? probably not.

When you want to implement BGG, you should look at sites.google.com/site/ambropo/dynarecodes