37
Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterd [email protected] http:// www.bio.vu.nl/thb Texel, 2013/04/16

Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam [email protected] Texel, 2013/04/16

Embed Size (px)

Citation preview

Page 1: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Art of modellingDEB course 2013

Bas KooijmanDept theoretical biology

Vrije Universiteit [email protected]

http://www.bio.vu.nl/thb

Texel, 2013/04/16

Page 2: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Modelling 1• model: scientific statement in mathematical language “all models are wrong, some are useful”

• aims: structuring thought; the single most useful property of models: “a model is not more than you put into it” how do factors interact? (machanisms/consequences) design of experiments, interpretation of results inter-, extra-polation (prediction) decision/management (risk analysis)

Page 3: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Modelling 2• language errors: mathematical, dimensions, conservation laws

• properties: generic (with respect to application) realistic (precision) simple (math. analysis, aid in thinking) plasticity in parameters (support, testability)

• ideals: assumptions for mechanisms (coherence, consistency) distinction action variables/meausered quantities core/auxiliary theory

Page 4: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Causation

Cause and effect sequences can work in chains A B C

But are problematic in networks A

B C Framework of dynamic systems allow for holistic approach

Page 5: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Dynamic systemsDefined by simultaneous behaviour of input, state variable, outputSupply systems: input + state variables outputDemand systems input state variables + outputReal systems: mixtures between supply & demand systemsConstraints: mass, energy balance equationsState variables: span a state space behaviour: usually set of ode’s with parametersTrajectory: map of behaviour state vars in state spaceParameters: constant, functions of time, functions of modifying variables compound parameters: functions of parameters

Page 6: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Empirical cycle

Page 7: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Modelling criteria

• Consistency dimensions, conservation laws, realism (consistency with data)

• Coherence consistency with neighbouring fields of interest, levels of

organisation

• Efficiency comparable level of detail, all vars and pars are effective

numerical behaviour

• Testability amount of support, hidden variables

Page 8: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Dimension rules

• quantities left and right of = must have equal dimensions

• + and – only defined for quantities with same dimension

• ratio’s of variables with similar dimensions are only dimensionless if addition of these variables has a meaning within the model context

• never apply transcendental functions to quantities with a dimension log, exp, sin, … What about pH, and pH1 – pH2?

• don’t replace parameters by their values in model representations y(x) = a x + b, with a = 0.2 M-1, b = 5 y(x) = 0.2 x + 5 What dimensions have y and x? Distinguish dimensions and units!

Page 9: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Model without dimension problem

Arrhenius model: ln k = a – T0 /Tk: some rate T: absolute temperaturea: parameter T0: Arrhenius temperature

Alternative form: k = k0 exp{1 – T0 /T}, with k0 = exp{a – 1}

Difference with allometric model: no reference value required to solve dimension problem

T-1ln r

ate

Arrhenius plot

Page 10: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Models with dimension problems 1.2.3

• Allometric model: y = a W b

y: some quantity a: proportionality constant W: body weight b: allometric parameter in (2/3, 1) Usual form ln y = ln a + b ln W Alternative form: y = y0 (W/W0 )b, with y0 = a W0

b

Alternative model: y = a L2 + b L3, where L W1/3

• Freundlich’s model: C = k c1/n

C: density of compound in soil k: proportionality constant c: concentration in liquid n: parameter in (1.4, 5) Alternative form: C = C0 (c/c0 )1/n, with C0 = kc0

1/n

Alternative model: C = 2C0 c(c0+c)-1 (Langmuir’s model)

Problem: No natural reference values W0 , c0

Values of y0 , C0 depend on the arbitrary choice

Page 11: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Allometric functions

Length, mmO2 c

onsu

mpt

ion,

μl/

h

Two curves fitted:

a L2 + b L3

with a = 0.0336 μl h-1 mm-2

b = 0.01845 μl h-1 mm-3

a Lb

with a = 0.0156 μl h-1 mm-2.437

