@compstats/core 0.2.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/LICENSE +21 -0
  3. package/README.md +310 -0
  4. package/dist/3d.d.ts +33 -0
  5. package/dist/3d.d.ts.map +1 -0
  6. package/dist/3d.js +1984 -0
  7. package/dist/3d.js.map +22 -0
  8. package/dist/core/arith.d.ts +133 -0
  9. package/dist/core/arith.d.ts.map +1 -0
  10. package/dist/core/frame.d.ts +98 -0
  11. package/dist/core/frame.d.ts.map +1 -0
  12. package/dist/core/histogram.d.ts +68 -0
  13. package/dist/core/histogram.d.ts.map +1 -0
  14. package/dist/core/kde.d.ts +106 -0
  15. package/dist/core/kde.d.ts.map +1 -0
  16. package/dist/core/logit.d.ts +109 -0
  17. package/dist/core/logit.d.ts.map +1 -0
  18. package/dist/core/matrix.d.ts +135 -0
  19. package/dist/core/matrix.d.ts.map +1 -0
  20. package/dist/core/moderation.d.ts +127 -0
  21. package/dist/core/moderation.d.ts.map +1 -0
  22. package/dist/core/ols.d.ts +76 -0
  23. package/dist/core/ols.d.ts.map +1 -0
  24. package/dist/core/pca.d.ts +99 -0
  25. package/dist/core/pca.d.ts.map +1 -0
  26. package/dist/core/precision.d.ts +10 -0
  27. package/dist/core/precision.d.ts.map +1 -0
  28. package/dist/core/pretty.d.ts +51 -0
  29. package/dist/core/pretty.d.ts.map +1 -0
  30. package/dist/core/regression.d.ts +68 -0
  31. package/dist/core/regression.d.ts.map +1 -0
  32. package/dist/core/rng.d.ts +206 -0
  33. package/dist/core/rng.d.ts.map +1 -0
  34. package/dist/core/sampling.d.ts +157 -0
  35. package/dist/core/sampling.d.ts.map +1 -0
  36. package/dist/core/special.d.ts +92 -0
  37. package/dist/core/special.d.ts.map +1 -0
  38. package/dist/core/tdist.d.ts +53 -0
  39. package/dist/core/tdist.d.ts.map +1 -0
  40. package/dist/core/ttest.d.ts +146 -0
  41. package/dist/core/ttest.d.ts.map +1 -0
  42. package/dist/data/moderationData.d.ts +40 -0
  43. package/dist/data/moderationData.d.ts.map +1 -0
  44. package/dist/data/pcaDegenerate.d.ts +18 -0
  45. package/dist/data/pcaDegenerate.d.ts.map +1 -0
  46. package/dist/index.d.ts +66 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +4195 -0
  49. package/dist/index.js.map +47 -0
  50. package/dist/interactive/controls.d.ts +97 -0
  51. package/dist/interactive/controls.d.ts.map +1 -0
  52. package/dist/interactive/logit.d.ts +57 -0
  53. package/dist/interactive/logit.d.ts.map +1 -0
  54. package/dist/interactive/matrixInverse.d.ts +86 -0
  55. package/dist/interactive/matrixInverse.d.ts.map +1 -0
  56. package/dist/interactive/moderation3d.d.ts +103 -0
  57. package/dist/interactive/moderation3d.d.ts.map +1 -0
  58. package/dist/interactive/pca.d.ts +90 -0
  59. package/dist/interactive/pca.d.ts.map +1 -0
  60. package/dist/interactive/regression.d.ts +57 -0
  61. package/dist/interactive/regression.d.ts.map +1 -0
  62. package/dist/interactive/sampling.d.ts +78 -0
  63. package/dist/interactive/sampling.d.ts.map +1 -0
  64. package/dist/interactive/scatter3d.d.ts +124 -0
  65. package/dist/interactive/scatter3d.d.ts.map +1 -0
  66. package/dist/interactive/tTest.d.ts +69 -0
  67. package/dist/interactive/tTest.d.ts.map +1 -0
  68. package/dist/interactive/target.d.ts +132 -0
  69. package/dist/interactive/target.d.ts.map +1 -0
  70. package/dist/plot/axes.d.ts +128 -0
  71. package/dist/plot/axes.d.ts.map +1 -0
  72. package/dist/plot/draw.d.ts +46 -0
  73. package/dist/plot/draw.d.ts.map +1 -0
  74. package/dist/plot/format.d.ts +33 -0
  75. package/dist/plot/format.d.ts.map +1 -0
  76. package/dist/plot/logit.d.ts +68 -0
  77. package/dist/plot/logit.d.ts.map +1 -0
  78. package/dist/plot/matrixInverse.d.ts +62 -0
  79. package/dist/plot/matrixInverse.d.ts.map +1 -0
  80. package/dist/plot/moderation3d.d.ts +135 -0
  81. package/dist/plot/moderation3d.d.ts.map +1 -0
  82. package/dist/plot/pca.d.ts +79 -0
  83. package/dist/plot/pca.d.ts.map +1 -0
  84. package/dist/plot/plotly.d.ts +209 -0
  85. package/dist/plot/plotly.d.ts.map +1 -0
  86. package/dist/plot/regression.d.ts +52 -0
  87. package/dist/plot/regression.d.ts.map +1 -0
  88. package/dist/plot/sampleCi.d.ts +82 -0
  89. package/dist/plot/sampleCi.d.ts.map +1 -0
  90. package/dist/plot/sampling.d.ts +159 -0
  91. package/dist/plot/sampling.d.ts.map +1 -0
  92. package/dist/plot/scatter3d.d.ts +164 -0
  93. package/dist/plot/scatter3d.d.ts.map +1 -0
  94. package/dist/plot/tTest.d.ts +49 -0
  95. package/dist/plot/tTest.d.ts.map +1 -0
  96. package/dist/plot/target.d.ts +55 -0
  97. package/dist/plot/target.d.ts.map +1 -0
  98. package/package.json +71 -0
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Drawing samples and reading confidence intervals off them — the statistics
3
+ * of `plot_sampling()` and `plot_sample_ci()` in `../compstatslib/R/`.
4
+ *
5
+ * Both demonstrations rest on the same idea: a statistic computed from a
6
+ * sample is itself a random quantity, and drawing many samples shows how it
7
+ * scatters. `plot_sampling()` draws repeatedly and accumulates the statistic;
8
+ * `plot_sample_ci()` draws once and asks how often an interval built from a
9
+ * sample covers the mean it was drawn from.
10
+ *
11
+ * Two rules shape this module, both from the port plan:
12
+ *
13
+ * - **The generator is an argument, and one call threads one generator.** R
14
+ * reads a global stream, which a pure core cannot. `drawSamples` takes
15
+ * exactly `reps * sampleSize` values from the generator it is given, in
16
+ * draw order, so a caller who holds the generator can keep drawing where
17
+ * the last call stopped. Restarting the generator per repetition would
18
+ * return the same sample every time.
19
+ * - **Accumulation belongs to the caller.** R's `plot_sampling()` returns a
20
+ * `vars` list holding every statistic drawn so far, and its interactive
21
+ * wrapper hands that back on the next call. This module takes one draw's
22
+ * inputs and returns one draw's outputs; nothing is kept between calls.
23
+ *
24
+ * Verified against R 4.5.3 in `sampling.test.ts` for the interval arithmetic.
25
+ * The drawn values cannot be checked against R and are not meant to be: a
26
+ * seeded JavaScript generator does not reproduce R's Mersenne Twister.
27
+ */
28
+ import { type Rng } from "./rng";
29
+ /** What one call to `drawSamples` should do. */
30
+ export interface DrawSamplesOptions {
31
+ /** How many values to take per sample. R's `sample_size`. */
32
+ readonly sampleSize: number;
33
+ /** How many samples to draw in this call. R's `reps`, default 1. */
34
+ readonly reps?: number;
35
+ /**
36
+ * The statistic to compute from each sample. R's `theta`, default the mean.
37
+ * Any function of a sample will do — the median, a trimmed mean, a range.
38
+ */
39
+ readonly theta?: (sample: readonly number[]) => number;
40
+ }
41
+ /** One draw: the samples themselves and the statistic of each. */
42
+ export interface SampleDraw {
43
+ /**
44
+ * The samples, in draw order. R holds these as the columns of a matrix, so
45
+ * flattening this array gives the same order R's `as.vector()` does — which
46
+ * is what to hand `kernelDensity` when pooling them.
47
+ */
48
+ readonly samples: readonly (readonly number[])[];
49
+ /** The statistic of each sample, in the same order. */
50
+ readonly thetas: readonly number[];
51
+ }
52
+ /** A pair of bounds. */
53
+ export interface Interval {
54
+ readonly low: number;
55
+ readonly high: number;
56
+ }
57
+ /** What one sample says about the mean it was drawn from. */
58
+ export interface SampleInterval {
59
+ /** The sample mean. */
60
+ readonly mean: number;
61
+ /** The sample standard deviation, with R's n − 1 denominator. */
62
+ readonly sd: number;
63
+ /** The standard error, `sd / sqrt(sampleSize)`. */
64
+ readonly standardError: number;
65
+ /** The 95% interval, `mean ± 1.96 * standardError`. */
66
+ readonly ci95: Interval;
67
+ /** The 99% interval, `mean ± 2.58 * standardError`. */
68
+ readonly ci99: Interval;
69
+ /**
70
+ * Whether either interval misses the population mean — R's `bad` set, one
71
+ * sample at a time. R collects the positions where this holds.
72
+ */
73
+ readonly excludesPopulationMean: boolean;
74
+ }
75
+ /** How to simulate a population. R's `distr_func` with its `...` bound in. */
76
+ export type DistributionFn = (rng: Rng, n: number) => number[];
77
+ /** What one call to `simulateSampleCi` should do. R's own defaults. */
78
+ export interface SampleCiOptions {
79
+ /** How many samples to draw. R's `num_samples`, default 100. */
80
+ readonly numSamples?: number;
81
+ /** How many values per sample. R's `sample_size`, default 100. */
82
+ readonly sampleSize?: number;
83
+ /** How many values in the simulated population. R's `pop_size`, 10000. */
84
+ readonly popSize?: number;
85
+ /**
86
+ * How to draw the population. R's `distr_func`, default `rnorm` with its
87
+ * own defaults, a standard normal. A caller who wants R's
88
+ * `plot_sample_ci(distr_func = runif, min = 17, max = 35)` passes
89
+ * `(rng, n) => runif(rng, n, { min: 17, max: 35 })`, which is what R's
90
+ * `...` pass-through amounts to.
91
+ */
92
+ readonly distribution?: DistributionFn;
93
+ }
94
+ /** The simulated population's statistics and every sample's interval. */
95
+ export interface SampleCiSimulation {
96
+ /** The mean of the drawn population. R draws its vertical line here. */
97
+ readonly populationMean: number;
98
+ /** The spread of the drawn population. R's window is this wide, halved. */
99
+ readonly populationSd: number;
100
+ /** One entry per sample, in draw order. */
101
+ readonly intervals: readonly SampleInterval[];
102
+ }
103
+ /**
104
+ * Draw samples from a population and compute a statistic from each.
105
+ *
106
+ * This is R's `replicate(reps, sample(population, sample_size))` followed by
107
+ * `apply(samples, FUN = theta, MARGIN = 2)`. Sampling is without replacement,
108
+ * as R's `sample()` is by default, so a value appears at most once within a
109
+ * sample — though the same value can appear in several samples.
110
+ *
111
+ * @param rng The source of randomness. The call takes exactly
112
+ * `reps * sampleSize` values from it.
113
+ * @param population The values to draw from. The function does not modify
114
+ * them.
115
+ * @param options The sample size, how many samples, and the statistic.
116
+ * @returns The samples in draw order and the statistic of each.
117
+ * @throws RangeError If `reps` or `sampleSize` is negative or fractional, or
118
+ * if `sampleSize` is larger than the population — the last from
119
+ * `sampleWithoutReplacement`, which is where R's own refusal lives.
120
+ */
121
+ export declare function drawSamples(rng: Rng, population: readonly number[], options: DrawSamplesOptions): SampleDraw;
122
+ /**
123
+ * Read a confidence interval off each sample.
124
+ *
125
+ * The multipliers are R's own literal 1.96 and 2.58, not quantiles of any
126
+ * distribution. That matters: 2.58 is not `qnorm(0.995)` to more than three
127
+ * digits, and a port that "corrected" it would draw slightly different bars
128
+ * from the R original the demonstration is taught beside.
129
+ *
130
+ * A sample of one gives NaN throughout, because its standard deviation is
131
+ * undefined — R reports NA there and drops it from the `bad` set, and NaN
132
+ * comparisons being false does the same thing here.
133
+ *
134
+ * @param samples The samples, each already drawn.
135
+ * @param populationMean The mean the samples were drawn from, which the
136
+ * intervals are asked to cover.
137
+ * @returns One entry per sample, in the order given.
138
+ */
139
+ export declare function sampleConfidenceIntervals(samples: readonly (readonly number[])[], populationMean: number): SampleInterval[];
140
+ /**
141
+ * Simulate a population, sample it many times, and interval each sample.
142
+ *
143
+ * This is the whole of `plot_sample_ci()` except the drawing. The population
144
+ * is simulated rather than given, which is the point of the demonstration:
145
+ * the true mean is known, so a student can count how many intervals miss it.
146
+ *
147
+ * The call takes the population's draws from the generator first, then each
148
+ * sample's, so a caller replaying one seed gets one simulation.
149
+ *
150
+ * @param rng The source of randomness, threaded through the whole call.
151
+ * @param options The sizes and the population's distribution.
152
+ * @returns The population's mean and spread, and every sample's interval.
153
+ * @throws RangeError If a count is negative or fractional, or if the sample
154
+ * size is larger than the population.
155
+ */
156
+ export declare function simulateSampleCi(rng: Rng, options?: SampleCiOptions): SampleCiSimulation;
157
+ //# sourceMappingURL=sampling.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sampling.d.ts","sourceRoot":"","sources":["../../src/core/sampling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAmC,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAalE,gDAAgD;AAChD,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,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ACH,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,CAAC;CACxC;AAED,yEAAyE;AACzE,MAAM,WAAW,kBAAkB;IACjC,wEAAwE;IACxE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,EAAE,kBAAkB,GAC1B,UAAU,CAWZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,EACvC,cAAc,EAAE,MAAM,GACrB,cAAc,EAAE,CAyBlB;AAcD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,GAAG,EACR,OAAO,GAAE,eAAoB,GAC5B,kBAAkB,CAsBpB"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Special functions that the statistics in `core/` build on.
3
+ *
4
+ * JavaScript has no `lgamma` and no incomplete beta, so the distribution
5
+ * functions need them here. R gets the same quantities from its own C
6
+ * routines; this module is the port's replacement.
7
+ *
8
+ * Every function is pure. None of them touch the DOM or hold state.
9
+ */
10
+ /**
11
+ * The natural log of the gamma function, R's `lgamma()`.
12
+ *
13
+ * @param x A positive number.
14
+ * @returns log Γ(x), or NaN if x is zero or less.
15
+ */
16
+ export declare function logGamma(x: number): number;
17
+ /**
18
+ * The natural log of the beta function, R's `lbeta()`.
19
+ *
20
+ * The obvious route, `logGamma(a) + logGamma(b) - logGamma(a + b)`, subtracts
21
+ * numbers near 600 for the degrees of freedom this package plots, and loses
22
+ * about three digits doing so. Expanding the Lanczos form first cancels the
23
+ * large terms by hand: the exponential parts collapse to the constant
24
+ * −(g − ½), and the logarithmic parts become ratios that stay of order one.
25
+ * What is left has no cancellation at all.
26
+ *
27
+ * Both ratios go through `log1p`. Each one sits just below 1, and taking the
28
+ * quotient first would round away the small part that the log then reads —
29
+ * a loss that grows with the larger argument, reaching 1e-13 by b = 2500.
30
+ *
31
+ * @param a A positive number.
32
+ * @param b A positive number.
33
+ * @returns log B(a, b), or NaN if either argument is zero or less.
34
+ */
35
+ export declare function logBeta(a: number, b: number): number;
36
+ /**
37
+ * The regularized incomplete beta function I_x(a, b), R's `pbeta()`.
38
+ *
39
+ * The continued fraction converges quickly only on one side of the
40
+ * distribution, so the function evaluates the mirrored form when x sits above
41
+ * the switch point and takes the complement.
42
+ *
43
+ * @param x A value between 0 and 1.
44
+ * @param a A positive shape.
45
+ * @param b A positive shape.
46
+ * @returns The share of the beta density below x, or NaN for a bad shape.
47
+ */
48
+ export declare function incompleteBeta(x: number, a: number, b: number): number;
49
+ /**
50
+ * The regularized incomplete beta function, told x and 1 − x separately.
51
+ *
52
+ * A caller that can write down both members of the pair should use this
53
+ * instead of `incompleteBeta`. Once x is within 1e-16 of 1, the double
54
+ * holding it has no room left for 1 − x, and rebuilding the complement by
55
+ * subtraction throws away the very digits the answer rests on. `pt()` reads
56
+ * both straight off t and df, so it gives up nothing.
57
+ *
58
+ * The two are treated as an exact pair, not as one value and a derived one:
59
+ * each logarithm is taken from whichever member still carries its precision.
60
+ *
61
+ * @param x A value between 0 and 1.
62
+ * @param complement The value of 1 − x, computed without subtracting.
63
+ * @param a A positive shape.
64
+ * @param b A positive shape.
65
+ * @returns The share of the beta density below x, or NaN for a bad shape.
66
+ */
67
+ export declare function incompleteBetaSplit(x: number, complement: number, a: number, b: number): number;
68
+ /**
69
+ * The standard normal distribution function, R's `pnorm()`.
70
+ *
71
+ * Built on the identity Φ(−z) = ½ · Q(½, z²/2), which keeps the far tail
72
+ * accurate relative to itself rather than losing it against 1. The
73
+ * non-central t needs Φ(−ncp) down to 1e-72 at the widest slider settings.
74
+ *
75
+ * @param z Where to evaluate the distribution.
76
+ * @returns A probability between 0 and 1, or NaN for a NaN input.
77
+ */
78
+ export declare function normalCdf(z: number): number;
79
+ /**
80
+ * The inverse of the regularized incomplete beta function, R's `qbeta()`.
81
+ *
82
+ * Newton's method on I_x(a, b) − p, with the exact beta density as the
83
+ * derivative. Every step keeps a bracket, and a step that leaves the bracket
84
+ * falls back to bisection, so the loop cannot run away on a poor guess.
85
+ *
86
+ * @param p A probability between 0 and 1.
87
+ * @param a A positive shape.
88
+ * @param b A positive shape.
89
+ * @returns The x where I_x(a, b) equals p, or NaN for a bad shape.
90
+ */
91
+ export declare function inverseIncompleteBeta(p: number, a: number, b: number): number;
92
+ //# sourceMappingURL=special.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"special.d.ts","sourceRoot":"","sources":["../../src/core/special.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAsCH;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAW1C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAepD;AA+DD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAWtE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,MAAM,EACT,UAAU,EAAE,MAAM,EAClB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACR,MAAM,CAmBR;AAuED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAM3C;AAwCD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACR,MAAM,CAiDR"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The t distribution: density, cumulative probability, and quantile.
3
+ *
4
+ * These are the port of R's `dt()`, `pt()`, and `qt()`. `plot_t_test()` in
5
+ * `../compstatslib/R/t_statistic_plot.R` draws both hypothesis curves from
6
+ * them. Verified against R in `tdist.test.ts`.
7
+ *
8
+ * All three take an optional non-centrality, as in R. Left out or given as 0,
9
+ * they run the central path, which `plot_t_test()` draws the null hypothesis
10
+ * from; given a non-zero value they run the non-central path behind the
11
+ * alternative-hypothesis curve, where the non-centrality is the t statistic
12
+ * itself.
13
+ *
14
+ * A note on how close this comes to R. The non-central routines follow R's
15
+ * own `pnt.c` and `dnt.c` step for step, down to the iteration cap and the
16
+ * error bound. That is on purpose. Both stop the series on an *absolute*
17
+ * bound, so where they stop is part of the answer, and a tidier stopping rule
18
+ * would move the last digits away from R rather than toward the truth. It
19
+ * also means this port inherits R's limits: at a large non-centrality the
20
+ * series terms are built by repeated subtraction and go to noise once they
21
+ * fall below about 1e-16, which is what R's own "full precision may not have
22
+ * been achieved" warning reports. Densities near 1e-50 there agree with R in
23
+ * absolute terms only.
24
+ */
25
+ /**
26
+ * The density of the t distribution, R's `dt()`.
27
+ *
28
+ * @param x Where to evaluate the density.
29
+ * @param df Degrees of freedom. Any positive number, whole or not.
30
+ * @param ncp The non-centrality. Left out, or 0, gives the central density.
31
+ * @returns The density, or NaN if df is zero or less.
32
+ */
33
+ export declare function dt(x: number, df: number, ncp?: number): number;
34
+ /**
35
+ * The share of the distribution below x, R's `pt()`.
36
+ *
37
+ * @param x Where to evaluate the distribution.
38
+ * @param df Degrees of freedom. Any positive number, whole or not.
39
+ * @param ncp The non-centrality. Left out, or 0, gives the central case.
40
+ * @returns A probability between 0 and 1, or NaN if df is zero or less.
41
+ */
42
+ export declare function pt(x: number, df: number, ncp?: number): number;
43
+ /**
44
+ * The value with probability p below it, R's `qt()`.
45
+ *
46
+ * @param p A probability between 0 and 1. The ends give infinities, as in R.
47
+ * @param df Degrees of freedom. Any positive number, whole or not.
48
+ * @param ncp The non-centrality. Left out, or 0, gives the central case.
49
+ * @returns The quantile, or NaN for a p outside 0 to 1 or a df of zero or
50
+ * less.
51
+ */
52
+ export declare function qt(p: number, df: number, ncp?: number): number;
53
+ //# sourceMappingURL=tdist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tdist.d.ts","sourceRoot":"","sources":["../../src/core/tdist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAuBH;;;;;;;GAOG;AACH,wBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAO9D;AAED;;;;;;;GAOG;AACH,wBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAO9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAO9D"}
@@ -0,0 +1,146 @@
1
+ /**
2
+ * The derived quantities of a one-sided t test.
3
+ *
4
+ * This is the statistics half of `plot_t_test()` in
5
+ * `../compstatslib/R/t_statistic_plot.R`. R computes these while drawing,
6
+ * scattered across `plot_t_test()`, `t_null_plot()`, `t_alt_lines()`, and
7
+ * `plot_error_matrix()`; here they are one pure result that the plot layer
8
+ * reads. Verified against R in `ttest.test.ts`.
9
+ *
10
+ * What the picture shows: a null distribution centerd at 0 and an alternative
11
+ * distribution centerd at the t statistic the given difference produces. The
12
+ * area of the null above the critical value is the significance level; the
13
+ * area of the alternative above that same point is the power, and what falls
14
+ * below it is beta.
15
+ */
16
+ /** The four numbers `plot_t_test()` takes, all optional as in R. */
17
+ export interface TTestOptions {
18
+ /** The difference the alternative hypothesis claims. */
19
+ readonly diff?: number;
20
+ /** The population standard deviation. */
21
+ readonly sd?: number;
22
+ /** The sample size. */
23
+ readonly n?: number;
24
+ /** The significance level. */
25
+ readonly alpha?: number;
26
+ }
27
+ /**
28
+ * R's defaults from the `plot_t_test()` signature.
29
+ *
30
+ * These live here rather than in the plot layer so that the plot and
31
+ * interactive layers read one set of numbers, and so that `tTestStats()` on
32
+ * its own yields the classroom demo, matching R's no-argument behavior.
33
+ */
34
+ export declare const DEFAULT_T_TEST_OPTIONS: {
35
+ readonly diff: 0.5;
36
+ readonly sd: 4;
37
+ readonly n: 100;
38
+ readonly alpha: 0.05;
39
+ };
40
+ /**
41
+ * A span of the x axis to shade under a curve.
42
+ *
43
+ * `from` can be −Infinity. Once the difference is large enough, beta
44
+ * underflows to exactly 0 and the shading starts at the quantile for 0, which
45
+ * is unbounded — the whole alternative curve lies in the rejection region.
46
+ * About one in thirty of the slider settings reaches this. The value is
47
+ * honest and the plot layer must clamp it to the drawing window; R instead
48
+ * hands the infinity to `seq()` and stops with an error, so this is one place
49
+ * the port has to do better rather than follow.
50
+ */
51
+ export interface FillRange {
52
+ /** Where the shading starts. May be −Infinity; see above. */
53
+ readonly from: number;
54
+ /** Where the shading stops. R runs every fill out to the 0.999 quantile. */
55
+ readonly to: number;
56
+ }
57
+ /**
58
+ * The four cells of the error matrix, and which row R rings.
59
+ *
60
+ * The numbers here are raw. R prints two of the four through `round(x, 2)`
61
+ * and the other two untouched: `plot_error_matrix()` writes `alpha` and
62
+ * `1 - alpha` as they are, but `round(alt_stats[2], 2)` and
63
+ * `round(alt_stats[1], 2)` for the power and beta cells. That asymmetry is
64
+ * R's own. Rounding is a display concern, so it belongs to the plot layer;
65
+ * this type carries full precision and lets the drawing decide.
66
+ */
67
+ export interface TTestErrorMatrix {
68
+ /** Top left: rejecting a true null. This is alpha. */
69
+ readonly typeOne: number;
70
+ /** Top right: rejecting a false null. This is the power. */
71
+ readonly correctReject: number;
72
+ /** Bottom left: keeping a true null. This is 1 − alpha. */
73
+ readonly correctFailToReject: number;
74
+ /** Bottom right: keeping a false null. This is beta. */
75
+ readonly typeTwo: number;
76
+ /**
77
+ * Whether R rings the top row rather than the bottom one.
78
+ *
79
+ * R's test is `alt_stats[3] < alt_stats[4]`: the point where the alternative
80
+ * fill begins, against the alternative's median. The fill begins at the
81
+ * critical value, so this asks whether the critical value sits below the
82
+ * median — that is, whether the test is more likely than not to reject. When
83
+ * it is, the top row is the likely outcome and gets the ring.
84
+ */
85
+ readonly highlightTopRow: boolean;
86
+ }
87
+ /** Everything `plot_t_test()` derives before it draws anything. */
88
+ export interface TTestStats {
89
+ /** The difference the statistics were computed from. */
90
+ readonly diff: number;
91
+ /** The standard deviation they were computed from. */
92
+ readonly sd: number;
93
+ /** The sample size they were computed from. */
94
+ readonly n: number;
95
+ /** The significance level they were computed from. */
96
+ readonly alpha: number;
97
+ /** Degrees of freedom, n − 1. */
98
+ readonly df: number;
99
+ /**
100
+ * The t statistic, `diff / (sd / √n)`.
101
+ *
102
+ * This doubles as the non-centrality of the alternative distribution, which
103
+ * is what makes the two curves in the picture the same shape shifted.
104
+ */
105
+ readonly t: number;
106
+ /** Where the null distribution starts rejecting, `qt(1 − alpha, df)`. */
107
+ readonly criticalValue: number;
108
+ /** The chance of keeping a false null: the alternative below the critical value. */
109
+ readonly beta: number;
110
+ /** The chance of rejecting a false null, 1 − beta. */
111
+ readonly power: number;
112
+ /** The alternative distribution's midpoint, `qt(0.5, df, ncp)`. */
113
+ readonly altMedian: number;
114
+ /** The height of the alternative curve at its midpoint. */
115
+ readonly altMedianDensity: number;
116
+ /**
117
+ * The shaded span under the alternative curve, the power.
118
+ *
119
+ * `from` is R's `alt_stats[3]`, `qt(beta, df, ncp)`. That inverts the beta
120
+ * it was just built from, so it lands back on the critical value — but only
121
+ * as closely as the two routines invert each other, which is why R's own
122
+ * numbers differ in the last digits from `criticalValue`.
123
+ */
124
+ readonly altFill: FillRange;
125
+ /**
126
+ * The shaded span under the null curve, the significance level.
127
+ *
128
+ * `from` is the critical value, by the same expression.
129
+ */
130
+ readonly nullFill: FillRange;
131
+ /** The four cells R draws beside the curves. */
132
+ readonly errorMatrix: TTestErrorMatrix;
133
+ }
134
+ /**
135
+ * Work out everything the picture needs from the four test parameters.
136
+ *
137
+ * A missing option takes R's default, so calling this with nothing yields the
138
+ * same demo `plot_t_test()` does. Nothing is validated: a sample size of 1
139
+ * leaves no degrees of freedom and the quantiles come back as NaN, which is
140
+ * what R does too.
141
+ *
142
+ * @param options The test parameters. Any left out take R's defaults.
143
+ * @returns The derived quantities. No drawing, no state.
144
+ */
145
+ export declare function tTestStats(options?: TTestOptions): TTestStats;
146
+ //# sourceMappingURL=ttest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ttest.d.ts","sourceRoot":"","sources":["../../src/core/ttest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,oEAAoE;AACpE,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB;IACvB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAEX;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,QAAQ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DjE"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The `moderation_data` dataset of the R package.
3
+ *
4
+ * Two hundred rows of a moderated relationship, used as the default data of
5
+ * `plot_moderation_3d()` and `plot_scatter3d()` so that both work with no
6
+ * arguments. R's `data.R` records the recipe: `x`, `z` and `w` are drawn
7
+ * independently from a normal distribution with standard deviation 2, and
8
+ *
9
+ * ```text
10
+ * y = 0.5 x + 0.3 z + 0.8 x z + N(0, 1)
11
+ * ```
12
+ *
13
+ * so the effect of `x` on `y` grows with `z` — the interaction the surface
14
+ * shows as a twist. Column `w` enters no equation: it is noise, and it is
15
+ * there so an example can carry a control variable that means nothing.
16
+ *
17
+ * The values below are the exact doubles of the R data file
18
+ * (`../compstatslib/data/moderation_data.rda`), printed at 17 significant
19
+ * digits, which round-trips an IEEE-754 double. **Exported from R, never
20
+ * regenerated** — the draw used `set.seed(42)` under R's own generator, so a
21
+ * JavaScript regeneration would produce different numbers and silently change
22
+ * every default demo. Source of the printed values:
23
+ * `.claude/plans/moderation-data.tsv`, checked against the column checksums of
24
+ * `.claude/plans/moderation-fixtures.md` in `moderationData.test.ts`.
25
+ *
26
+ * The columns are in the order of the R data frame — `y, x, z, w`, not
27
+ * alphabetical and not `x, y, z`. That order is load-bearing: `plot_scatter3d()`
28
+ * with no axis arguments takes the first three numeric columns, which is why
29
+ * its default plot puts `y` on the horizontal axis.
30
+ */
31
+ /** The four columns of the R `moderation_data` data frame. */
32
+ export type ModerationData = {
33
+ readonly y: readonly number[];
34
+ readonly x: readonly number[];
35
+ readonly z: readonly number[];
36
+ readonly w: readonly number[];
37
+ };
38
+ /** The 200 rows of the R `moderation_data` data frame, in file order. */
39
+ export declare const moderationData: ModerationData;
40
+ //# sourceMappingURL=moderationData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moderationData.d.ts","sourceRoot":"","sources":["../../src/data/moderationData.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,cAAc,EAAE,cAyZ5B,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The `pca_degenerate` dataset of the R package.
3
+ *
4
+ * A small two-column dataset that shows a degenerate PCA case: the two
5
+ * components carry almost the same variance (sdev 17.86 and 17.41), so the
6
+ * principal axes are barely distinguishable and the arrows of `plot_pca()`
7
+ * come out nearly the same length in nearly perpendicular directions.
8
+ *
9
+ * The 16 rows below are the exact doubles of the R data file
10
+ * (`../compstatslib/data/pca_degenerate.rda`), printed at 17 significant
11
+ * digits, which round-trips an IEEE-754 double. **Exported from R, never
12
+ * regenerated** — a JavaScript regeneration would silently change the demo.
13
+ * Source of the printed values: `.claude/plans/pca-fixtures.md`, section F1.
14
+ */
15
+ import type { Point } from "../core/regression";
16
+ /** The 16 rows of the R `pca_degenerate` data frame, in file order. */
17
+ export declare const pcaDegenerate: readonly Point[];
18
+ //# sourceMappingURL=pcaDegenerate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pcaDegenerate.d.ts","sourceRoot":"","sources":["../../src/data/pcaDegenerate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,uEAAuE;AACvE,eAAO,MAAM,aAAa,EAAE,SAAS,KAAK,EAiBzC,CAAC"}
@@ -0,0 +1,66 @@
1
+ export { machinePrecision } from "./core/precision";
2
+ export { mean, meanAbsoluteDeviation, median, quantile, quantiles, sd, } from "./core/arith";
3
+ export { bwNrd0, kernelDensity } from "./core/kde";
4
+ export type { KernelDensityEstimate, KernelDensityOptions, } from "./core/kde";
5
+ export { histogram, nclassSturges } from "./core/histogram";
6
+ export type { Histogram, HistogramOptions } from "./core/histogram";
7
+ export { rPretty } from "./core/pretty";
8
+ export type { RPrettyOptions } from "./core/pretty";
9
+ export { drawSamples, sampleConfidenceIntervals, simulateSampleCi, } from "./core/sampling";
10
+ export type { DistributionFn, DrawSamplesOptions, Interval, SampleCiOptions, SampleCiSimulation, SampleDraw, SampleInterval, } from "./core/sampling";
11
+ export { frameRows, isNumericColumn, numericColumns, requireNumericColumn, } from "./core/frame";
12
+ export type { Column, DataFrame } from "./core/frame";
13
+ export { moderationSurface } from "./core/moderation";
14
+ export type { ModerationOptions, ModerationSurface, ModerationTerm, } from "./core/moderation";
15
+ export { linearRegression } from "./core/regression";
16
+ export type { Point, RegressionFit } from "./core/regression";
17
+ export { determinant, invertMatrix } from "./core/matrix";
18
+ export type { Matrix2, MatrixInversion, Singularity } from "./core/matrix";
19
+ export { principalComponents } from "./core/pca";
20
+ export type { Loadings, PcaResult } from "./core/pca";
21
+ export { DEFAULT_LOGIT_EPSILON, DEFAULT_LOGIT_MAX_ITERATIONS, logisticRegression, predictLogit, } from "./core/logit";
22
+ export type { LogitFit, LogitOptions } from "./core/logit";
23
+ export { DEFAULT_LEAST_SQUARES_TOLERANCE, leastSquares } from "./core/ols";
24
+ export type { LeastSquaresFit, LeastSquaresOptions } from "./core/ols";
25
+ export { rcauchy, rlnorm, rnorm, rt, runif, sampleWithoutReplacement, seededRng, } from "./core/rng";
26
+ export type { Rng, RcauchyOptions, RlnormOptions, RnormOptions, RunifOptions, } from "./core/rng";
27
+ export { dt, pt, qt } from "./core/tdist";
28
+ export { DEFAULT_T_TEST_OPTIONS, tTestStats } from "./core/ttest";
29
+ export type { FillRange, TTestErrorMatrix, TTestOptions, TTestStats, } from "./core/ttest";
30
+ export { incompleteBeta, incompleteBetaSplit, inverseIncompleteBeta, logBeta, logGamma, normalCdf, } from "./core/special";
31
+ export { moderationData } from "./data/moderationData";
32
+ export type { ModerationData } from "./data/moderationData";
33
+ export { pcaDegenerate } from "./data/pcaDegenerate";
34
+ export { resolveTarget } from "./plot/target";
35
+ export type { Context2D, PlotTarget, RenderTarget } from "./plot/target";
36
+ export { DEFAULT_MARGINS, createScale, drawAxes, pixelInArea, prettyTicks, } from "./plot/axes";
37
+ export type { AxesOptions, Extent, Margins, PlotArea, Scale, ScaleOptions, } from "./plot/axes";
38
+ export { matrixInverseScale, plotMatrixInverse } from "./plot/matrixInverse";
39
+ export { logitScale, plotLogit } from "./plot/logit";
40
+ export type { LegendLocation, PlotLogitOptions } from "./plot/logit";
41
+ export { plotSampleCi, sampleCiScale } from "./plot/sampleCi";
42
+ export type { PlotSampleCiOptions } from "./plot/sampleCi";
43
+ export { plotSampling, samplingScale } from "./plot/sampling";
44
+ export type { PlotSamplingOptions, PlotSamplingResult, SamplingPanel, SamplingState, } from "./plot/sampling";
45
+ export { pcaScale, plotPca } from "./plot/pca";
46
+ export type { PlotPcaOptions } from "./plot/pca";
47
+ export { plotRegression, regressionScale } from "./plot/regression";
48
+ export type { PlotRegressionOptions } from "./plot/regression";
49
+ export { formatNumber, formatStat } from "./plot/format";
50
+ export { plotTTest, tTestScale } from "./plot/tTest";
51
+ export type { PlotTTestOptions } from "./plot/tTest";
52
+ export { eventPixel, resolveControlTarget, resolveInteractiveTarget, } from "./interactive/target";
53
+ export type { ClickSource, ControlTarget, InteractiveTarget, PanelTarget, ResolvedPanel, SplitTarget, } from "./interactive/target";
54
+ export { DEFAULT_MATRIX_INVERSE_VALUES, interactiveMatrixInverse, } from "./interactive/matrixInverse";
55
+ export type { InteractiveMatrixInverseHandle, InteractiveMatrixInverseOptions, } from "./interactive/matrixInverse";
56
+ export { interactiveSampling } from "./interactive/sampling";
57
+ export type { InteractiveSamplingHandle, InteractiveSamplingOptions, SamplingValues, } from "./interactive/sampling";
58
+ export { interactiveTTest } from "./interactive/tTest";
59
+ export type { InteractiveTTestHandle, InteractiveTTestOptions, TTestValues, } from "./interactive/tTest";
60
+ export { interactiveLogit } from "./interactive/logit";
61
+ export type { InteractiveLogitHandle, InteractiveLogitOptions, } from "./interactive/logit";
62
+ export { interactivePca } from "./interactive/pca";
63
+ export type { InteractivePcaHandle, InteractivePcaOptions, InteractivePcaResult, } from "./interactive/pca";
64
+ export { interactiveRegression } from "./interactive/regression";
65
+ export type { InteractiveRegressionHandle, InteractiveRegressionOptions, } from "./interactive/regression";
66
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,IAAI,EACJ,qBAAqB,EACrB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,EAAE,GACH,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACnD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,SAAS,EACT,eAAe,EACf,cAAc,EACd,oBAAoB,GACrB,MAAM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