statistical.js

"use strict";
/***************************************************
* Licensed Materials - Property of HCL.
* (c)Copyright HCL America, Inc. 2023-2024
****************************************************/
Object.defineProperty(exports, "__esModule", { value: true });
exports.maxA = exports.logNorm = exports.logest = exports.linest = exports.large = exports.kurt = exports.intercept = exports.hypGeom = exports.harMean = exports.growth = exports.geoMean = exports.gauss = exports.gammaLn = exports.gamma = exports.frequency = exports.forecast = exports.fisherInv = exports.fisher = exports.f = exports.exponDist = exports.expon = exports.devSq = exports.coVariance = exports.countUnique = exports.countIfs = exports.countIf = exports.countBlank = exports.countIn = exports.countA = exports.count = exports.correl = exports.confidenceT = exports.confidenceNorm = exports.confidence = exports.chiSqTest = exports.chiSqInvRt = exports.chiSqInv = exports.chiSqDistRt = exports.chiSqDist = exports.chiSq = exports.binomInv = exports.binomDistRange = exports.binom = exports.beta = exports.averageIfs = exports.averageIf = exports.averageA = exports.average = exports.aveDev = exports._openFormula = void 0;
exports.z = exports.weiBull = exports.varPA = exports.varA = exports.Var = exports.trimMean = exports.trend = exports.tInv2T = exports.tDist2T = exports.t = exports.steyx = exports.stDevPA = exports.stDevA = exports.stDev = exports.standardize = exports.small = exports.slope = exports.skew = exports.rsq = exports.rank = exports.quartile = exports.prob = exports.poisson = exports.phi = exports.permutationA = exports.permut = exports.percentRank = exports.percentile = exports.pearson = exports.norm = exports.negBinom = exports.mode = exports.minA = exports.median = void 0;
const tslib_1 = require("tslib");
/**
 * @file Statistical
 * @module statistical
 * @category Statistical
 */
const openf = tslib_1.__importStar(require("../openformula/statistical"));
exports._openFormula = openf;
const notes_list = tslib_1.__importStar(require("../notes/lists"));
const API = tslib_1.__importStar(require("../rosetta/API"));
const error = tslib_1.__importStar(require("../utils/error"));
/**
 * Returns the average of the absolute deviations of data points from their mean.
 * @param {number} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want the average of the absolute deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.
 * @returns {number} the average of the absolute deviations of data points from their mean or an error.
 */
function aveDev(...numbers) {
    return openf.AVEDEV(...numbers);
}
exports.aveDev = aveDev;
/**
 * Returns the average of its arguments.
 * @param {number} args number1, number2, ...Numbers, value references or ranges for which you want the average.
 * @returns {number} the average of the arguments
 */
function average(...numbers) {
    return openf.AVERAGE(...numbers);
}
exports.average = average;
/**
 * Returns the average of its arguments, including numbers, text, and logical values.
 * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values, ranges of values, or values for which you want the average.
 * @returns {number} the average of its arguments, including numbers, text, and logical values.
 */
function averageA(...values) {
    return openf.AVERAGEA(...values);
}
exports.averageA = averageA;
/**
 * Returns the average (arithmetic mean) of all the values in a range that meet a given criteria.
 * @param {*} range One or more values to average, including numbers or names, arrays, or references that contain numbers.
 * @param {string} criteria The criteria in the form of a number, expression, value reference, or text that defines which values are averaged.
 * @param {*} average_range Optional. The actual set of values to average. If omitted, range is used.
 * @returns {number} the average (arithmetic mean) of all the values in a range that meet a given criteria.
 */
function averageIf(range, criteria, average_range) {
    if (arguments.length <= 1) {
        return error.na;
    }
    return openf.AVERAGEIF(range, criteria, average_range);
}
exports.averageIf = averageIf;
/**
 * Returns the average (arithmetic mean) of all values that meet multiple criteria.
 * @param {*} args One or more values to average, including numbers or names, arrays, or references that contain numbers.
 * @returns {number} the average (arithmetic mean) of all values that meet multiple criteria.
 */
function averageIfs(...values) {
    return openf.AVERAGEIFS(...values);
}
exports.averageIfs = averageIfs;
/** @class */
exports.beta = {
    /**
     * Returns the beta cumulative distribution function.
     * @param {number} x The value between A and B at which to evaluate the function
     * @param {number} alpha A parameter of the distribution.
     * @param {number} beta A parameter of the distribution.
     * @param {boolean} cumulative A logical value that determines the form of the function. If cumulative is TRUE, BETA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.
     * @param {number} a Optional. A lower bound to the interval of x.
     * @param {number} b Optional. An upper bound to the interval of x.
     * @returns {number} the beta cumulative distribution function or an error if the arguments are incorrect.
     */
    dist: function (x, alpha, beta, cumulative, a, b) {
        if (arguments.length < 4) {
            return error.value;
        }
        return openf.BETA.DIST(x, alpha, beta, cumulative, a, b);
    },
    /**
     * Returns the inverse of the cumulative distribution function for a specified beta distribution.
     * @param {number} probability A probability associated with the beta distribution.
     * @param {number} alpha A parameter of the distribution.
     * @param {number} beta A parameter the distribution.
     * @param {number} a Optional. A lower bound to the interval of x.
     * @param {number} b Optional. An upper bound to the interval of x.
     * @returns {number} the inverse of the cumulative distribution function for a specified beta distribution or an error if the arguments are incorrect.
     */
    inv: function (probability, alpha, beta, a, b) {
        return openf.BETA.INV(probability, alpha, beta, a, b);
    }
};
/** @class */
exports.binom = {};
/**
 * Returns the individual term binomial distribution probability.
 * @param {number} number_s The number of successes in trials.
 * @param {number} trials The number of independent trials.
 * @param {number} probability_s The probability of success on each trial.
 * @param {boolean} cumulative A logical value that determines the form of the function. If cumulative is TRUE, then BINOM.DIST returns the cumulative distribution function, which is the probability that there are at most number_s successes; if FALSE, it returns the probability mass function, which is the probability that there are number_s successes.
 * @returns {number} the individual term binomial distribution probability as number or an error if the arguments are incorrect.
 */
