Zbornik gozdarstva in lesarstva, 38, 1991, s. 257 - 273 GDK 561.015.5 Math. Subj. Class. (1985) 62102, 90C30 EKSTREMNE KORELACIJE Anton CEDILNIK* Izvleček V članku je definirana količina, ki meri kvaliteto aproksimacije tabelarično podane funkcije s funkcijo iz neke družine D nekonstantnih funkcij. V ta namen je treba poiskati infimum in su- premum množice korelacijskih koeficientov med dano funkcijo in funkcijami iz D. Tu je to storjeno za družino vseh nekonstantnih funkcij in za družino rastnih funkcij. Ključne besede: aproksimacija, ekstremna korelacija, nelinearni program EXTREME CORRELATIONS Anton CEDILNIK* In the article we define a quantity which measures the quality of the approximation of a function, given by a table, with a function from a certain family D of nonconstant functions. For this purpose one has to find the infimum and the supremum of the set of correlation coef- ficients between the given function and functions from D. We do this for the family of ali nonconstant f unctions and for the famiJy of growth functions. Key words: approximation, extremal correlation, nonlinear programming Dr., docent, Biotehniška fakulteta, Oddelek za gozdarstvo, Univerza v Ljubljani, 61000 Ljubljana, Večna pot 83, Slovenija 258 Zbornik gozdarstva in lesarstva, 38 CONTENTS I. lntroduction .............................. II F . . . ,, - approx1mat1on ....................... . III. R~ - approximation (n > 2) ................ . Appendix: a nonlinear program ................. . I. INTRODUCTION In table 1 and table 2 we have measurings of function values of a function y (x), which we approximate with the function w1 = 0.5 x + 3.0. lts correlation coeffi- cient with data from table 1 is O. 7048 and with data from table 2 is 0.9986. In the first case the correlation is weak and in the second one very strong. Nevertheless, it can be shown that, contrary to the expectations, in the first case this approximation is the best (in the sense that the correlation cannot be increased), but in the second case we easily find a better approximation, for instance w2 = O.OS x2 + 0.35 x + + 3.10, for which the correlation coefficient is 1. Therefore, the correlation coeffi- cient is not necessarily a good measure of the quality of approximation. X y X y l 3.3 3.4 3.5 3.5 3.8 1 3.5 2 3.0 4.0 4.1 4.9 2 4.0 3 4.1 4.4 4.7 4.8 3 4.6 --- Table 1 Table 2 The purpose of this article is to introduce a better measure of the quality of approxi- mation (definition 1) and t.o calculate it in two special cases. But, firstly, some conventions and definitions! We deal with a functiony(x) for which the measurings of function values are in able 3. The table is ordered: X1 < X2 < ... < Xn. X y XJ Y11 Y12 Yts, X2 Y21 Y22 Y2s2 Table 3 x„ Ynt Yn2 ... Ynsn 259 CedilnikA.: Ekstremne korelacije. n 5k sk 2. l (k = l , ... ,n). E ,_ E ' E ,.._, r (k and / Will be the summation indexes k k= 1 I I= 1 only in these two sums). . (1) (2) s:= Esk ';?:_n k - 1 '{' Yk:= - ~Ykl sk , (k= l, ... ,n) The values Yk form a new function y. (3) - 1 '{' -y := s fSkYk (4) -: : = [ ~ ; (vk/ -y)it 2 = [ ~ ;Yi1 - syi•l/2 (S) w : =,: [ 1tsAJf - syi]-112 Presumption: (P) There is at least one k with Yk:l=y. Obviously, n>2, -r >o, w ~ l. w = 1 if and only if s1 = ... = sn = 1, hence if s = n. Correlation coefficient r (v, u) between the function y f rom table 3 and some other function u with values uk (k = 1, ... ,n) is the correlation coefficient for table 4: y Y11, .. ,, Y1s1, Y21, .. ,, Y2s2, .. ·,YnJ, .. ,, Ynsn u UJ,, ... , UJ, U2, .. ,., u2, .. ,., Un, .... , Un Table 4 (6) L L (vk1-.Y)(uk-ii) 1„ k / r V', u): = ~------------- [ }: }: ()'k1-y)2 · L L (u - ii)2) J/2 k I k / k where (7) 260 Zbornik gozdarstva in lesarstva, 38 Let us approximate the f unction y from table 3 with a f unction w from some family D of nonconstant functions, defined on the set (x., ... , xnl. lr(y, u)I ueDJ is a subset of the interval [-1, 1) with (8) A(v) := inf(r(y, u)lueDI , (9) B(y) : = sup lr(y, u) 1 u e DJ , (10) A(v) ::S, r(y, w) ,:5 B(v). Dejinition J. Quality oj D-approximation oj f unction y with f unction w e D is (11) K, .. weD)·- 2r(v,w)-B(y)-A(v) v-, · - B(v) - A(v) The definition is based on fig. 1. -1 o / I \ / I \ /,, I \ / / \ ,, . , I :,,.., -1 K Figure l 1 ' 1 The quality of D-approximation is again a number between -1 and 1, and (12) K(v, w e D) = K(ay + /3, yw + t5 ED) for ali such a, /3, y, t5 that ay > O and still is yw + t5 e D. Obviously, the family D must be at least so extensive that f or each y from table 3 and with the presumption (P), the denominator B(v)-A(y) in (11) is > O. We shall name such family sufficient. Examples. 1. The family Fn (n ~ 2) of all nonconstant functions on the set lxt,··•,xnl is suffi- cient. For proving this, calculate r(y, u), where uk = O (k ::/- i), u; = + 1, and de- mand that the.result is always the same for al\ i and both signs. 261 Cedilnik A.: Ekstremne korelacije. 2. A function u on lx1, ... ,xnJ is growthfunction if O< u1 ~ ... ~ Un and is non- constant if u1 t: Un, The family R~ (n ~ 3) of such functions is sufficient. To see this, calculate r(v, u), where Ut = ... = u;-1 = O, u; = ...l., u;+ 1 = ... = Un = 1 (2 Si< n-1), and demand that for each i and any le(0,1): -;,r/tJA = O. The family R~ is not sufficient. 3. A function u on (xJ,,,,,xnl is nonconstant linear if uk = axk + /3 (k = l, ... ,n) and a f:; O. The family Ln (n ~ 3) of these functions is not sufficient, since for the function y from table 5 we have: A (v) = B(v) = O. 1 X y Xn-X O (2 ~ k :5, n-1) x-xi Table 5 We already said that the family L2 = F2 is sufficient. (n the next two sections we shall find A (v) and B(y) and so also K(y, w r:D) for the families D = Fn (n ~ 2) and R~ (n >- 3). I. Fn - APPROXIMATION A(v) = min (r(y, u)I u eFnJ = -w-1 B(y) = max (r(v, u)I u eFnl = w -t = r (v, y). or any w e Fn there is K(y, we Fn) = w .r (v, w). roof. lt's easy to verify (using (l)-(6)) that 6) 262 Zbornik gozdarstva in lesarstva, 38 The numerator in (16) can be ragarded asa scalar product, therefore, by Cauchy- -Schwartz inequality, r(y, u) is the biggest for uk - i1 = A.OiA, - y) (A>O, k= l , ... ,n), and for such u we have: r(y, u) = w -J. Obviously, r(v, u) = -r(y, -u), from where we get (13). Then, (15) follows from the definition (11). QED. -Notes. l. For s1 = ... = Sn = 1 we have: K(y, w e Fn) = r(y, w). 2. The f unction y has not only the highest correlation with y but also the lowest sum of squares of declinations from y (even if the presumption (P) is not valid). The proof is simple. 3. For n > 2 we can continuously deform y to -y not going through the constant. Therefore: (17) lr(v, u)I u EFnl = [-w-1, w - 1]. III. R~ -· APPROXIMATION (n > 2) This tirne we'll approximate the function y with a function u e R~: O < u1 S ... S Un -1 u1• Let us change y with a new function p: . (18) (k = l , ... ,n) . For this function it holds (19) LPk = o, k (20) [p7/sk = W -l ~ l. k Let us also change u with q: (21) Qk : = (uk - u,)!t5(u), where (22) c5(u): = ~ ~ sk (Uk- Ut)> o. For q it holds: (23) (24) O = Q1 < Q2 < •·· < Qn, - - - 263 CedilnikA.: Ekstremne korelacije. Because of q e R~ and Qk = (qk - q 1)/o(q) for each k, we conclude that while u having traversed ali the set R~, q traverses ali that subset defined with (23) and (24). Easy computation shows: (25) r(y, u) = L PkQk · [r SkQI - s]· - 112• k k The maximum of this function is f ound in Appendix,. If we consider also that minr = -max(-r), the equations (26) and (27) of the next theorem f ollow. Theorem 3. Leta : = lP2,•••,Pn1 and b : = [s2, ... ,snJ- Then: (26) A(y) =-Hn-t (-a, b, s, -s), (27) B(y) = Hn-1 (a, b, s, -s), (28) lr(y, u) 1 u E R~J = [A (J'), B(y)]. Proof. We have to prove (28) else. The family R~ is convex. If min r(y, u) = = r(y, u') and max r(y, u) = r(y, u "), then A ~ r(y, Ju" + (1-,l)u') is a continu- ous function, which maps the interval [O, 1) onto the interval [A(y), B(y)J. QED. For the illustration we'll examine a special case: R~ - approximation of a noncon- stant increasing onevalued function. Instead of table 3 we have much more special table 6, for which we demand: Y Y1, Y2, .•• , y„ Table 6 l. n > 2, 2. XJ < X2 < ... < X 11 , 3. Yt ~ Y2 :::; ••• :5 Y11 f= Yt · 264 Zbornik gozdarstva in lesarstva, 38 The function u: = y -Y1 (uk:= Yk -Y1 (k = 1, ... ,n)) is from R~. Because of r(v, u) = l we already know: (29) B(v) = l. According to (26) we also have: (30) A (v) = -Hn-1 (-a, b, n, -n) where (31) (32) (33) (34) a; = (v;+ 1 -Y)/ -r (i = l, ... ,n-1), b; = 1 (i = 1, ... ,n-1), - l r Y = - 1.JYk, n k With the extension of (31) to index i = O we have: (35) ao S 01 ~ ••• S On-J, n-1 (36) E a; = o. i=O In the notation from Appendix there is (37) j-1 E; = ~ E a; U = 1, ... ,n-1), . J i=O (38) Therefore, P = n - 1 and a-1 (39) Hn-l (-a, b, n, -n) = max a(n~a·) E a;. o A (u ). From (40) we find out: (41) A(u) = min { V- ,. (~I) • }(_x)(n-1) } · Minimum is got for x = 1 andx = n-1 and its value is n.:_l · So we have found found the infimum of the numbers A(y): (42) 1 A(y) > n-1 . Note. The results of this section are because of (12) valid also for the Rn-ap- proximations, where Rn is the family 0f nonconstant increasing functions. APPENDIX: A NONLINEAR PROGRAM We shall solve the next nonlinear program. There are given a = [ak1mxJ, b = [bk1mxJ and numbers c and d. These parameters answer the following four conditions: me(l,2,3, ... 1, bk > (k = 1, ... , m). C> 0, ( 1) € : = c2 + d L b k > O, k III where, E ,_ E and - avoiding the triviality - at least one ak is -1= O. k k=I 266 Zbornik gozdarstva in lesarstva, 38 Maximize the objective function (2) z = [Zk1m-!1 - h,n (z; a, b, C d) : = t akZk . [ ~ bkz'i + d ]- 112• subject to the constraints (3) 0 ~ Z t < . . . ~ Z1n, (4) L bkZk = C. k The function hm is well defined: The constraints (3) and (4) determine a nonvoid convex compact set S, so the func- tion hm, which is contionuous, for certain has the maximum (6) H,,, (a, b, c, d) : = max lh111 (z: a, b, c, d) 1 z e SJ. Form = 1 there is only one point z: z1 = clb1 in Sand so: (7) ca1 H 1 (a, b, c, d) = ~ · veu1 The case m = 2 demands much more work - though quite elementary - than the previous one. lf the condition (8) is fulfilled, then forJ: {\O) (k = 1,2). lf the condition (8) is not true, then 267 CedilnikA.: Ekstremne korelacije. (11) for z: (12) Zt = O, Z2 = clb2 (if the first term in. (11) is greater) or (if the second term in (11) is greater). From now on we shall suppose that m > 2. The Lagrangian function: m-1 (14) L = hm + E lk (Zk+ 1 - Zk), k=I where J-s are the Lagrange multipliers. The corresponding Kahn-Tucker system U = l, ... ,m-1): (15) Zj ~ 0, (16) t1 LI a Zj < O, (17) Zj • ( ali tJZj) = 0, (18) A.j > o, (19) aLI a)i.j = Zj+I -Zj ~ o, (20) Aj · la LI i1 A-j} = ).J (Zj + 1 - ZJ) = O, considering (4) and (21) a Zml a Zj = -bjlbm, Let us sum up the equations (17), using (4) and (20): EakZk E * 1 ] . (E akzi + d)-112. bkz + d * (22) Am-1 = -[am -bm (Z,n + ~) k We shall change A.-s: (23) (j = 1, .... ,m-1). 268 Zbornik gozdarstva in lesarstva, 38 Putting (22) and (23) in ( 16) and ( 17) we get: (24) (25) Zj- [left side of (24)] = O. -µ, u = 1) µj (1 <.j o, (27) µj (Zj + 1 - Zj) = 0 (for j= l, .... ,m-1). One more definiton (k= l , .... ,m): (28) Let P be the index of the greatest Ek: (k > P ~ Ek < Ep) /\ (k s; P ~ Ek < Ep). Suppose that a is the adjacent index, for which Za> O, Za-1 = O (or a = 1 if z1 > O). a could be any number in (1, ... ,mL Because of (27) it is for a:f= 1: . µa-1 = O. The inequalities (24) are because of (25) the equations, as well, for a 1 and il and (36) { O (i = 1) } µJ-1 (i> l) ~ o, OSi the inequalities (31) are fulfilled, so we can forget them. But from the equations (32) we can calculate ali other µ-s: from the first equation we get µa, from the second one µ«+ 1, and so on. Summing up ali this equations, we get the identity, which means that these equations are dependent and the system is surely solvable. We find out: (a~i (c + c ~ .~i) > Ea ~ bp.j (a$ja), j=a we get ,n (46) Hm (a, b, c, d) > hm (z"; a, b, c, d) = Ea [d + c2/ E bJ 112 i=a On the other side, by (41): m m (47) Hm (a, b, c, d) < max Ea ( E b;z; + d) 112 = Ea · (min E b;ZT + d) 112, i=a i=a where we determine the extreme for ali z -s satisfying (43) only. It is easy to see that the extreme is gotten for z= z" and so: (48) Hm (a, b, c, d) = hm (z"; a, b, c, d). The question remains, how to find a. With some effort we transform (44) into (49) "' m m . ~ a/ E b· > E a·; i: b· ;=a j=a J j=i J j=i J (a O. For the function z' from case 1 there is hm (z'; a, b, c, d) > D. Hence Hm (a, b, c, d) > O and Ea > O because of (41). From (44) it follows then that (51) a = p, If P = m, we have (52) H / b CO,n m \a, ' c, d) = y b,n(c2 + dbm) · From now on let P < m. It is easy to verify that 272 Zbornik gozdarstva in lesarstva, 38 for all z which correspond the conditions (42) and (43). The right side of this equa- tion is minimal exactly for that z for which the function hm is maximal. Hence, if: (54) then (53) is equivalent to (55) M = ~ [-H;,,J - 1 or, explicitely, (56) Hm (a, b, c, d) = Ep y-d - 2M. The determination of M is a problem of quadratic programming and there is no need to discuss it here. POVZETEK če je tabelarično podana neka funkcija in jo aproksimiramo s funkcijo iz neke iz- brane družine nekonstantnih funkcij, ustrezni korelacijski koeficient v splošnem ne more biti katerokoli število med -1 in 1. V tem sestavku zato s pomočjo ekstremnih korelacijskih koeficientov definiramo mero za kvaliteto aproksimacije (definicija 1). Ekstremne korelacije izračunamo najprej za družino vseh nekonstantnih funk- cij, nato pa še za družino rastnih funkcij. Medtem ko je prva naloga preprosta, pa pri rastnih funkcijah zahteva po monotonosti povzroči, da je iskanje ekstremnih ko- relacij reševanje nelinearnega programa. Tega eksaktno rešimo v Dodatku. SUMMARY If a function given by a table is approximated by a function from a certain family of non-constant functions, then, in general, the correlation coefficient cannot be any number between -1 and 1. The aim of the study was to define a quantity that mea- sures the quality of approximation of a function by calculating extreme correlation coefficients (Definition 1 ). Extreme correlations were calculated first f or the family of ali non-constant function~ and \\\en fot tne fa.m\\"y oY growtn Yunctions. The for- mer is an easy task whi\e the \atter, due to the demand f or monoto~ici~y, ~ecoT?est~: f act a so\ving of a non-\inear program, the exact so\ution of whtch 18 gwen m Appendix. 273 CedilnikA.: Ekstremne korelacije. REFERENCES CEDILNIK A., 1986. Optimalna aproksimacija rastnih funkcij. Zb. gozd in les. 28, 5-16. CHIANG, A. C., 1974. Fundamental Methods of Mathematical Economics. McGraw-Hill, Inc., Tokyo. · JETER, M. w·., 1986. Mathematical Programming. Marcel Dekker, Inc., New York. LUENBERGER, D. G., 1969. Optimization by Vector Space Methods. John Wiley & Sons. Inc., New York . . PETRIC, J., ZLOBEC, S., 1983. Nelinearno programiranje. Naučna knjiga, Beograd.