MS WORD

1. Minimised Sum Square of Absolute Errors for solution of form y = Ax + B
We need to find values of A and B to minimise the equation:
F  i 1 ( yi  Axi  B) 2
N
- (1)
At the minimum we have two simultaneous equations formed by partial differentiation of – (1) with
respect to A and B respectively:
F
A
F
B
Let P1 =


N
= 0=
i 1
N
i 1
xi
- (2)
 ( yi  Axi  B)
- (3)
N
= 0=

 ( yi  Axi  B) xi
i 1

N
, P2 =
i 1
yi , P3 =

N
i 1
xi2 , P4 =

N
i 1
xi yi then (2) and (3) can be re-
written:P4 = AP3 + BP1
P2 = AP1 + BN
Isolating A from (5) we have :A = (P2 – BN)/P1
Substituting for A in 4) and solving for B we have:
- (4)
- (5)
- (6)
B = (P1P4 - P2P3)/(P12 – NP3)
- (7)
2. Minimised Sum Square of Absolute Errors for solution of form y = Ax + Bz + C
We need to find values of A and B to minimise the equation:
F  i 1 ( yi  Axi  Bz i  C ) 2
N
- (8)
At the minimum we have three simultaneous equations formed by partial differentiation of – (8)
with respect to A, B and C respectively:
F
A
= 0=
F
B
= 0=
F
C
= 0=



N
i 1
N
i 1
N
i 1
 ( yi  Axi  Bz i  C ) xi
- (9)
 ( yi  Axi  Bz i  C ) zi
- (10)
 ( yi  Axi  Bz i  C )
- (11)
With P1 – P4 as above, now let P5 =

N
i 1
xi zi , P6 =

N
z , P7=
i 1 i

N
i 1
yi zi , P8 =
(9), (10) and (11) can be re-written:P4 = AP3 + BP5 + CP1
P7 = AP5 + BP8 + CP6
P2 = AP1 + BP6 + CN
Isolating C from (14) we have :C = (P2 - AP1 - BP6)/N
Substituting for C in (12) we have:
NP4 – A(NP3 - P12 ) – B(NP5 - P1P6) – P1P2 = 0
Which, upon making the substitutions :
G1 = NP3 - P12 , G2 = NP5 - P1P6, G3 = NP4 - P1P2, and re-arranging for B, becomes:B = (G3 – AG1)/G2
Substituting from (15) and (17) in (13) leads, after some re-arrangement, to :
A = {P7 + (G3P62/G2N) – (G3P8/G2) – (P2P6/N)} /
{P5 + (G1P62/G2N) – (P1P6/N) - (G1P8/G2)}

N
2
i 1 i
z then
- (12)
- (13)
- (14)
- (15)
- (16)
- (17)
- (18)
3. Minimised Sum Square of Data Weighted Errors for solution of form y = Ax + B
We need to find values of A and B to minimise the equation:
F  i 1 (( yi  Axi  B) / yi ) 2
N
- (19)
At the minimum we have two simultaneous equations formed by partial differentiation of – (19)
with respect to A and B respectively:
F
A
= 0=
F
B
= 0=


N
i 1
N
i 1
 ( yi  Axi  B)( xi / yi2 )
- (20)
 ( yi  Axi  B) / yi2
- (21)
And, making the substitutions:

P16 = 
P11 =
N
i 1
N
i 1
( xi / yi ) , P12 =

N
i 1
(1 / yi ) , P13 =

N
i 1
( xi / yi2 ) , P15 =

N
i 1
(1 / yi2 ) ,
( xi2 / yi2 ) ,
We have from (20) and (21) we have, after some re-arrangement:
A = (P11 - BP13)/P16
B = (P12 – AP13)/P15
and, substituting from (22) into (23)
B = (P12P16-P11P13)/(P15P16-P132)
- (22)
- (23)
- (24)
4. Minimised Sum Square of Data Weighted Errors for solution of form y = Ax + Bz + C
We need to find values of A and B to minimise the equation:
F  i 1 (( yi  Axi  Bz i  C ) / yi ) 2
N
- (25)
At the minimum we have three simultaneous equations formed by partial differentiation of – (25)
with respect to A, B and C respectively:
F
A
= 0=
F
B
= 0=
F
C
= 0=



N
i 1
N
i 1
N
i 1
( yi  Axi  Bz i  C )( xi / yi2 )
- (26)
( yi  Axi  Bz i  C )( zi / yi2 )
- (27)
( yi  Axi  Bz i  C ) / yi2
- (28)
With Pn’s as defined above, now let P14 =
P19 =

N
i 1

N
z / yi2 , P17 =
i 1 i

N
x z / yi2 , P18=
i 1 i i