exports.binom.dist = function (number_s, trials, probability_s, cumulative) {
    return openf.BINOM.DIST(number_s, trials, probability_s, cumulative);
};
/**
 * Returns the probability of a trial result using a binomial distribution.
 * @param {number} trials The number of independent trials. Must be greater than or equal to 0.
 * @param {number} probability_s The probability of success in each trial. Must be greater than or equal to 0 and less than or equal to 1.
 * @param {number} number_s The number of successes in trials. Must be greater than or equal to 0 and less than or equal to Trials.
 * @param {number} number_s2 Optional. If provided, returns the probability that the number of successful trials will fall between Number_s and number_s2. Must be greater than or equal to Number_s and less than or equal to Trials.
 * @returns {number} the probability of a trial result using a binomial distribution.
 */
exports.binom.dist.range = function (trials, probability_s, number_s, number_s2) {
    return openf.BINOM.DIST.RANGE(trials, probability_s, number_s, number_s2);
};
/** @see binom.dist.range */
exports.binomDistRange = exports.binom.dist.range;
/**
 * Returns the smallest value for which the cumulative binomial distribution is less than or equal to a criterion value.
 * @param {number} trials The number of Bernoulli trials.
 * @param {number} probability_s The probability of a success on each trial.
 * @param {number} alpha The criterion value.
 * @returns {number} the smallest value for which the cumulative binomial distribution is less than or equal to a criterion value or an error if the arguments are incorrect.
 */
exports.binom.inv = function (trials, probability_s, alpha) {
    return openf.BINOM.INV(trials, probability_s, alpha);
};
/** @see binom.inv */
exports.binomInv = exports.binom.inv;
/** @class */
exports.chiSq = {};
/**
 * Returns the cumulative beta probability density function.
 * @param {number} x The value at which you want to evaluate the distribution.
 * @param {number} deg_freedom The number of degrees of freedom.
 * @param {boolean} cumulative A logical value that determines the form of the function. If cumulative is TRUE, CHISQ.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.
 * @returns {number} The values for a χ2-distribution.
 */
exports.chiSq.dist = function (x, deg_freedom, cumulative) {
    return openf.CHISQ.DIST(x, deg_freedom, cumulative);
};
/** @see chiSq.dist */
exports.chiSqDist = exports.chiSq.dist;
/**
 * Returns the one-tailed probability of the chi-squared distribution.
 * @param {number} x The value at which you want to evaluate the distribution.
 * @param {number} deg_freedom The number of degrees of freedom.
 * @returns {number} the value of x in the cdf of the Chi Square distribution.
 */
exports.chiSq.dist.rt = function (x, deg_freedom) {
    return openf.CHISQ.DIST.RT(x, deg_freedom);
};
/** @see chiSq.dist.rt */
exports.chiSqDistRt = exports.chiSq.dist.rt;
/**
 * Returns the cumulative beta probability density function.
 * @param {number} probability A probability associated with the chi-squared distribution.
 * @param {number} deg_freedom The number of degrees of freedom.
 * @returns {number} the inverse of the CHISQDIST function.
 */
exports.chiSq.inv = function (probability, deg_freedom) {
    return openf.CHISQ.INV(probability, deg_freedom);
};
/** @see chiSq.inv */
exports.chiSqInv = exports.chiSq.inv;
/**
 * Returns the inverse of the one-tailed probability of the chi-squared distribution.
 * @param {number} probability A probability associated with the chi-squared distribution.
 * @param {number} deg_freedom The number of degrees of freedom.
 * @returns {number} the value of x in the inverse of the cdf for the Chi Square distribution.
 */
exports.chiSq.inv.rt = function (probability, deg_freedom) {
    return openf.CHISQ.INV.RT(probability, deg_freedom);
};
/** @see chiSq.inv.rt */
exports.chiSqInvRt = exports.chiSq.inv.rt;
/**
 * Returns the test for independence.
 * @param {*} actual_range The range of data that contains observations to test against expected values.
 * @param {*} expected_range The range of data that contains the ratio of the product of row totals and column totals to the grand total.
 * @returns {number} the test for independence.
 */
exports.chiSq.test = function (actual_range, expected_range) {
    if (arguments.length !== 2) {
        return error.na;
    }
    return openf.CHISQ.TEST(actual_range, expected_range);
};
/** @see chiSq.test */
exports.chiSqTest = exports.chiSq.test;
/** @class */
exports.confidence = {
    /**
     * Returns the confidence interval for a population mean.
     * @param {number} alpha The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.
     * @param {number} standard_dev The population standard deviation for the data range and is assumed to be known.
     * @param {number} size The sample size.
     * @returns {number | Error} Returns a 1-_alpha_ confidence interval for value given a normal distribution with a standard deviation and a sample size
     */
    norm: function (alpha, standard_dev, size) {
        return openf.CONFIDENCE.NORM(alpha, standard_dev, size);
    },
    /**
     * Returns the confidence interval for a population mean, using a Student's t distribution.
     * @param {number} alpha The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.
     * @param {number} standard_dev The population standard deviation for the data range and is assumed to be known.
     * @param {number} size The sample size.
     * @returns {number | Error} Returns a 1-alpha confidence interval for value given the standard deviation and the sample size.
     */
    t: function (alpha, standard_dev, size) {
        return openf.CONFIDENCE.T(alpha, standard_dev, size);
    }
};
/** @see confidence.norm */
exports.confidenceNorm = exports.confidence.norm;
/** @see confidence.t */
exports.confidenceT = exports.confidence.t;
/**
 * Returns the correlation coefficient between two data sets.
 * @param {number[]} array1 A range of value values.
 * @param {number[]} array2 A second range of value values.
 * @returns {number | Error} Returns the population correlation coefficient of the _array1_ and _array2_ vectors (Pearson's Rho).
 */
function correl(array1, array2) {
    return openf.CORREL(array1, array2);
}
exports.correl = correl;
/**
 * When using the Open Formula implementation, counts how many numbers are in the list of arguments.
 * When using the Notes Formula implementation, calculates the number of text, number, or time-date values in a list.
 * @param {*} values Cell reference, or range within which you want to count numbers.
 * @returns {number} how many numbers are in the list of arguments.
 * or when using the Open Formula implementation see &nbsp;{@link https://www.oasis-open.org/committees/download.php/16826/openformula-spec-20060221.html#COUNT|www.oasis-open.org}
 * @example
 * rosettajs.Statistical.count(1,2,3); // Returns 3
 * @example
 * rosettajs.Statistical.count(["Jones", "Portsmore"]); // Returns 2
 */
