@sipemu/anofox-statistics 0.6.0 → 0.8.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.
@@ -117,7 +117,7 @@ export function brownForsythe(groups: Array<any>): any;
117
117
  * @param alpha - If specified, compute CI at (1-alpha) level (e.g., 0.05 for 95% CI)
118
118
  * @returns Object with statistic, df, p_value, estimate, conf_int
119
119
  */
120
- export function brunnerMunzel(x: Float64Array, y: Float64Array, alternative: JsAlternative, alpha?: number | null): any;
120
+ export function brunnerMunzel(x: Float64Array | number[], y: Float64Array | number[], alternative: JsAlternative, alpha?: number | null): any;
121
121
 
122
122
  /**
123
123
  * Chi-square goodness-of-fit test.
@@ -126,7 +126,7 @@ export function brunnerMunzel(x: Float64Array, y: Float64Array, alternative: JsA
126
126
  * @param expectedProps - Expected proportions as array of numbers (must sum to 1), or null for uniform
127
127
  * @returns Object with statistic, df, p_value
128
128
  */
129
- export function chiSquareGoodnessOfFit(observed: Float64Array, expected_props?: Float64Array | null): any;
129
+ export function chiSquareGoodnessOfFit(observed: Float64Array | number[], expected_props?: Float64Array | number[] | null): any;
130
130
 
131
131
  /**
132
132
  * Chi-square test for independence.
@@ -145,7 +145,7 @@ export function chiSquareTest(observed: Array<any>, yates_correction?: boolean |
145
145
  * @param horizon - Forecast horizon for HAC variance adjustment
146
146
  * @returns Object with statistic, p_value, p_value_two_sided
147
147
  */
148
- export function clarkWest(e1: Float64Array, e2: Float64Array, horizon: number): any;
148
+ export function clarkWest(e1: Float64Array | number[], e2: Float64Array | number[], horizon: number): any;
149
149
 
150
150
  /**
151
151
  * Cohen's Kappa for inter-rater agreement.
@@ -180,7 +180,7 @@ export function cramersV(observed: Array<any>): any;
180
180
  * @param x - Sample data as Float64Array
181
181
  * @returns Object with k2_statistic, p_value, skewness_z, kurtosis_z
182
182
  */
183
- export function dagostinoKSquared(x: Float64Array): any;
183
+ export function dagostinoKSquared(x: Float64Array | number[]): any;
184
184
 
185
185
  /**
186
186
  * Diebold-Mariano test for comparing forecast accuracy.
@@ -193,7 +193,7 @@ export function dagostinoKSquared(x: Float64Array): any;
193
193
  * @param varEstimator - Variance estimator (Acf or Bartlett)
194
194
  * @returns Object with statistic, p_value, horizon
195
195
  */
196
- export function dieboldMariano(e1: Float64Array, e2: Float64Array, loss_function: JsLossFunction, horizon: number, alternative: JsAlternative, var_estimator: JsVarEstimator): any;
196
+ export function dieboldMariano(e1: Float64Array | number[], e2: Float64Array | number[], loss_function: JsLossFunction, horizon: number, alternative: JsAlternative, var_estimator: JsVarEstimator): any;
197
197
 
198
198
  /**
199
199
  * Distance correlation (measures non-linear dependence).
@@ -202,7 +202,7 @@ export function dieboldMariano(e1: Float64Array, e2: Float64Array, loss_function
202
202
  * @param y - Second variable as Float64Array
203
203
  * @returns Object with dcor, dcov, dvar_x, dvar_y, statistic
204
204
  */
205
- export function distanceCorrelation(x: Float64Array, y: Float64Array): any;
205
+ export function distanceCorrelation(x: Float64Array | number[], y: Float64Array | number[]): any;
206
206
 
207
207
  /**
208
208
  * Distance correlation with permutation test.
@@ -213,7 +213,7 @@ export function distanceCorrelation(x: Float64Array, y: Float64Array): any;
213
213
  * @param seed - Random seed (optional)
214
214
  * @returns Object with dcor, statistic, p_value
215
215
  */
216
- export function distanceCorrelationTest(x: Float64Array, y: Float64Array, n_permutations?: number | null, seed?: bigint | null): any;
216
+ export function distanceCorrelationTest(x: Float64Array | number[], y: Float64Array | number[], n_permutations?: number | null, seed?: bigint | null): any;
217
217
 
