@stdlib/stats-strided-dsvariancepn 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +177 -0
- package/NOTICE +1 -0
- package/README.md +465 -0
- package/SECURITY.md +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +7 -0
- package/docs/img/equation_population_mean.svg +42 -0
- package/docs/img/equation_population_variance.svg +54 -0
- package/docs/img/equation_sample_mean.svg +43 -0
- package/docs/img/equation_unbiased_sample_variance.svg +61 -0
- package/docs/types/index.d.ts +95 -0
- package/include/stdlib/stats/strided/dsvariancepn.h +45 -0
- package/lib/dsvariancepn.js +62 -0
- package/lib/dsvariancepn.native.js +52 -0
- package/lib/index.js +68 -0
- package/lib/main.js +35 -0
- package/lib/native.js +35 -0
- package/lib/ndarray.js +90 -0
- package/lib/ndarray.native.js +53 -0
- package/manifest.json +104 -0
- package/package.json +95 -0
- package/src/addon.c +64 -0
- package/src/main.c +89 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../lib/ndarray.js", "../lib/dsvariancepn.js", "../lib/main.js", "../lib/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dssum = require( '@stdlib/blas-ext-base-dssum' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses a two-pass approach, as suggested by Neely (1966).\n*\n* ## References\n*\n* - Neely, Peter M. 1966. \"Comparison of Several Algorithms for Computation of Means, Standard Deviations and Correlation Coefficients.\" _Communications of the ACM_ 9 (7). Association for Computing Machinery: 496\u201399. doi:[10.1145/365719.365958](https://doi.org/10.1145/365719.365958).\n* - Schubert, Erich, and Michael Gertz. 2018. \"Numerically Stable Parallel Computation of (Co-)Variance.\" In _Proceedings of the 30th International Conference on Scientific and Statistical Database Management_. New York, NY, USA: Association for Computing Machinery. doi:[10.1145/3221269.3223036](https://doi.org/10.1145/3221269.3223036).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} correction - degrees of freedom adjustment\n* @param {Float32Array} x - input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {number} variance\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var v = dsvariancepn( 4, 1, x, 2, 1 );\n* // returns 6.25\n*/\nfunction dsvariancepn( N, correction, x, strideX, offsetX ) {\n\tvar mu;\n\tvar ix;\n\tvar M2;\n\tvar M;\n\tvar d;\n\tvar n;\n\tvar i;\n\n\tn = N - correction;\n\tif ( N <= 0 || n <= 0 ) {\n\t\treturn NaN;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\treturn 0.0;\n\t}\n\t// Compute an estimate for the mean:\n\tmu = dssum( N, x, strideX, offsetX ) / N;\n\n\t// Compute the variance...\n\tix = offsetX;\n\tM2 = 0.0;\n\tM = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\td = x[ ix ] - mu;\n\t\tM2 += d * d;\n\t\tM += d;\n\t\tix += strideX;\n\t}\n\treturn (M2/n) - ((M/N)*(M/n));\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsvariancepn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar stride2offset = require( '@stdlib/strided-base-stride2offset' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses a two-pass approach, as suggested by Neely (1966).\n*\n* ## References\n*\n* - Neely, Peter M. 1966. \"Comparison of Several Algorithms for Computation of Means, Standard Deviations and Correlation Coefficients.\" _Communications of the ACM_ 9 (7). Association for Computing Machinery: 496\u201399. doi:[10.1145/365719.365958](https://doi.org/10.1145/365719.365958).\n* - Schubert, Erich, and Michael Gertz. 2018. \"Numerically Stable Parallel Computation of (Co-)Variance.\" In _Proceedings of the 30th International Conference on Scientific and Statistical Database Management_. New York, NY, USA: Association for Computing Machinery. doi:[10.1145/3221269.3223036](https://doi.org/10.1145/3221269.3223036).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} correction - degrees of freedom adjustment\n* @param {Float32Array} x - input array\n* @param {integer} strideX - stride length\n* @returns {number} variance\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n*\n* var v = dsvariancepn( x.length, 1, x, 1 );\n* // returns ~4.3333\n*/\nfunction dsvariancepn( N, correction, x, strideX ) {\n\treturn ndarray( N, correction, x, strideX, stride2offset( N, strideX ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsvariancepn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar dsvariancepn = require( './dsvariancepn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsvariancepn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsvariancepn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/stats-strided-dsvariancepn\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var dsvariancepn = require( '@stdlib/stats-strided-dsvariancepn' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n*\n* var v = dsvariancepn( x.length, 1, x, 1 );\n* // returns ~4.3333\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var dsvariancepn = require( '@stdlib/stats-strided-dsvariancepn' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var v = dsvariancepn.ndarray( 4, 1, x, 2, 1 );\n* // returns 6.25\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils-try-require' );\nvar isError = require( '@stdlib/assert-is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsvariancepn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsvariancepn = main;\n} else {\n\tdsvariancepn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsvariancepn;\n\n// exports: { \"ndarray\": \"dsvariancepn.ndarray\" }\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,6BAA8B,EAAE,QAgCrD,SAASC,EAAcC,EAAGC,EAAYC,EAAGC,EAASC,EAAU,CAC3D,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAGJ,GADAD,EAAIV,EAAIC,EACHD,GAAK,GAAKU,GAAK,EACnB,MAAO,KAER,GAAKV,IAAM,GAAKG,IAAY,EAC3B,MAAO,GASR,IANAE,EAAKP,EAAOE,EAAGE,EAAGC,EAASC,CAAQ,EAAIJ,EAGvCM,EAAKF,EACLG,EAAK,EACLC,EAAI,EACEG,EAAI,EAAGA,EAAIX,EAAGW,IACnBF,EAAIP,EAAGI,CAAG,EAAID,EACdE,GAAME,EAAIA,EACVD,GAAKC,EACLH,GAAMH,EAEP,OAAQI,EAAGG,EAAOF,EAAER,GAAIQ,EAAEE,EAC3B,CAKAb,EAAO,QAAUE,ICzFjB,IAAAa,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAgB,QAAS,oCAAqC,EAC9DC,EAAU,IA+Bd,SAASC,EAAcC,EAAGC,EAAYC,EAAGC,EAAU,CAClD,OAAOL,EAASE,EAAGC,EAAYC,EAAGC,EAASN,EAAeG,EAAGG,CAAQ,CAAE,CACxE,CAKAP,EAAO,QAAUG,IC7DjB,IAAAK,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,uDAAwD,EAC/EC,EAAe,IACfC,EAAU,IAKdF,EAAaC,EAAc,UAAWC,CAAQ,EAK9CH,EAAO,QAAUE,ICYjB,IAAIE,EAAO,QAAS,MAAO,EAAE,KACzBC,EAAa,QAAS,2BAA4B,EAClDC,EAAU,QAAS,yBAA0B,EAC7CC,EAAO,IAKPC,EACAC,EAAMJ,EAAYD,EAAM,UAAW,aAAc,CAAE,EAClDE,EAASG,CAAI,EACjBD,EAAeD,EAEfC,EAAeC,EAMhB,OAAO,QAAUD",
|
|
6
|
+
"names": ["require_ndarray", "__commonJSMin", "exports", "module", "dssum", "dsvariancepn", "N", "correction", "x", "strideX", "offsetX", "mu", "ix", "M2", "M", "d", "n", "i", "require_dsvariancepn", "__commonJSMin", "exports", "module", "stride2offset", "ndarray", "dsvariancepn", "N", "correction", "x", "strideX", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsvariancepn", "ndarray", "join", "tryRequire", "isError", "main", "dsvariancepn", "tmp"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="13.863ex" height="7.343ex" style="vertical-align: -3.005ex;" viewBox="0 -1867.7 5968.8 3161.4" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" aria-labelledby="MathJax-SVG-1-Title">
|
|
2
|
+
<title id="MathJax-SVG-1-Title">mu equals StartFraction 1 Over upper N EndFraction sigma-summation Underscript i equals 0 Overscript upper N minus 1 Endscripts x Subscript i</title>
|
|
3
|
+
<defs aria-hidden="true">
|
|
4
|
+
<path stroke-width="1" id="E1-MJMATHI-3BC" d="M58 -216Q44 -216 34 -208T23 -186Q23 -176 96 116T173 414Q186 442 219 442Q231 441 239 435T249 423T251 413Q251 401 220 279T187 142Q185 131 185 107V99Q185 26 252 26Q261 26 270 27T287 31T302 38T315 45T327 55T338 65T348 77T356 88T365 100L372 110L408 253Q444 395 448 404Q461 431 491 431Q504 431 512 424T523 412T525 402L449 84Q448 79 448 68Q448 43 455 35T476 26Q485 27 496 35Q517 55 537 131Q543 151 547 152Q549 153 557 153H561Q580 153 580 144Q580 138 575 117T555 63T523 13Q510 0 491 -8Q483 -10 467 -10Q446 -10 429 -4T402 11T385 29T376 44T374 51L368 45Q362 39 350 30T324 12T288 -4T246 -11Q199 -11 153 12L129 -85Q108 -167 104 -180T92 -202Q76 -216 58 -216Z"></path>
|
|
5
|
+
<path stroke-width="1" id="E1-MJMAIN-3D" d="M56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153Z"></path>
|
|
6
|
+
<path stroke-width="1" id="E1-MJMAIN-31" d="M213 578L200 573Q186 568 160 563T102 556H83V602H102Q149 604 189 617T245 641T273 663Q275 666 285 666Q294 666 302 660V361L303 61Q310 54 315 52T339 48T401 46H427V0H416Q395 3 257 3Q121 3 100 0H88V46H114Q136 46 152 46T177 47T193 50T201 52T207 57T213 61V578Z"></path>
|
|
7
|
+
<path stroke-width="1" id="E1-MJMATHI-4E" d="M234 637Q231 637 226 637Q201 637 196 638T191 649Q191 676 202 682Q204 683 299 683Q376 683 387 683T401 677Q612 181 616 168L670 381Q723 592 723 606Q723 633 659 637Q635 637 635 648Q635 650 637 660Q641 676 643 679T653 683Q656 683 684 682T767 680Q817 680 843 681T873 682Q888 682 888 672Q888 650 880 642Q878 637 858 637Q787 633 769 597L620 7Q618 0 599 0Q585 0 582 2Q579 5 453 305L326 604L261 344Q196 88 196 79Q201 46 268 46H278Q284 41 284 38T282 19Q278 6 272 0H259Q228 2 151 2Q123 2 100 2T63 2T46 1Q31 1 31 10Q31 14 34 26T39 40Q41 46 62 46Q130 49 150 85Q154 91 221 362L289 634Q287 635 234 637Z"></path>
|
|
8
|
+
<path stroke-width="1" id="E1-MJSZ2-2211" d="M60 948Q63 950 665 950H1267L1325 815Q1384 677 1388 669H1348L1341 683Q1320 724 1285 761Q1235 809 1174 838T1033 881T882 898T699 902H574H543H251L259 891Q722 258 724 252Q725 250 724 246Q721 243 460 -56L196 -356Q196 -357 407 -357Q459 -357 548 -357T676 -358Q812 -358 896 -353T1063 -332T1204 -283T1307 -196Q1328 -170 1348 -124H1388Q1388 -125 1381 -145T1356 -210T1325 -294L1267 -449L666 -450Q64 -450 61 -448Q55 -446 55 -439Q55 -437 57 -433L590 177Q590 178 557 222T452 366T322 544L56 909L55 924Q55 945 60 948Z"></path>
|
|
9
|
+
<path stroke-width="1" id="E1-MJMATHI-69" d="M184 600Q184 624 203 642T247 661Q265 661 277 649T290 619Q290 596 270 577T226 557Q211 557 198 567T184 600ZM21 287Q21 295 30 318T54 369T98 420T158 442Q197 442 223 419T250 357Q250 340 236 301T196 196T154 83Q149 61 149 51Q149 26 166 26Q175 26 185 29T208 43T235 78T260 137Q263 149 265 151T282 153Q302 153 302 143Q302 135 293 112T268 61T223 11T161 -11Q129 -11 102 10T74 74Q74 91 79 106T122 220Q160 321 166 341T173 380Q173 404 156 404H154Q124 404 99 371T61 287Q60 286 59 284T58 281T56 279T53 278T49 278T41 278H27Q21 284 21 287Z"></path>
|
|
10
|
+
<path stroke-width="1" id="E1-MJMAIN-30" d="M96 585Q152 666 249 666Q297 666 345 640T423 548Q460 465 460 320Q460 165 417 83Q397 41 362 16T301 -15T250 -22Q224 -22 198 -16T137 16T82 83Q39 165 39 320Q39 494 96 585ZM321 597Q291 629 250 629Q208 629 178 597Q153 571 145 525T137 333Q137 175 145 125T181 46Q209 16 250 16Q290 16 318 46Q347 76 354 130T362 333Q362 478 354 524T321 597Z"></path>
|
|
11
|
+
<path stroke-width="1" id="E1-MJMAIN-2212" d="M84 237T84 250T98 270H679Q694 262 694 250T679 230H98Q84 237 84 250Z"></path>
|
|
12
|
+
<path stroke-width="1" id="E1-MJMATHI-78" d="M52 289Q59 331 106 386T222 442Q257 442 286 424T329 379Q371 442 430 442Q467 442 494 420T522 361Q522 332 508 314T481 292T458 288Q439 288 427 299T415 328Q415 374 465 391Q454 404 425 404Q412 404 406 402Q368 386 350 336Q290 115 290 78Q290 50 306 38T341 26Q378 26 414 59T463 140Q466 150 469 151T485 153H489Q504 153 504 145Q504 144 502 134Q486 77 440 33T333 -11Q263 -11 227 52Q186 -10 133 -10H127Q78 -10 57 16T35 71Q35 103 54 123T99 143Q142 143 142 101Q142 81 130 66T107 46T94 41L91 40Q91 39 97 36T113 29T132 26Q168 26 194 71Q203 87 217 139T245 247T261 313Q266 340 266 352Q266 380 251 392T217 404Q177 404 142 372T93 290Q91 281 88 280T72 278H58Q52 284 52 289Z"></path>
|
|
13
|
+
</defs>
|
|
14
|
+
<g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)" aria-hidden="true">
|
|
15
|
+
<use xlink:href="#E1-MJMATHI-3BC" x="0" y="0"></use>
|
|
16
|
+
<use xlink:href="#E1-MJMAIN-3D" x="881" y="0"></use>
|
|
17
|
+
<g transform="translate(1659,0)">
|
|
18
|
+
<g transform="translate(397,0)">
|
|
19
|
+
<rect stroke="none" width="1008" height="60" x="0" y="220"></rect>
|
|
20
|
+
<use xlink:href="#E1-MJMAIN-31" x="254" y="676"></use>
|
|
21
|
+
<use xlink:href="#E1-MJMATHI-4E" x="60" y="-704"></use>
|
|
22
|
+
</g>
|
|
23
|
+
</g>
|
|
24
|
+
<g transform="translate(3352,0)">
|
|
25
|
+
<use xlink:href="#E1-MJSZ2-2211" x="44" y="0"></use>
|
|
26
|
+
<g transform="translate(191,-1090)">
|
|
27
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-69" x="0" y="0"></use>
|
|
28
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-3D" x="345" y="0"></use>
|
|
29
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-30" x="1124" y="0"></use>
|
|
30
|
+
</g>
|
|
31
|
+
<g transform="translate(0,1151)">
|
|
32
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-4E" x="0" y="0"></use>
|
|
33
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-2212" x="888" y="0"></use>
|
|
34
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-31" x="1667" y="0"></use>
|
|
35
|
+
</g>
|
|
36
|
+
</g>
|
|
37
|
+
<g transform="translate(5052,0)">
|
|
38
|
+
<use xlink:href="#E1-MJMATHI-78" x="0" y="0"></use>
|
|
39
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-69" x="809" y="-213"></use>
|
|
40
|
+
</g>
|
|
41
|
+
</g>
|
|
42
|
+
</svg>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="21.565ex" height="7.343ex" style="vertical-align: -3.005ex;" viewBox="0 -1867.7 9284.8 3161.4" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" aria-labelledby="MathJax-SVG-1-Title">
|
|
2
|
+
<title id="MathJax-SVG-1-Title">sigma squared equals StartFraction 1 Over upper N EndFraction sigma-summation Underscript i equals 0 Overscript upper N minus 1 Endscripts left-parenthesis x Subscript i Baseline minus mu right-parenthesis squared</title>
|
|
3
|
+
<defs aria-hidden="true">
|
|
4
|
+
<path stroke-width="1" id="E1-MJMATHI-3C3" d="M184 -11Q116 -11 74 34T31 147Q31 247 104 333T274 430Q275 431 414 431H552Q553 430 555 429T559 427T562 425T565 422T567 420T569 416T570 412T571 407T572 401Q572 357 507 357Q500 357 490 357T476 358H416L421 348Q439 310 439 263Q439 153 359 71T184 -11ZM361 278Q361 358 276 358Q152 358 115 184Q114 180 114 178Q106 141 106 117Q106 67 131 47T188 26Q242 26 287 73Q316 103 334 153T356 233T361 278Z"></path>
|
|
5
|
+
<path stroke-width="1" id="E1-MJMAIN-32" d="M109 429Q82 429 66 447T50 491Q50 562 103 614T235 666Q326 666 387 610T449 465Q449 422 429 383T381 315T301 241Q265 210 201 149L142 93L218 92Q375 92 385 97Q392 99 409 186V189H449V186Q448 183 436 95T421 3V0H50V19V31Q50 38 56 46T86 81Q115 113 136 137Q145 147 170 174T204 211T233 244T261 278T284 308T305 340T320 369T333 401T340 431T343 464Q343 527 309 573T212 619Q179 619 154 602T119 569T109 550Q109 549 114 549Q132 549 151 535T170 489Q170 464 154 447T109 429Z"></path>
|
|
6
|
+
<path stroke-width="1" id="E1-MJMAIN-3D" d="M56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153Z"></path>
|
|
7
|
+
<path stroke-width="1" id="E1-MJMAIN-31" d="M213 578L200 573Q186 568 160 563T102 556H83V602H102Q149 604 189 617T245 641T273 663Q275 666 285 666Q294 666 302 660V361L303 61Q310 54 315 52T339 48T401 46H427V0H416Q395 3 257 3Q121 3 100 0H88V46H114Q136 46 152 46T177 47T193 50T201 52T207 57T213 61V578Z"></path>
|
|
8
|
+
<path stroke-width="1" id="E1-MJMATHI-4E" d="M234 637Q231 637 226 637Q201 637 196 638T191 649Q191 676 202 682Q204 683 299 683Q376 683 387 683T401 677Q612 181 616 168L670 381Q723 592 723 606Q723 633 659 637Q635 637 635 648Q635 650 637 660Q641 676 643 679T653 683Q656 683 684 682T767 680Q817 680 843 681T873 682Q888 682 888 672Q888 650 880 642Q878 637 858 637Q787 633 769 597L620 7Q618 0 599 0Q585 0 582 2Q579 5 453 305L326 604L261 344Q196 88 196 79Q201 46 268 46H278Q284 41 284 38T282 19Q278 6 272 0H259Q228 2 151 2Q123 2 100 2T63 2T46 1Q31 1 31 10Q31 14 34 26T39 40Q41 46 62 46Q130 49 150 85Q154 91 221 362L289 634Q287 635 234 637Z"></path>
|
|
9
|
+
<path stroke-width="1" id="E1-MJSZ2-2211" d="M60 948Q63 950 665 950H1267L1325 815Q1384 677 1388 669H1348L1341 683Q1320 724 1285 761Q1235 809 1174 838T1033 881T882 898T699 902H574H543H251L259 891Q722 258 724 252Q725 250 724 246Q721 243 460 -56L196 -356Q196 -357 407 -357Q459 -357 548 -357T676 -358Q812 -358 896 -353T1063 -332T1204 -283T1307 -196Q1328 -170 1348 -124H1388Q1388 -125 1381 -145T1356 -210T1325 -294L1267 -449L666 -450Q64 -450 61 -448Q55 -446 55 -439Q55 -437 57 -433L590 177Q590 178 557 222T452 366T322 544L56 909L55 924Q55 945 60 948Z"></path>
|
|
10
|
+
<path stroke-width="1" id="E1-MJMATHI-69" d="M184 600Q184 624 203 642T247 661Q265 661 277 649T290 619Q290 596 270 577T226 557Q211 557 198 567T184 600ZM21 287Q21 295 30 318T54 369T98 420T158 442Q197 442 223 419T250 357Q250 340 236 301T196 196T154 83Q149 61 149 51Q149 26 166 26Q175 26 185 29T208 43T235 78T260 137Q263 149 265 151T282 153Q302 153 302 143Q302 135 293 112T268 61T223 11T161 -11Q129 -11 102 10T74 74Q74 91 79 106T122 220Q160 321 166 341T173 380Q173 404 156 404H154Q124 404 99 371T61 287Q60 286 59 284T58 281T56 279T53 278T49 278T41 278H27Q21 284 21 287Z"></path>
|
|
11
|
+
<path stroke-width="1" id="E1-MJMAIN-30" d="M96 585Q152 666 249 666Q297 666 345 640T423 548Q460 465 460 320Q460 165 417 83Q397 41 362 16T301 -15T250 -22Q224 -22 198 -16T137 16T82 83Q39 165 39 320Q39 494 96 585ZM321 597Q291 629 250 629Q208 629 178 597Q153 571 145 525T137 333Q137 175 145 125T181 46Q209 16 250 16Q290 16 318 46Q347 76 354 130T362 333Q362 478 354 524T321 597Z"></path>
|
|
12
|
+
<path stroke-width="1" id="E1-MJMAIN-2212" d="M84 237T84 250T98 270H679Q694 262 694 250T679 230H98Q84 237 84 250Z"></path>
|
|
13
|
+
<path stroke-width="1" id="E1-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path>
|
|
14
|
+
<path stroke-width="1" id="E1-MJMATHI-78" d="M52 289Q59 331 106 386T222 442Q257 442 286 424T329 379Q371 442 430 442Q467 442 494 420T522 361Q522 332 508 314T481 292T458 288Q439 288 427 299T415 328Q415 374 465 391Q454 404 425 404Q412 404 406 402Q368 386 350 336Q290 115 290 78Q290 50 306 38T341 26Q378 26 414 59T463 140Q466 150 469 151T485 153H489Q504 153 504 145Q504 144 502 134Q486 77 440 33T333 -11Q263 -11 227 52Q186 -10 133 -10H127Q78 -10 57 16T35 71Q35 103 54 123T99 143Q142 143 142 101Q142 81 130 66T107 46T94 41L91 40Q91 39 97 36T113 29T132 26Q168 26 194 71Q203 87 217 139T245 247T261 313Q266 340 266 352Q266 380 251 392T217 404Q177 404 142 372T93 290Q91 281 88 280T72 278H58Q52 284 52 289Z"></path>
|
|
15
|
+
<path stroke-width="1" id="E1-MJMATHI-3BC" d="M58 -216Q44 -216 34 -208T23 -186Q23 -176 96 116T173 414Q186 442 219 442Q231 441 239 435T249 423T251 413Q251 401 220 279T187 142Q185 131 185 107V99Q185 26 252 26Q261 26 270 27T287 31T302 38T315 45T327 55T338 65T348 77T356 88T365 100L372 110L408 253Q444 395 448 404Q461 431 491 431Q504 431 512 424T523 412T525 402L449 84Q448 79 448 68Q448 43 455 35T476 26Q485 27 496 35Q517 55 537 131Q543 151 547 152Q549 153 557 153H561Q580 153 580 144Q580 138 575 117T555 63T523 13Q510 0 491 -8Q483 -10 467 -10Q446 -10 429 -4T402 11T385 29T376 44T374 51L368 45Q362 39 350 30T324 12T288 -4T246 -11Q199 -11 153 12L129 -85Q108 -167 104 -180T92 -202Q76 -216 58 -216Z"></path>
|
|
16
|
+
<path stroke-width="1" id="E1-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path>
|
|
17
|
+
</defs>
|
|
18
|
+
<g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)" aria-hidden="true">
|
|
19
|
+
<use xlink:href="#E1-MJMATHI-3C3" x="0" y="0"></use>
|
|
20
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-32" x="810" y="583"></use>
|
|
21
|
+
<use xlink:href="#E1-MJMAIN-3D" x="1304" y="0"></use>
|
|
22
|
+
<g transform="translate(2083,0)">
|
|
23
|
+
<g transform="translate(397,0)">
|
|
24
|
+
<rect stroke="none" width="1008" height="60" x="0" y="220"></rect>
|
|
25
|
+
<use xlink:href="#E1-MJMAIN-31" x="254" y="676"></use>
|
|
26
|
+
<use xlink:href="#E1-MJMATHI-4E" x="60" y="-704"></use>
|
|
27
|
+
</g>
|
|
28
|
+
</g>
|
|
29
|
+
<g transform="translate(3775,0)">
|
|
30
|
+
<use xlink:href="#E1-MJSZ2-2211" x="44" y="0"></use>
|
|
31
|
+
<g transform="translate(191,-1090)">
|
|
32
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-69" x="0" y="0"></use>
|
|
33
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-3D" x="345" y="0"></use>
|
|
34
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-30" x="1124" y="0"></use>
|
|
35
|
+
</g>
|
|
36
|
+
<g transform="translate(0,1151)">
|
|
37
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-4E" x="0" y="0"></use>
|
|
38
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-2212" x="888" y="0"></use>
|
|
39
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-31" x="1667" y="0"></use>
|
|
40
|
+
</g>
|
|
41
|
+
</g>
|
|
42
|
+
<use xlink:href="#E1-MJMAIN-28" x="5308" y="0"></use>
|
|
43
|
+
<g transform="translate(5698,0)">
|
|
44
|
+
<use xlink:href="#E1-MJMATHI-78" x="0" y="0"></use>
|
|
45
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-69" x="809" y="-213"></use>
|
|
46
|
+
</g>
|
|
47
|
+
<use xlink:href="#E1-MJMAIN-2212" x="6837" y="0"></use>
|
|
48
|
+
<use xlink:href="#E1-MJMATHI-3BC" x="7837" y="0"></use>
|
|
49
|
+
<g transform="translate(8441,0)">
|
|
50
|
+
<use xlink:href="#E1-MJMAIN-29" x="0" y="0"></use>
|
|
51
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-32" x="550" y="583"></use>
|
|
52
|
+
</g>
|
|
53
|
+
</g>
|
|
54
|
+
</svg>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="12.918ex" height="7.343ex" style="vertical-align: -3.005ex;" viewBox="0 -1867.7 5561.7 3161.4" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" aria-labelledby="MathJax-SVG-1-Title">
|
|
2
|
+
<title id="MathJax-SVG-1-Title">x overbar equals StartFraction 1 Over n EndFraction sigma-summation Underscript i equals 0 Overscript n minus 1 Endscripts x Subscript i</title>
|
|
3
|
+
<defs aria-hidden="true">
|
|
4
|
+
<path stroke-width="1" id="E1-MJMATHI-78" d="M52 289Q59 331 106 386T222 442Q257 442 286 424T329 379Q371 442 430 442Q467 442 494 420T522 361Q522 332 508 314T481 292T458 288Q439 288 427 299T415 328Q415 374 465 391Q454 404 425 404Q412 404 406 402Q368 386 350 336Q290 115 290 78Q290 50 306 38T341 26Q378 26 414 59T463 140Q466 150 469 151T485 153H489Q504 153 504 145Q504 144 502 134Q486 77 440 33T333 -11Q263 -11 227 52Q186 -10 133 -10H127Q78 -10 57 16T35 71Q35 103 54 123T99 143Q142 143 142 101Q142 81 130 66T107 46T94 41L91 40Q91 39 97 36T113 29T132 26Q168 26 194 71Q203 87 217 139T245 247T261 313Q266 340 266 352Q266 380 251 392T217 404Q177 404 142 372T93 290Q91 281 88 280T72 278H58Q52 284 52 289Z"></path>
|
|
5
|
+
<path stroke-width="1" id="E1-MJMAIN-AF" d="M69 544V590H430V544H69Z"></path>
|
|
6
|
+
<path stroke-width="1" id="E1-MJMAIN-3D" d="M56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153Z"></path>
|
|
7
|
+
<path stroke-width="1" id="E1-MJMAIN-31" d="M213 578L200 573Q186 568 160 563T102 556H83V602H102Q149 604 189 617T245 641T273 663Q275 666 285 666Q294 666 302 660V361L303 61Q310 54 315 52T339 48T401 46H427V0H416Q395 3 257 3Q121 3 100 0H88V46H114Q136 46 152 46T177 47T193 50T201 52T207 57T213 61V578Z"></path>
|
|
8
|
+
<path stroke-width="1" id="E1-MJMATHI-6E" d="M21 287Q22 293 24 303T36 341T56 388T89 425T135 442Q171 442 195 424T225 390T231 369Q231 367 232 367L243 378Q304 442 382 442Q436 442 469 415T503 336T465 179T427 52Q427 26 444 26Q450 26 453 27Q482 32 505 65T540 145Q542 153 560 153Q580 153 580 145Q580 144 576 130Q568 101 554 73T508 17T439 -10Q392 -10 371 17T350 73Q350 92 386 193T423 345Q423 404 379 404H374Q288 404 229 303L222 291L189 157Q156 26 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 112 180T152 343Q153 348 153 366Q153 405 129 405Q91 405 66 305Q60 285 60 284Q58 278 41 278H27Q21 284 21 287Z"></path>
|
|
9
|
+
<path stroke-width="1" id="E1-MJSZ2-2211" d="M60 948Q63 950 665 950H1267L1325 815Q1384 677 1388 669H1348L1341 683Q1320 724 1285 761Q1235 809 1174 838T1033 881T882 898T699 902H574H543H251L259 891Q722 258 724 252Q725 250 724 246Q721 243 460 -56L196 -356Q196 -357 407 -357Q459 -357 548 -357T676 -358Q812 -358 896 -353T1063 -332T1204 -283T1307 -196Q1328 -170 1348 -124H1388Q1388 -125 1381 -145T1356 -210T1325 -294L1267 -449L666 -450Q64 -450 61 -448Q55 -446 55 -439Q55 -437 57 -433L590 177Q590 178 557 222T452 366T322 544L56 909L55 924Q55 945 60 948Z"></path>
|
|
10
|
+
<path stroke-width="1" id="E1-MJMATHI-69" d="M184 600Q184 624 203 642T247 661Q265 661 277 649T290 619Q290 596 270 577T226 557Q211 557 198 567T184 600ZM21 287Q21 295 30 318T54 369T98 420T158 442Q197 442 223 419T250 357Q250 340 236 301T196 196T154 83Q149 61 149 51Q149 26 166 26Q175 26 185 29T208 43T235 78T260 137Q263 149 265 151T282 153Q302 153 302 143Q302 135 293 112T268 61T223 11T161 -11Q129 -11 102 10T74 74Q74 91 79 106T122 220Q160 321 166 341T173 380Q173 404 156 404H154Q124 404 99 371T61 287Q60 286 59 284T58 281T56 279T53 278T49 278T41 278H27Q21 284 21 287Z"></path>
|
|
11
|
+
<path stroke-width="1" id="E1-MJMAIN-30" d="M96 585Q152 666 249 666Q297 666 345 640T423 548Q460 465 460 320Q460 165 417 83Q397 41 362 16T301 -15T250 -22Q224 -22 198 -16T137 16T82 83Q39 165 39 320Q39 494 96 585ZM321 597Q291 629 250 629Q208 629 178 597Q153 571 145 525T137 333Q137 175 145 125T181 46Q209 16 250 16Q290 16 318 46Q347 76 354 130T362 333Q362 478 354 524T321 597Z"></path>
|
|
12
|
+
<path stroke-width="1" id="E1-MJMAIN-2212" d="M84 237T84 250T98 270H679Q694 262 694 250T679 230H98Q84 237 84 250Z"></path>
|
|
13
|
+
</defs>
|
|
14
|
+
<g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)" aria-hidden="true">
|
|
15
|
+
<use xlink:href="#E1-MJMATHI-78" x="0" y="0"></use>
|
|
16
|
+
<use xlink:href="#E1-MJMAIN-AF" x="63" y="7"></use>
|
|
17
|
+
<use xlink:href="#E1-MJMAIN-3D" x="850" y="0"></use>
|
|
18
|
+
<g transform="translate(1628,0)">
|
|
19
|
+
<g transform="translate(397,0)">
|
|
20
|
+
<rect stroke="none" width="720" height="60" x="0" y="220"></rect>
|
|
21
|
+
<use xlink:href="#E1-MJMAIN-31" x="110" y="676"></use>
|
|
22
|
+
<use xlink:href="#E1-MJMATHI-6E" x="60" y="-686"></use>
|
|
23
|
+
</g>
|
|
24
|
+
</g>
|
|
25
|
+
<g transform="translate(3033,0)">
|
|
26
|
+
<use xlink:href="#E1-MJSZ2-2211" x="0" y="0"></use>
|
|
27
|
+
<g transform="translate(147,-1090)">
|
|
28
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-69" x="0" y="0"></use>
|
|
29
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-3D" x="345" y="0"></use>
|
|
30
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-30" x="1124" y="0"></use>
|
|
31
|
+
</g>
|
|
32
|
+
<g transform="translate(57,1151)">
|
|
33
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-6E" x="0" y="0"></use>
|
|
34
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-2212" x="600" y="0"></use>
|
|
35
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-31" x="1379" y="0"></use>
|
|
36
|
+
</g>
|
|
37
|
+
</g>
|
|
38
|
+
<g transform="translate(4644,0)">
|
|
39
|
+
<use xlink:href="#E1-MJMATHI-78" x="0" y="0"></use>
|
|
40
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-69" x="809" y="-213"></use>
|
|
41
|
+
</g>
|
|
42
|
+
</g>
|
|
43
|
+
</svg>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="24.382ex" height="7.343ex" style="vertical-align: -3.005ex;" viewBox="0 -1867.7 10497.7 3161.4" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" aria-labelledby="MathJax-SVG-1-Title">
|
|
2
|
+
<title id="MathJax-SVG-1-Title">s squared equals StartFraction 1 Over n minus 1 EndFraction sigma-summation Underscript i equals 0 Overscript n minus 1 Endscripts left-parenthesis x Subscript i Baseline minus x overbar right-parenthesis squared</title>
|
|
3
|
+
<defs aria-hidden="true">
|
|
4
|
+
<path stroke-width="1" id="E1-MJMATHI-73" d="M131 289Q131 321 147 354T203 415T300 442Q362 442 390 415T419 355Q419 323 402 308T364 292Q351 292 340 300T328 326Q328 342 337 354T354 372T367 378Q368 378 368 379Q368 382 361 388T336 399T297 405Q249 405 227 379T204 326Q204 301 223 291T278 274T330 259Q396 230 396 163Q396 135 385 107T352 51T289 7T195 -10Q118 -10 86 19T53 87Q53 126 74 143T118 160Q133 160 146 151T160 120Q160 94 142 76T111 58Q109 57 108 57T107 55Q108 52 115 47T146 34T201 27Q237 27 263 38T301 66T318 97T323 122Q323 150 302 164T254 181T195 196T148 231Q131 256 131 289Z"></path>
|
|
5
|
+
<path stroke-width="1" id="E1-MJMAIN-32" d="M109 429Q82 429 66 447T50 491Q50 562 103 614T235 666Q326 666 387 610T449 465Q449 422 429 383T381 315T301 241Q265 210 201 149L142 93L218 92Q375 92 385 97Q392 99 409 186V189H449V186Q448 183 436 95T421 3V0H50V19V31Q50 38 56 46T86 81Q115 113 136 137Q145 147 170 174T204 211T233 244T261 278T284 308T305 340T320 369T333 401T340 431T343 464Q343 527 309 573T212 619Q179 619 154 602T119 569T109 550Q109 549 114 549Q132 549 151 535T170 489Q170 464 154 447T109 429Z"></path>
|
|
6
|
+
<path stroke-width="1" id="E1-MJMAIN-3D" d="M56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153Z"></path>
|
|
7
|
+
<path stroke-width="1" id="E1-MJMAIN-31" d="M213 578L200 573Q186 568 160 563T102 556H83V602H102Q149 604 189 617T245 641T273 663Q275 666 285 666Q294 666 302 660V361L303 61Q310 54 315 52T339 48T401 46H427V0H416Q395 3 257 3Q121 3 100 0H88V46H114Q136 46 152 46T177 47T193 50T201 52T207 57T213 61V578Z"></path>
|
|
8
|
+
<path stroke-width="1" id="E1-MJMATHI-6E" d="M21 287Q22 293 24 303T36 341T56 388T89 425T135 442Q171 442 195 424T225 390T231 369Q231 367 232 367L243 378Q304 442 382 442Q436 442 469 415T503 336T465 179T427 52Q427 26 444 26Q450 26 453 27Q482 32 505 65T540 145Q542 153 560 153Q580 153 580 145Q580 144 576 130Q568 101 554 73T508 17T439 -10Q392 -10 371 17T350 73Q350 92 386 193T423 345Q423 404 379 404H374Q288 404 229 303L222 291L189 157Q156 26 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 112 180T152 343Q153 348 153 366Q153 405 129 405Q91 405 66 305Q60 285 60 284Q58 278 41 278H27Q21 284 21 287Z"></path>
|
|
9
|
+
<path stroke-width="1" id="E1-MJMAIN-2212" d="M84 237T84 250T98 270H679Q694 262 694 250T679 230H98Q84 237 84 250Z"></path>
|
|
10
|
+
<path stroke-width="1" id="E1-MJSZ2-2211" d="M60 948Q63 950 665 950H1267L1325 815Q1384 677 1388 669H1348L1341 683Q1320 724 1285 761Q1235 809 1174 838T1033 881T882 898T699 902H574H543H251L259 891Q722 258 724 252Q725 250 724 246Q721 243 460 -56L196 -356Q196 -357 407 -357Q459 -357 548 -357T676 -358Q812 -358 896 -353T1063 -332T1204 -283T1307 -196Q1328 -170 1348 -124H1388Q1388 -125 1381 -145T1356 -210T1325 -294L1267 -449L666 -450Q64 -450 61 -448Q55 -446 55 -439Q55 -437 57 -433L590 177Q590 178 557 222T452 366T322 544L56 909L55 924Q55 945 60 948Z"></path>
|
|
11
|
+
<path stroke-width="1" id="E1-MJMATHI-69" d="M184 600Q184 624 203 642T247 661Q265 661 277 649T290 619Q290 596 270 577T226 557Q211 557 198 567T184 600ZM21 287Q21 295 30 318T54 369T98 420T158 442Q197 442 223 419T250 357Q250 340 236 301T196 196T154 83Q149 61 149 51Q149 26 166 26Q175 26 185 29T208 43T235 78T260 137Q263 149 265 151T282 153Q302 153 302 143Q302 135 293 112T268 61T223 11T161 -11Q129 -11 102 10T74 74Q74 91 79 106T122 220Q160 321 166 341T173 380Q173 404 156 404H154Q124 404 99 371T61 287Q60 286 59 284T58 281T56 279T53 278T49 278T41 278H27Q21 284 21 287Z"></path>
|
|
12
|
+
<path stroke-width="1" id="E1-MJMAIN-30" d="M96 585Q152 666 249 666Q297 666 345 640T423 548Q460 465 460 320Q460 165 417 83Q397 41 362 16T301 -15T250 -22Q224 -22 198 -16T137 16T82 83Q39 165 39 320Q39 494 96 585ZM321 597Q291 629 250 629Q208 629 178 597Q153 571 145 525T137 333Q137 175 145 125T181 46Q209 16 250 16Q290 16 318 46Q347 76 354 130T362 333Q362 478 354 524T321 597Z"></path>
|
|
13
|
+
<path stroke-width="1" id="E1-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path>
|
|
14
|
+
<path stroke-width="1" id="E1-MJMATHI-78" d="M52 289Q59 331 106 386T222 442Q257 442 286 424T329 379Q371 442 430 442Q467 442 494 420T522 361Q522 332 508 314T481 292T458 288Q439 288 427 299T415 328Q415 374 465 391Q454 404 425 404Q412 404 406 402Q368 386 350 336Q290 115 290 78Q290 50 306 38T341 26Q378 26 414 59T463 140Q466 150 469 151T485 153H489Q504 153 504 145Q504 144 502 134Q486 77 440 33T333 -11Q263 -11 227 52Q186 -10 133 -10H127Q78 -10 57 16T35 71Q35 103 54 123T99 143Q142 143 142 101Q142 81 130 66T107 46T94 41L91 40Q91 39 97 36T113 29T132 26Q168 26 194 71Q203 87 217 139T245 247T261 313Q266 340 266 352Q266 380 251 392T217 404Q177 404 142 372T93 290Q91 281 88 280T72 278H58Q52 284 52 289Z"></path>
|
|
15
|
+
<path stroke-width="1" id="E1-MJMAIN-AF" d="M69 544V590H430V544H69Z"></path>
|
|
16
|
+
<path stroke-width="1" id="E1-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path>
|
|
17
|
+
</defs>
|
|
18
|
+
<g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)" aria-hidden="true">
|
|
19
|
+
<use xlink:href="#E1-MJMATHI-73" x="0" y="0"></use>
|
|
20
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-32" x="663" y="583"></use>
|
|
21
|
+
<use xlink:href="#E1-MJMAIN-3D" x="1201" y="0"></use>
|
|
22
|
+
<g transform="translate(1979,0)">
|
|
23
|
+
<g transform="translate(397,0)">
|
|
24
|
+
<rect stroke="none" width="2443" height="60" x="0" y="220"></rect>
|
|
25
|
+
<use xlink:href="#E1-MJMAIN-31" x="971" y="676"></use>
|
|
26
|
+
<g transform="translate(60,-687)">
|
|
27
|
+
<use xlink:href="#E1-MJMATHI-6E" x="0" y="0"></use>
|
|
28
|
+
<use xlink:href="#E1-MJMAIN-2212" x="822" y="0"></use>
|
|
29
|
+
<use xlink:href="#E1-MJMAIN-31" x="1823" y="0"></use>
|
|
30
|
+
</g>
|
|
31
|
+
</g>
|
|
32
|
+
</g>
|
|
33
|
+
<g transform="translate(5108,0)">
|
|
34
|
+
<use xlink:href="#E1-MJSZ2-2211" x="0" y="0"></use>
|
|
35
|
+
<g transform="translate(147,-1090)">
|
|
36
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-69" x="0" y="0"></use>
|
|
37
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-3D" x="345" y="0"></use>
|
|
38
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-30" x="1124" y="0"></use>
|
|
39
|
+
</g>
|
|
40
|
+
<g transform="translate(57,1151)">
|
|
41
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-6E" x="0" y="0"></use>
|
|
42
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-2212" x="600" y="0"></use>
|
|
43
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-31" x="1379" y="0"></use>
|
|
44
|
+
</g>
|
|
45
|
+
</g>
|
|
46
|
+
<use xlink:href="#E1-MJMAIN-28" x="6552" y="0"></use>
|
|
47
|
+
<g transform="translate(6942,0)">
|
|
48
|
+
<use xlink:href="#E1-MJMATHI-78" x="0" y="0"></use>
|
|
49
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMATHI-69" x="809" y="-213"></use>
|
|
50
|
+
</g>
|
|
51
|
+
<use xlink:href="#E1-MJMAIN-2212" x="8081" y="0"></use>
|
|
52
|
+
<g transform="translate(9081,0)">
|
|
53
|
+
<use xlink:href="#E1-MJMATHI-78" x="0" y="0"></use>
|
|
54
|
+
<use xlink:href="#E1-MJMAIN-AF" x="63" y="7"></use>
|
|
55
|
+
</g>
|
|
56
|
+
<g transform="translate(9654,0)">
|
|
57
|
+
<use xlink:href="#E1-MJMAIN-29" x="0" y="0"></use>
|
|
58
|
+
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-32" x="550" y="583"></use>
|
|
59
|
+
</g>
|
|
60
|
+
</g>
|
|
61
|
+
</svg>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2020 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// TypeScript Version: 4.1
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Interface describing `dsvariancepn`.
|
|
23
|
+
*/
|
|
24
|
+
interface Routine {
|
|
25
|
+
/**
|
|
26
|
+
* Computes the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and returning an extended precision result.
|
|
27
|
+
*
|
|
28
|
+
* @param N - number of indexed elements
|
|
29
|
+
* @param correction - degrees of freedom adjustment
|
|
30
|
+
* @param x - input array
|
|
31
|
+
* @param strideX - stride length
|
|
32
|
+
* @returns variance
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
36
|
+
*
|
|
37
|
+
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
|
|
38
|
+
*
|
|
39
|
+
* var v = dsvariancepn( x.length, 1, x, 1 );
|
|
40
|
+
* // returns ~4.3333
|
|
41
|
+
*/
|
|
42
|
+
( N: number, correction: number, x: Float32Array, strideX: number ): number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Computes the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and alternative indexing semantics and returning an extended precision result.
|
|
46
|
+
*
|
|
47
|
+
* @param N - number of indexed elements
|
|
48
|
+
* @param correction - degrees of freedom adjustment
|
|
49
|
+
* @param x - input array
|
|
50
|
+
* @param strideX - stride length
|
|
51
|
+
* @param offsetX - starting index
|
|
52
|
+
* @returns variance
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
56
|
+
*
|
|
57
|
+
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
|
|
58
|
+
*
|
|
59
|
+
* var v = dsvariancepn.ndarray( x.length, 1, x, 1, 0 );
|
|
60
|
+
* // returns ~4.3333
|
|
61
|
+
*/
|
|
62
|
+
ndarray( N: number, correction: number, x: Float32Array, strideX: number, offsetX: number ): number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Computes the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and returning an extended precision result.
|
|
67
|
+
*
|
|
68
|
+
* @param N - number of indexed elements
|
|
69
|
+
* @param correction - degrees of freedom adjustment
|
|
70
|
+
* @param x - input array
|
|
71
|
+
* @param strideX - stride length
|
|
72
|
+
* @returns variance
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
76
|
+
*
|
|
77
|
+
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
|
|
78
|
+
*
|
|
79
|
+
* var v = dsvariancepn( x.length, 1, x, 1 );
|
|
80
|
+
* // returns ~4.3333
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
84
|
+
*
|
|
85
|
+
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
|
|
86
|
+
*
|
|
87
|
+
* var v = dsvariancepn.ndarray( x.length, 1, x, 1, 0 );
|
|
88
|
+
* // returns ~4.3333
|
|
89
|
+
*/
|
|
90
|
+
declare var dsvariancepn: Routine;
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
// EXPORTS //
|
|
94
|
+
|
|
95
|
+
export = dsvariancepn;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2020 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#ifndef STDLIB_STATS_STRIDED_DSVARIANCEPN_H
|
|
20
|
+
#define STDLIB_STATS_STRIDED_DSVARIANCEPN_H
|
|
21
|
+
|
|
22
|
+
#include "stdlib/blas/base/shared.h"
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
|
|
26
|
+
*/
|
|
27
|
+
#ifdef __cplusplus
|
|
28
|
+
extern "C" {
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Computes the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and returning an extended precision result.
|
|
33
|
+
*/
|
|
34
|
+
double API_SUFFIX(stdlib_strided_dsvariancepn)( const CBLAS_INT N, const float correction, const float *X, const CBLAS_INT strideX );
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Computes the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and alternative indexing semantics and returning an extended precision result.
|
|
38
|
+
*/
|
|
39
|
+
double API_SUFFIX(stdlib_strided_dsvariancepn_ndarray)( const CBLAS_INT N, const float correction, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
|
|
40
|
+
|
|
41
|
+
#ifdef __cplusplus
|
|
42
|
+
}
|
|
43
|
+
#endif
|
|
44
|
+
|
|
45
|
+
#endif // !STDLIB_STATS_STRIDED_DSVARIANCEPN_H
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2020 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict';
|
|
20
|
+
|
|
21
|
+
// MODULES //
|
|
22
|
+
|
|
23
|
+
var stride2offset = require( '@stdlib/strided-base-stride2offset' );
|
|
24
|
+
var ndarray = require( './ndarray.js' );
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// MAIN //
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Computes the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and returning an extended precision result.
|
|
31
|
+
*
|
|
32
|
+
* ## Method
|
|
33
|
+
*
|
|
34
|
+
* - This implementation uses a two-pass approach, as suggested by Neely (1966).
|
|
35
|
+
*
|
|
36
|
+
* ## References
|
|
37
|
+
*
|
|
38
|
+
* - Neely, Peter M. 1966. "Comparison of Several Algorithms for Computation of Means, Standard Deviations and Correlation Coefficients." _Communications of the ACM_ 9 (7). Association for Computing Machinery: 496–99. doi:[10.1145/365719.365958](https://doi.org/10.1145/365719.365958).
|
|
39
|
+
* - Schubert, Erich, and Michael Gertz. 2018. "Numerically Stable Parallel Computation of (Co-)Variance." In _Proceedings of the 30th International Conference on Scientific and Statistical Database Management_. New York, NY, USA: Association for Computing Machinery. doi:[10.1145/3221269.3223036](https://doi.org/10.1145/3221269.3223036).
|
|
40
|
+
*
|
|
41
|
+
* @param {PositiveInteger} N - number of indexed elements
|
|
42
|
+
* @param {number} correction - degrees of freedom adjustment
|
|
43
|
+
* @param {Float32Array} x - input array
|
|
44
|
+
* @param {integer} strideX - stride length
|
|
45
|
+
* @returns {number} variance
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
49
|
+
*
|
|
50
|
+
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
|
|
51
|
+
*
|
|
52
|
+
* var v = dsvariancepn( x.length, 1, x, 1 );
|
|
53
|
+
* // returns ~4.3333
|
|
54
|
+
*/
|
|
55
|
+
function dsvariancepn( N, correction, x, strideX ) {
|
|
56
|
+
return ndarray( N, correction, x, strideX, stride2offset( N, strideX ) );
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// EXPORTS //
|
|
61
|
+
|
|
62
|
+
module.exports = dsvariancepn;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2020 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict';
|
|
20
|
+
|
|
21
|
+
// MODULES //
|
|
22
|
+
|
|
23
|
+
var addon = require( './../src/addon.node' );
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
// MAIN //
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Computes the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and returning an extended precision result.
|
|
30
|
+
*
|
|
31
|
+
* @param {PositiveInteger} N - number of indexed elements
|
|
32
|
+
* @param {number} correction - degrees of freedom adjustment
|
|
33
|
+
* @param {Float32Array} x - input array
|
|
34
|
+
* @param {integer} strideX - stride length
|
|
35
|
+
* @returns {number} variance
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
39
|
+
*
|
|
40
|
+
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
|
|
41
|
+
*
|
|
42
|
+
* var v = dsvariancepn( x.length, 1, x, 1 );
|
|
43
|
+
* // returns ~4.3333
|
|
44
|
+
*/
|
|
45
|
+
function dsvariancepn( N, correction, x, strideX ) {
|
|
46
|
+
return addon( N, correction, x, strideX );
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// EXPORTS //
|
|
51
|
+
|
|
52
|
+
module.exports = dsvariancepn;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2020 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Compute the variance of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and returning an extended precision result.
|
|
23
|
+
*
|
|
24
|
+
* @module @stdlib/stats-strided-dsvariancepn
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
28
|
+
* var dsvariancepn = require( '@stdlib/stats-strided-dsvariancepn' );
|
|
29
|
+
*
|
|
30
|
+
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
|
|
31
|
+
*
|
|
32
|
+
* var v = dsvariancepn( x.length, 1, x, 1 );
|
|
33
|
+
* // returns ~4.3333
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
37
|
+
* var dsvariancepn = require( '@stdlib/stats-strided-dsvariancepn' );
|
|
38
|
+
*
|
|
39
|
+
* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
|
|
40
|
+
*
|
|
41
|
+
* var v = dsvariancepn.ndarray( 4, 1, x, 2, 1 );
|
|
42
|
+
* // returns 6.25
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
// MODULES //
|
|
46
|
+
|
|
47
|
+
var join = require( 'path' ).join;
|
|
48
|
+
var tryRequire = require( '@stdlib/utils-try-require' );
|
|
49
|
+
var isError = require( '@stdlib/assert-is-error' );
|
|
50
|
+
var main = require( './main.js' );
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
// MAIN //
|
|
54
|
+
|
|
55
|
+
var dsvariancepn;
|
|
56
|
+
var tmp = tryRequire( join( __dirname, './native.js' ) );
|
|
57
|
+
if ( isError( tmp ) ) {
|
|
58
|
+
dsvariancepn = main;
|
|
59
|
+
} else {
|
|
60
|
+
dsvariancepn = tmp;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
// EXPORTS //
|
|
65
|
+
|
|
66
|
+
module.exports = dsvariancepn;
|
|
67
|
+
|
|
68
|
+
// exports: { "ndarray": "dsvariancepn.ndarray" }
|
package/lib/main.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2020 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict';
|
|
20
|
+
|
|
21
|
+
// MODULES //
|
|
22
|
+
|
|
23
|
+
var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );
|
|
24
|
+
var dsvariancepn = require( './dsvariancepn.js' );
|
|
25
|
+
var ndarray = require( './ndarray.js' );
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// MAIN //
|
|
29
|
+
|
|
30
|
+
setReadOnly( dsvariancepn, 'ndarray', ndarray );
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// EXPORTS //
|
|
34
|
+
|
|
35
|
+
module.exports = dsvariancepn;
|