From b702adaaa9d35280e07a5f69360ad04541c1f5ca Mon Sep 17 00:00:00 2001 From: Scott Chamberlain Date: Sat, 6 May 2017 08:33:54 -0700 Subject: [PATCH] update simple-statistics, fix #66 also update license files for all JS libraries fixes to test-max and test-min for new version --- inst/js/LICENSE-geojson-random | 2 +- inst/js/LICENSE-geojsonhint | 29 +++-------------------------- inst/js/LICENSE-turfjs | 2 +- inst/js/README.md | 6 ++++-- inst/js/simple-statistics.js | 2 +- tests/testthat/test-max.R | 4 ++-- tests/testthat/test-min.R | 2 +- 7 files changed, 13 insertions(+), 34 deletions(-) diff --git a/inst/js/LICENSE-geojson-random b/inst/js/LICENSE-geojson-random index 864f567..1b74fa5 100644 --- a/inst/js/LICENSE-geojson-random +++ b/inst/js/LICENSE-geojson-random @@ -1,6 +1,6 @@ ISC License -Copyright (c) 2014, Tom MacWright +Copyright (c) 2017, Tom MacWright Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/inst/js/LICENSE-geojsonhint b/inst/js/LICENSE-geojsonhint index bd3c417..f7e105e 100644 --- a/inst/js/LICENSE-geojsonhint +++ b/inst/js/LICENSE-geojsonhint @@ -1,28 +1,5 @@ -Copyright (c) 2014, Tom MacWright +Copyright 2017 Mapbox +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of geojsonhint nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/inst/js/LICENSE-turfjs b/inst/js/LICENSE-turfjs index f9d5009..96ce51b 100644 --- a/inst/js/LICENSE-turfjs +++ b/inst/js/LICENSE-turfjs @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013 Morgan Herlocker +Copyright (c) 2017 TurfJS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/inst/js/README.md b/inst/js/README.md index 7a6f5b2..1006250 100644 --- a/inst/js/README.md +++ b/inst/js/README.md @@ -63,13 +63,15 @@ cp turf-invariant.js lawn/inst/js/ ## simple-statistics -Currently (as of 2016-10-12) using `simple-statistics` `v2.1.0` +Currently (as of 2017-05-06) using `simple-statistics` `v4.1.0` To recreate `inst/js/simple-statistics.js`: -Download the minified file from +Download the minified file from to `inst/js` directory in the `lawn` package + + ## geojsonhint Currently (as of 2016-10-12) using `geojsonhint` `v2.0.0-beta2` diff --git a/inst/js/simple-statistics.js b/inst/js/simple-statistics.js index aab8634..39b6e0d 100644 --- a/inst/js/simple-statistics.js +++ b/inst/js/simple-statistics.js @@ -1,2 +1,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;ut||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(!(0>r||r>1||0>=t||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(1-o>e);return u}}var o=t(10),i=t(13);r.exports=e},{10:10,13:13}],5:[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},{}],6:[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=0;u--)l[u]<3&&(l[u-1]+=l[u],l.pop(),h[u-1]+=h[u],h.pop());for(u=0;u=r)throw new Error("chunk size must be a positive integer");for(var e=0;ee;e++){for(var o=[],i=0;r>i;i++)o.push(0);n.push(o)}return n}function o(t,r){if(r>t.length)throw new Error("Cannot generate more classes than there are data values");var n=u(t),o=i(n);if(1===o)return[n];for(var a=e(r,n.length),s=e(r,n.length),f=0;r>f;f++)for(var c=n[0],h=Math.max(f,1);h=f;d--)v+=(h-d)/(h-d+1)*Math.pow(n[d]-g,2),g=(n[d]+(h-d)*g)/(h-d+1),d===h?(a[f][h]=v,s[f][h]=d,d>0&&(a[f][h]+=a[f-1][d-1])):0===d?v<=a[f][h]&&(a[f][h]=v,s[f][h]=d):v+a[f-1][d-1]=0;f--){var m=s[f][M];x[f]=n.slice(m,M+1),f>0&&(M=m-1)}return x}var i=t(56),u=t(31);r.exports=o},{31:31,56:56}],9:[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(50);r.exports=e},{50:50}],10:[function(t,r,n){"use strict";var e=1e-4;r.exports=e},{}],11:[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;r>s;s++)u.push(u[0]+a*s);return u.push(e),u}var o=t(20),i=t(26);r.exports=e},{20:20,26:26}],12:[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},{}],13:[function(t,r,n){"use strict";function e(t){if(0>t)return NaN;for(var r=1,n=2;t>=n;n++)r*=n;return r}r.exports=e},{}],14:[function(t,r,n){"use strict";function e(t){if(0!==t.length){for(var r=1,n=0;n=0?n:-n}r.exports=e},{}],18:[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;e>h;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},{}],19:[function(t,r,n){"use strict";function e(t){return function(r){return t.b+t.m*r}}r.exports=e},{}],20:[function(t,r,n){"use strict";function e(t){for(var r,n=0;nr)&&(r=t[n]);return void 0===r?NaN:r}r.exports=e},{}],21:[function(t,r,n){"use strict";function e(t){return t[t.length-1]}r.exports=e},{}],22:[function(t,r,n){"use strict";function e(t){return 0===t.length?NaN:o(t)/t.length}var o=t(51);r.exports=e},{51:51}],23:[function(t,r,n){"use strict";function e(t){return+o(t,.5)}var o=t(36);r.exports=e},{36:36}],24:[function(t,r,n){"use strict";function e(t){for(var r=o(t),n=[],e=0;ee&&(e=o,n=r),o=1,r=t[i]):o++;return n}r.exports=e},{}],31:[function(t,r,n){"use strict";function e(t){return t.slice().sort(function(t,r){return t-r})}r.exports=e},{}],32:[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;n0?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=t)){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(1-o>n);return e}}var o=t(10),i=t(13);r.exports=e},{10:10,13:13}],34:[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(10),i=t(17);r.exports=e},{10:10,17:17}],35:[function(t,r,n){"use strict";function e(t){for(var r=1,n=0;n=s-f)){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(37),f=t(38);r.exports=e},{37:37,38:38}],37:[function(t,r,n){"use strict";function e(t,r){var n=t.length*r;return 0>r||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},{}],38:[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);0>a-u/2&&(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);g>v;){for(o(t,v,g),v++,g--;t[v]p;)g--}t[n]===p?o(t,n,g):(g++,o(t,g,i)),r>=g&&(n=g+1),g>=r&&(i=g-1)}}function o(t,r,n){var e=t[r];t[r]=t[n],t[n]=e}r.exports=e},{}],39:[function(t,r,n){"use strict";function e(t,r){if(t.length<2)return 1;for(var n,e=0,o=0;o0;)e=Math.floor(r()*o--),n=t[o],t[o]=t[e],t[e]=n;return t}r.exports=e},{}],49:[function(t,r,n){"use strict";function e(t){var r=o(t);return isNaN(r)?0:Math.sqrt(r)}var o=t(57);r.exports=e},{57:57}],50:[function(t,r,n){"use strict";function e(t){for(var r=t,n=t,e=1;15>e;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;3.09>=u;u+=.01)i.push(e(u));r.exports=i},{}],51:[function(t,r,n){"use strict";function e(t){for(var r,n,e=0,o=0,i=0;i1)throw new Error("bernoulliDistribution requires probability to be between 0 and 1 inclusive");return[1-t,t]}r.exports=e},{}],5:[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,i=[],a=1;do{i[n]=a*Math.pow(r,n)*Math.pow(1-r,t-n),e+=i[n],n++,a=a*(t-n+1)/n}while(e<1-o);return i}}var o=t(16);r.exports=e},{16:16}],6:[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 a=0;a=0;a--)h[a]<3&&(h[a-1]+=h[a],h.pop(),c[a-1]+=c[a],c.pop());for(a=0;a0){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,a,u,s){if(!(t>r)){var f=Math.floor((t+r)/2);e[n][f]=e[n-1][f-1],a[n][f]=f;var c=n;t>n&&(c=Math.max(c,a[n][t-1]||0)),c=Math.max(c,a[n-1][f]||0);var h=f-1;r=c&&!((l=o(w,f,u,s))+e[n-1][c-1]>=e[n][f]);--w)p=o(c,f,u,s),v=p+e[n-1][c-1],vt.length)throw new Error("cannot generate more classes than there are data values");var n=f(t);if(1===s(n))return[n];var o=e(r,n.length),i=e(r,n.length);a(n,o,i);for(var u=[],c=i[0].length-1,h=i.length-1;h>=0;h--){var l=i[h][c];u[h]=n.slice(l,c+1),h>0&&(c=l-1)}return u}var s=t(67),f=t(37);r.exports=u},{37:37,67:67}],11:[function(t,r,n){"use strict";function e(t,r){var n,o,i,a,u=[];for(n=0;n=0?o[n]:+(1-o[n]).toFixed(4)}var o=t(60);r.exports=e},{60:60}],16:[function(t,r,n){"use strict";r.exports=1e-4},{}],17:[function(t,r,n){"use strict";function e(t,r){if(t.length<2)return t;for(var n=i(t),e=o(t),a=[n],u=(e-n)/r,s=1;s=0?1-n:n-1}r.exports=e},{}],19:[function(t,r,n){"use strict";function e(t){if(t<0)throw new Error("factorial requires a non-negative value");if(Math.floor(t)!==t)throw new Error("factorial requires an integer input");for(var r=1,n=2;n<=t;n++)r*=n;return r}r.exports=e},{}],20:[function(t,r,n){"use strict";function e(t){if(0===t.length)throw new Error("geometricMean requires at least one data point");for(var r=1,n=0;n=0?n:-n}r.exports=e},{}],24:[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,a,u=0,s=0,f=0,c=0,h=0;hr&&(r=t[n]);return r}r.exports=e},{}],27:[function(t,r,n){"use strict";function e(t){return t[t.length-1]}r.exports=e},{}],28:[function(t,r,n){"use strict";function e(t){if(0===t.length)throw new Error("mean requires at least one data point");return o(t)/t.length}var o=t(62);r.exports=e},{62:62}],29:[function(t,r,n){"use strict";function e(t){return+o(t,.5)}var o=t(43);r.exports=e},{43:43}],30:[function(t,r,n){"use strict";function e(t){for(var r=o(t),n=[],e=0;ee&&(r=t[o],e=i),n.set(t[o],i)}if(0===e)throw new Error("mode requires at last one data point");return r}r.exports=e},{}],36:[function(t,r,n){"use strict";function e(t){if(0===t.length)throw new Error("mode requires at least one data point");if(1===t.length)return t[0];for(var r=t[0],n=NaN,e=0,o=1,i=1;ie&&(e=o,n=r),o=1,r=t[i]):o++;return n}r.exports=e},{}],37:[function(t,r,n){"use strict";function e(t){return t.slice().sort(function(t,r){return t-r})}r.exports=e},{}],38:[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;n0?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=1&&(t=1-o),Math.sqrt(2)*i(2*t-1)}var o=t(16),i=t(23);r.exports=e},{16:16,23:23}],42:[function(t,r,n){"use strict";function e(t){for(var r=1,n=0;n1)throw new Error("quantiles must be between 0 and 1");return 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},{}],45:[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 a=i-n+1,u=r-n+1,s=Math.log(a),f=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*f*(a-f)/a);u-a/2<0&&(c*=-1);e(t,r,Math.max(n,Math.floor(r-u*f/a+c)),Math.min(i,Math.floor(r+(a-u)*f/a+c)))}var h=t[r],l=n,p=i;for(o(t,n,r),t[i]>h&&o(t,n,i);lh;)p--}t[n]===h?o(t,n,p):(p++,o(t,p,i)),p<=r&&(n=p+1),r<=p&&(i=p-1)}}function o(t,r,n){var e=t[r];t[r]=t[n],t[n]=e}r.exports=e},{}],46:[function(t,r,n){"use strict";function e(t,r){if(t.length<2)return 1;for(var n,e=0,o=0;o0;)e=Math.floor(r()*o--),n=t[o],t[o]=t[e],t[e]=n;return t}r.exports=e},{}],58:[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},{}],59:[function(t,r,n){"use strict";function e(t){if(1===t.length)return 0;var r=o(t);return Math.sqrt(r)}var o=t(68);r.exports=e},{68:68}],60:[function(t,r,n){"use strict";for(var e=Math.sqrt(2*Math.PI),o=[],i=0;i<=3.09;i+=.01)o.push(function(t){for(var r=t,n=t,o=1;o<15;o++)n*=t*t/(2*o+1),r+=n;return Math.round(1e4*(.5+r/e*Math.exp(-t*t/2)))/1e4}(i));r.exports=o},{}],61:[function(t,r,n){"use strict";function e(t,r,n){return(t*r-n)/(r-1)}r.exports=e},{}],62:[function(t,r,n){"use strict";function e(t){if(0===t.length)return 0;for(var r,n=t[0],e=0,o=1;o=Math.abs(t[o])?e+=n-r+t[o]:e+=t[o]-r+n,n=r;return n+e}r.exports=e},{}],63:[function(t,r,n){"use strict";function e(t,r){var n,e,i=o(t),a=0;if(2===r)for(e=0;e