N
z / yi ,
i 1 i
zi2 / yi2 then (26), (27) and (28) can be re-written:-
P11 = AP16 + BP17 + CP13
P18 = AP17 + BP19 + CP14
P12 = AP13 + BP14 + CP15
Isolating C from (31) we have :C = (P12 - AP13 – BP14)/P15
Substituting for C in (29) we have:
A(P15P16 - P132 )= (P11P15-P12P13) – B(P15P17-P13P14)
Which, upon making the substitutions :
G1 = P15P17-P13P14, G2 = P15P16 - P132, and re-arranging for A, becomes:A = ((P11P15-P12P13) – BG1)/G2
Substituting from (32) and (34) in (30) leads, after some re-arrangement, to :
- (29)
- (30)
- (31)
- (32)
- (33)
- (34)
B = {(P15P18 - P12P14)G2 – (P11P15 - P12P13)G1} /
{(P15P19-P142)G2 – G12}
- (35)
5. Minimised Sum Square of Predicted Weighted Errors for solution of form y = Ax + B
We need to find values of A and B to minimise the equation:
F  i 0 (( yi  Axi  B) /( Axi  B)) 2
N
- (36)
At the minimum we have two simultaneous equations formed by partial differentiation of – (36)
with respect to A and B respectively:
 x y /( Ax  B)   x y /( Ax  B)
= GG = 0 =  y /( Ax  B)   y /( Ax  B)
F
A
N
= FF = 0 =
F
B
i 1
i
2
i
N
2
i
i 1
N
3
2
i 1
i
i
i
N
3
i 1
i
- (37)
i
i
2
- (38)
i
To solve the two non-linear simultaneous equations (37) and (38) we use an iterative approach
based on Taylor Series expansions to solve for h and k as corrections to A and B (then FF, GG and
hence A, B): (see. For example, Froberg Introduction to Numerical Analysis).
FF + h
FF
A
GG + h
+k
GG
A
+k
FF
B
=0
GG
B
- (39)
=0
- (40)
(39) can now be re-written :
h = - (k
FF
B
+ FF)/
FF
A
- (41)
which can then be substituted in 40 which becomes, after re-arrangement gives for k :
k = (FF
GG
A
-GG
From (37) and (38)
FF
A
FF
B
GG
A
GG
B

=
=
=
N
FF
A
)/(
GG FF
B
A
-
FF GG
B
A
N
i 1
N
i 1
N
i 1
- (42)
 2 x y /( Ax  B)
 3x y /( Ax  B) +  2 x y /( Ax  B)
 3x y /( Ax  B) +  2 x y /( Ax  B)
 3y /( Ax  B) +  2y /( Ax  B)
N
 3xi2 yi2 /( Axi  B) 4 +
i 1
=
)
i
2
i
i
i
2
i
i
2
i
2
i i
i 1
N
4
3
i 1
i 1
4
i
i
i
i
i
N
3
=
FF
B
3
i 1
i
i
N
4
3
i
i
i
and, making substitutions:

P4 = 
N
P1 =
i 1
N
x y /( Axi  B) 3
i 1 i i
FF
A
= P8 = 2P2 – 3P1
FF
B
=
GG
B
= P9 = 2P6 – 3P5
GG
A

, P5 = 
xi2 yi2 /( Axi  B) 4 , P2 =
N
i 1
N
i 1

, P6 = 
N
x i2 yi /( Axi  B) 3 , P3 =
yi2 /( Axi  B) 4
i 1
N
i 1
xi yi2 /( Axi  B) 4 ,
yi /( Axi  B) 3
= P7 = 2P4 – 3P3
which, substituting in (42) gives
k = (FFP7 – GGP8)/(P8P9-P72)
- (43)
6. Minimised Sum Square of Predicted Weighted Errors for solution of form y = Ax + Bz + C
We need to find values of A and B to minimise the equation:
F  i 1 (( yi  Axi  Bz  C ) /( Axi  Bz  C )) 2
N
- (44)
At the minimum we have two simultaneous equations formed by partial differentiation of – (45)
with respect to A, B and C respectively:
F
A
 x y /( Ax  Bz  C)  
= FF = 0 =  z y /( Ax  Bz  C )  
= GG = 0 =  y /( Ax  Bz  C )  
N
= EE = 0 =
F
B
i 1
2
i
i
N
F
C
N
z yi /( Axi  Bz i  C ) 2 - (47)
i 1 i
i
N
3
i
xi yi /( Axi  Bz i  C ) 2 - (46)
N
3
i
2
i
i 1
i 1
i
2
i
i 1 i
N
3
i
yi /( Axi  Bz i  C ) 2 - (48)
i 1
i
To solve the three non-linear simultaneous equations (48), (49) and (50) we use an iterative
approach based on Taylor Series expansions to solve for h, k and l (then EE, FF, GG and hence A,
B,C): (see. For example, Froberg Introduction to Numerical Analysis).
EE + h
EE
A
+k
EE
B
+l
EE
C
=0
- (49)
FF + h
FF
A
+k
FF
B
+l
FF
C
=0
- (50)
GG + h
GG
A
+k
GG
B
+l
GG
C
=0
- (51)
From (49)
l = - ((EE + h
EE
A
EE
B
+k
)/
EE
C
)
- (52)
which, substituted in (50) gives for k:
k(
EE FF
C B
-
EE FF
B C
FF
C
) = (EE
EE
C
-FF
) + h(
EE FF
A C
-
FF EE
A
C
)
- (53)
now let:
R1 = (
EE FF
C B
-
EE FF
B C
), R2 = (
EE FF
A C
FF EE
A
C
-
FF
C
), R3 = (EE
EE
C
-FF
)
And substituting for l and k in (51):
h(R1(
EE GG
C
A
-
EE GG
A
C
)+R2(
GG EE
B
C
GG
C
EE
C
= (R1 (EE
-GG
GG EE
C
B
-
))
GG EE
C
B
) + R3(
-
GG EE
B
C
))
- (54)
From (51) , (52) and (53)
EE
A
EE
B
EE
C
FF
A
FF
B
FF
C
GG
A
GG
B
GG
C

