You are on page 1of 17

Uncertainties in

Numerical Computations: Calibration curve:

Mass = 4.635 ± 0.002 g Volume = 1.13 ± 0.05 mL d4


Measured Measured 𝑦𝑦 = 𝑚𝑚𝑚𝑚 + 𝑏𝑏

intensity
Mass Volume d3

d2
𝑑𝑑12 + 𝑑𝑑22 + 𝑑𝑑32 + 𝑑𝑑42
d1 = minimum
uncertainty
concentration
Computed density = ? ± ? g/mL Conc. = ? ± ? M

Topic Chapter
Errors in chemical analysis: systematic and random errors 5, 6
Statistical data treatment and evaluation: confidence intervals, t-
7
test, F-test, Q-test
Quality assurance: sampling, standardization, and calibration 8
Chapter 6D, Skoog and West’s Fundamentals of Analytical Chemistry, 9th edition, Brooks/Cole (2014) 1
Using Spreadsheet (Excel function LINEST ) for Least
Squares Analysis: m, b, R2 Sr, Sm, Sb, Sc
Refer to Chem2241_Supp_Spreadsheet for Least Squares_8-19S2

𝒚𝒚 = 𝒎𝒎𝒎𝒎 + 𝒃𝒃 ; 𝑹𝑹𝟐𝟐
R2: Coefficient of determination or square of
correlation coefficient

2
Interpretation of Least-Squares Results
• Calibration curve : n points is used;

• the mean value of y for the n points.

= (uncertainty of the result)

∑(xi- x� )2= Sxx

M is the number of measurements of the unknown giving the mean yc

3
Take-home message
Estimate its uncertainty using error propagation.
Calibration curve: (𝑦𝑦±∆𝑦𝑦) = (𝑚𝑚±∆𝑚𝑚)𝑥𝑥 + (𝑏𝑏 ±∆𝑏𝑏)
𝑦𝑦 = (𝑚𝑚±∆𝑚𝑚)𝑥𝑥 + (𝑏𝑏 ±∆𝑏𝑏)
d4 y: absorbance, x = concentration
Absorbance

d3 𝑥𝑥 = [𝑦𝑦 − 𝑚𝑚]/𝑏𝑏

2
d2
𝑑𝑑12 𝑑𝑑22 𝑑𝑑32 𝑑𝑑42
∆𝑥𝑥 ∆𝑚𝑚2+∆𝑦𝑦2 ∆𝑏𝑏
+ + + Relative error= = 2 +
d1 𝑥𝑥 𝑦𝑦−𝑚𝑚 𝑏𝑏
= minimum

concentration
Conc. = ? ± ? M Absolute error = concentration × relative error
Correlation and Regression
Method of Least Squares
d4
𝑑𝑑12 + 𝑑𝑑22 + 𝑑𝑑32 + 𝑑𝑑42 = minimum
intensity

d3

d2

d1
𝑦𝑦 = 𝑚𝑚𝑚𝑚 + 𝑏𝑏

concentration

Assumption 1
There is a linear relationship between
the measured variable (y) and the
analyte concentration (x). The values of m and b are determined
for which the sum of the squares of
the deviations are minimized
Part 1: Statistics 2019 S2 CHEM2241 IKC
5
Method of Least Squares
Assumption 2 Any deviation of individual data points from
the straight line results from error in the measurement. There is no
error in the x values of the points.
The vertical deviation [yi-(mxi+b)] of each point
from the straight line is called a residual.

Sum of the squares of the residuals

𝑆𝑆𝑆𝑆𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 = �[𝑦𝑦𝑖𝑖 − 𝑏𝑏 + 𝑚𝑚𝑥𝑥𝑖𝑖 ]2

Linear regression results:


R2 (coefficient of determination)
 closer to 1, better fit
Part 1: Statistics 2019 S2 CHEM2241 IKC
6
Method of Least Squares
Assumption 2 Any deviation of individual data points from
the straight line results from error in the measurement. There is no
error in the x values of the points.
The vertical deviation [yi-(mxi+b)] of each point
from the straight line is called a residual.

Linear regression results:


R2 (coefficient of determination)

% of the total variation in y is


described by the total variation in x
using 𝑦𝑦𝑖𝑖 = 𝑏𝑏 + 𝑚𝑚𝑥𝑥𝑖𝑖

