Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

99
What is ecotoxicology? Dose-response modelling Parameter inference Mathematical modelling in ecotoxicology Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29, 2020 [email protected] 1/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Transcript of Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

Page 1: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

Mathematical modelling in ecotoxicology

Sandrine CHARLES (UCBL - LBBE)

M1 BEE@Lyon - September 29, 2020

[email protected]

1/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 2: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

What is ecotoxicology?IntroductionMonospecific toxicity testsCritical Effect Concentrations

Dose-response modellingGeneral pointsDeterministic partStochastic part

Parameter inferenceGeneral pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

2/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 3: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Table of content

What is ecotoxicology?

Dose-response modelling

Parameter inference

3/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 4: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Detailed content

What is ecotoxicology?IntroductionMonospecific toxicity testsCritical Effect Concentrations

4/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 5: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Ecosystems are under...

...environmental pressuredue to variations in temperature, flow, conductivity...

5/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 6: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Ecosystems are under...

...ecological pressuredue to competition, predation, resource availability...

6/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 7: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Ecosystems are under...

...chemical pressuredue to massive rejection of xenobiotics in air, soil and water

7/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 8: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Ecotoxicology

I A scientific field at the bridge of chemistry, toxicology andecology

“The branch of toxicology concerned with the study of toxic effects,caused by natural or synthetic pollutants, to the constituents ofecosystems, animals (including humans), vegetables andmicroorganisms, in an integrated context” [Truhaut, 1977]

“Ecology in the presence of toxicants” [Chapman, 2002]

I In ecotoxicology, the answer of the ecosystem toenvironmental perturbations (physical, chemical and/orbiological) is studied in all compartments of the biosphere(air, soil and water) and at all levels of biological organization[Walker et al., 2006]

8/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 9: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

From one level of organization to the next

Depending on the level of biological organization, answers tochemical pressure may strongly differ [Clements, 2000]

9/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 10: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

From one level of organization to the next

Depending on the level of biological organization, answers tochemical pressure may strongly differ [Clements, 2000]

10/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 11: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

A key challenge in ecotoxicology:Extrapolating from one level to the next

I From the individual level...• Time-dependent effect modelling;• Identify critical life history traits;• Identify chemical modes of action;

I ... to the population level...• Population dynamic modelling including individual effect

models;• Identify critical demographic parameters;

I ... to the community level• Species distribution modelling;• Model community functioning accounting for ecological

interactions.

11/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 12: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

A variety of experimental devices

[Caquet et al., 1996]

12/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 13: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

A variety of experimental devices

[Caquet et al., 1996]

13/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 14: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Modelling at the individual level

I Estimating individual toxicity indices;

I Accounting for the individual variability.

14/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 15: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Modelling at the individual level

I Estimating individual toxicity indices;

I Accounting for the individual variability.

I Choose the appropriate model according to the data andto the research question;

I Choose an inference method for estimating model parameters.

15/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 16: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Detailed content

What is ecotoxicology?IntroductionMonospecific toxicity testsCritical Effect Concentrations

16/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 17: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Definition of toxicity tests or bioassays

I Bioassay is a word commonly used instead of biological assayor toxicity tests. It’s a particular type of scientificexperiment.

I Bioassays are typically conducted to measure the effects ofpotentially toxic substances on living organisms.

I Bioassays can be• qualitative: dedicated to assess physical effects of a substance

that cannot be quantified (e.g., abnormality or deformity).

• quantitative: dedicated to estimate the potency of asubstance by measurement of the biological response/effect itproduces; quantitative bioassays are typically analyzed usingstatistical methods.

17/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 18: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Definition of toxicity tests (continued)

Several kind of substances can be studied, for example:

I Pesticides, chemical, pharmaceutical, cosmetic substances;

I Effluents (industrial discharges, outputs from water plants);

I Polluted soils, waste, sewage sludge, sediments.

According to the substance, different kinds of experiments can beconducted:

I A control versus one treatment;

I A control and several treatments.

A treatment can be a fixed concentration of a substance (C1,C2...) or a time-variable concentration C (t).

18/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 19: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Acute vs. chronic quantitative bioassays

