Skip to contents

TL; DR

This document states the parametrization used for the positive density functions used in the package.

Log-normal

Let YY be a random variable following a Log-normal distribution with parameters η\eta and τ\tau. We denote YLN(η,τ)Y \sim LN(\eta, \tau). The density function associated with such a variable is g(y)=(2πτ)1/2y1exp{(logyη)22τ}. g(y) = (2 \pi \tau)^{-1 / 2} y^{-1} \exp \left \{ - \frac{(\log y - \eta)^{2}}{2 \tau}\right \}. The expected value (theoretical mean) of such a variable is E[Y]=exp{η+τ/2}, E[Y] = \exp \{\eta + \tau / 2 \}, while the variance is: V[Y]=[exp{τ}1]exp{2η+τ}. V[Y] = [\exp \{ \tau \} - 1] \exp \{2 \eta + \tau \}.

Since we are usually interested in parametrization regression models through the mean of a distribution, we work with an alternative parametrization of this distribution. In particular, to parametrize the distribution in terms of the mean (denoted μ\mu) on the original scale. The simplest way to achieve this is as follows by solving the following system of equations for η\eta and τ\tauμ=exp{η+τ/2}ϕ=2τ, \begin{align*} \mu & = \exp \{\eta + \tau / 2 \} \\ \phi & = 2 \tau, \end{align*} which yields η=logμϕτ=ϕ2. \begin{align*} \eta = \log \mu - \phi \\ \tau = \frac{\phi}{2}. \end{align*}

Alternatively, one may set ϕ=[exp{τ}1]exp{2η+τ}. \phi = [\exp \{ \tau \} - 1] \exp \{2 \eta + \tau \}. Which yields: η=log(μ2ϕ+μ2)τ=log(ϕ+μ2μ2).\begin{align*} \eta = \log \left ( \frac{\mu^2}{\sqrt{\phi + \mu^2}} \right) \\ \tau = \log \left ( \frac{\phi + \mu^2}{\mu^2} \right). \end{align*}

For simplicity, we work with the first option, which yields the following density: g(y)=(πϕ)1/2y1exp{1ϕ(logylogμ+ϕ)2}. g(y) = {(\pi \phi)}^{-1/2} y^{-1} \exp \left \{ - \frac{1}{\phi} {(\log y - \log \mu + \phi)}^{2} \right \}.

Gamma

Similarly, let~YGamma(α,β)Y \sim Gamma(\alpha, \beta), with density given by: g(y)=βαΓ(α)yα1exp{βy}, g(y) = \frac{\beta^\alpha}{\Gamma(\alpha)} y^{\alpha-1} \exp\{- \beta y \}, while its mean and variance are E[Y]=α/β E[Y] = \alpha / \beta and V[Y]=α/β2, V[Y] = \alpha / \beta^2, respectively.

Using a similar strategy as before, we get a parametrization in terms of the mean as follows: μ=α/βϕ=α. \begin{align*} \mu & = \alpha / \beta \\ \phi & = \alpha. \end{align*} Solving for α\alpha and β\beta gives: α=ϕβ=ϕ/μ. \begin{align*} \alpha & = \phi \\ \beta & = \phi / \mu. \end{align*} which yields the following density (parametrized in terms of the mean) g(y)=1Γ(ϕ)ϕϕμϕyϕ1exp{ϕμy}, g(y) = \frac{1}{\Gamma(\phi)} \frac{\phi^\phi}{\mu^\phi} y^{\phi-1} \exp \left \{- \frac{\phi}{\mu} y \right \},

References