@danielsimonjr/mathts-functions 0.15.0 → 0.16.1

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.
@@ -67,5 +67,58 @@ export declare function corrcoef(matrix: number[][]): number[][];
67
67
  * @example kendallTau([1,2,3,4,5], [2,1,4,3,5]) // 0.6
68
68
  */
69
69
  export declare function kendallTau(x: Vec, y: Vec): number;
70
+ /** Result of a simple linear regression with inference. */
71
+ export interface LinRegressResult {
72
+ slope: number;
73
+ intercept: number;
74
+ rValue: number;
75
+ pValue: number;
76
+ stdErr: number;
77
+ interceptStdErr: number;
78
+ }
79
+ /**
80
+ * OLS simple linear regression **with inference** — `y ≈ slope·x + intercept`,
81
+ * plus the correlation coefficient, the slope p-value (t-test, df = n−2), and
82
+ * the slope/intercept standard errors. Matches `scipy.stats.linregress`.
83
+ */
84
+ export declare function linregress(x: Vec, y: Vec): LinRegressResult;
85
+ /** A correlation coefficient with its two-tailed significance p-value. */
86
+ export interface CorrelationTestResult {
87
+ coefficient: number;
88
+ pValue: number;
89
+ }
90
+ /** Pearson correlation **test** (coefficient + two-tailed p, t-test). `scipy.stats.pearsonr`. */
91
+ export declare function pearsonr(x: Vec, y: Vec): CorrelationTestResult;
92
+ /** Spearman rank-correlation **test** (rho + two-tailed p, t-test). `scipy.stats.spearmanr`. */
93
+ export declare function spearmanr(x: Vec, y: Vec): CorrelationTestResult;
94
+ /**
95
+ * Kendall's τ **test** — τ_b coefficient and two-tailed p via the normal
96
+ * approximation `z = 3τ√(n(n−1)) / √(2(2n+5))` (standard large-sample form;
97
+ * scipy's small-n exact p is version/table-specific).
98
+ */
99
+ export declare function kendalltau(x: Vec, y: Vec): CorrelationTestResult;
100
+ /** Peak-to-peak / statistical range: max − min. (`np.ptp`; `range` is taken.) */
101
+ export declare function ptp(x: Vec): number;
102
+ /** Coefficient of variation: population-std / mean (`scipy.stats.variation`, ddof=0). */
103
+ export declare function variation(x: Vec): number;
104
+ /** Trimmed mean — drop `proportion` of the sorted data from each tail. `scipy.stats.trim_mean`. */
105
+ export declare function trimmedMean(x: Vec, proportion: number): number;
106
+ /** Summary statistics bundle (`scipy.stats.describe`): sample variance (ddof=1); biased Fisher skew/kurtosis. */
107
+ export interface DescribeResult {
108
+ nobs: number;
109
+ min: number;
110
+ max: number;
111
+ mean: number;
112
+ variance: number;
113
+ skewness: number;
114
+ kurtosis: number;
115
+ }
116
+ export declare function describe(x: Vec): DescribeResult;
117
+ /** Histogram counts and bin edges (`np.histogram`) — `bins` equal-width bins over [min, max]. */
118
+ export interface HistogramResult {
119
+ counts: number[];
120
+ edges: number[];
121
+ }
122
+ export declare function histogram(x: Vec, bins?: number): HistogramResult;
70
123
  export {};
71
124
  //# sourceMappingURL=descriptive-stats.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"descriptive-stats.d.ts","sourceRoot":"","sources":["../src/descriptive-stats.ts"],"names":[],"mappings":"AAsBA,KAAK,GAAG,GAAG,SAAS,MAAM,EAAE,GAAG,YAAY,CAAC;AAiB5C;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,CAazC;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,MAAM,CAsB/C;AAED,gFAAgF;AAChF,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAKpC;AAED,6DAA6D;AAC7D,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAKpC;AAED,qFAAqF;AACrF,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,UAAO,GAAG,MAAM,CAOhE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAA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,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,SAAK,GAAG,eAAe,CAwB5D"}
package/dist/index.d.ts CHANGED
@@ -17,7 +17,8 @@ export { evaluate, compileExpr, parse, parser, reviver, replacer } from './facto
17
17
  export { help } from './help.js';
18
18
  export { derivativeAt, valueAndDerivativeAt, gradientAt } from './grad-forward.js';
19
19
  export type { DualFn } from './grad-forward.js';
20
- export { gmean, hmean, moment, skewness, kurtosis, iqr, sem, zscore, cov, corrcoef, rankdata, spearman, kendallTau, } from './descriptive-stats.js';
20
+ export { gmean, hmean, moment, skewness, kurtosis, iqr, sem, zscore, cov, corrcoef, rankdata, spearman, kendallTau, linregress, pearsonr, spearmanr, kendalltau, ptp, variation, trimmedMean, describe, histogram, } from './descriptive-stats.js';
21
+ export type { LinRegressResult, CorrelationTestResult, DescribeResult, HistogramResult, } from './descriptive-stats.js';
21
22
  export { clamp, sigmoid, logsumexp, softmax, cumprod, cummax, cummin, cumtrapz, } from './numeric-extra.js';
22
23
  export { normalQuantile, studentTCDF, studentTQuantile, chiSquaredCDF, chiSquaredQuantile, fCDF, fQuantile, gammaCDF, gammaQuantile, betaCDF, betaQuantile, cauchyPDF, cauchyCDF, cauchyQuantile, laplacePDF, laplaceCDF, laplaceQuantile, logisticPDF, logisticCDF, logisticQuantile, } from './distribution-functions.js';
23
24
  export { fTest, jarqueBera, kruskalWallis, wilcoxon, fisherExact, studentizedRangeCDF, studentizedRangeQuantile, tukeyHSD, } from './hypothesis-extra.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,cAAc,kBAAkB,CAAC;AAKjC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,sBAAsB,CAAC;AACrC,OAAO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YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,MAAM,EACN,eAAe,EACf,cAAc,EACd,EAAE,GACH,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAG1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACnE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGxF,OAAO,EACL,SAAS,EACT,eAAe,EACf,KAAK,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -33,9 +33,11 @@ __export(typed_exports, {
33
33
  airyAi: () => airyAi,
34
34
  airyBi: () => airyBi,
35
35
  and: () => and,
36
+ andersonDarlingTest: () => andersonDarlingTest,
36
37
  angle2D: () => angle2D,
37
38
  angle3D: () => angle3D,
38
39
  anova: () => anova,
40
+ anova2: () => anova2,
39
41
  apart: () => apart,
40
42
  area: () => area,
41
43
  arg: () => arg,
