WIKI Document Number 5 Interpolaton wth Least Squares Curve Fttng wth the Least Square Method Mattheu Bultelle Department of Bo-Engneerng Imperal College, London
Context We wsh to model the postve feedback of the producton of AHL. For ths purpose we need to nterpolate a set of N expermental measurements, Y 1... N wth the functon x f x Ax B x Interpolaton Functon 1 0.8 0.6 0.4 0. A=1 B=1 A=1 B= A=1 B=4 0 0 5 10 There are several ways to do the nterpolaton, some are more robust than others. We chose to use the least square methods that s to mnmze the expresson, ) A A B Y B The mnmum of the functon s obtaned for the pont (A, such as 0 We have therefore the followng necessary condtons A (1) A Y 0 B B () B A Y B A B 0
Equaton (1) can be smplfed to yeld the condton (1) A Y B F( B Lkewse () can be modfed nto () A Y B B 3 G( The ntersectons of the curves, ) A A B Y B A FB and GB A are potental extrema of the. It s easy to prove that they actually are local mnma. If the data are knd to us there s only one ntersecton. In the general case we have more than one ntersectons. To determne whch local mnmum s the absolute mnmum (the pont we are A, for all the canddates the overall mnmum s of course the after), we need to compute pont that returns the lowest value. How many Local Mnma are there? There s no way to know how many local mnma there are but t s easy to know how many there are n the worst case scenaro It s easy to prove that the equaton B GB F can be turned nto a polynomal equaton of degree 5N-5. So there cannot be more the 5N-5 ntersecton ponts whch can stll be many. Do we know where they are located? Up to a pont. We are only nterested n the postve values of B, so we have 0 as a lower bound for B. Unfortunately we do not have a smple upper bound for B. An easy pragmatc soluton s avalable to us however. Just plot B G( F(! It wll be easy to dentfy a value of B (call t B lm ) whch s sure to be an upper bound (the estmaton does not have to be that precse!!!). A lttle physcal sense also helps: f you have done your experments properly you have acqured some data n the saturaton phase. If ths s the case you can be sure that max s larger than B, and max can therefore be sued as an upper bound for B n the search for the overall mnmum for A,.
How do I fnd the solutons of G( = F( We now have a lower and an upper bound for B. For complex equatons lke the one we are nterested n I would recommend the followng strategy (whch s not brute force but s stll computatonally ntensve). Implementaton wll requre a few programmng sklls (I recommend Matlab or C as language). 1) Cut the segment, 0 B nto a large number (p+1) of equally-spaced ponts lm Blm / p. Ideally p s large (1000 or even better). ) Compute B FB G for all the ponts B p lm / 3) For =0 to = p, Compare the sgn of G F wth G F 1 1 If there has been a change of sgn between then there s a zero of the functon between and 1. Fnd ths zero of the functon by dchotomy. Provdng the ntal samplng of 0, B lm has been fne enough (p large enough) we have found all the solutons of the functon. Remnder : Fndng zeros of a functon by dchotomy Dchotomy = cuttng n two Let us assume we have a functon f contnuous on a, b such as f a 0 and f b 0. Note f we have f a 0 and f b 0 nstead t does not matter ust swtch f for f!! It can be proven that f has a zero between a and b (f beng contnuous). Please note that there may be more than one zero between a and b. The method detaled below s gong to yeld one of them only, not all of them. To get all the zeros between a and b you need to resample a,b more fnely. Let us call the precson of the estmaton of ths zero. We want to return a value x such as x x 0 where f x 0 0. For ths purpose we buld two seres U 0 and V 0 wth the followng rules Intalzaton: U0 a, V0 b U Computng Rank +1: Compute V U 1 U V / If t s postve then V 1 V F. else V U 1 U V / U 1 Repeat the operaton whle U V
A less complcated way to fnd the overall Mnmum Excel offers a way to mplement the least square method wth any nterpolaton functon. All t needs s - the expresson of the nterpolaton functon - the data, Y 1... N - a startng pont for the search (A 0,B 0 ) However, the optmzaton algorthm s not as robust as we could hope and therefore nothng ensures that the software wll not return a local mnmum nstead of the overall mnmum. We can use the prevous results to get a more robust nterpolaton. The dea s to use a (potentally) large number of startng ponts and let Excel do the rest. We assume that the upper bound B lm has been found. 1) Cut the segment, 0 B nto a large number (p+1) of equally-spaced ponts p lm Blm /. Ideally for every value Blm / p we would assocate a value of of A such as (, ) s a good startng pont. If your experments were done properly then you dd some measures n the saturated phase of the curve. you can therefore use = Y max = Max (Y I ) all the tme. ) For every value of, run the Excel Smulaton wth (Y max, ) as startng pont. We call the result (A, B ). A 3) Compute the error functon A Y for (A, B ) B, The pont (A, B ) that acheves the lowest value of A, wll be a good approxmaton of the mnmum of A, A Y B f you have used enough ponts (p s large enough).