Skip to main content

Physics I course sequence · Interactive lesson

Data Analysis & Model Comparison

Measurements arrive as a table. Turning them into a slope with an uncertainty, then reading what the residuals do, is how you decide which of two physical models the data actually supports.

UPI-01.09 · Lesson 9 of 9 in this unit. Position is not a completion score.
Starting model: Data Analysis & Model ComparisonTop panel: five measured (m, T²) points with the line T² = a₀m fitted through the origin, slope a₀ = 1.655 s² kg⁻¹. Bottom panel: the residuals of that fit, magnified 1400 times, against a shaded band of ±σ. At m₀ = 12.5 g the reduced chi-squared is 10.93 while R² is still 0.9985.T² / s²line: T² = a₀m, intercept forced to zerom / kgresiduals of that fit, ×1400; band = ±σ
Start with a picture. Change the model in the lab below.
1

Build the model

Choose the physical mechanism and variables before choosing the fitting function.

y = ax + b

Explanation & assumptions

A model makes a testable claim. Define the controlled variable, measured response, units, assumptions and tested range. In the spring experiment, m is the total attached mass, including the hanger. A massless Hookean spring predicts T² = (4π²/k)m. A spring with effective moving mass predicts an intercept. A calibration or mass offset can also cause an intercept, so the fitted line alone does not identify the mechanism.

2

Turn data into evidence

Record measurements, units and uncertainties. Plot the data and look for trends, outliers and suitable ranges.

x = m (kg), y = T² (s²)

Explanation & assumptions

Use one row for each measurement. State how standard uncertainties were obtained and whether measurements share a calibration error. In this lab, the input uncertainties are independent standard uncertainties in T² and mass error is negligible. If the measured quantity is T, propagate u(T²) ≈ 2T u(T). Constant uncertainty in T therefore does not give constant uncertainty in T². Outliers need investigation, not automatic deletion.

3

Linearise before fitting

Choose a transformation that exposes the model and transforms the uncertainty correctly.

T² = (4π²/k)(m + mₑff)

Explanation & assumptions

For small-amplitude motion in the linear spring regime, plotting T² against m gives slope a = 4π²/k and intercept b = a meff. The slope has units s²/kg, so k has units kg/s² = N/m. The effective mass is b/a, in kg. A uniform spring contributes approximately one third of its own mass in the usual approximation. The fit applies only over the mass and amplitude range tested.

4

Least-squares fitting

Find the line that minimises the weighted sum of squared residuals.

wᵢ = 1/σᵢ²; χ² = Σwᵢrᵢ²

Explanation & assumptions

When all standard uncertainties are equal, a = Σ(xᵢ − x̄)(yᵢ − ȳ)/Σ(xᵢ − x̄)² and b = ȳ − ax̄. With unequal uncertainties, use weighted means and weighted sums. Larger standard uncertainty means less weight. The through-origin constraint instead gives a₀ = Σwᵢxᵢyᵢ/Σwᵢxᵢ². It should be imposed because of defensible physics, not because the line looks neater. Significant x errors require a different fitting method.

5

Residual analysis

Look for curvature, tilt or changing spread, not just a line that passes near the points.

rᵢ = yᵢ − (axᵢ + b)

Explanation & assumptions

Residuals retain the units of y. Curvature may suggest an omitted term; a tilt after forcing the origin may suggest an offset; changing spread may indicate nonconstant variance. None uniquely identifies the cause: calibration, correlations and chance also matter. Lack of an obvious pattern is useful evidence, not proof that the model is correct. With a free intercept, Σwᵢrᵢ = 0; only for equal weights does this imply Σrᵢ = 0.

6

Uncertainty in parameters

Report slope and intercept uncertainties, and keep their covariance when propagating to new quantities.

k = 4π²/a; mₑff = b/a

Explanation & assumptions

This lab treats σᵢ as known standard uncertainties. Define S = Σwᵢ and Q = Σwᵢ(xᵢ − x̄w)². Then uₐ² = 1/Q, ub² = 1/S + x̄w²/Q and cov(a, b) = −x̄w/Q. Do not multiply this covariance by reduced χ². If a common unknown noise variance is instead estimated from residuals, use s² = Σrᵢ²/(N − 2) and uₐ = s/√Σ(xᵢ − x̄)²; that is a different assumption. For k, uₖ = (4π²/a²)uₐ. For b/a, include the covariance term; the slope and intercept are not independent.