218
218
  /**
219
219
  * Energy distance two-sample test (multivariate data).
@@ -237,7 +237,7 @@ export function energyDistanceTest(x: Array<any>, y: Array<any>, n_permutations?
237
237
  * @param seed - Random seed (optional)
238
238
  * @returns Object with statistic, p_value, n_permutations
239
239
  */
240
- export function energyDistanceTest1d(x: Float64Array, y: Float64Array, n_permutations?: number | null, seed?: bigint | null): any;
240
+ export function energyDistanceTest1d(x: Float64Array | number[], y: Float64Array | number[], n_permutations?: number | null, seed?: bigint | null): any;
241
241
 
242
242
  /**
243
243
  * Fisher's exact test for 2x2 contingency tables.
@@ -275,7 +275,7 @@ export function intraclassCorrelation(data: Array<any>, icc_type: JsICCType): an
275
275
  * @param variant - Tau variant (TauA, TauB, TauC)
276
276
  * @returns Object with estimate, statistic, p_value, conf_int
277
277
  */
278
- export function kendallCorrelation(x: Float64Array, y: Float64Array, variant: JsKendallVariant): any;
278
+ export function kendallCorrelation(x: Float64Array | number[], y: Float64Array | number[], variant: JsKendallVariant): any;
279
279
 
280
280
  /**
281
281
  * Kruskal-Wallis H test (non-parametric one-way ANOVA).
@@ -297,7 +297,7 @@ export function kruskalWallis(groups: Array<any>): any;
297
297
  * @param mu - Location shift under H0 (default: 0)
298
298
  * @returns Object with statistic, p_value, estimate, null_value, conf_int
299
299
  */
300
- export function mannWhitneyU(x: Float64Array, y: Float64Array, alternative: JsAlternative, continuity_correction?: boolean | null, exact?: boolean | null, conf_level?: number | null, mu?: number | null): any;
300
+ export function mannWhitneyU(x: Float64Array | number[], y: Float64Array | number[], alternative: JsAlternative, continuity_correction?: boolean | null, exact?: boolean | null, conf_level?: number | null, mu?: number | null): any;
301
301
 
302
302
  /**
303
303
  * McNemar's exact test for paired proportions (small samples).
@@ -340,7 +340,7 @@ export function mmdTest(x: Array<any>, y: Array<any>, kernel: JsKernel, bandwidt
340
340
  * @param seed - Random seed (optional)
341
341
  * @returns Object with statistic, p_value, n_permutations
342
342
  */
343
- export function mmdTest1d(x: Float64Array, y: Float64Array, n_permutations?: number | null, seed?: bigint | null): any;
343
+ export function mmdTest1d(x: Float64Array | number[], y: Float64Array | number[], n_permutations?: number | null, seed?: bigint | null): any;
344
344
 
345
345
  /**
346
346
  * Model Confidence Set (MCS) procedure.
@@ -367,7 +367,7 @@ export function modelConfidenceSet(losses: Array<any>, alpha: number | null | un
367
367
  * @param seed - Random seed (optional)
368
368
  * @returns Object with statistic, p_value_consistent, p_value_upper
369
369
  */
370
- export function mspeAdjustedSpa(benchmark_errors: Float64Array, model_errors: Array<any>, n_bootstrap: number | null | undefined, block_length: number, seed?: bigint | null): any;
370
+ export function mspeAdjustedSpa(benchmark_errors: Float64Array | number[], model_errors: Array<any>, n_bootstrap: number | null | undefined, block_length: number, seed?: bigint | null): any;
371
371
 
372
372
  /**
373
373
  * One-way ANOVA test.
@@ -386,7 +386,7 @@ export function oneWayAnova(groups: Array<any>, kind: JsAnovaKind): any;
386
386
  * @param z - Array of confounding variables (each as Float64Array)
387
387
  * @returns Object with estimate, statistic, df, p_value
388
388
  */
389
- export function partialCorrelation(x: Float64Array, y: Float64Array, z: Array<any>): any;
389
+ export function partialCorrelation(x: Float64Array | number[], y: Float64Array | number[], z: Array<any>): any;
390
390
 
391
391
  /**
392
392
  * Pearson correlation coefficient with significance test.
@@ -396,7 +396,7 @@ export function partialCorrelation(x: Float64Array, y: Float64Array, z: Array<an
396
396
  * @param confLevel - Confidence level for CI (optional, e.g., 0.95)
397
397
  * @returns Object with estimate, statistic, df, p_value, conf_int
398
398
  */
