/*
		Now we need to solve Eq 4.2 to obtain x.  For any given value of
		eta there are two solutions to this equation, and since the distribution
		may be very skewed, these are not related by x ~ 1-x we used when
		implementing section 3 above.  However we know that:

			cross < x <= 1       ; iff eta < mu
				x == cross   ; iff eta == mu
				0 <= x < cross    ; iff eta > mu

		Where cross == 1 / (1 + mu)
		Many thanks to Prof Temme for clarifying this point. Therefore we'll just jump straight into Newton iterations to solve Eq 4.2 using these bounds, and simple bisection as the first guess, in practice this converges pretty quickly and we only need a few digits correct anyway:
	*/

/*
	*    function evalpoly( x ) {
	*        if ( x === 0.0 ) {
	*            return c[ 0 ];
	*        }
	*        return c[0]+x*(c[1]+x*(c[2]+x*(c[3]+...+x*(c[n-2]+x*c[n-1]))));
	*    }
	*/

/*
	* Create the index input arguments along with the value to set...
	* > function set( i0, i1, ..., v ) {
	*/

/*
	* Create the index input arguments...
	* > function get( i0, i1, ...) {
	*/

/*
	* Create the index input arguments...
	* > function set( i0, i1,..., v ) {
	*/

/*
	* Index into the array according to the offset and strides...
	* > data[offset+strides[0]*i0+strides[1]*i1+...] = v;
	*/

/*
	* Index into the array according to the offset and strides...
	* > return data[offset+strides[0]*i0+strides[1]*i1+...];
	*/

/*
	* Resolve indices based on the index mode.
	* > i0 = getIndex( i0, shape[0]-1, mode );
	*/

/*
	* Type check each index.
	* > if ( !isInteger( i0 ) ) { throw new TypeError( ... ) }
	*/

/*
	* e.g.,
	*
	*   function flattenArray( x ) {
	*       var o = [];
	*       var i0, i1;
	*       for ( i0 = 0; i0 < 2; i0++ ) {
	*           for ( i1 = 0; i1 < 2; i1++ ) {
	*               o.push( x[i0][i1] );
	*           }
	*       }
	*       return o;
	*   }
	*/

/*
	* e.g.,
	*     function get( i0, i1, i2 ) {
	*         if ( !isInteger( i0 ) ) {
	*             throw new TypeError( 'invalid argument. Indices must be integer valued. Argument: 0. Value: `'+i0+'`.' );
	*         }
	*         if ( !isInteger( i1 ) ) {
	*             throw new TypeError( 'invalid argument. Indices must be integer valued. Argument: 1. Value: `'+i1+'`.' );
	*         }
	*         if ( !isInteger( i2 ) ) {
	*             throw new TypeError( 'invalid argument. Indices must be integer valued. Argument: 2. Value: `'+i2+'`.' );
	*         }
	*         i0 = getIndex( i0, this._shape[0]-1, 'throw' );
	*         i1 = getIndex( i1, this._shape[1]-1, 'throw' );
	*         i2 = getIndex( i2, this._shape[2]-1, 'throw' );
	*         return this._buffer[ this._offset + this._strides[0]*i0 + this._strides[1]*i1 + this._strides[2]*i2 ];
	*     }
	*/

/*
	* e.g.,
	*     function get( i0, i1, i2 ) {
	*         return this._buffer[ this._offset + this._strides[0]*i0 + this._strides[1]*i1 + this._strides[2]*i2 ];
	*     }
	*/

/*
	* e.g.,
	*     function set( i0, i1, i2, v ) {
	*         if ( !isInteger( i0 ) ) {
	*             throw new TypeError( 'invalid argument. Indices must be integer valued. Argument: 0. Value: `'+i0+'`.' );
	*         }
	*         if ( !isInteger( i1 ) ) {
	*             throw new TypeError( 'invalid argument. Indices must be integer valued. Argument: 1. Value: `'+i1+'`.' );
	*         }
	*         if ( !isInteger( i2 ) ) {
	*             throw new TypeError( 'invalid argument. Indices must be integer valued. Argument: 2. Value: `'+i2+'`.' );
	*         }
	*         i0 = getIndex( i0, this._shape[0]-1, 'throw' );
	*         i1 = getIndex( i1, this._shape[1]-1, 'throw' );
	*         i2 = getIndex( i2, this._shape[2]-1, 'throw' );
	*         this._buffer[ this._offset + this._strides[0]*i0 + this._strides[1]*i1 + this._strides[2]*i2 ] = v;
	*         return this;
	*     }
	*/

/*
	* e.g.,
	*     function set( i0, i1, i2, v ) {
	*         this._buffer[ this._offset + this._strides[0]*i0 + this._strides[1]*i1 + this._strides[2]*i2 ] = v;
	*         return this;
	*     }
	*/

/*
         * Let's add some basic statistics about the beta's to be able to interpret them.
         * source: http://dept.stat.lsa.umich.edu/~kshedden/Courses/Stat401/Notes/401-multreg.pdf
         * validated against Excel Regression AddIn
         * test: "datamining statistics test"
         */

/*
* Adapted from MIT-licensed code.
*
* Copyright (c) 2014. Athan Reines.
*
* @source https://github.com/compute-io/iqr
*/

/*
* Adapted from MIT-licensed code.
*
* Copyright (c) 2014. Athan Reines.
*
* @source https://github.com/compute-io/max
*/

/*
* Adapted from MIT-licensed code.
*
* Copyright (c) 2014. Athan Reines.
*
* @source https://github.com/compute-io/mean
*/

/*
* Adapted from MIT-licensed code.
*
* Copyright (c) 2014. Athan Reines.
*
* @source https://github.com/compute-io/median
*/

/*
* Adapted from MIT-licensed code.
*
* Copyright (c) 2014. Athan Reines.
*
* @source https://github.com/compute-io/min
*/

/*
* Adapted from MIT-licensed code.
*
* Copyright (c) 2014. Athan Reines.
*
* @source https://github.com/compute-io/pcorr
*/

/*
* Adapted from MIT-licensed code.
*
* Copyright (c) 2014. Athan Reines.
*
* @source https://github.com/compute-io/range
*/

/*
* Adapted from MIT-licensed code.
*
* Copyright (c) 2014. Athan Reines.
*
* @source https://github.com/compute-io/stdev
*/

/*
* Adapted from MIT-licensed code.
*
* Copyright (c) 2014. Athan Reines.
*
* @source https://github.com/compute-io/variance
*/

/*
* Notes:
*	=> sin(-x) = -sin(x)
*	=> sin(+n) = +0, where `n` is a positive integer
*	=> sin(-n) = -sin(+n) = -0, where `n` is a positive integer
*	=> cos(-x) = cos(x)
*/

/*
* Translated from the Fortran module by
* ----------------------------------------------------------------------
* Authors:
*  Amparo Gil    (U. Cantabria, Santander, Spain)
*                 e-mail: amparo.gil@unican.es
*  Javier Segura (U. Cantabria, Santander, Spain)
*                 e-mail: javier.segura@unican.es
*  Nico M. Temme (CWI, Amsterdam, The Netherlands)
*                 e-mail: nico.temme@cwi.nl
* ---------------------------------------------------------------------
*/

/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
*/

/* -- Expanding -- */

/* 1000 */

/* 1001 */

/* 1002 */

/* 1003 */

/* 1004 */

/* 1005 */

/* 1006 */

/* 1007 */

/* 1008 */

/* 1009 */

/* 1010 */

/* 1011 */

/* 1012 */

/* 1013 */

/* 1014 */

/* 1015 */

/* 1016 */

/* 1017 */

/* 1018 */

/* 1019 */

/* 1020 */

/* 1021 */

/* 1022 */

/* 1023 */

/* 1024 */

/* 1025 */

/* 1026 */

/* 1027 */

/* 1028 */

/* 1029 */

/* 1030 */

/* 1031 */

/* 1032 */

/* 1033 */

/* 1034 */

/* 1035 */

/* 1036 */

/* 1037 */

/* 1038 */

/* 1039 */

/* 1040 */

/* 1041 */

/* 1042 */

/* 1043 */

/* 1044 */

/* 1045 */

/* 1046 */

/* 1047 */

/* 1048 */

/* 1049 */

/* 1050 */

/* 1051 */

/* 1052 */

/* 1053 */

/* 1054 */

/* 1055 */

/* 1056 */

/* 1057 */

/* 1058 */

/* 1059 */

/* 1060 */

/* 1061 */

/* 1062 */

/* 1063 */

/* 1064 */

/* 1065 */

/* 1066 */

/* 1067 */

/* 1068 */

/* 1069 */

/* 1070 */

/* 1071 */

/* 1072 */

/* 1073 */

/* 1074 */

/* 1075 */

/* 1076 */

/* 1077 */

/* 1078 */

/* 1079 */

/* 1080 */

/* 1081 */

/* 1082 */

/* 1083 */

/* 1084 */

/* 1085 */

/* 1086 */

/* 1087 */

/* 1088 */

/* 1089 */

/* 1090 */

/* 1091 */

/* 1092 */

/* 1093 */

/* 1094 */

/* 1095 */

/* 1096 */

/* 1097 */

/* 1098 */

/* 1099 */

/* 1100 */

/* 1101 */

/* 1102 */

/* 1103 */

/* 1104 */

/* 1105 */

/* 1106 */

/* 1107 */

/* 1108 */

/* 1109 */

/* 1110 */

/* 1111 */

/* 1112 */

/* 1113 */

/* 1114 */

/* 1115 */

/* 1116 */

/* 1117 */

/* 1118 */

/* 1119 */

/* 1120 */

/* 1121 */

/* 1122 */

/* 1123 */

/* 1124 */

/* 1125 */

/* 1126 */

/* 1127 */

/* 1128 */

/* 1129 */

/* 1130 */

/* 1131 */

/* 1132 */

/* 1133 */

/* 1134 */

/* 1135 */

/* 1136 */

/* 1137 */

/* 1138 */

/* 1139 */

/* 1140 */

/* 1141 */

/* 1142 */

/* 1143 */

/* 1144 */

/* 1145 */

/* 1146 */

/* 1147 */

/* 1148 */

/* 1149 */

/* 1150 */

/* 1151 */

/* 1152 */

/* 1153 */

/* 1154 */

/* 1155 */

/* 1156 */

/* 1157 */

/* 1158 */

/* 1159 */

/* 1160 */

/* 1161 */

/* 1162 */

/* 1163 */

/* 1164 */

/* 1165 */

/* 1166 */

/* 1167 */

/* 1168 */

/* 1169 */

/* 1170 */

/* 1171 */

/* 1172 */

/* 1173 */

/* 1174 */

/* 1175 */

/* 1176 */

/* 1177 */

/* 1178 */

/* 1179 */

/* 1180 */

/* 1181 */

/* 1182 */

/* 1183 */

/* 1184 */

/* 1185 */

/* 1186 */

/* 1187 */

/* 1188 */

/* 1189 */

/* 1190 */

/* 1191 */

/* 1192 */

/* 1193 */

/* 1194 */

/* 1195 */

/* 1196 */

/* 1197 */

/* 1198 */

/* 1199 */

/* 1200 */

/* 1201 */

/* 1202 */

/* 1203 */

/* 1204 */

/* 1205 */

/* 1206 */

/* 1207 */

/* 1208 */

/* 1209 */

/* 1210 */

/* 1211 */

/* 1212 */

/* 1213 */

/* 1214 */

/* 1215 */

/* 1216 */

/* 1217 */

/* 1218 */

/* 1219 */

/* 1220 */

/* 1221 */

/* 1222 */

/* 1223 */

/* 1224 */

/* 1225 */

/* 1226 */

/* 1227 */

/* 1228 */

/* 1229 */

/* 1230 */

/* 1231 */

/* 1232 */

/* 1233 */

/* 1234 */

/* 1235 */

/* 1236 */

/* 1237 */

/* 1238 */

/* 1239 */

/* 1240 */

/* 1241 */

/* 1242 */

/* 1243 */

/* 1244 */

/* 1245 */

/* 1246 */

/* 1247 */

/* 1248 */

/* 1249 */

/* 1250 */

/* 1251 */

/* 1252 */

/* 1253 */

/* 1254 */

/* 1255 */

/* 1256 */

/* 1257 */

/* 1258 */

/* 1259 */

/* 1260 */

/* 1261 */

/* 1262 */

/* 1263 */

/* 1264 */

/* 1265 */

/* 1266 */

/* 1267 */

/* 1268 */

/* 1269 */

/* 1270 */

/* 1271 */

/* 1272 */

/* 1273 */

/* 1274 */

/* 1275 */

/* 1276 */

/* 1277 */

/* 1278 */

/* 1279 */

/* 1280 */

/* 1281 */

/* 1282 */

/* 1283 */

/* 1284 */

/* 1285 */

/* 1286 */

/* 1287 */

/* 1288 */

/* 1289 */

/* 1290 */

/* 1291 */

/* 1292 */

/* 1293 */

/* 1294 */

/* 1295 */

/* 1296 */

/* 1297 */

/* 1298 */

/* 1299 */

/* 1300 */

/* 1301 */

/* 1302 */

/* 1303 */

/* 1304 */

/* 1305 */

/* 1306 */

/* 1307 */

/* 1308 */

/* 1309 */

/* 1310 */

/* 1311 */

/* 1312 */

/* 1313 */

/* 1314 */

/* 1315 */

/* 1316 */

/* 1317 */

/* 1318 */

/* 1319 */

/* 1320 */

/* 1321 */

/* 1322 */

/* 1323 */

/* 1324 */

/* 1325 */

/* 1326 */

/* 1327 */

/* 1328 */

/* 1329 */

/* 1330 */

/* 1331 */

/* 1332 */

/* 1333 */

/* 1334 */

/* 1335 */

/* 1336 */

/* 1337 */

/* 1338 */

/* 1339 */

/* 1340 */

/* 1341 */

/* 1342 */

/* 1343 */

/* 1344 */

/* 1345 */

/* 1346 */

/* 1347 */

/* 1348 */

/* 1349 */

/* 1350 */

/* 1351 */

/* 1352 */

/* 1353 */

/* 1354 */

/* 1355 */

/* 1356 */

/* 1357 */

/* 1358 */

/* 1359 */

/* 1360 */

/* 1361 */

/* 1362 */

/* 1363 */

/* 1364 */

/* 1365 */

/* 1366 */

/* 1367 */

/* 1368 */

/* 1369 */

/* 1370 */

/* 1371 */

/* 1372 */

/* 1373 */

/* 1374 */

/* 1375 */

/* 1376 */

/* 1377 */

/* 1378 */

/* 1379 */

/* 1380 */

/* 1381 */

/* 1382 */

/* 1383 */

/* 1384 */

/* 1385 */

/* 1386 */

/* 1387 */

/* 1388 */

/* 1389 */

/* 1390 */

/* 1391 */

/* 1392 */

/* 1393 */

/* 1394 */

/* 1395 */

/* 1396 */

/* 1397 */

/* 1398 */

/* 1399 */

/* 1400 */

/* 1401 */

/* 1402 */

/* 1403 */

/* 1404 */

/* 1405 */

/* 1406 */

/* 1407 */

/* 1408 */

/* 1409 */

/* 1410 */

/* 1411 */

/* 1412 */

/* 1413 */

/* 1414 */

/* 1415 */

/* 1416 */

/* 1417 */

/* 1418 */

/* 1419 */

/* 1420 */

/* 1421 */

/* 1422 */

/* 1423 */

/* 1424 */

/* 1425 */

/* 1426 */

/* 1427 */

/* 1428 */

/* 1429 */

/* 1430 */

/* 1431 */

/* 1432 */

/* 1433 */

/* 1434 */

/* 1435 */

/* 1436 */

/* 1437 */

/* 1438 */

/* 1439 */

/* 1440 */

/* 1441 */

/* 1442 */

/* 1443 */

/* 1444 */

/* 1445 */

/* 1446 */

/* 1447 */

/* 1448 */

/* 1449 */

/* 1450 */

/* 1451 */

/* 1452 */

/* 1453 */

/* 1454 */

/* 1455 */

/* 1456 */

/* 1457 */

/* 1458 */

/* 1459 */

/* 1460 */

/* 1461 */

/* 1462 */

/* 1463 */

/* 1464 */

/* 1465 */

/* 1466 */

/* 1467 */

/* 1468 */

/* 1469 */

/* 1470 */

/* 1471 */

/* 1472 */

/* 1473 */

/* 1474 */

/* 1475 */

/* 1476 */

/* 1477 */

/* 1478 */

/* 1479 */

/* 1480 */

/* 1481 */

/* 1482 */

/* 1483 */

/* 1484 */

/* 1485 */

/* 1486 */

/* 1487 */

/* 1488 */

/* 1489 */

/* 1490 */

/* 1491 */

/* 1492 */

/* 1493 */

/* 1494 */

/* 1495 */

/* 1496 */

/* 1497 */

/* 1498 */

/* 1499 */

/* 1500 */

/* 1501 */

/* 1502 */

/* 1503 */

/* 1504 */

/* 1505 */

/* 1506 */

/* 1507 */

/* 1508 */

/* 1509 */

/* 1510 */

/* 1511 */

/* 1512 */

/* 1513 */

/* 1514 */

/* 1515 */

/* 1516 */

/* 1517 */

/* 1518 */

/* 1519 */

/* 1520 */

/* 1521 */

/* 1522 */

/* 1523 */

/* 1524 */

/* 1525 */

/* 1526 */

/* 1527 */

/* 1528 */

/* 1529 */

/* 1530 */

/* 1531 */

/* 1532 */

/* 1533 */

/* 1534 */

/* 1535 */

/* 1536 */

/* 1537 */

/* 1538 */

/* 1539 */

/* 1540 */

/* 1541 */

/* 1542 */

/* 1543 */

/* 1544 */

/* 1545 */

/* 1546 */

/* 1547 */

/* 1548 */

/* 1549 */

/* 1550 */

/* 1551 */

/* 1552 */

/* 1553 */

/* 1554 */

/* 1555 */

/* 1556 */

/* 1557 */

/* 1558 */

/* 1559 */

/* 1560 */

/* 1561 */

/* 1562 */

/* 1563 */

/* 1564 */

/* 1565 */

/* 1566 */

/* 1567 */

/* 1568 */

/* 1569 */

/* 1570 */

/* 1571 */

/* 1572 */

/* 1573 */

/* 1574 */

/* 1575 */

/* 1576 */

/* 1577 */

/* 1578 */

/* 1579 */

/* 1580 */

/* 1581 */

/* 1582 */

/* 1583 */

/* 1584 */

/* 1585 */

/* 1586 */

/* 1587 */

/* 1588 */

/* 1589 */

/* 1590 */

/* 1591 */

/* 1592 */

/* 1593 */

/* 1594 */

/* 1595 */

/* 1596 */

/* 1597 */

/* 1598 */

/* 1599 */

/* 1600 */

/* 1601 */

/* 1602 */

/* 1603 */

/* 1604 */

/* 1605 */

/* 1606 */

/* 1607 */

/* 1608 */

/* 1609 */

/* 1610 */

/* 1611 */

/* 1612 */

/* 1613 */

/* 1614 */

/* 1615 */

/* 1616 */

/* 1617 */

/* 1618 */

/* 1619 */

/* 1620 */

/* 1621 */

/* 1622 */

/* 1623 */

/* 1624 */

/* 1625 */

/* 1626 */

/* 1627 */

/* 1628 */

/* 1629 */

/* 1630 */

/* 1631 */

/* 1632 */

/* 1633 */

/* 1634 */

/* 1635 */

/* 1636 */

/* 1637 */

/* 1638 */

/* 1639 */

/* 1640 */

/* 1641 */

/* 1642 */

/* 1643 */

/* 1644 */

/* 1645 */

/* 1646 */

/* 1647 */

/* 1648 */

/* 1649 */

/* 1650 */

/* 1651 */

/* 1652 */

/* 1653 */

/* 1654 */

/* 1655 */

/* 1656 */

/* 1657 */

/* 1658 */

/* 1659 */

/* 1660 */

/* 1661 */

/* 1662 */

/* 1663 */

/* 1664 */

/* 1665 */

/* 1666 */

/* 1667 */

/* 1668 */

/* 1669 */

/* 1670 */

/* 1671 */

/* 1672 */

/* 1673 */

/* 1674 */

/* 1675 */

/* 1676 */

/* 1677 */

/* 1678 */

/* 1679 */

/* 1680 */

/* 1681 */

/* 1682 */

/* 1683 */

/* 1684 */

/* 1685 */

/* 1686 */

/* 1687 */

/* 1688 */

/* 1689 */

/* 1690 */

/* 1691 */

/* 1692 */

/* 1693 */

/* 1694 */

/* 1695 */

/* 1696 */

/* 1697 */

/* 1698 */

/* 1699 */

/* 1700 */

/* 1701 */

/* 1702 */

/* 1703 */

/* 1704 */

/* 1705 */

/* 1706 */

/* 1707 */

/* 1708 */

/* 1709 */

/* 1710 */

/* 1711 */

/* 1712 */

/* 1713 */

/* 1714 */

/* 1715 */

/* 1716 */

/* 1717 */

/* 1718 */

/* 1719 */

/* 1720 */

/* 1721 */

/* 1722 */

/* 1723 */

/* 1724 */

/* 1725 */

/* 1726 */

/* 1727 */

/* 1728 */

/* 1729 */

/* 1730 */

/* 1731 */

/* 1732 */

/* 1733 */

/* 1734 */

/* 1735 */

/* 1736 */

/* 1737 */

/* 1738 */

/* 1739 */

/* 1740 */

/* 1741 */

/* 1742 */

/* 1743 */

/* 1744 */

/* 1745 */

/* 1746 */

/* 1747 */

/* 1748 */

/* 1749 */

/* 1750 */

/* 1751 */

/* 1752 */

/* 1753 */

/* 1754 */

/* 1755 */

/* 1756 */

/* 1757 */

/* 1758 */

/* 1759 */

/* 1760 */

/* 1761 */

/* 1762 */

/* 1763 */

/* 1764 */

/* 1765 */

/* 1766 */

/* 1767 */

/* 1768 */

/* 1769 */

/* 1770 */

/* 1771 */

/* 1772 */

/* 1773 */

/* 1774 */

/* 1775 */

/* 1776 */

/* 1777 */

/* 1778 */

/* 1779 */

/* 1780 */

/* 1781 */

/* 1782 */

/* 1783 */

/* 1784 */

/* 1785 */

/* 1786 */

/* 1787 */

/* 1788 */

/* 1789 */

/* 1790 */

/* 1791 */

/* 1792 */

/* 1793 */

/* 1794 */

/* 1795 */

/* 1796 */

/* 1797 */

/* 1798 */

/* 1799 */

/* 1800 */

/* 1801 */

/* 1802 */

/* 1803 */

/* 1804 */

/* 1805 */

/* 1806 */

/* 1807 */

/* 1808 */

/* 1809 */

/* 1810 */

/* 1811 */

/* 1812 */

/* 1813 */

/* 1814 */

/* 1815 */

/* 1816 */

/* 1817 */

/* 1818 */

/* 1819 */

/* 1820 */

/* 1821 */

/* 1822 */

/* 1823 */

/* 1824 */

/* 1825 */

/* 1826 */

/* 1827 */

/* 1828 */

/* 1829 */

/* 1830 */

/* 1831 */

/* 1832 */

/* 1833 */

/* 1834 */

/* 1835 */

/* 1836 */

/* 1837 */

/* 1838 */

/* 1839 */

/* 1840 */

/* 1841 */

/* 1842 */

/* 1843 */

/* 1844 */

/* 1845 */

/* 1846 */

/* 1847 */

/* 1848 */

/* 1849 */

/* 1850 */

/* 1851 */

/* 1852 */

/* 1853 */

/* 1854 */

/* 1855 */

/* 1856 */

/* 1857 */

/* 1858 */

/* 1859 */

/* 1860 */

/* 1861 */

/* 1862 */

/* 1863 */

/* 1864 */

/* 1865 */

/* 1866 */

/* 1867 */

/* 1868 */

/* 1869 */

/* 1870 */

/* 1871 */

/* 1872 */

/* 1873 */

/* 1874 */

/* 1875 */

/* 1876 */

/* 1877 */

/* 1878 */

/* 1879 */

/* 1880 */

/* 1881 */

/* 1882 */

/* 1883 */

/* 1884 */

/* 1885 */

/* 1886 */

/* 1887 */

/* 1888 */

/* 1889 */

/* 1890 */

/* 1891 */

/* 1892 */

/* 1893 */

/* 1894 */

/* 1895 */

/* 1896 */

/* 1897 */

/* 1898 */

/* 1899 */

/* 1900 */

/* 1901 */

/* 1902 */

/* 1903 */

/* 1904 */

/* 1905 */

/* 1906 */

/* 1907 */

/* 1908 */

/* 1909 */

/* 1910 */

/* 1911 */

/* 1912 */

/* 1913 */

/* 1914 */

/* 1915 */

/* 1916 */

/* 1917 */

/* 1918 */

/* 1919 */

/* 1920 */

/* 1921 */

/* 1922 */

/* 1923 */

/* 1924 */

/* 1925 */

/* 1926 */

/* 1927 */

/* 1928 */

/* 1929 */

/* 1930 */

/* 1931 */

/* 1932 */

/* 1933 */

/* 1934 */

/* 1935 */

/* 1936 */

/* 1937 */

/* 1938 */

/* 1939 */

/* 1940 */

/* 1941 */

/* 1942 */

/* 1943 */

/* 1944 */

/* 1945 */

/* 1946 */

/* 1947 */

/* 1948 */

/* 1949 */

/* 1950 */

/* 1951 */

/* 1952 */

/* 1953 */

/* 1954 */

/* 1955 */

/* 1956 */

/* 1957 */

/* 1958 */

/* 1959 */

/* 1960 */

/* 1961 */

/* 1962 */

/* 1963 */

/* 1964 */

/* 1965 */

/* 1966 */

/* 1967 */

/* 1968 */

/* 1969 */

/* 1970 */

/* 1971 */

/* 1972 */

/* 1973 */

/* 1974 */

/* 1975 */

/* 1976 */

/* 1977 */

/* 1978 */

/* 1979 */

/* 1980 */

/* 1981 */

/* 1982 */

/* 1983 */

/* 1984 */

/* 1985 */

/* 1986 */

/* 1987 */

/* 1988 */

/* 1989 */

/* 1990 */

/* 1991 */

/* 1992 */

/* 1993 */

/* 1994 */

/* 1995 */

/* 1996 */

/* 1997 */

/* 1998 */

/* 1999 */

/* 2000 */

/* 2001 */

/* 2002 */

/* 2003 */

/* 2004 */

/* 2005 */

/* 2006 */

/* 2007 */

/* 2008 */

/* 2009 */

/* 2010 */

/* 2011 */

/* 2012 */

/* 2013 */

/* 2014 */

/* 2015 */

/* 2016 */

/* 2017 */

/* 2018 */

/* 2019 */

/* 2020 */

/* 2021 */

/* 2022 */

/* 2023 */

/* 2024 */

/* 2025 */

/* 2026 */

/* 2027 */

/* 2028 */

/* 2029 */

/* 2030 */

/* 2031 */

/* 2032 */

/* 2033 */

/* 2034 */

/* 2035 */

/* 2036 */

/* 2037 */

/* 2038 */

/* 2039 */

/* 2040 */

/* 2041 */

/* 2042 */

/* 2043 */

/* 2044 */

/* 2045 */

/* 2046 */

/* 2047 */

/* 2048 */

/* 2049 */

/* 2050 */

/* 2051 */

/* 2052 */

/* 2053 */

/* 2054 */

/* 2055 */

/* 2056 */

/* 2057 */

/* 2058 */

/* 2059 */

/* 2060 */

/* 2061 */

/* 2062 */

/* 2063 */

/* 2064 */

/* 2065 */

/* 2066 */

/* 2067 */

/* 2068 */

/* 2069 */

/* 2070 */

/* 2071 */

/* 2072 */

/* 2073 */

/* 2074 */

/* 2075 */

/* 2076 */

/* 2077 */

/* 2078 */

/* 2079 */

/* 2080 */

/* 2081 */

/* 2082 */

/* 2083 */

/* 2084 */

/* 2085 */

/* 2086 */

/* 2087 */

/* 2088 */

/* 2089 */

/* 2090 */

/* 2091 */

/* 2092 */

/* 2093 */

/* 2094 */

/* 2095 */

/* 2096 */

/* 2097 */

/* 2098 */

/* 2099 */

/* 2100 */

/* 2101 */

/* 2102 */

/* 2103 */

/* 2104 */

/* 2105 */

/* 2106 */

/* 2107 */

/* 2108 */

/* 2109 */

/* 2110 */

/* 2111 */

/* 2112 */

/* 2113 */

/* 2114 */

/* 2115 */

/* 2116 */

/* 2117 */

/* 2118 */

/* 2119 */

/* 2120 */

/* 2121 */

/* 2122 */

/* 2123 */

/* 2124 */

/* 2125 */

/* 2126 */

/* 2127 */

/* 2128 */

/* 2129 */

/* 2130 */

/* 2131 */

/* 2132 */

/* 2133 */

/* 2134 */

/* 2135 */

/* 2136 */

/* 2137 */

/* 2138 */

/* 2139 */

/* 2140 */

/* 2141 */

/* 2142 */

/* 2143 */

/* 2144 */

/* 2145 */

/* 2146 */

/* 2147 */

/* 2148 */

/* 2149 */

/* 2150 */

/* 2151 */

/* 2152 */

/* 2153 */

/* 2154 */

/* 2155 */

/* 2156 */

/* 2157 */

/* 2158 */

/* 2159 */

/* 2160 */

/* 2161 */

/* 2162 */

/* 2163 */

/* 2164 */

/* 2165 */

/* 2166 */

/* 2167 */

/* 2168 */

/* 2169 */

/* 2170 */

/* 2171 */

/* 2172 */

/* 2173 */

/* 2174 */

/* 2175 */

/* 2176 */

/* 2177 */

/* 2178 */

/* 2179 */

/* 2180 */

/* 2181 */

/* 2182 */

/* 2183 */

/* 2184 */

/* 2185 */

/* 2186 */

/* 2187 */

/* 2188 */

/* 2189 */

/* 2190 */

/* 2191 */

/* 2192 */

/* 2193 */

/* 2194 */

/* 2195 */

/* 2196 */

/* 2197 */

/* 2198 */

/* 2199 */

/* 2200 */

/* 2201 */

/* 2202 */

/* 2203 */

/* 2204 */

/* 2205 */

/* 2206 */

/* 2207 */

/* 2208 */

/* 2209 */

/* 2210 */

/* 2211 */

/* 2212 */

/* 2213 */

/* 2214 */

/* 2215 */

/* 2216 */

/* 2217 */

/* 2218 */

/* 2219 */

/* 2220 */

/* 2221 */

/* 2222 */

/* 2223 */

/* 2224 */

/* 2225 */

/* 2226 */

/* 2227 */

/* 2228 */

/* 2229 */

/* 2230 */

/* 2231 */

/* 2232 */

/* 2233 */

/* 2234 */

/* 2235 */

/* 2236 */

/* 2237 */

/* 2238 */

/* 2239 */

/* 2240 */

/* 2241 */

/* 2242 */

/* 2243 */

/* 2244 */

/* 2245 */

/* 2246 */

/* 2247 */

/* 2248 */

/* 2249 */

/* 2250 */

/* 2251 */

/* 2252 */

/* 2253 */

/* 2254 */

/* 2255 */

/* 2256 */

/* 2257 */

/* 2258 */

/* 2259 */

/* 2260 */

/* 2261 */

/* 2262 */

/* 2263 */

/* 2264 */

/* 2265 */

/* 2266 */

/* 2267 */

/* 2268 */

/* 2269 */

/* 2270 */

/* 2271 */

/* 2272 */

/* 2273 */

/* 2274 */

/* 2275 */

/* 2276 */

/* 2277 */

/* 2278 */

/* 2279 */

/* 2280 */

/* 2281 */

/* 2282 */

/* 2283 */

/* 2284 */

/* 2285 */

/* 2286 */

/* 2287 */

/* 2288 */

/* 2289 */

/* 2290 */

/* 2291 */

/* 2292 */

/* 2293 */

/* 2294 */

/* 2295 */

/* 2296 */

/* 2297 */

/* 2298 */

/* 2299 */

/* 2300 */

/* 2301 */

/* 2302 */

/* 2303 */

/* 2304 */

/* 2305 */

/* 2306 */

/* 2307 */

/* 2308 */

/* 2309 */

/* 2310 */

/* 2311 */

/* 2312 */

/* 2313 */

/* 2314 */

/* 2315 */

/* 2316 */

/* 2317 */

/* 2318 */

/* 2319 */

/* 2320 */

/* 2321 */

/* 2322 */

/* 2323 */

/* 2324 */

/* 2325 */

/* 2326 */

/* 2327 */

/* 2328 */

/* 2329 */

/* 2330 */

/* 2331 */

/* 2332 */

/* 2333 */

/* 2334 */

/* 2335 */

/* 2336 */

/* 2337 */

/* 2338 */

/* 2339 */

/* 2340 */

/* 2341 */

/* 2342 */

/* 2343 */

/* 2344 */

/* 2345 */

/* 2346 */

/* 2347 */

/* 2348 */

/* 2349 */

/* 2350 */

/* 2351 */

/* 2352 */

/* 2353 */

/* 2354 */

/* 2355 */

/* 2356 */

/* 2357 */

/* 2358 */

/* 2359 */

/* 2360 */

/* 2361 */

/* 2362 */

/* 2363 */

/* 2364 */

/* 2365 */

/* 2366 */

/* 2367 */

/* 2368 */

/* 2369 */

/* 2370 */

/* 2371 */

/* 2372 */

/* 2373 */

/* 2374 */

/* 2375 */

/* 2376 */

/* 2377 */

/* 2378 */

/* 2379 */

/* 2380 */

/* 2381 */

/* 2382 */

/* 2383 */

/* 2384 */

/* 2385 */

/* 2386 */

/* 2387 */

/* 2388 */

/* 2389 */

/* 2390 */

/* 2391 */

/* 2392 */

/* 2393 */

/* 2394 */

/* 2395 */

/* 2396 */

/* 2397 */

/* 2398 */

/* 2399 */

/* 2400 */

/* 2401 */

/* 2402 */

/* 2403 */

/* 2404 */

/* 2405 */

/* 2406 */

/* 2407 */

/* 2408 */

/* 2409 */

/* 2410 */

/* 2411 */

/* 2412 */

/* 2413 */

/* 2414 */

/* 2415 */

/* 2416 */

/* 2417 */

/* 2418 */

/* 2419 */

/* 2420 */

/* 2421 */

/* 2422 */

/* 2423 */

/* 2424 */

/* 2425 */

/* 2426 */

/* 2427 */

/* 2428 */

/* 2429 */

/* 2430 */

/* 2431 */

/* 2432 */

/* 2433 */

/* 2434 */

/* 2435 */

/* 2436 */

/* 2437 */

/* 2438 */

/* 2439 */

/* 2440 */

/* 2441 */

/* 2442 */

/* 2443 */

/* 2444 */

/* 2445 */

/* 2446 */

/* 2447 */

/* 2448 */

/* 2449 */

/* 2450 */

/* 2451 */

/* 2452 */

/* 2453 */

/* 2454 */

/* 2455 */

/* 2456 */

/* 2457 */

/* 2458 */

/* 2459 */

/* 2460 */

/* 2461 */

/* 2462 */

/* 2463 */

/* 2464 */

/* 2465 */

/* 2466 */

/* 2467 */

/* 2468 */

/* 2469 */

/* 2470 */

/* 2471 */

/* 2472 */

/* 2473 */

/* 2474 */

/* 2475 */

/* 2476 */

/* 2477 */

/* 2478 */

/* 2479 */

/* 2480 */

/* 2481 */

/* 2482 */

/* 2483 */

/* 2484 */

/* 2485 */

/* 2486 */

/* 2487 */

/* 2488 */

/* 2489 */

/* 2490 */

/* 2491 */

/* 2492 */

/* 2493 */

/* 2494 */

/* 2495 */

/* 2496 */

/* 2497 */

/* 2498 */

/* 2499 */

/* 2500 */

/* 2501 */

/* 2502 */

/* 2503 */

/* 2504 */

/* 2505 */

/* 2506 */

/* 2507 */

/* 2508 */

/* 2509 */

/* 2510 */

/* 2511 */

/* 2512 */

/* 2513 */

/* 2514 */

/* 2515 */

/* 2516 */

/* 2517 */

/* 2518 */

/* 2519 */

/* 2520 */

/* 2521 */

/* 2522 */

/* 2523 */

/* 2524 */

/* 2525 */

/* 2526 */

/* 2527 */

/* 2528 */

/* 2529 */

/* 2530 */

/* 2531 */

/* 2532 */

/* 2533 */

/* 2534 */

/* 2535 */

/* 2536 */

/* 2537 */

/* 2538 */

/* 2539 */

/* 2540 */

/* 2541 */

/* 2542 */

/* 2543 */

/* 2544 */

/* 2545 */

/* 2546 */

/* 2547 */

/* 2548 */

/* 2549 */

/* 2550 */

/* 2551 */

/* 2552 */

/* 2553 */

/* 2554 */

/* 2555 */

/* 2556 */

/* 2557 */

/* 2558 */

/* 2559 */

/* 2560 */

/* 2561 */

/* 2562 */

/* 2563 */

/* 2564 */

/* 2565 */

/* 2566 */

/* 2567 */

/* 2568 */

/* 2569 */

/* 2570 */

/* 2571 */

/* 2572 */

/* 2573 */

/* 2574 */

/* 2575 */

/* 2576 */

/* 2577 */

/* 2578 */

/* 2579 */

/* 2580 */

/* 2581 */

/* 2582 */

/* 2583 */

/* 2584 */

/* 2585 */

/* 2586 */

/* 2587 */

/* 2588 */

/* 2589 */

/* 2590 */

/* 2591 */

/* 2592 */

/* 2593 */

/* 2594 */

/* 2595 */

/* 2596 */

/* 2597 */

/* 2598 */

/* 2599 */

/* 2600 */

/* 2601 */

/* 2602 */

/* 2603 */

/* 2604 */

/* 2605 */

/* 2606 */

/* 2607 */

/* 2608 */

/* 2609 */

/* 2610 */

/* 2611 */

/* 2612 */

/* 2613 */

/* 2614 */

/* 2615 */

/* 2616 */

/* 2617 */

/* 2618 */

/* 2619 */

/* 2620 */

/* 2621 */

/* 2622 */

/* 2623 */

/* 2624 */

/* 2625 */

/* 2626 */

/* 2627 */

/* 2628 */

/* 2629 */

/* 2630 */

/* 2631 */

/* 2632 */

/* 2633 */

/* 2634 */

/* 2635 */

/* 2636 */

/* 2637 */

/* 2638 */

/* 2639 */

/* 2640 */

/* 2641 */

/* 2642 */

/* 2643 */

/* 2644 */

/* 2645 */

/* 2646 */

/* 2647 */

/* 2648 */

/* 2649 */

/* 2650 */

/* 2651 */

/* 2652 */

/* 2653 */

/* 2654 */

/* 2655 */

/* 2656 */

/* 2657 */

/* 2658 */

/* 2659 */

/* 2660 */

/* 2661 */

/* 2662 */

/* 2663 */

/* 2664 */

/* 2665 */

/* 2666 */

/* 2667 */

/* 2668 */

/* 2669 */

/* 2670 */

/* 2671 */

/* 2672 */

/* 2673 */

/* 2674 */

/* 2675 */

/* 2676 */

/* 2677 */

/* 2678 */

/* 2679 */

/* 2680 */

/* 2681 */

/* 2682 */

/* 2683 */

/* 2684 */

/* 2685 */

/* 2686 */

/* 2687 */

/* 2688 */

/* 2689 */

/* 2690 */

/* 2691 */

/* 2692 */

/* 2693 */

/* 2694 */

/* 2695 */

/* 2696 */

/* 2697 */

/* 2698 */

/* 2699 */

/* 2700 */

/* 2701 */

/* 2702 */

/* 2703 */

/* 2704 */

/* 2705 */

/* 2706 */

/* 2707 */

/* 2708 */

/* 2709 */

/* 2710 */

/* 2711 */

/* 2712 */

/* 2713 */

/* 2714 */

/* 2715 */

/* 2716 */

/* 2717 */

/* 2718 */

/* 2719 */

/* 2720 */

/* 2721 */

/* 2722 */

/* 2723 */

/* 2724 */

/* 2725 */

/* 2726 */

/* 2727 */

/* 2728 */

/* 2729 */

/* 2730 */

/* 2731 */

/* 2732 */

/* 2733 */

/* 2734 */

/* 2735 */

/* 2736 */

/* 2737 */

/* 2738 */

/* 2739 */

/* 2740 */

/* 2741 */

/* 2742 */

/* 2743 */

/* 2744 */

/* 2745 */

/* 2746 */

/* 2747 */

/* 2748 */

/* 2749 */

/* 2750 */

/* 2751 */

/* 2752 */

/* 2753 */

/* 2754 */

/* 2755 */

/* 2756 */

/* 2757 */

/* 2758 */

/* 2759 */

/* 2760 */

/* 2761 */

/* 2762 */

/* 2763 */

/* 2764 */

/* 2765 */

/* 2766 */

/* 2767 */

/* 2768 */

/* 2769 */

/* 2770 */

/* 2771 */

/* 2772 */

/* 2773 */

/* 2774 */

/* 2775 */

/* 2776 */

/* 2777 */

/* 2778 */

/* 2779 */

/* 2780 */

/* 2781 */

/* 2782 */

/* 2783 */

/* 2784 */

/* 2785 */

/* 2786 */

/* 2787 */

/* 2788 */

/* 2789 */

/* 2790 */

/* 2791 */

/* 2792 */

/* 2793 */

/* 2794 */

/* 2795 */

/* 2796 */

/* 2797 */

/* 2798 */

/* 2799 */

/* 2800 */

/* 2801 */

/* 2802 */

/* 2803 */

/* 2804 */

/* 2805 */

/* 2806 */

/* 2807 */

/* 2808 */

/* 2809 */

/* 2810 */

/* 2811 */

/* 2812 */

/* 2813 */

/* 2814 */

/* 2815 */

/* 2816 */

/* 2817 */

/* 2818 */

/* 2819 */

/* 2820 */

/* 2821 */

/* 2822 */

/* 2823 */

/* 2824 */

/* 2825 */

/* 2826 */

/* 2827 */

/* 2828 */

/* 2829 */

/* 2830 */

/* 2831 */

/* 2832 */

/* 2833 */

/* 2834 */

/* 2835 */

/* 2836 */

/* 2837 */

/* 2838 */

/* 2839 */

/* 2840 */

/* 2841 */

/* 2842 */

/* 2843 */

/* 2844 */

/* 2845 */

/* 2846 */

/* 2847 */

/* 2848 */

/* 2849 */

/* 2850 */

/* 2851 */

/* 2852 */

/* 2853 */

/* 2854 */

/* 2855 */

/* 2856 */

/* 2857 */

/* 2858 */

/* 2859 */

/* 2860 */

/* 2861 */

/* 2862 */

/* 2863 */

/* 2864 */

/* 2865 */

/* 2866 */

/* 2867 */

/* 2868 */

/* 2869 */

/* 2870 */

/* 2871 */

/* 2872 */

/* 2873 */

/* 2874 */

/* 2875 */

/* 2876 */

/* 2877 */

/* 2878 */

/* 2879 */

/* 2880 */

/* 2881 */

/* 2882 */

/* 2883 */

/* 2884 */

/* 2885 */

/* 2886 */

/* 2887 */

/* 2888 */

/* 2889 */

/* 2890 */

/* 2891 */

/* 2892 */

/* 2893 */

/* 2894 */

/* 2895 */

/* 2896 */

/* 2897 */

/* 2898 */

/* 2899 */

/* 2900 */

/* 2901 */

/* 2902 */

/* 2903 */

/* 2904 */

/* 2905 */

/* 2906 */

/* 2907 */

/* 2908 */

/* 2909 */

/* 2910 */

/* 2911 */

/* 2912 */

/* 2913 */

/* 2914 */

/* 2915 */

/* 2916 */

/* 2917 */

/* 2918 */

/* 2919 */

/* 2920 */

/* 2921 */

/* 2922 */

/* 2923 */

/* 2924 */

/* 2925 */

/* 2926 */

/* 2927 */

/* 2928 */

/* 2929 */

/* 2930 */

/* 2931 */

/* 2932 */

/* 2933 */

/* 2934 */

/* 2935 */

/* 2936 */

/* 2937 */

/* 2938 */

/* 2939 */

/* 2940 */

/* 2941 */

/* 2942 */

/* 2943 */

/* 2944 */

/* 2945 */

/* 2946 */

/* 2947 */

/* 2948 */

/* 2949 */

/* 2950 */

/* 2951 */

/* 2952 */

/* 2953 */

/* 2954 */

/* 2955 */

/* 2956 */

/* 2957 */

/* 2958 */

/* 2959 */

/* 2960 */

/* 2961 */

/* 2962 */

/* 2963 */

/* 2964 */

/* 2965 */

/* 2966 */

/* 2967 */

/* 2968 */

/* 2969 */

/* 2970 */

/* 2971 */

/* 2972 */

/* 2973 */

/* 2974 */

/* 2975 */

/* 2976 */

/* 2977 */

/* 2978 */

/* 2979 */

/* 2980 */

/* 2981 */

/* 2982 */

/* 2983 */

/* 2984 */

/* 2985 */

/* 2986 */

/* 2987 */

/* 2988 */

/* 2989 */

/* 2990 */

/* 2991 */

/* 2992 */

/* 2993 */

/* 2994 */

/* 2995 */

/* 2996 */

/* 2997 */

/* 2998 */

/* 2999 */

/* 3000 */

/* 3001 */

/* 3002 */

/* 3003 */

/* 3004 */

/* 3005 */

/* 3006 */

/* 3007 */

/* 3008 */

/* 3009 */

/* 3010 */

/* 3011 */

/* 3012 */

/* 3013 */

/* 3014 */

/* 3015 */

/* 3016 */

/* 3017 */

/* 3018 */

/* 3019 */

/* 3020 */

/* 3021 */

/* 3022 */

/* 3023 */

/* 3024 */

/* 3025 */

/* 3026 */

/* 3027 */

/* 3028 */

/* 3029 */

/* 3030 */

/* 3031 */

/* 3032 */

/* 3033 */

/* 3034 */

/* 3035 */

/* 3036 */

/* 3037 */

/* 3038 */

/* 3039 */

/* 3040 */

/* 3041 */

/* 3042 */

/* 3043 */

/* 3044 */

/* 3045 */

/* 3046 */

/* 3047 */

/* 3048 */

/* 3049 */

/* 3050 */

/* 3051 */

/* 3052 */

/* 3053 */

/* 3054 */

/* 3055 */

/* 3056 */

/* 3057 */

/* 3058 */

/* 3059 */

/* 3060 */

/* 3061 */

/* 3062 */

/* 3063 */

/* 3064 */

/* 3065 */

/* 3066 */

/* 3067 */

/* 3068 */

/* 3069 */

/* 3070 */

/* 3071 */

/* 3072 */

/* 3073 */

/* 3074 */

/* 3075 */

/* 3076 */

/* 3077 */

/* 3078 */

/* 3079 */

/* 3080 */

/* 3081 */

/* 3082 */

/* 3083 */

/* 3084 */

/* 3085 */

/* 3086 */

/* 3087 */

/* 3088 */

/* 3089 */

/* 3090 */

/* 3091 */

/* 3092 */

/* 3093 */

/* 3094 */

/* 3095 */

/* 3096 */

/* 3097 */

/* 3098 */

/* 3099 */

/* 3100 */

/* 3101 */

/* 3102 */

/* 3103 */

/* 3104 */

/* 3105 */

/* 3106 */

/* 3107 */

/* 3108 */

/* 3109 */

/* 3110 */

/* 3111 */

/* 3112 */

/* 3113 */

/* 3114 */

/* 3115 */

/* 3116 */

/* 3117 */

/* 3118 */

/* 3119 */

/* 3120 */

/* 3121 */

/* 3122 */

/* 3123 */

/* 3124 */

/* 3125 */

/* 3126 */

/* 3127 */

/* 3128 */

/* 3129 */

/* 3130 */

/* 3131 */

/* 3132 */

/* 3133 */

/* 3134 */

/* 3135 */

/* 3136 */

/* 3137 */

/* 3138 */

/* 3139 */

/* 3140 */

/* 3141 */

/* 3142 */

/* 3143 */

/* 3144 */

/* 3145 */

/* 3146 */

/* 3147 */

/* 3148 */

/* 3149 */

/* 3150 */

/* 3151 */

/* 3152 */

/* 3153 */

/* 3154 */

/* 3155 */

/* 3156 */

/* 3157 */

/* 3158 */

/* 3159 */

/* 3160 */

/* 3161 */

/* 3162 */

/* 3163 */

/* 3164 */

/* 3165 */

/* 3166 */

/* 3167 */

/* 3168 */

/* 3169 */

/* 3170 */

/* 3171 */

/* 3172 */

/* 3173 */

/* 3174 */

/* 3175 */

/* 3176 */

/* 3177 */

/* 3178 */

/* 3179 */

/* 3180 */

/* 3181 */

/* 3182 */

/* 3183 */

/* 3184 */

/* 3185 */

/* 3186 */

/* 3187 */

/* 3188 */

/* 3189 */

/* 3190 */

/* 3191 */

/* 3192 */

/* 3193 */

/* 3194 */

/* 3195 */

/* 3196 */

/* 3197 */

/* 3198 */

/* 3199 */

/* 3200 */

/* 3201 */

/* 3202 */

/* 3203 */

/* 3204 */

/* 3205 */

/* 3206 */

/* 3207 */

/* 3208 */

/* 3209 */

/* 3210 */

/* 3211 */

/* 3212 */

/* 3213 */

/* 3214 */

/* 3215 */

/* 3216 */

/* 3217 */

/* 3218 */

/* 3219 */

/* 3220 */

/* 3221 */

/* 3222 */

/* 3223 */

/* 3224 */

/* 3225 */

/* 3226 */

/* 3227 */

/* 3228 */

/* 3229 */

/* 3230 */

/* 3231 */

/* 3232 */

/* 3233 */

/* 3234 */

/* 3235 */

/* 3236 */

/* 3237 */

/* 3238 */

/* 3239 */

/* 3240 */

/* 3241 */

/* 3242 */

/* 3243 */

/* 3244 */

/* 3245 */

/* 3246 */

/* 3247 */

/* 3248 */

/* 3249 */

/* 3250 */

/* 3251 */

/* 3252 */

/* 3253 */

/* 3254 */

/* 3255 */

/* 3256 */

/* 3257 */

/* 3258 */

/* 3259 */

/* 3260 */

/* 3261 */

/* 3262 */

/* 3263 */

/* 3264 */

/* 3265 */

/* 3266 */

/* 3267 */

/* 3268 */

/* 3269 */

/* 3270 */

/* 3271 */

/* 3272 */

/* 3273 */

/* 3274 */

/* 3275 */

/* 3276 */

/* 3277 */

/* 3278 */

/* 3279 */

/* 3280 */

/* 3281 */

/* 3282 */

/* 3283 */

/* 3284 */

/* 3285 */

/* 3286 */

/* 3287 */

/* 3288 */

/* 3289 */

/* 3290 */

/* 3291 */

/* 3292 */

/* 3293 */

/* 3294 */

/* 3295 */

/* 3296 */

/* 3297 */

/* 3298 */

/* 3299 */

/* 3300 */

/* 3301 */

/* 3302 */

/* 3303 */

/* 3304 */

/* 3305 */

/* 3306 */

/* 3307 */

/* 3308 */

/* 3309 */

/* 3310 */

/* 3311 */

/* 3312 */

/* 3313 */

/* 3314 */

/* 3315 */

/* 3316 */

/* 3317 */

/* 3318 */

/* 3319 */

/* 3320 */

/* 3321 */

/* 3322 */

/* 3323 */

/* 3324 */

/* 3325 */

/* 3326 */

/* 3327 */

/* 3328 */

/* 3329 */

/* 3330 */

/* 3331 */

/* 3332 */

/* 3333 */

/* 3334 */

/* 3335 */

/* 3336 */

/* 3337 */

/* 3338 */

/* 3339 */

/* 3340 */

/* 3341 */

/* 3342 */

/* 3343 */

/* 3344 */

/* 3345 */

/* 3346 */

/* 3347 */

/* 3348 */

/* 3349 */

/* 3350 */

/* 3351 */

/* 3352 */

/* 3353 */

/* 3354 */

/* 3355 */

/* 3356 */

/* 3357 */

/* 3358 */

/* 3359 */

/* 3360 */

/* 3361 */

/* 3362 */

/* 3363 */

/* 3364 */

/* 3365 */

/* 3366 */

/* 3367 */

/* 3368 */

/* 3369 */

/* 3370 */

/* 3371 */

/* 3372 */

/* 3373 */

/* 3374 */

/* 3375 */

/* 3376 */

/* 3377 */

/* 3378 */

/* 3379 */

/* 3380 */

/* 3381 */

/* 3382 */

/* 3383 */

/* 3384 */

/* 3385 */

/* 3386 */

/* 3387 */

/* 3388 */

/* 3389 */

/* 3390 */

/* 3391 */

/* 3392 */

/* 3393 */

/* 3394 */

/* 3395 */

/* 3396 */

/* 3397 */

/* 3398 */

/* 3399 */

/* 3400 */

/* 3401 */

/* 3402 */

/* 3403 */

/* 3404 */

/* 3405 */

/* 3406 */

/* 3407 */

/* 3408 */

/* 3409 */

/* 3410 */

/* 3411 */

/* 3412 */

/* 3413 */

/* 3414 */

/* 3415 */

/* 3416 */

/* 3417 */

/* 3418 */

/* 3419 */

/* 3420 */

/* 3421 */

/* 3422 */

/* 3423 */

/* 3424 */

/* 3425 */

/* 3426 */

/* 3427 */

/* 3428 */

/* 3429 */

/* 3430 */

/* 3431 */

/* 3432 */

/* 3433 */

/* 3434 */

/* 3435 */

/* 3436 */

/* 3437 */

/* 3438 */

/* 3439 */

/* 3440 */

/* 3441 */

/* 3442 */

/* 3443 */

/* 3444 */

/* 3445 */

/* 3446 */

/* 3447 */

/* 3448 */

/* 3449 */

/* 3450 */

/* 3451 */

/* 3452 */

/* 3453 */

/* 3454 */

/* 3455 */

/* 3456 */

/* 3457 */

/* 3458 */

/* 3459 */

/* 3460 */

/* 3461 */

/* 3462 */

/* 3463 */

/* 3464 */

/* 3465 */

/* 3466 */

/* 3467 */

/* 3468 */

/* 3469 */

/* 3470 */

/* 3471 */

/* 3472 */

/* 3473 */

/* 3474 */

/* 3475 */

/* 3476 */

/* 3477 */

/* 3478 */

/* 3479 */

/* 3480 */

/* 3481 */

/* 3482 */

/* 3483 */

/* 3484 */

/* 3485 */

/* 3486 */

/* 3487 */

/* 3488 */

/* 3489 */

/* 3490 */

/* 3491 */

/* 3492 */

/* 3493 */

/* 3494 */

/* 3495 */

/* 3496 */

/* 3497 */

/* 3498 */

/* 3499 */

/* 3500 */

/* 3501 */

/* 3502 */

/* 3503 */

/* 3504 */

/* 3505 */

/* 3506 */

/* 3507 */

/* 3508 */

/* 3509 */

/* 3510 */

/* 3511 */

/* 3512 */

/* 3513 */

/* 3514 */

/* 3515 */

/* 3516 */

/* 3517 */

/* 3518 */

/* 3519 */

/* 3520 */

/* 3521 */

/* 3522 */

/* 3523 */

/* 3524 */

/* 3525 */

/* 3526 */

/* 3527 */

/* 3528 */

/* 3529 */

/* 3530 */

/* 3531 */

/* 3532 */

/* 3533 */

/* 3534 */

/* 3535 */

/* 3536 */

/* 3537 */

/* 3538 */

/* 3539 */

/* 3540 */

/* 3541 */

/* 3542 */

/* 3543 */

/* 3544 */

/* 3545 */

/* 3546 */

/* 3547 */

/* 3548 */

/* 3549 */

/* 3550 */

/* 3551 */

/* 3552 */

/* 3553 */

/* 3554 */

/* 3555 */

/* 3556 */

/* 3557 */

/* 3558 */

/* 3559 */

/* 3560 */

/* 3561 */

/* 3562 */

/* 3563 */

/* 3564 */

/* 3565 */

/* 3566 */

/* 3567 */

/* 3568 */

/* 3569 */

/* 3570 */

/* 3571 */

/* 3572 */

/* 3573 */

/* 3574 */

/* 3575 */

/* 3576 */

/* 3577 */

/* 3578 */

/* 3579 */

/* 3580 */

/* 3581 */

/* 3582 */

/* 3583 */

/* 3584 */

/* 3585 */

/* 3586 */

/* 3587 */

/* 3588 */

/* 3589 */

/* 3590 */

/* 3591 */

/* 3592 */

/* 3593 */

/* 3594 */

/* 3595 */

/* 3596 */

/* 3597 */

/* 3598 */

/* 3599 */

/* 3600 */

/* 3601 */

/* 3602 */

/* 3603 */

/* 3604 */

/* 3605 */

/* 3606 */

/* 3607 */

/* 3608 */

/* 3609 */

/* 3610 */

/* 3611 */

/* 3612 */

/* 3613 */

/* 3614 */

/* 3615 */

/* 3616 */

/* 3617 */

/* 3618 */

/* 3619 */

/* 3620 */

/* 3621 */

/* 3622 */

/* 3623 */

/* 3624 */

/* 3625 */

/* 3626 */

/* 3627 */

/* 3628 */

/* 3629 */

/* 3630 */

/* 3631 */

/* 3632 */

/* 3633 */

/* 3634 */

/* 3635 */

/* 3636 */

/* 3637 */

/* 3638 */

/* 3639 */

/* 3640 */

/* 3641 */

/* 3642 */

/* 3643 */

/* 3644 */

/* 3645 */

/* 3646 */

/* 3647 */

/* 3648 */

/* 3649 */

/* 3650 */

/* 3651 */

/* 3652 */

/* 3653 */

/* 3654 */

/* 3655 */

/* 3656 */

/* 3657 */

/* 3658 */

/* 3659 */

/* 3660 */

/* 3661 */

/* 3662 */

/* 3663 */

/* 3664 */

/* 3665 */

/* 3666 */

/* 3667 */

/* 3668 */

/* 3669 */

/* 3670 */

/* 3671 */

/* 3672 */

/* 3673 */

/* 3674 */

/* 3675 */

/* 3676 */

/* 3677 */

/* 3678 */

/* 3679 */

/* 3680 */

/* 3681 */

/* 3682 */

/* 3683 */

/* 3684 */

/* 3685 */

/* 3686 */

/* 3687 */

/* 3688 */

/* 3689 */

/* 3690 */

/* 3691 */

/* 3692 */

/* 3693 */

/* 3694 */

/* 3695 */

/* 3696 */

/* 3697 */

/* 3698 */

/* 3699 */

/* 3700 */

/* 3701 */

/* 3702 */

/* 3703 */

/* 3704 */

/* 3705 */

/* 3706 */

/* 3707 */

/* 3708 */

/* 3709 */

/* 3710 */

/* 3711 */

/* 3712 */

/* 3713 */

/* 3714 */

/* 3715 */

/* 3716 */

/* 3717 */

/* 3718 */

/* 3719 */

/* 3720 */

/* 3721 */

/* 3722 */

/* 3723 */

/* 3724 */

/* 3725 */

/* 3726 */

/* 3727 */

/* 3728 */

/* 3729 */

/* 3730 */

/* 3731 */

/* 3732 */

/* 3733 */

/* 3734 */

/* 3735 */

/* 3736 */

/* 3737 */

/* 3738 */

/* 3739 */

/* 3740 */

/* 3741 */

/* 3742 */

/* 3743 */

/* 3744 */

/* 3745 */

/* 3746 */

/* 3747 */

/* 3748 */

/* 3749 */

/* 3750 */

/* 3751 */

/* 3752 */

/* 3753 */

/* 3754 */

/* 3755 */

/* 3756 */

/* 3757 */

/* 3758 */

/* 3759 */

/* 3760 */

/* 3761 */

/* 3762 */

/* 3763 */

/* 3764 */

/* 3765 */

/* 3766 */

/* 3767 */

/* 3768 */

/* 3769 */

/* 3770 */

/* 3771 */

/* 3772 */

/* 3773 */

/* 3774 */

/* 3775 */

/* 3776 */

/* 3777 */

/* 3778 */

/* 3779 */

/* 3780 */

/* 3781 */

/* 3782 */

/* 3783 */

/* 3784 */

/* 3785 */

/* 3786 */

/* 3787 */

/* 3788 */

/* 3789 */

/* 3790 */

/* 3791 */

/* 3792 */

/* 3793 */

/* 3794 */

/* 3795 */

/* 3796 */

/* 3797 */

/* 3798 */

/* 3799 */

/* 3800 */

/* 3801 */

/* 3802 */

/* 3803 */

/* 3804 */

/* 3805 */

/* 3806 */

/* 3807 */

/* 3808 */

/* 3809 */

/* 3810 */

/* 3811 */

/* 3812 */

/* 3813 */

/* 3814 */

/* 3815 */

/* 3816 */

/* 3817 */

/* 3818 */

/* 3819 */

/* 3820 */

/* 3821 */

/* 3822 */

/* 3823 */

/* 3824 */

/* 3825 */

/* 3826 */

/* 3827 */

/* 3828 */

/* 3829 */

/* 3830 */

/* 3831 */

/* 3832 */

/* 3833 */

/* 3834 */

/* 3835 */

/* 3836 */

/* 3837 */

/* 3838 */

/* 3839 */

/* 3840 */

/* 3841 */

/* 3842 */

/* 3843 */

/* 3844 */

/* 3845 */

/* 3846 */

/* 3847 */

/* 3848 */

/* 3849 */

/* 3850 */

/* 3851 */

/* 3852 */

/* 3853 */

/* 3854 */

/* 3855 */

/* 3856 */

/* 3857 */

/* 3858 */

/* 3859 */

/* 3860 */

/* 3861 */

/* 3862 */

/* 3863 */

/* 3864 */

/* 3865 */

/* 3866 */

/* 3867 */

/* 3868 */

/* 3869 */

/* 3870 */

/* 3871 */

/* 3872 */

/* 3873 */

/* 3874 */

/* 3875 */

/* 3876 */

/* 3877 */

/* 3878 */

/* 3879 */

/* 3880 */

/* 3881 */

/* 3882 */

/* 3883 */

/* 3884 */

/* 3885 */

/* 3886 */

/* 3887 */

/* 3888 */

/* 3889 */

/* 3890 */

/* 3891 */

/* 3892 */

/* 3893 */

/* 3894 */

/* 3895 */

/* 3896 */

/* 3897 */

/* 3898 */

/* 3899 */

/* 3900 */

/* 3901 */

/* 979 */

/* 980 */

/* 981 */

/* 982 */

/* 983 */

/* 984 */

/* 985 */

/* 986 */

/* 987 */

/* 988 */

/* 989 */

/* 990 */

/* 991 */

/* 992 */

/* 993 */

/* 994 */

/* 995 */

/* 996 */

/* 997 */

/* 998 */

/* 999 */

/* Falls through... */

/* This is a generated file. Do not edit directly. */

/* eslint-disable default-case */

/* eslint-disable max-lines */

/* eslint-disable max-statements */

/* eslint-disable max-statements, max-lines */

/* eslint-disable no-case-declarations */

/* eslint-disable no-invalid-this */

/* eslint-disable no-lonely-if */

/* eslint-disable no-mixed-operators */

/* eslint-disable no-mixed-operators, max-len */

/* eslint-disable no-restricted-syntax */

/* eslint-disable no-unneeded-ternary */

/* eslint-enable no-invalid-this */

/* falls through */

/* harmony default export */

/* harmony export (binding) */

/* harmony import */

/* tslint:disable:max-line-length */

/*#__PURE__*/

/**
	* Array order.
	*
	* ## Notes
	*
	* -   The array order is either row-major (C-style) or column-major (Fortran-style).
	*
	*
	* @private
	* @name order
	* @memberof ndarray.prototype
	* @type {string}
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var order = x.order;
	* // returns 'row-major'
	*/

/**
	* Calculate the next term of the series.
	*
	* @private
	* @returns {Array} series expansion terms
	*/

/**
	* Calculate the next term of the series.
	*
	* @private
	* @returns {number} series expansion term
	*/

/**
	* Calculate the numerator and denominator of the next term of the series.
	*
	* @private
	* @returns {Array} series expansion terms
	*/

/**
	* Calculates roots.
	*
	* @private
	* @param {number} x - function value
	* @returns {Array} function roots
	*/

/**
	* Calculates roots.
	*
	* @private
	* @param {number} x - input value
	* @returns {Array} roots
	*/

/**
	* Compare the elements of the input array.
	*
	* @private
	* @param {number} a - first number
	* @param {number} b - second number
	* @returns {boolean} comparison result
	*/

/**
	* Evaluates a polynomial.
	*
	* @private
	* @param {number} x - value at which to evaluate a polynomial
	* @returns {number} evaluated polynomial
	*/

/**
	* Evaluates the cumulative distribution function (CDF) for a Normal distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {Probability} evaluated CDF
	*
	* @example
	* var y = cdf( 2.0 );
	* // returns <number>
	*/

/**
	* Evaluates the cumulative distribution function (CDF) for a Student's t distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {Probability} evaluated CDF
	*
	* @example
	* var y = cdf( 2.0 );
	* // returns <number>
	*/

/**
	* Evaluates the cumulative distribution function (CDF) for a gamma distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {Probability} evaluated CDF
	*
	* @example
	* var y = cdf( 2.0 );
	* // returns <number>
	*/

/**
	* Evaluates the cumulative distribution function (CDF) for an F distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {Probability} evaluated CDF
	*
	* @example
	* var y = cdf( 10.0 );
	* // returns <number>
	*/

/**
	* Evaluates the cumulative distribution function (CDF) of a degenerate distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {Probability} evaluated cumulative distribution function
	*
	* @example
	* var y = cdf( 10.0 );
	* // returns <number>
	*/

/**
	* Evaluates the probability density function (PDF) for a normal distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {number} evaluated probability density function
	*
	* @example
	* var y = pdf( -3.14 );
	* // returns <number>
	*/

/**
	* Evaluates the probability density function (PDF) for a uniform distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {number} evaluated PDF
	*
	* @example
	* var y = pdf( 2.0 );
	* // returns <number>
	*/

/**
	* Evaluates the probability density function (PDF) for an exponential distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {number} evaluated PDF
	*
	* @example
	* var y = pdf( 2.3 );
	* // returns <number>
	*/

/**
	* Evaluates the probability density function (PDF) of a degenerate distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {number} evaluated probability density function
	*
	* @example
	* var y = pdf( 10.0 );
	* // returns <number>
	*/

/**
	* Evaluates the probability mass function (PMF) for a Bernoulli distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {Probability} evaluated PMF
	*
	* @example
	* var y = pmf( 2.0 );
	* // returns <number>
	*/

/**
	* Evaluates the quantile function for a Student's t distribution.
	*
	* @private
	* @param {Probability} p - input value
	* @returns {number} evaluated quantile function
	*
	* @example
	* var y = quantile( 0.3 );
	* // returns <number>
	*/

/**
	* Evaluates the quantile function for a normal distribution.
	*
	* @private
	* @param {Probability} p - input value
	* @returns {number} evaluated quantile function
	*
	* @example
	* var y = quantile( 0.3 );
	* // returns <number>
	*/

/**
	* Evaluates the quantile function of a degenerate distribution.
	*
	* @private
	* @param {Probability} p - input value
	* @returns {number} evaluated quantile function
	*
	* @example
	* var y = quantile( 0.5 );
	* // returns <number>
	*/

/**
	* Flattens an array and deep copies array elements.
	*
	* @private
	* @param {Array} arr - array to flatten
	* @throws {TypeError} must provide an array
	* @returns {Array} flattened array
	*/

/**
	* Flattens an array.
	*
	* @private
	* @param {Array} arr - array to flatten
	* @throws {TypeError} must provide an array
	* @returns {Array} flattened array
	*/

/**
	* Gets an element of an nd-array-like object .
	*
	* @private
	* @param {number} i - row index
	* @param {number} j - column index
	* @returns {number} number stored in row i and column j
	*/

/**
	* If provided a value, the accumulator function returns an updated corrected sample standard deviation. If not provided a value, the accumulator function returns the current corrected sample standard deviation.
	*
	* @private
	* @param {number} [x] - new value
	* @returns {(number|null)} corrected sample standard deviation or null
	*/

/**
	* If provided a value, the accumulator function returns an updated sum. If not provided a value, the accumulator function returns the current sum.
	*
	* @private
	* @param {number} [x] - new value
	* @returns {(number|null)} sum or null
	*/

/**
	* Index offset which specifies the buffer index at which to start iterating over array elements.
	*
	* @private
	* @name offset
	* @memberof ndarray.prototype
	* @type {NonNegativeInteger}
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var o = x.offset;
	* // returns 0
	*/

/**
	* Index strides which specify how to access data along corresponding array dimensions.
	*
	* @private
	* @name strides
	* @memberof ndarray.prototype
	* @type {IntegerArray}
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var s = x.strides;
	* // returns [ 2, 1 ]
	*/

/**
	* Information about the memory layout of the array.
	*
	* @private
	* @name flags
	* @memberof ndarray.prototype
	* @type {Object}
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var flgs = x.flags;
	* // returns <Object>
	*/

/**
	* Length of the array.
	*
	* @private
	* @name length
	* @memberof ndarray.prototype
	* @type {NonNegativeInteger}
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var len = x.length;
	* // returns 6
	*/

/**
	* Number of dimensions.
	*
	* @private
	* @name ndims
	* @memberof ndarray
	* @type {PositiveInteger}
	*
	* @example
	* var ndims = ndarray.ndims;
	* // returns <number>
	*/

/**
	* Number of dimensions.
	*
	* @private
	* @name ndims
	* @memberof ndarray.prototype
	* @type {PositiveInteger}
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var ndims = x.ndims;
	* // returns <number>
	*/

/**
	* Pointer to the underlying data buffer.
	*
	* @private
	* @name data
	* @memberof ndarray.prototype
	* @type {(Array|TypedArray|Buffer)}
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var data = x.data;
	* // returns [ 1, 2, 3, 4, 5, 6 ]
	*/

/**
	* Pretty-print output of ANOVA.
	*
	* @private
	* @param {Object} [opts] - options object
	* @param {PositiveInteger} [opts.digits=4] - number of digits after the decimal point
	* @param {boolean} [opts.decision=true] - boolean indicating whether to print the test decision
	* @throws {TypeError} options argument must be an object
	* @throws {TypeError} must provide valid options
	* @returns {string} formatted results
	*/

/**
	* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.
	*
	* @private
	* @param {number} a - minimum support (inclusive)
	* @param {number} b - maximum support (exclusive)
	* @returns {number} pseudorandom number
	*
	* @example
	* var v = uniform2( 0.0, 1.0 );
	* // returns <number>
	*
	* @example
	* var v = uniform2( 1.0, 0.0 );
	* // returns NaN
	*/

/**
	* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.
	*
	* @private
	* @returns {number} pseudorandom number
	*
	* @example
	* var v = uniform1();
	* // returns <number>
	*/

/**
	* Returns an array element located at a specified linear index.
	*
	* @private
	* @name iget
	* @memberof ndarray.prototype
	* @type {Function}
	* @param {integer} idx - linear index
	* @returns {*} array element
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var v = x.iget( 3 );
	* // returns 4
	*/

/**
	* Returns an array element located at a specified linear index.
	*
	* @private
	* @param {integer} idx - linear view index
	* @throws {TypeError} index must be an integer value
	* @throws {RangeError} index exceeds array dimensions
	* @returns {*} array element
	*/

/**
	* Returns an array element.
	*
	* @private
	* @name get
	* @memberof ndarray.prototype
	* @type {Function}
	* @param {...integer} idx - indices
	* @returns {*} array element
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var v = x.get( 1, 1 );
	* // returns 4
	*/

/**
	* Returns an array element.
	*
	* @private
	* @param {...integer} idx - indices
	* @throws {TypeError} provided indices must be integer valued
	* @throws {RangeError} index exceeds array dimensions
	* @returns {*} array element
	*/

/**
	* Returns an array element.
	*
	* @private
	* @param {integer} i - index
	* @throws {TypeError} index must be an integer value
	* @throws {RangeError} index exceeds array dimensions
	* @returns {*} array element
	*/

/**
	* Returns an array element.
	*
	* @private
	* @param {integer} i - index for first dimension
	* @param {integer} j - index for second dimension
	* @param {integer} k - index for third dimension
	* @param {integer} l - index for fourth dimension
	* @throws {TypeError} index for first dimension must be an integer value
	* @throws {TypeError} index for second dimension must be an integer value
	* @throws {TypeError} index for third dimension must be an integer value
	* @throws {TypeError} index for fourth dimension must be an integer value
	* @throws {RangeError} index exceeds array dimensions
	* @returns {*} array element
	*/

/**
	* Returns an array element.
	*
	* @private
	* @param {integer} i - index for first dimension
	* @param {integer} j - index for second dimension
	* @param {integer} k - index for third dimension
	* @throws {TypeError} index for first dimension must be an integer value
	* @throws {TypeError} index for second dimension must be an integer value
	* @throws {TypeError} index for third dimension must be an integer value
	* @throws {RangeError} index exceeds array dimensions
	* @returns {*} array element
	*/

/**
	* Returns an array element.
	*
	* @private
	* @param {integer} i - index for first dimension
	* @param {integer} j - index for second dimension
	* @throws {TypeError} index for first dimension must be an integer value
	* @throws {TypeError} index for second dimension must be an integer value
	* @throws {RangeError} index exceeds array dimensions
	* @returns {*} array element
	*/

/**
	* Returns the PRNG seed length.
	*
	* @private
	* @returns {PositiveInteger} seed length
	*/

/**
	* Returns the PRNG seed.
	*
	* @private
	* @returns {PRNGSeedMT19937} seed
	*/

/**
	* Returns the PRNG state length.
	*
	* @private
	* @returns {PositiveInteger} state length
	*/

/**
	* Returns the PRNG state size (in bytes).
	*
	* @private
	* @returns {PositiveInteger} state size (in bytes)
	*/

/**
	* Returns the current pseudorandom number generator state.
	*
	* @private
	* @returns {PRNGStateMT19937} current state
	*/

/**
	* Serializes an ndarray as a JSON object.
	*
	* ## Notes
	*
	* -   `JSON.stringify()` implicitly calls this method when stringifying an `ndarray` instance.
	* -   The method does **not** serialize data outside of the buffer region defined by the array configuration.
	*
	*
	* @private
	* @name toJSON
	* @memberof ndarray.prototype
	* @type {Function}
	* @returns {Object} serialized ndarray
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6, 7, 8 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 2;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var o = x.toJSON();
	* // e.g., returns { 'type': 'ndarray', 'dtype': '<dtype>', 'flags': {...}, 'offset': 0, 'order': 'row-major', 'shape': [ 3, 2 ], 'strides': [ 2, 1 ], 'data': [ 3, 4, 5, 6, 7, 8 ] }
	*/

/**
	* Serializes an ndarray as a string.
	*
	* ## Notes
	*
	* -   The method does **not** serialize data outside of the buffer region defined by the array configuration.
	*
	*
	* @private
	* @name toString
	* @memberof ndarray.prototype
	* @type {Function}
	* @returns {string} serialized ndarray
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6, 7, 8 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 2;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var str = x.toString();
	* // e.g., returns 'ndarray( [ 3, 4, 5, 6, 7, 8 ], [ 3, 2 ], [ 2, 1 ], 0, "row-major" )'
	*/

/**
	* Serializes the pseudorandom number generator as a JSON object.
	*
	* ## Notes
	*
	* -   `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
	*
	* @private
	* @returns {Object} JSON representation
	*/

/**
	* Sets an array element located at a specified linear index.
	*
	* @private
	* @name iset
	* @memberof ndarray.prototype
	* @type {Function}
	* @param {integer} idx - linear index
	* @param {*} v - value to set
	* @returns {ndarray} ndarray instance
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var v = x.iget( 3 );
	* // returns 4
	*
	* x.iset( 3, 10 );
	*
	* var b = x.data;
	* // returns [ 1, 2, 3, 10, 5, 6 ]
	*
	* v = x.iget( 3 );
	* // returns 10
	*/

/**
	* Sets an array element located at a specified linear index.
	*
	* @private
	* @param {integer} idx - linear view index
	* @param {*} v - value to set
	* @throws {TypeError} index must be an integer value
	* @throws {RangeError} index exceeds array dimensions
	* @returns {ndarray} ndarray instance
	*/

/**
	* Sets an array element.
	*
	* @private
	* @name set
	* @memberof ndarray.prototype
	* @type {Function}
	* @param {...integer} idx - indices
	* @param {*} v - value to set
	* @returns {ndarray} ndarray instance
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var v = x.get( 1, 1 );
	* // returns 4
	*
	* x.set( 1, 1, 10 );
	*
	* var b = x.data;
	* // returns [ 1, 2, 3, 10, 5, 6 ]
	*
	* v = x.get( 1, 1 );
	* // returns 10
	*/

/**
	* Sets an array element.
	*
	* @private
	* @param {...integer} idx - indices
	* @param {*} v - value to set
	* @throws {TypeError} provided indices must be integer valued
	* @throws {RangeError} index exceeds array dimensions
	* @returns {ndarray} ndarray instance
	*/

/**
	* Sets an array element.
	*
	* @private
	* @param {integer} i - index
	* @param {*} v - value to set
	* @throws {TypeError} index must be an integer value
	* @throws {RangeError} index exceeds array dimensions
	* @returns {ndarray} ndarray instance
	*/

/**
	* Sets an array element.
	*
	* @private
	* @param {integer} i - index for first dimension
	* @param {integer} j - index for second dimension
	* @param {*} v - value to set
	* @throws {TypeError} index for first dimension must be an integer value
	* @throws {TypeError} index for second dimension must be an integer value
	* @throws {RangeError} index exceeds array dimensions
	* @returns {ndarray} ndarray instance
	*/

/**
	* Sets an array element.
	*
	* @private
	* @param {integer} i - index for first dimension
	* @param {integer} j - index for second dimension
	* @param {integer} k - index for third dimension
	* @param {*} v - value to set
	* @throws {TypeError} index for first dimension must be an integer value
	* @throws {TypeError} index for second dimension must be an integer value
	* @throws {TypeError} index for third dimension must be an integer value
	* @throws {RangeError} index exceeds array dimensions
	* @returns {ndarray} ndarray instance
	*/

/**
	* Sets an array element.
	*
	* @private
	* @param {integer} i - index for first dimension
	* @param {integer} j - index for second dimension
	* @param {integer} k - index for third dimension
	* @param {integer} l - index for fourth dimension
	* @param {*} v - value to set
	* @throws {TypeError} index for first dimension must be an integer value
	* @throws {TypeError} index for second dimension must be an integer value
	* @throws {TypeError} index for third dimension must be an integer value
	* @throws {TypeError} index for fourth dimension must be an integer value
	* @throws {RangeError} index exceeds array dimensions
	* @returns {ndarray} ndarray instance
	*/

/**
	* Sets the pseudorandom number generator state.
	*
	* @private
	* @param {PRNGStateMT19937} s - generator state
	* @throws {Error} must provide a valid state
	*/

/**
	* Shape of the array.
	*
	* @private
	* @name shape
	* @memberof ndarray.prototype
	* @type {NonNegativeIntegerArray}
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var s = x.shape;
	* // returns [ 3, 2 ]
	*/

/**
	* Size (in bytes) of each array element (if known).
	*
	* @private
	* @name BYTES_PER_ELEMENT
	* @memberof ndarray
	* @type {(PositiveInteger|null)}
	*
	* @example
	* var nbytes = ndarray.BYTES_PER_ELEMENT;
	* // returns <number>
	*/

/**
	* Size (in bytes) of each array element (if known).
	*
	* @private
	* @name BYTES_PER_ELEMENT
	* @memberof ndarray.prototype
	* @type {(PositiveInteger|null)}
	*
	* @example
	* var Float64Array = require( '@stdlib/array/float64' );
	*
	* var buffer = new Float64Array( [ 1, 2, 3, 4, 5, 6 ] );
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var nbytes = x.BYTES_PER_ELEMENT;
	* // returns 8
	*/

/**
	* Size (in bytes) of the array (if known).
	*
	* @private
	* @name byteLength
	* @memberof ndarray.prototype
	* @type {(NonNegativeInteger|null)}
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var byteLength = x.byteLength;
	* // returns <number>
	*/

/**
	* Tests if every element in an array-like object passes a test condition.
	*
	* @private
	* @param {*} value - value to test
	* @returns {boolean} boolean indicating whether a value is an array-like object for which all elements pass a test condition
	*/

/**
	* Underlying data type.
	*
	* @private
	* @name dtype
	* @memberof ndarray
	* @type {string}
	*
	* @example
	* var dtype = ndarray.dtype;
	* // returns <string>
	*/

/**
	* Underlying data type.
	*
	* @private
	* @name dtype
	* @memberof ndarray.prototype
	* @type {string}
	*
	* @example
	* var buffer = [ 1, 2, 3, 4, 5, 6 ];
	* var shape = [ 3, 2 ];
	* var strides = [ 2, 1 ];
	* var offset = 0;
	*
	* var x = ndarray( buffer, shape, strides, offset, 'row-major' );
	*
	* var dtype = x.dtype;
	* // returns <string>
	*/

/**
	* ndarray constructor.
	*
	* @private
	* @constructor
	* @param {(ArrayLikeObject|TypedArray|Buffer)} buffer - data buffer
	* @param {NonNegativeIntegerArray} shape - array shape
	* @param {IntegerArray} strides - array strides
	* @param {NonNegativeInteger} offset - index offset
	* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)
	* @returns {ndarray} ndarray instance
	*/

/**
	* ndarray constructor.
	*
	* @private
	* @constructor
	* @param {(ArrayLikeObject|TypedArray|Buffer)} buffer - data buffer
	* @param {NonNegativeIntegerArray} shape - array shape
	* @param {IntegerArray} strides - array strides
	* @param {NonNegativeInteger} offset - index offset
	* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)
	* @throws {TypeError} `buffer` argument must be an array-like object, typed-array-like, or a Buffer
	* @throws {TypeError} `shape` argument must be an array-like object containing nonnegative integers
	* @throws {Error} `shape` argument length must equal the number of dimensions
	* @throws {TypeError} `strides` argument must be an array-like object containing integers
	* @throws {Error} `strides` argument length must equal the number of dimensions
	* @throws {TypeError} `offset` argument must be a nonnegative integer
	* @throws {TypeError} `order` argument must be a supported ndarray order
	* @throws {Error} `buffer` argument must be compatible with specified meta data
	* @returns {ndarray} ndarray instance
	*/

/**
     * @param [seedOrRandom=Math.random] - Control the random number generator used by the Random class instance. Pass a random number generator function with a uniform distribution over the half-open interval [0, 1[. If seed will pass it to ml-xsadd to create a seeded random number generator. If undefined will use Math.random.
     */

/**
     * Draw a random integer from a uniform distribution on [low, high). If only low is specified, the number is drawn on [0, low)
     * @param low - The lower bound of the uniform distribution interval.
     * @param high - The higher bound of the uniform distribution interval.
     */

/**
     * Draw a random number from a uniform distribution on [0,1)
     * @return The random number
     */

/**
     * Draw several random number from a uniform distribution on [0, 1)
     * @param size - The number of number to draw
     * @return - The list of drawn numbers.
     */

/**
     * Returns a 32-bit integer r (0 <= r < 2^32)
     */

/**
     * Returns a floating point number r (0.0 <= r < 1.0)
     */

/**
    * React component render method.
    */

/**
    * Scrolls to the bottom of the output panel after result has been inserted.
    */

/**
   *  Which event when fired outside the component will cause it to be closed.
   *
   * _see [DropdownMenu](#menu-props) for more details_
   */

/**
   * A Callback fired by the Overlay when it wishes to be hidden.
   *
   * __required__ when `rootClose` is `true`.
   *
   * @type func
   */

/**
   * A DOM Element, Ref to an element, or function that returns either. The `container` will have the Portal children
   * appended to it.
   */

/**
   * A DOM Element, Ref to an element, or function that returns either. The `target` element is where
   * the overlay is positioned relative to.
   */

/**
   * A `react-transition-group@2.0.0` `<Transition/>` component
   * used to animate the overlay as it changes visibility.
   */

/**
   * A callback fired when the Dropdown wishes to change visibility. Called with the requested
   * `show` value, the DOM event, and the source that fired it: `'click'`,`'keydown'`,`'rootClose'`, or `'select'`.
   *
   * ```ts static
   * function(
   *   isOpen: boolean,
   *   event: SyntheticEvent,
   * ): void
   * ```
   *
   * @controllable show
   */

/**
   * A css slector string that will return __focusable__ menu items.
   * Selectors should be relative to the menu component:
   * e.g. ` > li:not('.disabled')`
   */

/**
   * A render prop that returns a Menu element. The `props`
   * argument should spread through to **a component that can accept a ref**.
   *
   * @type {Function ({
   *   show: boolean,
   *   alignEnd: boolean,
   *   close: (?SyntheticEvent) => void,
   *   placement: Placement,
   *   outOfBoundaries: ?boolean,
   *   scheduleUpdate: () => void,
   *   props: {
   *     ref: (?HTMLElement) => void,
   *     style: { [string]: string | number },
   *     aria-labelledby: ?string
   *   },
   *   arrowProps: {
   *     ref: (?HTMLElement) => void,
   *     style: { [string]: string | number },
   *   },
   * }) => React.Element}
   */

/**
   * A render prop that returns a Toggle element. The `props`
   * argument should spread through to **a component that can accept a ref**. Use
   * the `onToggle` argument to toggle the menu open or closed
   *
   * @type {Function ({
   *   show: boolean,
   *   toggle: (show: boolean) => void,
   *   props: {
   *     ref: (?HTMLElement) => void,
   *     aria-haspopup: true
   *     aria-expanded: boolean
   *   },
   * }) => React.Element}
   */

/**
   * A render prop that returns an element to overlay and position. See
   * the [react-popper documentation](https://github.com/FezVrasta/react-popper#children) for more info.
   *
   * @type {Function ({
   *   show: boolean,
   *   placement: Placement,
   *   outOfBoundaries: ?boolean,
   *   scheduleUpdate: () => void,
   *   props: {
   *     ref: (?HTMLElement) => void,
   *     style: { [string]: string | number },
   *     aria-labelledby: ?string
   *   },
   *   arrowProps: {
   *     ref: (?HTMLElement) => void,
   *     style: { [string]: string | number },
   *   },
   * }) => React.Element}
   */

/**
   * A render prop that returns the root dropdown element. The `props`
   * argument should spread through to an element containing _both_ the
   * menu and toggle in order to handle keyboard events for focus management.
   *
   * @type {Function ({
   *   props: {
   *     onKeyDown: (SyntheticEvent) => void,
   *   },
   * }) => React.Element}
   */

/**
   * A set of popper options and props passed directly to react-popper's Popper component.
   */

/**
   * Align the menu to the 'end' side of the placement side of the Dropdown toggle. The default placement is `top-start` or `bottom-start`.
   */

/**
   * Aligns the dropdown menu to the 'end' of it's placement position.
   * Generally this is provided by the parent `Dropdown` component,
   * but may also be specified as a prop directly.
   */

/**
   * Allows to compute for a new array of points their cluster id
   * @param {Array<Array<number>>} data - the [x,y,z,...] points to cluster
   * @return {Array<number>} - cluster id for each point
   */

/**
   * An html id attribute for the Toggle button, necessary for assistive technologies, such as screen readers.
   * @type {string|number}
   * @required
   */

/**
   * Calculates the inverse PCA transform
   * @param {Matrix} dataset
   * @return {Matrix} dataset projected in the PCA space
   */

/**
   * Callback fired after the Overlay finishes transitioning in
   */

/**
   * Callback fired after the Overlay finishes transitioning out
   */

/**
   * Callback fired as the Overlay begins to transition in
   */

/**
   * Callback fired as the Overlay begins to transition out
   */

/**
   * Callback fired before the Overlay transitions in
   */

/**
   * Callback fired right before the Overlay transitions out
   */

/**
   * Control how much space there is between the edge of the boundary element and overlay.
   * A convenience shortcut to setting `popperConfig.modfiers.preventOverflow.padding`
   */

/**
   * Controls the focus behavior for when the Dropdown is opened. Set to
   * `true` to always focus the first menu item, `keyboard` to focus only when
   * navigating via the keyboard, or `false` to disable completely
   *
   * The Default behavior is `false` **unless** the Menu has a `role="menu"`
   * where it will default to `keyboard` to match the recommended [ARIA Authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton).
   */

/**
   * Controls the visible state of the menu, generally this is
   * provided by the parent `Dropdown` component,
   * but may also be specified as a prop directly.
   */

/**
   * Determines the direction and location of the Menu in relation to it's Toggle.
   */

/**
   * Enables the Popper.js `flip` modifier, allowing the Dropdown to
   * automatically adjust it's placement in case of overlap with the viewport or toggle.
   * Refer to the [flip docs](https://popper.js.org/popper-documentation.html#modifiers..flip.enabled) for more info
   */

/**
   * Enables the Popper.js `flip` modifier, allowing the Overlay to
   * automatically adjust it's placement in case of overlap with the viewport or toggle.
   * Refer to the [flip docs](https://popper.js.org/popper-documentation.html#modifiers..flip.enabled) for more info
   */

/**
   * Export the current model to a JSON object
   * @return {Object} model
   */

/**
   * Load a PCA model from JSON
   * @param {Object} model
   * @return {PCA}
   */

/**
   * Override the default event used by RootCloseWrapper.
   */

/**
   * Project the dataset into the PCA space
   * @param {Matrix} dataset
   * @param {Object} options
   * @return {Matrix} dataset projected in the PCA space
   */

/**
   * Result of the kmeans algorithm
   * @param {Array<number>} clusters - the cluster identifier for each data dot
   * @param {Array<Array<object>>} centroids - the K centers in format [x,y,z,...], the error and size of the cluster
   * @param {boolean} converged - Converge criteria satisfied
   * @param {number} iterations - Current number of iterations
   * @param {function} distance - (*Private*) Distance function to use between the points
   * @constructor
   */

/**
   * Returns a KMeansResult with the error and size of the cluster
   * @ignore
   * @param {Array<Array<number>>} data - the [x,y,z,...] points to cluster
   * @return {KMeansResult}
   */

/**
   * Returns the Eigenvalues (on the diagonal)
   * @returns {[number]}
   */

/**
   * Returns the Eigenvectors of the covariance matrix
   * @returns {Matrix}
   */

/**
   * Returns the cumulative proportion of variance
   * @return {[number]}
   */

/**
   * Returns the loadings matrix
   * @return {Matrix}
   */

/**
   * Returns the proportion of variance for each component
   * @return {[number]}
   */

/**
   * Returns the standard deviations of the principal components
   * @returns {[number]}
   */

/**
   * Set the visibility of the Overlay
   */

/**
   * Sets the initial show position of the Dropdown.
   */

/**
   * Specify disabled for disable RootCloseWrapper
   */

/**
   * Specify event for toggling overlay
   */

/**
   * Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay
   */

/**
   * Whether or not the Dropdown is visible.
   *
   * @controllable onToggle
   */

/**
  * Constructor function
  */

/**
  * Kernel smoother which returns a kernel density estimate at the supplied location.
  *
  * @param {number} x - input value
  * @returns {number} density estimate
  */

/**
 *
 * @param {Array} input
 * @param {object} [options={}]
 * @param {Array} [options.output=[]] specify the output array, can be the input array for in place modification
 */

/**
 * @classdesc Random class
 */

/**
 * @displayName Dropdown
 */

/**
 * @memberOf Dropdown
 * @param {object}  options
 * @param {boolean} options.flip Automatically adjust the menu `drop` position based on viewport edge detection
 * @param {boolean} options.show Display the menu manually, ignored in the context of a `Dropdown`
 * @param {boolean} options.usePopper opt in/out of using PopperJS to position menus. When disabled you must position it yourself.
 * @param {string}  options.rootCloseEvent The pointer event to listen for when determining "clicks outside" the menu for triggering a close.
 * @param {object}  options.popperConfig Options passed to the [`usePopper`](/api/usePopper) hook.
 */

/**
 * @private
 * Check that a column index is not out of bounds
 * @param {Matrix} matrix
 * @param {number} index
 * @param {boolean} [outer]
 */

/**
 * @private
 * Check that a row index is not out of bounds
 * @param {Matrix} matrix
 * @param {number} index
 * @param {boolean} [outer]
 */

/**
 * @private
 * Check that the provided vector is an array with the right length
 * @param {Matrix} matrix
 * @param {Array|Matrix} vector
 * @return {Array}
 * @throws {RangeError}
 */

/**
 * Also exported as `<Dropdown.Menu>` from `Dropdown`.
 *
 * @displayName DropdownMenu
 * @memberOf Dropdown
 */

/**
 * Also exported as `<Dropdown.Toggle>` from `Dropdown`.
 *
 * @displayName DropdownToggle
 * @memberOf Dropdown
 */

/**
 * Calculates the distance matrix for a given array of points
 * @ignore
 * @param {Array<Array<number>>} data - the [x,y,z,...] points to cluster
 * @param {function} distance - Distance function to use between the points
 * @return {Array<Array<number>>} - matrix with the distance values
 */

/**
 * Choose K different random points from the original data
 * @ignore
 * @param {Array<Array<number>>} data - Points in the format to cluster [x,y,z,...]
 * @param {number} K - number of clusters
 * @param {number} seed - seed for random number generation
 * @return {Array<Array<number>>} - Initial random points
 */

/**
 * Chooses the most distant points to a first random pick
 * @ignore
 * @param {Array<Array<number>>} data - Points in the format to cluster [x,y,z,...]
 * @param {number} K - number of clusters
 * @param {Array<Array<number>>} distanceMatrix - matrix with the distance values
 * @param {number} seed - seed for random number generation
 * @return {Array<Array<number>>} - Initial random points
 */

/**
 * Computes the maximum of the given values
 * @param {Array<number>} input
 * @return {number}
 */

/**
 * Computes the minimum of the given values
 * @param {Array<number>} input
 * @return {number}
 */

/**
 * Creates an instance of DecisionTree
 *
 * @constructor
 * @param builder - contains training set and
 *                  some configuration parameters
 */

/**
 * Creates new PCA (Principal Component Analysis) from the dataset
 * @param {Matrix} dataset - dataset or covariance matrix.
 * @param {Object} [options]
 * @param {boolean} [options.isCovarianceMatrix=false] - true if the dataset is a covariance matrix.
 * @param {string} [options.method='SVD'] - select which method to use: SVD (default), covarianceMatrirx or NIPALS.
 * @param {number} [options.nCompNIPALS=2] - number of components to be computed with NIPALS.
 * @param {boolean} [options.center=true] - should the data be centered (subtract the mean).
 * @param {boolean} [options.scale=false] - should the data be scaled (divide by the standard deviation).
 * @param {boolean} [options.ignoreZeroVariance=false] - ignore columns with zero variance if `scale` is `true`.
 * */

/**
 * Each step operation for kmeans
 * @ignore
 * @param {Array<Array<number>>} centers - K centers in format [x,y,z,...]
 * @param {Array<Array<number>>} data - Points [x,y,z,...] to cluster
 * @param {Array<number>} clusterID - Cluster identifier for each data dot
 * @param {number} K - Number of clusters
 * @param {object} [options] - Option object
 * @param {number} iterations - Current number of iterations
 * @return {KMeansResult}
 */

/**
 * FUNCTION: partial( fn, j )
 *	Partially applied function from the right.
 *
 * @private
 * @param {Function} fn - input function
 * @param {Number} j - array index
 * @returns {Function} partially applied function
 */

/**
 * Generator version for the algorithm
 * @ignore
 * @param {Array<Array<number>>} centers - K centers in format [x,y,z,...]
 * @param {Array<Array<number>>} data - Points [x,y,z,...] to cluster
 * @param {Array<number>} clusterID - Cluster identifier for each data dot
 * @param {number} K - Number of clusters
 * @param {object} [options] - Option object
 */

/**
 * Insert a new element to the queue. Elements are assumed to be objects with `sim` and `index` properties.
 */

/**
 * K-means algorithm
 * @param {Array<Array<number>>} data - Points in the format to cluster [x,y,z,...]
 * @param {number} K - Number of clusters
 * @param {object} [options] - Option object
 * @param {number} [options.maxIterations = 100] - Maximum of iterations allowed
 * @param {number} [options.tolerance = 1e-6] - Error tolerance
 * @param {boolean} [options.withIterations = false] - Store clusters and centroids for each iteration
 * @param {function} [options.distanceFunction = squaredDistance] - Distance function to use between the points
 * @param {number} [options.seed] - Seed for random initialization.
 * @param {string|Array<Array<number>>} [options.initialization = 'kmeans++'] - K centers in format [x,y,z,...] or a method for initialize the data:
 *  * You can either specify your custom start centroids, or select one of the following initialization method:
 *  * `'kmeans++'` will use the kmeans++ method as described by http://ilpubs.stanford.edu:8090/778/1/2006-13.pdf
 *  * `'random'` will choose K random different values.
 *  * `'mostDistant'` will choose the more distant points to a first random pick
 * @return {KMeansResult} - Cluster identifier for each data dot and centroids with the following fields:
 *  * `'clusters'`: Array of indexes for the clusters.
 *  * `'centroids'`: Array with the resulting centroids.
 *  * `'iterations'`: Number of iterations that took to converge
 */

/**
 * Returns a controller object for setting a timeout that is properly cleaned up
 * once the component unmounts. New timeouts cancel and replace existing ones.
 */

/**
 * The centers have moved more than the tolerance value?
 * @ignore
 * @param {Array<Array<number>>} centers - the K centers in format [x,y,z,...]
 * @param {Array<Array<number>>} oldCenters - the K old centers in format [x,y,z,...]
 * @param {function} distanceFunction - Distance function to use between the points
 * @param {number} tolerance - Allowed distance for the centroids to move
 * @return {boolean}
 */

/**
 * Update the center values based in the new configurations of the clusters
 * @ignore
 * @param {Array<Array<number>>} prevCenters - Centroids from the previous iteration
 * @param {Array <Array <number>>} data - the [x,y,z,...] points to cluster
 * @param {Array <number>} clusterID - the cluster identifier for each data dot
 * @param {number} K - Number of clusters
 * @return {Array} he K centers in format [x,y,z,...]
 */

/**
 * Updates the cluster identifier based in the new data
 * @ignore
 * @param {Array<Array<number>>} data - the [x,y,z,...] points to cluster
 * @param {Array<Array<number>>} centers - the K centers in format [x,y,z,...]
 * @param {Array <number>} clusterID - the cluster identifier for each data dot
 * @param {function} distance - Distance function to use between the points
 * @return {Array} the cluster identifier for each data dot
 */

/**
 * Wires up Dropdown toggle functionality, returning a set a props to attach
 * to the element that functions as the dropdown toggle (generally a button).
 *
 * @memberOf Dropdown
 */

/**
*
*	COMPUTE: argmax
*
*
*	DESCRIPTION:
*		- Computes the maximum value of a numeric array and returns the corresponding array indices.
*
*
*	NOTES:
*		[1]
*
*
*	TODO:
*		[1]
*
*
*	LICENSE:
*		MIT
*
*	Copyright (c) 2014. Athan Reines.
*
*
*	AUTHOR:
*		Athan Reines. kgryte@gmail.com. 2014.
*
*/

/**
*
*	COMPUTE: chunkify
*
*
*	DESCRIPTION:
*		- Segments an array into chunks.
*
*
*	NOTES:
*		[1]
*
*
*	TODO:
*		[1]
*
*
*	LICENSE:
*		MIT
*
*	Copyright (c) 2014. Athan Reines.
*
*
*	AUTHOR:
*		Athan Reines. kgryte@gmail.com. 2014.
*
*/

/**
*
*	VALIDATE: function
*
*
*	DESCRIPTION:
*		- Validates if a value is a function.
*
*
*	NOTES:
*		[1]
*
*
*	TODO:
*		[1]
*
*
*	LICENSE:
*		MIT
*
*	Copyright (c) 2014. Athan Reines.
*
*
*	AUTHOR:
*		Athan Reines. kgryte@gmail.com. 2014.
*
*/

/**
*
*	VALIDATE: integer
*
*
*	DESCRIPTION:
*		- Validates if a value is an integer.
*
*
*	NOTES:
*		[1]
*
*
*	TODO:
*		[1]
*
*
*	LICENSE:
*		MIT
*
*	Copyright (c) 2014. Athan Reines.
*
*
*	AUTHOR:
*		Athan Reines. kgryte@gmail.com. 2014.
*
*/

/**
*
*	VALIDATE: number
*
*
*	DESCRIPTION:
*		- Validates if a value is a number.
*
*
*	NOTES:
*		[1]
*
*
*	TODO:
*		[1]
*
*
*	LICENSE:
*		MIT
*
*	Copyright (c) 2014. Athan Reines.
*
*
*	AUTHOR:
*		Athan Reines. kgryte@gmail.com. 2014.
*
*/

/**
*
*	VALIDATE: string
*
*
*	DESCRIPTION:
*		- Validates if a value is a string.
*
*
*	NOTES:
*		[1]
*
*
*	TODO:
*		[1]
*
*
*	LICENSE:
*		MIT
*
*	Copyright (c) 2014. Athan Reines.
*
*
*	AUTHOR:
*		Athan Reines. kgryte@gmail.com. 2014.
*
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The following copyright, license, and long comment were part of the original implementation available as part of [FDLIBM]{@link http://www.netlib.org/fdlibm/s_expm1.c}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The following copyright, license, and long comment were part of the original implementation available as part of [FDLIBM]{@link http://www.netlib.org/fdlibm/s_log1p.c}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/e_atanh.c?view=markup}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/e_lgamma_r.c}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C code, long comment, copyright, license, and constants are from [Cephes]{@link http://www.netlib.org/cephes}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright 1984, 1995, 2000 by Stephen L. Moshier
*
* Some software in this archive may be from the book _Methods and Programs for Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989) or from the Cephes Mathematical Library, a commercial product. In either event, it is copyrighted by the author. What you see here may be used freely but it comes with no support or guarantee.
*
* Stephen L. Moshier
* moshier@na-net.ornl.gov
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_37_0/boost/math/special_functions/beta.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_37_0/boost/math/special_functions/gamma.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006.
* (C) Copyright Paul A. Bristow 2007.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_48_0/boost/math/special_functions/detail/erf_inv.hpp}. This implementation follows the original, but has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_60_0/boost/math/special_functions/powm1.hpp}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_61_0/boost/math/special_functions/beta.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_61_0/boost/math/special_functions/beta.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006.
* (C) Copyright Paul A. Bristow 2007.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_61_0/boost/math/special_functions/detail/t_distribution_inv.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* Copyright John Maddock 2006.
* Copyright Paul A. Bristow 2007.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_62_0/boost/math/special_functions/beta.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_62_0/boost/math/special_functions/detail/ibeta_inverse.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* Copyright John Maddock 2006.
* Copyright Paul A. Bristow 2007.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_62_0/boost/math/special_functions/detail/t_distribution_inv.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* Copyright John Maddock 2006.
* Copyright Paul A. Bristow 2007.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_62_0/boost/math/special_functions/gamma.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006-7, 2013-14.
* (C) Copyright Paul A. Bristow 2007, 2013-14.
* (C) Copyright Nikhar Agrawal 2013-14.
* (C) Christopher Kormanyos 2013-14.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_62_0/boost/math/tools/roots.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* Copyright John Maddock 2006.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_64_0/boost/math/special_functions/beta.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_64_0/boost/math/special_functions/detail/ibeta_inverse.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* Copyright John Maddock 2006.
* Copyright Paul A. Bristow 2007.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_64_0/boost/math/special_functions/detail/lgamma_small.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006-7, 2013-14.
* (C) Copyright Paul A. Bristow 2007, 2013-14.
* (C) Copyright Nikhar Agrawal 2013-14.
* (C) Copyright Christopher Kormanyos 2013-14.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_64_0/boost/math/special_functions/gamma.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006-7, 2013-14.
* (C) Copyright Paul A. Bristow 2007, 2013-14.
* (C) Copyright Nikhar Agrawal 2013-14.
* (C) Copyright Christopher Kormanyos 2013-14.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_64_0/boost/math/special_functions/gamma.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* Copyright John Maddock 2006-7, 2013-14.
* Copyright Paul A. Bristow 2007, 2013-14.
* Copyright Nikhar Agrawal 2013-14.
* Copyright Christopher Kormanyos 2013-14.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_64_0/boost/math/special_functions/lanczos.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* Copyright John Maddock 2006.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{http://www.boost.org/doc/libs/1_64_0/boost/math/special_functions/beta.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* A wrapper around String objects for specifying ordered categories.
*
* @param {string} name - variable name
* @param {Array} categories - ordered categories
* @returns {String} factor variable string object
*/

/**
* Algorithm adapted from Introduction to Information Retrieval by Manning et al., Cambridge University Press. 2008 [p.386].
*
* @param {Array} data - input data
* @param {Function} linkage - used linkage function
* @param {Function} distance - used distance metric
* @return {Array} a list holding merge instructions
*/

/**
* Alias for `eval` global.
*
* @module @stdlib/utils/eval
*
* @example
* var evil = require( '@stdlib/utils/eval' );
*
* var v = evil( '5*4*3*2*1' );
* // returns 120
*/

/**
* Allocate a buffer having a specified number of bytes.
*
* @module @stdlib/buffer/alloc-unsafe
*
* @example
* var allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' );
*
* var buf = allocUnsafe( 10 );
* // returns <Buffer>
*/

/**
* Allocates a buffer having a specified number of bytes.
*
* ## Notes
*
* -   The underlying memory of returned `Buffer` instances is not initialized. Memory contents are unknown and may contain sensitive data.
* -   When the size is less than half the pool size (specified on the `Buffer` constructor), memory is allocated from the `Buffer` pool for faster allocation of new `Buffer` instances.
*
*
* @param {NonNegativeInteger} size - number of bytes to allocate
* @throws {TypeError} must provide a nonnegative integer
* @returns {Buffer} new `Buffer` instance
*
* @example
* var buf = allocUnsafe( 10 );
* // returns <Buffer>
*/

/**
* Allows a function to be called with a vector instead of a single number.
*
* @private
* @param {Function} fun - input function
* @returns {Function} vectorized function
*/

/**
* An `Object.create` shim for older JavaScript engines.
*
* @private
* @param {Object} proto - prototype
* @returns {Object} created object
*
* @example
* var obj = createObject( Object.prototype );
* // returns {}
*/

/**
* Arbitrary constant `g` to be used in Lanczos approximation functions.
*
* @constant
* @type {number}
* @default 10.900511
* @see [Lanczos Approximation]{@link https://en.wikipedia.org/wiki/Lanczos_approximation}
*/

/**
* Arbitrary constant `g` to be used in Lanczos approximation functions.
*
* @module @stdlib/constants/math/float64-gamma-lanczos-g
* @type {number}
*
* @example
* var FLOAT64_GAMMA_LANCZOS_G = require( '@stdlib/constants/math/float64-gamma-lanczos-g' );
* // returns 10.900511
*/

/**
* Asymptotic expansions of the incomplete gamma functions when `a` is large and `x ~ a` (IEEE double precision or 10^-17).
*
* @private
* @param {number} a - function parameter
* @param {number} x - function parameter
* @returns {number} value of asymptotic expansion
*/

/**
* Bernoulli distribution probability mass function (PMF).
*
* @module @stdlib/stats/base/dists/bernoulli/pmf
*
* @example
* var pmf = require( '@stdlib/stats/base/dists/bernoulli/pmf' );
*
* var y = pmf( 0.0, 0.3 );
* // returns 0.7
*
* y = pmf( 1.0, 0.7 );
* // returns 0.7
*
* y = pmf( -1.0, 0.5 );
* // returns 0.0
*
* var mypmf = pmf.factory( 0.5 );
* y = mypmf( 2.0 );
* // returns 0.0
*
* y = mypmf( 1.0 );
* // returns 0.5
*/

/**
* Binary search algorithm returning the index at which the element if inserted would be larger than all elements to the left and smaller than those to the right.
*/

/**
* Building array of decision trees.
*/

/**
* Calculate a continued fraction approximation.
*
* @module @stdlib/math/base/tools/continued-fraction
*
* @example
* var continuedFraction = require( '@stdlib/math/base/tools/continued-fraction' );
*
* // Continued fraction for (e-1)^(-1):
* var gen = generator()
* var out = continuedFraction( gen );
* // returns ~0.582
*
* function generator() {
*    var i = 0;
*    return function() {
*        i++;
*        return [ i, i ];
*    };
* }
*/

/**
* Calculate p(X=x,C=i), i.e. the joint probability of observation x and class i.
*
* @param {Array} x - new observation
* @param {number} i - class indicator
* @returns {number} log probability
*/

/**
* Calculate the Lanczos sum for the approximation of the gamma function (scaled by `exp(-g)`, where `g = 10.900511`.
*
* @module @stdlib/math/base/special/gamma-lanczos-sum-expg-scaled
*
* @example
* var gammaLanczosSumExpGScaled = require( '@stdlib/math/base/special/gamma-lanczos-sum-expg-scaled' );
*
* var v = gammaLanczosSumExpGScaled( 4.0 );
* // returns ~0.018
*
* v = gammaLanczosSumExpGScaled( -1.5 );
* // returns ~25.337
*
* v = gammaLanczosSumExpGScaled( -0.5 );
* // returns ~-12.911
*
* v = gammaLanczosSumExpGScaled( 0.5 );
* // returns ~1.772
*
* v = gammaLanczosSumExpGScaled( 0.0 );
* // returns Infinity
*
* v = gammaLanczosSumExpGScaled( NaN );
* // returns NaN
*/

/**
* Calculate the Lanczos sum for the approximation of the gamma function.
*
* @module @stdlib/math/base/special/gamma-lanczos-sum
*
* @example
* var gammaLanczosSum = require( '@stdlib/math/base/special/gamma-lanczos-sum' );
*
* var v = gammaLanczosSum( 4.0 );
* // returns ~950.366
*
* v = gammaLanczosSum( -1.5 );
* // returns ~1373366.245
*
* v = gammaLanczosSum( -0.5 );
* // returns ~-699841.735
*
* v = gammaLanczosSum( 0.5 );
* // returns ~96074.186
*
* v = gammaLanczosSum( 0.0 );
* // returns Infinity
*
* v = gammaLanczosSum( NaN );
* // returns NaN
*/

/**
* Calculate the ratio of two gamma functions.
*
* @module @stdlib/math/base/special/gamma-delta-ratio
*
* @example
* var gammaDeltaRatio = require( '@stdlib/math/base/special/gamma-delta-ratio' );
*
* var y = gammaDeltaRatio( 2.0, 3.0 );
* // returns ~0.042
*
* y = gammaDeltaRatio( 4.0, 0.5 );
* // returns 2.0
*
* y = gammaDeltaRatio( 100.0, 0.0 );
* // returns 1.0
*/

/**
* Calculates a weight for the i-th observation.
*
* @param {Function} kernel - kernel function
* @param {number} bandwidth - kernel bandwidth
* @param {number} x0 - point for which to calculate density
* @param {number} xi - observation for which to calculate weight
* @returns {number} i-th weight
*/

/**
* Calculates class membership probabilities.
*
* @param {(Matrix|Array)} x - design matrix
* @returns {Array} class probabilities
*/

/**
* Calculates either a kernel density estimator or the MLE of a chosen parametric distribution.
*/

/**
* Calculates multinomial probability.
*
* @param {Array} x - new observation
* @param {number} i - class indicator
* @param {number} j - variable indicator
* @returns {number} probability
*/

/**
* Calculates normalized Q when a is a half-integer.
*
* @private
* @param {number} a - function parameter
* @param {number} x - function parameter
* @returns {number} upper gamma fraction
*/

/**
* Calculates normalized Q when a is an integer.
*
* @private
* @param {integer} a - function parameter
* @param {number} x - function parameter
* @returns {number} upper gamma fraction
*/

/**
* Calculates the Lanczos sum approximation.
*
* @name gammaLanczosSum
* @type {Function}
* @param {number} x - input value
* @returns {number} Lanczos sum approximation
*
* @example
* var v = gammaLanczosSum( 4.0 );
* // returns ~950.366
*
* @example
* var v = gammaLanczosSum( -1.5 );
* // returns ~1373366.245
*
* @example
* var v = gammaLanczosSum( -0.5 );
* // returns ~-699841.735
*
* @example
* var v = gammaLanczosSum( 0.5 );
* // returns ~96074.186
*
* @example
* var v = gammaLanczosSum( 0.0 );
* // returns Infinity
*
* @example
* var v = gammaLanczosSum( NaN );
* // returns NaN
*/

/**
* Calculates the Lanczos sum for the approximation of the gamma function (scaled by `exp(-g)`, where `g = 10.900511`.
*
* @name gammaLanczosSumExpGScaled
* @type {Function}
* @param {number} x - input value
* @returns {number} Lanczos sum approximation
*
* @example
* var v = gammaLanczosSumExpGScaled( 4.0 );
* // returns ~0.018
*
* @example
* var v = gammaLanczosSumExpGScaled( -1.5 );
* // returns ~25.337
*
* @example
* var v = gammaLanczosSumExpGScaled( -0.5 );
* // returns ~-12.911
*
* @example
* var v = gammaLanczosSumExpGScaled( 0.5 );
* // returns ~1.772
*
* @example
* var v = gammaLanczosSumExpGScaled( 0.0 );
* // returns Infinity
*
* @example
* var v = gammaLanczosSumExpGScaled( NaN );
* // returns NaN
*/

/**
* Calculates the current model fitted values (yhat) and residuals (e = y - yhat).
*
* @returns {Object} fitted values and residuals
*/

/**
* Calculates the dot product between j-th column vectors of the two input matrices skipping zero elements.
*
* @param {Matrix} x - first input matrix
* @param {Matrix} y - second input matrix
* @param {number} j - column index
* @returns {number} dot product value
*/

/**
* Calculates the dot product between two arrays.
*
* @param {NumberArray} x - first vector
* @param {NumberArray} y - second vector
* @returns {number} dot product
*/

/**
* Calculates the fitted value `ys` for a value `xs` on the horizontal axis.
*
* ## Methods
*
* -   The smoothed value for the x-axis value at the current index is computed using a (robust) locally weighted regression of degree one.  The tricube weight function is used with `h` equal to the maximum of `xs - x[ nleft ]` and `x[ nright ] - xs`.
*
* ## References
*
* -   Cleveland, William S. 1979. "Robust Locally and Smoothing Weighted Regression Scatterplots." _Journal of the American Statistical Association_ 74 (368): 829–36. doi:[10.1080/01621459.1979.10481038](https://doi.org/10.1080/01621459.1979.10481038).
* -   Cleveland, William S. 1981. "Lowess: A program for smoothing scatterplots by robust locally weighted regression." _American Statistician_ 35 (1): 54–55. doi:[10.2307/2683591](https://doi.org/10.2307/2683591).
*
* @private
* @param {NumericArray} x - ordered x-axis values (abscissa values)
* @param {NumericArray} y - corresponding y-axis values (ordinate values)
* @param {PositiveInteger} n - number of observations
* @param {NonNegativeInteger} i - current index
* @param {NonNegativeInteger} nleft - index of the first point used in computing the fitted value
* @param {NonNegativeInteger} nright - index of the last point used in computing the fitted value
* @param {ProbabilityArray} w - weights at indices from `nleft` to `nright` to be used in the calculation of the fitted value
* @param {boolean} userw - boolean indicating whether a robust fit is carried out using the weights in `rw`
* @param {ProbabilityArray} rw - robustness weights
* @returns {number} fitted value
*/

/**
* Calculates the inverse of the incomplete beta function.
*
* @private
* @param {PositiveNumber} a - function parameter
* @param {PositiveNumber} b - function parameter
* @param {Probability} p - function parameter
* @param {Probability} q - probability equal to `1 - p`
* @returns {Array} two-element array holding function value `y` and `1-y`
*/

/**
* Calculates the mean accuracy of the given test data and labels.
*
* @param {(Matrix|Array)} x - design matrix
* @param {Array} y - vector of class memberships
* @returns {number} mean accuracy
*/

/**
* Calculates the mean of a variable.
*
* @param values - array of values
*/

/**
* Calculates the power term prefix `(z^a)(e^-z)` used in the non-normalized incomplete gammas.
*
* @private
* @param {number} a - function parameter
* @param {number} z - function parameter
* @returns {number} power term prefix
*/

/**
* Calculates the ratio of two gamma functions via Lanczos approximation.
*
* ## Notes
*
* -   When \\( z < \epsilon \\), we get spurious numeric overflow unless we're very careful. This can occur either inside `lanczosSum(z)` or in the final combination of terms. To avoid this, split the product up into 2 (or 3) parts:
*
*     ```tex
*     \begin{align*}
*     G(z) / G(L) &= 1 / (z \cdot G(L)) ; z < \eps, L = z + \delta = \delta \\
*     z * G(L) &= z * G(lim) \cdot (G(L)/G(lim)) ; lim = \text{largest factorial}
*     \end{align*}
*     ```
*
* @private
* @param {number} z - first gamma parameter
* @param {number} delta - difference
* @returns {number} gamma ratio
*/

/**
* Calculates the variance of a variable.
*
* @param values - array of values
*/

/**
* Calculating entropy of a variable.
*
* @param values - array of values
*/

/**
* Calculating how many elements have the same
* values
*
* @param values - array of values
*/

/**
* Capitalize the first letter of each word in an input string.
*
* @module @stdlib/string/startcase
*
* @example
* var startcase = require( '@stdlib/string/startcase' );
*
* var str = startcase( 'beep boop foo bar' );
* // returns 'Beep Boop Foo Bar'
*/

/**
* Capitalizes the first letter of each word in an input string.
*
* @param {string} str - string to convert
* @throws {TypeError} must provide a primitive string
* @returns {string} start case string
*
* @example
* var str = startcase( 'beep boop foo bar' );
* // returns 'Beep Boop Foo Bar'
*/

/**
* Carries out the first method by Temme (described in section 2).
*
* ## References
*
* -   Temme, N. M. 1992. "Incomplete Laplace Integrals: Uniform Asymptotic Expansion with Application to the Incomplete Beta Function." _Journal of Computational and Applied Mathematics_ 41 (1–2): 1638–63. doi:[10.1016/0377-0427(92)90244-R](https://doi.org/10.1016/0377-0427(92)90244-R).
*
* @private
* @param {PositiveNumber} a - function parameter
* @param {PositiveNumber} b - function parameter
* @param {Probability} z - function parameter
* @returns {number} function value
*/

/**
* Carries out the second method by Temme (described in section 3).
*
* ## References
*
* -   Temme, N. M. 1992. "Incomplete Laplace Integrals: Uniform Asymptotic Expansion with Application to the Incomplete Beta Function." _Journal of Computational and Applied Mathematics_ 41 (1–2): 1638–63. doi:[10.1016/0377-0427(92)90244-R](https://doi.org/10.1016/0377-0427(92)90244-R).
*
* @private
* @param {number} z - function parameter
* @param {number} r - function parameter
* @param {number} theta - function parameter
* @returns {number} function value
*/

/**
* Carries out the third method by Temme (described in section 4).
*
* ## References
*
* -   Temme, N. M. 1992. "Incomplete Laplace Integrals: Uniform Asymptotic Expansion with Application to the Incomplete Beta Function." _Journal of Computational and Applied Mathematics_ 41 (1–2): 1638–63. doi:[10.1016/0377-0427(92)90244-R](https://doi.org/10.1016/0377-0427(92)90244-R).
*
* @private
* @param {PositiveNumber} a - function parameter
* @param {PositiveNumber} b - function parameter
* @param {Probability} p - function parameter
* @param {Probability} q - probability equal to `1-p`
* @returns {number} function value
*/

/**
* Casts buffer elements by copying those elements to a buffer of another data type.
*
* @private
* @param {(Array|TypedArray|Buffer)} buffer - input buffer
* @param {NonNegativeInteger} len - number of elements to cast
* @param {string} dtype - data type
* @returns {(Array|TypedArray|Buffer)} output buffer
*
* @example
* var b = castBuffer( [ 1.0, 2.0, 3.0 ], 3, 'float64' );
* // returns <Float64Array>[ 1.0, 2.0, 3.0 ]
*/

/**
* Checks the Karush-Khun-Tucker (KKT) conditions for an optimal solution.
*
* @returns {boolean} returns true if optimal conditions are satisfied, false otherwise
*/

/**
* Chi-squared distribution cumulative distribution function (CDF).
*
* @module @stdlib/stats/base/dists/chisquare/cdf
*
* @example
* var cdf = require( '@stdlib/stats/base/dists/chisquare/cdf' );
*
* var y = cdf( 2.0, 8.0 );
* // returns ~0.019
*
* y = cdf( 0.0, 1.0 );
* // returns 0.0
*
* @example
* var factory = require( '@stdlib/stats/base/dists/chisquare/cdf' ).factory;
*
* var cdf = factory( 1.0 );
*
* var y = cdf( 2.0 );
* // returns ~0.843
*
* y = cdf( 1.2 );
* // returns ~0.727
*/

/**
* Code adapted from Nikita Rokotyan. MIT licensed. Source: http://bl.ocks.org/Rokotyan/0556f8facbaf344507cdc45dc3622177
*/

/**
* Comparator function used to sort (x,y)-pairs in ascending order by the first coordinate.
*
* @private
* @param {Array} a - first pair
* @param {Array} b - second pair
* @returns {number} difference between `a` and `b`
*/

/**
* Comparator function used to sort values in ascending order.
*
* @private
* @param {number} a
* @param {number} b
* @returns {number} difference between `a` and `b`
*/

/**
* Comparator function used to sort values in ascending order.
*
* @private
* @param {number} a - first number
* @param {number} b - second number
* @returns {number} difference between `a` and `b`
*/

/**
* Comparator function used to sort values in ascending order.
*
* @private
* @param {number} a - first value
* @param {number} b - second value
* @returns {number} difference between `a` and `b`
*/

/**
* Compute `exp(x) - 1`.
*
* @module @stdlib/math/base/special/expm1
*
* @example
* var expm1 = require( '@stdlib/math/base/special/expm1' );
*
* var v = expm1( 0.2 );
* // returns ~0.221
*
* v = expm1( -9.0 );
* // returns ~-0.999
*
* v = expm1( 0.0 );
* // returns 0.0
*
* v = expm1( NaN );
* // returns NaN
*/

/**
* Compute `gamma(x+1) - 1` without cancellation errors.
*
* @module @stdlib/math/base/special/gamma1pm1
*
* @example
* var gamma1pm1 = require( '@stdlib/math/base/special/gamma1pm1' );
*
* var v = gamma1pm1( 0.2 );
* // returns ~-0.082
*
* v = gamma1pm1( -5.3 );
* // returns ~-1.102
*
* v = gamma1pm1( 0.0 );
* // returns 0.0
*
* v = gamma1pm1( NaN );
* // returns NaN
*/

/**
* Compute `x * ln(y)` so that the result is `0` if `x = 0`.
*
* @module @stdlib/math/base/special/xlogy
*
* @example
* var xlogy = require( '@stdlib/math/base/special/xlogy' );
*
* var out = xlogy( 3.0, 2.0 );
* // returns ~2.079
*
* out = xlogy( 1.5, 5.9 );
* // returns ~2.662
*
* out = xlogy( 0.9, 1.0 );
* // returns 0.0
*
* out = xlogy( 0.0, -2.0 );
* // returns 0.0
*
* out = xlogy( 1.5, NaN );
* // returns NaN
*
* out = xlogy( 0.0, NaN );
* // returns NaN
*
* out = xlogy( NaN, 2.3 );
* // returns NaN
*/

/**
* Compute a Pearson product-moment correlation test between paired samples.
*
* @module @stdlib/stats/pcorrtest
*
* @example
* var pcorrtest = require( '@stdlib/stats/pcorrtest' );
* var incrspace = require( '@stdlib/math/utils/incrspace' );
*
* var a = incrspace( 1, 11, 1 );
* var b = incrspace( 11, 21, 1 );
*
* var out = pcorrtest( a, b );
* var table = out.print();
*/

/**
* Compute a corrected sample standard deviation incrementally.
*
* @module @stdlib/stats/incr/stdev
*
* @example
* var incrstdev = require( '@stdlib/stats/incr/stdev' );
*
* var accumulator = incrstdev();
*
* var s = accumulator();
* // returns null
*
* s = accumulator( 2.0 );
* // returns 0.0
*
* s = accumulator( -5.0 );
* // returns ~4.95
*
* s = accumulator();
* // returns ~4.95
*/

/**
* Compute a one-sample Student's t-Test.
*
* @module @stdlib/stats/ttest
*
* @example
* var ttest = require( '@stdlib/stats/ttest' );
* var normal = require( '@stdlib/random/base/normal' ).factory;
*
* var rnorm;
* var out;
* var i;
* var x;
* var y;
*
* rnorm = normal( 1.0, 2.0, {
*     'seed': 786
* });
*
* // One-sample t-test:
* x = new Array( 100 );
* for ( i = 0; i < x.length; i++ ) {
*     x[ i ] = rnorm();
* }
* out = ttest( x );
*
* // Paired t-test:
* x = new Array( 100 );
* y = new Array( 100 );
* for ( i = 0; i < x.length; i++ ) {
*     x[ i ] = rnorm();
*     y[ i ] = rnorm();
* }
* out = ttest( x, y );
*/

/**
* Compute a one-sample z-Test.
*
* @module @stdlib/stats/ztest
*
* @example
* var ztest = require( '@stdlib/stats/ztest' );
* var normal = require( '@stdlib/random/base/normal' ).factory;
*
* var rnorm;
* var out;
* var i;
* var x;
* var y;
*
* rnorm = normal( 1.0, 2.0, {
*     'seed': 786
* });
*
* // One-sample z-test:
* x = new Array( 300 );
* for ( i = 0; i < x.length; i++ ) {
*     x[ i ] = rnorm();
* }
* out = ztest( x, 2.0 );
*/

/**
* Compute a sum of squared absolute values incrementally.
*
* @module @stdlib/stats/incr/sumabs2
*
* @example
* var incrsumabs2 = require( '@stdlib/stats/incr/sumabs2' );
*
* var accumulator = incrsumabs2();
*
* var sum = accumulator();
* // returns null
*
* sum = accumulator( 2.0 );
* // returns 4.0
*
* sum = accumulator( -5.0 );
* // returns 29.0
*
* sum = accumulator();
* // returns 29.0
*/

/**
* Compute a two-sample Student's t-Test.
*
* @module @stdlib/stats/ttest2
*
* @example
* var ttest2 = require( '@stdlib/stats/ttest2' );
* var incrspace = require( '@stdlib/math/utils/incrspace' );
*
* var a = incrspace( 1, 11, 1 );
* var b = incrspace( 7, 21, 1 );
*
* var out = ttest2( a, b );
* var table = out.print();
*/

/**
* Compute a two-sample z-Test.
*
* @module @stdlib/stats/ztest2
*
* @example
* var ztest2 = require( '@stdlib/stats/ztest2' );
* var incrspace = require( '@stdlib/math/utils/incrspace' );
*
* var a = incrspace( 1, 11, 1 );
* var b = incrspace( 7, 21, 1 );
*
* var out = ztest2( a, b );
* var table = out.print();
*/

/**
* Compute ranks for the values of an array-like object.
*
* @module @stdlib/stats/ranks
*
* @example
* var ranks = require( '@stdlib/stats/ranks' );
*
* var arr = [ 1.1, 2.0, 3.5, 0.0, 2.4 ];
* var out = ranks( arr );
* // returns [ 2, 3, 5, 1, 4 ]
*
* // Ties are averaged:
* arr = [ 2, 2, 1, 4, 3 ];
* out = ranks ( arr );
* // returns [ 2.5, 2.5, 1, 5, 4 ];
*
* // Missing values are placed last:
* arr = [ null, 2, 2, 1, 4, 3, NaN, NaN ];
* out = ranks( arr );
* // returns [ 6, 2.5, 2.5, 1, 5, 4, 7 ,8 ]
*/

/**
* Compute the Kruskal-Wallis test for equal medians.
*
* @module @stdlib/stats/kruskal-test
*
* @example
* var kruskalTest = require( '@stdlib/stats/kruskal-test' );
*
* // Data from Hollander & Wolfe (1973), p. 116:
* var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ];
* var y = [ 3.8, 2.7, 4.0, 2.4 ];
* var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ];
*
* var out = kruskalTest( x, y, z );
* // returns {...}
*/

/**
* Compute the arccosine of a number.
*
* @module @stdlib/math/base/special/acos
*
* @example
* var acos = require( '@stdlib/math/base/special/acos' );
*
* var v = acos( 1.0 );
* // returns 0.0
*
* v = acos( 0.707 ); // ~pi/4
* // returns ~0.7855
*
* v = acos( NaN );
* // returns NaN
*/

/**
* Compute the arcsine of a number.
*
* @module @stdlib/math/base/special/asin
*
* @example
* var asin = require( '@stdlib/math/base/special/asin' );
*
* var v = asin( 0.0 );
* // returns 0.0
*
* v = asin( 3.141592653589793/4.0 );
* // returns ~0.903
*
* v = asin( -3.141592653589793/6.0 );
* // returns ~-0.551
*
* v = asin( NaN );
* // returns NaN
*/

/**
* Compute the full upper fraction (Q) when `a` is very small.
*
* @private
* @param {number} a - function parameter
* @param {number} x - function parameter
* @param {boolean} invert - boolean indicating if the upper tail of the incomplete gamma function should be evaluated
* @returns {Array} full upper fraction (Q) and pgam
*/

/**
* Compute the hyperbolic arctangent of a number.
*
* @module @stdlib/math/base/special/atanh
*
* @example
* var atanh = require( '@stdlib/math/base/special/atanh' );
*
* var v = atanh( 0.0 );
* // returns 0.0
*
* v = atanh( 0.9 );
* // returns ~1.472
*
* v = atanh( 1.0 );
* // returns Infinity
*
* v = atanh( -1.0 );
* // returns -Infinity
*
* v = atanh( NaN );
* // returns NaN
*/

/**
* Compute the hyperbolic tangent of a number.
*
* @module @stdlib/math/base/special/tanh
*
* @example
* var tanh = require( '@stdlib/math/base/special/tanh' );
*
* var v = tanh( 0.0 );
* // returns 0.0
*
* var v = tanh( -0.0 );
* // returns -0.0
*
* v = tanh( 2.0 );
* // returns ~0.964
*
* v = tanh( -2.0 );
* // returns ~-0.964
*
* v = tanh( NaN );
* // returns NaN
*/

/**
* Compute the inverse of the lower incomplete gamma function.
*
* @module @stdlib/math/base/special/gammaincinv
*
* @example
* var gammaincinv = require( '@stdlib/math/base/special/gammaincinv' );
*
* var val = gammaincinv( 0.5, 2.0 );
* // returns ~1.678
*
* val = gammaincinv( 0.1, 10.0 );
* // returns ~6.221
*
* val = gammaincinv( 0.75, 3.0 );
* // returns ~3.92
*
* val = gammaincinv( 0.75, 3.0, true );
* // returns ~1.727
*
* val = gammaincinv( 0.75, NaN );
* // returns NaN
*
* val = gammaincinv( NaN, 3.0 );
* // returns NaN
*/

/**
* Compute the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view.
*
* @module @stdlib/ndarray/base/minmax-view-buffer-index
*
* @example
* var minmaxViewBufferIndex = require( '@stdlib/ndarray/base/minmax-view-buffer-index' );
*
* var shape = [ 10, 10 ];
* var strides = [ 10, 1 ];
* var offset = 10;
*
* var idx = minmaxViewBufferIndex( shape, strides, offset );
* // returns [ 10, 109 ]
*
* @example
* var minmaxViewBufferIndex = require( '@stdlib/ndarray/base/minmax-view-buffer-index' );
*
* var shape = [ 10, 10 ];
* var strides = [ -10, -1 ];
* var offset = 99;
*
* var idx = minmaxViewBufferIndex( shape, strides, offset );
* // returns [ 0, 99 ]
*
* @example
* var minmaxViewBufferIndex = require( '@stdlib/ndarray/base/minmax-view-buffer-index' );
*
* var shape = [ 10, 10 ];
* var strides = [ 1, 10 ];
* var offset = 10;
*
* var idx = minmaxViewBufferIndex( shape, strides, offset );
* // returns [ 10, 109 ]
*
* @example
* var minmaxViewBufferIndex = require( '@stdlib/ndarray/base/minmax-view-buffer-index' );
*
* var shape = [ 10, 10 ];
* var strides = [ -1, -10 ];
* var offset = 99;
*
* var idx = minmaxViewBufferIndex( shape, strides, offset );
* // returns [ 0, 99 ]
*/

/**
* Compute the value of `sin(πx)`.
*
* @module @stdlib/math/base/special/sinpi
*
* @example
* var sinpi = require( '@stdlib/math/base/special/sinpi' );
*
* var y = sinpi( 0.0 );
* // returns 0.0
*
* y = sinpi( 0.5 );
* // returns 1.0
*
* y = sinpi( 0.9 );
* // returns ~0.309
*
* y = sinpi( NaN );
* // returns NaN
*/

/**
* Computes Pearson product-moment correlation coefficients between one or more numeric arrays.
*
* @param {...Array} arr - numeric array
* @returns {Array} correlation matrix
*/

/**
* Computes `(z^a)*(e^-z) / gamma(a)`.
*
* @private
* @param {number} a - input value
* @param {number} z - input value
* @returns {number} function value
*/

/**
* Computes `exp(x) - 1`.
*
* ## Method
*
* 1.  Given \\(x\\), we use argument reduction to find \\(r\\) and an integer \\(k\\) such that
*
*     ```tex
*     x = k \cdot \ln(2) + r
*     ```
*
*     where
*
*     ```tex
*     |r| \leq \frac{\ln(2)}{2} \approx 0.34658
*     ```
*
*     <!-- <note> -->
*
*     A correction term \\(c\\) will need to be computed to compensate for the error in \\(r\\) when rounded to a floating-point number.
*
*     <!-- </note> -->
*
* 2.  To approximate \\(\operatorname{expm1}(r)\\), we use a special rational function on the interval \\(\[0,0.34658]\\). Since
*
*     ```tex
*     r \frac{e^r + 1}{e^r - 1} = 2 + \frac{r^2}{6} - \frac{r^4}{360} + \ldots
*     ```
*
*     we define \\(\operatorname{R1}(r^2)\\) by
*
*     ```tex
*     r \frac{e^r + 1}{e^r - 1} = 2 + \frac{r^2}{6} \operatorname{R1}(r^2)
*     ```
*
*     That is,
*
*     ```tex
*     \begin{align*}
*     \operatorname{R1}(r^2) &= \frac{6}{r} \biggl(\frac{e^r+1}{e^r-1} - \frac{2}{r}\biggr) \\
*     &= \frac{6}{r} \biggl( 1 + 2 \biggl(\frac{1}{e^r-1} - \frac{1}{r}\biggr)\biggr) \\
*     &= 1 - \frac{r^2}{60} + \frac{r^4}{2520} - \frac{r^6}{100800} + \ldots
*     \end{align*}
*     ```
*
*     We use a special Remes algorithm on \\(\[0,0.347]\\) to generate a polynomial of degree \\(5\\) in \\(r^2\\) to approximate \\(\mathrm{R1}\\). The maximum error of this polynomial approximation is bounded by \\(2^{-61}\\). In other words,
*
*     ```tex
*     \operatorname{R1}(z) \approx 1 + \mathrm{Q1} \cdot z + \mathrm{Q2} \cdot z^2 + \mathrm{Q3} \cdot z^3 + \mathrm{Q4} \cdot z^4 + \mathrm{Q5} \cdot z^5
*     ```
*
*     where
*
*     ```tex
*     \begin{align*}
*     \mathrm{Q1} &= -1.6666666666666567384\mbox{e-}2 \\
*     \mathrm{Q2} &= 3.9682539681370365873\mbox{e-}4 \\
*     \mathrm{Q3} &= -9.9206344733435987357\mbox{e-}6 \\
*     \mathrm{Q4} &= 2.5051361420808517002\mbox{e-}7 \\
*     \mathrm{Q5} &= -6.2843505682382617102\mbox{e-}9
*     \end{align*}
*     ```
*
*     where \\(z = r^2\\) and the values of \\(\mathrm{Q1}\\) to \\(\mathrm{Q5}\\) are listed in the source. The error is bounded by
*
*     ```tex
*     \biggl| 1 + \mathrm{Q1} \cdot z + \ldots + \mathrm{Q5} \cdot z - \operatorname{R1}(z) \biggr| \leq 2^{-61}
*     ```
*
*     \\(\operatorname{expm1}(r) = e^r - 1\\) is then computed by the following specific way which minimizes the accumulated rounding error
*
*     ```tex
*     \operatorname{expm1}(r) = r + \frac{r^2}{2} + \frac{r^3}{2} \biggl( \frac{3 - (\mathrm{R1} + \mathrm{R1} \cdot \frac{r}{2})}{6 - r ( 3 - \mathrm{R1} \cdot \frac{r}{2})} \biggr)
*     ```
*
*     To compensate for the error in the argument reduction, we use
*
*     ```tex
*     \begin{align*}
*     \operatorname{expm1}(r+c) &= \operatorname{expm1}(r) + c + \operatorname{expm1}(r) \cdot c \\
*     &\approx \operatorname{expm1}(r) + c + rc
*     \end{align*}
*     ```
*
*     Thus, \\(c + rc\\) will be added in as the correction terms for \\(\operatorname{expm1}(r+c)\\). Now, we can rearrange the term to avoid optimization screw up.
*
*     ```tex
*     \begin{align*}
*     \operatorname{expm1}(r+c) &\approx r - \biggl( \biggl( r + \biggl( \frac{r^2}{2} \biggl( \frac{\mathrm{R1} - (3 - \mathrm{R1} \cdot \frac{r}{2})}{6 - r (3 - \mathrm{R1} \cdot \frac{r}{2})} \biggr) - c \biggr) - c \biggr) - \frac{r^2}{2} \biggr) \\
*     &= r - \mathrm{E}
*     \end{align*}
*     ```
*
* 3.  To scale back to obtain \\(\operatorname{expm1}(x)\\), we have (from step 1)
*
*     ```tex
*     \operatorname{expm1}(x) = \begin{cases}
*     2^k  (\operatorname{expm1}(r) + 1) - 1 \\
*     2^k (\operatorname{expm1}(r) + (1-2^{-k}))
*     \end{cases}
*     ```
*
* ## Special Cases
*
* ```tex
* \begin{align*}
* \operatorname{expm1}(\infty) &= \infty \\
* \operatorname{expm1}(-\infty) &= -1 \\
* \operatorname{expm1}(\mathrm{NaN}) &= \mathrm{NaN}
* \end{align*}
* ```
*
*
* ## Notes
*
* -   For finite arguments, only \\(\operatorname{expm1}(0) = 0\\) is exact.
*
* -   To save one multiplication, we scale the coefficient \\(\mathrm{Qi}\\) to \\(\mathrm{Qi} \cdot {2^i}\\) and replace \\(z\\) by \\(\frac{x^2}{2}\\).
*
* -   To achieve maximum accuracy, we compute \\(\operatorname{expm1}(x)\\) by
*
*     -   if \\(x < -56 \cdot \ln(2)\\), return \\(-1.0\\) (raise inexact if \\(x\\) does not equal \\(\infty\\))
*
*     -   if \\(k = 0\\), return \\(r-\mathrm{E}\\)
*
*     -   if \\(k = -1\\), return \\(\frac{(r-\mathrm{E})-1}{2}\\)
*
*     -   if \\(k = 1\\),
*
*         -   if \\(r < -0.25\\), return \\(2((r+0.5)- \mathrm{E})\\)
*         -   else return \\(1+2(r-\mathrm{E})\\)
*
*     -   if \\(k < -2\\) or \\(k > 56\\), return \\(2^k(1-(\mathrm{E}-r)) - 1\\) (or \\(e^x-1\\))
*
*     -   if \\(k \leq 20\\), return \\(2^k((1-2^{-k})-(\mathrm{E}-r))\\)
*
*     -   else return \\(2^k(1-((\mathrm{E}+2^{-k})-r))\\)
*
* -   For IEEE 754 double, if \\(x > 7.09782712893383973096\mbox{e+}02\\), then \\(\operatorname{expm1}(x)\\) will overflow.
*
* -   The hexadecimal values listed in the source are the intended ones for the implementation constants. Decimal values may be used, provided that the compiler will convert from decimal to binary accurately enough to produce the intended hexadecimal values.
*
* -   According to an error analysis, the error is always less than \\(1\\) ulp (unit in the last place).
*
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var v = expm1( 0.2 );
* // returns ~0.221
*
* @example
* var v = expm1( -9.0 );
* // returns ~-0.9999
*
* @example
* var v = expm1( 0.0 );
* // returns 0.0
*
* @example
* var v = expm1( NaN );
* // returns NaN
*/

/**
* Computes `gamma(x+1) - 1`.
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var v = gammap1m1( 0.2 );
* // returns ~-0.082
*
* @example
* var v = gammap1m1( -9.2 );
* // returns ~-1.0
*
* @example
* var v = gammap1m1( 0.0 );
* // returns 0.0
*
* @example
* var v = gammap1m1( -3.0 );
* // returns NaN
*
* @example
* var v = gammap1m1( NaN );
* // returns NaN
*/

/**
* Computes `x * ln(y)` so that the result is `0` if `x = 0`.
*
* @param {number} x - input value
* @param {number} y - input value
* @returns {number} function value
*
* @example
* var out = xlogy( 3.0, 2.0 );
* // returns ~2.079
*
* @example
* var out = xlogy( 1.5, 5.9 );
* // returns ~2.662
*
* @example
* var out = xlogy( 0.9, 1.0 );
* // returns 0.0
*
* @example
* var out = xlogy( 0.0, -2.0 );
* // returns 0.0
*
* @example
* var out = xlogy( 1.5, NaN );
* // returns NaN
*
* @example
* var out = xlogy( 0.0, NaN );
* // returns NaN
*
* @example
* var out = xlogy( NaN, 2.3 );
* // returns NaN
*/

/**
* Computes `x` in the equations `P(a,xr) = p` and `Q(a,xr) = q`, where `a` is a positive parameter and `p` and `q` satisfy `p+q = 1`.
*
* ## Notes
*
* -   The equation is inverted with `min(p,q)`.
*
* @private
* @param {number} a - scale value of incomplete gamma function
* @param {Probability} p - probability value
* @param {Probability} q - probability value
* @returns {number} solution of the equations `P(a,xr) = p` and `Q(a,xr) = q` where `a` is a positive parameter
*/

/**
* Computes a Pearson product-moment correlation test between paired samples.
*
* @param {NumericArray} x - first data array
* @param {NumericArray} y - second data array
* @param {Options} [options] - function options
* @param {number} [options.alpha=0.05] - significance level
* @param {string} [options.alternative='two-sided'] - alternative hypothesis (`two-sided`, `less` or `greater`)
* @param {number} [options.rho=0.0] - correlation under H0
* @throws {TypeError} x argument has to be a typed array or array of numbers
* @throws {TypeError} y argument has to be a typed array or array of numbers
* @throws {Error} x and y must be arrays of the same length
* @throws {Error} x and y must contain at least four elements
* @throws {TypeError} options has to be simple object
* @throws {TypeError} must provide valid options
* @returns {Object} test result object
*
* @example
* var x = [ 2, 4, 3, 1, 2, 3 ];
* var y = [ 3, 2, 4, 1, 2, 4 ];
* var out = pcorrTest( x, y );
*/

/**
* Computes a matrix product of a n x p matrix and a column vector of length p.
*
* @param {Matrix} A - n x p matrix
* @param {Array} b - p x 1 column vector
* @returns {Array} result of matrix multiplication
*/

/**
* Computes a one-sample or paired Student's t test.
*
* @param {NumericArray} x - data array
* @param {NumericArray} [y] - optional paired data array
* @param {Options} [options] - function options
* @param {number} [options.alpha=0.05] - significance level
* @param {string} [options.alternative='two-sided'] - alternative hypothesis (`two-sided`, `less` or `greater`)
* @param {number} [options.mu=0] - mean under H0
* @throws {TypeError} x argument has to be a typed array or array of numbers
* @throws {TypeError} y argument has to be a typed array or array of numbers
* @throws {TypeError} options has to be simple object
* @throws {TypeError} alpha option has to be a number primitive
* @throws {RangeError} alpha option has to be a number in the interval `[0,1]`
* @throws {TypeError} alternative option has to be a string primitive
* @throws {Error} alternative option must be `two-sided`, `less` or `greater`
* @throws {TypeError} mu option has to be a number primitive
* @returns {Object} test result object
*
* @example
* var arr = [ 4, 4, 6, 6, 5 ];
* var out = ttest( arr, {
*     'mu': 5
* });
*
* @example
* var arr = [ 4, 4, 6, 6, 5 ];
* var out = ttest( arr, {
*     'alternative': 'greater'
* });
*/

/**
* Computes a one-sample z-test.
*
* @param {NumericArray} x - data array
* @param {PositiveNumber} sigma - known standard deviation
* @param {Options} [options] - function options
* @param {number} [options.alpha=0.05] - significance level
* @param {string} [options.alternative='two-sided'] - alternative hypothesis (`two-sided`, `less` or `greater`)
* @param {number} [options.mu=0] - mean under H0
* @throws {TypeError} x argument has to be a typed array or array of numbers
* @throws {TypeError} sigma argument has to be a positive number
* @throws {TypeError} options has to be simple object
* @throws {TypeError} alpha option has to be a number primitive
* @throws {RangeError} alpha option has to be a number in the interval `[0,1]`
* @throws {TypeError} alternative option has to be a string primitive
* @throws {Error} alternative option must be `two-sided`, `less` or `greater`
* @throws {TypeError} mu option has to be a number primitive
* @throws {TypeError} sigma option has to be a positive number
* @returns {Object} test result object
*
* @example
* var arr = [ 4, 4, 6, 6, 5 ];
* var out = ztest( arr, 1.0, {
*     'mu': 5
* });
*
* @example
* var arr = [ 4, 4, 6, 6, 5 ];
* var out = ztest( arr, 1.0, {
*     'alternative': 'greater'
* });
*/

/**
* Computes a quantile of the values in a numeric array.
*
* @param {Array} arr - input array
* @param {number} prob - quantile prob [0,1]
* @param {number} [method=7] - number indicating the method used to interpolate a quantile value
* @returns {(number|null)} quantile or null
*/

/**
* Computes a quantile of the values in a numeric array.
*
* @private
* @param {NumericArray} arr - sorted 1d array
* @param {Probability} p - quantile prob [0,1]
* @returns {number} quantile
*/

/**
* Computes a two-sample Student's t test.
*
* @param {NumericArray} x - first data array
* @param {NumericArray} y - second data array
* @param {Options} [options] - function options
* @param {number} [options.alpha=0.05] - significance level
* @param {string} [options.alternative='two-sided'] - alternative hypothesis (`two-sided`, `less` or `greater`)
* @param {number} [options.difference=0] - difference in means under H0
* @param {string} [options.variance='unequal'] - whether variances are `equal` or `unequal` under H0
* @throws {TypeError} x argument has to be a typed array or array of numbers
* @throws {TypeError} y argument has to be a typed array or array of numbers
* @throws {TypeError} options has to be simple object
* @throws {TypeError} alpha option has to be a number primitive
* @throws {RangeError} alpha option has to be a number in the interval `[0,1]`
* @throws {TypeError} alternative option has to be a string primitive
* @throws {Error} alternative option must be `two-sided`, `less` or `greater`
* @throws {TypeError} difference option has to be a number primitive
* @throws {TypeError} variance option has to be a string primitive
* @throws {Error} variance option must be `equal` or `unequal`
* @returns {Object} test result object
*/

/**
* Computes a two-sample z-test.
*
* @param {NumericArray} x - first data array
* @param {NumericArray} y - second data array
* @param {PositiveNumber} sigmax - known standard deviation of first group
* @param {PositiveNumber} sigmay - known standard deviation of second group
* @param {Options} [options] - function options
* @param {number} [options.alpha=0.05] - significance level
* @param {string} [options.alternative='two-sided'] - alternative hypothesis (`two-sided`, `less` or `greater`)
* @param {number} [options.difference=0] - difference in means under H0
* @throws {TypeError} x argument has to be a typed array or array of numbers
* @throws {TypeError} y argument has to be a typed array or array of numbers
* @throws {TypeError} sigmax argument has to be a positive number
* @throws {TypeError} sigmay argument has to be a positive number
* @throws {TypeError} options has to be simple object
* @throws {TypeError} must provide valid options
* @throws {Error} `alternative` option  must be either `two-sided`, `less`, or `greater`
* @returns {Object} test result object
*/

/**
* Computes an element-wise division.
*
* @param {NumberArray} arr - input array
* @param {(NumberArray|number)} x - either an array of equal length or a scalar
* @returns {NumberArray} output array
*/

/**
* Computes an element-wise multiplication of two arrays.
*
* @param {Array} x - numeric array
* @param {Array} y - numeric array
*/

/**
* Computes an element-wise multiplication.
*
* @param {NumberArray} arr - input array
* @param {(NumberArray|number)} x - either an array of equal length or a scalar
* @returns {NumberArray} output array
*/

/**
* Computes an element-wise subtraction.
*
* @param {NumberArray} arr - input array
* @param {(NumberArray|number)} x - either an array of equal length or a scalar
* @returns {NumberArray} output array
*/

/**
* Computes for each array element whether it is a missing value.
*
* @private
* @param {Array} arr - input array
* @param {Array} encoding - array whose elements encode missing values
* @returns {BooleanArray} output array
*/

/**
* Computes the Epanechnikov kernel for a value.
*
* @private
* @param {number} u - value for which we wish to calculate the Epanechnikov kernel
* @returns {number} the value for the kernel at u
*
* @example
* var u = 5.0;
* var out = epanechnikov( u );
* // returns 0.0
*/

/**
* Computes the Gaussian kernel for a value.
*
* @private
* @param {number} u - input value
* @returns {number} the value for the Gaussian kernel at u
*
* @example
* var u = 5.0;
* var out = gaussian( u );
* // returns ~0.0
*/

/**
* Computes the Kruskal-Wallis test for equality of medians.
*
* @param {...NumberArray} arguments - either two or more number arrays or a single numeric array if an array of group indicators is supplied as an option
* @param {Options} [options] - function options
* @param {number} [options.alpha=0.05] - significance level
* @param {Array} [options.groups] - array of group indicators
* @throws {Error} must provide at least two array-like arguments if `groups` is not set
* @throws {TypeError} must provide array-like arguments
* @throws {TypeError} options has to be simple object
* @throws {TypeError} must provide valid options
* @throws {RangeError} alpha option has to be a number in the interval `[0,1]`
* @returns {Object} test results
*
* @example
* // Data from Hollander & Wolfe (1973), p. 116:
* var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ];
* var y = [ 3.8, 2.7, 4.0, 2.4 ];
* var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ];
*
* var out = kruskal( x, y, z );
* // returns {...}
*/

/**
* Computes the Pearson product-moment correlation coefficient between `x` and `y`.
*
* @private
* @param {NumericArray} x - first data array
* @param {NumericArray} y - second data array
* @returns {number} correlation coefficient
*
* @example
* var x = [ 1.0, 2.0, 2.0, 1.0 ];
* var y = [ 1.8, 2.2, 2.5, 1.4 ];
* var r = pcorr( x, y );
* // returns ~0.905
*/

/**
* Computes the Stirling series corresponding to asymptotic series for the logarithm of the gamma function.
*
* ```tex
* \frac{1}{12x}-\frac{1}{360x^3}\ldots; x \ge 3
* ```
*
* @private
* @param {number} x - input value
* @returns {number} function value
*/

/**
* Computes the Triweight kernel for a value.
*
* @private
* @param {number} u - value for which we wish to calculate the Triweight kernel
* @returns {number} the value for the kernel at u
*
* @example
* var u = 5;
* out = triweight(u); // returns 0
*/

/**
* Computes the arccosine of a number.
*
* ## Method
*
* -   Analytically,
*
*     ```tex
*     \operatorname{acos}(x) = \frac{\pi}{2} - \operatorname{asin}(x)
*     ```
*
*     However, if \\(\|x\|\\) is near \\(1\\), there is cancellation error in subtracting \\(\opertorname{asin}(x)\\) from \\(\pi/2\\). Hence, if \\(x < -0.5\\),
*
*     ```tex
*     \operatorname{acos}(x) = \pi - 2.0 \cdot \operatorname{asin}(\sqrt{(1+x)/2})
*     ```
*
*     or, if \\(x > +0.5\\),
*
*     ```tex
*     \operatorname{acos}(x) = 2.0 \cdot \operatorname{asin}( \sqrt{(1-x)/2} )}
*     ```
*
* ## Notes
*
* -   Relative error:
*
*     | arithmetic | domain | # trials | peak    | rms     |
*     |:-----------|:------:|:---------|:--------|:--------|
*     | DEC        | -1, 1  | 50000    | 3.3e-17 | 8.2e-18 |
*     | IEEE       | -1, 1  | 10^6     | 2.2e-16 | 6.5e-17 |
*
*
* @param {number} x - input value
* @returns {number} arccosine (in radians)
*
* @example
* var v = acos( 1.0 );
* // returns 0.0
*
* @example
* var v = acos( 0.707 ); // ~pi/4
* // returns ~0.7855
*
* @example
* var v = acos( NaN );
* // returns NaN
*/

/**
* Computes the arcsine of a number.
*
* ## Method
*
* -   A rational function of the form
*
*     ```tex
*     x + x^3 \frac{P(x^2)}{Q(x^2)}
*     ```
*
*     is used for \\(\|x\|\\) in the interval \\(\[0, 0.5\]\\). If \\(\|x\| > 0.5\\), it is transformed by the identity
*
*     ```tex
*     \operatorname{asin}(x) = \frac{\pi}{2} - 2 \operatorname{asin}( \sqrt{ (1-x)/2 } )
*     ```
*
* ## Notes
*
* -   Relative error:
*
*     | arithmetic | domain | # trials | peak    | rms     |
*     |:-----------|:-------|:---------|:--------|:--------|
*     | DEC        | -1, 1  | 40000    | 2.6e-17 | 7.1e-18 |
*     | IEEE       | -1, 1  | 10^6     | 1.9e-16 | 5.4e-17 |
*
* @param {number} x - input value
* @returns {number} arcsine (in radians)
*
* @example
* var v = asin( 0.0 );
* // returns ~0.0
*
* @example
* var v = asin( 3.141592653589793/4.0 );
* // returns ~0.903
*
* @example
* var v = asin( -3.141592653589793/6.0 );
* // returns ~-0.551
*
* @example
* var v = asin( NaN );
* // returns NaN
*/

/**
* Computes the arithmetic mean of a numeric array.
*
* @param {Array} arr - input array
* @returns {(number|null)} arithmetic mean or null
*/

/**
* Computes the arithmetic mean of a numeric array.
*
* @private
* @param {NumericArray} arr - input array
* @returns {number} arithmetic mean
*
* @example
* var arr = [ 2.0, 6.0, 10.0 ];
* var out = mean( arr );
* // returns 6.0
*/

/**
* Computes the arithmetic mean of a numeric array.
*
* @private
* @param {NumericArray} arr - input array
* @returns {number} arithmetic mean
*/

/**
* Computes the cosine kernel for a value.
*
* @private
* @param {number} u - value for which we wish to calculate the cosine kernel
* @returns {number} the value for the kernel at u
*
* @example
* var u = 5;
* var out = cosine( u );
* // returns 0
*/

/**
* Computes the delta in `beta(a,b,x) = prefix + delta * beta(a+k,b,x)`.
*
* ## Notes
*
* Specifically, the function calculates
*
* ```tex
* \frac{ (a)(a+1)(a+2)...(a+k-1) }{ (b)(b+1)(b+2)...(b+k-1) }
* ```
*
* The function should only called with small `k`; for large `k`, it is grossly inefficient.
*
* @private
* @param {number} a - input value
* @param {number} b - input value
* @param {NonNegativeInteger} k - input value
* @returns {number} ratio value
*/

/**
* Computes the difference between `ibeta(a,b,x)` and `ibeta(a+k,b,x)`.
*
* @private
* @param {NonNegativeNumber} a - function parameter
* @param {NonNegativeNumber} b - function parameter
* @param {Probability} x - function parameter
* @param {Probability} y - probability equal to `1-x`
* @param {NonNegativeInteger} k - function input
* @param {boolean} normalized - boolean indicating whether to evaluate the power terms of the regularized or non-regularized incomplete beta function
* @param {(Array|TypedArray|Object)} out - output array holding the derivative as the second element
* @returns {number} difference between ibeta(a,b,x) and ibeta(a+k,b,x)
*/

/**
* Computes the hyperbolic arctangent of a number.
*
* ## Method
*
* 1.  Reduce \\( x \\) to positive by \\( \operatorname{atanh}(-x) = -\operatorname{atanh}(x) \\)
*
* 2.  For \\( x \ge 0.5 \\), we calculate
*
*     ```tex
*     \operatorname{atanh}(x) = \frac{1}{2} \cdot \log\left( 1 + \tfrac{2x}{1-x} \right) = \frac{1}{2} \cdot \operatorname{log1p}\left( 2 \tfrac{x}{1-x} \right)
*     ```
*
*     For \\( x < 0.5 \\), we have
*
*     ```tex
*     \operatorname{atanh}(x) = \frac{1}{2} \cdot \operatorname{log1p}\left( 2x + \tfrac{2x^2}{1-x} \right)
*     ```
*
* ## Special Cases
*
* ```tex
* \begin{align*}
* \operatorname{atanh}(\mathrm{NaN}) &= \mathrm{NaN}\\
* \operatorname{atanh}(1.0) &= \infty \\
* \operatorname{atanh}(-1.0) &= -\infty \\
* \end{align*}
* ```
*
* @param {number} x - input value
* @returns {number} hyperbolic arctangent (in radians)
*
* @example
* var v = atanh( 0.0 );
* // returns 0.0
*
* @example
* var v = atanh( 0.9 );
* // returns ~1.472
*
* @example
* var v = atanh( 1.0 );
* // returns Infinity
*
* @example
* var v = atanh( -1.0 );
* // returns -Infinity
*
* @example
* var v = atanh( NaN );
* // returns NaN
*/

/**
* Computes the hyperbolic tangent of a number.
*
* ## Method
*
* For \\( |x| < 0.625 \\), we use a rational function of the form (Cody and Waite)
*
* ```tex
* x + x^3 \frac{\mathrm{P}(x)}{\mathrm{Q}(x)}
* ```
*
* Otherwise,
*
* ```tex
* \begin{align*}
* \operatorname{tanh}(x) &= \frac{\operatorname{sinh}(x)}{\operatorname{cosh(x)}} \\
* &= 1 - \frac{2}{e^{2x} + 1}
* \end{align*}
* ```
*
* ## Notes
*
* -   Relative error:
*
*     | arithmetic | domain | # trials | peak    | rms     |
*     |:----------:|:------:|:--------:|:-------:|:-------:|
*     | DEC        | -2,2   | 50000    | 3.3e-17 | 6.4e-18 |
*     | IEEE       | -2,2   | 30000    | 2.5e-16 | 5.8e-17 |
*
*
* @param {number} x - input value (in radians)
* @returns {number} hyperbolic tangent
*
* @example
* var v = tanh( 0.0 );
* // returns 0.0
*
* @example
* var v = tanh( 2.0 );
* // returns ~0.964
*
* @example
* var v = tanh( -2.0 );
* // returns ~-0.964
*
* @example
* var v = tanh( NaN );
* // returns NaN
*/

/**
* Computes the inter-quartile range for a numeric array.
*
* @private
* @param {NumericArray} data - ndarray like data
* @param {number} j - column index for which to get the IQR
* @returns {number} inter-quartile range
*/

/**
* Computes the interquartile range for an array.
*
* @param {Array} arr - array of values
* @returns {number} interquartile range
*/

/**
* Computes the leading power terms in the incomplete beta function.
*
* When normalized,
*
* ```tex
* \frac{ x^a y^b }{ \operatorname{Beta}(a,b) }
* ```
*
* and otherwise
*
* ```tex
* x^a y^b
* ```
*
* ## Notes
*
* -   Almost all of the error in the incomplete beta comes from this function, particularly when \\( a \\) and \\( b \\) are large. Computing large powers are _hard_ though, and using logarithms just leads to horrendous cancellation errors.
*
* -   For \\( l1 * l2 > 0 \\) or \\( \operatorname{min}( a, b ) < 1 \\), the two power terms both go in the same direction (toward zero or toward infinity). In this case if either term overflows or underflows, then the product of the two must do so also. Alternatively, if one exponent is less than one, then we can't productively use it to eliminate overflow or underflow from the other term.  Problems with spurious overflow/underflow can't be ruled out. In this case, but it is _very_ unlikely since one of the power terms will evaluate to a number close to 1.
*
* -   If \\( \max( \abs(l1), \abs(l2) ) < 0.5 \\), both exponents are near one and both the exponents are greater than one, and, further, these two power terms tend in opposite directions (one toward zero, the other toward infinity), so we have to combine the terms to avoid any risk of overflow or underflow. We do this by moving one power term inside the other, we have:
*
*     ```tex
*     (1 + l_1)^a \cdot (1 + l_2)^b \\
*     = ((1 + l_1) \cdot (1 + l_2)^(b/a))^a \\
*     = (1 + l_1 + l_3 + l_1*l_3)^a
*     ```
*
*     and
*
*     ```tex
*     l_3 = (1 + l_2)^(b/a) - 1 \\
*     = \exp((b/a) * \ln(1 + l_2)) - 1
*     ```
*
*     The tricky bit is deciding which term to move inside. By preference, we move the larger term inside, so that the size of the largest exponent is reduced.  However, that can only be done as long as l3 (see above) is also small.
*
* @private
* @param {NonNegativeNumber} a - function parameter
* @param {NonNegativeNumber} b - function parameter
* @param {Probability} x - function parameter
* @param {Probability} y - probability equal to `1-x`
* @param {boolean} normalized - boolean indicating whether to evaluate the power terms of the regularized or non-regularized incomplete beta function
* @returns {number} power terms
*/

/**
* Computes the maximum value of a numeric array.
*
* @param {Array} arr - array of values
* @returns {number} max value
*/

/**
* Computes the median of an array.
*
* @param {Array} arr - input array
* @returns {(number|null)} median value or null
*/

/**
* Computes the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view.
*
* @param {(Array|TypedArray|Object)} [out] - output object
* @param {NonNegativeIntegerArray} shape - array shape
* @param {IntegerArray} strides - stride array
* @param {NonNegativeInteger} offset - index offset
* @returns {(Array|TypedArray|Object)} linear indices
*
* @example
* var shape = [ 10, 10 ];
* var strides = [ 10, 1 ];
* var offset = 10;
*
* var idx = minmaxViewBufferIndex( shape, strides, offset );
* // returns [ 10, 109 ]
*
* @example
* var shape = [ 10, 10 ];
* var strides = [ -10, -1 ];
* var offset = 99;
*
* var idx = minmaxViewBufferIndex( shape, strides, offset );
* // returns [ 0, 99 ]
*
* @example
* var shape = [ 10, 10 ];
* var strides = [ 1, 10 ];
* var offset = 10;
*
* var idx = minmaxViewBufferIndex( shape, strides, offset );
* // returns [ 10, 109 ]
*
* @example
* var shape = [ 10, 10 ];
* var strides = [ -1, -10 ];
* var offset = 99;
*
* var idx = minmaxViewBufferIndex( shape, strides, offset );
* // returns [ 0, 99 ]
*
* @example
* var shape = [ 10, 10 ];
* var strides = [ -1, -10 ];
* var offset = 99;
*
* var out = new Array( 2 );
* var idx = minmaxViewBufferIndex( out, shape, strides, offset );
* // returns [ 0, 99 ]
*
* var bool = ( idx === out );
* // returns true
*/

/**
* Computes the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view.
*
* @private
* @param {(Array|TypedArray|Object)} out - output object
* @param {NonNegativeIntegerArray} shape - array shape
* @param {IntegerArray} strides - stride array
* @param {NonNegativeInteger} offset - index offset
* @returns {(Array|TypedArray|Object)} linear indices
*
* @example
* var shape = [ 10, 10 ];
* var strides = [ 10, 1 ];
* var offset = 10;
*
* var out = new Array( 2 );
* var idx = minmaxViewBufferIndex( out, shape, strides, offset );
* // returns [ 10, 109 ]
*
* var bool = ( idx === out );
* // returns true
*
* @example
* var shape = [ 10, 10 ];
* var strides = [ -10, -1 ];
* var offset = 99;
*
* var out = new Array( 2 );
* var idx = minmaxViewBufferIndex( out, shape, strides, offset );
* // returns [ 0, 99 ]
*
* var bool = ( idx === out );
* // returns true
*
* @example
* var shape = [ 10, 10 ];
* var strides = [ 1, 10 ];
* var offset = 10;
*
* var out = new Array( 2 );
* var idx = minmaxViewBufferIndex( out, shape, strides, offset );
* // returns [ 10, 109 ]
*
* var bool = ( idx === out );
* // returns true
*
* @example
* var shape = [ 10, 10 ];
* var strides = [ -1, -10 ];
* var offset = 99;
*
* var out = new Array( 2 );
* var idx = minmaxViewBufferIndex( out, shape, strides, offset );
* // returns [ 0, 99 ]
*
* var bool = ( idx === out );
* // returns true
*/

/**
* Computes the minimum and maximum value of an array.
*
* @param {Array} arr - array of values
* @returns {Array} minimum and maximum value
*/

/**
* Computes the minimum value of an array.
*
* @param {Array} arr - array of values
* @returns {number} min value
*/

/**
* Computes the quartic kernel for a value.
*
* @private
* @param {number} u - input value
* @returns {number} kernel value at u
*
* @example
* var u = 5;
* var out = quartic(u);
* // returns 0
*/

/**
* Computes the ratio of two gamma functions.
*
* ## Notes
*
* -   Specifically, the function evaluates
*
*     ```tex
*     \frac{ \Gamma( z ) }{ \Gamma( z + \delta ) }
*     ```
*
* @param {number} z - first gamma parameter
* @param {number} delta - difference
* @returns {number} gamma ratio
*
* @example
* var y = gammaDeltaRatio( 2.0, 3.0 );
* // returns ~0.042
*
* @example
* var y = gammaDeltaRatio( 4.0, 0.5 );
* // returns ~0.516
*
* @example
* var y = gammaDeltaRatio( 100.0, 0.0 );
* // returns 1.0
*/

/**
* Computes the regularized incomplete gamma function. The upper tail is calculated via the modified Lentz's method for computing continued fractions, the lower tail using a power expansion.
*
*
* ## Notes
*
* -   When `a >= MAX_FACTORIAL` and computing the non-normalized incomplete gamma, result is rather hard to compute unless we use logs. There are really two options a) if `x` is a long way from `a` in value then we can reliably use methods 2 and 4 below in logarithmic form and go straight to the result. Otherwise we let the regularized gamma take the strain (the result is unlikely to underflow in the central region anyway) and combine with `lgamma` in the hopes that we get a finite result.
*
* @param {NonNegativeNumber} x - function parameter
* @param {PositiveNumber} a - function parameter
* @param {boolean} [regularized=true] - boolean indicating if the function should evaluate the regularized or non-regularized incomplete gamma functions
* @param {boolean} [upper=false] - boolean indicating if the function should return the upper tail of the incomplete gamma function
* @returns {number} function value
*/

/**
* Computes the regulated gamma function.
*
* @private
* @param {number} x - input value
* @returns {number} function value
*/

/**
* Computes the rule-of-thumb bandwidth for the values in a column of `x`.
*
* @private
* @param {ndarrayLike} arr - input ndarray
* @param {number} j - index of the column from which to obtain the values
* @returns {NumericArray} array with bandwidth values
*
* @example
* var ndarrayLike = require( './ndarray_like.js' );
*
* var x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, 1.7881, 2.019, 2.25, 2.481, 2.7119 ];
* var y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, 4.1934, 5.0415, 5.8896, 6.7376, 7.5857 ];
* var arr = ndarrayLike( x, y );
* var out = pickBandwidth( arr, 1 );
* // returns ~1.717
*/

/**
* Computes the sample ranks for the values of an array-like object.
*
* @param {Collection} x - data array
* @param {Object} [options] - options object
* @param {string} [options.method='average'] - method name determining how ties are treated
* @param {string} [options.missing='last'] - determines where missing values go (`first`,`last`, or `remove`)
* @param {Array} [options.encoding=[null,NaN]] - array of values encoding missing values
* @throws {TypeError} first argument has to be an array-like object
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {Array} array containing the computed ranks for the elements of x
*
* @example
* var arr = [ 1.1, 2.0, 3.5, 0.0, 2.4 ];
* var out = ranks( arr );
* // returns [ 2, 3, 5, 1, 4 ]
*
* @example
* // Ties are averaged:
* arr = [ 2, 2, 1, 4, 3 ];
* out = ranks( arr );
* // returns [ 2.5, 2.5, 1, 5, 4 ]
*
* @example
* // Missing values are placed last:
* arr = [ null, 2, 2, 1, 4, 3, NaN, NaN ];
* out = ranks( arr );
* // returns [ 6, 2.5, 2.5, 1, 5, 4, 7 ,8 ]
*/

/**
* Computes the sample standard deviation over an array of values.
*
* @param {Array} arr - array of values
* @returns {number} sample standard deviation
*/

/**
* Computes the sum of a Chebyshev polynomial.
*
* @private
* @param {PositiveInteger} n - degree of polynomial
* @param {number} t - input value
* @returns {number} Chebyshev sum
*/

/**
* Computes the sum of elements of a numeric array.
*
* @param {Array} arr - input array
* @returns {(number|null)} sum or null
*/

/**
* Computes the sum of elements of an numeric array.
*
* @private
* @param {NumericArray} arr - input array
* @returns {number} sum
*
* @example
* var arr = [ 2.0, 6.0, 10.0 ];
* var out = sum( arr );
* // returns 18.0
*/

/**
* Computes the triangular kernel for a value.
*
* @private
* @param {number} u - input value
* @returns {number} kernel value at u
*
* @example
* var u = 0.2;
* var out = triangular( u );
* // returns 0.8
*/

/**
* Computes the tricube kernel for a value.
*
* @private
* @param {number} u - value for which we wish to calculate the tricube kernel
* @returns {number} the value for the kernel at u
*
* @example
* var u = 5;
* out = tricube(u);
* // returns 0
*/

/**
* Computes the unbiased standard deviation of an array.
*
* @private
* @param {NumericArray} arr - input array
* @returns {number} standard deviation
*
* @example
* var arr = [ 2, 3, 4, 3, 5 ];
* var out = stdev( arr );
* // returns ~1.14
*/

/**
* Computes the unbiased standard deviation.
*
* @private
* @param {ndarrayLike} arr - input array
* @param {number} j - column for which to calculate the standard deviation
* @returns {number} standard deviation
*
* @example
* var ndarrayLike = require( './ndarray_like.js' );
*
* var x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, 1.7881, 2.019, 2.25, 2.481, 2.7119 ];
* var y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, 4.1934, 5.0415, 5.8896, 6.7376, 7.5857 ];
* var arr = ndarrayLike( x, y );
* var out = stdev( arr, 1 );
* // returns ~2.568
*/

/**
* Computes the unbiased variance of an array.
*
* @private
* @param {NumericArray} arr - input array
* @returns {number} variance
*/

/**
* Computes the uniform kernel.
*
* @private
* @param {number} u - input value
* @returns {number} kernel value at u
*
* @example
* var u = 0.2;
* var out = uniform( u );
* // returns 0.5
*/

/**
* Computes the value of `sin(πx)`.
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var y = sinpi( 0.0 );
* // returns 0.0
*
* @example
* var y = sinpi( 0.5 );
* // returns 1.0
*
* @example
* var y = sinpi( 0.9 );
* // returns ~0.309
*
* @example
* var y = sinpi( NaN );
* // returns NaN
*/

/**
* Computes the variance of an array.
*
* @param {Array} arr - input array
* @param {boolean} [bias=false] - boolean indicating whether to calculate a biased or unbiased estimate of the variance
* @returns {(number|null)} variance or null
*/

/**
* Computes the vector of means for each treatment.
*
* @private
* @param {NumericArray} x - measured values
* @param {Array} factor - array of treatments
* @param {Array} treats - unique treatments
* @returns {Object} summary statistics for the categories.
*/

/**
* Computes two-dimensional kernel density estimates.
*
* @param {NumericArray} x - array of x values
* @param {NumericArray} y - array of y values
* @param {Options} [options] - function options
* @param {NumericArray} [options.h] - array of length two containing the bandwidth values for x and y
* @param {number} [options.n=25] - number of partitions on the x- and y-axes
* @param {number} [options.xMin] - lower limit of x
* @param {number} [options.xMax] - upper limit of x
* @param {number} [options.yMin] - lower limit of y
* @param {number} [options.yMax] - upper limit of y
* @param {(string|Function)} [options.kernel='gaussian'] - a string or function to specifying the used kernel function
* @throws {TypeError} first argument must be an array or matrix-like
* @throws {TypeError} second argument must be an array
* @throws {Error} first and second arguments must be of the same length
* @throws {RangeError} `xMin` must be smaller than `xMax`
* @throws {RangeError} `yMin` must be smaller than `yMax`
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {Object} object containing the density estimates (`z`) along grid points (`x` and `y` values)
*
* @example
* var x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, 1.7881, 2.019, 2.25, 2.481, 2.7119 ];
* var y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, 4.1934, 5.0415, 5.8896, 6.7376, 7.5857 ];
* var out = kde2d( x, y );
*/

/**
* Contains MIT-licensed code:
*
* The MIT License (MIT)
*
* Copyright (c) 2013 Yurii Lahodiuk
*
* 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
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/**
* Continued fraction for the incomplete beta.
*
* @private
* @param {NonNegativeNumber} a - function parameter
* @param {NonNegativeNumber} b - function parameter
* @param {Probability} x - function parameter
* @param {Probability} y - probability equal to `1-x`
* @returns {Function} series function
*/

/**
* Converts two arrays .
*
* @private
* @param {NumericArray} x - array of x values
* @param {NumericArray} y - array of y values
* @throws {TypeError} first argument must be a numeric array
* @throws {TypeError} second argument must be a numeric array
* @throws {Error} first and second arguments must be of the same length
* @returns {Object} object that mirrors an `ndarray`
*
* @example
* var x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, 1.7881, 2.019, 2.25, 2.481, 2.7119 ];
* var y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, 4.1934, 5.0415, 5.8896, 6.7376, 7.5857 ];
* var out = ndarrayLike( x, y );
*/

/**
* Copies an ndarray view to a data buffer.
*
* @private
* @param {ndarray} arr - input ndarray
* @param {string} dtype - data type
* @returns {(Array|TypedArray|Buffer)} output data buffer
*
* @example
* var ndarray = require( '@stdlib/ndarray/ctor' );
*
* var vector = ndarray( 'generic', 1 );
*
* var buffer = [ 1.0, 2.0, 3.0 ];
* var shape = [ 3 ];
* var strides = [ -1 ];
* var vec = vector( buffer, shape, strides, 2, 'row-major' );
*
* var b = copyView( vec, 'float64' );
* // returns <Float64Array>[ 3.0, 2.0, 1.0 ]
*/

/**
* Copies ndarray flags.
*
* @private
* @param {Object} flags - flags
* @returns {Object} copy of input object
*/

/**
* Copies the contents of array-like object to a new array.
*
*
* @private
* @param {ArrayLike} arr - input array
* @param {NonNegativeInteger} len - array length
* @returns {Array} output array
*
* @example
* var arr = [ 1.0, 2.0, 3.0 ];
*
* var out = copy( arr, arr.length );
* // returns [ 1.0, 2.0, 3.0 ]
*
* var bool = ( arr === out );
* // returns false
*/

/**
* Create a memoized ndarray constructor.
*
* @module @stdlib/ndarray/base/memoized-ctor
*
* @example
* var ctor = require( '@stdlib/ndarray/base/memoized-ctor' );
*
* var f1 = ctor( 'float64', 3 );
* // returns <Function>
*
* var f2 = ctor( 'float64', 3 );
* // returns <Function>
*
* var bool = ( f1 === f2 );
* // returns true
*
* var buffer = [ 1, 2, 3, 4, 5, 6 ];
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var out = f1( buffer, shape, strides, offset, 'row-major' );
*/

/**
* Create a memoized ndarray constructor.
*
* @module @stdlib/ndarray/memoized-ctor
*
* @example
* var ctor = require( '@stdlib/ndarray/memoized-ctor' );
*
* var f1 = ctor( 'float64', 3 );
* // returns <Function>
*
* var f2 = ctor( 'float64', 3 );
* // returns <Function>
*
* var bool = ( f1 === f2 );
* // returns true
*
* var buffer = [ 1, 2, 3, 4, 5, 6 ];
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var out = f1( buffer, shape, strides, offset, 'row-major' );
*/

/**
* Create a string from a sequence of Unicode code points.
*
* @module @stdlib/string/from-code-point
*
* @example
* var fromCodePoint = require( '@stdlib/string/from-code-point' );
*
* var str = fromCodePoint( 9731 );
* // returns '☃'
*/

/**
* Create a zero-filled contiguous linear ndarray data buffer.
*
* @module @stdlib/ndarray/base/buffer
*
* @example
* var buffer = require( '@stdlib/ndarray/base/buffer' );
*
* var buf = buffer( 'float64', 3 );
* // returns <Float64Array>[ 0.0, 0.0, 0.0 ]
*/

/**
* Create an ndarray constructor.
*
* @module @stdlib/ndarray/base/ctor
*
* @example
* var ctor = require( '@stdlib/ndarray/base/ctor' );
*
* var ndarray = ctor( 'float64', 3 );
* // returns <Function>
*
* var buffer = [ 1, 2, 3, 4, 5, 6 ];
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var out = ndarray( buffer, shape, strides, offset, 'row-major' );
*/

/**
* Create an ndarray constructor.
*
* @module @stdlib/ndarray/ctor
*
* @example
* var ctor = require( '@stdlib/ndarray/ctor' );
*
* var ndarray = ctor( 'generic', 3 );
* // returns <Function>
*
* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var out = ndarray( buffer, shape, strides, offset, 'row-major' );
*/

/**
* Creates a function to evaluate a series expansion of the incomplete gamma function.
*
* @private
* @param {number} a1 - function parameter
* @param {number} z1 - function parameter
* @returns {Function} series function
*/

/**
* Creates a function to evaluate a series expansion of the upper incomplete gamma fraction.
*
* @private
* @param {number} a1 - function parameter
* @param {number} z1 - function parameter
* @returns {Function} series function
*/

/**
* Creates a string from a sequence of Unicode code points.
*
* ## Notes
*
* -   UTF-16 encoding uses one 16-bit unit for non-surrogates (U+0000 to U+D7FF and U+E000 to U+FFFF).
* -   UTF-16 encoding uses two 16-bit units (surrogate pairs) for U+10000 to U+10FFFF and encodes U+10000-U+10FFFF by subtracting 0x10000 from the code point, expressing the result as a 20-bit binary, and splitting the 20 bits of 0x0-0xFFFFF as upper and lower 10-bits. The respective 10-bits are stored in two 16-bit words: a high and a low surrogate.
*
*
* @param {...NonNegativeInteger} args - sequence of code points
* @throws {Error} must provide either an array-like object of code points or one or more code points as separate arguments
* @throws {TypeError} a code point must be a nonnegative integer
* @throws {RangeError} must provide a valid Unicode code point
* @returns {string} created string
*
* @example
* var str = fromCodePoint( 9731 );
* // returns '☃'
*/

/**
* Creates a two-dimensional array.
*
* @param {number} m - number of rows
* @param {number} n - number of columns
* @return {Array} an empty array of arrays
*/

/**
* Creates an instance of RandomForest with specific number of trees.
*
* @constructor
* @param opts - contains configuration parameters for building decision trees
*/

/**
* Creates an instance of a decision tree for classification problems.
*
* @constructor
* @param opts - contains training set and some configuration parameters
*/

/**
* Define a non-enumerable property.
*
* @module @stdlib/utils/define-nonenumerable-property
*
* @example
* var objectKeys = require( '@stdlib/utils/keys' );
* var setNonEnumerableProperty = require( '@stdlib/utils/define-nonenumerable-property' );
*
* var obj = {};
*
* setNonEnumerableProperty( obj, 'foo', 'bar' );
*
* var v = obj.foo;
* // returns 'bar'
*
* var keys = objectKeys( obj );
* // returns []
*/

/**
* Define a read-only property.
*
* @module @stdlib/utils/define-read-only-property
*
* @example
* var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
*
* var obj = {};
*
* setReadOnly( obj, 'foo', 'bar' );
*
* try {
*     obj.foo = 'boop';
* } catch ( err ) {
*     console.error( err.message );
* }
*/

/**
* Defines a non-enumerable property.
*
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {*} value - value to set
*
* @example
* var objectKeys = require( '@stdlib/utils/keys' );
*
* var obj = {};
*
* setNonEnumerableProperty( obj, 'foo', 'bar' );
*
* var v = obj.foo;
* // returns 'bar'
*
* var keys = objectKeys( obj );
* // returns []
*/

/**
* Defines a read-only property.
*
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {*} value - value to set
*
* @example
* var obj = {};
*
* setReadOnly( obj, 'foo', 'bar' );
*
* try {
*     obj.foo = 'boop';
* } catch ( err ) {
*     console.error( err.message );
* }
*/

/**
* Degenerate distribution cumulative distribution function (CDF).
*
* @module @stdlib/stats/base/dists/degenerate/cdf
*
* @example
* var cdf = require( '@stdlib/stats/base/dists/degenerate/cdf' );
*
* var y = cdf( 2.0, 5.0 );
* // returns 0.0
*
* @example
* var factory = require( '@stdlib/stats/base/dists/degenerate/cdf' ).factory;
*
* var cdf = factory( 5.0 );
*
* var y = cdf( 3.0 );
* // returns 0.0
*
* y = cdf( 6.0 );
* // returns 1.0
*/

/**
* Degenerate distribution probability density function (PDF).
*
* @module @stdlib/stats/base/dists/degenerate/pdf
*
* @example
* var pdf = require( '@stdlib/stats/base/dists/degenerate/pdf' );
*
* var y = pdf( 2.0, 0.0 );
* // returns 0.0
*
* @example
* var factory = require( '@stdlib/stats/base/dists/degenerate/pdf' ).factory;
*
* var pdf = factory( 10.0 );
*
* var y = pdf( 10.0 );
* // returns Infinity
*/

/**
* Degenerate distribution quantile function.
*
* @module @stdlib/stats/base/dists/degenerate/quantile
*
* @example
* var quantile = require( '@stdlib/stats/base/dists/degenerate/quantile' );
*
* var y = quantile( 0.5, 2.0 );
* // returns 2.0
*
* @example
* var factory = require( '@stdlib/stats/base/dists/degenerate/quantile' ).factory;
*
* var quantile = factory( 10.0 );
*
* var y = quantile( 0.5 );
* // returns 10.0
*/

/**
* Delete the element passed to parameter `elem` from the queue, if present.
*/

/**
* Detects a JSON string.
*
* Regular expression: `/^\{[\s\S]*\}$|^\[[\s\S]*\]$/`
*
* -   `^\{`
*
*     -   match a `{` literal which is the first character
*
* -   `[\s\S]*`
*
*     -   match any whitespace and non-whitespace characters which occur `0` or more times
*
* -   `\}$`
*
*     -   match a `}` literal which is the last character
*
* -   `|`
*
*     -   alternatively
*
* -   `^\[`
*
*     -   match a `[` literal which is the first character
*
* -   `[\s\S]*`
*
*     -   match any whitespace and non-whitespace characters which occur `0` or more times
*
* -   `\]$`
*
*     -   match a `]` literal which is the last character
*
*
* Example matching strings:
*
* -   `'{}'`
* -   `'[]'`
* -   `'{adjlkfaj3743.,><\n\t\rdf}'`
* -   `'[adjlkfaj3743.,><\n\t\rdf]'`
* -   `'{"a":5}'`
*
* @constant
* @type {RegExp}
* @default /^\{[\s\S]*\}$|^\[[\s\S]*\]$/
*/

/**
* Determine (nested) array dimensions.
*
* @module @stdlib/array/shape
*
* @example
* var arrayShape = require( '@stdlib/array/shape' );
*
* var arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ];
*
* var shape = arrayShape( arr );
* // returns [ 3, 3 ]
*
* @example
* var arrayShape = require( '@stdlib/array/shape' );
*
* var arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8 ] ];
*
* var shape = arrayShape( arr );
* // returns [ 3 ]
*
* @example
* var arrayShape = require( '@stdlib/array/shape' );
*
* var arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], null ];
*
* var shape = arrayShape( arr );
* // returns [ 3 ]
*/

/**
* Determine if an array data type can be cast to another array data type according to a specified casting rule.
*
* @module @stdlib/ndarray/base/assert/is-allowed-data-type-cast
*
* @example
* var isAllowedCast = require( '@stdlib/ndarray/base/assert/is-allowed-data-type-cast' );
*
* var bool = isAllowedCast( 'float32', 'float64', 'safe' );
* // returns true
*
* bool = isAllowedCast( 'float64', 'int32', 'safe' );
* // returns false
*/

/**
* Determine if an ndarray data type can be safely cast to another ndarray data type.
*
* @module @stdlib/ndarray/base/assert/is-safe-data-type-cast
*
* @example
* var isSafeCast = require( '@stdlib/ndarray/base/assert/is-safe-data-type-cast' );
*
* var bool = isSafeCast( 'float32', 'float64' );
* // returns true
*
* bool = isSafeCast( 'float64', 'int32' );
* // returns false
*/

/**
* Determine if an ndarray data type can be safely cast to, or is of the same "kind" as, another ndarray data type.
*
* @module @stdlib/ndarray/base/assert/is-same-kind-data-type-cast
*
* @example
* var isSameKindCast = require( '@stdlib/ndarray/base/assert/is-same-kind-data-type-cast' );
*
* var bool = isSameKindCast( 'float32', 'float64' );
* // returns true
*
* bool = isSameKindCast( 'uint16', 'int16' );
* // returns false
*/

/**
* Determine the index offset which specifies the location of the first indexed value in a multidimensional array based on a stride array.
*
* @module @stdlib/ndarray/strides2offset
*
* @example
* var strides2offset = require( '@stdlib/ndarray/base/strides2offset' );
*
* var shape = [ 2, 3, 10 ];
* var strides = [ 30, -10, 1 ];
*
* var offset = strides2offset( shape, strides );
* // returns 20
*/

/**
* Determine the order of a multidimensional array based on a provided stride array.
*
* @module @stdlib/ndarray/base/strides2order
*
* @example
* var strides2order = require( '@stdlib/ndarray/base/strides2order' );
*
* var order = strides2order( [ 2, 1 ] );
* // returns 'row-major'
*
* order = strides2order( [ 1, 2 ] );
* // returns 'column-major'
*
* order = strides2order( [ 1, 1, 1 ] );
* // returns 'both'
*
* order = strides2order( [ 2, 3, 1 ] );
* // returns 'none'
*/

/**
* Determines (nested) array dimensions.
*
* @param {Array} arr - array
* @throws {TypeError} must provide an array
* @returns {Array} array shape
*
* @example
* var arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ];
*
* var shape = arrayShape( arr );
* // returns [ 3, 3 ]
*
* @example
* var arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8 ] ];
*
* var shape = arrayShape( arr );
* // returns [ 3 ]
*
* @example
* var arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], null ];
*
* var shape = arrayShape( arr );
* // returns [ 3 ]
*/

/**
* Determines if an array is column-major contiguous.
*
* @private
* @param {string} order - **inferred** array order
* @param {boolean} contiguous - boolean indicating is an array is contiguous
* @returns {boolean} boolean indicating if an array is column-major contiguous
*/

/**
* Determines if an array is contiguous.
*
* @private
* @param {NonNegativeInteger} len - array length
* @param {NonNegativeIntegerArray} shape - array shape
* @param {IntegerArray} strides - stride array
* @param {NonNegativeInteger} offset - index offset
* @param {integer} iterationOrder - iteration order
* @returns {boolean} boolean indicating if an array is contiguous
*/

/**
* Determines if an array is row-major contiguous.
*
* @private
* @param {string} order - **inferred** array order
* @param {boolean} contiguous - boolean indicating is an array is contiguous
* @returns {boolean} boolean indicating if an array is row-major contiguous
*/

/**
* Determines the order of a multidimensional array based on a provided stride array.
*
* @param {IntegerArray} strides - stride array
* @returns {string} order
*
* @example
* var strides2order = require( '@stdlib/ndarray/base/strides2order' );
*
* var order = strides2order( [ 2, 1 ] );
* // returns 'row-major'
*
* order = strides2order( [ 1, 2 ] );
* // returns 'column-major'
*
* order = strides2order( [ 1, 1, 1 ] );
* // returns 'both'
*
* order = strides2order( [ 2, 3, 1 ] );
* // returns 'none'
*/

/**
* Difference between one and the smallest value greater than one that can be represented as a double-precision floating-point number.
*
* ## Notes
*
* The difference is
*
* ```tex
* \frac{1}{2^{52}}
* ```
*
* @constant
* @type {number}
* @default 2.220446049250313e-16
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
* @see [Machine Epsilon]{@link https://en.wikipedia.org/wiki/Machine_epsilon}
*/

/**
* Difference between one and the smallest value greater than one that can be represented as a double-precision floating-point number.
*
* @module @stdlib/constants/math/float64-eps
* @type {number}
*
* @example
* var FLOAT64_EPSILON = require( '@stdlib/constants/math/float64-eps' );
* // returns 2.220446049250313e-16
*/

/**
* Dummy constructor.
*
* @private
*/

/**
* Evaluate `bˣ - 1`.
*
* @module @stdlib/math/base/special/powm1
*
* @example
* var powm1 = require( '@stdlib/math/base/special/powm1' );
*
* var y = powm1( 2.0, 3.0 );
* // returns 7.0
*
* y = powm1( 4.0, 0.5 );
* // returns 1.0
*
* y = powm1( 0.0, 100.0 );
* // returns -1.0
*
* y = powm1( 100.0, 0.0 );
* // returns 0.0
*
* y = powm1( 0.0, 0.0 );
* // returns 0.0
*
* y = powm1( 3.141592653589793, 5.0 );
* // returns ~305.0197
*
* y = powm1( NaN, 3.0 );
* // returns NaN
*
* y = powm1( 5.0, NaN );
* // returns NaN
*/

/**
* Evaluate a polynomial.
*
* @module @stdlib/math/base/tools/evalpoly
*
* @example
* var evalpoly = require( '@stdlib/math/base/tools/evalpoly' );
*
* var v = evalpoly( [3.0,2.0,1.0], 10.0 ); // 3*10^0 + 2*10^1 + 1*10^2
* // returns 123.0
*
* @example
* var evalpoly = require( '@stdlib/math/base/tools/evalpoly' );
*
* var polyval = evalpoly.factory( [3.0,2.0,1.0] );
*
* var v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2
* // returns 123.0
*
* v = polyval( 5.0 ); // => 3*5^0 + 2*5^1 + 1*5^2
* // returns 38.0
*/

/**
* Evaluate the beta function.
*
* @module @stdlib/math/base/special/beta
*
* @example
* var beta = require( '@stdlib/math/base/special/beta' );
*
* var v = beta( 0.0, 0.5 );
* // returns Infinity
*
* v = beta( 1.0, 1.0 );
* // returns 1.0
*
* v = beta( -1.0, 2.0 );
* // returns NaN
*
* v = beta( 5.0, 0.2 );
* // returns ~3.382
*
* v = beta( 4.0, 1.0 );
* // returns 0.25
*
* v = beta( NaN, 2.0 );
* // returns NaN
*/

/**
* Evaluate the beta function.
*
* @param {NonNegativeNumber} a - input value
* @param {NonNegativeNumber} b - input value
* @returns {number} evaluated beta function
*
* @example
* var v = beta( 0.0, 0.5 );
* // returns Infinity
*
* @example
* var v = beta( 1.0, 1.0 );
* // returns 1.0
*
* @example
* var v = beta( -1.0, 2.0 );
* // returns NaN
*
* @example
* var v = beta( 5.0, 0.2 );
* // returns ~3.382
*
* @example
* var v = beta( 4.0, 1.0 );
* // returns 0.25
*
* @example
* var v = beta( NaN, 2.0 );
* // returns NaN
*/

/**
* Evaluate the cumulative distribution function (CDF) for an F distribution.
*
* @module @stdlib/stats/base/dists/f/cdf
*
* @example
* var cdf = require( '@stdlib/stats/base/dists/f/cdf' );
*
* var y = cdf( 2.0, 1.0, 1.0 );
* // returns ~0.608
*
* y = cdf( 2.0, 8.0, 4.0 );
* // returns ~0.737
*
* y = cdf( -1.0, 2.0, 2.0 );
* // returns 0.0
*
* var mycdf = cdf.factory( 10.0, 2.0 );
*
* y = mycdf( 10.0 );
* // returns ~0.906
*
* y = mycdf( 8.0 );
* // returns ~0.884
*/

/**
* Evaluate the incomplete beta function and its first derivative.
*
* @module @stdlib/math/base/special/kernel-betainc
*
* @example
* var kernelBetainc = require( '@stdlib/math/base/special/kernel-betainc' );
*
* var out = kernelBetainc( 0.5, 2.0, 2.0, false, false );
* // returns [ ~0.083, ~1.5 ]
*
* out = kernelBetainc( 0.2, 1.0, 2.0, true, false );
* // returns [ 0.32, 1.6 ]
*
* var arr = new Array( 2 );
* out = kernelBetainc( arr, 0.2, 1.0, 2.0, true, true );
* // returns [ 0.64, 1.6 ]
*
* var bool = ( arr === out );
* // returns true
*/

/**
* Evaluate the incomplete beta function.
*
* @module @stdlib/math/base/special/betainc
*
* @example
* var betainc = require( '@stdlib/math/base/special/betainc' );
*
* var y = betainc( 0.5, 2.0, 2.0 );
* // returns 0.5
*
* y = betainc( 0.5, 2.0, 2.0, false );
* // returns ~0.083
*
* y = betainc( 0.2, 1.0, 2.0 );
* // returns 0.36
*
* y = betainc( 0.2, 1.0, 2.0, true, true );
* // returns 0.64
*/

/**
* Evaluate the incomplete gamma function.
*
* @module @stdlib/math/base/special/gammainc
*
* @example
* var gammainc = require( '@stdlib/math/base/special/gammainc' );
*
* var v = gammainc( 6.0, 2.0 );
* // returns ~0.9826
*
* v = gammainc( 1.0, 2.0, true, true );
* // returns ~0.7358
*
* v = gammainc( 7.0, 5.0 );
* // returns ~0.8270
*
* v = gammainc( 7.0, 5.0, false );
* // returns ~19.8482
*
* v = gammainc( NaN, 2.0 );
* // returns NaN
*
* v = gammainc( 6.0, NaN );
* // returns NaN
*/

/**
* Evaluate the inverse complementary error function.
*
* @module @stdlib/math/base/special/erfcinv
*
* @example
* var erfcinv = require( '@stdlib/math/base/special/erfcinv' );
*
* var y = erfcinv( 0.5 );
* // returns ~0.4769
*
* y = erfcinv( 0.8 );
* // returns ~-0.1791
*
* y = erfcinv( 0.0 );
* // returns Infinity
*
* y = erfcinv( 2.0 );
* // returns -Infinity
*
* y = erfcinv( NaN );
* // returns NaN
*/

/**
* Evaluate the inverse error function.
*
* @module @stdlib/math/base/special/erfinv
*
* @example
* var erfinv = require( '@stdlib/math/base/special/erfinv' );
*
* var y = erfinv( 0.5 );
* // returns ~0.4769
*
* y = erfinv( 0.8 );
* // returns ~0.9062
*
* y = erfinv( 0.0 );
* // returns 0.0
*
* y = erfinv( -0.0 );
* // returns -0.0
*
* y = erfinv( -1.0 );
* // returns -Infinity
*
* y = erfinv( 1.0 );
* // returns Infinity
*
* y = erfinv( NaN );
* // returns NaN
*/

/**
* Evaluate the inverse of the incomplete beta function.
*
* @module @stdlib/math/base/special/kernel-betaincinv
*
* @example
* var kernelBetaincinv = require( '@stdlib/math/base/special/kernel-betaincinv' );
*
* var y = kernelBetaincinv( 3.0, 3.0, 0.2, 0.8 );
* // returns [ ~0.327, ~0.673 ]
*
* y = kernelBetaincinv( 3.0, 3.0, 0.4, 0.6 );
* // returns [ ~0.446, ~0.554 ]
*
* y = kernelBetaincinv( 1.0, 6.0, 0.4, 0.6 );
* // returns [ ~0.082, ~0.918 ]
*
* y = kernelBetaincinv( 1.0, 6.0, 0.8, 0.2 );
* // returns [ ~0.235, ~0.765 ]
*/

/**
* Evaluate the lower incomplete gamma integral via a series expansion and divide by `gamma(z)` to normalize.
*
* @private
* @param {number} a - function parameter
* @param {number} z - function parameter
* @returns {number} function value
*/

/**
* Evaluate the natural logarithm of \\(1+x\\).
*
* @module @stdlib/math/base/special/log1p
*
* @example
* var log1p = require( '@stdlib/math/base/special/log1p' );
*
* var v = log1p( 4.0 );
* // returns ~1.609
*
* v = log1p( -1.0 );
* // returns -Infinity
*
* v = log1p( 0.0 );
* // returns 0.0
*
* v = log1p( -0.0 );
* // returns -0.0
*
* v = log1p( -2.0 );
* // returns NaN
*
* v = log1p( NaN );
* // returns NaN
*/

/**
* Evaluate the natural logarithm of the gamma function.
*
* @module @stdlib/math/base/special/gammaln
*
* @example
* var gammaln = require( '@stdlib/math/base/special/gammaln' );
*
* var v = gammaln( 1.0 );
* // returns 0.0
*
* v = gammaln( 2.0 );
* // returns 0.0
*
* v = gammaln( 4.0 );
* // returns ~1.792
*
* v = gammaln( -0.5 );
* // returns ~1.266
*
* v = gammaln( 0.5 );
* // returns ~0.572
*
* v = gammaln( 0.0 );
* // returns Infinity
*
* v = gammaln( NaN );
* // returns NaN
*/

/**
* Evaluate the quantile function for a Student's t distribution.
*
* @module @stdlib/stats/base/dists/t/quantile
*
* @example
* var quantile = require( '@stdlib/stats/base/dists/t/quantile' );
*
* var y = quantile( 0.8, 1.0 );
* // returns ~1.376
*
* y = quantile( 0.1, 1.0 );
* // returns ~-3.078
*
* y = quantile( 0.5, 0.1 );
* // returns 0.0
*
* var myquantile = quantile.factory( 4.0 );
*
* y = myquantile( 0.2 );
* // returns ~-0.941
*
* y = myquantile( 0.9 );
* // returns ~1.533
*/

/**
* Evaluate the signum function.
*
* @module @stdlib/math/base/special/signum
*
* @example
* var signum = require( '@stdlib/math/base/special/signum' );
*
* var sign = signum( -5.0 );
* // returns -1.0
*
* sign = signum( 5.0 );
* // returns 1.0
*
* sign = signum( -0.0 );
* // returns -0.0
*
* sign = signum( 0.0 );
* // returns 0.0
*
* sign = signum( NaN );
* // returns NaN
*/

/**
* Evaluates Student's t quantiles via a body series expansion. Tail and body series are due to Shaw.
*
* ## References
*
* -   Shaw, William T. 2006. "Sampling Student's T distribution – use of the inverse cumulative distribution function." _Journal of Computational Finance_ 9 (4): 37–73. [www.mth.kcl.ac.uk/~shaww/web\_page/papers/Tdistribution06.pdf](www.mth.kcl.ac.uk/~shaww/web_page/papers/Tdistribution06.pdf).
*
* @private
* @param {PositiveNumber} df - degrees of freedom
* @param {Probability} u - input probability
* @returns {number} function value
*/

/**
* Evaluates Student's t quantiles via a method due to Hill.
*
* ## References
*
* -   Hill, G. W. 1970. "Algorithm 396: Student's T-Quantiles." _Communications of the ACM_ 13 (10). New York, NY, USA: ACM: 619–20. doi:[10.1145/355598.355600](https://doi.org/10.1145/355598.355600).
*
* @private
* @param {PositiveNumber} ndf - degrees of freedom
* @param {Probability} u - input probability
* @returns {number} function value
*/

/**
* Evaluates Student's t quantiles via a tail series expansion. Tail and body series are due to Shaw.
*
* ## References
*
* -   Shaw, William T. 2006. "Sampling Student's T distribution – use of the inverse cumulative distribution function." _Journal of Computational Finance_ 9 (4): 37–73. [www.mth.kcl.ac.uk/~shaww/web\_page/papers/Tdistribution06.pdf](www.mth.kcl.ac.uk/~shaww/web_page/papers/Tdistribution06.pdf).
*
* @private
* @param {number} df - degrees of freedom
* @param {number} v - function value
* @returns {number} tail value
*/

/**
* Evaluates Student's t quantiles.
*
* @private
* @param {PositiveNumber} df - degrees of freedom
* @param {Probability} u - input probability
* @param {Probability} v - probability equal to `1-u`
* @returns {number} function value
*/

/**
* Evaluates `bˣ - 1`.
*
* @param {number} b - base
* @param {number} x - exponent
* @returns {number} function value
*
* @example
* var y = powm1( 2.0, 3.0 );
* // returns 7.0
*
* @example
* var y = powm1( 4.0, 0.5 );
* // returns 1.0
*
* @example
* var y = powm1( 0.0, 100.0 );
* // returns -1.0
*
* @example
* var y = powm1( 100.0, 0.0 );
* // returns 0.0
*
* @example
* var y = powm1( 0.0, 0.0 );
* // returns 0.0
*
* @example
* var y = powm1( 3.141592653589793, 5.0 );
* // returns ~305.0197
*
* @example
* var y = powm1( NaN, 3.0 );
* // returns NaN
*
* @example
* var y = powm1( 5.0, NaN );
* // returns NaN
*/

/**
* Evaluates a continued fraction expansion.
*
* ```text
*           a1
*      ---------------
*      b1 +     a2
*           ----------
*            b2 +   a3
*                -----
*                b3 + ...
* ```
*
* @private
* @param {Function} gen - function giving terms of continued fraction expansion
* @param {PositiveNumber} factor - further terms are only added as long as factor*result is smaller than the next term
* @param {PositiveInteger} maxIter - maximum number of iterations
* @returns {number} evaluated expansion
*/

/**
* Evaluates a continued fraction expansion.
*
* ```text
*      b0 +    a1
*      ---------------
*      b1 +     a2
*           ----------
*           b2 +   a3
*                -----
*                b3 + ...
* ```
*
* @private
* @param {Function} gen - function giving terms of continued fraction expansion
* @param {PositiveNumber} factor - further terms are only added as long as factor*result is smaller than the next term
* @param {PositiveInteger} maxIter - maximum number of iterations
* @returns {number} evaluated expansion
*/

/**
* Evaluates a continued fraction expansion.
*
* ```text
*      b0 +   a1
*      ---------------
*      b1 +   a2
*           ----------
*           b2 +   a3
*                -----
*                b3 + ...
* ```
*
* @private
* @param {Function} gen - function giving terms of continued fraction expansion
* @param {PositiveNumber} factor - further terms are only added as long as factor*result is smaller than the next term
* @param {PositiveInteger} maxIter - maximum number of iterations
* @returns {number} evaluated expansion
*/

/**
* Evaluates a polynomial.
*
* ## Notes
*
* -   The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @param {NumericArray} c - polynomial coefficients sorted in ascending degree
* @param {number} x - value at which to evaluate the polynomial
* @returns {number} evaluated polynomial
*
* @example
* var v = evalpoly( [3.0,2.0,1.0], 10.0 ); // 3*10^0 + 2*10^1 + 1*10^2
* // returns 123.0
*/

/**
* Evaluates a polynomial.
*
* ## Notes
*
* -   The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the polynomial
* @returns {number} evaluated polynomial
*/

/**
* Evaluates a rational function, i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\).
*
* ## Notes
*
* -   Coefficients should be sorted in ascending degree.
* -   The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the rational function
* @returns {number} evaluated rational function
*/

/**
* Evaluates the `eps1` function.
*
* @private
* @param {number} eta - eta value
* @returns {number} function value
*/

/**
* Evaluates the `eps2` function.
*
* @private
* @param {number} eta - eta value
* @returns {number} function value
*/

/**
* Evaluates the `eps3` function.
*
* @private
* @param {number} eta - eta value
* @returns {number} function value
*/

/**
* Evaluates the continued fraction approximation for the supplied series generator using the modified Lentz algorithm.
*
* ## References
*
* -   Lentz, William J. 1976. "Generating bessel functions in Mie scattering calculations using continued fractions." _Applied Optics_ 15 (3): 668–71. doi:[10.1364/AO.15.000668](https://doi.org/10.1364/AO.15.000668).
*
* @param {Function} generator - function returning terms of continued fraction expansion
* @param {Object} [options] - function options
* @param {PositiveInteger} [options.maxIter=1000000] - maximum number of iterations
* @param {PositiveNumber} [options.tolerance=2.22e-16] - further terms are only added as long as the next term is greater than current term times the tolerance
* @param {boolean} [options.keep=false] - whether to keep the leading b term
* @returns {number} value of continued fraction
*
* @example
* // Continued fraction for (e-1)^(-1):
* var gen = generator()
* var out = continuedFraction( gen );
* // returns ~0.582
*
* function generator() {
*    var i = 0;
*    return function() {
*        i++;
*        return [ i, i ];
*    };
* }
*/

/**
* Evaluates the continued fraction approximation for the supplied series generator using the modified Lentz algorithm.
*
* ## References
*
* -   Lentz, William J. 1976. "Generating bessel functions in Mie scattering calculations using continued fractions." _Applied Optics_ 15 (3): 668–71. doi:[10.1364/AO.15.000668](https://doi.org/10.1364/AO.15.000668).
*
* @param {Function} generator - function returning terms of continued fraction expansion
* @param {Object} [options] - function options
* @param {PositiveInteger} [options.maxIter=1000] - maximum number of iterations
* @param {PositiveNumber} [options.tolerance=2.22e-16] - further terms are only added as long as the next term is greater than current term times the tolerance
* @param {boolean} [options.keep=false] - whether to keep the leading b term
* @returns {number} value of continued fraction
*
* @example
* // Continued fraction for (e-1)^(-1):
* var gen = generator();
* var out = continuedFraction( gen );
* // returns ~0.582
*
* function* generator() {
*    var i = 0;
*    while ( true ) {
*        i++;
*        yield [ i, i ];
*    }
* }
*/

/**
* Evaluates the cumulative distribution function (CDF) for a Normal distribution with mean `mu` and standard deviation `sigma` at a value `x`.
*
* @param {number} x - input value
* @param {number} mu - mean
* @param {NonNegativeNumber} sigma - standard deviation
* @returns {Probability} evaluated cumulative distribution function
*
* @example
* var y = cdf( 2.0, 0.0, 1.0 );
* // returns ~0.977
*
* @example
* var y = cdf( -1.0, -1.0, 2.0 );
* // returns 0.5
*
* @example
* var y = cdf( -1.0, 4.0, 2.0 );
* // returns ~0.006
*
* @example
* var y = cdf( NaN, 0.0, 1.0 );
* // returns NaN
*
* @example
* var y = cdf( 0.0, NaN, 1.0 );
* // returns NaN
*
* @example
* var y = cdf( 0.0, 0.0, NaN );
* // returns NaN
*
* @example
* // Negative standard deviation:
* var y = cdf( 2.0, 0.0, -1.0 );
* // returns NaN
*/

/**
* Evaluates the cumulative distribution function (CDF) for a Student's t distribution with degrees of freedom `v` at a value `x`.
*
* @param {number} x - input value
* @param {PositiveNumber} v - degrees of freedom
* @returns {Probability} evaluated CDF
*
* @example
* var y = cdf( 2.0, 0.1 );
* // returns ~0.611
*
* @example
* var y = cdf( 1.0, 2.0 );
* // returns ~0.789
*
* @example
* var y = cdf( -1.0, 4.0 );
* // returns ~0.187
*
* @example
* var y = cdf( NaN, 1.0 );
* // returns NaN
*
* @example
* var y = cdf( 0.0, NaN );
* // returns NaN
*
* @example
* var y = cdf( 2.0, -1.0 );
* // returns NaN
*/

/**
* Evaluates the cumulative distribution function (CDF) for a chi-squared distribution with degrees of freedom `k` at a value `x`.
*
* @param {number} x - input value
* @param {NonNegativeNumber} k - degrees of freedom
* @returns {Probability} evaluated CDF
*
* @example
* var y = cdf( 2.0, 3.0 );
* // returns ~0.428
*
* @example
* var y = cdf( 1.0, 0.5 );
* // returns ~0.846
*
* @example
* var y = cdf( -1.0, 4.0 );
* // returns 0.0
*
* @example
* var y = cdf( NaN, 1.0 );
* // returns NaN
*
* @example
* var y = cdf( 0.0, NaN );
* // returns NaN
*
* @example
* // Negative degrees of freedom:
* var y = cdf( 2.0, -1.0 );
* // returns NaN
*/

/**
* Evaluates the cumulative distribution function (CDF) for a degenerate distribution with mean value `mu`.
*
* @param {number} x - input value
* @param {number} mu - constant value of distribution
* @returns {Probability} evaluated cumulative distribution function
*
* @example
* var y = cdf( 2.0, 3.0 );
* // returns 0.0
*
* @example
* var y = cdf( 4.0, 3.0 );
* // returns 1.0
*
* @example
* var y = cdf( 3.0, 3.0 );
* // returns 1.0
*
* @example
* var y = cdf( NaN, 0.0 );
* // returns NaN
*
* @example
* var y = cdf( 0.0, NaN );
* // returns NaN
*/

/**
* Evaluates the cumulative distribution function (CDF) for a gamma distribution with shape parameter `alpha` and rate parameter `beta` at a value `x`.
*
* @param {number} x - input value
* @param {NonNegativeNumber} alpha - shape parameter
* @param {PositiveNumber} beta - rate parameter
* @returns {Probability} evaluated CDF
*
* @example
* var y = cdf( 2.0, 1.0, 1.0 );
* // returns ~0.865
*
* @example
* var y = cdf( 2.0, 3.0, 1.0 );
* // returns ~0.323
*
* @example
* var y = cdf( -1.0, 2.0, 2.0 );
* // returns 0.0
*
* @example
* var y = cdf( +Infinity, 4.0, 2.0 );
* // returns 1.0
*
* @example
* var y = cdf( -Infinity, 4.0, 2.0 );
* // returns 0.0
*
* @example
* var y = cdf( NaN, 0.0, 1.0 );
* // returns NaN
*
* @example
* var y = cdf( 0.0, NaN, 1.0 );
* // returns NaN
*
* @example
* var y = cdf( 0.0, 0.0, NaN );
* // returns NaN
*
* @example
* var y = cdf( 2.0, -1.0, 1.0 );
* // returns NaN
*
* @example
* var y = cdf( 2.0, 1.0, -1.0 );
* // returns NaN
*/

/**
* Evaluates the cumulative distribution function (CDF) for an F distribution with numerator degrees of freedom `d1` and denominator degrees of freedom `d2` at a value `x`.
*
* @param {number} x - input value
* @param {PositiveNumber} d1 - numerator degrees of freedom
* @param {PositiveNumber} d2 - denominator degrees of freedom
* @returns {Probability} evaluated CDF
*
* @example
* var y = cdf( 2.0, 1.0, 1.0 );
* // returns ~0.608
*
* @example
* var y = cdf( 2.0, 8.0, 4.0 );
* // returns ~0.737
*
* @example
* var y = cdf( -1.0, 2.0, 2.0 );
* // returns 0.0
*
* @example
* var y = cdf( +Infinity, 4.0, 2.0 );
* // returns 1.0
*
* @example
* var y = cdf( -Infinity, 4.0, 2.0 );
* // returns 0.0
*
* @example
* var y = cdf( NaN, 1.0, 1.0 );
* // returns NaN
*
* @example
* var y = cdf( 0.0, NaN, 1.0 );
* // returns NaN
*
* @example
* var y = cdf( 0.0, 1.0, NaN );
* // returns NaN
*
* @example
* var y = cdf( 2.0, 1.0, -1.0 );
* // returns NaN
*
* @example
* var y = cdf( 2.0, -1.0, 1.0 );
* // returns NaN
*/

/**
* Evaluates the incomplete beta function and its first derivative.
*
* @param {(Array|TypedArray|Object)} [out] - output array
* @param {Probability} x - function input
* @param {NonNegativeNumber} a - function parameter
* @param {NonNegativeNumber} b - function parameter
* @param {boolean} invert - boolean indicating if the function should return the upper tail of the incomplete beta function instead
* @param {boolean} normalized - boolean indicating if the function should evaluate the regularized boolean beta function
* @returns {(Array|TypedArray|Object)} function value and first derivative
*
* @example
* var out = kernelBetainc( 0.5, 2.0, 2.0, false, false );
* // returns [ ~0.083, ~1.5 ]
*
* @example
* var out = kernelBetainc( 0.2, 1.0, 2.0, true, false );
* // returns [ 0.32, 1.6 ]
*
* @example
* var arr = new Array( 2 );
* var out = kernelBetainc( arr, 0.2, 1.0, 2.0, true, true );
* // returns [ 0.64, 1.6 ]
*
* var bool = ( arr === out );
* // returns true
*/

/**
* Evaluates the incomplete beta function and its first derivative. This function divides up the input range and selects the right implementation method for each domain.
*
* @private
* @param {(Array|TypedArray|Object)} out - output array
* @param {Probability} x - function input
* @param {NonNegativeNumber} a - function parameter
* @param {NonNegativeNumber} b - function parameter
* @param {boolean} invert - boolean indicating if the function should return the upper tail of the incomplete beta function instead
* @param {boolean} normalized - boolean indicating if the function should evaluate the regularized boolean beta function
* @returns {(Array|TypedArray|Object)} function value and first derivative
*
* @example
* var out = ibetaImp( new Array( 2 ), 0.5, 2.0, 2.0, false, false );
* // returns [ ~0.083, ~1.5 ]
*
* @example
* var out = ibetaImp( new Array( 2 ), 0.2, 1.0, 2.0, true, false );
* // returns [ 0.32, 1.6 ]
*
* @example
* var out = ibetaImp( new Array( 2 ), 0.2, 1.0, 2.0, true, true );
* // returns [ 0.64, 1.6 ]
*/

/**
* Evaluates the incomplete beta function.
*
* @param {Probability} x - function parameter
* @param {NonNegativeNumber} a - function parameter
* @param {NonNegativeNumber} b - function parameter
* @param {boolean} [regularized=true] - boolean indicating if the function should evaluate the regularized or non-regularized incomplete beta function
* @param {boolean} [upper=false] - boolean indicating if the function should return the upper tail of the incomplete beta function
* @returns {number} function value
*
* @example
* var y = betainc( 0.5, 2.0, 2.0 );
* // returns 0.5
*
* @example
* var y = betainc( 0.5, 2.0, 2.0, false );
* // returns ~0.083
*
* @example
* var y = betainc( 0.2, 1.0, 2.0 );
* // returns 0.36
*/

/**
* Evaluates the incomplete beta via the continued fraction representation.
*
* @private
* @param {NonNegativeNumber} a - function parameter
* @param {NonNegativeNumber} b - function parameter
* @param {Probability} x - function parameter
* @param {Probability} y - probability equal to `1-x`
* @param {boolean} normalized - boolean indicating whether to evaluate the power terms of the regularized or non-regularized incomplete beta function
* @param {(Array|TypedArray|Object)} out - output array holding the derivative as the second element
* @returns {number} incomplete beta value
*/

/**
* Evaluates the inverse complementary error function.
*
* Note that
*
* ```tex
* \operatorname{erfc^{-1}}(1-z) = \operatorname{erf^{-1}}(z)
* ```
*
* ## Method
*
* 1.  For \\(|x| \leq 0.5\\), we evaluate the inverse error function using the rational approximation
*
*     ```tex
*     \operatorname{erf^{-1}}(x) = x(x+10)(\mathrm{Y} + \operatorname{R}(x))
*     ```
*
*     where \\(Y\\) is a constant and \\(\operatorname{R}(x)\\) is optimized for a low absolute error compared to \\(|Y|\\).
*
*     <!-- <note> -->
*
*     Max error \\(2.001849\mbox{e-}18\\). Maximum deviation found (error term at infinite precision) \\(8.030\mbox{e-}21\\).
*
*     <!-- </note> -->
*
* 2.  For \\(0.5 > 1-|x| \geq 0\\), we evaluate the inverse error function using the rational approximation
*
*     ```tex
*     \operatorname{erf^{-1}} = \frac{\sqrt{-2 \cdot \ln(1-x)}}{\mathrm{Y} + \operatorname{R}(1-x)}
*     ```
*
*     where \\(Y\\) is a constant, and \\(\operatorname{R}(q)\\) is optimized for a low absolute error compared to \\(Y\\).
*
*     <!-- <note> -->
*
*     Max error \\(7.403372\mbox{e-}17\\). Maximum deviation found (error term at infinite precision) \\(4.811\mbox{e-}20\\).
*
*     <!-- </note> -->
*
* 3.  For \\(1-|x| < 0.25\\), we have a series of rational approximations all of the general form
*
*     ```tex
*     p = \sqrt{-\ln(1-x)}
*     ```
*
*     Accordingly, the result is given by
*
*     ```tex
*     \operatorname{erf^{-1}}(x) = p(\mathrm{Y} + \operatorname{R}(p-B))
*     ```
*
*     where \\(Y\\) is a constant, \\(B\\) is the lowest value of \\(p\\) for which the approximation is valid, and \\(\operatorname{R}(x-B)\\) is optimized for a low absolute error compared to \\(Y\\).
*
*     <!-- <note> -->
*
*     Almost all code will only go through the first or maybe second approximation.  After that we are dealing with very small input values.
*
*     -   If \\(p < 3\\), max error \\(1.089051\mbox{e-}20\\).
*     -   If \\(p < 6\\), max error \\(8.389174\mbox{e-}21\\).
*     -   If \\(p < 18\\), max error \\(1.481312\mbox{e-}19\\).
*     -   If \\(p < 44\\), max error \\(5.697761\mbox{e-}20\\).
*     -   If \\(p \geq 44\\), max error \\(1.279746\mbox{e-}20\\).
*
*     <!-- </note> -->
*
*     <!-- <note> -->
*
*     The Boost library can accommodate \\(80\\) and \\(128\\) bit long doubles. JavaScript only supports a \\(64\\) bit double (IEEE 754). Accordingly, the smallest \\(p\\) (in JavaScript at the time of this writing) is \\(\sqrt{-\ln(\sim5\mbox{e-}324)} = 27.284429111150214\\).
*
*     <!-- </note> -->
*
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var y = erfcinv( 0.5 );
* // returns ~0.4769
*
* @example
* var y = erfcinv( 0.8 );
* // returns ~0.1791
*
* @example
* var y = erfcinv( 0.0 );
* // returns Infinity
*
* @example
* var y = erfcinv( 2.0 );
* // returns -Infinity
*
* @example
* var y = erfcinv( NaN );
* // returns NaN
*/

/**
* Evaluates the inverse error function.
*
* ## Method
*
* 1.  For \\(|x| \leq 0.5\\), we evaluate the inverse error function using the rational approximation
*
*     ```tex
*     \operatorname{erf^{-1}}(x) = x(x+10)(\mathrm{Y} + \operatorname{R}(x))
*     ```
*
*     where \\(Y\\) is a constant and \\(\operatorname{R}(x)\\) is optimized for a low absolute error compared to \\(|Y|\\).
*
*     <!-- <note> -->
*
*     Max error \\(2.001849\mbox{e-}18\\). Maximum deviation found (error term at infinite precision) \\(8.030\mbox{e-}21\\).
*
*     <!-- </note> -->
*
* 2.  For \\(0.5 > 1-|x| \geq 0\\), we evaluate the inverse error function using the rational approximation
*
*     ```tex
*     \operatorname{erf^{-1}} = \frac{\sqrt{-2 \cdot \ln(1-x)}}{\mathrm{Y} + \operatorname{R}(1-x)}
*     ```
*
*     where \\(Y\\) is a constant, and \\(\operatorname{R}(q)\\) is optimized for a low absolute error compared to \\(Y\\).
*
*     <!-- <note> -->
*
*     Max error \\(7.403372\mbox{e-}17\\). Maximum deviation found (error term at infinite precision) \\(4.811\mbox{e-}20\\).
*
*     <!-- </note> -->
*
* 3.  For \\(1-|x| < 0.25\\), we have a series of rational approximations all of the general form
*
*     ```tex
*     p = \sqrt{-\ln(1-x)}
*     ```
*
*     Accordingly, the result is given by
*
*     ```tex
*     \operatorname{erf^{-1}}(x) = p(\mathrm{Y} + \operatorname{R}(p-B))
*     ```
*
*     where \\(Y\\) is a constant, \\(B\\) is the lowest value of \\(p\\) for which the approximation is valid, and \\(\operatorname{R}(x-B)\\) is optimized for a low absolute error compared to \\(Y\\).
*
*     <!-- <note> -->
*
*     Almost all code will only go through the first or maybe second approximation.  After that we are dealing with very small input values.
*
*     -   If \\(p < 3\\), max error \\(1.089051\mbox{e-}20\\).
*     -   If \\(p < 6\\), max error \\(8.389174\mbox{e-}21\\).
*     -   If \\(p < 18\\), max error \\(1.481312\mbox{e-}19\\).
*     -   If \\(p < 44\\), max error \\(5.697761\mbox{e-}20\\).
*     -   If \\(p \geq 44\\), max error \\(1.279746\mbox{e-}20\\).
*
*     <!-- </note> -->
*
*     <!-- <note> -->
*
*     The Boost library can accommodate \\(80\\) and \\(128\\) bit long doubles. JavaScript only supports a \\(64\\) bit double (IEEE 754). Accordingly, the smallest \\(p\\) (in JavaScript at the time of this writing) is \\(\sqrt{-\ln(\sim5\mbox{e-}324)} = 27.284429111150214\\).
*
*     <!-- </note> -->
*
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var y = erfinv( 0.5 );
* // returns ~0.4769
*
* @example
* var y = erfinv( 0.8 );
* // returns ~0.9062
*
* @example
* var y = erfinv( 0.0 );
* // returns 0.0
*
* @example
* var y = erfinv( -0.0 );
* // returns -0.0
*
* @example
* var y = erfinv( -1.0 );
* // returns -Infinity
*
* @example
* var y = erfinv( 1.0 );
* // returns Infinity
*
* @example
* var y = erfinv( NaN );
* // returns NaN
*/

/**
* Evaluates the natural logarithm of \\(1+x\\).
*
* ## Method
*
* 1.  Argument Reduction: find \\(k\\) and \\(f\\) such that
*
*     ```tex
*     1+x = 2^k (1+f)
*     ```
*
*     where
*
*     ```tex
*     \frac{\sqrt{2}}{2} < 1+f < \sqrt{2}
*     ```
*
*     <!-- <note> -->
*
*     If \\(k=0\\), then \\(f=x\\) is exact. However, if \\(k \neq 0\\), then \\(f\\) may not be representable exactly. In that case, a correction term is needed. Let
*
*     ```tex
*     u = \operatorname{round}(1+x)
*     ```
*
*     and
*
*     ```tex
*     c = (1+x) - u
*     ```
*
*     then
*
*     ```tex
*     \ln (1+x) - \ln u \approx \frac{c}{u}
*     ```
*
*     We can thus proceed to compute \\(\ln(u)\\), and add back the correction term \\(c/u\\).
*
*     <!-- </note> -->
*
*     <!-- <note> -->
*
*     When \\(x > 2^{53}\\), one can simply return \\(\ln(x)\\).
*
*     <!-- </note> -->
*
* 2.  Approximation of \\(\operatorname{log1p}(f)\\). Let
*
*     ```tex
*     s = \frac{f}{2+f}
*     ```
*
*     based on
*
*     ```tex
*     \begin{align*}
*     \ln 1+f &= \ln (1+s) - \ln (1-s) \\
*             &= 2s + \frac{2}{3} s^3 + \frac{2}{5} s^5 + ... \\
*             &= 2s + sR \\
*     \end{align*}
*     ```
*
*     We use a special Reme algorithm on \\(\[0,0.1716\]\\) to generate a polynomial of degree \\(14\\) to approximate \\(R\\). The maximum error of this polynomial approximation is bounded by \\(2^{-58.45}\\). In other words,
*
*     ```tex
*     R(z) \approx \mathrm{Lp}_1 s^2 + \mathrm{Lp}_2 s^4 + \mathrm{Lp}_3 s^6 + \mathrm{Lp}_4 s^8 + \mathrm{Lp}_5 s^{10} + \mathrm{Lp}_6 s^{12} + \mathrm{Lp}_7 s^{14}
*     ```
*
*     and
*
*     ```tex
*     | \mathrm{Lp}_1 s^2 + \ldots + \mathrm{Lp}_7 s^14 - R(z) | \leq 2^{-58.45}
*     ```
*
*     <!-- <note> -->
*
*     The values of \\(Lp1\\) to \\(Lp7\\) may be found in the source.
*
*     <!-- </note> -->
*
*     Note that
*
*     ```tex
*     \begin{align*}
*     2s &= f - sf \\
*        &= f - \frac{f^2}{2} + s \frac{f^2}{2} \\
*     \end{align*}
*     ```
*
*     In order to guarantee error in \\(\ln\\) below \\(1\ \mathrm{ulp}\\), we compute the log by
*
*     ```tex
*     \operatorname{log1p}(f) = f - \biggl(\frac{f^2}{2} - s\biggl(\frac{f^2}{2}+R\biggr)\biggr)
*     ```
*
* 3.  Finally,
*
*     ```tex
*     \begin{align*}
*     \operatorname{log1p}(x) &= k \cdot \mathrm{ln2} + \operatorname{log1p}(f) \\
*     &= k \cdot \mathrm{ln2}_{hi}+\biggl(f-\biggl(\frac{f^2}{2}-\biggl(s\biggl(\frac{f^2}{2}+R\biggr)+k \cdot \mathrm{ln2}_{lo}\biggr)\biggr)\biggr) \\
*     \end{align*}
*     ```
*
*     Here \\(\mathrm{ln2}\\) is split into two floating point numbers:
*
*     ```tex
*     \mathrm{ln2}_{hi} + \mathrm{ln2}_{lo}
*     ```
*
*     where \\(n \cdot \mathrm{ln2}_{hi}\\) is always exact for \\(|n| < 2000\\).
*
*
* ## Special Cases
*
* -   \\(\operatorname{log1p}(x) = \mathrm{NaN}\\) with signal if \\(x < -1\\) (including \\(-\infty\\))
* -   \\(\operatorname{log1p}(+\infty) = +\infty\\)
* -   \\(\operatorname{log1p}(-1) = -\infty\\) with signal
* -   \\(\operatorname{log1p}(\mathrm{NaN})= \mathrm{NaN}\\) with no signal
*
*
* ## Notes
*
* -   According to an error analysis, the error is always less than \\(1\\) ulp (unit in the last place).
*
* -   The hexadecimal values are the intended ones for the used constants. The decimal values may be used, provided that the compiler will convert from decimal to binary accurately enough to produce the hexadecimal values shown.
*
* -   Assuming \\(\ln(x)\\) is accurate, the following algorithm can be used to evaluate \\(\operatorname{log1p}(x)\\) to within a few ULP:
*
*     ```javascript
*     var u = 1.0 + x;
*     if ( u === 1.0 ) {
*         return x;
*     } else {
*         return ln(u) * (x/(u-1.0));
*     }
*     ```
*
*     See HP-15C Advanced Functions Handbook, p.193.
*
*
* @param {number} x - input value
* @returns {number} the natural logarithm of `1+x`
*
* @example
* var v = log1p( 4.0 );
* // returns ~1.609
*
* @example
* var v = log1p( -1.0 );
* // returns -Infinity
*
* @example
* var v = log1p( 0.0 );
* // returns 0.0
*
* @example
* var v = log1p( -0.0 );
* // returns -0.0
*
* @example
* var v = log1p( -2.0 );
* // returns NaN
*
* @example
* var v = log1p( NaN );
* // returns NaN
*/

/**
* Evaluates the natural logarithm of the gamma function for small arguments.
*
* ## Method
*
* 1.  For \\( z > 2 \\), begin by performing argument reduction until \\( z \\) is in \\(\[2,3)\\). Use the following form:
*
*     ```tex
*     \operatorname{gammaln}(z) = (z-2)(z+1)(Y + R(z-2))
*     ```
*
*     where \\( R(z-2) \\) is a rational approximation optimized for low absolute error. As long as the absolute error is small compared to the constant \\( Y \\), then any rounding error in the computation will get wiped out.
*
* 2.  If \\( z < 1 \\), use recurrence to shift to \\( z \\) in the interval \\(\[1,2\]\\). Then, use one of two approximations: one for \\( z \\) in \\(\[1,1.5\]\\) and one for \\( z \\) in \\(\[1.5,2\]\\):
*
*     -   For \(( z \\) in \\(\[1,1.5\]\\), use
*
*         ```tex
*         \operatorname{gammaln}(z) = (z-1)(z-2)(Y + R(z-1))
*         ```
*
*         where \\( R(z-1) \\) is a rational approximation optimized for low absolute error. As long as the absolute error is small compared to the constant \\( Y \\), then any rounding error in the computation will get wiped out.
*
*     -   For \\( z \\) in \\(\[1.5,2\]\\), use
*
*         ```tex
*         \operatorname{gammaln}(z) = (2-z)(1-z)(Y + R(2-z))
*         ```
*
*         where \\( R(2-z) \\) is a rational approximation optimized for low absolute error. As long as the absolute error is small compared to the constant \\( Y \\), then any rounding error in the computation will get wiped out.
*
*
* ## Notes
*
* -   Relative error:
*
*     | function | peak         | maximum deviation |
*     |:--------:|:------------:|:-----------------:|
*     | R(Z-2)   | 4.231e-18    | 5.900e-24         |
*     | R(Z-1)   | 1.230011e-17 | 3.139e-021        |
*     | R(2-Z)   | 1.797565e-17 | 2.151e-021        |
*
*
* @private
* @param {number} z - input value
* @param {number} zm1 - `z` minus one
* @param {number} zm2 - `z` minus two
* @returns {number} function value
*/

/**
* Evaluates the natural logarithm of the gamma function.
*
* ## Method
*
* 1.  Argument reduction for \\(0 < x \leq 8\\). Since \\(\Gamma(1+s) = s \Gamma(s)\\), for \\(x \in \[0,8]\\), we may reduce \\(x\\) to a number in \\(\[1.5,2.5]\\) by
*
*     ```tex
*     \operatorname{lgamma}(1+s) = \ln(s) + \operatorname{lgamma}(s)
*     ```
*
*     For example,
*
*     ```tex
*     \begin{align*}
*     \operatorname{lgamma}(7.3) &= \ln(6.3) + \operatorname{lgamma}(6.3) \\
*     &= \ln(6.3 \cdot 5.3) + \operatorname{lgamma}(5.3) \\
*     &= \ln(6.3 \cdot 5.3 \cdot 4.3 \cdot 3.3 \cdot2.3) + \operatorname{lgamma}(2.3)
*     \end{align*}
*     ```
*
* 2.  Compute a polynomial approximation of \\(\mathrm{lgamma}\\) around its minimum (\\(\mathrm{ymin} = 1.461632144968362245\\)) to maintain monotonicity. On the interval \\(\[\mathrm{ymin} - 0.23, \mathrm{ymin} + 0.27]\\) (i.e., \\(\[1.23164,1.73163]\\)), we let \\(z = x - \mathrm{ymin}\\) and use
*
*     ```tex
*     \operatorname{lgamma}(x) = -1.214862905358496078218 + z^2 \cdot \operatorname{poly}(z)
*     ```
*
*     where \\(\operatorname{poly}(z)\\) is a \\(14\\) degree polynomial.
*
* 3.  Compute a rational approximation in the primary interval \\(\[2,3]\\). Let \\( s = x - 2.0 \\). We can thus use the approximation
*
*     ```tex
*     \operatorname{lgamma}(x) = \frac{s}{2} + s\frac{\operatorname{P}(s)}{\operatorname{Q}(s)}
*     ```
*
*     with accuracy
*
*     ```tex
*     \biggl|\frac{\mathrm{P}}{\mathrm{Q}} - \biggr(\operatorname{lgamma}(x)-\frac{s}{2}\biggl)\biggl| < 2^{-61.71}
*     ```
*
*     The algorithms are based on the observation
*
*     ```tex
*     \operatorname{lgamma}(2+s) = s(1 - \gamma) + \frac{\zeta(2) - 1}{2} s^2 - \frac{\zeta(3) - 1}{3} s^3 + \ldots
*     ```
*
*     where \\(\zeta\\) is the zeta function and \\(\gamma = 0.5772156649...\\) is the Euler-Mascheroni constant, which is very close to \\(0.5\\).
*
* 4.  For \\(x \geq 8\\),
*
*     ```tex
*     \operatorname{lgamma}(x) \approx \biggl(x-\frac{1}{2}\biggr) \ln(x) - x + \frac{\ln(2\pi)}{2} + \frac{1}{12x} - \frac{1}{360x^3} + \ldots
*     ```
*
*     which can be expressed
*
*     ```tex
*     \operatorname{lgamma}(x) \approx \biggl(x-\frac{1}{2}\biggr)(\ln(x)-1)-\frac{\ln(2\pi)-1}{2} + \ldots
*     ```
*
*     Let \\(z = \frac{1}{x}\\). We can then use the approximation
*
*     ```tex
*     f(z) = \operatorname{lgamma}(x) - \biggl(x-\frac{1}{2}\biggr)(\ln(x)-1)
*     ```
*
*     by
*
*     ```tex
*     w = w_0 + w_1 z + w_2 z^3 + w_3 z^5 + \ldots + w_6 z^{11}
*     ```
*
*     where
*
*     ```tex
*     |w - f(z)| < 2^{-58.74}
*     ```
*
* 5.  For negative \\(x\\), since
*
*     ```tex
*     -x \Gamma(-x) \Gamma(x) = \frac{\pi}{\sin(\pi x)}
*     ```
*
*     where \\(\Gamma\\) is the gamma function, we have
*
*     ```tex
*     \Gamma(x) = \frac{\pi}{\sin(\pi x)(-x)\Gamma(-x)}
*     ```
*
*     Since \\(\Gamma(-x)\\) is positive,
*
*     ```tex
*     \operatorname{sign}(\Gamma(x)) = \operatorname{sign}(\sin(\pi x))
*     ```
*
*     for \\(x < 0\\). Hence, for \\(x < 0\\),
*
*     ```tex
*     \mathrm{signgam} = \operatorname{sign}(\sin(\pi x))
*     ```
*
*     and
*
*     ```tex
*     \begin{align*}
*     \operatorname{lgamma}(x) &= \ln(|\Gamma(x)|) \\
*     &= \ln\biggl(\frac{\pi}{|x \sin(\pi x)|}\biggr) - \operatorname{lgamma}(-x)
*     \end{align*}
*     ```
*
*     <!-- <note> -->
*
*     Note that one should avoid computing \\(\pi (-x)\\) directly in the computation of \\(\sin(\pi (-x))\\).
*
*     <!-- </note> -->
*
*
* ## Special Cases
*
* ```tex
* \begin{align*}
* \operatorname{lgamma}(2+s) &\approx s (1-\gamma) & \mathrm{for\ tiny\ s} \\
* \operatorname{lgamma}(x) &\approx -\ln(x) & \mathrm{for\ tiny\ x} \\
* \operatorname{lgamma}(1) &= 0 & \\
* \operatorname{lgamma}(2) &= 0 & \\
* \operatorname{lgamma}(0) &= \infty & \\
* \operatorname{lgamma}(\infty) &= \infty & \\
* \operatorname{lgamma}(-\mathrm{integer}) &= \pm \infty
* \end{align*}
* ```
*
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var v = gammaln( 1.0 );
* // returns 0.0
*
* @example
* var v = gammaln( 2.0 );
* // returns 0.0
*
* @example
* var v = gammaln( 4.0 );
* // returns ~1.792
*
* @example
* var v = gammaln( -0.5 );
* // returns ~1.266
*
* @example
* var v = gammaln( 0.5 );
* // returns ~0.572
*
* @example
* var v = gammaln( 0.0 );
* // returns Infinity
*
* @example
* var v = gammaln( NaN );
* // returns NaN
*/

/**
* Evaluates the probability density function (PDF) for a degenerate distribution centered at `mu`.
*
* @param {number} x - input value
* @param {number} mu - constant value of the distribution
* @returns {number} evaluated probability density function
*
* @example
* var y = pdf( 2.0, 3.0 );
* // returns 0.0
*
* @example
* var y = pdf( 3.0, 3.0 );
* // returns Infinity
*
* @example
* var y = pdf( NaN, 0.0 );
* // returns NaN
*
* @example
* var y = pdf( 0.0, NaN );
* // returns NaN
*/

/**
* Evaluates the probability density function (PDF) for a normal distribution with mean `mu` and standard deviation `sigma` at a value `x`.
*
* @param {number} x - input value
* @param {number} mu - mean
* @param {NonNegativeNumber} sigma - standard deviation
* @returns {number} evaluated probability density function
*
* @example
* var y = pdf( 2.0, 0.0, 1.0 );
* // returns ~0.054
*
* @example
* var y = pdf( -1.0, 4.0, 2.0 );
* // returns ~0.009
*
* @example
* var y = pdf( NaN, 0.0, 1.0 );
* // returns NaN
*
* @example
* var y = pdf( 0.0, NaN, 1.0 );
* // returns NaN
*
* @example
* var y = pdf( 0.0, 0.0, NaN );
* // returns NaN
*
* @example
* // Negative standard deviation:
* var y = pdf( 2.0, 0.0, -1.0 );
* // returns NaN
*
* @example
* var y = pdf( 2.0, 8.0, 0.0 );
* // returns 0.0
*
* @example
* var y = pdf( 8.0, 8.0, 0.0 );
* // returns Infinity
*/

/**
* Evaluates the probability density function (PDF) for a uniform distribution with minimum support `a` and maximum support `b` at a value `x`.
*
* @param {number} x - input value
* @param {number} a - minimum support
* @param {number} b - maximum support
* @returns {number} evaluated PDF
*
* @example
* var y = pdf( 2.0, 0.0, 4.0 );
* // returns 0.25
*
* @example
* var y = pdf( 5.0, 0.0, 4.0 );
* // returns 0.0
*
* @example
* var y = pdf( 0.25, 0.0, 1.0 );
* // returns 1.0
*
* @example
* var y = pdf( NaN, 0.0, 1.0 );
* // returns NaN
*
* @example
* var y = pdf( 0.0, NaN, 1.0 );
* // returns NaN
*
* @example
* var y = pdf( 0.0, 0.0, NaN );
* // returns NaN
*
* @example
* var y = pdf( 2.0, 3.0, 1.0 );
* // returns NaN
*/

/**
* Evaluates the probability density function (PDF) for an exponential distribution with rate parameter `lambda` at a value `x`.
*
* @param {number} x - input value
* @param {PositiveNumber} lambda - rate parameter
* @returns {number} evaluated PDF
*
* @example
* var y = pdf( 0.3, 4.0 );
* // returns ~1.205
*
* @example
* var y = pdf( 2.0, 0.7 );
* // returns ~0.173
*
* @example
* var y = pdf( -1.0, 0.5 );
* // returns 0.0
*
* @example
* var y = pdf( 0, NaN );
* // returns NaN
*
* @example
* var y = pdf( NaN, 2.0 );
* // returns NaN
*
* @example
* // Negative rate:
* var y = pdf( 2.0, -1.0 );
* // returns NaN
*/

/**
* Evaluates the probability mass function (PMF) for a Bernoulli distribution with success probability `p` at a value `x`.
*
* @param {number} x - input value
* @param {Probability} p - success probability
* @returns {Probability} evaluated PMF
*
* @example
* var y = pmf( 1.0, 0.3 );
* // returns 0.3
*
* @example
* var y = pmf( 0.0, 0.3 );
* // returns 0.7
*
* @example
* var y = pmf( -1.0, 0.5 );
* // returns 0.0
*
* @example
* var y = pmf( 0.8, 0.5 );
* // returns 0.0
*
* @example
* var y = pmf( 0.0, NaN );
* // returns NaN
*
* @example
* var y = pmf( NaN, 0.5 );
* // returns NaN
*
* @example
* // Invalid success probability:
* var y = pmf( 1.0, 1.5 );
* // returns NaN
*/

/**
* Evaluates the quantile function for a Student's t distribution with degrees of freedom `v` at a probability `p`.
*
* @param {Probability} p - input value
* @param {PositiveNumber} v - degrees of freedom
* @returns {number} evaluated quantile function
*
* @example
* var y = quantile( 0.8, 1.0 );
* // returns ~1.376
*
* @example
* var y = quantile( 0.1, 1.0 );
* // returns ~-3.078
*
* @example
* var y = quantile( 0.5, 0.1 );
* // returns 0.0
*
* @example
* var y = quantile( -0.2, 0.1 );
* // returns NaN
*
* @example
* var y = quantile( NaN, 1.0 );
* // returns NaN
*
* @example
* var y = quantile( 0.0, NaN );
* // returns NaN
*
* @example
* var y = quantile( 0.5, -1.0 );
* // returns NaN
*/

/**
* Evaluates the quantile function for a degenerate distribution centered at `mu`.
*
* @param {Probability} p - input value
* @param {number} mu - constant value of the distribution
* @returns {number} evaluated quantile function
*
* @example
* var y = quantile( 0.5, 2.0 );
* // returns 2.0
*
* @example
* var y = quantile( 0.9, 4.0 );
* // returns 4.0
*
* @example
* var y = quantile( 1.1, 0.0 );
* // returns NaN
*
* @example
* var y = quantile( -0.2, 0.0 );
* // returns NaN
*
* @example
* var y = quantile( NaN, 0.0 );
* // returns NaN
*
* @example
* var y = quantile( 0.0, NaN );
* // returns NaN
*/

/**
* Evaluates the quantile function for a normal distribution with mean `mu` and standard deviation `sigma` at a probability `p`.
*
* @param {Probability} p - input value
* @param {number} mu - mean
* @param {NonNegativeNumber} sigma - standard deviation
* @returns {number} evaluated quantile function
*
* @example
* var y = quantile( 0.8, 0.0, 1.0 );
* // returns ~0.842
*
* @example
* var y = quantile( 0.5, 4.0, 2.0 );
* // returns 4.0
*
* @example
* var y = quantile( 1.1, 0.0, 1.0 );
* // returns NaN
*
* @example
* var y = quantile( -0.2, 0.0, 1.0 );
* // returns NaN
*
* @example
* var y = quantile( NaN, 0.0, 1.0 );
* // returns NaN
*
* @example
* var y = quantile( 0.0, NaN, 1.0 );
* // returns NaN
*
* @example
* var y = quantile( 0.0, 0.0, NaN );
* // returns NaN
*
* @example
* // Negative standard deviation:
* var y = quantile( 0.5, 0.0, -1.0 );
* // returns NaN
*/

/**
* Evaluates the signum function.
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var sign = signum( -5.0 );
* // returns -1.0
*
* @example
* var sign = signum( 5.0 );
* // returns 1.0
*
* @example
* var sign = signum( -0.0 );
* // returns -0.0
*
* @example
* var sign = signum( 0.0 );
* // returns 0.0
*
* @example
* var sign = signum( NaN );
* // returns NaN
*/

/**
* Exclusion test for all predictors not in active set. If one or more predictors fail the test, they are included in the active set.
*
* @returns {boolean} returns true if active set was changed, false otherwise
*/

/**
* Expands a strides array to accommodate an expanded array shape (i.e., an array shape with prepended singleton dimensions).
*
* @private
* @param {NonNegativeInteger} ndims - number of dimensions
* @param {Array} shape - expanded array shape
* @param {Array} strides - strides array
* @param {string} order - memory layout order
* @returns {Array} output strides array
*
* @example
* var out = expandStrides( 4, [ 1, 1, 2, 2 ], [ 1, 2 ], 'column-major' );
* // returns [ 1, 1, 1, 2 ]
*
* @example
* var out = expandStrides( 4, [ 1, 1, 2, 2 ], [ 2, 1 ], 'row-major' );
* // returns [ 4, 4, 2, 1 ]
*/

/**
* Exponential distribution probability density function (PDF).
*
* @module @stdlib/stats/base/dists/exponential/pdf
*
* @example
* var pdf = require( '@stdlib/stats/base/dists/exponential/pdf' );
*
* var y = pdf( 0.3, 4.0 );
* // returns ~1.205
*
* var myPDF = pdf.factory( 0.5 );
*
* y = myPDF( 3.0 );
* // returns ~0.112
*
* y = myPDF( 1.0 );
* // returns ~0.303
*/

/**
* FUNCTION: argmax( arr )
*	Computes the maximum value of a numeric array and returns the corresponding array indices.
*
* @param {Array} arr - array of values
* @returns {Array} array indices
*/

/**
* FUNCTION: chebyshev( x, y[, accessor] )
*	Computes the Chebyshev distance between two arrays.
*
* @param {Number[]|Array} x - input array
* @param {Number[]|Array} y - input array
* @param {Function} [accessor] - accessor function for accessing array values
* @returns {Number|Null} Chebyshev distance or null
*/

/**
* FUNCTION: chunkify( arr, n[, opts] )
*	Segments an array into chunks.
*
* @param {Array} arr - array to be chunked
* @param {Number} n - chunk size
* @param {Object} [opts] - function options
* @param {Number} [opts.start] - array index from which to begin chunking (default: 0)
* @param {Boolean} [opts.truncate] - indicates whether last chunk should be truncated if it contains padded values (default: false)
* @param {Boolean} [opts.padding] - indicates whether chunks should be allowed to contain padded values (default: true)
* @param {*} [opts.padding_value] - value used for padding (default: null)
* @param {Number} [opts.delay] - integer specifying the number of padded values to add to the first chunk (default: 0)
* @param {Number} [opts.overlap] - integer specifying extent of chunk overlap/underlap (default: 0)
* @returns {Array} array of chunks
*/

/**
* FUNCTION: distance( x, y[, accessor] )
*	Computes the cosine distance between two arrays.
*
* @param {Number[]|Array} x - input array
* @param {Number[]|Array} y - input array
* @param {Function} [accessor] - accessor function for accessing array values
* @returns {Number|Null} Cosine distance
*/

/**
* FUNCTION: dot( x, y[, accessor] )
*	Computes the dot product between two arrays.
*
* @param {Array} x - input array
* @param {Array} y - input array
* @param {Function} [accessor] - accessor function for accessing array values
* @returns {Number|Null} dot product
*/

/**
* FUNCTION: euclidean( x, y[, accessor] )
*	Computes the Euclidean distance between two arrays.
*
* @param {Number[]|Array} x - input array
* @param {Number[]|Array} y - input array
* @param {Function} [accessor] - accessor function for accessing array values
* @returns {Number|Null} Euclidean distance or null
*/

/**
* FUNCTION: hamming( a, b, accessor )
*	Computes the Hamming distance between two sequences.
*
* @param {String|Array} a - array or string sequence
* @param {String|Array} b - array or string sequence
* @param {Function} [accessor] - accessor function for accessing array values
* @returns {Number} Hamming distance
*/

/**
* FUNCTION: isArray( value )
*	Validates if a value is an array.
*
* @param {*} value - value to be validated
* @returns {Boolean} boolean indicating whether value is an array
*/

/**
* FUNCTION: isFunction( value )
*	Validates if a value is a function.
*
* @param {*} value - value to be validated
* @returns {Boolean} boolean indicating whether value is a function
*/

/**
* FUNCTION: isInteger( value )
*	Validates if a value is an integer.
*
* @param {Number} value - value to be validated
* @returns {Boolean} boolean indicating whether value is an integer
*/

/**
* FUNCTION: isNumber( value )
*	Validates if a value is a number.
*
* @param {*} value - value to be validated
* @returns {Boolean} boolean indicating whether value is a number
*/

/**
* FUNCTION: isObject( value )
*	Validates if a value is a object; e.g., {}.
*
* @param {*} value - value to be validated
* @returns {Boolean} boolean indicating whether value is a object
*/

/**
* FUNCTION: isString( value )
*	Validates if a value is a string.
*
* @param {*} value - value to be validated
* @returns {Boolean} boolean indicating whether value is a string
*/

/**
* FUNCTION: l2norm( arr[, accessor] )
*	Calculates the L2 norm (Euclidean norm) of an array.
*
* @param {Array} arr - input array
* @param {Function} [accessor] - accessor function for accessing array values
* @returns {Number|Null} L2 norm or null
*/

/**
* FUNCTION: manhattan( x, y[, accessor] )
*	Computes the Manhattan distance between two arrays.
*
* @param {Number[]|Array} x - input array
* @param {Number[]|Array} y - input array
* @param {Function} [accessor] - accessor function for accessing array values
* @returns {Number|Null} Manhattan distance or null
*/

/**
* FUNCTION: similarity( x, y[, accessor] )
*	Computes the cosine similarity between two arrays.
*
* @param {Number[]|Array} x - input array
* @param {Number[]|Array} y - input array
* @param {Function} [accessor] - accessor function for accessing array values
* @returns {Number|Null} cosine similarity or null
*/

/**
* FUNCTION: validate( arr, n, opts )
*	Validates `chunkify` arguments.
*
* @param {Array} arr - input array
* @param {Number} n - chunk size
* @param {Object} opts - options object
*/

/**
* Fills an array-like object with zeros.
*
* @private
* @param {(Array|TypedArray|Buffer)} v - array-like object to fill
* @returns {(Array|TypedArray|Buffer)} input value
*
* @example
* var arr = zeros( new Array( 2 ) );
* // returns [ 0, 0 ]
*/

/**
* Finding value which is most frequent in an array.
*
* @param values - array of values
*/

/**
* Fit lasso regression via coordinate descent.
*
* @param {Matrix|Array} x - design matrix
* @param {NumberArray} y - response vector
* @param {number} lambda - L1 penalty value
* @returns {Object} regression model
*/

/**
* Fit the data under the assumption that p(x_i|c) follows a multinomial distribution.
*
* ## Notes
*
* -   Assigns prior and conditional probabilities of BayesFit instance.
*
* @param {Matrix} x - design matrix
* @param {Array} y - vector of class memberships
* @returns {Void}
*/

/**
* Fit the data under the assumption that p(x_i|c) follows a normal distribution.
*
* ## Notes
*
* -   Assigns prior and conditional probabilities of BayesFit instance.
*
* @param {Matrix} x - design matrix
* @param {Array} y - vector of class memberships
* @returns {void}
*/

/**
* Fits a Gaussian naive Bayes model.
*
* @param {(Matrix|Array)} x - design matrix
* @param {Array} y - vector of class memberships
* @returns {GaussianFit} model fit
*/

/**
* Fits a multinomial naive Bayes model.
*
* @param {(Matrix|Array)} x - design matrix
* @param {Array} y - vector of class memberships
* @param {Object} [opts] - function options
* @param {number} [opts.alpha] - Laplace smoothing parameter
* @returns {MultinomialFit} MultinomialFit instance
*/

/**
* Flatten an array.
*
* @module @stdlib/utils/flatten-array
*
* @example
* var flattenArray = require( '@stdlib/utils/flatten-array' );
*
* var arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ];
*
* var out = flattenArray( arr );
* // returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
*
* @example
* var flattenArray = require( '@stdlib/utils/flatten-array' );
*
* var flatten = flattenArray.factory( [2,2], {
*     'copy': false
* });
*
* var out = flatten( [[1,2],[3,4]] );
* // returns [ 1, 2, 3, 4 ]
*
* out = flatten( [[5,6],[7,8]] );
* // returns [ 5, 6, 7, 8 ]
*/

/**
* Flattens an array.
*
* @param {Array} arr - input array
* @param {Options} [options] - function options
* @param {NonNegativeInteger} [options.depth] - maximum depth to flatten
* @param {boolean} [options.copy=false] - boolean indicating whether to deep copy array elements
* @throws {TypeError} first argument must be an array
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {Array} flattened array
*
* @example
* var arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ];
*
* var out = flattenArray( arr );
* // returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
*/

/**
* For integer arguments we can relate the incomplete beta to the complement of the binomial distribution cdf and use this finite sum.
*
* @private
* @param {NonNegativeInteger} n - number of trials
* @param {NonNegativeInteger} k - function input
* @param {Probability} x - function input
* @param {Probability} y - probability equal to `1-x`
* @returns {number} sum
*/

/**
* Function for building classification decision tree.
*/

/**
* Function to make shapes from breakpoints.
*/

/**
* Gamma distribution cumulative distribution function (CDF).
*
* @module @stdlib/stats/base/dists/gamma/cdf
*
* @example
* var cdf = require( '@stdlib/stats/base/dists/gamma/cdf' );
*
* var y = cdf( 2.0, 8.0, 3.0 );
* // returns ~0.256
*
* y = cdf( 0.0, 1.0, 1.0 );
* // returns 0.0
*
* var mycdf = cdf.factory( 2.0, 0.5 );
* y = mycdf( 6.0 );
* // returns ~0.801
*
* y = mycdf( 2.0 );
* // returns ~0.264
*/

/**
* Generate a linearly spaced numeric array.
*
* @module @stdlib/math/utils/linspace
*
* @example
* var linspace = require( '@stdlib/math/utils/linspace' );
*
* var arr = linspace( 0, 100, 6 );
* // returns [ 0, 20, 40, 60, 80, 100 ]
*/

/**
* Generate a stride array from an array shape.
*
* @module @stdlib/ndarray/base/shape2strides
*
* @example
* var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
*
* var strides = shape2strides( [ 3, 2 ], 'row-major' );
* // returns [ 2, 1 ]
*
* strides = shape2strides( [ 3, 2 ], 'column-major' );
* // returns [ 1, 3 ]
*/

/**
* Generates a full table of safe casts for each ndarray data type.
*
* @private
* @returns {Object} table
*/

/**
* Generates a full table of same "kind" casts for each ndarray data type.
*
* @private
* @returns {Object} table
*/

/**
* Generates a function for evaluating a polynomial.
*
* ## Notes
*
* -   The compiled function uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: http://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @param {NumericArray} c - polynomial coefficients sorted in ascending degree
* @returns {Function} function for evaluating a polynomial
*
* @example
* var polyval = factory( [3.0,2.0,1.0] );
*
* var v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2
* // returns 123.0
*
* v = polyval( 5.0 ); // => 3*5^0 + 2*5^1 + 1*5^2
* // returns 38.0
*/

/**
* Generates a linearly spaced numeric array.
*
* @param {number} x1 - first array value
* @param {number} x2 - last array value
* @param {NonNegativeInteger} [len=100] - length of output array
* @throws {TypeError} first argument must be numeric
* @throws {TypeError} second argument must be numeric
* @throws {TypeError} third argument must be a nonnegative integer
* @returns {Array} linearly spaced numeric array
*
* @example
* var arr = linspace( 0, 100, 6 );
* // returns [ 0, 20, 40, 60, 80, 100 ]
*/

/**
* Generates a stride array from an array shape.
*
* @param {(Array|TypedArray|Object)} [out] - output object
* @param {NonNegativeIntegerArray} shape - array shape
* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)
* @returns {(Array|TypedArray|Object)} array strides
*
* @example
* var strides = shape2strides( [ 3, 2 ], 'row-major' );
* // returns [ 2, 1 ]
*
* strides = shape2strides( [ 3, 2 ], 'column-major' );
* // returns [ 1, 3 ]
*/

/**
* Generates a stride array from an array shape.
*
* @private
* @param {(Array|TypedArray|Object)} out - output object
* @param {NonNegativeIntegerArray} shape - array shape
* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)
* @returns {(Array|TypedArray|Object)} array strides
*
* @example
* var strides = new Array( 2 );
*
* var out = shape2strides( strides, [ 3, 2 ], 'row-major' );
* // returns [ 2, 1 ]
*
* var bool = ( out === strides );
* // returns true
*
* out = shape2strides( strides, [ 3, 2 ], 'column-major' );
* // returns [ 1, 3 ]
*/

/**
* Generates a string displaying the filters for the current active data subset.
*
* @private
* @param {Array} filters - data subset filters
* @param {boolean} abridged - controls whether to display all filters in multiple lines or an abridged version
* @returns {string} filter display string
*/

/**
* Generates a table of safe casts for each ndarray data type.
*
* @private
* @returns {Object} table
*/

/**
* Generates a table of same "kind" casts for each ndarray data type.
*
* @private
* @returns {Object} table
*/

/**
* Given a stride array, determine array iteration order.
*
* @module @stdlib/ndarray/base/iteration-order
*
* @example
* var iterationOrder = require( '@stdlib/ndarray/base/iteration-order' );
*
* var o = iterationOrder( [ 2, 1 ] );
* // returns 1
*
* o = iterationOrder( [ -2, 1 ] );
* // returns 0
*
* o = iterationOrder( [ -2, -1 ] );
* // returns -1
*/

/**
* Group values according to an indicator function and return group counts.
*
* @module @stdlib/utils/count-by
*
* @example
* var countBy = require( '@stdlib/utils/count-by' );
*
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = countBy( arr, indicator );
* // returns { 'b': 3, 'f': 1 }
*/

/**
* Group values according to an indicator function.
*
* @module @stdlib/utils/group-by
*
* @example
* var groupBy = require( '@stdlib/utils/group-by' );
*
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = groupBy( arr, indicator );
* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }
*
* @example
* var groupBy = require( '@stdlib/utils/group-by' );
*
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var opts = {
*     'returns': 'indices'
* };
* var out = groupBy( arr, opts, indicator );
* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }
*
* @example
* var groupBy = require( '@stdlib/utils/group-by' );
*
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var opts = {
*     'returns': '*'
* };
* var out = groupBy( arr, opts, indicator );
* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }
*/

/**
* Group values as arrays associated with distinct keys.
*
* @module @stdlib/utils/group
*
* @example
* var group = require( '@stdlib/utils/group' );
*
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
* var groups = [ 'b', 'b', 'f', 'b' ];
*
* var out = group( arr, groups );
* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }
*
* @example
* var group = require( '@stdlib/utils/group' );
*
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
* var groups = [ 'b', 'b', 'f', 'b' ];
*
* var opts = {
*     'returns': 'indices'
* };
*
* var out = group( arr, opts, groups );
* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }
*
* @example
* var group = require( '@stdlib/utils/group' );
*
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
* var groups = [ 'b', 'b', 'f', 'b' ];
*
* var opts = {
*     'returns': '*'
* };
*
* var out = group( arr, opts, groups );
* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }
*/

/**
* Groups values according to an indicator function and outputs results according to element indices.
*
* ## Notes
*
* -   Checking for an "own" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.
*
*
* @private
* @param {Collection} collection - collection to group
* @param {Options} opts - function options
* @param {*} [opts.thisArg] - execution context
* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to
* @returns {Object} group results
*
* @example
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = groupBy( arr, {}, indicator );
* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }
*/

/**
* Groups values according to an indicator function and outputs results as element values.
*
* ## Notes
*
* -   We need to cache the collection value to prevent the edge case where, during the invocation of the indicator function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.
* -   Checking for an "own" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.
*
*
* @private
* @param {Collection} collection - collection to group
* @param {Options} opts - function options
* @param {*} [opts.thisArg] - execution context
* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to
* @returns {Object} group results
*
* @example
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = groupBy( arr, {}, indicator );
* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }
*/

/**
* Groups values according to an indicator function and outputs results as index-element values.
*
* ## Notes
*
* -   We need to cache the collection value to prevent the edge case where, during the invocation of the indicator function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.
* -   Checking for an "own" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.
*
*
* @private
* @param {Collection} collection - collection to group
* @param {Options} opts - function options
* @param {*} [opts.thisArg] - execution context
* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to
* @returns {Object} group results
*
* @example
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = groupBy( arr, {}, indicator );
* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }
*/

/**
* Groups values according to an indicator function and returns group counts.
*
* @param {Collection} collection - input collection
* @param {Options} [options] - function options
* @param {*} [options.thisArg] - execution context
* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to
* @throws {TypeError} first argument must be a collection
* @throws {TypeError} options argument must be an object
* @throws {TypeError} last argument must be a function
* @throws {TypeError} must provide valid options
* @returns {Object} counts
*
* @example
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = countBy( arr, indicator );
* // returns { 'b': 3, 'f': 1 }
*/

/**
* Groups values according to an indicator function.
*
* @param {Collection} collection - collection to group
* @param {Options} [options] - function options
* @param {*} [options.thisArg] - execution context
* @param {string} [options.returns="values"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned
* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to
* @throws {TypeError} first argument must be a collection
* @throws {TypeError} options argument must be an object
* @throws {TypeError} last argument must be a function
* @throws {TypeError} must provide valid options
* @returns {Object} group results
*
* @example
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = groupBy( arr, indicator );
* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }
*
* @example
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var opts = {
*     'returns': 'indices'
* };
* var out = groupBy( arr, opts, indicator );
* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }
*
* @example
* function indicator( v ) {
*     return v[ 0 ];
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var opts = {
*     'returns': '*'
* };
* var out = groupBy( arr, opts, indicator );
* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }
*/

/**
* Groups values as arrays associated with distinct keys and outputs element indices.
*
* ## Notes
*
* -   Checking for an "own" property is necessary to guard against the edge case where a group identifier which matches a method or property on the `Object` prototype.
*
*
* @private
* @param {Collection} collection - collection to group
* @param {Collection} groups - collection defining which group an element in the input collection belongs to
* @returns {Object} group results
*
* @example
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
* var groups = [ 'b', 'b', 'f', 'b' ];
*
* var out = group( arr, groups );
* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }
*/

/**
* Groups values as arrays associated with distinct keys and outputs element values.
*
* ## Notes
*
* -   Checking for an "own" property is necessary to guard against the edge case where a group identifier which matches a method or property on the `Object` prototype.
*
*
* @private
* @param {Collection} collection - collection to group
* @param {Collection} groups - collection defining which group an element in the input collection belongs to
* @returns {Object} group results
*
* @example
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
* var groups = [ 'b', 'b', 'f', 'b' ];
*
* var out = group( arr, groups );
* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }
*/

/**
* Groups values as arrays associated with distinct keys and outputs index-element pairs.
*
* ## Notes
*
* -   Checking for an "own" property is necessary to guard against the edge case where a group identifier which matches a method or property on the `Object` prototype.
*
*
* @private
* @param {Collection} collection - collection to group
* @param {Collection} groups - collection defining which group an element in the input collection belongs to
* @returns {Object} group results
*
* @example
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
* var groups = [ 'b', 'b', 'f', 'b' ];
*
* var out = group( arr, groups );
* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }
*/

/**
* Groups values as arrays associated with distinct keys.
*
* @param {Collection} collection - collection to group
* @param {Options} [options] - function options
* @param {string} [options.returns="values"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned
* @param {Collection} groups - collection defining which group an element in the input collection belongs to
* @throws {TypeError} first argument must be a collection
* @throws {TypeError} options argument must be an object
* @throws {TypeError} last argument must be a collection
* @throws {TypeError} must provide valid options
* @throws {RangeError} first and last arguments must be the same length
* @returns {Object} group results
*
* @example
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
* var groups = [ 'b', 'b', 'f', 'b' ];
*
* var out = group( arr, groups );
* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }
*
* @example
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
* var groups = [ 'b', 'b', 'f', 'b' ];
*
* var opts = {
*     'returns': 'indices'
* };
*
* var out = group( arr, opts, groups );
* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }
*
* @example
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
* var groups = [ 'b', 'b', 'f', 'b' ];
*
* var opts = {
*     'returns': '*'
* };
*
* var out = group( arr, opts, groups );
* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }
*/

/**
* Helper function used by root finding code to convert `eta` to `x`.
*
* @private
* @param {number} t - first parameter
* @param {number} a - second parameter
* @returns {Function} root function
*/

/**
* Hierarchical clustering based on priority-queue algorithm. Implements single-linkage and complete-linkage.
*
* @param {Array} data - two-dimensional array
* @param {Object} [opts] - function options
* @param {String} [opts.linkage='complete'] - accessor function for accessing array values
* @param {String} [opts.distance='euclidean'] - boolean indicating whether to return a new array
* @return {Object} an object exposing two functions, `getTree` and `getClusters(k)`, where `k` is the number of clusters
*/

/**
* Identity function.
*
* @module @stdlib/utils/identity-function
*
* @example
* var identity = require( '@stdlib/utils/identity-function' );
*
* var input = [];
* var output = identity( input );
*
* var bool = ( input === output );
* // returns true
*/

/**
* Identity function.
*
* @param {*} x - input value
* @returns {*} input value
*
* @example
* var v = identity( 3.14 );
* // returns 3.14
*/

/**
* Implement prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.
*
* @module @stdlib/utils/inherit
*
* @example
* var inherit = require( '@stdlib/utils/inherit' );
*
* function Foo() {
*     return this;
* }
* Foo.prototype.beep = function beep() {
*     return 'boop';
* };
*
* function Bar() {
*     Foo.call( this );
*     return this;
* }
* inherit( Bar, Foo );
*
* var bar = new Bar();
* var v = bar.beep();
* // returns 'boop'
*/

/**
* Implementation of the high order Newton-like method.
*
* @private
* @param {number} x0 - initial value
* @param {number} a - scale parameter
* @param {number} m - indicator
* @param {Probability} p - probability value
* @param {Probability} q - probability value
* @param {number} lgama - logarithm of scale parameter
* @param {number} invfp - one over `fp`
* @param {boolean} pcase - boolean indicating whether p < 0.5
* @returns {number} function value of the inverse
*/

/**
* Implements prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.
*
* ## Notes
*
* -   This implementation is not designed to work with ES2015/ES6 classes. For ES2015/ES6 classes, use `class` with `extends`.
* -   For reference, see [node#3455](https://github.com/nodejs/node/pull/3455), [node#4179](https://github.com/nodejs/node/issues/4179), [node#3452](https://github.com/nodejs/node/issues/3452), and [node commit](https://github.com/nodejs/node/commit/29da8cf8d7ab8f66b9091ab22664067d4468461e#diff-3deb3f32958bb937ae05c6f3e4abbdf5).
*
*
* @param {(Object|Function)} ctor - constructor which will inherit
* @param {(Object|Function)} superCtor - super (parent) constructor
* @throws {TypeError} first argument must be either an object or a function which can inherit
* @throws {TypeError} second argument must be either an object or a function from which a constructor can inherit
* @throws {TypeError} second argument must have an inheritable prototype
* @returns {(Object|Function)} child constructor
*
* @example
* function Foo() {
*     return this;
* }
* Foo.prototype.beep = function beep() {
*     return 'boop';
* };
*
* function Bar() {
*     Foo.call( this );
*     return this;
* }
* inherit( Bar, Foo );
*
* var bar = new Bar();
* var v = bar.beep();
* // returns 'boop'
*/

/**
* Incomplete beta series.
*
* @private
* @param {NonNegativeNumber} a - function parameter
* @param {NonNegativeNumber} b - function parameter
* @param {Probability} x - function parameter
* @param {NonNegativeInteger} s0 - initial value
* @param {boolean} normalized - boolean indicating whether to evaluate the power terms of the regularized or non-regularized incomplete beta function
* @param {(Array|TypedArray|Object)} out - output array holding the derivative as the second element
* @param {Probability} y - probability equal to `1-x`
* @returns {number} function value
*/

/**
* Inverts the lower gamma function; i.e., computes `xr` such that `P(a,xr) = p`.
*
* ## Method
*
* The present code uses different methods of computation depending on the values of the input values: Taylor, asymptotic expansions and high-order Newton methods.
*
* ## Notes
*
* -   The claimed accuracy obtained using this inversion routine is near `1e-12`.
*
* ## References
*
* -   A. Gil, J. Segura and N.M. Temme, GammaCHI: a package for the inversion and computation of the gamma and chi-square distribution functions (central and noncentral). Computer Physics Commun
* -   A. Gil, J. Segura and N.M. Temme. Efficient and accurate algorithms for the computation and inversion of the incomplete gamma function ratios. SIAM J Sci Comput. (2012) 34(6), A2965-A2981
*
*
* @param {Probability} p - probability value
* @param {number} a - scale parameter
* @param {boolean} [upper=false] - boolean indicating if the function should invert the upper tail of the incomplete gamma function instead; i.e., compute `xr` such that `Q(a,xr) = p`.
* @returns {number} function value of the inverse
*/

/**
* Iterate over the active set of predictors and perform coordinate descent until convergence.
*
* @returns {void}
*/

/**
* Iteratively re-weighted least squares algorithm.
*/

/**
* Lasso object to fit regression.
*
* @constructor
* @returns {LassoFit} instance
*/

/**
* Locally-weighted polynomial regression via the LOWESS algorithm.
*
* ## Methods
*
* -   Calculates fitted values using a nearest neighbor function and robust locally weighted regression of degree one with the tricube weight function.
*
* ## References
*
* -   Cleveland, William S. 1979. "Robust Locally and Smoothing Weighted Regression Scatterplots." _Journal of the American Statistical Association_ 74 (368): 829–36. doi:[10.1080/01621459.1979.10481038](https://doi.org/10.1080/01621459.1979.10481038).
* -   Cleveland, William S. 1981. "Lowess: A program for smoothing scatterplots by robust locally weighted regression." _American Statistician_ 35 (1): 54–55. doi:[10.2307/2683591](https://doi.org/10.2307/2683591).
*
* @private
* @param {NumericArray} x - ordered x-axis values (abscissa values)
* @param {NumericArray} y - corresponding y-axis values (ordinate values)
* @param {PositiveInteger} n - number of observations
* @param {PositiveNumber} f - smoother span (proportion of points which influence smoothing at each value)
* @param {NonNegativeInteger} nsteps - number of iterations in the robust fit
* @param {PositiveNumber} delta - nonnegative parameter which may be used to reduce the number of computations
* @returns {Object} sorted x-values and fitted values
*/

/**
* Locally-weighted polynomial regression via the LOWESS algorithm.
*
* ## References
*
* -   Cleveland, William S. 1979. "Robust Locally and Smoothing Weighted Regression Scatterplots." _Journal of the American Statistical Association_ 74 (368): 829–36. doi:[10.1080/01621459.1979.10481038](https://doi.org/10.1080/01621459.1979.10481038).
* -   Cleveland, William S. 1981. "Lowess: A program for smoothing scatterplots by robust locally weighted regression." _American Statistician_ 35 (1): 54–55. doi:[10.2307/2683591](https://doi.org/10.2307/2683591).
*
* @param {NumericArray} x - ordered x-axis values (abscissa values)
* @param {NumericArray} y - corresponding y-axis values (ordinate values)
* @param {Options} options - function options
* @param {PositiveNumber} [options.f=2/3] - smoother span (proportion of points which influence smoothing at each value)
* @param {integer} [options.nsteps=3] - number of iterations in the robust fit (fewer iterations translates to faster function execution)
* @param {NonNegativeNumber} [options.delta] - nonnegative parameter which may be used to reduce the number of computations
* @param {boolean} [options.sorted=false] - boolean indicating if the input array `x` is already in sorted order
* @throws {TypeError} first argument must be a numeric array
* @throws {TypeError} second argument must be a numeric array
* @throws {Error} arguments `x` and `y` must have the same length
* @returns {Object} ordered x-values and fitted values
*/

/**
* Locally-weighted polynomial regression via the LOWESS algorithm.
*
* @module @stdlib/stats/lowess
*
* @example
* var lowess = require( '@stdlib/stats/lowess' );
*
* var x = [
*     4, 4, 7, 7, 8, 9, 10, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14,
*     14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 20,
*     20, 20, 20, 20, 22, 23, 24, 24, 24, 24, 25
* ];
* var y = [
*     2, 10, 4, 22, 16, 10, 18, 26, 34, 17, 28, 14, 20, 24, 28, 26, 34, 34, 46,
*     26, 36, 60, 80, 20, 26, 54, 32, 40, 32, 40, 50, 42, 56, 76, 84, 36, 46, 68,
*     32, 48, 52, 56, 64, 66, 54, 70, 92, 93, 120, 85
* ];
*
* var out = lowess( x, y );
* /* returns
*     {
*         'x': [
*             4,
*             4,
*             7,
*             7,
*             ...,
*             24,
*             24,
*             24,
*             25
*         ],
*         'y': [
*             ~4.857,
*             ~4.857,
*             ~13.1037,
*             ~13.1037,
*             ...,
*             ~79.102,
*             ~79.102,
*             ~79.102,
*             ~84.825
*         ]
*     }
* *\/
*/

/**
* Loop over the data and generate new labels.
*/

/**
* Map values from one object to a new object having the same keys.
*
* @module @stdlib/utils/map-values
*
* @example
* var mapValues = require( '@stdlib/utils/map-values' );
*
* function transform( value, key ) {
*     return key + value;
* }
*
* var obj1 = {
*     'a': 1,
*     'b': 2
* };
*
* var obj2 = mapValues( obj1, transform );
* // returns { 'a': 'a1', 'b': 'b2' }
*/

/**
* Maps values from one object to a new object having the same keys.
*
* ## Notes
*
* -   Iteration order is **not** guaranteed.
* -   The function only operates on own properties, not inherited properties.
*
*
* @param {Object} obj - source object
* @param {Function} transform - transform function
* @throws {TypeError} first argument must be an object
* @throws {TypeError} second argument must be a function
* @returns {Object} new object
*
* @example
* function transform( value, key ) {
*     return key + value;
* }
*
* var obj1 = {
*     'a': 1,
*     'b': 2
* };
*
* var obj2 = mapValues( obj1, transform );
* // returns { 'a': 'a1', 'b': 'b2' }
*/

/**
* Matches a space.
*
* Regular expression: `/[\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/`
*
* -   `[]`
*     -   match any one of the listed characters
*
* -   `\u0009`
*     -   character tabulation (horizontal tab; `\t`)
*
* -   `\u000A`
*     -   line feed (LF; `\n`)
*
* -   `\u000B`
*     -   line tabulation (vertical tab; `\v`)
*
* -   `\u000C`
*     -   form feed (`\f`)
*
* -   `\u000D`
*     -   carriage return (CR; `\r`)
*
* -   `\u0020`
*     -   space (most common)
*
* -   `\u0085`
*     -   next line (NEL)
*
* -   `\u00A0`
*     -   non-breaking space
*
* -   `\u1680`
*     -   Ogham space mark
*
* -   `\u2000`
*     -   en quad
*
* -   `\u2001`
*     -   em quad
*
* -   `\u2002`
*     -   en space
*
* -   `\u2003`
*     -   em space
*
* -   `\u2004`
*
*     -   three-per-em space (thick space)
*
* -   `\u2005`
*     -   four-per-em space (mid space)
*
* -   `\u2006`
*     -   six-per-em space
*
* -   `\u2007`
*     -   figure space
*
* -   `\u2008`
*     -   punctuation space
*
* -   `\u2009`
*     -   thin space
*
* -   `\u200A`
*     -   hair space
*
* -   `\u2028`
*     -   line separator
*
* -   `\u2029`
*     -   paragraph separator
*
* -   `\u202F`
*     -   narrow no-break space
*
* -   `\u205F`
*     -   medium mathematical space
*
* -   `\u3000`
*     -   ideographic space
*
* -   `\uFEFF`
*     -   zero width non-breaking space
*
* @constant
* @type {RegExp}
* @default /[\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/
* @see [whitespace]{@link https://en.wikipedia.org/wiki/Whitespace_character}
*/

/**
* Matrix product of `A` and `B`.
*
* @param {Matrix} A - first input matrix
* @param {Matrix} B - second input matrix
* @returns {Matrix} A * B
*/

/**
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
*
* @constant
* @type {integer32}
* @default 65535
* @see [Unicode]{@link https://en.wikipedia.org/wiki/Unicode}
*/

/**
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
*
* @module @stdlib/constants/string/unicode-max-bmp
* @type {integer32}
*
* @example
* var UNICODE_MAX_BMP = require( '@stdlib/constants/string/unicode-max-bmp' );
* // returns 65535
*/

/**
* Maximum Unicode code point.
*
* @constant
* @type {integer32}
* @default 1114111
* @see [Unicode]{@link https://en.wikipedia.org/wiki/Unicode}
*/

/**
* Maximum Unicode code point.
*
* @module @stdlib/constants/string/unicode-max
* @type {integer32}
*
* @example
* var UNICODE_MAX = require( '@stdlib/constants/string/unicode-max' );
* // returns 1114111
*/

/**
* Maximum double-precision floating-point number.
*
* ## Notes
*
* The maximum is given by
*
* ```tex
* 2^{1023} (2 - 2^{-52})
* ```
*
* @constant
* @type {number}
* @default 1.7976931348623157e+308
* @see [IEEE 754]{@link http://en.wikipedia.org/wiki/IEEE_754-1985}
*/

/**
* Maximum double-precision floating-point number.
*
* @module @stdlib/constants/math/float64-max
* @type {number}
*
* @example
* var FLOAT64_MAX = require( '@stdlib/constants/math/float64-max' );
* // returns 1.7976931348623157e+308
*/

/**
* Maximum single-precision floating-point number.
*
* ## Notes
*
* The maximum is given by
*
* ```tex
* 2^{127} (2 - 2^{-23})
* ```
*
* @constant
* @type {number}
* @default 3.4028234663852886e+38
* @see [IEEE 754]{@link http://en.wikipedia.org/wiki/IEEE_754-1985}
*/

/**
* Maximum single-precision floating-point number.
*
* @module @stdlib/constants/math/float32-max
* @type {number}
*
* @example
* var FLOAT32_MAX = require( '@stdlib/constants/math/float32-max' );
* // returns 3.4028234663852886e+38
*/

/**
* Multidimensional array.
*
* @module @stdlib/ndarray/array
*
* @example
* var array = require( '@stdlib/ndarray/array' );
*
* var arr = array( [ [ 1, 2 ], [ 3, 4 ] ] );
* // returns <ndarray>
*
* var v = arr.get( 0, 0 );
* // returns 1
*
* @example
* var array = require( '@stdlib/ndarray/array' );
*
* var opts = {
*     'dtype': 'generic',
*     'flatten': false
* };
*
* var arr = array( [ [ 1, 2 ], [ 3, 4 ] ], opts );
* // returns <ndarray>
*
* var v = arr.get( 0 );
* // returns [ 1, 2 ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var array = require( '@stdlib/ndarray/array' );
*
* var opts = {
*     'shape': [ 2, 2 ]
* };
*
* var arr = array( new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ), opts );
* // returns <ndarray>
*
* var v = arr.get( 0, 0 );
* // returns 1.0
*/

/**
* Multiplies each column of matrix `A` with the elements of vector `b`.
*
* @param {Matrix} A - input matrix
* @param {NumberArray} b - input vector
* @returns {Matrix} `A` with columns multiplied by elements of `b`
*/

/**
* Naive Bayes fitting object constructor for multinomial distribution.
*
* @constructor
* @param {Matrix} x - design matrix
* @param {Array} y - vector of class memberships
* @param {number} alpha - Laplace smoothing parameter
* @returns {MultinomialFit} MultinomialFit instance
*/

/**
* Naive Bayes fitting object constructor for normal distribution.
*
* @constructor
* @param {Matrix} x - design matrix
* @param {Array} y - vector of class memberships
* @returns {GaussianFit} GaussianFit instance
*/

/**
* Natural logarithm of the maximum double-precision floating-point number.
*
* ## Notes
*
* The natural logarithm of the maximum is given by
*
* ```tex
* \ln \left( 2^{1023} (2 - 2^{-52}) \right)
* ```
*
* @constant
* @type {number}
* @default 709.782712893384
* @see [IEEE 754]{@link http://en.wikipedia.org/wiki/IEEE_754-1985}
*/

/**
* Natural logarithm of the maximum double-precision floating-point number.
*
* @module @stdlib/constants/math/float64-max-ln
* @type {number}
*
* @example
* var FLOAT64_MAX_LN = require( '@stdlib/constants/math/float64-max-ln' );
* // returns 709.782712893384
*/

/**
* Natural logarithm of the smallest normalized double-precision floating-point number.
*
* ## Notes
*
* The number has the value
*
* ```tex
* -\ln \left( 2^{1023-1} \right)
* ```
*
* @constant
* @type {number}
* @default -708.3964185322641
* @see [IEEE 754]{@link http://en.wikipedia.org/wiki/IEEE_754-1985}
*/

/**
* Natural logarithm of the smallest normalized double-precision floating-point number.
*
* @module @stdlib/constants/math/float64-min-ln
* @type {number}
*
* @example
* var FLOAT64_MIN_LN = require( '@stdlib/constants/math/float64-min-ln' );
* // returns -708.3964185322641
*/

/**
* Natural logarithm of the square root of `2π`.
*
* @module @stdlib/constants/math/float64-ln-sqrt-two-pi
* @type {number}
*
* @example
* var LN_SQRT_TWO_PI = require( '@stdlib/constants/math/float64-ln-sqrt-two-pi' );
* // returns 0.9189385332046728
*/

/**
* Natural logarithm of the square root of `2π`.
*
* ```tex
* \ln \sqrt{2\pi}
* ```
*
* @constant
* @type {number}
* @default 0.9189385332046728
*/

/**
* Normal distribution cumulative distribution function (CDF).
*
* @module @stdlib/stats/base/dists/normal/cdf
*
* @example
* var cdf = require( '@stdlib/stats/base/dists/normal/cdf' );
*
* var y = cdf( 2.0, 0.0, 1.0 );
* // returns ~0.977
*
* var myCDF = cdf.factory( 10.0, 2.0 );
* y = myCDF( 10.0 );
* // returns 0.5
*/

/**
* Normal distribution probability density function (PDF).
*
* @module @stdlib/stats/base/dists/normal/pdf
*
* @example
* var pdf = require( '@stdlib/stats/base/dists/normal/pdf' );
*
* var y = pdf( 2.0, 0.0, 1.0 );
* // returns ~0.054
*
* var myPDF = pdf.factory( 10.0, 2.0 );
* y = myPDF( 10.0 );
* // returns ~0.199
*/

/**
* Normal distribution quantile function.
*
* @module @stdlib/stats/base/dists/normal/quantile
*
* @example
* var quantile = require( '@stdlib/stats/base/dists/normal/quantile' );
*
* var y = quantile( 0.8, 0.0, 1.0 );
* // returns ~0.842
*
* var myQuantile = quantile.factory( 10.0, 2.0 );
* y = myQuantile( 0.5 );
* // returns 10.0
*/

/**
* One fourth times the mathematical constant `π`.
*
* @constant
* @type {number}
* @default 7.85398163397448309616e-1
* @see [Wikipedia]{@link https://en.wikipedia.org/wiki/Pi}
*/

/**
* One fourth times the mathematical constant `π`.
*
* @module @stdlib/constants/math/float64-fourth-pi
* @type {number}
*
* @example
* var FOURTH_PI = require( '@stdlib/constants/math/float64-fourth-pi' );
* // returns 7.85398163397448309616e-1
*/

/**
* One half times the mathematical constant `π`.
*
* @constant
* @type {number}
* @default 1.5707963267948966
* @see [Wikipedia]{@link https://en.wikipedia.org/wiki/Pi}
*/

/**
* One half times the mathematical constant `π`.
*
* @module @stdlib/constants/math/float64-half-pi
* @type {number}
*
* @example
* var HALF_PI = require( '@stdlib/constants/math/float64-half-pi' );
* // returns 1.5707963267948966
*/

/**
* One half times the natural logarithm of 2.
*
* @module @stdlib/constants/math/float64-half-ln-two
* @type {number}
*
* @example
* var HALF_LN2 = require( '@stdlib/constants/math/float64-half-ln-two' );
* // returns 3.46573590279972654709e-01
*/

/**
* One half times the natural logarithm of 2.
*
* ```tex
* \frac{\ln 2}{2}
* ```
*
* @constant
* @type {number}
* @default 3.46573590279972654709e-01
*/

/**
* One-way analysis of variance.
*
* @module @stdlib/stats/anova1
*
* @example
* var anova1 = require( '@stdlib/stats/anova1' );
* var x = [ 1, 3, 5, 2, 4, 6, 8, 7, 10, 11, 12, 15 ];
* var f = [ 'control', 'treatA', 'treatB', 'treatC', 'control', 'treatA', 'treatB', 'treatC', 'control', 'treatA', 'treatB', 'treatC' ];
*
* var out = anova1( x, f );
* /* returns
*     {
*         'treatment': {
*             'df': 11,
*             'ss': ~20.667,
*             'mss': ~6.889
*          }
*         'error': {
*             'df': 8,
*             'ss': ~185.333,
*             'mss': ~23.1667,
*         },
*         'statistic': ~0.297,
*         'pValue': ~0.826,
*         'means': { 'control': { 'mean': 5.0, 'sampleSize': 3, 'SD': ~4.583 },
*            'treatA': { 'mean': ~6.667, 'sampleSize': 3, 'SD': ~4.041 },
*            'treatB': { 'mean': ~8.333, 'sampleSize': 3, 'SD': ~3.512 },
*            'treatC': { 'mean': 8.0, 'sampleSize': 3, 'SD': ~6.557 }
*         },
*         'method': 'One-Way ANOVA'
*     }
* *\/
*
* var table = out.print();
* /*
* One-Way ANOVA
*
* Null Hypothesis: All Means Equal
* Alternate Hypothesis: At Least one Mean not Equal
*
* 		df	Sum Squares	Mean Sum Sq.	F Score	P Value
* Treatment	11	15		5		0.3125	0.8161
* Errors		8	128		16
*
* *\/
*/

/**
* Perform a one-way analysis of variance (ANOVA).
*
* @param {NumericArray} x - measured values
* @param {Array} factor - array of treatments
* @param {Options} [options] - function options
* @param {number} [options.alpha=0.05] - significance level
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} `x` must be a numeric array
* @throws {TypeError} `factor` must be an array
* @throws {RangeError} `factor` must have at least two unique elements
* @throws {RangeError} length of `x` must be greater than or equal to two
* @throws {RangeError} `x` and `factor` must have the same length
* @returns {Object} test results
*/

/**
* Performs root finding via second order Newton-Raphson iteration.
*
* @private
* @param {Array} fun - two-element array of the function and its first derivative
* @param {number} guess - initial starting value.
* @param {number} min - minimum possible value for the result,used as initial lower bracket.
* @param {number} max - maximum possible value for the result, used as initial upper bracket.
* @param {PositiveInteger} digits - desired number of binary digits
* @param {PositiveInteger} maxIter - maximum number of iterations
* @returns {number} function value
*/

/**
* Performs root finding via third order Halley iteration.
*
* @private
* @param {Array} fun - array of function and its first two derivatives
* @param {number} guess - initial starting value
* @param {number} minimum - minimum possible value for the result, used as initial lower bracket
* @param {number} maximum - maximum possible value for the result, used as initial upper bracket
* @param {PositiveInteger} digits - desired number of binary digits
* @param {PositiveInteger} maxIter - maximum number of iterations
* @returns {number} function value
*/

/**
* Predict class membership for new observation(s).
*
* @param {(Matrix|Array)} x - new observation(s)
* @returns {Array} array of predicted class memberships
*/

/**
* Predict class membership for one new observation.
*
* @param {Array} x - new observation
* @returns {(number|string)} predicted class membership
*/

/**
* Prepends singleton dimensions in order to satisfy a minimum number of dimensions.
*
* @private
* @param {NonNegativeInteger} ndims - number of dimensions
* @param {Array} shape - array dimensions
* @param {NonNegativeInteger} ndmin - minimum number of dimensions
* @returns {Array} output shape array
*/

/**
* Pretty-print output of test.
*
* @param {Object} [opts] - options object
* @param {PositiveInteger} [opts.digits=4] - number of digits after the decimal point
* @param {boolean} [opts.decision=true] - boolean indicating whether to print the test decision
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {string} formatted output
*/

/**
* Pretty-print output of test.
*
* @param {Object} [opts] - options object
* @param {PositiveInteger} [opts.digits=4] - number of digits after the decimal point
* @param {boolean} [opts.decision=true] - boolean indicating whether to print the test decision
* @throws {TypeError} options has to be simple object
* @throws {TypeError} must provide valid options
* @returns {string} formatted output
*/

/**
* Recursively (and eagerly) attempts to resolve nested array dimensions.
*
* @private
* @param {Array} shape - output array
* @param {Array} arr - array
* @returns {Array} shape array
*/

/**
* Recursively flattens an array.
*
* @private
* @param {Array} out - output array
* @param {Array} arr - input array
* @param {NonNegativeInteger} depth - recursion depth
* @returns {Array} output array
*/

/**
* Recursively verifies that all nested arrays have consistent dimensions.
*
* @private
* @param {PositiveInteger} ndims - number of dimensions
* @param {Array} shape - shape array
* @param {NonNegativeInteger} d - dimension
* @param {Array} arr - array element to verify
* @param {boolean} flg - boolean indicating whether to continue recursing
* @returns {NonNegativeInteger} number of consistent dimensions
*/

/**
* Regular expression to match a whitespace character.
*
* ## Notes
*
* -   Matches the 25 characters defined as whitespace ("WSpace=Y","WS") characters in the Unicode 9.0 character database.
* -   Matches one related whitespace character without the Unicode character property "WSpace=Y" (zero width non-breaking space which was deprecated as of Unicode 3.2).
*
* @module @stdlib/regexp/whitespace
* @type {RegExp}
*
* @example
* var RE_WHITESPACE = require( '@stdlib/regexp/whitespace' );
*
* var bool = RE_WHITESPACE.test( ' ' );
* // returns true
*
* bool = RE_WHITESPACE.test( '\t' );
* // returns true
*
* bool = RE_WHITESPACE.test( 'a' );
* // returns false
*/

/**
* Repeat a string a specified number of times and return the concatenated result.
*
* @module @stdlib/string/repeat
*
* @example
* var replace = require( '@stdlib/string/repeat' );
*
* var str = repeat( 'a', 5 );
* // returns 'aaaaa'
*
* str = repeat( '', 100 );
* // returns ''
*
* str = repeat( 'beep', 0 );
* // returns ''
*/

/**
* Repeats a string a specified number of times and returns the concatenated result.
*
* ## Methods
*
* The algorithmic trick used in the implementation is to treat string concatenation the same as binary addition (i.e., any natural number (nonnegative integer) can be expressed as a sum of powers of two).
*
* For example,
*
* ```text
* n = 10 => 1010 => 2^3 + 2^0 + 2^1 + 2^0
* ```
*
* We can produce a 10-repeat string by "adding" the results of a 8-repeat string and a 2-repeat string.
*
* The implementation is then as follows:
*
* 1.  Let `s` be the string to be repeated and `o` be an output string.
*
* 2.  Initialize an output string `o`.
*
* 3.  Check the least significant bit to determine if the current `s` string should be "added" to the output "total".
*
*     -   if the bit is a one, add
*     -   otherwise, move on
*
* 4.  Double the string `s` by adding `s` to `s`.
*
* 5.  Right-shift the bits of `n`.
*
* 6.  Check if we have shifted off all bits.
*
*     -   if yes, done.
*     -   otherwise, move on
*
* 7.  Repeat 3-6.
*
* The result is that, as the string is repeated, we continually check to see if the doubled string is one which we want to add to our "total".
*
* The algorithm runs in `O(log_2(n))` compared to `O(n)`.
*
*
* @param {string} str - string to repeat
* @param {NonNegativeInteger} n - number of times to repeat the string
* @throws {TypeError} first argument must be a string primitive
* @throws {TypeError} second argument must be a nonnegative integer
* @throws {RangeError} output string length must not exceed maximum allowed string length
* @returns {string} repeated string
*
* @example
* var str = repeat( 'a', 5 );
* // returns 'aaaaa'
*
* @example
* var str = repeat( '', 100 );
* // returns ''
*
* @example
* var str = repeat( 'beep', 0 );
* // returns ''
*/

/**
* Represents a PriorityQueue. Elements queued will always be sorted in increasing order.
*
* @param {Array} values - input array of values
* @constructor
*/

/**
* Reset the queue to zero elements
*/

/**
* Restrict an index to the interval `[0,max]`.
*
* @module @stdlib/ndarray/base/clamp-index
*
* @example
* var clampIndex = require( '@stdlib/ndarray/base/clamp-index' );
*
* var idx = clampIndex( -1, 10 );
* // returns 0
*
* idx = clampIndex( 15, 10 );
* // returns 10
*
* idx = clampIndex( 5, 10 );
* // returns 5
*/

/**
* Restricts an index to the interval `[0,max]`.
*
* @param {integer} idx - index
* @param {NonNegativeInteger} max - maximum index
* @returns {NonNegativeInteger} index
*
* @example
* var idx = clampIndex( -1, 10 );
* // returns 0
*
* idx = clampIndex( 15, 10 );
* // returns 10
*
* idx = clampIndex( 5, 10 );
* // returns 5
*/

/**
* Return a boolean indicating if a buffer length is compatible with provided ndarray meta data.
*
* @module @stdlib/ndarray/base/assert/is-stride-offset-buffer-compatible
*
* @example
* var isBufferLengthCompatible = require( '@stdlib/ndarray/base/assert/is-buffer-length-compatible' );
*
* var shape = [ 2, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var bool = isBufferLengthCompatible( 4, shape, strides, offset );
* // returns true
*
* @example
* var isBufferLengthCompatible = require( '@stdlib/ndarray/base/assert/is-buffer-length-compatible' );
*
* var shape = [ 2, 2 ];
* var strides = [ 2, 1 ];
* var offset = 2;
*
* var bool = isBufferLengthCompatible( 4, shape, strides, offset );
* // returns false
*/

/**
* Return a function which tests if every element in an array-like object passes a test condition.
*
* @module @stdlib/assert/tools/array-like-function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
* var arraylikefcn = require( '@stdlib/assert/tools/array-like-function' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arraylikefcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/

/**
* Return a list of ndarray casting modes.
*
* @module @stdlib/ndarray/casting-modes
*
* @example
* var modes = require( '@stdlib/ndarray/casting-modes' );
*
* var list = modes();
* // returns [ 'none', 'equiv', 'safe', 'same-kind', 'unsafe' ]
*/

/**
* Return a list of ndarray data types to which a provided ndarray data type can be safely cast or cast within the same "kind".
*
* @module @stdlib/ndarray/same-kind-casts
*
* @example
* var sameKindCasts = require( '@stdlib/ndarray/same-kind-casts' );
*
* var list = sameKindCasts( 'float32' );
* // returns [...]
*/

/**
* Return a list of ndarray data types to which a provided ndarray data type can be safely cast.
*
* @module @stdlib/ndarray/safe-casts
*
* @example
* var safeCasts = require( '@stdlib/ndarray/safe-casts' );
*
* var list = safeCasts( 'float32' );
* // returns [...]
*/

/**
* Return a list of ndarray data types.
*
* @module @stdlib/ndarray/dtypes
*
* @example
* var dtypes = require( '@stdlib/ndarray/dtypes' );
*
* var list = dtypes();
* // returns [...]
*/

/**
* Return a list of ndarray index modes.
*
* @module @stdlib/ndarray/index-modes
*
* @example
* var modes = require( '@stdlib/ndarray/index-modes' );
*
* var list = modes();
* // returns [ 'throw', 'clamp', 'wrap' ]
*/

/**
* Return a list of ndarray orders.
*
* @module @stdlib/ndarray/orders
*
* @example
* var orders = require( '@stdlib/ndarray/orders' );
*
* var list = orders();
* // returns [ 'row-major', 'column-major' ]
*/

/**
* Return an array of an object's own enumerable property `[key, value]` pairs.
*
* @module @stdlib/utils/entries
*
* @example
* var objectEntries = require( '@stdlib/utils/entries' );
*
* var obj = {
*     'beep': 'boop',
*     'foo': 'bar'
* };
*
* var entries = objectEntries( obj );
* // e.g., returns [ ['beep', 'boop'], ['foo', 'bar'] ]
*/

/**
* Return an array of an object's own enumerable property values.
*
* @module @stdlib/utils/values
*
* @example
* var objectValues = require( '@stdlib/utils/values' );
*
* var obj = {
*     'beep': 'boop',
*     'foo': 'bar'
* };
*
* var vals = objectValues( obj );
* // e.g., returns [ 'boop', 'bar' ]
*/

/**
* Return an index given an index mode.
*
* @module @stdlib/ndarray/base/ind
*
* @example
* var ind = require( '@stdlib/ndarray/base/ind' );
*
* var idx = ind( -1, 10, 'wrap' );
* // returns 10
*
* idx = ind( 14, 10, 'wrap' );
* // returns 3
*
* idx = ind( 6, 10, 'wrap' );
* // returns 6
*
* @example
* var ind = require( '@stdlib/ndarray/base/ind' );
*
* var idx = ind( -1, 10, 'clamp' );
* // returns 0
*
* idx = ind( 14, 10, 'clamp' );
* // returns 10
*
* idx = ind( 6, 10, 'clamp' );
* // returns 6
*
* @example
* var ind = require( '@stdlib/ndarray/base/ind' );
*
* var idx = ind( 1, 10, 'throw' );
* // returns 1
*
* idx = ind( 14, 10, 'throw' );
* // throws <RangeError>
*
* idx = ind( -1, 10, 'throw' );
* // throws <RangeError>
*/

/**
* Return the data type of an ndarray data buffer.
*
* @module @stdlib/ndarray/base/buffer-dtype
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var dtype = require( '@stdlib/ndarray/base/buffer-dtype' );
*
* var buf = new Float64Array( 10 );
*
* var dt = dtype( buf );
* // returns 'float64'
*
* dt = dtype( {} );
* // returns 'generic'
*
* dt = dtype( 'beep' );
* // returns null
*/

/**
* Return the maximum absolute value.
*
* @module @stdlib/math/base/special/maxabs
*
* @example
* var maxabs = require( '@stdlib/math/base/special/maxabs' );
*
* var v = maxabs( 3.14, -4.2 );
* // returns 4.2
*
* v = maxabs( 5.9, 3.14, 4.2 );
* // returns 5.9
*
* v = maxabs( 3.14, NaN );
* // returns NaN
*
* v = maxabs( +0.0, -0.0 );
* // returns +0.0
*/

/**
* Return the minimum absolute value.
*
* @module @stdlib/math/base/special/minabs
*
* @example
* var minabs = require( '@stdlib/math/base/special/minabs' );
*
* var v = minabs( -3.14, 4.2 );
* // returns 3.14
*
* v = min( 5.9, 3.14, 4.2 );
* // returns 3.14
*
* v = min( 3.14, NaN );
* // returns NaN
*
* v = min( +0.0, -0.0 );
* // returns +0.0
*/

/**
* Return the number of bytes per element provided an underlying array data type.
*
* @module @stdlib/ndarray/base/bytes-per-element
*
* @example
* var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' );
*
* var nbytes = bytesPerElement( 'float64' );
* // returns 8
*
* nbytes = bytesPerElement( 'generic' );
* // returns null
*/

/**
* Return the number of elements currently in the queue
*/

/**
* Return the number of elements in an array.
*
* @module @stdlib/ndarray/base/numel
*
* @example
* var numel = require( '@stdlib/ndarray/base/numel' );
*
* var n = numel( [ 3, 3, 3 ] );
* // returns 27
*/

/**
* Returns a boolean indicating if a buffer length is compatible with provided ndarray meta data.
*
* @param {NonNegativeInteger} len - buffer length
* @param {NonNegativeIntegerArray} shape - array shape
* @param {IntegerArray} strides - stride array
* @param {NonNegativeInteger} offset - index offset
* @returns {boolean} boolean indicating if a buffer length is compatible
*
* @example
* var shape = [ 2, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var bool = isBufferLengthCompatible( 4, shape, strides, offset );
* // returns true
*
* @example
* var shape = [ 2, 2 ];
* var strides = [ 2, 1 ];
* var offset = 2;
*
* var bool = isBufferLengthCompatible( 4, shape, strides, offset );
* // returns false
*/

/**
* Returns a boolean indicating if a provided ndarray data type can be cast to another ndarray data type according to a specified casting mode.
*
* @param {string} from - ndarray data type
* @param {string} to - ndarray data type
* @param {string} casting - ndarray casting mode
* @returns {boolean} boolean indicating if a data type can be cast to another data type
*
* @example
* var bool = isAllowedCast( 'float32', 'float64', 'safe' );
* // returns true
*
* bool = isAllowedCast( 'float64', 'int32', 'safe' );
* // returns false
*/

/**
* Returns a boolean indicating if a provided ndarray data type can be safely cast to another ndarray data type.
*
* @param {string} from - ndarray data type
* @param {string} to - ndarray data type
* @returns {boolean} boolean indicating if a data type can be safely cast to another data type
*
* @example
* var bool = isSafeCast( 'float32', 'float64' );
* // returns true
*
* bool = isSafeCast( 'float64', 'int32' );
* // returns false
*/

/**
* Returns a boolean indicating if a provided ndarray data type can be safely cast to, or is of the same "kind" as, another ndarray data type.
*
* @param {string} from - ndarray data type
* @param {string} to - ndarray data type
* @returns {boolean} boolean indicating if a data type can be cast to another data type
*
* @example
* var bool = isSameKindCast( 'float32', 'float64' );
* // returns true
*
* bool = isSameKindCast( 'uint16', 'int16' );
* // returns false
*/

/**
* Returns a cache key.
*
* @private
* @param {string} dtype - data type
* @param {Options} opts - function options
* @param {boolean} opts.codegen - boolean indicating whether to use code generation
* @param {string} opts.mode - specifies how to handle indices which exceed array dimensions
* @param {StringArray} opts.submode - specifies how to handle subscripts which exceed array dimensions on a per dimension basis
* @returns {string} cache key
*
* @example
* var opts = {
*     'codegen': true,
*     'mode': 'throw',
*     'submode': [ 'throw' ]
* };
* var key = getKey( 'float64', opts );
* // returns 'float64;codegen=true,mode="throw",submode=["throw"]'
*/

/**
* Returns a cache key.
*
* @private
* @param {string} dtype - data type
* @param {Options} opts - function options
* @param {boolean} opts.codegen - boolean indicating whether to use code generation
* @returns {string} cache key
*
* @example
* var opts = {
*     'codegen': true
* };
* var key = getKey( 'float64', opts );
* // returns 'float64;codegen=true'
*/

/**
* Returns a comparison result. If `-1`, `a` comes before `b`. If `1`, `b` comes before `a`. If `0`, the order stays the same.
*
* @private
* @param {number} a - first number
* @param {number} b - second number
* @returns {boolean} comparison result
*/

/**
* Returns a constructor cache.
*
* ## Notes
*
* -   Should return something similar to the following:
*
*     ```text
*     {
*         "float64;codegen=true": [],
*         "float64;codegen=false": [],
*         "float32;codegen=true": [],
*         "float32;codegen=false": [],
*         ...
*     }
*     ```
*
* @private
* @returns {Object} constructor cache
*/

/**
* Returns a constructor cache.
*
* @private
* @returns {Object} constructor cache
*/

/**
* Returns a function for evaluating the cumulative distribution function (CDF) for a Normal distribution.
*
* @param {number} mu - mean
* @param {NonNegativeNumber} sigma - standard deviation
* @returns {Function} function to evaluate the cumulative distribution function
*
* @example
* var cdf = factory( 10.0, 2.0 );
* var y = cdf( 10.0 );
* // returns 0.5
*
* y = cdf( 12.0 );
* // returns ~0.841
*/

/**
* Returns a function for evaluating the cumulative distribution function (CDF) for a Student's t distribution with degrees of freedom `v`.
*
* @param {PositiveNumber} v - degrees of freedom
* @returns {Function} CDF
*
* @example
* var cdf = factory( 0.5 );
* var y = cdf( 3.0 );
* // returns ~0.816
*
* y = cdf( 1.0 );
* // returns ~0.699
*/

/**
* Returns a function for evaluating the cumulative distribution function (CDF) for a chi-squared distribution with degrees of freedom `k`.
*
* @param {NonNegativeNumber} k - degrees of freedom
* @returns {Function} CDF
*
* @example
* var cdf = factory( 3.0 );
*
* var y = cdf( 6.0 );
* // returns ~0.888
*
* y = cdf( 1.5 );
* // returns ~0.318
*/

/**
* Returns a function for evaluating the cumulative distribution function (CDF) for a gamma distribution with shape parameter `alpha` and rate parameter `beta`.
*
* @param {NonNegativeNumber} alpha - shape parameter
* @param {PositiveNumber} beta - rate parameter
* @returns {Function} CDF
*
* @example
* var cdf = factory( 0.5, 0.1 );
* var y = cdf( 12.0 );
* // returns ~0.879
*
* y = cdf( 8.0 );
* // returns ~0.794
*/

/**
* Returns a function for evaluating the cumulative distribution function (CDF) for an F distribution with numerator degrees of freedom `d1` and denominator degrees of freedom `d2`.
*
* @param {PositiveNumber} d1 - numerator degrees of freedom
* @param {PositiveNumber} d2 - denominator degrees of freedom
* @returns {Function} CDF
*
* @example
* var cdf = factory( 10.0, 2.0 );
*
* var y = cdf( 10.0 );
* // returns ~0.906
*
* y = cdf( 8.0 );
* // returns ~0.884
*/

/**
* Returns a function for evaluating the cumulative distribution function (CDF) of a degenerate distribution centered at a provided mean value.
*
* @param {number} mu - constant value of distribution
* @returns {Function} function to evaluate the cumulative distribution function
*
* @example
* var cdf = factory( 5.0 );
*
* var y = cdf( 3.0 );
* // returns 0.0
*
* y = cdf( 6.0 );
* // returns 1.0
*
* y = cdf( NaN );
* // returns NaN
*/

/**
* Returns a function for evaluating the probability density function (PDF) for a normal distribution.
*
* @param {number} mu - mean
* @param {NonNegativeNumber} sigma - standard deviation
* @returns {Function} function to evaluate the probability density function
*
* @example
* var pdf = factory( 10.0, 2.0 );
* var y = pdf( 10.0 );
* // returns ~0.199
*
* y = pdf( 5.0 );
* // returns ~0.009
*/

/**
* Returns a function for evaluating the probability density function (PDF) for a uniform distribution with minimum support `a` and maximum support `b`.
*
* @param {number} a - minimum support
* @param {number} b - maximum support
* @returns {Function} PDF
*
* @example
* var pdf = factory( 0.0, 10.0 );
* var y = pdf( 2.0 );
* // returns 0.1
*
* y = pdf( 12.0 );
* // returns 0.0
*/

/**
* Returns a function for evaluating the probability density function (PDF) for an exponential distribution with parameter `lambda`.
*
* @param {PositiveNumber} lambda - rate parameter
* @returns {Function} probability density function (PDF)
*
* @example
* var pdf = factory( 0.5 );
* var y = pdf( 3.0 );
* // returns ~0.112
*
* y = pdf( 1.0 );
* // returns ~0.303
*/

/**
* Returns a function for evaluating the probability density function (PDF) of a degenerate distribution centered at a provided mean value.
*
* @param {number} mu - value at which to center the distribution
* @returns {Function} function to evaluate the probability density function
*
* @example
* var pdf = factory( 5.0 );
*
* var y = pdf( 0.0 );
* // returns 0.0
*
* y = pdf( 5.0 );
* // returns Infinity
*/

/**
* Returns a function for evaluating the probability mass function (PMF) for a Bernoulli distribution with success probability `p`.
*
* @param {Probability} p - success probability
* @returns {Function} PMF
*
* @example
* var pmf = factory( 0.8 );
* var y = pmf( 0.0 );
* // returns 0.2
*
* y = pmf( 1.0 );
* // returns 0.8
*/

/**
* Returns a function for evaluating the quantile function for a Student's t distribution with degrees of freedom `v`.
*
* @param {PositiveNumber} v - degrees of freedom
* @returns {Function} quantile function
*
* @example
* var quantile = factory( 0.5 );
* var y = quantile( 0.5 );
* // returns 0.0
*
* y = quantile( 0.8 );
* // returns ~2.513
*
* y = quantile( 1.0 );
* // returns Infinity
*/

/**
* Returns a function for evaluating the quantile function of a degenerate distribution centered at a provided mean value.
*
* @param {number} mu - value at which to center the distribution
* @returns {Function} function to evaluate the quantile function
*
* @example
* var quantile = factory( 5.0 );
*
* var y = quantile( 0.3 );
* // returns 5.0
*
* y = quantile( 0.1 );
* // returns 5.0
*
* y = quantile( 1.1 );
* // returns NaN
*/

/**
* Returns a function for evaluating the quantile function of a normal distribution.
*
* @param {number} mu - mean
* @param {NonNegativeNumber} sigma - standard deviation
* @returns {Function} quantile function
*
* @example
* var quantile = factory( 10.0, 2.0 );
* var y = quantile( 0.5 );
* // returns 10.0
*
* y = quantile( 0.8 );
* // returns ~11.683
*/

/**
* Returns a function for flattening arrays having specified dimensions.
*
* @param {PositiveIntegerArray} dims - dimensions
* @param {Options} [options] - function options
* @param {boolean} [options.copy=false] - boolean indicating whether to deep copy array elements
* @throws {TypeError} first argument must be an array of positive integers
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {Function} flatten function
*
* @example
* var flatten = factory( [2,2], {
*     'copy': false
* });
*
* var out = flatten( [[1,2],[3,4]] );
* // returns [ 1, 2, 3, 4 ]
*
* out = flatten( [[5,6],[7,8]] );
* // returns [ 5, 6, 7, 8 ]
*/

/**
* Returns a function to calculate the specified statistic.
*
* @param {string} statName - name of statistic
* @returns {Function} function to calculate statistic
*/

/**
* Returns a function to flatten an array and deep copy.
*
* @private
* @param {Function} flatten - flatten function
* @returns {Function} wrapped flatten function
*/

/**
* Returns a function to flatten an array containing elements all having the same dimensions.
*
* @private
* @param {PositiveIntegerArray} dims - dimensions
* @returns {Function} flatten function
*/

/**
* Returns a function to flatten an array.
*
* @private
* @param {Function} flatten - flatten function
* @returns {Function} wrapped flatten function
*/

/**
* Returns a function to pretty print test results.
*
* @private
* @param {Object} results - test results
* @returns {Function} pretty print function
*/

/**
* Returns a function which checks whether an element is equal to input.
*
* @param {string} input - the element the generated function should compare to
* @return {Function} a function which when invoked checks whether its first argument is equal to input
*/

/**
* Returns a function which tests if every element in an array-like object passes a test condition.
*
* @param {Function} predicate - function to apply
* @throws {TypeError} must provide a function
* @returns {Function} an array-like object function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arraylikefcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/

/**
* Returns a getter function for arrays having a specified number of dimensions.
*
* @private
* @param {PositiveInteger} ndims - array dimensions
* @param {StringArray} mode - specifies how to handle indices which exceed array dimensions
* @returns {Function} getter
*
* @example
* var f = get( 3 );
* // returns <Function>
*/

/**
* Returns a getter function for arrays having a specified number of dimensions.
*
* @private
* @param {PositiveInteger} ndims - array dimensions
* @returns {Function} getter
*
* @example
* var f = get( 3 );
* // returns <Function>
*/

/**
* Returns a kernel density smoothing function.
*
* @param {Array} xs - input data
* @param {Function} kernel - kernel function
* @param {number} bandwidth - kernel bandwidth
* @returns {Function} kernel smoother
*/

/**
* Returns a list of ndarray casting modes.
*
* @returns {StringArray} list of ndarray casting modes
*
* @example
* var list = modes();
* // returns [ 'none', 'equiv', 'safe', 'same-kind', 'unsafe' ]
*/

/**
* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast or cast within the same "kind".
*
* @param {string} [dtype] - ndarray data type
* @returns {(Object|StringArray|null)} list of ndarray data types or null
*
* @example
* var list = sameKindCasts( 'float32' );
* // returns [...]
*/

/**
* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast.
*
* @param {string} [dtype] - ndarray data type
* @returns {(Object|StringArray|null)} list of ndarray data types or null
*
* @example
* var list = safeCasts( 'float32' );
* // returns [...]
*/

/**
* Returns a list of ndarray data types.
*
* @returns {StringArray} list of ndarray data types
*
* @example
* var list = dtypes();
* // returns [...]
*/

/**
* Returns a list of ndarray index modes.
*
* @returns {StringArray} list of ndarray index modes
*
* @example
* var list = modes();
* // returns [ 'throw', 'clamp', 'wrap' ]
*/

/**
* Returns a list of ndarray orders.
*
* @returns {StringArray} list of ndarray orders
*
* @example
* var list = orders();
* // returns [ 'row-major', 'column-major' ]
*/

/**
* Returns a memoized ndarray constructor.
*
* @param {string} dtype - data type
* @param {PositiveInteger} ndims - number of dimensions
* @param {Options} [options] - function options
* @param {boolean} [options.codegen=true] - boolean indicating whether to use code generation
* @param {string} [options.mode="throw"] - specifies how to handle indices which exceed array dimensions
* @param {StringArray} [options.submode=["throw"]] - specifies how to handle subscripts which exceed array dimensions on a per dimension basis
* @throws {TypeError} first argument must be a supported ndarray data type
* @throws {TypeError} second argument must be a number having a positive integer value
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {Function} memoized ndarray constructor
*
* @example
* var f1 = ctor( 'float64', 3 );
* // returns <Function>
*
* var f2 = ctor( 'float64', 3 );
* // returns <Function>
*
* var bool = ( f1 === f2 );
* // returns true
*
* var buffer = [ 1, 2, 3, 4, 5, 6 ];
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var out = f1( buffer, shape, strides, offset, 'row-major' );
*/

/**
* Returns a memoized ndarray constructor.
*
* @param {string} dtype - data type
* @param {PositiveInteger} ndims - number of dimensions
* @param {Options} [options] - function options
* @param {boolean} [options.codegen=true] - boolean indicating whether to use code generation
* @returns {Function} memoized ndarray constructor
*
* @example
* var f1 = ctor( 'float64', 3 );
* // returns <Function>
*
* var f2 = ctor( 'float64', 3 );
* // returns <Function>
*
* var bool = ( f1 === f2 );
* // returns true
*
* var buffer = [ 1, 2, 3, 4, 5, 6 ];
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var out = f1( buffer, shape, strides, offset, 'row-major' );
*/

/**
* Returns a method for getting an array element located at a specified linear index.
*
* @private
* @param {Function} base - parent (super) method
* @param {string} mode - specifies how to handle indices which exceed array dimensions
* @returns {Function} method for getting an array element
*/

/**
* Returns a method for returning an array element.
*
* @private
* @param {StringArray} mode - specifies how to handle indices which exceed array dimensions
* @returns {Function} method for returning an array element
*/

/**
* Returns a method for setting an array element located at a specified linear index.
*
* @private
* @param {Function} base - parent (super) method
* @param {string} mode - specifies how to handle indices which exceed array dimensions
* @returns {Function} method for setting an array element
*/

/**
* Returns a method for setting an array element.
*
* @private
* @param {StringArray} mode - specifies how to handle indices which exceed array dimensions
* @returns {Function} method for setting an array element
*/

/**
* Returns a method to return an array element.
*
* @private
* @param {PositiveInteger} ndims - number of dimensions
* @param {boolean} codegen - boolean indicating whether to use code generation
* @param {StringArray} mode - specifies how to handle indices which exceed array dimensions
* @returns {Function} method to return an array element
*/

/**
* Returns a method to set an array element.
*
* @private
* @param {PositiveInteger} ndims - number of dimensions
* @param {boolean} codegen - boolean indicating whether to use code generation
* @param {StringArray} mode - specifies how to handle indices which exceed array dimensions
* @returns {Function} method to set an array element
*/

/**
* Returns a multidimensional array.
*
* @param {(ArrayLikeObject|TypedArrayLike|Buffer|ndarrayLike)} [buffer] - data source
* @param {Options} [options] - function options
* @param {(ArrayLikeObject|TypedArrayLike|Buffer|ndarrayLike)} [options.buffer] - data source
* @param {string} [options.dtype="float64"] - underlying storage data type (if the input data is not of the same type, this option specifies the data type to which to cast the input data)
* @param {string} [options.order="row-major"] - specifies the memory layout of the array as either row-major (C-style) or column-major (Fortran-style)
* @param {NonNegativeIntegerArray} [options.shape] - array shape
* @param {boolean} [options.codegen=true] - boolean indicating whether to use code generation
* @param {string} [options.mode="throw"] - specifies how to handle indices which exceed array dimensions
* @param {StringArray} [options.submode=["throw"]] - specifies how to handle subscripts which exceed array dimensions on a per dimension basis
* @param {boolean} [options.copy=false] - boolean indicating whether to copy source data to a new data buffer
* @param {boolean} [options.flatten=true] - boolean indicating whether to automatically flatten generic array data sources
* @param {NonNegativeInteger} [options.ndmin=0] - minimum number of dimensions
* @param {string} [options.casting="safe"] - casting rule used to determine what constitutes an acceptable cast
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {Error} must provide either an array shape, data source, or both
* @throws {Error} invalid cast
* @throws {RangeError} data source must be compatible with specified meta data
* @returns {ndarray} ndarray instance
*
* @example
* var arr = array( [ [ 1, 2 ], [ 3, 4 ] ] );
* // returns <ndarray>
*
* var v = arr.get( 0, 0 );
* // returns 1
*
* @example
* var opts = {
*     'dtype': 'generic',
*     'flatten': false
* };
*
* var arr = array( [ [ 1, 2 ], [ 3, 4 ] ], opts );
* // returns <ndarray>
*
* var v = arr.get( 0 );
* // returns [ 1, 2 ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var opts = {
*     'shape': [ 2, 2 ]
* };
*
* var arr = array( new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ), opts );
* // returns <ndarray>
*
* var v = arr.get( 0, 0 );
* // returns 1.0
*/

/**
* Returns a permutation which rearranges input array.
*
* @private
* @param {ArrayLike} x - input array-like object
* @returns {Array} permutation array
*/

/**
* Returns a pseudorandom number generator for generating uniformly distributed random numbers.
*
* @param {number} [a] - minimum support (inclusive)
* @param {number} [b] - maximum support (exclusive)
* @param {Options} [options] - function options
* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers
* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed
* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
* @throws {TypeError} `a` must be a number
* @throws {TypeError} `b` must be a number
* @throws {RangeError} `a` must be less than `b`
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {Error} must provide a valid state
* @returns {PRNG} pseudorandom number generator
*
* @example
* var uniform = factory( 0.0, 1.0 );
*
* var v = uniform();
* // returns <number>
*
* @example
* var uniform = factory( -3.0, -1.0, {
*     'seed': 297
* });
* var v = uniform();
* // returns <number>
*/

/**
* Returns a root finding function.
*
* @private
* @param {PositiveNumber} a - function parameter
* @param {PositiveNumber} b - function parameter
* @param {Probability} target - probability value
* @param {boolean} invert - boolean indicating whether to find the roots of the upper or lower incomplete beta function
* @returns {Function} root finding function
*/

/**
* Returns a setter function for arrays having a specified number of dimensions.
*
* @private
* @param {PositiveInteger} ndims - array dimensions
* @param {StringArray} mode - specifies how to handle indices which exceed array dimensions
* @returns {Function} setter
*
* @example
* var f = set( 3 );
* // returns <Function>
*/

/**
* Returns a setter function for arrays having a specified number of dimensions.
*
* @private
* @param {PositiveInteger} ndims - array dimensions
* @returns {Function} setter
*
* @example
* var f = set( 3 );
* // returns <Function>
*/

/**
* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.
*
* @name uniform
* @type {PRNG}
* @param {number} a - minimum support (inclusive)
* @param {number} b - maximum support (exclusive)
* @returns {number} pseudorandom number
*
* @example
* var v = uniform( 0.0, 1.0 );
* // returns <number>
*/

/**
* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.
*
* @private
* @param {PRNG} rand - pseudorandom number generator
* @param {number} a - minimum support (inclusive)
* @param {number} b - maximum support (exclusive)
* @returns {number} pseudorandom number
*/

/**
* Returns a zero-filled contiguous linear ndarray data buffer.
*
* @param {string} dtype - data type
* @param {NonNegativeInteger} size - buffer size
* @returns {(Array|TypedArray|Buffer)|null} data buffer
*
* @example
* var buf = buffer( 'float64', 3 );
* // returns <Float64Array>[ 0.0, 0.0, 0.0 ]
*/

/**
* Returns an accumulator function which incrementally computes a corrected sample standard deviation.
*
* ## Method
*
* -   This implementation uses [Welford's method][algorithms-variance] for efficient computation, which can be derived as follows. Let
*
*     ```tex
*     \begin{align*}
*     S_n &= n \sigma_n^2 \\
*         &= \sum_{i=1}^{n} (x_i - \mu_n)^2 \\
*         &= \biggl(\sum_{i=1}^{n} x_i^2 \biggr) - n\mu_n^2
*     \end{align*}
*     ```
*
*     Accordingly,
*
*     ```tex
*     \begin{align*}
*     S_n - S_{n-1} &= \sum_{i=1}^{n} x_i^2 - n\mu_n^2 - \sum_{i=1}^{n-1} x_i^2 + (n-1)\mu_{n-1}^2 \\
*                   &= x_n^2 - n\mu_n^2 + (n-1)\mu_{n-1}^2 \\
*                   &= x_n^2 - \mu_{n-1}^2 + n(\mu_{n-1}^2 - \mu_n^2) \\
*                   &= x_n^2 - \mu_{n-1}^2 + n(\mu_{n-1} - \mu_n)(\mu_{n-1} + \mu_n) \\
*                   &= x_n^2 - \mu_{n-1}^2 + (\mu_{n-1} - x_n)(\mu_{n-1} + \mu_n) \\
*                   &= x_n^2 - \mu_{n-1}^2 + \mu_{n-1}^2 - x_n\mu_n - x_n\mu_{n-1} + \mu_n\mu_{n-1} \\
*                   &= x_n^2 - x_n\mu_n - x_n\mu_{n-1} + \mu_n\mu_{n-1} \\
*                   &= (x_n - \mu_{n-1})(x_n - \mu_n) \\
*                   &= S_{n-1} + (x_n - \mu_{n-1})(x_n - \mu_n)
*     \end{align*}
*     ```
*
*     where we use the identity
*
*     ```tex
*     x_n - \mu_{n-1} = n (\mu_n - \mu_{n-1})
*     ```
*
* [algorithms-variance]: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
*
* @param {number} [mean] - mean value
* @throws {TypeError} must provide a number primitive
* @returns {Function} accumulator function
*
* @example
* var accumulator = incrstdev();
*
* var s = accumulator();
* // returns null
*
* s = accumulator( 2.0 );
* // returns 0.0
*
* s = accumulator( -5.0 );
* // returns ~4.95
*
* s = accumulator();
* // returns ~4.95
*
* @example
* var accumulator = incrstdev( 3.0 );
*/

/**
* Returns an accumulator function which incrementally computes a sum of squared absolute values.
*
* @returns {Function} accumulator function
*
* @example
* var accumulator = incrsumabs2();
*
* var sum = accumulator();
* // returns null
*
* sum = accumulator( 2.0 );
* // returns 4.0
*
* sum = accumulator( -5.0 );
* // returns 29.0
*
* sum = accumulator();
* // returns 29.0
*/

/**
* Returns an array element located a specified linear view index.
*
* @private
* @param {integer} idx - linear view index
* @returns {*} array element
*/

/**
* Returns an array element.
*
* @private
* @param {...integer} idx - indices
* @returns {*} array element
*/

/**
* Returns an array of an object's own enumerable property `[key, value]` pairs.
*
* @param {ObjectLike} obj - input object
* @throws {TypeError} must provide an object-like value
* @returns {Array} array containing key-value pairs
*
* @example
* var obj = {
*     'beep': 'boop',
*     'foo': 'bar'
* };
*
* var entries = objectEntries( obj );
* // e.g., returns [ ['beep', 'boop'], ['foo', 'bar'] ]
*/

/**
* Returns an array of an object's own enumerable property values.
*
* @param {ObjectLike} obj - input object
* @throws {TypeError} must provide an object-like value
* @returns {Array} value array
*
* @example
* var obj = {
*     'beep': 'boop',
*     'foo': 'bar'
* };
*
* var vals = objectValues( obj );
* // e.g., returns [ 'boop', 'bar' ]
*/

/**
* Returns an index given an index mode.
*
* @param {integer} idx - index
* @param {NonNegativeInteger} max - maximum index
* @param {string} mode - specifies how to handle an index outside the interval `[0,max]`
* @throws {RangeError} index out-of-bounds
* @returns {integer} index
*
* @example
* var idx = ind( 2, 9, 'clamp' );
* // returns 2
*
* idx = ind( 10, 9, 'clamp' );
* // returns 9
*
* idx = ind( -1, 9, 'clamp' );
* // returns 0
*
* @example
* var idx = ind( 2, 9, 'wrap' );
* // returns 2
*
* idx = ind( 10, 9, 'wrap' );
* // returns 0
*
* idx = ind( -1, 9, 'wrap' );
* // returns 9
*
* @example
* var idx = ind( 2, 9, 'throw' );
* // returns 2
*
* idx = ind( 10, 9, 'throw' );
* // throws <RangeError>
*
* idx = ind( -1, 9, 'throw' );
* // throws <RangeError>
*/

/**
* Returns an ndarray constructor.
*
* @param {string} dtype - data type
* @param {PositiveInteger} ndims - number of dimensions
* @param {Options} [options] - function options
* @param {boolean} [options.codegen=true] - boolean indicating whether to use code generation
* @param {string} [options.mode="throw"] - specifies how to handle indices which exceed array dimensions
* @param {StringArray} [options.submode=["throw"]] - specifies how to handle subscripts which exceed array dimensions on a per dimension basis
* @throws {TypeError} first argument must be a supported ndarray data type
* @throws {TypeError} second argument must be a number having a positive integer value
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {RangeError} too many dimensions
* @returns {Function} ndarray constructor
*
* @example
* var ndarray = ctor( 'generic', 2 );
* // returns <Function>
*
* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var out = ndarray( buffer, shape, strides, offset, 'row-major' );
*/

/**
* Returns an ndarray constructor.
*
* @param {string} dtype - data type
* @param {PositiveInteger} ndims - number of dimensions
* @param {Options} [options] - function options
* @param {boolean} [options.codegen=true] - boolean indicating whether to use code generation
* @returns {Function} ndarray constructor
*
* @example
* var ndarray = ctor( 'float64', 3 );
* // returns <Function>
*
* var buffer = [ 1, 2, 3, 4, 5, 6 ];
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var out = ndarray( buffer, shape, strides, offset, 'row-major' );
*/

/**
* Returns an ndarray data buffer constructor.
*
* @param {string} dtype - data type
* @returns {(Function|null)} data buffer constructor or null
*
* @example
* var ctor = ctors( 'float64' );
* // returns <Function>
*
* @example
* var ctor = ctors( 'float' );
* // returns null
*/

/**
* Returns array iteration order.
*
* ## Notes
*
* -   Return value key:
*
*     -   `0`: unordered (i.e., strides of mixed sign; e.g., `[ 9, -3, 1 ]`)
*     -   `1`: ordered left-to-right (i.e., all nonnegative strides)
*     -   `-1`: ordered right-to-left (i.e., all negative strides)
*
* @param {IntegerArray} strides - stride array
* @returns {integer} iteration order
*
* @example
* var o = iterationOrder( [ 2, 1 ] );
* // returns 1
*
* o = iterationOrder( [ -2, 1 ] );
* // returns 0
*
* o = iterationOrder( [ -2, -1 ] );
* // returns -1
*/

/**
* Returns n spaces.
*
* @private
* @param {integer} n - number of spaces
* @returns {string} n spaces
*/

/**
* Returns the arithmetic range of an array.
*
* @param {Array} arr - input array
* @returns {Array} arithmetic range
*/

/**
* Returns the arithmetic range of an array.
*
* @private
* @param {Array} arr - input array
* @returns {Array} arithmetic range
*/

/**
* Returns the data type of an ndarray data buffer.
*
* @param {*} value - input value
* @returns {(string|null)} data type
*
* @example
* var dt = dtype( [ 1, 2, 3 ] );
* // returns 'generic'
*
* var dt = dtype( 'beep' );
* // returns null
*/

/**
* Returns the filled output panel.
*/

/**
* Returns the index offset which specifies the location of the first indexed value in a multidimensional array based on a stride array.
*
* @param {NonNegativeIntegerArray} shape - array shape
* @param {IntegerArray} strides - stride array
* @returns {NonNegativeInteger} offset - offset
*
* @example
* var shape = [ 2, 3, 10 ];
* var strides = [ 30, -10, 1 ];
*
* var offset = strides2offset( shape, strides );
* // returns 20
*/

/**
* Returns the inverse of the incomplete beta function via the Student t distribution.
*
* @private
* @param {PositiveNumber} a - function parameter
* @param {Probability} p - probability value
* @param {Object} py - placeholder object holding one minus the returned value
* @returns {number} function value
*/

/**
* Returns the majority vote prediction for the chosen item.
*/

/**
* Returns the maximum absolute value.
*
* @param {number} [x] - first number
* @param {number} [y] - second number
* @param {...number} [args] - numbers
* @returns {number} maximum absolute value
*
* @example
* var v = maxabs( 3.14, -4.2 );
* // returns 4.2
*
* @example
* var v = maxabs( 5.9, 3.14, 4.2 );
* // returns 5.9
*
* @example
* var v = maxabs( 3.14, NaN );
* // returns NaN
*
* @example
* var v = maxabs( +0.0, -0.0 );
* // returns +0.0
*/

/**
* Returns the maximum element currently in the queue and remove it.
*/

/**
* Returns the maximum element currently in the queue.
*/

/**
* Returns the maximum value.
*
* @private
* @param {ndarrayLike} arr - input array
* @param {number} j - column index for which to get the maximum
* @param {number} len - number of rows in arr
* @returns {number} maximum value
*/

/**
* Returns the minimum absolute value.
*
* @param {number} [x] - first number
* @param {number} [y] - second number
* @param {...number} [args] - numbers
* @returns {number} minimum absolute value
*
* @example
* var v = minabs( -3.14, 4.2 );
* // returns 3.14
*
* @example
* var v = minabs( 5.9, 3.14, 4.2 );
* // returns 3.14
*
* @example
* var v = minabs( 3.14, NaN );
* // returns NaN
*
* @example
* var v = minabs( +0.0, -0.0 );
* // returns +0.0
*/

/**
* Returns the minimum value.
*
* @private
* @param {ndarrayLike} arr - input array
* @param {number} j - column index for which to get the range
* @param {number} len - number of rows in arr
* @returns {number} minimum value
*/

/**
* Returns the number of bytes per element provided an underlying array data type.
*
* @param {string} dtype - data type
* @returns {(NonNegativeInteger|null)} number of bytes per element
*
* @example
* var nbytes = bytesPerElement( 'float64' );
* // returns 8
*
* nbytes = bytesPerElement( 'generic' );
* // returns null
*/

/**
* Returns the number of elements in an array.
*
* @param {(NonNegativeIntegerArray|EmptyArray)} shape - array shape
* @returns {NonNegativeInteger} number of elements
*
* @example
* var n = numel( [ 3, 3, 3 ] );
* // returns 27
*/

/**
* Returns the positive number satisfying \\( \eta^2/2=\lambda-1-\ln(\lambda) \\) with \\( \operatorname{sign}(\lambda-1)=\operatorname{sign}(\eta) \\).
*
* @private
* @param {number} eta - eta value
* @returns {number} value satisfying equation
*/

/**
* Returns the predicted value for the i-th observation using the decision tree.
*/

/**
* Returns the specified kernel function.
*
* @private
* @param {string} name - kernel name
* @returns {(Function|Error)} kernel function or corresponding error
*/

/**
* Returns the unique elements in an array.
*
* @private
* @param {Array} arr - input array
* @returns {Array} array of unique elements
*/

/**
* Scrolls a vertical scrollbar to the specified position.
*
* @param {Node} element - DOM node with the scrollbar to change
* @param {number} to - vertical position of the scroll bar after animation
* @param {integer} duration - number of milliseconds until animation shall be complete
* @returns {void}
*/

/**
* Serializes an ndarray as a JSON object.
*
* ## Notes
*
* -   The method does **not** serialize data outside of the buffer region defined by the array configuration.
*
* @private
* @returns {Object} JSON representation
*/

/**
* Serializes an ndarray as a string.
*
* ## Notes
*
* -   The method does **not** serialize data outside of the buffer region defined by the array configuration.
*
* @private
* @returns {string} string representation
*/

/**
* Series approximation to the incomplete beta.
*
* @private
* @param {NonNegativeNumber} a - function parameter
* @param {NonNegativeNumber} b - function parameter
* @param {Probability} x - function parameter
* @param {number} result - initial result value
* @returns {Function} series function
*/

/**
* Series representation for upper fraction when `z` is small.
*
* @private
* @param {number} a - function parameter
* @param {number} x - function parameter
* @returns {Function} series function
*/

/**
* Sets an array element located a specified linear view index.
*
* @private
* @param {integer} idx - linear view index
* @param {*} v - value to set
* @returns {ndarray} ndarray instance
*/

/**
* Sets an array element.
*
* @private
* @param {...integer} idx - indices
* @param {*} v - value to set
* @returns {ndarray} ndarray instance
*/

/**
* Smallest positive double-precision floating-point subnormal number.
*
* @module @stdlib/constants/math/float64-smallest-subnormal
* @type {number}
*
* @example
* var FLOAT64_SMALLEST_SUBNORMAL = require( '@stdlib/constants/math/float64-smallest-subnormal' );
* // returns 4.940656458412465e-324
*/

/**
* Smallest positive single-precision floating-point normal number.
*
* @module @stdlib/constants/math/float32-smallest-normal
* @type {number}
*
* @example
* var FLOAT32_SMALLEST_NORMAL = require( '@stdlib/constants/math/float32-smallest-normal' );
* // returns 1.1754943508222875e-38
*/

/**
* Soft-thresholding operator.
*
* @param {number} x - input value
* @param {number} t - threshold value
* @returns {number} return value
*/

/**
* Split values into two groups according to a predicate function.
*
* @module @stdlib/utils/bifurcate-by
*
* @example
* var bifurcateBy = require( '@stdlib/utils/bifurcate-by' );
*
* function predicate( v ) {
*     return v[ 0 ] === 'b';
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = bifurcateBy( arr, predicate );
* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]
*
* @example
* var bifurcateBy = require( '@stdlib/utils/bifurcate-by' );
*
* function predicate( v ) {
*     return v[ 0 ] === 'b';
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var opts = {
*     'returns': 'indices'
* };
* var out = bifurcateBy( arr, opts, predicate );
* // returns [ [ 0, 1, 3 ], [ 2 ] ]
*
* @example
* var bifurcateBy = require( '@stdlib/utils/bifurcate-by' );
*
* function predicate( v ) {
*     return v[ 0 ] === 'b';
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var opts = {
*     'returns': '*'
* };
* var out = bifurcateBy( arr, opts, predicate );
* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]
*/

/**
* Splits an input array by group and calls a function with the sub-array of each group.
*
* @private
* @param {Array} arr - input array
* @param {string} factor - group values
* @param {Function} fun - function to invoke with the array of values for each group
* @returns {Object} table with keys corresponding to the unique group labels and values corresponding to the function values for each sub-array
*/

/**
* Splits two input arrays by group and calls a supplied function with the two sub-arrays for each group.
*
* @private
* @param {Array} arr1 - first input array
* @param {Array} arr2 - second input array
* @param {string} factor - group values
* @param {Function} fun - function to invoke for each group
* @returns {Object} table with keys corresponding to the unique group labels and values corresponding to the function values
*/

/**
* Splits values into two groups according to a predicate function and outputs results as element indices.
*
* @private
* @param {Collection} collection - input collection
* @param {Options} opts - function options
* @param {*} [opts.thisArg] - execution context
* @param {Function} predicate - predicate function specifying which group an element in the input collection belongs to
* @returns {(Array<Array>|Array)} results
*
* @example
* function predicate( v ) {
*     return v[ 0 ] === 'b';
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = bifurcateBy( arr, {}, predicate );
* // returns [ [ 0, 1, 3 ], [ 2 ] ]
*/

/**
* Splits values into two groups according to a predicate function and outputs results as element values.
*
* ## Notes
*
* -   We need to cache the collection value to prevent the edge case where, during the invocation of the predicate function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.
*
*
* @private
* @param {Collection} collection - input collection
* @param {Options} opts - function options
* @param {*} [opts.thisArg] - execution context
* @param {Function} predicate - predicate function indicating which group an element in the input collection belongs to
* @returns {(Array<Array>|Array)} results
*
* @example
* function predicate( v ) {
*     return v[ 0 ] === 'b';
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = bifurcateBy( arr, {}, predicate );
* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]
*/

/**
* Splits values into two groups according to a predicate function and outputs results as index-element values.
*
* ## Notes
*
* -   We need to cache the collection value to prevent the edge case where, during the invocation of the predicate function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.
*
*
* @private
* @param {Collection} collection - input collection
* @param {Options} opts - function options
* @param {*} [opts.thisArg] - execution context
* @param {Function} predicate - predicate function indicating which group an element in the input collection belongs to
* @returns {(Array<Array>|Array)} results
*
* @example
* function predicate( v ) {
*     return v[ 0 ] === 'b';
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = bifurcateBy( arr, {}, predicate );
* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]
*/

/**
* Splits values into two groups according to a predicate function.
*
* @param {Collection} collection - input collection
* @param {Options} [options] - function options
* @param {*} [options.thisArg] - execution context
* @param {string} [options.returns="values"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned
* @param {Function} predicate - predicate function indicating which group an element in the input collection belongs to
* @throws {TypeError} first argument must be a collection
* @throws {TypeError} options argument must be an object
* @throws {TypeError} last argument must be a function
* @throws {TypeError} must provide valid options
* @returns {(Array<Array>|Array)} group results
*
* @example
* function predicate( v ) {
*     return v[ 0 ] === 'b';
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var out = bifurcateBy( arr, predicate );
* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]
*
* @example
* function predicate( v ) {
*     return v[ 0 ] === 'b';
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var opts = {
*     'returns': 'indices'
* };
* var out = bifurcateBy( arr, opts, predicate );
* // returns [ [ 0, 1, 3 ], [ 2 ] ]
*
* @example
* function predicate( v ) {
*     return v[ 0 ] === 'b';
* }
* var arr = [ 'beep', 'boop', 'foo', 'bar' ];
*
* var opts = {
*     'returns': '*'
* };
* var out = bifurcateBy( arr, opts, predicate );
* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]
*/

/**
* Splitting observations using specific predicate and pivot.
*/

/**
* Square root of `2`.
*
* @module @stdlib/constants/math/float64-sqrt-two
* @type {number}
*
* @example
* var SQRT2 = require( '@stdlib/constants/math/float64-sqrt-two' );
* // returns 1.4142135623730951
*/

/**
* Square root of `2`.
*
* ```tex
* \sqrt{2}
* ```
*
* @constant
* @type {number}
* @default 1.4142135623730951
*/

/**
* Standardizes elements in input array.
*
* @param {Array} x - input array
* @param {boolean} demean - controls whether the mean should be subtracted from the values
* @param {boolean} scale - controls whether values should be divided by the standard deviation
* @returns {Array} output array with added `mu` and `sigma` properties
*/

/**
* Student's t distribution cumulative distribution function (CDF).
*
* @module @stdlib/stats/base/dists/t/cdf
*
* @example
* var cdf = require( '@stdlib/stats/base/dists/t/cdf' );
*
* var y = cdf( 2.0, 0.1 );
* // returns ~0.611
*
* y = cdf( 1.0, 2.0 );
* // returns ~0.789
*
* y = cdf( -1.0, 4.0 );
* // returns ~0.187
*
* var mycdf = cdf.factory( 0.5 );
* y = mycdf( 3.0 );
* // returns ~0.816
*
* y = mycdf( 1.0 );
* // returns ~0.699
*/

/**
* Sum the elements of the series given by the supplied function.
*
* @module @stdlib/math/base/tools/sum-series
*
* @example
* var sumSeries = require( '@stdlib/math/base/tools/sum-series' );
*
* var gen = geometricSeriesClosure( 0.9 )
* var out = sumSeries( gen );
* // returns 10
*
* function geometricSeriesClosure( x ) {
*     var exponent = -1;
*     return function() {
*         exponent += 1;
*         return Math.pow( x, exponent );
*     };
* }
*/

/**
* Sum the elements of the series given by the supplied function.
*
* @param {Function} generator - series function
* @param {Object} [options] - function options
* @param {PositiveInteger} [options.maxTerms=1000000] - maximum number of terms to be added
* @param {PositiveNumber} [options.tolerance=2.22e-16] - further terms are only added as long as the next term is greater than current term times the tolerance
* @param {number} [options.initialValue=0] - initial value of the resulting sum
* @returns {number} sum of all series terms
*
* @example
* var gen = geometricSeriesClosure( 0.9 )
* var out = sumSeries( gen );
* // returns 10.0
*
* function geometricSeriesClosure( x ) {
*     var exponent = -1;
*     return function() {
*         exponent += 1;
*         return Math.pow( x, exponent );
*     };
* }
*/

/**
* Sum the elements of the series given by the supplied function.
*
* @param {Function} generator - series function
* @param {Object} [options] - function options
* @param {PositiveInteger} [options.maxTerms=1000000] - maximum number of terms to be added
* @param {PositiveNumber} [options.tolerance=2.22e-16] - further terms are only added as long as the next term is greater than current term times the tolerance
* @param {number} [options.initialValue=0] - initial value of the resulting sum
* @returns {number} sum of all series terms
*
* @example
* var gen = geometricSeriesGenerator( 0.9 );
* var out = sumSeries( gen );
* // returns 10.0
*
* function* geometricSeriesGenerator( x ) {
*     var exponent = 0;
*     while ( true ) {
*         yield Math.pow( x, exponent );
*         exponent += 1;
*     }
* }
*/

/**
* Sums elements of an array.
*
* @private
* @param {Array} arr - input array
* @returns {number} array sum
*/

/**
* Sums elements of the series expansion of the lower incomplete gamma function.
*
* ## Method
*
* -   Multiply result by `((z^a) * (e^-z) / a)` to get the full lower incomplete integral.
* -   Divide by `tgamma(a)` to get the normalized value.
*
* @private
* @param {number} a - function parameter
* @param {number} z - function parameter
* @param {number} initialValue - initial value of the resulting sum
* @returns {number} sum of terms of lower gamma series
*/

/**
* Test for native `function*()` support.
*
* @module @stdlib/assert/has-generator-support
*
* @example
* var hasGeneratorSupport = require( '@stdlib/assert/has-generator-support' );
*
* var bool = hasGeneratorSupport();
* // returns <boolean>
*/

/**
* Test if a value is a 2-dimensional ndarray-like object.
*
* @module @stdlib/assert/is-matrix-like
*
* @example
* var ctor = require( '@stdlib/ndarray/ctor' );
* var isMatrixLike = require( '@stdlib/assert/is-matrix-like' );
*
* var ndarray = ctor( 'generic', 2 );
*
* var arr = ndarray( [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
*
* var bool = isMatrixLike( arr );
* // returns true
*
* bool = isMatrixLike( [] );
* // returns false
*/

/**
* Test if a value is a nonnegative number.
*
* @module @stdlib/assert/is-nonnegative-number
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' );
*
* var bool = isNonNegativeNumber( 5.0 );
* // returns true
*
* bool = isNonNegativeNumber( new Number( 5.0 ) );
* // returns true
*
* bool = isNonNegativeNumber( 3.14 );
* // returns true
*
* bool = isNonNegativeNumber( -5.0 );
* // returns false
*
* bool = isNonNegativeNumber( null );
* // returns false
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;
*
* var bool = isNonNegativeNumber( 3.0 );
* // returns true
*
* bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns false
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isObject;
*
* var bool = isNonNegativeNumber( 3.0 );
* // returns false
*
* bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns true
*/

/**
* Test if a value is a numeric array.
*
* @module @stdlib/assert/is-numeric-array
*
* @example
* var isNumericArray = require( '@stdlib/assert/is-numeric-array' );
*
* var bool = isNumericArray( new Int8Array( 10 ) );
* // returns true
*
* bool = isNumericArray( [ 1, 2, 3 ] );
* // returns true
*
* bool = isNumericArray( [ '1', '2', '3' ] );
* // returns false
*/

/**
* Test if a value is a parseable JSON string.
*
* @module @stdlib/assert/is-json
*
* @example
* var isJSON = require( '@stdlib/assert/is-json' );
*
* var v = isJSON( '{"a":5}' );
* // returns true
*
* v = isJSON( '{a":5}' );
* // returns false
*/

/**
* Test if a value is a positive number.
*
* @module @stdlib/assert/is-positive-number
*
* @example
* var isPositiveNumber = require( '@stdlib/assert/is-positive-number' );
*
* var bool = isPositiveNumber( 5.0 );
* // returns true
*
* bool = isPositiveNumber( new Number( 5.0 ) );
* // returns true
*
* bool = isPositiveNumber( 3.14 );
* // returns true
*
* bool = isPositiveNumber( -5.0 );
* // returns false
*
* bool = isPositiveNumber( null );
* // returns false
*
* @example
* var isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;
*
* var bool = isPositiveNumber( 3.0 );
* // returns true
*
* bool = isPositiveNumber( new Number( 3.0 ) );
* // returns false
*
* @example
* var isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isObject;
*
* var bool = isPositiveNumber( 3.0 );
* // returns false
*
* bool = isPositiveNumber( new Number( 3.0 ) );
* // returns true
*/

/**
* Test if a value is a probability.
*
* @module @stdlib/assert/is-probability
*
* @example
* var isProbability = require( '@stdlib/assert/is-probability' );
*
* var bool = isProbability( 0.5 );
* // returns true
*
* bool = isProbability( new Number( 0.5 ) );
* // returns true
*
* bool = isProbability( 3.14 );
* // returns false
*
* bool = isProbability( -5.0 );
* // returns false
*
* bool = isProbability( null );
* // returns false
*
* @example
* var isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;
*
* var bool = isProbability( 0.3 );
* // returns true
*
* bool = isProbability( new Number( 0.3 ) );
* // returns false
*
* @example
* var isProbability = require( '@stdlib/assert/is-probability' ).isObject;
*
* var bool = isProbability( 0.77 );
* // returns false
*
* bool = isProbability( new Number( 0.77 ) );
* // returns true
*/

/**
* Test if a value is an array of arrays.
*
* @module @stdlib/assert/is-array-array
*
* @example
* var isArrayArray = require( '@stdlib/assert/is-array-array' );
*
* var bool = isArrayArray( [ [], [] ] );
* // returns true
*
* bool = isArrayArray( [ {}, {} ] );
* // returns false
*
* bool = isArrayArray( [] );
* // returns false
*/

/**
* Test if a value is an array-like object containing only integers.
*
* @module @stdlib/assert/is-integer-array
*
* @example
* var isIntegerArray = require( '@stdlib/assert/is-integer-array' );
*
* var bool = isIntegerArray( [ -3.0, new Number(0.0), 2.0 ] );
* // returns true
*
* bool = isIntegerArray( [ -3.0, '3.0' ] );
* // returns false
*
* @example
* var isIntegerArray = require( '@stdlib/assert/is-integer-array' ).primitives;
*
* var bool = isIntegerArray( [ -1.0, 10.0 ] );
* // returns true
*
* bool = isIntegerArray( [ -1.0, 0.0, 5.0 ] );
* // returns true
*
* bool = isIntegerArray( [ -3.0, new Number(-1.0) ] );
* // returns false
*
* @example
* var isIntegerArray = require( '@stdlib/assert/is-integer-array' ).objects;
*
* var bool = isIntegerArray( [ new Number(1.0), new Number(3.0) ] );
* // returns true
*
* bool = isIntegerArray( [ -1.0, 0.0, 3.0 ] );
* // returns false
*
* bool = isIntegerArray( [ 3.0, new Number(-1.0) ] );
* // returns false
*/

/**
* Test if a value is an array-like object containing only nonnegative integers.
*
* @module @stdlib/assert/is-nonnegative-integer-array
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' );
*
* var bool = isNonNegativeIntegerArray( [ 3.0, new Number(3.0) ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 3.0, '3.0' ] );
* // returns false
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives;
*
* var bool = isNonNegativeIntegerArray( [ 1.0, 0.0, 10.0 ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 3.0, new Number(1.0) ] );
* // returns false
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).objects;
*
* var bool = isNonNegativeIntegerArray( [ new Number(3.0), new Number(1.0) ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 1.0, 0.0, 10.0 ] );
* // returns false
*/

/**
* Test if a value is an array-like object containing only objects.
*
* @module @stdlib/assert/is-object-array
*
* @example
* var isObjectArray = require( '@stdlib/assert/is-object-array' );
*
* var bool = isObjectArray( [ {}, new Number(3.0) ] );
* // returns true
*
* bool = isObjectArray( [ {}, { 'beep': 'boop' } ] );
* // returns true
*
* bool = isObjectArray( [ {}, '3.0' ] );
* // returns false
*/

/**
* Test if a value is an array-like object containing only positive integers.
*
* @module @stdlib/assert/is-positive-integer-array
*
* @example
* var isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' );
*
* var bool = isPositiveIntegerArray( [ 3.0, new Number(3.0) ] );
* // returns true
*
* bool = isPositiveIntegerArray( [ 3.0, '3.0' ] );
* // returns false
*
* @example
* var isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' ).primitives;
*
* var bool = isPositiveIntegerArray( [ 1.0, 2.0, 10.0 ] );
* // returns true
*
* bool = isPositiveIntegerArray( [ 3.0, new Number(1.0) ] );
* // returns false
*
* @example
* var isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' ).objects;
*
* var bool = isPositiveIntegerArray( [ new Number(3.0), new Number(1.0) ] );
* // returns true
*
* bool = isPositiveIntegerArray( [ 1.0, 2.0, 10.0 ] );
* // returns false
*/

/**
* Test if a value is an array-like object containing only positive numbers.
*
* @module @stdlib/assert/is-positive-number-array
*
* @example
* var isPositiveNumberArray = require( '@stdlib/assert/is-positive-number-array' );
*
* var bool = isPositiveNumberArray( [ 3.0, new Number(3.0) ] );
* // returns true
*
* bool = isPositiveNumberArray( [ 3.0, '3.0' ] );
* // returns false
*
* @example
* var isPositiveNumberArray = require( '@stdlib/assert/is-positive-number-array' ).primitives;
*
* var bool = isPositiveNumberArray( [ 1.0, 5.0, 10.0 ] );
* // returns true
*
* bool = isPositiveNumberArray( [ 3.0, new Number(1.0) ] );
* // returns false
*
* @example
* var isPositiveNumberArray = require( '@stdlib/assert/is-positive-number-array' ).objects;
*
* var bool = isPositiveNumberArray( [ new Number(3.0), new Number(1.0) ] );
* // returns true
*
* bool = isPositiveNumberArray( [ 1.0, 5.0, 10.0 ] );
* // returns false
*/

/**
* Test if a value is an array-like object of numbers.
*
* @module @stdlib/assert/is-number-array
*
* @example
* var isNumberArray = require( '@stdlib/assert/is-number-array' );
*
* var bool = isNumberArray( [ 1, 2, 3 ] );
* // returns true
*
* bool = isNumberArray( [ '1', 2, 3 ] );
* // returns false
*
* @example
* var isNumberArray = require( '@stdlib/assert/is-number-array' ).primitives;
*
* var bool = isNumberArray( [ 1, 2, 3 ] );
* // returns true
*
* bool = isNumberArray( [ 1, new Number( 2 ) ] );
* // returns false
*
* @example
* var isNumberArray = require( '@stdlib/assert/is-number-array' ).objects;
*
* var bool = isNumberArray( [ new Number( 1 ), new Number( 2 ) ] );
* // returns true
*
* bool = isNumberArray( [ new Number( 1 ), 2 ] );
* // returns false
*/

/**
* Test if a value is an array-like object.
*
* @module @stdlib/assert/is-array-like-object
*
* @example
* var isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );
*
* var bool = isArrayLikeObject( [] );
* // returns true
*
* bool = isArrayLikeObject( { 'length':10 } );
* // returns true
*
* bool = isArrayLikeObject( 'beep' );
* // returns false
*/

/**
* Test if a value is ndarray-like.
*
* @module @stdlib/assert/is-ndarray-like
*
* @example
* var ctor = require( '@stdlib/ndarray/ctor' );
* var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
*
* var ndarray = ctor( 'generic', 2 );
*
* var arr = ndarray( [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
*
* var bool = isndarrayLike( arr );
* // returns true
*
* bool = isndarrayLike( [] );
* // returns false
*/

/**
* Test if a value is typed-array-like.
*
* @module @stdlib/assert/is-typed-array-like
*
* @example
* var Int16Array = require( '@stdlib/array/int16' );
* var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );
*
* var bool = isTypedArrayLike( new Int16Array() );
* // returns true
*
* bool = isTypedArrayLike({
*	'length': 10,
*	'byteOffset': 0,
*	'byteLength': 10,
*	'BYTES_PER_ELEMENT': 4
* });
* // returns true
*/

/**
* Test whether a string contains only numeric digits.
*
* @module @stdlib/assert/is-digit-string
*
* @example
* var isDigitString = require( '@stdlib/assert/is-digit-string' );
*
* var out = isDigitString( '0123456789' );
* // returns true
*
* out = isDigitString( '0xffffff' );
* // returns false
*
* out = isDigitString( '' );
* // returns false
*/

/**
* Test whether an input value is a supported ndarray casting mode.
*
* @module @stdlib/ndarray/base/assert/is-casting-mode
*
* @example
* var isCastingMode = require( '@stdlib/ndarray/base/assert/is-casting-mode' );
*
* var bool = isCastingMode( 'none' );
* // returns true
*
* bool = isCastingMode( 'equiv' );
* // returns true
*
* bool = isCastingMode( 'safe' );
* // returns true
*
* bool = isCastingMode( 'same-kind' );
* // returns true
*
* bool = isCastingMode( 'unsafe' );
* // returns true
*
* bool = isCastingMode( 'foo' );
* // returns false
*/

/**
* Test whether an input value is a supported ndarray data type.
*
* @module @stdlib/ndarray/base/assert/is-data-type
*
* @example
* var isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' );
*
* var bool = isDataType( 'binary' );
* // returns true
*
* bool = isDataType( 'float32' );
* // returns true
*
* bool = isDataType( 'float64' );
* // returns true
*
* bool = isDataType( 'generic' );
* // returns true
*
* bool = isDataType( 'int16' );
* // returns true
*
* bool = isDataType( 'int32' );
* // returns true
*
* bool = isDataType( 'int8' );
* // returns true
*
* bool = isDataType( 'uint16' );
* // returns true
*
* bool = isDataType( 'uint32' );
* // returns true
*
* bool = isDataType( 'uint8' );
* // returns true
*
* bool = isDataType( 'uint8c' );
* // returns true
*
* bool = isDataType( 'foo' );
* // returns false
*/

/**
* Test whether an input value is a supported ndarray index mode.
*
* @module @stdlib/ndarray/base/assert/is-index-mode
*
* @example
* var isIndexMode = require( '@stdlib/ndarray/base/assert/is-index-mode' );
*
* var bool = isIndexMode( 'wrap' );
* // returns true
*
* bool = isIndexMode( 'clamp' );
* // returns true
*
* bool = isIndexMode( 'throw' );
* // returns true
*
* bool = isIndexMode( 'foo' );
* // returns false
*/

/**
* Test whether an input value is an ndarray order.
*
* @module @stdlib/ndarray/base/assert/is-order
*
* @example
* var isOrder = require( '@stdlib/ndarray/base/assert/is-order' );
*
* var bool = isOrder( 'row-major' );
* // returns true
*
* bool = isOrder( 'column-major' );
* // returns true
*
* bool = isOrder( 'foo' );
* // returns false
*/

/**
* Tests (loosely) if an input value is an array-like object.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if an input value is an array-like object
*
* @example
* var bool = isArrayLikeObject( [] );
* // returns true
*
* @example
* var bool = isArrayLikeObject( '' );
* // returns false
*/

/**
* Tests for native `function*()` support.
*
* @returns {boolean} boolean indicating if an environment has native `function*()` support
*
* @example
* var bool = hasGeneratorSupport();
* // returns <boolean>
*/

/**
* Tests if a value is a 2-dimensional ndarray-like object.
*
* @param {*} v - value to test
* @returns {boolean} boolean indicating if a value is a 2-dimensional ndarray-like object
*
* @example
* var ctor = require( '@stdlib/ndarray/ctor' );
*
* var ndarray = ctor( 'generic', 2 );
* var arr = ndarray( [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
*
* var bool = isMatrixLike( arr );
* // returns true
*
* bool = isMatrixLike( [] );
* // returns false
*/

/**
* Tests if a value is a nonnegative number.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a nonnegative number
*
* @example
* var bool = isNonNegativeNumber( 5.0 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( 3.14 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( -5.0 );
* // returns false
*
* @example
* var bool = isNonNegativeNumber( null );
* // returns false
*/

/**
* Tests if a value is a number object having a nonnegative value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a nonnegative number value
*
* @example
* var bool = isNonNegativeNumber( 3.0 );
* // returns false
*
* @example
* var bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns true
*/

/**
* Tests if a value is a number object having a positive value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a positive value
*
* @example
* var bool = isPositiveNumber( 3.0 );
* // returns false
*
* @example
* var bool = isPositiveNumber( new Number( 3.0 ) );
* // returns true
*/

/**
* Tests if a value is a number object having a value which is a probability.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a value which is a probability
*
* @example
* var bool = isProbability( 0.5 );
* // returns false
*
* @example
* var bool = isProbability( new Number( 0.5 ) );
* // returns true
*/

/**
* Tests if a value is a number primitive having a nonnegative value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative number value
*
* @example
* var bool = isNonNegativeNumber( 3.0 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns false
*/

/**
* Tests if a value is a number primitive having a positive value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a positive value
*
* @example
* var bool = isPositiveNumber( 3.0 );
* // returns true
*
* @example
* var bool = isPositiveNumber( new Number( 3.0 ) );
* // returns false
*/

/**
* Tests if a value is a number primitive having a value which is a probability.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a value which is a probability
*
* @example
* var bool = isProbability( 0.66 );
* // returns true
*
* @example
* var bool = isProbability( new Number( 0.66 ) );
* // returns false
*/

/**
* Tests if a value is a numeric array.
*
* @param {*} v - value to test
* @returns {boolean} boolean indicating if a value is a numeric array
*
* @example
* var bool = isNumericArray( new Int8Array( 10 ) );
* // returns true
*
* bool = isNumericArray( [ 1, 2, 3 ] );
* // returns true
*
* bool = isNumericArray( [ '1', '2', '3' ] );
* // returns false
*/

/**
* Tests if a value is a parseable JSON string.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a parseable JSON string
*
* @example
* var v = isJSON( '{"a":5}' );
* // returns true
*
* @example
* var v = isJSON( '{a":5}' );
* // returns false
*/

/**
* Tests if a value is a positive number.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a positive number
*
* @example
* var bool = isPositiveNumber( 5.0 );
* // returns true
*
* @example
* var bool = isPositiveNumber( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isPositiveNumber( 3.14 );
* // returns true
*
* @example
* var bool = isPositiveNumber( -5.0 );
* // returns false
*
* @example
* var bool = isPositiveNumber( null );
* // returns false
*/

/**
* Tests if a value is a probability.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a probability
*
* @example
* var bool = isProbability( 0.5 );
* // returns true
*
* @example
* var bool = isProbability( new Number( 0.5 ) );
* // returns true
*
* @example
* var bool = isProbability( 3.14 );
* // returns false
*
* @example
* var bool = isProbability( -5.0 );
* // returns false
*
* @example
* var bool = isProbability( null );
* // returns false
*/

/**
* Tests if a value is an array-like object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is an array-like object
*
* @example
* var bool = isArrayLikeObject( [] );
* // returns true
*
* @example
* var bool = isArrayLikeObject( { 'length':10 } );
* // returns true
*
* @example
* var bool = isArrayLikeObject( 'beep' );
* // returns false
*/

/**
* Tests if a value is ndarray-like.
*
* @param {*} v - value to test
* @returns {boolean} boolean indicating if a value is ndarray-like
*
* @example
* var ctor = require( '@stdlib/ndarray/ctor' );
*
* var ndarray = ctor( 'generic', 2 );
* var arr = ndarray( [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
*
* var bool = isndarrayLike( arr );
* // returns true
*
* bool = isndarrayLike( [] );
* // returns false
*/

/**
* Tests if a value is typed-array-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is typed-array-like
*
* @example
* var arr = {
*	'BYTES_PER_ELEMENT': 8,
*	'length': 10,
*	'byteOffset': 0,
*	'byteLength': 10
* };
* var val = isTypedArrayLike( arr );
* // returns true
*
* @example
* var Int8Array = require( '@stdlib/array/int8' );
*
* var val = isTypedArrayLike( new Int8Array( 4 ) );
* // returns true
*
* @example
* var val = isTypedArrayLike( [] );
* // returns false
*
* @example
* var val = isTypedArrayLike( {} );
* // returns false
*
* @example
* var val = isTypedArrayLike( null );
* // returns false
*
* @example
* var val = isTypedArrayLike( 'beep' );
* // returns false
*/

/**
* Tests that a value is a valid constructor.
*
* @private
* @param {*} value - value to test
* @returns {(Error|null)} error object or null
*
* @example
* var ctor = function ctor() {};
*
* var err = validate( ctor );
* // returns null
*
* err = validate( null );
* // returns <TypeError>
*/

/**
* Tests whether a string contains only numeric digits.
*
* @param {*} x - value to test
* @returns {boolean} boolean indicating if a string contains only numeric digits
*
* @example
* var out = isDigitString( '0123456789' );
* // returns true
*
* @example
* var out = isDigitString( '0xffffff' );
* // returns false
*
* @example
* var out = isDigitString( '' );
* // returns false
*
* @example
* var out = isDigitString( 123 );
* // returns false
*/

/**
* Tests whether an input value is a supported ndarray casting mode.
*
* @param {*} v - value to test
* @returns {boolean} boolean indicating whether an input value is a supported ndarray casting mode
*
* @example
* var bool = isCastingMode( 'none' );
* // returns true
*
* bool = isCastingMode( 'equiv' );
* // returns true
*
* bool = isCastingMode( 'safe' );
* // returns true
*
* bool = isCastingMode( 'same-kind' );
* // returns true
*
* bool = isCastingMode( 'unsafe' );
* // returns true
*
* bool = isCastingMode( 'foo' );
* // returns false
*/

/**
* Tests whether an input value is a supported ndarray data type.
*
* @param {*} v - value to test
* @returns {boolean} boolean indicating whether an input value is a supported ndarray data type
*
* @example
* var bool = isDataType( 'binary' );
* // returns true
*
* bool = isDataType( 'float32' );
* // returns true
*
* bool = isDataType( 'float64' );
* // returns true
*
* bool = isDataType( 'generic' );
* // returns true
*
* bool = isDataType( 'int16' );
* // returns true
*
* bool = isDataType( 'int32' );
* // returns true
*
* bool = isDataType( 'int8' );
* // returns true
*
* bool = isDataType( 'uint16' );
* // returns true
*
* bool = isDataType( 'uint32' );
* // returns true
*
* bool = isDataType( 'uint8' );
* // returns true
*
* bool = isDataType( 'uint8c' );
* // returns true
*
* bool = isDataType( 'foo' );
* // returns false
*/

/**
* Tests whether an input value is a supported ndarray index mode.
*
* @param {*} v - value to test
* @returns {boolean} boolean indicating whether an input value is a supported ndarray index mode
*
* @example
* var bool = isIndexMode( 'wrap' );
* // returns true
*
* bool = isIndexMode( 'clamp' );
* // returns true
*
* bool = isIndexMode( 'throw' );
* // returns true
*
* bool = isIndexMode( 'foo' );
* // returns false
*/

/**
* Tests whether an input value is an ndarray order.
*
* @param {*} v - value to test
* @returns {boolean} boolean indicating whether an input value is an ndarray order
*
* @example
* var bool = isOrder( 'row-major' );
* // returns true
*
* bool = isOrder( 'column-major' );
* // returns true
*
* bool = isOrder( 'foo' );
* // returns false
*/

/**
* The mathematical constant `π` times `2`.
*
* @constant
* @type {number}
* @default 6.283185307179586
* @see [Wikipedia]{@link https://en.wikipedia.org/wiki/Pi}
*/

/**
* The mathematical constant `π` times `2`.
*
* @module @stdlib/constants/math/float64-two-pi
* @type {number}
*
* @example
* var TWO_PI = require( '@stdlib/constants/math/float64-two-pi' );
* // returns 6.283185307179586
*/

/**
* The smallest positive double-precision floating-point subnormal number.
*
* ## Notes
*
* The number has the value
*
* ```tex
* \frac{1}{2^{1023-1} 2^{52}}
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 0 00000000000 00000000000000000000 00000000000000000000000000000001
* ```
*
* @constant
* @type {number}
* @default 4.940656458412465e-324
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/

/**
* The smallest positive single-precision floating-point normal number.
*
* ## Notes
*
* The number has the value
*
* ```tex
* \frac{1}{2^{127-1}}
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 0 00000001 00000000000000000000000
* ```
*
* @constant
* @type {number}
* @default 1.1754943508222875e-38
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/

/**
* This component is used by students to briefly summarize data as it is presented and perform various statistical tests.
*
* @property {Array} categorical - array of strings indicating the name of each categorical variable
* @property {Array} quantitative - array of strings indicating the name of each quantitative variable
* @property {(Object|Array)} data - data object or array to be viewed. If it is an object, the keys correspond to column values while an array will expect an array of objects with a named field corresponding to each column. If you wish to allow students the ability to import a `.csv` file, set the `data` option to be `false`
* @property {Object} dataInfo - object containing the keys \'name\', whose value is a string, \'info\', whose value is an array of strings in which each element in the array is a new line and \'variables\', an object with keys as variable names and values as variable descriptions
* @property {boolean} editor - boolean indicating whether to show the editor to the user
* @property {Object} editorProps - object to be passed to `TextEditor` indicating properties to be used
* @property {string} editorTitle - string indicating the title of the explorer to be displayed
* @property {boolean} groupMode - controls whether to sync editor changes across users in a group
* @property {boolean} dataTable - boolean value indicating whether to hide the data table from view
* @property {boolean} histogramDensities - boolean value indicating whether to display histogram densities
* @property {Array<string>} models - array of strings indicating models that may be fit on the data
* @property {string} opened - page opened at startup
* @property {Array<string>} plots - array of strings indicating which plots to show to the user
* @property {Array<node>} questions - array of nodes indicating surrounding text and question components to be displayed in a tabbed window
* @property {boolean} showTestDecisions - boolean indicating whether to show the decisions made for each test based on the calculated p-values
* @property {Array<string>} statistics - array of strings indicating which summary statistics may be calculated
* @property {Array<string>} tables - array of strings indicating which tables may be created from the data
* @property {Array<Object>} tabs - array of objects and keys indicating any custom tabs to add
* @property {Array<string>} tests - array of strings indicating which hypothesis tests to include
* @property {boolean} transformer - boolean indicating whether one wants to display a variable transformer
* @property {Function} onTutorialCompletion - function invoked when user has completed the data explorer tutorial
* @property {Object} style - CSS inline styles for main container
*/

/**
* This is DiDonato and Morris's BGRAT routine, see Eq's 9 through 9.6.
*
* @private
* @param {NonNegativeNumber} a - function parameter
* @param {NonNegativeNumber} b - function parameter
* @param {Probability} x - function parameter
* @param {Probability} y - probability equal to `1-x`
* @param {NonNegativeInteger} s0 - initial value
* @param {number} mult - initial value
* @param {boolean} normalized - boolean indicating whether to evaluate the regularized or non-regularized incomplete beta function
* @returns {number} function value
*/

/**
* Two-dimensional kernel density estimation.
*
* @module @stdlib/stats/kde2d
*
* @example
* var kde2d = require( '@stdlib/stats/kde2d' );
* var x = [ 1, 3, 5, 6, 21, 23, 16, 17, 20, 10 ];
* var y = [ 0.40, 0.20, 0.20, 0.15, 0.05, 0.55, 0.6, 0.33, 0.8, 0.41 ];
*
* var out = kde2d( x, y );
* // returns { 'x': [1, 1.91, ... ], 'y': [0.05, 0.08125, ...], 'z': ndarray {Float64Array[ 0.031, ...] }
*/

/**
* Uniform distribution probability density function (PDF).
*
* @module @stdlib/stats/base/dists/uniform/pdf
*
* @example
* var pdf = require( '@stdlib/stats/base/dists/uniform/pdf' );
*
* var y = pdf( 3.0, 2.0, 6.0 );
* // returns 0.25
*
* var myPDF = pdf.factory( 6.0, 7.0 );
* y = myPDF( 7.0 );
* // returns 1.0
*
* y = myPDF( 5.0 );
* // returns 0.0
*/

/**
* Uniform distribution pseudorandom numbers.
*
* @module @stdlib/random/base/uniform
*
* @example
* var uniform = require( '@stdlib/random/base/uniform' );
*
* var v = uniform( 0.0, 1.0 );
* // returns <number>
*
* @example
* var factory = require( '@stdlib/random/base/uniform' ).factory;
* var uniform = factory( -5.0, 5.0, {
*     'seed': 297
* });
*
* var v = uniform();
* // returns <number>
*
* @example
* var factory = require( '@stdlib/random/base/uniform' ).factory;
* var uniform = factory({
*     'seed': 297
* });
*
* var v = uniform( -5.0, 5.0 );
* // returns <number>
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination for function options
* @param {Options} options - function options
* @param {NonNegativeInteger} [options.depth] - depth to flatten
* @param {boolean} [options.copy] - boolean indicating whether to deep copy array elements
* @returns {(Error|null)} error or null
*
* @example
* var opts = {};
* var options = {
*     'depth': 10,
*     'copy': false
* };
* var err = validate( opts, options );
* if ( err ) {
*     throw err;
* }
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination for validated options
* @param {Object} options - function options
* @param {string} [options.method] - method determining how ties are treated
* @param {string} [opts.missing] - determines where missing values go (`first`,`last`, or `remove`)
* @param {Array} [opts.encoding] - array of values encoding missing values
* @returns {(null|Error)} null or an error
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination for validated options
* @param {Options} options - function options
* @param {number} [options.alpha] - significance level
* @param {Array} [options.groups] - array of group indicators
* @returns {(null|Error)} null or an error
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination for validated options
* @param {Options} options - function options
* @param {number} [options.alpha] - significance level
* @param {string} [options.alternative] - alternative hypothesis (`two-sided`, `less` or `greater`)
* @param {number} [options.difference] - difference in means under H0
* @param {string} [options.variance] - whether variances are `equal` or `unequal` under H0
* @returns {(null|Error)} null or an error
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination for validated options
* @param {Options} options - function options
* @param {number} [options.alpha] - significance level
* @param {string} [options.alternative] - alternative hypothesis (`two-sided`, `less` or `greater`)
* @param {number} [options.difference] - difference in means under H0
* @returns {(null|Error)} null or an error
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination for validated options
* @param {Options} options - function options
* @param {number} [options.alpha] - significance level
* @param {string} [options.alternative] - alternative hypothesis (`two-sided`, `less` or `greater`)
* @param {number} [options.mu] - mean under H0
* @returns {(null|Error)} null or an error
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination for validated options
* @param {Options} options - function options
* @param {number} [options.alpha] - significance level
* @param {string} [options.alternative] - alternative hypothesis (`two-sided`, `less` or `greater`)
* @param {number} [options.rho] - correlation coefficient unter HO
* @returns {(null|Error)} null or an error
*
* @example
* var opts = {};
* var options = {
*     'alpha': 0.01,
*     'rho': 0.8
* };
* var err = validate( opts, options );
* if ( err ) {
*     throw err;
* }
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {*} [options.thisArg] - execution context
* @param {string} [options.returns] - output format
* @returns {(Error|null)} null or an error object
*
* @example
* var opts = {};
* var options = {
*     'returns': '*',
*     'thisArg': {}
* };
* var err = validate( opts, options );
* if ( err ) {
*     throw err;
* }
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {*} [options.thisArg] - execution context
* @returns {(Error|null)} null or an error object
*
* @example
* var opts = {};
* var options = {
*     'thisArg': {}
* };
* var err = validate( opts, options );
* if ( err ) {
*     throw err;
* }
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {Probability} [options.f] - smoother span (proportion of points which influence smoothing at each value)
* @param {NonNegativeInteger} [options.nsteps] - number of iterations in the robust fit
* @param {NonNegativeNumber} [options.delta] - nonnegative parameter which may be used to save computations
* @param {boolean} [options.sorted] - boolean indicating if the input array is in sorted order
* @returns {(Error|null)} null or an error object
*
* @example
* var opts = {};
* var options = {
*     'f': 0.75,
*     'nsteps': 6,
*     'delta': 0.03,
*     'sorted': true
* };
* var err = validate( opts, options );
* if ( err ) {
*     throw err;
* }
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {boolean} [options.codegen] - boolean indicating whether to use code generation
* @param {string} [options.mode] - specifies how to handle indices which exceed array dimensions
* @param {string} [options.submode] - specifies how to handle subscripts which exceed array dimensions
* @returns {(Error|null)} null or an error object
*
* @example
* var opts = {};
* var options = {
*     'mode': 'clamp',
*     'submode': [ 'throw', 'wrap', 'clamp' ],
*     'codegen': false
* };
* var err = validate( opts, options );
* if ( err ) {
*     throw err;
* }
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {number} [options.alpha] - significance level
* @returns {(Error|null)} null or an error object
*
* @example
* var opts = {};
* var options = {
*     'alpha': 0.6
* };
* var err = validate( opts, options );
* if ( err ) {
*     throw err;
* }
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {number} [options.n] - number of splits in the generated grid
* @param {NumericArray} [options.h] - array of length two indicating the x and y bandwidth values
* @param {number} [options.xMin] - lower limit of x
* @param {number} [options.xMax] - upper limit of x
* @param {number} [options.xMin] - lower limit of y
* @param {number} [options.yMax] - upper limit of y
* @param {(string|Function)} [options.kernel] - a string or function to specifying the used kernel function
* @returns {(Error|null)} null or an error object
*
* @example
* var opts = {};
* var options = {
*     'xMin': 3.14,
*     'kernel': 'gaussian'
* };
* var err = validate( opts, options );
* if ( err ) {
*     throw err;
* }
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {string} [options.returns] - output format
* @returns {(Error|null)} null or an error object
*
* @example
* var opts = {};
* var options = {
*     'returns': '*'
* };
* var err = validate( opts, options );
* if ( err ) {
*     throw err;
* }
*/

/**
* Validates values provided for minimum and maximum support.
*
* @private
* @param {number} a - minimum support
* @param {number} b - maximum support
* @returns {(Error|null)} error or null
*
* @example
* var err = validate( 1.0, 2.0 );
* if ( err ) {
*     throw err;
* }
*/

/**
* Wrap an index on the interval `[0,max]`.
*
* @module @stdlib/ndarray/base/wrap-index
*
* @example
* var wrapIndex = require( '@stdlib/ndarray/base/wrap-index' );
*
* var idx = wrapIndex( -1, 10 );
* // returns 10
*
* idx = wrapIndex( 14, 10 );
* // returns 3
*
* idx = wrapIndex( 6, 10 );
* // returns 6
*/

/**
* Wraps an index on the interval `[0,max]`.
*
* @param {integer} idx - index
* @param {NonNegativeInteger} max - maximum index
* @returns {NonNegativeInteger} index
*
* @example
* var idx = wrapIndex( -1, 10 );
* // returns 10
*
* idx = wrapIndex( 13, 10 );
* // returns 2
*
* idx = wrapIndex( 6, 10 );
* // returns 6
*/

/**
* ndarray data buffer constructors.
*
* @module @stdlib/ndarray/base/buffer-ctors
*
* @example
* var ctors = require( '@stdlib/ndarray/base/buffer-ctors' );
*
* var ctor = ctors( 'float64' );
* // returns <Function>
*
* ctor = ctors( 'int' );
* // returns null
*/

/**
*Computes the sample excess kurtosis of an array of values.
*
* @param {Array} arr - array of values
* @returns {number} sample excess kurtosis
*/

/**
*Computes the sample skewness of an array of values.
*
* @param {Array} arr - array of values
* @returns {number} sample skewness
*/

/** @component */

/** @ignore */

/** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */

/** An `onClick` handler passed to the Toggle component */

/** Disables the toggle NavLink  */

/** Specify where the overlay element is positioned in relation to the target element */

/** Style the toggle NavLink as active  */

/** The content of the non-toggle Button.  */

/** Whether to render the dropdown menu in the DOM before the first time it is shown */

/***/

// "Casting" to the same data type is always allowed, regardless of the casting mode...

// "nulling" of the role if the user really doesn't want one

// -----------

// -0.2929 < x < 0.41422

// 0.7316 <= x <=  0.9

// 0x3FD62E42 0xFEFA39EF

// 0x3FF0A2B2 0x3F3BAB73

// 0x3ff00000 - (0x200000>>k) = 1072693248 - (0x200000>>k) => 0x200000 = 0 00000000010 00000000000000000000

// 0xBC50C7CAA48A971F => TT = -(tail of TF)

// 1-|x| >= 0.25

// 1.7316 <= x < 2

// 2**-28

// 2*N+1

// 2^28

// @ts-ignore

// A

// Account for augmented dimensions (note: expanding the strides array to account for prepended singleton dimensions does **not** affect the index offset):

// Add a source directive for debugging:

// Add k to y's exponent:

// Add the value argument...

// Address case where `f` cannot be represented exactly...

// Address floating point errors introduced by taking the sqrt and enforce strict [-1,1] bounds...

// Adjust the array shape to satisfy the minimum number of dimensions...

// Already have sq defined

// And e3, and put it in terms[3]:

// And finally we know that our result is below the inflection point, so set an upper limit on our search:

// And from from 9.2:

// And iterate:

// Any number raised to zero (including 0) is always 1 => b^0 - 1 = 0

// Anything goes for "unsafe" casting...

// Apply a bit mask (0 00000000000 11111111111111111111) to remove the exponent:

// Apply dynamic padding.

// Approximation of log1p(f)...

// Arbitrarily large delta...

// Argument reduction (reduce to [0,2))...

// Argument reduction (reduce to interval [0,1]). If `x` is negative, we can safely negate the value, taking advantage of the error function being an odd function; i.e., `erf(-x) = -erf(x)`.

// Argument reduction (reduce to interval [0,1]). If `x` is outside [0,1], we can take advantage of the complementary error function reflection formula: `erfc(-z) = 2 - erfc(z)`, by negating the result once finished.

// Argument reduction...

// Array shape:

// As `delta` is a small integer, we can use a finite product:

// Asymptotic inverse expansion about normal:

// At this point we may or may not have the right answer, Eq-3.2 has two solutions for x for any given eta, however the mapping in 3.2 is 1:1 with the sign of eta and x-sin^2(theta) being the same. So we can check if we have the right root of 3.2, and if not switch x for 1-x.  This transformation is motivated by the fact that the distribution is *almost* symmetric so 1-x will be in the right ball park for the solution:

// Avoid exceeding the maximum stack size on V8 :(. Note that the choice of `500` was empirically determined...

// Begin by evaluating the next Pn from Eq 9.4:

// Begin by getting an initial approximation for the quantity eta from the dominant part of the incomplete beta:

// Begin by testing whether we're in the "bad" zone where the result will be near 0.5 and the usual series and continued fractions are slow to converge:

// Bit shift to isolate the exponent and then subtract the bias:

// Body series for small N, start with Eq 56 of Shaw:

// Both a and b less than 1, there is a point of inflection at xs:

// Both a,b < 1:

// Both a,b >= 1:

// Bring the correction terms together to evaluate eta; this is the last equation on page 151:

// Bring them together to get a final estimate for eta:

// Buffer offset:

// Build an object containing all ndarray properties needed to revive a serialized ndarray...

// Build the output array...

// Building sub-trees:

// CHEBYSHEV DISTANCE //

// CHUNKIFY //

// COSINE DISTANCE //

// COSINE SIMILARITY //

// Cache references to the parent constructor and parent constructor methods:

// Calculate # ties for each value & rank sums per group:

// Calculate Q via finite sum for half integer a:

// Calculate Q via finite sum:

// Calculate Residuals:

// Calculate correction terms:

// Calculate e1 and put it in terms[1], see the middle of page 151:

// Calculate mid point:

// Calculate powers:

// Calculate test statistic using short-cut formula:

// Calculate the increment:

// Calculate the population excess kurtosis:

// Calculate the population skewness:

// Call the parent constructor:

// Can not handle redirect-url, such as when access 'http://something.com/avatar.png'

// Can we do better here?

// Case 1: x is an array

// Case 2: scalar

// Case A: Iterate over generator object created by a generator function...

// Case A: Predictions for multiple observations:

// Case B: Create prediction for a single observation:

// Case B: Only one new observation:

// Case B: Repeatedly call function...

// Case of ndarray, opts

// Case: ( a <= 1 ) != ( b <= 1 ). If all else fails we get here, only one of a and b is above 1, and a+b is small.  Start by swapping things around so that we have a concave curve with b > a and no points of inflection in [0,1].  As long as we expect x to be small then we can use the simple (and cheap) power term to estimate x, but when we expect x to be large then this greatly underestimates x and leaves us trying to iterate "round the corner" which may take almost forever. We could use Temme's inverse gamma function case in that case, this works really rather well (albeit expensively) even though strictly speaking we're outside it's defined range. However it's expensive to compute, and an alternative approach which models the curve as a distorted quarter circle is much cheaper to compute, and still keeps the number of iterations required down to a reasonable level. With thanks to Prof. Temme for this suggestion.

// Case: 1.5 < z <= 2

// Case: Have both a second and first variable...

// Case: Resetting the second variable...

// Case: We have a categorical variable

// Case: We have a filter for a quantitative variable, which has a min and max value

// Case: grouping variable selected, do not omit missing values

// Case: grouping variable selected, omit missing values

// Case: invert upper gamma function

// Case: missing = 'remove'

// Case: more than one statistic calculated

// Case: no grouping variable selected

// Case: row-major

// Case: |x| < 2**-28

// Cast data to generic array...

// Change things around so we can handle as b == 1 special case below:

// Changeover criterion chosen to give a changeover at Q ~ 0.33:

// Changeover here occurs when P ~ 0.75 or Q ~ 0.25:

// Character codes:

// Chebyshev polynomial coefficients...

// Check for out of bounds step:

// Check for over/underflow in the power terms:

// Check if `f=x` can be represented exactly (no need for correction terms), allowing us to bypass argument reduction...

// Check if argument reduction is needed and if we can just return a small value approximation requiring less computation but with equivalent accuracy...

// Check if u significand is less than sqrt(2) significand => 0x6a09e => 01101010000010011110

// Check that all array element dimensions are consistent:

// Check that output string will not exceed the maximum string length:

// Chose appropriate bandwidth via rule-of-thumb:

// Close all the parentheses...

// Close the IIFE:

// Close the function call:

// Close the function:

// Closing braces...

// Code generation. Start with function definition...

// Code generation. Start with the function definition...

// Code generation. Start with the function definition:

// Code point from a supplementary plane. Split into two 16-bit code units (surrogate pair).

// Combine eta0 and the error terms to compute eta (Second equation p155):

// Combine power terms with Lanczos approximation:

// Combine with the leftover terms from the Lanczos approximation:

// Compute P:

// Compute Q:

// Compute robustness weights except last time...

// Compute square root of the result and then square it:

// Compute the 4th root of the result then square it twice:

// Compute the number of bytes...

// Compute the number of elements...

// Compute weights (pick up all ties on right):

// Convert SVG string to data URL

// Convert back coefficients to original scale:

// Convert fitted values and residuals back to original scale before standardizing:

// Copy `shape` and `strides` to prevent external mutation:

// Copy and sort data --> build X

// Copy the array to avoid mutation:

// Copy the values from the 2D array

// Copy to prevent mutation and sort by x:

// Correction for ties:

// Correction term is zero:

// Correction term...

// Count number of occurrences of each of value:

// Count number of occurrences of each value:

// Counting number of occurrences:

// Create a lower-level base constructor:

// Create a prototype which inherits from the parent prototype:

// Create an empty matrix

// Create new object with different insertion order:

// Create the `ndarray` to hold the density values:

// Create the code which accesses the nested array values and pushes them onto the flattened array.

// Create the function body...

// Create the function in the current scope to allow access to required modules:

// Create the function in the global scope:

// Create the nested for loops...

// Create the variables...

// Creating training sets for each tree:

// Crop output to the desired size (undo dynamic padding).

// DEFAULT PROPERTIES //

// DOT PRODUCT //

// Data buffer parameter...

// Default: invert lower gamma function

// Define some variables:

// Define the variables and powers we'll need later on:

// Depending upon which approximation method we use, we may end up calculating either x or y initially (where y = 1-x):

// Derivative not set...

// Detect different values of attribute:

// Determine if the array can be stored contiguously:

// Determine the minimum and maximum linear indices which are accessible by the array view:

// Diagonal elements of covariance matrix...

// Don't bother showing anything if we don't have to.

// Don't un-render the overlay while it's transitioning out.

// Double the string:

// EUCLIDEAN DISTANCE //

// EXPORTS //

// Eagerly determine array dimensions:

// Empty...

// Ensure that each array element is an array of the same size:

// Ensure that the array is compatible with a single memory segment:

// Eq Following 2.17:

// Estimate x and y, using expm1 to get a good estimate for y when it's very small:

// Even number of elements, so must take the mean of the two middle values:

// Exploit the fact that the covariance matrix is symmetric...

// Exponentiation would yield a complex result...

// Exports

// Extend to a few very special cases...

// Extract correlation coefficient from correlation matrix:

// Extract the more significant bits from |x|:

// FUNCTIONS //

// Figure out how many digits to iterate towards:

// Figure out what the coefficients are. They depend only on the degrees of freedom (Eq 57 of Shaw):

// Filter out huge and non-finite arguments...

// Finally the normal case:

// Find weighted center of x values:

// First base near 1 only:

// First loop inlines imports

// First term underflows so we need to start at the mode of the distribution and work outwards:

// First three values...

// Fitted value at x[ i ]:

// Fix root xlink without namespace

// Flip the signs of negative strides:

// For custom components provide additional, non-DOM, props;

// For simplicity, if the timeout is short, just set a normal timeout.

// For small matrices, resort to naive multiplication.

// For some of the methods we can put tighter bounds on the result than simply [0,1]:

// Formatted table

// Function is symmetric, so invert it:

// Function to invoke to create an ndarray:

// General case. Direct computation is most accurate, but use various fallbacks for different parts of the problem domain:

// General case:

// Get first estimate for eta, see Eq 3.9 and 3.10, but note there is a typo in Eq 3.10:

// Get the first approximation for eta from the inverse error function (Eq: 2.9 and 2.10):

// Get the middle index:

// Get the size of the current dimension:

// Get the standard deviation through the helper function

// Go through, add to meanTable by indexing factor[i]

// HAMMING DISTANCE //

// Handle `+-0`

// Handle rounding errors:

// Handle trivial cases first...

// Hypothesis

// ISINTEGER //

// ISOBJECT //

// If `check()` returns a value less than `ndims`, trim off the inconsistent dimensions:

// If `x == 0`, return the first coefficient...

// If `x` is an integer, the mod is an integer...

// If `x` is even, recognize that `(-b)**x == (b)**x`...

// If an array does not contain any elements, then no data to store, and, if the array is unordered, adjacent array elements are not guaranteed to be stored next to each other.

// If eta is large we need to solve Eq 3.2 more directly, begin by getting an initial approximation for x from the last equation on page 155, this is a polynomial in u:

// If no coefficients, the function always returns 0...

// If not provided a data buffer, create it; otherwise, see if we need to cast a provided data buffer to another data type or perform a copy...

// If not provided a shape, infer from a provided data source...

// If our initial approximation is out of bounds then bisect:

// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:

// If the array element is not an array or is not the same size, we have found an inconsistent dimension:

// If the constructor has not already been created, create it; otherwise, return a memoized constructor...

// If the count is odd, append the current concatenated string:

// If the indices are "inbounds", then the buffer length is compatible:

// If the ndarray can be considered both "row-major" and "column-major", then use the default order; otherwise, use the ndarray's stated layout order...

// If the previous statement did not throw an error, we can cache the constructor...

// If the user indicated that "any" order suffices (meaning the user does not care about ndarray order), then we use the default order, unless the input ndarray is either unequivocally "row-major" or "column-major" or configured as such....

// If we are provided an "external" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.

// If we didn't find any constructors, this could be due to 1) we have yet to create the constructor or 2) we have been provided invalid options. Either way, let's attempt to create an ndarray constructor...

// If we get here then a and b are very different in magnitude and we need to use the third of Temme's methods which involves inverting the incomplete gamma.  This is much more expensive than the other methods.  We also can only use this method when a > b, which can lead to cancellation errors if we really want y (as we will when x is close to 1), so a different expansion is used in that case.

// If we have yet to determine array strides, we assume that we can compute the strides, along with the index offset, for a **contiguous** data source based solely on the array shape and specified memory layout order...

// If we're in a region where the first derivative is very large, then we have to take care that the root-finder doesn't terminate prematurely.  We'll bump the precision up to avoid this, but we have to take care not to set the precision too high or the last few iterations will just thrash around and convergence may be slow in this case. Try 3/4 of machine epsilon:

// If x < 2, use lgamma(x) = lgamma(x+1) - log(x)

// If x equals 1 or 2, return 0

// If |x| < 2**-70, return -ln(|x|)

// If |x| >= 2**52, must be -integer

// Implementation inspired from scikit

// In "safe" casting mode, only casts which preserve values are allowed...

// In each of the following, we further reduce to [-π/4,π/4)...

// Incomplete beta power term, combined with the Lanczos approximation:

// Infer the array "order" from the stride array (this is supplementary to the `order` parameter):

// Inherit from the parent constructor:

// Init closest distances

// Initialize active set to all predictors:

// Initialize model parameters to zero:

// Initialize the shape/dimensions array:

// Input data has to be sorted:

// Iterate over the remaining centers

// KNOWN ISSUE

// Know that result is below the inflection point, so set an upper limit on search...

// L2NORM //

// Lanczos calculation:

// Last three values...

// Last two steps haven't converged, try bisection:

// Lazily generate table...

// Let the value of current attribute be the pivot:

// Limit chosen so that we use Temme's expansion only if the result would be larger than about 10^-6. Below that the regular series and continued fractions converge OK, and if we use Temme's method we get increasing errors from the dominant erfc term as it's (inexact) argument increases in magnitude.

// Loop through the array, only incrementing a pointer when successive values are different. When a succeeding value is different, move the pointer and set the next value. In the trivial case where all array elements are unique, we incur a slight penalty in resetting the element value for each unique value. In other cases, we simply move a unique value to a new position in the array. The end result is a sorted array with unique values.

// Loop through x and y indices:

// Lower bound for our search:  We're not interested in denormalized answers as these tend to take up lots of iterations, given that we can't get accurate derivatives in this area (they tend to be infinite).

// MAIN //

// MANHATTAN DISTANCE //

// METHODS //

// MODEL COMPONENTS //

// MODULES //

// Make a shallow copy of x:

// Make a stdlib/stats/base/kernels package

// Make sum of weights equal to one:

// Make sure both matrices are the same size.

// Make sure we don't have a zero derivative:

// Make the grid:

// Mapping from data types to underlying buffer constructors...

// Mapping from ndarray data buffer constructors to data types...

// Matrix holding partial residuals:

// Mean sum of squares

// Model a distorted quarter circle:

// Module

// Move to one of the sub-trees:

// Must be the first iteration, pretend that we had a previous one at either min or max:

// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595

// Newton-Raphson iteration of a polynomial case, choice of seed value is taken from Shaw's online supplement:

// Next line

// Next term is given by Eq 41:

// No casts between different data types are allowed in "none" or "equiv" casting modes...

// No good/quick approximation for ln(b)*x, so we have to evaluate...

// Non-normalized, just compute the power:

// Normalize u by setting the exponent to 1023 (bias) => 0x3ff00000 => 0 01111111111 00000000000000000000

// Normalize u/2 by setting the exponent to 1022 (bias-1 => 2**-1 = 1/2) => 0x3fe00000 => 0 01111111110 00000000000000000000

// Note that, since the stride is negative, this operation increments, not decrements, the offset...

// Note: order should match `ctors` order

// Note: we assume that an option value can be uniquely serialized to a `string` via `JSON.stringify()`...

// Note: we assume that an option value can be uniquely serialized to a `string` via `toString()`...

// Note: we ignore whether `options` has a `buffer` property

// Note: we use an array to avoid unordered key look-up

// Now an initial value for J, see 9.6: gammainc( u, b, regularized, upper )

// Now bring everything together to provide the result this is Eq 62 of Shaw:

// Now evaluate e2 and put it in terms[2]:

// Now get total ss:

// Now iterate, we can use either p or q as the target here depending on which is smaller:

// Now make the mean by dividing by the sample size

// Now start adding in values

// Now that we have eta we need to back solve for x, we seek the value of x that gives eta in Eq 3.2. The two methods used are described in section 5. Begin by defining a few variables we'll need later:

// Now we can start to pull things together and evaluate the sum in Eq 9:

// Now we have a guess for x (and for y) we can set things up for iteration.  If x > 0.5 it pays to swap things round:

// Now we need to compute the perturbation error terms that convert eta0 to eta, these are all polynomials of polynomials. Probably these should be re-written to use tabulated data (see examples above), but it's less of a win in this case as we need to calculate the individual powers for the denominator terms anyway, so we might as well use them for the numerator-polynomials as well. Refer to p154-p155 for the details of these expansions:

// Now we need to convert eta to the return value `x`, by solving the appropriate quadratic equation:

// Now we need to ensure that we start our iteration from the right side of the inflection point:

// Now we need to perturb eta0 to get eta, which we do by evaluating the polynomial in 1/r at the bottom of page 151, to do this we first need the error terms e1, e2 e3 which we'll fill into the array "terms".  Since these terms are themselves polynomials, we'll need another array "workspace" to calculate those...

// Now we want Jn from Jn-1 using Eq 9.6:

// OK, starting slightly above the mode didn't work, we'll have to sum the terms the old fashioned way:

// Only a small out of bounds step, let's assume that the result is probably approximately at minimum:

// Only leafs contains predicted category...

// Oops zero derivative!!!

// Oops, under/overflow, sidestep if we can:

// Order:

// Otherwise, evaluate the polynomial...

// Our recursive multiplication function.

// Overflow, return an arbitrarily large value:

// PLOT COMPONENTS //

// PROPERTIES //

// Points are spread out enough to compute slope:

// Possible overflow, use Newton step:

// Probably cancellation error, try a Newton step instead:

// Propagate the number of consistent dimensions up the recursion chain...

// Pull it together with Eq 9:

// Put a matrix into the top left of a matrix of zeros.

// Radius will not decrease by a move to the right...

// React's built version is broken: https://github.com/facebook/react/issues/4251

// Recompute active set:

// Recursively examine nested elements:

// Relate to the binomial distribution and use a finite sum:

// Remember pairs 'attribute-predicate-value' which provide gain...

// Repeatedly call function...

// Reset delta2 so that this branch will *not* be taken on the next iteration:

// Restriction by maximal depth of tree or size of training set is to small so we have to terminate process of building tree...

// Result is then an odd polynomial in v (see Eq 56 of Shaw)...

// Return the corrected sample excess kurtosis:

// Return the corrected sample skewness:

// Return the instance:

// Return the ndarray instance:

// Right-shift the bits:

// Robustness iterations:

// S

// Safari NS namespace fix

// SafeAnchor handles the disabled case, but we handle it here

// Second base near 1 only:

// Second loop parses rules

// See eq following 2.15:

// See whether non-active variables all pass exclusion test:

// Select calculation method for the initial estimate:

// Series summation from 0 to k-1:

// Set private properties...

// Set the constructor to refer to the child constructor:

// Set the value:

// Set to a safe zero to avoid a

// Set y = |x|:

// Side Effect

// Sidestep on a, and then use the series representation:

// Sidestep so we can use the series representation:

// Simple implementation of mouseEnter and mouseLeave.

// Since x is so small that P is necessarily very small too, use http://functions.wolfram.com/GammaBetaErf/GammaRegularized/06/01/05/01/01/

// Small a and b, both greater than 1, there is a point of inflection at xs, and it's complement is xs2, we must always start our iteration from the right side of the point of inflection.

// Small eta use the expansion Temme gives in the second equation of section 5, it's a polynomial in eta:

// Some powers of sin(theta) cos(theta) that we'll need later:

// Some values we'll need later, these are Eq 9.1:

// Some variables we'll need...

// Sort array in ascending order:

// Sort data in ascending order:

// Special case for large a and a ~ z:

// Special case see: http://functions.wolfram.com/GammaBetaErf/BetaRegularized/03/01/01/

// Special case where the base of the power term is close to 1; compute `(1+x)^y` instead:

// Special case: +-0

// Special case: -1

// Special case: 0

// Special case: 1

// Special case: 2

// Special case: NaN

// Special case: |x| > 1 (range error)

// Special cases:

// Special cases: NaN, +-infinity

// Split up the calculation to avoid spurious overflow:

// Splitting training set by given 'attribute-predicate-value':

// Stride array...

// Student's T with b = 0.5 gets handled as a special case, swap around if the arguments are in the "wrong" order:

// Subtract hu significand from next largest hu => 0 00000000001 00000000000000000000 => 0x00100000 => 1048576

// Supply `nBins` as a suggested value for the number of bins; exact number of bins may differ...

// Swap `a` and `b`:

// Synonyms

// TEST COMPONENTS //

// TODO: Revisit once we have function for sorting multiple arrays by the elements of one of the arrays

// TODO: consider extracting as a constant

// TODO: consider moving to pkg

// TODO: replace with `stdlib` pkg

// TODO: reserved for future use

// TODO: validate that minimum number of dimensions does not exceed the maximum number of possible dimensions (in theory, infinite; in practice, determined by max array length; see https://github.com/stdlib-js/stdlib/blob/ac350059877c036640775d6b30d0e98e840d07cf/lib/node_modules/%40stdlib/ndarray/ctor/lib/main.js#L57)

// Tail series expansion, see section 6 of Shaw's paper. `w` is calculated using Eq 60:

// Temme doesn't specify what value to switch on here, but this seems to work pretty well:

// Test failed: include predictor in active set -> iterate again

// The approach which follows is to resolve a view index to its subscripts and then plug the subscripts into the standard formula for computing the linear index in the underlying data buffer...

// The final step is a few Newton-Raphson iterations to clean up our approximation for x, this is pretty cheap in general, and very cheap compared to an incomplete beta evaluation. The limits set on x come from the observation that the sign of eta and x-sin^2(theta) are the same.

// The flag invert is set to true if we swap a for b and p for q, in which case the result has to be subtracted from 1:

// The result is at the point of inflection, best just return it:

// The second error function case is the next cheapest to use, it breaks down when the result is likely to be very small, if `a+b` is also small, but we can use a cheaper expansion there in any case. As before `x` won't be much larger than `p`, so as long as `p` is small we should be free of cancellation error.

// This avoids possible overflow, but appears to be marginally less accurate:

// This intentionally forwards size and variant (if set) to the

// This is exclusively for simplicity:

// This is method 2 below, done in logs, we're really outside the range of this method, but since the result is almost certainly infinite, we should probably be OK:

// This is method 2 below, done in logs:

// This is method 4 below, done in logs:

// This isn't very sophisticated, or accurate, but it does work:

// Tidy up, if we "lower" was too high then zero is the best answer we have:

// Traversing tree from the root to leaf:

// Treat a < 1 as a special case because our Lanczos approximations are optimized against the factorials with a > 1, and for high precision types very small values of `a` can give rather erroneous results for gamma:

// Trivial case where we have all negative strides...

// Trivial case where we have all positive strides...

// Truncate the array:

// Try and compute the easy way first:

// Try http://functions.wolfram.com/06.06.06.0039.01

// Under a limited range of circumstances we can improve our estimate for x...

// Update brackets:

// Use Eq 45 to extract the result:

// Use a heuristic to avoid memoization of highly-specialized ndarray constructors, thus effectively introducing "fast" and "slow" ndarray construction paths...

// Use a simple two-term Taylor series...

// Use at least two and at most n points:

// Use large-sample normality to calculate p-value based on Fisher's z transform...

// Use t-test for H0: rho = 0.0 vs H1: rho != 0.0...

// Used as hash-set for avoiding the checking of split by rules with the same 'attribute-predicate-pivot' more than once

// User provided a covariance matrix instead of dataset.

// User provided a dataset but wants us to compute and use the covariance matrix.

// VARIABLES //

// Validate some options before others...

// Validate the remaining options...

// Value at N = 0

// WARNING: in C, this is not thread safe

// WARNING: in C, this would not be thread safe

// WARNING: not thread safe

// We get numeric overflow in this area:

// We have a Student's T distribution:

// We have an arcsine distribution:

// We have integer degrees of freedom, try for the special cases first:

// We need logs, and this *will* cancel:

// We need the quantity Pn. Unfortunately, this is computed recursively and requires a full history of all the previous values. No choice but to declare a big table and hope it's big enough...

// We provide an empty the TabContext so `<Nav>`s in `<TabPane>`s don't

// We're not interested in answers smaller than machine epsilon:

// We've crossed over so move in opposite direction to last step:

// When a and b differ by a small amount the curve is quite symmetrical and we can use an error function to approximate the inverse. This is the cheapest of the three Temme expansions, and the calculated value for x will never be much larger than p, so we don't have to worry about cancellation as long as p is small.

// When a+b is large then we can use one of Prof Temme's asymptotic expansions, begin by swapping things around so that p < 0.5, we do this to avoid cancellations errors when p is large.

// When the base of the exponent is very near 1 we get really gross errors unless extra care is taken:

// X

// X[i] is the individual continuous

// Zero raised to any number (except 0) is always zero => 0^x - 1 = -1

// [1] Compute the covariance...

// [2] Normalize the co-moments...

// [3] Compute the standard deviations...

// [4] Set the diagonal elements to 1:

// [5] Compute the correlation coefficients...

// [a] Extract the values and compute the deltas...

// [b] Update the covariance between one array and every other array...

// [c] Update the means...

// `d` is one more than the index of the last consistent dimension and thus equal to the number of consistent dimensions:

// `df = 1` is the same as the Cauchy distribution, see Shaw Eq 35:

// `df = 2` has an exact result, see Shaw Eq 36:

// `l1` and `l2` are the base of the exponents minus one:

// `rows` and `cols` are the dimensions of the output matrix.

// a is equivalent to this

// add the value for all dimensions of the point

// arcsin(1-x) = pi/2 - sqrt(2x)(1+R(x))

// asm type annotation

// at `j` is the size of the first non-prepended dimension

// cache bypass so we dont have CORS issues with cached images

// call the draw function

// call the tree layout function on the data

// check input is sane

// chooses a random point as initial cluster

// chooses the more distant point

// chooses the set of points that maximises the min distance

// clone children in order

// column-major

// config.nbinsx = nBins;

// conflict with the top level one.

// copy previous centers

// copy!

// dataURI, mailto:, tel:, etc.

// define the draw function

// define the tree layout function

// divides by length

// end FUNCTION argmax()

// end FUNCTION chebyshev()

// end FUNCTION chunkify()

// end FUNCTION distance()

// end FUNCTION dot()

// end FUNCTION euclidean()

// end FUNCTION hamming()

// end FUNCTION isArray()

// end FUNCTION isFunction()

// end FUNCTION isInteger()

// end FUNCTION isNumber()

// end FUNCTION isObject()

// end FUNCTION isString()

// end FUNCTION l2norm()

// end FUNCTION manhattan()

// end FUNCTION partial()

// end FUNCTION similarity()

// end FUNCTION validate()

// ensure that a menu set triggers an update for consumers

// equivalent to (b-a)*r + a

// eslint-disable-line default-case

// eslint-disable-line eqeqeq

// eslint-disable-line id-length

// eslint-disable-line max-len

// eslint-disable-line max-len, no-mixed-operators

// eslint-disable-line no-buffer-constructor

// eslint-disable-line no-control-regex

// eslint-disable-line no-eval

// eslint-disable-line no-new-func

// eslint-disable-line no-new-wrappers

// eslint-disable-line no-plusplus

// eslint-disable-line no-underscore-dangle

// eslint-disable-line no-unused-vars

// eslint-disable-line react/no-unused-state

// eslint-disable-line stdlib/no-redeclare

// eslint-disable-next-line no-console

// eslint-disable-next-line react-hooks/rules-of-hooks

// exact

// faster than map

// for Firefox

// for cases when the trigger is disabled and mouseOut/Over can cause flicker

// for other components

// for testing

// gammaln(1+s) = ln(s) + gammaln(s)

// get out at first zero weight on right

// handle +-0 (IEEE 754-2008 spec)

// handles +-0 (IEEE 754-2008)

// if x <= -56*ln(2)

// if x > sqrt(2)/2-1 => ~-0.2929

// if |f| < 2**-20

// if |x| < 1.5*ln(2)

// if |x| < 2**-29

// if |x| < sqrt(2)-1 => ~0.41422

// if |x| > 0.5*ln(2)

// if |x| >= 56*ln(2)

// if |x| >= 709.78...

// index of current point

// index of previously estimated point

// infinite loop until convergence

// iterating over all attributes of item

// let the value of current attribute be the pivot

// max value => 1048575

// maximum similarity

// menus are display: none when not shown.

// minimum distance

// minimum distance to centers

// moving from one child element to another.

// no default

// only `show` should be changing

// or size of training set is to small

// pi/2 = PIO2 + MOREBITS

// pi/2 = PIO2 + MOREBITS.

// positive unbiased exponent

// q < 3

// q < 6

// q >= 0.25

// ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache

// remove the vars

// restriction by maximal depth of tree

// rightmost point (may be greater than `nright` because of ties)

// row-major

// see 9.3.

// sign preserving

// slight optimization to avoid modulo arithmetic when max+1 < idx <= 2*(max+1)

// slight optimization to avoid modulo arithmetic when |idx| <= max+1

// small enough for non-zero weight

// so we have to terminate process of building tree

// splitting training set by given 'attribute-predicate-value'

// statistic()

// strip out comments

// suffice to return exp(x)-1

// sum of weights

// t*ln2_hi is exact here

// t=1-2^-k

// t=2^-k

// than false negatives. strict `undefined` check allows explicit

// this algorithm can be implemented with matrices of different sizes.

// traces.push( { colorscale: 'YIGnBu' } );

// tslint:disable-next-line

// types are confused between node and web here IDK

// underlying component, to allow it to render size and style variants.

// unified regex

// url is absolute already

// url is absolute already, without protocol

// use a bitwise OR to cast `k` to an integer (see also asm.js type annotations: http://asmjs.org/spec/latest/#annotations)

// use linear fit

// used as hash-set for avoiding the checking of split by rules

// we don't need the default popper style,

// weak test

// will redirect to 'http://something.com/65fc2ffcc8aea7ba65a1d1feda173540'

// will result in some false positives but that seems better

// with the same 'attribute-predicate-pivot' more than once

// x = 1-q <= 0.5

// x is now in primary range...

// |x| <= 0.5
