@numero-uno-jpn/rstats 0.11.0 → 0.12.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/CHANGELOG.md +57 -0
- package/README.ja.md +44 -13
- package/README.md +43 -11
- package/dist/chunks/{chunk-VJ4BDBMU.js → chunk-3VMBBQLV.js} +2 -2
- package/dist/chunks/chunk-4OKAZJJG.js +3 -0
- package/dist/chunks/{chunk-EZAFN5CD.js → chunk-6BH65HGN.js} +1 -1
- package/dist/chunks/chunk-ATC4F4BX.js +2 -0
- package/dist/chunks/{chunk-JWBO5WVN.js → chunk-EDH53DXN.js} +2 -2
- package/dist/chunks/{chunk-Y5CNQ266.js → chunk-EZ2KD5NA.js} +2 -2
- package/dist/chunks/{chunk-Y5PYRAYP.js → chunk-GSPOO2G3.js} +2 -2
- package/dist/chunks/{chunk-F5EDJFEO.js → chunk-K7AZ65H7.js} +2 -2
- package/dist/chunks/{chunk-YSWGDOWK.js → chunk-LEIH4U5X.js} +2 -2
- package/dist/chunks/{chunk-EZWBRCJL.js → chunk-OX3SBG5X.js} +1 -1
- package/dist/chunks/chunk-SGZQDJRR.js +2 -0
- package/dist/chunks/{chunk-C5XTWMGB.js → chunk-UH2N3ZQW.js} +1 -1
- package/dist/chunks/chunk-UV2MZYDQ.js +2 -0
- package/dist/chunks/{chunk-TOGXTCZO.js → chunk-VQHEOBTM.js} +2 -2
- package/dist/chunks/chunk-WJQZZYOI.js +2 -0
- package/dist/chunks/chunk-WKEFHOFR.js +2 -0
- package/dist/chunks/{chunk-CGBNKHNZ.js → chunk-WXC25OPJ.js} +2 -2
- package/dist/chunks/{chunk-5WDJPHYY.js → chunk-XJQKSR52.js} +1 -1
- package/dist/data/grouping.d.ts +39 -15
- package/dist/data/grouping.js +21 -22
- package/dist/descriptive/basic.d.ts +130 -17
- package/dist/descriptive/basic.js +115 -14
- package/dist/descriptive/cov.d.ts +22 -12
- package/dist/descriptive/dataFrames.d.ts +39 -11
- package/dist/descriptive/dataFrames.js +14 -6
- package/dist/descriptive/factanal.d.ts +26 -6
- package/dist/descriptive/factanal.js +7 -3
- package/dist/descriptive/hist.d.ts +27 -6
- package/dist/descriptive/hist.js +9 -3
- package/dist/descriptive/missing.d.ts +13 -6
- package/dist/descriptive/missing.js +4 -2
- package/dist/descriptive/moments.d.ts +91 -13
- package/dist/descriptive/moments.js +66 -9
- package/dist/descriptive/omega.d.ts +28 -6
- package/dist/descriptive/omega.js +16 -4
- package/dist/descriptive/pivot.d.ts +22 -6
- package/dist/descriptive/pivot.js +7 -3
- package/dist/descriptive/quantile.d.ts +33 -5
- package/dist/descriptive/quantile.js +20 -2
- package/dist/descriptive/rank.d.ts +12 -2
- package/dist/descriptive/rank.js +2 -0
- package/dist/descriptive/table.d.ts +55 -7
- package/dist/descriptive/table.js +38 -4
- package/dist/descriptive.js +2 -2
- package/dist/distributions/arcsine.d.ts +40 -5
- package/dist/distributions/arcsine.js +35 -4
- package/dist/distributions/beta.d.ts +12 -0
- package/dist/distributions/beta.js +12 -0
- package/dist/distributions/binomial.d.ts +18 -0
- package/dist/distributions/binomial.js +18 -0
- package/dist/distributions/bvnorm.d.ts +4 -1
- package/dist/distributions/bvnorm.js +4 -1
- package/dist/distributions/cauchy.d.ts +24 -0
- package/dist/distributions/cauchy.js +24 -0
- package/dist/distributions/chisq.d.ts +18 -0
- package/dist/distributions/chisq.js +18 -0
- package/dist/distributions/exponential.d.ts +29 -1
- package/dist/distributions/exponential.js +24 -0
- package/dist/distributions/f.d.ts +18 -0
- package/dist/distributions/f.js +18 -0
- package/dist/distributions/gamma.d.ts +20 -0
- package/dist/distributions/gamma.js +18 -0
- package/dist/distributions/geometric.d.ts +24 -0
- package/dist/distributions/geometric.js +24 -0
- package/dist/distributions/hypergeometric.d.ts +24 -0
- package/dist/distributions/hypergeometric.js +24 -0
- package/dist/distributions/invgamma.d.ts +32 -4
- package/dist/distributions/invgamma.js +27 -3
- package/dist/distributions/kumaraswamy.d.ts +31 -3
- package/dist/distributions/kumaraswamy.js +31 -3
- package/dist/distributions/laplace.d.ts +36 -4
- package/dist/distributions/laplace.js +31 -3
- package/dist/distributions/logistic.d.ts +29 -1
- package/dist/distributions/logistic.js +24 -0
- package/dist/distributions/lognormal.d.ts +29 -1
- package/dist/distributions/lognormal.js +24 -0
- package/dist/distributions/multinomial.d.ts +7 -1
- package/dist/distributions/multinomial.js +2 -0
- package/dist/distributions/negbinomial.d.ts +29 -1
- package/dist/distributions/negbinomial.js +24 -0
- package/dist/distributions/normal.d.ts +11 -1
- package/dist/distributions/normal.js +6 -0
- package/dist/distributions/pareto.d.ts +36 -4
- package/dist/distributions/pareto.js +31 -3
- package/dist/distributions/poisson.d.ts +18 -0
- package/dist/distributions/poisson.js +18 -0
- package/dist/distributions/signrank.d.ts +24 -0
- package/dist/distributions/signrank.js +24 -0
- package/dist/distributions/summary.d.ts +20 -2
- package/dist/distributions/summary.js +4 -0
- package/dist/distributions/t.d.ts +18 -0
- package/dist/distributions/t.js +18 -0
- package/dist/distributions/triangular.d.ts +36 -4
- package/dist/distributions/triangular.js +31 -3
- package/dist/distributions/tukey.d.ts +15 -1
- package/dist/distributions/tukey.js +10 -0
- package/dist/distributions/uniform.d.ts +29 -1
- package/dist/distributions/uniform.js +24 -0
- package/dist/distributions/weibull.d.ts +29 -1
- package/dist/distributions/weibull.js +24 -0
- package/dist/distributions/wilcox.d.ts +24 -0
- package/dist/distributions/wilcox.js +24 -0
- package/dist/distributions.js +2 -2
- package/dist/entries/descriptive.d.ts +1 -1
- package/dist/entries/mixed.d.ts +1 -0
- package/dist/entries/mixed.js +2 -0
- package/dist/entries/numerics.d.ts +1 -1
- package/dist/entries/tests.js +1 -1
- package/dist/htest/agreement.d.ts +61 -23
- package/dist/htest/agreement.js +19 -9
- package/dist/htest/ansariTest.d.ts +8 -2
- package/dist/htest/aov.d.ts +43 -10
- package/dist/htest/aov.js +17 -3
- package/dist/htest/binomTest.d.ts +12 -2
- package/dist/htest/binomTest.js +2 -0
- package/dist/htest/brunnerMunzelTest.d.ts +9 -3
- package/dist/htest/brunnerMunzelTest.js +4 -2
- package/dist/htest/chisqTest.d.ts +19 -3
- package/dist/htest/cor.d.ts +20 -4
- package/dist/htest/effectSize.d.ts +70 -12
- package/dist/htest/effectSize.js +40 -7
- package/dist/htest/fisherTest.d.ts +9 -1
- package/dist/htest/fisherTest.js +2 -0
- package/dist/htest/groups.d.ts +5 -1
- package/dist/htest/ksTest.d.ts +20 -3
- package/dist/htest/leveneTest.d.ts +15 -4
- package/dist/htest/leveneTest.js +5 -2
- package/dist/htest/mantelhaenTest.d.ts +25 -3
- package/dist/htest/mantelhaenTest.js +15 -1
- package/dist/htest/mcnemarTest.d.ts +14 -4
- package/dist/htest/mcnemarTest.js +4 -2
- package/dist/htest/multipleComparisons.d.ts +173 -29
- package/dist/htest/multipleComparisons.js +123 -19
- package/dist/htest/normalityTests.d.ts +56 -9
- package/dist/htest/normalityTests.js +40 -6
- package/dist/htest/onewayTest.d.ts +32 -3
- package/dist/htest/onewayTest.js +10 -0
- package/dist/htest/pAdjust.d.ts +9 -1
- package/dist/htest/pAdjust.js +2 -0
- package/dist/htest/pairwise.d.ts +50 -5
- package/dist/htest/pairwise.js +25 -0
- package/dist/htest/poissonTest.d.ts +12 -2
- package/dist/htest/poissonTest.js +2 -0
- package/dist/htest/polycor.d.ts +29 -10
- package/dist/htest/power.d.ts +60 -6
- package/dist/htest/power.js +6 -0
- package/dist/htest/propTest.d.ts +13 -2
- package/dist/htest/propTest.js +2 -0
- package/dist/htest/pwr.d.ts +286 -36
- package/dist/htest/pwr.js +116 -15
- package/dist/htest/rankTests.d.ts +80 -12
- package/dist/htest/rankTests.js +11 -2
- package/dist/htest/tTest.d.ts +13 -3
- package/dist/htest/testFormula.js +6 -3
- package/dist/htest/trendTests.d.ts +29 -8
- package/dist/htest/trendTests.js +8 -4
- package/dist/htest/types.d.ts +14 -2
- package/dist/htest/varTest.d.ts +25 -8
- package/dist/htest/wilcoxTest.d.ts +10 -2
- package/dist/internal/dpq.d.ts +4 -0
- package/dist/internal/noncentral.d.ts +2 -0
- package/dist/internal/vectorize.d.ts +4 -0
- package/dist/linalg/basic.d.ts +39 -5
- package/dist/linalg/basic.js +15 -0
- package/dist/linalg/chol.d.ts +26 -5
- package/dist/linalg/chol.js +7 -0
- package/dist/linalg/eigen.d.ts +16 -7
- package/dist/linalg/eigen.js +6 -5
- package/dist/linalg/expm.d.ts +15 -5
- package/dist/linalg/expm.js +5 -3
- package/dist/linalg/kappa.d.ts +21 -1
- package/dist/linalg/kappa.js +16 -0
- package/dist/linalg/lu.d.ts +30 -6
- package/dist/linalg/lu.js +15 -3
- package/dist/linalg/matrix.d.ts +4 -0
- package/dist/linalg/norm.d.ts +16 -1
- package/dist/linalg/norm.js +9 -0
- package/dist/linalg/ops.d.ts +156 -35
- package/dist/linalg/ops.js +96 -15
- package/dist/linalg/qr.d.ts +87 -12
- package/dist/linalg/qr.js +31 -0
- package/dist/linalg/schur.d.ts +8 -2
- package/dist/linalg/schur.js +3 -1
- package/dist/linalg/solve.d.ts +42 -6
- package/dist/linalg/solve.js +22 -0
- package/dist/linalg/svd.d.ts +12 -2
- package/dist/linalg/svd.js +2 -0
- package/dist/linalg.js +2 -2
- package/dist/mixed.js +3 -0
- package/dist/models/anovaSequential.d.ts +26 -4
- package/dist/models/anovaSequential.js +3 -1
- package/dist/models/aovEz.d.ts +29 -6
- package/dist/models/aovEz.js +5 -2
- package/dist/models/aovStrata.d.ts +13 -3
- package/dist/models/aovStrata.js +5 -1
- package/dist/models/carAnova.d.ts +9 -3
- package/dist/models/carAnova.js +4 -2
- package/dist/models/coxph.d.ts +33 -7
- package/dist/models/coxph.js +8 -3
- package/dist/models/formula.d.ts +26 -1
- package/dist/models/formula.js +125 -9
- package/dist/models/glm.d.ts +128 -21
- package/dist/models/glm.js +71 -14
- package/dist/models/glmAnova.d.ts +30 -5
- package/dist/models/glmAnova.js +15 -2
- package/dist/models/glmConfint.d.ts +16 -2
- package/dist/models/glmConfint.js +9 -1
- package/dist/models/glmFamily.d.ts +27 -5
- package/dist/models/lm.d.ts +77 -19
- package/dist/models/lm.js +22 -4
- package/dist/models/lmer.d.ts +162 -0
- package/dist/models/lmer.js +457 -0
- package/dist/models/mauchly.d.ts +20 -5
- package/dist/models/mauchly.js +7 -3
- package/dist/models/mixedDeviance.d.ts +44 -0
- package/dist/models/mixedDeviance.js +872 -0
- package/dist/models/mixedStructure.d.ts +82 -0
- package/dist/models/mixedStructure.js +309 -0
- package/dist/models/modelFrame.d.ts +17 -2
- package/dist/models/modelFrame.js +36 -21
- package/dist/models/modelMatrix.d.ts +33 -8
- package/dist/models/modelMatrix.js +21 -5
- package/dist/models/survival.d.ts +41 -9
- package/dist/models/survival.js +10 -4
- package/dist/numerics/deriv.d.ts +21 -6
- package/dist/numerics/deriv.js +16 -5
- package/dist/numerics/integrate.d.ts +37 -7
- package/dist/numerics/integrate.js +8 -2
- package/dist/numerics/interp.d.ts +63 -12
- package/dist/numerics/interp.js +30 -6
- package/dist/numerics/ode.d.ts +15 -5
- package/dist/numerics/ode.js +5 -3
- package/dist/numerics.js +2 -2
- package/dist/optim/optim.d.ts +32 -8
- package/dist/optim/optim.js +8 -4
- package/dist/random/beta.d.ts +8 -0
- package/dist/random/beta.js +8 -0
- package/dist/random/binomial.d.ts +16 -0
- package/dist/random/binomial.js +16 -0
- package/dist/random/continuous.d.ts +51 -0
- package/dist/random/continuous.js +51 -0
- package/dist/random/extra.d.ts +66 -6
- package/dist/random/extra.js +66 -6
- package/dist/random/gamma.d.ts +33 -0
- package/dist/random/gamma.js +33 -0
- package/dist/random/hyper.d.ts +8 -0
- package/dist/random/hyper.js +8 -0
- package/dist/random/poisson.d.ts +25 -0
- package/dist/random/poisson.js +25 -0
- package/dist/random/r2dtable.d.ts +2 -0
- package/dist/random/r2dtable.js +2 -0
- package/dist/random/rank.d.ts +16 -0
- package/dist/random/rank.js +16 -0
- package/dist/random/rng.d.ts +49 -6
- package/dist/random/rng.js +29 -2
- package/dist/random/sample.d.ts +10 -2
- package/dist/random/sample.js +5 -1
- package/dist/random/streams.d.ts +13 -0
- package/dist/random/streams.js +13 -0
- package/dist/rstats.js +14 -14
- package/dist/special/besselIK.d.ts +11 -3
- package/dist/special/besselIK.js +6 -2
- package/dist/special/besselJY.d.ts +6 -2
- package/dist/special/besselJY.js +6 -2
- package/dist/special/beta.d.ts +16 -2
- package/dist/special/beta.js +16 -2
- package/dist/special/choose.d.ts +13 -5
- package/dist/special/choose.js +13 -5
- package/dist/special/erf.d.ts +8 -3
- package/dist/special/erf.js +8 -3
- package/dist/special/extra.d.ts +30 -10
- package/dist/special/extra.js +25 -9
- package/dist/special/gamma.d.ts +18 -2
- package/dist/special/gamma.js +18 -2
- package/dist/special/log1p.d.ts +16 -7
- package/dist/special/log1p.js +16 -7
- package/dist/special/psigamma.d.ts +9 -3
- package/dist/special/psigamma.js +9 -3
- package/dist/special/rCompatible.d.ts +5 -1
- package/dist/special.js +2 -2
- package/dist/tests.js +12 -12
- package/llms.txt +13 -3
- package/package.json +5 -1
- package/dist/chunks/chunk-7GQMKH3Z.js +0 -2
- package/dist/chunks/chunk-AHHS6AC4.js +0 -3
- package/dist/chunks/chunk-ALM3VHFP.js +0 -2
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type Vectorizable, type VectorResult } from "../internal/vectorize.js";
|
|
2
2
|
import { type DensityOptions, type TailOptions } from "../internal/dpq.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Limits and mode of the triangular distribution.
|
|
5
|
+
*
|
|
6
|
+
* @category Distributions
|
|
7
|
+
*/
|
|
4
8
|
export interface TriangParams {
|
|
5
9
|
/** Minimum. Default `-1`. */
|
|
6
10
|
a?: number;
|
|
@@ -13,13 +17,41 @@ export declare function dtriang1(x: number, a: number, b: number, c: number, log
|
|
|
13
17
|
export declare function ptriang1(q: number, a: number, b: number, c: number, lowerTail: boolean, logP: boolean): number;
|
|
14
18
|
export declare function qtriang1(p: number, a: number, b: number, c: number, lowerTail: boolean, logP: boolean): number;
|
|
15
19
|
/**
|
|
16
|
-
* Density of the triangular distribution. Equivalent to `extraDistr::dtriang(x, a = -1, b = 1, c = (a + b)/2, log = FALSE)
|
|
20
|
+
* Density of the triangular distribution. Equivalent to `extraDistr::dtriang(x, a = -1, b = 1, c = (a + b)/2, log = FALSE)` in R.
|
|
17
21
|
*
|
|
18
22
|
* @param x - Value(s) at which to evaluate: a number, `number[]` or `Float64Array`. The result has the same shape.
|
|
19
23
|
* @param options - `a`, `b` and `c` (see {@link TriangParams}) and `log` (see {@link DensityOptions}).
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* dtriang(0); // 1
|
|
28
|
+
* dtriang(1, { a: 0, b: 4, c: 1 }); // 0.5
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @category Distributions
|
|
20
32
|
*/
|
|
21
33
|
export declare function dtriang<T extends Vectorizable>(x: T, options?: TriangParams & DensityOptions): VectorResult<T>;
|
|
22
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Distribution function of the triangular distribution. Equivalent to `extraDistr::ptriang(q, a, b, c, lower.tail, log.p)` in R.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* ptriang(0); // 0.5
|
|
40
|
+
* ptriang(2, { a: 0, b: 4, c: 1 }); // 0.6666666666666667
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @category Distributions
|
|
44
|
+
*/
|
|
23
45
|
export declare function ptriang<T extends Vectorizable>(q: T, options?: TriangParams & TailOptions): VectorResult<T>;
|
|
24
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Quantile function of the triangular distribution. Equivalent to `extraDistr::qtriang(p, a, b, c, lower.tail, log.p)` in R.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* qtriang(0.5); // 0
|
|
52
|
+
* qtriang(0.9, { a: 0, b: 4, c: 1 }); // 2.904554884989668
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @category Distributions
|
|
56
|
+
*/
|
|
25
57
|
export declare function qtriang<T extends Vectorizable>(p: T, options?: TriangParams & TailOptions): VectorResult<T>;
|
|
@@ -63,23 +63,51 @@ export function qtriang1(p, a, b, c, lowerTail, logP) {
|
|
|
63
63
|
return b - Math.sqrt(upper * w * (b - c));
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
-
* Density of the triangular distribution. Equivalent to `extraDistr::dtriang(x, a = -1, b = 1, c = (a + b)/2, log = FALSE)
|
|
66
|
+
* Density of the triangular distribution. Equivalent to `extraDistr::dtriang(x, a = -1, b = 1, c = (a + b)/2, log = FALSE)` in R.
|
|
67
67
|
*
|
|
68
68
|
* @param x - Value(s) at which to evaluate: a number, `number[]` or `Float64Array`. The result has the same shape.
|
|
69
69
|
* @param options - `a`, `b` and `c` (see {@link TriangParams}) and `log` (see {@link DensityOptions}).
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* dtriang(0); // 1
|
|
74
|
+
* dtriang(1, { a: 0, b: 4, c: 1 }); // 0.5
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @category Distributions
|
|
70
78
|
*/
|
|
71
79
|
export function dtriang(x, options = {}) {
|
|
72
80
|
const { a = -1, b = 1, log = false } = options;
|
|
73
81
|
const c = options.c ?? (a + b) / 2;
|
|
74
82
|
return vectorize(x, (v) => dtriang1(v, a, b, c, log));
|
|
75
83
|
}
|
|
76
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Distribution function of the triangular distribution. Equivalent to `extraDistr::ptriang(q, a, b, c, lower.tail, log.p)` in R.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* ptriang(0); // 0.5
|
|
90
|
+
* ptriang(2, { a: 0, b: 4, c: 1 }); // 0.6666666666666667
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @category Distributions
|
|
94
|
+
*/
|
|
77
95
|
export function ptriang(q, options = {}) {
|
|
78
96
|
const { a = -1, b = 1, lowerTail = true, logP = false } = options;
|
|
79
97
|
const c = options.c ?? (a + b) / 2;
|
|
80
98
|
return vectorize(q, (v) => ptriang1(v, a, b, c, lowerTail, logP));
|
|
81
99
|
}
|
|
82
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Quantile function of the triangular distribution. Equivalent to `extraDistr::qtriang(p, a, b, c, lower.tail, log.p)` in R.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* qtriang(0.5); // 0
|
|
106
|
+
* qtriang(0.9, { a: 0, b: 4, c: 1 }); // 2.904554884989668
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @category Distributions
|
|
110
|
+
*/
|
|
83
111
|
export function qtriang(p, options = {}) {
|
|
84
112
|
const { a = -1, b = 1, lowerTail = true, logP = false } = options;
|
|
85
113
|
const c = options.c ?? (a + b) / 2;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type Vectorizable, type VectorResult } from "../internal/vectorize.js";
|
|
2
2
|
import { type TailOptions } from "../internal/dpq.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link ptukey} and {@link qtukey}.
|
|
5
|
+
*
|
|
6
|
+
* @category Distributions
|
|
7
|
+
*/
|
|
4
8
|
export interface TukeyOptions extends TailOptions {
|
|
5
9
|
/** Number of groups whose ranges are compared; the statistic is the maximum of that many ranges. Default `1`. */
|
|
6
10
|
nranges?: number;
|
|
@@ -27,6 +31,8 @@ export declare function qtukey1(p: number, k: number, df: number, r: number, low
|
|
|
27
31
|
* ptukey(3.5, 3, 12); // 0.9300045147248135
|
|
28
32
|
* ptukey(3.5, 3, 12, { lowerTail: false }); // 0.06999548527518648
|
|
29
33
|
* ```
|
|
34
|
+
*
|
|
35
|
+
* @category Distributions
|
|
30
36
|
*/
|
|
31
37
|
export declare function ptukey<T extends Vectorizable>(q: T, nmeans: number, df: number, options?: TukeyOptions): VectorResult<T>;
|
|
32
38
|
/**
|
|
@@ -39,5 +45,13 @@ export declare function ptukey<T extends Vectorizable>(q: T, nmeans: number, df:
|
|
|
39
45
|
* @param df - Degrees of freedom of the standard deviation estimate.
|
|
40
46
|
* @param options - `nranges`, `lowerTail` and `logP` (see {@link TukeyOptions}).
|
|
41
47
|
* @returns The quantile(s).
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* qtukey(0.95, 3, 12); // 3.7729289657270084
|
|
52
|
+
* qtukey(0.95, 4, 20); // 3.958293560945357
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @category Distributions
|
|
42
56
|
*/
|
|
43
57
|
export declare function qtukey<T extends Vectorizable>(p: T, nmeans: number, df: number, options?: TukeyOptions): VectorResult<T>;
|
|
@@ -963,6 +963,8 @@ function brent(f, a, b, fa, fb) {
|
|
|
963
963
|
* ptukey(3.5, 3, 12); // 0.9300045147248135
|
|
964
964
|
* ptukey(3.5, 3, 12, { lowerTail: false }); // 0.06999548527518648
|
|
965
965
|
* ```
|
|
966
|
+
*
|
|
967
|
+
* @category Distributions
|
|
966
968
|
*/
|
|
967
969
|
export function ptukey(q, nmeans, df, options = {}) {
|
|
968
970
|
const { nranges = 1, lowerTail = true, logP = false } = options;
|
|
@@ -978,6 +980,14 @@ export function ptukey(q, nmeans, df, options = {}) {
|
|
|
978
980
|
* @param df - Degrees of freedom of the standard deviation estimate.
|
|
979
981
|
* @param options - `nranges`, `lowerTail` and `logP` (see {@link TukeyOptions}).
|
|
980
982
|
* @returns The quantile(s).
|
|
983
|
+
*
|
|
984
|
+
* @example
|
|
985
|
+
* ```ts
|
|
986
|
+
* qtukey(0.95, 3, 12); // 3.7729289657270084
|
|
987
|
+
* qtukey(0.95, 4, 20); // 3.958293560945357
|
|
988
|
+
* ```
|
|
989
|
+
*
|
|
990
|
+
* @category Distributions
|
|
981
991
|
*/
|
|
982
992
|
export function qtukey(p, nmeans, df, options = {}) {
|
|
983
993
|
const { nranges = 1, lowerTail = true, logP = false } = options;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type Vectorizable, type VectorResult } from "../internal/vectorize.js";
|
|
2
2
|
import { type DensityOptions, type TailOptions } from "../internal/dpq.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Parameters of the uniform distribution.
|
|
5
|
+
*
|
|
6
|
+
* @category Distributions
|
|
7
|
+
*/
|
|
4
8
|
export interface UniformParams {
|
|
5
9
|
/** Lower limit. Default `0`. */
|
|
6
10
|
min?: number;
|
|
@@ -16,6 +20,14 @@ export declare function qunif1(p: number, min: number, max: number, lowerTail: b
|
|
|
16
20
|
* @param x - Value(s) at which to evaluate: a number, `number[]` or `Float64Array`. The result has the same shape.
|
|
17
21
|
* @param options - `min` and `max` (see {@link UniformParams}) and `log` (see {@link DensityOptions}).
|
|
18
22
|
* @returns The density (or log density).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* dunif(0.5); // 1
|
|
27
|
+
* dunif([1, 3], { min: 0, max: 2 }); // [0.5, 0]
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @category Distributions
|
|
19
31
|
*/
|
|
20
32
|
export declare function dunif<T extends Vectorizable>(x: T, options?: UniformParams & DensityOptions): VectorResult<T>;
|
|
21
33
|
/**
|
|
@@ -24,6 +36,14 @@ export declare function dunif<T extends Vectorizable>(x: T, options?: UniformPar
|
|
|
24
36
|
* @param q - Quantile(s): a number, `number[]` or `Float64Array`. The result has the same shape.
|
|
25
37
|
* @param options - `min` and `max` (see {@link UniformParams}), `lowerTail` and `logP` (see {@link TailOptions}).
|
|
26
38
|
* @returns The probability (or log probability).
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* punif(0.3); // 0.3
|
|
43
|
+
* punif(1.5, { min: 1, max: 3 }); // 0.25
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @category Distributions
|
|
27
47
|
*/
|
|
28
48
|
export declare function punif<T extends Vectorizable>(q: T, options?: UniformParams & TailOptions): VectorResult<T>;
|
|
29
49
|
/**
|
|
@@ -32,5 +52,13 @@ export declare function punif<T extends Vectorizable>(q: T, options?: UniformPar
|
|
|
32
52
|
* @param p - Probability (or log probability with `logP`): a number, `number[]` or `Float64Array`. The result has the same shape.
|
|
33
53
|
* @param options - `min` and `max` (see {@link UniformParams}), `lowerTail` and `logP` (see {@link TailOptions}).
|
|
34
54
|
* @returns The quantile(s).
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* qunif(0.25); // 0.25
|
|
59
|
+
* qunif([0.1, 0.9], { min: -1, max: 1 }); // [-0.8, 0.8]
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @category Distributions
|
|
35
63
|
*/
|
|
36
64
|
export declare function qunif<T extends Vectorizable>(p: T, options?: UniformParams & TailOptions): VectorResult<T>;
|
|
@@ -61,6 +61,14 @@ export function qunif1(p, min, max, lowerTail, logP) {
|
|
|
61
61
|
* @param x - Value(s) at which to evaluate: a number, `number[]` or `Float64Array`. The result has the same shape.
|
|
62
62
|
* @param options - `min` and `max` (see {@link UniformParams}) and `log` (see {@link DensityOptions}).
|
|
63
63
|
* @returns The density (or log density).
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* dunif(0.5); // 1
|
|
68
|
+
* dunif([1, 3], { min: 0, max: 2 }); // [0.5, 0]
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @category Distributions
|
|
64
72
|
*/
|
|
65
73
|
export function dunif(x, options = {}) {
|
|
66
74
|
const { min = 0, max = 1, log = false } = options;
|
|
@@ -72,6 +80,14 @@ export function dunif(x, options = {}) {
|
|
|
72
80
|
* @param q - Quantile(s): a number, `number[]` or `Float64Array`. The result has the same shape.
|
|
73
81
|
* @param options - `min` and `max` (see {@link UniformParams}), `lowerTail` and `logP` (see {@link TailOptions}).
|
|
74
82
|
* @returns The probability (or log probability).
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* punif(0.3); // 0.3
|
|
87
|
+
* punif(1.5, { min: 1, max: 3 }); // 0.25
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @category Distributions
|
|
75
91
|
*/
|
|
76
92
|
export function punif(q, options = {}) {
|
|
77
93
|
const { min = 0, max = 1, lowerTail = true, logP = false } = options;
|
|
@@ -83,6 +99,14 @@ export function punif(q, options = {}) {
|
|
|
83
99
|
* @param p - Probability (or log probability with `logP`): a number, `number[]` or `Float64Array`. The result has the same shape.
|
|
84
100
|
* @param options - `min` and `max` (see {@link UniformParams}), `lowerTail` and `logP` (see {@link TailOptions}).
|
|
85
101
|
* @returns The quantile(s).
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* qunif(0.25); // 0.25
|
|
106
|
+
* qunif([0.1, 0.9], { min: -1, max: 1 }); // [-0.8, 0.8]
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @category Distributions
|
|
86
110
|
*/
|
|
87
111
|
export function qunif(p, options = {}) {
|
|
88
112
|
const { min = 0, max = 1, lowerTail = true, logP = false } = options;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type Vectorizable, type VectorResult } from "../internal/vectorize.js";
|
|
2
2
|
import { type DensityOptions, type TailOptions } from "../internal/dpq.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Parameters of the Weibull distribution (besides the positional `shape`).
|
|
5
|
+
*
|
|
6
|
+
* @category Distributions
|
|
7
|
+
*/
|
|
4
8
|
export interface WeibullParams {
|
|
5
9
|
/** Scale. Default `1`. */
|
|
6
10
|
scale?: number;
|
|
@@ -15,6 +19,14 @@ export declare function qweibull1(p: number, shape: number, scale: number, lower
|
|
|
15
19
|
* @param shape - Shape parameter.
|
|
16
20
|
* @param options - `scale` (see {@link WeibullParams}) and `log` (see {@link DensityOptions}).
|
|
17
21
|
* @returns The density (or log density).
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* dweibull(1, 2); // 0.7357588823428847
|
|
26
|
+
* dweibull(1, 2, { scale: 3 }); // 0.1988531815143044
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @category Distributions
|
|
18
30
|
*/
|
|
19
31
|
export declare function dweibull<T extends Vectorizable>(x: T, shape: number, options?: WeibullParams & DensityOptions): VectorResult<T>;
|
|
20
32
|
/**
|
|
@@ -24,6 +36,14 @@ export declare function dweibull<T extends Vectorizable>(x: T, shape: number, op
|
|
|
24
36
|
* @param shape - Shape parameter.
|
|
25
37
|
* @param options - `scale` (see {@link WeibullParams}), `lowerTail` and `logP` (see {@link TailOptions}).
|
|
26
38
|
* @returns The probability (or log probability).
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* pweibull(1, 2); // 0.6321205588285577
|
|
43
|
+
* pweibull(2, 1.5, { scale: 3 }); // 0.41977020402532716
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @category Distributions
|
|
27
47
|
*/
|
|
28
48
|
export declare function pweibull<T extends Vectorizable>(q: T, shape: number, options?: WeibullParams & TailOptions): VectorResult<T>;
|
|
29
49
|
/**
|
|
@@ -33,5 +53,13 @@ export declare function pweibull<T extends Vectorizable>(q: T, shape: number, op
|
|
|
33
53
|
* @param shape - Shape parameter.
|
|
34
54
|
* @param options - `scale` (see {@link WeibullParams}), `lowerTail` and `logP` (see {@link TailOptions}).
|
|
35
55
|
* @returns The quantile(s).
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* qweibull(0.5, 2); // 0.8325546111576977
|
|
60
|
+
* qweibull(0.9, 1.5, { scale: 3 }); // 5.231164540789235
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @category Distributions
|
|
36
64
|
*/
|
|
37
65
|
export declare function qweibull<T extends Vectorizable>(p: T, shape: number, options?: WeibullParams & TailOptions): VectorResult<T>;
|
|
@@ -94,6 +94,14 @@ export function qweibull1(p, shape, scale, lowerTail, logP) {
|
|
|
94
94
|
* @param shape - Shape parameter.
|
|
95
95
|
* @param options - `scale` (see {@link WeibullParams}) and `log` (see {@link DensityOptions}).
|
|
96
96
|
* @returns The density (or log density).
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* dweibull(1, 2); // 0.7357588823428847
|
|
101
|
+
* dweibull(1, 2, { scale: 3 }); // 0.1988531815143044
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @category Distributions
|
|
97
105
|
*/
|
|
98
106
|
export function dweibull(x, shape, options = {}) {
|
|
99
107
|
const { scale = 1, log = false } = options;
|
|
@@ -106,6 +114,14 @@ export function dweibull(x, shape, options = {}) {
|
|
|
106
114
|
* @param shape - Shape parameter.
|
|
107
115
|
* @param options - `scale` (see {@link WeibullParams}), `lowerTail` and `logP` (see {@link TailOptions}).
|
|
108
116
|
* @returns The probability (or log probability).
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* pweibull(1, 2); // 0.6321205588285577
|
|
121
|
+
* pweibull(2, 1.5, { scale: 3 }); // 0.41977020402532716
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* @category Distributions
|
|
109
125
|
*/
|
|
110
126
|
export function pweibull(q, shape, options = {}) {
|
|
111
127
|
const { scale = 1, lowerTail = true, logP = false } = options;
|
|
@@ -118,6 +134,14 @@ export function pweibull(q, shape, options = {}) {
|
|
|
118
134
|
* @param shape - Shape parameter.
|
|
119
135
|
* @param options - `scale` (see {@link WeibullParams}), `lowerTail` and `logP` (see {@link TailOptions}).
|
|
120
136
|
* @returns The quantile(s).
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* qweibull(0.5, 2); // 0.8325546111576977
|
|
141
|
+
* qweibull(0.9, 1.5, { scale: 3 }); // 5.231164540789235
|
|
142
|
+
* ```
|
|
143
|
+
*
|
|
144
|
+
* @category Distributions
|
|
121
145
|
*/
|
|
122
146
|
export function qweibull(p, shape, options = {}) {
|
|
123
147
|
const { scale = 1, lowerTail = true, logP = false } = options;
|
|
@@ -15,6 +15,14 @@ export declare function qwilcox1(p: number, m: number, n: number, lowerTail: boo
|
|
|
15
15
|
* @param n - Size of the second sample.
|
|
16
16
|
* @param options - `log` (see {@link DensityOptions}).
|
|
17
17
|
* @returns The probability (or log probability).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* dwilcox(5, 4, 6); // 0.02857142857142857
|
|
22
|
+
* dwilcox([0, 1, 2], 3, 4); // [0.02857142857142857, 0.02857142857142857, 0.05714285714285714]
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Distributions
|
|
18
26
|
*/
|
|
19
27
|
export declare function dwilcox<T extends Vectorizable>(x: T, m: number, n: number, options?: DensityOptions): VectorResult<T>;
|
|
20
28
|
/**
|
|
@@ -29,6 +37,14 @@ export declare function dwilcox<T extends Vectorizable>(x: T, m: number, n: numb
|
|
|
29
37
|
* @param n - Size of the second sample.
|
|
30
38
|
* @param options - `lowerTail` and `logP` (see {@link TailOptions}).
|
|
31
39
|
* @returns The probability (or log probability).
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* pwilcox(5, 4, 6); // 0.08571428571428572
|
|
44
|
+
* pwilcox(18, 4, 6, { lowerTail: false }); // 0.08571428571428572
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @category Distributions
|
|
32
48
|
*/
|
|
33
49
|
export declare function pwilcox<T extends Vectorizable>(q: T, m: number, n: number, options?: TailOptions): VectorResult<T>;
|
|
34
50
|
/**
|
|
@@ -43,5 +59,13 @@ export declare function pwilcox<T extends Vectorizable>(q: T, m: number, n: numb
|
|
|
43
59
|
* @param n - Size of the second sample.
|
|
44
60
|
* @param options - `lowerTail` and `logP` (see {@link TailOptions}).
|
|
45
61
|
* @returns The quantile(s).
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* qwilcox(0.025, 4, 6); // 3
|
|
66
|
+
* qwilcox([0.25, 0.75], 4, 6); // [9, 15]
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @category Distributions
|
|
46
70
|
*/
|
|
47
71
|
export declare function qwilcox<T extends Vectorizable>(p: T, m: number, n: number, options?: TailOptions): VectorResult<T>;
|
|
@@ -229,6 +229,14 @@ export function qwilcox1(p, m, n, lowerTail, logP) {
|
|
|
229
229
|
* @param n - Size of the second sample.
|
|
230
230
|
* @param options - `log` (see {@link DensityOptions}).
|
|
231
231
|
* @returns The probability (or log probability).
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```ts
|
|
235
|
+
* dwilcox(5, 4, 6); // 0.02857142857142857
|
|
236
|
+
* dwilcox([0, 1, 2], 3, 4); // [0.02857142857142857, 0.02857142857142857, 0.05714285714285714]
|
|
237
|
+
* ```
|
|
238
|
+
*
|
|
239
|
+
* @category Distributions
|
|
232
240
|
*/
|
|
233
241
|
export function dwilcox(x, m, n, options = {}) {
|
|
234
242
|
const log = options.log ?? false;
|
|
@@ -246,6 +254,14 @@ export function dwilcox(x, m, n, options = {}) {
|
|
|
246
254
|
* @param n - Size of the second sample.
|
|
247
255
|
* @param options - `lowerTail` and `logP` (see {@link TailOptions}).
|
|
248
256
|
* @returns The probability (or log probability).
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* ```ts
|
|
260
|
+
* pwilcox(5, 4, 6); // 0.08571428571428572
|
|
261
|
+
* pwilcox(18, 4, 6, { lowerTail: false }); // 0.08571428571428572
|
|
262
|
+
* ```
|
|
263
|
+
*
|
|
264
|
+
* @category Distributions
|
|
249
265
|
*/
|
|
250
266
|
export function pwilcox(q, m, n, options = {}) {
|
|
251
267
|
const { lowerTail = true, logP = false } = options;
|
|
@@ -263,6 +279,14 @@ export function pwilcox(q, m, n, options = {}) {
|
|
|
263
279
|
* @param n - Size of the second sample.
|
|
264
280
|
* @param options - `lowerTail` and `logP` (see {@link TailOptions}).
|
|
265
281
|
* @returns The quantile(s).
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* ```ts
|
|
285
|
+
* qwilcox(0.025, 4, 6); // 3
|
|
286
|
+
* qwilcox([0.25, 0.75], 4, 6); // [9, 15]
|
|
287
|
+
* ```
|
|
288
|
+
*
|
|
289
|
+
* @category Distributions
|
|
266
290
|
*/
|
|
267
291
|
export function qwilcox(p, m, n, options = {}) {
|
|
268
292
|
const { lowerTail = true, logP = false } = options;
|