@mark1russell7/rigor-statistics 0.1.6 → 0.1.8

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
@@ -1,6 +1,6 @@
1
1
  # @mark1russell7/rigor-statistics
2
2
 
3
- The statistics of measured work. It gives quantiles, bootstrap intervals, the sign test, the paired permutation test, Wilson intervals and the Holm correction. It gives the interval of a median from order statistics, and the central interval of a binomial count. It also gives least squares, rank correlation, the comparison with a baseline beyond the noise, and the Brier score of predictions.
3
+ The statistics of measured work. It gives quantiles, bootstrap intervals, the sign test, the paired permutation test, Wilson intervals and the Holm correction. It gives the interval of a median from order statistics, and the central interval of a binomial count. It also gives least squares, rank correlation, the comparison with a baseline beyond the noise, and the Brier score of predictions. It fits response records that a browser can evaluate from plain JSON.
4
4
 
5
5
  ```sh
6
6
  npm install @mark1russell7/rigor-statistics
@@ -26,6 +26,78 @@ v.state; // "gain", "loss", "noise" or "
26
26
 
27
27
  A promotion reads `gains` against `drops` and `effect`. A sign test alone is not enough, because it counts a win of any size. Judge a change of a default against the current default, not against "no change".
28
28
 
29
+ ## Fit and show a response
30
+
31
+ The format `response-records/1` keeps the measured points of a study, a model for each measure and the held-out error of each fold. A record is plain JSON, and the functions use no Node API. Thus a browser reads a record and evaluates its models.
32
+
33
+ ```ts
34
+ import { fitResponse, parseResponseRecord, sliceResponse } from "@mark1russell7/rigor-statistics";
35
+
36
+ const record = fitResponse(
37
+ {
38
+ schema: "response-records/1",
39
+ name: "time of a placement",
40
+ dimensions: [
41
+ { id: "boxes", label: "Boxes", kind: "continuous", range: [10, 10000], unit: "", log: true },
42
+ { id: "strategy", label: "Strategy", kind: "categorical", levels: ["shelf", "skyline"], unit: "" },
43
+ // Only the arm "skyline" has this parameter. Each other point has null.
44
+ { id: "depth", label: "Depth", kind: "continuous", range: [1, 8], unit: "", when: { dimension: "strategy", levels: ["skyline"] } },
45
+ ],
46
+ measures: [{ id: "ms", label: "Time", unit: "ms", direction: "lower" }],
47
+ points, // { id, values, measures, group }: repeats of one input have one group
48
+ },
49
+ { log: ["ms"], logFloor: 0.001 },
50
+ );
51
+
52
+ // A server writes the text. A browser reads it, and it asks for one dimension with the other dimensions held.
53
+ const text = JSON.stringify(record);
54
+ const parsed = parseResponseRecord(JSON.parse(text));
55
+ if (!parsed.ok) throw new Error(JSON.stringify(parsed.faults));
56
+ const slice = sliceResponse(parsed.record, "ms", { vary: "depth", hold: { boxes: 1000 } });
57
+ slice.curve; // { at, value, low, high, nearest } along the dimension
58
+ slice.points; // the measured points with the held values
59
+ slice.error; // the held-out error of the folds
60
+ ```
61
+
62
+ A test of this package compiles and starts this example, and it examines that the two texts are equal.
63
+
64
+ `fitResponse` keeps all the points of one `group` in one fold, so repeats of a group are not on both sides of a split. Each fold chooses its penalty from the other folds only. The folds thus measure the prediction of an unseen group.
65
+
66
+ There are two kinds of model. A `ridge` model is a sum of weighted terms. Each term is a product of powers of number inputs and one-hot columns of levels. A `table` model has one cell for each combination of levels. `fitResponse` gives a table when each dimension is categorical, and a ridge model in other cases.
67
+
68
+ A dimension with `when` is conditional: only some levels of its parent have the dimension. This suits a benchmark in which each arm has its own parameters. A point at another level has `null`. In a ridge model, a term with an absent dimension is 0, so the columns of the parent carry the mean of that level. A table keeps `null` in its cells. For each kind of model, `predictResponse` refuses `null` at a dimension with no condition.
69
+
70
+ To vary a conditional dimension, `sliceResponse` needs its parent at a level inside `when`. With no held value, the parent takes the most common level inside `when`. A held conditional dimension reads `null` when its parent is outside `when`.
71
+
72
+ The band of a curve is `value ± width × RMSE`, from the held-out error of the folds. On a log scale, the band is a ratio. The band has one width along the curve. It is the mean error of the model.
73
+
74
+ The field `nearest` of each place tells how far the place is from a measurement. It goes from 0 to 1, and 0 means that a point was measured there. A viewer can fade the band away from the data. A table cell with the `fallback` value has `nearest` above 0.
75
+
76
+ ### The error of one cell
77
+
78
+ Each fold keeps one error for each measure. To get the error of a chosen set of points, fit with the option `outOfFold`. Each fold then stores the prediction of each held-out point with a value, on the scale of the model. The default is off, and a record with no option has the same bytes as a record of an earlier version.
79
+
80
+ `heldOutErrorAt(record, "ms", ids)` gives the fields of `heldOutError` for these points. The baseline of a point is the mean of the training points of its fold. The set of all the points gives the pooled error of the folds, to the rounding of the sums. A test examines this at 24 seeds, with a relative tolerance of 1e-12.
81
+
82
+ ### The reason that a measure is absent
83
+
84
+ A measure with `null` has no value. To tell why, declare the reasons in the field `reasons` of the data. Then map the measure to a reason in the field `absent` of the point:
85
+
86
+ ```json
87
+ {
88
+ "reasons": [{ "id": "budget", "label": "Out of budget" }],
89
+ "points": [{ "id": "p7", "values": { "boxes": 10000 }, "measures": { "ms": null }, "absent": { "ms": "budget" } }]
90
+ }
91
+ ```
92
+
93
+ `parseResponseRecord` refuses a reason on a measure with a number, and a reason with no declaration. A measure with `null` and no reason is good. `fitResponse` treats each of them as `null`, and it keeps the reasons in the record.
94
+
95
+ `sliceResponse` and `surfaceResponse` give these points in a list `absent`, beside the list `points`. Each item has `id`, `at`, `reason` and `group`. The value of `reason` is `null` when the point states no reason. Thus a chart can draw each reason apart.
96
+
97
+ ### Many levels with few pairs
98
+
99
+ The default expansion has one product for each pair of levels of two dimensions. Two dimensions with 76 and 33 levels thus give 2508 products, and the limit `RESPONSE_MAX_TERMS` refuses them. With the option `interactions: "seen"`, a ridge fit keeps only the terms that are not 0 at one point or more. This choice looks only at the inputs of the points. A term with no point has the weight 0, so the choice does not change a prediction. The limit applies after the choice.
100
+
29
101
  ## The functions
30
102
 
31
103
  | Function | What it gives |
@@ -48,6 +120,11 @@ A promotion reads `gains` against `drops` and `effect`. A sign test alone is not
48
120
  | `spearman`, `kendallTau`, `ranks` | The rank correlations, with mean ranks for ties. |
49
121
  | `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. |
