Lab data plotter & error calculator
Load your readings from a CSV file, or start from a department experiment, and get a weighted least-squares fit with parameter uncertainties, χ² goodness-of-fit, residuals, a derived physical constant with propagated error, and a publication-ready graph. Your data never leaves your browser.
1 · Data
2 · Graph
3 · Fit results
4 · Physical result
Error propagation calculator
Enter any formula using the variable names below. The uncertainty is σf² = Σ(∂f/∂xᵢ σᵢ)², with derivatives taken numerically. Variables are assumed independent.
| name | value | σ | share of σ² |
|---|
Repeated measurements
Paste repeated readings of one quantity (separated by spaces, commas or new lines).
Method
The parameters minimise the weighted sum of squared residuals
$$ \chi^2(\mathbf p) = \sum_{i=1}^{N}\frac{\big(y_i - f(x_i;\mathbf p)\big)^2}{\sigma_i^2} .$$Models that are linear in their parameters (straight line, polynomials) are solved exactly from the normal equations. Non-linear models use Levenberg–Marquardt. The parameter covariance is \(C = (J^TWJ)^{-1}\) with \(W = \mathrm{diag}(1/\sigma_i^2)\), and the standard errors are \(\sqrt{C_{jj}}\). If x also has uncertainties, each point's weight uses the effective variance \(\sigma_{\text{eff}}^2 = \sigma_y^2 + \big(f'(x_i)\,\sigma_{x,i}\big)^2\), iterated to convergence.
Derived quantities include the parameter correlations: \(\sigma_F^2 = \nabla F^{\,T}\, C\, \nabla F\). The test suite checks the straight-line errors against the textbook formulas and shows that 68% of Monte-Carlo fits contain the true value within ±1σ.
CSV format
Comma, semicolon or tab separated. The first row holds column names, and each further row is one measurement. Uncertainty columns are optional. For example:
Length_m,Period_s,Period_err_s 0.20,0.898,0.005 0.40,1.270,0.005 0.60,1.553,0.005
Reading the χ² test
- χ²/ν ≫ 1: either the model is wrong (look for structure in the residuals) or the uncertainties are underestimated.
- χ²/ν ≪ 1: the uncertainties are probably overestimated.
- Residuals should scatter randomly about zero. A curved pattern means a missing term in the model.