@mark1russell7/rigor-statistics 0.1.26 → 0.1.27

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 CHANGED
@@ -191,7 +191,7 @@ logLoss([{ p: p.a, hit: true }]); // the probability of the obser
191
191
  | `spearman`, `kendallTau`, `ranks` | The rank correlations, with mean ranks for ties. |
192
192
  | `compareRatios`, `noiseFloor`, `noiseVerdict` | The comparison with a baseline, the noise floor of the 5-seed rule with a margin of practical effect, and the state of a difference over the seeds. |
193
193
  | `optionFloor({ sigma, delta, tests, alpha, power })`, `tQuantile(p, df)` | The fewest values for each of two options, so that one test of a Bonferroni family finds a difference of `delta` with the stated power, from the Student t law. It assumes unpaired groups of equal size and equal `sigma`. The quantile of the Student t law. |
194
- | `normalCdf(x)`, `normalQuantile(p)` | The distribution function of the standard normal law and its quantile (AS 241 of Wichura). Both keep their relative digits in the lower tail, to `p = 1e-300`. |
194
+ | `normalCdf(x)`, `normalQuantile(p)` | The distribution function of the standard normal law and its quantile (AS 241 of Wichura). They come from `rigor-generators`. Both keep their relative digits in the lower tail, to `p = 1e-300`. |
195
195
  | `modeCount(values, { minShare, valleyRatio })` | The count of the modes of a sample, from a kernel density estimate. |
196
196
  | `smoothLawScores(values)`, `bestSmoothLaw(values)` | The mean log density of the uniform, normal, exponential, log-normal and Pareto laws at their fits, and the best of them. |
197
197
  | `brier`, `calibration` | The Brier score of predictions, and the hit rate of each stated level. |
package/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import "@mark1russell7/rigor-generators";
1
+ import { normalCdf, normalQuantile } from "@mark1russell7/rigor-generators";
2
2
  /**
3
3
  * The descriptive statistics: the mean, the standard deviation, the median, the quantiles and a summary of a list.
4
4
  * Each function throws a RangeError for an empty list or for a value that is NaN. Thus a missing value cannot make a
@@ -1278,20 +1278,6 @@ interface OptionFloorOptions {
1278
1278
  * @returns A whole number of 2 or more.
1279
1279
  */
1280
1280
  export declare function optionFloor(options: OptionFloorOptions): number;
1281
- /**
1282
- * This function gives the distribution function of the standard normal law, `P(Z <= x)`. Its relative error is below
1283
- * 1e-14, also in the lower tail: `normalCdf(-37)` is approximately 5.7e-300, not 0.
1284
- *
1285
- * @param x - A number. `-Infinity` gives 0 and `Infinity` gives 1.
1286
- */
1287
- export declare function normalCdf(x: number): number;
1288
- /**
1289
- * This function gives the quantile of the standard normal law, the `x` with `normalCdf(x) = p`. It uses PPND16 of
1290
- * Wichura (algorithm AS 241). Its relative error is near 1e-16 for each `p` from 1e-300 to 1 - 1e-16.
1291
- *
1292
- * @param p - The share of the law below the result, from 0 to 1. A `p` of 0 gives `-Infinity` and 1 gives `Infinity`.
1293
- */
1294
- export declare function normalQuantile(p: number): number;
1295
1281
  /** One cell of a coverage study: the hits of a method on the true value in `draws` seeded samples of size `sample`. */
