11 Mathematical Modeling

A structured guide to selecting, fitting, interpreting, validating, and responsibly applying mathematical models to real-world data.

The

A represents a real situation for a particular purpose; it is not the situation itself. It can be used to estimate a quantity, compare alternatives, describe a trend, or support a decision.

The provides a disciplined workflow:

  1. Define the question: decide what must be estimated, predicted, compared, or optimized.

  2. Identify the variables: specify the input or explanatory variables and the output or response variable.

  3. Collect and examine data: organize observations, graph them, and look for patterns, unusual values, and changes in spread.

  4. Select a model: choose a function whose shape and assumptions fit the context.

  5. Fit the model: estimate parameter values so that predictions agree reasonably with observations.

  6. Interpret and validate: explain parameters in context and inspect errors or residuals.

  7. Use the model appropriately: restrict predictions to a reasonable domain and state limitations.

A useful model must do more than match existing points. Its assumptions should make sense, its variables should have clear meanings and units, and its predictions should address the original question.

Takeaway: Modeling combines mathematical fit with contextual judgment; a close fit alone is not enough.

Selecting a Function Model

Model selection should use both numerical patterns and the mechanism suggested by the context. A function's domain must contain only meaningful inputs, and its range should reflect possible outputs.

Common patterns include:

  • A constant model, y=ay=a, for an output that remains approximately unchanged.

  • A , y=mx+by=mx+b, for approximately constant additive change.

  • A quadratic model, y=ax2+bx+cy=ax^2+bx+c, for curved change with one possible turning point.

  • A polynomial model, y=anxn+⋯+a1x+a0y=a_nx^n+\cdots+a_1x+a_0, for more complicated smooth variation.

  • An , y=abxy=ab^x or y=Aekxy=Ae^{kx}, for approximately constant multiplicative or percentage change.

  • A logarithmic model, y=a+bln⁡xy=a+b\ln x, for rapid initial change that slows as the input increases.

  • An inverse-variation model, y=kxy=\frac{k}{x}, when the product of the variables is approximately constant.

  • A sinusoidal model, y=Asin⁡(Bx+C)+Dy=A\sin(Bx+C)+D, for repeating behavior.

For values near 100,110,120,130100,110,120,130, the successive differences are approximately constant, supporting a . For values near 100,110,121,133.1100,110,121,133.1, the successive ratios are approximately constant:

110100=1.10,121110=1.10,133.1121=1.10.\frac{110}{100}=1.10,\qquad \frac{121}{110}=1.10,\qquad \frac{133.1}{121}=1.10.

An with a growth factor near 1.101.10 is more appropriate in the second case. A model can be reasonable over a short interval while becoming inappropriate for long-term prediction.

Takeaway: Differences suggest additive change, ratios suggest multiplicative change, and context determines whether the pattern is credible.

Fitting Functions to Data

Fitting means choosing parameter values so that model outputs are close to observed data. A fitted prediction can be written as

y^=f(x;θ^),\hat y=f(x;\hat\theta),

where θ^\hat\theta denotes estimated parameters.

For a ,

y^=mx+b,\hat y=mx+b,

mm is the estimated rate of change, measured in output units per input unit. The intercept bb is the predicted output at x=0x=0, but only when that input is meaningful and relevant to the data range.

chooses the parameters that minimize

∑i=1n(yi−y^i)2.\sum_{i=1}^{n}(y_i-\hat y_i)^2.

For example, suppose electricity use EE, measured in kilowatt-hours, is modeled from average temperature TT, measured in degrees Celsius, by

E^=18T+420.\hat E=18T+420.

The slope predicts an increase of approximately 1818 kilowatt-hours for each one-degree increase in average temperature over the observed range. At T=12T=12,

E^=18(12)+420=636.\hat E=18(12)+420=636.

The predicted use is approximately 636636 kilowatt-hours.

Nonlinear parameters can be estimated numerically. For an exponential relationship y=abxy=ab^x, taking natural logarithms gives

ln⁡y=ln⁡a+xln⁡b.\ln y=\ln a+x\ln b.

If a fitted line for ln⁡y\ln y against xx is ln⁡y=c+dx\ln y=c+dx, then a=eca=e^c and b=edb=e^d. This transformation requires positive response values and can change the weighting of errors, so the result should be checked in the original units.

Takeaway: Fitting produces parameter estimates, but interpreting those estimates requires units, a meaningful domain, and awareness of how the fitting method weights errors.

Residuals and Model Validation