Part 1: Statistics
 closer to 1, better fit
2019 S2 CHEM2241 IKC
7
Part 1:S2
2019 Statistics
CHEM2241 IKC
In running the linear regression, the Sum of the squares of the
residuals or sum of square error (𝑆𝑆𝑆𝑆𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 =SSE) is minimized

y = mx + b 𝑦𝑦 = 𝑚𝑚𝑚𝑚 + 𝑏𝑏
y
𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸1 = 𝑦𝑦1 − 𝑚𝑚𝑥𝑥1 + 𝑏𝑏
Errorn 𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸2 = 𝑦𝑦2 − (𝑚𝑚𝑥𝑥2 + 𝑏𝑏)
(x1, y1) (xn, yn) …
(x2, y2) 𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝑛𝑛 = 𝑦𝑦𝑛𝑛 − 𝑚𝑚𝑥𝑥𝑛𝑛 + 𝑏𝑏
b
x 𝑆𝑆𝑆𝑆𝑆𝑆 = 𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸1 + 𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸2 … + 𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝑛𝑛
δ lim

Where 𝑆𝑆𝑆𝑆𝑆𝑆 = 𝑛𝑛𝑦𝑦 2 − 2𝑚𝑚𝑚𝑚𝑥𝑥𝑥𝑥 − 2𝑏𝑏𝑏𝑏𝑦𝑦� + 𝑚𝑚2 𝑛𝑛𝑥𝑥 2 + 2𝑏𝑏𝑏𝑏𝑏𝑏𝑥𝑥̅ + 𝑛𝑛𝑏𝑏 2


When δ lim at the saddle point/ global minima,

𝜕𝜕𝑆𝑆𝑆𝑆𝑆𝑆 𝜕𝜕𝑆𝑆𝑆𝑆𝑆𝑆
b
= 0; =0
𝜕𝜕𝜕𝜕 𝜕𝜕𝜕𝜕
m
Saddle point
Supplementary 8
Supplementary
Sum of the squares of the residuals/ sum of square error
(𝑺𝑺𝑺𝑺𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓 =SSE)
Part 1:S2
2019 Statistics
CHEM2241 IKC Supplementary

Sum of the squares of the residuals/ sum of square error (𝑺𝑺𝑺𝑺𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓 =SSE)

𝑦𝑦 2 , 𝑥𝑥𝑥𝑥, 𝑦𝑦,
� 𝑥𝑥 2 , 𝑥𝑥̅ are the average of y2, xy, y, x2, x.
For example,
𝑦𝑦 2 + 𝑦𝑦 2 + ⋯ + 𝑦𝑦 2
2 1 2 𝑛𝑛
𝑦𝑦 =
𝑛𝑛
=x

=
x
y
∑iy i

n n

10
Part 1:S2
2019 Statistics
CHEM2241 IKC Supplementary
𝑆𝑆𝑆𝑆𝑆𝑆 = 𝑛𝑛𝑦𝑦 2 − 2𝑚𝑚𝑚𝑚𝑥𝑥𝑥𝑥 − 2𝑏𝑏𝑏𝑏𝑦𝑦� + 𝑚𝑚2 𝑛𝑛𝑥𝑥 2 + 2𝑏𝑏𝑏𝑏𝑏𝑏𝑥𝑥̅ + 𝑛𝑛𝑏𝑏2
When δ lim at the saddle point/ global minima, δ lim

𝜕𝜕𝑆𝑆𝑆𝑆𝑆𝑆
=0
𝜕𝜕𝜕𝜕
0 0 2m 0
𝑛𝑛𝑦𝑦 2 − 2𝑚𝑚𝑚𝑚𝑥𝑥𝑥𝑥 − 2𝑏𝑏𝑏𝑏𝑦𝑦� + 𝑚𝑚2 𝑛𝑛𝑥𝑥 2 + 2𝑏𝑏𝑏𝑏𝑏𝑏𝑥𝑥̅ + 𝑛𝑛𝑏𝑏2 = 0
−2𝑛𝑛𝑥𝑥𝑥𝑥 + 2𝑚𝑚𝑚𝑚𝑥𝑥 2 + 2𝑏𝑏𝑏𝑏𝑥𝑥̅ = 0
−𝑥𝑥𝑥𝑥 + 𝑚𝑚𝑥𝑥 2 + 𝑏𝑏𝑥𝑥̅ = 0