7

Goodness of fit (χ²)

Compare residual size with the stated errors, allowing for fitted parameters and sample size.

χ²ᵣ = χ²/ν; ν = N − p

Explanation & assumptions

The free-intercept line uses p = 2; the origin-constrained line uses p = 1. Under a correct model with independent Gaussian known errors, reduced χ² has expectation 1 and standard deviation √(2/ν). With few points it fluctuates substantially. Large values can reflect missing physics, underestimated uncertainties, outliers or correlation. Small values can reflect conservative uncertainties, correlations or chance. A value near 1 does not certify a model, and ν = 0 gives no reduced χ².

8

Compare parameters

Ask whether independent estimates differ meaningfully relative to their uncertainties.

t′ = |A − B| / √(uₐ² + uᵦ²)

Explanation & assumptions

For independent estimates, divide their absolute difference by the standard uncertainty of that difference. If the estimates are correlated, include −2 cov(A, B) inside the square root. This standardized difference is not automatically a Student t-test. Two or three standard uncertainties are context-dependent heuristics, not universal rules that prove agreement or a real difference. The assumptions and uncertainty quality matter.

9

Compare models

Fit the same data, inspect residuals and justify any additional parameter physically.

Δχ² = χ²origin − χ²free

Explanation & assumptions

For these nested linear models with known independent Gaussian errors, Δχ² = (b/ub)². Under the zero-intercept null, an extra fitted parameter reduces χ² by one on average; this is an expectation, not a guaranteed improvement or a decision rule. Compare the reduction with the added flexibility and use independent evidence. R² values must use the same definition to be comparable. In the worked example, both models have high centered R², but the constrained model has a much larger χ² and a residual tilt.

10

State the limits

Report the tested range, assumptions, uncertainties and what has not been established.

Measure → model → test → revise

Explanation & assumptions

The worked example covers 0.100–0.500 kg. Small-amplitude, Hookean behaviour, negligible mass error and independent T² uncertainties are assumed. Large amplitudes, permanent deformation, damping and correlated calibration errors are not tested here. Report estimates with units, sensible rounding, uncertainties and residual evidence. A successful fit supports a model within those conditions; it does not justify extrapolation or establish causation.

Interactive lab: spring model comparison

Fit a free-intercept line and a through-origin line to the same measurements.

Teaching simulation · Worked example · five synthetic points. Not a real experiment.

Spring parameters

k and effective mass apply when you generate new data.

σ updates all error bars without moving points. New data use this σ for independent Gaussian noise in T².

Squared period against mass

-0.070.190.440.690.940.000.140.270.410.54Attached mass, m (kg)Squared period, T² (s²)
Teaching dataFree interceptThrough origin
Error bars: ±1 standard uncertainty in T². Mass uncertainty is assumed negligible. Lines are shown only across the measured mass range.

Residuals against mass

-7.54e-3-4.02e-3-5.00e-43.02e-36.54e-30.000.140.270.410.54Attached mass, m (kg)Residual, r (s²)
Free-intercept residuals
Error bars: ±1 standard uncertainty in T². Mass uncertainty is assumed negligible. A pattern suggests a problem; it does not uniquely identify its cause.

Fit results · free intercept

Slope, a (s²/kg)
1.600 ± 0.009
Intercept, b (s²)
0.0200 ± 0.0031
Spring constant, k (N/m)
24.67 ± 0.15
Effective mass (g)
12.50 ± 2.03
Parameter uncertainties are 1σ, conditional on this model and the stated measurement errors.

Goodness of fit

χ²
3.333
Degrees of freedom ν = N − 2
3
Reduced χ²
1.111
Centered weighted R²
0.999883
R² describes the spread explained; it does not validate the model.
Same data and uncertainties · two nested linear models
ComparisonFree interceptThrough origin
Fitted parameters21
Reduced χ²1.11110.934
Centered weighted R²0.9998830.998463
χ² decrease for one extra parameter40.404

