0% found this document useful (0 votes)
37 views

Linear Least Squares Curve

This document discusses linear least squares curve fitting. It presents the equations to calculate the slope (m) and y-intercept (b) of a linear regression line that best fits a set of x-y data points by minimizing the sum of the squares of the residuals. It also provides equations for calculating the standard deviation of the y values, fit coefficients, and correlation coefficient of the linear regression model.

Uploaded by

Lee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Linear Least Squares Curve

This document discusses linear least squares curve fitting. It presents the equations to calculate the slope (m) and y-intercept (b) of a linear regression line that best fits a set of x-y data points by minimizing the sum of the squares of the residuals. It also provides equations for calculating the standard deviation of the y values, fit coefficients, and correlation coefficient of the linear regression model.

Uploaded by

Lee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Colby College

Linear Least Squares Curve Fitting




y
^
i
= f(x
i
) = m x
i
+ b

r
i
= y
i
y
^
i
= y
i
m x
i
b

S =

i=1
n
r
2
i
=

i=1
n
(y
i
mx
i
b)
2

S
m
b
= 0 = 2 (y
i
mx
i
b)(x
i
)

S
b
m
= 0 = 2 (y
i
mx
i
b)(1))

i=1
n
1= n

0 = y
i
x
i
m x
2
i
b x
i


0 = y
i
m x
i
b n


0 = ( y
i
x
i
m x
2
i
b x
i
)( x
i
)

0 = ( y
i
m x
i
b n)( x
2
i
)


0 = x
i
y
i
x
i
+ b ( x
i
)
2
+ x
2
i
y
i
bn x
2
i



b =
x
2
i
y
i
x
i
x
i
y
i
n x
2
i
( x
i
)
2
m =
n x
i
y
i
x
i
y
i
n x
2
i
( x
i
)
2




Standard Deviation of the Y Values
s
2
y
=
r
2
i
n 2


D = n x
2
i
( x
i
)
2










y
x









r
i
y
i
y
^
i
x
i
Colby College
Standard Deviation of the Fit Coefficients

Propagation of errors:
2
f =

f
x
2
y

2
x +

f
y
2
x

2
y

example: for the slope get the sum for each y
i
value:

2
m =

m
y
1
2

2
y
1
+

m
y
2
2

2
y
2
+ ...

with
2
y
i
= s
2
y
for each y data point:

2
m =

m
y
1
2
s
2
y
+

m
y
2
2
s
2
y
+ ...

2
m =

m
y
i
2
s
2
y

m
y
1
=
nx
1
x
i
D

m
y
1
2
=
n
2
x
2
1
2nx
1
x
i
+ ( x
i
)
2
D
2

m
y
i
2
=
n
2
x
2
i
2n x
i
x
i
+ n( x
i
)
2
D
2 ( x
i
)
2
= ( x
i
)
2
1 = n( x
i
)
2


m
y
i
2
=
n
2
x
2
i
n( x
i
)
2
D
2 =
nD
D
2

s
2
m
=
n
D
s
2
y
s
2
b
=
x
2
i
D
s
2
y


Correlation coefficient
y
av
=
y
i
n
y
^
= m x
i
+ b is the fit value

R
2
=
( y
^
y
av
)
2
(y
i

y
av
)
2


R =
n x
i
y
i
x
i
y
i
{n x
2
i
( x
i
)
2
}{n y
2
i
( y
i
)
2
}

You might also like