𝑥𝑥𝑥𝑥 − 𝑏𝑏𝑥𝑥̅
𝑚𝑚 = ← 𝐸𝐸𝐸𝐸. 1 b
𝑥𝑥 2
m
𝜕𝜕𝑆𝑆𝑆𝑆𝑆𝑆
=0
𝜕𝜕𝜕𝜕 Saddle point
0 0 0 2b
𝑛𝑛𝑦𝑦 2 − 2𝑚𝑚𝑚𝑚𝑥𝑥𝑥𝑥 − 2𝑏𝑏𝑏𝑏𝑦𝑦� + 𝑚𝑚2 𝑛𝑛𝑥𝑥 2 + 2𝑏𝑏𝑏𝑏𝑏𝑏𝑥𝑥̅ + 𝑛𝑛𝑏𝑏2 = 0
−2𝑛𝑛𝑦𝑦� + 2𝑚𝑚𝑚𝑚𝑥𝑥̅ + 2𝑏𝑏𝑏𝑏 = 0
𝑏𝑏 = 𝑦𝑦� − 𝑚𝑚𝑥𝑥̅ ← 𝐸𝐸𝐸𝐸. 2

Combine Eq. 1 and Eq. 2,

𝑥𝑥𝑥𝑥 − (𝑦𝑦� − 𝑚𝑚𝑥𝑥)̅ 𝑥𝑥̅ 𝑆𝑆𝑥𝑥𝑥𝑥 n


𝑚𝑚 = 𝑚𝑚 = 𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤
𝑥𝑥 2 𝑆𝑆𝑥𝑥𝑥𝑥
n
𝑚𝑚𝑥𝑥 2 = 𝑥𝑥𝑥𝑥 − 𝑥𝑥̅ � 𝑦𝑦� + 𝑚𝑚𝑥𝑥̅ 2

𝑥𝑥𝑥𝑥 − 𝑥𝑥̅ � 𝑦𝑦� n


𝑚𝑚 =
𝑥𝑥 2 − 𝑥𝑥̅ 2 11
Supplementary

 To calculate m and b and the standard deviations of


these results we need the following intermediate
values: 𝑆𝑆𝑥𝑥𝑥𝑥
𝑚𝑚 = 𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤
𝑆𝑆𝑥𝑥𝑥𝑥
( x)
2

∑(x − x ) = ∑ x
2 2 i
S xx = i i −
n
( y)
2

∑( y − y ) = ∑ y
2 2 i
S yy = i i −
n
( ∑ xy)
∑ ( xi − x )( yi − y=) ∑
i i
S xy= xy −
i i
n

=x

=
x
y

i y i

n n
Part 1: Statistics
Part 1:S2
2019 Statistics
CHEM2241 IKC Supplementary
𝑆𝑆𝑆𝑆𝑆𝑆 = 𝑛𝑛𝑦𝑦 2 − 2𝑚𝑚𝑚𝑚𝑥𝑥𝑥𝑥 − 2𝑏𝑏𝑏𝑏𝑦𝑦� + 𝑚𝑚2 𝑛𝑛𝑥𝑥 2 + 2𝑏𝑏𝑏𝑏𝑏𝑏𝑥𝑥̅ + 𝑛𝑛𝑏𝑏2
When δ lim at the saddle point/ global minima,

𝜕𝜕𝑆𝑆𝑆𝑆𝑆𝑆
=0
𝜕𝜕𝜕𝜕
0 0 2m 0
𝑛𝑛𝑦𝑦 2 − 2𝑚𝑚𝑚𝑚𝑥𝑥𝑥𝑥 − 2𝑏𝑏𝑏𝑏𝑦𝑦� + 𝑚𝑚2 𝑛𝑛𝑥𝑥 2 + 2𝑏𝑏𝑏𝑏𝑏𝑏𝑥𝑥̅ + 𝑛𝑛𝑏𝑏2 = 0
−2𝑛𝑛𝑥𝑥𝑥𝑥 + 2𝑚𝑚𝑚𝑚𝑥𝑥 2 + 2𝑏𝑏𝑏𝑏𝑥𝑥̅ = 0
−𝑥𝑥𝑥𝑥 + 𝑚𝑚𝑥𝑥 2 + 𝑏𝑏𝑥𝑥̅ = 0
( ∑ xi )
2