function count(...values) {
    let input = values;
    if (API.isCurrentAPIOpenFormula()) {
        return openf.COUNT(...input);
    }
    else {
        if (values.length === 1) {
            if (Array.isArray(values[0])) {
                input = values[0]; // Notes will pass in multiple values as an array
            }
        }
        else if (values.length === 0) {
            input = undefined; // not parameter specified (spread operator will turn this into array with empty string)
        }
        return notes_list.Count(input);
    }
}
exports.count = count;
/**
 * Counts how many values are in the list of arguments.
 * @param {*} args Arguments representing the values that you want to count.
 * @returns {number} how many values are in the list of arguments
 */
function countA(...values) {
    return openf.COUNTA(...values);
}
exports.countA = countA;
/**
 * Counts the number of occurrences of a value in a given range.
 *
 * Category: Statistical
 *
 * @param {*} range
 * @param {*} value
 * @returns {number} the number of occurrences of a value in a given range.
 *
 */
function countIn(range, value) {
    return openf.COUNTIN(range, value);
}
exports.countIn = countIn;
/**
 * Counts the number of blank values within a range.
 * @param {number} values The range from which you want to count the blank values.
 * @returns {number} the number of blank values within a range.
 */
function countBlank(...values) {
    return openf.COUNTBLANK(...values);
}
exports.countBlank = countBlank;
/**
 * Counts the number of values within a range that meet the given criteria.
 * @param {*} range The values to check
 * @param {string} criteria The criteria to apply to each value in _range_
 * @returns {number} The number of values in _range_ that meet _criteria_
 */
function countIf(range, criteria) {
    return openf.COUNTIF(range, criteria);
}
exports.countIf = countIf;
/**
 * Counts the number of values within a range that meet multiple criteria.
 * @param {*} valuesAndCriteria Range in which to evaluate the associated criteria.
 * @returns {number} the number of values within a range that meet multiple criteria
 */
function countIfs(...valuesAndCriteria) {
    return openf.COUNTIFS(...valuesAndCriteria);
}
exports.countIfs = countIfs;
/**
 * Returns the number of unique items in a flattened array
 * Formula.js only
 *
 * @param {*} values The array or multiple arrays to be examined.
 *
 * @returns {number} the number of unique items in a flattened array
 */
function countUnique(...values) {
    return openf.COUNTUNIQUE(...values);
}
exports.countUnique = countUnique;
/** @class */
exports.coVariance = {
    /**
   * Returns covariance, the average of the products of paired deviations.
   * @param {number} array1 The first value range of integers.
   * @param {number} array2 The second value range of integers.
   * @returns {number} covariance, the average of the products of paired deviations or an error if the arguments are incorrect.
   */
    p: function (array1, array2) {
        return openf.COVARIANCE.P(array1, array2);
    },
    /**
   * Returns the sample covariance, the average of the products deviations for each data point pair in two data sets.
   * @param {number} array1 The first value range of integers.
   * @param {number} array2 The second value range of integers.
   * @returns {number|Error} Returns the covariance of the _array1_ and _array2_ vectors.
   */
    s: function (array1, array2) {
        return openf.COVARIANCE.S(array1, array2);
    }
};
/**
 * Returns the sum of squares of deviations.
 * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the sum of squared deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.
 * @returns {number} the sum of squares of deviations or an error if the arguments are incorrect.
 */
function devSq(...numbers) {
    return openf.DEVSQ(...numbers);
}
exports.devSq = devSq;
/** @class */
exports.expon = {};
/**
 * Returns the exponential distribution.
 * @param {number} x The value of the function.
 * @param {number} lambda The parameter value.
 * @param {boolean} cumulative A logical value that indicates which form of the exponential function to provide. If cumulative is TRUE, EXPON.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.
 * @returns {number} the exponential distribution or an error if the arguments are incorrect.
 */
exports.expon.dist = function (x, lambda, cumulative) {
    return openf.EXPON.DIST(x, lambda, cumulative);
};
/** @see expon.dist */
exports.exponDist = exports.expon.dist;
/** @class */
exports.f = {};
/**
 * Returns the F probability distribution.
 * @param {number} x The value at which to evaluate the function.
 * @param {number} deg_freedom1 The numerator degrees of freedom.
 * @param {number} deg_freedom2 The denominator degrees of freedom.
 * @param {boolean} cumulative A logical value that determines the form of the function. If cumulative is TRUE, F.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.
 * @returns {number} the F probability distribution or an error if the arguments are incorrect.
 */
exports.f.dist = function (x, deg_freedom1, deg_freedom2, cumulative) {
    return openf.F.DIST(x, deg_freedom1, deg_freedom2, cumulative);
};
/**
 * Returns the F probability distribution.
 * @param {number} x The value at which to evaluate the function.
 * @param {number} deg_freedom1 The numerator degrees of freedom.
 * @param {number} deg_freedom2 The denominator degrees of freedom.
 * @returns {number} the F probability distribution or an error if the arguments are incorrect.
 */
exports.f.dist.rt = function (x, deg_freedom1, deg_freedom2) {
    if (arguments.length !== 3) {
        return error.na;
    }
    return openf.F.DIST.RT(x, deg_freedom1, deg_freedom2);
};
/**
 * Returns the inverse of the F probability distribution.
 * @param {number} probability A probability associated with the F cumulative distribution.
 * @param {number} deg_freedom1 The numerator degrees of freedom.
 * @param {number} deg_freedom2 The denominator degrees of freedom.
 * @returns {number} the inverse of the F probability distribution or an error if the arguments are incorrect.
 */
exports.f.inv = function (probability, deg_freedom1, deg_freedom2) {
    return openf.F.INV(probability, deg_freedom1, deg_freedom2);
};
/**
 * Returns the inverse of the F probability distribution.
 * @param {number} probability A probability associated with the F cumulative distribution.
 * @param {number} deg_freedom1 The numerator degrees of freedom.
 * @param {number} deg_freedom2 The denominator degrees of freedom.
 * @returns {number} the inverse of the F probability distribution or an error if the arguments are incorrect.
 */
exports.f.inv.rt = function (probability, deg_freedom1, deg_freedom2) {
    if (arguments.length !== 3) {
        return error.na;
    }
    return openf.F.INV.RT(probability, deg_freedom1, deg_freedom2);
};
/**
 * Returns the result of an F-test.
 * @param {number} array1 The first array or range of data.
 * @param {number} array2 The second array or range of data.
 * @returns {number} the result of an F test or an error if the arguments are incorrect.
 */