=
=
=
=
=
=
=
=
N
=
i 1
N
i 1
N
i 1
N
i 1
N
i 1
N
 2 x y /( Ax  Bz  C)
 3x z y /( Ax  Bz  C ) +  2 x z y /( Ax  Bz  C )
 3x y /( Ax  Bz  C ) +  2 x y /( Ax  Bz  C )
 3x z y /( Ax  Bz  C ) +  2 x z y /( Ax  Bz  C )
 3z y /( Ax  Bz  C ) +  2 z y /( Ax  Bz  C )
 3z y /( Ax  Bz  C ) +  2 z y /( Ax  Bz  C )
 3x y /( Ax  Bz  C ) +  2 x y /( Ax  Bz  C )
 3z y /( Ax  Bz  C ) +  2 z y /( Ax  Bz  C )
 3y /( Ax  Bz  C ) +  2y /( Ax  Bz  C )
2
i
i i
i
2
i
i
i
2
i
2
i
i
i
2
i
i
i
i 1
i
2
i
i
i
N
2
i
i 1
N
i 1
4
i 1
N
4
i 1
N
i
i
4
i
i
i
i
i
3
i
i
i
3
i
i
i
i
3
i
i
i
i
i
i
i
N
3
i 1
i
N
3
i 1
i
i
2
i
i 1
4
i
i
i
i
N
4
i
i
i 1
i
2
i
i i
N
4
i
i
i
3
i 1
i
i
N
4
i
2
i
3
i
3
i 1
i
i
2
i
i 1
N
4
i
i
i 1
N
N
 3xi2 yi2 /( Axi  Bz i  C ) 4 +
i
i
i
Or, making substitutions:

P3 = 
P5 = 
P1 =
N

z y /( Ax  Bz  C ) , P4 = 
y /( Ax  Bz  C ) , P6 = 
x y 2 /( Axi  Bz i  C ) 3 , P2 =
i 1 i i
N
i 1 i
N
i 1
2
i
2
i
3
i
i
i 1
N
xi yi /( Axi  Bz i  C ) 2
z yi /( Axi  Bz i  C ) 2
i 1 i
i
3
i
N
N
i 1
yi /( Axi  Bz i  C ) 2
3
 x y /( Ax  Bz  C) , P8=  x y /( Ax  Bz  C) ,
P9=  x z y /( Ax  Bz  C ) , P10 =  x z y /( Ax  Bz  C ) ,
P11 =  x y /( Ax  Bz  C ) , P12 =  x y /( Ax  Bz  C ) ,
P13=  z y /( Ax  Bz  C ) , P14=  z y /( Ax  Bz  C ) ,
P15 =  z y /( Ax  Bz  C ) , P16 =  z y /( Ax  Bz  C ) ,
P17=  y /( Ax  Bz  C ) , P18 =  y /( Ax  Bz  C ) ,
P7=
N
2
i 1
i
N
3
i
i
N
i i
i
i
i 1
i
N
i
N
2
i 1
i
i
i
i 1
i
i
i
N
i
i
N
i 1
N
3
i
i
i 1
i
i
4
i
2
i
i 1 i
i
4
i
2
i
i
N
3
i 1 i
i
2
i
i i
N
2
i 1 i
3
i
4
i
N
3
i 1
2
i
N
3
i 1
2
i
i 1
i
i
4
i
2
i
i
4
i
2
i
i
4
i
i
Then
EE = P1 – P2, FF = P3 – P4, GG = P5 – P6,
EE
B
EE
C
EE
A
= EP =2P7 – 3P8,
FF
B
= FS = 2P13 – 3P14,
GG
C
= GP = 2P17-3P18, which can be back-substituted into (52) – (54).
= ES = 2P9 – 3P10,
FF
C
= FP = 2P15-3P16,
= EP = 2P11-3P12,
GG
A
FF
A
= GD = 2P11-3P12,
= FD = 2P9 – 3P10,
GG
B
= GS = 2P15-3P16,
7. Minimised Sum Square of Errors for solution of form y = AxB
The traditional approach to this problem is to take logs of both sides:Ln(y) = BLn(x) + Ln(A), and minimise:-
F  i 1 ( Ln( yi )  BLn ( xi )  Ln( A)) 2
N
- (55)
Which has exactly the same form as (1) and can be solved by transformation of variables. However it
should be noted that this is actually minimising the errors in the logarithms, rather than the absolute
errors.
8. Minimised Sum Square of Errors for solution of form y = AxBzC
The traditional approach to this problem is to take logs of both sides:Ln(y) = BLn(x) + Ln(A), and minimise:-
F  i 1 ( Ln( yi )  BLn ( xi )  CLn( zi )  Ln( A)) 2
N
- (56)
Which has exactly the same form as (8) and can be solved by appropriate transformation of
variables. However it should be noted that this is actually minimising the errors in the logarithms,
rather than the absolute errors.
9. Minimised Sum Square of Absolute Errors for solution of form y = AxB
We need to find values of A and B to minimise the equation:
F  i 1 ( yi  AxiB ) 2
N
- (57)
Differentiating (54) with respect to A and B gives:F
A
= 0=
F
B
= 0=