1296
1282
  interface CoverageCell {
1297
1283
  /** The name of the cell, for example `"skewed 120/108"`. The result names the rejected cells with it. */
@@ -1652,5 +1638,5 @@ interface BradleyTerryFit {
1652
1638
  * outcome, a bad weight and a bad option.
1653
1639
  */
1654
1640
  export declare function bradleyTerry(items: number, comparisons: readonly PairComparison[], options?: BradleyTerryOptions): BradleyTerryFit;
1655
- export type { BinomialSide, BootstrapOptions, BradleyTerryFit, BradleyTerryOptions, CalibrationLevel, CategoricalDimension, CompareOptions, Comparison, ContinuousDimension, Corrected, CountInterval, CoverageBar, CoverageCell, CoverageMinSample, CoverageReason, CoverageStep, Effect, EloOptions, EloUpdate, Forecast, Glicko2Game, Glicko2Options, Glicko2Rating, Interval, Kappa, LeastSquaresFit, LeastSquaresOptions, MedianInterval, ModeOptions, NoiseOptions, NoiseState, NoiseVerdict, OptionFloorOptions, OrdinalDimension, PairComparison, PairOutcome, PairProbabilities, ParsedResponseRecord, PermutationOptions, PermutationResult, Proportion, QuantileInterval, QuantileMethod, RatingScale, ResponseAbsentPoint, ResponseBand, ResponseCurvePoint, ResponseData, ResponseDimension, ResponseDimensionBase, ResponseFactor, ResponseFault, ResponseFitOptions, ResponseFold, ResponseFoldError, ResponseHeldOutError, ResponseInputValue, ResponseMeasure, ResponseModel, ResponseModelBase, ResponsePoint, ResponseReason, ResponseRecord, ResponseSlice, ResponseSliceOptions, ResponseSlicePoint, ResponseSurface, ResponseSurfaceAbsentPoint, ResponseSurfaceOptions, ResponseSurfacePoint, ResponseTableCell, ResponseValue, ResponseViewOptions, ResponseWhen, RidgeInput, RidgeInputBase, RidgeLevelInput, RidgeNumberInput, RidgeOptions, RidgeRankInput, RidgeResponseModel, RidgeTerm, RunningSummary, SampleTotalOptions, SideP, SignFlipOptions, SignFlipResult, SmoothLaw, SmoothLawScore, SobolIndex, SobolIndices, SobolOptions, Summary, TableResponseModel, TieModel, TwoSamplePermutationOptions, TwoSamplePermutationResult, UStatisticInterval, UStatisticMean, UStatisticMethod, UStatisticOptions };
1641
+ export { type BinomialSide, type BootstrapOptions, type BradleyTerryFit, type BradleyTerryOptions, type CalibrationLevel, type CategoricalDimension, type CompareOptions, type Comparison, type ContinuousDimension, type Corrected, type CountInterval, type CoverageBar, type CoverageCell, type CoverageMinSample, type CoverageReason, type CoverageStep, type Effect, type EloOptions, type EloUpdate, type Forecast, type Glicko2Game, type Glicko2Options, type Glicko2Rating, type Interval, type Kappa, type LeastSquaresFit, type LeastSquaresOptions, type MedianInterval, type ModeOptions, type NoiseOptions, type NoiseState, type NoiseVerdict, type OptionFloorOptions, type OrdinalDimension, type PairComparison, type PairOutcome, type PairProbabilities, type ParsedResponseRecord, type PermutationOptions, type PermutationResult, type Proportion, type QuantileInterval, type QuantileMethod, type RatingScale, type ResponseAbsentPoint, type ResponseBand, type ResponseCurvePoint, type ResponseData, type ResponseDimension, type ResponseDimensionBase, type ResponseFactor, type ResponseFault, type ResponseFitOptions, type ResponseFold, type ResponseFoldError, type ResponseHeldOutError, type ResponseInputValue, type ResponseMeasure, type ResponseModel, type ResponseModelBase, type ResponsePoint, type ResponseReason, type ResponseRecord, type ResponseSlice, type ResponseSliceOptions, type ResponseSlicePoint, type ResponseSurface, type ResponseSurfaceAbsentPoint, type ResponseSurfaceOptions, type ResponseSurfacePoint, type ResponseTableCell, type ResponseValue, type ResponseViewOptions, type ResponseWhen, type RidgeInput, type RidgeInputBase, type RidgeLevelInput, type RidgeNumberInput, type RidgeOptions, type RidgeRankInput, type RidgeResponseModel, type RidgeTerm, type RunningSummary, type SampleTotalOptions, type SideP, type SignFlipOptions, type SignFlipResult, type SmoothLaw, type SmoothLawScore, type SobolIndex, type SobolIndices, type SobolOptions, type Summary, type TableResponseModel, type TieModel, type TwoSamplePermutationOptions, type TwoSamplePermutationResult, type UStatisticInterval, type UStatisticMean, type UStatisticMethod, type UStatisticOptions, normalCdf, normalQuantile };
1656
1642
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/describe.ts","../src/running.ts","../src/regression.ts","../src/bootstrap.ts","../src/distribution.ts","../src/ridge.ts","../src/response.ts","../src/response-parse.ts","../src/response-fit.ts","../src/response-sobol.ts","../src/tests.ts","../src/agreement.ts","../src/rank.ts","../src/discrete.ts","../src/compare.ts","../src/power.ts","../src/normal.ts","../src/coverage.ts","../src/u-statistic.ts","../src/rating.ts","../src/bradley-terry.ts"],"mappings":";;;;;;;KAOY;;wBAmBI,OAAO;wBAIP,KAAK;;;;;wBAgBL,GAAG;;;;;;;wBAgBH,eAAe,iCAAiC,WAAW,SAAQ;;wBAkBnE,SAAS,2BAA2B,WAAW,SAAQ;;;;;wBASvD,OAAO;;UAQN;WACN;WACA;;WAEA;WACA;;WAEA;WACA;;WAEA;WACA;;WAEA;;wBAGK,UAAU,4BAA4B;;;;;;;;;;UCvGrC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;;qBAIE,eAAe;;;;;wBAMZ,aAAa,GAAG,gBAAgB,gBAAgB;;wBAWhD,UAAU,QAAQ,mBAAmB;;;;;wBAUrC,aAAa,GAAG,gBAAgB,GAAG,iBAAiB;;wBAep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AK,cAAc;;KCvFzE;;;;;;;qBAQC;;UAGI;;WAEN;;WAEA;;WAEA,QAAQ;;WAER;;WAEA,kBAAkB,aAAa;;;UAIzB;;WAEN;WACA;WACA;;;UAIM;;WAEN;WACA;WACA;WACA;;WAEA;;WAEA,WAAW;;WAEX,MAAM;;WAEN;;WAEA;;WAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmFK,mBAAmB,2BAA2B,SAAS,oBAAoB;;;;;;;UCrI1E;;WAEN;;WAEA;;WAEA;;;UAIM,mBAAmB;;WAEzB;;;UAIM;;WAEN;;WAEA;;WAEA;;;;;;wBAyBK,YAAY,YAAY,YAAY,UAAS;;;;;;wBAY7C,UAAU,YAAY,YAAY,eAAe,UAAS,aAAkB;;UAU3E;WACN;;WAEA;;WAEA;;;UAIM;WACN;WACA;;WAEA;;;UAIM;;WAEN;;WAEA;;;;;;;wBAmBK,cAAc,QAAQ,eAAe,gBAAgB,eAAe,UAAS,iBAAsB;;;;;wBAuEnG,YAAY,QAAQ,gBAAgB;;UAQnC;;WAEN;;WAEA;;WAEA;;;;;;;wBAuBK,kBAAkB,YAAY,YAAY,eAAU;;;;;wBAWpD,iBAAiB,kBAAkB,UAAS;;wBAO5C,iBAAiB,gBAAgB,UAAS;;KCtO9C;;UAGK;WACN;WACA;WACA,SAAS;;WAET;;;KAIC;;UAGK;;WAEN;;WAEA;;;;;WAKA,OAAO;;;;;WAKP;;WAEA;;WAEA;;;UAIM;;WAEN;;;;;WAKA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;;wBA6CK,aAAa,eAAe,sBAAsB,kBAAkB,UAAS,sBAA2B"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/describe.ts","../src/running.ts","../src/regression.ts","../src/bootstrap.ts","../src/distribution.ts","../src/ridge.ts","../src/response.ts","../src/response-parse.ts","../src/response-fit.ts","../src/response-sobol.ts","../src/tests.ts","../src/agreement.ts","../src/rank.ts","../src/discrete.ts","../src/compare.ts","../src/power.ts","../src/coverage.ts","../src/u-statistic.ts","../src/rating.ts","../src/bradley-terry.ts"],"mappings":";;;;;;;KAOY;;wBAmBI,OAAO;wBAIP,KAAK;;;;;wBAgBL,GAAG;;;;;;;wBAgBH,eAAe,iCAAiC,WAAW,SAAQ;;wBAkBnE,SAAS,2BAA2B,WAAW,SAAQ;;;;;wBASvD,OAAO;;UAQN;WACN;WACA;;WAEA;WACA;;WAEA;WACA;;WAEA;WACA;;WAEA;;wBAGK,UAAU,4BAA4B;;;;;;;;;;UCvGrC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;;qBAIE,eAAe;;;;;wBAMZ,aAAa,GAAG,gBAAgB,gBAAgB;;wBAWhD,UAAU,QAAQ,mBAAmB;;;;;wBAUrC,aAAa,GAAG,gBAAgB,GAAG,iBAAiB;;wBAepD,YAAY,GAAG;;;;;wBASf,UAAU,GAAG;;;;;;UCrEZ;;WAEN;;UAGM;;WAEN;;WAEA;;;;;WAKA;;WAEA;;WAEA;;;;;;;;;;;wBAkBK,aAAa,mCAAmC,sBAAsB,UAAS,sBAA2B;UC7BzG;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;;;;;WAMT;;;;;WAKA;;;UAIM;;WAEN;;WAEA;;WAEA;;UAGM,iBAAiB,QAAQ;;WAE/B;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;;;;;wBAOK,UAAU,GAAG,eAAe,KAAK,YAAY,iBAAiB,gBAAgB,UAAS,mBAAwB;;;;;;;;wBAsB/G,aAAa,GAAG,GAC9B,YAAY,KACZ,YAAY,KACZ,YAAY,YAAY,KAAK,YAAY,gBACzC,UAAS,mBACR;;;;;;wBAwBa,qBAAqB,8BAA8B,gCAAgC,UAAS,mBAAwB;;;;;;;wBAUpH,sBACd,mCACA,sBACA,UAAS,mBAAmB,sBAC3B;;wBAoGa,gBAAgB,2BAA2B,UAAS,mBAAwB;;;;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B;;UAQnC;;WAEN;;WAEA;;WAEA;;;;;;;wBAuBK,kBAAkB,YAAY,YAAY,eAAU;;;;;wBAWpD,iBAAiB,kBAAkB,UAAS;;wBAO5C,iBAAiB,gBAAgB,UAAS;;KCtO9C;;UAGK;WACN;WACA;WACA,SAAS;;WAET;;;KAIC;;UAGK;;WAEN;;WAEA;;;;;WAKA,OAAO;;;;;WAKP;;WAEA;;WAEA;;;UAIM;;WAEN;;;;;WAKA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;;wBA6CK,aAAa,eAAe,sBAAsB,kBAAkB,UAAS,sBAA2B"}
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { random } from "@mark1russell7/rigor-generators";
1
+ import { normalCdf, normalQuantile, random } from "@mark1russell7/rigor-generators";
2
2
  // src/describe.ts