I Acute toxicity: from some hours to some days (e.g., survivalor mobility inhibition)→ short-time exposure at high concentrations;→ rapid impact on organisms.

I Chronic toxicity: from some days to some weeks (e.g.,growth or reproduction inhibition, sub-individual biomarkers)→ long-time exposure at low concentrations.

19/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 20: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Standard experimental designUnder standardized protocols, individuals are counted over time,that is at regular time pointsEndpoints can be survival, growth and/or reproduction for example.

20/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 21: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Example of a toxicity test

Daphnia magna, acute immobilisation test (OECD 202, 1984) andchronic reproduction test (OECD 211, 2012)

Daphnia magna

Acute test: the number of immobiledaphnids is determined for each con-centration at 24 and 48 hours.

Chronic test: offsprings are dailycounted during 21 days.

21/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 22: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Example of survival dataEffect of chlordane on D. magna survival during 21 days(10 replicates of 1 individual):

2.9 7

0.73 1.82

0 0.18

0 1 2 3 4 5 6 7 8 9101112131415161718192021 0 1 2 3 4 5 6 7 8 9101112131415161718192021

0

1

0

1

0

1

Time

Num

ber

of s

urvi

vors

22/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 23: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Example of reproduction dataEffect of chlordane on D. magna reproduction during 21 days(10 replicates of 1 individual):

2.9 7

0.73 1.82

0 0.18

0 1 2 3 4 5 6 7 8 9101112131415161718192021 0 1 2 3 4 5 6 7 8 9101112131415161718192021

0

20

40

60

80

100

120

0

20

40

60

80

100

120

0

20

40

60

80

100

120

Time

Cum

ulat

ed N

umbe

r of

offs

prin

g

2.9 7

0.73 1.82

0 0.18

0 1 2 3 4 5 6 7 8 9101112131415161718192021 0 1 2 3 4 5 6 7 8 9101112131415161718192021

0

20

40

60

80

100

120

0

20

40

60

80

100

120

0

20

40

60

80

100

120

Time

Cum

ulat

ed N

umbe

r of o

ffspr

ing

23/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 24: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Detailed content

What is ecotoxicology?IntroductionMonospecific toxicity testsCritical Effect Concentrations

24/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 25: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Standard analyses of toxicity test dataDerive Critical Effect Concentrations

also called ”summary statistics of toxicity” or ”thresholds”.

→ Most common indicators to quantitatively assess risks for singlespecies exposed to single contaminants.

→ Estimation of the exposure level (e.g., concentration) abovewhich adverse effects can occur on organisms, and below whichadverse effects are unlikely, i.e., which can not be distinguishedfrom background noise [OECD, 2006].

OECD (2006). Current approaches in the statistical analysis of ecotoxicity data: aguidance to application. Technical report ENV/JM/MONO(2006)18.

25/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 26: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Determination of a NOECBased on hypothesis tests

I NOEC: “No Observed Effect Concentration” :Maximal dose (or concentration) without any observedadverse effect.

I LOEC: “Lowest Observed Effect Concentration” :Minimal dose (or concentration) with an observed adverseeffect.

Example for a continuous variable normally distributed:Dunnett’s test for a global comparison of the observed mean inevery non-control groups to the observed mean in the control group(with correction of α risk due to multiple comparisons).

26/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 27: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Shortcomings of the NOEC

Severely criticized for multiple disadvantages

I necessarily one of the tested concentrations (hence stronglydependent on the experimental design);

I based on a wrong interpretation of the p-value (absence ofevidence is not evidence of absence);

I strongly dependent on the sample size→ unprotectrive with small sample sizes: the lower the samplesize, the higher the NOEC;

I cannot always be determined (e.g., if the first concentrationleads to a significant difference);

I no uncertainty limits are associated.

27/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 28: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

x% effective or lethal concentrations

Alternative to the NOEC, now strongly recommended.→ obtained by fitting a dose-response model to toxicity test dataat a chosen target time point, then deriving the dose whichcorresponds to a given effect level (usually 10, 20 or 50%).

Advantages of ECx or LCx

I capture and account for thewhole dose-response curve;

I slightly dependent on theexperimental design;

I may be associated touncertainty limits.