The offset substantially improves this fit under the stated error assumptions. Check residuals and independent physics before attributing it to spring mass.

Known, independent σ values; negligible mass error. No rescaling by reduced χ². Both R² values use the same centered weighted denominator; R² can be negative or undefined. Parameter errors are conditional, not a measure of model truth.

Original two-slider exploration

This independent five-point tool changes effective mass and the stated uncertainty while fitting only the through-origin model. Its settings are not linked to the new lab. The lower panel is schematic: shading represents ±1 stated σ, not a confidence interval on the fit. Its fixed residual scale may clip points at the extremes.

Interactive model
12.5 g
3.0 ×10⁻³ s²

A high R² does not validate the model. Stated uncertainty changes χ² without moving the measurements; an offset is not uniquely attributable to spring inertia.

Interactive physics modelOriginal through-origin exploration: increase the omitted effective mass and inspect the residual tilt. The lower graph uses a different vertical scale; it is not a separate measurement.T² / s²line: T² = a₀m, intercept forced to zerom / kgresiduals (different scale); band = ±σ

FITTED SLOPE a₀1.655 s² kg⁻¹

k FROM a₀23.86 N m⁻¹

REDUCED χ²10.93

R²0.9985

Live interpretationFITTED SLOPE a₀: 1.655 s² kg⁻¹. k FROM a₀: 23.86 N m⁻¹. REDUCED χ²: 10.93. R²: 0.9985

Worked examples

The same five-point dataset is used in the lab and the Medium and Hard examples.

Easy · Linearise a spring measurement

A 0.300 kg mass takes 14.17 s for 20 oscillations. Linearise the spring model and estimate k from this single point.

View full solution →
  1. T = 14.17/20 = 0.7085 s; T² = 0.50197225 s².
  2. T² = (4π²/k)m. With a zero intercept imposed, a₀ = T²/m = 1.67324 s²/kg.
  3. k = 4π²/a₀ = 23.594 N/m, reported as 23.6 N/m.
  4. A single point cannot test the zero-intercept assumption or estimate goodness of fit. If the 20-period timing has standard uncertainty 0.06 s and mass error is negligible, u(T) = 0.003 s and u(k) ≈ 0.20 N/m.

k ≈ 23.6 N/m, conditional on a zero intercept.

Medium · Fit the five-point dataset

Fit (m, T²) = (0.100, 0.182), (0.200, 0.337), (0.300, 0.502), (0.400, 0.657), (0.500, 0.822), in kg and s². Every T² has known standard uncertainty 0.003 s².

View full solution →
  1. x̄ = 0.300 kg, ȳ = 0.500 s². The sums are Σ(xᵢ − x̄)² = 0.100 kg² and Σ(xᵢ − x̄)(yᵢ − ȳ) = 0.1600 s² kg.
  2. a = 1.600 s²/kg; b = 0.500 − 1.600(0.300) = 0.0200 s². Residuals are +0.002, −0.003, +0.002, −0.003, +0.002 s².
  3. With known σ = 0.003 s², uₐ = 0.003/√0.100 = 0.0094868 s²/kg and ub = 0.003√(1/5 + 0.300²/0.100) = 0.0031464 s². These are not rescaled using residual scatter.
  4. χ² = 3.3333, ν = 5 − 2 = 3, reduced χ² = 1.1111. The intercept lies 0.0200/0.0031464 = 6.36 standard uncertainties from zero.
  5. k = 4π²/a = 24.6740 N/m with uₖ = 0.1463 N/m. The two fitted parameters have covariance −0.000027 s⁴/kg; retaining it gives meff = 12.50 ± 2.03 g.

a = 1.600 ± 0.009 s²/kg; b = 0.0200 ± 0.0031 s²; k = 24.67 ± 0.15 N/m (1σ).

Hard · Compare models and test a parameter

Refit the same five points through the origin. Compare with the free-intercept model, then check against an independent static estimate kₛ = 24.90 ± 0.25 N/m.

