lib/index.js
/**
* FUNCTION: quantile( p[, opts] )
*	Evaluates the quantile function for a Student t distribution.
*
* @param {Number|Number[]|Array|Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|Matrix} p - input value
* @param {Object} [opts] - function options
* @param {Number} [opts.v=1] - degrees of freedom
* @param {Boolean} [opts.copy=true] - boolean indicating if the function should return a new data structure
* @param {Function} [opts.accessor] - accessor function for accessing array values
* @param {String} [opts.path] - deep get/set key path
* @param {String} [opts.sep="."] - deep get/set key path separator
* @param {String} [opts.dtype="float64"] - output data type
* @returns {Number|Number[]|Array|Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|Matrix} quantile function value(s)
*/
quantile( p[, opts] )
Evaluates the quantile function for a Student t distribution.
quantile ( p [ opts ] ) Evaluates the quantile function for a Student t distribution .
function quantile( p, options ) {
	var opts = {},
		ctor,
		err,
		out,
		dt,
		d;
	if ( arguments.length > 1 ) {
		err = validate( opts, options );
		if ( err ) {
			throw err;
		}
	}
	opts.v = typeof opts.v !== 'undefined' ? opts.v : 1;
	if ( isNumber( p ) ) {
		return quantile1( p, opts.v );
	}
	if ( isMatrixLike( p ) ) {
		if ( opts.copy !== false ) {
			dt = opts.dtype || 'float64';
			ctor = ctors( dt );
			if ( ctor === null ) {
				throw new Error( 'quantile()::invalid option. Data type option does not have a corresponding array constructor. Option: `' + dt + '`.' );
			}
			d = new ctor( p.length );
			out = matrix( d, p.shape, dt );
		} else {
			out = p;
		}
		return quantile5( out, p, opts.v );
	}
	if ( isTypedArrayLike( p ) ) {
		if ( opts.copy === false ) {
			out = p;
		} else {
			dt = opts.dtype || 'float64';
			ctor = ctors( dt );
			if ( ctor === null ) {
				throw new Error( 'quantile()::invalid option. Data type option does not have a corresponding array constructor. Option: `' + dt + '`.' );
			}
			out = new ctor( p.length );
		}
		return quantile6( out, p, opts.v );
	}
	if ( isArrayLike( p ) ) {
		if ( opts.path ) {
			opts.sep = opts.sep || '.';
			return quantile4( p, opts.v, opts.path, opts.sep );
		}
		if ( opts.copy === false ) {
			out = p;
		}
		else if ( opts.dtype ) {
			ctor = ctors( opts.dtype );
			if ( ctor === null ) {
				throw new TypeError( 'quantile()::invalid option. Data type option does not have a corresponding array constructor. Option: `' + opts.dtype + '`.' );
			}
			out = new ctor( p.length );
		}
		else {
			out = new Array( p.length );
		}
		if ( opts.accessor ) {
			return quantile3( out, p, opts.v, opts.accessor );
		}
		return quantile2( out, p, opts.v );
	}
	return NaN;
} 
function quantile ( p , options ) { var opts = { } , ctor , err , out , dt , d ; if ( arguments . length > 1 ) { err = validate ( opts , options ) ; if ( err ) { throw err ; } } opts . v = typeof opts . v !== 'undefined' ? opts . v : 1 ; if ( isNumber ( p ) ) { return quantile1 ( p , opts . v ) ; } if ( isMatrixLike ( p ) ) { if ( opts . copy !== false ) { dt = opts . dtype || 'float64' ; ctor = ctors ( dt ) ; if ( ctor === null ) { throw new Error ( 'quantile()::invalid option. Data type option does not have a corresponding array constructor. Option: `' + dt + '`.' ) ; } d = new ctor ( p . length ) ; out = matrix ( d , p . shape , dt ) ; } else { out = p ; } return quantile5 ( out , p , opts . v ) ; } if ( isTypedArrayLike ( p ) ) { if ( opts . copy === false ) { out = p ; } else { dt = opts . dtype || 'float64' ; ctor = ctors ( dt ) ; if ( ctor === null ) { throw new Error ( 'quantile()::invalid option. Data type option does not have a corresponding array constructor. Option: `' + dt + '`.' ) ; } out = new ctor ( p . length ) ; } return quantile6 ( out , p , opts . v ) ; } if ( isArrayLike ( p ) ) { if ( opts . path ) { opts . sep = opts . sep || '.' ; return quantile4 ( p , opts . v , opts . path , opts . sep ) ; } if ( opts . copy === false ) { out = p ; } else if ( opts . dtype ) { ctor = ctors ( opts . dtype ) ; if ( ctor === null ) { throw new TypeError ( 'quantile()::invalid option. Data type option does not have a corresponding array constructor. Option: `' + opts . dtype + '`.' ) ; } out = new ctor ( p . length ) ; } else { out = new Array ( p . length ) ; } if ( opts . accessor ) { return quantile3 ( out , p , opts . v , opts . accessor ) ; } return quantile2 ( out , p , opts . v ) ; } return NaN ; }
FUNCTION: quantile( p[, opts] )
Evaluates the quantile function for a Student t distribution.
FUNCTION : quantile ( p [ opts ] ) Evaluates the quantile function for a Student t distribution .
/* jshint newcap:false */ // Create an output matrix: // Handle deepset first... // Handle regular and accessor arrays next... // end FUNCTION quantile()