R/invgamma.R

Defines functions rinvgamma

Documented in rinvgamma

#' @title The Inverse Gamma Distribution
#'
#' @description Random generation for the Inverse Gamma distribution with
#'   parameters `shape` (alpha) and `scale` (beta).
#'
#' @inheritParams stats::rgamma
#'
#' @return numeric vector of length \code{n}.
#'
#' @examples
#' rinvgamma(10, 0.5, 0.01)
#'
#' @export
rinvgamma <- function(n, shape, scale) {
  return(1 / stats::rgamma(n, shape = shape, rate = scale))
}
ihmeuw-demographics/demUtils documentation built on Feb. 27, 2024, 1:25 p.m.