We start Part II (Quantifying Uncertainty) today Lab 2 - Equations

30
tart Part II (Quantifying Uncertainty) today 2 - Equations rrow - Tue 3-5 or 7-9 PM - SN 4117 gnment 2 – Data Equations Wednesday

description

We start Part II (Quantifying Uncertainty) today Lab 2 - Equations Tomorrow - Tue 3-5 or 7-9 PM - SN 4117 Assignment 2 – Data Equations Due Wednesday. Chapter 5. Data = Model + Residual. Data = Model + Residual. Data Equations. Data = Model + Residual. Data = Model + Residual. - PowerPoint PPT Presentation

Transcript of We start Part II (Quantifying Uncertainty) today Lab 2 - Equations

Page 1: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

We start Part II (Quantifying Uncertainty) today

Lab 2 - EquationsTomorrow - Tue 3-5 or 7-9 PM - SN 4117

Assignment 2 – Data EquationsDue Wednesday

Page 2: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Data = Model + ResidualChapter 5

Data Equations

Data = Model + ResidualData = Model + ResidualData = Model + ResidualData = Model + Residual

Page 3: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Data Equations

• Central concept in the course• We’ll teach a general approach that will allow

you to set up an appropriate analysis of data• You don’t have to worry about whether you

have selected the ‘right’ test• We are going to use data equations to

compare models to dataData = Model + Residual

Page 4: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Flexible approach

Data = Model + Residual

Page 5: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Symbolic expression Analyse data

• Increase confidence using model triangle– Link symbols with graphical and verbal model

Data

Verbal

Graphical Formal

Page 6: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Assessing fit

• We’ll use data equations to measure:– How well the model fits the data (goodness of fit)– Error rate

Model

Plant height

Tim

e in

sunl

ight

Data

• We do not expect a perfect fit

• But model and observed values should be close

Page 7: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Definition

• Three terms: Y = Ŷ + εData Model ResidualObserved Expected Error

Fitted• Residuals:

ε = Y - Ŷ

Page 8: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

e.g. Dobzhansky’s Fruit Flies

• Dobzhansky pioneered work on fruit fly evolutionary genetics in the lab and field

• One research question he addressed was:– Does genetic variability decrease at

higher altitude, due to stronger selection in extreme environments?

Nothing in Biology Makes Sense Except in the Light

of Evolution

Page 9: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

e.g. Dobzhansky’s Fruit Flies

Nothing in Biology Makes Sense Except in the Light

of Evolution

Heterozygosity H (%)

Elevation E (km)

0.59 0.260.37 0.910.41 1.40.4 1.89

0.31 2.440.18 2.620.2 3.05

Nothing in Biology Makes Sense Except in the Light

of Statistics

?

Page 10: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Heterozygosity H (%)

Elevation E (km)

0.59 0.260.37 0.910.41 1.40.4 1.89

0.31 2.440.18 2.620.2 3.05

Model?

• Heterozygosity in Drosophila = 40%Data = Model + Residual H = Ĥ + ε H = 40% + ε

• Many options• First we’ll check deviance

from a single value

Page 11: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Data ==

Model ++

Res. Res.2

2

0.59 = 0.4 + 0.19 0.03610.37 = 0.4 + -0.03 0.00090.41 = 0.4 + 0.01 0.00010.4 = 0.4 + 0.00 0.0000

0.31 = 0.4 + -0.09 0.00810.18 = 0.4 + -0.22 0.04840.2 = 0.4 + -0.20 0.0400∑ -0.34 0.1336

Model 1: Deviations from a Single Value Model

• With this simple model, we can form 7 data equations

Summed residuals is a measure of biasSummed residuals2 is a measure of goodness of fit

Page 12: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations
Page 13: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

What if the parameter is unknown?

• Use statistical methods to make the "best" estimate• What does "best" mean?– Residuals should sum to zero (unbiased estimate)– Residuals should be as small as possible

• The mean meets both criteria • Next model: Deviations from the Mean

Data = Model + Residual

Page 14: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Data ==

Model ++

Res. Res.2

2

0.59 = 0.3514 + 0.2386 0.05690.37 = 0.3514 + 0.0186 0.00030.41 = 0.3514 + 0.0586 0.00340.4 = 0.3514 + 0.0486 0.0024

