LearnBayes (version 2.15.1)

rigamma: Random number generation for inverse gamma distribution

Description

Simulates from a inverse gamma (a, b) distribution with density proportional to $y^(-a-1) exp(-b/y)$

Usage

rigamma(n, a, b)

Arguments

n

number of random numbers to be generated

a

inverse gamma shape parameter

b

inverse gamma rate parameter

Value

vector of n simulated draws

Examples

Run this code
# NOT RUN {
a=10
b=5
n=20
rigamma(n,a,b)
# }

Run the code above in your browser using DataLab