\subsection{Gamma types 2 and 1 distributions}\label{subsec:GammaDistributionTypes}

\subsection{Gamma distributions of types I and II}\label{subsec:GammaDistributionTypes}

\begin{definition}

Let $X>0$ gamma random variable parameterized by a shape $\frac{\nu}{2}>0$ and a scale $\frac{2}{s}>0$. We will denote $X\sim G_2(\nu, s)\equiv G\left(\frac{\nu}{2}, \frac{2}{s}\right)$, and say that $X$ has a gamma-2 distribution.

Let $X>0$ gamma random variable parameterized by a shape

$\frac{\nu}{2}>0$ and a scale $\frac{2}{s}>0$. We will denote

@@ -194,18 +198,25 @@ These distributions are not implemented in Dynare but can be easily built from t

\end{proposition}

\begin{proof}[Proof of proposition \ref{GammaDistribution:type1and2:densities}]

The density of the gamma-2 distribution is easily obtained from the density of the gamma distribution, and the first two moments of this distribution are given by proposition \ref{GammaDistributionMoments}. The density of the gamma-1 distribution is given by:

\[

f_Y(y)= f_X\left(h^{-1}(y)\right)\times\left|\frac{\mathrm d}{\mathrm d y}h^{-1}(y)\right|

\]

by applying the change of variable formula, where $h(x)=\sqrt{x}$, and $f_X(x)$ is the density of the gamma-2 distribution. Substituting $f_X$ and the reciprocal of $h$ in the definition of $f_Y$, we get:

\[

\begin{split}

f_Y(y)&=\mathcal C\left(\frac{\nu}{2},\frac{2}{s}\right)^{-1}y^{\nu-2}e^{-\frac{s}{2}y^2}\times\left| \frac{\mathrm d}{\mathrm d y}y^2\right|\\

Let $X$ be a gamma distributed random variable whith shape parameter $\alpha>0$ and scale parameter $\beta>0$. Then $Z = X^{-1}$ is said to be gamma inverted distributed, $Z\sim IG(\alpha, \beta)$.

Let $X$ be a gamma distributed random variable with shape parameter

$\alpha>0$ and scale parameter $\beta>0$. Then $Z = X^{-1}$ has an

@@ -306,7 +319,10 @@ where $X~G_2(\nu, s)$. From proposition \ref{GammaDistribution:type2:moments}, w

\end{proposition}

\begin{proof}[Proof of proposition \ref{InvertedGammaDensity}]

Let $f_X$ denote the density of the gamma distribution with shape and scale parameters $\alpha>0$ and $\beta>0$, and define $h(x)=\frac{1}{x}$. The density of the inverted gamma distribution is defined as follows:

Let $f_X$ denote the density of the gamma distribution with shape

and scale parameters $\alpha>0$ and $\beta>0$, and define

$h(x)=\frac{1}{x}$. The density of the inverted gamma distribution

\subsection{Inverted Gamma of types 1 and 2}\label{sec:InvertedGammaDistributionsOfType1And2}

\subsection{Inverted Gamma of types I and II}\label{sec:InvertedGammaDistributionsOfType1And2}

\begin{definition}\label{InvertedGamma2}

Let $X>0$ be a real random variable with gamma-2 distribution, $X\sim G\left(\frac{\nu}{2},\frac{2}{s}\right)$. $Y = X^{-1}$ is said to have an inverted gamma of type 2 distribution, $Y\sim IG_2(\nu, s)$.

Let $X>0$ be a real random variable with gamma distribution of type II,

$X\sim G\left(\frac{\nu}{2},\frac{2}{s}\right)$. $Y = X^{-1}$ is

said to have an inverted gamma distribution of type II,

$Y\sim IG_2(\nu, s)$.

\end{definition}

\begin{proposition}\label{InvertedGamma2Density}

...

...

@@ -454,7 +474,7 @@ and by substitution in the first equation:

Direct from proposition \ref{InvertedGammaMoments} with $\alpha=\nicefrac{\nu}{2}$ and $\beta=\nicefrac{s}{2}$.

\end{proof}

The inverted gamma type II distribution is implemented in \Dynare\ as a prior, using the

The inverted gamma distribution of type II is implemented in \Dynare\ as a prior, using the

keyword \verb+INV_GAMMA2_PDF+. The user has to specify $\mu$ and $\sigma$, and \Dynare\ solves the

two equations given in proposition \ref{InvertedGamma2Moments} for the scale and shape parameters:

...

...

@@ -467,7 +487,7 @@ two equations given in proposition \ref{InvertedGamma2Moments} for the scale and

This distribution is often used as a prior for the variance of a structural shock

or measurement error. Note that the sole difference between an inverted gamma

distribution and the inverted gamma type II distribution is in the parameterization of the

distribution and the inverted gamma distribution of type II is in the parameterization of the

shape and scale parameters. If the prior distribution is defined by its first and

second moments, this difference does not matter.\newline

...

...

@@ -530,11 +550,14 @@ the mode formula given in proposition \ref{InvertedGamma2Mode}.

third order polynomial has to be greater than four.

\end{proof}

In practice we instead usually define the priors over standard deviations, that is

over the square root of the variance. This motivates the following definition.\newline

In practice we instead usually define the priors over standard

deviations, i.e. the square root of the variance. This motivates the

following definition.\newline

\begin{definition}\label{InvertedGamma1}

Let $X>0$ be a real random variable with gamma distribution of type I, $X\sim G_1\left(\nu,s\right)$. $Y = X^{-1}$ is said to have an inverted gamma distribution of type I, $Y\sim IG_1(\nu, s)$.

Let $X>0$ be a real random variable with gamma distribution of type

I, $X\sim G_1\left(\nu,s\right)$. $Y = X^{-1}$ is said to have an

inverted gamma distribution of type I, $Y\sim IG_1(\nu, s)$.

\end{definition}

\begin{proposition}\label{InvertedGamma1Density}

...

...

@@ -649,9 +672,10 @@ variance we have a closed form solution:

The inverse gamma distribution of type I (type II) is usually used as

a prior for the standard deviation (resp. variance) of a structural

(or measurement) shock. The rational is that in linear model with

(or measurement) shock. The rational is that in linear models with

gaussian noise, the Normal (for the parameters) – Inverse Gamma

(for the variance of the error) prior is conjugate. Obviously this is

not true for DSGE models, there is no computational advantage in