exports.f.test = function (array1, array2) {
    return openf.F.TEST(array1, array2);
};
/**
 * Returns the Fisher transformation.
 * @param {number} x A numeric value for which you want the transformation.
 * @returns {number} the Fisher transformation for a given number, or an error if the arguments are incorrect.
 */
function fisher(x) {
    return openf.FISHER(x);
}
exports.fisher = fisher;
/**
 * Returns the inverse of the Fisher transformation.
 * @param {number} y The value for which you want to perform the inverse of the transformation.
 * @returns {number | Error} the inverse of the Fisher transformation.
 */
function fisherInv(y) {
    return openf.FISHERINV(y);
}
exports.fisherInv = fisherInv;
/**
 * Returns a value along a linear trend.
 * @param {number} x The data point for which you want to predict a value.
 * @param {number} known_ys The dependent array or range of data.
 * @param {number} known_xs The independent array or range of data.
 * @returns {number} a value along a linear trend or an error if the arguments are incorrect.
 */
function forecast(x, known_ys, known_xs) {
    return openf.FORECAST(x, known_ys, known_xs);
}
exports.forecast = forecast;
/**
 * Returns a frequency distribution as a vertical array.
 * @param {number} data_array An array of or reference to a set of values for which you want to count frequencies. If data_array contains no values, FREQUENCY returns an array of zeros.
 * @param {number} bins_array An array of or reference to intervals into which you want to group the values in data_array. If bins_array contains no values, FREQUENCY returns the number of elements in data_array.
 * @returns {number} a frequency distribution as a vertical array or an error if the arguments are incorrect.
 */
function frequency(data_array, bins_array) {
    return openf.FREQUENCY(data_array, bins_array);
}
exports.frequency = frequency;
/**
 * @class
 * Returns the Gamma function value.
 * @param {number} number Returns a number.
 * @returns {number} the Gamma function value or an error if the arguments are incorrect.
 */
function gamma(number) {
    return openf.GAMMA(number);
}
exports.gamma = gamma;
/**
 * Returns the gamma distribution.
 * @param {number} value The value at which you want to evaluate the distribution.
 * @param {number} alpha A parameter to the distribution.
 * @param {number} beta A parameter to the distribution. If beta = 1, GAMMA.DIST returns the standard gamma distribution.
 * @param {boolean} cumulative A logical value that determines the form of the function. If cumulative is TRUE, GAMMA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.
 * @returns {number} the gamma distribution or an error if the arguments are incorrect.
 */
gamma.dist = function (value, alpha, beta, cumulative) {
    if (arguments.length !== 4) {
        return error.na;
    }
    return openf.GAMMA.DIST(value, alpha, beta, cumulative);
};
/**
 * Returns the inverse of the gamma cumulative distribution.
 * @param {number} probability The probability associated with the gamma distribution.
 * @param {number} alpha A parameter to the distribution.
 * @param {number} beta A parameter to the distribution. If beta = 1, GAMMA.INV returns the standard gamma distribution.
 * @returns {number} the inverse of the gamma cumulative distribution or an error if the arguments are incorrect.
 */
gamma.inv = function (probability, alpha, beta) {
    if (arguments.length !== 3) {
        return error.na;
    }
    return openf.GAMMA.INV(probability, alpha, beta);
};
/**
 * @class
 * Returns the natural logarithm of the gamma function, Γ(x).
 * @param {number} x The value for which you want to calculate GAMMALN.
 * @returns {number} the natural logarithm of the gamma function, Γ(x), or an error if the arguments are incorrect
 */
function gammaLn(x) {
    return openf.GAMMALN(x);
}
exports.gammaLn = gammaLn;
/**
 * Returns the natural logarithm of the gamma function, Γ(x).
 * @param {number} x The value for which you want to calculate GAMMALN.PRECISE.
 * @returns {number} the natural logarithm of the gamma function, Γ(x), or an error if the arguments are incorrect.
 */
gammaLn.precise = function (x) {
    if (arguments.length !== 1) {
        return error.na;
    }
    return openf.GAMMALN.PRECISE(x);
};
/**
 * Returns 0.5 less than the standard normal cumulative distribution.
 * @param {number} z Returns a number.
 * @returns {number} 0.5 less than the standard normal cumulative districubtion or an error if the arguments are incorrect.
 */
function gauss(z) {
    return openf.GAUSS(z);
}
exports.gauss = gauss;
/**
 * Returns the geometric mean.
 * @param {number} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.
 * @returns {number} the geometric mean or an error if the arguments are incorrect.
 */
function geoMean(...values) {
    return openf.GEOMEAN(...values);
}
exports.geoMean = geoMean;
/**
 * Returns values along an exponential trend.
 * @param {number} known_y The set of y-values you already know in the relationship y = b*m^x.
 - If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.
 - If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.
 - If any of the numbers in known_y's is 0 or negative, GROWTH returns the #NUM! error value.
 * @param {number} known_x Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.
 - The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).
 - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.
 * @param {number} new_x Optional. Are new x-values for which you want GROWTH to return corresponding y-values.
 - new_x's must include a column (or row) for each independent variable, just as known_x's does. So, if known_y's is in a single column, known_x's and new_x's must have the same number of columns. If known_y's is in a single row, known_x's and new_x's must have the same number of rows.
 - If new_x's is omitted, it is assumed to be the same as known_x's.
 - If both known_x's and new_x's are omitted, they are assumed to be the array {1,2,3,...} that is the same size as known_y's.
 * @param {boolean} use_const Optional. A logical value specifying whether to force the constant b to equal 1. If const is TRUE or omitted, b is calculated normally. If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.
 - If const is TRUE or omitted, b is calculated normally.
 - If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.
 * @returns {number} values along an exponential trend or an error if the arguments are incorrect.
 */
function growth(known_y, known_x, new_x, use_const) {
    return openf.GROWTH(known_y, known_x, new_x, use_const);
}
exports.growth = growth;
/**
 * Returns the harmonic mean.
 * @param {number} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.
 * @returns {number} the harmonic mean or an error if the arguments are incorrect.
 */