0.31 = 0.3514 + -0.0414 0.00170.18 = 0.3514 + -0.1714 0.02940.2 = 0.3514 + -0.1514 0.0229

= 0.3514 ∑ 0 0.1171

Model 2: Deviations from the Mean

• Form 7 data equations

Page 15: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations
Page 16: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations
Page 17: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Single value vs. Mean model𝐇=��+𝜺

= 0.4∑ res = -0.34∑ res2 = 0.1336

𝐇=𝐇+𝜺 = 0.3514∑ res = 0∑ res2 = 0.1171

• Mean model: unbiased and better fit• But biological criteria have been replaced by

statistical criteria

Page 18: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

e.g. Dobzhansky’s Fruit Flies

Nothing in Biology Makes Sense Except in the Light

of Evolution

Heterozygosity H (%)

Elevation E (km)

0.59 0.260.37 0.910.41 1.40.4 1.89

0.31 2.440.18 2.620.2 3.05

What about elevation?...don't you

remember my question?

Does genetic variability decrease at higher altitude, due to stronger selection in extreme environments?

Page 19: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Model 3: Deviations from a linear trend

• What’s all that? ↗Data = Model + Residual

• Where:– is the heterozygosity gradient (%/km)– is elevation (km)– is the offset

Remember ?

%/km km %%%

Page 20: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Estimate slope () and offset ()

Heterozygosity H (%)

Elevation E (km)

0.59 0.26

0.2 3.05

�� E=∆ 𝑦∆ 𝑥=

(20−59 ) %(3.05−0.26 ) km

=−13.98 %/ km

H=𝐇𝒐+𝜷𝐄 ∙ E

H=H𝑜+(−13.98 % / km) ∙E5 9%= H𝑜+(−13.98 % /km)∙0.26H𝑜=59 %−(−13.98 % /km) ∙0.26H𝑜=62.62 %

Page 21: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Model 3: Deviations from a linear trend

𝐇=𝟎 .𝟔𝟐𝟔−𝟎 .𝟏𝟑𝟗𝟖 ∙𝐄+𝜺Parameters estimated using first and last and values

With this equation, we can calculate fitted values

Page 22: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Elevation Data ==

Model ++

Res. Res.2

2

0.26 0.59 = 0.5900 + 0.0000 0.00000.91 0.37 = 0.4991 + -0.1291 0.01671.4 0.41 = 0.4306 + -0.0206 0.0004

1.89 0.4 = 0.3622 + 0.0378 0.00142.44 0.31 = 0.2853 + 0.0247 0.00062.62 0.18 = 0.2601 + -0.0801 0.00643.05 0.2 = 0.2000 + 0.0000 0.0000∑ -0.1700 0.0253

Model 3: Deviations from a linear trend

𝐇=𝟎 .𝟔𝟐𝟔−𝟎 .𝟏𝟑𝟗𝟖 ∙𝐄+𝜺With this equation, we can calculate fitted values

???????

???????

Page 23: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations
Page 24: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

There’s a better way to estimate slope

• “Least squares" estimate of slope ()• Estimate offset () from mean values

�� E=∑ (H −H)(E−E)

∑ (E−E ¿)2=−0.127 ¿

𝐇=��𝒐+ ��𝐄 ∙𝐄+𝜺

• Line passes through mean coordinates (, )• We know less about Y-intercept

Page 25: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Model 4: Deviations from a linear trend (least squares)

𝐇=𝟎 .𝟓𝟖−𝟎 .𝟏𝟐𝟕 ∙𝐄+𝜺

Page 26: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations
Page 27: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations
Page 28: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations

Model comparisonSingle value model based on prior knowledge | ∑ res = -0.34Mean model (least squares) | ∑ res = 0Linear trend (two data points) | ∑ res = -0.17Linear trend (least squares) | ∑ res = 0

Two unbiased models

Mean model (least squares) | ∑ res2 = 0.1171Linear trend (least squares) | ∑ res2 = 0.0204Reduction in squared deviance ∑ res2 =

0.0966

Page 29: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations
Page 30: We start Part II (Quantifying Uncertainty) today Lab 2 -  Equations