I am currently working on a DSGE model with matching and search frictions and in the model, there is an expression which is making trouble.

g(x) = int(yt,inf) (x-yt) f(x) dx
with
f(x) being the pdf of a log-normal distribution, so that the partial expectation can be expressed as:
g(x) = e^(mu + 1/2 * sigma^2) Phi( (mu+sigma^2-ln(y))/sigma) - y Phi( (mu - ln(y))/sigma)
(here, Phi is the normal cdf)

What is the log-linerized form of this function? Does anybody have an idea?

So far I have only found a solution for the conditional expectation, but I have not been able reproduce it.
H(a) = (int(yt,inf) a f(a) da) /(1-F(yt))
– > dH(a)/da * a/H(a) * yt_hat
(with yt_hat being the deviation from the steady state)

As far as I have found out by now, there is no way to use the non-linear equation in dynare. So one has to use the log-lineraized version of the model.

Whenever there is a conditional or partial expectation, one has to evaluate the elasticity at the steady state value. This gives you the following solutions:

Conditional expectation:
H(a) = (int(yt,inf) a f(a) da) /(1-F(yt))
the partial derivative
dH(y)/dy = f(y)/(1-F(y)) *(H(y)-y)
and the elasticity is simply
eHa = dH(y)/dy * y/H(y)
the expression in the linearization is
H(y) *eHa * ythat