@fileverse-dev/formulajs 4.4.11-mod-4 → 4.4.11-mod-6
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/lib/browser/formula.js +82 -129
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +72 -128
- package/lib/esm/crypto-constants.mjs +40 -0
- package/lib/esm/index.mjs +3 -37
- package/package.json +5 -2
- package/types/cjs/index.d.cts +0 -24
- package/types/esm/index.d.mts +0 -24
package/lib/cjs/index.cjs
CHANGED
|
@@ -3,26 +3,6 @@
|
|
|
3
3
|
var jStat = require('jstat');
|
|
4
4
|
var bessel = require('bessel');
|
|
5
5
|
|
|
6
|
-
function _interopNamespaceDefault(e) {
|
|
7
|
-
var n = Object.create(null);
|
|
8
|
-
if (e) {
|
|
9
|
-
Object.keys(e).forEach(function (k) {
|
|
10
|
-
if (k !== 'default') {
|
|
11
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return e[k]; }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
n.default = e;
|
|
20
|
-
return Object.freeze(n);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
var jStat__namespace = /*#__PURE__*/_interopNamespaceDefault(jStat);
|
|
24
|
-
var bessel__namespace = /*#__PURE__*/_interopNamespaceDefault(bessel);
|
|
25
|
-
|
|
26
6
|
const nil = new Error('#NULL!');
|
|
27
7
|
const div0 = new Error('#DIV/0!');
|
|
28
8
|
const value = new Error('#VALUE!');
|
|
@@ -1064,7 +1044,7 @@ function COLUMN(reference, index) {
|
|
|
1064
1044
|
return undefined
|
|
1065
1045
|
}
|
|
1066
1046
|
|
|
1067
|
-
return
|
|
1047
|
+
return jStat.col(reference, index)
|
|
1068
1048
|
}
|
|
1069
1049
|
|
|
1070
1050
|
/**
|
|
@@ -1088,7 +1068,7 @@ function COLUMNS(array) {
|
|
|
1088
1068
|
return 0
|
|
1089
1069
|
}
|
|
1090
1070
|
|
|
1091
|
-
return
|
|
1071
|
+
return jStat.cols(array)
|
|
1092
1072
|
}
|
|
1093
1073
|
|
|
1094
1074
|
/**
|
|
@@ -1294,7 +1274,7 @@ function ROWS(array) {
|
|
|
1294
1274
|
return 0
|
|
1295
1275
|
}
|
|
1296
1276
|
|
|
1297
|
-
return
|
|
1277
|
+
return jStat.rows(array)
|
|
1298
1278
|
}
|
|
1299
1279
|
/**
|
|
1300
1280
|
* Returns a sorted array of the elements in an array. The returned array is the same shape as the provided array argument.
|
|
@@ -2251,7 +2231,7 @@ function AVEDEV() {
|
|
|
2251
2231
|
return range
|
|
2252
2232
|
}
|
|
2253
2233
|
|
|
2254
|
-
return
|
|
2234
|
+
return jStat.sum(jStat(range).subtract(jStat.mean(range)).abs()[0]) / range.length
|
|
2255
2235
|
}
|
|
2256
2236
|
|
|
2257
2237
|
/**
|
|
@@ -2456,7 +2436,7 @@ BETA.DIST = function (x, alpha, beta, cumulative, a, b) {
|
|
|
2456
2436
|
|
|
2457
2437
|
x = (x - a) / (b - a);
|
|
2458
2438
|
|
|
2459
|
-
return cumulative ?
|
|
2439
|
+
return cumulative ? jStat.beta.cdf(x, alpha, beta) : jStat.beta.pdf(x, alpha, beta)
|
|
2460
2440
|
};
|
|
2461
2441
|
|
|
2462
2442
|
/**
|
|
@@ -2484,7 +2464,7 @@ BETA.INV = (probability, alpha, beta, a, b) => {
|
|
|
2484
2464
|
return value
|
|
2485
2465
|
}
|
|
2486
2466
|
|
|
2487
|
-
return
|
|
2467
|
+
return jStat.beta.inv(probability, alpha, beta) * (b - a) + a
|
|
2488
2468
|
};
|
|
2489
2469
|
|
|
2490
2470
|
const BINOM = {};
|
|
@@ -2511,8 +2491,8 @@ BINOM.DIST = (number_s, trials, probability_s, cumulative) => {
|
|
|
2511
2491
|
}
|
|
2512
2492
|
|
|
2513
2493
|
return cumulative
|
|
2514
|
-
?
|
|
2515
|
-
:
|
|
2494
|
+
? jStat.binomial.cdf(number_s, trials, probability_s)
|
|
2495
|
+
: jStat.binomial.pdf(number_s, trials, probability_s)
|
|
2516
2496
|
};
|
|
2517
2497
|
|
|
2518
2498
|
/**
|
|
@@ -2569,7 +2549,7 @@ BINOM.INV = (trials, probability_s, alpha) => {
|
|
|
2569
2549
|
let x = 0;
|
|
2570
2550
|
|
|
2571
2551
|
while (x <= trials) {
|
|
2572
|
-
if (
|
|
2552
|
+
if (jStat.binomial.cdf(x, trials, probability_s) >= alpha) {
|
|
2573
2553
|
return x
|
|
2574
2554
|
}
|
|
2575
2555
|
|
|
@@ -2597,7 +2577,7 @@ CHISQ.DIST = (x, deg_freedom, cumulative) => {
|
|
|
2597
2577
|
return value
|
|
2598
2578
|
}
|
|
2599
2579
|
|
|
2600
|
-
return cumulative ?
|
|
2580
|
+
return cumulative ? jStat.chisquare.cdf(x, deg_freedom) : jStat.chisquare.pdf(x, deg_freedom)
|
|
2601
2581
|
};
|
|
2602
2582
|
|
|
2603
2583
|
/**
|
|
@@ -2622,7 +2602,7 @@ CHISQ.DIST.RT = (x, deg_freedom) => {
|
|
|
2622
2602
|
return value
|
|
2623
2603
|
}
|
|
2624
2604
|
|
|
2625
|
-
return 1 -
|
|
2605
|
+
return 1 - jStat.chisquare.cdf(x, deg_freedom)
|
|
2626
2606
|
};
|
|
2627
2607
|
|
|
2628
2608
|
/**
|
|
@@ -2642,7 +2622,7 @@ CHISQ.INV = (probability, deg_freedom) => {
|
|
|
2642
2622
|
return value
|
|
2643
2623
|
}
|
|
2644
2624
|
|
|
2645
|
-
return
|
|
2625
|
+
return jStat.chisquare.inv(probability, deg_freedom)
|
|
2646
2626
|
};
|
|
2647
2627
|
|
|
2648
2628
|
/**
|
|
@@ -2667,7 +2647,7 @@ CHISQ.INV.RT = (probability, deg_freedom) => {
|
|
|
2667
2647
|
return value
|
|
2668
2648
|
}
|
|
2669
2649
|
|
|
2670
|
-
return
|
|
2650
|
+
return jStat.chisquare.inv(1.0 - probability, deg_freedom)
|
|
2671
2651
|
};
|
|
2672
2652
|
|
|
2673
2653
|
/**
|
|
@@ -2782,7 +2762,7 @@ CONFIDENCE.NORM = (alpha, standard_dev, size) => {
|
|
|
2782
2762
|
return value
|
|
2783
2763
|
}
|
|
2784
2764
|
|
|
2785
|
-
return
|
|
2765
|
+
return jStat.normalci(1, alpha, standard_dev, size)[1] - 1
|
|
2786
2766
|
};
|
|
2787
2767
|
|
|
2788
2768
|
/**
|
|
@@ -2804,7 +2784,7 @@ CONFIDENCE.T = (alpha, standard_dev, size) => {
|
|
|
2804
2784
|
return value
|
|
2805
2785
|
}
|
|
2806
2786
|
|
|
2807
|
-
return
|
|
2787
|
+
return jStat.tci(1, alpha, standard_dev, size)[1] - 1
|
|
2808
2788
|
};
|
|
2809
2789
|
|
|
2810
2790
|
/**
|
|
@@ -2824,7 +2804,7 @@ function CORREL(array1, array2) {
|
|
|
2824
2804
|
return value
|
|
2825
2805
|
}
|
|
2826
2806
|
|
|
2827
|
-
return
|
|
2807
|
+
return jStat.corrcoeff(array1, array2)
|
|
2828
2808
|
}
|
|
2829
2809
|
|
|
2830
2810
|
/**
|
|
@@ -2975,8 +2955,8 @@ COVARIANCE.P = (array1, array2) => {
|
|
|
2975
2955
|
return value
|
|
2976
2956
|
}
|
|
2977
2957
|
|
|
2978
|
-
const mean1 =
|
|
2979
|
-
const mean2 =
|
|
2958
|
+
const mean1 = jStat.mean(array1);
|
|
2959
|
+
const mean2 = jStat.mean(array2);
|
|
2980
2960
|
|
|
2981
2961
|
let result = 0;
|
|
2982
2962
|
|
|
@@ -3006,7 +2986,7 @@ COVARIANCE.S = (array1, array2) => {
|
|
|
3006
2986
|
return value
|
|
3007
2987
|
}
|
|
3008
2988
|
|
|
3009
|
-
return
|
|
2989
|
+
return jStat.covariance(array1, array2)
|
|
3010
2990
|
};
|
|
3011
2991
|
|
|
3012
2992
|
/**
|
|
@@ -3024,7 +3004,7 @@ function DEVSQ() {
|
|
|
3024
3004
|
return range
|
|
3025
3005
|
}
|
|
3026
3006
|
|
|
3027
|
-
const mean =
|
|
3007
|
+
const mean = jStat.mean(range);
|
|
3028
3008
|
|
|
3029
3009
|
let result = 0;
|
|
3030
3010
|
|
|
@@ -3055,7 +3035,7 @@ EXPON.DIST = (x, lambda, cumulative) => {
|
|
|
3055
3035
|
return value
|
|
3056
3036
|
}
|
|
3057
3037
|
|
|
3058
|
-
return cumulative ?
|
|
3038
|
+
return cumulative ? jStat.exponential.cdf(x, lambda) : jStat.exponential.pdf(x, lambda)
|
|
3059
3039
|
};
|
|
3060
3040
|
|
|
3061
3041
|
const F = {};
|
|
@@ -3081,8 +3061,8 @@ F.DIST = (x, deg_freedom1, deg_freedom2, cumulative) => {
|
|
|
3081
3061
|
}
|
|
3082
3062
|
|
|
3083
3063
|
return cumulative
|
|
3084
|
-
?
|
|
3085
|
-
:
|
|
3064
|
+
? jStat.centralF.cdf(x, deg_freedom1, deg_freedom2)
|
|
3065
|
+
: jStat.centralF.pdf(x, deg_freedom1, deg_freedom2)
|
|
3086
3066
|
};
|
|
3087
3067
|
|
|
3088
3068
|
/**
|
|
@@ -3108,7 +3088,7 @@ F.DIST.RT = function (x, deg_freedom1, deg_freedom2) {
|
|
|
3108
3088
|
return value
|
|
3109
3089
|
}
|
|
3110
3090
|
|
|
3111
|
-
return 1 -
|
|
3091
|
+
return 1 - jStat.centralF.cdf(x, deg_freedom1, deg_freedom2)
|
|
3112
3092
|
};
|
|
3113
3093
|
|
|
3114
3094
|
/**
|
|
@@ -3134,7 +3114,7 @@ F.INV = (probability, deg_freedom1, deg_freedom2) => {
|
|
|
3134
3114
|
return num
|
|
3135
3115
|
}
|
|
3136
3116
|
|
|
3137
|
-
return
|
|
3117
|
+
return jStat.centralF.inv(probability, deg_freedom1, deg_freedom2)
|
|
3138
3118
|
};
|
|
3139
3119
|
|
|
3140
3120
|
/**
|
|
@@ -3167,7 +3147,7 @@ F.INV.RT = function (probability, deg_freedom1, deg_freedom2) {
|
|
|
3167
3147
|
return value
|
|
3168
3148
|
}
|
|
3169
3149
|
|
|
3170
|
-
return
|
|
3150
|
+
return jStat.centralF.inv(1.0 - probability, deg_freedom1, deg_freedom2)
|
|
3171
3151
|
};
|
|
3172
3152
|
|
|
3173
3153
|
/**
|
|
@@ -3267,8 +3247,8 @@ function FORECAST(x, known_ys, known_xs) {
|
|
|
3267
3247
|
return value
|
|
3268
3248
|
}
|
|
3269
3249
|
|
|
3270
|
-
const xmean =
|
|
3271
|
-
const ymean =
|
|
3250
|
+
const xmean = jStat.mean(known_xs);
|
|
3251
|
+
const ymean = jStat.mean(known_ys);
|
|
3272
3252
|
|
|
3273
3253
|
const n = known_xs.length;
|
|
3274
3254
|
|
|
@@ -3353,7 +3333,7 @@ function GAMMA(number) {
|
|
|
3353
3333
|
return num
|
|
3354
3334
|
}
|
|
3355
3335
|
|
|
3356
|
-
return
|
|
3336
|
+
return jStat.gammafn(number)
|
|
3357
3337
|
}
|
|
3358
3338
|
|
|
3359
3339
|
/**
|
|
@@ -3380,7 +3360,7 @@ GAMMA.DIST = function (value$1, alpha, beta, cumulative) {
|
|
|
3380
3360
|
return value
|
|
3381
3361
|
}
|
|
3382
3362
|
|
|
3383
|
-
return cumulative ?
|
|
3363
|
+
return cumulative ? jStat.gamma.cdf(value$1, alpha, beta, true) : jStat.gamma.pdf(value$1, alpha, beta, false)
|
|
3384
3364
|
};
|
|
3385
3365
|
|
|
3386
3366
|
/**
|
|
@@ -3406,7 +3386,7 @@ GAMMA.INV = function (probability, alpha, beta) {
|
|
|
3406
3386
|
return value
|
|
3407
3387
|
}
|
|
3408
3388
|
|
|
3409
|
-
return
|
|
3389
|
+
return jStat.gamma.inv(probability, alpha, beta)
|
|
3410
3390
|
};
|
|
3411
3391
|
|
|
3412
3392
|
/**
|
|
@@ -3424,7 +3404,7 @@ function GAMMALN(x) {
|
|
|
3424
3404
|
return x
|
|
3425
3405
|
}
|
|
3426
3406
|
|
|
3427
|
-
return
|
|
3407
|
+
return jStat.gammaln(x)
|
|
3428
3408
|
}
|
|
3429
3409
|
|
|
3430
3410
|
/**
|
|
@@ -3448,7 +3428,7 @@ GAMMALN.PRECISE = function (x) {
|
|
|
3448
3428
|
return value
|
|
3449
3429
|
}
|
|
3450
3430
|
|
|
3451
|
-
return
|
|
3431
|
+
return jStat.gammaln(x)
|
|
3452
3432
|
};
|
|
3453
3433
|
|
|
3454
3434
|
/**
|
|
@@ -3466,7 +3446,7 @@ function GAUSS(z) {
|
|
|
3466
3446
|
return z
|
|
3467
3447
|
}
|
|
3468
3448
|
|
|
3469
|
-
return
|
|
3449
|
+
return jStat.normal.cdf(z, 0, 1) - 0.5
|
|
3470
3450
|
}
|
|
3471
3451
|
|
|
3472
3452
|
/**
|
|
@@ -3484,7 +3464,7 @@ function GEOMEAN() {
|
|
|
3484
3464
|
return args
|
|
3485
3465
|
}
|
|
3486
3466
|
|
|
3487
|
-
return
|
|
3467
|
+
return jStat.geomean(args)
|
|
3488
3468
|
}
|
|
3489
3469
|
|
|
3490
3470
|
/**
|
|
@@ -3695,7 +3675,7 @@ function KURT() {
|
|
|
3695
3675
|
return range
|
|
3696
3676
|
}
|
|
3697
3677
|
|
|
3698
|
-
const mean =
|
|
3678
|
+
const mean = jStat.mean(range);
|
|
3699
3679
|
const n = range.length;
|
|
3700
3680
|
|
|
3701
3681
|
let sigma = 0;
|
|
@@ -3704,7 +3684,7 @@ function KURT() {
|
|
|
3704
3684
|
sigma += Math.pow(range[i] - mean, 4);
|
|
3705
3685
|
}
|
|
3706
3686
|
|
|
3707
|
-
sigma = sigma / Math.pow(
|
|
3687
|
+
sigma = sigma / Math.pow(jStat.stdev(range, true), 4);
|
|
3708
3688
|
|
|
3709
3689
|
return ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sigma - (3 * (n - 1) * (n - 1)) / ((n - 2) * (n - 3))
|
|
3710
3690
|
}
|
|
@@ -3760,8 +3740,8 @@ function LINEST(known_y, known_x) {
|
|
|
3760
3740
|
return value
|
|
3761
3741
|
}
|
|
3762
3742
|
|
|
3763
|
-
const ymean =
|
|
3764
|
-
const xmean =
|
|
3743
|
+
const ymean = jStat.mean(known_y);
|
|
3744
|
+
const xmean = jStat.mean(known_x);
|
|
3765
3745
|
const n = known_x.length;
|
|
3766
3746
|
|
|
3767
3747
|
let num = 0;
|
|
@@ -3841,7 +3821,7 @@ LOGNORM.DIST = (x, mean, standard_dev, cumulative) => {
|
|
|
3841
3821
|
return value
|
|
3842
3822
|
}
|
|
3843
3823
|
|
|
3844
|
-
return cumulative ?
|
|
3824
|
+
return cumulative ? jStat.lognormal.cdf(x, mean, standard_dev) : jStat.lognormal.pdf(x, mean, standard_dev)
|
|
3845
3825
|
};
|
|
3846
3826
|
|
|
3847
3827
|
/**
|
|
@@ -3863,7 +3843,7 @@ LOGNORM.INV = (probability, mean, standard_dev) => {
|
|
|
3863
3843
|
return value
|
|
3864
3844
|
}
|
|
3865
3845
|
|
|
3866
|
-
return
|
|
3846
|
+
return jStat.lognormal.inv(probability, mean, standard_dev)
|
|
3867
3847
|
};
|
|
3868
3848
|
|
|
3869
3849
|
/**
|
|
@@ -3941,7 +3921,7 @@ function MEDIAN() {
|
|
|
3941
3921
|
|
|
3942
3922
|
const range = arrayValuesToNumbers(flatArguments);
|
|
3943
3923
|
|
|
3944
|
-
let result =
|
|
3924
|
+
let result = jStat.median(range);
|
|
3945
3925
|
|
|
3946
3926
|
if (isNaN(result)) {
|
|
3947
3927
|
result = num;
|
|
@@ -4090,8 +4070,8 @@ NEGBINOM.DIST = (number_f, number_s, probability_s, cumulative) => {
|
|
|
4090
4070
|
}
|
|
4091
4071
|
|
|
4092
4072
|
return cumulative
|
|
4093
|
-
?
|
|
4094
|
-
:
|
|
4073
|
+
? jStat.negbin.cdf(number_f, number_s, probability_s)
|
|
4074
|
+
: jStat.negbin.pdf(number_f, number_s, probability_s)
|
|
4095
4075
|
};
|
|
4096
4076
|
|
|
4097
4077
|
const NORM = {};
|
|
@@ -4121,7 +4101,7 @@ NORM.DIST = (x, mean, standard_dev, cumulative) => {
|
|
|
4121
4101
|
}
|
|
4122
4102
|
|
|
4123
4103
|
// Return normal distribution computed by jStat [http://jstat.org]
|
|
4124
|
-
return cumulative ?
|
|
4104
|
+
return cumulative ? jStat.normal.cdf(x, mean, standard_dev) : jStat.normal.pdf(x, mean, standard_dev)
|
|
4125
4105
|
};
|
|
4126
4106
|
|
|
4127
4107
|
/**
|
|
@@ -4143,7 +4123,7 @@ NORM.INV = (probability, mean, standard_dev) => {
|
|
|
4143
4123
|
return value
|
|
4144
4124
|
}
|
|
4145
4125
|
|
|
4146
|
-
return
|
|
4126
|
+
return jStat.normal.inv(probability, mean, standard_dev)
|
|
4147
4127
|
};
|
|
4148
4128
|
|
|
4149
4129
|
NORM.S = {};
|
|
@@ -4164,7 +4144,7 @@ NORM.S.DIST = (z, cumulative) => {
|
|
|
4164
4144
|
return value
|
|
4165
4145
|
}
|
|
4166
4146
|
|
|
4167
|
-
return cumulative ?
|
|
4147
|
+
return cumulative ? jStat.normal.cdf(z, 0, 1) : jStat.normal.pdf(z, 0, 1)
|
|
4168
4148
|
};
|
|
4169
4149
|
|
|
4170
4150
|
/**
|
|
@@ -4182,7 +4162,7 @@ NORM.S.INV = (probability) => {
|
|
|
4182
4162
|
return value
|
|
4183
4163
|
}
|
|
4184
4164
|
|
|
4185
|
-
return
|
|
4165
|
+
return jStat.normal.inv(probability, 0, 1)
|
|
4186
4166
|
};
|
|
4187
4167
|
|
|
4188
4168
|
/**
|
|
@@ -4202,8 +4182,8 @@ function PEARSON(array1, array2) {
|
|
|
4202
4182
|
return value
|
|
4203
4183
|
}
|
|
4204
4184
|
|
|
4205
|
-
const xmean =
|
|
4206
|
-
const ymean =
|
|
4185
|
+
const xmean = jStat.mean(array1);
|
|
4186
|
+
const ymean = jStat.mean(array2);
|
|
4207
4187
|
const n = array1.length;
|
|
4208
4188
|
|
|
4209
4189
|
let num = 0;
|
|
@@ -4448,7 +4428,7 @@ POISSON.DIST = (x, mean, cumulative) => {
|
|
|
4448
4428
|
return value
|
|
4449
4429
|
}
|
|
4450
4430
|
|
|
4451
|
-
return cumulative ?
|
|
4431
|
+
return cumulative ? jStat.poisson.cdf(x, mean) : jStat.poisson.pdf(x, mean)
|
|
4452
4432
|
};
|
|
4453
4433
|
|
|
4454
4434
|
/**
|
|
@@ -4649,7 +4629,7 @@ function ROW(reference, index) {
|
|
|
4649
4629
|
return undefined
|
|
4650
4630
|
}
|
|
4651
4631
|
|
|
4652
|
-
return
|
|
4632
|
+
return jStat.row(reference, index)
|
|
4653
4633
|
}
|
|
4654
4634
|
|
|
4655
4635
|
/**
|
|
@@ -4688,7 +4668,7 @@ function SKEW() {
|
|
|
4688
4668
|
return range
|
|
4689
4669
|
}
|
|
4690
4670
|
|
|
4691
|
-
const mean =
|
|
4671
|
+
const mean = jStat.mean(range);
|
|
4692
4672
|
const n = range.length;
|
|
4693
4673
|
|
|
4694
4674
|
let sigma = 0;
|
|
@@ -4697,7 +4677,7 @@ function SKEW() {
|
|
|
4697
4677
|
sigma += Math.pow(range[i] - mean, 3);
|
|
4698
4678
|
}
|
|
4699
4679
|
|
|
4700
|
-
return (n * sigma) / ((n - 1) * (n - 2) * Math.pow(
|
|
4680
|
+
return (n * sigma) / ((n - 1) * (n - 2) * Math.pow(jStat.stdev(range, true), 3))
|
|
4701
4681
|
}
|
|
4702
4682
|
|
|
4703
4683
|
/**
|
|
@@ -4714,7 +4694,7 @@ SKEW.P = function () {
|
|
|
4714
4694
|
return range
|
|
4715
4695
|
}
|
|
4716
4696
|
|
|
4717
|
-
const mean =
|
|
4697
|
+
const mean = jStat.mean(range);
|
|
4718
4698
|
const n = range.length;
|
|
4719
4699
|
|
|
4720
4700
|
let m2 = 0;
|
|
@@ -4748,8 +4728,8 @@ function SLOPE(known_y, known_x) {
|
|
|
4748
4728
|
return value
|
|
4749
4729
|
}
|
|
4750
4730
|
|
|
4751
|
-
const xmean =
|
|
4752
|
-
const ymean =
|
|
4731
|
+
const xmean = jStat.mean(known_x);
|
|
4732
|
+
const ymean = jStat.mean(known_y);
|
|
4753
4733
|
const n = known_x.length;
|
|
4754
4734
|
|
|
4755
4735
|
let num = 0;
|
|
@@ -4894,8 +4874,8 @@ function STEYX(known_y, known_x) {
|
|
|
4894
4874
|
return value
|
|
4895
4875
|
}
|
|
4896
4876
|
|
|
4897
|
-
const xmean =
|
|
4898
|
-
const ymean =
|
|
4877
|
+
const xmean = jStat.mean(known_x);
|
|
4878
|
+
const ymean = jStat.mean(known_y);
|
|
4899
4879
|
const n = known_x.length;
|
|
4900
4880
|
|
|
4901
4881
|
let lft = 0;
|
|
@@ -4951,7 +4931,7 @@ T.DIST['2T'] = function (x, deg_freedom) {
|
|
|
4951
4931
|
return value
|
|
4952
4932
|
}
|
|
4953
4933
|
|
|
4954
|
-
return (1 -
|
|
4934
|
+
return (1 - jStat.studentt.cdf(x, deg_freedom)) * 2
|
|
4955
4935
|
};
|
|
4956
4936
|
|
|
4957
4937
|
/**
|
|
@@ -4976,7 +4956,7 @@ T.DIST.RT = function (x, deg_freedom) {
|
|
|
4976
4956
|
return value
|
|
4977
4957
|
}
|
|
4978
4958
|
|
|
4979
|
-
return 1 -
|
|
4959
|
+
return 1 - jStat.studentt.cdf(x, deg_freedom)
|
|
4980
4960
|
};
|
|
4981
4961
|
|
|
4982
4962
|
/**
|
|
@@ -4996,7 +4976,7 @@ T.INV = (probability, deg_freedom) => {
|
|
|
4996
4976
|
return value
|
|
4997
4977
|
}
|
|
4998
4978
|
|
|
4999
|
-
return
|
|
4979
|
+
return jStat.studentt.inv(probability, deg_freedom)
|
|
5000
4980
|
};
|
|
5001
4981
|
|
|
5002
4982
|
/**
|
|
@@ -5020,7 +5000,7 @@ T.INV['2T'] = (probability, deg_freedom) => {
|
|
|
5020
5000
|
return value
|
|
5021
5001
|
}
|
|
5022
5002
|
|
|
5023
|
-
return Math.abs(
|
|
5003
|
+
return Math.abs(jStat.studentt.inv(probability / 2, deg_freedom))
|
|
5024
5004
|
};
|
|
5025
5005
|
|
|
5026
5006
|
// The algorithm can be found here:
|
|
@@ -5042,8 +5022,8 @@ T.TEST = (array1, array2) => {
|
|
|
5042
5022
|
return value
|
|
5043
5023
|
}
|
|
5044
5024
|
|
|
5045
|
-
const mean_x =
|
|
5046
|
-
const mean_y =
|
|
5025
|
+
const mean_x = jStat.mean(array1);
|
|
5026
|
+
const mean_y = jStat.mean(array2);
|
|
5047
5027
|
|
|
5048
5028
|
let s_x = 0;
|
|
5049
5029
|
let s_y = 0;
|
|
@@ -5115,7 +5095,7 @@ function TRIMMEAN(range, percent) {
|
|
|
5115
5095
|
|
|
5116
5096
|
const trim = FLOOR(range.length * percent, 2) / 2;
|
|
5117
5097
|
|
|
5118
|
-
return
|
|
5098
|
+
return jStat.mean(
|
|
5119
5099
|
initial(
|
|
5120
5100
|
rest(
|
|
5121
5101
|
range.sort((a, b) => a - b),
|
|
@@ -8589,7 +8569,7 @@ function BESSELI(x, n) {
|
|
|
8589
8569
|
return value
|
|
8590
8570
|
}
|
|
8591
8571
|
|
|
8592
|
-
return
|
|
8572
|
+
return bessel.besseli(x, n)
|
|
8593
8573
|
}
|
|
8594
8574
|
|
|
8595
8575
|
/**
|
|
@@ -8609,7 +8589,7 @@ function BESSELJ(x, n) {
|
|
|
8609
8589
|
return value
|
|
8610
8590
|
}
|
|
8611
8591
|
|
|
8612
|
-
return
|
|
8592
|
+
return bessel.besselj(x, n)
|
|
8613
8593
|
}
|
|
8614
8594
|
|
|
8615
8595
|
/**
|
|
@@ -8629,7 +8609,7 @@ function BESSELK(x, n) {
|
|
|
8629
8609
|
return value
|
|
8630
8610
|
}
|
|
8631
8611
|
|
|
8632
|
-
return
|
|
8612
|
+
return bessel.besselk(x, n)
|
|
8633
8613
|
}
|
|
8634
8614
|
|
|
8635
8615
|
/**
|
|
@@ -8649,7 +8629,7 @@ function BESSELY(x, n) {
|
|
|
8649
8629
|
return value
|
|
8650
8630
|
}
|
|
8651
8631
|
|
|
8652
|
-
return
|
|
8632
|
+
return bessel.bessely(x, n)
|
|
8653
8633
|
}
|
|
8654
8634
|
|
|
8655
8635
|
/**
|
|
@@ -9500,7 +9480,7 @@ function ERF(lower_limit, upper_limit) {
|
|
|
9500
9480
|
return value
|
|
9501
9481
|
}
|
|
9502
9482
|
|
|
9503
|
-
return
|
|
9483
|
+
return jStat.erf(lower_limit)
|
|
9504
9484
|
}
|
|
9505
9485
|
|
|
9506
9486
|
// TODO
|
|
@@ -9533,7 +9513,7 @@ function ERFC(x) {
|
|
|
9533
9513
|
return value
|
|
9534
9514
|
}
|
|
9535
9515
|
|
|
9536
|
-
return
|
|
9516
|
+
return jStat.erfc(x)
|
|
9537
9517
|
}
|
|
9538
9518
|
|
|
9539
9519
|
// TODO
|
|
@@ -13564,40 +13544,6 @@ const SERVICE_API_KEY = {
|
|
|
13564
13544
|
Etherscan: "ETHERSCAN_API_KEY"
|
|
13565
13545
|
};
|
|
13566
13546
|
|
|
13567
|
-
const FUNCTION_LOCALE = [
|
|
13568
|
-
{
|
|
13569
|
-
n: "GETTXLIST",
|
|
13570
|
-
t: 20,
|
|
13571
|
-
d: "Returns the list of transactions performed by an address, with optional pagination.",
|
|
13572
|
-
a: "Returns the list of transactions performed by an address, with optional pagination.",
|
|
13573
|
-
p: [
|
|
13574
|
-
{
|
|
13575
|
-
name: "value1",
|
|
13576
|
-
detail:
|
|
13577
|
-
"The address string representing the addresses to check for balance",
|
|
13578
|
-
example: `"0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"`,
|
|
13579
|
-
require: "m",
|
|
13580
|
-
},
|
|
13581
|
-
{
|
|
13582
|
-
name: "value2",
|
|
13583
|
-
detail: "Page number.",
|
|
13584
|
-
example: "1",
|
|
13585
|
-
require: "o",
|
|
13586
|
-
repeat: "n",
|
|
13587
|
-
type: "rangenumber",
|
|
13588
|
-
},
|
|
13589
|
-
{
|
|
13590
|
-
name: "value3",
|
|
13591
|
-
detail: "Page size(offset).",
|
|
13592
|
-
example: "100",
|
|
13593
|
-
require: "o",
|
|
13594
|
-
repeat: "n",
|
|
13595
|
-
type: "rangenumber",
|
|
13596
|
-
},
|
|
13597
|
-
],
|
|
13598
|
-
}
|
|
13599
|
-
];
|
|
13600
|
-
|
|
13601
13547
|
async function GETTXLIST(address, page, offset) {
|
|
13602
13548
|
const API_KEY = window.localStorage.getItem('ETHERSCAN_API_KEY');
|
|
13603
13549
|
console.log("FORMULA JS API KEY ETHERSCAN NOT FOUND", API_KEY);
|
|
@@ -13776,7 +13722,6 @@ exports.FLOORPRECISE = FLOORPRECISE;
|
|
|
13776
13722
|
exports.FORECAST = FORECAST;
|
|
13777
13723
|
exports.FREQUENCY = FREQUENCY;
|
|
13778
13724
|
exports.FTEST = FTEST;
|
|
13779
|
-
exports.FUNCTION_LOCALE = FUNCTION_LOCALE;
|
|
13780
13725
|
exports.FV = FV;
|
|
13781
13726
|
exports.FVSCHEDULE = FVSCHEDULE;
|
|
13782
13727
|
exports.GAMMA = GAMMA;
|
|
@@ -13965,7 +13910,6 @@ exports.SEC = SEC;
|
|
|
13965
13910
|
exports.SECH = SECH;
|
|
13966
13911
|
exports.SECOND = SECOND;
|
|
13967
13912
|
exports.SERIESSUM = SERIESSUM;
|
|
13968
|
-
exports.SERVICE_API_KEY = SERVICE_API_KEY;
|
|
13969
13913
|
exports.SHEET = SHEET;
|
|
13970
13914
|
exports.SHEETS = SHEETS;
|
|
13971
13915
|
exports.SIGN = SIGN;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/crypto-constants.js
|
|
2
|
+
var SERVICE_API_KEY = {
|
|
3
|
+
Etherscan: "ETHERSCAN_API_KEY"
|
|
4
|
+
};
|
|
5
|
+
var FUNCTION_LOCALE = [
|
|
6
|
+
{
|
|
7
|
+
n: "GETTXLIST",
|
|
8
|
+
t: 20,
|
|
9
|
+
d: "Returns the list of transactions performed by an address, with optional pagination.",
|
|
10
|
+
a: "Returns the list of transactions performed by an address, with optional pagination.",
|
|
11
|
+
p: [
|
|
12
|
+
{
|
|
13
|
+
name: "value1",
|
|
14
|
+
detail: "The address string representing the addresses to check for balance",
|
|
15
|
+
example: `"0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"`,
|
|
16
|
+
require: "m"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "value2",
|
|
20
|
+
detail: "Page number.",
|
|
21
|
+
example: "1",
|
|
22
|
+
require: "o",
|
|
23
|
+
repeat: "n",
|
|
24
|
+
type: "rangenumber"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "value3",
|
|
28
|
+
detail: "Page size(offset).",
|
|
29
|
+
example: "100",
|
|
30
|
+
require: "o",
|
|
31
|
+
repeat: "n",
|
|
32
|
+
type: "rangenumber"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
export {
|
|
38
|
+
FUNCTION_LOCALE,
|
|
39
|
+
SERVICE_API_KEY
|
|
40
|
+
};
|