hyperformula-dc
Version:
HyperFormula is a JavaScript engine for efficient processing of spreadsheet-like data and formulas
1,092 lines (1,040 loc) • 33.3 kB
JavaScript
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
require("core-js/modules/es.reflect.construct.js");
require("core-js/modules/es.symbol.js");
require("core-js/modules/es.symbol.description.js");
require("core-js/modules/es.object.to-string.js");
require("core-js/modules/es.symbol.iterator.js");
require("core-js/modules/es.array.iterator.js");
require("core-js/modules/es.string.iterator.js");
require("core-js/modules/web.dom-collections.iterator.js");
exports.__esModule = true;
exports.StatisticalPlugin = void 0;
require("core-js/modules/es.math.trunc.js");
require("core-js/modules/es.object.get-prototype-of.js");
var _Cell = require("../../Cell");
var _errorMessage = require("../../error-message");
var _bessel = require("./3rdparty/bessel/bessel");
var _jstat = require("./3rdparty/jstat/jstat");
var _FunctionPlugin2 = require("./FunctionPlugin");
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var StatisticalPlugin = /*#__PURE__*/function (_FunctionPlugin) {
_inherits(StatisticalPlugin, _FunctionPlugin);
var _super = _createSuper(StatisticalPlugin);
function StatisticalPlugin() {
_classCallCheck(this, StatisticalPlugin);
return _super.apply(this, arguments);
}
_createClass(StatisticalPlugin, [{
key: "erf",
value: function erf(ast, state) {
return this.runFunction(ast.args, state, this.metadata('ERF'), function (lowerBound, upperBound) {
if (upperBound === undefined) {
return (0, _jstat.erf)(lowerBound);
} else {
return (0, _jstat.erf)(upperBound) - (0, _jstat.erf)(lowerBound);
}
});
}
}, {
key: "erfc",
value: function erfc(ast, state) {
return this.runFunction(ast.args, state, this.metadata('ERFC'), _jstat.erfc);
}
}, {
key: "expondist",
value: function expondist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('EXPON.DIST'), function (x, lambda, cumulative) {
if (cumulative) {
return _jstat.exponential.cdf(x, lambda);
} else {
return _jstat.exponential.pdf(x, lambda);
}
});
}
}, {
key: "fisher",
value: function fisher(ast, state) {
return this.runFunction(ast.args, state, this.metadata('FISHER'), function (x) {
return Math.log((1 + x) / (1 - x)) / 2;
});
}
}, {
key: "fisherinv",
value: function fisherinv(ast, state) {
return this.runFunction(ast.args, state, this.metadata('FISHERINV'), function (y) {
return 1 - 2 / (Math.exp(2 * y) + 1);
});
}
}, {
key: "gamma",
value: function gamma(ast, state) {
return this.runFunction(ast.args, state, this.metadata('GAMMA'), _jstat.gammafn);
}
}, {
key: "gammadist",
value: function gammadist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('GAMMA.DIST'), function (value, alphaVal, betaVal, cumulative) {
if (cumulative) {
return _jstat.gamma.cdf(value, alphaVal, betaVal);
} else {
return _jstat.gamma.pdf(value, alphaVal, betaVal);
}
});
}
}, {
key: "gammaln",
value: function gammaln(ast, state) {
return this.runFunction(ast.args, state, this.metadata('GAMMALN'), _jstat.gammaln);
}
}, {
key: "gammainv",
value: function gammainv(ast, state) {
return this.runFunction(ast.args, state, this.metadata('GAMMA.INV'), _jstat.gamma.inv);
}
}, {
key: "gauss",
value: function gauss(ast, state) {
return this.runFunction(ast.args, state, this.metadata('GAUSS'), function (z) {
return _jstat.normal.cdf(z, 0, 1) - 0.5;
});
}
}, {
key: "betadist",
value: function betadist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('BETA.DIST'), function (x, alphaVal, betaVal, cumulative, A, B) {
if (x <= A) {
return new _Cell.CellError(_Cell.ErrorType.NUM, _errorMessage.ErrorMessage.ValueSmall);
} else if (x >= B) {
return new _Cell.CellError(_Cell.ErrorType.NUM, _errorMessage.ErrorMessage.ValueLarge);
}
x = (x - A) / (B - A);
if (cumulative) {
return _jstat.beta.cdf(x, alphaVal, betaVal);
} else {
return _jstat.beta.pdf(x, alphaVal, betaVal);
}
});
}
}, {
key: "betainv",
value: function betainv(ast, state) {
return this.runFunction(ast.args, state, this.metadata('BETA.INV'), function (x, alphaVal, betaVal, A, B) {
if (A >= B) {
return new _Cell.CellError(_Cell.ErrorType.NUM, _errorMessage.ErrorMessage.WrongOrder);
} else {
return _jstat.beta.inv(x, alphaVal, betaVal) * (B - A) + A;
}
});
}
}, {
key: "binomialdist",
value: function binomialdist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('BINOM.DIST'), function (succ, trials, prob, cumulative) {
if (succ > trials) {
return new _Cell.CellError(_Cell.ErrorType.NUM, _errorMessage.ErrorMessage.WrongOrder);
}
succ = Math.trunc(succ);
trials = Math.trunc(trials);
if (cumulative) {
return _jstat.binomial.cdf(succ, trials, prob);
} else {
return _jstat.binomial.pdf(succ, trials, prob);
}
});
}
}, {
key: "binomialinv",
value: function binomialinv(ast, state) {
return this.runFunction(ast.args, state, this.metadata('BINOM.INV'), function (trials, prob, alpha) {
trials = Math.trunc(trials);
var lower = -1;
var upper = trials;
while (upper > lower + 1) {
var mid = Math.trunc((lower + upper) / 2);
if (_jstat.binomial.cdf(mid, trials, prob) >= alpha) {
upper = mid;
} else {
lower = mid;
}
}
return upper;
});
}
}, {
key: "besselifn",
value: function besselifn(ast, state) {
return this.runFunction(ast.args, state, this.metadata('BESSELI'), function (x, n) {
return (0, _bessel.besseli)(x, Math.trunc(n));
});
}
}, {
key: "besseljfn",
value: function besseljfn(ast, state) {
return this.runFunction(ast.args, state, this.metadata('BESSELJ'), function (x, n) {
return (0, _bessel.besselj)(x, Math.trunc(n));
});
}
}, {
key: "besselkfn",
value: function besselkfn(ast, state) {
return this.runFunction(ast.args, state, this.metadata('BESSELK'), function (x, n) {
return (0, _bessel.besselk)(x, Math.trunc(n));
});
}
}, {
key: "besselyfn",
value: function besselyfn(ast, state) {
return this.runFunction(ast.args, state, this.metadata('BESSELY'), function (x, n) {
return (0, _bessel.bessely)(x, Math.trunc(n));
});
}
}, {
key: "chisqdist",
value: function chisqdist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('CHISQ.DIST'), function (x, deg, cumulative) {
deg = Math.trunc(deg);
if (cumulative) {
return _jstat.chisquare.cdf(x, deg);
} else {
return _jstat.chisquare.pdf(x, deg);
}
});
}
}, {
key: "chisqdistrt",
value: function chisqdistrt(ast, state) {
return this.runFunction(ast.args, state, this.metadata('CHISQ.DIST.RT'), function (x, deg) {
return 1 - _jstat.chisquare.cdf(x, Math.trunc(deg));
});
}
}, {
key: "chisqinv",
value: function chisqinv(ast, state) {
return this.runFunction(ast.args, state, this.metadata('CHISQ.INV'), function (p, deg) {
return _jstat.chisquare.inv(p, Math.trunc(deg));
});
}
}, {
key: "chisqinvrt",
value: function chisqinvrt(ast, state) {
return this.runFunction(ast.args, state, this.metadata('CHISQ.INV.RT'), function (p, deg) {
return _jstat.chisquare.inv(1.0 - p, Math.trunc(deg));
});
}
}, {
key: "fdist",
value: function fdist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('F.DIST'), function (x, deg1, deg2, cumulative) {
deg1 = Math.trunc(deg1);
deg2 = Math.trunc(deg2);
if (cumulative) {
return _jstat.centralF.cdf(x, deg1, deg2);
} else {
return _jstat.centralF.pdf(x, deg1, deg2);
}
});
}
}, {
key: "fdistrt",
value: function fdistrt(ast, state) {
return this.runFunction(ast.args, state, this.metadata('F.DIST.RT'), function (x, deg1, deg2) {
return 1 - _jstat.centralF.cdf(x, Math.trunc(deg1), Math.trunc(deg2));
});
}
}, {
key: "finv",
value: function finv(ast, state) {
return this.runFunction(ast.args, state, this.metadata('F.INV'), function (p, deg1, deg2) {
return _jstat.centralF.inv(p, Math.trunc(deg1), Math.trunc(deg2));
});
}
}, {
key: "finvrt",
value: function finvrt(ast, state) {
return this.runFunction(ast.args, state, this.metadata('F.INV.RT'), function (p, deg1, deg2) {
return _jstat.centralF.inv(1.0 - p, Math.trunc(deg1), Math.trunc(deg2));
});
}
}, {
key: "weibulldist",
value: function weibulldist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('WEIBULL.DIST'), function (x, shape, scale, cumulative) {
if (cumulative) {
return _jstat.weibull.cdf(x, scale, shape);
} else {
return _jstat.weibull.pdf(x, scale, shape);
}
});
}
}, {
key: "poissondist",
value: function poissondist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('POISSON.DIST'), function (x, mean, cumulative) {
x = Math.trunc(x);
if (cumulative) {
return _jstat.poisson.cdf(x, mean);
} else {
return _jstat.poisson.pdf(x, mean);
}
});
}
}, {
key: "hypgeomdist",
value: function hypgeomdist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('HYPGEOM.DIST'), function (s, numberS, populationS, numberPop, cumulative) {
if (s > numberS || s > populationS || numberS > numberPop || populationS > numberPop) {
return new _Cell.CellError(_Cell.ErrorType.NUM, _errorMessage.ErrorMessage.ValueLarge);
}
if (s + numberPop < populationS + numberS) {
return new _Cell.CellError(_Cell.ErrorType.NUM, _errorMessage.ErrorMessage.ValueLarge);
}
s = Math.trunc(s);
numberS = Math.trunc(numberS);
populationS = Math.trunc(populationS);
numberPop = Math.trunc(numberPop);
if (cumulative) {
return _jstat.hypgeom.cdf(s, numberPop, populationS, numberS);
} else {
return _jstat.hypgeom.pdf(s, numberPop, populationS, numberS);
}
});
}
}, {
key: "tdist",
value: function tdist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('T.DIST'), function (x, deg, cumulative) {
deg = Math.trunc(deg);
if (cumulative) {
return _jstat.studentt.cdf(x, deg);
} else {
return _jstat.studentt.pdf(x, deg);
}
});
}
}, {
key: "tdist2t",
value: function tdist2t(ast, state) {
return this.runFunction(ast.args, state, this.metadata('T.DIST.2T'), function (x, deg) {
return (1 - _jstat.studentt.cdf(x, Math.trunc(deg))) * 2;
});
}
}, {
key: "tdistrt",
value: function tdistrt(ast, state) {
return this.runFunction(ast.args, state, this.metadata('T.DIST.RT'), function (x, deg) {
return 1 - _jstat.studentt.cdf(x, Math.trunc(deg));
});
}
}, {
key: "tdistold",
value: function tdistold(ast, state) {
return this.runFunction(ast.args, state, this.metadata('TDIST'), function (x, deg, mode) {
return mode * (1 - _jstat.studentt.cdf(x, Math.trunc(deg)));
});
}
}, {
key: "tinv",
value: function tinv(ast, state) {
return this.runFunction(ast.args, state, this.metadata('T.INV'), function (p, deg) {
return _jstat.studentt.inv(p, Math.trunc(deg));
});
}
}, {
key: "tinv2t",
value: function tinv2t(ast, state) {
return this.runFunction(ast.args, state, this.metadata('T.INV.2T'), function (p, deg) {
return _jstat.studentt.inv(1 - p / 2, Math.trunc(deg));
});
}
}, {
key: "lognormdist",
value: function lognormdist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('LOGNORM.DIST'), function (x, mean, stddev, cumulative) {
if (cumulative) {
return _jstat.lognormal.cdf(x, mean, stddev);
} else {
return _jstat.lognormal.pdf(x, mean, stddev);
}
});
}
}, {
key: "lognorminv",
value: function lognorminv(ast, state) {
return this.runFunction(ast.args, state, this.metadata('LOGNORM.INV'), function (p, mean, stddev) {
return _jstat.lognormal.inv(p, mean, stddev);
});
}
}, {
key: "normdist",
value: function normdist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('NORM.DIST'), function (x, mean, stddev, cumulative) {
if (cumulative) {
return _jstat.normal.cdf(x, mean, stddev);
} else {
return _jstat.normal.pdf(x, mean, stddev);
}
});
}
}, {
key: "norminv",
value: function norminv(ast, state) {
return this.runFunction(ast.args, state, this.metadata('NORM.INV'), function (p, mean, stddev) {
return _jstat.normal.inv(p, mean, stddev);
});
}
}, {
key: "normsdist",
value: function normsdist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('NORM.S.DIST'), function (x, cumulative) {
if (cumulative) {
return _jstat.normal.cdf(x, 0, 1);
} else {
return _jstat.normal.pdf(x, 0, 1);
}
});
}
}, {
key: "normsinv",
value: function normsinv(ast, state) {
return this.runFunction(ast.args, state, this.metadata('NORM.S.INV'), function (p) {
return _jstat.normal.inv(p, 0, 1);
});
}
}, {
key: "phi",
value: function phi(ast, state) {
return this.runFunction(ast.args, state, this.metadata('PHI'), function (x) {
return _jstat.normal.pdf(x, 0, 1);
});
}
}, {
key: "negbinomdist",
value: function negbinomdist(ast, state) {
return this.runFunction(ast.args, state, this.metadata('NEGBINOM.DIST'), function (nf, ns, p, cumulative) {
nf = Math.trunc(nf);
ns = Math.trunc(ns);
if (cumulative) {
return _jstat.negbin.cdf(nf, ns, p);
} else {
return _jstat.negbin.pdf(nf, ns, p);
}
});
}
}, {
key: "confidencenorm",
value: function confidencenorm(ast, state) {
return this.runFunction(ast.args, state, this.metadata('CONFIDENCE.NORM'), // eslint-disable-next-line
// @ts-ignore
function (alpha, stddev, size) {
return (0, _jstat.normalci)(1, alpha, stddev, Math.trunc(size))[1] - 1;
});
}
}, {
key: "confidencet",
value: function confidencet(ast, state) {
return this.runFunction(ast.args, state, this.metadata('CONFIDENCE.T'), function (alpha, stddev, size) {
size = Math.trunc(size);
if (size === 1) {
return new _Cell.CellError(_Cell.ErrorType.DIV_BY_ZERO);
} // eslint-disable-next-line
// @ts-ignore
return (0, _jstat.tci)(1, alpha, stddev, size)[1] - 1;
});
}
}, {
key: "standardize",
value: function standardize(ast, state) {
return this.runFunction(ast.args, state, this.metadata('STANDARDIZE'), function (x, mean, stddev) {
return (x - mean) / stddev;
});
}
}]);
return StatisticalPlugin;
}(_FunctionPlugin2.FunctionPlugin);
exports.StatisticalPlugin = StatisticalPlugin;
StatisticalPlugin.implementedFunctions = {
'ERF': {
method: 'erf',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
optionalArg: true
}]
},
'ERFC': {
method: 'erfc',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}]
},
'EXPON.DIST': {
method: 'expondist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'FISHER': {
method: 'fisher',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: -1,
lessThan: 1
}]
},
'FISHERINV': {
method: 'fisherinv',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}]
},
'GAMMA': {
method: 'gamma',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}]
},
'GAMMA.DIST': {
method: 'gammadist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'GAMMALN': {
method: 'gammaln',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}]
},
'GAMMA.INV': {
method: 'gammainv',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0,
lessThan: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}]
},
'GAUSS': {
method: 'gauss',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}]
},
'BETA.DIST': {
method: 'betadist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
defaultValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
defaultValue: 1
}]
},
'BETA.INV': {
method: 'betainv',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0,
maxValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
defaultValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
defaultValue: 1
}]
},
'BINOM.DIST': {
method: 'binomialdist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0,
maxValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'BINOM.INV': {
method: 'binomialinv',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0,
maxValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0,
lessThan: 1
}]
},
'BESSELI': {
method: 'besselifn',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}]
},
'BESSELJ': {
method: 'besseljfn',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}]
},
'BESSELK': {
method: 'besselkfn',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}]
},
'BESSELY': {
method: 'besselyfn',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}]
},
'CHISQ.DIST': {
method: 'chisqdist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1,
maxValue: 1e10
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'CHISQ.DIST.RT': {
method: 'chisqdistrt',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1,
maxValue: 1e10
}]
},
'CHISQ.INV': {
method: 'chisqinv',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0,
maxValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1,
maxValue: 1e10
}]
},
'CHISQ.INV.RT': {
method: 'chisqinvrt',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0,
maxValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}]
},
'F.DIST': {
method: 'fdist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'F.DIST.RT': {
method: 'fdistrt',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}]
},
'F.INV': {
method: 'finv',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0,
maxValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}]
},
'F.INV.RT': {
method: 'finvrt',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0,
maxValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}]
},
'WEIBULL.DIST': {
method: 'weibulldist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'POISSON.DIST': {
method: 'poissondist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'HYPGEOM.DIST': {
method: 'hypgeomdist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'T.DIST': {
method: 'tdist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'T.DIST.2T': {
method: 'tdist2t',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}]
},
'T.DIST.RT': {
method: 'tdistrt',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}]
},
'TDIST': {
method: 'tdistold',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.INTEGER,
minValue: 1,
maxValue: 2
}]
},
'T.INV': {
method: 'tinv',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0,
lessThan: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}]
},
'T.INV.2T': {
method: 'tinv2t',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0,
maxValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}]
},
'LOGNORM.DIST': {
method: 'lognormdist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'LOGNORM.INV': {
method: 'lognorminv',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0,
lessThan: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}]
},
'NORM.DIST': {
method: 'normdist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'NORM.INV': {
method: 'norminv',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0,
lessThan: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}]
},
'NORM.S.DIST': {
method: 'normsdist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'NORM.S.INV': {
method: 'normsinv',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0,
lessThan: 1
}]
},
'PHI': {
method: 'phi',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}]
},
'NEGBINOM.DIST': {
method: 'negbinomdist',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 0,
maxValue: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.BOOLEAN
}]
},
'CONFIDENCE.NORM': {
method: 'confidencenorm',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0,
lessThan: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}]
},
'CONFIDENCE.T': {
method: 'confidencet',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0,
lessThan: 1
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
minValue: 1
}]
},
'STANDARDIZE': {
method: 'standardize',
parameters: [{
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER
}, {
argumentType: _FunctionPlugin2.ArgumentTypes.NUMBER,
greaterThan: 0
}]
}
};
StatisticalPlugin.aliases = {
NEGBINOMDIST: 'NEGBINOM.DIST',
EXPONDIST: 'EXPON.DIST',
BETADIST: 'BETA.DIST',
NORMDIST: 'NORM.DIST',
NORMINV: 'NORM.INV',
NORMSDIST: 'NORM.S.DIST',
NORMSINV: 'NORM.S.INV',
LOGNORMDIST: 'LOGNORM.DIST',
LOGINV: 'LOGNORM.INV',
TINV: 'T.INV.2T',
HYPGEOMDIST: 'HYPGEOM.DIST',
POISSON: 'POISSON.DIST',
WEIBULL: 'WEIBULL.DIST',
FINV: 'F.INV.RT',
FDIST: 'F.DIST.RT',
CHIDIST: 'CHISQ.DIST.RT',
CHIINV: 'CHISQ.INV.RT',
GAMMADIST: 'GAMMA.DIST',
'GAMMALN.PRECISE': 'GAMMALN',
GAMMAINV: 'GAMMA.INV',
BETAINV: 'BETA.INV',
BINOMDIST: 'BINOM.DIST',
CONFIDENCE: 'CONFIDENCE.NORM',
CRITBINOM: 'BINOM.INV',
WEIBULLDIST: 'WEIBULL.DIST',
TINV2T: 'T.INV.2T',
TDISTRT: 'T.DIST.RT',
TDIST2T: 'T.DIST.2T',
FINVRT: 'F.INV.RT',
FDISTRT: 'F.DIST.RT',
CHIDISTRT: 'CHISQ.DIST.RT',
CHIINVRT: 'CHISQ.INV.RT',
LOGNORMINV: 'LOGNORM.INV',
POISSONDIST: 'POISSON.DIST'
};