ziko 0.52.0 → 0.54.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.
@@ -0,0 +1,371 @@
1
+ import { mapfun } from '../mapfun/index.js';
2
+ import { complex } from '../../complex/index.js'
3
+
4
+ export const deg2rad = (...deg) => mapfun(x => x * Math.PI / 180, ...deg);
5
+ export const rad2deg = (...rad) => mapfun(x => x / Math.PI * 180, ...rad);
6
+
7
+ export const abs = (...x) => mapfun(
8
+ x =>{
9
+ if(x.isComplex?.()) return x.z;
10
+ return Math.abs(x)
11
+ },
12
+ ...x
13
+ )
14
+
15
+ export const pow = (...x) => {
16
+ const n = x.pop();
17
+ return mapfun(
18
+ x => {
19
+ if(x.isComplex?.()) {
20
+ if(n.isComplex?.()) return new x.constructor({
21
+ z: Math.exp(n.a * Math.log(x.z) - n.b * x.phi),
22
+ phi: n.b * Math.log(x.z) + n.a * x.phi
23
+ })
24
+ return new x.constructor({z: x.z ** n, phi: x.phi * n});
25
+ }
26
+ if(n.isComplex?.()) return new x.constructor({
27
+ z: Math.exp(n.a * Math.log(x)),
28
+ phi: n.b * Math.log(x)
29
+ })
30
+ return Math.pow(x, n)
31
+ },
32
+ ...x
33
+ )
34
+ }
35
+
36
+ export const sqrt = (...x) => mapfun(
37
+ x=>{
38
+ if(x.isComplex?.())
39
+ return new x.constructor({z: x.z**(1/2), phi: x.phi/2});
40
+ if(x < 0) return complex(0, Math.sqrt(-x))
41
+ return Math.sqrt(x);
42
+ },
43
+ ...x
44
+ );
45
+
46
+ export const cbrt = (...x) => mapfun(
47
+ x=>{
48
+ if(x.isComplex?.())
49
+ return new x.constructor({z: x.z**(1/3), phi: x.phi/3})
50
+ return Math.cbrt(x);
51
+ },
52
+ ...x
53
+ );
54
+
55
+ export const nthr = (...x) => {
56
+ const n = x.pop();
57
+ if(typeof n !== 'number') throw Error('nthr expects a real number n');
58
+ return mapfun(
59
+ x => {
60
+ if(x.isComplex?.()) return new x.constructor({z: x.z ** (1/n), phi: x.phi / n});
61
+ if(x<0) return n%2===2 ? complex(0, (-x)**(1/n)) : -1 * (-x)**(1/n)
62
+ return x**(1/n)
63
+ },
64
+ ...x
65
+ )
66
+ }
67
+
68
+ export const croot = (...x) =>{
69
+ const c = x.pop()
70
+ if(!c.isComplex?.()) throw Error('croot expect Complex number as root')
71
+ return mapfun(
72
+ x => {
73
+ if(typeof x === 'number') x = new c.constructor(x, 0);
74
+ const {a : c_a, b : c_b} = c;
75
+ const {z, phi} = x;
76
+ const D = Math.hypot(c_a, c_b);
77
+ const A = Math.exp((Math.log(z)*c_a + phi*c_b)/D);
78
+ const B = (phi*c_a - Math.log(z)*c_b)/D
79
+ return new c.constructor(
80
+ A * Math.cos(B),
81
+ A * Math.sin(B)
82
+ )
83
+ },
84
+ ...x
85
+ )
86
+ }
87
+
88
+ export const exp = (...x) => mapfun(
89
+ x => {
90
+ if(x.isComplex?.()) return new x.constructor(
91
+ Math.exp(x.a) * Math.cos(x.b),
92
+ Math.exp(x.a) * Math.sin(x.b)
93
+ );
94
+ return Math.exp(x)
95
+ }
96
+ ,...x
97
+ );
98
+
99
+ export const ln = (...x) => mapfun(
100
+ x => {
101
+ if(x.isComplex?.()) return new x.constructor(
102
+ Math.log(x.z),
103
+ x.phi
104
+ );
105
+ return Math.log(x)
106
+ }
107
+ ,...x
108
+ );
109
+
110
+ export const sign = (...x) => mapfun(
111
+ x => {
112
+ if(x.isComplex?.()){
113
+ const {z, phi} = x;
114
+ if(z===0) return new x.constructor(0, 0);
115
+ return new x.constructor({z:1, phi})
116
+ }
117
+ return Math.sign(x)
118
+ }
119
+ ,...x
120
+ );
121
+
122
+ export const floor = (...x) => mapfun(
123
+ x => {
124
+ if(x.isComplex?.()) return new x.constructor(
125
+ Math.floor(x.a),
126
+ Math.floor(x.b)
127
+ )
128
+ return Math.floor(x)
129
+ },
130
+ ...x
131
+ )
132
+ export const ceil = (...x) => mapfun(
133
+ x => {
134
+ if(x.isComplex?.()) return new x.constructor(
135
+ Math.ceil(x.a),
136
+ Math.ceil(x.b)
137
+ )
138
+ return Math.ceil(x)
139
+ },
140
+ ...x
141
+ )
142
+ export const round = (...x) => mapfun(
143
+ x => {
144
+ if(x.isComplex?.()) return new x.constructor(
145
+ Math.round(x.a),
146
+ Math.round(x.b)
147
+ )
148
+ return Math.round(x)
149
+ },
150
+ ...x
151
+ )
152
+
153
+ export const trunc = (...x) => mapfun(
154
+ x => {
155
+ if(x.isComplex?.()) return new x.constructor(
156
+ Math.trunc(x.a),
157
+ Math.trunc(x.b)
158
+ )
159
+ return Math.trunc(x)
160
+ },
161
+ ...x
162
+ )
163
+
164
+ export const fract = (...x) => mapfun(
165
+ x => {
166
+ if(x.isComplex?.()) return new x.constructor(
167
+ x.a - Math.trunc(x.a),
168
+ x.b - Math.trunc(x.b)
169
+ )
170
+ return x - Math.trunc(x)
171
+ },
172
+ ...x
173
+ )
174
+
175
+ export const cos = (...x) => mapfun(
176
+ x => {
177
+ if(x.isComplex?.()) return new x.constructor(
178
+ Math.cos(x.a) * Math.cosh(x.b),
179
+ -Math.sin(x.a) * Math.sinh(x.b)
180
+ );
181
+ return Math.cos(x)
182
+ }
183
+ ,...x
184
+ );
185
+
186
+ export const sin = (...x) => mapfun(
187
+ x =>{
188
+ if(x?.isComplex) return new x.constructor(
189
+ Math.sin(x.a) * Math.cosh(x.b),
190
+ Math.cos(x.a) * Math.sinh(x.b)
191
+ );
192
+ return Math.sin(x)
193
+ }
194
+ , ...x
195
+ );
196
+
197
+ export const tan = (...x) => mapfun(
198
+ x =>{
199
+ if(x?.isComplex){
200
+ const D = Math.cos(2*x.a) + Math.cosh(2*x.b);
201
+ return new x.constructor(
202
+ Math.sin(2*x.a) / D,
203
+ Math.sinh(2*x.b) / D
204
+ );
205
+ }
206
+ return Math.tan(x)
207
+ },
208
+ ...x
209
+ );
210
+
211
+ export const sec = (...x) => mapfun(
212
+ x => {
213
+ if(x.isComplex?.()) {
214
+
215
+ }
216
+ return 1 / Math.cos(x)
217
+ }
218
+ ,...x
219
+ );
220
+
221
+ export const acos = (...x) => mapfun(
222
+ x =>{
223
+ if(x?.isComplex){
224
+ const { a, b } = x;
225
+ const Rp = Math.hypot(a + 1, b);
226
+ const Rm = Math.hypot(a - 1, b);
227
+ globalThis.Rp = Rp
228
+ globalThis.Rm = Rm
229
+ return new x.constructor(
230
+ Math.acos((Rp - Rm) / 2),
231
+ -Math.acosh((Rp + Rm) / 2),
232
+ )
233
+ }
234
+ return Math.acos(x)
235
+ },
236
+ ...x
237
+ );
238
+
239
+ export const asin = (...x) => mapfun(
240
+ x => {
241
+ if(x?.isComplex){
242
+ const { a, b } = x;
243
+ const Rp = Math.hypot(a + 1, b);
244
+ const Rm = Math.hypot(a - 1, b);
245
+ return new x.constructor(
246
+ Math.asin((Rp - Rm) / 2),
247
+ Math.acosh((Rp + Rm) / 2)
248
+ );
249
+ }
250
+ return Math.asin(x);
251
+ },
252
+ ...x
253
+ );
254
+
255
+ export const atan = (...x) => mapfun(
256
+ x => {
257
+ if(x?.isComplex){
258
+ const { a, b } = x;
259
+ return new x.constructor(
260
+ Math.atan((a*2/(1-a**2-b**2)))/2,
261
+ Math.log((a**2 + (1+b)**2)/(a**2 + (1-b)**2))/4
262
+ )
263
+ }
264
+ return Math.atan(x);
265
+ },
266
+ ...x
267
+ );
268
+
269
+ export const acot = (...x) => mapfun(
270
+ x => {
271
+ if(x?.isComplex){
272
+ const { a, b } = x;
273
+ return new x.constructor(
274
+ Math.atan(2*a/(a**2+(b-1)*(b+1)))/2,
275
+ Math.log((a**2 + (b-1)**2)/(a**2 + (b+1)**2))/4
276
+ )
277
+ }
278
+ return Math.PI/2 - Math.atan(x);
279
+ },
280
+ ...x
281
+ );
282
+
283
+
284
+ export const cosh = (...x) => mapfun(
285
+ x =>{
286
+ if(x?.isComplex) return new x.constructor(
287
+ Math.cosh(x.a) * Math.cos(x.b),
288
+ Math.sinh(x.a) * Math.sin(x.b)
289
+ );
290
+ return Math.cosh(x)
291
+ },
292
+ ...x
293
+ )
294
+ export const sinh = (...x) => mapfun(
295
+ x =>{
296
+ if(x?.isComplex) return new x.constructor(
297
+ Math.sinh(x.a) * Math.cos(x.b),
298
+ Math.cosh(x.a) * Math.sin(x.b)
299
+ );
300
+ return Math.sinh(x)
301
+ },
302
+ ...x
303
+ )
304
+ export const tanh = (...x) => mapfun(
305
+ x =>{
306
+ if(x?.isComplex){
307
+ const D = Math.cosh(2*a) + Math.cos(2*b);
308
+ return new x.constructor(
309
+ Math.sinh(2*a) / D,
310
+ Math.sin(2*b) / D
311
+ )
312
+ }
313
+ return Math.tanh(x)
314
+ },
315
+ ...x
316
+ )
317
+
318
+ export const coth = (...x) => mapfun(
319
+ x =>{
320
+ if(x?.isComplex){
321
+ const {a, b} = x
322
+ const D = (Math.sinh(a)**2)*(Math.cos(b)**2) + (Math.cosh(a)**2)*(Math.sin(b)**2)
323
+ return new x.constructor(
324
+ Math.cosh(a) * Math.sinh(a) / D,
325
+ - Math.sin(b) * Math.cos(b) / D
326
+ )
327
+ }
328
+ return 1/Math.tanh(x)
329
+ },
330
+ ...x
331
+ )
332
+
333
+ export const acosh = (...x) => mapfun(
334
+ x =>{
335
+ if(x?.isComplex){
336
+ return ln(x.clone().add(sqrt(x.clone().mul(x.clone()).sub(1))))
337
+ }
338
+ return Math.acosh(x)
339
+ },
340
+ ...x
341
+ )
342
+
343
+ export const asinh = (...x) => mapfun(
344
+ x =>{
345
+ if(x?.isComplex){
346
+ return ln(x.clone().add(sqrt(x.clone().mul(x.clone()).add(1))))
347
+ }
348
+ return Math.asinh(x)
349
+ },
350
+ ...x
351
+ )
352
+
353
+ export const atanh = (...x) => mapfun(
354
+ x =>{
355
+ if(x?.isComplex){
356
+
357
+ }
358
+ return Math.atanh(x)
359
+ },
360
+ ...x
361
+ )
362
+
363
+ export const sig = (...x) => mapfun(
364
+ x =>{
365
+ if(x?.isComplex){
366
+
367
+ }
368
+ return 1/(1+Math.exp(-x))
369
+ },
370
+ ...x
371
+ )
@@ -0,0 +1,65 @@
1
+ export const norm = (x, min, max) => {
2
+ if(x.isComplex?.()) return new x.constructor(
3
+ norm(x.a, min, max),
4
+ norm(x.b, min, max)
5
+ )
6
+ if(x.isMatrix?.()) return new x.constructor(
7
+ x.rows,
8
+ x.cols,
9
+ norm(x.arr.flat(1), min, max)
10
+ );
11
+ return min !== max ? (value - min) / (max - min) : 0;
12
+ }
13
+
14
+ export const lerp = (x, min, max) => {
15
+ if(x.isComplex?.()) return new x.constructor(
16
+ lerp(x.a, min, max),
17
+ lerp(x.b, min, max)
18
+ )
19
+ if(x.isMatrix?.()) return new x.constructor(
20
+ x.rows,
21
+ x.cols,
22
+ lerp(x.arr.flat(1), min, max)
23
+ );
24
+ return (max - min) * value + min;
25
+ }
26
+
27
+ export const map = (x, min, max) => {
28
+ if(x.isComplex?.()) return new x.constructor(
29
+ map(x.a, min, max),
30
+ map(x.b, min, max)
31
+ )
32
+ if(x.isMatrix?.()) return new x.constructor(
33
+ x.rows,
34
+ x.cols,
35
+ map(x.arr.flat(1), min, max)
36
+ );
37
+ return lerp(norm(x, a, b), c, d);
38
+ }
39
+
40
+ export const clamp = (x, min, max) => {
41
+ if(x.isComplex?.()) return new x.constructor(
42
+ clamp(x.a, min, max),
43
+ clamp(x.b, min, max)
44
+ )
45
+ if(x.isMatrix?.()) return new x.constructor(
46
+ x.rows,
47
+ x.cols,
48
+ clamp(x.arr.flat(1), min, max)
49
+ );
50
+ return Math.min(Math.max(c, min), max)
51
+ }
52
+
53
+ export const hypot = (...x) => {
54
+ const c0 = x.find(a => a.isComplex?.());
55
+ if (c0) {
56
+ const W = x.map(n => n.isComplex?.() ? n : new c0.constructor(n, 0));
57
+ return Math.hypot(...W.map(c => c.z));
58
+ }
59
+ return Math.hypot(...x);
60
+ };
61
+
62
+
63
+ export const atan2 = (x, y, rad = true) =>{
64
+
65
+ }
@@ -1,4 +1,4 @@
1
- import { add, sub, mul } from "../../utils/index.js";
1
+ import { add, sub, mul } from "../../functions/arithmetic/index.js";
2
2
  import { pow } from "../../functions/index.js";
