Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-statistics

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-statistics - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

src/sample_with_replacement.js

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="2.3.0"></a>
# [2.3.0](https://github.com/simple-statistics/simple-statistics/compare/v2.2.0...v2.3.0) (2017-02-17)
### Features
* **core:** sampleWithReplacement (#174) ([a8d05d1](https://github.com/simple-statistics/simple-statistics/commit/a8d05d1))
# CHANGELOG

@@ -2,0 +12,0 @@

2

dist/simple-statistics.min.js

@@ -1,2 +0,2 @@

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.ss=t()}}(function(){return function t(r,n,e){function o(u,a){if(!n[u]){if(!r[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var c=n[u]={exports:{}};r[u][0].call(c.exports,function(t){var n=r[u][1][t];return o(n?n:t)},c,c.exports,t,r,n,e)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<e.length;u++)o(e[u]);return o}({1:[function(t,r,n){"use strict";var e=r.exports={};e.linearRegression=t(21),e.linearRegressionLine=t(22),e.standardDeviation=t(54),e.rSquared=t(43),e.mode=t(32),e.modeSorted=t(33),e.min=t(29),e.max=t(23),e.minSorted=t(30),e.maxSorted=t(24),e.sum=t(56),e.sumSimple=t(58),e.product=t(39),e.quantile=t(40),e.quantileSorted=t(41),e.iqr=e.interquartileRange=t(19),e.medianAbsoluteDeviation=e.mad=t(27),e.chunk=t(8),e.shuffle=t(51),e.shuffleInPlace=t(52),e.sample=t(45),e.ckmeans=t(9),e.uniqueCountSorted=t(61),e.sumNthPowerDeviations=t(57),e.equalIntervalBreaks=t(14),e.sampleCovariance=t(47),e.sampleCorrelation=t(46),e.sampleVariance=t(50),e.sampleStandardDeviation=t(49),e.sampleSkewness=t(48),e.permutationsHeap=t(36),e.combinations=t(10),e.combinationsReplacement=t(11),e.geometricMean=t(17),e.harmonicMean=t(18),e.mean=e.average=t(25),e.median=t(26),e.medianSorted=t(28),e.rootMeanSquare=e.rms=t(44),e.variance=t(62),e.tTest=t(59),e.tTestTwoSample=t(60),e.bayesian=t(2),e.perceptron=t(35),e.epsilon=t(13),e.factorial=t(16),e.bernoulliDistribution=t(3),e.binomialDistribution=t(4),e.poissonDistribution=t(37),e.chiSquaredGoodnessOfFit=t(7),e.zScore=t(63),e.cumulativeStdNormalProbability=t(12),e.standardNormalTable=t(55),e.errorFunction=e.erf=t(15),e.inverseErrorFunction=t(20),e.probit=t(38),e.mixin=t(31),e.bisect=t(5)},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,2:2,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,3:3,30:30,31:31,32:32,33:33,35:35,36:36,37:37,38:38,39:39,4:4,40:40,41:41,43:43,44:44,45:45,46:46,47:47,48:48,49:49,5:5,50:50,51:51,52:52,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,7:7,8:8,9:9}],2:[function(t,r,n){"use strict";function e(){this.totalCount=0,this.data={}}e.prototype.train=function(t,r){this.data[r]||(this.data[r]={});for(var n in t){var e=t[n];void 0===this.data[r][n]&&(this.data[r][n]={}),void 0===this.data[r][n][e]&&(this.data[r][n][e]=0),this.data[r][n][e]++}this.totalCount++},e.prototype.score=function(t){var r,n={};for(var e in t){var o=t[e];for(r in this.data)n[r]={},this.data[r][e]?n[r][e+"_"+o]=(this.data[r][e][o]||0)/this.totalCount:n[r][e+"_"+o]=0}var i={};for(r in n){i[r]=0;for(var u in n[r])i[r]+=n[r][u]}return i},r.exports=e},{}],3:[function(t,r,n){"use strict";function e(t){return t<0||t>1?NaN:o(1,t)}var o=t(4);r.exports=e},{4:4}],4:[function(t,r,n){"use strict";function e(t,r){if(!(r<0||r>1||t<=0||t%1!==0)){var n=0,e=0,u={};do u[n]=i(t)/(i(n)*i(t-n))*(Math.pow(r,n)*Math.pow(1-r,t-n)),e+=u[n],n++;while(e<1-o);return u}}var o=t(13),i=t(16);r.exports=e},{13:13,16:16}],5:[function(t,r,n){"use strict";function e(t,r,n,e,i){if("function"!=typeof t)throw new TypeError("func must be a function");for(var u=0;u<e;u++){var a=(r+n)/2;if(0===t(a)||Math.abs((n-r)/2)<i)return a;o(t(a))===o(t(r))?r=a:n=a}throw new Error("maximum number of iterations exceeded")}var o=t(53);r.exports=e},{53:53}],6:[function(t,r,n){"use strict";var e={1:{.995:0,.99:0,.975:0,.95:0,.9:.02,.5:.45,.1:2.71,.05:3.84,.025:5.02,.01:6.63,.005:7.88},2:{.995:.01,.99:.02,.975:.05,.95:.1,.9:.21,.5:1.39,.1:4.61,.05:5.99,.025:7.38,.01:9.21,.005:10.6},3:{.995:.07,.99:.11,.975:.22,.95:.35,.9:.58,.5:2.37,.1:6.25,.05:7.81,.025:9.35,.01:11.34,.005:12.84},4:{.995:.21,.99:.3,.975:.48,.95:.71,.9:1.06,.5:3.36,.1:7.78,.05:9.49,.025:11.14,.01:13.28,.005:14.86},5:{.995:.41,.99:.55,.975:.83,.95:1.15,.9:1.61,.5:4.35,.1:9.24,.05:11.07,.025:12.83,.01:15.09,.005:16.75},6:{.995:.68,.99:.87,.975:1.24,.95:1.64,.9:2.2,.5:5.35,.1:10.65,.05:12.59,.025:14.45,.01:16.81,.005:18.55},7:{.995:.99,.99:1.25,.975:1.69,.95:2.17,.9:2.83,.5:6.35,.1:12.02,.05:14.07,.025:16.01,.01:18.48,.005:20.28},8:{.995:1.34,.99:1.65,.975:2.18,.95:2.73,.9:3.49,.5:7.34,.1:13.36,.05:15.51,.025:17.53,.01:20.09,.005:21.96},9:{.995:1.73,.99:2.09,.975:2.7,.95:3.33,.9:4.17,.5:8.34,.1:14.68,.05:16.92,.025:19.02,.01:21.67,.005:23.59},10:{.995:2.16,.99:2.56,.975:3.25,.95:3.94,.9:4.87,.5:9.34,.1:15.99,.05:18.31,.025:20.48,.01:23.21,.005:25.19},11:{.995:2.6,.99:3.05,.975:3.82,.95:4.57,.9:5.58,.5:10.34,.1:17.28,.05:19.68,.025:21.92,.01:24.72,.005:26.76},12:{.995:3.07,.99:3.57,.975:4.4,.95:5.23,.9:6.3,.5:11.34,.1:18.55,.05:21.03,.025:23.34,.01:26.22,.005:28.3},13:{.995:3.57,.99:4.11,.975:5.01,.95:5.89,.9:7.04,.5:12.34,.1:19.81,.05:22.36,.025:24.74,.01:27.69,.005:29.82},14:{.995:4.07,.99:4.66,.975:5.63,.95:6.57,.9:7.79,.5:13.34,.1:21.06,.05:23.68,.025:26.12,.01:29.14,.005:31.32},15:{.995:4.6,.99:5.23,.975:6.27,.95:7.26,.9:8.55,.5:14.34,.1:22.31,.05:25,.025:27.49,.01:30.58,.005:32.8},16:{.995:5.14,.99:5.81,.975:6.91,.95:7.96,.9:9.31,.5:15.34,.1:23.54,.05:26.3,.025:28.85,.01:32,.005:34.27},17:{.995:5.7,.99:6.41,.975:7.56,.95:8.67,.9:10.09,.5:16.34,.1:24.77,.05:27.59,.025:30.19,.01:33.41,.005:35.72},18:{.995:6.26,.99:7.01,.975:8.23,.95:9.39,.9:10.87,.5:17.34,.1:25.99,.05:28.87,.025:31.53,.01:34.81,.005:37.16},19:{.995:6.84,.99:7.63,.975:8.91,.95:10.12,.9:11.65,.5:18.34,.1:27.2,.05:30.14,.025:32.85,.01:36.19,.005:38.58},20:{.995:7.43,.99:8.26,.975:9.59,.95:10.85,.9:12.44,.5:19.34,.1:28.41,.05:31.41,.025:34.17,.01:37.57,.005:40},21:{.995:8.03,.99:8.9,.975:10.28,.95:11.59,.9:13.24,.5:20.34,.1:29.62,.05:32.67,.025:35.48,.01:38.93,.005:41.4},22:{.995:8.64,.99:9.54,.975:10.98,.95:12.34,.9:14.04,.5:21.34,.1:30.81,.05:33.92,.025:36.78,.01:40.29,.005:42.8},23:{.995:9.26,.99:10.2,.975:11.69,.95:13.09,.9:14.85,.5:22.34,.1:32.01,.05:35.17,.025:38.08,.01:41.64,.005:44.18},24:{.995:9.89,.99:10.86,.975:12.4,.95:13.85,.9:15.66,.5:23.34,.1:33.2,.05:36.42,.025:39.36,.01:42.98,.005:45.56},25:{.995:10.52,.99:11.52,.975:13.12,.95:14.61,.9:16.47,.5:24.34,.1:34.28,.05:37.65,.025:40.65,.01:44.31,.005:46.93},26:{.995:11.16,.99:12.2,.975:13.84,.95:15.38,.9:17.29,.5:25.34,.1:35.56,.05:38.89,.025:41.92,.01:45.64,.005:48.29},27:{.995:11.81,.99:12.88,.975:14.57,.95:16.15,.9:18.11,.5:26.34,.1:36.74,.05:40.11,.025:43.19,.01:46.96,.005:49.65},28:{.995:12.46,.99:13.57,.975:15.31,.95:16.93,.9:18.94,.5:27.34,.1:37.92,.05:41.34,.025:44.46,.01:48.28,.005:50.99},29:{.995:13.12,.99:14.26,.975:16.05,.95:17.71,.9:19.77,.5:28.34,.1:39.09,.05:42.56,.025:45.72,.01:49.59,.005:52.34},30:{.995:13.79,.99:14.95,.975:16.79,.95:18.49,.9:20.6,.5:29.34,.1:40.26,.05:43.77,.025:46.98,.01:50.89,.005:53.67},40:{.995:20.71,.99:22.16,.975:24.43,.95:26.51,.9:29.05,.5:39.34,.1:51.81,.05:55.76,.025:59.34,.01:63.69,.005:66.77},50:{.995:27.99,.99:29.71,.975:32.36,.95:34.76,.9:37.69,.5:49.33,.1:63.17,.05:67.5,.025:71.42,.01:76.15,.005:79.49},60:{.995:35.53,.99:37.48,.975:40.48,.95:43.19,.9:46.46,.5:59.33,.1:74.4,.05:79.08,.025:83.3,.01:88.38,.005:91.95},70:{.995:43.28,.99:45.44,.975:48.76,.95:51.74,.9:55.33,.5:69.33,.1:85.53,.05:90.53,.025:95.02,.01:100.42,.005:104.22},80:{.995:51.17,.99:53.54,.975:57.15,.95:60.39,.9:64.28,.5:79.33,.1:96.58,.05:101.88,.025:106.63,.01:112.33,.005:116.32},90:{.995:59.2,.99:61.75,.975:65.65,.95:69.13,.9:73.29,.5:89.33,.1:107.57,.05:113.14,.025:118.14,.01:124.12,.005:128.3},100:{.995:67.33,.99:70.06,.975:74.22,.95:77.93,.9:82.36,.5:99.33,.1:118.5,.05:124.34,.025:129.56,.01:135.81,.005:140.17}};r.exports=e},{}],7:[function(t,r,n){"use strict";function e(t,r,n){for(var e,u,a=o(t),s=0,f=1,c=r(a),h=[],l=[],p=0;p<t.length;p++)void 0===h[t[p]]&&(h[t[p]]=0),h[t[p]]++;for(p=0;p<h.length;p++)void 0===h[p]&&(h[p]=0);for(u in c)u in h&&(l[+u]=c[u]*t.length);for(u=l.length-1;u>=0;u--)l[u]<3&&(l[u-1]+=l[u],l.pop(),h[u-1]+=h[u],h.pop());for(u=0;u<h.length;u++)s+=Math.pow(h[u]-l[u],2)/l[u];return e=h.length-f-1,i[e][n]<s}var o=t(25),i=t(6);r.exports=e},{25:25,6:6}],8:[function(t,r,n){"use strict";function e(t,r){var n=[];if(r<=0)throw new Error("chunk size must be a positive integer");for(var e=0;e<t.length;e+=r)n.push(t.slice(e,e+r));return n}r.exports=e},{}],9:[function(t,r,n){"use strict";function e(t,r){for(var n=[],e=0;e<t;e++){for(var o=[],i=0;i<r;i++)o.push(0);n.push(o)}return n}function o(t,r,n,e){var o;if(t>0){var i=(n[r]-n[t-1])/(r-t+1);o=e[r]-e[t-1]-(r-t+1)*i*i}else o=e[r]-n[r]*n[r]/(r+1);return o<0?0:o}function i(t,r,n,e,u,a,s){if(!(t>r)){var f=Math.floor((t+r)/2);e[n][f]=e[n-1][f-1],u[n][f]=f;var c=n;t>n&&(c=Math.max(c,u[n][t-1]||0)),c=Math.max(c,u[n-1][f]||0);var h=f-1;r<e.length-1&&(h=Math.min(h,u[n][r+1]||0));for(var l,p,v,g,x=h;x>=c&&(l=o(x,f,a,s),!(l+e[n-1][c-1]>=e[n][f]));--x)p=o(c,f,a,s),v=p+e[n-1][c-1],v<e[n][f]&&(e[n][f]=v,u[n][f]=c),c++,g=l+e[n-1][x-1],g<e[n][f]&&(e[n][f]=g,u[n][f]=x);i(t,f-1,n,e,u,a,s),i(f+1,r,n,e,u,a,s)}}function u(t,r,n){for(var e,u=r[0].length,a=t[Math.floor(u/2)],s=[],f=[],c=0;c<u;++c)e=t[c]-a,0===c?(s.push(e),f.push(e*e)):(s.push(s[c-1]+e),f.push(f[c-1]+e*e)),r[0][c]=o(0,c,s,f),n[0][c]=0;for(var h,l=1;l<r.length;++l)h=l<r.length-1?l:u-1,i(h,u-1,l,r,n,s,f)}function a(t,r){if(r>t.length)throw new Error("Cannot generate more classes than there are data values");var n=f(t),o=s(n);if(1===o)return[n];var i=e(r,n.length),a=e(r,n.length);u(n,i,a);for(var c=[],h=a[0].length-1,l=a.length-1;l>=0;l--){var p=a[l][h];c[l]=n.slice(p,h+1),l>0&&(h=p-1)}return c}var s=t(61),f=t(34);r.exports=a},{34:34,61:61}],10:[function(t,r,n){"use strict";function e(t,r){var n,o,i,u,a=[];for(n=0;n<t.length;n++)if(1===r)a.push([t[n]]);else for(i=e(t.slice(n+1,t.length),r-1),o=0;o<i.length;o++)u=i[o],u.unshift(t[n]),a.push(u);return a}r.exports=e},{}],11:[function(t,r,n){"use strict";function e(t,r){for(var n=[],o=0;o<t.length;o++)if(1===r)n.push([t[o]]);else for(var i=e(t.slice(o,t.length),r-1),u=0;u<i.length;u++)n.push([t[o]].concat(i[u]));return n}r.exports=e},{}],12:[function(t,r,n){"use strict";function e(t){var r=Math.abs(t),n=Math.min(Math.round(100*r),o.length-1);return t>=0?o[n]:+(1-o[n]).toFixed(4)}var o=t(55);r.exports=e},{55:55}],13:[function(t,r,n){"use strict";var e=1e-4;r.exports=e},{}],14:[function(t,r,n){"use strict";function e(t,r){if(t.length<=1)return t;for(var n=i(t),e=o(t),u=[n],a=(e-n)/r,s=1;s<r;s++)u.push(u[0]+a*s);return u.push(e),u}var o=t(23),i=t(29);r.exports=e},{23:23,29:29}],15:[function(t,r,n){"use strict";function e(t){var r=1/(1+.5*Math.abs(t)),n=r*Math.exp(-Math.pow(t,2)-1.26551223+1.00002368*r+.37409196*Math.pow(r,2)+.09678418*Math.pow(r,3)-.18628806*Math.pow(r,4)+.27886807*Math.pow(r,5)-1.13520398*Math.pow(r,6)+1.48851587*Math.pow(r,7)-.82215223*Math.pow(r,8)+.17087277*Math.pow(r,9));return t>=0?1-n:n-1}r.exports=e},{}],16:[function(t,r,n){"use strict";function e(t){if(t<0)return NaN;for(var r=1,n=2;n<=t;n++)r*=n;return r}r.exports=e},{}],17:[function(t,r,n){"use strict";function e(t){if(0!==t.length){for(var r=1,n=0;n<t.length;n++){if(t[n]<=0)return;r*=t[n]}return Math.pow(r,1/t.length)}}r.exports=e},{}],18:[function(t,r,n){"use strict";function e(t){if(0!==t.length){for(var r=0,n=0;n<t.length;n++){if(t[n]<=0)return;r+=1/t[n]}return t.length/r}}r.exports=e},{}],19:[function(t,r,n){"use strict";function e(t){var r=o(t,.75),n=o(t,.25);if("number"==typeof r&&"number"==typeof n)return r-n}var o=t(40);r.exports=e},{40:40}],20:[function(t,r,n){"use strict";function e(t){var r=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),n=Math.sqrt(Math.sqrt(Math.pow(2/(Math.PI*r)+Math.log(1-t*t)/2,2)-Math.log(1-t*t)/r)-(2/(Math.PI*r)+Math.log(1-t*t)/2));return t>=0?n:-n}r.exports=e},{}],21:[function(t,r,n){"use strict";function e(t){var r,n,e=t.length;if(1===e)r=0,n=t[0][1];else{for(var o,i,u,a=0,s=0,f=0,c=0,h=0;h<e;h++)o=t[h],i=o[0],u=o[1],a+=i,s+=u,f+=i*i,c+=i*u;r=(e*c-a*s)/(e*f-a*a),n=s/e-r*a/e}return{m:r,b:n}}r.exports=e},{}],22:[function(t,r,n){"use strict";function e(t){return function(r){return t.b+t.m*r}}r.exports=e},{}],23:[function(t,r,n){"use strict";function e(t){for(var r,n=0;n<t.length;n++)(void 0===r||t[n]>r)&&(r=t[n]);return void 0===r?NaN:r}r.exports=e},{}],24:[function(t,r,n){"use strict";function e(t){return t[t.length-1]}r.exports=e},{}],25:[function(t,r,n){"use strict";function e(t){return 0===t.length?NaN:o(t)/t.length}var o=t(56);r.exports=e},{56:56}],26:[function(t,r,n){"use strict";function e(t){return+o(t,.5)}var o=t(40);r.exports=e},{40:40}],27:[function(t,r,n){"use strict";function e(t){for(var r=o(t),n=[],e=0;e<t.length;e++)n.push(Math.abs(t[e]-r));return o(n)}var o=t(26);r.exports=e},{26:26}],28:[function(t,r,n){"use strict";function e(t){return o(t,.5)}var o=t(41);r.exports=e},{41:41}],29:[function(t,r,n){"use strict";function e(t){for(var r,n=0;n<t.length;n++)(void 0===r||t[n]<r)&&(r=t[n]);return void 0===r?NaN:r}r.exports=e},{}],30:[function(t,r,n){"use strict";function e(t){return t[0]}r.exports=e},{}],31:[function(t,r,n){"use strict";function e(t,r){function n(r){return function(){var n=Array.prototype.slice.apply(arguments);return n.unshift(this),t[r].apply(t,n)}}var e=!(!Object.defineProperty||!Object.defineProperties);if(!e)throw new Error("without defineProperty, simple-statistics cannot be mixed in");var o,i=["median","standardDeviation","sum","product","sampleSkewness","mean","min","max","quantile","geometricMean","harmonicMean","root_mean_square"];o=r?r.slice():Array.prototype;for(var u=0;u<i.length;u++)Object.defineProperty(o,i[u],{value:n(i[u]),configurable:!0,enumerable:!1,writable:!0});return o}r.exports=e},{}],32:[function(t,r,n){"use strict";function e(t){return i(o(t))}var o=t(34),i=t(33);r.exports=e},{33:33,34:34}],33:[function(t,r,n){"use strict";function e(t){if(0===t.length)return NaN;if(1===t.length)return t[0];for(var r=t[0],n=NaN,e=0,o=1,i=1;i<t.length+1;i++)t[i]!==r?(o>e&&(e=o,n=r),o=1,r=t[i]):o++;return n}r.exports=e},{}],34:[function(t,r,n){"use strict";function e(t){return t.slice().sort(function(t,r){return t-r})}r.exports=e},{}],35:[function(t,r,n){"use strict";function e(){this.weights=[],this.bias=0}e.prototype.predict=function(t){if(t.length!==this.weights.length)return null;for(var r=0,n=0;n<this.weights.length;n++)r+=this.weights[n]*t[n];return r+=this.bias,r>0?1:0},e.prototype.train=function(t,r){if(0!==r&&1!==r)return null;t.length!==this.weights.length&&(this.weights=t,this.bias=1);var n=this.predict(t);if(n!==r){for(var e=r-n,o=0;o<this.weights.length;o++)this.weights[o]+=e*t[o];this.bias+=e}return this},r.exports=e},{}],36:[function(t,r,n){"use strict";function e(t){for(var r=new Array(t.length),n=[t.slice()],e=0;e<t.length;e++)r[e]=0;for(e=0;e<t.length;)if(r[e]<e){var o=0;e%2!==0&&(o=r[e]);var i=t[o];t[o]=t[e],t[e]=i,n.push(t.slice()),r[e]++,e=0}else r[e]=0,e++;return n}r.exports=e},{}],37:[function(t,r,n){"use strict";function e(t){if(!(t<=0)){var r=0,n=0,e={};do e[r]=Math.pow(Math.E,-t)*Math.pow(t,r)/i(r),n+=e[r],r++;while(n<1-o);return e}}var o=t(13),i=t(16);r.exports=e},{13:13,16:16}],38:[function(t,r,n){"use strict";function e(t){return 0===t?t=o:t>=1&&(t=1-o),Math.sqrt(2)*i(2*t-1)}var o=t(13),i=t(20);r.exports=e},{13:13,20:20}],39:[function(t,r,n){"use strict";function e(t){for(var r=1,n=0;n<t.length;n++)r*=t[n];return r}r.exports=e},{}],40:[function(t,r,n){"use strict";function e(t,r){var n=t.slice();if(Array.isArray(r)){i(n,r);for(var e=[],u=0;u<r.length;u++)e[u]=s(n,r[u]);return e}var f=a(n.length,r);return o(n,f,0,n.length-1),s(n,r)}function o(t,r,n,e){r%1===0?f(t,r,n,e):(r=Math.floor(r),f(t,r,n,e),f(t,r+1,r+1,e))}function i(t,r){for(var n=[0],e=0;e<r.length;e++)n.push(a(t.length,r[e]));n.push(t.length-1),n.sort(u);for(var i=[0,n.length-1];i.length;){var s=Math.ceil(i.pop()),f=Math.floor(i.pop());if(!(s-f<=1)){var c=Math.floor((f+s)/2);o(t,n[c],n[f],n[s]),i.push(f,c,c,s)}}}function u(t,r){return t-r}function a(t,r){var n=t*r;return 1===r?t-1:0===r?0:n%1!==0?Math.ceil(n)-1:t%2===0?n-.5:n}var s=t(41),f=t(42);r.exports=e},{41:41,42:42}],41:[function(t,r,n){"use strict";function e(t,r){var n=t.length*r;return r<0||r>1?NaN:1===r?t[t.length-1]:0===r?t[0]:n%1!==0?t[Math.ceil(n)-1]:t.length%2===0?(t[n-1]+t[n])/2:t[n]}r.exports=e},{}],42:[function(t,r,n){"use strict";function e(t,r,n,i){for(n=n||0,i=i||t.length-1;i>n;){if(i-n>600){var u=i-n+1,a=r-n+1,s=Math.log(u),f=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*f*(u-f)/u);a-u/2<0&&(c*=-1);var h=Math.max(n,Math.floor(r-a*f/u+c)),l=Math.min(i,Math.floor(r+(u-a)*f/u+c));e(t,r,h,l)}var p=t[r],v=n,g=i;for(o(t,n,r),t[i]>p&&o(t,n,i);v<g;){for(o(t,v,g),v++,g--;t[v]<p;)v++;for(;t[g]>p;)g--}t[n]===p?o(t,n,g):(g++,o(t,g,i)),g<=r&&(n=g+1),r<=g&&(i=g-1)}}function o(t,r,n){var e=t[r];t[r]=t[n],t[n]=e}r.exports=e},{}],43:[function(t,r,n){"use strict";function e(t,r){if(t.length<2)return 1;for(var n,e=0,o=0;o<t.length;o++)e+=t[o][1];n=e/t.length;for(var i=0,u=0;u<t.length;u++)i+=Math.pow(n-t[u][1],2);for(var a=0,s=0;s<t.length;s++)a+=Math.pow(t[s][1]-r(t[s][0]),2);return 1-a/i}r.exports=e},{}],44:[function(t,r,n){"use strict";function e(t){if(0===t.length)return NaN;for(var r=0,n=0;n<t.length;n++)r+=Math.pow(t[n],2);return Math.sqrt(r/t.length)}r.exports=e},{}],45:[function(t,r,n){"use strict";function e(t,r,n){var e=o(t,n);return e.slice(0,r)}var o=t(51);r.exports=e},{51:51}],46:[function(t,r,n){"use strict";function e(t,r){var n=o(t,r),e=i(t),u=i(r);return n/e/u}var o=t(47),i=t(49);r.exports=e},{47:47,49:49}],47:[function(t,r,n){"use strict";function e(t,r){if(t.length<=1||t.length!==r.length)return NaN;for(var n=o(t),e=o(r),i=0,u=0;u<t.length;u++)i+=(t[u]-n)*(r[u]-e);var a=t.length-1;return i/a}var o=t(25);r.exports=e},{25:25}],48:[function(t,r,n){"use strict";function e(t){var r=i(t);if(isNaN(r)||t.length<3)return NaN;var n=t.length,e=Math.pow(r,3),u=o(t,3);return n*u/((n-1)*(n-2)*e)}var o=t(57),i=t(49);r.exports=e},{49:49,57:57}],49:[function(t,r,n){"use strict";function e(t){var r=o(t);return isNaN(r)?NaN:Math.sqrt(r)}var o=t(50);r.exports=e},{50:50}],50:[function(t,r,n){"use strict";function e(t){if(t.length<=1)return NaN;var r=o(t,2),n=t.length-1;return r/n}var o=t(57);r.exports=e},{57:57}],51:[function(t,r,n){"use strict";function e(t,r){return t=t.slice(),o(t.slice(),r)}var o=t(52);r.exports=e},{52:52}],52:[function(t,r,n){"use strict";function e(t,r){r=r||Math.random;for(var n,e,o=t.length;o>0;)e=Math.floor(r()*o--),n=t[o],t[o]=t[e],t[e]=n;return t}r.exports=e},{}],53:[function(t,r,n){"use strict";function e(t){if("number"==typeof t)return t<0?-1:0===t?0:1;throw new TypeError("not a number")}r.exports=e},{}],54:[function(t,r,n){"use strict";function e(t){var r=o(t);return isNaN(r)?0:Math.sqrt(r)}var o=t(62);r.exports=e},{62:62}],55:[function(t,r,n){"use strict";function e(t){for(var r=t,n=t,e=1;e<15;e++)n*=t*t/(2*e+1),r+=n;return Math.round(1e4*(.5+r/o*Math.exp(-t*t/2)))/1e4}for(var o=Math.sqrt(2*Math.PI),i=[],u=0;u<=3.09;u+=.01)i.push(e(u));r.exports=i},{}],56:[function(t,r,n){"use strict";function e(t){for(var r,n,e=0,o=0,i=0;i<t.length;i++)r=t[i]-o,n=e+r,o=n-e-r,e=n;return e}r.exports=e},{}],57:[function(t,r,n){"use strict";function e(t,r){for(var n=o(t),e=0,i=0;i<t.length;i++)e+=Math.pow(t[i]-n,r);return e}var o=t(25);r.exports=e},{25:25}],58:[function(t,r,n){"use strict";function e(t){for(var r=0,n=0;n<t.length;n++)r+=t[n];return r}r.exports=e},{}],59:[function(t,r,n){"use strict";function e(t,r){var n=i(t),e=o(t),u=Math.sqrt(t.length);return(n-r)/(e/u)}var o=t(54),i=t(25);r.exports=e},{25:25,54:54}],60:[function(t,r,n){"use strict";function e(t,r,n){var e=t.length,u=r.length;if(!e||!u)return null;n||(n=0);var a=o(t),s=o(r),f=i(t),c=i(r);if("number"==typeof a&&"number"==typeof s&&"number"==typeof f&&"number"==typeof c){var h=((e-1)*f+(u-1)*c)/(e+u-2);return(a-s-n)/Math.sqrt(h*(1/e+1/u))}}var o=t(25),i=t(50);r.exports=e},{25:25,50:50}],61:[function(t,r,n){"use strict";function e(t){for(var r,n=0,e=0;e<t.length;e++)0!==e&&t[e]===r||(r=t[e],n++);return n}r.exports=e},{}],62:[function(t,r,n){"use strict";function e(t){return 0===t.length?NaN:o(t,2)/t.length}var o=t(57);r.exports=e},{57:57}],63:[function(t,r,n){"use strict";function e(t,r,n){return(t-r)/n}r.exports=e},{}]},{},[1])(1)});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.ss=t()}}(function(){return function t(r,n,e){function o(u,a){if(!n[u]){if(!r[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var c=n[u]={exports:{}};r[u][0].call(c.exports,function(t){var n=r[u][1][t];return o(n?n:t)},c,c.exports,t,r,n,e)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<e.length;u++)o(e[u]);return o}({1:[function(t,r,n){"use strict";var e=r.exports={};e.linearRegression=t(21),e.linearRegressionLine=t(22),e.standardDeviation=t(55),e.rSquared=t(43),e.mode=t(32),e.modeSorted=t(33),e.min=t(29),e.max=t(23),e.minSorted=t(30),e.maxSorted=t(24),e.sum=t(57),e.sumSimple=t(59),e.product=t(39),e.quantile=t(40),e.quantileSorted=t(41),e.iqr=e.interquartileRange=t(19),e.medianAbsoluteDeviation=e.mad=t(27),e.chunk=t(8),e.sampleWithReplacement=t(51),e.shuffle=t(52),e.shuffleInPlace=t(53),e.sample=t(45),e.ckmeans=t(9),e.uniqueCountSorted=t(62),e.sumNthPowerDeviations=t(58),e.equalIntervalBreaks=t(14),e.sampleCovariance=t(47),e.sampleCorrelation=t(46),e.sampleVariance=t(50),e.sampleStandardDeviation=t(49),e.sampleSkewness=t(48),e.permutationsHeap=t(36),e.combinations=t(10),e.combinationsReplacement=t(11),e.geometricMean=t(17),e.harmonicMean=t(18),e.mean=e.average=t(25),e.median=t(26),e.medianSorted=t(28),e.rootMeanSquare=e.rms=t(44),e.variance=t(63),e.tTest=t(60),e.tTestTwoSample=t(61),e.bayesian=t(2),e.perceptron=t(35),e.epsilon=t(13),e.factorial=t(16),e.bernoulliDistribution=t(3),e.binomialDistribution=t(4),e.poissonDistribution=t(37),e.chiSquaredGoodnessOfFit=t(7),e.zScore=t(64),e.cumulativeStdNormalProbability=t(12),e.standardNormalTable=t(56),e.errorFunction=e.erf=t(15),e.inverseErrorFunction=t(20),e.probit=t(38),e.mixin=t(31),e.bisect=t(5)},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,2:2,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,3:3,30:30,31:31,32:32,33:33,35:35,36:36,37:37,38:38,39:39,4:4,40:40,41:41,43:43,44:44,45:45,46:46,47:47,48:48,49:49,5:5,50:50,51:51,52:52,53:53,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,7:7,8:8,9:9}],2:[function(t,r,n){"use strict";function e(){this.totalCount=0,this.data={}}e.prototype.train=function(t,r){this.data[r]||(this.data[r]={});for(var n in t){var e=t[n];void 0===this.data[r][n]&&(this.data[r][n]={}),void 0===this.data[r][n][e]&&(this.data[r][n][e]=0),this.data[r][n][e]++}this.totalCount++},e.prototype.score=function(t){var r,n={};for(var e in t){var o=t[e];for(r in this.data)n[r]={},this.data[r][e]?n[r][e+"_"+o]=(this.data[r][e][o]||0)/this.totalCount:n[r][e+"_"+o]=0}var i={};for(r in n){i[r]=0;for(var u in n[r])i[r]+=n[r][u]}return i},r.exports=e},{}],3:[function(t,r,n){"use strict";function e(t){return t<0||t>1?NaN:o(1,t)}var o=t(4);r.exports=e},{4:4}],4:[function(t,r,n){"use strict";function e(t,r){if(!(r<0||r>1||t<=0||t%1!==0)){var n=0,e=0,u={};do u[n]=i(t)/(i(n)*i(t-n))*(Math.pow(r,n)*Math.pow(1-r,t-n)),e+=u[n],n++;while(e<1-o);return u}}var o=t(13),i=t(16);r.exports=e},{13:13,16:16}],5:[function(t,r,n){"use strict";function e(t,r,n,e,i){if("function"!=typeof t)throw new TypeError("func must be a function");for(var u=0;u<e;u++){var a=(r+n)/2;if(0===t(a)||Math.abs((n-r)/2)<i)return a;o(t(a))===o(t(r))?r=a:n=a}throw new Error("maximum number of iterations exceeded")}var o=t(54);r.exports=e},{54:54}],6:[function(t,r,n){"use strict";var e={1:{.995:0,.99:0,.975:0,.95:0,.9:.02,.5:.45,.1:2.71,.05:3.84,.025:5.02,.01:6.63,.005:7.88},2:{.995:.01,.99:.02,.975:.05,.95:.1,.9:.21,.5:1.39,.1:4.61,.05:5.99,.025:7.38,.01:9.21,.005:10.6},3:{.995:.07,.99:.11,.975:.22,.95:.35,.9:.58,.5:2.37,.1:6.25,.05:7.81,.025:9.35,.01:11.34,.005:12.84},4:{.995:.21,.99:.3,.975:.48,.95:.71,.9:1.06,.5:3.36,.1:7.78,.05:9.49,.025:11.14,.01:13.28,.005:14.86},5:{.995:.41,.99:.55,.975:.83,.95:1.15,.9:1.61,.5:4.35,.1:9.24,.05:11.07,.025:12.83,.01:15.09,.005:16.75},6:{.995:.68,.99:.87,.975:1.24,.95:1.64,.9:2.2,.5:5.35,.1:10.65,.05:12.59,.025:14.45,.01:16.81,.005:18.55},7:{.995:.99,.99:1.25,.975:1.69,.95:2.17,.9:2.83,.5:6.35,.1:12.02,.05:14.07,.025:16.01,.01:18.48,.005:20.28},8:{.995:1.34,.99:1.65,.975:2.18,.95:2.73,.9:3.49,.5:7.34,.1:13.36,.05:15.51,.025:17.53,.01:20.09,.005:21.96},9:{.995:1.73,.99:2.09,.975:2.7,.95:3.33,.9:4.17,.5:8.34,.1:14.68,.05:16.92,.025:19.02,.01:21.67,.005:23.59},10:{.995:2.16,.99:2.56,.975:3.25,.95:3.94,.9:4.87,.5:9.34,.1:15.99,.05:18.31,.025:20.48,.01:23.21,.005:25.19},11:{.995:2.6,.99:3.05,.975:3.82,.95:4.57,.9:5.58,.5:10.34,.1:17.28,.05:19.68,.025:21.92,.01:24.72,.005:26.76},12:{.995:3.07,.99:3.57,.975:4.4,.95:5.23,.9:6.3,.5:11.34,.1:18.55,.05:21.03,.025:23.34,.01:26.22,.005:28.3},13:{.995:3.57,.99:4.11,.975:5.01,.95:5.89,.9:7.04,.5:12.34,.1:19.81,.05:22.36,.025:24.74,.01:27.69,.005:29.82},14:{.995:4.07,.99:4.66,.975:5.63,.95:6.57,.9:7.79,.5:13.34,.1:21.06,.05:23.68,.025:26.12,.01:29.14,.005:31.32},15:{.995:4.6,.99:5.23,.975:6.27,.95:7.26,.9:8.55,.5:14.34,.1:22.31,.05:25,.025:27.49,.01:30.58,.005:32.8},16:{.995:5.14,.99:5.81,.975:6.91,.95:7.96,.9:9.31,.5:15.34,.1:23.54,.05:26.3,.025:28.85,.01:32,.005:34.27},17:{.995:5.7,.99:6.41,.975:7.56,.95:8.67,.9:10.09,.5:16.34,.1:24.77,.05:27.59,.025:30.19,.01:33.41,.005:35.72},18:{.995:6.26,.99:7.01,.975:8.23,.95:9.39,.9:10.87,.5:17.34,.1:25.99,.05:28.87,.025:31.53,.01:34.81,.005:37.16},19:{.995:6.84,.99:7.63,.975:8.91,.95:10.12,.9:11.65,.5:18.34,.1:27.2,.05:30.14,.025:32.85,.01:36.19,.005:38.58},20:{.995:7.43,.99:8.26,.975:9.59,.95:10.85,.9:12.44,.5:19.34,.1:28.41,.05:31.41,.025:34.17,.01:37.57,.005:40},21:{.995:8.03,.99:8.9,.975:10.28,.95:11.59,.9:13.24,.5:20.34,.1:29.62,.05:32.67,.025:35.48,.01:38.93,.005:41.4},22:{.995:8.64,.99:9.54,.975:10.98,.95:12.34,.9:14.04,.5:21.34,.1:30.81,.05:33.92,.025:36.78,.01:40.29,.005:42.8},23:{.995:9.26,.99:10.2,.975:11.69,.95:13.09,.9:14.85,.5:22.34,.1:32.01,.05:35.17,.025:38.08,.01:41.64,.005:44.18},24:{.995:9.89,.99:10.86,.975:12.4,.95:13.85,.9:15.66,.5:23.34,.1:33.2,.05:36.42,.025:39.36,.01:42.98,.005:45.56},25:{.995:10.52,.99:11.52,.975:13.12,.95:14.61,.9:16.47,.5:24.34,.1:34.28,.05:37.65,.025:40.65,.01:44.31,.005:46.93},26:{.995:11.16,.99:12.2,.975:13.84,.95:15.38,.9:17.29,.5:25.34,.1:35.56,.05:38.89,.025:41.92,.01:45.64,.005:48.29},27:{.995:11.81,.99:12.88,.975:14.57,.95:16.15,.9:18.11,.5:26.34,.1:36.74,.05:40.11,.025:43.19,.01:46.96,.005:49.65},28:{.995:12.46,.99:13.57,.975:15.31,.95:16.93,.9:18.94,.5:27.34,.1:37.92,.05:41.34,.025:44.46,.01:48.28,.005:50.99},29:{.995:13.12,.99:14.26,.975:16.05,.95:17.71,.9:19.77,.5:28.34,.1:39.09,.05:42.56,.025:45.72,.01:49.59,.005:52.34},30:{.995:13.79,.99:14.95,.975:16.79,.95:18.49,.9:20.6,.5:29.34,.1:40.26,.05:43.77,.025:46.98,.01:50.89,.005:53.67},40:{.995:20.71,.99:22.16,.975:24.43,.95:26.51,.9:29.05,.5:39.34,.1:51.81,.05:55.76,.025:59.34,.01:63.69,.005:66.77},50:{.995:27.99,.99:29.71,.975:32.36,.95:34.76,.9:37.69,.5:49.33,.1:63.17,.05:67.5,.025:71.42,.01:76.15,.005:79.49},60:{.995:35.53,.99:37.48,.975:40.48,.95:43.19,.9:46.46,.5:59.33,.1:74.4,.05:79.08,.025:83.3,.01:88.38,.005:91.95},70:{.995:43.28,.99:45.44,.975:48.76,.95:51.74,.9:55.33,.5:69.33,.1:85.53,.05:90.53,.025:95.02,.01:100.42,.005:104.22},80:{.995:51.17,.99:53.54,.975:57.15,.95:60.39,.9:64.28,.5:79.33,.1:96.58,.05:101.88,.025:106.63,.01:112.33,.005:116.32},90:{.995:59.2,.99:61.75,.975:65.65,.95:69.13,.9:73.29,.5:89.33,.1:107.57,.05:113.14,.025:118.14,.01:124.12,.005:128.3},100:{.995:67.33,.99:70.06,.975:74.22,.95:77.93,.9:82.36,.5:99.33,.1:118.5,.05:124.34,.025:129.56,.01:135.81,.005:140.17}};r.exports=e},{}],7:[function(t,r,n){"use strict";function e(t,r,n){for(var e,u,a=o(t),s=0,f=1,c=r(a),h=[],l=[],p=0;p<t.length;p++)void 0===h[t[p]]&&(h[t[p]]=0),h[t[p]]++;for(p=0;p<h.length;p++)void 0===h[p]&&(h[p]=0);for(u in c)u in h&&(l[+u]=c[u]*t.length);for(u=l.length-1;u>=0;u--)l[u]<3&&(l[u-1]+=l[u],l.pop(),h[u-1]+=h[u],h.pop());for(u=0;u<h.length;u++)s+=Math.pow(h[u]-l[u],2)/l[u];return e=h.length-f-1,i[e][n]<s}var o=t(25),i=t(6);r.exports=e},{25:25,6:6}],8:[function(t,r,n){"use strict";function e(t,r){var n=[];if(r<=0)throw new Error("chunk size must be a positive integer");for(var e=0;e<t.length;e+=r)n.push(t.slice(e,e+r));return n}r.exports=e},{}],9:[function(t,r,n){"use strict";function e(t,r){for(var n=[],e=0;e<t;e++){for(var o=[],i=0;i<r;i++)o.push(0);n.push(o)}return n}function o(t,r,n,e){var o;if(t>0){var i=(n[r]-n[t-1])/(r-t+1);o=e[r]-e[t-1]-(r-t+1)*i*i}else o=e[r]-n[r]*n[r]/(r+1);return o<0?0:o}function i(t,r,n,e,u,a,s){if(!(t>r)){var f=Math.floor((t+r)/2);e[n][f]=e[n-1][f-1],u[n][f]=f;var c=n;t>n&&(c=Math.max(c,u[n][t-1]||0)),c=Math.max(c,u[n-1][f]||0);var h=f-1;r<e.length-1&&(h=Math.min(h,u[n][r+1]||0));for(var l,p,v,g,x=h;x>=c&&(l=o(x,f,a,s),!(l+e[n-1][c-1]>=e[n][f]));--x)p=o(c,f,a,s),v=p+e[n-1][c-1],v<e[n][f]&&(e[n][f]=v,u[n][f]=c),c++,g=l+e[n-1][x-1],g<e[n][f]&&(e[n][f]=g,u[n][f]=x);i(t,f-1,n,e,u,a,s),i(f+1,r,n,e,u,a,s)}}function u(t,r,n){for(var e,u=r[0].length,a=t[Math.floor(u/2)],s=[],f=[],c=0;c<u;++c)e=t[c]-a,0===c?(s.push(e),f.push(e*e)):(s.push(s[c-1]+e),f.push(f[c-1]+e*e)),r[0][c]=o(0,c,s,f),n[0][c]=0;for(var h,l=1;l<r.length;++l)h=l<r.length-1?l:u-1,i(h,u-1,l,r,n,s,f)}function a(t,r){if(r>t.length)throw new Error("Cannot generate more classes than there are data values");var n=f(t),o=s(n);if(1===o)return[n];var i=e(r,n.length),a=e(r,n.length);u(n,i,a);for(var c=[],h=a[0].length-1,l=a.length-1;l>=0;l--){var p=a[l][h];c[l]=n.slice(p,h+1),l>0&&(h=p-1)}return c}var s=t(62),f=t(34);r.exports=a},{34:34,62:62}],10:[function(t,r,n){"use strict";function e(t,r){var n,o,i,u,a=[];for(n=0;n<t.length;n++)if(1===r)a.push([t[n]]);else for(i=e(t.slice(n+1,t.length),r-1),o=0;o<i.length;o++)u=i[o],u.unshift(t[n]),a.push(u);return a}r.exports=e},{}],11:[function(t,r,n){"use strict";function e(t,r){for(var n=[],o=0;o<t.length;o++)if(1===r)n.push([t[o]]);else for(var i=e(t.slice(o,t.length),r-1),u=0;u<i.length;u++)n.push([t[o]].concat(i[u]));return n}r.exports=e},{}],12:[function(t,r,n){"use strict";function e(t){var r=Math.abs(t),n=Math.min(Math.round(100*r),o.length-1);return t>=0?o[n]:+(1-o[n]).toFixed(4)}var o=t(56);r.exports=e},{56:56}],13:[function(t,r,n){"use strict";var e=1e-4;r.exports=e},{}],14:[function(t,r,n){"use strict";function e(t,r){if(t.length<=1)return t;for(var n=i(t),e=o(t),u=[n],a=(e-n)/r,s=1;s<r;s++)u.push(u[0]+a*s);return u.push(e),u}var o=t(23),i=t(29);r.exports=e},{23:23,29:29}],15:[function(t,r,n){"use strict";function e(t){var r=1/(1+.5*Math.abs(t)),n=r*Math.exp(-Math.pow(t,2)-1.26551223+1.00002368*r+.37409196*Math.pow(r,2)+.09678418*Math.pow(r,3)-.18628806*Math.pow(r,4)+.27886807*Math.pow(r,5)-1.13520398*Math.pow(r,6)+1.48851587*Math.pow(r,7)-.82215223*Math.pow(r,8)+.17087277*Math.pow(r,9));return t>=0?1-n:n-1}r.exports=e},{}],16:[function(t,r,n){"use strict";function e(t){if(t<0)return NaN;for(var r=1,n=2;n<=t;n++)r*=n;return r}r.exports=e},{}],17:[function(t,r,n){"use strict";function e(t){if(0!==t.length){for(var r=1,n=0;n<t.length;n++){if(t[n]<=0)return;r*=t[n]}return Math.pow(r,1/t.length)}}r.exports=e},{}],18:[function(t,r,n){"use strict";function e(t){if(0!==t.length){for(var r=0,n=0;n<t.length;n++){if(t[n]<=0)return;r+=1/t[n]}return t.length/r}}r.exports=e},{}],19:[function(t,r,n){"use strict";function e(t){var r=o(t,.75),n=o(t,.25);if("number"==typeof r&&"number"==typeof n)return r-n}var o=t(40);r.exports=e},{40:40}],20:[function(t,r,n){"use strict";function e(t){var r=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),n=Math.sqrt(Math.sqrt(Math.pow(2/(Math.PI*r)+Math.log(1-t*t)/2,2)-Math.log(1-t*t)/r)-(2/(Math.PI*r)+Math.log(1-t*t)/2));return t>=0?n:-n}r.exports=e},{}],21:[function(t,r,n){"use strict";function e(t){var r,n,e=t.length;if(1===e)r=0,n=t[0][1];else{for(var o,i,u,a=0,s=0,f=0,c=0,h=0;h<e;h++)o=t[h],i=o[0],u=o[1],a+=i,s+=u,f+=i*i,c+=i*u;r=(e*c-a*s)/(e*f-a*a),n=s/e-r*a/e}return{m:r,b:n}}r.exports=e},{}],22:[function(t,r,n){"use strict";function e(t){return function(r){return t.b+t.m*r}}r.exports=e},{}],23:[function(t,r,n){"use strict";function e(t){for(var r,n=0;n<t.length;n++)(void 0===r||t[n]>r)&&(r=t[n]);return void 0===r?NaN:r}r.exports=e},{}],24:[function(t,r,n){"use strict";function e(t){return t[t.length-1]}r.exports=e},{}],25:[function(t,r,n){"use strict";function e(t){return 0===t.length?NaN:o(t)/t.length}var o=t(57);r.exports=e},{57:57}],26:[function(t,r,n){"use strict";function e(t){return+o(t,.5)}var o=t(40);r.exports=e},{40:40}],27:[function(t,r,n){"use strict";function e(t){for(var r=o(t),n=[],e=0;e<t.length;e++)n.push(Math.abs(t[e]-r));return o(n)}var o=t(26);r.exports=e},{26:26}],28:[function(t,r,n){"use strict";function e(t){return o(t,.5)}var o=t(41);r.exports=e},{41:41}],29:[function(t,r,n){"use strict";function e(t){for(var r,n=0;n<t.length;n++)(void 0===r||t[n]<r)&&(r=t[n]);return void 0===r?NaN:r}r.exports=e},{}],30:[function(t,r,n){"use strict";function e(t){return t[0]}r.exports=e},{}],31:[function(t,r,n){"use strict";function e(t,r){function n(r){return function(){var n=Array.prototype.slice.apply(arguments);return n.unshift(this),t[r].apply(t,n)}}var e=!(!Object.defineProperty||!Object.defineProperties);if(!e)throw new Error("without defineProperty, simple-statistics cannot be mixed in");var o,i=["median","standardDeviation","sum","product","sampleSkewness","mean","min","max","quantile","geometricMean","harmonicMean","root_mean_square"];o=r?r.slice():Array.prototype;for(var u=0;u<i.length;u++)Object.defineProperty(o,i[u],{value:n(i[u]),configurable:!0,enumerable:!1,writable:!0});return o}r.exports=e},{}],32:[function(t,r,n){"use strict";function e(t){return i(o(t))}var o=t(34),i=t(33);r.exports=e},{33:33,34:34}],33:[function(t,r,n){"use strict";function e(t){if(0===t.length)return NaN;if(1===t.length)return t[0];for(var r=t[0],n=NaN,e=0,o=1,i=1;i<t.length+1;i++)t[i]!==r?(o>e&&(e=o,n=r),o=1,r=t[i]):o++;return n}r.exports=e},{}],34:[function(t,r,n){"use strict";function e(t){return t.slice().sort(function(t,r){return t-r})}r.exports=e},{}],35:[function(t,r,n){"use strict";function e(){this.weights=[],this.bias=0}e.prototype.predict=function(t){if(t.length!==this.weights.length)return null;for(var r=0,n=0;n<this.weights.length;n++)r+=this.weights[n]*t[n];return r+=this.bias,r>0?1:0},e.prototype.train=function(t,r){if(0!==r&&1!==r)return null;t.length!==this.weights.length&&(this.weights=t,this.bias=1);var n=this.predict(t);if(n!==r){for(var e=r-n,o=0;o<this.weights.length;o++)this.weights[o]+=e*t[o];this.bias+=e}return this},r.exports=e},{}],36:[function(t,r,n){"use strict";function e(t){for(var r=new Array(t.length),n=[t.slice()],e=0;e<t.length;e++)r[e]=0;for(e=0;e<t.length;)if(r[e]<e){var o=0;e%2!==0&&(o=r[e]);var i=t[o];t[o]=t[e],t[e]=i,n.push(t.slice()),r[e]++,e=0}else r[e]=0,e++;return n}r.exports=e},{}],37:[function(t,r,n){"use strict";function e(t){if(!(t<=0)){var r=0,n=0,e={};do e[r]=Math.pow(Math.E,-t)*Math.pow(t,r)/i(r),n+=e[r],r++;while(n<1-o);return e}}var o=t(13),i=t(16);r.exports=e},{13:13,16:16}],38:[function(t,r,n){"use strict";function e(t){return 0===t?t=o:t>=1&&(t=1-o),Math.sqrt(2)*i(2*t-1)}var o=t(13),i=t(20);r.exports=e},{13:13,20:20}],39:[function(t,r,n){"use strict";function e(t){for(var r=1,n=0;n<t.length;n++)r*=t[n];return r}r.exports=e},{}],40:[function(t,r,n){"use strict";function e(t,r){var n=t.slice();if(Array.isArray(r)){i(n,r);for(var e=[],u=0;u<r.length;u++)e[u]=s(n,r[u]);return e}var f=a(n.length,r);return o(n,f,0,n.length-1),s(n,r)}function o(t,r,n,e){r%1===0?f(t,r,n,e):(r=Math.floor(r),f(t,r,n,e),f(t,r+1,r+1,e))}function i(t,r){for(var n=[0],e=0;e<r.length;e++)n.push(a(t.length,r[e]));n.push(t.length-1),n.sort(u);for(var i=[0,n.length-1];i.length;){var s=Math.ceil(i.pop()),f=Math.floor(i.pop());if(!(s-f<=1)){var c=Math.floor((f+s)/2);o(t,n[c],n[f],n[s]),i.push(f,c,c,s)}}}function u(t,r){return t-r}function a(t,r){var n=t*r;return 1===r?t-1:0===r?0:n%1!==0?Math.ceil(n)-1:t%2===0?n-.5:n}var s=t(41),f=t(42);r.exports=e},{41:41,42:42}],41:[function(t,r,n){"use strict";function e(t,r){var n=t.length*r;return r<0||r>1?NaN:1===r?t[t.length-1]:0===r?t[0]:n%1!==0?t[Math.ceil(n)-1]:t.length%2===0?(t[n-1]+t[n])/2:t[n]}r.exports=e},{}],42:[function(t,r,n){"use strict";function e(t,r,n,i){for(n=n||0,i=i||t.length-1;i>n;){if(i-n>600){var u=i-n+1,a=r-n+1,s=Math.log(u),f=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*f*(u-f)/u);a-u/2<0&&(c*=-1);var h=Math.max(n,Math.floor(r-a*f/u+c)),l=Math.min(i,Math.floor(r+(u-a)*f/u+c));e(t,r,h,l)}var p=t[r],v=n,g=i;for(o(t,n,r),t[i]>p&&o(t,n,i);v<g;){for(o(t,v,g),v++,g--;t[v]<p;)v++;for(;t[g]>p;)g--}t[n]===p?o(t,n,g):(g++,o(t,g,i)),g<=r&&(n=g+1),r<=g&&(i=g-1)}}function o(t,r,n){var e=t[r];t[r]=t[n],t[n]=e}r.exports=e},{}],43:[function(t,r,n){"use strict";function e(t,r){if(t.length<2)return 1;for(var n,e=0,o=0;o<t.length;o++)e+=t[o][1];n=e/t.length;for(var i=0,u=0;u<t.length;u++)i+=Math.pow(n-t[u][1],2);for(var a=0,s=0;s<t.length;s++)a+=Math.pow(t[s][1]-r(t[s][0]),2);return 1-a/i}r.exports=e},{}],44:[function(t,r,n){"use strict";function e(t){if(0===t.length)return NaN;for(var r=0,n=0;n<t.length;n++)r+=Math.pow(t[n],2);return Math.sqrt(r/t.length)}r.exports=e},{}],45:[function(t,r,n){"use strict";function e(t,r,n){var e=o(t,n);return e.slice(0,r)}var o=t(52);r.exports=e},{52:52}],46:[function(t,r,n){"use strict";function e(t,r){var n=o(t,r),e=i(t),u=i(r);return n/e/u}var o=t(47),i=t(49);r.exports=e},{47:47,49:49}],47:[function(t,r,n){"use strict";function e(t,r){if(t.length<=1||t.length!==r.length)return NaN;for(var n=o(t),e=o(r),i=0,u=0;u<t.length;u++)i+=(t[u]-n)*(r[u]-e);var a=t.length-1;return i/a}var o=t(25);r.exports=e},{25:25}],48:[function(t,r,n){"use strict";function e(t){var r=i(t);if(isNaN(r)||t.length<3)return NaN;var n=t.length,e=Math.pow(r,3),u=o(t,3);return n*u/((n-1)*(n-2)*e)}var o=t(58),i=t(49);r.exports=e},{49:49,58:58}],49:[function(t,r,n){"use strict";function e(t){var r=o(t);return isNaN(r)?NaN:Math.sqrt(r)}var o=t(50);r.exports=e},{50:50}],50:[function(t,r,n){"use strict";function e(t){if(t.length<=1)return NaN;var r=o(t,2),n=t.length-1;return r/n}var o=t(58);r.exports=e},{58:58}],51:[function(t,r,n){"use strict";function e(t,r,n){if(0===t.length)return[];n=n||Math.random;for(var e=t.length,o=[],i=0;i<r;i++){var u=Math.floor(n()*e);o.push(t[u])}return o}r.exports=e},{}],52:[function(t,r,n){"use strict";function e(t,r){return t=t.slice(),o(t.slice(),r)}var o=t(53);r.exports=e},{53:53}],53:[function(t,r,n){"use strict";function e(t,r){r=r||Math.random;for(var n,e,o=t.length;o>0;)e=Math.floor(r()*o--),n=t[o],t[o]=t[e],t[e]=n;return t}r.exports=e},{}],54:[function(t,r,n){"use strict";function e(t){if("number"==typeof t)return t<0?-1:0===t?0:1;throw new TypeError("not a number")}r.exports=e},{}],55:[function(t,r,n){"use strict";function e(t){var r=o(t);return isNaN(r)?0:Math.sqrt(r)}var o=t(63);r.exports=e},{63:63}],56:[function(t,r,n){"use strict";function e(t){for(var r=t,n=t,e=1;e<15;e++)n*=t*t/(2*e+1),r+=n;return Math.round(1e4*(.5+r/o*Math.exp(-t*t/2)))/1e4}for(var o=Math.sqrt(2*Math.PI),i=[],u=0;u<=3.09;u+=.01)i.push(e(u));r.exports=i},{}],57:[function(t,r,n){"use strict";function e(t){for(var r,n,e=0,o=0,i=0;i<t.length;i++)r=t[i]-o,n=e+r,o=n-e-r,e=n;return e}r.exports=e},{}],58:[function(t,r,n){"use strict";function e(t,r){for(var n=o(t),e=0,i=0;i<t.length;i++)e+=Math.pow(t[i]-n,r);return e}var o=t(25);r.exports=e},{25:25}],59:[function(t,r,n){"use strict";function e(t){for(var r=0,n=0;n<t.length;n++)r+=t[n];return r}r.exports=e},{}],60:[function(t,r,n){"use strict";function e(t,r){var n=i(t),e=o(t),u=Math.sqrt(t.length);return(n-r)/(e/u)}var o=t(55),i=t(25);r.exports=e},{25:25,55:55}],61:[function(t,r,n){"use strict";function e(t,r,n){var e=t.length,u=r.length;if(!e||!u)return null;n||(n=0);var a=o(t),s=o(r),f=i(t),c=i(r);if("number"==typeof a&&"number"==typeof s&&"number"==typeof f&&"number"==typeof c){var h=((e-1)*f+(u-1)*c)/(e+u-2);return(a-s-n)/Math.sqrt(h*(1/e+1/u))}}var o=t(25),i=t(50);r.exports=e},{25:25,50:50}],62:[function(t,r,n){"use strict";function e(t){for(var r,n=0,e=0;e<t.length;e++)0!==e&&t[e]===r||(r=t[e],n++);return n}r.exports=e},{}],63:[function(t,r,n){"use strict";function e(t){return 0===t.length?NaN:o(t,2)/t.length}var o=t(58);r.exports=e},{58:58}],64:[function(t,r,n){"use strict";function e(t,r,n){return(t-r)/n}r.exports=e},{}]},{},[1])(1)});
//# sourceMappingURL=dist/simple-statistics.min.js.map

