This function returns a 2-vector (shape and scale in that order) with the two parameters for an inverse Gamma distribution which has a requested mean and standard deviation. The inverse gamma is commonly used as the prior for a model parameter which has support on the positive reals (such as a variance).
Because it's a function (not a procedure), you need to do a SOURCE instruction on the file before you can use it in a RATS program.
If the s.d. is %NA (infinite), it returns a shape parameter of 2, which is the largest value for which the variance is undefined.
source invgammaparms.src (needs to be done once)
set test 1 1000 = igparms(2)/%rangamma(igparms(1))
set logg 1 1000 = -2.0*log(test)+$
will create a series named TEST with inverse gammas with (population) mean 2 and standard deviation 1 and the log density (in LOGG) at each drawn value.