N
i 1
N
i 1
 ( yi  AxiB ) xi

N
i 1
B
- (58)
 ( yi  AxiB ) xi ln xi
Making the substitutions:
P1 =
B
yi xi ln xi , P2 =
B

N
i 1
xi
2B
ln xi , P3 =
- (59)

N
i 1
B
yi xi , P4 =

N
i 1
B
yi xi (ln xi ) 2 ,
P5 =

N
i 1
2B
xi , P6 =

N
2B
xi (ln xi ) 2 we arrive at, from 58:
i 1
A = P3/P5
- (60)
And substituting into (59) we find we need to solve the equation
FB = P3P2 – P1P5 = 0
- (61)
In order to solve this we can make use of Newton-Raphson technique (see, for example, Froberg) in
which, if Xn is an approximate solution to FB(X) = 0, then an iterative technique can be used:
Xn+1 = Xn – FB(Xn)/FB’(Xn)
- (62)
And, from (64):
 y x ln x  2x (ln x ) + 
-  y x ln x  2x ln x - 
N
FB’ =
N
B
i 1
i
i
N
2B
i 1
i
i 1
2B
i 1
i
i 1
N
i
N
B
i i
N
2
i
i
i 1
i
xi
xi
ln xi


yi xi (ln xi ) 2
2B
2B
N
B
yi xi ln xi
i 1
N
B
i 1
= 2P3P6 – P1P2 – P4P5
- (63)
And we can keep iterating through (62) until the absolute value of the correction factor
FB(Xn)/FB’(Xn) is less than a set tolerance level.
10. Minimised Sum Square of Absolute Errors for solution of form y = AxBzC
We need to find values of A and B to minimise the equation:
F  i 1 ( yi  AxiB ziC ) 2
N
- (64)
Differentiating (54) with respect to A, B and C gives:F
A
= 0=
F
B
= 0=
F
C
= 0=



N

P5 = 
P8 = 
P11= 
N
i 1
N
i 1
i 1
N
i 1
N
i 1
- (66)
 ( yi  AxiB ziC ) xi ziC ln zi
- (67)
B
N
i 1
2B
xi zi2C , P3 =
 x
x z (ln x ) , P9 = 
y x z (ln z ) , P12 = 
B
yi xi ziC ln zi , P6 =
i
2 B 2C
i
i i
N
i 1
i
2 B 2C
i
z
N
2
2
N
i 1
ln zi , P7 =
F
C

N
i 1

N
i 1
2B
xi zi2C ln xi ,
B
yi xi ziC (ln xi ) 2 ,

N
i 1
2B
xi zi2C ln xi ln zi
2B
xi zi2C (ln zi ) 2
we arrive at, from 65:
A = P1/P2
And substituting into (66) and (67)
F
B
B
yi xi ziC ln xi , P4 =
yi xi ziC ln xi ln zi , P10 =
i 1
i

B
i 1
N
i
B C
i
- (65)
 ( yi  AxiB ziC ) xi ziC ln xi

B
yi xi ziC , P2 =
B
B
i 1
N
Making the substitutions:
P1 =
 ( yi  AxiB ziC ) xi
i 1
N
- (68)
= FF = P2P3 - P1P4 = 0
= GG = P2P5 - P1P6 = 0
Which can be solved iteratively as in Section 5 above:
FF + h
FF
B
+k
GG
B
GG + h
+k
FF
C
=0
GG
C
- (69)
=0
- (70)
(69) can now be re-written :
h = - (k
FF
C
+ FF)/
FF
B
- (71)
which can then be substituted in (70) which becomes, after re-arrangement gives for k :
k = (FF
GG
B
where we have:
-GG
FF
B
)/(
GG FF
C
B
-
FF GG
C
B
)
- (72)
FF
B
= P2(

N
i 1
yi xi ziC (ln xi ) 2 ) +P3( i 1 2xi zi2C ln xi ) – P1( i 1 2xi zi2C (ln xi ) 2 )
N
B
N
2B
– P4 (
FF
C
= P2(

N
2B
B
yi xi ziC ln xi )
i 1
= P2P7 + P3P4 – 2P1P8 = P15

N
i 1
yi xi ziC ln xi ln zi ) +P3( i 1 2xi zi2C ln zi ) –P1( i 1 2yi xi ziC ln xi ln zi )
N
B
N
2B
–P4 (

N
B
B
i 1
yi xi ziC ln zi )
=2P3P6 + P2P9 – 2P1P10 – P4P5 = P16
GG
B
= P2(

N
i 1
yi xi ziC ln xi ln zi ) + P5 ( i 1 2xi zi2C ln xi ) – P1( i 1 2xi zi2C ln xi ln zi )
N
B
N
2B
-P6