function harMean(...values) {
    return openf.HARMEAN(...values);
}
exports.harMean = harMean;
/**
 * Returns the hypergeometric distribution.
 * @param {number} sample_s The number of successes in the sample.
 * @param {number} number_sample The size of the sample.
 * @param {number} population_s The number of successes in the population.
 * @param {number} number_pop The population size.
 * @param {boolean} cumulative A logical value that determines the form of the function. If cumulative is TRUE, then HYPGEOM.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.
 * @returns {number} the hypergeometric distribution or an error if the arguments are incorrect.
 */
exports.hypGeom = {
    dist: function (sample_s, number_sample, population_s, number_pop, cumulative) {
        return openf.HYPGEOM.DIST(sample_s, number_sample, population_s, number_pop, cumulative);
    }
};
/**
 * Returns the intercept of the linear regression line.
 * @param {number} known_y The dependent set of observations or data.
 * @param {number} known_x The independent set of observations or data.
 * @returns the intercept of the linear regression line.
 */
function intercept(known_y, known_x) {
    return openf.INTERCEPT(known_y, known_x);
}
exports.intercept = intercept;
/**
 * Returns the kurtosis of a data set.
 * @param {number} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate kurtosis. You can also use a single array or a reference to an array instead of arguments separated by commas.
 * @returns {number} the kurtosis of a data set or an error if the arguments are incorrect.
 */
function kurt(...values) {
    return openf.KURT(...values);
}
exports.kurt = kurt;
/**
* Returns the k-th largest value in a data set.
* @param {number} array The array or range of data for which you want to determine the k-th largest value.
* @param {number} k The position (from the largest) in the array or value range of data to return.
* @returns the k-th largest value in a data set or an error if the arguments are incorrect.
* */
function large(array, k) {
    return openf.LARGE(array, k);
}
exports.large = large;
/**
 * Returns the parameters of a linear trend.
 * @param {number} known_y The set of y-values that you already know in the relationship y = mx + b.
 - If the range of known_y's is in a single column, each column of known_x's is interpreted as a separate variable.
 - If the range of known_y's is contained in a single row, each row of known_x's is interpreted as a separate variable.
 * @param {number} known_x Optional. A set of x-values that you may already know in the relationship y = mx + b.
 - The range of known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).
 - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.
 * @returns {number} the parameters of a linear trend or an error if the arguments are incorrect.
 */
function linest(known_y, known_x) {
    return openf.LINEST(known_y, known_x);
}
exports.linest = linest;
// According to Microsoft:
// http://office.microsoft.com/en-us/starter-help/logest-function-HP010342665.aspx
// LOGEST returns are based on the following linear model:
// ln y = x1 ln m1 + ... + xn ln mn + ln b
/**
 * Returns the parameters of an exponential trend.
 * @param {number} known_y The set of y-values you already know in the relationship y = b*m^x.
 - If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.
 - If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.
 * @param {number} known_x Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.
 - The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a range of values with a height of one row or a width of one column (which is also known as a vector).
 - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.
 * @returns the parameters of an exponential trend or an error if the arguments are incorrect.
 */
function logest(known_y, known_x) {
    return openf.LOGEST(known_y, known_x);
}
exports.logest = logest;
/** @class */
exports.logNorm = {
    /**
     * Returns the cumulative lognormal distribution.
     * @param {number} x The value at which to evaluate the function.
     * @param {number} mean The mean of ln(x).
     * @param {number} standard_dev The standard deviation of ln(x).
     * @param {boolean} cumulative A logical value that determines the form of the function. If cumulative is TRUE, LOGNORM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.
     * @returns the cumulative lognormal distribution or an error if the arguments are incorrect.
     */
    dist: function (x, mean, standard_dev, cumulative) {
        return openf.LOGNORM.DIST(x, mean, standard_dev, cumulative);
    },
    /**
     * Returns the inverse of the lognormal cumulative distribution.
     * @param {number} probability A probability associated with the lognormal distribution.
     * @param {number} mean The mean of ln(x).
     * @param {number} standard_dev The standard deviation of ln(x).
     * @returns the inverse of the lognormal cumulative distribution or an error if the arguments are incorrect.
     */
    inv: function (probability, mean, standard_dev) {
        return openf.LOGNORM.INV(probability, mean, standard_dev);
    }
};
/**
 * Returns the maximum value in a list of arguments, including numbers, text, and logical values.
 * @param {number} args value1, value2,... Number arguments 2 to 255 for which you want to find the largest value.
 * @returns {number} the maximum value in a list of arguments, including numbers, text, and logical values.
 */
function maxA(...values) {
    return openf.MAXA(...values);
}
exports.maxA = maxA;
/**
 * Returns the median of the given numbers.
 * @param {number} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want the median.
 * @returns {number} the median of the given numbers or an error if the arguments are incorrect.
 */
function median(...values) {
    return openf.MEDIAN(...values);
}
exports.median = median;
/**
 * Returns the smallest value in a list of arguments, including numbers, text, and logical values.
 * @param {number} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values for which you want to find the smallest value.
 * @returns {number} the smallest value in a list of arguments, including numbers, text, and logical values.
 */
function minA(...values) {
    return openf.MINA(...values);
}
exports.minA = minA;
/** @class */
exports.mode = {
    /**
     * Returns a vertical array of the most frequently occurring, or repetitive values in an array or range of data.
     * @param {mumber} values number1, number2, ... Number arguments 2 to 254 for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.
     * @returns {number} a vertical array of the most frequently occurring, or repetitive values in an array or range of data or an error if the arguments are incorrect.
     */
    mult: function (...values) {
        return openf.MODE.MULT(...values);
    },
    /**
     * Returns the most common value in a data set.
     * @param {number[]} values number1, number2, ... Arguments 2 to 254 for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.
     * @returns {number | Error} the most common value in a data set or an error if the arguments are incorrect.
     */
    sngl: function (...values) {
        return openf.MODE.SNGL(...values);
    }
};
/**
   * Returns the negative binomial distribution.
   * @param {number} number_f The number of failures.
   * @param {number} number_s The threshold number of successes.
   * @param {number} probability_s The probability of a success.
   * @param {boolean} cumulative A logical value that determines the form of the function. If cumulative is TRUE, NEGBINOM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.
   * @returns {number} the negative binomial distribution or an error if the arguments are incorrect.
   */
