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 logpdf;

	/**
	* Evaluates the natural logarithm of the probability density function (PDF) for an inverse gamma distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {number} evaluated logPDF
	*
	* @example
	* var y = logpdf( -1.2 );
	* // returns <number>
	*/
	function logpdf( x ) {
		var out;
		if ( isnan( x ) ) {
			return NaN;
		}
		if ( x <= 0.0 ) {
			return NINF;
		}
		out = firstTerm - ( ( alpha + 1.0 ) * ln( x ) ) - ( beta / x );
		return out;
	}
}
Returns a function for evaluating the natural logarithm of 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} logPDF

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

var y = logpdf( 1.0 );
// returns ~-0.977

y = logpdf( 2.0 );
// returns ~-3.0