Home > Statistical Methods calculators > Fitting straight line - Curve fitting example

1. Fitting straight line - Curve fitting example ( Enter your problem )
  1. Formula & Example-1
  2. Example-2
Other related methods
  1. Straight line (y = a + bx)
  2. Second degree parabola `(y = a + bx + cx^2)`
  3. Cubic equation `(y = a + bx + cx^2 + dx^3)`
  4. Exponential equation `(y=ae^(bx))`
  5. Exponential equation `(y=ab^x)`
  6. Exponential equation `(y=ax^b)`

1. Formula & Example-1
(Previous example)
2. Second degree parabola `(y = a + bx + cx^2)`
(Next method)

2. Example-2





Calculate Fitting straight line - Curve fitting using Least square method
XY
32.3
52.6
72.8
93.2
113.5


Solution:
Method-1 of solution :
Straight line equation is `y = a + bx`.

The normal equations are
`sum y = an + b sum x`

`sum xy = a sum x + b sum x^2`


The values are calculated using the following table
`x``y``x^2``x*y`
32.396.9
52.62513
72.84919.6
93.28128.8
113.512138.5
------------
`sum x=35``sum y=14.4``sum x^2=285``sum x*y=106.8`


Substituting these values in the normal equations
`5a+35b=14.4`

`35a+285b=106.8`


Solving these two equations using Elimination method,
`5a+35b=14.4`

and `35a+285b=106.8`

`5a+35b=14.4 ->(1)`

`35a+285b=106.8 ->(2)`

equation`(1) xx 7 =>35a+245b=100.8`

equation`(2) xx 1 =>35a+285b=106.8`

Substracting `=>-40b=-6`

`=>40b=6`

`=>b=6/40`

`=>b=3/20`

`=>b=0.15`

Putting `b=0.15` in equation `(1)`, we have

`5a+35(0.15)=14.4`

`=>5a=14.4-5.25`

`=>5a=9.15`

`=>a=9.15/5`

`=>a=1.83`

`:.a=1.83" and "b=0.15`

Now substituting this values in the equation is `y = a + bx`, we get

`y = 1.83 +0.15x`



Method-2 of solution :

Equation of straight line is `y=mx+b`, where Slope is m and Intercept is b

`m=(n sum xy - sum x sum y) / (n sum(x^2) - (sum x)^2)`

`b=(sum y - m sum x)/n`

The values are calculated using the following table
`x``y``x^2``x*y`
32.396.9
52.62513
72.84919.6
93.28128.8
113.512138.5
------------
`sum x=35``sum y=14.4``sum x^2=285``sum x*y=106.8`


Find the value of Slope `m`

`m=(n sum xy - sum x sum y) / (n sum(x^2) - (sum x)^2)`

`:.m=(5 * 106.8 - 35*14.4) / (5* 285 - (35)^2)`

`:.m=(534 - 504) / (1425 - 1225)`

`:.m=(30) / (200)`

`:.m=0.15`

Find the value of Intercept `b`

`b=(sum y - m sum x)/n`

`:.b=(14.4 - 0.15 * 35)/5`

`:.b=(14.4 -5.25)/5`

`:.b=(9.15)/5`

`:.b=1.83`

So the required equation is `y=mx+b`

`y=0.15x+1.83`




The (x,y) points and line `y = 1.83 +0.15x` on a graph





This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then Submit Here



1. Formula & Example-1
(Previous example)
2. Second degree parabola `(y = a + bx + cx^2)`
(Next method)





Share this solution or page with your friends.


 
Copyright © 2023. All rights reserved. Terms, Privacy
 
 

.