# Function of lognormal distribution

Hi everyone!.

I need to define a function of lognormal pdf to use in dynare.
Let’s assume that a lognormal p.d.f. f(x) is defined on (mu, sigma).
I would like to define a function which returns the integral from certain number “a” to infinity of x f(x). i.e., int_a^infty x f(x) dx.
How can I define the function in dynare?

Thank you.

TKang

In this case you most probably have to work with an external function. There is currently no good example. The best I could find is Integration function - dynare v4?

In financial frictions literature à la Bernanke, Gertler y Gilchrist (1999), If x is log-normal(1,sigma^2) then:

\int_{a}^\infty x f(x) dx = 1 - \Phi(z - sigma),

where: z = (1/\sigma)*(ln(a) + 0.5 *\sigma ^2), and \Phi() is accumulated standardized normal distribution function.

you can see the derivation, for example, in Appendix (5) of GIMF.