@@ -29,2 +29,3 @@ /* @flow */

ss.chunk = require('./src/chunk');
ss.sampleWithReplacement = require('./src/sample_with_replacement');
ss.shuffle = require('./src/shuffle');

@@ -31,0 +32,0 @@ ss.shuffleInPlace = require('./src/shuffle_in_place');

{
"name": "simple-statistics",
"version": "2.2.0",
"version": "2.3.0",
"description": "Simple Statistics",

@@ -18,11 +18,13 @@ "author": "Tom MacWright <tom@macwright.org> (http://macwright.org/)",

"are-we-flow-yet": "^1.0.0",
"browserify": "^13.0.0",
"browserify": "^14.1.0",
"bundle-collapser": "^1.0.0",
"eslint": "^3.0.1",
"cz-conventional-changelog": "^1.2.0",
"eslint": "^3.8.1",
"exorcist": "^0.4.0",
"flow-bin": "^0.28.0",
"jsdoctest": "1.6.3",
"mocha": "2.5.3",
"flow-bin": "^0.39.0",
"jsdoctest": "1.7.0",
"mocha": "3.2.0",
"random-js": "^1.0.4",
"tap": "^6.1.1",
"standard-changelog": "^0.0.1",
"tap": "^10.1.1",
"uglify-js": "^2.6.2"

@@ -34,2 +36,3 @@ },