399
- export function pearsonCorrelation(x: Float64Array, y: Float64Array, conf_level?: number | null): any;
399
+ export function pearsonCorrelation(x: Float64Array | number[], y: Float64Array | number[], conf_level?: number | null): any;
400
400
 
401
401
  /**
402
402
  * Permutation t-test.
@@ -408,7 +408,7 @@ export function pearsonCorrelation(x: Float64Array, y: Float64Array, conf_level?
408
408
  * @param seed - Random seed (optional)
409
409
  * @returns Object with statistic, p_value, n_permutations
410
410
  */
411
- export function permutationTTest(x: Float64Array, y: Float64Array, alternative: JsAlternative, n_permutations?: number | null, seed?: bigint | null): any;
411
+ export function permutationTTest(x: Float64Array | number[], y: Float64Array | number[], alternative: JsAlternative, n_permutations?: number | null, seed?: bigint | null): any;
412
412
 
413
413
  /**
414
414
  * Phi coefficient for 2x2 tables.
@@ -448,7 +448,7 @@ export function propTestTwo(successes1: number, trials1: number, successes2: num
448
448
  * @param data - Input sample as Float64Array
449
449
  * @returns Float64Array of ranks (length matches input)
450
450
  */
451
- export function rank(data: Float64Array): Float64Array;
451
+ export function rank(data: Float64Array | number[]): Float64Array;
452
452
 
453
453
  /**
454
454
  * One-way repeated-measures ANOVA.
@@ -472,7 +472,7 @@ export function repeatedMeasuresAnova(data: Array<any>, compute_sphericity?: boo
472
472
  * @param z - Array of confounding variables to control for x only (each as Float64Array)
473
473
  * @returns Object with estimate, statistic, df, p_value
474
474
  */
475
- export function semiPartialCorrelation(x: Float64Array, y: Float64Array, z: Array<any>): any;
475
+ export function semiPartialCorrelation(x: Float64Array | number[], y: Float64Array | number[], z: Array<any>): any;
476
476
 
477
477
  /**
478
478
  * Shapiro-Wilk test for normality.
@@ -480,7 +480,7 @@ export function semiPartialCorrelation(x: Float64Array, y: Float64Array, z: Arra
480
480
  * @param x - Sample data as Float64Array
481
481
  * @returns Object with statistic (W) and p_value
482
482
  */
483
- export function shapiroWilk(x: Float64Array): any;
483
+ export function shapiroWilk(x: Float64Array | number[]): any;
484
484
 
485
485
  /**
486
486
  * Superior Predictive Ability (SPA) test.
@@ -494,7 +494,7 @@ export function shapiroWilk(x: Float64Array): any;
494
494
  * @param seed - Random seed (optional)
495
495
  * @returns Object with statistic, p_values, best_model_idx
496
496
  */
497
- export function spaTest(benchmark_losses: Float64Array, model_losses: Array<any>, n_bootstrap: number | null | undefined, block_length: number, seed?: bigint | null): any;
497
+ export function spaTest(benchmark_losses: Float64Array | number[], model_losses: Array<any>, n_bootstrap: number | null | undefined, block_length: number, seed?: bigint | null): any;
498
498
 
499
499
  /**
500
500
  * Spearman rank correlation coefficient with significance test.
@@ -504,7 +504,7 @@ export function spaTest(benchmark_losses: Float64Array, model_losses: Array<any>
504
504
  * @param confLevel - Confidence level for CI (optional)
505
505
  * @returns Object with estimate, statistic, df, p_value, conf_int
506
506
  */
507
- export function spearmanCorrelation(x: Float64Array, y: Float64Array, conf_level?: number | null): any;
507
+ export function spearmanCorrelation(x: Float64Array | number[], y: Float64Array | number[], conf_level?: number | null): any;
508
508
 
509
509
  export function start(): void;
510
510
 
@@ -519,7 +519,7 @@ export function start(): void;
519
519
  * @param confLevel - Confidence level for CI (optional, e.g., 0.95)
520
520
  * @returns Object with statistic, df, p_value, mean_x, mean_y, conf_int
521
521
  */