Shortcomings of ECx or LCx

I sometimes technicaldifficulties when fitting;

I choice of a model;

I choice of an effect level x ;

I choice of the exposureduration.

28/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 29: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

IntroductionMonospecific toxicity testsCritical Effect Concentrations

Example of LCx estimationUse of survival data at the end of the experiment (day 21)

0.00

0.25

0.50

0.75

1.00

0.18 0.73 1.82 2.9 7Concentration

Sur

viva

l pro

babi

lity

median 2.5% 97.5%

LC5 0.22 0.0074 0.71LC10 0.41 0.033 1.04LC20 0.82 0.16 1.6LC50 2.67 1.50 5.3

29/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 30: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Table of content

What is ecotoxicology?

Dose-response modelling

Parameter inference

30/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 31: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Detailed content

Dose-response modellingGeneral pointsDeterministic partStochastic part

31/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 32: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Dose or Concentration-response or effect relationships?

A few vocabulary:

I Dose refers to the internal concentration, i.e., the amount oftoxicant within the body of organisms. But in ecotoxicology,only the exposure concentration is usually known.→ We rather speak about concentration-response or effectrelationships.

I Concentration-response relationships refer to the linkbetween the exposure concentration and the proportion ofindividuals responding with an all-or-none effect.

I Concentration-effect relationships refer to the link betweenthe exposure concentration and the magnitude of the inducedbiological change, measured in appropriate units.

32/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 33: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Definition

A concentration-response/effect relationship is a simple X -Ygraph relating increasing levels of exposure (X ) to theresponse/effect (Y ) at a certain exposure time.

Examples of responses:

I Quantal data, expressed as proportion or probability (e.g.,mortality or immobilization).

Examples of effects:

I Ordered descriptive categories (e.g., severity of a lesion);

I Counts (e.g., reproduction products like eggs or clutches);

I Continuous measurements (e.g., body size).

33/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 34: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

What is a regression model?

From concentration-response/effect experiments, if there is areasonable number of concentrations (usually ≥ 5) of the toxicantand a reasonably well-behaved response/effect, it is straightforwardto fit a regression model.

A regression model relating a dependent variable Y (the responseor the effect) to an explanatory variable X (the concentration) iscomposed of two parts:

1. a deterministic part, which describes the mean value (orcurve) (e.g., a log-logistic model);

2. a stochastic part, which represents the distribution aroundthe mean curve (e.g., a normal distribution).

Nevertheless, each part depends on the nature of data to analyze.

34/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 35: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

To make it simpleThe Gaussian linear regression

Build a linear model between an observed quantitative continousvariable Y and a controled quantitative continous variable X .

Example of the best high jump at the Olympic Games from 1896 to 1992.

1900 1920 1940 1960 1980

180

190

200

210

220

230

Year

Hei

ght (

in c

m)

35/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 36: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Best high jump at the Olympic GamesThe model

Yi = αXi + β + εi with εi ∼i .d .N(0, σ2

)The linear function f (x ) = αx + β is the deterministic part of themodel, while εi stand for the stochastic part, assuming a Gaussian(or normal) distribution of the observations Yi .

This model can equivalently be written as follows:

Yi ∼ N(f (Xi), σ

2)

with f (Xi) = αXi + β

In total, there are 3 parameters to estimate: α, β and σ.

36/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 37: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Detailed content

Dose-response modellingGeneral pointsDeterministic partStochastic part

37/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 38: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Four shapes to describe dynamic in life science

Sigmoid Michaelis−Menten

Exponential Linear

From http://bioassay.dk/bioassay/

38/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 39: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Example of linear relationship

Data on the relation-ship of average heightsand weights for Ameri-can women aged 30–39.

(n = 15)

150 155 160 165 170 175 180

55

60

65

70

75

American women aged 30−39

Height (cm)

Wei

ght (

kg)

39/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 40: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Example of exponential relationship

Data on the relation-ship between tempera-ture in degrees Celsiusand vapour pressure (inmillimetres of mercury).

(n = 19)

0 50 100 150 200 250 300 350

0

200

400

600

800

Vapor Pressure of Mercury

Temperature (deg C)

Pre

ssur