"build": "npm run bundle && npm run minify",
"changelog": "standard-changelog CHANGELOG.md -w",
"prepublish": "npm run build && ./scripts/update_readme.js",

@@ -52,3 +55,8 @@ "bundle": "mkdir -p dist && browserify -p bundle-collapser/plugin -s ss index.js --debug | exorcist dist/simple-statistics.js.map > dist/simple-statistics.js",

"statistics"
]
],
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}

@@ -23,8 +23,8 @@ # Simple Statistics

* `https://unpkg.com/simple-statistics@2.2.0/dist/simple-statistics.js`
* Minified: `https://unpkg.com/simple-statistics@2.2.0/dist/simple-statistics.min.js`
* `https://unpkg.com/simple-statistics@2.3.0/dist/simple-statistics.js`
* Minified: `https://unpkg.com/simple-statistics@2.3.0/dist/simple-statistics.min.js`
Bower:
* Bower: `https://unpkg.com/simple-statistics@2.2.0/bower.zip`
* Bower: `https://unpkg.com/simple-statistics@2.3.0/bower.zip`

@@ -31,0 +31,0 @@ ## Ports

@@ -15,447 +15,486 @@ 'use strict';

*/
var chiSquaredDistributionTable = { '1':
{ '0.995': 0,
'0.99': 0,
'0.975': 0,
'0.95': 0,
'0.9': 0.02,
'0.5': 0.45,
'0.1': 2.71,
'0.05': 3.84,
'0.025': 5.02,
'0.01': 6.63,
'0.005': 7.88 },
'2':
{ '0.995': 0.01,
'0.99': 0.02,
'0.975': 0.05,
'0.95': 0.1,
'0.9': 0.21,
'0.5': 1.39,
'0.1': 4.61,
'0.05': 5.99,
'0.025': 7.38,
'0.01': 9.21,
'0.005': 10.6 },
'3':
{ '0.995': 0.07,
'0.99': 0.11,
'0.975': 0.22,
'0.95': 0.35,
'0.9': 0.58,
'0.5': 2.37,
'0.1': 6.25,
'0.05': 7.81,
'0.025': 9.35,
'0.01': 11.34,
'0.005': 12.84 },
'4':
{ '0.995': 0.21,
'0.99': 0.3,
'0.975': 0.48,
'0.95': 0.71,
'0.9': 1.06,
'0.5': 3.36,
'0.1': 7.78,
'0.05': 9.49,
'0.025': 11.14,
'0.01': 13.28,
'0.005': 14.86 },
'5':
{ '0.995': 0.41,
'0.99': 0.55,
'0.975': 0.83,
'0.95': 1.15,
'0.9': 1.61,
'0.5': 4.35,
'0.1': 9.24,
'0.05': 11.07,
'0.025': 12.83,
'0.01': 15.09,
'0.005': 16.75 },
'6':
{ '0.995': 0.68,
'0.99': 0.87,
'0.975': 1.24,
'0.95': 1.64,
'0.9': 2.2,
'0.5': 5.35,
'0.1': 10.65,
'0.05': 12.59,
'0.025': 14.45,
'0.01': 16.81,
'0.005': 18.55 },
'7':
{ '0.995': 0.99,
'0.99': 1.25,
'0.975': 1.69,
'0.95': 2.17,
'0.9': 2.83,
'0.5': 6.35,
'0.1': 12.02,
'0.05': 14.07,
'0.025': 16.01,
'0.01': 18.48,
'0.005': 20.28 },
'8':
{ '0.995': 1.34,
'0.99': 1.65,
'0.975': 2.18,
'0.95': 2.73,
'0.9': 3.49,
'0.5': 7.34,
'0.1': 13.36,
'0.05': 15.51,
'0.025': 17.53,
'0.01': 20.09,
'0.005': 21.96 },
'9':
{ '0.995': 1.73,
'0.99': 2.09,
'0.975': 2.7,
'0.95': 3.33,
'0.9': 4.17,
'0.5': 8.34,
'0.1': 14.68,
'0.05': 16.92,
'0.025': 19.02,
'0.01': 21.67,
'0.005': 23.59 },
'10':
{ '0.995': 2.16,
'0.99': 2.56,
'0.975': 3.25,
'0.95': 3.94,
'0.9': 4.87,
'0.5': 9.34,
'0.1': 15.99,
'0.05': 18.31,
'0.025': 20.48,
'0.01': 23.21,
'0.005': 25.19 },
'11':
{ '0.995': 2.6,
'0.99': 3.05,
'0.975': 3.82,
'0.95': 4.57,
'0.9': 5.58,
'0.5': 10.34,
'0.1': 17.28,
'0.05': 19.68,
'0.025': 21.92,
'0.01': 24.72,
'0.005': 26.76 },
'12':
{ '0.995': 3.07,
'0.99': 3.57,
'0.975': 4.4,
'0.95': 5.23,
'0.9': 6.3,
'0.5': 11.34,
'0.1': 18.55,
'0.05': 21.03,
'0.025': 23.34,
'0.01': 26.22,
'0.005': 28.3 },
'13':
{ '0.995': 3.57,
'0.99': 4.11,
'0.975': 5.01,
'0.95': 5.89,
'0.9': 7.04,
'0.5': 12.34,
'0.1': 19.81,
'0.05': 22.36,
'0.025': 24.74,
'0.01': 27.69,
'0.005': 29.82 },
'14':
{ '0.995': 4.07,
'0.99': 4.66,
'0.975': 5.63,
'0.95': 6.57,
'0.9': 7.79,
'0.5': 13.34,
'0.1': 21.06,
'0.05': 23.68,
'0.025': 26.12,
'0.01': 29.14,
'0.005': 31.32 },
'15':
{ '0.995': 4.6,
'0.99': 5.23,
'0.975': 6.27,
'0.95': 7.26,
'0.9': 8.55,
'0.5': 14.34,
'0.1': 22.31,
'0.05': 25,
'0.025': 27.49,
'0.01': 30.58,
'0.005': 32.8 },
'16':
{ '0.995': 5.14,
'0.99': 5.81,
'0.975': 6.91,
'0.95': 7.96,
'0.9': 9.31,
'0.5': 15.34,
'0.1': 23.54,
'0.05': 26.3,
'0.025': 28.85,
'0.01': 32,
'0.005': 34.27 },
'17':
{ '0.995': 5.7,
'0.99': 6.41,
'0.975': 7.56,
'0.95': 8.67,
'0.9': 10.09,
'0.5': 16.34,
'0.1': 24.77,
'0.05': 27.59,
'0.025': 30.19,
'0.01': 33.41,
'0.005': 35.72 },
'18':
{ '0.995': 6.26,
'0.99': 7.01,
'0.975': 8.23,
'0.95': 9.39,
'0.9': 10.87,
'0.5': 17.34,
'0.1': 25.99,
'0.05': 28.87,
'0.025': 31.53,
'0.01': 34.81,
'0.005': 37.16 },
'19':
{ '0.995': 6.84,
'0.99': 7.63,
'0.975': 8.91,
'0.95': 10.12,
'0.9': 11.65,
'0.5': 18.34,
'0.1': 27.2,
'0.05': 30.14,
'0.025': 32.85,
'0.01': 36.19,
'0.005': 38.58 },
'20':
{ '0.995': 7.43,
'0.99': 8.26,
'0.975': 9.59,
'0.95': 10.85,
'0.9': 12.44,
'0.5': 19.34,
'0.1': 28.41,
'0.05': 31.41,
'0.025': 34.17,
'0.01': 37.57,
'0.005': 40 },
'21':
{ '0.995': 8.03,
'0.99': 8.9,
'0.975': 10.28,
'0.95': 11.59,
'0.9': 13.24,
'0.5': 20.34,
'0.1': 29.62,
'0.05': 32.67,
'0.025': 35.48,
'0.01': 38.93,
'0.005': 41.4 },
'22':
{ '0.995': 8.64,
'0.99': 9.54,
'0.975': 10.98,
'0.95': 12.34,
'0.9': 14.04,
'0.5': 21.34,
'0.1': 30.81,
'0.05': 33.92,
'0.025': 36.78,
'0.01': 40.29,
'0.005': 42.8 },
'23':
{ '0.995': 9.26,
'0.99': 10.2,
'0.975': 11.69,
'0.95': 13.09,
'0.9': 14.85,
'0.5': 22.34,
'0.1': 32.01,
'0.05': 35.17,
'0.025': 38.08,
'0.01': 41.64,
'0.005': 44.18 },
'24':
{ '0.995': 9.89,
'0.99': 10.86,
'0.975': 12.4,
'0.95': 13.85,
'0.9': 15.66,
'0.5': 23.34,
'0.1': 33.2,
'0.05': 36.42,
'0.025': 39.36,
'0.01': 42.98,
'0.005': 45.56 },
'25':
{ '0.995': 10.52,
'0.99': 11.52,
'0.975': 13.12,
'0.95': 14.61,
'0.9': 16.47,
'0.5': 24.34,
'0.1': 34.28,
'0.05': 37.65,
'0.025': 40.65,
'0.01': 44.31,
'0.005': 46.93 },
'26':
{ '0.995': 11.16,
'0.99': 12.2,
'0.975': 13.84,
'0.95': 15.38,
'0.9': 17.29,
'0.5': 25.34,
'0.1': 35.56,
'0.05': 38.89,
'0.025': 41.92,
'0.01': 45.64,
'0.005': 48.29 },
'27':
{ '0.995': 11.81,
'0.99': 12.88,
'0.975': 14.57,
'0.95': 16.15,
'0.9': 18.11,
'0.5': 26.34,
'0.1': 36.74,
'0.05': 40.11,
'0.025': 43.19,
'0.01': 46.96,
'0.005': 49.65 },
'28':
{ '0.995': 12.46,
'0.99': 13.57,
'0.975': 15.31,
'0.95': 16.93,
'0.9': 18.94,
'0.5': 27.34,
'0.1': 37.92,
'0.05': 41.34,
'0.025': 44.46,
'0.01': 48.28,
'0.005': 50.99 },
'29':
{ '0.995': 13.12,
'0.99': 14.26,
'0.975': 16.05,
'0.95': 17.71,
'0.9': 19.77,
'0.5': 28.34,
'0.1': 39.09,
'0.05': 42.56,
'0.025': 45.72,
'0.01': 49.59,
'0.005': 52.34 },
'30':
{ '0.995': 13.79,
'0.99': 14.95,
'0.975': 16.79,
'0.95': 18.49,
'0.9': 20.6,
'0.5': 29.34,
'0.1': 40.26,
'0.05': 43.77,
'0.025': 46.98,
'0.01': 50.89,
'0.005': 53.67 },
'40':
{ '0.995': 20.71,
'0.99': 22.16,
'0.975': 24.43,
'0.95': 26.51,
'0.9': 29.05,
'0.5': 39.34,
'0.1': 51.81,
'0.05': 55.76,
'0.025': 59.34,
'0.01': 63.69,
'0.005': 66.77 },
'50':
{ '0.995': 27.99,
'0.99': 29.71,
'0.975': 32.36,
'0.95': 34.76,
'0.9': 37.69,
'0.5': 49.33,
'0.1': 63.17,
'0.05': 67.5,
'0.025': 71.42,
'0.01': 76.15,
'0.005': 79.49 },
'60':
{ '0.995': 35.53,
'0.99': 37.48,
'0.975': 40.48,
'0.95': 43.19,
'0.9': 46.46,
'0.5': 59.33,
'0.1': 74.4,
'0.05': 79.08,
'0.025': 83.3,
'0.01': 88.38,
'0.005': 91.95 },
'70':
{ '0.995': 43.28,
'0.99': 45.44,
'0.975': 48.76,
'0.95': 51.74,
'0.9': 55.33,
'0.5': 69.33,
'0.1': 85.53,
'0.05': 90.53,
'0.025': 95.02,
'0.01': 100.42,
'0.005': 104.22 },
'80':
{ '0.995': 51.17,
'0.99': 53.54,
'0.975': 57.15,
'0.95': 60.39,
'0.9': 64.28,
'0.5': 79.33,
'0.1': 96.58,
'0.05': 101.88,
'0.025': 106.63,
'0.01': 112.33,
'0.005': 116.32 },
'90':
{ '0.995': 59.2,
'0.99': 61.75,
'0.975': 65.65,
'0.95': 69.13,
'0.9': 73.29,
'0.5': 89.33,
'0.1': 107.57,
'0.05': 113.14,
'0.025': 118.14,
'0.01': 124.12,
'0.005': 128.3 },
'100':
{ '0.995': 67.33,
'0.99': 70.06,
'0.975': 74.22,
'0.95': 77.93,
'0.9': 82.36,
'0.5': 99.33,
'0.1': 118.5,
'0.05': 124.34,
'0.025': 129.56,
'0.01': 135.81,
'0.005': 140.17 } };
var chiSquaredDistributionTable = {
'1': {
'0.995': 0,
'0.99': 0,
'0.975': 0,
'0.95': 0,
'0.9': 0.02,
'0.5': 0.45,
'0.1': 2.71,
'0.05': 3.84,
'0.025': 5.02,
'0.01': 6.63,
'0.005': 7.88
},
'2': {
'0.995': 0.01,
'0.99': 0.02,
'0.975': 0.05,
'0.95': 0.1,
'0.9': 0.21,
'0.5': 1.39,
'0.1': 4.61,
'0.05': 5.99,
'0.025': 7.38,
'0.01': 9.21,
'0.005': 10.6
},
'3': {
'0.995': 0.07,
'0.99': 0.11,
'0.975': 0.22,
'0.95': 0.35,
'0.9': 0.58,
'0.5': 2.37,
'0.1': 6.25,
'0.05': 7.81,
'0.025': 9.35,
'0.01': 11.34,
'0.005': 12.84
},
'4': {
'0.995': 0.21,
'0.99': 0.3,
'0.975': 0.48,
'0.95': 0.71,
'0.9': 1.06,
'0.5': 3.36,
'0.1': 7.78,
'0.05': 9.49,
'0.025': 11.14,
'0.01': 13.28,
'0.005': 14.86
},
'5': {
'0.995': 0.41,
'0.99': 0.55,
'0.975': 0.83,
'0.95': 1.15,
'0.9': 1.61,
'0.5': 4.35,
'0.1': 9.24,
'0.05': 11.07,
'0.025': 12.83,
'0.01': 15.09,
'0.005': 16.75
},
'6': {
'0.995': 0.68,
'0.99': 0.87,
'0.975': 1.24,
'0.95': 1.64,
'0.9': 2.2,
'0.5': 5.35,
'0.1': 10.65,
'0.05': 12.59,
'0.025': 14.45,
'0.01': 16.81,
'0.005': 18.55
},
'7': {
'0.995': 0.99,
'0.99': 1.25,
'0.975': 1.69,
'0.95': 2.17,
'0.9': 2.83,
'0.5': 6.35,
'0.1': 12.02,
'0.05': 14.07,
'0.025': 16.01,
'0.01': 18.48,
'0.005': 20.28
},
'8': {
'0.995': 1.34,
'0.99': 1.65,
'0.975': 2.18,
'0.95': 2.73,
'0.9': 3.49,
'0.5': 7.34,
'0.1': 13.36,
'0.05': 15.51,
'0.025': 17.53,
'0.01': 20.09,
'0.005': 21.96
},
'9': {
'0.995': 1.73,
'0.99': 2.09,
'0.975': 2.7,
'0.95': 3.33,
'0.9': 4.17,
'0.5': 8.34,
'0.1': 14.68,
'0.05': 16.92,
'0.025': 19.02,
'0.01': 21.67,
'0.005': 23.59
},
'10': {
'0.995': 2.16,
'0.99': 2.56,
'0.975': 3.25,
'0.95': 3.94,
'0.9': 4.87,
'0.5': 9.34,
'0.1': 15.99,
'0.05': 18.31,
'0.025': 20.48,
'0.01': 23.21,
'0.005': 25.19
},
'11': {
'0.995': 2.6,
'0.99': 3.05,
'0.975': 3.82,
'0.95': 4.57,
'0.9': 5.58,
'0.5': 10.34,
'0.1': 17.28,
'0.05': 19.68,
'0.025': 21.92,
'0.01': 24.72,
'0.005': 26.76
},
'12': {
'0.995': 3.07,
'0.99': 3.57,
'0.975': 4.4,
'0.95': 5.23,
'0.9': 6.3,
'0.5': 11.34,
'0.1': 18.55,
'0.05': 21.03,
'0.025': 23.34,
'0.01': 26.22,
'0.005': 28.3
},
'13': {
'0.995': 3.57,
'0.99': 4.11,
'0.975': 5.01,
'0.95': 5.89,
'0.9': 7.04,
'0.5': 12.34,
'0.1': 19.81,
'0.05': 22.36,
'0.025': 24.74,
'0.01': 27.69,
'0.005': 29.82
},
'14': {
'0.995': 4.07,
'0.99': 4.66,
'0.975': 5.63,
'0.95': 6.57,
'0.9': 7.79,
'0.5': 13.34,
'0.1': 21.06,
'0.05': 23.68,
'0.025': 26.12,
'0.01': 29.14,
'0.005': 31.32
},
'15': {
'0.995': 4.6,
'0.99': 5.23,
'0.975': 6.27,
'0.95': 7.26,
'0.9': 8.55,
'0.5': 14.34,
'0.1': 22.31,
'0.05': 25,
'0.025': 27.49,
'0.01': 30.58,
'0.005': 32.8
},
'16': {
'0.995': 5.14,
'0.99': 5.81,
'0.975': 6.91,
'0.95': 7.96,
'0.9': 9.31,
'0.5': 15.34,
'0.1': 23.54,
'0.05': 26.3,
'0.025': 28.85,
'0.01': 32,
'0.005': 34.27
},
'17': {
'0.995': 5.7,
'0.99': 6.41,
'0.975': 7.56,
'0.95': 8.67,
'0.9': 10.09,
'0.5': 16.34,
'0.1': 24.77,
'0.05': 27.59,
'0.025': 30.19,
'0.01': 33.41,
'0.005': 35.72
},
'18': {
'0.995': 6.26,
'0.99': 7.01,
'0.975': 8.23,
'0.95': 9.39,
'0.9': 10.87,
'0.5': 17.34,
'0.1': 25.99,
'0.05': 28.87,
'0.025': 31.53,
'0.01': 34.81,
'0.005': 37.16
},
'19': {
'0.995': 6.84,
'0.99': 7.63,
'0.975': 8.91,
'0.95': 10.12,
'0.9': 11.65,
'0.5': 18.34,
'0.1': 27.2,
'0.05': 30.14,
'0.025': 32.85,
'0.01': 36.19,
'0.005': 38.58
},
'20': {
'0.995': 7.43,
'0.99': 8.26,
'0.975': 9.59,
'0.95': 10.85,
'0.9': 12.44,
'0.5': 19.34,
'0.1': 28.41,
'0.05': 31.41,
'0.025': 34.17,
'0.01': 37.57,
'0.005': 40
},
'21': {
'0.995': 8.03,
'0.99': 8.9,
'0.975': 10.28,
'0.95': 11.59,
'0.9': 13.24,
'0.5': 20.34,
'0.1': 29.62,
'0.05': 32.67,
'0.025': 35.48,
'0.01': 38.93,
'0.005': 41.4
},
'22': {
'0.995': 8.64,
'0.99': 9.54,
'0.975': 10.98,
'0.95': 12.34,
'0.9': 14.04,
'0.5': 21.34,
'0.1': 30.81,
'0.05': 33.92,
'0.025': 36.78,
'0.01': 40.29,
'0.005': 42.8
},
'23': {
'0.995': 9.26,
'0.99': 10.2,
'0.975': 11.69,
'0.95': 13.09,
'0.9': 14.85,
'0.5': 22.34,
'0.1': 32.01,
'0.05': 35.17,
'0.025': 38.08,
'0.01': 41.64,
'0.005': 44.18
},
'24': {
'0.995': 9.89,
'0.99': 10.86,
'0.975': 12.4,
'0.95': 13.85,
'0.9': 15.66,
'0.5': 23.34,
'0.1': 33.2,
'0.05': 36.42,
'0.025': 39.36,
'0.01': 42.98,
'0.005': 45.56
},
'25': {
'0.995': 10.52,
'0.99': 11.52,
'0.975': 13.12,
'0.95': 14.61,
'0.9': 16.47,
'0.5': 24.34,
'0.1': 34.28,
'0.05': 37.65,
'0.025': 40.65,
'0.01': 44.31,
'0.005': 46.93
},
'26': {
'0.995': 11.16,
'0.99': 12.2,
'0.975': 13.84,
'0.95': 15.38,
'0.9': 17.29,
'0.5': 25.34,
'0.1': 35.56,
'0.05': 38.89,
'0.025': 41.92,
'0.01': 45.64,
'0.005': 48.29
},
'27': {
'0.995': 11.81,
'0.99': 12.88,
'0.975': 14.57,
'0.95': 16.15,
'0.9': 18.11,
'0.5': 26.34,
'0.1': 36.74,
'0.05': 40.11,
'0.025': 43.19,
'0.01': 46.96,
'0.005': 49.65
},
'28': {
'0.995': 12.46,
'0.99': 13.57,
'0.975': 15.31,
'0.95': 16.93,
'0.9': 18.94,
'0.5': 27.34,
'0.1': 37.92,
'0.05': 41.34,
'0.025': 44.46,
'0.01': 48.28,
'0.005': 50.99
},
'29': {
'0.995': 13.12,
'0.99': 14.26,
'0.975': 16.05,
'0.95': 17.71,
'0.9': 19.77,
'0.5': 28.34,
'0.1': 39.09,
'0.05': 42.56,
'0.025': 45.72,
'0.01': 49.59,
'0.005': 52.34
},
'30': {
'0.995': 13.79,
'0.99': 14.95,
'0.975': 16.79,
'0.95': 18.49,
'0.9': 20.6,
'0.5': 29.34,
'0.1': 40.26,
'0.05': 43.77,
'0.025': 46.98,
'0.01': 50.89,
'0.005': 53.67
},
'40': {
'0.995': 20.71,
'0.99': 22.16,
'0.975': 24.43,
'0.95': 26.51,
'0.9': 29.05,
'0.5': 39.34,
'0.1': 51.81,
'0.05': 55.76,
'0.025': 59.34,
'0.01': 63.69,
'0.005': 66.77
},
'50': {
'0.995': 27.99,
'0.99': 29.71,
'0.975': 32.36,
'0.95': 34.76,
'0.9': 37.69,
'0.5': 49.33,
'0.1': 63.17,
'0.05': 67.5,
'0.025': 71.42,
'0.01': 76.15,
'0.005': 79.49
},
'60': {
'0.995': 35.53,
'0.99': 37.48,
'0.975': 40.48,
'0.95': 43.19,
'0.9': 46.46,
'0.5': 59.33,
'0.1': 74.4,
'0.05': 79.08,
'0.025': 83.3,
'0.01': 88.38,
'0.005': 91.95
},
'70': {
'0.995': 43.28,
'0.99': 45.44,
'0.975': 48.76,
'0.95': 51.74,
'0.9': 55.33,
'0.5': 69.33,
'0.1': 85.53,
'0.05': 90.53,
'0.025': 95.02,
'0.01': 100.42,
'0.005': 104.22
},
'80': {
'0.995': 51.17,
'0.99': 53.54,
'0.975': 57.15,
'0.95': 60.39,
'0.9': 64.28,
'0.5': 79.33,
'0.1': 96.58,
'0.05': 101.88,
'0.025': 106.63,
'0.01': 112.33,
'0.005': 116.32
},
'90': {
'0.995': 59.2,
'0.99': 61.75,
'0.975': 65.65,
'0.95': 69.13,
'0.9': 73.29,
'0.5': 89.33,
'0.1': 107.57,
'0.05': 113.14,
'0.025': 118.14,
'0.01': 124.12,
'0.005': 128.3
},
'100': {
'0.995': 67.33,
'0.99': 70.06,
'0.975': 74.22,
'0.95': 77.93,
'0.9': 82.36,
'0.5': 99.33,
'0.1': 118.5,
'0.05': 124.34,
'0.025': 129.56,
'0.01': 135.81,
'0.005': 140.17
}
};
module.exports = chiSquaredDistributionTable;