A compares an observed value with the value predicted by the model:

ei=yi−y^i.e_i=y_i-\hat y_i.

Positive residuals indicate underprediction; negative residuals indicate overprediction. Residuals represent the part of the response not explained by the fitted model.

A plot should generally show points scattered around zero without a systematic pattern. Important checks include:

  • Randomness: a curve or trend suggests that the model misses structure.

  • Constant spread: a funnel shape suggests that variability changes across the input range.

  • Outliers: an unusually large may indicate an unusual observation, measurement problem, or missing feature.

  • Dependence: runs, trends, or cycles in time-ordered residuals suggest that the model has not captured a time effect or another relationship.

Two common error summaries are the mean absolute error and root mean square error:

MAE=1n∑i=1n∣ei∣\mathrm{MAE}=\frac{1}{n}\sum_{i=1}^{n}|e_i|

and

RMSE=1n∑i=1nei2.\mathrm{RMSE}=\sqrt{\frac{1}{n}\sum_{i=1}^{n}e_i^2}.

Both are expressed in the original output units. Mean absolute error gives the average absolute error, while root mean square error penalizes large errors more strongly.

The , denoted by R2R^2, can summarize explained variation for a particular data set and definition. However, a high R2R^2 does not prove that the model is appropriate, causal, or reliable outside the observed range.

Takeaway: patterns often reveal model problems that a single goodness-of-fit number can hide.

Interpreting Parameters and Assumptions

Parameters must be interpreted with their units, associated variables, and model assumptions. For the

P(t)=P0bt,P(t)=P_0b^t,

P0P_0 is the predicted value when t=0t=0, and bb is the multiplicative factor for each one-unit increase in tt. If b>1b>1, the model represents growth; if 0<b<10<b<1, it represents decay. The percentage change per time unit is

(b−1)×100%.(b-1)\times100\%.

For

P(t)=240(1.06)t,P(t)=240(1.06)^t,

the initial value is 240240, and the predicted increase is 6%6\% per time unit. After four time units,

P(4)=240(1.06)4≈302.97.P(4)=240(1.06)^4\approx302.97.

The prediction is approximately 303303 units, subject to the model's assumptions.

examines how much predictions change when parameters or assumptions change. This matters especially for long-term predictions, because a small parameter change can produce a large difference after repeated growth or decay.

Association between variables does not by itself establish causation. A fitted relationship can support prediction without proving that changing one variable causes a change in another.

Takeaway: A parameter's numerical value is meaningful only when its role, units, interpretation, and uncertainty are made clear.

Using Models Responsibly

estimates a value inside the observed input range and is usually more reliable because the model is used where it was fitted. predicts outside that range and is riskier because the relationship, variability, or mechanism may change.

Before relying on a prediction, ask:

  • Is the data representative of the situation?

  • Are the measurements accurate and sufficiently numerous?

  • Were important variables omitted?

  • Are assumptions about independence, variability, or growth reasonable?

  • Is the input domain restricted by physical, practical, or mathematical constraints?

  • Could an outlier or influential observation control the fitted parameters?

  • Do residuals show curvature, changing spread, dependence, or cycles?

  • Does the conclusion claim causation without an appropriate study design?

Consider the fitted advertising-sales relationship

y^=−0.04x2+1.8x+12,\hat y=-0.04x^2+1.8x+12,

where xx is advertising spending in hundreds of dollars and yy is weekly sales in hundreds of dollars. The negative quadratic coefficient indicates diminishing increases and a turning point. For y=ax2+bx+cy=ax^2+bx+c, the vertex input is

x=−b2a=−1.82(−0.04)=22.5.x=-\frac{b}{2a}=-\frac{1.8}{2(-0.04)}=22.5.

The model predicts its maximum at approximately x=22.5x=22.5, corresponding to 2,2502{,}250 dollars in advertising. The predicted sales are

y^=−0.04(22.5)2+1.8(22.5)+12=32.25,\hat y=-0.04(22.5)^2+1.8(22.5)+12=32.25,

or approximately 3,2253{,}225 dollars in weekly sales. This does not prove that spending exactly 2,2502{,}250 dollars causes maximum sales. The conclusion is justified only over the data-supported range and after checking residuals, error measures, influential observations, and the quality of the data.

A responsible conclusion states the prediction, the domain, the assumptions, and the limitations. A model can be useful without being exact when its purpose and conditions of use are explicit.

Takeaway: Prefer when appropriate, treat cautiously, and report both what the model predicts and when that prediction is credible.