function factory( p ) {
	if (
		isnan( p ) ||
		p < 0.0 ||
		p > 1.0
	) {
		return constantFunction( NaN );
	}
	return pmf;

	/**
	* Evaluates the probability mass function (PMF) for a geometric distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {Probability} evaluated PMF
	*
	* @example
	* var y = pmf( 2.0 );
	* // returns <number>
	*/
	function pmf( x ) {
		var q;
		if ( isnan( x ) ) {
			return NaN;
		}
		if ( isNonNegativeInteger( x ) ) {
			q = 1.0 - p;
			return p * pow( q, x );
		}
		return 0.0;
	}
}
Returns a function for evaluating the probability mass function (PMF) for a geometric distribution with success probability `p`.

@param {Probability} p - success probability
@returns {Function} PMF

@example
var pmf = factory( 0.5 );
var y = pmf( 3.0 );
// returns 0.0625

y = pmf( 1.0 );
// returns 0.25