∑ ( xi − x ) ∑i−
2 2
𝑚𝑚 =
𝑥𝑥𝑥𝑥 − 𝑏𝑏𝑥𝑥̅
← 𝐸𝐸𝐸𝐸. 1 S xx = = x
𝑥𝑥 2 n
( y)
2
𝜕𝜕𝑆𝑆𝑆𝑆𝑆𝑆 ∑
∑ ( yi − y ) ∑y
2 2 i
𝜕𝜕𝜕𝜕
=0 S yy = = i −
0 0 0 2b n
𝑛𝑛𝑦𝑦 2 − 2𝑚𝑚𝑚𝑚𝑥𝑥𝑥𝑥 − 2𝑏𝑏𝑏𝑏𝑦𝑦� + 𝑚𝑚2 𝑛𝑛𝑥𝑥 2 + 2𝑏𝑏𝑏𝑏𝑏𝑏𝑥𝑥̅ + 𝑛𝑛𝑏𝑏2 = 0
( ∑ xy)
∑ ( xi − x )( yi − y=) ∑
−2𝑛𝑛𝑦𝑦� + 2𝑚𝑚𝑚𝑚𝑥𝑥̅ + 2𝑏𝑏𝑏𝑏 = 0 i i
S xy= xy −
i i
𝑏𝑏 = 𝑦𝑦� − 𝑚𝑚𝑥𝑥̅ ← 𝐸𝐸𝐸𝐸. 2 n
Combine Eq. 1 and Eq. 2,

𝑥𝑥𝑥𝑥 − (𝑦𝑦� − 𝑚𝑚𝑥𝑥)̅ 𝑥𝑥̅ 𝑆𝑆𝑥𝑥𝑥𝑥 n


𝑚𝑚 = 𝑚𝑚 = 𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤
𝑥𝑥 2 𝑆𝑆𝑥𝑥𝑥𝑥
n
𝑚𝑚𝑥𝑥 2 = 𝑥𝑥𝑥𝑥 − 𝑥𝑥̅ � 𝑦𝑦� + 𝑚𝑚𝑥𝑥̅ 2

𝑥𝑥𝑥𝑥 − 𝑥𝑥̅ � 𝑦𝑦� n


𝑚𝑚 =
𝑥𝑥 2 − 𝑥𝑥̅ 2 13
Supplementary

 Six quantities from Sxx, Syy,and Sxy.


S xy 𝑆𝑆𝑆𝑆𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 = �[𝑦𝑦𝑖𝑖 − 𝑏𝑏 + 𝑚𝑚𝑥𝑥𝑖𝑖 ]2 =
m= , b= y − mx
S yy
S yy − m 2 S xx
the standard deviation about the regression sr = = Sy
n−2 (uncertainty in y)
the standard deviation of the slope sm = sr / S xx

the standard deviation of the intercept sb =sr


∑i
x 2

n∑ x − ( ∑ xi )
2 2
i

the standard deviation for results from the calibration curve


s 1 1 ( yc − y ) 2
sc = r + + 2
= Sy (uncertainty in x)
m M n m S xx

Part 1: Statistics
Supplementary

 Six quantities from Sxx, Syy,and Sxy.


S xy 𝑆𝑆𝑆𝑆𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 = �[𝑦𝑦𝑖𝑖 − 𝑏𝑏 + 𝑚𝑚𝑥𝑥𝑖𝑖 ]2 =
m= , b= y − mx
S yy
S yy − m 2 S xx
the standard deviation about the regression sr = = Sy
n−2 (uncertainty in y)
the standard deviation of the slope sm = sr / S xx

the standard deviation of the intercept sb =sr


∑i
x 2

n∑ x − ( ∑ xi )
2 2
i

the standard deviation for results from the calibration curve


s 1 1 ( yc − y ) 2
sc = r + + 2
= Sy (uncertainty in x)
m M n m S xx

Part 1: Statistics 2019 S2 CHEM2241 IKC Error 15


Part 1:S2
2019 Statistics
CHEM2241 IKC Supplementary

16
Part 1:S2
2019 Statistics
CHEM2241 IKC Supplementary

17

You might also like