function factory( alpha, beta ) {
	var firstTerm;
	if (
		isnan( alpha ) ||
		isnan( beta ) ||
		alpha <= 0.0 ||
		beta <= 0.0
	) {
		return constantFunction( NaN );
	}
	firstTerm = ( alpha * ln( beta ) ) - gammaln( alpha );
	return pdf;

	/**
	* Evaluates the probability density function (PDF) for an inverse gamma distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {number} evaluated PDF
	*
	* @example
	* var y = pdf( -1.2 );
	* // returns <number>
	*/
	function pdf( x ) {
		var lnl;
		if ( isnan( x ) ) {
			return NaN;
		}
		if ( x <= 0.0 ) {
			return 0.0;
		}
		lnl = firstTerm - (( alpha + 1.0 ) * ln( x )) - (beta / x);
		return exp( lnl );
	}
}
Returns a function for evaluating the probability density function (PDF) for an inverse gamma distribution with shape parameter `alpha` and scale parameter `beta`.

@param {PositiveNumber} alpha - shape parameter
@param {PositiveNumber} beta - scale parameter
@returns {Function} PDF

@example
var pdf = factory( 3.0, 1.5 );

var y = pdf( 1.0 );
// returns ~0.377

y = pdf( 2.0 );
// returns ~0.05