3
3
  function checked(name, values) {
4
4
  if (values.length === 0) throw new RangeError(`${name}: the list is empty.`);
@@ -3366,162 +3366,6 @@ function optionFloor(options) {
3366
3366
  }
3367
3367
  throw new RangeError(`optionFloor: no count under 10,000,000 for sigma ${sigma} and delta ${delta}.`);
3368
3368
  }
3369
- // src/normal.ts
3370
- /**
3371
- * The standard normal law: its distribution function `normalCdf` and its quantile `normalQuantile`. The two functions
3372
- * keep their relative digits in the far tails, so a small tail probability does not become 0.
3373
- */
3374
- const SQRT_PI = Math.sqrt(Math.PI);
3375
- /** The series of `erf(z)` with positive terms, `2/√π · e^(-z²) · Σ (2z²)^n · z / (1·3·…·(2n+1))`, for a small `z` of 0 or more. */
3376
- function erfSeries(z) {
3377
- const twoZ2 = 2 * z * z;
3378
- let term = z;
3379
- let sum = z;
3380
- for (let n = 1; n < 500 && term > sum * 1e-17; n++) {
3381
- term *= twoZ2 / (2 * n + 1);
3382
- sum += term;
3383
- }
3384
- return 2 / SQRT_PI * expMinusSquare(z) * sum;
3385
- }
3386
- /**
3387
- * The continued fraction of `erfc(z)`, `e^(-z²)/√π · 1/(z + (1/2)/(z + 1/(z + (3/2)/(z + …))))`, by the method of
3388
- * Lentz, for a `z` of 1.5 or more.
3389
- */
3390
- function erfcFraction(z) {
3391
- const tiny = 1e-300;
3392
- let f = z;
3393
- let c = z;
3394
- let d = 0;
3395
- for (let n = 1; n < 5e3; n++) {
3396
- const a = n / 2;
3397
- d = z + a * d;
3398
- d = 1 / (Math.abs(d) < tiny ? tiny : d);
3399
- c = z + a / c;
3400
- if (Math.abs(c) < tiny) c = tiny;
3401
- const delta = c * d;
3402
- f *= delta;
3403
- if (Math.abs(delta - 1) < 1e-16) break;
3404
- }
3405
- return expMinusSquare(z) / (SQRT_PI * f);
3406
- }
3407
- /**
3408
- * The value of `e^(-z²)` with its relative digits for a large `z`. The rounding of `z²` costs `z²` ulps, so the
3409
- * function splits `z` into `hi + lo`. `hi` has 4 bits after the point, so `hi²` is exact.
3410
- */
3411
- function expMinusSquare(z) {
3412
- const hi = Math.round(z * 16) / 16;
3413
- const lo = z - hi;
3414
- return Math.exp(-hi * hi) * Math.exp(-lo * (z + hi));
3415
- }
3416
- /** The complementary error function `erfc(z) = 1 - erf(z)`, with its relative digits for a large `z`. */
3417
- function erfc(z) {
3418
- if (z < 0) return 2 - erfc(-z);
3419
- return z < 1.5 ? 1 - erfSeries(z) : erfcFraction(z);
3420
- }
3421
- /**
3422
- * This function gives the distribution function of the standard normal law, `P(Z <= x)`. Its relative error is below
3423
- * 1e-14, also in the lower tail: `normalCdf(-37)` is approximately 5.7e-300, not 0.
3424
- *
3425
- * @param x - A number. `-Infinity` gives 0 and `Infinity` gives 1.
3426
- */
3427
- function normalCdf(x) {
3428
- if (Number.isNaN(x)) throw new RangeError("normalCdf: x is NaN.");
3429
- if (x === Number.NEGATIVE_INFINITY) return 0;
3430
- if (x === Number.POSITIVE_INFINITY) return 1;
3431
- return erfc(-x / Math.SQRT2) / 2;
3432
- }
3433
- const A = [
3434
- 3.3871328727963665,
3435
- 133.14166789178438,
3436
- 1971.5909503065513,
3437
- 13731.69376550946,
3438
- 45921.95393154987,
3439
- 67265.7709270087,
3440
- 33430.57558358813,
3441
- 2509.0809287301227
3442
- ];
3443
- const B = [
3444
- 1,
3445
- 42.31333070160091,
3446
- 687.1870074920579,
3447
- 5394.196021424751,
3448
- 21213.794301586597,
3449
- 39307.89580009271,
3450
- 28729.085735721943,
3451
- 5226.495278852854
3452
- ];
3453
- const C = [
3454
- 1.4234371107496835,
3455
- 4.630337846156546,
3456
- 5.769497221460691,
3457
- 3.6478483247632045,
3458
- 1.2704582524523684,
3459
- .2417807251774506,
3460
- .022723844989269184,
3461
- .0007745450142783414
3462
- ];
3463
- const D = [
3464
- 1,
3465
- 2.053191626637759,
3466
- 1.6763848301838038,
3467
- .6897673349851,
3468
- .14810397642748008,
3469
- .015198666563616457,
3470
- .0005475938084995345,
3471
- 1.0507500716444169e-9
3472
- ];
3473
- const E = [
3474
- 6.657904643501103,
3475
- 5.463784911164114,
3476
- 1.7848265399172913,
3477
- .29656057182850487,
3478
- .026532189526576124,
3479
- .0012426609473880784,
3480
- 27115555687434876e-21,
3481
- 2.0103343992922881e-7
3482
- ];
3483
- const F = [
3484
- 1,
3485
- .599832206555888,
3486
- .1369298809227358,
3487
- .014875361290850615,
3488
- .0007868691311456133,
3489
- 18463183175100548e-21,
3490
- 1.421511758316446e-7,
3491
- 20442631033899397e-31
3492
- ];
3493
- /** The value of a polynomial with the coefficients `c[0] + c[1] x + …`, by the rule of Horner. */
3494
- function poly(c, x) {
3495
- let value = 0;
3496
- for (let i = c.length - 1; i >= 0; i--) value = value * x + c[i];
3497
- return value;
3498
- }
3499
- /**
3500
- * This function gives the quantile of the standard normal law, the `x` with `normalCdf(x) = p`. It uses PPND16 of
3501
- * Wichura (algorithm AS 241). Its relative error is near 1e-16 for each `p` from 1e-300 to 1 - 1e-16.
3502
- *
3503
- * @param p - The share of the law below the result, from 0 to 1. A `p` of 0 gives `-Infinity` and 1 gives `Infinity`.
3504
- */
3505
- function normalQuantile(p) {
3506
- if (!(p >= 0 && p <= 1)) throw new RangeError(`normalQuantile: p is from 0 to 1, not ${p}.`);
3507
- if (p === 0) return Number.NEGATIVE_INFINITY;
3508
- if (p === 1) return Number.POSITIVE_INFINITY;
3509
- const q = p - .5;
3510
- if (Math.abs(q) <= .425) {
3511
- const r = .180625 - q * q;
3512
- return q * poly(A, r) / poly(B, r);
3513
- }
3514
- let r = Math.sqrt(-Math.log(q < 0 ? p : 1 - p));
3515
- let value;
3516
- if (r <= 5) {
3517
- r -= 1.6;
3518
- value = poly(C, r) / poly(D, r);
3519
- } else {
3520
- r -= 5;
3521
- value = poly(E, r) / poly(F, r);
3522
- }
3523
- return q < 0 ? -value : value;
3524
- }
3525
3369
  // src/coverage.ts
3526
3370
  /**
3527
3371
  * The rule that finds the smallest sample at which an interval method keeps its level. The input is the hits of the