N
2B
B
yi xi ziC ln xi
i 1
= 2P4P5 + P2P9 - 2P1P10 - P3P6 = P17
GG
C
= P2(

N
i 1
yi xi ziC (ln zi ) 2 ) +P5( i 1 2xi zi2C ln zi ) – P1( i 1 2xi zi2C (ln zi ) 2 )
N
B
N
2B
-P6(

N
2B
B
i 1
yi xi ziC ln zi )
= P2P11 + P5P6 – 2P1P12 = P18
And, substituting back in (71) and (72)
k = (FFP17 – GGP15)/(P15P18-P16P17)
h = - (kP16 + FF)/ P15
11. Minimised Sum Square of Data Weighted Errors for solution of form y = AxB
We need to find values of A and B to minimise the equation:
F  i 1 (( yi  AxiB ) / yi ) 2
N
- (73)
- (74)
- (75)
Differentiating (76) with respect to A and B gives:F
A
= 0=
F
B
= 0=


N
i 1
N
i 1
 ( yi  AxiB ) xi / yi2
- (76)
 ( yi  AxiB ) xi ln xi / yi2
- (77)
B
B
Making the substitutions:

P5 = 
P1 =
N
i 1
N
i 1
B
xi ln xi / yi , P2 =
xi
2B

N
i 1
xi
2B
ln xi / yi2 , P3 =

N
i 1
B
xi / yi ,
/ yi2 we find from (76)
A = P3/P5
- (78)
And substituting into (75) we find we need to solve the equation
FF = P2P3 – P1P5 = 0
- (79)
In order to solve this we can make use of the method of Regula-Falsi (see for example wikipedia Newton-Raphson can also be used but seems more volatile).
12. Minimised Sum Square of Data Weighted Errors for solution of form y = AxBzC
We need to find values of A and B to minimise the equation:
F  i 1 (( yi  AxiB ziC ) / yi ) 2
N
- (80)
Differentiating (54) with respect to A, B and C gives:F
A
= 0=
F
B
= 0=


N
i 1
N
i 1
 ( yi  AxiB ziC ) xi ziC / yi2
- (81)
 ( yi  AxiB ziC ) xi ziC ln xi / yi2
- (82)
B
B
F
C

N
= 0=
i 1
 ( yi  AxiB ziC ) xi ziC ln xi / yi2
B
Making the substitutions:

P4 = 
P1 =
N
i 1
N

N
xiB ziC / yi , P2 =
i 1
2B
xi zi2 B / yi2 , P3 =
2B
xi zi2C ln xi / yi2 , P5 =
i 1

N

N
i 1
- (83)
B
xi ziC ln xi / yi ,
B
xi ziC ln zi / yi , P6 =
i 1

N
i 1
2B
xi zi2C ln zi / yi2 we find
from (81)
A = P3/P5
And substituting into (83) and (84) we find we need to solve the equations:
FF = P2P3 – P1P4 = 0
GG = P2P5 - P1P6 = 0
Which can be solved iteratively as in Section 5 above:
FF
B
FF + h
GG + h
+k
GG
B
FF
C
=0
GG
C
+k
- (84)
- (85)
=0
- (86)
(86) can now be re-written :
h = - (k
FF
C
+ FF)/
FF
B
- (87)
which can then be substituted in (87) which becomes, after re-arrangement gives for k :
k = (FF
GG
B
-GG
FF
B
)/(
GG FF
C
B
From (86) and (87), and with:

P10 = 
P7 =
N
i 1
N
B
xi ziC (ln xi ) 2 / yi , P8 =
-
FF GG
C
B

N
i 1
)
- (88)
2B
xi zi2C (ln xi ) 2 / yi2 , P9 =

xi zi2C ln xi ln zi / yi2 , P11 = i 1 xi ziC (ln zi ) 2 / yi ,P12 =
N
2B
i 1
FF
B
B
N
i 1
B
xi ziC ln xi ln zi / yi ,

N
i 1
2B
xi zi2C (ln zi ) 2 / yi2
= P2P7 + P3P4 – 2P1P8 = P15
FF
C
= 2P3P6 + P2P9 – 2P1P10 – P4P5 = P16
GG
B
= 2P4P5 + P2P9 - 2P1P10 - P3P6 = P17
GG
C
= P2P11 + P5P6 - 2P1P12 = P18
and, from (86)
k = (FFP17 – GGP15)/(P15P18-P16P17)
and, from (85)
h = -(kP16 +FF)/P15
Minimised Sum Square of Predictor Weighted Errors for solution of form y = AxB
We need to find values of A and B to minimise the equation:
F  i 1 (( yi  AxiB ) / AxiB ) 2
N
- (88)
Differentiating (54) with respect to A and B gives:F
A
= 0=
F
B
= 0=


N
i 1
N
i 1
 ( yi  AxiB ) yi / xi2
- (89)
 ( yi  AxiB ) yi ln xi / xi2 B
- (90)
Making the substitutions:

P5 = 
P1 =
N
i 1
N
i 1
yi2 ln xi / xi2 B , P2 =

