function NegativeBinomial() {
	var r;
	var p;
	if ( !(this instanceof NegativeBinomial) ) {
		if ( arguments.length === 0 ) {
			return new NegativeBinomial();
		}
		return new NegativeBinomial( arguments[ 0 ], arguments[ 1 ] );
	}
	if ( arguments.length ) {
		r = arguments[ 0 ];
		p = arguments[ 1 ];
		if ( !isPositive( r ) ) {
			throw new TypeError( format( 'invalid argument. Number of trials until experiment is stopped must be a positive number. Value: `%s`.', r ) );
		}
		if ( !isProbability( p ) ) {
			throw new TypeError( format( 'invalid argument. Success probability must be a number between 0 and 1. Value: `%s`.', p ) );
		}
	} else {
		r = 1.0;
		p = 0.5;
	}
	defineProperty( this, 'r', {
		'configurable': false,
		'enumerable': true,
		'get': function get() {
			return r;
		},
		'set': function set( value ) {
			if ( !isPositive( value ) ) {
				throw new TypeError( format( 'invalid assignment. Must be a positive number. Value: `%s`.', value ) );
			}
			r = value;
		}
	});
	defineProperty( this, 'p', {
		'configurable': false,
		'enumerable': true,
		'get': function get() {
			return p;
		},
		'set': function set( value ) {
			if ( !isProbability( value ) ) {
				throw new TypeError( format( 'invalid assignment. Must be a number on the interval: [0, 1]. Value: `%s`.', value ) );
			}
			p = value;
		}
	});
	return this;
}
Negative binomial distribution constructor.

@constructor
@param {PositiveNumber} [r=1.0] - number of successes until experiment is stopped
@param {Probability} [p=0.5] - success probability
@throws {TypeError} `r` must be a positive number
@throws {TypeError} `p` must be a number between 0 and 1
@returns {NegativeBinomial} distribution instance

@example
var nbinomial = new NegativeBinomial( 5.0, 0.1 );

var y = nbinomial.cdf( 10.0 );
// returns ~0.013

var v = nbinomial.mode;
// returns 36.0