← Learning map

MATHEMATICAL MODELING WORKSHOP / 02

A good fit, an uncertain future

Can early observations identify a long-run carrying capacity?

About 150 minutesSynthetic teaching experimentv1.0.0Reading local draft…
Learning objectives & prerequisites

Least squares, derivatives and arrays. Review Notes 1, 3 and 4.

  • Separate calibration, prediction and retrospective diagnosis.
  • Explain why early logistic growth poorly constrains K.
  • Use residuals and a loss surface to challenge a fit.

01 / 08 · 10 MIN

Observe

A synthetic population is observed every half day for 20 days. A logistic generator starts with 5 individuals; additive Gaussian observation noise is added with a fixed seed. Observations may include unrealistic values under large noise: that reveals an observation-model assumption, not a negative latent population.

YOUR TURN

Sketch early growth and late saturation. Which part contains information about capacity?

02 / 08 · 10 MIN

Ask

The inferential target is K, but the decision may concern a future population. A model can predict the next day reasonably while leaving K uncertain. State whether your objective is parameter estimation or extrapolation before choosing a metric.

YOUR TURN

Define the forecast horizon and acceptable error. Explain why calibration error alone is insufficient.

03 / 08 · 15 MIN

Assume

Hold the initial population at 5 and assume independent, constant-variance additive errors. Choosing least squares encodes those modeling preferences. The generator is known only because this is a teaching experiment; real-data work must justify the observation mechanism separately.

YOUR TURN

Record the units of r and K and two reasons the noise assumption might fail.

04 / 08 · 20 MIN

Formulate

Integrate dP/dt=rP(1−P/K) with P(0)=5 to obtain the displayed trajectory. For P much smaller than K the factor 1−P/K is nearly one. Many capacities then produce almost the same exponential-like observations, creating a flat direction in the loss surface.

P(t)=K1+(K/P01)ert,L(r,K)=iT(P(ti;r,K)yi)2P(t)=\frac{K}{1+(K/P_0-1)e^{-rt}},\qquad L(r,K)=\sum_{i\in\mathcal{T}}(P(t_i;r,K)-y_i)^2
YOUR TURN

Derive the early-time approximation and predict the orientation of the low-loss region.

05 / 08 · 15 MIN

Design

Fit only observations at or before the selected calibration end time. Everything later is held out. Compare logistic and fixed-initial-value exponential fits on those future rows. The full-data fit is displayed as retrospective diagnosis and must never be reported as an honest held-out predictor.

YOUR TURN

Write the data-splitting rule and compute how many calibration and held-out observations the default setting has.

06 / 08 · 25 MIN

Experiment

Complete the logistic predictor. Compare calibration ending at days 2, 8 and 16 with the same generated dataset and seed. Inspect the fitted K, held-out RMSE, residuals and parameter surface; the condition number is a local diagnostic, not a confidence interval.

YOUR TURN

Record whether low calibration error coincides with accurate K. Repeat with noise=0 and noise=5.

07 / 08 · 25 MIN

Challenge

The optimizer can converge to a point inside a long shallow valley. That is successful numerical optimization and weak statistical information at the same time. Extending the time window or measuring density dependence can be more informative than tightening solver tolerances.

YOUR TURN

Design an additional observation time that would distinguish two low-loss parameter pairs.

08 / 08 · 15 MIN

Communicate

Report the split, fitted parameters, predictive error and evidence about identifiability. Describe how knowing the synthetic truth helped audit the method. A fit to this generator does not establish logistic growth in a real species.

YOUR TURN

Write a claim–evidence table separating parameter recovery, prediction and real-world validity.

Need a little guidance?

1. Concept hint

Check P(0)=5 and the limit P(t)→K before fitting anything.

2. Mathematical / algorithm hint

The denominator is 1+(K/5−1)exp(−rt). Use arrays without looping over observations.

3. Reference implementation guide

Read the reference predictor; keep calibration and held-out rows separate.

Compare the reasoning before applying it. Your current code is backed up before replacement.

Experiment protocol: comparison, failure & extension

Required comparison

Use the same seed and compare day-2, day-8 and day-16 calibration windows.

Failure experiment

With day-2 data, converged fits can give weakly constrained capacity.

Research extension

Add a profile-loss analysis for K or redesign observation times under a fixed measurement budget.

PYTHON WORKBENCH

Predict. Then run.

Parameters & random seed

Edit directly above or open the syntax-highlighting editor. The starter's unfinished student_model should fail relevant checks; use your derivation to complete it.

The runtime downloads only when started. Each experiment uses a fresh namespace and a 30-second limit.

Unable to load? Download the standalone notebook and run it in Python with NumPy, SciPy and Matplotlib. Reference notebook

Connect this lesson to your bookshelf.

Confirm draft change

Baseline and my run

The baseline uses the specified synthetic data; the right column shows only your last completed run.