Table adjusting ?

1 Answer
Aug 31, 2016

y=0.489421x+25.3113

Explanation:

Given a list of values {xk,yk},k=1,2,,n

a line can be adjusted such that the accumulated deviation error is minimum.

Let the line be given by

y=ax+b

then the error at point xk is ek=yk(axk+b)

The accumulated quadratic error will be given by

E(a,b)=nk=1e2k=nk=1(yk(axk+b))2

E(a,b) have a minimum for a0,b0 such that

Ea(a0,b0)=0b0xk+a0x2k=xkyk
Eb(a0,b0)=0nb0+a0xk=yk

solving for a0,b0

a0=(xk)(yk)nxkyk(xk)2nx2k
b0=(xk)(xkyk)(x2k)(yk)(xk)2nx2k

appliying it to the table

{{10,15},{10,25},{15,17},{17,20},{25,11.5},{30,11},{35,5},{35,10}}

we obtain:

a0=0.489421,b0=25.3113

so the adjusting line is

y=0.489421x+25.3113

Attached a plot

enter image source here