@@ -19,3 +19,3 @@ 'use strict';

// On the first iteration of this loop, max is
// NaN and is thus made the maximum element in the array
// undefined and is thus made the maximum element in the array
if (value === undefined || x[i] > value) {

@@ -22,0 +22,0 @@ value = x[i];

@@ -16,3 +16,3 @@ 'use strict';

// On the first iteration of this loop, min is
// NaN and is thus made the minimum element in the array
// undefined and is thus made the minimum element in the array
if (value === undefined || x[i] < value) {

@@ -19,0 +19,0 @@ value = x[i];

@@ -6,3 +6,3 @@ 'use strict';

/*
/**
* The [sample variance](https://en.wikipedia.org/wiki/Variance#Sample_variance)

@@ -9,0 +9,0 @@ * is the sum of squared deviations from the mean. The sample variance

@@ -15,4 +15,4 @@ 'use strict';

* @param {number} n count of how many elements to take
* @param {Function} [randomSource=Math.random] an optional source of entropy
* instead of Math.random
* @param {Function} [randomSource=Math.random] an optional entropy source that
* returns numbers between 0 inclusive and 1 exclusive: the range [0, 1)
* @return {Array} subset of n elements in original array

@@ -19,0 +19,0 @@ * @example

'use strict';
/* @flow */
/*
/**
* A [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle)

@@ -13,3 +13,4 @@ * in-place - which means that it **will change the order of the original

* @param {Array} sample input array
* @param {Function} [randomSource=Math.random] an optional source of entropy
* @param {Function} [randomSource=Math.random] an optional entropy source that
* returns numbers between 0 inclusive and 1 exclusive: the range [0, 1)
* @returns {Array} sample

@@ -16,0 +17,0 @@ * @example

@@ -6,3 +6,3 @@ 'use strict';

/*
/**
* A [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle)

@@ -14,3 +14,4 @@ * is a fast way to create a random permutation of a finite set. This is

* @param {Array} sample an array of any kind of element
* @param {Function} [randomSource=Math.random] an optional entropy source
* @param {Function} [randomSource=Math.random] an optional entropy source that
* returns numbers between 0 inclusive and 1 exclusive: the range [0, 1)
* @return {Array} shuffled version of input

@@ -17,0 +18,0 @@ * @example

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc