Validation

Lattent's analysis engine is a small, readable JavaScript library. The same reference datasets are fitted by Lattent and by SciPy, the standard scientific Python library, and the results must agree before any release. The test suites (tests/run-engines.js with tests/check_scipy.py for the calculators, and tests/run-studio.js with tests/check_studio.py for Studio) simulate data with known parameters and noise, fits it in both, and compare estimates, standard errors, derived quantities and p-values. A technical note further down benchmarks the fitting engine against certified reference results.

CheckReferenceLargest relative difference
Dose–response, 4PL inhibitor (30 points)scipy.optimize.curve_fitpass parameters 1×10⁻⁸, SE 3×10⁻⁸
Dose–response, 4PL agonistcurve_fitpass parameters < 10⁻⁶, SE < 10⁻⁵
Dose–response, 5PL asymmetriccurve_fitpass parameters < 10⁻⁶, SE < 10⁻³
EC80 / IC80 from the fitted curveclosed-form inverse of the 4PLpass < 10⁻⁶
Standard curve, 4PL unweightedcurve_fitpass parameters < 10⁻⁶, SE < 10⁻³
Standard curve, 4PL with 1/Y² weightingcurve_fit with sigma = Ypass parameters < 10⁻⁶, SE < 10⁻³
Sample interpolationanalytic 4PL inversepass < 10⁻⁶
Linear standard curvescipy.stats.linregresspass parameters < 10⁻⁸, SE < 10⁻⁵
Michaelis–Mentencurve_fitpass parameters < 10⁻⁴, SE < 10⁻³
Substrate inhibition, Hillcurve_fitpass parameters < 10⁻⁴
Competitive, non-competitive, uncompetitive, mixed (global)curve_fit on stacked datapass parameters < 10⁻⁴, SE < 10⁻³
Mechanism selection by AICcknown simulated mechanismpass competitive correctly preferred
Student t CDF and quantilesscipy.stats.tpass < 10⁻⁷
Welch's t-testscipy.stats.ttest_ind(equal_var=False)pass < 10⁻⁶
qPCR fold change (2^−ΔΔCt)hand calculationpass < 10⁻⁹
qPCR p-valuettest_ind on −ΔΔCtpass < 10⁻⁶

Lattent Studio engine

CheckReferenceLargest relative difference
Normality (D'Agostino–Pearson K²)scipy.stats.normaltestpass < 10⁻⁶
Student, paired t teststtest_ind, ttest_relpass < 10⁻⁷
Mann–Whitney, exact and asymptoticmannwhitneyupass < 10⁻⁷
One-way ANOVA, Kruskal–Wallis, Brown–Forsythef_oneway, kruskal, levenepass < 10⁻⁷
Welch's ANOVAtextbook formula in NumPypass < 10⁻⁷
Tukey HSD p-values and intervalsscipy.stats.tukey_hsdpass < 2×10⁻³ (numerical integration)
Studentized range distributionscipy.stats.studentized_rangepass < 10⁻³
Pearson and Spearman correlationpearsonr, spearmanrpass < 10⁻⁷
Multiple linear regressionnumpy.linalg.lstsqpass < 10⁻⁸
PCA eigenvaluesnumpy.linalg.eigvalshpass < 10⁻⁸
Arrhenius, Langmuir, KWW, Carreau fitsscipy.optimize.curve_fitpass parameters < 10⁻⁵, SE < 2×10⁻³
User-defined equation parsercurve_fit on the same expressionpass < 10⁻⁵
Multi-peak fit (simulated XRD)known peak positions and widthspass centres < 0.2%, widths < 5%
d-spacing and Scherrer sizeBragg and Scherrer equationspass < 10⁻⁹
Savitzky–Golay smoothingscipy.signal.savgol_filterpass < 10⁻⁹
Gaussian-process mean, SD and leave-one-outclosed form in NumPypass < 10⁻⁵
Tauc band gap (simulated, 3.20 eV)known valuepass within 0.05 eV
Tensile modulus (simulated, 70 GPa)known valuepass within 2%

Run them yourself: node tests/run-studio.js out.json && python tests/check_studio.py out.json.

Technical note: nonlinear fitting on the NIST reference problems

Measured 16 October 2026 on an Apple M1 · Node 24.4 (V8, the engine in Chrome and Edge) · Python 3.12.9 with SciPy 1.18.1

Agreeing with SciPy on well-behaved data shows that two implementations match; it does not show that either is right on hard problems. For that, the US National Institute of Standards and Technology publishes the Statistical Reference Datasets (StRD): nonlinear regression problems with certified parameter values computed to 11 significant digits, each with two prescribed starting points, the first further from the solution. Lattent's fitting engine (the code behind every Studio fit and user-defined equation) and scipy.optimize.curve_fit were run on all 26 single-predictor problems from both starting points: 52 fits.

51 / 52Lattent fits with at least 4 correct significant digits in every parameter
45 / 52SciPy curve_fit, default settings
8.6 vs 6.4median correct digits, worst parameter of each fit
17 vs 0.6 msmedian time per fit; SciPy is faster
NIST difficultyFitsFits with ≥ 4 digitsMedian digits
LattentSciPyLattentSciPy
Lower16161610.17.8
Average2020179.06.4
Higher1615127.75.1
Standard errors (all fits)5247438.45.1

Reading the numbers. Accuracy is the log relative error, −log₁₀(|estimate − certified| / |certified|), roughly the number of correct significant digits, taken for the worst parameter of each fit and capped at 11. Four digits is the usual pass mark; anything above 6 is more precision than any laboratory measurement supports.

All 52 fits
ProblemDifficultyStartLattent digitsSciPy digitsLattent msSciPy ms
Misra1aLower111.08.63.30.3
Misra1aLower210.98.42.40.2
Chwirut2Lower18.66.26.10.2
Chwirut2Lower28.55.95.50.2
Chwirut1Lower17.85.8220.3
Chwirut1Lower28.65.9160.2
Lanczos3Lower16.84.6545.1
Lanczos3Lower27.24.8510.6
Gauss1Lower110.66.97200.8
Gauss1Lower210.66.87300.8
Gauss2Lower19.98.55101.0
Gauss2Lower29.98.14670.9
DanWoodLower111.07.91.40.1
DanWoodLower211.08.71.40.1
Misra1bLower110.27.83.70.5
Misra1bLower210.27.92.60.2
Kirby2Average18.26.4340.5
Kirby2Average28.35.8320.4
Hahn1Average15.16.42202.0
Hahn1Average25.05.12261.9
MGH17Average19.0failed1300.2
MGH17Average29.56.4100.8
Lanczos1Average110.610.6534.7
Lanczos1Average210.610.6500.6
Lanczos2Average16.86.6525.1
Lanczos2Average27.76.4520.6
Gauss3Average110.09.27651.1
Gauss3Average210.17.76951.2
Misra1cAverage110.98.22.60.2
Misra1cAverage210.87.92.40.1
Misra1dAverage111.08.72.80.2
Misra1dAverage211.08.42.30.1
Roszman1Average18.35.53.50.2
Roszman1Average28.35.63.40.2
ENSOAverage15.53.24366.3
ENSOAverage25.53.15935.5
MGH09Higher16.34.01712
MGH09Higher26.44.07.00.6
ThurberHigher17.04.5653.3
ThurberHigher26.94.5782.1
BoxBODHigher17.7failed3.50.1
BoxBODHigher27.85.11.50.2
Rat42Higher19.96.82.00.2
Rat42Higher29.77.11.80.2
MGH10Higher1failed6.7604.6
MGH10Higher28.86.8132.2
Eckerle4Higher19.67.27.20.4
Eckerle4Higher29.67.23.50.2
Rat43Higher17.85.16.00.7
Rat43Higher27.44.93.80.3
Bennett5Higher17.35.416822
Bennett5Higher27.54.01985.9

Reproduce it: node tests/bench/nist.js and python tests/bench/nist_scipy.py; the data and certified values are in tests/bench/nist.json, converted from NIST's files by tests/bench/extract_nist.py, and the raw results above are in tests/bench/results.json. Continuous integration fails if fewer than 50 of the 52 fits reach four digits. Nelson, the one StRD problem with two predictors, is omitted.

Cite Lattent

Lattent's specialist models

Facet's built-in suggestions and the shape-guided auto-fit use two small neural networks trained by Lattent, not by a third party. Both run entirely in your browser.

Shape familyHeld-out accuracy
Straight line99.3%
Polynomial curvature95.5%
Decay99.3%
Rise to a plateau97.0%
Sigmoidal97.2%
Exponential growth98.8%
Power law96.5%
Logarithmic99.0%
Thermally activated100.0%
Inverse (1/X)98.0%
Spectrum with peaks98.7%
Absorption edge99.8%
Stress–strain100.0%

The models suggest; they never compute results. Every number still comes from the validated fitting engine above. The browser inference is checked against scikit-learn on every release (largest difference below 10⁻⁵). Retrain with node tests/ml/simulate.js and python tests/ml/train.py.

Equation discovery, AutoML and uncertainty

These checks use synthetic data with known answers, so success is unambiguous (tests/ml/check_learn.js).

CheckDataResult
Equation discovery: six known lawsquadratic, exponential decay, power law (5% relative noise), Arrhenius, Langmuir and Hall–Petch, each with noiseAll six recovered with the right form; for example exponent 1.501 (true 1.5), 4029 K (true 4000), K = 3.24 (true 3.33)
Equation discovery on an exampleglass transition against molar massRediscovers Flory–Fox: Tg = 100.6 − 1.11×10⁵/Mn (true 100.5 − 1.1×10⁵/Mn)
AutoML: nonlinear benchmarkFriedman #1, 160 samples, 5 informative and 5 pure-noise inputsGaussian process selected, cross-validated R² 0.93; the five informative inputs all rank above the five noise inputs
AutoML: linear problem40 samples, y = 2x₁ − x₂ + noiseA linear model selected, cross-validated R² 0.99
Conformal prediction intervals90% intervals from AutoML, tested on 400 new samples89.3% coverage
Property-network intervals9,511 compositions never seen in training90% half-widths: 0.17 eV/atom (formation energy); 0.41, 1.15 and 1.29 eV (band gap, for predicted gaps below 0.3, 0.3–2 and above 2 eV)

Discovery and generative models

Discover combines a live database, a powder-diffraction simulator and three neural networks that Lattent trained itself on Materials Project data (via Matbench, CC BY 4.0). The networks run in your browser, and the browser code reproduces PyTorch to within 2×10⁻⁶ (float32 property networks) and 1.2×10⁻³ (float16 generator).

CheckDataResult
Formation energy of the most stable polymorph, from composition9,511 test compositions never seen in training (85,607 for training)MAE 0.092 eV/atom, R² 0.945 (predicting the median gives 0.98 eV/atom)
DFT (PBE) band gap, from composition10,573 test entries, split by composition (95,540 for training)MAE 0.32 eV, R² 0.84 (median predictor 1.19 eV)
Generator: unconditional samples2,526 formulas97% distinct, 71% absent from the training set; ternaries are over-represented (75% against 52% in the data)
Generator: kesterite family, Cu–Zn–Sn–S800 samplesCu₂ZnSnS₄ is the third most frequent formula (15% of samples) and in the top ten after screening
Generator: olivine cathode, Li–Fe–P–O300 samplesLiFePO₄ is proposed
Generator: band-gap guidance400 samples per targetmean predicted gap of the top candidates 0.93 eV for a 0.5 eV target, 3.73 eV for 3.5 eV
Powder XRD, fcc Au (a = 4.078 Å, Cu Kα₁)reference pattern of gold38.19°, 44.39°, 64.59°, 77.58°, 81.74° with the fcc extinctions; I(200)/I(111) = 48%
Symmetrisation of distorted DFT cellsstrained one-atom fcc cell; distorted hcp cell24 split reflections become the 5 fcc reflections; hcp cell restored to a = b, γ = 120° at the same volume
Phase identification, gold nanoparticles5 fitted peaks against all Au structures in Alexandria (PBE)fcc Au, Fm3̅m, score 0.98 (next phase 0.71); lattice 2.2% below PBE, as expected
Phase identification, ZnO8 experimental peaks against all Zn–O structureswurtzite, P6₃mc, ranked first (score 0.91)

Run the checks yourself: node tests/gen/check.js tests/gen/props_parity.json and node tests/gen/check_xtal.js (the second queries Alexandria; add --offline to skip it). Retrain with tests/gen/train_props.py and tests/gen/train_mdiff.py.

What is computed and how

Limits

Lattent is research software. It is not validated for GLP, 21 CFR Part 11 or clinical diagnostic use. Asymptotic confidence intervals assume roughly normal residuals and a well-determined fit; Lattent warns when a parameter is poorly constrained, but judgement is still yours.