522
- export function tTest(x: Float64Array, y: Float64Array, kind: JsTTestKind, alternative: JsAlternative, mu?: number | null, conf_level?: number | null): any;
522
+ export function tTest(x: Float64Array | number[], y: Float64Array | number[], kind: JsTTestKind, alternative: JsAlternative, mu?: number | null, conf_level?: number | null): any;
523
523
 
524
524
  /**
525
525
  * TOST using bootstrap resampling.
@@ -533,7 +533,7 @@ export function tTest(x: Float64Array, y: Float64Array, kind: JsTTestKind, alter
533
533
  * @param seed - Random seed (optional)
534
534
  * @returns TOST result object
535
535
  */
536
- export function tostBootstrap(x: Float64Array, y: Float64Array, lower_bound: number, upper_bound: number, alpha?: number | null, n_bootstrap?: number | null, seed?: bigint | null): any;
536
+ export function tostBootstrap(x: Float64Array | number[], y: Float64Array | number[], lower_bound: number, upper_bound: number, alpha?: number | null, n_bootstrap?: number | null, seed?: bigint | null): any;
537
537
 
538
538
  /**
539
539
  * TOST for correlation equivalence.
@@ -547,7 +547,7 @@ export function tostBootstrap(x: Float64Array, y: Float64Array, lower_bound: num
547
547
  * @param alpha - Significance level (default: 0.05)
548
548
  * @returns TOST result object
549
549
  */
550
- export function tostCorrelation(x: Float64Array, y: Float64Array, rho_null: number, lower_bound: number, upper_bound: number, method: JsCorrelationTostMethod, alpha?: number | null): any;
550
+ export function tostCorrelation(x: Float64Array | number[], y: Float64Array | number[], rho_null: number, lower_bound: number, upper_bound: number, method: JsCorrelationTostMethod, alpha?: number | null): any;
551
551
 
552
552
  /**
553
553
  * TOST for one-sample proportion.
@@ -586,7 +586,7 @@ export function tostPropTwo(successes1: number, trials1: number, successes2: num
586
586
  * @param alpha - Significance level (default: 0.05)
587
587
  * @returns TOST result object
588
588
  */
589
- export function tostTTestOneSample(x: Float64Array, mu: number, lower_bound: number, upper_bound: number, alpha?: number | null): any;
589
+ export function tostTTestOneSample(x: Float64Array | number[], mu: number, lower_bound: number, upper_bound: number, alpha?: number | null): any;
590
590
 
591
591
  /**
592
592
  * TOST t-test for paired samples.
@@ -598,7 +598,7 @@ export function tostTTestOneSample(x: Float64Array, mu: number, lower_bound: num
598
598
  * @param alpha - Significance level (default: 0.05)
599
599
  * @returns TOST result object
600
600
  */
601
- export function tostTTestPaired(x: Float64Array, y: Float64Array, lower_bound: number, upper_bound: number, alpha?: number | null): any;
601
+ export function tostTTestPaired(x: Float64Array | number[], y: Float64Array | number[], lower_bound: number, upper_bound: number, alpha?: number | null): any;
602
602
 
603
603
  /**
604
604
  * TOST t-test for two independent samples.
@@ -611,7 +611,7 @@ export function tostTTestPaired(x: Float64Array, y: Float64Array, lower_bound: n
611
611
  * @param pooled - Use pooled variance (default: false for Welch)
612
612
  * @returns TOST result object
613
613
  */
614
- export function tostTTestTwoSample(x: Float64Array, y: Float64Array, lower_bound: number, upper_bound: number, alpha?: number | null, pooled?: boolean | null): any;
614
+ export function tostTTestTwoSample(x: Float64Array | number[], y: Float64Array | number[], lower_bound: number, upper_bound: number, alpha?: number | null, pooled?: boolean | null): any;
615
615
 
616
616
  /**
617
617
  * TOST Wilcoxon test for paired samples.
@@ -623,7 +623,7 @@ export function tostTTestTwoSample(x: Float64Array, y: Float64Array, lower_bound
623
623
  * @param alpha - Significance level (default: 0.05)
624
624
  * @returns TOST result object
625
625
  */
626
- export function tostWilcoxonPaired(x: Float64Array, y: Float64Array, lower_bound: number, upper_bound: number, alpha?: number | null): any;
626
+ export function tostWilcoxonPaired(x: Float64Array | number[], y: Float64Array | number[], lower_bound: number, upper_bound: number, alpha?: number | null): any;
627
627
 
