function factory( alpha, beta ) {
	if (
		isnan( alpha ) ||
		isnan( beta ) ||
		alpha < 0.0 ||
		beta <= 0.0
	) {
		return constantFunction( NaN );
	}
	if ( alpha === 0.0 ) {
		return degenerate( 0.0 );
	}
	return logpdf;

	/**
	* Evaluates the logarithm of the probability density function (PDF) for a gamma distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {number} evaluated logPDF
	*
	* @example
	* var y = logpdf( -1.2 );
	* // returns <number>
	*/
	function logpdf( x ) {
		if ( isnan( x ) ) {
			return NaN;
		}
		if ( x < 0.0 || x === PINF ) {
			return NINF;
		}
		return ln( gammaDeriv( alpha, x * beta ) ) + ln( beta );
	}
}
Returns a function for evaluating the logarithm of the probability density function (PDF) for a gamma distribution with shape parameter `alpha` and rate parameter `beta`.

@param {NonNegativeNumber} alpha - shape parameter
@param {PositiveNumber} beta - rate parameter
@returns {Function} logPDF

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

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

y = logpdf( 4.0 );
// returns ~-2.704