e (m

m o

f Hg)

40/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 41: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Example of hyperbolic relationship

Data on reaction veloc-ity versus substrate con-centration in an enzy-matic reaction involvinguntreated cells or cellstreated with puromycin(Michaelis-Menten).

(n = 12, n = 11)0.0 0.2 0.4 0.6 0.8 1.0

50

100

150

200

Reaction velocity under puromycin

Substrate concentration (ppm)

Rea

ctio

n ve

loci

ty (

coun

ts/m

in/m

in)

treateduntreated

41/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 42: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Example of sigmoidal relationship

Data from a singledose-effect relationshipbetween root lengthsof perennial ryegrass(Lolium perenne L.) andconcentration of ferulicacid.

(n = 24)1 2 5 10 20

0

2

4

6

8

Ryegrass root length under chemical pressure

Concentration (mM, log−scale)

Roo

t len

gth

(cm

)

42/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 43: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Sigmoidal deterministic partAmong sigmoidal curves, the log-logistic model is the mostcommonly concentration-response/effect model used in(eco)toxicology [Ritz, 2010]:

Y = c +d − c

1 + exp(b. log(Xe ))

m

Y = c +d − c

1 + (Xe )b

b, c, d , e are positive, all with a geometric meaning.

Ritz C. (2010) Toward a unified approach to dose-response modeling in ecotoxicology.Environmental Toxicology and Chemistry, 29(1): 220–229.

43/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 44: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

The log-logistic model - Graphb = 3,c = 0.2,d = 1.1 and e = 0.3.

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

1.2

X

Y

Parameter d

Parameter c

Parameter e

Curvature b

e = 0.3 (arbitrary unit)

In case of survival, d corresponds to the natural mortality (may be fixed to 1)and c is fixed to 0.

44/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 45: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

The log-logistic model - Morphology

Case of survival, with c = 0 and d = 1: e = LC50.

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

Variation of b ( LC50 = 0.3)

X

Y

b = 1b = 2b = 3b = 4b = 5

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

Variation of LC50 (b = 3)

X

Y

LC50 = 0.1LC50 = 0.2LC50 = 0.3LC50 = 0.4LC50 = 0.5

45/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 46: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Other sigmoidal modelsMany other models exist to describe sigmoidal shapes ofdose-response curves as for example the Weibull’s models:

Y = c + (d − c)e−( xe)b or Y = c + (d − c)(1− e−( x

e)b )

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

1.2

X

Y

Weibull 1

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

1.2

X

Y

Weibull 2

46/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 47: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Comparison of sigmoidal curves

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

1.2

X

Y

Log−logisticWeibull 1Weibull 2

47/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 48: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Detailed content

Dose-response modellingGeneral pointsDeterministic partStochastic part

48/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 49: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

What is the stochastic part of a model?

The stochastic part

models the probability distribution around the average tendency ofthe data.

It depends on the nature of the data (namely quantal, discrete orcontinuous data)

49/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 50: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

What is the stochastic part of a model?Example with the Gaussian linear regression

50/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 51: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Quantal data - description

Quantal (or binary) data arise when a particular property isrecorded to be present or absent in each individual (e.g., anindividual shows an effect or it does not show an effect).

Therefore, these data can exhibit only two states.

Typically, quantal data are presented as the number ofindividuals showing the property (e.g., mortality) out of a totalnumber of individuals observed in each experimental unit.

Although this can be expressed as a fraction, the total number ofindividuals cannot generally be omitted.

51/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 52: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Quantal data - Binomial stochastic part

With quantal experimental data (e.g., survival data), thestochastic part of the model is necessarily binomial.

Observations are then described by a model of the following form:

Y ∼ B (p(X , θ),n)

where p(X , θ) is the probability of success (e.g., survivalprobability) as described by one of the dose-response models (e.g.,log-logistic or Pires-Fox), X is the exposure concentration, θ is theparameter vector and n is the total number of individuals.

52/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 53: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Principle of a binomial process

I A binomial statistical experiment consistsof n repeated trials, each trial resulting injust two possible outcomes: success (ofprobability p) or failure.

I Trials are independant.

I Let Y be the number of successesresulting from a binomial experiment, thenY ∼ B (p,n).

