@danielsimonjr/mathts-functions 0.40.1 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +717 -2
- package/dist/ml/glm.d.ts +45 -0
- package/dist/ml/glm.d.ts.map +1 -0
- package/dist/numeric/bspline.d.ts +47 -0
- package/dist/numeric/bspline.d.ts.map +1 -0
- package/dist/numeric/monte-carlo.d.ts +40 -0
- package/dist/numeric/monte-carlo.d.ts.map +1 -0
- package/dist/numeric/solveODE.d.ts +23 -1
- package/dist/numeric/solveODE.d.ts.map +1 -1
- package/dist/special/niche.d.ts +139 -0
- package/dist/special/niche.d.ts.map +1 -0
- package/dist/stats/mvn.d.ts +33 -0
- package/dist/stats/mvn.d.ts.map +1 -0
- package/dist/stats/power-analysis.d.ts +32 -0
- package/dist/stats/power-analysis.d.ts.map +1 -0
- package/dist/typed/dist-objects.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,10 @@ export { quad } from './numeric/adaptive-quad.js';
|
|
|
51
51
|
export type { QuadOptions, QuadResult } from './numeric/adaptive-quad.js';
|
|
52
52
|
export { interpn } from './numeric/interpn.js';
|
|
53
53
|
export type { NDArrayInput } from './numeric/interpn.js';
|
|
54
|
+
export { bsplineFit, bsplineEval } from './numeric/bspline.js';
|
|
55
|
+
export type { BSplineFitOptions, BSplineTuple } from './numeric/bspline.js';
|
|
56
|
+
export { monteCarloIntegrate } from './numeric/monte-carlo.js';
|
|
57
|
+
export type { Bound, MonteCarloOptions, MonteCarloResult } from './numeric/monte-carlo.js';
|
|
54
58
|
export { movingAverage, ewma, detrend, acf } from './timeseries-extra.js';
|
|
55
59
|
export { pacf, ljungBox, durbinWatson, adfuller } from './stats/timeseries.js';
|
|
56
60
|
export type { LjungBoxResult, AdfullerResult } from './stats/timeseries.js';
|
|
@@ -98,10 +102,17 @@ export { polygamma, trigamma, jacobiP, gegenbauerC } from './special/polygamma-o
|
|
|
98
102
|
export { jacobiSN, jacobiCN, jacobiDN } from './special/jacobi-elliptic.js';
|
|
99
103
|
export { rootsLegendre } from './numeric/gauss-nodes.js';
|
|
100
104
|
export type { RootsLegendreResult } from './numeric/gauss-nodes.js';
|
|
105
|
+
export { polylog, struveH, struveL, kelvinBer, kelvinBei, barnesG } from './special/niche.js';
|
|
101
106
|
export { bfs, dfs, floydWarshall, bellmanFord, closenessCentrality, harmonicCentrality, } from './graph/traversal-centrality.js';
|
|
102
107
|
export type { BellmanFordResult } from './graph/traversal-centrality.js';
|
|
103
108
|
export { maxFlow, minCut, astar, hungarian } from './graph/optimization.js';
|
|
104
109
|
export type { MaxFlowResult, MinCutResult, AStarResult, HungarianResult, } from './graph/optimization.js';
|
|
105
110
|
export { interval, Interval } from './numeric/interval.js';
|
|
106
111
|
export { graphColoring, maxClique, louvainCommunities, katzCentrality, isIsomorphic, } from './graph/community-coloring.js';
|
|
112
|
+
export { glm } from './ml/glm.js';
|
|
113
|
+
export type { GlmFamily, GlmLink, GlmOptions, GlmResult } from './ml/glm.js';
|
|
114
|
+
export { mvnPdf, mvnSample } from './stats/mvn.js';
|
|
115
|
+
export type { MvnVector, MvnCov, MvnSampleOptions } from './stats/mvn.js';
|
|
116
|
+
export { tTestPower } from './stats/power-analysis.js';
|
|
117
|
+
export type { TTestPowerAlternative, TTestPowerOptions } from './stats/power-analysis.js';
|
|
107
118
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAOzC,OA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B,CAAC;AAM9F,OAAO,EACL,GAAG,EACH,GAAG,EACH,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAKzE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC5E,YAAY,EACV,aAAa,EACb,YAAY,EACZ,WAAW,EACX,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO3D,OAAO,EACL,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,MAAM,+BAA+B,CAAC;AAKvC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAK7E,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAI1E,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11817,6 +11817,25 @@ function _fdJacobian(f, t, y, f0) {
|
|
|
11817
11817
|
}
|
|
11818
11818
|
return J;
|
|
11819
11819
|
}
|
|
11820
|
+
function _jacobianAt(f, t, y, f0, options) {
|
|
11821
|
+
const n = y.length;
|
|
11822
|
+
if (options.jac) {
|
|
11823
|
+
const J = options.jac(t, y);
|
|
11824
|
+
const ok = Array.isArray(J) && J.length === n && J.every((row2) => Array.isArray(row2) && row2.length === n);
|
|
11825
|
+
if (!ok) {
|
|
11826
|
+
throw new Error(
|
|
11827
|
+
`The "jac" option must return an ${n}\xD7${n} matrix (n = state dimension); got a mismatched shape`
|
|
11828
|
+
);
|
|
11829
|
+
}
|
|
11830
|
+
return J;
|
|
11831
|
+
}
|
|
11832
|
+
return _fdJacobian(f, t, y, f0);
|
|
11833
|
+
}
|
|
11834
|
+
function _fdTimeDerivative(f, t, y, f0) {
|
|
11835
|
+
const delt = Math.sqrt(Number.EPSILON * Math.max(1e-5, Math.abs(t)));
|
|
11836
|
+
const fp = _fArr(f, t + delt, y);
|
|
11837
|
+
return f0.map((v, i) => (fp[i] - v) / delt);
|
|
11838
|
+
}
|
|
11820
11839
|
function rosenbrockSolve(f, tspan, y0raw, options = {}) {
|
|
11821
11840
|
const t0 = tspan[0];
|
|
11822
11841
|
const tf = tspan[1];
|
|
@@ -11853,7 +11872,7 @@ function rosenbrockSolve(f, tspan, y0raw, options = {}) {
|
|
|
11853
11872
|
while ((dir > 0 ? t < tf : t > tf) && iter < maxIter) {
|
|
11854
11873
|
if (Math.abs(h) > Math.abs(tf - t)) h = tf - t;
|
|
11855
11874
|
const F0 = _fArr(f, t, y);
|
|
11856
|
-
const J =
|
|
11875
|
+
const J = _jacobianAt(f, t, y, F0, options);
|
|
11857
11876
|
const W = identityMinus(J, h * gamma2);
|
|
11858
11877
|
const k1 = _luSolve(W, F0);
|
|
11859
11878
|
const y1 = y.map((yi, i) => yi + 0.5 * h * k1[i]);
|
|
@@ -11894,6 +11913,145 @@ function rosenbrockSolve(f, tspan, y0raw, options = {}) {
|
|
|
11894
11913
|
}
|
|
11895
11914
|
return { t: tOut, y: yOut };
|
|
11896
11915
|
}
|
|
11916
|
+
var RODAS = {
|
|
11917
|
+
gamma: 0.25,
|
|
11918
|
+
alpha2: 0.386,
|
|
11919
|
+
alpha3: 0.21,
|
|
11920
|
+
alpha4: 0.63,
|
|
11921
|
+
d1: 0.25,
|
|
11922
|
+
d2: -0.1043,
|
|
11923
|
+
d3: 0.1035,
|
|
11924
|
+
d4: -0.03620000000000023,
|
|
11925
|
+
a21: 1.544,
|
|
11926
|
+
a31: 0.9466785280815826,
|
|
11927
|
+
a32: 0.2557011698983284,
|
|
11928
|
+
a41: 3.314825187068521,
|
|
11929
|
+
a42: 2.896124015972201,
|
|
11930
|
+
a43: 0.9986419139977817,
|
|
11931
|
+
a51: 1.221224509226641,
|
|
11932
|
+
a52: 6.019134481288629,
|
|
11933
|
+
a53: 12.53708332932087,
|
|
11934
|
+
a54: -0.687886036105895,
|
|
11935
|
+
C21: -5.6688,
|
|
11936
|
+
C31: -2.430093356833875,
|
|
11937
|
+
C32: -0.2063599157091915,
|
|
11938
|
+
C41: -0.1073529058151375,
|
|
11939
|
+
C42: -9.594562251023355,
|
|
11940
|
+
C43: -20.47028614809616,
|
|
11941
|
+
C51: 7.496443313967647,
|
|
11942
|
+
C52: -10.24680431464352,
|
|
11943
|
+
C53: -33.99990352819905,
|
|
11944
|
+
C54: 11.7089089320616,
|
|
11945
|
+
C61: 8.083246795921522,
|
|
11946
|
+
C62: -7.981132988064893,
|
|
11947
|
+
C63: -31.52159432874371,
|
|
11948
|
+
C64: 16.31930543123136,
|
|
11949
|
+
C65: -6.058818238834054
|
|
11950
|
+
};
|
|
11951
|
+
function rodasSolve(f, tspan, y0raw, options = {}) {
|
|
11952
|
+
const t0 = tspan[0];
|
|
11953
|
+
const tf = tspan[1];
|
|
11954
|
+
if (!(typeof t0 === "number" && typeof tf === "number")) {
|
|
11955
|
+
throw new Error('The "RODAS" stiff method requires numeric tspan');
|
|
11956
|
+
}
|
|
11957
|
+
if (!y0raw.every((v) => typeof v === "number")) {
|
|
11958
|
+
throw new Error('The "RODAS" stiff method requires plain-number state (y0)');
|
|
11959
|
+
}
|
|
11960
|
+
const y0 = y0raw;
|
|
11961
|
+
const n = y0.length;
|
|
11962
|
+
const dir = tf >= t0 ? 1 : -1;
|
|
11963
|
+
const g = RODAS.gamma;
|
|
11964
|
+
const rtol = options.tol ? options.tol : 1e-4;
|
|
11965
|
+
const atol = rtol * 1e-3;
|
|
11966
|
+
const maxIter = options.maxIter ? options.maxIter : 1e5;
|
|
11967
|
+
const span = Math.abs(tf - t0);
|
|
11968
|
+
let t = t0;
|
|
11969
|
+
let y = y0.slice();
|
|
11970
|
+
let h;
|
|
11971
|
+
if (options.firstStep) {
|
|
11972
|
+
h = dir * Math.abs(options.firstStep);
|
|
11973
|
+
} else {
|
|
11974
|
+
const f0 = f(t, y);
|
|
11975
|
+
const d0 = _rmsNorm(y);
|
|
11976
|
+
const d1 = _rmsNorm(Array.isArray(f0) ? f0 : [f0]);
|
|
11977
|
+
h = dir * Math.min(d0 < 1e-5 || d1 < 1e-5 ? 1e-6 : 0.01 * (d0 / d1), span);
|
|
11978
|
+
}
|
|
11979
|
+
const tOut = [t];
|
|
11980
|
+
const yOut = [y.slice()];
|
|
11981
|
+
let iter = 0;
|
|
11982
|
+
while ((dir > 0 ? t < tf : t > tf) && iter < maxIter) {
|
|
11983
|
+
if (Math.abs(h) > Math.abs(tf - t)) h = tf - t;
|
|
11984
|
+
const F0 = _fArr(f, t, y);
|
|
11985
|
+
const J = _jacobianAt(f, t, y, F0, options);
|
|
11986
|
+
const fx = _fdTimeDerivative(f, t, y, F0);
|
|
11987
|
+
const E = J.map((row2, i) => row2.map((v, j) => (i === j ? 1 / (g * h) : 0) - v));
|
|
11988
|
+
const k1 = _luSolve(
|
|
11989
|
+
E,
|
|
11990
|
+
F0.map((v, i) => v + h * RODAS.d1 * fx[i])
|
|
11991
|
+
);
|
|
11992
|
+
const g2 = y.map((yi, i) => yi + RODAS.a21 * k1[i]);
|
|
11993
|
+
const f2 = _fArr(f, t + RODAS.alpha2 * h, g2);
|
|
11994
|
+
const k2 = _luSolve(
|
|
11995
|
+
E,
|
|
11996
|
+
f2.map((v, i) => v + RODAS.C21 * k1[i] / h + h * RODAS.d2 * fx[i])
|
|
11997
|
+
);
|
|
11998
|
+
const g3 = y.map((yi, i) => yi + RODAS.a31 * k1[i] + RODAS.a32 * k2[i]);
|
|
11999
|
+
const f3 = _fArr(f, t + RODAS.alpha3 * h, g3);
|
|
12000
|
+
const k3 = _luSolve(
|
|
12001
|
+
E,
|
|
12002
|
+
f3.map((v, i) => v + (RODAS.C31 * k1[i] + RODAS.C32 * k2[i]) / h + h * RODAS.d3 * fx[i])
|
|
12003
|
+
);
|
|
12004
|
+
const g4 = y.map((yi, i) => yi + RODAS.a41 * k1[i] + RODAS.a42 * k2[i] + RODAS.a43 * k3[i]);
|
|
12005
|
+
const f4 = _fArr(f, t + RODAS.alpha4 * h, g4);
|
|
12006
|
+
const k4 = _luSolve(
|
|
12007
|
+
E,
|
|
12008
|
+
f4.map(
|
|
12009
|
+
(v, i) => v + (RODAS.C41 * k1[i] + RODAS.C42 * k2[i] + RODAS.C43 * k3[i]) / h + h * RODAS.d4 * fx[i]
|
|
12010
|
+
)
|
|
12011
|
+
);
|
|
12012
|
+
const g5 = y.map(
|
|
12013
|
+
(yi, i) => yi + RODAS.a51 * k1[i] + RODAS.a52 * k2[i] + RODAS.a53 * k3[i] + RODAS.a54 * k4[i]
|
|
12014
|
+
);
|
|
12015
|
+
const f5 = _fArr(f, t + h, g5);
|
|
12016
|
+
const k5 = _luSolve(
|
|
12017
|
+
E,
|
|
12018
|
+
f5.map(
|
|
12019
|
+
(v, i) => v + (RODAS.C51 * k1[i] + RODAS.C52 * k2[i] + RODAS.C53 * k3[i] + RODAS.C54 * k4[i]) / h
|
|
12020
|
+
)
|
|
12021
|
+
);
|
|
12022
|
+
const g6 = g5.map((v, i) => v + k5[i]);
|
|
12023
|
+
const f6 = _fArr(f, t + h, g6);
|
|
12024
|
+
const k6 = _luSolve(
|
|
12025
|
+
E,
|
|
12026
|
+
f6.map(
|
|
12027
|
+
(v, i) => v + (RODAS.C61 * k1[i] + RODAS.C62 * k2[i] + RODAS.C63 * k3[i] + RODAS.C64 * k4[i] + RODAS.C65 * k5[i]) / h
|
|
12028
|
+
)
|
|
12029
|
+
);
|
|
12030
|
+
const yNew = g6.map((v, i) => v + k6[i]);
|
|
12031
|
+
let errNorm = 0;
|
|
12032
|
+
for (let i = 0; i < n; i++) {
|
|
12033
|
+
const sc = atol + rtol * Math.max(Math.abs(y[i]), Math.abs(yNew[i]));
|
|
12034
|
+
errNorm += (k6[i] / sc) ** 2;
|
|
12035
|
+
}
|
|
12036
|
+
errNorm = Math.sqrt(errNorm / n);
|
|
12037
|
+
if (errNorm <= 1 || Math.abs(h) <= 1e-14 * Math.abs(t)) {
|
|
12038
|
+
t += h;
|
|
12039
|
+
y = yNew;
|
|
12040
|
+
tOut.push(t);
|
|
12041
|
+
yOut.push(y.slice());
|
|
12042
|
+
}
|
|
12043
|
+
h *= Math.min(6, Math.max(0.2, 0.9 * Math.pow(errNorm || 1e-10, -1 / 4)));
|
|
12044
|
+
const maxStepR = options.maxStep;
|
|
12045
|
+
const minStepR = options.minStep;
|
|
12046
|
+
if (maxStepR && Math.abs(h) > maxStepR) h = dir * maxStepR;
|
|
12047
|
+
else if (minStepR && Math.abs(h) < minStepR) h = dir * minStepR;
|
|
12048
|
+
iter++;
|
|
12049
|
+
}
|
|
12050
|
+
if (iter >= maxIter) {
|
|
12051
|
+
throw new Error("Maximum number of iterations reached, try changing options");
|
|
12052
|
+
}
|
|
12053
|
+
return { t: tOut, y: yOut };
|
|
12054
|
+
}
|
|
11897
12055
|
var createSolveODE = /* @__PURE__ */ factory(
|
|
11898
12056
|
name,
|
|
11899
12057
|
dependencies,
|
|
@@ -12199,7 +12357,8 @@ var createSolveODE = /* @__PURE__ */ factory(
|
|
|
12199
12357
|
const methods = {
|
|
12200
12358
|
RK23: _rk23,
|
|
12201
12359
|
RK45: _rk45,
|
|
12202
|
-
ROSENBROCK: rosenbrockSolve
|
|
12360
|
+
ROSENBROCK: rosenbrockSolve,
|
|
12361
|
+
RODAS: rodasSolve
|
|
12203
12362
|
};
|
|
12204
12363
|
if (method.toUpperCase() in methods) {
|
|
12205
12364
|
const methodOptions = { ...opt };
|
|
@@ -47472,6 +47631,228 @@ function interpn(grids, values, query) {
|
|
|
47472
47631
|
});
|
|
47473
47632
|
}
|
|
47474
47633
|
|
|
47634
|
+
// src/numeric/bspline.ts
|
|
47635
|
+
function findSpan(n, p, u, U) {
|
|
47636
|
+
if (u >= U[n + 1]) return n;
|
|
47637
|
+
if (u <= U[p]) return p;
|
|
47638
|
+
let low = p;
|
|
47639
|
+
let high = n + 1;
|
|
47640
|
+
let mid = Math.floor((low + high) / 2);
|
|
47641
|
+
while (u < U[mid] || u >= U[mid + 1]) {
|
|
47642
|
+
if (u < U[mid]) high = mid;
|
|
47643
|
+
else low = mid;
|
|
47644
|
+
mid = Math.floor((low + high) / 2);
|
|
47645
|
+
}
|
|
47646
|
+
return mid;
|
|
47647
|
+
}
|
|
47648
|
+
function basisFuns(span, u, p, U) {
|
|
47649
|
+
const N = new Array(p + 1);
|
|
47650
|
+
N[0] = 1;
|
|
47651
|
+
const left = new Array(p + 1);
|
|
47652
|
+
const right = new Array(p + 1);
|
|
47653
|
+
for (let j = 1; j <= p; j++) {
|
|
47654
|
+
left[j] = u - U[span + 1 - j];
|
|
47655
|
+
right[j] = U[span + j] - u;
|
|
47656
|
+
let saved = 0;
|
|
47657
|
+
for (let r = 0; r < j; r++) {
|
|
47658
|
+
const temp = N[r] / (right[r + 1] + left[j - r]);
|
|
47659
|
+
N[r] = saved + right[r + 1] * temp;
|
|
47660
|
+
saved = left[j - r] * temp;
|
|
47661
|
+
}
|
|
47662
|
+
N[j] = saved;
|
|
47663
|
+
}
|
|
47664
|
+
return N;
|
|
47665
|
+
}
|
|
47666
|
+
function validateXY(x, y) {
|
|
47667
|
+
if (x.length !== y.length) throw new Error("bsplineFit: x and y must have the same length");
|
|
47668
|
+
for (let i = 1; i < x.length; i++) {
|
|
47669
|
+
if (!(x[i] > x[i - 1])) throw new Error("bsplineFit: x must be strictly increasing");
|
|
47670
|
+
}
|
|
47671
|
+
}
|
|
47672
|
+
function buildDesignMatrix(x, t, k, numCoef) {
|
|
47673
|
+
const n = x.length;
|
|
47674
|
+
const A = Array.from({ length: n }, () => new Array(numCoef).fill(0));
|
|
47675
|
+
for (let i = 0; i < n; i++) {
|
|
47676
|
+
const span = findSpan(numCoef - 1, k, x[i], t);
|
|
47677
|
+
const N = basisFuns(span, x[i], k, t);
|
|
47678
|
+
for (let j = 0; j <= k; j++) A[i][span - k + j] = N[j];
|
|
47679
|
+
}
|
|
47680
|
+
return A;
|
|
47681
|
+
}
|
|
47682
|
+
function bsplineFit(x, y, opts = {}) {
|
|
47683
|
+
validateXY(x, y);
|
|
47684
|
+
const k = opts.k ?? 3;
|
|
47685
|
+
const n = x.length;
|
|
47686
|
+
if (n <= k) {
|
|
47687
|
+
throw new Error(`bsplineFit: need more than ${k} data points for a degree-${k} fit`);
|
|
47688
|
+
}
|
|
47689
|
+
const s = opts.s ?? 0;
|
|
47690
|
+
const x0 = x[0];
|
|
47691
|
+
const xN = x[n - 1];
|
|
47692
|
+
if (s <= 0 && opts.nknots === void 0) {
|
|
47693
|
+
const m2 = n + k + 1;
|
|
47694
|
+
const t2 = new Array(m2);
|
|
47695
|
+
for (let i = 0; i <= k; i++) t2[i] = x0;
|
|
47696
|
+
for (let i = 0; i <= k; i++) t2[m2 - 1 - i] = xN;
|
|
47697
|
+
for (let j = 1; j <= n - k - 1; j++) {
|
|
47698
|
+
let sum3 = 0;
|
|
47699
|
+
for (let i = j; i <= j + k - 1; i++) sum3 += x[i];
|
|
47700
|
+
t2[k + j] = sum3 / k;
|
|
47701
|
+
}
|
|
47702
|
+
const A2 = buildDesignMatrix(x, t2, k, n);
|
|
47703
|
+
const c2 = linsolve(A2, [...y]);
|
|
47704
|
+
return { t: t2, c: c2, k };
|
|
47705
|
+
}
|
|
47706
|
+
const maxInterior = Math.max(0, n - k - 2);
|
|
47707
|
+
const heuristicInterior = Math.round((n - k - 1) / (1 + Math.max(0, s)));
|
|
47708
|
+
let numInterior = opts.nknots ?? heuristicInterior;
|
|
47709
|
+
numInterior = Math.min(Math.max(0, numInterior), maxInterior);
|
|
47710
|
+
const numCoef = numInterior + k + 1;
|
|
47711
|
+
const m = numCoef + k + 1;
|
|
47712
|
+
const t = new Array(m);
|
|
47713
|
+
for (let i = 0; i <= k; i++) t[i] = x0;
|
|
47714
|
+
for (let i = 0; i <= k; i++) t[m - 1 - i] = xN;
|
|
47715
|
+
for (let j = 1; j <= numInterior; j++) {
|
|
47716
|
+
t[k + j] = x0 + j * (xN - x0) / (numInterior + 1);
|
|
47717
|
+
}
|
|
47718
|
+
const A = buildDesignMatrix(x, t, k, numCoef);
|
|
47719
|
+
const c = leastSquares(A, [...y]);
|
|
47720
|
+
return { t, c, k };
|
|
47721
|
+
}
|
|
47722
|
+
function bsplineEval(spline, xnew) {
|
|
47723
|
+
const { t, c, k } = spline;
|
|
47724
|
+
const nLast = c.length - 1;
|
|
47725
|
+
const evalOne = (x) => {
|
|
47726
|
+
const span = findSpan(nLast, k, x, t);
|
|
47727
|
+
const N = basisFuns(span, x, k, t);
|
|
47728
|
+
let val = 0;
|
|
47729
|
+
for (let j = 0; j <= k; j++) val += N[j] * c[span - k + j];
|
|
47730
|
+
return val;
|
|
47731
|
+
};
|
|
47732
|
+
return Array.isArray(xnew) ? xnew.map(evalOne) : evalOne(xnew);
|
|
47733
|
+
}
|
|
47734
|
+
|
|
47735
|
+
// src/numeric/monte-carlo.ts
|
|
47736
|
+
function isPrime2(x) {
|
|
47737
|
+
if (x < 2) return false;
|
|
47738
|
+
for (let i = 2; i * i <= x; i++) {
|
|
47739
|
+
if (x % i === 0) return false;
|
|
47740
|
+
}
|
|
47741
|
+
return true;
|
|
47742
|
+
}
|
|
47743
|
+
function nthPrime(k) {
|
|
47744
|
+
let count2 = 0;
|
|
47745
|
+
let candidate = 1;
|
|
47746
|
+
while (count2 < k) {
|
|
47747
|
+
candidate++;
|
|
47748
|
+
if (isPrime2(candidate)) count2++;
|
|
47749
|
+
}
|
|
47750
|
+
return candidate;
|
|
47751
|
+
}
|
|
47752
|
+
function vanDerCorput(idx, base) {
|
|
47753
|
+
let f = 1;
|
|
47754
|
+
let r = 0;
|
|
47755
|
+
let i = idx;
|
|
47756
|
+
while (i > 0) {
|
|
47757
|
+
f /= base;
|
|
47758
|
+
r += f * (i % base);
|
|
47759
|
+
i = Math.floor(i / base);
|
|
47760
|
+
}
|
|
47761
|
+
return r;
|
|
47762
|
+
}
|
|
47763
|
+
function haltonSequence(n, dims) {
|
|
47764
|
+
const bases = Array.from({ length: dims }, (_, d) => nthPrime(d + 1));
|
|
47765
|
+
const points = [];
|
|
47766
|
+
for (let idx = 1; idx <= n; idx++) {
|
|
47767
|
+
points.push(bases.map((b) => vanDerCorput(idx, b)));
|
|
47768
|
+
}
|
|
47769
|
+
return points;
|
|
47770
|
+
}
|
|
47771
|
+
var SOBOL_BITS = 30;
|
|
47772
|
+
function sobolDirectionNumbers(dim, bits) {
|
|
47773
|
+
const M = new Array(bits + 1).fill(0);
|
|
47774
|
+
if (dim === 0) {
|
|
47775
|
+
for (let i = 1; i <= bits; i++) M[i] = 1;
|
|
47776
|
+
return M;
|
|
47777
|
+
}
|
|
47778
|
+
M[1] = 1;
|
|
47779
|
+
for (let i = 2; i <= bits; i++) {
|
|
47780
|
+
M[i] = 2 * M[i - 1] ^ M[i - 1];
|
|
47781
|
+
}
|
|
47782
|
+
return M;
|
|
47783
|
+
}
|
|
47784
|
+
function sobolSequence(n, dims) {
|
|
47785
|
+
if (dims < 1 || dims > 2) {
|
|
47786
|
+
throw new Error(
|
|
47787
|
+
"monteCarloIntegrate: method 'sobol' supports only 1-2 dimensions here (only the first two Sobol direction-number sets are forced by the recurrence with no external lookup table); use method: 'halton' for higher-dimensional integrals"
|
|
47788
|
+
);
|
|
47789
|
+
}
|
|
47790
|
+
const bits = SOBOL_BITS;
|
|
47791
|
+
const scale4 = Math.pow(2, bits);
|
|
47792
|
+
const scaledDir = Array.from({ length: dims }, (_, d) => {
|
|
47793
|
+
const M = sobolDirectionNumbers(d, bits);
|
|
47794
|
+
return M.map((m, i) => i === 0 ? 0 : m * Math.pow(2, bits - i));
|
|
47795
|
+
});
|
|
47796
|
+
const points = [];
|
|
47797
|
+
for (let idx = 1; idx <= n; idx++) {
|
|
47798
|
+
const gray = idx ^ idx >>> 1;
|
|
47799
|
+
const pt = new Array(dims).fill(0);
|
|
47800
|
+
for (let d = 0; d < dims; d++) {
|
|
47801
|
+
let acc = 0;
|
|
47802
|
+
let k = gray;
|
|
47803
|
+
let bitPos = 1;
|
|
47804
|
+
while (k > 0) {
|
|
47805
|
+
if (k & 1) acc ^= scaledDir[d][bitPos];
|
|
47806
|
+
k >>>= 1;
|
|
47807
|
+
bitPos++;
|
|
47808
|
+
}
|
|
47809
|
+
pt[d] = acc / scale4;
|
|
47810
|
+
}
|
|
47811
|
+
points.push(pt);
|
|
47812
|
+
}
|
|
47813
|
+
return points;
|
|
47814
|
+
}
|
|
47815
|
+
function monteCarloIntegrate(f, bounds, opts = {}) {
|
|
47816
|
+
const dims = bounds.length;
|
|
47817
|
+
if (dims === 0) {
|
|
47818
|
+
throw new Error("monteCarloIntegrate: bounds must have at least one dimension");
|
|
47819
|
+
}
|
|
47820
|
+
for (const [lo, hi] of bounds) {
|
|
47821
|
+
if (!(hi > lo)) throw new Error("monteCarloIntegrate: each bound must have hi > lo");
|
|
47822
|
+
}
|
|
47823
|
+
const n = Math.floor(opts.n ?? 1e5);
|
|
47824
|
+
if (n < 1) throw new Error("monteCarloIntegrate: n must be >= 1");
|
|
47825
|
+
const method = opts.method ?? "uniform";
|
|
47826
|
+
const volume = bounds.reduce((v, [lo, hi]) => v * (hi - lo), 1);
|
|
47827
|
+
let unitPoints;
|
|
47828
|
+
if (method === "uniform") {
|
|
47829
|
+
const rng = createRng(opts.seed ?? null);
|
|
47830
|
+
unitPoints = Array.from({ length: n }, () => Array.from({ length: dims }, () => rng()));
|
|
47831
|
+
} else if (method === "halton") {
|
|
47832
|
+
unitPoints = haltonSequence(n, dims);
|
|
47833
|
+
} else if (method === "sobol") {
|
|
47834
|
+
unitPoints = sobolSequence(n, dims);
|
|
47835
|
+
} else {
|
|
47836
|
+
throw new Error(`monteCarloIntegrate: unknown method '${String(method)}'`);
|
|
47837
|
+
}
|
|
47838
|
+
let sum3 = 0;
|
|
47839
|
+
let sumSq = 0;
|
|
47840
|
+
for (const u of unitPoints) {
|
|
47841
|
+
const x = u.map((ui, d) => bounds[d][0] + ui * (bounds[d][1] - bounds[d][0]));
|
|
47842
|
+
const fx = f(x);
|
|
47843
|
+
sum3 += fx;
|
|
47844
|
+
sumSq += fx * fx;
|
|
47845
|
+
}
|
|
47846
|
+
const mean7 = sum3 / n;
|
|
47847
|
+
const estimate = volume * mean7;
|
|
47848
|
+
if (method !== "uniform") {
|
|
47849
|
+
return { estimate, stderr: 0 };
|
|
47850
|
+
}
|
|
47851
|
+
const variance2 = n > 1 ? Math.max(0, sumSq - n * mean7 * mean7) / (n - 1) : 0;
|
|
47852
|
+
const stderr = volume * Math.sqrt(variance2 / n);
|
|
47853
|
+
return { estimate, stderr };
|
|
47854
|
+
}
|
|
47855
|
+
|
|
47475
47856
|
// src/timeseries-extra.ts
|
|
47476
47857
|
var arr4 = (x) => Array.isArray(x) ? x : Array.from(x);
|
|
47477
47858
|
var mean4 = (x) => mean(x);
|
|
@@ -50698,6 +51079,111 @@ function rootsLegendre(n) {
|
|
|
50698
51079
|
return { nodes, weights };
|
|
50699
51080
|
}
|
|
50700
51081
|
|
|
51082
|
+
// src/special/niche.ts
|
|
51083
|
+
var MAX_TERMS2 = 1e4;
|
|
51084
|
+
var RELTOL2 = 1e-16;
|
|
51085
|
+
function polylog(s, z) {
|
|
51086
|
+
if (Math.abs(z) >= 1) {
|
|
51087
|
+
throw new Error("polylog: only |z| < 1 is supported (analytic continuation not implemented)");
|
|
51088
|
+
}
|
|
51089
|
+
if (z === 0) return 0;
|
|
51090
|
+
let sum3 = 0;
|
|
51091
|
+
let zk = 1;
|
|
51092
|
+
for (let k = 1; k <= MAX_TERMS2; k++) {
|
|
51093
|
+
zk *= z;
|
|
51094
|
+
const term = zk / Math.pow(k, s);
|
|
51095
|
+
sum3 += term;
|
|
51096
|
+
if (k > 1 && Math.abs(term) < Math.abs(sum3) * RELTOL2) break;
|
|
51097
|
+
}
|
|
51098
|
+
return sum3;
|
|
51099
|
+
}
|
|
51100
|
+
function struveH(v, z) {
|
|
51101
|
+
if (z < 0) {
|
|
51102
|
+
throw new Error("struveH: z must be >= 0");
|
|
51103
|
+
}
|
|
51104
|
+
if (z === 0) return 0;
|
|
51105
|
+
const halfZ = z / 2;
|
|
51106
|
+
const logHalfZ = Math.log(halfZ);
|
|
51107
|
+
let term = Math.exp((v + 1) * logHalfZ - _lgamma(1.5) - _lgamma(v + 1.5));
|
|
51108
|
+
let sum3 = term;
|
|
51109
|
+
for (let k = 0; k < MAX_TERMS2; k++) {
|
|
51110
|
+
const ratio = -(halfZ * halfZ) / ((k + 1.5) * (k + v + 1.5));
|
|
51111
|
+
term *= ratio;
|
|
51112
|
+
sum3 += term;
|
|
51113
|
+
if (Math.abs(term) < Math.abs(sum3) * RELTOL2) break;
|
|
51114
|
+
}
|
|
51115
|
+
return sum3;
|
|
51116
|
+
}
|
|
51117
|
+
function struveL(v, z) {
|
|
51118
|
+
if (z < 0) {
|
|
51119
|
+
throw new Error("struveL: z must be >= 0");
|
|
51120
|
+
}
|
|
51121
|
+
if (z === 0) return 0;
|
|
51122
|
+
const halfZ = z / 2;
|
|
51123
|
+
const logHalfZ = Math.log(halfZ);
|
|
51124
|
+
let term = Math.exp((v + 1) * logHalfZ - _lgamma(1.5) - _lgamma(v + 1.5));
|
|
51125
|
+
let sum3 = term;
|
|
51126
|
+
for (let k = 0; k < MAX_TERMS2; k++) {
|
|
51127
|
+
const ratio = halfZ * halfZ / ((k + 1.5) * (k + v + 1.5));
|
|
51128
|
+
term *= ratio;
|
|
51129
|
+
sum3 += term;
|
|
51130
|
+
if (Math.abs(term) < Math.abs(sum3) * RELTOL2) break;
|
|
51131
|
+
}
|
|
51132
|
+
return sum3;
|
|
51133
|
+
}
|
|
51134
|
+
function kelvinBer(x) {
|
|
51135
|
+
const halfX = x / 2;
|
|
51136
|
+
const halfX4 = halfX * halfX * halfX * halfX;
|
|
51137
|
+
let term = 1;
|
|
51138
|
+
let sum3 = term;
|
|
51139
|
+
for (let k = 0; k < MAX_TERMS2; k++) {
|
|
51140
|
+
const denom = (2 * k + 1) * (2 * k + 2);
|
|
51141
|
+
term *= -halfX4 / (denom * denom);
|
|
51142
|
+
sum3 += term;
|
|
51143
|
+
if (k > 0 && Math.abs(term) < Math.abs(sum3) * RELTOL2) break;
|
|
51144
|
+
}
|
|
51145
|
+
return sum3;
|
|
51146
|
+
}
|
|
51147
|
+
function kelvinBei(x) {
|
|
51148
|
+
const halfX = x / 2;
|
|
51149
|
+
const halfX4 = halfX * halfX * halfX * halfX;
|
|
51150
|
+
let term = halfX * halfX;
|
|
51151
|
+
let sum3 = term;
|
|
51152
|
+
for (let k = 0; k < MAX_TERMS2; k++) {
|
|
51153
|
+
const denom = (2 * k + 2) * (2 * k + 3);
|
|
51154
|
+
term *= -halfX4 / (denom * denom);
|
|
51155
|
+
sum3 += term;
|
|
51156
|
+
if (k > 0 && Math.abs(term) < Math.abs(sum3) * RELTOL2) break;
|
|
51157
|
+
}
|
|
51158
|
+
return sum3;
|
|
51159
|
+
}
|
|
51160
|
+
var LN_GLAISHER_A = 0.2487544770337842;
|
|
51161
|
+
var BERNOULLI_TAIL = [-1 / 30, 1 / 42, -1 / 30, 5 / 66];
|
|
51162
|
+
var BARNES_SHIFT_THRESHOLD = 16;
|
|
51163
|
+
function lnBarnesGAsymptotic(y) {
|
|
51164
|
+
let sum3 = y * y * Math.log(y) / 2 - 3 * y * y / 4 + y / 2 * Math.log(2 * Math.PI) - Math.log(y) / 12 + (1 / 12 - LN_GLAISHER_A);
|
|
51165
|
+
let y2k = y * y;
|
|
51166
|
+
for (let k = 1; k <= BERNOULLI_TAIL.length; k++) {
|
|
51167
|
+
sum3 += BERNOULLI_TAIL[k - 1] / (4 * k * (k + 1) * y2k);
|
|
51168
|
+
y2k *= y * y;
|
|
51169
|
+
}
|
|
51170
|
+
return sum3;
|
|
51171
|
+
}
|
|
51172
|
+
function barnesG(z) {
|
|
51173
|
+
if (z <= 0) {
|
|
51174
|
+
throw new Error("barnesG: only z > 0 is supported");
|
|
51175
|
+
}
|
|
51176
|
+
let shifted = z;
|
|
51177
|
+
let sumLgamma = 0;
|
|
51178
|
+
while (shifted < BARNES_SHIFT_THRESHOLD) {
|
|
51179
|
+
sumLgamma += _lgamma(shifted);
|
|
51180
|
+
shifted += 1;
|
|
51181
|
+
}
|
|
51182
|
+
const y = shifted - 1;
|
|
51183
|
+
const lnG = lnBarnesGAsymptotic(y) - sumLgamma;
|
|
51184
|
+
return Math.exp(lnG);
|
|
51185
|
+
}
|
|
51186
|
+
|
|
50701
51187
|
// src/graph/traversal-centrality.ts
|
|
50702
51188
|
function bfs(adj, start) {
|
|
50703
51189
|
const n = adj.length;
|
|
@@ -51430,6 +51916,222 @@ function isIsomorphic(graphA, graphB) {
|
|
|
51430
51916
|
}
|
|
51431
51917
|
return backtrack(0);
|
|
51432
51918
|
}
|
|
51919
|
+
|
|
51920
|
+
// src/ml/glm.ts
|
|
51921
|
+
function getLink(link) {
|
|
51922
|
+
if (link === "log") {
|
|
51923
|
+
return {
|
|
51924
|
+
linkInv: (eta) => Math.exp(eta),
|
|
51925
|
+
dMuDEta: (mu) => mu,
|
|
51926
|
+
linkFn: (mu) => Math.log(mu)
|
|
51927
|
+
};
|
|
51928
|
+
}
|
|
51929
|
+
return {
|
|
51930
|
+
linkInv: (eta) => 1 / eta,
|
|
51931
|
+
dMuDEta: (mu) => -mu * mu,
|
|
51932
|
+
linkFn: (mu) => 1 / mu
|
|
51933
|
+
};
|
|
51934
|
+
}
|
|
51935
|
+
function getFamily(family) {
|
|
51936
|
+
if (family === "poisson") {
|
|
51937
|
+
return {
|
|
51938
|
+
variance: (mu) => mu,
|
|
51939
|
+
deviance: (y, mu) => {
|
|
51940
|
+
const term = y > 0 ? y * Math.log(y / mu) : 0;
|
|
51941
|
+
return 2 * (term - (y - mu));
|
|
51942
|
+
},
|
|
51943
|
+
defaultLink: "log",
|
|
51944
|
+
validLinks: ["log"],
|
|
51945
|
+
mustart: (y) => y.map((yi) => yi + 0.1),
|
|
51946
|
+
validateY: (y) => {
|
|
51947
|
+
if (y.some((yi) => yi < 0 || !Number.isFinite(yi))) {
|
|
51948
|
+
throw new Error("glm: poisson family requires non-negative, finite y");
|
|
51949
|
+
}
|
|
51950
|
+
}
|
|
51951
|
+
};
|
|
51952
|
+
}
|
|
51953
|
+
return {
|
|
51954
|
+
variance: (mu) => mu * mu,
|
|
51955
|
+
deviance: (y, mu) => 2 * (-Math.log(y / mu) + (y - mu) / mu),
|
|
51956
|
+
defaultLink: "log",
|
|
51957
|
+
validLinks: ["log", "inverse"],
|
|
51958
|
+
mustart: (y) => y.slice(),
|
|
51959
|
+
validateY: (y) => {
|
|
51960
|
+
if (y.some((yi) => yi <= 0 || !Number.isFinite(yi))) {
|
|
51961
|
+
throw new Error("glm: gamma family requires strictly positive, finite y");
|
|
51962
|
+
}
|
|
51963
|
+
}
|
|
51964
|
+
};
|
|
51965
|
+
}
|
|
51966
|
+
function glm(X, y, opts) {
|
|
51967
|
+
const n = X.length;
|
|
51968
|
+
if (n === 0) throw new Error("glm: empty design matrix");
|
|
51969
|
+
if (y.length !== n) throw new Error(`glm: length mismatch (X has ${n} rows, y has ${y.length})`);
|
|
51970
|
+
const family = getFamily(opts.family);
|
|
51971
|
+
family.validateY(y);
|
|
51972
|
+
const link = opts.link ?? family.defaultLink;
|
|
51973
|
+
if (!family.validLinks.includes(link)) {
|
|
51974
|
+
throw new Error(`glm: ${opts.family} family does not support the ${link} link`);
|
|
51975
|
+
}
|
|
51976
|
+
const linkFns = getLink(link);
|
|
51977
|
+
const useIntercept = opts.intercept !== false;
|
|
51978
|
+
const design = useIntercept ? X.map((row2) => [1, ...row2]) : X.map((row2) => [...row2]);
|
|
51979
|
+
const p = design[0].length;
|
|
51980
|
+
if (n <= p) throw new Error(`glm: need more observations (${n}) than parameters (${p})`);
|
|
51981
|
+
const tol = opts.tol ?? 1e-10;
|
|
51982
|
+
const maxIter = opts.maxIter ?? 100;
|
|
51983
|
+
let eta = family.mustart(y).map((mu2) => linkFns.linkFn(mu2));
|
|
51984
|
+
let beta2 = new Array(p).fill(0);
|
|
51985
|
+
let iterations = 0;
|
|
51986
|
+
for (let iter = 0; iter < maxIter; iter++) {
|
|
51987
|
+
iterations = iter + 1;
|
|
51988
|
+
const mu2 = eta.map((e) => linkFns.linkInv(e));
|
|
51989
|
+
const w = new Array(n);
|
|
51990
|
+
const z = new Array(n);
|
|
51991
|
+
for (let i = 0; i < n; i++) {
|
|
51992
|
+
const dMuDEta = linkFns.dMuDEta(mu2[i]);
|
|
51993
|
+
const v = family.variance(mu2[i]);
|
|
51994
|
+
w[i] = Math.max(dMuDEta * dMuDEta / v, 1e-12);
|
|
51995
|
+
z[i] = eta[i] + (y[i] - mu2[i]) / dMuDEta;
|
|
51996
|
+
}
|
|
51997
|
+
const XtWX = Array.from({ length: p }, () => new Array(p).fill(0));
|
|
51998
|
+
const XtWz = new Array(p).fill(0);
|
|
51999
|
+
for (let i = 0; i < n; i++) {
|
|
52000
|
+
const wi = w[i];
|
|
52001
|
+
const row2 = design[i];
|
|
52002
|
+
for (let a = 0; a < p; a++) {
|
|
52003
|
+
const wa = wi * row2[a];
|
|
52004
|
+
for (let b = 0; b < p; b++) {
|
|
52005
|
+
XtWX[a][b] += wa * row2[b];
|
|
52006
|
+
}
|
|
52007
|
+
XtWz[a] += wa * z[i];
|
|
52008
|
+
}
|
|
52009
|
+
}
|
|
52010
|
+
const ridgeEps = 1e-10;
|
|
52011
|
+
const regularized = XtWX.map((row2, a) => row2.map((v, b) => a === b ? v + ridgeEps : v));
|
|
52012
|
+
let newBeta;
|
|
52013
|
+
try {
|
|
52014
|
+
newBeta = linsolve(regularized, XtWz);
|
|
52015
|
+
} catch {
|
|
52016
|
+
break;
|
|
52017
|
+
}
|
|
52018
|
+
const newEta = design.map((row2) => row2.reduce((s, v, j) => s + v * newBeta[j], 0));
|
|
52019
|
+
let maxDiff = 0;
|
|
52020
|
+
for (let i = 0; i < n; i++) maxDiff = Math.max(maxDiff, Math.abs(newEta[i] - eta[i]));
|
|
52021
|
+
beta2 = newBeta;
|
|
52022
|
+
eta = newEta;
|
|
52023
|
+
if (maxDiff < tol) break;
|
|
52024
|
+
}
|
|
52025
|
+
const mu = eta.map((e) => linkFns.linkInv(e));
|
|
52026
|
+
const deviance = y.reduce((sum3, yi, i) => sum3 + family.deviance(yi, mu[i]), 0);
|
|
52027
|
+
const predict = (x) => {
|
|
52028
|
+
const Dx = useIntercept ? x.map((row2) => [1, ...row2]) : x.map((row2) => [...row2]);
|
|
52029
|
+
return Dx.map((row2) => linkFns.linkInv(row2.reduce((s, v, j) => s + v * beta2[j], 0)));
|
|
52030
|
+
};
|
|
52031
|
+
return { coefficients: beta2, fittedValues: mu, deviance, iterations, predict };
|
|
52032
|
+
}
|
|
52033
|
+
|
|
52034
|
+
// src/stats/mvn.ts
|
|
52035
|
+
function normalizeMvnInputs(mean7, cov2) {
|
|
52036
|
+
if (typeof mean7 === "number") {
|
|
52037
|
+
if (typeof cov2 !== "number") {
|
|
52038
|
+
throw new Error("mvn: cov must be a scalar variance when mean is a scalar");
|
|
52039
|
+
}
|
|
52040
|
+
if (!(cov2 > 0)) throw new Error("mvn: variance must be positive");
|
|
52041
|
+
return { meanArr: [mean7], covArr: [[cov2]] };
|
|
52042
|
+
}
|
|
52043
|
+
if (typeof cov2 === "number") {
|
|
52044
|
+
throw new Error("mvn: cov must be a k\xD7k matrix when mean is a vector");
|
|
52045
|
+
}
|
|
52046
|
+
const meanArr = [...mean7];
|
|
52047
|
+
const k = meanArr.length;
|
|
52048
|
+
const covArr = cov2.map((row2) => [...row2]);
|
|
52049
|
+
if (covArr.length !== k || covArr.some((row2) => row2.length !== k)) {
|
|
52050
|
+
throw new Error(`mvn: cov must be ${k}x${k} matching mean length ${k}`);
|
|
52051
|
+
}
|
|
52052
|
+
for (let i = 0; i < k; i++) {
|
|
52053
|
+
for (let j = i + 1; j < k; j++) {
|
|
52054
|
+
const tol = 1e-9 * (1 + Math.abs(covArr[i][j]));
|
|
52055
|
+
if (Math.abs(covArr[i][j] - covArr[j][i]) > tol) {
|
|
52056
|
+
throw new Error("mvn: cov must be symmetric");
|
|
52057
|
+
}
|
|
52058
|
+
}
|
|
52059
|
+
}
|
|
52060
|
+
return { meanArr, covArr };
|
|
52061
|
+
}
|
|
52062
|
+
function mvnPdf(x, mean7, cov2) {
|
|
52063
|
+
const { meanArr, covArr } = normalizeMvnInputs(mean7, cov2);
|
|
52064
|
+
const xArr = typeof x === "number" ? [x] : [...x];
|
|
52065
|
+
if (xArr.length !== meanArr.length) {
|
|
52066
|
+
throw new Error(`mvnPdf: x must have length ${meanArr.length} (matching mean)`);
|
|
52067
|
+
}
|
|
52068
|
+
return multivariateNormal(meanArr, covArr).pdf(xArr);
|
|
52069
|
+
}
|
|
52070
|
+
function mvnSample(mean7, cov2, n, opts) {
|
|
52071
|
+
if (!Number.isInteger(n) || n < 1) throw new Error("mvnSample: n must be a positive integer");
|
|
52072
|
+
const { meanArr, covArr } = normalizeMvnInputs(mean7, cov2);
|
|
52073
|
+
const k = meanArr.length;
|
|
52074
|
+
const { L } = cholesky(covArr);
|
|
52075
|
+
const rng = createRng(opts?.seed ?? null);
|
|
52076
|
+
const samples = new Array(n);
|
|
52077
|
+
for (let s = 0; s < n; s++) {
|
|
52078
|
+
const z = new Array(k);
|
|
52079
|
+
for (let i = 0; i < k; i++) {
|
|
52080
|
+
const u1 = Math.max(rng(), 1e-300);
|
|
52081
|
+
const u2 = rng();
|
|
52082
|
+
z[i] = Math.sqrt(-2 * Math.log(u1)) * Math.cos(2 * Math.PI * u2);
|
|
52083
|
+
}
|
|
52084
|
+
const row2 = new Array(k);
|
|
52085
|
+
for (let i = 0; i < k; i++) {
|
|
52086
|
+
let sum3 = meanArr[i];
|
|
52087
|
+
for (let j = 0; j <= i; j++) sum3 += L[i][j] * z[j];
|
|
52088
|
+
row2[i] = sum3;
|
|
52089
|
+
}
|
|
52090
|
+
samples[s] = row2;
|
|
52091
|
+
}
|
|
52092
|
+
return samples;
|
|
52093
|
+
}
|
|
52094
|
+
|
|
52095
|
+
// src/stats/power-analysis.ts
|
|
52096
|
+
function powerAt(effectSize, nobs, alpha, alt) {
|
|
52097
|
+
const df = 2 * (nobs - 1);
|
|
52098
|
+
const nc = effectSize * Math.sqrt(nobs / 2);
|
|
52099
|
+
if (alt === "larger") {
|
|
52100
|
+
const tCrit2 = studentTQuantile(1 - alpha, df);
|
|
52101
|
+
return 1 - noncentralTCDF(tCrit2, df, nc);
|
|
52102
|
+
}
|
|
52103
|
+
if (alt === "smaller") {
|
|
52104
|
+
const tCrit2 = studentTQuantile(alpha, df);
|
|
52105
|
+
return noncentralTCDF(tCrit2, df, nc);
|
|
52106
|
+
}
|
|
52107
|
+
const tCrit = studentTQuantile(1 - alpha / 2, df);
|
|
52108
|
+
return 1 - noncentralTCDF(tCrit, df, nc) + noncentralTCDF(-tCrit, df, nc);
|
|
52109
|
+
}
|
|
52110
|
+
function tTestPower(effectSize, nobsOrPower, alpha, opts = {}) {
|
|
52111
|
+
if (!(alpha > 0 && alpha < 1)) throw new Error("tTestPower: alpha must be in (0, 1)");
|
|
52112
|
+
const alt = opts.alternative ?? "two-sided";
|
|
52113
|
+
if (opts.solveFor === "nobs") {
|
|
52114
|
+
const targetPower = nobsOrPower;
|
|
52115
|
+
if (!(targetPower > 0 && targetPower < 1)) {
|
|
52116
|
+
throw new Error('tTestPower: target power must be in (0, 1) when solveFor is "nobs"');
|
|
52117
|
+
}
|
|
52118
|
+
if (effectSize === 0) throw new Error("tTestPower: cannot solve for nobs when effectSize is 0");
|
|
52119
|
+
let lo = 2 + 1e-9;
|
|
52120
|
+
let hi = 1e7;
|
|
52121
|
+
if (powerAt(effectSize, hi, alpha, alt) < targetPower) {
|
|
52122
|
+
throw new Error("tTestPower: target power unreachable even at nobs = 1e7");
|
|
52123
|
+
}
|
|
52124
|
+
for (let it = 0; it < 200; it++) {
|
|
52125
|
+
const mid = (lo + hi) / 2;
|
|
52126
|
+
if (powerAt(effectSize, mid, alpha, alt) < targetPower) lo = mid;
|
|
52127
|
+
else hi = mid;
|
|
52128
|
+
}
|
|
52129
|
+
return (lo + hi) / 2;
|
|
52130
|
+
}
|
|
52131
|
+
const nobs = nobsOrPower;
|
|
52132
|
+
if (!(nobs > 1)) throw new Error("tTestPower: nobs must be greater than 1");
|
|
52133
|
+
return powerAt(effectSize, nobs, alpha, alt);
|
|
52134
|
+
}
|
|
51433
52135
|
export {
|
|
51434
52136
|
ARRAY_WORKER_THRESHOLD,
|
|
51435
52137
|
CAS_BATCH_THRESHOLD,
|
|
@@ -51481,6 +52183,7 @@ export {
|
|
|
51481
52183
|
autoCorrelation,
|
|
51482
52184
|
avogadro,
|
|
51483
52185
|
bandpassFilter,
|
|
52186
|
+
barnesG,
|
|
51484
52187
|
bartlettPSD,
|
|
51485
52188
|
bartlettTest,
|
|
51486
52189
|
bellNumbers,
|
|
@@ -51524,6 +52227,8 @@ export {
|
|
|
51524
52227
|
bootstrapCI,
|
|
51525
52228
|
boundingBox,
|
|
51526
52229
|
bspline,
|
|
52230
|
+
bsplineEval,
|
|
52231
|
+
bsplineFit,
|
|
51527
52232
|
butter,
|
|
51528
52233
|
buttord,
|
|
51529
52234
|
cancel,
|
|
@@ -51857,6 +52562,7 @@ export {
|
|
|
51857
52562
|
getAssumptions,
|
|
51858
52563
|
getComputePool,
|
|
51859
52564
|
getMatrixDataType,
|
|
52565
|
+
glm,
|
|
51860
52566
|
globalMinimize,
|
|
51861
52567
|
gmean,
|
|
51862
52568
|
gmres,
|
|
@@ -51959,6 +52665,8 @@ export {
|
|
|
51959
52665
|
kdTreeKNN,
|
|
51960
52666
|
kdTreeNearest,
|
|
51961
52667
|
kdTreeRadius,
|
|
52668
|
+
kelvinBei,
|
|
52669
|
+
kelvinBer,
|
|
51962
52670
|
kendallTau,
|
|
51963
52671
|
kendallTauTest,
|
|
51964
52672
|
kendalltau,
|
|
@@ -52078,6 +52786,7 @@ export {
|
|
|
52078
52786
|
molarPlanckConstant,
|
|
52079
52787
|
molarVolume,
|
|
52080
52788
|
moment,
|
|
52789
|
+
monteCarloIntegrate,
|
|
52081
52790
|
movingAverage,
|
|
52082
52791
|
multiTaperPSD,
|
|
52083
52792
|
multinomial,
|
|
@@ -52088,6 +52797,8 @@ export {
|
|
|
52088
52797
|
multiplyScalar,
|
|
52089
52798
|
multivariateNormal,
|
|
52090
52799
|
multivariateTaylor,
|
|
52800
|
+
mvnPdf,
|
|
52801
|
+
mvnSample,
|
|
52091
52802
|
nearestNeighbor,
|
|
52092
52803
|
negativeBinomialDist,
|
|
52093
52804
|
nelderMead,
|
|
@@ -52190,6 +52901,7 @@ export {
|
|
|
52190
52901
|
polygamma,
|
|
52191
52902
|
polygonArea,
|
|
52192
52903
|
polygonPerimeter,
|
|
52904
|
+
polylog,
|
|
52193
52905
|
polymul,
|
|
52194
52906
|
polynomialGCD,
|
|
52195
52907
|
polynomialLCM,
|
|
@@ -52350,6 +53062,8 @@ export {
|
|
|
52350
53062
|
stirlingS2,
|
|
52351
53063
|
string,
|
|
52352
53064
|
stronglyConnectedComponents,
|
|
53065
|
+
struveH,
|
|
53066
|
+
struveL,
|
|
52353
53067
|
studentTCDF,
|
|
52354
53068
|
studentTPDF,
|
|
52355
53069
|
studentTQuantile,
|
|
@@ -52371,6 +53085,7 @@ export {
|
|
|
52371
53085
|
symbolicPartialDerivative,
|
|
52372
53086
|
symbolicProduct,
|
|
52373
53087
|
tDist,
|
|
53088
|
+
tTestPower,
|
|
52374
53089
|
tan,
|
|
52375
53090
|
tangentLine,
|
|
52376
53091
|
tanh,
|
package/dist/ml/glm.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Supported exponential-family distributions. */
|
|
2
|
+
export type GlmFamily = 'poisson' | 'gamma';
|
|
3
|
+
/** Supported link functions. */
|
|
4
|
+
export type GlmLink = 'log' | 'inverse';
|
|
5
|
+
export interface GlmOptions {
|
|
6
|
+
/** Exponential family: `'poisson'` (counts) or `'gamma'` (positive continuous). */
|
|
7
|
+
family: GlmFamily;
|
|
8
|
+
/** Link function. Default `'log'` for both families (`'inverse'` — the Gamma
|
|
9
|
+
* canonical link — is also supported for `family: 'gamma'`). */
|
|
10
|
+
link?: GlmLink;
|
|
11
|
+
/** Prepend a column of ones (default true), matching `ols`'s convention. */
|
|
12
|
+
intercept?: boolean;
|
|
13
|
+
/** Convergence tolerance on the max-norm change in the linear predictor (default 1e-10). */
|
|
14
|
+
tol?: number;
|
|
15
|
+
/** Maximum IRLS iterations (default 100). */
|
|
16
|
+
maxIter?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface GlmResult {
|
|
19
|
+
/** Fitted coefficients (intercept first, if included). */
|
|
20
|
+
coefficients: number[];
|
|
21
|
+
/** Fitted mean response `μ = linkInverse(Xβ)` for the training rows. */
|
|
22
|
+
fittedValues: number[];
|
|
23
|
+
/** Residual deviance `Σ d(yᵢ, μᵢ)` (family-specific unit deviance). */
|
|
24
|
+
deviance: number;
|
|
25
|
+
/** Number of IRLS iterations performed. */
|
|
26
|
+
iterations: number;
|
|
27
|
+
/** Predict the mean response for new rows. */
|
|
28
|
+
predict: (x: number[][]) => number[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Fit a generalized linear model `μ = linkInverse(Xβ)` by IRLS (Fisher
|
|
32
|
+
* scoring). Supports `family: 'poisson'` (log link only) and `family:
|
|
33
|
+
* 'gamma'` (log or inverse link).
|
|
34
|
+
*
|
|
35
|
+
* @param X - Design matrix (rows = observations, cols = predictors)
|
|
36
|
+
* @param y - Response vector (non-negative for Poisson, strictly positive for Gamma)
|
|
37
|
+
* @param opts - `family` (required), `link` (default `'log'`), `intercept`
|
|
38
|
+
* (default true), `tol` (default 1e-10), `maxIter` (default 100)
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* glm([[1], [2], [3], [4], [5]], [1, 2, 3, 5, 8], { family: 'poisson' })
|
|
42
|
+
* // => coefficients ~= [-0.374104, 0.492678] (matches statsmodels sm.GLM(..., family=Poisson()))
|
|
43
|
+
*/
|
|
44
|
+
export declare function glm(X: number[][], y: number[], opts: GlmOptions): GlmResult;
|
|
45
|
+
//# sourceMappingURL=glm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glm.d.ts","sourceRoot":"","sources":["../../src/ml/glm.ts"],"names":[],"mappings":"AAmBA,kDAAkD;AAClD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5C,gCAAgC;AAChC,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;AAExC,MAAM,WAAW,UAAU;IACzB,mFAAmF;IACnF,MAAM,EAAE,SAAS,CAAC;IAClB;oEACgE;IAChE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4EAA4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4FAA4F;IAC5F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,0DAA0D;IAC1D,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,wEAAwE;IACxE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,MAAM,EAAE,CAAC;CACtC;AAiED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,GAAG,SAAS,CAmF3E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
type f64 = number;
|
|
2
|
+
type i32 = number;
|
|
3
|
+
/** Options for {@link bsplineFit}. */
|
|
4
|
+
export interface BSplineFitOptions {
|
|
5
|
+
/** Spline degree (default 3, cubic). */
|
|
6
|
+
k?: i32;
|
|
7
|
+
/** Smoothing factor. `0` (default) fits an interpolating spline that
|
|
8
|
+
* passes through every data point exactly. `s > 0` requests a
|
|
9
|
+
* least-squares smoothing spline with fewer basis functions than data
|
|
10
|
+
* points — the number of interior knots shrinks roughly in proportion to
|
|
11
|
+
* `s`. Use `nknots` to control the knot count directly instead. */
|
|
12
|
+
s?: f64;
|
|
13
|
+
/** Explicit number of interior knots for a smoothing fit (used whenever
|
|
14
|
+
* `s > 0`, or set this directly with `s` left at 0). Overrides the
|
|
15
|
+
* `s`-derived heuristic. */
|
|
16
|
+
nknots?: i32;
|
|
17
|
+
}
|
|
18
|
+
/** A fitted B-spline in scipy's `tck` tuple shape: knot vector `t`,
|
|
19
|
+
* coefficients `c`, and degree `k`. */
|
|
20
|
+
export interface BSplineTuple {
|
|
21
|
+
t: f64[];
|
|
22
|
+
c: f64[];
|
|
23
|
+
k: i32;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Fit a B-spline of degree `k` (default cubic) to data `(x, y)`, returned
|
|
27
|
+
* in scipy's `tck` tuple shape `{ t, c, k }`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const xs = Array.from({ length: 15 }, (_, i) => (i * 2 * Math.PI) / 14);
|
|
31
|
+
* const ys = xs.map(Math.sin);
|
|
32
|
+
* const tck = bsplineFit(xs, ys); // cubic interpolating spline (s=0)
|
|
33
|
+
* bsplineEval(tck, xs[3]); // === ys[3] exactly (interpolation)
|
|
34
|
+
*/
|
|
35
|
+
export declare function bsplineFit(x: readonly f64[], y: readonly f64[], opts?: BSplineFitOptions): BSplineTuple;
|
|
36
|
+
/**
|
|
37
|
+
* Evaluate a fitted B-spline (de Boor's algorithm) at one point or an array
|
|
38
|
+
* of points.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* bsplineEval(bsplineFit(xs, ys), 1.0); // spline value at x=1
|
|
42
|
+
* bsplineEval(bsplineFit(xs, ys), [1, 2, 3]); // vectorized
|
|
43
|
+
*/
|
|
44
|
+
export declare function bsplineEval(spline: BSplineTuple, xnew: f64): f64;
|
|
45
|
+
export declare function bsplineEval(spline: BSplineTuple, xnew: readonly f64[]): f64[];
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=bspline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bspline.d.ts","sourceRoot":"","sources":["../../src/numeric/bspline.ts"],"names":[],"mappings":"AAgCA,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,GAAG,GAAG,MAAM,CAAC;AAElB,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,wCAAwC;IACxC,CAAC,CAAC,EAAE,GAAG,CAAC;IACR;;;;uEAImE;IACnE,CAAC,CAAC,EAAE,GAAG,CAAC;IACR;;gCAE4B;IAC5B,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED;uCACuC;AACvC,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,GAAG,EAAE,CAAC;IACT,CAAC,EAAE,GAAG,EAAE,CAAC;IACT,CAAC,EAAE,GAAG,CAAC;CACR;AAmED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,CAAC,EAAE,SAAS,GAAG,EAAE,EACjB,CAAC,EAAE,SAAS,GAAG,EAAE,EACjB,IAAI,GAAE,iBAAsB,GAC3B,YAAY,CAgDd;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;AAClE,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type f64 = number;
|
|
2
|
+
type i32 = number;
|
|
3
|
+
/** An axis-aligned integration bound `[lo, hi]`. */
|
|
4
|
+
export type Bound = readonly [f64, f64];
|
|
5
|
+
/** Options for {@link monteCarloIntegrate}. */
|
|
6
|
+
export interface MonteCarloOptions {
|
|
7
|
+
/** Number of sample points (default 1e5). */
|
|
8
|
+
n?: i32;
|
|
9
|
+
/** Sampling method (default `'uniform'`). */
|
|
10
|
+
method?: 'uniform' | 'halton' | 'sobol';
|
|
11
|
+
/** Seed for the deterministic RNG, `method: 'uniform'` only (reproducible
|
|
12
|
+
* draws). Omit for a time-seeded, non-reproducible generator. */
|
|
13
|
+
seed?: string | number;
|
|
14
|
+
}
|
|
15
|
+
/** Result of {@link monteCarloIntegrate}. */
|
|
16
|
+
export interface MonteCarloResult {
|
|
17
|
+
/** The estimated integral. */
|
|
18
|
+
estimate: f64;
|
|
19
|
+
/** Standard error of `estimate` (uniform MC only; 0 for QMC methods —
|
|
20
|
+
* see the module doc). */
|
|
21
|
+
stderr: f64;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Estimate `∫ f` over the axis-aligned box `bounds` (one `[lo, hi]` pair
|
|
25
|
+
* per dimension) by Monte-Carlo or quasi-Monte-Carlo sampling.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* monteCarloIntegrate((x) => x[0] ** 2, [[0, 1]], { n: 1e5, seed: 42 });
|
|
29
|
+
* // estimate ~ 1/3, stderr ~ 6e-4
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // unit-disk area via the indicator function, ~ pi
|
|
33
|
+
* monteCarloIntegrate((x) => (x[0] ** 2 + x[1] ** 2 <= 1 ? 1 : 0), [
|
|
34
|
+
* [-1, 1],
|
|
35
|
+
* [-1, 1],
|
|
36
|
+
* ]);
|
|
37
|
+
*/
|
|
38
|
+
export declare function monteCarloIntegrate(f: (x: f64[]) => f64, bounds: readonly Bound[], opts?: MonteCarloOptions): MonteCarloResult;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=monte-carlo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monte-carlo.d.ts","sourceRoot":"","sources":["../../src/numeric/monte-carlo.ts"],"names":[],"mappings":"AAqCA,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,GAAG,GAAG,MAAM,CAAC;AAElB,oDAAoD;AACpD,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAExC,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,CAAC,CAAC,EAAE,GAAG,CAAC;IACR,6CAA6C;IAC7C,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC;qEACiE;IACjE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,6CAA6C;AAC7C,MAAM,WAAW,gBAAgB;IAC/B,8BAA8B;IAC9B,QAAQ,EAAE,GAAG,CAAC;IACd;8BAC0B;IAC1B,MAAM,EAAE,GAAG,CAAC;CACb;AA2GD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,GAAG,EACpB,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,IAAI,GAAE,iBAAsB,GAC3B,gBAAgB,CA0ClB"}
|
|
@@ -3,7 +3,7 @@ import type { MathNumericType, MathArray, Unit } from '../types.js';
|
|
|
3
3
|
* Options for ODE solver
|
|
4
4
|
*/
|
|
5
5
|
interface ODEOptions {
|
|
6
|
-
method?: 'RK23' | 'RK45' | 'Rosenbrock';
|
|
6
|
+
method?: 'RK23' | 'RK45' | 'Rosenbrock' | 'RODAS';
|
|
7
7
|
tol?: number;
|
|
8
8
|
firstStep?: number | Unit;
|
|
9
9
|
minStep?: number | Unit;
|
|
@@ -11,6 +11,12 @@ interface ODEOptions {
|
|
|
11
11
|
minDelta?: number;
|
|
12
12
|
maxDelta?: number;
|
|
13
13
|
maxIter?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Analytic Jacobian ∂fᵢ/∂yⱼ of the forcing function, used by the stiff methods (`Rosenbrock`
|
|
16
|
+
* and `RODAS`) in place of the default finite-difference Jacobian. Must return an n×n matrix
|
|
17
|
+
* (n = state dimension). Ignored by the explicit RK23/RK45 methods.
|
|
18
|
+
*/
|
|
19
|
+
jac?: (t: number, y: number[]) => number[][];
|
|
14
20
|
}
|
|
15
21
|
/**
|
|
16
22
|
* Forcing function type for ODE
|
|
@@ -36,6 +42,22 @@ export declare function rosenbrockSolve(f: ForcingFunction, tspan: unknown[], y0
|
|
|
36
42
|
t: number[];
|
|
37
43
|
y: number[][];
|
|
38
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* RODAS stiff ODE solver — Hairer & Wanner's 4th-order, 6-stage, L-stable Rosenbrock method. Like
|
|
47
|
+
* the 2nd-order `rosenbrockSolve` (ode23s) it is linearly implicit: it forms the iteration matrix
|
|
48
|
+
* `E = I/(γh) − J` once per step (Jacobian J analytic via `options.jac` or finite-differenced),
|
|
49
|
+
* LU-factorises it, and solves it against six successive right-hand sides. Being 4th order it
|
|
50
|
+
* reaches tight tolerances (rtol < 1e-6) in far fewer steps than ode23s, whose 2nd order forces
|
|
51
|
+
* many small steps there. It retains the `h·d_i·∂f/∂t` term (∂f/∂t finite-differenced once per
|
|
52
|
+
* step) so it stays 4th order on non-autonomous systems `f(t, y)`.
|
|
53
|
+
*
|
|
54
|
+
* Module-level (not factory-nested) for the same reason as `rosenbrockSolve`: pure numeric helpers
|
|
55
|
+
* with no factory-scope dependency. Plain-number state only (the Jacobian/linear solve are numeric).
|
|
56
|
+
*/
|
|
57
|
+
export declare function rodasSolve(f: ForcingFunction, tspan: unknown[], y0raw: unknown[], options?: ODEOptions): {
|
|
58
|
+
t: number[];
|
|
59
|
+
y: number[][];
|
|
60
|
+
};
|
|
39
61
|
export declare const createSolveODE: import("../utils/factory.js").FactoryFunction<any, any>;
|
|
40
62
|
export {};
|
|
41
63
|
//# sourceMappingURL=solveODE.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solveODE.d.ts","sourceRoot":"","sources":["../../src/numeric/solveODE.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAU,IAAI,EAAa,MAAM,aAAa,CAAC;AAkCvF;;GAEG;AACH,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"solveODE.d.ts","sourceRoot":"","sources":["../../src/numeric/solveODE.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAU,IAAI,EAAa,MAAM,aAAa,CAAC;AAkCvF;;GAEG;AACH,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC;CAC9C;AAUD;;GAEG;AACH,KAAK,eAAe,GAAG,CACrB,CAAC,EAAE,eAAe,EAClB,CAAC,EAAE,eAAe,GAAG,SAAS,KAC3B,eAAe,GAAG,SAAS,CAAC;AAkGjC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE,eAAe,EAClB,KAAK,EAAE,OAAO,EAAE,EAChB,KAAK,EAAE,OAAO,EAAE,EAChB,OAAO,GAAE,UAAe,GACvB;IAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CAuFhC;AAgDD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CACxB,CAAC,EAAE,eAAe,EAClB,KAAK,EAAE,OAAO,EAAE,EAChB,KAAK,EAAE,OAAO,EAAE,EAChB,OAAO,GAAE,UAAe,GACvB;IAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CA0HhC;AAED,eAAO,MAAM,cAAc,yDA6oB1B,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Niche special functions: polylogarithm, Struve H/L, Kelvin ber/bei (order
|
|
3
|
+
* 0), and the Barnes G-function.
|
|
4
|
+
*
|
|
5
|
+
* These are lower-traffic special functions with narrower validity domains
|
|
6
|
+
* than the Bessel/Airy/elliptic families in `typed/special.ts`. They follow
|
|
7
|
+
* the same plain-exported-function pattern as `hypergeometric.ts` and
|
|
8
|
+
* `polygamma-orthopoly.ts` — pure `number -> number` (or `number, number ->
|
|
9
|
+
* number`) math, no typed-function array/WASM dispatch overloads.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
/** 64-bit float (default for decimals) */
|
|
14
|
+
type f64 = number;
|
|
15
|
+
/**
|
|
16
|
+
* Polylogarithm Li_s(z), computed via its defining series (DLMF 25.12.10):
|
|
17
|
+
*
|
|
18
|
+
* Li_s(z) = sum_{k=1}^inf z^k / k^s
|
|
19
|
+
*
|
|
20
|
+
* which converges for `|z| < 1` (any real `s`). Analytic continuation to
|
|
21
|
+
* `|z| >= 1` (needed for e.g. the dilogarithm's reflection formulas) is
|
|
22
|
+
* **out of scope** — this throws rather than silently returning a wrong or
|
|
23
|
+
* divergent value.
|
|
24
|
+
*
|
|
25
|
+
* Special value: `Li_1(z) = -ln(1 - z)`.
|
|
26
|
+
*
|
|
27
|
+
* @param s - Order (any real number)
|
|
28
|
+
* @param z - Argument, must satisfy `|z| < 1`
|
|
29
|
+
* @returns Li_s(z)
|
|
30
|
+
* @throws {Error} If `|z| >= 1`
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* polylog(2, 0.5) // ~0.5822405265 (dilogarithm)
|
|
34
|
+
* polylog(1, 0.5) // ~0.6931471806 (= -ln(0.5) = ln 2)
|
|
35
|
+
*/
|
|
36
|
+
export declare function polylog(s: f64, z: f64): f64;
|
|
37
|
+
/**
|
|
38
|
+
* Struve function H_v(z), via its power series (DLMF 11.2.1):
|
|
39
|
+
*
|
|
40
|
+
* H_v(z) = sum_{k=0}^inf (-1)^k / (Gamma(k+3/2) Gamma(k+v+3/2)) * (z/2)^(2k+v+1)
|
|
41
|
+
*
|
|
42
|
+
* Evaluated by the standard term-recurrence ratio
|
|
43
|
+
* `term_{k+1}/term_k = -(z/2)^2 / ((k+3/2)(k+v+3/2))`, seeded by a single
|
|
44
|
+
* pair of `lgamma` evaluations (avoids recomputing Gamma at every order and
|
|
45
|
+
* avoids overflow from large individual Gamma values).
|
|
46
|
+
*
|
|
47
|
+
* Valid for `z >= 0` and `v > -3/2` (so that `Gamma(v+3/2)` has no pole).
|
|
48
|
+
*
|
|
49
|
+
* @param v - Order (real, `v > -3/2`)
|
|
50
|
+
* @param z - Argument (real, `z >= 0`)
|
|
51
|
+
* @returns H_v(z)
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* struveH(0, 1) // ~0.5686566270
|
|
55
|
+
* struveH(1, 2) // ~0.6467637283
|
|
56
|
+
*/
|
|
57
|
+
export declare function struveH(v: f64, z: f64): f64;
|
|
58
|
+
/**
|
|
59
|
+
* Modified Struve function L_v(z), via its power series (DLMF 11.2.1):
|
|
60
|
+
*
|
|
61
|
+
* L_v(z) = sum_{k=0}^inf 1 / (Gamma(k+3/2) Gamma(k+v+3/2)) * (z/2)^(2k+v+1)
|
|
62
|
+
*
|
|
63
|
+
* Same as `struveH` but without the alternating `(-1)^k` sign, so every term
|
|
64
|
+
* is positive and the series grows monotonically for `z > 0` (like a
|
|
65
|
+
* modified Bessel function).
|
|
66
|
+
*
|
|
67
|
+
* Valid for `z >= 0` and `v > -3/2`.
|
|
68
|
+
*
|
|
69
|
+
* @param v - Order (real, `v > -3/2`)
|
|
70
|
+
* @param z - Argument (real, `z >= 0`)
|
|
71
|
+
* @returns L_v(z)
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* struveL(0, 1) // ~0.7102431859
|
|
75
|
+
*/
|
|
76
|
+
export declare function struveL(v: f64, z: f64): f64;
|
|
77
|
+
/**
|
|
78
|
+
* Kelvin function ber(x) (order 0), via its power series (DLMF 10.65.1):
|
|
79
|
+
*
|
|
80
|
+
* ber(x) = sum_{k=0}^inf (-1)^k (x/2)^(4k) / ((2k)!)^2
|
|
81
|
+
*
|
|
82
|
+
* Evaluated by the term-recurrence ratio
|
|
83
|
+
* `term_{k+1}/term_k = -(x/2)^4 / ((2k+1)(2k+2))^2`.
|
|
84
|
+
*
|
|
85
|
+
* @param x - Argument (real)
|
|
86
|
+
* @returns ber(x)
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* kelvinBer(0) // 1
|
|
90
|
+
* kelvinBer(2) // ~0.7517341827
|
|
91
|
+
*/
|
|
92
|
+
export declare function kelvinBer(x: f64): f64;
|
|
93
|
+
/**
|
|
94
|
+
* Kelvin function bei(x) (order 0), via its power series (DLMF 10.65.1):
|
|
95
|
+
*
|
|
96
|
+
* bei(x) = sum_{k=0}^inf (-1)^k (x/2)^(4k+2) / ((2k+1)!)^2
|
|
97
|
+
*
|
|
98
|
+
* Evaluated by the term-recurrence ratio
|
|
99
|
+
* `term_{k+1}/term_k = -(x/2)^4 / ((2k+2)(2k+3))^2`.
|
|
100
|
+
*
|
|
101
|
+
* @param x - Argument (real)
|
|
102
|
+
* @returns bei(x)
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* kelvinBei(0) // 0
|
|
106
|
+
* kelvinBei(2) // ~0.9722916273
|
|
107
|
+
*/
|
|
108
|
+
export declare function kelvinBei(x: f64): f64;
|
|
109
|
+
/**
|
|
110
|
+
* Barnes G-function G(z), for real `z > 0`.
|
|
111
|
+
*
|
|
112
|
+
* Uses the functional equation `G(z+1) = Gamma(z) * G(z)` to shift `z` up
|
|
113
|
+
* until it is large enough for the asymptotic expansion of `ln G` (DLMF
|
|
114
|
+
* 5.17.5) to converge to machine precision, then unwinds the shift:
|
|
115
|
+
*
|
|
116
|
+
* ln G(z) = ln G(z + n) - sum_{k=0}^{n-1} lgamma(z + k)
|
|
117
|
+
*
|
|
118
|
+
* Verified against `mpmath.barnesg` (dps=25) to relative error ~1e-14 across
|
|
119
|
+
* the anchored integer/half-integer test values. Not extended to `z <= 0`
|
|
120
|
+
* (Barnes G has zeros/sign changes on the non-positive real axis that this
|
|
121
|
+
* shift-and-asymptotic approach does not handle) — that domain is out of
|
|
122
|
+
* scope.
|
|
123
|
+
*
|
|
124
|
+
* Known integer values: `G(1) = G(2) = 1`, and in general
|
|
125
|
+
* `G(n+3) = prod_{k=1}^{n} k!` for nonnegative integers `n`
|
|
126
|
+
* (e.g. `G(4) = 2`, `G(5) = 12`, `G(6) = 288`).
|
|
127
|
+
*
|
|
128
|
+
* @param z - Argument (real, `z > 0`)
|
|
129
|
+
* @returns G(z)
|
|
130
|
+
* @throws {Error} If `z <= 0`
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* barnesG(4) // 2 (= 1!)
|
|
134
|
+
* barnesG(5) // 12 (= 1! * 2!)
|
|
135
|
+
* barnesG(4.5) // ~4.1862532590
|
|
136
|
+
*/
|
|
137
|
+
export declare function barnesG(z: f64): f64;
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=niche.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"niche.d.ts","sourceRoot":"","sources":["../../src/special/niche.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAIH,0CAA0C;AAC1C,KAAK,GAAG,GAAG,MAAM,CAAC;AAYlB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG,CAe3C;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG,CAiB3C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG,CAiB3C;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAYrC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAYrC;AAsCD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAcnC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** A vector given either as a scalar (1-D case) or an array (k-D case). */
|
|
2
|
+
export type MvnVector = number | readonly number[];
|
|
3
|
+
/** A covariance given either as a scalar variance (1-D case) or a k×k matrix. */
|
|
4
|
+
export type MvnCov = number | readonly (readonly number[])[];
|
|
5
|
+
/**
|
|
6
|
+
* Multivariate-normal probability density, handling both the 1-D case
|
|
7
|
+
* (`x`/`mean` scalars, `cov` a scalar variance) and the general k-D case
|
|
8
|
+
* (`x`/`mean` length-k arrays, `cov` a k×k matrix). Reduces to the ordinary
|
|
9
|
+
* normal PDF when k=1.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* mvnPdf([0, 0], [0, 0], [[1, 0], [0, 1]]); // ~0.15915494 (scipy multivariate_normal.pdf)
|
|
13
|
+
* mvnPdf(0, 0, 1); // ~0.3989422804 (standard normal density at 0)
|
|
14
|
+
*/
|
|
15
|
+
export declare function mvnPdf(x: MvnVector, mean: MvnVector, cov: MvnCov): number;
|
|
16
|
+
/** Options for {@link mvnSample}. */
|
|
17
|
+
export interface MvnSampleOptions {
|
|
18
|
+
/** Seed for the deterministic RNG (reproducible draws). Omit for a
|
|
19
|
+
* time-seeded, non-reproducible generator. */
|
|
20
|
+
seed?: string | number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Draw `n` samples from a multivariate normal `N(mean, cov)` via `x = mean +
|
|
24
|
+
* L·z`, where `Σ = LLᵀ` (Cholesky) and `z` is a vector of independent standard
|
|
25
|
+
* normals (Box-Muller). Handles the 1-D case the same as {@link mvnPdf}.
|
|
26
|
+
* Returns an `n`-length array of length-k row vectors.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* mvnSample([1, 2], [[2, 0.5], [0.5, 1]], 20000, { seed: 42 });
|
|
30
|
+
* // empirical mean ~= [1, 2], empirical covariance ~= [[2, 0.5], [0.5, 1]]
|
|
31
|
+
*/
|
|
32
|
+
export declare function mvnSample(mean: MvnVector, cov: MvnCov, n: number, opts?: MvnSampleOptions): number[][];
|
|
33
|
+
//# sourceMappingURL=mvn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mvn.d.ts","sourceRoot":"","sources":["../../src/stats/mvn.ts"],"names":[],"mappings":"AAgBA,2EAA2E;AAC3E,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;AACnD,iFAAiF;AACjF,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;AAmC7D;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAOzE;AAED,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B;kDAC8C;IAC9C,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,SAAS,EACf,GAAG,EAAE,MAAM,EACX,CAAC,EAAE,MAAM,EACT,IAAI,CAAC,EAAE,gBAAgB,GACtB,MAAM,EAAE,EAAE,CAwBZ"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Alternative hypothesis direction. */
|
|
2
|
+
export type TTestPowerAlternative = 'two-sided' | 'larger' | 'smaller';
|
|
3
|
+
export interface TTestPowerOptions {
|
|
4
|
+
/**
|
|
5
|
+
* `'power'` (default): the second positional argument is `nobs` (per-group
|
|
6
|
+
* sample size) and the function returns the power.
|
|
7
|
+
*
|
|
8
|
+
* `'nobs'`: the second positional argument is instead read as the *target
|
|
9
|
+
* power*, and the function solves (by bisection) for the per-group `nobs`
|
|
10
|
+
* (continuous, matching statsmodels' own continuous solver) needed to reach
|
|
11
|
+
* it.
|
|
12
|
+
*/
|
|
13
|
+
solveFor?: 'power' | 'nobs';
|
|
14
|
+
/** Default `'two-sided'`. */
|
|
15
|
+
alternative?: TTestPowerAlternative;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Statistical power of a two-sample t-test with equal group sizes.
|
|
19
|
+
*
|
|
20
|
+
* @param effectSize - Standardized effect size (Cohen's d)
|
|
21
|
+
* @param nobsOrPower - Per-group sample size (`solveFor: 'power'`, the
|
|
22
|
+
* default) or the target power to solve for (`solveFor: 'nobs'`)
|
|
23
|
+
* @param alpha - Significance level
|
|
24
|
+
* @param opts - `solveFor` (default `'power'`), `alternative` (default `'two-sided'`)
|
|
25
|
+
* @returns The power (default) or the required per-group `nobs` (`solveFor: 'nobs'`)
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* tTestPower(0.5, 64, 0.05); // ~0.80146 (statsmodels tt_ind_solve_power)
|
|
29
|
+
* tTestPower(0.5, 0.8, 0.05, { solveFor: 'nobs' }); // ~63.77 (per-group nobs for 80% power)
|
|
30
|
+
*/
|
|
31
|
+
export declare function tTestPower(effectSize: number, nobsOrPower: number, alpha: number, opts?: TTestPowerOptions): number;
|
|
32
|
+
//# sourceMappingURL=power-analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"power-analysis.d.ts","sourceRoot":"","sources":["../../src/stats/power-analysis.ts"],"names":[],"mappings":"AAeA,wCAAwC;AACxC,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,6BAA6B;IAC7B,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AAuBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,iBAAsB,GAC3B,MAAM,CA2BR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dist-objects.d.ts","sourceRoot":"","sources":["../../src/typed/dist-objects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;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