exports.negBinom = {
    dist: function (number_f, number_s, probability_s, cumulative) {
        return openf.NEGBINOM.DIST(number_f, number_s, probability_s, cumulative);
    }
};
/** @class */
exports.norm = {
    /**
     * Returns the normal cumulative distribution.
     * @param {number} x The value for which you want the distribution.
     * @param {number} mean The arithmetic mean of the distribution.
     * @param {number} standard_dev The standard deviation of the distribution.
     * @param {boolean} cumulative A logical value that determines the form of the function. If cumulative is TRUE, NORM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.
     * @returns {number} the normal cumulative distribution or an error if the arguments are incorrect.
     */
    dist: function (x, mean, standard_dev, cumulative) {
        return openf.NORM.DIST(x, mean, standard_dev, cumulative);
    },
    /**
     * Returns the inverse of the normal cumulative distribution.
     * @param {number} probability A probability corresponding to the normal distribution.
     * @param {number} mean The arithmetic mean of the distribution.
     * @param {number} standard_dev The standard deviation of the distribution.
     * @returns {number} the inverse of the normal cumulative distribution or an error if the arguments are incorrect.
     */
    inv: function (probability, mean, standard_dev) {
        return openf.NORM.INV(probability, mean, standard_dev);
    },
    s: {
        /**
         * Returns the standard normal cumulative distribution.
         *
         * Category: Statistical
         *
         * @param {number} z The value for which you want the distribution.
         * @param {boolean} cumulative Cumulative is a logical value that determines the form of the function. If cumulative is TRUE, NORMS.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.
         * @returns {number} the standard normal cumulative distribution or an error if the arguments are incorrect.
         */
        dist: function (z, cumulative) {
            return openf.NORM.S.DIST(z, cumulative);
        },
        /**
         * Returns the inverse of the standard normal cumulative distribution.
         *
         * Category: Statistical
         *
         * @param {number} probability A probability corresponding to the normal distribution.
         * @returns {number} the inverse of the standard normal cumulative distribution or an error if the arguments are incorrect.
         */
        inv: function (probability) {
            return openf.NORM.S.INV(probability);
        }
    }
};
/**
 * Returns the Pearson product moment correlation coefficient.
 * @param {number[]} array1 A set of independent values.
 * @param {number[]} array2 A set of dependent values.
 * @returns {number} the Pearson product moment correlation coefficient or an error if the arguments are incorrect.
 */
function pearson(array1, array2) {
    return openf.PEARSON(array1, array2);
}
exports.pearson = pearson;
/** @class */
exports.percentile = {
    /**
     * Returns the k-th percentile of values in a range, where k is in the range 0..1, exclusive.
     * @param {number[]} array The array or range of data that defines relative standing.
     * @param {number} k The percentile value in the range 0..1, exclusive.
     * @returns {number} the k-th percentile of values in a range, where k is in the range 0..1, exclusive or an error if the arguments aer incorrect.
     */
    exc: function (array, k) {
        return openf.PERCENTILE.EXC(array, k);
    },
    /**
     * Returns the k-th percentile of values in a range.
     * @param {number[]} array The array or range of data that defines relative standing.
     * @param {number} k The percentile value in the range 0..1, inclusive.
     * @returns {number} the k-th percentile of values in a range or an error if the arguments are incorrect.
     */
    inc: function (array, k) {
        return openf.PERCENTILE.INC(array, k);
    }
};
/** @class */
exports.percentRank = {
    /**
     * Returns the rank of a value in a data set as a percentage (0..1, exclusive) of the data set.
     * @param {number[]} array The array or range of data with numeric values that defines relative standing
     * @param {number} x The value for which you want to know the rank.
     * @param {number} significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK.EXC uses three digits (0.xxx).
     * @returns {number} the rank of a value in a data set as a percentage (0..1, exclusive) of the data set or an error if the arguments are incorrect.
     */
    exc: function (array, x, significance) {
        return openf.PERCENTRANK.EXC(array, x, significance);
    },
    /**
     * Returns the percentage rank of a value in a data set.
     * @param {number[]} array The array or range of data with numeric values that defines relative standing.
     * @param {number} x The value for which you want to know the rank.
     * @param {number} significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK.INC uses three digits (0.xxx).
     * @returns {number} the percentage rank of a value in a data set or an error if the arguments are incorrect.
     */
    inc: function (array, x, significance) {
        return openf.PERCENTRANK.INC(array, x, significance);
    }
};
/**
 * Returns the number of permutations for a given number of objects.
 * @param {number} number An integer that describes the number of objects.
 * @param {number} number_chosen An integer that describes the number of objects in each permutation.
 * @returns {number} the number of permutations for a given number of objects or an error if the arguments are incorrect.
 */
function permut(number, number_chosen) {
    return openf.PERMUT(number, number_chosen);
}
exports.permut = permut;
/**
 * Returns the number of permutations for a given number of objects (with repetitions) that can be selected from the total objects.
 * @param {number} number An integer that describes the total number of objects.
 * @param {number} number_chosen An integer that describes the number of objects in each permutation.
 * @returns {number} the number of permutations for a given number of objects (with repetitions) that can be selected from the total objects or an error if the arguments are incorrect.
 */
function permutationA(number, number_chosen) {
    return openf.PERMUTATIONA(number, number_chosen);
}
exports.permutationA = permutationA;
/**
 * Returns the value of the density function for a standard normal distribution.
 * @param {number} x X is the number for which you want the density of the standard normal distribution.
 * @returns {number} the value of the density function for a standard normal distribution or an error if the argument is incorrect.
 */
function phi(x) {
    return openf.PHI(x);
}
exports.phi = phi;
/** @class */
exports.poisson = {
    /**
     * Returns the Poisson distribution.
     * @param {number} x The number of events.
     * @param {number} mean The expected numeric value.
     * @param {boolean} cumulative A logical value that determines the form of the probability distribution returned. If cumulative is TRUE, POISSON.DIST returns the cumulative Poisson probability that the number of random events occurring will be between zero and x inclusive; if FALSE, it returns the Poisson probability mass function that the number of events occurring will be exactly x.
     * @returns {number} the Poisson distribution or an error if the arguments are incorrect.
     */
    dist: function (x, mean, cumulative) {
        return openf.POISSON.DIST(x, mean, cumulative);
    }
};
/**
 * Returns the probability that values in a range are between two limits.
 * @param {number[]} x_range The range of numeric values of x with which there are associated probabilities.
 * @param {number[]} prob_range A set of probabilities associated with values in x_range.
 * @param {number} lower_limit Optional. The lower bound on the value for which you want a probability.
 * @param {number} upper_limit Optional. The optional upper bound on the value for which you want a probability.
 * @returns {number} the probability that values in a range are between two limits.
 */
