# Loglinearized model with steady state value in model

Dear all,

I’m trying to replicate the model of the paper The general equilibrium effects of fiscal policy: Estimates for the euro area of Forni, Monteforte and Sessa as part for my thesis.
I’m having trouble modelling the log-linearised version of their model as the expressions include steady state values. The formulas for the steady state are given in the paper, but I’m confused how to model this.
Should I make a steady state block after the model block where I can refer to in the model block or should I compute the steady state values in the model block and simply declare them as new variables.
Any help would be much appreciated.

With kind regards,
Steven Hoekstra

Hello Steven,

First of all, you should not compute the steady state values in the model block.

Since the formulas are given in the paper, you should write a steady state file : Manual steady state > see section 4.10.2 Using a steady state file and look at the examples.

I would recommand to use `steady-state block` that will ask dynare to generate the m-file for you (it allows to call matlab function, which is for instance useful if they solve a block of equations simultanously)

Follow closely and in an orderly fashion the steady state given in the paper. In your `steady-state block` the first line should correspond to the first variable they determine in steady state, i.e. var_name = expression.

Good luck
Alex

Thank you Alex for your quick response.

I have follow up question. The log-linearised model uses the steady state values in the expressions in the model itself. for example consumption aggregation is given by cSS x log(ct)=gamma x cNRSS x log(cNRt)+(1-gamma) x cRSS x log(cRt), where SS denotes the steady state values of the variable and the subscript t denotes the time varying variable, x denotes multiplication.
Can you in someway refer to the steady state values in the steady state block from the model block?

Steven

Yes, often the `model block` contains expression with steady state values of variables.

You have multiple options (which are equivalent as far as I know) :

1. Add a new parameters `cSS` and in the `steady-state block` defines `cSS = c` (after the line for c, obviously). Doing so you set the parameter at the steady state value of `c`.

2. You can use the operator `steady_state()`.
So `cSS` can be substituted by `steady_state(c)`. But to keep your `model-block` readable I suggest that you define cSS as local variable at the beginning of your model block : `#cSS=steady_state(c)`. Then `cSS` will correspond to the steady state value of c.

I would go for the solution with the model-local variables as in e.g. https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Smets_Wouters_2007/Smets_Wouters_2007_45.mod

Dear all,

Thank you all for your responses. I will continue try to work out the kinks of the log-linear model.
In the mean time, I’m also working on the standard version of the model, however I encounter an error, namely log(0) is undefined. I cannot see how I can fix this error as I have initialised any variable which could cause this error to a sensible value. Is there a mistake in my model itself, or is the initialisation process the issue?
Attached is my .mod file.
Any help would be much appreciated.

With kind regards,
Steven.
Forni2008.mod (4.1 KB)

For which variable does this occur? I only get the error message

Error: v not used in the model block

Strange, I do get a different error.
Maybe it is a problem of my settings?

Here is my command window. It does not show for which variable the problem does occur.

Steven

There was indeed a redundant variable declared. I’ve removed it as well with another double formule as to match up variable and equation numbers. The new . mod file is below.
Forni2008.mod (4.0 KB)
I do still get the same error as my previous message displays.
Any help would be much appreciated.

Steven

Dynare says:
`ERROR: log(0) not defined!`
It means you have a log(0) in your model block!
The problem comes from line 96:
`log(R)=rhoR*log(R(-1))+(1-rhoR)*(rhopi*log(pitilde(-1))+rhoy*log(y))+rhodpi*log(pitilde-pitilde(-1))+rhody*log(y-y(-1))+etam;`
but fixing this there are still others you have to take care of!
My suggestion is to look into your model deep again.

Ah yes, I understand.
However, I did initialise some of the variables to prevent this error from happening.
That is I initialised every variable that would go into a log function to a sensible value to prevent this from happening. How come the error still comes up then?

Thanks,
Steven

As pointed out by @ddiority, the equation

``````log(R)=rhoR*log(R(-1))+(1-rhoR)*(rhopi*log(pitilde(-1))+rhoy*log(y))+rhodpi*log(pitilde-pitilde(-1))+rhody*log(y-y(-1))+etam;
``````

does not make sense. Within the logs, there will be zeros in steady state.

I see it now. The reason I wrote that line is as of next part of the paper.

I will try to contact the authors for clarification on how they mean this, as they use hat notation to denote the log function in the rest of the paper.
Thank you all very much for your help.
Steven

You are confusing something. The authors are talking about the difference in logs, not the log of the difference.

I see now, thank you. Now I get NaN values as a solution for the steady state, so I think there must be some intrinsic problem in the model on my behalf. I wil try to work this out.