How to do inverse gamma sampling in R?

How to do inverse gamma sampling in R?

Although @Dason and @Stephane already commented that your approach is valid, there are several packages in R that do this (found googling for r inverse gamma: See also the wikipedia page for the gamma distribution and the inverse gamma distribution for the probability density function of both distributions:

What is the family of Gaussian inverse gamma distributions?

In probability theory and statistics, the normal-inverse-gamma distribution (or Gaussian-inverse-gamma distribution) is a four-parameter family of multivariate continuous probability distributions. It is a family of conjugate priors of a normal distribution with unknown mean and variance.

Why are there two different parameterizations of the gamma distribution?

This discrepancy arises because there are two different parameterizations of the Gamma distribution and each relate differently to the Inverse Gamma distribution. On Wikipedia, the two parameterizations for the Gamma distribution are differentiated by using ( k, θ) and ( α, β).

How is Gibbs sampling used in the MCMC?

I am using Gibbs sampling in the MCMC estimation of a stochastic volatility model. One of the posterior distributions is an Inverse Gamma distribution. I was struggling with the sampling procedure or to be precise with the link to the Gamma distribution.

What is the inverse gamma distribution in statistics?

Inverse-gamma distribution. In probability theory and statistics, the inverse gamma distribution is a two-parameter family of continuous probability distributions on the positive real line, which is the distribution of the reciprocal of a variable distributed according to the gamma distribution.

Is the cumulative distribution function the gamma function?

Cumulative distribution function. The cumulative distribution function is the regularized gamma function. where the numerator is the upper incomplete gamma function and the denominator is the gamma function. Many math packages allow direct computation of Q {displaystyle Q} , the regularized gamma function.

Which is the generalization of the normal inverse Wishart distribution?

The normal-inverse-Wishart distribution is a generalization of the normal-inverse-gamma distribution that is defined over multivariate random variables.