'use strict';

// MODULES //

var gammaFactory = require( '@stdlib/math/base/dist/gamma/pdf' ).factory;


// MAIN //

/**
* Returns a function for evaluating the probability density function (PDF) for a chi-squared distribution with degrees of freedom `k`.
*
* @param {NonNegativeNumber} k - degrees of freedom
* @returns {Function} PDF
*
* @example
* var pdf = factory( 0.5 );
* var y = pdf( 2.0 );
* // returns ~0.051
* y = pdf( 1.0 );
* // returns ~0.141
*/
function factory( k ) {
	return gammaFactory( k / 2, 0.5 );
} // end FUNCTION factory()


// EXPORTS //

module.exports = factory;

'use strict';

// MODULES //

var gammaFactory = require( '@stdlib/math/base/dist/gamma/pdf' ).factory;


// MAIN //

/**
* Returns a function for evaluating the probability density function (PDF) for a chi-squared distribution with degrees of freedom `k`.
*
* @param {NonNegativeNumber} k - degrees of freedom
* @returns {Function} PDF
*
* @example
* var pdf = factory( 0.5 );
*
* var y = pdf( 2.0 );
* // returns ~0.051
*
* y = pdf( 1.0 );
* // returns ~0.141
*/
function factory( k ) {
	return gammaFactory( k/2.0, 0.5 );
} // end FUNCTION factory()


// EXPORTS //

module.exports = factory;

Insert newlines and add decimal point
Insert newlines and add decimal point