N
i 1
yi ln xi / xiB , P3 =

N
i 1
yi2 / xi2 B ,
yi / xiB we find from (91)
A = P1/P2
And substituting into (90) we find we need to solve the equation
FF = P2P3 – P1P5 = 0
- (91)
- (92)
In order to solve this we can make use of the method of Regula-Falsi (see for example wikipedia).
13. Minimised Sum Square of Absolute Weighted Errors for solution of form y = AxBzC
We need to find values of A and B to minimise the equation:
F  i 1 (( yi  AxiB ziC ) / AxiB ziC ) 2
N
- (93)
Differentiating (54) with respect to A, B and C gives:F
A
= 0=
F
B
= 0=
F
C
= 0=



N
i 1
N
i 1
N
i 1
 ( yi  AxiB ziC ) yi / xi2 B zi2C
- (94)
 ( yi  AxiB ziC ) yi ln xi / xi2 B zi2C
- (95)
 ( yi  AxiB ziC ) yi ln zi / C
- (96)
Making the substitutions:

P4 = 
P1 =
N
i 1
N
i 1
yi2 / xi2 B zi2 C , P2 =

N
i 1
yi ln xi / xiB ziC , P5 =
yi / xiB ziC , P3 =

N
i 1

N
i 1
yi2 ln xi / xi2 B zi2C ,
yi2 ln zi / xiB ziC , P6 =

N
i 1
yi ln zi xiB ziC we find from (94)
A = P1/P2
And substituting into (95) and (96) we find we need to solve the equations:
FF = P2P3 – P1P4 = 0
GG = P2P5 - P1P6 = 0
Which can be solved iteratively as in Section 5 above:
FF + h
FF
B
GG + h
+k
GG
B
+k
FF
C
- (97)
=0
GG
C
- (98)
=0
- (99)
(97) can now be re-written :
h = - (k
FF
C
+ FF)/
FF
B
- (100)
which can then be substituted in (99) which becomes, after re-arrangement gives for k :
k = (FF
GG
B
-GG
FF
B
)/(
GG FF
C
B
From (98) and (99), and with:

P10 = 
P7 =
N
i 1
N
i 1
FF
B
-
FF GG
C
B

, P11 = 
yi2 (ln xi ) 2 / xi2 B zi2C , P8 =
yi ln xi ln zi / xiB ziC
N
i 1
N
i 1
)
yi (ln xi ) 2 / xiB ziC , P9 =
- (101)

yi2 (ln zi ) 2 / xi2 B zi2C ,P12 =
N
yi2 ln xi ln zi / xi2 B zi2C ,
i 1

N
i 1
yi ln zi / xiB ziC
= P1P8 + P3P4 – 2P2P7 = P15
- (102)
FF
C
= 2P4P5 + P1P10 – 2P2P9 – P3P6 = P16
- (103)
GG
B
= 2P3P6 + P1P10 – P4P5 – 2P2P9 = P17
- (104)
GG
C
= P5P6 – P1P12 – 2P2P11 = P18
- (105)
and, from (101)
k = (FFP17 – GGP15)/(P15P18-P16P17)
and, from (100)
h = -(kP16 +FF)/P15
- (106)
- (107)
14. Minimised Sum Square of Absolute Errors for solution of form y = A + BxC
We need to find values of A and B to minimise the equation:
F  i 1 ( yi  ( A  Bx iC )) 2
N
Differentiating (106) with respect to A, B and C gives:-
- (108)
F
A
= 0=
F
B
= 0=
F
C
= 0=



N
i 1
N
( yi  ( A  Bx iC ))
- (109)
( yi  ( A  Bx iC )) xiC
- (110)
( yi  ( A  Bx iC )) xiC ln xi
- (111)
i 1
N
i 1
Making the substitutions:

P5 = 
P1 =
N
i 1
N
i 1
yi , P2 =

N
C
xi , P3 =
i 1
xiC ln xi , P6 =

N
i 1

N
i 1
2C
xi , P4 =

N
i 1
yi xiC ln xi ,
xi2C ln xi , P7 = i 1 yi xiC
N
we arrive at, from 109:
A = (P1-BP2)/N
And substituting into (110):
B = (P1P2-NP7)/(P22 – NP3)
And we now have to solve the equation formed from 111 by using (109) and (110) :
FB = 0 = P4 – AP5 – BP6
Using, for example, the method of Regula-Falsi.
- (112)
- (113)
- (114)
15. Minimised Sum Square of Data Weighted Errors for solution of form y = A + BxC
We need to find values of A and B to minimise the equation:
F  i 1 (( yi  ( A  Bx iC ) / yi )) 2
N
- (115)
Differentiating (115) with respect to A, B and C gives:F
A
= 0=
F
B
= 0=
F
C
= 0=



N
i 1
N
( yi  ( A  Bx iC ))
- (116)
( yi  ( A  Bx iC )) xiC
- (117)
( yi  ( A  Bx iC )) xiC ln xi
- (118)
i 1
N
i 1
Making the substitutions:

P5 = 
P1 =
N
i 1
N
i 1
yi , P2 =