50
122
  | `brier`, `calibration` | The Brier score of predictions, and the hit rate of each stated level. |
123
+ | `fitResponse(data, options)` | A record of the format `response-records/1`, with one model for each measure and held-out folds. |
124
+ | `parseResponseRecord(value)` | The examination of unknown data. It gives the record, or one fault with a path for each error. |
125
+ | `predictResponse(model, inputs)`, `heldOutError(record, measure)` | The value of a model at one set of inputs, and the error of the folds of a measure. |
126
+ | `heldOutErrorAt(record, measure, ids)` | The held-out error of a chosen set of points, from the predictions of the option `outOfFold`. |
127
+ | `sliceResponse(record, measure, options)`, `surfaceResponse(record, measure, options)` | A fitted curve over one dimension, or a fitted surface over two, with the matching measured points, the matching points with no value, a band and the distance to the nearest measurement. |
51
128
 
52
129
  Each function throws a RangeError for an empty list, for a NaN and for a parameter out of its range. Thus a missing value cannot make a quiet NaN in a record.
53
130
 
package/build/index.d.ts CHANGED
@@ -161,6 +161,492 @@ interface RidgeOptions {
161
161
  * `k` is 0. It also throws for a value that is not finite, for a `lambda` below 0, and for a bad free index.
162
162
  */
163
163
  export declare function ridgeSolve(gram: ArrayLike<number>, moment: ArrayLike<number>, lambda: number, options?: RidgeOptions): number[];
164
+ /** The value of the field `schema` of a record. */
165
+ export declare const RESPONSE_RECORDS_SCHEMA = "response-records/1";
166
+ /** The value of a dimension at a point: a number, or the text of a level. */
167
+ type ResponseValue = number | string;
168
+ /** The value of a dimension at a place. The value `null` means that a conditional dimension is absent there. */
169
+ type ResponseInputValue = ResponseValue | null;
170
+ /** The condition of a dimension: the dimension has a value only at these levels of its parent. */
171
+ interface ResponseWhen {
172
+ /** The id of the parent: a categorical or ordinal dimension with no condition. */
173
+ readonly dimension: string;
174
+ readonly levels: readonly ResponseValue[];
175
+ }
176
+ /** The fields of each kind of dimension. */
177
+ interface ResponseDimensionBase {
178
+ /** The key of the dimension in the values of a point. */
179
+ readonly id: string;
180
+ /** The name that a view shows. */
181
+ readonly label: string;
182
+ /** The unit. An empty string means that the dimension has no unit. */
183
+ readonly unit: string;
184
+ /** With this field, a point has a value only at the stated levels of the parent. Each other point has `null`. */
185
+ readonly when?: ResponseWhen;
186
+ }
187
+ /** A dimension with each number in a range. */
188
+ interface ContinuousDimension extends ResponseDimensionBase {
189
+ readonly kind: "continuous";
190
+ /** The smallest and the largest value. The first is less than the second. */
191
+ readonly range: readonly [number, number];
192
+ /** When true, a model and an axis use the base-10 logarithm of the value. All of the range is above 0. */
193
+ readonly log?: boolean;
194
+ }
195
+ /** A dimension with levels in order. Number levels ascend. A model reads a text level as its position. */
196
+ interface OrdinalDimension extends ResponseDimensionBase {
197
+ readonly kind: "ordinal";
198
+ readonly levels: readonly number[] | readonly string[];
199
+ /** When true, a model uses the base-10 logarithm of the level. The levels are numbers above 0. */
200
+ readonly log?: boolean;
201
+ }
202
+ /** A dimension with levels that have no order, for example the arms of a benchmark. */
203
+ interface CategoricalDimension extends ResponseDimensionBase {
204
+ readonly kind: "categorical";
205
+ readonly levels: readonly string[];
206
+ }
207
+ /** A dimension of a record. */
208
+ type ResponseDimension = ContinuousDimension | OrdinalDimension | CategoricalDimension;
209
+ /** A measured value of each point. */
210
+ interface ResponseMeasure {
211
+ /** The key of the measure in the measures of a point. */
212
+ readonly id: string;
213
+ readonly label: string;
214
+ /** The unit. An empty string means that the measure has no unit. */
215
+ readonly unit: string;
216
+ /** The better direction of the value. The value `none` means that no direction is better. */
217
+ readonly direction: "higher" | "lower" | "none";
218
+ }
219
+ /** A declared reason that a measure is absent, for example infeasible, unsupported or out of budget. */
220
+ interface ResponseReason {
221
+ /** The key of the reason in the field `absent` of a point. */
222
+ readonly id: string;
223
+ /** The name that a view shows. */
224
+ readonly label: string;
225
+ }
226
+ /** One measured point. */
227
+ interface ResponsePoint {
228
+ readonly id: string;
229
+ /** The value of each dimension. */
230
+ readonly values: Readonly<Record<string, ResponseInputValue>>;
231
+ /** The value of each measure. The value `null` means that the run did not give the measure at this point. */
232
+ readonly measures: Readonly<Record<string, number | null>>;
233
+ /** The points of one group stay on one side of each split, for example the repeats of one seed. */
234
+ readonly group?: string;
235
+ /** The reason of a measure with `null`: a map from the id of the measure to the id of a declared reason. */
236
+ readonly absent?: Readonly<Record<string, string>>;
237
+ }
238
+ /** One factor of a term: a power of a number dimension, or 1 at a level and 0 at each other level. */
239
+ type ResponseFactor = {
240
+ readonly dimension: string;
241
+ readonly power: number;
242
+ } | {
243
+ readonly dimension: string;
244
+ readonly level: ResponseValue;
245
+ };
246
+ /** The fields of each kind of input of a ridge model. */
247
+ interface RidgeInputBase {
248
+ readonly dimension: string;
249
+ /** When true, the dimension is conditional, so `null` is a good value. Each term of an absent dimension is 0. */
250
+ readonly conditional?: boolean;
251
+ }
252
+ /** The coordinate of a number dimension: the value (or its logarithm), less `center`, divided by `spread`. */
253
+ interface RidgeNumberInput extends RidgeInputBase {
254
+ readonly kind: "number";
255
+ readonly center: number;
256
+ readonly spread: number;
257
+ readonly log?: boolean;
258
+ }
259
+ /** The coordinate of an ordinal dimension with text levels: the position of the level, as in `RidgeNumberInput`. */
260
+ interface RidgeRankInput extends RidgeInputBase {
261
+ readonly kind: "rank";
262
+ readonly levels: readonly string[];
263
+ readonly center: number;
264
+ readonly spread: number;
265
+ }
266
+ /** A categorical dimension: the factors of its levels are the one-hot columns. */
267
+ interface RidgeLevelInput extends RidgeInputBase {
268
+ readonly kind: "level";
269
+ readonly levels: readonly string[];
270
+ }
271
+ /** An input of a ridge model. The model holds it, so `predictResponse` needs no record. */
272
+ type RidgeInput = RidgeNumberInput | RidgeRankInput | RidgeLevelInput;
273
+ /** A term of a ridge model: the product of its factors, times the weight. */
274
+ interface RidgeTerm {
275
+ readonly factors: readonly ResponseFactor[];
276
+ readonly weight: number;
277
+ }
278
+ /** The fields of each kind of model. */
279
+ interface ResponseModelBase {
280
+ /** The id of the measure of the model. */
281
+ readonly measure: string;
282
+ /** With `log`, the model and the held-out errors use the base-10 logarithm of the measure. */
283
+ readonly scale: "linear" | "log";
284
+ /** With the scale `log`, the fit gave this value to each smaller measured value. */
285
+ readonly floor?: number;
286
+ }
287
+ /** A ridge fit over a stated expansion: the intercept, plus the sum of the terms. */
288
+ interface RidgeResponseModel extends ResponseModelBase {
289
+ readonly kind: "ridge";
290
+ /** The penalty of the fit. */
291
+ readonly lambda: number;
292
+ readonly inputs: readonly RidgeInput[];
293
+ readonly intercept: number;
294
+ readonly terms: readonly RidgeTerm[];
295
+ }
296
+ /** One cell of a table model. */
297
+ interface ResponseTableCell {
298
+ /** The value of each dimension of the table, in the order of its `dimensions`. An absent dimension has `null`. */
299
+ readonly at: readonly ResponseInputValue[];
300
+ /** The mean of the measured values of the cell, on the scale of the model. */
301
+ readonly value: number;
302
+ /** The number of points of the cell. */
303
+ readonly n: number;
304
+ }
305
+ /** The mean of each measured combination of levels. */
306
+ interface TableResponseModel extends ResponseModelBase {
307
+ readonly kind: "table";
308
+ readonly dimensions: readonly string[];
309
+ /** The ids of the dimensions of the table with a condition. Only these dimensions take `null`. */
310
+ readonly conditional?: readonly string[];
311
+ readonly cells: readonly ResponseTableCell[];
312
+ /** The value of a combination with no cell: the mean of all the fitted points, on the scale of the model. */
313
+ readonly fallback: number;
314
+ }
315
+ /** A model that a browser evaluates from plain JSON. */
316
+ type ResponseModel = RidgeResponseModel | TableResponseModel;
317
+ /** The held-out error of one measure in one fold, on the scale of the model. */
318
+ interface ResponseFoldError {
319
+ /** The number of held-out points with a value of the measure. */
320
+ readonly n: number;
321
+ /** The mean absolute error. */
322
+ readonly mae: number;
323
+ /** The root mean square error. */
324
+ readonly rmse: number;
325
+ /** The mean absolute error of the mean of the training points, used as the prediction. */
326
+ readonly baselineMae: number;
327
+ }
328
+ /** One split of the points. The fold held out `heldOut`, and it fit a model on the other points. */
329
+ interface ResponseFold {
330
+ /** The ids of the held-out points. */
331
+ readonly heldOut: readonly string[];
332
+ /** The error of each measure. A measure with no held-out point or no training point has no entry. */
333
+ readonly errors: Readonly<Record<string, ResponseFoldError>>;
334
+ /**
335
+ * The prediction of each held-out point with a value, on the scale of the model. The keys are the id of the measure,
336
+ * then the id of the point. The model of this fold gave them. Only the option `outOfFold` of `fitResponse` writes this field.
337
+ */
338
+ readonly predictions?: Readonly<Record<string, Readonly<Record<string, number>>>>;
339
+ }
340
+ /** The data of a record, before a fit. */
341
+ interface ResponseData {
342
+ readonly schema: typeof RESPONSE_RECORDS_SCHEMA;
343
+ readonly name: string;
344
+ readonly dimensions: readonly ResponseDimension[];
345
+ readonly measures: readonly ResponseMeasure[];
346
+ /** The reasons that a measure of a point can be absent. Each id in the field `absent` of a point is in this list. */
347
+ readonly reasons?: readonly ResponseReason[];
348
+ readonly points: readonly ResponsePoint[];
349
+ }
350
+ /** A record: the data, one model for each measure, and the folds. */
351
+ interface ResponseRecord extends ResponseData {
352
+ readonly models: readonly ResponseModel[];
353
+ readonly folds: readonly ResponseFold[];
354
+ }
355
+ /** The held-out error of one measure over all the folds, on the scale of the model. */
356
+ interface ResponseHeldOutError {
357
+ /** The number of held-out points. */
358
+ readonly n: number;
359
+ /** The number of folds with this measure. */
360
+ readonly folds: number;
361
+ /** The mean absolute error of all the held-out points. */
362
+ readonly mae: number;
363
+ /** The root mean square error of all the held-out points. */
364
+ readonly rmse: number;
365
+ /** The mean absolute error of the baseline. */
366
+ readonly baselineMae: number;
367
+ /** The value `1 - mae / baselineMae`. The value 0 is no better than the mean. A baseline of 0 gives `null`. */
368
+ readonly skill: number | null;
369
+ }
370
+ /** The options of `sliceResponse` and `surfaceResponse`. */
371
+ interface ResponseViewOptions {
372
+ /** The value of each held dimension. Each other dimension takes its usual value, as `sliceResponse` tells. */
373
+ readonly hold?: Readonly<Record<string, ResponseInputValue>>;
374
+ /** The number of values on a continuous axis, 2 or more. The default is 33. */
375
+ readonly steps?: number;
376
+ /**
377
+ * The share of the range of a held number dimension in which a point matches. A log dimension uses the log scale.
378
+ * The default is 0: only an equal value matches.
379
+ */
380
+ readonly tolerance?: number;
381
+ /** The half width of the band, as a multiple of the held-out root mean square error. The default is 1. */
382
+ readonly width?: number;
383
+ }
384
+ /** The options of `sliceResponse`. */
385
+ interface ResponseSliceOptions extends ResponseViewOptions {
386
+ /** The id of the dimension of the curve. */
387
+ readonly vary: string;
388
+ }
389
+ /** The options of `surfaceResponse`. */
390
+ interface ResponseSurfaceOptions extends ResponseViewOptions {
391
+ /** The ids of the two dimensions of the surface: first the x axis, then the y axis. */
392
+ readonly vary: readonly [string, string];
393
+ }
394
+ /**
395
+ * The fitted value at one place, with its band. The band is the mean error of the model, and `nearest` tells how far
396
+ * the place is from a measurement.
397
+ */
398
+ interface ResponseBand {
399
+ readonly value: number;
400
+ readonly low: number;
401
+ readonly high: number;
402
+ /**
403
+ * The distance from this place to the nearest measured point with a value of the measure, from 0 to 1. The value 0
404
+ * means that a point was measured here. A number or rank dimension counts as its share of the axis. A different
405
+ * categorical level counts 1, and an absent value against a present value counts 1. The distance is the largest
406
+ * count over the dimensions.
407
+ */
408
+ readonly nearest: number;
409
+ }
410
+ /** One place of a curve. */
411
+ interface ResponseCurvePoint extends ResponseBand {
412
+ /** The value of the varied dimension. */
413
+ readonly at: ResponseValue;
414
+ }
415
+ /** A measured point of a slice. */
416
+ interface ResponseSlicePoint {
417
+ readonly id: string;
418
+ /** The value of the varied dimension. */
419
+ readonly at: ResponseValue;
420
+ readonly value: number;
421
+ readonly group?: string;
422
+ }
423
+ /** A point of a slice that matches the held values and has no value of the measure. */
424
+ interface ResponseAbsentPoint {
425
+ readonly id: string;
426
+ /** The value of the varied dimension. */
427
+ readonly at: ResponseValue;
428
+ /** The id of the declared reason. The value `null` means that the point states no reason. */
429
+ readonly reason: string | null;
430
+ readonly group?: string;
431
+ }
432
+ /** The fitted curve over one dimension, and the measured points that match the held values. */
433
+ interface ResponseSlice {
434
+ readonly measure: string;
435
+ readonly vary: string;
436
+ /** The value of each other dimension. */
437
+ readonly held: Readonly<Record<string, ResponseInputValue>>;
438
+ readonly curve: readonly ResponseCurvePoint[];
439
+ readonly points: readonly ResponseSlicePoint[];
440
+ /** The points that match the held values and have no value of the measure, each with its reason. */
441
+ readonly absent: readonly ResponseAbsentPoint[];
442
+ readonly error: ResponseHeldOutError;
443
+ }
444
+ /** A measured point of a surface. */
445
+ interface ResponseSurfacePoint {
446
+ readonly id: string;
447
+ /** The values of the two varied dimensions. */
448
+ readonly at: readonly [ResponseValue, ResponseValue];
449
+ readonly value: number;
450
+ readonly group?: string;
451
+ }
452
+ /** A point of a surface that matches the held values and has no value of the measure. */
453
+ interface ResponseSurfaceAbsentPoint {
454
+ readonly id: string;
455
+ /** The values of the two varied dimensions. */
456
+ readonly at: readonly [ResponseValue, ResponseValue];
457
+ /** The id of the declared reason. The value `null` means that the point states no reason. */
458
+ readonly reason: string | null;
459
+ readonly group?: string;
460
+ }
461
+ /** The fitted surface over two dimensions, and the measured points that match the held values. */
462
+ interface ResponseSurface {
463
+ readonly measure: string;
464
+ readonly vary: readonly [string, string];
465
+ /** The value of each other dimension. */
466
+ readonly held: Readonly<Record<string, ResponseInputValue>>;
467
+ readonly x: readonly ResponseValue[];
468
+ readonly y: readonly ResponseValue[];
469
+ /** One row for each value of `y`. Each row has one cell for each value of `x`. */
470
+ readonly cells: readonly (readonly ResponseBand[])[];
471
+ readonly points: readonly ResponseSurfacePoint[];
472
+ /** The points that match the held values and have no value of the measure, each with its reason. */
473
+ readonly absent: readonly ResponseSurfaceAbsentPoint[];
474
+ readonly error: ResponseHeldOutError;
475
+ }
476
+ /**
477
+ * This function gives the value of a model at `inputs`, on the scale of the measure. The inputs have a value for each
478
+ * dimension that the model reads. An absent conditional dimension has `null`. A table model gives its `fallback` for a
479
+ * combination with no cell.
480
+ *
481
+ * The function throws a RangeError for a missing input and for a value that is not a number or a level of the model.
482
+ * It throws for `null` at a dimension with no condition, for each kind of model. It also throws for a value at or below
483
+ * 0 on a log scale. A number outside the range of the record is good, so the
484
+ * function extrapolates.
485
+ */
486
+ export declare function predictResponse(model: ResponseModel, inputs: Readonly<Record<string, ResponseInputValue>>): number;
487
+ /**
488
+ * This function gives the held-out error of a measure over all the folds. Each point has the same weight, so a small
489
+ * fold has a small effect. The function throws a RangeError when no fold has the measure.
490
+ */
491
+ export declare function heldOutError(record: Pick<ResponseRecord, "folds">, measure: string): ResponseHeldOutError;
492
+ /**
493
+ * This function gives the held-out error of a chosen set of points, on the scale of the model. It uses the stored
494
+ * predictions of the option `outOfFold`. Thus a reader can get the error of one cell. The result has the fields of
495
+ * `heldOutError`, and the set of all the points gives the same values to the rounding of the sums.
496
+ *
497
+ * Each point counts at most once. A point with no value of the measure, or with no prediction, adds nothing to `n`.
498
+ * The baseline of a point is the mean of the training points of its fold.
499
+ *
500
+ * The function throws a RangeError for an unknown measure and for a record with no predictions of the measure. It
501
+ * also throws for an unknown id, for a repeated id, and for a set with no point to score.
502
+ */
503
+ export declare function heldOutErrorAt(record: ResponseRecord, measure: string, ids: readonly string[]): ResponseHeldOutError;
504
+ /**
505
+ * This function gives a view of a measure over one dimension of a parsed record:
506
+ * - `curve`: the fitted value at each level, or at `steps` values of a continuous dimension, with its band.
507
+ * - `points`: the measured points that match the held values. This list is empty when no point matches them.
508
+ * - `absent`: the points that match the held values and have no value of the measure, each with its reason. A chart
509
+ * can draw each reason apart.
510
+ * - `held`: the value of each other dimension.
511
+ * - `error`: the held-out error.
512
+ *
513
+ * Each dimension with no value in `hold` takes its usual value. For a continuous dimension, this value is the median
514
+ * of its measured values. For the other kinds, it is the most common level, and a tie gives the first level.
515
+ *
516
+ * A conditional dimension follows its parent:
517
+ * - To vary a conditional dimension, the parent needs a level inside `when`. With no held value, the parent takes the
518
+ * most common level inside `when`. A held level outside `when` is a RangeError.
519
+ * - A held conditional dimension reads `null` in `held` when its parent is outside `when`, also with a value in `hold`.
520
+ * The points that match have `null` at this dimension.
521
+ * - When the parent varies, a held conditional dimension keeps its value in `held`. Each place outside `when` reads
522
+ * `null` for the fit, and for the matching points.
523
+ *
524
+ * The band is the fitted value, plus and less `width` times the held-out root mean square error. On a log scale, this
525
+ * distance is on the log scale of the model, so the band is a ratio. The band has one width along all the curve. The
526
+ * band is the mean error of the model, and `nearest` tells how far the place is from a measurement.
527
+ *
528
+ * The function throws a RangeError for an unknown measure or dimension, and for a held value that is not good for its
529
+ * dimension. It also throws for a dimension that is both varied and held, and for a bad option.
530
+ */
531
+ export declare function sliceResponse(record: ResponseRecord, measure: string, options: ResponseSliceOptions): ResponseSlice;
532
+ /**
533
+ * This function gives the view of `sliceResponse` over two dimensions. The fields `x` and `y` are the two axes, and
534
+ * `cells` has one row for each value of `y`. The rules of the held values, of the matching points and of the band are
535
+ * the rules of `sliceResponse`. The function also throws a RangeError when the two varied dimensions are one dimension.
536
+ * It throws when a conditional dimension varies with its parent, and when two varied dimensions need no common level.
537
+ */
538
+ export declare function surfaceResponse(record: ResponseRecord, measure: string, options: ResponseSurfaceOptions): ResponseSurface;
539
+ /** The largest power of a factor. A larger power of a coordinate from -1 to 1 adds almost nothing to a model. */
540
+ export declare const RESPONSE_MAX_POWER = 8;
541
+ /** One fault of a record. */
542
+ interface ResponseFault {
543
+ /** The place of the fault, for example `points[3].values.size`. An empty string is the record itself. */
544
+ readonly path: string;
545
+ /** What is wrong, and what the format needs. */
546
+ readonly message: string;
547
+ }
548
+ /** The result of `parseResponseRecord`: the record, or each fault that the validator found. */
549
+ type ParsedResponseRecord = {
550
+ readonly ok: true;
551
+ readonly record: ResponseRecord;
552
+ } | {
553
+ readonly ok: false;
554
+ readonly faults: readonly ResponseFault[];
555
+ };
556
+ /**
557
+ * This function examines unknown data, for example the result of `JSON.parse`, against `response-records/1`. It gives
558
+ * `{ ok: true, record }`, with the same object as the record, or `{ ok: false, faults }`. Each fault has the path of
559
+ * the bad field and a message. The function does not throw. Data that the checks cannot read, for example an object
560
+ * with a loop, gives one fault.
561
+ *
562
+ * A field that the format does not have is a fault. Thus a wrong spelling of an optional field cannot go unseen.
563
+ *
564
+ * The function examines the models and the folds only when the data has no fault, because they refer to the data.
565
+ * Thus a correction of the data can show more faults. These rules apply to the folds:
566
+ * - A point is in one fold or in no fold.
567
+ * - All the points of a group are in one fold, or all are in no fold. Thus no group is on both sides of a split.
568
+ * - The count `n` of an error is the number of held-out points with a value of the measure.
569
+ * - Each measure has an error in one fold or more.
570
+ *
571
+ * These rules apply to the predictions of a fold:
572
+ * - Each prediction is a finite number of a held-out point of the fold with a value of the measure.
573
+ * - The fold has a prediction of each such point, and an error of the measure.
574
+ * - When one fold has predictions of a measure, each fold with an error of the measure has them.
575
+ *
576
+ * These rules apply to the reasons of a point:
577
+ * - Each reason is on a known measure with no number. A measure with `null` and no reason is good.
578
+ * - Each reason has a declaration in the field `reasons` of the record.
579
+ */
580
+ export declare function parseResponseRecord(value: unknown): ParsedResponseRecord;
581
+ /** The options of `fitResponse`. */
582
+ interface ResponseFitOptions {
583
+ /** The number of folds, 3 or more. With fewer groups, each group is one fold. The default is 5. */
584
+ readonly folds?: number;
585
+ /** The seed of the split. The default is 1. */
586
+ readonly seed?: number | string;
587
+ /** The kind of model. The default `auto` gives a table when each dimension is categorical, and a ridge fit otherwise. */
588
+ readonly model?: "auto" | "ridge" | "table";
589
+ /** The largest total power of a term of a ridge fit, from 1 to 8. The default is 2. */
590
+ readonly degree?: number;
591
+ /**
592
+ * When true, a ridge fit also has the products of two dimensions, up to `degree`. The default is true. The value
593
+ * false also removes the products of a conditional dimension with the levels of its parent. Thus this option is the
594
+ * way out of the limit `RESPONSE_MAX_TERMS`.
595
+ *
596
+ * The value `seen` is the expansion of true, with only the terms that are not 0 at one point or more. Thus a sparse
597
+ * product of two large sets of levels keeps only the pairs with points. The limit applies after this choice.
598
+ */
599
+ readonly interactions?: boolean | "seen";
600
+ /** The stated terms of a ridge fit, in place of `degree` and `interactions`. */
601
+ readonly terms?: readonly (readonly ResponseFactor[])[];
602
+ /** The penalties that a ridge fit chooses from, each above 0. The default is `RESPONSE_LAMBDAS`. */
603
+ readonly lambdas?: readonly number[];
604
+ /** The ids of the measures to fit on a log scale. */
605
+ readonly log?: readonly string[];
606
+ /** On a log scale, each smaller value takes this value. With no floor, a value of 0 or less is an error. */
607
+ readonly logFloor?: number;
608
+ /**
609
+ * When true, each fold stores the prediction of each held-out point with a value. Then `heldOutErrorAt` gives the error of
610
+ * a chosen set of points. The default is false, and the record then has no field `predictions`.
611
+ */
612
+ readonly outOfFold?: boolean;
613
+ }
614
+ /** The default penalties of a ridge fit. The coordinates are from -1 to 1, so one list suits each record. */
615
+ export declare const RESPONSE_LAMBDAS: readonly number[];
616
+ /** The largest number of coefficients of a ridge fit. The memory of each fold grows as the square of this number. */
617
+ export declare const RESPONSE_MAX_TERMS = 1024;
618
+ /**
619
+ * This function fits each measure of `data`, and it gives a record with the models and the folds.
620
+ *
621
+ * The split: the groups, sorted and then shuffled with `seed`, go to the folds in turn. A point with no group is a
622
+ * group of its own. Thus the repeats of one group are not on both sides of a split. The same split applies to each
623
+ * measure. A record needs 3 groups or more.
624
+ *
625
+ * The model: a ridge fit over a stated expansion, or the mean of each cell of a table. The default expansion has
626
+ * each power of each number dimension up to `degree`. It has one column for each level of a categorical dimension.
627
+ * It also has the products of two dimensions up to `degree`. Each coordinate goes from -1 to 1 over the declared
628
+ * range. The intercept has no penalty.
629
+ *
630
+ * A conditional dimension: a term with an absent dimension is 0. Thus the columns of the parent carry the mean of each
631
+ * level with no value. A dimension with two parent levels or more also has each power times each of these levels, if
632
+ * `interactions` is true. A table keeps `null` as a level of its cells.
633
+ *
634
+ * The penalty: each fold of a ridge fit chooses from `lambdas` with the other folds. Thus the held-out error of a
635
+ * fold is not optimistic. The model of the record chooses with all the folds.
636
+ *
637
+ * The errors: a fold scores the model of the other folds on its held-out points, on the scale of the model. With the
638
+ * option `outOfFold`, the fold also stores the prediction of each of these points.
639
+ *
640
+ * The reasons: a measure with a stated reason is `null` for the fit. The field `reasons` of the data stays in the record.
641
+ *
642
+ * The result does not depend on the order of the points, except for the field `points`, which keeps the order of
643
+ * the data. The same data and options give the same bytes in one JavaScript engine.
644
+ *
645
+ * The function throws a RangeError for data with a fault, for a bad option, and for fewer than 3 groups. It also
646
+ * throws for a measure with no value, and for a measure with all its values in one fold. It throws for a value of 0
647
+ * or less on a log scale with no `logFloor`. It throws for more than `RESPONSE_MAX_TERMS` terms.
648
+ */
649
+ export declare function fitResponse(data: ResponseData, options?: ResponseFitOptions): ResponseRecord;
164
650
  /**
165
651
  * The sign test of paired results: `better` inputs where the candidate wins and `worse` where it loses. The ties
166
652
  * do not count. One-sided (the default), it is the p of `better` wins or more if the two are equal. Two-sided, it is
@@ -382,5 +868,5 @@ interface CalibrationLevel {
382
868
  }
383
869
  /** The hit rate of each stated level, from the lowest level. */
384
870
  export declare function calibration(forecasts: readonly Forecast[]): CalibrationLevel[];
385
- export type { BootstrapOptions, CalibrationLevel, CompareOptions, Comparison, Corrected, CountInterval, Effect, Forecast, Interval, LeastSquaresFit, LeastSquaresOptions, MedianInterval, NoiseOptions, NoiseState, NoiseVerdict, PermutationOptions, PermutationResult, Proportion, QuantileMethod, RidgeOptions, Summary };
871
+ export type { BootstrapOptions, CalibrationLevel, CategoricalDimension, CompareOptions, Comparison, ContinuousDimension, Corrected, CountInterval, Effect, Forecast, Interval, LeastSquaresFit, LeastSquaresOptions, MedianInterval, NoiseOptions, NoiseState, NoiseVerdict, OrdinalDimension, ParsedResponseRecord, PermutationOptions, PermutationResult, Proportion, QuantileMethod, 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, Summary, TableResponseModel };
386
872
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/describe.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A;;WAEA;;;;;;;wBAQK,KAAK,4BAA4B,iBAAe;UAa/C;;WAEN;;WAEA;;WAEA,aAAa;;UAGP;;WAEN;;WAEA;WACA;;;;;;wBAOK,kBAAkB,8BAA8B,6BAA6B,UAAS,qBAA0B;;wBCtHhH,MAAM;;;;;wBAgBN,SAAS,sBAAsB;;qBAmBlC;;;;;;wBAQG,WAAW,sBAAsB,sBAAsB;;UC1BtD;WACN;WACA;;WAEA;;WAEA;;;;;;;;;;wBAWK,eAAe,2BAA2B,iBAAe;;UAqBxD;WACN;WACA;;WAEA;;;;;;;wBAQK,iBAAiB,WAAW,WAAW,iBAAe;;;;;;wBA2BtD,yBAAyB,mBAAmB,WAAW,iBAAe;UClGrE;;WAEN;;WAEA;;;;;;WAMA;;;;;;wBAgBK,WAAW,2BAA2B,UAAS;;;;;KASnD;;UAGK;;WAEN;WACA;;WAEA;;WAEA;WACA;;WAEA;WACA,OAAO;;;;;;;;wBASF,aAAa,2BAA2B,UAAS;WAA0B;IAAqC;UAW/G;;WAEN;;WAEA;;WAEA;;;UAIM;WACN;WACA;;WAEA;;WAEA;;UAGM;;WAEN;WACA;;WAEA;;WAEA;;WAEA;;WAEA,QAAQ;;WAER;;WAEA;;WAEA;WACA,cAAc;;WAEd;WACA,cAAc;;;;;;;;wBAST,cAAc,2BAA2B,UAAS,iBAAsB;;UA6CvE;WACN;WACA;;;wBASK,MAAM,oBAAoB;;UAQzB;WACN;WACA;WACA;;WAEA;;WAEA,UAAU;;;wBAIL,YAAY,oBAAoB,aAAa"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/describe.ts","../src/regression.ts","../src/bootstrap.ts","../src/ridge.ts","../src/response.ts","../src/response-parse.ts","../src/response-fit.ts","../src/tests.ts","../src/rank.ts","../src/discrete.ts","../src/compare.ts"],"mappings":";;;;;;KAOY;;wBAmBI,OAAO;wBAIP,KAAK;;;;;wBAgBL,GAAG;;;;;;;wBAgBH,eAAe,iCAAiC,WAAW,SAAQ;;wB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