3
3
  export function matrix_det(M) {
4
4
  if (!M.isSquare) return new Error("is not square matrix");
@@ -1,22 +1,17 @@
1
- import{
2
- min,
3
- max,
4
- } from "../functions/index.js"
5
- import {
6
- Utils,
1
+ import {
7
2
  add,
8
3
  sub,
9
4
  mul,
10
- div,
11
- modulo,
5
+ div,
6
+ modulo
7
+ } from '../functions/arithmetic/index.js'
8
+ import {
12
9
  map,
13
- lerp,
14
- norm,
15
- clamp
16
-
17
- } from "../utils/index.js";
10
+ lerp,
11
+ clamp,
12
+ norm
13
+ } from '../functions/utils/index.js'
18
14
  import { Complex } from "../complex/index.js";
19
- // import { Random } from "../random/index.js"
20
15
  import { arr2str } from "../../data/index.js";
21
16
  import {
22
17
  matrix_inverse,
@@ -1,70 +1,10 @@
1
- import { abs , pow , sqrtn , max , min} from "../functions/index.js";
2
- import { mul } from "../utils/index.js";
1
+ import { abs , pow , nthr } from "../functions/index.js";
2
+ import { mul } from "../functions/arithmetic/index.js";
3
3
  import { E } from "../const.js";
4
4
  const zeros=(n)=>new Array(n).fill(0);
5
5
  const ones=(n)=>new Array(n).fill(1);
6
6
  const nums=(num,n)=>new Array(n).fill(num);
7
- const norm=(value, min, max)=>{
8
- if (typeof value === "number") return min !== max ? (value - min) / (max - min) : 0;
9
- else if (value.isMatrix?.()) return new value.constructor(value.rows, value.cols, norm(value.arr.flat(1), min, max));
10
- else if (value.isComplex?.()) return new value.constructor(norm(value.a, min, max), norm(value.b, min, max));
11
- else if (value instanceof Array) {
12
- if (value.every((n) => typeof (n === "number"))) {
13
- return value.map((n) => norm(n, min, max));
14
- } else {
15
- let y = new Array(value.length);
16
- for (let i = 0; i < value.length; i++) {
17
- y[i] = norm(value[i]);
18
- }
19
- }
20
- }
21
- }
22
- const lerp=(value, min, max)=>{
23
- if (typeof value === "number") return (max - min) * value + min;
24
- else if (value.isMatrix?.()) return new value.constructor(value.rows, value.cols, lerp(value.arr.flat(1), min, max));
25
- else if (value.isComplex?.()) return new value.constructor(lerp(value.a, min, max), lerp(value.b, min, max));
26
- else if (value instanceof Array) {
27
- if (value.every((n) => typeof (n === "number"))) {
28
- return value.map((n) => lerp(n, min, max));
29
- } else {
30
- let y = new Array(value.length);
31
- for (let i = 0; i < value.length; i++) {
32
- y[i] = lerp(value[i]);
33
- }
34
- }
35
- }
36
- }
37
- const map=(x, a, b, c, d)=>{
38
- if (typeof x === "number") return lerp(norm(x, a, b), c, d);
39
- else if (x.isMatrix?.()) return new x.constructor(x.rows, x.cols, map(x.arr.flat(1), a, b, c, d));
40
- else if (x.isComplex?.()) return new x.constructor(map(x.a, b, c, d), map(x.b, a, b, c, d));
41
- else if (x instanceof Array) {
42
- if (x.every((n) => typeof (n === "number"))) {
43
- return x.map((n) => map(n, a, b, c, d));
44
- } else {
45
- let y = new Array(x.length);
46
- for (let i = 0; i < x.length; i++) {
47
- y[i] = map(x[i], a, b, c, d);
48
- }
49
- }
50
- }
51
- }
52
- const clamp=(x, a , b)=>{
53
- const [min_value,max_value]=[min(a,b),max(a,b)]
54
- if (typeof x === "number") return min(max(x, min_value), max_value);
55
- else if (x.isMatrix?.()) return new x.constructor(x.rows, x.cols, clamp(x.arr.flat(1), min_value, max_value));
56
- else if (x.isComplex?.()) return new x.constructor(clamp(x.a, min_value, max_value), clamp(x.b, min_value, max_value));
57
- else if (x instanceof Array) {
58
- if (x.every((n) => typeof (n === "number"))) {
59
- return x.map((n) => clamp(n, min_value, max_value));
60
- } else {
61
- let y = new Array(x.length);
62
- for (let i = 0; i < x.length; i++) {
63
- y[i] = clamp(x[i], min_value, max_value);
64
- }
65
- }
66
- }
67
- }
7
+
68
8
  const arange=(a, b, step , include = false)=>{
69
9
  let tab = [];
70
10
  if(a<b){
@@ -107,7 +47,7 @@ const geomspace=(a,b,n=abs(b-a)+1,endpoint=true)=>{
107
47
  if([a,b].every(n=>typeof n==="number")){
108
48
  const [max,min]=[a,b].sort((a,b)=>b-a);
109
49
  let base;
110
- endpoint ? base = sqrtn(max/min,n-1) : base = sqrtn(max/min,n) ;
50
+ endpoint ? base = nthr(max/min,n-1) : base = nthr(max/min,n) ;
111
51
  const Y = [min];
112
52
  for (let i = 1; i < n; i++) {
113
53
  Y.push(Y[i-1]*base)
@@ -120,7 +60,7 @@ const geomspace=(a,b,n=abs(b-a)+1,endpoint=true)=>{
120
60
  const z2 = new n.constructor(b)
121
61
  n=n||Math.abs(z1.a-z2.a)+1;
122
62
  let base;
123
- endpoint ? base = sqrtn(z2.div(z1),n-1) : base = sqrtn(z2.div(z1),n) ;
63
+ endpoint ? base = nthr(z2.div(z1),n-1) : base = nthr(z2.div(z1),n) ;
124
64
  const Y = [z1];
125
65
  for (let i = 1; i < n; i++) {
126
66
  Y.push(mul(Y[i-1],base))
@@ -132,10 +72,10 @@ export {
132
72
  zeros,
133
73
  ones,
134
74
  nums,
135
- norm,
136
- lerp,
137
- map,
138
- clamp,
75
+ // norm,
76
+ // lerp,
77
+ // map,
78
+ // clamp,
139
79
  arange,
140
80
  linspace,
141
81
  logspace,
@@ -0,0 +1,39 @@
1
+ export const accum_sum = (arr) => {
2
+ let result = [];
3
+ let total = 0;
4
+ for (let x of arr) {
5
+ total += x;
6
+ result.push(total);
7
+ }
8
+ return result;
9
+ };
10
+
11
+ export const accum_product = (arr) => {
12
+ let result = [];
13
+ let prod = 1;
14
+ for (let x of arr) {
15
+ prod *= x;
16
+ result.push(prod);
17
+ }
18
+ return result;
19
+ };
20
+
21
+ export const accum_max = (arr) => {
22
+ let result = [];
23
+ let m = -Infinity;
24
+ for (let x of arr) {
25
+ m = Math.max(m, x);
26
+ result.push(m);
27
+ }
28
+ return result;
29
+ };
30
+
31
+ export const accum_min = (arr) => {
32
+ let result = [];
33
+ let m = Infinity;
34
+ for (let x of arr) {
35
+ m = Math.min(m, x);
36
+ result.push(m);
37
+ }
38
+ return result;
39
+ };
@@ -0,0 +1,75 @@
1
+ // Mean
2
+ export const mean = (...x) => x.reduce((a, b) => a + b) / x.length;
3
+ export const geo_mean = (...x) => (x.reduce((a, b) => a * b)) ** (1/x.length);
4
+ // Quadratic Mean
5
+ export const rms = (...x) => {
6
+ const n = x.length;
7
+ return (Math.hypot(...x)/n)**(1/n)
8
+ }
9
+
10
+ export const weighted_mean=(values, weights)=>{
11
+ let sum = 0, sw = 0;
12
+ for (let i = 0; i < values.length; i++) {
13
+ sum += values[i] * weights[i];
14
+ sw += weights[i];
15
+ }
16
+ return sum / sw;
17
+ }
18
+
19
+ export const harmonic_mean = (...x) => {
20
+ let s = 0, i = 0;
21
+ for(i=0; i<x.length; i++)
22
+ s += 1/x[i]
23
+ return x.length / s;
24
+ }
25
+
26
+ export const power_mean = (X, p) =>{
27
+ let s = 0, i = 0, l = X.length;
28
+ for(i=0; i < l; i++)
29
+ s+= X[i]**p
30
+ return (s / l) ** (1 / p);
31
+ }
32
+
33
+ export const trimmed_mean = (X, k) =>{
34
+ let a = [...X].sort((a,b)=>a-b).slice(k, X.length - k);
35
+ return mean(...a);
36
+ }
37
+
38
+ export const winsorized_mean = (X, k) =>{
39
+ let a = [...X].sort((a,b)=>a-b);
40
+ let low = a[k], high = a[a.length - k - 1];
41
+ a = a.map(x => Math.max(low, Math.min(high, x)));
42
+ return mean(a);
43
+ }
44
+
45
+ export const midrange = (x) =>{
46
+ let min = Math.min(...x);
47
+ let max = Math.max(...x);
48
+ return (min + max) / 2;
49
+ }
50
+
51
+ export const midhinge = (...x) =>{
52
+ let a = x.sort((a,b)=>a-b);
53
+ let q1 = a[Math.floor((a.length - 1) * 0.25)];
54
+ let q3 = a[Math.floor((a.length - 1) * 0.75)];
55
+ return (q1 + q3) / 2;
56
+ }
57
+
58
+
59
+ export const interquartile_mean = (...x) =>{
60
+ let a = x.sort((a,b)=>a-b);
61
+ let q1 = a[Math.floor((a.length - 1) * 0.25)];
62
+ let q3 = a[Math.floor((a.length - 1) * 0.75)];
63
+ let m = a.filter(x => x >= q1 && x <= q3);
64
+ return mean(m);
65
+ }
66
+
67
+
68
+ export const contraharmonic_mean = (...x) =>{
69
+ let num = 0, den = 0, i, l = x.length;
70
+ for(i = 0; i < l; i++){
71
+ num += x[i]**2;
72
+ den += x[i]
73
+ }
74
+ return num / den;
75
+ }
@@ -0,0 +1,17 @@
1
+ export * from './position/index.js';
2
+ export * from './average/index.js';
3
+ export * from './variability/index.js'
4
+ export * from './rolling/index.js'
5
+ export * from './accum/index.js'
6
+
7
+
8
+ // min
9
+ // max
10
+
11
+ // mean
12
+ // variance
13
+ // std
14
+ // percentil
15
+ // accum
16
+
17
+ //