b = 2.437

Page 12: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Kleber’s lawO2 consumption weight3/4

O2 consumption has contributions from• maintenance & development• overheads of assimilation, growth & reproduction

These are all functions of weight that should be added

But:

sum of functions of weight allometric function of weightProblem in relating respiration to other activities

Page 13: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Egg development time

Bottrell, H. H., Duncan, A., Gliwicz, Z. M. , Grygierek, E., Herzig, A., Hillbricht-Ilkowska, A., Kurasawa, H. Larsson, P., Weglenska, T. 1976 A review of some problems in zooplankton production studies.Norw. J. Zool. 24: 419-456

)))(ln(3414.0)ln(2193.03956.3exp( 2TTD

Kelvinin etemperatur t timedevelopmen egg

TD

2

2

)(ln

ln)dim(

ln

ln)dim(

ln)dim()))(ln()ln(exp(

K

tc

K

tb

taTcTbaD

Page 14: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

molecule

cell

individual

population

ecosystem

system earth

time

spac

e

Space-time scales

When changing the space-time scale, new processes will become important other will become less importantIndividuals are special because of straightforward energy/mass balances

Each process has its characteristic domain of space-time scales

Page 15: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Complex models

• hardly contribute to insight• hardly allow parameter estimation• hardly allow falsification

Avoid complexity by• delineating modules• linking modules in simple ways• estimate parameters of modules only

Page 16: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Biodegradation of compoundsn-th order model Monod model

nkXXdt

d

1)1(10 )1()(

nn ktnXtX

ktXtXn

0

0

)( kXt /0

}exp{)( 0

1

ktXtXn

n

akXaXt

nn

1

1)(

111

00

XK

XkX

dt

d

ktXtXKXtX }/)(ln{)(0 00

ktXtXXK

0

0

)( }/exp{0 KktXt

}/exp{)( 0

0

KktXtXXK

aKkakXaXt ln)1()( 1100

; ;

X : conc. of compound, X0 : X at time 0 t : time k : degradation rate n : order K : saturation constant

Page 17: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Biodegradation of compoundsn-th order model Monod model

scaled time scaled time

scal

ed c

onc.

scal

ed c

onc.

Page 18: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Plasticity in parameters

If plasticity of shapes of y(x|a) is large as function of a:

• little problems in estimating value of a from {xi,yi}i

(small confidence intervals)

• little support from data for underlying assumptions

(if data were different: other parameter value results, but still a good fit, so no rejection of assumption)

Page 19: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Stochastic vs deterministic models

Only stochastic models can be tested against experimental data

Standard way to extend deterministic model to stochastic one: regression model: y(x| a,b,..) = f(x|a,b,..) + e, with e N(0,2)Originates from physics, where e stands for measurement error

Problem: deviations from model are frequently not measurement errorsAlternatives:• deterministic systems with stochastic inputs• differences in parameter values between individualsProblem: parameter estimation methods become very complex

Page 20: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

StatisticsDeals with• estimation of parameter values, and confidence in these values• tests of hypothesis about parameter values differs a parameter value from a known value? differ parameter values between two samples?

Deals NOT with• does model 1 fit better than model 2 if model 1 is not a special case of model 2

Statistical methods assume that the model is given(Non-parametric methods only use some properties of the given model, rather than its full specification)

Page 21: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Large scatter

• complicates parameter estimation• complicates falsification

Avoid large scatter by• Standardization of factors

that contribute to measurements• Stratified sampling

Page 22: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Kinds of statistics 1.2.4

Descriptive statistics sometimes useful, frequently boring

Mathematical statistics beautiful mathematical construct rarely applicable due to assumptions to keep it simple

Scientific statistics still in its childhood due to research workers being specialised upcoming thanks to increase of computational power (Monte Carlo studies)

Page 23: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Nested models

2210)( xwxwwxy

xwwxy 10)( 0)( wxy 220)( xwwxy

Venn diagram

02 w 01 w

Page 24: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Error of the first kind: reject null hypothesis while it is true

Error of the second kind: accept null hypothesis while the alternative hypothesis is true

Level of significance of a statistical test: = probability on error of the first kind

Power of a statistical test: = 1 – probability on error of the second kind

Testing of hypothesis

true false

accept 1 -

reject 1 -

null hypothesis

dec

isio

nNo certainty in statistics

Page 25: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Statements to remember

• “proving” something statistically is absurd

• if you do not know the power of your test, do don’t know what you are doing while testing

• you need to specify the alternative hypothesis to know the power this involves knowledge about the subject (biology, chemistry, ..)

• parameters only have a meaning if the model is “true” this involves knowledge about the subject

Page 26: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Independent observations

IIf

If X and Y are independent

Page 27: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Central limit theorems

The sum of n independent identically (i.i.) distributed random variables becomes normally distributed for increasing n.

The sum of n independent point processes tends to behave as a Poisson process for increasing n.

yy

YXZ yYPyzXPzZPdyyfyzfzfYXZ )()()(;)()()(

Number of events in a time interval is i.i. Poisson distributedTime intervals between subsequent events is i.i. exponentially distributed

Page 28: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Sums of random variables

)λexp()λ()(

λ)(

)λexp(λ)(

1 yyn

yf

xxf

nY

X

)(Var)(Var;1

i

n

ii XnYXY

)λexp(!

λ)()(

)λexp(!

λ)(

ny

nyYP

xxXP

y

x

Exp

onen

tial p

rob

dens

Poi

sson

pro

b

Page 29: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Normal probability density

2

2 σ

μ

2

1exp

πσ2

1)(

xxf X

μ'μ

2

1exp

π2

1)( 1- xxxf

nX

μ)/σ(x-

σ

σ95%

Page 30: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Parameter estimation

Most frequently used method: Maximization of (log) Likelihood

likelihood: probability of finding observed data (given the model), considered as function of parameter values

If we repeat the collection of data many times (same conditions, same number of data)the resulting ML estimate

Page 31: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Profile likelihoodlarge sample

approximation

95% conf interval

Page 32: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Comparison of modelsAkaike Information Criterion for sample size n and K parameters

12)θ(log2

Kn

nKL

12σlog 2

Kn

nKn

in the case of a regression model

You can compare goodness of fit of different models to the same databut statistics will not help you to choose between the models

Page 33: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Confidence intervals

parameter

estimate

excluding

point 4

sd

excluding

point 4

estimate

including

point 4

sd

including

point 4

L, mm 6.46 1.08 3.37 0.096

rB,d-1 0.099 0.022 0.277 0.023

time, d

leng

th, m

m

ttrLLLtrLLLtL

B

B

smallfor)()exp()()(

00

0

10 LBr

95% conf intervals

correlations amongparameter estimatescan have big effectson sim conf intervals

excludespoint 4

includespoint 4

L

Page 34: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

: These gouramis are from the same nest, These gouramis are from the same nest, they have the same age and lived in the same tank they have the same age and lived in the same tankSocial interaction during feeding caused the huge size differenceSocial interaction during feeding caused the huge size differenceAge-based models for growth are bound to fail;Age-based models for growth are bound to fail; growth depends on food intake growth depends on food intake

No age, but size:No age, but size:

Trichopsis vittatus

Page 35: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Rules for feeding

Page 36: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

time

time time

rese

rve

dens

ityre

serv

e de

nsity

leng

thle

ngth

time 1 ind

2 ind

determinexpectation

Social interaction Feeding

Page 37: Art of modelling DEB course 2013 Bas Kooijman Dept theoretical biology Vrije Universiteit Amsterdam Bas@bio.vu.nl  Texel, 2013/04/16

Dependent observations

Conclusion

Dependences can work out in complex ways

The two growth curves look like von Bertalanffy curves with very different parameters

But in reality both individuals had the same parameters!