I The probability distribution of Y is abinomial distribution of mean p × n andvariance p × (1− p)× n.

53/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 54: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Binomial probability distribution - Graph

0 2 4 6 8 10

0.0

0.1

0.2

0.3

0.4

Y

Pro

babi

lity

p = 0.1 and n = 10

I P(Y = 1) is the highest

I P(Y = 8) andP(Y = 9) are very low

54/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 55: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Binomial probability distribution - Morphologyn = 10

0 2 4 6 8 10

0.0

0.1

0.2

0.3

0.4

0.5

0.6

p = 0.05

Y

Prob

abilit

y de

nsity

func

tion

0 2 4 6 8 10

0.0

0.1

0.2

0.3

0.4

0.5

0.6

p = 0.15

Y

Prob

abilit

y de

nsity

func

tion

0 2 4 6 8 10

0.0

0.1

0.2

0.3

0.4

0.5

0.6

p = 0.25

Y

Prob

abilit

y de

nsity

func

tion

55/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 56: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Discrete data - description

Data are discrete if there are only a finite number of possiblevalues or if there is a space on the number line between each twopossible values.

Discrete data are usually obtained when we are countingsomething (using whole numbers).

They are also called count data.

Typical discrete data are reproduction data.

56/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 57: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Discrete data - Poisson stochastic part

Count data are usually modelled using a Poisson distribution. IfN is the number of reproduction outputs (e.g., eggs or clutches) atconcentration X , then:

N ∼ P(λ)

with λ = f (X , θ) the mean of the Poisson distribution, that is thepredicted mean value from the log-logistic model, the Pires-Foxmodel or any other deterministic part: X is the exposureconcentration and θ the parameter vector.

57/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 58: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Poisson probability distribution - Vizualizationλ denotes both the mean and the variance of the distribution.

0 2 4 6 8 10

0.0

0.2

0.4

0.6

0.8

λ = 0.1

Y

Prob

abilit

y

0 2 4 6 8 10

0.0

0.2

0.4

0.6

0.8

λ = 1

Y

Prob

abilit

y

0 2 4 6 8 10

0.0

0.2

0.4

0.6

0.8

λ = 5

Y

Prob

abilit

y

58/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 59: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Continuous data - description

Data are continuous when they can (theoretically) take any valuein an open interval.

Examples include measurements of length, body weight, etc.

Due to practical reasons the measured resolution depends on thequality of the measurement device.

Typically, continuous data have a dimension (e.g., g, cm,g.L−1).

59/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 60: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Continuous data - Gaussian stochastic part

With continuous experimental data, the currently encounteredstochastic part is normal (or Gaussian), even if other stochastic partsmay be sometimes more appropriate.

Observations are then described by a model of the following form:

Y ∼ N (f (X , θ), σ)

with X the independant variables (e.g., the concentration), f (X , θ) thelog-logistic or the Pires-Fox model and θ the vector of model parameters.This expression can equivalently be written as follows:

Y = f (X , θ) + ε with ε ∼ N (0, σ)

The normal distribution is a bell-shaped probability density function withtwo parameters: mean µ and variance σ2.

60/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 61: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

The bell-shaped Gaussian probability distribution

−4 0 2 4

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

Variation of µ (σ = 1)

ε

Pro

babi

lity

µ=− 2µ=− 1µ=0µ=1µ=2

−4 −2 0 2 4

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

Variation of σ (µ = 0)

ε

Pro

babi

lity

σ=0.6σ=0.8σ=1σ=1.2σ=1.4

61/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 62: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

In brief: a wide variety of models

1. A deterministic part: linear or non-linear,and its associated parameters:for example, (α, β) or (b, c, d , e);

2. A stochastic part: Gaussian or not,and its associated parameters:for example, p (binomial), λ (Poisson) or σ (normal).

62/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 63: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

A battery of regression types

I Gaussian linear regression: simple linear regression,polynomial regression, multiple regression,...;

I Generalized linear regression: logistic regression, Poissonregression, multinomial logit regression, probit regression,...;

I Gaussian non-linear regression: least-square regression,simple or multiple;

I Generalized non-linear regression.

