Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
JavaScript statistics libraries compute summaries such as the mean, variance, and quantiles, and work with probability distributions. Distribution functions return probabilities from a distribution or draw random samples from it. These libraries let dashboards, analytics tools, and AI agents describe data and run regressions in the browser or Node.js.
Popularity
d3-array has the most monthly downloads in this comparison, at 538.9M.
private _adjust(dataset: Matrix, ignoreZeroVariance: boolean) {
if (this.center) {
const mean = dataset.mean('column');
const stdevs = this.scale
? dataset.standardDeviation('column', { mean })
: null;
this.means = mean;
dataset.subRowVector(mean);
if (this.scale) {
for (let i = 0; i < (stdevs as number[]).length; i++) {
if ((stdevs as number[])[i] === 0) {
if (ignoreZeroVariance) {
dataset.removeColumn(i);
(stdevs as number[]).splice(i, 1);
this.excludedFeatures.push(i);
i--;
} else {
throw new RangeError(
`Cannot scale the dataset (standard deviation is zero at index ${i}`,
);
}
}
}
this.stdevs = stdevs;
dataset.divRowVector(stdevs as number[]);
}
}
}
vega-statistics
Provides statistical routines and probability distributions.
export function binContinuous(
maxbins: number,
extent: Interval<number>,
exact = false
): BinConfig {
// will do exactly max bins if (exact) {
return binRegularIntervals(maxbins, extent);
}
// might do bins less than maxbins, but will do it more nicely intervals return vegaBin({ maxbins, extent });
}
jStat
Provides statistical operations through static functions and wrapped numeric collections.
Downloads / mo
6.0M
Stars
1.8K
Last release
1.9.6
License
MIT
Strengths
Configures quantile estimation.Set the quantile parameters to match the required estimation method.
Offers static and wrapped APIs.Use static functions or chain operations on a jStat object.
Limitations
Variance defaults to the population.Pass true for sample variance when using the array API.
Matrix variance restricts sample selection.The matrix API cannot select population versus sample variance through its flag.
export function determineMeanAndStddev(data) {
const dataMean = data.mean(0);
// TODO(bileschi): Simplify when and if tf.var / tf.std added to the API. const diffFromMean = data.sub(dataMean);
const squaredDiffFromMean = diffFromMean.square();
const variance = squaredDiffFromMean.mean(0);
const dataStd = variance.sqrt();
return {dataMean, dataStd};
}
FAQ
Simple Statistics suits apps that need descriptive statistics, regression, and inference tests in one package. jStat suits code that needs named probability distributions alongside descriptive statistics. d3-array suits data pipelines that need summaries and quantiles.
Sample standard deviation divides by one less than the number of values to correct the bias of estimating from a sample. Population standard deviation divides by the full count. Math.js switches between the two with a setting.
jStat provides statistical routines for arrays and matrices along with named probability distribution functions. It computes values such as the normal CDF.
d3-random generates random numbers from the normal distribution and other distributions. jStat and Vega Statistics also sample from a normal distribution.
For coding agents
Found your statistics library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.