Home > Statistical Methods calculators > Fitting cubic equation - Curve fitting example

3. Fitting cubic equation - Curve fitting example ( Enter your problem )
  1. Formula & Examples
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)`

2. Second degree parabola `(y = a + bx + cx^2)`
(Previous method)
4. Exponential equation `(y=ae^(bx))`
(Next method)

1. Formula & Examples





Formula
The equation is `y = a + bx + cx^2 + dx^3` and the normal equations are
1. `sum y = an + b sum x + c sum x^2 + d sum x^3`
2. `sum xy = a sum x + b sum x^2 + c sum x^3 + d sum x^4`
3. `sum x^2y = a sum x^2 + b sum x^3 + c sum x^4 + d sum x^5`
4. `sum x^3y = a sum x^3 + b sum x^4 + c sum x^5 + d sum x^6`

Examples
1. Calculate Fitting cubic equation - Curve fitting using Least square method
XY
199640
199750
199862
199958
200060


Solution:
The equation is `y = a + bx + cx^2 + dx^3` and the normal equations are

`sum y = an + b sum x + c sum x^2 + d sum x^3`

`sum xy = a sum x + b sum x^2 + c sum x^3 + d sum x^4`

`sum x^2y = a sum x^2 + b sum x^3 + c sum x^4 + d sum x^5`

`sum x^3y = a sum x^3 + b sum x^4 + c sum x^5 + d sum x^6`


`X``y``x = X - 1998``x^2``x^3``x^4``x^5``x^6``x*y``x^2*y``x^3*y`
199640-24-816-3264-80160-320
199750-11-11-11-5050-50
199862000000000
199958111111585858
200060248163264120240480
---------------------------------
9990270010034013048508168


Substituting these values in the normal equations
`270=5a+0b+10c+0d`

`48=0a+10b+0c+34d`

`508=10a+0b+34c+0d`

`168=0a+34b+0c+130d`


Solving these 4 equations using inverse matrix method,
Here `5a+10c=270`
`10b+34d=48`
`10a+34c=508`
`34b+130d=168`

Now converting given equations into matrix form
`[[5,0,10,0],[0,10,0,34],[10,0,34,0],[0,34,0,130]] [[a],[b],[c],[d]]=[[270],[48],[508],[168]]`

Now, A = `[[5,0,10,0],[0,10,0,34],[10,0,34,0],[0,34,0,130]]`, X = `[[a],[b],[c],[d]]` and B = `[[270],[48],[508],[168]]`

`:. AX = B`

`:. X = A^-1 B`

`|A|` = 
 `5`  `0`  `10`  `0` 
 `0`  `10`  `0`  `34` 
 `10`  `0`  `34`  `0` 
 `0`  `34`  `0`  `130` 


 =
 `5` × 
 `10`  `0`  `34` 
 `0`  `34`  `0` 
 `34`  `0`  `130` 
 `+0` × 
 `0`  `0`  `34` 
 `10`  `34`  `0` 
 `0`  `0`  `130` 
 `+10` × 
 `0`  `10`  `34` 
 `10`  `0`  `0` 
 `0`  `34`  `130` 
 `+0` × 
 `0`  `10`  `0` 
 `10`  `0`  `34` 
 `0`  `34`  `0` 


`=5 × (4896)+0 × (0)+10 × (-1440)+0 × (0)`

`=24480+0-14400+0`

`=10080`


`"Here, " |A| = 10080 != 0`

`:. A^(-1) " is possible."`

`Adj(A)` = 
Adj
`5``0``10``0`
`0``10``0``34`
`10``0``34``0`
`0``34``0``130`


 = 
 + 
 `10`  `0`  `34` 
 `0`  `34`  `0` 
 `34`  `0`  `130` 
 - 
 `0`  `0`  `34` 
 `10`  `34`  `0` 
 `0`  `0`  `130` 
 + 
 `0`  `10`  `34` 
 `10`  `0`  `0` 
 `0`  `34`  `130` 
 - 
 `0`  `10`  `0` 
 `10`  `0`  `34` 
 `0`  `34`  `0` 
 - 
 `0`  `10`  `0` 
 `0`  `34`  `0` 
 `34`  `0`  `130` 
 + 
 `5`  `10`  `0` 
 `10`  `34`  `0` 
 `0`  `0`  `130` 
 - 
 `5`  `0`  `0` 
 `10`  `0`  `0` 
 `0`  `34`  `130` 
 + 
 `5`  `0`  `10` 
 `10`  `0`  `34` 
 `0`  `34`  `0` 
 + 
 `0`  `10`  `0` 
 `10`  `0`  `34` 
 `34`  `0`  `130` 
 - 
 `5`  `10`  `0` 
 `0`  `0`  `34` 
 `0`  `0`  `130` 
 + 
 `5`  `0`  `0` 
 `0`  `10`  `34` 
 `0`  `34`  `130` 
 - 
 `5`  `0`  `10` 
 `0`  `10`  `0` 
 `0`  `34`  `0` 
 - 
 `0`  `10`  `0` 
 `10`  `0`  `34` 
 `0`  `34`  `0` 
 + 
 `5`  `10`  `0` 
 `0`  `0`  `34` 
 `10`  `34`  `0` 
 - 
 `5`  `0`  `0` 
 `0`  `10`  `34` 
 `10`  `0`  `0` 
 + 
 `5`  `0`  `10` 
 `0`  `10`  `0` 
 `10`  `0`  `34` 
T


 = 
`+(10 xx (34 × 130 - 0 × 0) +0 xx (0 × 130 - 0 × 34) +34 xx (0 × 0 - 34 × 34))``-(0 xx (34 × 130 - 0 × 0) +0 xx (10 × 130 - 0 × 0) +34 xx (10 × 0 - 34 × 0))``+(0 xx (0 × 130 - 0 × 34) -10 xx (10 × 130 - 0 × 0) +34 xx (10 × 34 - 0 × 0))``-(0 xx (0 × 0 - 34 × 34) -10 xx (10 × 0 - 34 × 0) +0 xx (10 × 34 - 0 × 0))`
`-(0 xx (34 × 130 - 0 × 0) -10 xx (0 × 130 - 0 × 34) +0 xx (0 × 0 - 34 × 34))``+(5 xx (34 × 130 - 0 × 0) -10 xx (10 × 130 - 0 × 0) +0 xx (10 × 0 - 34 × 0))``-(5 xx (0 × 130 - 0 × 34) +0 xx (10 × 130 - 0 × 0) +0 xx (10 × 34 - 0 × 0))``+(5 xx (0 × 0 - 34 × 34) +0 xx (10 × 0 - 34 × 0) +10 xx (10 × 34 - 0 × 0))`
`+(0 xx (0 × 130 - 34 × 0) -10 xx (10 × 130 - 34 × 34) +0 xx (10 × 0 - 0 × 34))``-(5 xx (0 × 130 - 34 × 0) -10 xx (0 × 130 - 34 × 0) +0 xx (0 × 0 - 0 × 0))``+(5 xx (10 × 130 - 34 × 34) +0 xx (0 × 130 - 34 × 0) +0 xx (0 × 34 - 10 × 0))``-(5 xx (10 × 0 - 0 × 34) +0 xx (0 × 0 - 0 × 0) +10 xx (0 × 34 - 10 × 0))`
`-(0 xx (0 × 0 - 34 × 34) -10 xx (10 × 0 - 34 × 0) +0 xx (10 × 34 - 0 × 0))``+(5 xx (0 × 0 - 34 × 34) -10 xx (0 × 0 - 34 × 10) +0 xx (0 × 34 - 0 × 10))``-(5 xx (10 × 0 - 34 × 0) +0 xx (0 × 0 - 34 × 10) +0 xx (0 × 0 - 10 × 10))``+(5 xx (10 × 34 - 0 × 0) +0 xx (0 × 34 - 0 × 10) +10 xx (0 × 0 - 10 × 10))`
T


 = 
`+(10 xx (4420 +0) +0 xx (0 +0) +34 xx (0 -1156))``-(0 xx (4420 +0) +0 xx (1300 +0) +34 xx (0 +0))``+(0 xx (0 +0) -10 xx (1300 +0) +34 xx (340 +0))``-(0 xx (0 -1156) -10 xx (0 +0) +0 xx (340 +0))`
`-(0 xx (4420 +0) -10 xx (0 +0) +0 xx (0 -1156))``+(5 xx (4420 +0) -10 xx (1300 +0) +0 xx (0 +0))``-(5 xx (0 +0) +0 xx (1300 +0) +0 xx (340 +0))``+(5 xx (0 -1156) +0 xx (0 +0) +10 xx (340 +0))`
`+(0 xx (0 +0) -10 xx (1300 -1156) +0 xx (0 +0))``-(5 xx (0 +0) -10 xx (0 +0) +0 xx (0 +0))``+(5 xx (1300 -1156) +0 xx (0 +0) +0 xx (0 +0))``-(5 xx (0 +0) +0 xx (0 +0) +10 xx (0 +0))`
`-(0 xx (0 -1156) -10 xx (0 +0) +0 xx (340 +0))``+(5 xx (0 -1156) -10 xx (0 -340) +0 xx (0 +0))``-(5 xx (0 +0) +0 xx (0 -340) +0 xx (0 -100))``+(5 xx (340 +0) +0 xx (0 +0) +10 xx (0 -100))`
T


 = 
`4896``0``-1440``0`
`0``9100``0``-2380`
`-1440``0``720``0`
`0``-2380``0``700`
T


 = 
`4896``0``-1440``0`
`0``9100``0``-2380`
`-1440``0``720``0`
`0``-2380``0``700`



`"Now, "A^(-1)=1/|A| × Adj(A)`

`"Here, "X = A^(-1) × B`

`:. X = 1/|A| × Adj(A) × B`

 = `1/(10080)` ×
`4896``0``-1440``0`
`0``9100``0``-2380`
`-1440``0``720``0`
`0``-2380``0``700`
×
`270`
`48`
`508`
`168`


 = `1/(10080)` ×
`4896×270+0×48-1440×508+0×168`
`0×270+9100×48+0×508-2380×168`
`-1440×270+0×48+720×508+0×168`
`0×270-2380×48+0×508+700×168`


 = `1/(10080)` ×
`590400`
`36960`
`-23040`
`3360`


 = 
`410/7`
`11/3`
`-16/7`
`1/3`


`:.[[a],[b],[c],[d]]=[[410/7],[11/3],[-16/7],[1/3]]`

`:. a=410/7, b=11/3, c=-16/7, d=1/3`

Now substituting this values in the equation is `y = a + bx + cx^2 + dx^3`, we get

`y = 410/7 +11/3x-16/7x^2+1/3x^3`

`y = 410/7 +11/3(X-1998)-16/7(X-1998)^2+1/3(X-1998)^3`


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



2. Second degree parabola `(y = a + bx + cx^2)`
(Previous method)
4. Exponential equation `(y=ae^(bx))`
(Next method)





Share this solution or page with your friends.


 
Copyright © 2024. All rights reserved. Terms, Privacy
 
 

.