N
C
xi , P3 =
i 1
xiC ln xi , P6 =

N
i 1

N
i 1
2C
xi , P4 =

N
i 1
yi xiC ln xi ,
xi2C ln xi , P7 = i 1 yi xiC
N
we arrive at, from 115:
A = (P1-BP2)/N
And substituting into (117):
B = (P1P2-NP7)/(P22 – NP3)
And we now have to solve the equation formed from (118) by using (119) and (120) :
FB = 0 = P4 – AP5 – BP6
Using, for example, the method of Regula-Falsi.
- (119)
- (120)
- (121)
16. Minimised Sum Square of Absolute Errors for solution of form y = A + BxC
We need to find values of A and B to minimise the equation:
F  i 1 ( yi  ( A  Bx iC )) 2
N
- (122)
Differentiating (122) with respect to A, B and C gives:F
A
= 0=
F
B
= 0=
F
C
= 0=



N
i 1
N
( yi  ( A  Bx iC ))
- (123)
( yi  ( A  Bx iC )) xiC
- (124)
( yi  ( A  Bx iC )) xiC ln xi
- (125)
i 1
N
i 1
Making the substitutions:

P5 = 
P1 =
N
yi , P2 =
i 1
N

N
i 1
xiC ln xi , P6 =
i 1
C
xi , P3 =


N
2C
xi , P4 =
i 1

N
i 1
yi xiC ln xi ,
xi2C ln xi , P7 = i 1 yi xiC
N
N
i 1
we arrive at, from 123:
A = (P1-BP2)/N
And substituting into (124):
B = (P1P2-NP7)/(P22 – NP3)
And we now have to solve the equation formed from 125 by using (126) and (127) :
FB = 0 = P4 – AP5 – BP6
Using, for example, the method of Regula-Falsi.
- (126)
- (127)
- (128)
17. Minimised Sum Square of Data Weighted Errors for solution of form y = A + BxC
We need to find values of A and B to minimise the equation:
F  i 1 (( yi  ( A  Bx iC )) / yi ) 2
N
- (129)
Differentiating (129) with respect to A, B and C gives:F
A
= 0=
F
B
= 0=
F
C
= 0=



N
i 1
N
i 1
N
i 1
( yi  ( A  Bx iC )) / yi
- (130)
( yi  ( A  Bx iC )) xiC / yi2
- (131)
( yi  ( A  Bx iC )) xiC ln xi / yi2
- (132)
Making the substitutions:

P5 = 
P1 =
N
i 1
N
1 / yi , P2 =

N
xi2C / yi2 , P6 =
i 1
1 / yi2 , P3 =
i 1


N
i 1
C
xi / yi2 , P4 =

N
i 1
xiC / yi ,
xiC ln xi / yi , P7 = i 1 xiC ln xi / yi2 , P8 =
N
N
i 1

N
i 1
xi2C ln xi / yi
we arrive at, from (130) and (131)
A = (P1P5-P3P4)/(P2P5-P32)
B = (P1P3 – P2P4)/(P32-P2P5)
And we now have to solve the equation formed from (132) by using (133) and (134) :
FB = 0 = P6 – AP7 – BP8
Using, for example, the method of Regula-Falsi.
- (133)
- (134)
- (135)
18. Minimised Sum Square of Predicted Weighted Errors for solution of form y = A + BxC
We need to find values of A and B to minimise the equation:
F  i 1 (( yi  ( A  Bx iC )) /( A  Bx iC )) 2
N
- (136)
At the minimum we have two simultaneous equations formed by partial differentiation of – (136)
with respect to A, B and C respectively:
F
A
F
B
F
C

= FF = 0 = 
= GG = 0 = 
N
= EE = 0 =
i 1
yi2 /( A  Bx iC ) 3  i 1 yi /( A  Bx iC ) 2
N
x C yi2 /( A  Bx iC ) 3  i 1 xiC yi /( A  Bx iC ) 2
i 1 i
N
N
i 1
N
- (137)
- (138)
yi2 xiC ln xi /( A  Bx iC ) 3  i 1 yi xiC /( A  Bx iC ) 2 - (139)
N
To solve the three non-linear simultaneous equations (137) – (139) we use an iterative approach
based on Taylor Series expansions to solve for h, k and l (then EE, FF and GG and hence A, B, C): (see.
For example, Froberg Introduction to Numerical Analysis).
EE + h
EE
A
+k
EE
B
+l
EE
C
=0
- (140)
FF + h
FF
A
GG + h
FF
B
+k
GG
A
GG
B
+k
FF
C
+l
=0
GG
C
+l
- (141)
=0
- (142)
From (124)
l = - ((EE + h
EE
A
+k
EE
B
)/
EE
C
)
- (143)
which, substituted in (125) gives for k:
k(
EE FF
C B
EE FF
B C
-
) = (EE
FF
C
-FF
EE
C
EE FF
A C
) + h(
-
FF EE
A
C
)
- (144)
now let:
R1 = (
EE FF
C B
-
EE FF
B C
), R2 = (
EE FF
A C
FF EE
A
C
-
), R3 = (EE
FF
C
-FF
EE
C
)
And substituting for l and k in (126):
h(R1(
EE GG
C
A
-
EE GG
A
C
)+R2(
= (R1 (EE
GG
C
GG EE
B
C
-GG
From (140) , (141) and (142)
EE
A
EE
B

=
=
=
=
=
N
=
i 1
N
 3yi2 /( A  Bx iC ) 4 +
i 1
-
EE
C
GG EE
C
B
) + R3(

N
GG EE
C
B
-
GG EE
B
C
))
- (145)
2yi /( A  Bx iC )3
i 1

N
 3yi2 xiC /( A  Bx iC ) 4 +
))
i 1
2yi xiC /( A  Bx iC ) 3
 2y x ln x /( A  Bx )
 3x y x /( A  Bx ) +  2y x /( A  Bx )
 3y x /( A  Bx ) +  2y x /( A  Bx )
 3B y x ln x /( A  Bx ) +  2B y x ln x /( A  Bx ) +
 y x ln x /( A  Bx ) -  y x ln x /( A  Bx )