function prob(x_range, prob_range, lower_limit, upper_limit) {
    return openf.PROB(x_range, prob_range, lower_limit, upper_limit);
}
exports.prob = prob;
/** @class */
exports.quartile = {
    /**
     * Returns the quartile of the data set, based on percentile values from 0..1, exclusive.
     * @param {number[]} range The array or value range of numeric values for which you want the quartile value.
     * @param {number} quart Indicates which value to return.
     * @returns {number} the quartile of the data set, based on percentile values from 0..1, exclusive or an error if the arguments are wrong.
     */
    exc: function (range, quart) {
        return openf.QUARTILE.EXC(range, quart);
    },
    /**
     * Returns the quartile of a data set.
     * @param {number[]} range The array or value range of numeric values for which you want the quartile value.
     * @param {number} quart Indicates which value to return.
     * @returns {number} the quartile of a data set or an error if the arguments are incorrect.
     */
    inc: function (range, quart) {
        return openf.QUARTILE.INC(range, quart);
    }
};
/** @class */
exports.rank = {
    /**
     * Returns the rank of a number in a list of numbers.
     * @param {number} number The number whose rank you want to find.
     * @param {number[]} ref An array of, or a reference to, a list of numbers. Nonnumeric values in Ref are ignored.
     * @param {boolean} order Optional. A number specifying how to rank number.
     * @returns {number} the rank of a number in a list of numbers or an error if the arguments are incorrect.
     */
    avg: function (number, ref, order) {
        return openf.RANK.AVG(number, ref, order);
    },
    /**
     * Returns the rank of a number in a list of numbers.
     * @param {number} number The number whose rank you want to find.
     * @param {number[]} ref An array of, or a reference to, a list of numbers. Non-numeric values in Ref are ignored.
     * @param {boolean} order Optional. A number specifying how to rank number.
     * @returns {number} the rank of a number in a list of numbers or an error if the arguments are incorrect.
     */
    eq: function (number, ref, order) {
        return openf.RANK.EQ(number, ref, order);
    }
};
/**
 * Returns the square of the Pearson product moment correlation coefficient.
 * @param {number[]} known_y An array or range of data points.
 * @param {number[]} known_x An array or range of data points.
 * @returns {number} the square of the Pearson product moment correlation coefficient or an error if the arguments are inforrect.
 */
function rsq(known_y, known_x) {
    return openf.RSQ(known_y, known_x);
}
exports.rsq = rsq;
/**
 * Returns the skewness of a distribution.
 * @param {number[]} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate skewness. You can also use a single array or a reference to an array instead of arguments separated by commas.
 * @returns {number} the skewness of a distribution or an error if the arguments are incorrect.
 */
function skew(...values) {
    return openf.SKEW(...values);
}
exports.skew = skew;
/**
 * Returns the skewness of a distribution based on a population.
 * @param {number[]} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate skewness. You can also use a single array or a reference to an array instead of arguments separated by commas.
 * @returns {number} the skewness of a distribution based on a population or an error if the arguments are wrong.
 */
skew.p = function (...values) {
    return openf.SKEW.P(...values);
};
/**
 * Returns the slope of the linear regression line.
 * @param {number[]} known_y An array or value range of numeric dependent data points.
 * @param {number[]} known_x The set of independent data points.
 * @returns {number} the slope of the linear regression line or an error if the arguments are incorrect.
 */
function slope(known_y, known_x) {
    return openf.SLOPE(known_y, known_x);
}
exports.slope = slope;
/**
 * Returns the k-th smallest value in a data set.
 * @param {number[]} array An array or range of numerical data for which you want to determine the k-th smallest value.
 * @param {number} k The position (from the smallest) in the array or range of data to return.
 * @returns {number} the k-th smallest value in a data set or an error if the arguments are incorrect.
 */
function small(array, k) {
    return openf.SMALL(array, k);
}
exports.small = small;
/**
 * Returns a normalized value.
 * @param {number} x The value you want to normalize.
 * @param {number} mean The arithmetic mean of the distribution.
 * @param {number} standard_dev The standard deviation of the distribution.
 * @returns {number}a normalized value or an error if the arguments are incorrect.
 */
function standardize(x, mean, standard_dev) {
    return openf.STANDARDIZE(x, mean, standard_dev);
}
exports.standardize = standardize;
/**
 * @class
 * Estimates standard deviation based on a sample.
 */
exports.stDev = {
    /**
     * Calculates standard deviation based on the entire population.
     * @param {number[]} args number1, number2, ... Number arguments 2 to 254 corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.
     * @returns {number} standard deviation based on the entire population or an error.
     */
    p: function (...args) {
        return openf.STDEV.P(...args);
    },
    /**
     * Estimates standard deviation based on a sample.
     * @param {number[]} args number1, number2, ... Number arguments 2 to 254 corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.
     * @returns {number} Estimated standard deviation based on a sample or an error
     */
    s: function (...args) {
        return openf.STDEV.S(...args);
    }
};
/**
 * Estimates standard deviation based on a sample, including numbers, text, and logical values.
 * @param {number[]} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.
 * @returns {number} Estimated standard deviation based on a sample, including numbers, text, and logical values or an error.
 */
function stDevA(...args) {
    return openf.STDEVA(...args);
}
exports.stDevA = stDevA;
/**
 * Calculates standard deviation based on the entire population, including numbers, text, and logical values.
 * @param {number[]} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.
 * @returns {number} Calculated standard deviation based on the entire population, including numbers, text, and logical values or an error.
 */
function stDevPA(...args) {
    return openf.STDEVPA(...args);
}
exports.stDevPA = stDevPA;
/**
 * Returns the standard error of the predicted y-value for each x in the regression.
 * @param {number[]} known_y An array or range of dependent data points.
 * @param {number[]} known_x An array or range of independent data points.
 * @returns {number} the standard error of the predicted y-value for each x in the regression or an error if the arguments are incorrect.
 */
function steyx(known_y, known_x) {
    return openf.STEYX(known_y, known_x);
}
exports.steyx = steyx;
/** @class */
exports.t = {};
/**
 * Returns the Percentage Points (probability) for the Student t-distribution.
 * @param {number} x The numeric value at which to evaluate the distribution
 * @param {number} deg_freedom An integer indicating the number of degrees of freedom.
 * @param {number} cumulative A number that determines the form of the function. If cumulative is 1, T.DIST returns the cumulative distribution function; if 2, it returns the probability density function.
 * @returns {number} the Percentage Points (probability) for the Student t-distribution or an error.
 */