63/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 64: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Link with other courses

In your course entitled ”Analyse des Donnees en Biologie”, youheard (or will hear?) about logistic regression within the particularframework of generalized linear regressions (Mrs I. Amat).

The example that has been dealt (or will be deal) with:presence/absence of birds on islands according to the distancefrom the continent and to the island surface.

Further details on the logistic regression will be given during thepractical session, as well as an introduction to the Poissonregression as another particular case of the generalized linearregression.

64/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 65: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Logistic regression

The logistic regression deals with quantal data. It is used tomodel the probability of ”success”p via a relationship between thelogit (or the log-odd) of p and a linear combination of one ormore independent variables (”predictors”):

logit(p) = ln

(p

1− p

)= β0 + β0X1 + β2X2 . . .+ βnXn

The quantity p1−p is called an odd ratio: the ratio of the

probability of success over the probability of failure.

Remark: logit stands for logistic unit.

65/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 66: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Logistic regression: example

logit(Passing exam) = 1.5046 Hours−4.0777 with p−value = 0.0167

According to the model, 2 hours of study leads to an estimatedprobability of passing the exam of 0.26, while the probabilitybecomes 0.87 with 4 hours of study.

Source: https://en.wikipedia.org/wiki/Logistic_regression

66/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 67: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Poisson regression

The Poisson regression deals with count data. The responsevariable Y is assumed to follow a Poisson distribution of parameterλ, and the logarithm of λ is modeled by a linear combination ofone or more independent variables (”predictors”):

ln(λ) = β0 + β0X1 + β2X2 . . .+ βnXn

Under this model, the mean is assumed to be equal to the variance.

Remark: A Poisson regression model is sometimes called alog-linear model.

67/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 68: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Poisson regressionExample with a nonlinear X −Y relationship

2.9 7

0.73 1.82

0 0.18

0 1 2 3 4 5 6 7 8 9101112131415161718192021 0 1 2 3 4 5 6 7 8 9101112131415161718192021

0

20

40

60

80

100

120

0

20

40

60

80

100

120

0

20

40

60

80

100

120

Time

Cum

ulat

ed N

umbe

r of

offs

prin

g

0

2

4

6

00.18 0.73 1.82 2.9 7Concentration

Rep

rodu

ctio

n ra

te

→ More information during the practical session of ”Analyse desDonnees en Biologie”.

68/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 69: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsDeterministic partStochastic part

Regression analysis: for what?

I Widely used for prediction;

I To understand which ones of the independent variables arerelated to the dependent variable;

I To infer causal relationships between the independent anddependent variables; but caution is advisable:for example, correlation does not imply causation.

Regression analysis: how to do in practice?

69/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 70: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Table of content

What is ecotoxicology?

Dose-response modelling

Parameter inference

70/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 71: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Detailed content

Parameter inferenceGeneral pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

71/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 72: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

What is inference ?

Inference usually implies to fit a model to observed data.

1 2 5 10 20

0

2

4

6

8

Concentration (mM, log−scale)

Roo

t len

gth

(cm

)

72/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 73: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

What is inference ≡ Get parameter estimates

Several criteria may provide the best fit parameter values.

1 2 5 10 20

0

2

4

6

8

Concentration (mM, log−scale)

Roo

t len

gth

(cm

)

⇒ Search for best fit based on the concept of probability.

73/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 74: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

What is a probability ?

One word,at least two definitions.

