@zukhruf/statistics 0.8.176 → 0.8.177
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/README.md +4 -2
- package/dist/interval/confidence-interval-method.d.ts +1 -0
- package/dist/interval/confidence-interval-method.d.ts.map +1 -1
- package/dist/interval/percentile-interval.d.ts +1 -0
- package/dist/interval/percentile-interval.d.ts.map +1 -1
- package/dist/interval/percentile-interval.js +4 -0
- package/dist/interval/percentile-interval.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -51,8 +51,8 @@ nanmean([1, NaN, 3]); // 2, as numpy.nanmean(a)
|
|
|
51
51
|
| `InvertedCdf` | `method='inverted_cdf'` | The nearest rank: the value at the index `ceil(nq) − 1`, and the first value when `q` is 0. |
|
|
52
52
|
| `ConfidenceInterval` | the `ConfidenceInterval` of `scipy.stats.bootstrap` | `low` and `high`. `isAbove(value)` is true when `low > value`, and `isBelow(value)` is true when `high < value`: the whole interval lies on one side of the value. |
|
|
53
53
|
| `DifferenceInterval` | the `ConfidenceInterval` of `scipy.stats.bootstrap`, with the observed statistic | A `ConfidenceInterval` of (change − baseline) with `observed`: the difference that the data gives. `new DifferenceInterval(low, high, observed)` makes one. It is data only: it has no verdict. mteb's `ChangeVerdict`, the `Interval` of relevance-filtering and the `Interval` of event-detection hold the same three values. `@zukhruf/evals` gives it in each verdict of two runs. |
|
|
54
|
-
| `ConfidenceIntervalMethod` | the `method` of `scipy.stats.bootstrap` | A rule that gives the confidence interval of a bootstrap distribution: `of(distribution)
|
|
55
|
-
| `PercentileInterval` | `method='percentile'` of `scipy.stats.bootstrap` | The `low` and the `high` quantile of a bootstrap distribution, both read with one quantile method, as `numpy.percentile` reads them. It sorts a copy, so the distribution does not change.
|
|
54
|
+
| `ConfidenceIntervalMethod` | the `method` of `scipy.stats.bootstrap` | A rule that gives the confidence interval of a bootstrap distribution: `of(distribution)`, and states its `level`, the share of the distribution that the interval covers, such as 0.95 (`confidence_level` of SciPy). `PercentileInterval` is one. A caller with a rule of its own writes another. |
|
|
55
|
+
| `PercentileInterval` | `method='percentile'` of `scipy.stats.bootstrap` | The `low` and the `high` quantile of a bootstrap distribution, both read with one quantile method, as `numpy.percentile` reads them. It sorts a copy, so the distribution does not change. Its `level` is `high` minus `low`. |
|
|
56
56
|
| `IidBootstrap` | `arch.bootstrap.IIDBootstrap`; `n_resamples` and `bootstrap_distribution` of SciPy | Draws `nResamples` resamples of the data, with replacement. `distribution(data, statistic)` gives the statistic of each resample. `interval(data, statistic, method)` gives the interval that a `ConfidenceIntervalMethod` reads from that distribution. Data with no items throws a `RangeError`. |
|
|
57
57
|
|
|
58
58
|
The random generator is an input. `randomIndex(n)` gives an index from 0 to n − 1. Each item of a resample takes one call, in order, resample by resample, as a Python loop over the same generator does. So `(n) => random.randrange(n)` of python-random draws as CPython's `random.Random`, and a port of NumPy's `default_rng` draws as `integers(0, n, n)` when it draws one index for each call. An index out of range throws a `RangeError`.
|
|
@@ -136,6 +136,7 @@ class DifferenceInterval extends ConfidenceInterval {
|
|
|
136
136
|
|
|
137
137
|
// The method of scipy.stats.bootstrap. Exported as a type only.
|
|
138
138
|
interface ConfidenceIntervalMethod {
|
|
139
|
+
readonly level: number;
|
|
139
140
|
of(distribution: readonly number[]): ConfidenceInterval;
|
|
140
141
|
}
|
|
141
142
|
|
|
@@ -145,6 +146,7 @@ class PercentileInterval implements ConfidenceIntervalMethod {
|
|
|
145
146
|
readonly high: number;
|
|
146
147
|
readonly method: QuantileMethod;
|
|
147
148
|
});
|
|
149
|
+
get level(): number;
|
|
148
150
|
of(distribution: readonly number[]): ConfidenceInterval;
|
|
149
151
|
}
|
|
150
152
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confidence-interval-method.d.ts","sourceRoot":"","sources":["../../src/interval/confidence-interval-method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAInE,MAAM,WAAW,wBAAwB;
|
|
1
|
+
{"version":3,"file":"confidence-interval-method.d.ts","sourceRoot":"","sources":["../../src/interval/confidence-interval-method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAInE,MAAM,WAAW,wBAAwB;IAIvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,EAAE,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,kBAAkB,CAAC;CACzD"}
|
|
@@ -8,6 +8,7 @@ export declare class PercentileInterval implements ConfidenceIntervalMethod {
|
|
|
8
8
|
readonly high: number;
|
|
9
9
|
readonly method: QuantileMethod;
|
|
10
10
|
});
|
|
11
|
+
get level(): number;
|
|
11
12
|
of(distribution: readonly number[]): ConfidenceInterval;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=percentile-interval.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percentile-interval.d.ts","sourceRoot":"","sources":["../../src/interval/percentile-interval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAM9D,qBAAa,kBAAmB,YAAW,wBAAwB;;IAKjE,YAAY,EACV,GAAG,EACH,IAAI,EACJ,MAAM,GACP,EAAE;QACD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;KACjC,EAIA;IAED,EAAE,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,kBAAkB,CAMtD;CACF"}
|
|
1
|
+
{"version":3,"file":"percentile-interval.d.ts","sourceRoot":"","sources":["../../src/interval/percentile-interval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAM9D,qBAAa,kBAAmB,YAAW,wBAAwB;;IAKjE,YAAY,EACV,GAAG,EACH,IAAI,EACJ,MAAM,GACP,EAAE;QACD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;KACjC,EAIA;IAGD,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,EAAE,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,kBAAkB,CAMtD;CACF"}
|
|
@@ -12,6 +12,10 @@ export class PercentileInterval {
|
|
|
12
12
|
this.#high = high;
|
|
13
13
|
this.#method = method;
|
|
14
14
|
}
|
|
15
|
+
// A percentile interval covers what lies between its two quantiles.
|
|
16
|
+
get level() {
|
|
17
|
+
return this.#high - this.#low;
|
|
18
|
+
}
|
|
15
19
|
of(distribution) {
|
|
16
20
|
const sorted = distribution.toSorted((a, b) => a - b);
|
|
17
21
|
return new ConfidenceInterval(this.#method.of(sorted, this.#low), this.#method.of(sorted, this.#high));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percentile-interval.js","sourceRoot":"","sources":["../../src/interval/percentile-interval.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,uEAAuE;AACvE,4EAA4E;AAC5E,6EAA6E;AAC7E,YAAY;AACZ,MAAM,OAAO,kBAAkB;IACpB,IAAI,CAAS;IACb,KAAK,CAAS;IACd,OAAO,CAAiB;IAEjC,YAAY,EACV,GAAG,EACH,IAAI,EACJ,MAAM,GAKP;QACC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,EAAE,CAAC,YAA+B;QAChC,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACtD,OAAO,IAAI,kBAAkB,CAC3B,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAClC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CACpC,CAAC;IACJ,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"percentile-interval.js","sourceRoot":"","sources":["../../src/interval/percentile-interval.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,uEAAuE;AACvE,4EAA4E;AAC5E,6EAA6E;AAC7E,YAAY;AACZ,MAAM,OAAO,kBAAkB;IACpB,IAAI,CAAS;IACb,KAAK,CAAS;IACd,OAAO,CAAiB;IAEjC,YAAY,EACV,GAAG,EACH,IAAI,EACJ,MAAM,GAKP;QACC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,oEAAoE;IACpE,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,EAAE,CAAC,YAA+B;QAChC,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACtD,OAAO,IAAI,kBAAkB,CAC3B,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAClC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CACpC,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/statistics",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.177",
|
|
4
4
|
"description": "The percentile bootstrap, NumPy's quantile methods, and the sum, mean, nanmean and std of NumPy in JavaScript, to the last bit: resamples with a random generator that the caller gives, the percentile interval of their statistic, and NumPy's pairwise sum.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -43,6 +43,6 @@
|
|
|
43
43
|
"@stdlib/blas-ext-base-gsumpw": "^0.3.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@zukhruf/parameterized-test": "^0.8.
|
|
46
|
+
"@zukhruf/parameterized-test": "^0.8.177"
|
|
47
47
|
}
|
|
48
48
|
}
|