628
628
  /**
629
629
  * TOST Wilcoxon test for two independent samples.
@@ -635,7 +635,7 @@ export function tostWilcoxonPaired(x: Float64Array, y: Float64Array, lower_bound
635
635
  * @param alpha - Significance level (default: 0.05)
636
636
  * @returns TOST result object
637
637
  */
638
- export function tostWilcoxonTwoSample(x: Float64Array, y: Float64Array, lower_bound: number, upper_bound: number, alpha?: number | null): any;
638
+ export function tostWilcoxonTwoSample(x: Float64Array | number[], y: Float64Array | number[], lower_bound: number, upper_bound: number, alpha?: number | null): any;
639
639
 
640
640
  /**
641
641
  * TOST Yuen test using trimmed means.
@@ -648,7 +648,7 @@ export function tostWilcoxonTwoSample(x: Float64Array, y: Float64Array, lower_bo
648
648
  * @param alpha - Significance level (default: 0.05)
649
649
  * @returns TOST result object
650
650
  */
651
- export function tostYuen(x: Float64Array, y: Float64Array, lower_bound: number, upper_bound: number, trim?: number | null, alpha?: number | null): any;
651
+ export function tostYuen(x: Float64Array | number[], y: Float64Array | number[], lower_bound: number, upper_bound: number, trim?: number | null, alpha?: number | null): any;
652
652
 
653
653
  /**
654
654
  * Two-way ANOVA with interaction.
@@ -664,7 +664,7 @@ export function tostYuen(x: Float64Array, y: Float64Array, lower_bound: number,
664
664
  * (each: ss, df, ms, f_statistic, p_value), plus levels_a, levels_b, n,
665
665
  * grand_mean, cell_means, marginal_means_a, marginal_means_b.
666
666
  */
667
- export function twoWayAnova(values: Float64Array, factor_a: Uint32Array, factor_b: Uint32Array): any;
667
+ export function twoWayAnova(values: Float64Array | number[], factor_a: Uint32Array | number[], factor_b: Uint32Array | number[]): any;
668
668
 
669
669
  /**
670
670
  * Wilcoxon signed-rank test.
@@ -678,7 +678,7 @@ export function twoWayAnova(values: Float64Array, factor_a: Uint32Array, factor_
678
678
  * @param mu - Null hypothesis value (default: 0.0)
679
679
  * @returns Object with statistic, p_value, estimate, null_value, conf_int
680
680
  */
681
- export function wilcoxonSignedRank(x: Float64Array, y: Float64Array, alternative: JsAlternative, continuity_correction?: boolean | null, exact?: boolean | null, conf_level?: number | null, mu?: number | null): any;
681
+ export function wilcoxonSignedRank(x: Float64Array | number[], y: Float64Array | number[], alternative: JsAlternative, continuity_correction?: boolean | null, exact?: boolean | null, conf_level?: number | null, mu?: number | null): any;
682
682
 
683
683
  /**
684
684
  * Yuen's test for trimmed means (robust alternative to t-test).
@@ -690,7 +690,7 @@ export function wilcoxonSignedRank(x: Float64Array, y: Float64Array, alternative
690
690
  * @param confLevel - Confidence level for CI (optional)
691
691
  * @returns Object with statistic, df, p_value, diff, trimmed_mean_x, trimmed_mean_y
692
692
  */
693
- export function yuenTest(x: Float64Array, y: Float64Array, trim: number | null | undefined, alternative: JsAlternative, conf_level?: number | null): any;
693
+ export function yuenTest(x: Float64Array | number[], y: Float64Array | number[], trim: number | null | undefined, alternative: JsAlternative, conf_level?: number | null): any;
694
694
 
695
695
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
696
696
 
@@ -754,11 +754,11 @@ export interface InitOutput {
754
754
  readonly yuenTest: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
755
755
  readonly __wbindgen_malloc: (a: number, b: number) => number;
756
756
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
757
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
757
758
  readonly __wbindgen_exn_store: (a: number) => void;
758
759
  readonly __externref_table_alloc: () => number;
759
760
  readonly __wbindgen_externrefs: WebAssembly.Table;
760
761
  readonly __externref_table_dealloc: (a: number) => void;
761
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
762
762
  readonly __wbindgen_start: () => void;
763
763
  }
764
764