@stdlib/stats-base-dists-f-ctor
Version:
F distribution constructor.
135 lines (116 loc) • 2.69 kB
TypeScript
/*
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// TypeScript Version: 4.1
/**
* F distribution.
*/
declare class F {
/**
* F distribution constructor.
*
* @param d1 - numerator degrees of freedom (default: 1.0)
* @param d2 - denominator degrees of freedom (default: 1.0)
* @throws `d1` must be a positive number
* @throws `d2` must be a positive number
* @returns distribution instance
*
* @example
* var f = new F( 1.0, 1.0 );
*
* var y = f.cdf( 0.8 );
* // returns ~0.465
*
* var v = f.mode;
* // returns NaN
*/
constructor( d1: number, d2: number );
/**
* F distribution constructor.
*
* @returns distribution instance
*
* @example
* var f = new F();
*
* var y = f.cdf( 0.8 );
* // returns ~0.465
*
* var v = f.mode;
* // returns NaN
*/
constructor();
/**
* Numerator degrees of freedom. If set, the value must be greater than `0`.
*/
d1: number;
/**
* Denominator degrees of freedom. If set, the value must be greater than `0`.
*/
d2: number;
/**
* Read-only property which returns the differential entropy.
*/
readonly entropy: number;
/**
* Read-only property which returns the excess kurtosis.
*/
readonly kurtosis: number;
/**
* Read-only property which returns the expected value.
*/
readonly mean: number;
/**
* Read-only property which returns the mode.
*/
readonly mode: number;
/**
* Read-only property which returns the skewness.
*/
readonly skewness: number;
/**
* Read-only property which returns the standard deviation.
*/
readonly stdev: number;
/**
* Read-only property which returns the variance.
*/
readonly variance: number;
/**
* Evaluates the cumulative distribution function (CDF).
*
* @param x - input value
* @returns evaluated CDF
*/
cdf( x: number ): number;
/**
* Evaluates the probability density function (PDF).
*
* @param x - input value
* @returns evaluated PDF
*/
pdf( x: number ): number;
/**
* Evaluates the quantile function at probability `p`.
*
* @param p - input probability
* @returns evaluated quantile function
*/
quantile( p: number ): number;
}
// EXPORTS //
export = F;