Hi, All: assume I need to generate X from inverse gamma with parameter (k, beta). should I generate from Y from gamma(-k, beta), then take X=1/Y? Thanks pat
Patrick Wang wrote:> > assume I need to generate X from inverse gamma with parameter (k, > beta). > > should I generate from Y from gamma(-k, beta), > > then take X=1/Y? >Check the Borg of All Wisdom... en.wikipedia.org/wiki/Inverse-gamma_distribution Generate Y from gamma(k, 1/beta) (using... rgamma(n = number.of.points, shape = k, scale = 1/beta) ... or ... rgamma(n = number.of.points, shape = k, rate = beta) ) and take X = 1/Y (unless your beta is not the rate parameter...) Alberto Monteiro