=   3y x ln x /( A  Bx ) +  2y x ln x /( A  Bx )
=   3y x ln x /( A  Bx ) +  2y x ln x /( A  Bx )
=  y x (ln x ) /( A  Bx ) -  3B y x (ln x ) /( A  Bx )
 y x (ln x ) /( A  Bx ) +  2By x (ln x ) /( A  Bx
EE
C
FF
A
FF
B
FF
C
N
i 1
N
i 1
N
2 C
i i
2 C
i i
GG
A
i 1
GG
B
i 1
GG
C
i 1
i
2 C
i i
N
i 1
2
i
C
i i
N
C
i i
C
i i
C 2
i
N
C
i i
i 1
N
i 1
C 3
i
i 1
2
C 3
i
i
C 4
i
N
C 3
i
i
2C
i i
C 3
i
i
2 2C
i i
N
C 2
i
i
C 3
i
i 1
C 4
i
i
2 2C
i i
N
N
C 3
i
2C
i i
i 1
i 1
C 3
i
i
C
i i
C 4
i
C 3
i
2 C
i i
N
N
i
i
N
N
i 1
C 4
i
C
i i
i 1
C 4
i
2 2C
i i
i 1
N
2 C
i i
i
i 1
N
i 1
N
 3yi2 xiC ln xi /( A  Bx iC ) 4 +
i 1
i
2
C 4
i
i
2C
I
2
C 3
i
i
Or, making substitutions:
 y /( A  Bx ) , P2 =  y /( A  Bx )
P3 =  y x /( A  Bx ) , P4 =  y x /( A  Bx )
P5 =  y x ln x /( A  Bx ) , P6 =  y x ln x /( A  Bx )
P7=  y /( A  Bx ) , P8=  y /( A  Bx ) ,
P9=  y x /( A  Bx ) , P10 =  y x /( A  Bx ) ,
P11 =  y x ln x /( A  Bx ) , P12 =  y x ln x /( A  Bx ) ,
P13=  y x /( A  Bx ) , P14=  y x /( A  Bx ) ,
P15 =  y x ln x /( A  Bx ) , P16 =  y x ln x /( A  Bx ) ,
P1 =
N
2
i
i 1
N
2 C
i i
i 1
N
2 C
i i
i 1
N
2
i 1
i
N
N
i 1
N
i 1
N
i 1
i 1
i 1
N
N
i
C
i
C 3
i
N
i 1
N
i 1
C 3
i
C 2
i
i
C 3
i
i 1
C 4
i
i
C
i i
i
C 4
i
i
C 2
i
i 1
N
C 4
i
2 2C
i i
2 C
i i
C
i i
i 1
C 3
i
i
C 4
i
2 C
i i
C 2
i
i
N
C 3
i
2 C
i i
i 1
N
C 3
i
C
i i
2C
i i
N
i 1
C 3
i
i
C 3
i
2 2C
i i
i
-
C 4
i
)

P19 = 
P21= 
P17=
N
i 1
yi xiC ln xi /( A  Bx iC ) 2 , P18 =
N
N
yi xiC (ln xi ) 2 /( A  Bx iC ) 2
N
i 1
yi xi2C ln xi /( A  Bx iC )3 ,

, P22 = 
yi2 xiC (ln xi ) 2 /( A  Bx iC ) 3 , P20 =
i 1
i 1

N
i 1
N
i 1
yi2 xi2C (ln xi ) 2 /( A  Bx iC ) 4 ,
yi xi2C (ln xi ) 2 /( A  Bx iC ) 3
Then
EE = P1 – P2, FF = P3 – P4, GG = P5 – P6,
EE
A
= EP =2P8 – 3P7,
FF
B
= FS = 2P14 – 3P13,
2P18-3P16,
GG
C
EE
B
= ES = 2P10 – 3P9,
FF
C
EE
C
= EP = 2P11-3P12,
= FP = P15 – 3BP16 – P17 + 2BP18,
FF
A
= FD = 2P10 – 3P9,
GG
A
= GD = 2P12-3P11,
GG
B
= GS =
= GP = P19 – 3BP20 – P21 + 2BP22, which can be back-substituted into (143) – (145).