exports.t.dist = function (x, deg_freedom, cumulative) {
    return openf.T.DIST(x, deg_freedom, cumulative);
};
/**
 * Returns the Percentage Points (probability) for the Student t-distribution
 * @param {number} x The numeric value at which to evaluate the distribution.
 * @param {number} deg_freedom An integer indicating the number of degrees of freedom.
 * @returns {number} the Percentage Points (probability) for the Student t-distribution  or an error if the arguments are incorrect.
 */
exports.t.dist['2T'] = function (x, deg_freedom) {
    if (arguments.length !== 2) {
        return error.na;
    }
    return openf.T.DIST['2T'](x, deg_freedom);
};
/** @see t.dist */
exports.tDist2T = exports.t.dist['2T'];
/**
 * Returns the Student's t-distribution.
 * @param {number} x The numeric value at which to evaluate the distribution.
 * @param {number} deg_freedom An integer indicating the number of degrees of freedom.
 * @returns {number} the Student's t-distribution or an error if the arguments are incorrect.
 */
exports.t.dist.rt = function (x, deg_freedom) {
    if (arguments.length !== 2) {
        return error.na;
    }
    return openf.T.DIST.RT(x, deg_freedom);
};
/**
 * Returns the t-value of the Student's t-distribution as a function of the probability and the degrees of freedom.
 * @param {number} probability The probability associated with the Student's t-distribution.
 * @param {number} deg_freedom The number of degrees of freedom with which to characterize the distribution.
 * @returns {number} the t-value of the Student's t-distribution as a function of the probability and the degrees of freedom or an error if the arguments are incorrect.
 */
exports.t.inv = function (probability, deg_freedom) {
    return openf.T.INV(probability, deg_freedom);
};
/**
 * Returns the inverse of the Student's t-distribution
 * @param {number} probability The probability associated with the Student's t-distribution.
 * @param {number} deg_freedom The number of degrees of freedom with which to characterize the distribution.
 * @returns {number} the inverse of the Student's t-distribution or and error if the arguments are incorrect.
 */
exports.t.inv['2T'] = function (probability, deg_freedom) {
    return openf.T.INV['2T'](probability, deg_freedom);
};
/** @see t.inv */
exports.tInv2T = exports.t.inv['2T'];
/**
 * Returns the probability associated with a Student's t-test.
 * The algorithm can be found here: http://www.chem.uoa.gr/applets/AppletTtest/Appl_Ttest2.html
 * @param {number[]} array1 The first data set.
 * @param {number[]} array2 The second data set.
 * @returns {number} the probability associated with a Student's t-test or an error if the arguments are incorrect.
 */
exports.t.test = function (array1, array2) {
    return openf.T.TEST(array1, array2);
};
/**
 * Returns values along a linear trend.
 * @param {number[]} known_ys The set of y-values you already know in the relationship y = mx + b
 * @param {number[]} known_xs An optional set of x-values that you may already know in the relationship y = mx + b
 * @param {number[]} new_xs Optional. New x-values for which you want TREND to return corresponding y-values.
 * @returns {number[]} values along a linear trend or an error if the arguments are incorrect.
 */
function trend(known_ys, known_xs, new_xs) {
    return openf.TREND(known_ys, known_xs, new_xs);
}
exports.trend = trend;
/**
 * Returns the mean of the interior of a data set.
 * @param {number[]} range The array or range of values to trim and average.
 * @param {number} percent The fractional number of data points to exclude from the calculation. For example, if percent = 0.2, 4 points are trimmed from a data set of 20 points (20 x 0.2): 2 from the top and 2 from the bottom of the set.
 * @returns {number} the mean of the interior of a data set or an error if the arguments are incorrect.
 */
function trimMean(range, percent) {
    return openf.TRIMMEAN(range, percent);
}
exports.trimMean = trimMean;
// This function name is capitalized because it will conflict witha JS keyword var. 
/**
 * @class
 * Compute the sample variance of a set of numbers.
*/
exports.Var = {};
/**
* Calculates variance based on the entire population.
* @param {number[]} args number1, number2, ... Number arguments 2 to 254 corresponding to a population.
* @returns {number} Calculates variance based on the entire population or an error if the arguments are incorrect.
*/
exports.Var.p = function (...args) {
    return openf.VAR.P(...args);
};
/**
* Estimates variance based on a sample.
* @param {number[]} args number1, number2, ... Number arguments 2 to 254 corresponding to a sample of a population.
* @returns {number} Estimates variance based on a sample.
*/
exports.Var.s = function (...args) {
    return openf.VAR.S(...args);
};
/**
 * Estimates variance based on a sample, including numbers, text, and logical values.
 * @param {number[]} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a sample of a population.
 * @returns {number} Estimated variance based on a sample, including numbers, text, and logical values.
 */
function varA(...args) {
    return openf.VARA(...args);
}
exports.varA = varA;
/**
 * Calculates variance based on the entire population, including numbers, text, and logical values.
 * @param {number[]} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a population.
 * @returns {number} Calculated variance based on the entire population, including numbers, text, and logical values
 */
function varPA(...args) {
    return openf.VARPA(...args);
}
exports.varPA = varPA;
/** @class */
exports.weiBull = {
    /**
     * Returns the Weibull distribution.
     * @param {number} x The value at which to evaluate the function.
     * @param {number} alpha A parameter to the distribution.
     * @param {number} beta A parameter to the distribution.
     * @param {number} cumulative Determines the form of the function.
     * @returns {number} the Weibull distribution or an error if the arguments are incorrect.
     */
    dist: function (x, alpha, beta, cumulative) {
        return openf.WEIBULL.DIST(x, alpha, beta, cumulative);
    }
};
/** @class */
exports.z = {
    /**
     * Returns the one-tailed probability-value of a z-test.
     * @param {number[]} array The array or range of data against which to test x.
     * @param {number} x The value to test.
     * @param {number} sigma Optional. The population (known) standard deviation. If omitted, the sample standard deviation is used.
     * @returns {number} the one-tailed probability-value of a z-test or an error if the argumnts are incorrect.
     */
    test: function (array, x, sigma) {
        return openf.Z.TEST(array, x, sigma);
    }
};
//# sourceMappingURL=statistical.js.map