Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 46 ยท Getting Started

Types of Models

Sort models into families: deterministic or stochastic, discrete or continuous, empirical or mechanistic. See why the family decides which tools you use.

Doctors do not treat every illness the same way, and modellers do not use the same tool for every question. Before you write any equation it helps to ask: what kind of model is this? The answer narrows your choices from a bewildering toolbox to two or three sensible methods.

This lesson gives you the three main questions that sort almost every model you will meet, and a feel for when each family fits.

What you will learn

  • The difference between deterministic and stochastic models
  • The difference between discrete-time and continuous-time models
  • The difference between empirical and mechanistic (theory-based) models
  • How to pick a family for a new question

Key terms

Deterministic: the same inputs always give exactly the same output.

Stochastic: the model includes chance, so repeated runs give different outputs.

Discrete-time model: time moves in steps (day 1, day 2, ...), and the model gives a rule for the next step.

Continuous-time model: time flows smoothly and the model describes instantaneous rates of change.

Empirical model: a formula fitted to data without explaining why it works. Mechanistic model: built from an understanding of how the system works.

Question 1: is chance part of the story?

A deterministic model has no randomness. If you know the starting state and the rule, the future is fixed. A bank account with a fixed interest rate is deterministic, and so is the leaking tank from the last lesson.

A stochastic model includes chance on purpose. The word comes from a Greek root for "aim" or "guess". You use one when randomness is essential, not just a nuisance: the number of customers arriving at a shop each minute, whether a single seed germinates, or how a pollen grain jiggles in water. (Robert Brown described that jiggling in 1827, and Albert Einstein explained it with a stochastic model in 1905.)

A stochastic model does not predict one future. It predicts a spread of possible futures, so you run it many times and look at averages and ranges. Chapter 7 is all about this.

A good test: "If I ran the real situation twice from the same start, would I expect different outcomes that matter?" If yes, think stochastic. If the differences are tiny compared with the question, a deterministic model is simpler and usually enough.

Question 2: does time tick or flow?

A discrete-time model describes the system at separate moments: end of each month, each generation, each game turn. Its core is a rule for the next step: x(n+1) = f(x(n)). Rules like this are called difference equations.

A continuous-time model treats time as a smooth stream and uses derivatives, giving a differential equation such as dT/dt = โˆ’k (T โˆ’ T_env).

Neither is "more correct". Choose by how the real system behaves and what data you have. Annual census counts of a bird population suit a discrete model, because breeding happens once a year. The cooling of a cup of tea suits a continuous one. Often you can model the same thing both ways and compare. A computer solving a differential equation secretly turns it into small discrete steps, as the tank simulation in the last lesson did.

A two-by-two grid: deterministic or stochastic, discrete or continuous time, with a small example in each cell
Two yes-or-no questions give four families. Real projects often combine them.

Question 3: theory or data?

An empirical model is built by fitting a curve to observations. Johannes Kepler's third law of planetary motion is a classic: he noticed from data that for planets the square of the orbital period is proportional to the cube of the orbit's size, Tยฒ โˆ aยณ. It worked beautifully, but it did not say why.

A mechanistic model starts from how the system works. Isaac Newton's law of gravitation explains Kepler's law, and predicts it for moons, comets and satellites that Kepler never saw.

Empirical Mechanistic
Starts from Data Understanding of the process
Good at Interpolating inside the data range Extrapolating to new situations
Weak at Predicting outside the data Needing knowledge you may not have
Example A polynomial fitted to sales figures Cooling law from heat transfer

Real projects mix them. A mechanistic skeleton with a few parameters fitted to data is the most common recipe, and it is the one you will use most in this course.

Other useful labels

  • Linear or nonlinear: in a linear model, doubling the input doubles the effect. Nonlinear models can show saturation, tipping points and chaos.
  • Static or dynamic: a static model gives one answer (the cheapest mix of ingredients); a dynamic model follows change over time.
  • Analytic or computational: some models have a formula for the answer, others you can only solve by simulation.

Common misconceptions

"Stochastic models are less scientific." They are exactly as rigorous. They describe distributions of outcomes honestly instead of pretending one future.

"Continuous models are more accurate." Accuracy depends on assumptions and data, not on the type. A discrete model of a yearly cycle can beat a continuous one.

"A good curve fit is a good model." A curve can fit the data you have and still fail badly outside it. The next demonstration shows why.

Try it

First, one idea (steady growth of 10% per period) written in all four families. Compare the pictures: the deterministic ones are single lines, the stochastic ones depend on the random seed, so change it and run again.

Python One idea, four model families

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Second, the empirical-versus-mechanistic trap. We create pretend measurements of a cooling object for the first 20 minutes, then fit two models: a quadratic polynomial (empirical) and an exponential cooling law (mechanistic). Both fit well. Then we ask for a prediction at 60 minutes.

Python Empirical fit versus mechanistic fit

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. A model of how many customers walk into a small shop each minute should most likely be:

    Arrivals are random events, and the variation between days matters, so chance should be part of the model.
  2. 2. Which model is discrete-time?

    x(n+1) = 1.05 x(n) is a rule that jumps from one step to the next. The others use derivatives, so time flows continuously.
  3. 3. Kepler's third law, found by studying data without explaining it, is an example of:

    It was fitted to observations. Newton's gravitation later explained why it holds, which is the mechanistic version.
  4. 4. Which is the main weakness of a purely empirical model?

    A flexible curve can follow the data closely and still go wrong where there is no data.
  5. 5. A stochastic model gives:

    You run it many times and summarize the distribution of results, for example with an average and a range.

Summary

  • Three questions sort most models: chance or not, steps or flow, theory or data.
  • Deterministic models give one future, stochastic ones give a spread of possible futures.
  • Discrete models use difference equations, continuous models use differential equations.
  • Mechanistic models extrapolate better, empirical ones are easier to build.
  • The best real models often combine a mechanistic structure with parameters fitted to data.

Next: The Python Modelling Toolkit