@@ -73,6 +75,7 @@ __export(typed_exports, {
73
75
  bitNot: () => bitNot,
74
76
  bitOr: () => bitOr,
75
77
  bitXor: () => bitXor,
78
+ bootstrapCI: () => bootstrapCI,
76
79
  bspline: () => bspline,
77
80
  cancel: () => cancel,
78
81
  carlsonRC: () => carlsonRC,
@@ -122,12 +125,14 @@ __export(typed_exports, {
122
125
  cube: () => cube,
123
126
  cubicSpline: () => cubicSpline,
124
127
  curvefit: () => curvefit,
128
+ dagostinoTest: () => dagostinoTest,
125
129
  dct: () => dct,
126
130
  deepEqual: () => deepEqual,
127
131
  degree: () => degree,
128
132
  delaunayTriangulation: () => delaunayTriangulation,
129
133
  differences: () => differences,
130
134
  digamma: () => digamma,
135
+ discreteUniformDist: () => discreteUniformDist,
131
136
  discriminant: () => discriminant,
132
137
  distance2D: () => distance2D,
133
138
  distance3D: () => distance3D,
@@ -180,6 +185,7 @@ __export(typed_exports, {
180
185
  fourier: () => fourier,
181
186
  fresnelC: () => fresnelC,
182
187
  fresnelS: () => fresnelS,
188
+ friedmanTest: () => friedmanTest,
183
189
  fullSimplify: () => fullSimplify,
184
190
  functionExpand: () => functionExpand,
185
191
  fuseUnaryChain: () => fuseUnaryChain,
@@ -200,6 +206,7 @@ __export(typed_exports, {
200
206
  graphDistance: () => graphDistance,
201
207
  griddata: () => griddata,
202
208
  groupDelay: () => groupDelay,
209
+ gumbelDist: () => gumbelDist,
203
210
  harmonicNumber: () => harmonicNumber,
204
211
  hermiteH: () => hermiteH,
205
212
  hermiteInterp: () => hermiteInterp,
@@ -207,6 +214,7 @@ __export(typed_exports, {
207
214
  hex: () => hex,
208
215
  highpassFilter: () => highpassFilter,
209
216
  hilbertTransform: () => hilbertTransform,
217
+ hotellingT2: () => hotellingT2,
210
218
  hypergeometricDist: () => hypergeometricDist,
211
219
  hypot: () => hypot,
212
220
  idct: () => idct,
@@ -220,6 +228,7 @@ __export(typed_exports, {
220
228
  intersectLines2D: () => intersectLines2D,
221
229
  intersectSegments2D: () => intersectSegments2D,
222
230
  invFourier: () => invFourier,
231
+ invGaussDist: () => invGaussDist,
223
232
  isConnected: () => isConnected,
224
233
  jacobiSymbol: () => jacobiSymbol,
225
234
  jordanForm: () => jordanForm,
@@ -255,6 +264,7 @@ __export(typed_exports, {
255
264
  lowpassFilter: () => lowpassFilter,
256
265
  lucas: () => lucas,
257
266
  lucasL: () => lucasL,
267
+ mahalanobis: () => mahalanobis,
258
268
  manhattanDistance: () => manhattanDistance,
259
269
  mannWhitneyTest: () => mannWhitneyTest,
260
270
  matmul: () => matmul,
@@ -269,6 +279,7 @@ __export(typed_exports, {
269
279
  maxSelect: () => maxSelect,
270
280
  maximize: () => maximize,
271
281
  mean: () => mean,
282
+ meanCI: () => meanCI,
272
283
  medfilt: () => medfilt,
273
284
  medianSelect: () => medianSelect,
274
285
  min: () => min,
@@ -280,7 +291,9 @@ __export(typed_exports, {
280
291
  moebiusMu: () => moebiusMu,
281
292
  multiTaperPSD: () => multiTaperPSD,
282
293
  multinomial: () => multinomial,
294
+ multipleComparison: () => multipleComparison,
283
295
  multiply: () => multiply,
296
+ multivariateNormal: () => multivariateNormal,
284
297
  nearestNeighbor: () => nearestNeighbor,
285
298
  negativeBinomialDist: () => negativeBinomialDist,
286
299
  newtonInterp: () => newtonInterp,
@@ -329,10 +342,12 @@ __export(typed_exports, {
329
342
  parallelStatSum: () => parallelStatSum,
330
343
  parallelStatVariance: () => parallelStatVariance,
331
344
  parallelXCorr: () => parallelXCorr,
345
+ paretoDist: () => paretoDist,
332
346
  partitions: () => partitions,
333
347
  pchip: () => pchip,
334
348
  pchipInterp: () => pchipInterp,
335
349
  periodogram: () => periodogram,
350
+ permutationTest: () => permutationTest,
336
351
  permutations: () => permutations,
337
352
  pickRandom: () => pickRandom,
338
353
  pinv: () => pinv,
@@ -360,12 +375,14 @@ __export(typed_exports, {
360
375
  principalComponentAnalysis: () => principalComponentAnalysis,
361
376
  print: () => print,
362
377
  projectVector: () => projectVector,
378
+ proportionCI: () => proportionCI,
363
379
  proportionZTest: () => proportionZTest,
364
380
  quadprog: () => quadprog,
365
381
  quickSelect: () => quickSelect,
366
382
  random: () => random,
367
383
  randomInt: () => randomInt,
368
384
  rank: () => rank,
385
+ rayleighDist: () => rayleighDist,
369
386
  rbfInterpolate: () => rbfInterpolate,
370
387
  re: () => re,
371
388
  reduce: () => reduce,
@@ -440,6 +457,7 @@ __export(typed_exports, {
440
457
  trapz: () => trapz,
441
458
  trapzF64: () => trapzF64,
442
459
  triangleArea: () => triangleArea,
460
+ triangularDist: () => triangularDist,
443
461
  trigExpand: () => trigExpand,
444
462
  trigReduce: () => trigReduce,
445
463
  trigToExp: () => trigToExp,
@@ -13595,9 +13613,234 @@ function negativeBinomialDist(r, p) {
13595
13613
  })
13596
13614
  };
13597
13615
  }
13616
+ var EULER_GAMMA = 0.5772156649015329;
13617
+ function _contSample(quantile, rng) {
13618
+ return quantile(rng());
13619
+ }
13620
+ function paretoDist(b, xm) {
13621
+ if (b <= 0 || xm <= 0) throw new Error("paretoDist: shape b and scale xm must be positive");
13622
+ const quantile = (p) => p <= 0 ? xm : p >= 1 ? Infinity : xm / Math.pow(1 - p, 1 / b);
13623
+ return {
13624
+ pdf: (x) => x < xm ? 0 : b * Math.pow(xm, b) / Math.pow(x, b + 1),
13625
+ cdf: (x) => x < xm ? 0 : 1 - Math.pow(xm / x, b),
13626
+ quantile,
13627
+ mean: b > 1 ? b * xm / (b - 1) : Infinity,
13628
+ variance: b > 2 ? xm * xm * b / ((b - 1) * (b - 1) * (b - 2)) : Infinity,
13629
+ sample: () => _contSample(quantile, Math.random),
13630
+ sampleN: (n, opts) => _sampleNDispatch(null, [], n, opts, (count2, rng) => {
13631
+ const out = new Float64Array(count2);
13632
+ for (let j = 0; j < count2; j++) out[j] = _contSample(quantile, rng);
13633
+ return out;
13634
+ })
13635
+ };
13636
+ }
13637
+ function rayleighDist(sigma) {
13638
+ if (sigma <= 0) throw new Error("rayleighDist: sigma must be positive");
13639
+ const s2 = sigma * sigma;
13640
+ const quantile = (p) => p <= 0 ? 0 : p >= 1 ? Infinity : sigma * Math.sqrt(-2 * Math.log(1 - p));
13641
+ return {
13642
+ pdf: (x) => x < 0 ? 0 : x / s2 * Math.exp(-(x * x) / (2 * s2)),
13643
+ cdf: (x) => x < 0 ? 0 : 1 - Math.exp(-(x * x) / (2 * s2)),
13644
+ quantile,
13645
+ mean: sigma * Math.sqrt(Math.PI / 2),
13646
+ variance: (4 - Math.PI) / 2 * s2,
13647
+ sample: () => _contSample(quantile, Math.random),
13648
+ sampleN: (n, opts) => _sampleNDispatch(null, [], n, opts, (count2, rng) => {
13649
+ const out = new Float64Array(count2);
13650
+ for (let j = 0; j < count2; j++) out[j] = _contSample(quantile, rng);
13651
+ return out;
13652
+ })
13653
+ };
13654
+ }
13655
+ function triangularDist(a, c, b) {
13656
+ if (!(a <= c && c <= b && a < b))
13657
+ throw new Error("triangularDist: require a <= mode <= b, a < b");
13658
+ const quantile = (p) => {
13659
+ if (p <= 0) return a;
13660
+ if (p >= 1) return b;
13661
+ const fc = (c - a) / (b - a);
13662
+ return p < fc ? a + Math.sqrt(p * (b - a) * (c - a)) : b - Math.sqrt((1 - p) * (b - a) * (b - c));
13663
+ };
13664
+ return {
13665
+ pdf: (x) => {
13666
+ if (x < a || x > b) return 0;
13667
+ if (x < c) return 2 * (x - a) / ((b - a) * (c - a));
13668
+ if (x > c) return 2 * (b - x) / ((b - a) * (b - c));
13669
+ return 2 / (b - a);
13670
+ },
13671
+ cdf: (x) => {
13672
+ if (x <= a) return 0;
13673
+ if (x >= b) return 1;
13674
+ return x < c ? (x - a) * (x - a) / ((b - a) * (c - a)) : 1 - (b - x) * (b - x) / ((b - a) * (b - c));
13675
+ },
13676
+ quantile,
13677
+ mean: (a + c + b) / 3,
13678
+ variance: (a * a + c * c + b * b - a * c - a * b - c * b) / 18,
13679
+ sample: () => _contSample(quantile, Math.random),
13680
+ sampleN: (n, opts) => _sampleNDispatch(null, [], n, opts, (count2, rng) => {
13681
+ const out = new Float64Array(count2);
13682
+ for (let j = 0; j < count2; j++) out[j] = _contSample(quantile, rng);
13683
+ return out;
13684
+ })
13685
+ };
13686
+ }
13687
+ function discreteUniformDist(lo, hi) {
13688
+ if (!Number.isInteger(lo) || !Number.isInteger(hi) || hi < lo) {
13689
+ throw new Error("discreteUniformDist: require integer lo <= hi");
13690
+ }
13691
+ const k = hi - lo + 1;
13692
+ const cdf = (x) => {
13693
+ if (x < lo) return 0;
13694
+ if (x >= hi) return 1;
13695
+ return (Math.floor(x) - lo + 1) / k;
13696
+ };
13697
+ return {
13698
+ pdf: (x) => Number.isInteger(x) && x >= lo && x <= hi ? 1 / k : 0,
13699
+ cdf,
13700
+ quantile: (p) => {
13701
+ if (p <= 0) return lo;
13702
+ if (p >= 1) return hi;
13703
+ return Math.min(hi, lo + Math.ceil(p * k) - 1);
13704
+ },
13705
+ mean: (lo + hi) / 2,
13706
+ variance: (k * k - 1) / 12,
13707
+ sample: () => lo + Math.floor(Math.random() * k),
13708
+ sampleN: (n, opts) => _sampleNDispatch(null, [], n, opts, (count2, rng) => {
13709
+ const out = new Float64Array(count2);
13710
+ for (let j = 0; j < count2; j++) out[j] = lo + Math.floor(rng() * k);
13711
+ return out;
13712
+ })
13713
+ };
13714
+ }
13715
+ function gumbelDist(mu, beta2) {
13716
+ if (beta2 <= 0) throw new Error("gumbelDist: scale beta must be positive");
13717
+ const quantile = (p) => p <= 0 ? -Infinity : p >= 1 ? Infinity : mu - beta2 * Math.log(-Math.log(p));
13718
+ return {
13719
+ pdf: (x) => {
13720
+ const z = (x - mu) / beta2;
13721
+ return 1 / beta2 * Math.exp(-(z + Math.exp(-z)));
13722
+ },
13723
+ cdf: (x) => Math.exp(-Math.exp(-(x - mu) / beta2)),
13724
+ quantile,
13725
+ mean: mu + beta2 * EULER_GAMMA,
13726
+ variance: Math.PI * Math.PI / 6 * beta2 * beta2,
13727
+ sample: () => _contSample(quantile, Math.random),
13728
+ sampleN: (n, opts) => _sampleNDispatch(null, [], n, opts, (count2, rng) => {
13729
+ const out = new Float64Array(count2);
13730
+ for (let j = 0; j < count2; j++) out[j] = _contSample(quantile, rng);
13731
+ return out;
13732
+ })
13733
+ };
13734
+ }
13735
+ function invGaussDist(mu, lambda) {
13736
+ if (mu <= 0 || lambda <= 0) throw new Error("invGaussDist: mu and lambda must be positive");
13737
+ const quantile = (p) => {
13738
+ if (p <= 0) return 0;
13739
+ if (p >= 1) return Infinity;
13740
+ let lo = 1e-9;
13741
+ let hi = mu * 100;
13742
+ for (let it = 0; it < 200; it++) {
13743
+ const mid = (lo + hi) / 2;
13744
+ if (cdf(mid) < p) lo = mid;
13745
+ else hi = mid;
13746
+ }
13747
+ return (lo + hi) / 2;
13748
+ };
13749
+ const cdf = (x) => {
13750
+ if (x <= 0) return 0;
13751
+ const a = Math.sqrt(lambda / x) * (x / mu - 1);
13752
+ const b = -Math.sqrt(lambda / x) * (x / mu + 1);
13753
+ return _normalCdfStd(a) + Math.exp(2 * lambda / mu) * _normalCdfStd(b);
13754
+ };
13755
+ return {
13756
+ pdf: (x) => {
13757
+ if (x <= 0) return 0;
13758
+ return Math.sqrt(lambda / (2 * Math.PI * x * x * x)) * Math.exp(-lambda * (x - mu) * (x - mu) / (2 * mu * mu * x));
13759
+ },
13760
+ cdf,
13761
+ quantile,
13762
+ mean: mu,
13763
+ variance: mu * mu * mu / lambda,
13764
+ sample: () => _contSample(quantile, Math.random),
13765
+ sampleN: (n, opts) => _sampleNDispatch(null, [], n, opts, (count2, rng) => {
13766
+ const out = new Float64Array(count2);
13767
+ for (let j = 0; j < count2; j++) out[j] = _contSample(quantile, rng);
13768
+ return out;
13769
+ })
13770
+ };
13771
+ }
13772
+ function _cholesky(m) {
13773
+ const n = m.length;
13774
+ const L = Array.from({ length: n }, () => new Array(n).fill(0));
13775
+ for (let i = 0; i < n; i++) {
13776
+ for (let j = 0; j <= i; j++) {
13777
+ let s = m[i][j];
13778
+ for (let k = 0; k < j; k++) s -= L[i][k] * L[j][k];
13779
+ if (i === j) {
13780
+ if (s <= 0) throw new Error("multivariateNormal: covariance is not positive-definite");
13781
+ L[i][j] = Math.sqrt(s);
13782
+ } else {
13783
+ L[i][j] = s / L[j][j];
13784
+ }
13785
+ }
13786
+ }
13787
+ return L;
13788
+ }
13789
+ function multivariateNormal(mean6, cov2) {
13790
+ const k = mean6.length;
13791
+ if (cov2.length !== k || cov2.some((row2) => row2.length !== k)) {
13792
+ throw new Error("multivariateNormal: cov must be a k\xD7k matrix matching mean");
13793
+ }
13794
+ const L = _cholesky(cov2);
13795
+ let logDet = 0;
13796
+ for (let i = 0; i < k; i++) logDet += 2 * Math.log(L[i][i]);
13797
+ return {
13798
+ mean: mean6,
13799
+ cov: cov2,
13800
+ pdf: (x) => {
13801
+ if (x.length !== k) throw new Error("multivariateNormal.pdf: x must have length k");
13802
+ const z = new Array(k).fill(0);
13803
+ for (let i = 0; i < k; i++) {
13804
+ let s = x[i] - mean6[i];
13805
+ for (let j = 0; j < i; j++) s -= L[i][j] * z[j];
13806
+ z[i] = s / L[i][i];
13807
+ }
13808
+ let quad = 0;
13809
+ for (let i = 0; i < k; i++) quad += z[i] * z[i];
13810
+ return Math.exp(-0.5 * (k * Math.log(2 * Math.PI) + logDet + quad));
13811
+ }
13812
+ };
13813
+ }
13598
13814
 
13599
13815
  // src/typed/hypothesis.ts
13600
13816
  import { computePool as computePool10 } from "@danielsimonjr/mathts-parallel";
13817
+
13818
+ // src/distribution-functions.ts
13819
+ var normalQuantile = (p, mu = 0, sigma = 1) => normalDist(mu, sigma).quantile(p);
13820
+ var studentTCDF = (x, df) => tDist(df).cdf(x);
13821
+ var studentTQuantile = (p, df) => tDist(df).quantile(p);
13822
+ var chiSquaredCDF = (x, df) => chiSquaredDist(df).cdf(x);
13823
+ var chiSquaredQuantile = (p, df) => chiSquaredDist(df).quantile(p);
13824
+ var fCDF = (x, d1, d2) => fDist(d1, d2).cdf(x);
13825
+ var fQuantile = (p, d1, d2) => fDist(d1, d2).quantile(p);
13826
+ var gammaCDF = (x, shape, rate = 1) => gammaDist(shape, rate).cdf(x);
13827
+ var gammaQuantile = (p, shape, rate = 1) => gammaDist(shape, rate).quantile(p);
13828
+ var betaCDF = (x, a, b) => betaDist(a, b).cdf(x);
13829
+ var betaQuantile = (p, a, b) => betaDist(a, b).quantile(p);
13830
+ var cauchyPDF = (x, x0 = 0, gamma2 = 1) => 1 / (Math.PI * gamma2 * (1 + ((x - x0) / gamma2) ** 2));
13831
+ var cauchyCDF = (x, x0 = 0, gamma2 = 1) => 0.5 + Math.atan((x - x0) / gamma2) / Math.PI;
13832
+ var cauchyQuantile = (p, x0 = 0, gamma2 = 1) => x0 + gamma2 * Math.tan(Math.PI * (p - 0.5));
13833
+ var laplacePDF = (x, mu = 0, b = 1) => Math.exp(-Math.abs(x - mu) / b) / (2 * b);
13834
+ var laplaceCDF = (x, mu = 0, b = 1) => x < mu ? 0.5 * Math.exp((x - mu) / b) : 1 - 0.5 * Math.exp(-(x - mu) / b);
13835
+ var laplaceQuantile = (p, mu = 0, b = 1) => p < 0.5 ? mu + b * Math.log(2 * p) : mu - b * Math.log(2 - 2 * p);
13836
+ var logisticPDF = (x, mu = 0, s = 1) => {
13837
+ const e = Math.exp(-(x - mu) / s);
13838
+ return e / (s * (1 + e) ** 2);
13839
+ };
13840
+ var logisticCDF = (x, mu = 0, s = 1) => 1 / (1 + Math.exp(-(x - mu) / s));
13841
+ var logisticQuantile = (p, mu = 0, s = 1) => mu + s * Math.log(p / (1 - p));
13842
+
13843
+ // src/typed/hypothesis.ts
13601
13844
  var HYPOTHESIS_THRESHOLD = 4096;
13602
13845
  function _makeMulberry322(seed) {
13603
13846
  let s = seed | 0;
@@ -14492,6 +14735,273 @@ function binomialTest(successes, n, p = 0.5) {
14492
14735
  }
14493
14736
  return { statistic: successes / n, pValue: Math.min(1, pValue) };
14494
14737
  }
14738
+ function _skewKurt(a) {
14739
+ const n = a.length;
14740
+ const m = _mean(a);
14741
+ let m2 = 0;
14742
+ let m3 = 0;
14743
+ let m4 = 0;
14744
+ for (const v of a) {
14745
+ const d = v - m;
14746
+ m2 += d * d;
14747
+ m3 += d * d * d;
14748
+ m4 += d * d * d * d;
14749
+ }
14750
+ const mu2 = m2 / n;
14751
+ return { skew: m3 / n / Math.pow(mu2, 1.5), kurtPearson: m4 / n / (mu2 * mu2) };
14752
+ }
14753
+ function andersonDarlingTest(data) {
14754
+ const n = data.length;
14755
+ if (n < 8) throw new Error("andersonDarlingTest: need at least 8 observations");
14756
+ const sorted = data.slice().sort((p2, q) => p2 - q);
14757
+ const mean6 = _mean(sorted);
14758
+ const s = Math.sqrt(_variance(sorted, 1));
14759
+ const phi = (z) => 0.5 * erfcScalar(-z / Math.SQRT2);
14760
+ let sumTerm = 0;
14761
+ for (let i = 0; i < n; i++) {
14762
+ const wi = (sorted[i] - mean6) / s;
14763
+ const wj = (sorted[n - 1 - i] - mean6) / s;
14764
+ sumTerm += (2 * (i + 1) - 1) / n * (Math.log(phi(wi)) + Math.log(1 - phi(wj)));
14765
+ }
14766
+ const a2 = -n - sumTerm;
14767
+ const a2s = a2 * (1 + 0.75 / n + 2.25 / (n * n));
14768
+ let p;
14769
+ if (a2s < 0.2) p = 1 - Math.exp(-13.436 + 101.14 * a2s - 223.73 * a2s * a2s);
14770
+ else if (a2s < 0.34) p = 1 - Math.exp(-8.318 + 42.796 * a2s - 59.938 * a2s * a2s);
14771
+ else if (a2s < 0.6) p = Math.exp(0.9177 - 4.279 * a2s - 1.38 * a2s * a2s);
14772
+ else if (a2s < 10) p = Math.exp(1.2937 - 5.709 * a2s + 0.0186 * a2s * a2s);
14773
+ else p = 0;
14774
+ return { statistic: a2, pValue: Math.max(0, Math.min(1, p)) };
14775
+ }
14776
+ function dagostinoTest(data) {
14777
+ const n = data.length;
14778
+ if (n < 8) throw new Error("dagostinoTest: need at least 8 observations");
14779
+ const { skew, kurtPearson } = _skewKurt(data);
14780
+ const y = skew * Math.sqrt((n + 1) * (n + 3) / (6 * (n - 2)));
14781
+ const beta2 = 3 * (n * n + 27 * n - 70) * (n + 1) * (n + 3) / ((n - 2) * (n + 5) * (n + 7) * (n + 9));
14782
+ const w2 = -1 + Math.sqrt(2 * (beta2 - 1));
14783
+ const delta = 1 / Math.sqrt(0.5 * Math.log(w2));
14784
+ const alpha = Math.sqrt(2 / (w2 - 1));
14785
+ const yy = y === 0 ? 1 : y;
14786
+ const z1 = delta * Math.log(yy / alpha + Math.sqrt(yy / alpha * (yy / alpha) + 1));
14787
+ const E = 3 * (n - 1) / (n + 1);
14788
+ const varb2 = 24 * n * (n - 2) * (n - 3) / ((n + 1) * (n + 1) * (n + 3) * (n + 5));
14789
+ const xx = (kurtPearson - E) / Math.sqrt(varb2);
14790
+ const sqrtbeta1 = 6 * (n * n - 5 * n + 2) / ((n + 7) * (n + 9)) * Math.sqrt(6 * (n + 3) * (n + 5) / (n * (n - 2) * (n - 3)));
14791
+ const A = 6 + 8 / sqrtbeta1 * (2 / sqrtbeta1 + Math.sqrt(1 + 4 / (sqrtbeta1 * sqrtbeta1)));
14792
+ const term1 = 1 - 2 / (9 * A);
14793
+ const denom = 1 + xx * Math.sqrt(2 / (A - 4));
14794
+ const term2 = Math.sign(denom) * Math.cbrt((1 - 2 / A) / Math.abs(denom));
14795
+ const z2 = (term1 - term2) / Math.sqrt(2 / (9 * A));
14796
+ const k2 = z1 * z1 + z2 * z2;
14797
+ return { statistic: k2, pValue: Math.exp(-k2 / 2) };
14798
+ }
14799
+ function friedmanTest(groups) {
14800
+ const k = groups.length;
14801
+ if (k < 3) throw new Error("friedmanTest: need at least 3 related groups");
14802
+ const n = groups[0].length;
14803
+ for (const g of groups)
14804
+ if (g.length !== n) throw new Error("friedmanTest: all groups must be the same length");
14805
+ const rankSums = new Array(k).fill(0);
14806
+ let tieCorrection = 0;
14807
+ for (let block = 0; block < n; block++) {
14808
+ const row2 = groups.map((g) => g[block]);
14809
+ const order = row2.map((_, i) => i).sort((i, j) => row2[i] - row2[j]);
14810
+ const ranks = new Array(k);
14811
+ for (let i = 0; i < k; ) {
14812
+ let j = i;
14813
+ while (j < k && row2[order[j]] === row2[order[i]]) j++;
14814
+ const avg = (i + 1 + j) / 2;
14815
+ const t = j - i;
14816
+ if (t > 1) tieCorrection += t * t * t - t;
14817
+ for (let m = i; m < j; m++) ranks[order[m]] = avg;
14818
+ i = j;
14819
+ }
14820
+ for (let g = 0; g < k; g++) rankSums[g] += ranks[g];
14821
+ }
14822
+ let stat = 12 / (n * k * (k + 1)) * rankSums.reduce((acc, rr) => acc + rr * rr, 0) - 3 * n * (k + 1);
14823
+ const c = 1 - tieCorrection / (n * k * (k * k - 1));
14824
+ if (c !== 0) stat /= c;
14825
+ const df = k - 1;
14826
+ return { statistic: stat, pValue: _chiSquaredPValue(stat, df), degreesOfFreedom: df };
14827
+ }
14828
+ function anova2(data) {
14829
+ const nA = data.length;
14830
+ const nB = data[0].length;
14831
+ const r = data[0][0].length;
14832
+ if (nA < 2 || nB < 2 || r < 2)
14833
+ throw new Error("anova2: need at least 2 levels per factor and 2 replicates");
14834
+ const all = [];
14835
+ for (const row2 of data) for (const cell of row2) for (const v of cell) all.push(v);
14836
+ const grand = _mean(all);
14837
+ const aMeans = data.map((row2) => _mean(row2.flat()));
14838
+ const bMeans = Array.from({ length: nB }, (_, j) => _mean(data.map((row2) => row2[j]).flat()));
14839
+ const cellMeans = data.map((row2) => row2.map((cell) => _mean(cell)));
14840
+ let ssA = 0;
14841
+ for (const am of aMeans) ssA += (am - grand) * (am - grand);
14842
+ ssA *= nB * r;
14843
+ let ssB = 0;
14844
+ for (const bm of bMeans) ssB += (bm - grand) * (bm - grand);
14845
+ ssB *= nA * r;
14846
+ let ssAB = 0;
14847
+ let sse = 0;
14848
+ for (let i = 0; i < nA; i++) {
14849
+ for (let j = 0; j < nB; j++) {
14850
+ const d = cellMeans[i][j] - aMeans[i] - bMeans[j] + grand;
14851
+ ssAB += d * d;
14852
+ for (const v of data[i][j]) sse += (v - cellMeans[i][j]) * (v - cellMeans[i][j]);
14853
+ }
14854
+ }
14855
+ ssAB *= r;
14856
+ const dfA = nA - 1;
14857
+ const dfB = nB - 1;
14858
+ const dfAB = dfA * dfB;
14859
+ const dfE = nA * nB * (r - 1);
14860
+ const mse = sse / dfE;
14861
+ const fA = ssA / dfA / mse;
14862
+ const fB = ssB / dfB / mse;
14863
+ const fAB = ssAB / dfAB / mse;
14864
+ return {
14865
+ factorA: { F: fA, pValue: _fPValue(fA, dfA, dfE), degreesOfFreedom: [dfA, dfE] },
14866
+ factorB: { F: fB, pValue: _fPValue(fB, dfB, dfE), degreesOfFreedom: [dfB, dfE] },
14867
+ interaction: { F: fAB, pValue: _fPValue(fAB, dfAB, dfE), degreesOfFreedom: [dfAB, dfE] }
14868
+ };
14869
+ }
14870
+ function multipleComparison(pValues, method = "bh") {
14871
+ const m = pValues.length;
14872
+ if (m === 0) return [];
14873
+ if (method === "bonferroni") return pValues.map((p) => Math.min(p * m, 1));
14874
+ const order = pValues.map((_, i) => i).sort((i, j) => pValues[i] - pValues[j]);
14875
+ const out = new Array(m);
14876
+ if (method === "holm") {
14877
+ let running = 0;
14878
+ for (let rank2 = 0; rank2 < m; rank2++) {
14879
+ const idx = order[rank2];
14880
+ running = Math.max(running, (m - rank2) * pValues[idx]);
14881
+ out[idx] = Math.min(running, 1);
14882
+ }
14883
+ } else {
14884
+ let prev = 1;
14885
+ for (let rank2 = m - 1; rank2 >= 0; rank2--) {
14886
+ const idx = order[rank2];
14887
+ prev = Math.min(prev, pValues[idx] * m / (rank2 + 1));
14888
+ out[idx] = Math.min(prev, 1);
14889
+ }
14890
+ }
14891
+ return out;
14892
+ }
14893
+ function meanCI(data, confidence = 0.95) {
14894
+ const n = data.length;
14895
+ if (n < 2) throw new Error("meanCI: need at least 2 observations");
14896
+ const m = _mean(data);
14897
+ const se = Math.sqrt(_variance(data, 1) / n);
14898
+ const tcrit = studentTQuantile((1 + confidence) / 2, n - 1);
14899
+ return { estimate: m, lower: m - tcrit * se, upper: m + tcrit * se, confidence };
14900
+ }
14901
+ function proportionCI(successes, n, confidence = 0.95) {
14902
+ if (n <= 0 || successes < 0 || successes > n) {
14903
+ throw new Error("proportionCI: require 0 <= successes <= n, n > 0");
14904
+ }
14905
+ const p = successes / n;
14906
+ const z = normalQuantile((1 + confidence) / 2);
14907
+ const half = z * Math.sqrt(p * (1 - p) / n);
14908
+ return { estimate: p, lower: p - half, upper: p + half, confidence };
14909
+ }
14910
+ function bootstrapCI(data, statistic, opts = {}) {
14911
+ const n = data.length;
14912
+ if (n < 2) throw new Error("bootstrapCI: need at least 2 observations");
14913
+ const confidence = opts.confidence ?? 0.95;
14914
+ const B = opts.resamples ?? 2e3;
14915
+ const rng = opts.seed !== void 0 ? _makeMulberry322(opts.seed) : Math.random;
14916
+ const stats = new Float64Array(B);
14917
+ const resample2 = new Array(n);
14918
+ for (let b = 0; b < B; b++) {
14919
+ for (let i = 0; i < n; i++) resample2[i] = data[Math.floor(rng() * n)];
14920
+ stats[b] = statistic(resample2);
14921
+ }
14922
+ stats.sort();
14923
+ const loIdx = Math.floor((1 - confidence) / 2 * B);
14924
+ const hiIdx = Math.min(B - 1, Math.ceil((1 - (1 - confidence) / 2) * B) - 1);
14925
+ return { estimate: statistic(data), lower: stats[loIdx], upper: stats[hiIdx], confidence };
14926
+ }
14927
+ function permutationTest(a, b, statistic, opts = {}) {
14928
+ const na = a.length;
14929
+ const nb = b.length;
14930
+ const B = opts.resamples ?? 2e3;
14931
+ const rng = opts.seed !== void 0 ? _makeMulberry322(opts.seed) : Math.random;
14932
+ const observed = statistic(a, b);
14933
+ const pool = new Float64Array(na + nb);
14934
+ for (let i = 0; i < na; i++) pool[i] = a[i];
14935
+ for (let i = 0; i < nb; i++) pool[na + i] = b[i];
14936
+ let extreme = 1;
14937
+ for (let p = 0; p < B; p++) {
14938
+ _shuffle(pool, rng);
14939
+ const x = Array.from(pool.subarray(0, na));
14940
+ const y = Array.from(pool.subarray(na));
14941
+ if (Math.abs(statistic(x, y)) >= Math.abs(observed) - 1e-12) extreme++;
14942
+ }
14943
+ return { statistic: observed, pValue: extreme / (B + 1) };
14944
+ }
14945
+ function _matInverse(m) {
14946
+ const n = m.length;
14947
+ const a = m.map((row2, i) => [...row2, ...Array.from({ length: n }, (_, j) => i === j ? 1 : 0)]);
14948
+ for (let col = 0; col < n; col++) {
14949
+ let pivot = col;
14950
+ for (let r = col + 1; r < n; r++) if (Math.abs(a[r][col]) > Math.abs(a[pivot][col])) pivot = r;
14951
+ if (Math.abs(a[pivot][col]) < 1e-15) throw new Error("matrix inverse: singular matrix");
14952
+ [a[col], a[pivot]] = [a[pivot], a[col]];
14953
+ const d = a[col][col];
14954
+ for (let j = 0; j < 2 * n; j++) a[col][j] /= d;
14955
+ for (let r = 0; r < n; r++) {
14956
+ if (r === col) continue;
14957
+ const f = a[r][col];
14958
+ for (let j = 0; j < 2 * n; j++) a[r][j] -= f * a[col][j];
14959
+ }
14960
+ }
14961
+ return a.map((row2) => row2.slice(n));
14962
+ }
14963
+ function _quadForm(d, M) {
14964
+ const n = d.length;
14965
+ let s = 0;
14966
+ for (let i = 0; i < n; i++) {
14967
+ let mi = 0;
14968
+ for (let j = 0; j < n; j++) mi += M[i][j] * d[j];
14969
+ s += d[i] * mi;
14970
+ }
14971
+ return s;
14972
+ }
14973
+ function mahalanobis(u, v, cov2) {
14974
+ if (u.length !== v.length || cov2.length !== u.length) {
14975
+ throw new Error("mahalanobis: u, v, and cov dimensions must match");
14976
+ }
14977
+ const inv2 = _matInverse(cov2);
14978
+ const d = u.map((ui, i) => ui - v[i]);
14979
+ return Math.sqrt(_quadForm(d, inv2));
14980
+ }
14981
+ function hotellingT2(data, mu0) {
14982
+ const n = data.length;
14983
+ const p = mu0.length;
14984
+ if (n <= p) throw new Error("hotellingT2: need more observations than variables");
14985
+ if (data.some((row2) => row2.length !== p))
14986
+ throw new Error("hotellingT2: every row must have length p");
14987
+ const xbar = Array.from({ length: p }, (_, j) => _mean(data.map((row2) => row2[j])));
14988
+ const S = Array.from({ length: p }, () => new Array(p).fill(0));
14989
+ for (const row2 of data) {
14990
+ for (let i = 0; i < p; i++) {
14991
+ for (let j = 0; j < p; j++) S[i][j] += (row2[i] - xbar[i]) * (row2[j] - xbar[j]);
14992
+ }
14993
+ }
14994
+ for (let i = 0; i < p; i++) for (let j = 0; j < p; j++) S[i][j] /= n - 1;
14995
+ const diff2 = xbar.map((x, i) => x - mu0[i]);
14996
+ const t2 = n * _quadForm(diff2, _matInverse(S));
14997
+ const f = (n - p) / (p * (n - 1)) * t2;
14998
+ return {
14999
+ statistic: t2,
15000
+ fStatistic: f,
15001
+ pValue: _fPValue(f, p, n - p),
15002
+ degreesOfFreedom: [p, n - p]
15003
+ };
15004
+ }
14495
15005
 
14496
15006
  // src/typed/matrix-ops.ts
14497
15007
  import {
@@ -42803,6 +43313,159 @@ function kendallTau(x, y) {
42803
43313
  if (denom === 0) return NaN;
42804
43314
  return (P2 - Q2) / denom;
42805
43315
  }
43316
+ function _tTwoTail(t, df) {
43317
+ return 2 * (1 - studentTCDF(Math.abs(t), df));
43318
+ }
43319
+ function linregress(x, y) {
43320
+ const n = x.length;
43321
+ if (n !== y.length) throw new Error("linregress: x and y must have equal length");
43322
+ if (n < 3) throw new Error("linregress: need at least 3 points for inference");
43323
+ const xa = Array.from(x);
43324
+ const ya = Array.from(y);
43325
+ const xbar = mean2(xa);
43326
+ const ybar = mean2(ya);
43327
+ let sxx = 0;
43328
+ let sxy = 0;
43329
+ let syy = 0;
43330
+ for (let i = 0; i < n; i++) {
43331
+ const dx = xa[i] - xbar;
43332
+ const dy = ya[i] - ybar;
43333
+ sxx += dx * dx;
43334
+ sxy += dx * dy;
43335
+ syy += dy * dy;
43336
+ }
43337
+ const slope = sxy / sxx;
43338
+ const intercept = ybar - slope * xbar;
43339
+ const rValue = sxy / Math.sqrt(sxx * syy);
43340
+ const df = n - 2;
43341
+ const s2 = (syy - slope * sxy) / df;
43342
+ const stdErr = Math.sqrt(s2 / sxx);
43343
+ const interceptStdErr = Math.sqrt(s2 * (1 / n + xbar * xbar / sxx));
43344
+ return {
43345
+ slope,
43346
+ intercept,
43347
+ rValue,
43348
+ pValue: _tTwoTail(slope / stdErr, df),
43349
+ stdErr,
43350
+ interceptStdErr
43351
+ };
43352
+ }
43353
+ function _corrTPValue(r, n) {
43354
+ const df = n - 2;
43355
+ if (df <= 0 || Math.abs(r) >= 1) return Math.abs(r) >= 1 ? 0 : 1;
43356
+ const t = r * Math.sqrt(df / (1 - r * r));
43357
+ return _tTwoTail(t, df);
43358
+ }
43359
+ function _pearson(x, y) {
43360
+ const xa = Array.from(x);
43361
+ const ya = Array.from(y);
43362
+ const n = xa.length;
43363
+ if (n !== ya.length) throw new Error("pearsonr: inputs must have equal length");
43364
+ const mx = mean2(xa);
43365
+ const my = mean2(ya);
43366
+ let sxy = 0;
43367
+ let sxx = 0;
43368
+ let syy = 0;
43369
+ for (let i = 0; i < n; i++) {
43370
+ const dx = xa[i] - mx;
43371
+ const dy = ya[i] - my;
43372
+ sxy += dx * dy;
43373
+ sxx += dx * dx;
43374
+ syy += dy * dy;
43375
+ }
43376
+ return sxy / Math.sqrt(sxx * syy);
43377
+ }
43378
+ function pearsonr(x, y) {
43379
+ const r = _pearson(x, y);
43380
+ return { coefficient: r, pValue: _corrTPValue(r, x.length) };
43381
+ }
43382
+ function spearmanr(x, y) {
43383
+ const rho = spearman(x, y);
43384
+ return { coefficient: rho, pValue: _corrTPValue(rho, x.length) };
43385
+ }
43386
+ function kendalltau(x, y) {
43387
+ const tau2 = kendallTau(x, y);
43388
+ const n = x.length;
43389
+ const z = 3 * tau2 * Math.sqrt(n * (n - 1)) / Math.sqrt(2 * (2 * n + 5));
43390
+ return { coefficient: tau2, pValue: 2 * (1 - normalCDF(Math.abs(z))) };
43391
+ }
43392
+ function ptp(x) {
43393
+ const a = Array.from(x);
43394
+ if (a.length === 0) return NaN;
43395
+ let lo = a[0];
43396
+ let hi = a[0];
43397
+ for (const v of a) {
43398
+ if (v < lo) lo = v;
43399
+ if (v > hi) hi = v;
43400
+ }
43401
+ return hi - lo;
43402
+ }
43403
+ function variation(x) {
43404
+ const a = Array.from(x);
43405
+ return stdPop(a) / mean2(a);
43406
+ }
43407
+ function trimmedMean(x, proportion) {
43408
+ if (proportion < 0 || proportion >= 0.5) {
43409
+ throw new Error("trimmedMean: proportion must be in [0, 0.5)");
43410
+ }
43411
+ const a = Array.from(x).sort((p, q) => p - q);
43412
+ const k = Math.floor(a.length * proportion);
43413
+ return mean2(a.slice(k, a.length - k));
43414
+ }
43415
+ function describe(x) {
43416
+ const a = Array.from(x);
43417
+ const n = a.length;
43418
+ if (n < 1) throw new Error("describe: input must be non-empty");
43419
+ const m = mean2(a);
43420
+ let m2 = 0;
43421
+ let m3 = 0;
43422
+ let m4 = 0;
43423
+ let lo = a[0];
43424
+ let hi = a[0];
43425
+ for (const v of a) {
43426
+ const d = v - m;
43427
+ m2 += d * d;
43428
+ m3 += d * d * d;
43429
+ m4 += d * d * d * d;
43430
+ if (v < lo) lo = v;
43431
+ if (v > hi) hi = v;
43432
+ }
43433
+ const mu2 = m2 / n;
43434
+ return {
43435
+ nobs: n,
43436
+ min: lo,
43437
+ max: hi,
43438
+ mean: m,
43439
+ variance: m2 / (n - 1),
43440
+ skewness: m3 / n / Math.pow(mu2, 1.5),
43441
+ kurtosis: m4 / n / (mu2 * mu2) - 3
43442
+ };
43443
+ }
43444
+ function histogram(x, bins = 10) {
43445
+ const a = Array.from(x);
43446
+ if (a.length === 0) throw new Error("histogram: input must be non-empty");
43447
+ if (!Number.isInteger(bins) || bins < 1)
43448
+ throw new Error("histogram: bins must be a positive integer");
43449
+ let lo = a[0];
43450
+ let hi = a[0];
43451
+ for (const v of a) {
43452
+ if (v < lo) lo = v;
43453
+ if (v > hi) hi = v;
43454
+ }
43455
+ if (lo === hi) {
43456
+ lo -= 0.5;
43457
+ hi += 0.5;
43458
+ }
43459
+ const width = (hi - lo) / bins;
43460
+ const edges = Array.from({ length: bins + 1 }, (_, i) => lo + i * width);
43461
+ const counts = new Array(bins).fill(0);
43462
+ for (const v of a) {
43463
+ let idx = Math.floor((v - lo) / width);
43464
+ if (idx === bins) idx = bins - 1;
43465
+ if (idx >= 0 && idx < bins) counts[idx]++;
43466
+ }
43467
+ return { counts, edges };
43468
+ }
42806
43469
 
42807
43470
  // src/numeric-extra.ts
42808
43471
  var toArr = (x) => Array.isArray(x) ? x : Array.from(x);
@@ -42888,31 +43551,6 @@ function cumtrapz(y, x) {
42888
43551
  return out;
42889
43552
  }
42890
43553
 
42891
- // src/distribution-functions.ts
42892
- var normalQuantile = (p, mu = 0, sigma = 1) => normalDist(mu, sigma).quantile(p);
42893
- var studentTCDF = (x, df) => tDist(df).cdf(x);
42894
- var studentTQuantile = (p, df) => tDist(df).quantile(p);
42895
- var chiSquaredCDF = (x, df) => chiSquaredDist(df).cdf(x);
42896
- var chiSquaredQuantile = (p, df) => chiSquaredDist(df).quantile(p);
42897
- var fCDF = (x, d1, d2) => fDist(d1, d2).cdf(x);
42898
- var fQuantile = (p, d1, d2) => fDist(d1, d2).quantile(p);
42899
- var gammaCDF = (x, shape, rate = 1) => gammaDist(shape, rate).cdf(x);
42900
- var gammaQuantile = (p, shape, rate = 1) => gammaDist(shape, rate).quantile(p);
42901
- var betaCDF = (x, a, b) => betaDist(a, b).cdf(x);
42902
- var betaQuantile = (p, a, b) => betaDist(a, b).quantile(p);
42903
- var cauchyPDF = (x, x0 = 0, gamma2 = 1) => 1 / (Math.PI * gamma2 * (1 + ((x - x0) / gamma2) ** 2));
42904
- var cauchyCDF = (x, x0 = 0, gamma2 = 1) => 0.5 + Math.atan((x - x0) / gamma2) / Math.PI;
42905
- var cauchyQuantile = (p, x0 = 0, gamma2 = 1) => x0 + gamma2 * Math.tan(Math.PI * (p - 0.5));
42906
- var laplacePDF = (x, mu = 0, b = 1) => Math.exp(-Math.abs(x - mu) / b) / (2 * b);
42907
- var laplaceCDF = (x, mu = 0, b = 1) => x < mu ? 0.5 * Math.exp((x - mu) / b) : 1 - 0.5 * Math.exp(-(x - mu) / b);
42908
- var laplaceQuantile = (p, mu = 0, b = 1) => p < 0.5 ? mu + b * Math.log(2 * p) : mu - b * Math.log(2 - 2 * p);
42909
- var logisticPDF = (x, mu = 0, s = 1) => {
42910
- const e = Math.exp(-(x - mu) / s);
42911
- return e / (s * (1 + e) ** 2);
42912
- };
42913
- var logisticCDF = (x, mu = 0, s = 1) => 1 / (1 + Math.exp(-(x - mu) / s));
42914
- var logisticQuantile = (p, mu = 0, s = 1) => mu + s * Math.log(p / (1 - p));
42915
-
42916
43554
  // src/hypothesis-extra.ts
42917
43555
  var arr2 = (x) => Array.isArray(x) ? x : Array.from(x);
42918
43556
  var sampleVar = (x) => variance(x);
@@ -43962,9 +44600,11 @@ export {
43962
44600
  airyAi,
43963
44601
  airyBi,
43964
44602
  and,
44603
+ andersonDarlingTest,
43965
44604
  angle2D,
43966
44605
  angle3D,
43967
44606
  anova,
44607
+ anova2,
43968
44608
  apart,
43969
44609
  mapSlices as apply,
43970
44610
  area,
@@ -44017,6 +44657,7 @@ export {
44017
44657
  bohrRadius,
44018
44658
  boltzmann,
44019
44659
  boolean,
44660
+ bootstrapCI,
44020
44661
  bspline,
44021
44662
  butter,
44022
44663
  cancel,
@@ -44115,12 +44756,14 @@ export {
44115
44756
  cumtrapz,
44116
44757
  curl,
44117
44758
  curvefit,
44759
+ dagostinoTest,
44118
44760
  dct,
44119
44761
  deepEqual,
44120
44762
  degree,
44121
44763
  delaunayTriangulation,
44122
44764
  derivative,
44123
44765
  derivativeAt,
44766
+ describe,
44124
44767
  det,
44125
44768
  detrend,
44126
44769
  deuteronMass,
@@ -44129,6 +44772,7 @@ export {
44129
44772
  differences,
44130
44773
  digamma,
44131
44774
  directionalDerivative,
44775
+ discreteUniformDist,
44132
44776
  discriminant,
44133
44777
  distance,
44134
44778
  distance2D,
@@ -44278,6 +44922,7 @@ export {
44278
44922
  freqz,
44279
44923
  fresnelC,
44280
44924
  fresnelS,
44925
+ friedmanTest,
44281
44926
  fullSimplify,
44282
44927
  functionExpand,
44283
44928
  fuseUnaryChain,
@@ -44313,6 +44958,7 @@ export {
44313
44958
  griddata,
44314
44959
  groebnerBasis,
44315
44960
  groupDelay,
44961
+ gumbelDist,
44316
44962
  harmonicNumber,
44317
44963
  hartreeEnergy,
44318
44964
  hasNumericValue,
@@ -44325,7 +44971,9 @@ export {
44325
44971
  hex,
44326
44972
  highpassFilter,
44327
44973
  hilbertTransform,
44974
+ histogram,
44328
44975
  hmean,
44976
+ hotellingT2,
44329
44977
  hypergeometricDist,
44330
44978
  hypot,
44331
44979
  idct,
@@ -44347,6 +44995,7 @@ export {
44347
44995
  intersectSegments2D,
44348
44996
  inv,
44349
44997
  invFourier,
44998
+ invGaussDist,
44350
44999
  inverseConductanceQuantum,
44351
45000
  inverseLaplace,
44352
45001
  inverseLaplaceTransform,
@@ -44371,6 +45020,7 @@ export {
44371
45020
  kdTree,
44372
45021
  kdTreeNearest,
44373
45022
  kendallTau,
45023
+ kendalltau,
44374
45024
  kldivergence,
44375
45025
  klitzing,
44376
45026
  kmeans,
@@ -44405,6 +45055,7 @@ export {
44405
45055
  linearInterp,
44406
45056
  linearRegression,
44407
45057
  linprog,
45058
+ linregress,
44408
45059
  linsolve,
44409
45060
  loess,
44410
45061
  log,
@@ -44432,6 +45083,7 @@ export {
44432
45083
  mad,
44433
45084
  magneticConstant,
44434
45085
  magneticFluxQuantum,
45086
+ mahalanobis,
44435
45087
  manhattanDistance,
44436
45088
  mannWhitneyTest,
44437
45089
  map,
@@ -44452,6 +45104,7 @@ export {
44452
45104
  maxSelect,
44453
45105
  maximize,
44454
45106
  mean,
45107
+ meanCI,
44455
45108
  medfilt,
44456
45109
  median,
44457
45110
  medianSelect,
@@ -44472,8 +45125,10 @@ export {
44472
45125
  movingAverage,
44473
45126
  multiTaperPSD,
44474
45127
  multinomial,
45128
+ multipleComparison,
44475
45129
  multiply,
44476
45130
  multiplyScalar,
45131
+ multivariateNormal,
44477
45132
  multivariateTaylor,
44478
45133
  nearestNeighbor,
44479
45134
  negativeBinomialDist,
@@ -44533,6 +45188,7 @@ export {
44533
45188
  parallelStatSum,
44534
45189
  parallelStatVariance,
44535
45190
  parallelXCorr,
45191
+ paretoDist,
44536
45192
  parse,
44537
45193
  parseNumberWithConfig,
44538
45194
  parser,
@@ -44541,7 +45197,9 @@ export {
44541
45197
  partitions,
44542
45198
  pchip,
44543
45199
  pchipInterp,
45200
+ pearsonr,
44544
45201
  periodogram,
45202
+ permutationTest,
44545
45203
  permutations,
44546
45204
  pickRandom,
44547
45205
  piecewise,
@@ -44578,8 +45236,10 @@ export {
44578
45236
  print,
44579
45237
  prod,
44580
45238
  projectVector,
45239
+ proportionCI,
44581
45240
  proportionZTest,
44582
45241
  protonMass,
45242
+ ptp,
44583
45243
  qr,
44584
45244
  quadprog,
44585
45245
  quantileSeq,
@@ -44598,6 +45258,7 @@ export {
44598
45258
  rank,
44599
45259
  rankdata,
44600
45260
  rationalize,
45261
+ rayleighDist,
44601
45262
  rbfInterpolate,
44602
45263
  re,
44603
45264
  reduce,
@@ -44673,6 +45334,7 @@ export {
44673
45334
  sort,
44674
45335
  sparse,
44675
45336
  spearman,
45337
+ spearmanr,
44676
45338
  spectralClustering,
44677
45339
  spectrogram,
44678
45340
  speedOfLight,
@@ -44728,10 +45390,12 @@ export {
44728
45390
  trapz,
44729
45391
  trapzF64,
44730
45392
  triangleArea,
45393
+ triangularDist,
44731
45394
  trigExpand,
44732
45395
  trigReduce,
44733
45396
  trigToExp,
44734
45397
  tril,
45398
+ trimmedMean,
44735
45399
  triu,
44736
45400
  tukeyHSD,
44737
45401
  typeOf2 as typeOf,
@@ -44765,6 +45429,7 @@ export {
44765
45429
  vander,
44766
45430
  variables,
44767
45431
  variance,
45432
+ variation,
44768
45433
  voronoiDiagram,
44769
45434
  weakMixingAngle,
44770
45435
  weibullDist,
@@ -232,5 +232,54 @@ export declare function hypergeometricDist(population: number, successes: number
232
232
  * @example negativeBinomialDist(5, 0.4).pmf(3) // 0.0774144
233
233
  */
234
234
  export declare function negativeBinomialDist(r: number, p: f64): Distribution;
235
+ /**
236
+ * Pareto distribution (shape `b` > 0, scale `xm` > 0) — `scipy.stats.pareto(b, scale=xm)`.
237
+ * @example paretoDist(3, 2).cdf(4) // 0.875
238
+ */
239
+ export declare function paretoDist(b: number, xm: number): Distribution;
240
+ /**
241
+ * Rayleigh distribution (scale `sigma` > 0) — `scipy.stats.rayleigh(scale=sigma)`.
242
+ * @example rayleighDist(2).mean // 2.5066282746
243
+ */
244
+ export declare function rayleighDist(sigma: number): Distribution;
245
+ /**
246
+ * Triangular distribution on `[a, b]` with mode `c` — matches
247
+ * `scipy.stats.triang((c-a)/(b-a), loc=a, scale=b-a)`.
248
+ * @example triangularDist(0, 4, 6).mean // 3.3333333333
249
+ */
250
+ export declare function triangularDist(a: number, c: number, b: number): Distribution;
251
+ /**
252
+ * Discrete uniform distribution on the integers `lo..hi` (inclusive) — matches
253
+ * `scipy.stats.randint(lo, hi+1)`.
254
+ * @example discreteUniformDist(1, 6).pmf(3) // 0.1666666667
255
+ */
256
+ export declare function discreteUniformDist(lo: number, hi: number): Distribution;
257
+ /**
258
+ * Gumbel (right / maximum) distribution (location `mu`, scale `beta` > 0) —
259
+ * `scipy.stats.gumbel_r(loc=mu, scale=beta)`.
260
+ * @example gumbelDist(1, 2).cdf(3) // 0.6922006276
261
+ */
262
+ export declare function gumbelDist(mu: number, beta: number): Distribution;
263
+ /**
264
+ * Inverse-Gaussian (Wald) distribution — mean `mu` > 0, shape `lambda` > 0.
265
+ * Matches `scipy.stats.invgauss(mu, scale=lambda)` where the scipy mean is
266
+ * `mu*scale`; here `mu` is the actual mean directly.
267
+ * @example invGaussDist(1, 1).pdf(1) // 0.3989422804
268
+ */
269
+ export declare function invGaussDist(mu: number, lambda: number): Distribution;
270
+ /** A multivariate distribution exposing a density function. */
271
+ export interface MultivariateDistribution {
272
+ pdf: (x: number[]) => f64;
273
+ mean: number[];
274
+ cov: number[][];
275
+ }
276
+ /**
277
+ * Multivariate normal distribution with the given `mean` vector and `cov`
278
+ * covariance matrix. Density via a Cholesky factorization (stable log-det +
279
+ * triangular solve). Matches `scipy.stats.multivariate_normal(mean, cov).pdf`.
280
+ *
281
+ * @example multivariateNormal([0, 0], [[1, 0.5],[0.5, 2]]).pdf([0, 0]) // 0.1203098284
282
+ */
283
+ export declare function multivariateNormal(mean: number[], cov: number[][]): MultivariateDistribution;
235
284
  export {};
236
285
  //# sourceMappingURL=dist-objects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dist-objects.d.ts","sourceRoot":"","sources":["../../src/typed/dist-objects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AASH,0CAA0C;AAC1C,KAAK,GAAG,GAAG,MAAM,CAAC;AAElB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;IACrB,uCAAuC;IACvC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;IACrB,sCAAsC;IACtC,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;IAC1B,wBAAwB;IACxB,IAAI,EAAE,GAAG,CAAC;IACV,4BAA4B;IAC5B,QAAQ,EAAE,GAAG,CAAC;IACd,oDAAoD;IACpD,MAAM,EAAE,MAAM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@@ -348,5 +348,121 @@ export declare function binomialTest(successes: number, n: number, p?: f64): {
348
348
  statistic: f64;
349
349
  pValue: f64;
350
350
  };
351
+ /** Normality-test result (statistic + p-value). */
352
+ export interface NormalityTestResult {
353
+ statistic: f64;
354
+ pValue: f64;
355
+ }
356
+ /**
357
+ * Anderson-Darling test for normality. Returns the A^2 statistic (matching
358
+ * scipy.stats.anderson, standardized with the ddof=1 sample std) and a p-value
359
+ * from the D'Agostino-Stephens approximation on the small-sample-corrected A^2*.
360
+ */
361
+ export declare function andersonDarlingTest(data: f64[]): NormalityTestResult;
362
+ /**
363
+ * D'Agostino-Pearson omnibus normality test (scipy.stats.normaltest):
364
+ * K2 = Z1^2 + Z2^2 (skew + kurtosis Z-tests), chi-square with 2 df, p = e^(-K2/2).
365
+ */
366
+ export declare function dagostinoTest(data: f64[]): NormalityTestResult;
367
+ /**
368
+ * Friedman test - non-parametric repeated-measures ANOVA across k related
369
+ * groups of the same n blocks. chi-square with k-1 df. scipy.stats.friedmanchisquare.
370
+ */
371
+ export declare function friedmanTest(groups: f64[][]): {
372
+ statistic: f64;
373
+ pValue: f64;
374
+ degreesOfFreedom: number;
375
+ };
376
+ /** One factor's line in a two-way ANOVA table. */
377
+ export interface Anova2Effect {
378
+ F: f64;
379
+ pValue: f64;
380
+ degreesOfFreedom: [number, number];
381
+ }
382
+ /** Balanced two-way (with-replication) ANOVA result. */
383
+ export interface Anova2Result {
384
+ factorA: Anova2Effect;
385
+ factorB: Anova2Effect;
386
+ interaction: Anova2Effect;
387
+ }
388
+ /**
389
+ * Balanced two-way ANOVA with replication. data[i][j] holds the r replicates for
390
+ * level i of factor A x level j of factor B (all cells equal size). Equivalent to
391
+ * MATLAB anova2.
392
+ */
393
+ export declare function anova2(data: f64[][][]): Anova2Result;
394
+ /**
395
+ * Multiple-comparison p-value correction: bonferroni, holm (step-down), or bh
396
+ * (Benjamini-Hochberg FDR). Matches statsmodels multipletests.
397
+ */
398
+ export declare function multipleComparison(pValues: f64[], method?: 'bonferroni' | 'holm' | 'bh'): f64[];
399
+ /** A confidence interval with the point estimate it brackets. */
400
+ export interface ConfidenceInterval {
401
+ estimate: f64;
402
+ lower: f64;
403
+ upper: f64;
404
+ confidence: f64;
405
+ }
406
+ /**
407
+ * Confidence interval for the population mean via the Student-t distribution
408
+ * (`scipy.stats.t.interval`). `confidence` defaults to 0.95.
409
+ */
410
+ export declare function meanCI(data: f64[], confidence?: number): ConfidenceInterval;
411
+ /**
412
+ * Wald confidence interval for a binomial proportion (normal approximation).
413
+ * `confidence` defaults to 0.95.
414
+ */
415
+ export declare function proportionCI(successes: number, n: number, confidence?: number): ConfidenceInterval;
416
+ /** Options for `bootstrapCI`. */
417
+ export interface BootstrapCIOptions {
418
+ confidence?: number;
419
+ resamples?: number;
420
+ seed?: number;
421
+ }
422
+ /**
423
+ * Percentile bootstrap confidence interval for an arbitrary statistic of a
424
+ * single sample (`scipy.stats.bootstrap`, percentile method). Resampling is
425
+ * deterministic when `seed` is given. Returns the CI plus the observed estimate.
426
+ */
427
+ export declare function bootstrapCI(data: f64[], statistic: (sample: f64[]) => f64, opts?: BootstrapCIOptions): ConfidenceInterval;
428
+ /** Options for `permutationTest`. */
429
+ export interface PermutationOptions {
430
+ resamples?: number;
431
+ seed?: number;
432
+ }
433
+ /**
434
+ * Two-sample permutation test for an arbitrary statistic `statistic(a, b)`.
435
+ * The combined pool is repeatedly shuffled and re-split; the two-tailed p-value
436
+ * is the fraction of permuted statistics at least as extreme (in absolute value)
437
+ * as the observed one (`scipy.stats.permutation_test`). Deterministic with `seed`.
438
+ */
439
+ export declare function permutationTest(a: f64[], b: f64[], statistic: (x: f64[], y: f64[]) => f64, opts?: PermutationOptions): {
440
+ statistic: f64;
441
+ pValue: f64;
442
+ };
443
+ /**
444
+ * Mahalanobis distance between two vectors `u` and `v` under covariance `cov`:
445
+ * √((u−v)ᵀ Σ⁻¹ (u−v)). Matches `scipy.spatial.distance.mahalanobis(u, v, inv(cov))`
446
+ * (this form takes the covariance directly and inverts it internally).
447
+ *
448
+ * @example mahalanobis([1,2], [2.5,1], [[2,0.5],[0.5,1]]) // 1.8126539343
449
+ */
450
+ export declare function mahalanobis(u: number[], v: number[], cov: number[][]): f64;
451
+ /** One-sample Hotelling's T² result. */
452
+ export interface HotellingResult {
453
+ statistic: f64;
454
+ fStatistic: f64;
455
+ pValue: f64;
456
+ degreesOfFreedom: [number, number];
457
+ }
458
+ /**
459
+ * One-sample Hotelling's T² test — the multivariate generalization of the
460
+ * one-sample t-test: is the mean vector of `data` (rows = observations, columns
461
+ * = variables) equal to `mu0`? T² = n·(x̄−μ₀)ᵀ S⁻¹ (x̄−μ₀), and
462
+ * F = (n−p)/(p(n−1))·T² ~ F(p, n−p) under H₀.
463
+ *
464
+ * @example hotellingT2(data, [5, 7]) // { statistic, fStatistic, pValue, degreesOfFreedom }
465
+ */
466
+ export declare function hotellingT2(data: f64[][], mu0: f64[]): HotellingResult;
351
467
  export {};
352
468
  //# sourceMappingURL=hypothesis.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hypothesis.d.ts","sourceRoot":"","sources":["../../src/typed/hypothesis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAUH,mBAAmB;AACnB,KAAK,GAAG,GAAG,MAAM,CAAC;AAElB,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,GAAG,CAAC;IACZ,gBAAgB,EAAE,GAAG,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,GAAG,CAAC;IACZ,gBAAgB,EAAE,GAAG,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,GAAG,CAAC;IAChB,MAAM,EAAE,GAAG,CAAC;IACZ,SAAS,EAAE,GAAG,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;CACf;AAED,MAAM,WAAW,Y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I,EAAE,GAAG,EAAE,EACX,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,GAAG,EACjC,IAAI,GAAE,kBAAuB,GAC5B,kBAAkB,CAgBpB;AAED,qCAAqC;AACrC,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE,GAAG,EAAE,EACR,CAAC,EAAE,GAAG,EAAE,EACR,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,GAAG,EACtC,IAAI,GAAE,kBAAuB,GAC5B;IAAE,SAAS,EAAE,GAAG,CAAC;IAAC,MAAM,EAAE,GAAG,CAAA;CAAE,CAiBjC;AAsCD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,GAAG,GAAG,CAO1E;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,GAAG,CAAC;IACf,UAAU,EAAE,GAAG,CAAC;IAChB,MAAM,EAAE,GAAG,CAAC;IACZ,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,eAAe,CAwBtE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielsimonjr/mathts-functions",
3
- "version": "0.15.0",
3
+ "version": "0.16.1",
4
4
  "description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
5
5
  "author": "Daniel Simon Jr.",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@danielsimonjr/mathts-core": "^0.6.0",
37
- "@danielsimonjr/mathts-expression": "^0.5.3",
37
+ "@danielsimonjr/mathts-expression": "^0.6.0",
38
38
  "@danielsimonjr/mathts-matrix": "^0.2.2",
39
39
  "@danielsimonjr/mathts-parallel": "^0.3.3",
40
40
  "bignumber.js": "^9.1.2",