View full solution →
  1. Through the origin: a₀ = Σmᵢyᵢ/Σmᵢ² = 0.9100/0.5500 = 1.654545 s²/kg. Residuals are approximately +0.01655, +0.00609, +0.00564, −0.00482, −0.00527 s².
  2. χ²origin = 43.7374, ν = 4 and reduced χ² = 10.9343. The free fit has χ² = 3.3333, ν = 3 and reduced χ² = 1.1111.
  3. Δχ² = 40.4040 for one additional parameter. Together with the residual tilt of the constrained model, this is substantial evidence against the zero-intercept restriction under the stated errors.
  4. The origin model gives k₀ = 23.8606 ± 0.0583 N/m. Its narrow conditional uncertainty is not evidence of accuracy: the model does not fit well.
  5. The free-fit effective mass is 12.50 ± 2.03 g. Under the uniform-spring approximation, the spring mass would be about 37.5 ± 6.1 g. Check the spring, hanger and calibration independently; an intercept alone does not prove inertia.
  6. Compare free-fit k with the independent static result: t′ = |24.6740 − 24.90|/√(0.1463² + 0.25²) = 0.78. They are compatible at this precision, not proven identical.

The free-intercept model is better supported; its spring constant is compatible with the independent static estimate.

Quick check

Five questions · practice for this visit only

1If residuals show a clear curved pattern, what should you investigate first?
Review or reset practice

This practice does not change saved course progress. Refresh starts a new session.

Exam-style practice

Original practice tasks, not questions from a particular examination board.

1. Investigate a spring experimentally

Use the five-point dataset above. Define the variables and assumptions; fit both models; assess the residuals and χ²; report k and its uncertainty. Propose an independent test of the offset.

Suggested solution & marking points
  1. Plot mass in kg and T² in s²; include ±0.003 s² bars and negligible mass uncertainty as an assumption.
  2. Obtain a = 1.600 s²/kg and b = 0.0200 s². Use ν = 3 for the free fit and ν = 4 for the origin fit.
  3. Compare reduced χ² of 1.11 and 10.93, together with the constrained residual tilt.
  4. Report k = 24.67 ± 0.15 N/m, with standard uncertainty and the stated model conditions.
  5. Check the hanger, calibration and spring mass independently. State the 0.100–0.500 kg range; do not infer behaviour outside it.

2. Test a model with curved residuals

Choose “Curved relationship” in the lab. Does adding an intercept repair the line? Explain how you would test an alternative functional form without declaring the model correct from R² alone.

Suggested solution & marking points

The data include a quadratic term, so a free intercept cannot generally remove the curved residual pattern. A physically motivated nonlinear term is a candidate, but calibration and uncertainty assumptions must also be checked. Fit alternatives to the same data, account for extra parameters, inspect residuals and test predictions on independent measurements. Avoid extrapolation beyond the measured range.

Summary: a fit is a claim, not a verdict

  • Start from physics, define the measurement and transform its uncertainty consistently.
  • Use the correct weights, quote parameter uncertainties and preserve covariance.
  • Read residuals and χ² together. Compare like with like and charge for extra flexibility.
  • State the range, assumptions, limitations and independent checks.
Method details, formula sheet & sources

All lab data are synthetic teaching data. Fits use known, independent standard uncertainties in T²; parameter covariance is not rescaled by reduced χ².

S = Σwᵢ; Q = Σwᵢ(xᵢ − x̄w)²
uₐ² = 1/Q; uᵦ² = 1/S + x̄w²/Q
cov(a,b) = −x̄w/Q
u²(mₑff) = uᵦ²/a² + b²uₐ²/a⁴ − 2b cov(a,b)/a³

For a through-origin fit, u²(a₀) = 1/Σwᵢxᵢ². Both descriptive R² values use 1 − χ²/Σwᵢ(yᵢ − ȳw)². With no spread in y, R² is undefined. Reciprocal and ratio propagation is a first-order approximation and becomes unreliable for a poorly constrained slope.

Reviewed for this lesson on 28 September 2026. This review does not certify alignment to a school syllabus.

Extra challenging questions

Connect several ideas, explore supplied data, and compare your reasoning with a worked solution.