From a lecture by Marie Laure Delignette-Muller (http://www2.vetagro-sup.fr/ens/biostat/introBayesPreditox_juil14.pdf)

74/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 75: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Frequentist view of probability

In a frequentist perspective, the probability of an event is definedas the fraction of times that the event occurs in a very largenumber of trials.

Probability of being a black sheep ?

75/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 76: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Bayesian view of probability

In a Bayesian perspective, the probability is seen as a degree ofbelief, a measure of uncertainty.

Probability of rain tomorrow ?

76/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 77: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Generalization to populationInference also implies generalization from a sample to population,and the calculation of uncertainty in the estimated parameters,especially uncertainty due to sampling error.

Sampling

Results observed

on a sample

Conclusion on

the population

Statistical inference

A sample

77/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 78: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Let’s take a very simple example

Estimation of a probability to survive for animals studied underfixed conditionsData : Y = 24 survivals among n = 100 organisms

The model:

I No deterministic part

I Binomial stochastic part : Y ∼ B(p,n)

This model is characterized by only one parameter: p.For the sake of generality, the vector of model parameters will bedenoted θ hereafter.

78/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 79: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Detailed content

Parameter inferenceGeneral pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

79/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 80: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Point estimate of θ: θ

Frequentist framework

Parameter θ is assumed fixed but unknown

Parameter θ is estimated by one of the following methods:

I Maximum likelihood: maxθ

P (Y | θ);

I Moment matching;

I Minimization of sum of squared deviations.

In some cases, these different methods may lead to the sameestimation of θ.Example: the estimated survival probability is p = 24

100 = 0.24.

80/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 81: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Interval estimate of θ: confidence interval

The calculation of a confidence interval (generally a 95%interval) is based on repeated sampling from the model :

Definition

If we repeatedly obtain samples of size n from the population andbuild a 95% confidence interval for each, we can expect 95% of theintervals to contain the true value of the parameter.

In average, among the 95% confidence intervals we obtained, 1 outof 20 does not contain the true value of the parameter to estimate.Example: the 95% confidence interval of the survival probability is

p ± 2

√p(1−p)

n , that is [0.15; 0.33].

81/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 82: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Bayesian estimation of θ

Bayesian framework

Parameter θ is supposed uncertain, and its uncertainty ischaracterized by a probability distribution (subjectivemeaning of a probability, degree of belief)

I Prior distribution: P(θ) more or less informative;

I Posterior distribution: P(θ|Y ) calculated using the Bayestheorem, from the prior distribution and the likelihoodfunction P(Y |θ);

P(θ|Y ) =P(Y |θ)× P(θ)

P(Y )∝ P(Y |θ)× P(θ)

82/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 83: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Principle of Bayesian inference

Conclusion on on

the population Bayesian inference

A sample from the

population

+

A prior

distribution

A posterior

distribution

The posterior distribution = the conditional distribution of the unknown parameters given the observed data

83/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 84: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Use of the posterior distribution for parameter estimation

I Point estimate:Mean, median or mode of the posterior distribution

I Interval estimate:Definition of a credible interval (or Bayesian confidenceinterval) from posterior distribution quantiles:→ 2.5% and 97.5% quantiles for a 95% credible interval.Easy interpretation: the probability that the parameter liesin a 95% credible interval is 95%.

I Hypothesis tests:It is no more necessary to calculate any p-value: one canmake decisions directly from posterior distributions.

84/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 85: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Example : Bayesian estimation of a survival probability

I Likelihood function: B(p,n)I Data: Y = 24 survivals out of

n =100

I Prior distribution : U (0, 1)non informative

I Posterior distribution:analytically known in simplecases

0.0 0.2 0.4 0.6 0.8 1.0

I Point estimate : 0.24

I 95% credible interval[0.17; 0.33]

85/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 86: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Frequentist framework

I Parameter θ is supposed fixed but unknown;

I Parameter inference only uses observed data;

I Confidence intervals are based on repeated sampling from themodel, the probability being associated to the relative occurrencefrequency of an outcome.

Bayesian framework

I Parameter θ is considered as a random variable, associated toa probability distribution;

I Parameter inference uses both observed data and prior information(prior distribution);

I Credible intervals are defined from the posterior distribution and canbe easily interpreted: 95% is the probability that the true parametervalue lies within its 95% credible interval.

86/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 87: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Frequentist framework

I Parameter θ is supposed fixed but unknown;

I Parameter inference only uses observed data;

I Confidence intervals are based on repeated sampling from themodel, the probability being associated to the relative occurrencefrequency of an outcome.

Bayesian framework

I Parameter θ is considered as a random variable, associated toa probability distribution;

I Parameter inference uses both observed data and prior information(prior distribution);

I Credible intervals are defined from the posterior distribution and canbe easily interpreted: 95% is the probability that the true parametervalue lies within its 95% credible interval.

86/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 88: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

A foretaste of your second course semester

During the second semester, the optional course ”Bio-Informatiqueet Modelisation en Ecologie” (BIME) proposes an introduction tothe nonlinear regression based on a frequentist approach.

You will hear about:

I Enzyme kinetics and the Michaelis-menten model;

I Microbial growth and the influence of temperature on thepopulation growth rate.

The practical session will be based on the R software, andparticularly the ’drc’ package, specifically dedicated to the fittingof dose-repsonse curves within a frequentist framework.

87/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 89: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Detailed content

Parameter inferenceGeneral pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

88/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 90: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Survival of D. magna exposed to chlordane

Y ∼ B(f (X , θ),n)

f (X , θ): log-logistic model with 3 parameters: θ = (b, d , e), c = 0

Use of a Bayesian approachwith the R software and package ’morse’ (*).

> library(morse)> data("chlordan")> sdata <- survData(chlordan)

(*) Virgile Baudrot, Sandrine Charles, Marie Laure Delignette-Muller, Wandrille Duchemin, Benoit Goussen,

Guillaume Kon-Kam-King, Christelle Lopes, Philippe Ruiz, Alexander Singer and Philippe Veber (2020). morse:

Modelling Tools for Reproduction and Survival Data in Ecotoxicology. R package version 3.2.7.

https://CRAN.R-project.org/package=morse

89/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 91: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Survival of D. magna exposed to chlordane> plotDoseResponse(sdata, style = "ggplot", addlegend = FALSE)

0

1

00.18 0.73 1.82 2.9 7Concentration

Sur

viva

l pro

babi

lity

Vertical segments are binomial confidence intervals representingthe variability between replicates.

90/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 92: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Survival of D. magna exposed to chlordane

> sfitTT <- survFitTT(sdata)

> su <- summary(sfitTT, quiet=TRUE)> su$Qpriors

50% 2.5% 97.5%b 1.000e+00 1.259e-02 7.943e+01e 1.122e+00 1.867e-01 6.748e+00

> su$Qpost

50% 2.5% 97.5%b 1.182e+00 4.936e-01 2.129e+00e 2.692e+00 1.532e+00 5.241e+00

91/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 93: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Survival of D. magna exposed to chlordanePrior-Posterior probability densities

−2 −1 0 1 2

0.0

0.5

1.0

1.5

2.0

2.5

Parameter b

Den

sity

0 1 2 3 4 5 6 7

0.0

0.1

0.2

0.3

0.4

0.5

Parameter e

Den

sity

92/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 94: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Survival of D. magna exposed to chlordane> plot(sfitTT, adddata = TRUE, log.scale = TRUE)

0.00

0.25

0.50

0.75

1.00

0.18 0.73 1.82 2.9 7Concentration

Sur

viva

l pro

babi

lity

93/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 95: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Survival of D. magna exposed to chlordaneValidate the model: Posterior Predictive Check

> ppc(sfitTT)

0.0

2.5

5.0

7.5

10.0

0.0 2.5 5.0 7.5 10.0Observed nb of survivors

Pre

dict

ed n

b of

sur

vivo

rs

94/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 96: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

Survival of D. magna exposed to chlordaneEstimates of x% Lethal Concentrations for ERA

> su$QLCx

50% 2.5% 97.5%LC5 2.218e-01 7.784e-03 7.106e-01LC10 4.171e-01 3.424e-02 1.041e+00LC20 8.264e-01 1.612e-01 1.632e+00LC50 2.692e+00 1.532e+00 5.241e+00

95/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 97: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

The same on-line: the web platform MOSAIC

https://mosaic.univ-lyon1.fr/

96/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 98: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

What is ecotoxicology?Dose-response modelling

Parameter inference

General pointsFrequentist vs Bayesian frameworkThe Bayesian framework under the R software

The same on-line: the web platform MOSAIC

https://mosaic.univ-lyon1.fr/

97/98 S. Charles, [email protected] M1 BEE@Lyon - Modelling in ecotoxicology

Page 99: Sandrine CHARLES (UCBL - LBBE) M1 BEE@Lyon - September 29 ...

Thank youfor your attention

Thanks to J.-P. Lena, C. Lopes and I. Amat for their useful advices