text
stringlengths
2.85k
2.55M
label
class label
11 classes
arXiv:1502.06374v3 [math.GR] 30 Sep 2017 ADJOINT REPRESENTATIONS OF BLACK BOX GROUPS PSL2 pFq q ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA Abstract. Given a black box group Y encrypting PSL2 pFq over an unknown field F of unknown odd characteristic p and a global exponent E for Y (that is, an integer E such that yE “ 1 for all y P Y), we present a Las Vegas algorithm which constructs a unipotent element in Y. The running time of our algorithm is polynomial in log E. This answers the question posed by Babai and Beals in 1999. We also find the characteristic of the underlying field in time polynomial in log E and linear in p. Furthermore, we construct, in probabilistic time polynomial in log E, ‚ a black box group X encrypting PGL2 pFq – SO3 pFq, its subgroup Y˝ of index 2 isomorphic to Y and a probabilistic polynomial in log E time isomorphism Y˝ ÝÑ Y; ‚ a black box field K, and ‚ polynomial time, in log E, isomorphisms SO3 pKq ÝÑ X ÝÑ SO3 pKq. If, in addition, we know p and the standard explicitly given finite field Fq isomorphic to the field F then we construct, in time polynomial in log E, isomorphism SO3 pFq q ÝÑ SO3 pKq. Unlike many papers on black box groups, our algorithms make no use of additional oracles other than the black box group operations. Moreover, our result acts as an SL2 -oracle in the black box group theory. We implemented our algorithms in GAP and tested them for groups such as PSL2 pFq for |F| “ 115756986668303657898962467957 (a prime number). 1. Introduction 1.1. The principal results. Black box groups were introduced by Babai and Szemerédi [8] as an idealized setting for randomized algorithms for solving permutation and matrix group problems in computational group theory. A black box group is a black box (or an oracle, or a device, or an algorithm) operating with 0–1 strings of uniform length which encrypt (not necessarily in a unique way) elements of some finite group. In various classes of black box problems the isomorphism type of the encrypted group could be known in advance or unknown. We denote a black box group encrypting a group X by using the same letter in sans serif, X, and we apply the same convention to the strings x produced by X which correspond to the group element x P X. All black box groups in this paper are assumed to satisfy Axioms BB1–BB4 stated in Sections 2.1 and 2.2. In particular, we assume that for every black box Date: 30 September 2017. 1991 Mathematics Subject Classification. Primary 20P05, Secondary 03C65. 1 2 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA group X we are given a global exponent, that is, an integer E such that xE “ 1 for all x P X, and the computation of xE is feasible. In this paper, we present an algorithm which solves the old problem by Babai and Beals [6, Problem 10.1] that remained open since 1999. We prove the following theorem. Theorem 1.1. Let Y be a black box group encrypting Y “ PSL2 pFq, where F is an unknown finite field of unknown odd characteristic p and let E be a global exponent for Y. Assume also that |F| ě 7. Then there exists a Las Vegas algorithm which constructs a string representing a non-trivial unipotent element from Y in time polynomial in log E. In particular, the characteristic p of the underlying field can be found in time polynomial in log E and linear in p. For a discussion of randomized algorithms and, in particular, Las Vegas algorithms, see Section 1.3. In case of p “ 2, the Babai-Beals problem has been solved by Kantor and Kassabov [28], and in Section 4.9 we briefly discuss how our methods can also be applied to this case. We exclude small cases |F| ă 7 from consideration in this paper because they – and, more generally, black box recognition of classical matrix groups over small fields are comprehensively treated in the memoir by Kantor and Seress [29]. Note that, in Theorem 1.1, we do not have any information about the ground field of the group Y . However, we use some form of an upper bound on the size of this field which is implicitly present in the global exponent E. Note also that we construct a unipotent element without knowing its order and our algorithm is Las Vegas due to the unipotency test, Lemma 5.5. To find the characteristic of the underlying field, we construct a unipotent element and then find its order. In the special case when our black box group Y is explicitly represented by matrices, Theorem 1.1 takes the form that also remained unknown until now. Corollary 1.2. Let p be an odd prime number. Given matrices g1 , . . . , gm in the group GLn pFpk q of invertible matrices over a finite field Fpk of odd characteristic p which generate subgroup G isomorphic to SL2 pFpl q, pl ě 7, we can find in G a non-trivial unipotent element in probabilistic time polynomial in k, l, m, n and log p. Our algorithm is Las Vegas. Our next result is a solution to the problem of recognizing a black box group encrypting the group PSL2 pFq defined over an unknown field of unknown odd characteristic. Theorem 1.3. Let Y be a black box group encrypting PSL2 pFq, where F is an unknown field of unknown odd characteristic p and let E be a global exponent for Y. Assume also that |F| ě 7. Then we construct, in probabilistic time polynomial in log E, (a) a black box group X encrypting the group SO3 pFq, its subgroup Y˝ of index 2 isomorphic to Y and a probabilistic polynomial in log E time isomorphism Y˝ ÝÑ Y; (b) a black box field K, and (c) polynomial time, in log E, isomorphisms SO3 pKq ÝÑ X ÝÑ SO3 pKq. BLACK BOX GROUPS PSL2 pFq q 3 Our algorithms are Las Vegas. If, in addition, we know p and the standard explicitly given finite field Fq of characteristic p isomorphic to F then we construct, in log Etime, an isomorphism SO3 pFq q ÝÑ SO3 pKq. Since, by Theorem 1.1, we can find the characteristic p of the underlying field in time linear in p and polynomial in log E, and also because finding efficient two-way isomorphisms between a black box field of order pn and an explicitly given standard field can be done in time linear in p and polynomial in time n log p (see Section 3), we have a stronger result: Corollary 1.4. Let X be a black box group encrypting SO3 pFq, where F is an unknown field of unknown odd characteristic p and let E be a global exponent for X. Assume also that |F| ě 7. Then we construct, in time linear in p and polynomial in log E, an isomorphism X ÐÑ SO3 pFq q, where Fq is the standard explicitly given finite field isomorphic to F. We note here that our algorithm fully replaces the so-called “SL2 -oracle”, an assumption of existence of two-way polynomial-time isomorphism between arbitrary black box group encrypting SL2 pFpk q and the group SL2 pFpk q over the standard explicitly given field Fpk . Moreover, we do not use discrete logarithm oracle on finite fields in our algorithms as opposed to majority of the existing algorithms for black box groups. (Given a generator x of F˚ and a random element y P F, a discrete logarithm oracle finds an integer k which satisfies xk “ y.) The first use of an “SL2 -oracle” appeared in 2001; quite a number of papers referring to SL2 oracle and discrete logarithm oracle followed [17, 18, 19, 20]. The present paper together with [13, 14] shows the way to eliminate discrete logarithm oracle and SL2 -oracle entirely from black box recognition problems for classical groups of odd characteristic. By replacing the axiom BB4 with BB5 (stated in Subsection 2.3), that is, removing the assumption of knowing a global exponent E for the black box groups and assuming to have a function which computes square roots of group elements, when exist, we have the following more general result. It explains, in particular, why the characteristic of the field is not used in our Theorems 1.1 and 1.3. Theorem 1.5. Y be a black box group which satisfies axioms BB1–BB3 and encrypts the group PSL2 pFq over some unknown finite field F of unknown odd characteristic p with |F| ě 7. Assume also that Axiom BB5 holds in Y. Then we can construct, in probabilistic time polynomial in log E, (a) a black box group X encrypting the group SO3 pFq, its subgroup Y˝ of index 2 isomorphic to Y and a probabilistic polynomial in log E time isomorphism Y˝ ÝÑ Y; (b) a black box field K, and (c) polynomial time, in log E, isomorphisms SO3 pKq ÝÑ X ÝÑ SO3 pKq. Our algorithms are Las Vegas. We record this result here, but its discussion will be published by us elsewhere; it is linked to work by Ahmavaara [1, 2, 3], Kustaanheimo [30], and other theoretical 4 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA physicists who attempted to build a model of quantum mechanics based on a very big prime field. Recently, this theory was revisited by Zilber [42] who used a model-theoretic approach to the idea of “quantization by looking at everything as if it happens in a finite field”. Our Theorem 1.5 appears to fit well into an emerging theory linking model theory with physics: in view of [42, Proposition 5.2], finite groups PGL2 pFq structurally approximate, in some explicitly defined sense, the Minkowski group PSL2 pCq. 1.2. A very brief outline of the proof. The proof of Theorem 1.3 will be achieved as a sequence of steps some of which are interesting on their own. (a) We construct a new black box group X encrypting SO3 pFq, a group which contains PSL2 pFq as a subgroup Y˝ of index 2, and map Y˝ ãÑ Y, see Theorem 5.1. (b) Using involutions in X, we construct a black box projective plane P that encrypts the projective plane of the 3-dimensional space of the adjoint representation of PGL2 pFq » SO3 pFq on its Lie algebra l “ sl2 pFq. We describe how to produce random points in P, describe lines through two points, construct intersection of two lines, etc. We shall note here that we do not list the elements in P or in any line in P. Furthermore, the plane P has polarity induced by the Killing form on its underlying Lie algebra. The Lie algebra product induces on P a partial binary operation which we are able to compute using black box methods; we denote this operation by b, call cross product and systematically use in algorithms developed in the paper. (c) We introduce a set of tools which allows us to coordinatize P by homogeneous coordinates over a black box field K constructed in the projective plane P. To that end, we use a classical coordinatization of Desarguesian projective planes developed by Hilbert. (d) We use the action of X on P to construct a matrix representation X ÝÑ SO3 pKq. where SO3 pKq is realized as a group of 3 ˆ 3 matrices over the black box field K. (e) Coordinatizing SO3 pKq in a similar way, we construct an isomorphism SO3 pKq ÝÑ X. (f) The map SO3 pFq q ÝÑ SO3 pKq is constructed from the isomorphism Fq ÝÑ K from the explicitly given finite field F onto a black box field K. We use a result by Maurer and Raub [33] formulated in our paper as Theorem 3.1 to construct this isomorphism. This is a polynomial time algorithm which runs in time log |Fq |. (All known algorithms for the inverse isomorphism Fq ÐÝ K BLACK BOX GROUPS PSL2 pFq q 5 are reduced to solving discrete logarithm problem in Fp , the prime subfield of Fq , so finding polynomial time algorithms which construct two-way isomorphisms represent a major open problem in algebraic cryptography). (g) Section 12 contains analysis of complexities of all algorithms used in the proof. 1.3. Monte-Carlo and Las Vegas algorithms. Recall that a Monte-Carlo algorithm is a randomized algorithm which gives a correct output with probability strictly bigger than 1{2. A special case of Monte–Carlo algorithms is a Las Vegas algorithm which either outputs a correct answer or reports failure. A detailed comparison of Monte–Carlo and Las Vegas algorithms, both from practical and theoretical point, can be found in [5]. By the nature of our axioms, many algorithms for black box groups (in the sense of Axioms BB1–BB4) are Monte-Carlo. In case of decision problems, where the output is “yes” or “no”, the error of a Monte–Carlo algorithm can be made arbitrarily close to 0 by repeatedly re-running it. So answers to questions of the kind “Is this black box group isomorphic to the given group?” can be made as precise as we wish. In this paper, algorithms are Las Vegas. 1.4. Terminology and notation. In what follows we make extensive use of the language of projective geometry, see, for example Coxeter [22] and Hartshorne [26]. Group theoretic terminology mostly follows [23]. 1.5. Organization of the paper. In Section 2, we discuss the axioms of black box groups. Section 3 contains a brief discussion of black box fields. In Section 4, we introduce morphisms and protomorphisms of black box groups and the crucially important procedure that we call “reification of an involution”. We also explain how our arguments work in even characteristic producing a unipotent element in PSL2 p2n q. In Section 5, we present applications of reification of involutions, in particular, we construct a black box group encrypting SO3 pFq from a black box group encrypting PSL2 pFq. In Section 6, we discuss the geometry of involutions in SO3 pFq, and in Section 7 we construct a black box projective plane and present algorithms for additional operations and relations coming from the underlying Lie algebra. In Section 8, we construct a black box subgroup encrypting Sym4 in a black box group encrypting SO3 pFq (it provides us with an orthogonal basis in the projective plane with a polarity) and in Section 9, we apply Hilbert’s coordinatization to the black box projective plane and construct a black box field. In Section 10, we prove Theorem 1.1 and in Section 11, we prove Theorem 1.3. In Section 12, we give the complexities of the procedures presented in this paper. 2. Black box groups 2.1. Axioms for black box groups. What follows are slightly modified BabaiSzmerédi axioms. The concept of a black box can be applied to rings, fields, and, as we can see in this paper, even to projective planes. So, we formulate our axioms for groups but use the wording which makes them applicable to other algebraic structures. This explains why we are using the length lpXq of strings produced by a black box X as a proxy for the complexity of a black box X: it is applicable to a variety of structures. 6 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA In our algorithms, we have to work with several black box groups at once and build new black boxes (sometimes for the same abstract group, sometimes for different groups) from existing ones. For that reason we specify the functionality of a family X of black boxes X by the following axioms. BB1 On request, each X produces a binary string of fixed length lpXq (which depends on X) encrypting a random (almost) uniformly distributed element from some fixed group X; this is done in probabilistic time polynomial in lpXq. BB2 Each X computes, in probabilistic time polynomial in lpXq, a string encrypting the product of two strings or an inverse of a string (that is, a string encrypting the inverse of an element given by a string). BB3 Each X decides, in probabilistic time polynomial in lpXq, whether two strings encrypt the same element in its group X – therefore identification of strings agrees with the canonical projection πX ✲ X. X ......... If Axioms BB1–BB3 hold for a particular black box group X, we say that X is a black box over X, or that a black box X encrypts the group X. Notice that we are not making any assumptions of practical computability or the time complexity of the projection πX . We will discuss our set up and terminology further in Section 4.2. In respect of Axiom BB1, we note here that a black box group X encrypting a finite group X may not necessarily be given by generators: see, for example, discussion of black boxes for centralizers of involutions [11], or discussion of links between black box algebra and homomorphic encryption [12]. When a black box group X is given by some generators, that is, some strings x1 , x2 , . . . , xm in X such that X “ xπX px1 q, πX px2 q, . . . , πX pxm qy, then producing random elements from X can be done by using either the algorithm presented in [4, Theorem 1.1] or the algorithm called “the product replacement algorithm” [21]. It turned out that the product replacement algorithm is much more practical and we refer reader to [7, 32, 35, 36] for its detailed analysis. In this paper, we systematically build new black box groups from old ones, and use randomized algorithms for their constructions. In this situation, operations in these new black boxes are performed by randomized algorithms – this explains the randomization introduced in Axioms BB2 and BB3. A typical example of a black box group is provided by a group X generated in a big matrix group GLn prk q by several matrices x1 , . . . , xl . We can, of course, multiply, invert, compare matrices. Therefore computer routines for these operations together with the sampling of the product replacement algorithm run on a tuple of generators px1 , . . . , xl q can be viewed as a black box X encrypting the group X. 2.2. Global exponent and Axiom BB4. Notice that, even in routine examples, the number of elements of a matrix group X could be astronomical. This makes many natural questions about the black box X over X – for example, finding the order of X or the isomorphism type of X when X is given as a simple group of Lie type – inaccessible for all known deterministic methods. Even when X is cyclic, existing approaches to finding its order are conditional and involve either the discrete logarithm problem or prime factorization of large integers. BLACK BOX GROUPS PSL2 pFq q 7 Nevertheless black box problems for finite groups frequently have a feature which makes them more accessible: BB4 We are given a global exponent of X, that is, a natural number E :“ EpXq such that ‚ xE “ 1 for all strings x produced by X; and ‚ log E is polynomially bounded in terms of lpXq. For example, if X is a black box group arising from a subgroup in the known ambient group G, the exponent of G can be taken for a global exponent of X. If we know the factorization of E into prime factors then we can find the order of any element x produced by X as the minimal divisor e of E such that xe “ 1. However, we wish to work with linear groups over fields of large characteristic where factorization of E is becoming unfeasible. Our approach allows us to avoid determination of orders of random elements from X and consequently avoid making any assumptions about the prime factorization of the global exponent. 2.3. Axiom BB5. It is important to observe that our proof of Theorem 1.3 uses the global exponent E and Axiom BB4 only for computing square roots of semisimple elements in Y and X (this is done by Tonelli-Shanks algorithm, Lemma 5.6). Therefore Axiom BB4 can be replaced by its corollary, Axiom BB5 – see Theorem 1.5. BB5 We are given a partial 1- or 2-valued function ρ of two variables on a subset S Ă X that computes, in probabilistic time polynomial in lpXq, square roots in cyclic subgroups of X in the following sense: if x P S and y P xxy has square roots in xxy then ρpx, yq is the set of these roots. In particular, ‚ if |x| is even, ρpx, 1q is the subgroup of order 2 in xxy; ‚ if |x| is even then, consecutively applying ρpx, ¨q to 2-elements in xxy, we can find 2-elements in xxy of every order present; ‚ if |x| is odd, and x P xxy then ρpx, xq is the unique square root of x in xxy. We emphasize that Axiom BB5 provides everything needed for construction of centralizers of involutions by the maps ζ0 and ζ1 , Section 4.7. Axiom BB5 follows from BB4 by Lemma 5.6, applied to the cyclic group xxy. 3. Black box fields We define black box fields using, by analogy with black box groups, Axioms BB1– BB3, with a few obvious changes in the wording, and with Axiom BB2 covering the addition, multiplication, and inversion in the field. The reader may wish to compare our exposition with [10]. We remind that, in this paper, we do not necessarily know the characteristic of the field. Therefore we slightly generalize the definition of a black box field given in [10, 33] by removing the assumption that the characteristic of the field is known. We refer the reader to [10, 33] for more details of black box fields of known characteristic. We shall be using some results about the isomorphism problem for black box fields of known characteristic p [33], that is, the problem of constructing an isomorphism and its inverse between a black box field K and an explicitly given finite field Fpn . The explicit data for a finite field of cardinality pn is defined to be a system of structure constants over the prime field, that is, n3 elements pcijk qni,j,k“1 8 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA of the prime field Fp “ Z{pZ (represented as integers in r0, p ´ 1s) so that Fpn becomes a field with ordinary addition and multiplication by elements of Fp , and multiplication determined by si sj “ n ÿ cijk sk , k“1 where s1 , s2 , . . . , sn denotes a basis of Fpn over Fp . The concept of an explicitly given field of order pn is robust; indeed, Lenstra Jr. has shown in [31, Theorem 1.2] that for any two fields A and B of order pn given by two sets of structure constants paijk qni,j,k“1 and pbijk qni,j,k“1 an isomorphism A ÝÑ B can be constructed in time polynomial in n log p. By an efficient isomorphism between a black box field and an explicitly given finite field Fpn , we mean an algorithm constructing such an isomorphism in time polynomial in n and log p. One of the key results on black box fields belongs to Maurer and Raub [33]; its statement and proof can be reformulated to yield the following result. Theorem 3.1. Let K be a black box field of known characteristic p encrypting an explicitly given finite field Fpn and K0 the prime subfield of K. Then the isomorphism problem between K and Fpn can be efficiently reduced to the isomorphism problem between K0 and Fp . In particular, ‚ an efficient isomorphism K0 ÝÑ Fp can be extended in time polynomial in the input length lpKq to an efficient isomorphism K ÝÑ Fpn ; ‚ there exists an isomorphism Fpn ÝÑ K computable in polynomial in lpKq time. The existence of an efficient isomorphism K0 ÝÑ Fp would follow from solution of the discrete logarithm problem in K0 . In particular, this means that, for small primes p, every black box field of order pn is effectively isomorphic to Fpn . 4. Morphisms and protomorphisms This section contains crucial tools for our algorithms. They are based on a simple observation that a map φ ✲ Y X .......... from a group to a group is a homomorphism of groups if and only if its graph F “ tpx, φpxqq : x P Xu is a subgroup of X ˆ Y . Essentially we treat homomorphisms of black box groups as black box groups on their own, see Section 4.4. With this principle, almost everything in this section is self-evident. First, we introduce some terminology. 4.1. Morphisms. Given two black boxes X and Y encrypting finite groups X and Y , respectively, we say that a map φ which assigns strings produced by X to strings produced by Y is a morphism of black box groups, if ‚ the map φ is computable in probabilistic time polynomial in lpXq and lpYq, and BLACK BOX GROUPS PSL2 pFq q 9 ‚ there is a homomorphism φ : X Ñ Y such that the following diagram is commutative: φ ✲ X .. .. .. πX .. .❄ φ ✲ X where πX and πY are the canonical respectively. Y .. .. .. πY .. .❄ Y projections of X and Y onto X and Y , We shall say in this situation that a morphism φ encrypts the homomorphism φ. For example, morphisms arise naturally when a black box group X is given by a generating set and we replace a generating set for the black box group X by a more convenient one and run the product replacement algorithm for the new generating set; in fact, we replace a black box for X and deal with a morphism Y ÝÑ X from a new black box Y into X. We apply to morphisms and abstract homomorphisms the same notational convention as to the strings and elements, using the same letters in sans serifed or plain version, respectively. Since different strings produced by Y may represent the same element in Y , replacing strings φpxq by equivalent strings produces a new morphism φ1 which also encrypts φ and, for all the practical purpose is the same as φ. Slightly abusing terminology, we say that a morphism φ is an injection, or a surjection, etc., if φ has these properties. In accordance with standard conventions, hooked arrows ãÑ stand for injections; dotted arrows are reserved for homomorphisms, including natural projections πX ✲ X; X ......... which are not necessarily morphisms, since, by the very nature of black box problems, we are not given an efficient procedure for constructing the projection of a black box onto the group it encrypts. 4.2. Black box subgroups and further remarks on terminology. If we have an injection φ YĂ ✲ X .. .. .. .. .. πX .. πY .. .. .❄ .❄ φ Y Ă ✲ X we say that Y is a black box subgroup of X encrypting Y ď X. We emphasize that a black box subgroup is a procedure and has to be treated as such especially when one writes a computer code for black box group algorithm. Notice that different black box subgroups may encrypt the same subgroup. Indeed, an element in Y can be encrypted by several different strings produced from X; it is important to take into consideration a possibility that not all of these strings are produced by Y. If elements πY py1 q, . . . , πY pyk q generate Y , we call strings y1 , . . . , yk generators of Y. Black box subgroups will be constructed in this paper in one of the following ways: 10 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA ‚ We pick some strings y1 , . . . , ym produced by the black box group X and we treat them as generators of a black box subgroup Y. We use the product replacement algorithm [21] for random sampling. ‚ Given black box subgroups Y1 , . . . , Yk in X, we generate a subgroup Y “ xY1 , . . . , Yk y by taking generating sets in Yi and combining them into a generating set in Y. ‚ If Y is the centralizer in X of an involution or a proto-involution in the sense of Section 4.6 then we apply the procedure described in Section 4.7 to “populate” Y and eventually find a generating set for Y. Terminology and conventions. Abusing terminology and notation, we write x P X for a string x produced by the black box group X and we say that x is an element of X. In the rest of the paper, a subgroup of a black box group is meant to refer to a black box subgroup. The order opxq (“ |x|) of x is opxq “ |x|. We shall refer to a string x P X as an involution, or a semisimple element, or a unipotent element, etc., if x P X is an element with these properties. If x P X is an involution, then CX pxq denotes a black box subgroup encrypting CX pxq, see Section 4.7 for a construction of CX pxq. Moreover, we refer to black box subgroups in X as to tori, unipotent groups, etc., if they encrypt subgroups in X with these properties. 4.3. Direct and semidirect products of black box groups. Assume that X encrypts X and Y encrypts Y . Then the black box X ˆ Y produces pairs of strings px, yq by sampling X and Y independently, with operations carried out componentwise in X and Y; of course, X ˆ Y encrypts X ˆ Y and lpX ˆ Yq “ lpXq ` lpYq. More generally, given black box groups X1 , . . . , Xn , we can define their direct product X “ X1 ˆ ¨ ¨ ¨ ˆ Xn in an expected way, consecutively sampling strings xi P Xi to form a random n-tuple px1 , . . . , xn q and carrying out group operations on these n-tuples componentwise. Later in the paper, we will use semidirect products of black box groups. They arise in a situation when we have two black box group X and Y and a polynomial time in lpXq and lpYq procedure for the action of Y on X by automorphisms, X ˆ Y ÝÑ X, px, yq ÞÑ xy ; then X ¸ Y samples independent pairs px, yq of strings from X and Y with multiplication performed and inversion by the rules (1) ´1 px1 , y1 q ˝ px2 , y2 q :“ px1 xy21, y1 y2 q and px, yq´1 :“ ppx´1 qy , y´1 q. 4.4. Morphisms as black box groups. Given a morphism φ ✲ Y X .. .. .. .. .. πX .. πY .. .. .❄ .❄ φ ✲ Y X of black box groups, we can associate with it a black box subgroup Z ãÑ X ˆ Y which encrypts the graph F “ tpx, φpxq : x P Xqu of φ. The black box group Z BLACK BOX GROUPS PSL2 pFq q 11 produces strings tpx, φpxqqu with x is sampled by the black box X and the natural projection is defined as πZ : Z ÝÑ F px, φpxqq ÞÑ pπX pxq, φpπX pxqq. In practice, this means that we find strings x1 , . . . , xk generating X with known images y1 “ φpx1 q, . . . , yk “ φpxk q in Y and then use the product replacement algorithm for the black box subgroup Z˚ “ xpx1 , y1 q, . . . , pxk , yk qy ãÑ X ˆ Y encrypting a subgraph t px, φpxqq u of the homomorphism φ. Random sampling of the black box Z˚ returns strings x P X with their images φpxq P Y already attached. 4.5. Protomorphisms. Let X and Y be two black box groups encrypting X and Y , respectively, and π the canonical projection of X ˆ Y onto X ˆ Y . A protomorphism Z between black box groups X and Y is a black box subgroup Z ãÑ X ˆ Y such that πZ pZq is the graph of a homomorphism from X to Y or from Y to X – the direction of homomorphism is not set here. We say that Z encrypts this homomorphism. Given a string x in a black box group X encrypting a group X, it is frequently useful to associate with x a black box for the graph of a specific automorphism of X, namely, the conjugation by πX pxq. It can be viewed as a black box subgroup Cx ãÑ X ˆ X, which produces strings py, yx q for random strings y P X, with group operations and equality relation defined in the obvious way. Treating a homomorphism X ÝÑ Y of black box groups X and Y as a black box subgroup in their direct product XˆY allows us to construct previously inaccessible objects – see, for example, “reification of involutions”, Section 4.8. 4.6. Amalgamation of local proto-automorphisms. Let X be a black box group encrypting a group X. Expanding the terminology from the previous section, a proto-automorphism F on X is a black box subgroup F ãÑ X ˆ X for the graph of an automorphism of X. Assume that black box subgroups Y1 , . . . , Yk of X are encrypting, respectively, subgroups Y1 , . . . , Yk of X, and assume that xY1 , . . . , Yk y “ X. Assume that φ1 , . . . , φk are automorphisms of subgroups Y1 , . . . , Yk , respectively, and Fi are proto-automorphisms on Yi encrypting φi , i “ 1, . . . , k. We say that the system of proto-automorphisms F1 , . . . , Fk is consistent if there exists a unique automorphism φ of X such that φi “ φ |Yi for all i “ 1, . . . , k. Theorem 4.1 (Amalgamation of local proto-automorphisms). If F1 , . . . , Fk is a consistent system of proto-automorphisms on black box subgroups in X, then F “ xF1 , . . . , Fk y is a proto-automorphism on X. Proof. The proof is self-evident.  We call F the amalgam of proto-automorphisms F1 , . . . , Fk . Theorem 4.2 (Augmentation of a black box group by a proto-involution). If A ãÑ X ˆ X 12 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA is a proto-automorphism on X encrypting an involutive automorphism α on X, we can construct an involutive automorphism α of A by setting α : px, x1 q ÞÑ px1 , xq for px, x1 q P A. Then the semidirect product A ¸ t1, αu is a black box encrypting X ¸ xαy, with A canonically projecting onto X and α projecting to α. Proof. The proof is self-evident.  Theorems 4.1 and 4.2 provide the conceptional frame for a construction of a black group encrypting SO3 pFq » PGL2 pFq from a black box group encrypting PSL2 pFq, see Theorem 5.1. 4.7. Centralizer of a proto-involution. Let A ãÑ XˆX be a proto-involution on X defined in Section 4.6. Assume that A encrypts some involutive automorphism α P AutpXq of X. Later in the paper, we work in the situation when α is an external automorphism and α is not present as a string in the black box group. In this case, we do not have any access to α but we can make use of its graph. Given A, we shall construct a black box group, which we denote it as CX rAs, encrypting CX pαq. Let A “ tpx, xα q P X ˆ X | x P Xu be the graph of α. Obviously, by writing formally CX rAs “ tx P X | there exists y P X such that px, yq P A and x “ yu, we get CX pαq “ CX rAs. We will construct a black box subgroup CX rAs ãÑ X which satisfies a similar condition CX rAs “ tx P X | there exists y P X such that px, yq P A and πX pxq “ πX pyqu, and encrypts CX rAs. It follows from the arguments in [11, 16] that we have the map ζ “ ζ0 \ ζ1 : ÝÑ CX pαq " α ´1 ζ0 pxq “ ipx if opxα x´1 q is even ? x q x ÞÑ α ´1 ζ1 pxq “ x x ¨ x if opxα x´1 q is odd, ? where ipxq is the unique involution and x is the unique square root of x in the cyclic group xxy of odd order. Notice that the map above can be written in the following way using the graph A of α instead of α. ζ:X ζ : A ÝÑ CX rAs “ CX pαq " ζ0 ppx, yqq “ a ipyx´1 q px, yq ÞÑ ζ1 ppx, yqq “ yx´1 ¨ x if opyx´1 q is even if opyx´1 q is odd. Assume that X satisfies Axiom BB4 and has a global exponent E “ 2k m with m odd. If x P X is a string encrypting an element of even order then the last non-identity string in the sequence 2 1 ‰ xm , pxm q2 , pxm q2 , . . . , pxm q 2k´1 , pxm q 2k “1 is an involution and denoted by ipxq. If x P X encrypts an element of odd order then y :“?xpm`1q{2 obviously satisfies 2 y “ x and is a square root of x in xxy; we denote y :“ x. Hence, we have the analogous map for the black box groups. BLACK BOX GROUPS PSL2 pFq q (2) ζ : A ÝÑ CX rAs " ´1 ζ 0 ppx, yqq “ ipyx q a px, yq ÞÑ ζ 1 ppx, yqq “ yx´1 ¨ x 13 if opyx´1 q is even if opyx´1 q is odd. If X is a simple group of Lie type then, as shown in [37], ζ1 pxq is defined for random x P X with probability Op1{nq where n is the Lie rank of X. Furthermore, the same calculation as in [11, Section 6] proves that elements πX pζ 1 px, yqq, for px, yq P A, are uniformly distributed over CX pαq. Therefore ζ 1 provides an efficient black box for CX rAs. If A is a graph of an inner automorphism corresponding to an element a P X, we denote CX rAs by CX paq. For the black box groups X encrypting PSL2 pFq or PGL2 pFq, where F is a finite field of odd characteristic, we can construct a generating set for CX paq in the following way, if needed. We know that CX paq “ T ¸ xwy, where T is the maximal torus containing the involution a and w inverts T. Since the map ζ 1 produces uniformly distributed elements in X, by [34, I.8], a set of size Oplog log |F|q consisting of random elements in C contains a generator for T with probability ą 1{2. Moreover, since the half of the elements in C are involutions inverting T, we can construct a generating set of size Oplog log |F|q for CX paq. The map ζ 0 is useful when we are interested mostly in involutions in CX rAs, as it happens, for example, in reification of involutions, see Section 4.8. 4.8. Reification of an involution. We approach the most fascinating part of the story: identification of an involution in X from its description. We shall call this procedure the reification of an involution; it is intensively used in the present paper and in [15]. Following the notation from the previous subsection, assume that A ãÑ Xˆ X is a proto-involution on X encrypting a specific inner automorphism of X, conjugation by an involution a P X. We want to find a string a in X that encrypts a. Let A ă X ˆ X be the graph of conjugation by a. Obviously, a P Y “ CX rAs, and, moreover, a P ZpY q. Denote by ΩpY q the subgroup generated by all involutions in ZpY q, then a P ΩpY q. Even more so, a probabilistic algorithm described in Section 4.7 gives us a black box group Y “ CX rAs encrypting Y . Now we apply to the subgroup (unknown to us) ΩpY q the algorithm proving the following lemma. Lemma 4.3. Assume that a black box group Y encrypts a subgroup Y in a simple group X of Lie type of odd characteristic and of Lie rank n. Assume also that we know a global exponent E for Y. Then there is a Las Vegas algorithm which constructs a black box group W ãÑ Y which encrypts an elementary abelian 2-group W ď Y which contains ΩpY q. The algorithm works in probabilistic time polynomial in lpYq, log E (the global exponent of Y), and n. Proof. Let i1 be an involution produced from a random element in Y by repeated square and multiply method. Then Y1 “ CY pi1 q is a black box subgroup encrypting a subgroup Y1 ď Y containing ΩpY q. Now, let i2 be a string encrypting an involution different from i1 produced by Y1 , then similarly Y2 “ CY1 pi2 q is a black box subgroup encrypting a subgroup Y2 ď Y1 containing ΩpY q. Continuing in this way, we descend to a black box subgroup Z ãÑ Y encrypting an abelian group Z containing ΩpY q. Now, by using the black box group Z, we construct the involutions in Z as 14 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA described in Section 4.7. Finally, we use these involutions and bounds from [38, pp. 192–193] to construct a generating set in a black box subgroup W ãÑ Y which encrypts an elementary abelian subgroup containing ΩpY q. If X is a simple group of Lie type of odd characteristic, then the length of chains of centralizers of involutions is bounded by a polynomial in its Lie rank, giving a crude upper bound of log |X|. Since elements of even order (hence involutions) in X are abundant by [27] and the number of involutions in ZpY q is bounded by a polynomial in the Lie rank of X, the process quickly produces a desired black box subgroup W ãÑ Y.  Since a is a string which encrypts an involution in an elementary abelian group in ZpY q, it belongs to an elementary abelian group W constructed in Lemma 4.3; after that, a can be identified by testing every possibility in W. These crude estimates show that the reification procedure works in probabilistic time polynomial in lpXq, log E (where E is the global exponent of X) and |W |. In this paper, reification of involutions is applied to SO3 pFq in odd characteristic. In this case, centralizers of involutions at the subsequent stages of the algorithm are either dihedral or abelian, and the black box subgroup W in the statement of Lemma 4.3 has order at most 4. Hence the procedure, in this case, is pretty fast. 4.9. Involutions in PSL2 p2n q. Let X be a black box group encrypting PSL2 p2n q for some n ě 2. A paper by Kantor and Kassabov [28] contains a construction of an involution in X, a result analogous to the results in this paper. We shall now show how involutions in PSL2 p2n q can be constructed by our methods. Take two non-commuting elements x and y of odd order. It is a well-known property of SL2 p2n q that either x and y belong to the same Borel subgroup in X – but in that case rx, ys is an involution, and we are done, or there is an involution a P X which inverts both x and y. We do not know a, but it is obvious that the proto-involution A ă X ˆ X corresponding to a contains the tuple ppxyqa , xyq “ pxa ya , xyq “ px´1 y´1 , xyq. Now it follows from Equation (2) that ζ 1 ppx´1 y´1 , xyqq “ a xy2 x ¨ x´1 y´1 . It is easy to see that the calculation produces an involution in CX pAq unless xy2 x is already an involution. 5. Applications of reifications of involutions 5.1. Construction of SO3 pFq from PSL2 pFq. It will become clear later in this paper that black box groups PGL2 pFq – SO3 pFq are easier to analyze than SL2 pFq or PSL2 pFq because they contain more involutions. We extend a black box group encrypting PSL2 pFq to a black box group encrypting SO3 pFq using amalgamation of proto-automorphisms, Theorem 4.1, and augmentation of a black box group by a proto-involution, Theorem 4.2. If x P X is a non-trivial semisimple element, then we will denote the maximal torus in X containing x by Tx . Theorem 5.1. Let Y be a black box group encrypting a group Y “ PSL2 pFq, where F is an unknown finite field of unknown odd characteristic and |F| ě 7. Assume that we know a global exponent E for Y. Then there is an algorithm which constructs BLACK BOX GROUPS PSL2 pFq q 15 a proto-involution Y˝ ãÑ Y ˆ Y on Y encrypting a diagonal automorphism d of Y . Moreover, if we take the automorphism d : px, x1 q ÞÑ px1 , xq for px, x1 q P Y˝ of Y˝ , then the semidirect product X “ Y˝ ¸ xdy is a black box group encrypting PGL2 pFq. The running time of the algorithm is polynomial in log E. Proof. We recall that Y has one conjugacy class of external involutive diagonal automorphisms [24, Table 4.5.1]. Let d be its representative, then CY pdq “ S ¸ xwy where S is a torus in Y of order p|F|´1q{2 or p|F|`1q{2 depending on |F| ” ´1 mod 4 or |F| ” 1 mod 4, respectively, and w is an involution inverting S. Observe that the order of the torus S is odd. Take an involution t P CY pdq inverting S and assume that t is contained in some maximal torus T . By the Frattini argument, Y ¨NY xdy pT q “ Y xdy and we can assume without loss of generality that d normalizes T. Notice that xT, Sy “ Y and d centralizes S and inverts every element in T . Therefore we can apply to Y amalgamation of proto-automorphisms and augmentation by a proto-involution, Theorem 4.1 and Theorem 4.2. Construction of tori T and S in Y with these properties goes as follows. We first construct an involution u P Y and its centralizer CY puq “ Tu ¸ xwy. Then, we find a random element y P Y such that the element z :“ uuy has odd order and set S :“ xzy. A black box for Tu can be set up (or a generating set for Tu can be found) by the arguments in Subsection 4.7. It follows from the well-known description of subgroups in PSL2 pFq that the subgroups Tu and S generate Y. Consider the amalgam of local proto-automorphisms α : Tu Ñ Tu , β : S Ñ S, t ÞÑ t´1 s ÞÑ s and let Y˝ be the resulting involutive proto-automorphism of Y. Note that the automorphism d : px, x1 q ÞÑ px1 , xq of Y˝ defined by the rule as in Theorem 4.2, so the black box group Y˝ ¸ xdy encrypts Y ¸ xdy. All we need to do now is to make sure that the automorphism d encrypts an external involutive automorphism of Y . Observe that if the element z belongs to a maximal torus of odd order in Y, then d encrypts an external involutive diagonal automorphism of Y . However, if the element z belongs to a maximal torus of even order in Y, then d must be the involution in this torus since d centralizes S. Therefore, d encrypts some inner automorphism of Y and we can construct the involution d in Y as a string by constructing the central involution in CY pdq. In this case, we reconstruct a random element y P Y and repeat our procedure as above. Note that the probability of finding an element y P Y such that the element z :“ uuy belongs to a maximal torus of odd order is at least 1{2.  5.2. Reification of involutions in SO3 pFq. Reification of proto-involutions, as described in Section 4.8, is the most important procedure involved in our construction of unipotent elements in SO3 pFq and in the proof of Theorem 1.3. We list some well-known properties of the group X » SO3 pFq » PGL2 pFq. Lemma 5.2. Let X » SO3 pFq » PGL2 pFq where F is a field of odd characteristic. Then: 16 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA ‚ Every non-trivial element in X is either semisimple or unipotent. ‚ Every non-trivial semisimple element z P X belongs to a unique torus Z ă X and centralizes an involution r P Z. ‚ If s and t are distinct involutions in X and z “ st is a semisimple element, the involution r in the torus Z containing z is the only involution in X which commutes with both s and t. For two distinct involutions s, t P X, we denote the only involution in X that commutes with both s and t, if such involution exists, as s b t. If it does not exist, then, in view of Lemma 5.2, the product st is a unipotent element. Theorem 5.3. Let X be a black box group encrypting X “ SO3 pFq, where F is an unknown finite field of unknown odd characteristic. Assume that |F| ě 7 and we know a global exponent E for X. Let s, t P X be two distinct involutions such that st is not a unipotent element. Then there is a Las Vegas algorithm constructing the involution j commuting with s and t. The running time of the algorithm is polynomial in log E. We shall write j “ s b t, treating b as a partial binary operation on the set of involutions and call it cross product. Proof. We set z :“ st. Note first that if |z| “ 2, then s and t commute and z is an involution commuting with them. If |z| ą 2, CX pπX pzqq is a torus containing an involution πX pjq and it is inverted by πX psq and πX ptq. Clearly, j commutes with s and t. By Lemma 5.2, such an involution j is unique in X. If the order of z is even, then j “ ipzq, see Section 4.7. If z has odd order, then observe that j centralizes Z “ xzy and inverts every element in the torus Ts containing s; construction of Ts is similar to construction of tori in the proof of Theorem 5.1. Since the order of z is odd, we have |Z| ě 3 and so X “ xTs , Zy. Now the involution j can be found by amalgamating local proto-automorphisms x ÞÑ x´1 x ÞÑ x on Ts on Z and reifying the result, see Section 4.8. In X “ SO3 pFq where F is a finite field of odd characteristic with |F| ě 7, the last step can be run very efficiently due to the fact that involutions r P X have the property that ZpCX prqq “ xry, see details in Section 4.8.  5.3. Writing an element in SO3 pFq as a product of two involutions. It is well-known that any element of order ą 2 in SO3 pFq, where F is a finite field of odd characteristic, can be writen as a product of two involutions. The following lemma shows the same can be done in black box groups. Lemma 5.4. Let X be a black box group encrypting SO3 pFq, where F is a finite field of unknown odd characteristic and |F| ě 7. Then, with a given global exponent E for X, we can represent an arbitrary element x P X of order |x| ą 2 as a product of two involutions r and s from X in time polynomial in log E. In particular, this yields an involution r inverting x. This algorithm is Las Vegas. Proof. We take a random element y P X. By [25], the probability that X is generated by x and y is at least 1 ´ 2|F|12 `2 . Now, we reify the involution r that inverts x and BLACK BOX GROUPS PSL2 pFq q 17 y. If we end up with a failure or a serendipitous discovery of a unipotent element, we need to repeat reification with other choice of y. When we have the involution r, we can decompose x “ r ¨ rx, where both r and s “ rx are involutions.  5.4. Unipotency test. The following lemma makes the algorithm in Theorem 1.1 Las Vegas. Lemma 5.5. Assume that X encrypts SO3 pFq where F is an unknown finite field of unknown odd characteristic with |F| ě 7. Let u P X of order bigger than 2 and r an involution inverting u – the latter can be found by Lemma 5.4. (a) Take a random element 1 ‰ t P CX prq with |t| ě 3. Then u is unipotent if and only if u ‰ ut and ru, ut s “ 1. (b) Assume that u is unipotent. Then U “ xuTr y is the maximal unipotent subgroup in X containing u, s inverts U, and B “ UTr is the Borel subgroup containing U. The algorithms in this Lemma run in probabilistic time polynomial in log E. Proof. To prove (a), observe that since |t| ě 3, t belongs to the torus Tr . Note that the elements of X are either semisimple or unipotent. If u is semisimple, then CX puq is the torus Tu . Since ru, ut s “ 1 and u P Tu , we have ut P Tu . Hence t P NX pTu q “ Tu ¸ xwy for some involution w inverting Tu . Since |t| ě 3, we conclude that t P Tu . This is a contradiction to the assumption u ‰ ut . Hence u is a unipotent element in X. If u is unipotent, then part (b) immediately follows from the structural facts about the groups SO3 pFq in odd characteristic and also provides the reverse implication in (a). By the arguments in Section 4.7, the black box for the subgroup Tr allows us to construct random conjugates of u by the random elements of Tr . Hence we can construct random elements from U and B.  5.5. Bisection of angles. Note that bisection of angles is the extraction of square roots in the group of rotations. In our setting, Axiom BB4 allows us to find square roots of elements in cyclic black box subgroups by virtue of the Tonelli-Shanks algorithm [39, 40]. Usually the Tonelli-Shanks algorithm is formulated only for multiplicative groups of finite fields and we include its more general formulation for completeness of exposition. Lemma 5.6 (The Tonelli-Shanks Algorithm). Let T be a cyclic black box group of known global exponent E. Let z be an element in T that has a square root in T. Then an element t P T such that t2 “ z can be found in probabilistic polynomial time in log E. Proof. We set E “ 2m n where p2, nq “ 1. Given t P T, we shall say that l is the 2-height of t, if |tn | “ 2l ; notice that this is equivalent to 2l being the largest power of 2 that divides the order |t| of t. We first construct an element x P T with maximal 2-height l, that is, the order |x| is divisible by the maximum power of 2 dividing the order of T. To do this, we construct a constant number of random elements in T and take the element with the biggest 2-height. Note that since T is cyclic, at least half of the elements of T have orders with maximal 2-height. If a chosen element does not have the biggest 2-height, then the procedure below fails, and we start our procedure by constructing 18 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA an element with bigger 2-height. Let x P T be an element with maximal 2-height l, that is, the order x is divisible by the maximum power of 2 dividing the order of T. If l ‰ 0, then x can not be a square in T, namely, there are no elements y P T such that y2 “ x. We set a :“ zpn`1q{2 , b :“ zn , c :“ xn . Note that if b “ 1, then z has odd order and the element a is the desired square root of z. If b ‰ 1, then we run the loop: d ‚ Find the smallest non-negative integer d such that b2 “ 1. ‚ If d ą 0 then repeat until d “ 0: l´d´1 Set a :“ ac2 , l b :“ bc2 ´d , l´d c :“ c2 , l :“ d. ‚ When d “ 0, the element a is the desired square root of z.  Lemma 5.7. Let X be a black box group encrypting SO3 pFq, where F is an unknown finite field of unknown odd characteristic. Assume that |F| ě 7 and i, j P X are two conjugate involutions. Then, given an exponent E for X, we can find an involution x P X such that ix “ j in time polynomial in log E. Proof. We set E “ 2m n where p2, nq “ 1, and set z “ ij. pn`1q{2 If the order of z is odd, that is, zn “ 1 then notice that iz “ j. Now, zpn`1q{2 j is an involution conjugating i to j. Assume now that the order of z is even and k “ ipzq is the involution in xzy, see Section 4.7. We denote by Y the subgroup in X encrypting PSL2 pFq; it is well-known that |X : Y| “ 2 and Y Ÿ X. Let T be the maximal torus in X containing k and T2 “ tt2 | t P Tu, then T2 is the subgroup of index 2 in T and T2 “ T X Y. Observe that z “ ij P T2 because i and j, being conjugate, simultaneously belong or do not belong to Y. We can now apply the Tonelli-Shanks algorithm for cyclic groups, Lemma 5.6, and find t P T such that t2 “ z “ ij; after that we have itj “ jt´1 itj “ jt´1 jjitj “ tjitj “ t2 jij “ j, and x “ tj is an involution since j inverts t P T.  6. Geometry of involutions in PGL2 pFq » SO3 pFq Let X “ PGL2 pFq » SO3 pFq, where F is a finite field of odd characteristic. In this section, we see that actions of involutions from X control properties of every facet of the structure of the group and its Lie algebra. Involutions are multifunctional: they act as pointers to tori in the group X, to toric subalgebras in the Lie algebra l “ LiepXq of X, to points and to lines in the projective plane associated with l as F-vector space, and they control the canonical polarity on P . 6.1. The Lie algebra. Let M be the 2 ˆ 2 matrix algebra over F. We denote the elements of M by lower case Greek letters. The Lie algebra l “ sl2 pFq of the group X “ PGL2 pFq » SO3 pFq is the vector space of 2 ˆ 2 matrices of trace 0 with the Lie bracket rα, βs “ αβ ´ βα and the Killing form Kpα, βq “ Trpαβq. The isomorphism PGL2 pFq » SO3 pFq comes from the adjoint action of GL2 pFq on the Lie algebra l, that is, action by conjugation on l. The group PGL2 pFq is the image of this action and becomes the group of BLACK BOX GROUPS PSL2 pFq q 19 automorphisms of l. Therefore it preserves the Killing form K on l, moreover, it coincides with the orthogonal group SO3 pl, Kq. The following property of matrices in M can be easily checked. Lemma 6.1. Let α P M be a non-scalar matrix. Then α2 is a scalar matrix if and only if Trpαq “ 0. Similarly, the following properties of l “ sl2 pFq can also be easily proven. Lemma 6.2. Let α, β P l, that is, Trpαq “ Trpβq “ 0. (a) α is either non-degenerate and semisimple or α2 “ 0. (b) Trpα2 q “ ´ det α. As a consequence, Trpα2 q “ 0 if and only if α2 “ 0. (c) rα, βs “ 0 if and only if α and β are collinear, that is, one of them is a scalar multiple of another one. (d) Trpα, rα, βsq “ 0. 6.2. Projectivization of the Lie algebra: polarity. Now consider the projective space PpM q associated with the vector space M and the natural map ω : M r t0u ÝÑ PpM q. Notice that X “ PGL2 pFq is the image of GL2 pFq under this map. Denote by P “ ωplq the image of l in PpM q; it is a projective plane with polarity π induced by the Killing form on l. It follows from Lemmas 6.1 and 6.2(a) that I “ P XX is the set of involutions in X. By Lemma 6.2(b), the set Q “ P rI is a quadric in P determined by the quadratic form Trpα2 q (“ ´ det α by Lemma 6.2(b)). The group X has a natural action on PpM q induced by the action of GL2 pFq on M by conjugation. Obviously, X leaves invariant the projective plane P and its subsets I and Q. Moreover X acts on P by collineations and preserves the polarity π. There are two kinds of points in P : ‚ involutive (or toric, or semisimple, or regular ) – they form the set I; ‚ unipotent (or parabolic, or tangent ) – they are points on the quadric Q. We shall call I the involution plane; it is a projective plane with a polarity, but with points of the corresponding quadric removed. For points a, b P P we shall write a K b if a P πpbq (which is equivalent to b P πpaq). If α, β P l are matrices representing a and b, respectively, then a K b is the same as Kpα, βq “ Trpαβq “ 0. Notice also that Q “ t a P P : a P πpaq u. 6.3. Projectivization of the Lie algebra: cross product. The Lie product r , s on l induces a partial binary operation on the plane P : namely, if a and b are distinct points in P represented by matrices α, β P l, respectively, then, in view of Lemma 6.2(c), rα, βs ‰ 0 and ωprα, βsq is defined as in Section 6.2 and does not depend on choice of α and β. We denote ωprα, βsq “ a b b and call it the cross product of a and b. Obviously, a b b “ b b a. The cross product has an obvious connection with the polarity: 20 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA Lemma 6.3. If a and b are distinct points in P then a K a b b and b K a b b, and, consequently, a b b “ πpaq ^ πpbq is the point of intersection of the polar lines of a and b. Proof. The proof follows from Lemma 6.2(d).  Notice that action of X on P preserves the cross product. We use the term “cross product” and notation b to emphasize the analogy with the cross product of vectors in R3 , that is, the Lie algebra operation in the Lie algebra of SO3 pRq, the group of rotations of the 3-dimensional Euclidean space. The projective plane P with polarity and cross product is a combinatorial object that retains essential properties of the Lie algebra l “ sl2 ; we shall call it the projectivization of l. As we shall soon see, polarity and cross product can be constructed inside of the group X: first on the set I of involutions and then extended to the whole plane P by interpreting the points of the quadric Q as maximal unipotent subgroups of X. Moreover, these constructions can be carried out in a black box group X encrypting X. 6.4. Points. Now we turn our attention to involutions in X which will serve as points in our projective plane. In view of Lemma 6.2(b), a vector σ P l is semisimple in the Lie algebra sense if and only if Kpσ, σq ‰ 0 (that is, σ is regular in the terminology of the theory of quadratic forms) and nilpotent if and only if Kpσ, σq “ 0 (that is, σ is singular). Every semisimple element σ in l gives rise to an involution in X, the half-turn sσ around the one-dimensional vector subspace (it is also a Lie subalgebra) generated by σ: (3) sσ : α ÞÑ 2Kpα, σq σ ´ α. Kpσ, σq Observe that the half-turn sσ is not changed if we replace σ by a non-zero scalar multiple cσ. Lemma 6.4. An involution s “ ωpσq in X represented by a matrix σ is the halfturn around σ: ωpσq “ sσ . Proof. Indeed, in its adjoint action on l, every involution s from X has eigenvalues `1, ´1, ´1. If s “ ωpσq then obviously σ s “ σ is an eigenvector for s and eigenvalue `1. Obviously this means that then s “ sσ .  Denote the `1-eigenspace (the axis of the half-turn) s as ts . Obviously, ts is a 1-dimensional regular subspace of l and thus a Cartan subalgebra of l. If Ts is a torus in X containing s then ts “ LiepTs q, the Lie algebra of Ts . Lemma 6.5. Let i, j P I and i ‰ j, then i K j if and only if ij “ ji. Proof. By Lemma 6.4, i and j are half-turns. Now it easily follows from Equation 3 in Section 6.4 that they commute if and only if their axes are orthogonal, that is, if and only if i K j.  BLACK BOX GROUPS PSL2 pFq q 21 Lemma 6.5 allows us to interpret the polarity restricted to the involution plane I within the group X: Lemma 6.6. If i P I then πpiq X I “ t j P I | ij “ ji and i ‰ j u. We shall denote πI piq “ πpiq X I. Similarly, we have the following result for the cross product: Lemma 6.7. If i, j P I are distinct involutions and k “ i b j P I then k “ πpiq ^ πpjq is the only involution in X which commutes with the both i and j. Later in the paper, we shall extend the polarity and cross product to the whole projective plane P “ I Y Q. 6.5. Lines. For every involution s P I, its polar image πpsq in P can be described by taking its intersection with I: πI psq “ πpsq X I. It could happen that one or two points in πpsq X Q are missing from πI psq. Set q “ |F|. The centralizer C “ CX psq is a dihedral group of order 2pq ˘ 1q which contains the maximal torus Ts of order q ˘ 1 inverted by q ˘ 1 involutions in the coset C r Ts ; these involutions commute with s and therefore πI psq “ C r Ts . As we shall see in the next section, there are more lines on P . 6.6. The Weisfeiler plane. Every 1-dimensional subspace a in l is a Lie subalgebra of l and coincides with the Lie algebra LiepAq of some 1-dimensional algebraic subgroup A ă X. Assuming that |F| “ q, the latter belongs to one of the three conjugacy classes: ‚ non-split tori: cyclic subgroups of order q ` 1, ‚ maximal unipotent subgroups of order q, ‚ split tori: cyclic subgroups of order q ´ 1, see the paper by Boris Weisfeiler [41]. Therefore the set W of 1-dimensional algebraic subgroups A in X is in one-to-one correspondence A Ø LiepAq with the set of 1-dimensional Lie subalgebras of l and can be treated as a projective plane; we shall call the Weisfeiler plane and denote it by W . It will be convenient to identify W with the dual plane P ˚ of P and treat points of W as lines of P . For that we need to describe the incidence relation between points and lines. If A is 1-dimensional subgroup in X, the line ℓpAq associated with it contains (incident with) all involutions inverting A; if w is one of these involutions then ℓI “ ℓpAq X I coincides with the coset Aw. ‚ If A is a non-split torus, all q ` 1 points in ℓpAq are involutions. ‚ If A is a maximal unipotent subgroup, q points in ℓpAq are involutions in the Borel subgroup NX pAq inverting A, and the additional parabolic point in ℓpAq X C is ωpLiepAqq for A itself. 22 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA ‚ If A is a split torus, q ´ 1 points in ℓpAq are involutions inverting A; two additional parabolic points in ℓpAq X Q are ωpLiepU qq and ωpLiepV qq for two maximal unipotent subgroups U and V normalized by A. These three types of lines are called hyperbolic, parabolic, and elliptic, respectively. The parabolic lines are tangent lines to Q, that is, lines having exactly one point with Q in common. In I, a parabolic line appears as the coset U t of a maximal unipotent subgroup U in X with respect to an involution t inverting every element in U . 7. The black box projective plane and projectivization of the Lie algebra Let X be a black box group encrypting X “ PGL2 pFq » SO3 pFq where F is a finite field of odd characteristic and |F| ě 7. Using the black box X as a computational engine, we shall construct a black box projective plane P that encrypts the projective plane P discussed in Section 6. The elements or objects of P are points and lines. 7.1. Points. There are two types of points in P; regular and parabolic. A regular point is an involution in X; I is the set of all involutions in X. To produce a random regular point, we construct an involution from a random element in X by repeated square and multiply method and conjugate it by a random element. Note that a random element in X has even order with probability at least 1/4 [27]. A parabolic point a black box for a maximal unipotent subgroup U ă X; it is a point on the quadric Q “ P r I; to construct one is the principal aim of the paper. 7.2. Lines. There are two types of lines in P; toric and parabolic. A toric or regular line l is a black box for a subgroup T ¸ xwy where T ă X is a torus and w P X is an involution that inverts every element in T. A toric line is incident to the following points: ‚ If |T| “ q ` 1 then l is incident only to points represented by involutions in the coset Tw; ‚ If |T| “ q ´ 1 then l is incident to q ´ 1 points represented by involutions in the coset Tw and, in addition, two parabolic points which will be constructed later and correspond to two maximal unipotent subgroups normalized by T. It is convenient to specify a toric line using its polar image, that is, the involution in the torus T. A parabolic line (or tangent line) u is a black box for a subgroup U ¸ xty where U ă X is a maximal unipotent subgroup and t P X is an involution inverting every element in U – it exists and can be computed by Lemma 5.5(b). The line u is incident to two kinds of points: ‚ q regular points, involutions in the coset Ut; and ‚ U itself, seen as a point. 7.3. Cross product on I and a serendipity construction of a unipotent element. As we can see, we have immediate access only to points in I, that is, involutions in X. Our principal tool is the cross product provided by Theorem 5.3. In view of Lemma 6.7, the operation b on I encrypts the cross product on I. BLACK BOX GROUPS PSL2 pFq q 23 For large q, the probability of hitting a unipotent element u by taking product of two random involutions s and t is O p1{qq, as can be seen from the following argument. Indeed, note that the number of involutions in X is q 2 where q “ |F| and for a fixed involution s, there are at most two unipotent subgroups normalized by s. Therefore, the number of unipotent elements of the form ssx , x P X, is at most 2pq ´ 1q. Therefore, the probability of this event is approximately O p1{qq and becomes astronomically small for a large field F. However if it happens by a sheer strike of luck, we get a unipotent element u “ st and a black box for the parabolic subgroup its maximal unipotent subgroup B “ xuTs y ¸ Ts , U “ xuTs y, (that is, a parabolic point) and the set Us of regular points in the corresponding parabolic line, see Lemma 5.5. Combining Theorem 5.3 with the arguments above, we have Theorem 7.1. There is probabilistic polynomial time Las Vegas algorithm which, given two involutions i, j P I, constructs either ‚ an involution i b j, or ‚ a black box subgroup U ¸ xiy “ U ¸ xjy where U is a maximal unipotent subgroup in X inverted by i and j. The black box for U represents a parabolic point in P which coincides with i b j in sense of Section 6.3. The strategy of our proof of Theorem 1.1 is to carry out a polynomial time chain of constructions in I which will force the serendipity moment, that is, the second bullet point in Theorem 7.1. In the next section, we shall describe tools for computations in I needed for that purpose. 7.4. A toolbox for the involution plane I. Constructions in this section are conditional on assumption that s b t P I is an involution for all involutions s and t that we encounter in our calculations – as it was explained in Section 7.3, this is what normally happens with very high probability. We shall expand our algorithms to the whole black box projective plane P in Section 7.5. 7.4.1. Polar image of a point in I. Let q “ |F|. Let t be an involution and Tt a torus containing it, and w an involution inverting Tt . ‚ If |Tt | “ q ` 1 then the polar line πptq is the coset Tt w, with random points in it generated in an obvious way with the help of a black box for Tt ă CX ptq. ‚ If |Tt | “ q ´ 1 then the polar line πptq is the coset Tt w together with two points represented by black boxes for maximal unipotent subgroups U and V normalized by Tt . At this stage we do not know how to construct U and V, but it will become clear after Theorem 1.1 is proven: we take a nontrivial unipotent element u, construct the maximal unipotent subgroup A and an involution s inverting A as in Lemma 5.5, and then construct an element x conjugating the involution sx “ t. Now Tt normalizes U “ Ax , and if r P CX ptq r Tt then Tt normalizes Ur “ V as well. 24 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA 7.4.2. Polar image of a line in I. Let k be a line in P. Given a line, we can always find on it two distinct regular points, see Section 7.2; take points a ‰ b on k. Then πpkq “ a b b. 7.4.3. A line through two regular points. If s, t P I then the line s _ t through s and t is s _ t “ πps b tq. We shall note here that we do not list the points on the black box projective lines but we produce random elements on them when they are needed. 7.4.4. Intersection of two lines in I. If two lines k and l intersect in I, their intersection point k ^ l can be found as k ^ l “ π pπpkq _ πplqq . 7.5. Expansion of the toolbox from I to P. 7.5.1. Polarity in P. If U is a maximal unipotent subgroup in X seen as a parabolic point and t an involution inverting U which can be constructed by Lemmas 5.4 and 5.5, then πpUq is the tangent line Ut Y tUu through U. 7.5.2. Intersection of two lines. Since we have now polarity in P, the formula is the same as in 7.4.4. 7.5.3. Cross product in P. For two distinct points s, t P P, sbt “ πpsq ^ πptq. 7.5.4. A line through parabolic points. Let s be an involution and U a parabolic point, that is, a maximal unipotent subgroup. Observe that if s inverts U then s belongs to the line tangent to Q at U. In this case, we have s _ U “ U Y Us. Assume now that s does not invert U. In this case, the line s _ U is the polar line of the involution r which centralizes s and inverts U. Since r P CX psq, r inverts every element in the torus Ts . Therefore, r can be reified from the amalgamation of the the following proto-morphisms: Ts Ñ Ts , U Ñ U, t ÞÑ t´1 u ÞÑ u´1 . Moreover, since s and U belong to the line s _ U and s does not normalize U, the other missing point in this line is the unipotent group Us . Hence, in this case, we have s _ U “ Tr s Y tU, Us u. For the line passing through given two parabolic points U and V, we follow the similar procedure as above. Note that, in this case, the line U _ V is the polar line of the involution r which inverts both U and V. Therefore, r can be reified similarly and U _ V “ Tr w Y tU, Vu for some w P CX prq inverting Tr . BLACK BOX GROUPS PSL2 pFq q 25 8. Construction of Sym4 It is well-known that there is only one conjugacy class of subgroups isomorphic to Sym4 in SO3 pFq over a finite field of odd characteristic. The fundamental procedure in the coordinatization of P is the construction of a black box subgroup encrypting Sym4 in a black box group encrypting SO3 pFq over a finite field of odd characteristic. As we shall soon see, a subgroup isomorphic to Sym4 provides us with a convenient basis triangle in P. Theorem 8.1. Let X be a black box group encrypting X “ SO3 pFq over an unknown finite field F of unknown odd characteristic and |F| ě 7. Then, given a global exponent E for X, there is a polynomial in log E time Las Vegas algorithm constructing a black box subgroup in X which encrypts a subgroup in X isomorphic to Sym4 . We precede our proof of Theorem 8.1 with a few lemmas. We work within the terminological conventions of Section 4.2 and apply to strings and black box subgroups of X the same terms as to corresponding elements and subgroups of X. We work under assumptions of Theorem 8.1. It is well-known that X has two conjugacy classes of involutions. We say that an involution is of `-type if the order of its centralizer is 2pq ´ 1q and ´-type if the order of its centralizer is 2pq ` 1q. Notice that CX piq “ Ti ¸ xwy where Ti is a torus of order pq ˘ 1q and w is an involution inverting Ti . We will consider the involutions of `-type if q ” 1 mod 4 and ´-type if q ” ´1 mod 4 so that the order of the corresponding torus is always divisible by 4; we will call them involutions of right type. We are looking for a 5-tuple pi, j, z, s, Ti q where i P X is an involution of right type, j P X is an involution of right type which inverts Ti , z P X is an element of order 3 normalizing xi, jy and s P Ti is an element of order 4. We also set k “ ij and note that k is also of right type. Clearly xi, j, zy encrypts a subgroup isomorphic to Alt4 and xi, j, z, sy encrypts Sym4 . The crucial part of our construction is the search an element z P X of order 3 permuting some mutually commuting involutions i, j, k P X of right type. The following lemma provides explicit construction of such an element. Lemma 8.2. Let i, j, k P X be mutually commuting involutions of right type and x P X be an arbitrary element. Assume that y1 “ ijx has odd order m1 and set m1 `1 2 n1 “ y1 m2 `1 2 n2 “ y2 ´1 and s “ kxn1 . Assume also that y2 “ js has odd order m2 and set ´1 . Then the element z “ xn´1 1 n2 permutes i, j, k, and z has order 3. ´1 ´1 Proof. Observe first that in1 “ jx and jn2 “ s. Since s “ kxn1 , we have jn2 “ kxn1 . ´1 ´1 ´1 Hence j “ kxn1 n2 “ kz . Now, we prove that jz “ i. Since jxn1 “ i, we have ´1 ´1 ´1 jz “ jxn1 n2 “ in2 . We claim that y2 P CX piq, which implies that n2 P CX piq, so ´1 ´1 jz “ in2 “ i. Now, since j P CX piq, y2 “ js P CX piq if and only if s “ kxn1 P CX piq. x x x n1 Moreover, since i “ j , s P CX piq if and only if k P CX pj q, equivalently, k P CX pjq and the claim follows. It is now clear that iz “ k since ij “ k, and z has order 3.  Lemma 8.3. Let X, i, j, k, y1 , y2 and z be as in Lemma 8.2. Then the probability 1 . that y1 and y2 have odd orders is bounded from below by 21 ´ 2|F| 26 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA Proof. We first note that the subgroup xi, zy – Alt4 is a subgroup of Y ď X where Y – PSL2 pFq, so the involutions i, j, k belong to a normal subgroup isomorphic to PSL2 pFq. Therefore it is enough to compute the estimate in Y. Notice that all involutions in Y are conjugate. Therefore the probability that y1 and y2 have odd orders is the same as the probability of the product of two random involutions from Y to be of odd order. The rest of computation is done in the underlying group Y “ πpYq. We set |F| “ q and we denote by a one of these numbers pq ˘ 1q{2 which is odd and by b the other one. Then |Y | “ qpq 2 ´ 1q{2 “ 2abq and |CY piq| “ 2b for any involution i P Y . Hence the total number of involutions is |Y | 2abq “ “ aq. |CY piq| 2b Now we compute the number of pairs of involutions pi, jq such that their product ij belongs to a torus of order a. Let T be a torus of order a. Then NY pT q is a dihedral group of order 2a. Therefore the involutions in NY pT q form the coset NY pT qzT since a is odd. Hence, for every torus of order a, we have a2 pairs of involutions whose product belong to T . The number of tori of order a is |Y |{|NY pT q| “ 2abq{2a “ bq. Hence, there are bqa2 pairs of involutions whose product belong to a torus of order a. Thus the desired probability is b q´1 1 1 bqa2 “ ě “ ´ . 2 paqq q 2q 2 2q  Proof of Theorem 8.1. Let E “ 2m n where p2, nq “ 1. We first construct an involution i P X of right type and an element s P CX piq of order 4. Let i P X be an involution constructed from a random element by taking its power using squareand-multiply method. To check whether i is an involution of right type or not, we search for an element s P C :“ CX piq of order 4. Note that a random element from C can be constructed efficiently by the arguments in Section 4.7. Note also that if i is of right type then C contains elements of order 4, otherwise, C does not contain elements of order 4. If i is of right type then, since C “ Ti ¸ xwy, where Ti is a torus of order q ˘ 1 and w is an involution which inverts Ti , a random element from C has order divisible by 4 with probability at least 1{4. As soon as we find an element y P C such that yn ‰ 1 and y2n ‰ 1, then we construct an element s P xyy of order 4 by repeated square-and-multiple method. If we can not find an element of order 4 in C, we deduce that i is not of right type and we start from the beginning. Let i P X be a right type involution. The coset Ti w of Ti in C consists of the involutions inverting Ti , so half of the elements of C are the involutions inverting Ti and half of the involutions in Ti w are of the same type as i. We construct an involution j P C and check whether j is an involution of right type by following the same arguments above. Finally, for commuting right type involutions i, j P X, we construct an element z of order 3 normalizing xi, jy by using Lemma 8.2. The probability of constructing 1 such an element z P X is at least 21 ´ 2|F| by Lemma 8.3. Hence xs, zy is a black box subgroup encrypting Sym4 .  BLACK BOX GROUPS PSL2 pFq q 27 9. Coordinatization and a construction of a black box field To construct a black box field in X, all we need is to carry out Hilbert’s coordinatization of P [26] using our toolbox from Section 7. 9.1. The spinor basis. A construction from Section 8 yields a black box subgroup H encrypting Sym4 and we shall need to introduce special notation for some of its elements as they will play the central role in later calculations. We denote the three involutions in the 4-group E “ O2 pHq by e1 , e2 , e3 . If t1 , t2 , t3 are the centralizers in the Lie algebra l of their images πpe1 q, πpe2 q, πpe3 q, respectively, we know that they are orthogonal to each other and l “ t1 ‘ t2 ‘ t3 is the weight decomposition for the action of E on l and is therefore a grading of l: rt1 , t2 s “ t3 , rt2 , t3 s “ t1 , rt3 , t1 s “ t2 . Moreover, an element z of order 3 from H cyclically permutes t1 , t2 , t3 , which allows us to select a basis in l made of ǫ1 P t1 , ǫ2 “ ǫz1 P t2 , and ǫ3 “ ǫz2 P t3 . Since E lies in the commutator of H, the involutions ei P E have spinor norm 1 and therefore vectors ǫi can be chosen to satisfy Kpǫi , ǫi q “ 1 forming an orthonormal basis in l, Kpǫi , ǫj q “ δij . In particular, the quadric Q in P can be written by the equation x21 ` x22 ` x23 “ 0 in the coordinates x1 , x2 , x3 associated with the basis ǫ1 , ǫ2 , ǫ3 . In addition, the basis ǫ1 , ǫ2 , ǫ3 seen as a basis of the Lie algebra l obviously satisfies the Lie relations rǫ1 , ǫ2 s “ aǫ3 , rǫ2 , ǫ3 s “ aǫ1 , rǫ3 , ǫ1 s “ aǫ2 , for some fixed a P F˚q . What we found is an analogue of a spinor basis (or Pauli basis) from quantum mechanics and we will discuss these in detail elsewhere. 9.2. First steps towards the coordinatization of P. We know that ǫ1 , ǫ2 , ǫ3 form an orthonormal basis in l and e1 , e2 , e3 have homogeneous coordinates p1, 0, 0q, p0, 1, 0q, p0, 0, 1q; and the quadric Q is given in coordinates x1 , x2 , x3 associated with this basis by the equation x21 ` x22 ` x23 “ 0. Following traditional notation, we represent lines in P by equations of the form X1 x1 ` X2 x2 ` X3 x3 “ 0 and treat the tuple rX1 , X2 , X3 s as the homogeneous coordinates of the line. 28 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA 9.3. First steps in construction of a black box field. We shall now construct a black box field K. Towards this end, we take the set of points on the line e1 _ e3 for the extended field K Y t8u by assigning the coordinate x1 “ 0 to e3 and x1 “ 8 to e1 . We call the line e1 _ e3 the x1 -axis and similarly the line e2 _ e3 the x2 -axis. Taking into account that the coordinatization of P has to be consistent with the action of X, and, in particular, with the action of H on the basis e1 , e2 , e3 , we see that if we take the line e1 _ e2 for the line at infinity, we have the following: e2 “ p0, 8, 1q r ✡❏ ✡ ❏ ✡ ❏ ✡ ❏ ✡ ❏ ✡ ❏ ✡ ❏ ✡ ❏ ✡ ❏r r e3 “ p0, 0, 1q e1 “ p8, 0, 1q Here, 0 and 1 can be seen as elements of our future black box field K. The following is the same picture in homogeneous coordinates: e2 “r p0, 1, 0q ✡❏ ✡ ❏ ✡ ❏ ✡ ❏ ✡ ❏ ✡ ❏ ✡ ❏ ✡ ❏ ❏r ✡ r e3 “ p0, 0, 1q e1 “ p1, 0, 0q We shall gradually assign coordinates to more and more points in P, at every step ensuring that the coordinatization is consistent with the action of X on I and P and hence with the vector space structure on l. If a point x P P has coordinates x1 , x2 , x3 , we shall write x “ px1 , x2 , x3 q. Similarly, we denote lines by their coordinates, ℓ “ rX1 , X2 , X3 s which denote the line ℓ “ t px1 , x2 , x3 q | X1 x1 ` X2 x2 ` X3 x3 “ 0 u. We note that px1 , x2 , x3 q and rX1 , X2 , X3 s are homogeneous coordinates, they are defined up to multiplication by a non-zero scalar. BLACK BOX GROUPS PSL2 pFq q 29 Observe that polarity has a very simple meaning in terms of homogeneous coordinates associated with an orthonormal basis: πppx1 , x2 , x3 qq “ rX1 , X2 , X3 s if and only if X1 “ x1 , X2 “ x2 , X3 “ x3 . In particular, polar images of the base points ǫi have equations xi “ 0, i “ 1, 2, 3, and homogeneous coordinates πpǫ1 q “ r1, 0, 0s, πpǫ2 q “ r0, 1, 0s, πpǫ3 q “ r0, 0, 1s. So we have, in the black box setup, the following picture. e2 “r p0, 1, 0q ✡❏ ✡ ❏ ✡ ❏ ✡ ❏ r0, 0, 1s r1, 0, 0s✡ ❏ ✡ ❏ ✡ ❏ ✡ ❏ r ✡ ❏r e3 “ p0, 0, 1q e1 “ p1, 0, 0q r0, 1, 0s We shall soon add new points to this picture. 9.4. The unity element in K. So far, we know which elements on the x1 -axis represent the point 0 and 8 and now we construct the unity element on the x1 axis. Let z be an element of order 3 in H which permutes the basis points e1 , e2 , e3 . Pick in NH pxzyq an involution d1 which commutes with e1 . Observe that E ¸ xd1 y is a dihedral group of order 8 and therefore ed21 “ e3 . Now turn to the use of homogeneous coordinates. Recall that e2 “ p0, 1, 0q and e3 “ p0, 0, 1q. There are two involutions which conjugate e2 and e3 (see Equation 3 in Section 6.4): sp0,1,1q pe2 q “ “ “ and “ sp0,1,´1q pe2 q “ “ “ “ sp0,1,1q pp0, 1, 0qq 2p0 ¨ 0 ` 1 ¨ 1 ` 1 ¨ 0q p0, 1, 1q ´ p0, 1, 0q 02 ` 12 ` 12 p0, 0, 1q e3 sp0,1,´1q pp0, 1, 0qq 2p0 ¨ 0 ` 1 ¨ 1 ` p´1q ¨ 0q p0, 1, ´1q ´ p0, 1, 0q 02 ` 12 ` 12 p0, 0, ´1q e3 We can assign to d1 the coordinates p0, 1, 1q and set 2 d2 “ dz1 “ p1, 0, 1q and d3 “ dz1 “ p1, 1, 0q. So we have now a richer picture: 30 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA e2 “ p0, 1, 0q r ✡❏ ✡ ❏ ✡ ❏ ✡ ❏ r d3 “ p1, 1, 0q d1 “ p0, 1, 1q✡ r ❏ ✡ ❏ ✡ ❏ ✡ ❏ ✡ r ❏r r e3 “ p0, 0, 1q d2 “ p1, 0, 1q e1 “ p1, 0, 0q 9.5. More about H. We record for future use that the natural isomorphism H ÝÑ Sym4 , where Sym4 is seen as the symmetric group of the set t 0, 1, 2, 3 u in notation chosen in such a way that In particular, e1 ÞÑ p01qp23q e2 ÞÑ p02qp13q e3 ÞÑ p03qp12q z ÞÑ p123q dd23 “ d1 , d1 ÞÑ p23q d2 ÞÑ p13q . d3 ÞÑ p12q ed13 “ e2 . 9.6. Affine coordinates. Taking, as we have already did, the line e1 _ e2 for the line at infinity and the lines x2 “ 0 and x1 “ 0 for the coordinate axes, we get e2 “ p0, 8, 1q r ✡❏ ✡ ❏ ✡ ❏ ✡ ❏ r d3 “ p8, 8, 1q d1 “ p0, 1, 1q✡ r ❏ ✡ ❏ ✡ ❏ ✡ ❏ r ❏r r✡ e3 “ p0, 0, 1q d2 “ p1, 0, 1q e1 “ p8, 0, 1q Observe that this assignment of coordinates agrees with action by H. In particular, conjugation by d3 moves the points 0, 1, 8 on the x1 -axis to the points 0, 1, 8 on the x2 -axis, respectively. Therefore we can treat both coordinate axes as the two copies of the projective line K Y t8u over the black box field K that we will construct on the x1 -axis. Now on “this side of infinity”, on the affine plane x3 ‰ 0, the homogeneous coordinates of arbitrary point x can be written as px1 , x2 , 1q, where x1 “ px _ e2 q ^ pe1 _ e3 q and x2 “ px _ e1 q ^ pe2 _ e3 q are projections of x onto the coordinate axes, and we get the classical coordinatization of the affine plane [22]: BLACK BOX GROUPS PSL2 pFq q 31 p0, 8, 1q r ✡❏ ✄ ✡✄ ❏ ✡✄ ❏ ✡ ✄ ❏ r✡ ✄ ❏ p0, x2 , 1q ❛ ✡ ❛✄r px1 , x2 , 1q ❏ ❛ ✡ ✄ ❛❛❛ ❏ ✡ ❛❛❏ ✄ ✄r ✡ r ❛ ❏r p0, 0, 1q px1 , 0, 1q p8, 0, 1q p0, x2 q r r rpx1 , x2 q r px1 , 0q p0, 0q If x lies on the line at infinity x3 “ 0 then we can take any point x1 on the line e3 _ x, construct its affine coordinates px11 , x12 , 1q as above and take the triple px11 , x12 , 0q for the homogeneous coordinates of x. 9.7. Addition ‘ on K. Now we can introduce the field operations in the usual way, as shown on the following two diagrams, see Hartshorne [26] for details. We do this on the x1 -axis. Note that the set of points on this axis consists of involutions in CX pe2 q except e2 together with the two parabolic points – the two maximal unipotent subgroups inverted by e2 – if the involution e2 is of the `-type in the sense of Section 8. ✻ rc ❍❍ ❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍ ❍ ❍r ❍r r r d1 “ p0, 1q r❍ e3 “ p0, 0q b a ✲ a‘b In terms of our toolbox, we first construct c “ pa _ e2 q ^ pd1 _ e1 q, then we construct the point at infinity on the line d1 _ b and denote it 8d1 ,b : 8d1 ,b “ pd1 _ bq ^ pe1 _ e2 q, then a ‘ b is the point of intersection of the line c _ d parallel to d1 _ b with the x1 -axis e1 _ e3 : a ‘ b “ pc _ 8d1 ,b q ^ pe1 _ e3 q. 9.8. Multiplication b on K. 32 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA e3 _ d3 d “ pa, aq r ❍❍ ❍❍ ❍❍ ❍❍ ❍❍ c “ p1, 1q r ❍❍ ❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍ ❍ r ❍r ❍r r r e3 “ p0, 0q d2 “ p1, 0q a b abb In terms of our toolbox, we first construct the line x1 “ x2 as e3 _ d3 , then the point c “ p1, 1q as pe3 _ d3 q ^ pd2 _ e2 q, and point d “ pa, aq as d “ pe3 _ d3 q ^ pa _ e2 q, then the point at infinity of the line b _ c as 8b,c “ pb _ cq ^ pe1 _ e2 q, the line through the point d parallel to b _ c as d _ 8b,c , and, finally, the product a b b as the point of intersection of that line with the x1 -axis e1 _ e3 : a b b “ pe1 _ e3 q ^ pd _ 8b,c q. 9.9. Inversion and negation in K. Forming the negative x ÞÑ a x and inversion x ÞÑ xa on K are much easier to compute than addition and multiplication. Here are two useful observations. If x “ pχ, 0, 1q is a point in the x1 -axis, sp0,0,1q pxq “ “ “ “ “ sp0,0,1q ppχ, 0, 1qq 2p0 ¨ χ ` 0 ¨ 0 ` 1 ¨ 1q p0, 0, 1q ´ pχ, 0, 1q 02 ` 02 ` 12 p0, 0, 2q ´ pχ, 0, 1q p´χ, 0, 1q ax BLACK BOX GROUPS PSL2 pFq q 33 and sp1,0,1q pxq “ “ “ “ “ “ sp1,0,1q ppχ, 0, 1qq 2p1 ¨ χ ` 0 ¨ 0 ` 1 ¨ 1q p1, 0, 1q ´ pχ, 0, 1q 12 ` 02 ` 12 pχ ` 1, 0, χ ` 1q ´ pχ, 0, 1q p1, 0, χq p1{χ, 0, 1q xa . Therefore the field operations of taking negative and inversion x ÞÑ a x, x ÞÑ xa on K are computable by single conjugations, that is, for a regular point x in πpe2 q, ax “ xe3 and xa “ xd2 . This completes the construction of the black box field K. 9.10. Square roots in K. Given an element x P K, a number of polynomial time Las Vegas algorithms allow us to find a square root of x in K, if it exists. In our context, the Tonelli-Shanks algorithm, Lemma 5.6, is suitable for our purposes since the multiplicative group K˚ of K is isomorphic to a torus in X and inherits the global exponent from X. 10. Enforced serendipity: construction of unipotent elements The aim of this section is to prove Theorem 1.1. We start by presenting a test which decides whether an element in PGL2 pFq » SO3 pFq is unipotent or not when the characteristic of the field F is not known. This allows us to make our algorithm presented in Theorem 1.1 a Las Vegas algorithm. We will use the following lemma to locate a unipotent element in X. Lemma 10.1. Let q ” ´1 mod 4. Then, for random x, y P Fq , ´x2 ´ y 2 is a non-zero quadratic residue with probability 1{2 ´ 1{2q 2 . Proof. By [9, Theorem 10.5.1], for a fixed 0 ‰ c P Fq , the number of solutions of the equation ´x2 ´ y 2 “ c2 is q ` 1. Since there are pq ´ 1q{2 non-zero elements in Fq which are quadratic residue, ´x2 ´ y 2 is a quadratic residue with probability q2 ´ 1 1 1 pq ` 1qpq ´ 1q “ “ ´ 2 2 2 2q 2q 2 2q for random x, y P Fq . Hence the result follows.  Proof of Theorem 1.1. Let Y be a black box group encrypting PSL2 pFq over some unknown field of unknown odd characteristic p. Let E be an exponent for Y and E “ 2m n, p2, nq “ 1. First, we construct a black box group X encrypting SO3 pFq from the given black box group Y by using Theorem 5.1. Next, we construct three commuting involutions e1 , e2 , e3 in Y which we take for an orthogonal basis in our projective plane and the starting points for its coordinatization. Then we construct a black box subgroup H ă X encrypting Sym4 containing e1 , e2 , e3 (Theorem 8.1). Note that e1 , e2 , e3 , being involutions in Y, are right type involutions in X in the sense of Section 8. 34 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA Finally, by following the procedures described in Section 9, we have a black box field K with addition, ‘, and multiplication, b, together with the procedures for computing multiplicative and additive inverses. Let K be defined on the x1 -axis, that is, the elements of K Y t8u are the involutions in the coset Te2 e1 “ Te2 e3 , together with two parabolic points – the maximal unipotent subgroups normalized by e2 – if the involution e2 is of `-type in sense of Section 8, and we choose the involutions e3 and e1 for the roles of 0 and 8, respectively. We work in the affine plane x3 “ 1 in P as constructed in Section 9.6 with coordinates px1 , x2 , 1q. In these coordinates, the quadratic equation which defines the conic Q is x21 ‘ x22 ‘ 1 “ 0. Let d1 and d2 be the unit elements on the x2 -axis and x1 -axis, respectively, constructed as described in Subsection 9.4. Let d3 be the unit element that moves the x1 -axis to the x2 -axis coordinate-wise, see Subsection 9.6. Now, we distinguish the cases q ” 1 mod 4 and q ” ´1 mod 4 to construct a unipotent element in X. If q ” 1 mod 4, then the coset Te2 e3 has q ´ 1 involutions. Therefore, K has two missing points which are precisely the parabolic points on the x1 -axis. Since the x2 -coordinate of any point on x1 -axis is 0, in this case, there exists an element c P K such that c2 ‘ 1 “ 0. This means that, on the x1 -axis, the points with the homogeneous coordinates p˘c, 0, 1q lie on the conic Q so they are parabolic and the construction of one of these parabolic points gives a unipotent element in the black box group X. Observe that the multiplicative order of the elements ˘c P K is 4. Therefore, the construction of an element of order 4 in the multiplicative group of K gives us a unipotent element in X. To that end, we choose a random element u P K and construct the sequence 2 m un , u2n , u2 n , . . . , u2 n “1 by using the multiplication in K. Obviously, if 4 divides the multiplicative order of u, then the construction of this sequence for u produces a unipotent element; we detect it as a failure in reification of an involution at some step of construction. Because of probabilistic nature of our algorithms, there is a tiny possibility that the resulting element is semisimple – but we can use our unipotency test, Lemma 5.5, to decide whether this element is unipotent or not. If we can not find a unipotent element from this sequence, then we choose another element in K randomly and repeat this procedure. Note that at least half of the elements in K have multiplicative orders divisible by 4. If q ” ´1 mod 4, then the coset Te2 e3 has q ` 1 involutions. Since 4 does not divide q´1 in this case, there exists no element in K satisfying x21 ‘1 “ 0. Therefore, we should find a solution of the equation x21 ‘x22 ‘1 “ 0 in K. To this end, we search for random elements x, y P K such that ax2 ay2 has a square root in K, which can be checked by using Tonelli-Shanks algorithm. By Lemma 10.1, for random x, y P K, ax2 a y2 is a non-zero quadratic residue with probability 1{2 ´ 1{2q 2 . Assume that ax2 a y2 “ c2 for some c P K, and we compute this c P K by using TonelliShanks algorithm applied in K. Then we have x2 ‘ y2 ‘ c2 “ 0, or equivalently, y2 x2 d3 lies on the c2 ‘ c2 ‘ 1 “ 0. We set a “ x{c and b “ y{c. Now, recall that b x2 -axis and its coordinate is the same as the coordinate of the element b on the x1 -axis. Now, the intersection of the lines e1 _ bd3 and e2 _ a has the homogenous BLACK BOX GROUPS PSL2 pFq q 35 coordinate pa, b, 1q. Clearly, the construction of this intersection point produces a candidate unipotent element in X. Finally, we use unipotency test, Lemma 5.5, to check that it is indeed a unipotent element. To find the characteristic of the underlying field, we compute the order of the unipotent element that we constructed.  We tested our algorithm in GAP for finding unipotent elements in SO3 pFp q for 30-digit primes like p “ 115756986668303657898962467957: it works. 11. Coordinatization of the action of X on I, Proof of Theorem 1.3 The proof of Theorem 1.3 (a) follows from Theorem 5.1 and the proof for part (b), namely, the construction of a black box field K, follows from the constructions in Section 9. 11.1. Construction of the morphism X ÝÑ SO3 pKq. The aim of this section is to represent the action of an arbitrary element x P X on the projective plane P by a 3 ˆ 3 matrix ϕpxq with coefficient in K. We shall consider several cases: Case 1. We set » fi » fi » fi 1 0 0 a1 0 0 a1 0 0 ϕpe1 q “ –0 a1 0 fl , ϕpe2 q “ – 0 1 0 fl , ϕpe3 q “ – 0 a1 0fl . 0 0 a1 0 0 a1 0 0 1 Case 2. Now we compute ϕpuq for an arbitrary involution u P X in “general position” in the sense that u does not commute with any of ei , i “ 1, 2, 3. If u P X then involutions ui “ eui , i “ 1, 2, 3, represent the vectors ǫui in the projective plane P. We can compute the homogeneous coordinates pui1 , ui2 , ui3 q of ui using construction from Section 9.6. The vector pui1 , ui2 , ui3 q is a scalar multiple of ǫui . We have to normalize it by finding a scalar ci P K such that c2i pu2i1 ` u2i2 ` u2i3 q “ 1 which is done by taking a square root d ci “ ˘ 1 u2i1 ` u2i2 ` u2i3 (see Section 9.10). The choice of signs ˘ is dictated by the need to make the matrix ˆ ˙ ` ˘ uij U “ u1ij “ ci an involution from SO3 pKq; that is, U has to have determinant 1 and be symmetric. The choice of signs could happen to be not unique and defined up to simultaneous change of two signs, that is, up to multiplication of U on the right by one of the matrices ϕpei q. Since U and ϕpei q are involutions, their product U ϕpei q can happen to be an involution if and only if U and ϕpei q commute, which is excluded by our choice of u. Case 3. Now let u P X be an involution not in general position, say u P CX pe1 q. Recall that C “ CX pe1 q is a dihedral group. If u “ e1 , we are in Case 1. If u ‰ e1 , we do random search for an involution v P X such that v and w :“ uv do not commute with any e1 , e2 , e3 (this condition is satisfied with probability 1 ´ Op 1q )). Then u “ vwv and we can compute ϕpvq and ϕpwq as in Case 2 and then compute ϕpuq “ ϕpvqϕpwqϕpvq. 36 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA Case 4. This is the general case. By Lemma 5.4, we know that every x P X is either an involution, or a product of two or three involutions, say x “ uv; so we compute ϕpxq “ ϕpuqϕpvq, where ϕpuq and ϕpvq are computed as in Cases 2 and 3. This gives us an algorithm constructing a morphism X ÝÑ SO3 pKq. 11.2. Construction of the morphism SO3 pKq ÝÑ X. It is well known that each element r in SO3 pKq is either an involution or product of two involutions. In case r is not an involtuion, we can write r as a product of two involutions using Lemma 5.4. Therefore it will suffice to compute ϕ´1 prq for an involution r P SO3 pKq. We shall think of r as matrix in the same orthonormal basis in which » » fi » fi fi 1 0 0 a1 0 0 a1 0 0 ϕpe1 q “ –0 a1 0 fl , ϕpe2 q “ – 0 1 0 fl , ϕpe3 q “ – 0 a1 0fl . 0 0 a1 0 0 a1 0 0 1 As it was with computation of ϕ, we can easily reduce computation of ϕ´1 prq to the case when r is in general position, that is, r does not commute with any ϕpei q, i “ 1, 2, 3. Being an involution, r is a symmetric matrix; denote its rows as r1 , r2 , r3 . Now construct in P points si which have in the homogeneous coordinates associated with the basis e1 , e2 , e3 the coordinated vectors ri , i “ 1, 2, 3. The preimage s “ ϕ´1 prq satisfies the condition esi “ si , i “ 1, 2, 3. and is in general position with respect to tei u; therefore s is uniquely defined by these conditions. We compute an involution t1 P X such that et11 “ s1 , Lemma 5.7. Then the element (not necessarily an involution) x “ st1 belongs to C “ CX pe1 q and sends e2 t1 1 to ex2 “ est 2 “ s2 P C. We solve the conjugation problem once more, this time in C, and identify this element x P C; it is defined uniquely up to multiplication by an element from E “ xe1 , e2 y, so we get a coset Ex as an answer. Now s P Ext1 , and, being in general position, is the only involution there. 11.3. Construction of a morphism SO3 pFq q Ñ SO3 pKq. Let Fq be a standard explicitly given finite field of order q and Fp be its prime subfield. Assume also that K0 is the prime subfield of K. Then the isomorphism Fp Ñ K0 can be extended to an isomorphism in time polynomial in the input length to an isomorphism Fq Ñ K [33]. 12. Complexities In this section, we compute the complexities of the main procedures presented in this paper. Let Y be a black box group encrypting PSL2 pFq for some finite field F of odd characteristic. Let µ denote an upper bound on the time requirement for each group operation in Y and ξ an upper bound on the time requirement, per element, for the construction of random elements of Y. Let E be a global exponent for Y. In the sequel, we are going to construct a black box group X encrypting SO3 pFq from the black box group Y. By the construction of this black box group X, see Subsection 4.3 and Theorem 5.1, the time requirement for each group operation in BLACK BOX GROUPS PSL2 pFq q 37 X becomes at most 4µ, see Equation (1) in Subsection 4.3. An upper bound on the time requirement, per element, for the construction of random elements of X is 2ξ since we compute in the direct product Y ˆ Y. Moreover, E is replaced by 2E when we compute with the black box group X. For simplicity, we shall denote E as an exponent for both Y and X. We shall express complexities of our procedures in terms of µ, ξ and E. We set E “ 2m n where p2, nq “ 1. 12.1. Constructing an involution in Y (and in X). At least the quarter of elements in Y and in X are of even order [27, Corollary 5.3], therefore an involution can be constructed from a random element by repeated square-and-multiply method in time Opξ ` µ log Eq. 12.2. Centralizer of an involution s in Y (and in X). By the arguments at the end of Subsection 4.7, a generating set for CY psq and CX psq can be constructed in time Opξ log log E ` µ log E log log Eq. 12.3. Unipotency test, Lemma 5.5. For a given involution i P X and a random element x P X, the running time for our test which decides whether the element iix is unipotent or not is dominated by the complexity of the construction of CX piq. Therefore, the running time for our unipotency test is Opξ log log E ` µ log E log log Eq. 12.4. Reification of an involution in X, Theorems 5.1 and 5.3. We present the complexity for the algorithm in Theorem 5.3. The computation of the complexity for Theorem 5.1 is the same. Given two involutions s, t P X, we shall find the complexity of constructing the involution j :“ s b t, if exists, which commutes with both s and t. We set z “ st and check whether z has odd or even order which takes time Opµ log Eq. If z has even order then j P xzy can be computed in time Opµ log Eq, giving the total time Opµ log Eq. If z has odd order then, as in Subsection 12.2, CX psq can be constructed in time Opξ log log E ` µ log E log log Eq. At this point, we can check whether z is unipotent or not, see Subsection 12.3. Assume that z is not unipotent. Note that the elements in the generating set for CX psq which are not involutions can be taken to be generators for the torus Ts . Let STs be a generating set for Ts . By [34, I.8], we can take |STs | “ Oplog log |F|q. Clearly S “ STs Y tzu is a generating set for X and computing the action of j on S takes Opµ log log |F|q time. Hence, we run the product replacement algorithm on S to construct a random element x together with its conjugate xj . Since the elements of the form xj x´1 have odd orders with probability bounded from below by a constant, see [37], the construction of CX pjq takes Opξ log log E ` µ log E log log Eq time. Finally, the involution j can be constructed from an element of even order from the torus in CX pjq by square-andmultiply method. Hence, if z has odd order, the construction of the involution j is Opξ log log E ` µ log E log log Eq time. 12.5. A line through s and t. As this is an application of a reification of an involution, if the involution j :“ s b t exits then the total time needed to construct j is Opξ log log E`µ log E log log Eq. If j does not exist for these particular involutions s and t then the reification process returns a unipotent element u. In this case, we construct a parabolic line xuTs ys in time Opξ log log E ` µ log E log log Eq. 38 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA 12.6. Intersection of two non-parabolic lines k and l. Given involutions s1 , s2 , t1 , t2 P X, where s1 , s2 define a line k and t1 , t2 define a line l, the intersection of k and l, if exists, is the involution ps1 b s2 q b pt1 b t2 q. Therefore, it can be computed in time Opξ log log E ` µ log E log log Eq, see Subsection 12.4. 12.7. Tonelli-Shanks algorithm for tori in X, Lemma 5.6. We follow the outline presented in the proof of Lemma 5.6. Let T be a cyclic black box group. We use the exponent E “ 2m n, n odd, for T. Let z P T be an element that has a square root in T. Checking whether z has odd or even order takes Opµ log Eq time. If |z| is odd then the square root of z, which is zp|z|`1q{2 , can be constructed in time Opµ log Eq. If |z| is even then we need to look for an element of maximal 2-height in T. Observe that the proportion of the elements of maximal 2-height in T is at least 1{2 and computing the 2-height of an arbitrary element takes Opµ log Eq time. The elements a, b, c and the corresponding non-negative integer d in the proof of Lemma 5.6 can be set up in time Opµ log Eq and Opµmq, respectively. As the recursion has at most m steps and each step takes at most Opµ log Eq time, the over all construction takes Opξ ` µm log Eq time. 12.8. Bisection of angles, Lemma 5.7. Given two conjugate involutions i, j P X, we shall find the complexity of constructing a conjugating involution x P X, that is, ix “ j. The construction of x involves finding the square root of z “ ij and construction of centralizers of involutions. Therefore it takes Opξ log log E ` µm log Eq time, see Subsection 12.7. Since m ă log E, we have Opξ log log E ` µ log2 Eq. 12.9. Representation of an arbitrary element as a product of involutions, Lemma 5.4. This is an another application of a reification of an involution, see Subsection 12.4. Hence it takes Opξ log log E ` µ log E log log Eq time. 12.10. Addition and multiplication in K. As described in Subsections 9.7 and 9.8, addition and multiplication in K involve constant number of reifications of involutions. Hence they can be done in time Opξ log log E ` µ log E log log Eq. 12.11. Tonelli-Shanks algorithm in K. By Section 12.10, a multiplication in K can be done in time Opξ log log E ` µ log E log log Eq, so following the computations in Section 12.7, Tonelli-Shanks algorithm in K runs in time Opξm log E log log E ` µm log2 E log log Eq. Since m ă log E, we have Opξ log2 E log log E`µ log3 E log log Eq. 12.12. Constructing a unipotent element and finding the characteristic, Theorem 1.1. The construction of three commuting involutions in a black box group Y encrypting PSL2 pFq over a field of odd characteristic involves only constructing involutions and their centralizers in Y. Therefore, by Subsection 12.1 and 12.2, it can be done in time Opξ log log E ` µ log E log log Eq. The construction of a black box group X encrypting SO3 from the black box group Y takes Opξ log log E ` µ log E log log Eq time by Subsection 12.4. Construction of a black box subgroup encrypting Sym4 can be done in time Opξ log log E`µ log E log log Eq. Hence, we have a set-up for the projective plane and a black box field K in time Opξ log log E ` µ log E log log Eq. q ” 1 mod 4 : For a random element u P K, to check whether u has a multiplicative order divisible by 4 involves log E multiplications in K. Since each multiplication in K takes Opξ log log E ` µ log E log log Eq time and the orders of the half of BLACK BOX GROUPS PSL2 pFq q 39 the elements in K are divisible by 4, the construction of a unipotent element takes at most Opξ log E log log E ` µ log2 E log log Eq time. q ” ´1 mod 4 : By the complexity given in Subsection 12.11, finding elements x, y P K where ax a y is a quadratic residue takes time Opξ log2 E log log E ` µ log3 E log log Eq. Since the rest of the computation involves addition and multiplication in K, constructing lines and finding the intersections of lines, the overall construction takes time Opξ log2 E log log E ` µ log3 E log log Eq. 12.13. Morphism X Ñ SO3 pKq. We will find the complexity to represent an involution u P X in SO3 pKq when u does not commute with some commuting right type involutions e1 , e2 , e3 P X. Then, together with the computations in Subsection 12.9 the complexity of the representation of an arbitrary element follows. As in Subsection 12.12, we have a set up for the projective plane and a black box field K in time Opξ log log E ` µ log E log log Eq. Then, the computation of the homogenous coordinates for eui “ pui1 , ui2 , ui3 q involves finding intersections of the corresponding lines, so it takes Opξ log log E `µ log E log log Eq time. Normalization of eui “ pui1 , ui2 , ui3 q involves the computation of u2 `u12 `u2 and its square root ci in K. The computation of the quotient 1 u2i1 `u2i2 `u2i3 i1 i2 i3 takes Opξ log log E ` µ log E log log Eq time and the computation of square roots ci in K takes Opξ log2 E log log E ` µ log3 E log log Eq time, see Subsection 12.11. Hence, the normalization of eui can 2 3 be done in time Opξ log ´ E¯log log E ` µ log E log log Eq. The time needed to comuij pute the matrix U “ ci is Opξ log log E ` µ log E log log Eq. Hence adding all the complexities above, we get Opξ log2 E log log E ` µ log3 E log log Eq. 12.14. Morphism SO3 pKq Ñ X. Let r P SO3 pKq be an arbitrary element. To write r as a product of two involutions in SO3 pKq, we apply the same arguments in Lemma 5.4. In this case, we take any s P SO3 pKq and look for an involution t P SO3 pKq (a symmetric matrix of order 2) which inverts both r and s. Since r and s matrices over black box field K, to find such an involution t, we solve the corresponding systems of linear equations in K. Hence, this can be done in time Opξ log log E ` µ log E log log Eq. Now, let r P SO3 pKq be an involution. As in Subsection 12.13, it is enough to find the complexity for the construction of a black box group element r P X encrypting r when r does not commute with ϕpe1 q, ϕpe2 q, ϕpe3 q. Let r1 , r2 , r3 be the rows of r. Constructing the involutions s1 , s2 , s3 P P with the homogenous coordinates r1 , r2 , r3 involve only constant number of reifications of involutions and intersections of lines. Therefore, we can construct these involutions in time Opξ log log E`µ log E log log Eq. Constructing the desired involution r P X such that eri “ si involves two times bisection of angles and the construction of centralizers of involutions in X so it takes Opξ log log E ` µ log2 E log log Eq time by Subsections 12.2 and 12.8. Hence the running time for the construction of the black box group element encrypting r is Opξ log log E ` µ log2 E log log Eq. Acknowledgements This paper would have never been written if the authors did not enjoy the warm hospitality offered to them at the Nesin Mathematics Village in Şirince, Izmir Province, Turkey, in Summers 2011–17; our thanks go to Ali Nesin and to all volunteers, staff, and students who have made the Village a mathematical paradise. 40 ALEXANDRE BOROVIK AND ŞÜKRÜ YALÇINKAYA We thank Adrien Deloro and Roman Kossak for many fruitful discussions, and Alexander Konovalov and Chris Stephenson who helped us to clarify links with the computer science. Our work was partially supported by the Marie Curie FP7 Initial Training Network MALOA (PITN-GA-2008-MALOA no. 238381) and by CoDiMa (CCP in the area of Computational Discrete Mathematics; EPSRC grant EP/M022641/1), and by The Dame Kathleen Ollerenshaw Trust. In the project, we were using the GAP software package by The GAP Group, GAP–Groups, Algorithms, and Programming, Version 4.8.4; 2016 (http://www.gap-system.org). References [1] Y. Ahmavaara, The structure of space and the formalism of relativistic quantum theory. I, J. Math. Physics 6 (1965), no. 1, 87–93. , The structure of space and the formalism of relativistic quantum theory. II, J. Math. [2] Physics 6 (1965), no. 2, 220–227. [3] , Structure of space and the formalism of relativistic quantum theory. III. IV, J. Math. Physics 7 (1966), no. 2, 197–204. [4] L. Babai, Local expansion of vertex-transitive graphs and random generation in finite groups, Proc. ACM Symp. on Theory of Computing (1991), 164–174. [5] , Randomization in group algorithms: conceptual questions, Groups and Computation II (L. Finkelstein and W. M. Kantor, eds.), DIMACS Ser. Discrete Math. Theoret. Comput. Sci., vol. 28, Amer. Math. Soc., Providence, RI, 1997, pp. 1–17. [6] L. Babai and R. Beals, A polynomial-time theory of black box groups. I, Groups St. Andrews 1997 in Bath, I, London Math. Soc. Lecture Note Ser., vol. 260, Cambridge Univ. Press, Cambridge, 1999, pp. 30–64. [7] L. Babai and I. Pak, Strong bias of group generators: an obstacle to the “product replacement algorithm”, J. Algorithms 50 (2004), no. 2, 215–231, SODA 2000 special issue. [8] L. Babai and E. Szemerédi, On the complexity of matrix group problems, Proc. 25th IEEE Sympos. Foundations Comp. Sci. (1984), 229–240. [9] B. C. Berndt, R. J. Evans, and K. S. Williams, Gauss and Jacobi sums, Canadian Mathematical Society Series of Monographs and Advanced Texts, John Wiley & Sons, Inc., New York, 1998, A Wiley-Interscience Publication. [10] D. Boneh and R. J. Lipton, Algorithms for black-box fields and their application to cryptography, Advances in Cryptology CRYPTO 96 (Neal Koblitz, ed.), Lecture Notes in Computer Science, vol. 1109, Springer Berlin Heidelberg, 1996, pp. 283–297. [11] A. V. Borovik, Centralisers of involutions in black box groups, Computational and Statistical Group Theory (Las Vegas, NV/Hoboken, NJ, 2001), Contemp. Math., vol. 298, Amer. Math. Soc., Providence, RI, 2002, pp. 7–20. [12] A. V. Borovik and Ş. Yalçınkaya, Homomorphic encryption and black box algebra, arXiv:1709.01169, 2017. , Construction of Curtis-Phan-Tits system for black box classical groups, [13] arXiv:1008.2823v1. [14] , Steinberg presentations of black box classical groups in small characteristics, arXiv:1302.3059v1. [15] , Structural recognition of black box groups PGL3 pFq q, in preparation. [16] J. N. Bray, An improved method for generating the centralizer of an involution, Arch. Math. (Basel) 74 (2000), no. 4, 241–245. [17] P. A. Brooksbank, Fast constructive recognition of black-box unitary groups, LMS J. Comput. Math. 6 (2003), 162–197. , Fast constructive recognition of black box symplectic groups, J. Algebra 320 (2008), [18] no. 2, 885–909. [19] P. A. Brooksbank and W. M. Kantor, On constructive recognition of a black box PSLpd, qq, Groups and Computation III (W. M. Kantor and Á. Seress, eds.), Ohio State Univ. Math. Res. Inst. Publ., vol. 8, de Gruyter, Berlin, 2001, pp. 95–111. [20] , Fast constructive recognition of black box orthogonal groups, J. Algebra 300 (2006), no. 1, 256–288. BLACK BOX GROUPS PSL2 pFq q 41 [21] F. Celler, C. R. Leedham-Green, S. H. Murray, A. C. Niemeyer, and E. A. O’Brien, Generating random elements of a finite group, Comm. Algebra 23 (1995), no. 13, 4931–4948. [22] H.S.M. Coxeter, Projective Geometry, Springer New York, 2003. [23] D. Gorenstein, R. Lyons, and R. Solomon, The Classification of the Finite Simple Groups. Number 1, Mathematical Surveys and Monographs, vol. 40, American Mathematical Society, Providence, RI, 1994. , The Classification of the Finite Simple Groups. Number 3. Part I. Chapter A, [24] Mathematical Surveys and Monographs, vol. 40, American Mathematical Society, Providence, RI, 1998. [25] R. M. Guralnick, W. M. Kantor, and J. Saxl, The probability of generating a classical group, Comm. Algebra 22 (1994), no. 4, 1395–1402. [26] R. Hartshorne, Foundations of Projective Geometry, Lecture Notes, Harvard University, vol. 1966/67, W. A. Benjamin, Inc., New York, 1967. [27] I. M. Isaacs, W. M. Kantor, and N. Spaltenstein, On the probability that a group element is p-singular, J. Algebra 176 (1995), no. 1, 139–181. [28] W. M. Kantor and M. Kassabov, Black box groups isomorphic to PGLp2, 2e q, J. Algebra 421 (2015), 16–26. [29] W. M. Kantor and Á. Seress, Black Box Classical Croups, Mem. Amer. Math. Soc. 149 (2001), no. 708, viii+168. [30] P.E. Kustaanheimo, On the fundamental prime of a finite world, Annales Academiae Scientiarum Fennicae. Series A. 1, Mathematica-Physica, 1952. [31] H. W. Lenstra Jr., Finding isomorphisms between finite fields, Mathematics of Computation 56 (1991), no. 193, pp. 329–347. [32] A. Lubotzky and I. Pak, The product replacement algorithm and Kazhdan’s property (T), J. Amer. Math. Soc. 14 (2001), no. 2, 347–363. [33] U. Maurer and D. Raub, Black-box extension fields and the inexistence of field-homomorphic one-way permutations, Advances in Cryptology—ASIACRYPT 2007, Lecture Notes in Comput. Sci., vol. 4833, Springer, Berlin, 2007, pp. 427–443. [34] D. S. Mitrinović, J. Sándor, and B. Crstici, Handbook of number theory, Mathematics and its Applications, vol. 351, Kluwer Academic Publishers Group, Dordrecht, 1996. [35] I. Pak, The product replacement algorithm is polynomial, Proc. FOCS’2000, The 41st Ann. Symp. on Foundations of Comp. Sci. (2001), 476–485. [36] , What do we know about the product replacement algorithm?, Groups and Computation III (W. M. Kantor and Á. Seress, eds.), Ohio State Univ. Math. Res. Inst. Publ., vol. 8, de Gruyter, Berlin, 2001, pp. 301–347. [37] C. W. Parker and R. A. Wilson, Recognising simplicity of black-box groups by constructing involutions and their centralisers, J. Algebra 324 (2010), no. 5, 885–915. [38] C. Pomerance, The expected number of random elements to generate a finite abelian group, Periodica Mathematica Hungarica 43 (2002), no. 1, 191–198. [39] D. Shanks, Five number-theoretic algorithms, Proceedings of the Second Manitoba Conference on Numerical Mathematics (Univ. Manitoba, Winnipeg, Man., 1972) (Winnipeg, Man.), Utilitas Math., 1973, pp. 51–70. Congressus Numerantium, No. VII. [40] A. Tonelli, Bemerkung über die auflösung quadratischer congruenzen, Nachrichten von der Königlichen Gesellschaft der Wissenschaften und der Georg-Augusts-Universität zu Göttingen (1891), 344–346 (German). [41] B. Weisfeiler, On abstract monomorphisms of k-forms of PGLp2q, J. Algebra 57 (1979), 522–543. [42] B. Zilber, Perfect infinities and finite approximation, (2012, https://people.maths.ox.ac.uk/zilber/inf-to-finite.pdf). School of Mathematics, University of Manchester, UK; [email protected] Department of Mathematics, Istanbul University, Turkey; [email protected]
4math.GR
Optimal projection of observations in a Bayesian setting arXiv:1709.06606v3 [math.ST] 12 Feb 2018 L. Giraldi, O. P. Le Maître, I. Hoteit, O. M. Knio Abstract Optimal dimensionality reduction methods are proposed for the Bayesian inference of a Gaussian linear model with additive noise in presence of overabundant data. Three different optimal projections of the observations are proposed based on information theory: the projection that minimizes the Kullback-Leibler divergence between the posterior distributions of the original and the projected models, the one that minimizes the expected Kullback-Leibler divergence between the same distributions, and the one that maximizes the mutual information between the parameter of interest and the projected observations. The first two optimization problems are formulated as the determination of an optimal subspace and therefore the solution is computed using Riemannian optimization algorithms on the Grassmann manifold. Regarding the maximization of the mutual information, it is shown that there exists an optimal subspace that minimizes the entropy of the posterior distribution of the reduced model; a basis of the subspace can be computed as the solution to a generalized eigenvalue problem; an a priori error estimate on the mutual information is available for this particular solution; and that the dimensionality of the subspace to exactly conserve the mutual information between the input and the output of the models is less than the number of parameters to be inferred. Numerical applications to linear and nonlinear models are used to assess the efficiency of the proposed approaches, and to highlight their advantages compared to standard approaches based on the principal component analysis of the observations. 1 Introduction We consider the problem of Bayesian inference in the case of overabundant data. The goal is to compute an optimal approximation of the posterior distribution by projection of the observations. These projections are computed solving the following optimization problem  min J P (X | Y = y), P (X | W = V T y) , V where X is the inferred parameter, Y the observations of the Bayesian model with values in Rn , y ∈ Rn the data, W = V T Y the reduced observations with values in Rr , V ∈ Rn×r the deterministic matrix defining the projection from the full to the reduced observations, and J a functional defining the optimality criterion. 1 In the literature, the most popular dimensionality reduction techniques result from the optimal approximation of the observations Y with respect to the L2 norm defined by 2 kY kL2 = E(Y T Y ), with E the expectation operator. A best low-rank approximation of Y with respect to the L2 norm is computed by a singular value decomposition. Then, with V being the matrix composed of the dominant left eigenvectors of Y , the approximation is given by Y ≈ V W where W = V T Y . The reader could refer to [15, Section 4.4.3] for the presentation of the singular value decomposition in a general case. When applied to the centered random vector Y − E(Y ), this decomposition is also called truncated Karhunen-Loève expansion [20, 21, 22], or principal component analysis [17, 19, 26]. Let Ω denote a sample space. When considering the random vector as a map Ω → Rn , an approximation of the observations Y can be used to define the matrix V based on the L∞ norm defined by kY kL∞ = sup max |Yi (ω)|. ω∈Ω 1≤i≤n The empirical interpolation method [4] provides an approximation of the form ω 7→ V W (ω) of a parametric vector ω 7→ Y (ω) based on this supremum norm. Given that computing the supremum is not tractable, the sample space is restricted to a finite sample ΩN = {ωi }N i=1 ⊂ Ω and the norm is approximated by kY kL∞ ≈ max max |Yi (ω)|. ω∈ΩN 1≤i≤n The interpolation is then defined to be exact on a subsample {ωj? }rj=1 ⊂ ΩN , and on a restricted number of indices {ij }rj=1 ⊂ {1, . . . , n}. The interpolation points ((ωj? , ij ))rj=1 are selected in a greedy fashion using the supremum norm of the error, such that (ωr? , ir ) = arg max max Yi − ω∈ΩN 1≤i≤n r−1 X Vij Wj . j=1 The approach reduces to the interpolation of the matrix Mij = Yi (ωj ) and is therefore very close to the cross approximation method [5] for the low-rank interpolation of a matrix. A detailed comparison between the singular value decomposition, the empirical interpolation method and the cross approximation is provided in [6]. A weighted variant of the empirical interpolation method was introduced in [8] in order to take into account probability measures. Given a positive weight w : Ω → R+ , the supremum norm is modified such that w kY kL∞ = sup max w(ω)|Yi (ω)|, ω∈Ω 1≤i≤n yielding different interpolation points. While the approximations based on the L2 and L∞ norms are widely used, they are optimal with respect to the output of the model and are not directly related to the distribution of the parameter to infer. An exception to this rule is [13] where a weighted singular value decomposition was used to accommodate uniform priors. 2 Geppert et al. [12] propose to reduce the number of observations in a Bayesian regression framework using random projections. The methodology relies on εsubspace embeddings that are particular maps of the form Π ∈ Rr×n satisfying 2 2 2 (1 − ε) kBxk ≤ kΠBxk ≤ (1 + ε) kBxk , for a particular B ∈ Rn×q , and for any x ∈ Rq with a probability 1 − α. In order to obtain an error on the posterior distribution of order ε in terms of the Wasserstein metric, it is shown that the number of observations required is O((q + log(1/α))/ε2 ), O(q log(q/α)/ε2 ) or O(q 2 /(αε2 )), depending on the embedding. Even though the dimension r can be drastically smaller than the original number of observations, n, it can still be relatively large for a small risk α and a small error ε. Another related technique is introduced in a series of papers [9, 28, 29]. Given a Gaussian linear model, the goal is to directly compute an approximate posterior covariance matrix as a low-rank update of the prior covariance. Given a particular loss function depending only on the covariance, it is shown that an optimal low-rank update can be derived from a generalized eigenvalue problem. The resulting distribution is then optimal in terms of the Hellinger distance and Kullback-Leibler divergence under the assumption that the mean is exactly recovered. An optimal mean is also derived as a linear projection of the data by minimizing the Bayes risk defined as the expected Mahalanobis distance between the parameter of interest X and the approximate mean. Regarding this methodology, two disadvantages are notable: there is an inconsistency between the optimality criteria of the mean and the covariance, and the computation of the different matrices requires the inversion of the covariance matrix of the noise, which is of large dimension n × n. In this work, the approximate mean and covariance are defined similarly, namely as an affine function of the data and as a low-rank update of the prior covariance, respectively. However, they result from the optimal projections of the statistical model using criteria from information theory, namely the Kullback-Leibler divergence, the expected Kullback-Leibler divergence, and the mutual information, which is the first contribution of this paper. The second contribution concerns the choice of the practical numerical algorithm for the minimization of the expected Kullback-Leibler divergence between the posterior distributions of the full and reduced model. It is moreover shown that a solution to the optimization problem defined as the maximization of the mutual information I(X, W ) between the parameter X and the reduced observations W is given by the solution of a generalized eigenvalue problem that does not require the inversion of a large matrix. We can moreover estimate the loss I(X, Y ) − I(X, W ) and show that no more than q projections are required to recover the full mutual information, where q is the size of X. The last contribution of this work concerns the illustration of the method on linear and nonlinear examples. This paper is organized as follows. In Section 2, the full and reduced linear models are presented in the Gaussian case, as well as other required definitions. The posterior distributions are then provided explicitly in closed form. Section 3 introduces the three different optimization problems that are used to define the alternative optimal projections of the observations. The analysis of the corresponding optimal subspace and the numerical algorithms for their computation 3 are then provided. The methodologies are finally applied and illustrated to a Bayesian linear regression problem in Section 4 and to a nonlinear problem in Section 5. Major conclusions are summarized in Section 5.4. 2 2.1 Linear Gaussian model Models We consider an abstract probability space (Ω, F, P), where Ω is the sample space, F is a σ-algebra and P a probability measure. Given an Rn -valued random vector Z, we denote by P (Z) the pushforward probability measure such that P (A) = P(Z −1 (A)) for any set A in the Borel algebra of Rn , and fZ the probability density function defined with respect to the Lebesgue measure. We consider the following linear model Y = BX + E, (1) where B ∈ Rn×q is the design matrix, X is the random parameter we want to infer and E is the random noise. The random vector X (resp. E) is supposed to follow the multivariate normal distribution N (mX , CX ) (resp. N (mE , CE )) with mean mX ∈ Rq (resp. mE ∈ Rn ) and covariance CX ∈ Rq×q (resp. CE ∈ Rn×n ). The input parameter X and the noise E are assumed to be independent. In order to compress the amount of data used for the inference, we introduce V = (vi )ri=1 ∈ Rn×r , a reduced basis of observations. In the following, the term reduced space may be used for V , as we look for the projection of the observations on the space spanned by the columns of V . The linear model expressed in the reduced coordinates is therefore W = V T BX + V T E, (2) and the reduction is efficient if, for r  n, the posterior distribution P (X | W ) is close to P (X | Y ) in some sense defined in Section 3. Our main goal is to compute a suitable matrix V which satisfies this condition. In order to subsequently apply the different methodologies to nonlinear models of the form Y = A(X) + E, it is beneficial to consider the random vector A(X) = BX. In the linear case, this random vector follows the distribution N (mA , CA ) where mA = BmX and CA = BCX B T . We also denote by CAX the covariance between A and X, that is   T CAX = E (A(X) − mA ) (X − mX ) = BCX . Given the structure of the problem, the random vectors Y and W are also distributed according to the multivariate normal distribution N (mY , CY ) and N (mW , CW ), respectively, with mY = mA +mE , CY = CA +CE , mW = V T mY , and CW = V T CY V . The extension of the approach to nonlinear problems is based on the three quantities mA , CA and CAX . 4 2.2 Posterior distributions Given the linear Gaussian structure of Equation (1), an observation y of Y , and a reduced basis V , the posterior distributions P (X | Y = y) and P (X | W = V T y) can be analytically derived. The result is summarized in Proposition 2.1. Proposition 2.1. The posterior distribution P (X | Y = y) follows the multivariate normal distribution N (m? , C? ), where −1 T T C? = CX (CX + CAX CE CAX )−1 CX = CX − CAX CY−1 CAX , (3) m? = G? (y − mY ) + h? , (4) and with G? = T CAX CY−1 and h? = −1 C? CX mX + G? mA . Regarding the posterior distribution of the reduced model, if the matrix V ∈ Rn×r is full-rank, the distribution P (X | W = V T y) follows the multivariate normal distribution N (mV , CV ), where  −1 −1 T T CV = CX CX + CAX V V T CE V V CAX CX  −1 T T = CX − CAX V V T CY V V CAX , (5) and mV = GV V T (y − mY ) + hV , (6) with T GV = CAX V (V T CY V )−1 , and −1 hV = CV CX mX + GV V T mA . Proof. See Appendix A. Regarding Proposition 2.1, we can first notice that the two expressions −1 T C? = CX (CX + CAX CE CAX )−1 CX  −1 −1 T T and CV = CX CX + CAX V V T CE V V CAX CX show that the matrices C? and CV are always symmetric positive definite, even for a nonlinear model. In the following, we denote by GLr the set of invertible matrices in Rr×r , and obtain an invariance property expressed in Proposition 2.2. Proposition 2.2. For all matrices M ∈ GLr , we have mV M = mV and CV M = CV . Therefore, the posterior distribution P (X | W = V T y) ∼ N (mV , CV ) is invariant under invertible linear transformation of the matrix V on the right. Proof. See Appendix B. 5 In practice, this proposition means that V is less important than range(V ) in the determination of the posterior distribution. Indeed, rescaling, rotating or permuting the observations in Equation (2) does not affect the posterior distribution P (X | W = V T y). Formally, the Grassmann manifold Gr(r, n) defined as the set of r dimensional subspace of Rn is therefore the set of interest to determine the optimal reduced observations. In this work, we identify Gr(r, n) with the quotient manifold Rn×r /GLr following [2], where Rn×r is the set of full rank matrices of Rn×r ∗ ∗ and the quotient space is defined by  Gr(r, n) = Rn×r /GLr = [V ]; V ∈ R∗n×r , where [V ] = {V M ; M ∈ GLr } . ∗ Finally, Proposition (2.2) means that it is more important to identify the equivalence class [V ] ∈ Rn×r than a particular matrix V ∈ Rn×r . ∗ ∗ The next section presents the different proposed optimization problems, where the Grassmann manifold Gr(r, n) has an important role. 3 3.1 Optimality criteria for the definition of the reduced basis Kullback-Leibler divergence minimization Given two distributions P (Z0 ) and P (Z1 ), the Kullback-Leibler divergence between them is defined by   fZ (7) DKL (P (Z0 ) k P (Z1 )) = EZ0 log 0 . fZ1 This divergence quantifies the “information lost when [P (Z1 )] is used to approximate [P (Z0 )]” according to [7, Section 2.1]. The Kullback-Leibler divergence is always positive and null if and only if the two distributions are identical, therefore defining a generalized distance between distributions. This interpretation of the Kullback-Leibler divergence leads us to consider → R defined by the following functional J0 : Rn×r ∗  J0 (V ) = DKL P (X | Y = y) k P (X | W = V T y) . The domain definition of J0 must be restricted to the set of full rank matrices Rn×r in order to comply with Proposition 2.1 characterizing the posterior dis∗ tributions. Given that we are working with Gaussian distributions, the computation of the Kullback-Leibler divergence is always well-posed (i.e. fZ1 is always stricly positive in Equation (7)). The general expression of the Kullback-Leibler divergence between two Gaussian distribution is given in Proposition 3.1. Proposition 3.1. Assuming that Z0 ∼ N (m0 , C0 ) and Z1 ∼ N (m1 , C1 ) are Rq -valued random variables, the Kullback-Leibler divergence between P (Z0 ) and P (Z1 ) is expressed by DKL (P (Z0 ) k P (Z1 )) = 1 (D`d (C0 , C1 ) + DC1 (m0 , m1 )) , 2 6 where D`d (C0 , C1 ) is the Bregman log det divergence between C0 and C1 defined by   D`d (C0 , C1 ) = tr C0 C1−1 − log det C0 C1−1 − q, and DC1 (m0 , m1 ) is the Mahalanobis divergence defined by DC1 (m0 , m1 ) = (m0 − m1 )T C1−1 (m0 − m1 ). Proof. See Appendix C. As a consequence of Proposition 3.1, the functional J0 has a closed form depending on m? , C? , mV and CV :  J0 (V ) = DKL P (X | Y = y) k P (X | W = V T y) (8) 1 = (D`d (C? , CV ) + DCV (m? , mV )) 2   1 = tr C? CV−1 − log det C? CV−1 − q 2  T + (m? − mV ) CV−1 (m? − mV ) . Given Proposition 2.2, for all M ∈ GLr , we have J0 (V M ) = J0 (V ). It means that we are in fact interested in the map defined on Gr(r, n) by [V ] 7→ J0 (V ). The minimization problem of interest is therefore  min DKL P (X | Y = y) k P (X | W = V T y) . (9) [V ]∈Gr(r,n) We can show that the following result holds. Theorem 3.2. There exists a solution to Problem (9). Proof. See Appendix D. Note that the minimization of the Kullback-Leibler divergence in Problem (9) results in an a posteriori reduction in the sense that a realization y of Y is required to evaluate the cost function. In the following, other functionals are proposed that circumvent this issue. 3.2 Expected Kullback-Leibler divergence minimization The first possibility to remove the dependence on the data is to work on the expected Kullback-Leibler divergence with respect to the observation, where the measurement Y is treated as a random variable. Similarly to Section 3.1, let J1 : Rn×r → R be defined by ∗  J1 (V ) = EY DKL P (X | Y ) k P (X | W = V T Y ) . The expected Kullback-Leibler divergence admits a closed form as well, presented in the next proposition. Proposition 3.3. We have the following equality J1 (V ) = 1 (D`d (C? , CV ) + EY (DCV (m? , mV ))) , 2 7 (10) where EY (DCV (m? , mV )) =   T  tr CV−1 G? − GV V T CY G? − GV V T + (h? − hV )CV−1 (h? − hV ). Proof. See Appendix E. Using Proposition 2.2 and Equation (10), we can show that J1 (V ) = J1 (V M ) for all matrices M ∈ GLr . We are therefore interested in finding the optimal equivalence class [V ] and solving the minimization problem  min EY DKL P (X | Y ) k P (X | W = V T Y ) . (11) [V ]∈Gr(r,n) As in Section 3.1, we can prove the following result. Theorem 3.4. There exists a solution to Problem (11). Proof. The proof is similar to the one in Appendix D, replacing J0 by J1 . Remark 3.5. The minimization of the log det divergence D`d (C? , CV ) has also been considered, being the data-free part of the Kullback-Leibler divergence. It has been ignored in the paper as it did not bring additional insights on the optimal construction of the reduced observations. 3.3 Mutual information maximization and entropy minimization In this section the Shannon entropy and the mutual information are introduced. The entropy H(Z) (sometimes denoted H(P (Z))) quantifies the uncertainty or the amount of information contained in a random variable Z ∼ P (Z) and is defined by H(Z) = EZ (− log(fZ (Z))). The mutual information I(Z0 , Z1 ) between the two random variables Z0 ∼ P0 (Z0 ) and Z1 ∼ P1 (Z1 ) is a measure of the information that Z0 contains about Z1 , and is defined by I(Z0 , Z1 ) = H(Z0 ) + H(Z1 ) − H(Z0 , Z1 ), where H(Z0 , Z1 ) is the entropy of the joint distribution of Z = (Z0 , Z1 ). From this definition, it is clear that the mutual information is symmetric. The new definition of the reduced basis, introduced in this section, is related to the definition of the mutual information. We would like the reduced observations W to contain as much information as possible about X. We therefore consider the following maximization problem max I(W, X). V ∈Rn×r ∗ Note that another expression of the mutual information is I(W, X) = EW (DKL (P (X | W ) k P (X))), 8 (12) showing that this strategy aims at maximizing the expected information gain between the prior and the posterior distributions of X. The optimization problem in Equation (12) admits a simple solution presented in Theorem 3.6. Moreover, we shall show that the maximization of the mutual information is equivalent to the minimization of the entropy of the posterior distribution P (X | W = V T y). Theorem 3.6. The following equalities hold   −1  1 I(W, X) = log det V T CY V V T CE V 2 1 q T and H(P (X | W = V y)) = −I(W, X) + log det CX + log(2πe). 2 2 As a consequence, the maximization of the mutual information I(W, X) and the minimization of the entropy of the posterior distribution H(P (X | W = V T y)) with respect to V admit the same solutions for any realization y of Y . We have the equality r 1X log λi , (13) max I(W, X) = 2 i=1 V ∈Rn×r ∗ where (λi )ri=1 are the r dominant eigenvalues of the following generalized eigenvector problem CY v = λCE v, λ ∈ R, v ∈ Rn . (14) A solution to the optimization Problem (13) is given by the matrix V with columns being eigenvectors (vi )ri=1 associated to the dominant eigenvalues of Problem (14). Proof. See Appendix F. Several remarks follow this result. First, the map J2 : V 7→ I(W, X) is also invariant under the transformation J2 (V M ) = J2 (V ) for any invertible matrix M ∈ GLr , and therefore the solution should be searched in the Grassmann manifold. However in the present case, a particular solution admits a simple characterization. The generalized eigenvalue problem in Equation (14) is used to define the optimal mean in [29] to minimize the Bayes risk. It is however unclear how this optimal mean is related to the mean defined in Equation (6). Note moreover that the computation of the optimal mean from [29] requires the inversion of the matrix CE , which is not needed in the presently developed approach. Another interesting feature of Theorem 3.6 is that it provides an a priori estimate for the reduction error, based on the mutual information, summarized in the following Corollary 3.7. Corollary 3.7. Let V ∈ Rn×r be a particuler solution to Problem (13) and W be the reduced model associated to V , and (λi )ni=1 be the eigenvalues associated to Problem (14) sorted in a decreasing order. Then, the relative error on the mutual information is given by Pr log λi I(Y, X) − I(W, X) = 1 − Pni=1 . I(Y, X) i=1 log λi 9 In fact, the entire spectrum of CY is not required to estimate the error. In practice, we only need to determine the eigenvalues νi associated to the following problem CA v = νCE v, ν ≥ 0, v ∈ Rn . (15) If λ is an eigenvalue associated to Problem (14), then ν = λ − 1 is an eigenvalue associated to Problem (15). Considering Problem (15) is beneficial in practice because CA is at most a rank-q matrix. This remark leads to the following important result on the number of required projections to get the same mutual information between the observations and the parameter of interest, for the full and the reduced model. Corollary 3.8. Let V ∈ Rn×r be a solution to Problem (13) and W be the reduced model associated to V , and (λi )ni=1 be the eigenvalues associated to Problem (14), sorted in a decreasing order. Let (νi )ni=1 be the eigenvalues associated to Problem (15) (i.e. λi = 1 + νi ), and let m ≤ q  n be the rank of B ∈ Rn×q (see Equation (1)). Then CA = BCX B T is a rank-m matrix, and the relative error on the mutual information is given by Pr log(1 + νi ) I(Y, X) − I(W, X) = 1 − Pi=1 . (16) m I(Y, X) i=1 log(1 + νi ) The condition r ≥ m implies that I(W, X) = I(Y, X) and the mutual informations between the observations and the parameter of interest are the same for the full and the reduced model. In particular, the condition is satisfied for m = q. As a side note, the principal component analysis of the observations Y yields a reduced basis defined as the dominant eigenvectors of CY . Therefore, the resulting reduced space is optimal with respect to the mutual information in the case of a white noise, i.e. CE = σ 2 In . However, denoting (χi )ni=1 the eigenvalues of CY sorted in a decreasing order, the corresponding estimate of the relative reduction error on the mutual information is given by  Pr χi I(Y, X) − I(W, X) i=1 log σ 2  = 1 − Pn χi . I(Y, X) i=1 log σ 2 Note that the usual error criteria used in the principal component analysis between the random variable Y and its rank-r truncated version Yr controls the L2 norm and is given by (see e.g. [6, Proposition 2.1])   2 Pr E kY − Yr k2 χ2   = 1 − Pni=1 2i . 2 i=1 χi E kY k 2 3.4 Numerical solution to the optimization problems For any functional J ∈ {J0 , J1 , J2 } involved in the optimization problems presented in Section 3, the following property holds J (V ) = J (V M ), ∀M ∈ GLr . As a consequence of this invariance, there exists an infinite number of solutions to the optimization problems and the Hessian of the functional ∇2 J is illconditioned in a neighbourhood of a solution. The main consequence is that 10 we cannot use a standard Newton algorithm to solve these nonlinear problems without regularizing the optimization problem first. In order to circumvent this issue, we consider here the restriction of the optimization problem to the Grassmann manifold Gr(r, n), replacing the search for a n×r matrix by the search of a r-dimensional linear subspace of Rn×n . In order to solve Problems (9) and (11) we choose to use a specific algorithm exploiting the smooth manifold structure of Gr(r, n), that is the Riemannian trust-region algorithm [1] implemented in the Pymanopt library [32]. The derivatives of the cost functions are computed by automatic differentiation with the autograd library [24]. Given a finite dimensional vector space V equipped with the inner product h·, ·iV and the associated norm k·kV , the trust-region algorithm consists in correcting the current iterate V ∈ V with W ∈ V using a quadratic approximation of the functional J . W is defined as the solution to min m(W ) = J (V ) + h∇J (V ), W iV + W ∈V 1 ∇2 J (V )W, W 2 V , such that kW k2V ≤ ∆2 , where ∇J (resp. ∇2 J ) is the gradient (resp. Hessian) of J . The trust-region radius ∆ is adapted at each iteration of the algorithm based on the quantity ρ= J (V ) − J (V + W ) . m(0) − m(W ) If ρ is close to 1, the quadratic approximation is good and the radius ∆ can be expanded. Otherwise, ∆ is shrinked. The Riemannian version of the algorithm consists in considering the tangent space to the manifold for the search space, which is locally mapped to the smooth manifold. Formally, let M be a smooth manifold equipped with the Riemannian metric h·, ·iM,V and the associated norm k·kM,V defined on the tangent space TV M to M at V . We denote by RV : TV M → M a retraction which is a first-order approximation of the exponential map that maps locally the tangent space to the manifold. The retraction is such that RV (0) = V . The correction is now defined as min W ∈TV M m(W ) = J (V ) + h∇J (V ), W iM,V + 1 ∇2 J (V )W, W 2 M,V , (17) such that kW k2M ≤ ∆2 , where ∇J (resp. ∇2 J ) is the Riemannian gradient (resp. Riemannian Hessian) of J . The correction that belongs to the tangent space is mapped to the manifold using the retraction, such that the new iterate is defined by RV (W ). The trust-region radius is now adapted according to the ratio J (V ) − J (RV (W )) ρ= . m(0) − m(W ) The quadratic subproblem presented in Equation (17) is solved with a truncated conjugate gradient method. We refer the reader to [1] for an exhaustive description and analysis of the algorithm as well as its application on the Grassmann manifold. 11 4 4.1 Application to Bayesian linear regression Inference problem The goal of this section is to illustrate the results of Section 3, and numerically assess the methods in the case of a Bayesian polynomial regression. Given a uniformly distributed sample (si )ni=1 in (−1, 1), we want to infer the random variable, X, from the following linear model Yi = q−1 X Tj (si )Xj + E(si ), ∀i ∈ {1, . . . , n}, (18) j=0 where Tj is the Chebyshev polynomial of the first kind [14] of order j and q = 30. The two moments of the prior distribution of X ∼ N (mX , CX ) are defined by (mX )i = −1 + 2 and 2 (CX )ij = σX  1+ √ 1200 |i − j| (q − 1)  i−1 q−1   √ |i − j| exp − 1200 , (q − 1) with σX = 1. Note that the covariance CX is a Matérn 3/2 covariance matrix, prescribing that polynomial coefficients associated to Chebyshev polynomials with distant degrees are less correlated than close ones. The noise E is a stationary Gaussian process with mean and covariance functions defined respectively by µE (s) = cos(4πs) and   |s − s0 | 2 2 kE (s, s0 ) = σE,1 exp − + σE,2 δ(s − s0 ), `E with σE,1 = 0.6, `E = 0.05, and σE,2 = 10−3 . The model presented in Equation (18) is equivalent to the linear model from Equation (1) with Bij = Tj−1 (si ). Figure 1 illustrates the data y used for the observations and the maximum a posteriori fit Bm? + mE . The rest of Section 4 is dedicated to the optimal estimation of the posterior distribution P (X | Y = y) using P (X | W = V T y), where V has been computed according to the criteria introduced in Section 3. 4.2 Numerical results We first consider three types of approaches for the computation of the reduced space V based on the principal component analysis. They are denoted PCA-A, PCA-Y and PCA-YN and are respectively computed as the dominant eigenvectors of the three following eigenvalue problems CA v = λv, CY v = λv −1 and CY CE v = λv. (19) PCA-A corresponds to the principal component analysis of A(X)= BX, PCA-Y to the analysis of Y , and PCA-YN to the analysis of Y using the Mahalanobis −1 distance, the metric induced by the inverse of the noise covariance CE . The 12 4 2 0 −2 Observations MAP estimate −4 −1 −0.8 −0.6 −0.4 −0.2 0 s 0.2 0.4 0.6 0.8 1 Figure 1: Comparison between the observations y and the MAP estimate Bm? + mE . latter has been successfully used in a Bayesian inference context in [13], where the metric is directly involved in the posterior distribution due to uniform priors. We denote by KLD (resp. EKLD, MI) the solutions obtained using the minimization of the Kullback-Leibler divergence (resp. minimization of the expected Kullback-Leibler divergence, maximization of the mutual information). For a particular realization y, we compute the Kullback-Leibler divergence between the posterior distribution P (X | W = V T y) and P (X | Y = y), and analyze its dependence on the dimension of the reduced space, r. The results are plotted in Figure 2 for the different dimensionality reduction methods. We conclude that the information theoretic based methods (KLD, EKLD, MI) with r = q dimensions yield the exact posterior distribution within machine accuracy, and outperform the PCA-based approaches. Given that we are measuring the error using the Kullback-Leibler divergence, the KLD method performs better than the others. We can however note that the EKLD and MI techniques are robust to the realization y. We will observe below that the PCA methods require a dimension of the order of the total number of observations, n, to achieve a similar accuracy. Figure 3 depicts the dependence the expected Kullback-Leibler divergence between the posterior distributions of the reduced and the full models on the dimension of the reduced spaces; plotted are results obtained using the different projection techniques. Similar to Figure 2, the information theoretic approaches converge to the posterior distribution with subspaces of dimension r = q, which is not the case for the PCA methods. We also note that even when the expected Kullback-Leibler divergence is used as error criterion, the EKLD method does not really improve the speed of convergence of the distributions compared to the other information theoretic approaches. Figure 4 illustrates the relative error with respect to the dimension of the reduced space between the mutual information of: • the observations and the parameter of interest, I(Y, X); and, • the projected observations and the parameter of interest. 13 Kullback-Leibler divergence (nat) 102 101 PCA-A PCA-Y PCA-YN KLD EKLD MI 100 10−1 10−2 0 10 20 30 40 Dimension of the reduced space 50 Expected Kullback-Leibler divergence (nat) Figure 2: Kullback-Leibler divergence versus the dimension of the reduced space for the different numerical methods. 102 101 PCA-A PCA-Y PCA-YN KLD EKLD MI 100 10−1 10−2 0 10 20 30 40 Dimension of the reduced space 50 Figure 3: Expected Kullback-Leibler divergence versus the dimension of the reduced space for the different numerical methods. 14 Relative error on the mutual information We are in fact looking at the criterion introduced in Corrolaries 3.7 and 3.8. We note that for r ≥ q = 30, all the information theoretic methods converge to the minimal value of the relative error. This behavior is predicted by Corollary 3.8 for the MI approach, as illustrated in the figure by the fact that the error estimator (16) overlaps with the error of the MI approach. Again, the PCA based methods perform poorly when compared to the information theoretic approaches. 100 PCA-A PCA-Y PCA-YN KLD EKLD MI Error estim. 10−1 10−2 10−3 0 10 20 30 40 Dimension of the reduced space 50 Figure 4: Relative error between the mutual information of the observations and the parameter of interest of the full model and the one of the reduced model and error estimator (16) versus the dimension of the reduced space for the different numerical methods. In Figure 5, the different divergences and the absolute error on the entropy with respect to the dimension of the reduced space are illustrated for the PCA-based methods for larger values of the dimension and compared to the MI approach. The absolute error on the entropy is equivalent to the error on the mutual information up to a constant according to Theorem 3.6. One can see that the dimension of the reduced space must be an order of magnitude larger compared to the MI technique to reach the same accuracy for all three convergence criteria. In Figure 6, the normalized singular values (σi /σ1 )ni=1 computed for the PCA methods are illustrated. The singular values are defined by p σi = λi , such that σ1 ≥ σ2 ≥ . . . ≥ σn , where (λi )ni=1 are the eigenvalues involved in Equation (19). It is shown that the spectrum resulting from the PCA-YN method decays faster than the other approaches. Moreover note that the eigenvalues involved in the MI approach (i.e. eigenvalues of Problem (14)) are strictly equal to the eigenvalues of the PCA-YN technique, see [13] for more details. For the last experiment, we only consider the PCA-Y and MI approaches. The convergence of the Kullback-Leibler divergence, the expected KullbackLeibler divergence, and the entropy with respect to the dimension of the reduced space is plotted in Figure 7 for the PCA-Y and MI methods using an even larger number of observations (n = 2000). For a dimension r = 30, the three quantities 15 Expected Kullback-Leibler divergence(nat)Kullback-Leibler divergence (nat) Absolute error on the entropy (nat) 102 PCA-A PCA-Y PCA-YN MI 101 100 10−1 10−2 0 100 200 300 102 400 500 PCA-A PCA-Y PCA-YN MI 101 100 10−1 10−2 0 100 200 102 300 400 500 PCA-A PCA-Y PCA-YN MI 101 100 10−1 10−2 0 100 200 300 400 Dimension of the reduced space 500 Figure 5: Kullback-Leibler divergence (top), expected Kullback-Leibler divergence (middle), and entropy (bottom) versus the dimension of the reduced space for PCA-A, PCA-Y, PCA-YN and MI methods. 16 100 σi /σ1 PCA-A PCA-Y PCA-YN 10−1 10−2 0 10 20 30 i 40 50 60 Figure 6: Normalized singular values for the PCA-A, PCA-Y, PCA-YN methods. of interest are null within machine precision for the MI method, whereas the PCA-Y approaches needs a dimension r = 700 to get a value of 10−2 nat. This highlights that the accuracy of the MI method is more related to the number of parameters (q = 30) than the number of observations (n = 500 in Figures 2, 3, and 4, and n = 2000 in Figure 7) as predicted by Corollary 3.8 for the relative error on the mutual information. 102 PCA-Y - Kullback-Leibler div. PCA-Y - Exp. Kullback-Leibler div. PCA-Y - Abs. error on the entropy MI - Kullback-Leibler div. MI - Exp. Kullback-Leibler div. MI - Abs. error on the entropy nat 101 100 10−1 10−2 0 100 200 300 400 500 600 Dimension of the reduced space 700 800 Figure 7: Kullback-Leibler divergence, expected Kullback-Leibler divergence, and the entropy for the PCA-Y and MI methods versus the dimension of the reduced space for a larger number of observations (n = 2000). 4.3 Summary We have seen that regarding the accuracy on the posterior, the KLD, EKLD, and MI approaches perform much better in terms of Kullback-Leibler divergence than the PCA approaches. On the other hand, in terms of computational efforts to evaluate the basis, the PCA methods and the MI technique only require the solution to an eigenvalue problem, whereas the others need more advanced strategies like the Riemannian optimization algorithm presented in Section 3.4. 17 The maximization of the mutual information therefore exhibits a good balance between posterior distribution accuracy and computational difficulty, further providing an a priori error estimate as well as an upper bound on the number of required projections. 5 Application to nonlinear problems We focused in the previous sections on the case of a linear problem where X, A(X) and E follow the multivariate normal distribution. In [13], we showed that when A is nonlinear and X is drawn according to a uniform distribution, the PCA-YN is an appropriate dimensionality reduction method. The reason is that the probability density function of the posterior distribution of X is 1 2 log fX (X | Y = y) = − ky − A(X)kC −1 + constant, E 2 and that the PCA-YN aims to approximate the random variable Y with respect to the Mahalanobis norm k·kC −1 . This illustrates that the appropriate E dimensionality reduction method depends on the statistical model used for the inference. In this section, we assess the benefits of the proposed approaches when the normality assumption is violated for A(X), specifically using a log-normal model. In particular, we numerically evaluate the robustness of the approach using two values of the variance of the underlying Gaussian random vector, i.e. a small variance yielding a model that could be well approximated with a Gaussian process, and a large variance where the Gaussian assumption no longer holds. The last example also involves dimensionality reduction in a large-scale data setting, where the number of observations is drastically reduced. 5.1 Inference problem For s ∈ (−1, 1)2 , let F be a centered stationary Gaussian process with covariance function given by ! 2 ks − s0 k 2 0 2 + σF,2 δ(s − s0 ). kF (s, s ) = σF,1 exp − 2`2F The nonlinear regression model of interest is based on the PCA of the random vector (F (si ))ni=1 , where (si )ni=1 is a uniformly distributed sample in (−1, 1)2 . Let CF be the covariance matrix of the random vector, and its eigenpairs (λi , wi )ni=1 ∈ (R+ × Rn )n ordered such that λ1 ≥ . . . ≥ λn . The nonlinear model of interest is then given by   q X Yi = exp  Bij Xj  + E(si ), where Bij = (wj )i . j=1 The prior distribution of X is deduced from the PCA of F . Given that F is a Gaussian process, X is chosen to follow the multivariate normal distribution N (0, CX ) such that (CX )ij = λi δij . The noise E is a centered Gaussian process independent of X and F with covariance function   ks − s0 k 0 2 2 kE (s, s ) = σE,1 exp − + σE,2 δ(s − s0 ). `E 18 The synthetic data y are generated using the nonlinear model Yei = exp (F (si )) + E(si ), ∀i ∈ {1, . . . , n}. We are therefore introducing a model error accounting for the truncation to q terms of the PCA-based expansion of F . In the applications below, the number of parameters is set to q = 20. Two different sets of values for the standard deviation parameters (σF,1 , σF,2 , σE,1 and σE,2 ) will be tested to control the nonlinearity of the mapping between the predictions and the observations. The correlation lengths are set to `F = 0.2 and `E = 0.05. Finally, we shall use n = 2, 000 observation points. 5.2 Computation of the bases and error estimation To compute the reduced bases, we rely on the expressions of the linear case which need the determination of the second moments of the nonlinear model A(X) = (Ai (X))ni=1 , where Ai (X) = exp((BX)i ). The analytical expressions of the mean mA = E(A(X)) and the covariances CA = E((A(X)−mA )(A(X)−mA )T ) and CAX = E((A(X) − mA )(X − mX )T ) are given by     1 1 Dii , (CA )ij = exp (Dii + Djj ) (exp (Dij ) − 1), (mA )i = exp 2 2 and (CAX )ij = (mA )i (BCX )ij , where D = BCX B T . To assess the reduction error, the Kullback-Leibler divergence and the mutual information are not available in closed form. Their accurate numerical estimation is challenging and would require prohibitive sampling of the posterior distributions, for instance using a Markov-Chain Monte Carlo method, and an estimation of the probability density function with inherent source of error. The situation is even more complicated for the expected Kullback-Leibler divergence, requiring a repetitive sampling of the posterior distribution for the estimation of only one value of this quantity. Therefore, we choose to characterize the reduction error by its impact on the MAP value of the parameter. The MAP is computed by solving max log fX (x | Y = y) ⇔ max log fY (y | X = x) + log fX (x), x x (20) for the full (unreduced) approach and, in the case of the reduced models, max log fX (x | W = V T y) ⇔ max log fW (V T y | X = x) + log fX (x). x x (21) These optimization problems are solved with a trust-region Newton method, using automatic differentiation for the evaluation of the gradient and the Hessian of the log density function. We denote by xMAP (resp. xMAP ) the MAP estimate of the full (resp. reV duced) model. Since xMAP is a stationary point of the log density function of the posterior distribution, the second-order Taylor expansion of fX (· | Y = y) is given by log fX (x | Y = y) ≈ log fX (xMAP | Y = y) 1 + (x − xMAP )T ∇2 log fX (xMAP | Y = y)(x − xMAP ). 2 19 Approximating locally the distribution by the multivariate normal distribution N (xMAP , C MAP ), where C MAP = −(∇2 log fX (xMAP | Y = y))−1 , gives the so-called Laplace approximation of the distribution [31]. Similarly, the posterior distribution of the reduced model will be approximated by the multivariate normal distribution N (xMAP , CVMAP ) where V CVMAP = −(∇2 log fX (xMAP | W = V T y))−1 . V In the following, we monitor the convergence of xMAP to xMAP with the V dimension of the reduced space, as well as the convergence of the Hessian (CVMAP )−1 to (C MAP )−1 in Frobenius norm. Note that it is empirically checked that the posterior distribution is unimodal by solving 200 times the Problems (20) and (21) with random initial guesses drawn according to the prior distribution. We denote by  and H the (Ye -averaged) relative errors on the MAP and Hessian, respectively defined by   −1 −1  MAP EYe CVMAP − C MAP − x EYe xMAP V  Fro .  and H = = −1 EYe (kxMAP k) MAP EYe (C ) Fro (22) The expectations appearing in the errors  and H are estimated by a crude Monte-Carlo method with a sample of size 70. This low sample size was found enough to obtain sufficiently correct error estimates, reflecting the robustness of all approaches which exhibit moderate dependences of the reduction error with the particular realization of Ye . 5.3 Weak nonlinearity In this section, the case of a weak nonlinearity is considered, setting the standard deviations to σF,1 = 0.3, σF,2 = 0.001, σE,1 = 0.1, and σE,2 = 0.001. The error estimates  and H introduced in Equation (22) are plotted in Figure 8 against the dimension of the reduced space. First, we observe that all the methods converge in terms of  or H . All the principal component analysis based approaches perform poorly compared to the information theoretic techniques introduced here, with more than one order of magnitude difference when considering a reduced space of dimension 100. As a consequence, the normality assumption for the computation of the reduced basis is shown to improve the quality of the posterior distribution even when the statistical model does not have a Gaussian structure anymore. It is interesting to note that the maximization of the mutual information (MI method) yields a basis that performs slightly better than the KLD or the EKLD approaches regarding the error on the MAP parameter . The difference is less significant when considering the error on the Hessian H but the information theoretic methods converges faster than the principal component analysis based approaches which tend to stagnate. 20 100 10−1  PCA-A PCA-Y PCA-YN KLD EKLD MI 10−2 10−3 0 20 40 60 80 Dimension of the reduced space 100 100 10−1 H PCA-A PCA-Y PCA-YN KLD EKLD MI 10−2 10−3 0 20 40 60 80 Dimension of the reduced space 100 Figure 8: Error  and H versus the dimension of the reduced space for the case of a weak nonlinearity. 21 A comparison between the MAP estimates of the field, A(xMAP ) and A(xMAP ), V e for the same sample y of Y and the PCA-Y and MI methods is provided in Figure 9 for the reduction with r = 60. The plots highlight the better approximation for the MI method. PCA-Y MI 1 0.5 0.5 0 0 s0 s0 1 −0.5 −0.5 −1 −1 −1 −0.5 0 s 0.5 −1 1 −0.5 0 s 0.5 1 ) (solid lines) for Figure 9: Contour plot of A(xMAP ) (dashed lines) and A(xMAP V the PCA-Y (left) and the MI (right) methods with a dimension of the reduced space r = 60. 5.4 Strong nonlinearity A strong nonlinearity is considered by considerably increasing σF,1 and σE,1 compared to Section 5.3. The standard deviations are now set to σF,1 = 1.5 and σE,1 = 0.6, while σF,2 and σE,2 are identically set to 0.001. We expect now that the Gaussian assumption to be less useful than in Section 5.3. Figure 10 depicts the convergence of the error estimators  and H with respect to the dimension of the reduced space for the different methods. In contrast to Section 5.3, all the approaches exhibit a similar convergence in terms of the error criteria  and H . Note that the PCA-Y method performs slightly better, especially for the error on the Hessian matrix. One major difference with the previous convergence curves reported previously in Figure 8 is the larger dimension of the reduced space needed to achieve a given relative error. Indeed, the dimension of the reduced space varies from 1 to 100 in Figure 8 and from 1 to 1000 in Figure 10. It indicates that a larger amount of observations is required to identify the posterior distribution of the model parameters, with similar relative accuracy, because of the non-linearities. Even if the normality assumption is violated, the information theoretic approaches are shown to be robust and converge to the original posterior distribution at the same rate as the PCA based methods. The estimates A(xMAP ) and A(xMAP ) of the field are compared in Figure 11 V for the PCA-Y and MI methods and dimension r = 400 and the same sample of Ye . It confirms that for this highly non-linear case and this dimension of the reduced space, the two reduction approaches yield similar accuracy. 22 100  PCA-A PCA-Y PCA-YN KLD EKLD MI 10−1 10−2 0 200 400 600 800 Dimension of the reduced space 1,000 100 10−1 H PCA-A PCA-Y PCA-YN KLD EKLD MI 10−2 10−3 0 200 400 600 800 Dimension of the reduced space 1,000 Figure 10: Error estimates versus the dimension of the reduced space for the case of a strong nonlinearity. PCA-Y MI 0.2 0 0 s0 s0 0.2 −0.2 −0.2 −0.4 −0.4 −0.5 0 s −0.5 0.5 0 s 0.5 Figure 11: Contour plot of A(xMAP ) (dashed lines) and A(xMAP ) (solid lines) for V the PCA-Y (left) and the MI (right) methods with a dimension of the reduced space r = 400. 23 5.5 Large-scale problem The objective of this section is to demonstrate the feasibility, robustness and efficiency of the proposed information-based reduction method in the context of large-scale simulations and large-dimensional observations. To this end, we consider the problem of identifying three values κΩ1,2,3 associated with the three subdomains, Ω1,2,3 , of the two-dimensional domain Ω depicted in the left plot of Figure 12. These κΩj are independent and follow a log-normal distribution with parameters µκ , σκ . They are therefore expressed as Xj ∼ N (0, 1). κΩj = exp [µκ + σκ Xj ] , Thus, the vector of parameters to be inferred is X ∈ Rq , q = 3. For simplicity, but without loss of generality, we shall use hereafter µκ = 0 and σκ = 1. The inference uses a large set of n ≈ 32, 000 observations Yi modeled as Yi = Ai (X) + Ei , (23) where Ai (X) := U (xi ) is the solution at the observation point xi ∈ Ω of the elliptic partial differential equation with uncertain parameters κΩj : ∇ · (κ(x)∇U (x)) = −1, κ(x ∈ Ωj ) = κΩj . The model equation is equipped with homogeneous Dirichlet (resp. Neumann) boundary conditions on the vertical and horizontal (resp. oblique) boundaries of Ω. The model for the Ei is again the independent centered Gaussian model with variance σ2 . Ω2 Ω1 Ω3 Ω2 Ω3 Ω2 Ω1 Ω3 Ω1 Figure 12: Left plot: Schematic of the problem domain (contained in a 3 × 3 square) and its three subdomains, Ωj , over which κ = κj is constant. Centre plots: centroids location for 20 and 100 clusters. Right plot: observation points xi . For the reduction, we consider the maximization of the mutual information (MI), requiring the solution of (15). Since CE is diagonal, the reduced basis is given by the dominant eigenspace of CA . Different approaches can be used to estimate CA . Here, we rely on a Polynomial Chaos (PC) method [21], exploiting the low dimensionality of X, and a standard, second-order finite element method for the spatial discretization of the elliptic problem on a very fine mesh. As expected from the low dimensionality of X, the decay of the spectrum of CA is very fast. In Figure 13 we plot the first five dominant modes of CA using the observation points shown in the right plot of Figure 12. Note that these observation points cover well the entire domain Ω. 24 Figure 13: The five leading reduced modes (from left to right) of the MI method plotted against the n ≈ 32, 000 observation points shown in the right plot of Figure 12. For comparison purposes, we also consider more reduction approaches based on observation clustering. Indeed, the amount of observations (n ≈ 32, 000) appears an overkill to learn just q = 3 parameters. It is consequently tempting to disregard some observations and retain only k > 0 of them to carry the inference. However, we want to maintain a sufficient coverage of the domain, and so we rely on a clustering method (k-means [16, 23]) to partition the observations set into k > 0 distinct subsets, minimizing the Euclidean distances between the xi and their respective cluster’s centroids. The k-means procedure randomly generates clusters with a roughly equal number of observations. In each cluster, the position xi of the selected observation is the one closest to the corresponding cluster centroid. Two examples of selected observation points are depicted in the two center plots of Figure 12, for k = 20 and 100 clusters respectively. We shall refer to this reduction approach as “Centroids.” Disregarding all observations but the k-th closest to the centroids is clearly a brutal reduction approach, which is more susceptible to be affected by the noise compared to an approach involving the projection of all observations. Consequently, one may prefer to average (with equal weight) all the observations belonging to a cluster to define the corresponding reduced observation. This approach is referred to Cluster Averages (CAv) in the following. The MI, Centroids and CAv reduction approaches are compared for three noise levels. The measurements yi are randomly generated from (23) and plotted in Figure 14 to appreciate the noise to signal ratio. Figure 14: Measurements yi for noise level σ = 0.01, 0.1 and 0.5 from left to right. To quantify the reduction errors, we consider as before the distance to the 25 unreduced MAP point and Hessian: xMAP − xMAP V ˆ(y) = kxMAP k CVMAP and ˆH (y) = −1 − C MAP −1 Fro −1 . (C MAP ) Fro Note that we do not average over random observations Y , and restrict the analysis to a unique measurement y, because of the involved computational times. The convergence of the errors ˆ(y) and ˆH (y) with the dimension of the reduced spaces is reported in Figure 15, for the three approaches and the highest noise level (σ ). It is seen that the MI reduction converges for roughly 10 reduced modes, and outperforms the cluster-based reduction methods that converges at a much lower rate. As one may have expected, the convergence of the errors in the cluster-based methods is also noisier than in MI, with Centroids exhibiting higher sensitivity to noise than CAv. 10−4 10−1 ˆH (y) ˆ(y) 10−1 10−4 MI Centroids CAv 10−7 MI Centroids CAv 10−7 0 20 40 60 80 100 Dimension of the reduced space 0 20 40 60 80 100 Dimension of the reduced space Figure 15: Convergence with the reduction dimension of the MI, Centroids and Cluster Averages errors on MAP (ˆ (y), left) and Hessian (ˆ H (y), right). Case of high noise level σ = 0.5. However, the slow convergence of the cluster-based methods is due to the large noise in the previous example. This can be appreciated form the results reported in Figure 16, which show that ˆ and ˆH decrease with the noise level in the CAv method, but that the convergence rate remains the same. Also note that the convergence rate of the MI method appears to be insensitive to the noise level. 5.6 Summary The numerical experiments of Sections 5.3–5.5 suggest that the information theoretic approaches yield robust reductions even though they were developed for linear Gaussian models. We have shown in particular that they perform better then the PCA-based approaches, except in the strongly nonlinear case where all approaches behave similarly. Moreover, the solution to the maximization of the mutual information is significantly simpler to compute than in the KLD and EKLD techniques. Indeed, it only requires the solution of an eigenvalue problem and has therefore a computational complexity similar to the computation of the principal component analysis. Moreover, the proposed approaches are robust to model errors as illustrated in Section 5.5. Indeed, even if we truncate the PCA-based expansion of the 26 100 ˆH (y) ˆ(y) 100 10−4 10−4 σE = 0.01 σE = 0.1 σE = 0.5 σE = 0.01 σE = 0.1 σE = 0.5 10−8 10−8 0 50 100 Dimension of the reduced space 0 50 100 Dimension of the reduced space Figure 16: Convergence with the reduction dimension of the MI (solid lines) and CAv (dashed lines) MAP errors (ˆ (y), left) and Hessian errors (ˆ H (y), right). Plotted are the errors for different noise intensities as indicated. Gaussian process, F , the information theoretic reduction methods provide the lowest errors on the posterior distribution approximation. 6 6.1 Conclusions and perspectives Conclusions Different optimal reductions of observations by projection in a Bayesian framework are investigated in this work. The proposed methods are optimal in an information theoretic sense and aim at conserving the information about the posterior distribution of interest for Gaussian linear models with correlated additive noise. Three optimization problems are proposed. First, the Kullback-Leibler divergence between the posterior distribution of the full and the reduced models is minimized. This corresponds to an a posteriori approach in the sense that a realization of the observations (a measurement) is required to compute the optimal projection. Second, we consider the minimization of the expected value of the previous Kullback-Leibler divergence, where the expectation is taken with respect to the observations. As a consequence, no measurement is required to compute the optimal reduced space and this strategy yields an a priori technique. The last proposed approach is the maximization of the mutual information between the projected observations and the parameters of interest. This last approach is equivalent to the minimization of the entropy of the posterior distribution. Solving the first two optimization problems requires specific numerical algorithms. We use in this work the Riemannian trust-region algorithm on a manifold that take into account the invariance of the problems. In contrast, the mutual information maximization only requires the solution to a generalized eigenvalue problem. The computational cost and efficiency of the Riemannian algorithms will be addressed in a future work when large scale model will be considered. Regarding the resulting posterior distributions, the three approaches are similar in terms of (possibly expected) Kullback-Leibler divergence and mutual information, and perform much better, on the considered examples, than the 27 methods based on the principal component analysis of the observations. We advocate therefore that the mutual information maximization is the most appropriate approach for the determination of the optimal observation projection, given the balance between accuracy and computational complexity. For this particular approach, an a priori error estimate on the mutual information loss is readily available as well as a bound on the number of required projections. It is shown that no more projections than the rank of the linear model are required, which is in particular lower than the number of parameters to be inferred. Moreover, we addressed the linear Gaussian case in this work. However, the proposed approaches only require the first two moments of the distributions and have been successfully applied to nonlinear non-Gaussian examples, in which optimality is no longer ensured. 6.2 Perspectives In future works, the method will be applied to extreme hydrological flow problems (e.g. [13, 30]). In particular, we plan to apply the approach to the framework of Ensemble Kalman filters (EnKF) [11] for large datasets. The EnKF is a recursive Bayesian estimation technique for dynamical models of the form X (k+1) = HX (k) + L(k) , Y (k+1) = BX (k+1) + E (k) , where X (0) , L(k) , and E (k) are independent Gaussian vectors. Note that the equation above is the same as (1). To estimate the posterior distribution of X (k+1) , the Kalman filter requires the inversion of the covariance matrix CY (k+1) at each iteration of the discrete dynamical system. However, in the EnKF, CX (k+1) is estimated using a Monte-Carlo estimator with a sample size that can be much lower than the total number of observations n. As a consequence, the covariance of the forward state X (k+1) is low-rank and we showed in this paper that a low number of projections of the observations are enough to recover the mutual information between the estimated distribution of the state X (k+1) and the observations Y (k+1) . Additional challenges arise when the datasets are high dimensional. Considering the mutual information based technique, the problem could be first tackled using high performance computing. Given that we a priori know an upper bound on the number of projections that is already low, we only need an efficient matrix product computation (e.g. [10]) to implement the algorithm from [1]. Further developments are required to appropriately use these approaches in a streaming environment. Acknowledgments This work is supported by King Abdullah University of Science and Technology Awards CRG3-2156 and OSR-2016-RPP-3268. A Proof of Proposition 2.1 According to Bayes’ theorem, the posterior distribution is such that fX (x | Y = y) ∝ fY (y | X = x)fX (x), 28 or equivalently, log fX (x | Y = y) = log fY (y | X = x) + log fX (x) + k0 1 T −1 (y − Bx − mE ) CE =− (y − Bx − mE ) 2  T −1 + (x − mX ) CX (x − mX ) + k1 , where k0 and k1 are constants. Because the log probability density function is quadratic with respect to x, we conclude that the posterior distribution is also a multivariate normal distribution, i.e. P (X | Y = y) ∼ N (m? , C? ). This implies that, up to a constant k2 , the following equality holds  1 T (x − m? ) C?−1 (x − m? ) + k2 . log fX (x | Y = y) = − 2 Identifying the quadratic terms in x and using the Woodbury matrix identity [18, Equation (29)] gives  −1 −1 −1 −1 −1 T C?−1 = CX + B T CE B = CX CX + CAX CE CAX CX −1 T and C? = CX − CX B T CE + BCX B T BCX = CX − CAX CY−1 CAX . Identifying the linear term w.r.t. x yields −1 −1 C?−1 m? = CX mX + B T CE (y − mE ) −1 −1 −1 = B T CE (y − mY ) + B T CE mA + CX mX . We finally have m? = G? (y − mY ) + h? , with −1 −1 T T G? = C? B T CE = CAX (I − CY−1 CA )CE = CAX CY−1 , −1 h? = C? CX mX + G? mA . For the posterior distribution of the reduced model, we substitute (y − mY ), CY , mE , CE , mA , CAX , and CA respectively by V T (y − mY ), V T CY V , V T mE , V T CE V , V T mA , V T CAX , and V T CA V in the full model. The fact that V is full-rank ensures that V T CY V , V T CE V and T CX + CAX V (V T CE V )−1 V T CAX are symmetric positive definite matrices and hence are invertible. B Proof of Proposition 2.2 For M ∈ GLr we have CAX V M (M T V T CE V M )−1 M T V T CAX = CAX V (V T CE V )−1 V T CAX , so we deduce that CV M = CV . Moreover, given that T T GV M = CAX V M (M T V T CY V M )−1 = CAX V (V T CY V )−1 M −T = GV M −T , we conclude that GV M (V M )T = GV V T , hV M = hV and finally mV M = mV . 29 C Proof of Proposition 3.1 Using the definition of the Kullback-Leibler divergence (7), we have 1 DKL (P (Z0 ) k P (Z1 )) = EZ log det(C1 ) 2 1 det(C0 ) 2 !  1 1 T T − (Z − m0 ) C0−1 (Z − m0 ) + (Z − m1 ) C1−1 (Z − m1 ) . 2 2 Given that Z ∼ P (Z0 ), we deduce that      T T EZ (Z − m0 ) C0−1 (Z − m0 ) = EZ tr (Z − m0 ) C0−1 (Z − m0 ) (24) = tr(EZ ((Z − m0 )(Z − m0 )T )C0−1 ) = tr(C0 C0−1 ) = q. Moreover we have   T EZ (Z − m1 ) C1−1 (Z − m1 ) = EZ ((Z − m0 + m0 − m1 )T C1−1 (Z − m0 + m0 − m1 ))  T T = EZ (Z − m0 ) C1−1 (Z − m0 ) + (m0 − m1 ) C1−1 (m0 − m1 )  T +2 (Z − m0 ) C1−1 (m0 − m1 ) . Using the same trace technique as in Equation 24, and using the fact that EZ (Z) = m0 , the term EZ ((Z − m1 )T C1−1 (Z − m1 )) is equal to    T T EZ (Z − m1 ) C1−1 (Z − m1 ) = tr C0 C1−1 + (m0 − m1 ) C1−1 (m0 − m1 ) , yielding the final result DKL (P (Z0 ) k P (Z1 )) =    1 T tr C0 C1−1 − log det C0 C1−1 − q + (m0 − m1 ) C1−1 (m0 − m1 ) . 2 D Proof of Theorem 3.2 First, the map J0 is smooth (∈ C ∞ ) as the sum and composition of smooth functions, noting that the determinant is always strictly positive. Let π : Rn×r → Gr(r, n) denotes the canonical projection defined by π(V ) = ∗ [V ]. Let K0 : Gr(r, n) → R be the map defined by J0 (V ) = K0 ◦ π(V ). K0 is in fact the functional we are minimizing in Problem (9). According to [3, Proposition 3.4.5], the smoothness of J0 implies that K0 is smooth and in particular continuous. According to [25, Lemma 5.1] Gr(r, n) is compact, the extreme value theorem concludes the proof. 30 E Proof of Proposition 3.3 Since only m? and mV depend on Y in Equation (8), the expected KullbackLeibler divergence admits the form  EY DKL P (X | Y ) k P (X | W = V T Y ) = 1 (D`d (C? , CV ) + EY (DCV (m? , mV ))) . 2 Note that m? = G? (Y − mY ) + h? and mV = GV V T (Y − mY ) + hV , hence m? − mV = (G? − GV V T )(Y − mY ) + (h? − hV ), and EY (DCV (m? , mV )) =   T  + (h? − hV )CV−1 (h? − hV ), tr CV−1 G? − GV V T CY G? − GV V T which yields the final result. F Proof of Theorem 3.6 For a normally distributed Rn -valued random variable Z ∼ N (mZ , CZ ), the entropy H(Z) is given by H(Z) = 1 n log(det(CZ )) + log(2πe). 2 2 Given that X and W are normally distributed, we immediatly deduce 1 q log(det(CX )) + log(2πe), 2 2 1 r and H(W ) = log(det(V T CY V )) + log(2πe). 2 2 H(X) = In order to compute the joint-entropy H(W, X), we need to characterize the covariance of (W, X). Note that we already know that (W, X) is drawn according to a Gaussian distribution. In order to obtain the covariance C(W,X) , we identify the quadratic terms in the following equality between the probability density functions: log f(W,X) (W, X) = log fW (W | X) + log fX (X), where the likelihood fW (W | X) is directly deduced from Equation (2). The conditional random distribution P (W | X) follows the Gaussian distribution N (V T (AX + mE ), V T CE V ). Identifying the quadratic terms yields ! −1 −1 T V T CE V − V T CE V V A −1 −1 −1 T C(W,X) = . −1 −AT V V T CE V CX + AT V V T C E V V A −1 According to [27, Section 9.1.2], the determinant of the precision matrix C(W,X) is given by    −1   −1 −1 det C(W,X) = det V T CE V det CX . 31 We immediatly have 1 r+q log det(C(W,X) ) + log(2πe) 2 2 1 r+q −1 = − log det(C(W,X) )+ log(2πe) 2 2   −1  r + q 1 −1 log det CX =− + log det V T CE V + log(2πe), 2 2 H(W, X) = and the mutual information reduces to   −1  1 I(W, X) = log det V T CY V + log det V T CE V 2   −1  1 = log det V T CY V V T CE V , 2 which proves the first equality. Regarding the entropy of the posterior distribution, we know that P (X | W = V T y) ∼ N (mV , CV ), yielding H(P (X | W = V T y)) = q 1 log det(CV ) + log(2πe), 2 2 and the entropy does not depend on the realization y of Y . Using Equation (5), we have log det (CV )  1  1 1 1 −1 T = log det CX2 (I − CX2 B T V V T CY V V BCX2 )CX2   1 1 −1 T = log det I − CX2 B T V V T CY V V BCX2 + log det CX   = log det V T CY V − V T BCX B T V − log det V T CY V + log det CX . The last equality is obtained using the identity det(I + M N ) = det(I + N M ), 1/2 with M = (V T CY V )−1/2 V T BCX and N = M T and factorizing the resulting expression by (V T CY V )−1/2 on the left and right in the determinant. We finally find that log det (CV )   = log det V T CY V − V T CA V − log det V T CY V + log det CX   = log det V T CE V − log det V T CY V + log det CX   −1  = log det CX − log det V T CY V V T CE V , and the entropy is H(P (X | W = V T y)) =   −1  1 q 1 + log det(CX ) + log(2πe), − log det V T CY V V T CE V 2 2 2 that proves the second equality. For the last part of the proof, we consider the maximization problem   −1  max log det V T CY V V T CE V = max 2 I (W, X) . (25) n×r V ∈Rn×r ∗ V ∈R∗ 32 1 First let us introduce a change of variable, setting U = CE2 V . The optimization problem becomes   −1  −1 −1 max det U T CE 2 CY CE 2 U U T U . U ∈Rn×r ∗ Then, the quantity K(U ) = det((U T CY U )(U T U )−1 ) is invariant under any invertible linear transformation on the right, meaning that K(U ) = K(U Q) for any Q ∈ Rr×r invertible. With St(r, n) denoting the Stiefel manifold defined by St(r, n) = {M ∈ Rn×r ; M T M = Ir }, there exists a matrix Û ∈ St(r, n) such that K(U ) = K(Û ). Such a matrix Û can be computed using, for instance, a thin QR factorization. We can therefore consider the following equivalent optimization problem   −1 −1 (26) max det U T CE 2 CY CE 2 U . U ∈St(r,n) In order to conclude the proof, we need the following result. Lemma F.1. Let K ∈ Rn×n be a symmetric positive definite matrix with eigenvalues (λi )ni=1 in a decreasing order. Then we have max U ∈St(r,n) r  X log det U T KU = log λi . (27) i=1 Moreover, any solution to the optimization Problem (27) is an invariant subspace of K and a particular solution is given by the matrix U whose columns are the eigenvectors of K associated to the eigenvalues (λi )ri=1 . Proof. First, a solution to Problem (27) exists using the fact that F : U 7→ log det(U T KU ) is continuous and St(r, n) is compact. It is closed as the inverse image of {0} by the continuous function U 7→ U T U − I, and bounded because kU k2Fro = r for all U ∈ St(r, n). The extreme value theorem implies the existence of a maximizer. Let us introduce the map H : Rn×r × Rr×r → R be defined by   H (U, Ψ) = 2 tr U T U − I Ψ , and consider the Lagrangian function L (U, Ψ) = F (U ) + H (U, Ψ) associated to the constrained optimization Problem (27). An optimal solution (U? , Ψ? ) satisfies the equation DU L (U? , Ψ? )[δU ] = 0, ∀δU ∈ Rn×r , where DU L (U? , Ψ? )[δU ] denotes the Gâteaux derivative of the Lagrangian L at U? in the direction δU with respect to the first parameter. Given the formula   d −1 log det (U + tδU ) = 2 tr (U + tδU ) δU , dt we conclude that the Gâteaux derivative DU F (U )[δU ] is   −1 T DU F (U )[δU ] = 2 tr U T KU U KδU , 33 and similarly we have DU H (U )[δU ] = 2 tr((Ψ? + ΨT? )U T δU ). Hence, for all δU ∈ Rn×r , a solution U? to Problem (27) satisfies    −1 T DU L (U? , Ψ? )[δU ] = 2 tr U?T KU? U? K + (Ψ? + ΨT? )U?T δU = 0. The result holding for all δU , we conclude that U? satisfies U?T KU? −1 U?T K + (Ψ? + ΨT? )U?T = 0 KU? = −U? (Ψ? + ΨT? )U?T KU? . ⇔ Finally, multiplying this last equation on the left by U?T and on the right by (U?T KU? )−1 gives that Ψ? + ΨT? = −Ir and KU? = U? U?T KU? , meaning that U? spans an r-dimensional invariant subspace of K. To conclude the proof, let U be the r-dimensional subspace spanned by the columns of U? , i.e. U = range U? , and consider K as a linear map on Rn . K being diagonalizable, the restriction K|U of K to its invariant subspace U is also diagonalizable. Hence there exists an orthonormal basis of U formed of eigenvectors of K|U and therefore of eigenvectors of K. Given the invariance F (U Q) = F (U ) for every orthogonal matrix Q ∈ Rr×r , we can arbitrary set the columns of U? to be eigenvectors of K. As a consequence, the determinant is X log det(U?T KU? ) = log λi , i∈I where I is a subset of {1, . . . , n} such that #I = r. The sum is maximized by picking the r largest eigenvalues (λi )ri=1 , and therefore a solution U? is given by a matrix whose columns corresponds to r eigenvectors associated to the dominant eigenvalues. −1 −1 Since CE 2 CY CE 2 is symmetric positive definite, Lemma F.1 gives first that a solution to Problem (26) is given by the matrix U whose columns are the −1 −1 −1 dominant eigenvectors of CE 2 CY CE 2 . Using the equality V = CE 2 U , we finally find that a solution to Problem (27) is given by the matrix V whose columns are r dominant eigenvectors associated to the generalized eigenvalue problem CY v = λCE v, λ ∈ R, v ∈ Rn . References [1] P.-A. Absil, C.G. Baker, and K.A. Gallivan. Trust-region methods on Riemannian manifolds. Foundations of Computational Mathematics, 7(3):303– 330, 2007. 34 [2] P.-A. Absil, R. Mahony, and R. Sepulchre. Riemannian geometry of Grassmann manifolds with a view on algorithmic computation. Acta Applicandae Mathematica, 80(2):199–220, Jan 2004. [3] P.-A. Absil, R. Mahony, and R. Sepulchre. Optimization algorithms on matrix manifolds. Princeton University Press, 2009. [4] M. Barrault, Y. Maday, N. Cuong Nguyen, and A. T. Patera. An ‘empirical interpolation’ method: application to efficient reduced-basis discretization of partial differential equations. Comptes Rendus Mathematique, 339(9):667 – 672, 2004. [5] M. Bebendorf. Approximation of boundary element matrices. Numerische Mathematik, 86(4):565–589, Oct 2000. [6] M. Bebendorf, Y. Maday, and B. Stamm. Comparison of Some Reduced Representation Approximations, chapter 3, pages 67–100. Springer International Publishing, Cham, 2014. [7] K. P. Burnham and D. R. Anderson. Model selection and multimodel inference: a practical information-theoretic approach. Springer Science & Business Media, 2003. [8] P. Chen, A. Quarteroni, and G. Rozza. A weighted empirical interpolation method: a priori convergence analysis and applications. ESAIM: Mathematical Modelling and Numerical Analysis, 48(4):943–953, 2014. [9] T. Cui, J. Martin, Y. M. Marzouk, A. Solonen, and A. Spantini. Likelihoodinformed dimension reduction for nonlinear inverse problems. Inverse Problems, 29:114015, 2014. [10] P. Drineas, R. Kannan, and M. W. Mahoney. Fast Monte Carlo Algorithms for Matrices I: Approximating Matrix Multiplication. SIAM Journal on Computing, 36(1):132–157, jan 2006. [11] G. Evensen. Sequential data assimilation with a nonlinear quasi-geostrophic model using Monte Carlo methods to forecast error statistics. Journal of Geophysical Research, 99(C5):10143, may 1994. [12] L. N. Geppert, K. Ickstadt, A. Munteanu, J. Quedenfeld, and C. Sohler. Random projections for bayesian regression. Statistics and Computing, 27(1):79–101, Jan 2017. [13] L. Giraldi, O. P. Le Maître, K. T. Mandli, C. N. Dawson, I. Hoteit, and O. M. Knio. Bayesian inference of earthquake parameters from buoy data using a polynomial chaos-based surrogate. Computational Geosciences, 21(4):683–699, Aug 2017. [14] I. S. Gradshteyn and I. M. Ryzhik. Table of Integrals, Series, and Products. Elsevier, eight edition edition, 2014. [15] W. Hackbusch. Tensor Spaces and Numerical Tensor Calculus, volume 42 of Springer Series in Computational Mathematics. Springer-Verlag Berlin Heidelberg, 2012. 35 [16] J. A. Hartigan and M. A. Wong. Algorithm AS 136: A k-means clustering algorithm. Journal of the Royal Statistical Society. Series C (Applied Statistics), 28(1):100–108, 1979. [17] H. Hotelling. Analysis of a complex of statistical variables with principal components. Journal of Educational Psychology, 24:417–441, 1933. [18] A. S. Householder. A survey of some closed methods for inverting matrices. Journal of the Society for Industrial and Applied Mathematics, 5(3):155– 169, 1957. [19] I. T. Jolliffe. Principal Component Analysis. Springer, 2002. [20] K. Karhunen. Über lineare methoden in der wahrscheinlichkeitsrechnung. Annales Academiæ Scientiarum Fennicæ Series A1, Mathematical Physics 37, 37:1–79, 1947. [21] O. P. Le Maître and O. M. Knio. Spectral Methods for Uncertainty Quantification: With Applications to Computational Fluid Dynamics. Springer, 1st editio edition, 2010. [22] M. Loève. Fonctions aléatoires du second ordre. Processus stochastiques et mouvement Brownien, 1948. [23] J. Mac Queen. Some methods for classification and analysis of multivariate observations. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Statistics, pages 281–297, Berkeley, Calif., 1967. University of California Press. [24] D. Maclaurin, D. Duvenaud, M. Johnson, and R. P. Adams. Autograd: Reverse-mode differentiation of native Python, 2017. [25] J. W. Milnor and J. D. Stasheff. Characteristic Classes, volume 76 of Ann. of Math. Stud. Princeton Univ. Press, Princeton, NJ, 1974. [26] K. Pearson. Liii. on lines and planes of closest fit to systems of points in space. Philosophical Magazine, 2(11):559–572, 1901. [27] K. B. Petersen and M. S. Pedersen. The matrix cookbook, nov 2012. Version 20121115. [28] A. Spantini, T. Cui, K. Willcox, L. Tenorio, and Y. M. Marzouk. Goaloriented optimal approximations of bayesian linear inverse problems. SIAM Journal on Scientific Computing, in press, 2017. [29] A. Spantini, A. Solonen, T. Cui, J. Martin, L. Tenorio, and Y. Marzouk. Optimal low-rank approximations of bayesian linear inverse problems. SIAM Journal on Scientific Computing, 37(6):A2451–A2487, 2015. [30] I. Sraj, K. T. Mandli, O. M. Knio, C. N. Dawson, and I. Hoteit. Uncertainty quantification and inference of manning’s friction coefficients using dart buoy data during the tōhoku tsunami. Ocean Modelling, 83:82 – 97, 2014. [31] L. Tierney and J. B. Kadane. Accurate approximations for posterior moments and marginal densities. Journal of the american statistical association, 81(393):82–86, 1986. 36 [32] J. Townsend, N. Koep, and S. Weichwald. Pymanopt: A Python toolbox for optimization on manifolds using automatic differentiation. Journal of Machine Learning Research, 17(137):1–5, 2016. 37
10math.ST
System-Aware Compression Yehuda Dar, Michael Elad, and Alfred M. Bruckstein arXiv:1801.04853v1 [cs.IT] 15 Jan 2018 Computer Science Department, Technion – Israel Institute of Technology {ydar,elad,freddy}@cs.technion.ac.il Abstract—Many information systems employ lossy compression as a crucial intermediate stage among other processing components. While the important distortion is defined by the system’s input and output signals, the compression usually ignores the system structure, therefore, leading to an overall suboptimal rate-distortion performance. In this paper we propose a compression methodology for an operational rate-distortion optimization considering a known system layout, modeled using linear operators and noise. Using the alternating direction method of multipliers (ADMM) technique, we show that the design of the new globally-optimized compression reduces to a standard compression of a ”system adjusted” signal. We further explain the main ideas of our method by theoretically studying the case of a cyclo-stationary Gaussian signal. We present experimental results for coding of one-dimensional signals and for video compression using the HEVC standard, showing significant gains by the adjustment to an acquisition-rendering system. I. I NTRODUCTION Lossy compression has a central role in information systems where the data may be inaccurately represented in order to meet storage-space or transmission-bandwidth constraints. While the compression is a crucial system-component, it is only an intermediate stage among data processing procedures that determine the eventual output of the system. For example, consider a common audio/visual system structure where the source signal is acquired and compressed for its storage/transmission, then the decompression is followed by a rendering stage producing the ultimate system output. Evidently, in this example, the quality of the system output is determined by the acquisition-rendering chain, and not solely on the lossy compression stage. Nevertheless, the compression is usually designed independently of the system structure, thus inducing a sub-optimal rate-distortion performance for the complete system. Here we propose a compression approach defined by an operational rate-distortion optimization considering a known system structure. Specifically, we study a general flow (Fig. 1) where the compression is preceded by a linear operator distorting the input along with an additive white noise, and the decompression is followed by another linear operation. We formulate a rate-distortion optimization based on a quadratic distortion metric involving the system’s linear operators. For general linear operators, this intricate rate-distortion optimization is too hard to be directly solved for high dimensional signals. Consequently, we address this challenge using the alternating direction method of multipliers (ADMM) technique [1], suggesting an iterative procedure that relies on the simpler tasks of standard compression (which is system independent!) and `2 -constrained deconvolution for the linear operators of the system. Optimizing the system output quality from the compression standpoint is an attractive answer to the inherent tradeoff among distortion, bit-cost, and computational complexity. First, bits are wisely spent for representing signal components that will be important at the output of the overall system (for example, one should obviously not code signal components belonging to the null space of the post-decompression operator). Second, the added computational load can be well accommodated in the compression environment that is often rich in computational and time resources, in contrast to the decompression stage. Importantly, the proposed compression framework is a paradigm for addressing intricate rate-distortion optimization forms via iterative solution of easier problems emerging from the ADMM method (or other variable-splitting optimization techniques, see for example [2]). Indeed, the problem addressed here is an extension of our recent compression method [3] that pre-compensates for a later degradation occurring after decompression. In this paper the task is harder than in [3], as the source signal is available here only in its degraded version. The recent wide use of ADMM for complicated signal restoration problems (e.g., see [4]–[8]) suggests that our ADMMbased approach for complicated compression problems entails great potential. Using rate-distortion theory, we further study the examined problem for the case of a cyclo-stationary Gaussian source signal and linear shift-invariant system operators. Our results show that the initial rate-distortion optimization reduces to a reverse water-filling procedure adjusted to the system operators and considering the pseudoinverse-filtered version of the input signal. We use these theoretic results to explain concepts appearing (differently) in the proposed practical method intended for non-Gaussian signals and general linear system operators. Jointly using sampling and source coding procedures is fundamental to digitization-based systems as, indeed, was recently studied in [9] from an information-theoretic perspective. Accordingly, we demonstrate our general framework for adapting standard compression methods to the specific settings of an acquisition-compression-decompression-rendering system. We present experiments considering coding of onedimensional signals using an adaptive tree-based technique, and to video compression using the state-of-the-art HEVC standard [10]. Comparisons of our strategy to a regular compression flow exhibited that our method achieves significant Fig. 1. The general system structure considered in this paper. gains at medium/high bit-rates. II. T HE P ROPOSED M ETHOD Let us describe the considered system structure (Fig. 1). A source signal, an N -length column vector x ∈ RN , undergoes a linear processing represented by the M × N matrix A and, then, deteriorated  by an additive white Gaussian noise vector n ∼ N 0, σn2 I , resulting in the signal w = Ax + n (1) where w and n are M -length column vectors. We represent the lossy compression procedure via the mapping C : RM → B from the M -dimensional signal domain to a discrete set B of binary compressed representations (that may have different lengths). The signal w is the input to the compression component of the system, producing the compressed binary data b = C (w) that can be stored or transmitted in an error-free manner. Then, on a device and settings depending on the specific application, the compressed data b ∈ B is decompressed to provide the signal v = F (b) where F : B → S represents the decompression mapping between the binary compressed representations in B to the corresponding decompressed signals in the discrete set S ⊂ RM . The decompressed signal v is further processed by the linear operator denoted as the N × M matrix B, resulting in the system output signal y = Bv, (2) which is an M -length real-valued column vector. As an example, consider an acquisition-compressionrendering system where the signal w is a sampled version of the source signal x, and the system output y is the rendered version of the decompressed signal v. We assume here that the operators A and B, as well as the noise variance σn2 , are known and fixed (i.e., cannot be optimized). Consequently, we formulate a new compression procedure in order to optimize the end-to-end rate-distortion performance of the entire system. Specifically, we want the system output y to be the best approximation of the source signal x under the bit-budget constraint. However, at the compression stage we do not accurately know x, but rather its degraded form w formulated in (1). This motivates us to suggest the following distortion metric with respect to the system output y ds (w, y) = 1 2 kw − Ayk2 . M (3) This metric conforms with the fact that if y is close to x, then, by (1), w will be close to Ay up to the noise n. Indeed, for the ideal case of y = x the metric (3) becomes 1 2 ds (w, x) = knk2 ≈ σn2 (4) M where the last approximate equality is under the assumption of a sufficiently large M (the length of n). Since y = Bv, we can rewrite the distortion ds (w, y) in (3) as a function of the decompressed signal v, namely, 1 2 kw − ABvk2 . (5) dc (w, v) = M Since the operator B produces the output signal y, an ideal result will be y = PB x, where PB is the matrix projecting onto B’s range. The corresponding ideal distortion Ds is 1 2 kA (I − PB ) x + nk2 . (6) D0 , ds (w, PB x) = M We use the distortion metric (5) to constrain the bit-cost minimization in the following rate-distortion optimization v̂ = argmin R (v) v∈S (7) 1 2 kw − ABvk2 ≤ D0 + D M where R (v) evaluates the length of the binary compressed description of the decompressed signal v, and D ≥ 0 determines the allowed distortion. By (6), the value D0 depends on the operator A, the null space of B, the source signal x, and the noise realization n. Since x and n are unknown, D0 cannot be accurately calculated in the operational case (in Section III we formulate the expected value of D0 for the case of a cyclo-stationary Gaussian source signal). We address the optimization (7) using its unconstrained Lagrangian form 1 2 v̂ = argmin R (v) + λ kw − ABvk2 (8) M v∈S subject to D0 ≤ where λ ≥ 0 is a Lagrange multiplier corresponding to some distortion constraint Dλ ≥ D0 (such optimization strategy with respect to some Lagrange multiplier is common, e.g., in video coding [10]). In the case of high-dimensional signals, the discrete set S is extremely large and, therefore, it is impractical to directly solve the Lagrangian form in (8) for generally structured matrices A and B. This difficulty vanishes, for example, when A = B = I, reducing the Lagrangian optimization in (8) to the standard (system independent) compression form (see, e.g., [11], [12]). Indeed, such standard Lagrangian ratedistortion optimizations are practically solved using blockbased designs that translate the task to a sequence of blocklevel optimizations of feasible dimensions. Here we consider general A and B matrices, and address the computational difficulty in solving (8) using the alternating direction method of multipliers (ADMM) technique [1]. For start, we apply variable splitting to rewrite (8) as v̂ = argmin R (v) + λ v∈S,z∈RM subject to 1 2 kw − ABzk2 M (9) v=z where z ∈ RM is an auxiliary variable that is not (directly) restricted to the discrete set S. The augmented Lagrangian (in its scaled form) and the method of multipliers (see [1, Ch. 2] ) turn (9) into the following iterative procedure   (10) v̂(t) , ẑ(t) = 2 β 1 2 v − z + u(t) kw − ABzk2 + M 2 2 v∈S,z∈RM   (t+1) (t) (t) (t) , (11) u = u + v̂ − ẑ argmin R (v) + λ where t is the iteration number, u(t) ∈ RM is the scaled dual variable, and β is an auxiliary parameter originating at the augmented Lagrangian. Further simplifying (10) using one iteration of alternating minimization gives the ADMM form of the problem The second optimization stage (13) is an `2 -constrained deconvolution problem, that can be easily solved in various ways. The analytic solution of (13) is −1    βM (t) βM ∗ ∗ (t) ∗ ∗ I B A w+ ṽ ,(17) ẑ = B A AB + 2λ 2λ showing it as a weighted averaging of w and ṽ(t) . In the generic description given in Algorithm 1 we replace the quantity βM 2λ with the parameter β̃. The proposed method is summarized in Algorithm 1. Our goal is to provide a binary compressed representation of the optimized solution. Hence, the procedure output is the compressed data, b(t) , obtained in the compression stage of the last iteration. Algorithm 1 Generic System-Aware Compression 1: 2: 3: 4: 5: 6: 7: 8: 9: 2 β v − z̃(t) v̂(t) = argmin R (v) + 2 2 v∈S 1 β 2 ẑ(t) = argmin λ kw − ABzk2 + z − ṽ(t) M 2 M z∈R   (t+1) u = u(t) + v̂(t) − ẑ(t) . (12) 2 2 (13) 10: 11: 12: Inputs: w, θ, β̃. Initialize t = 0 , ẑ(0) = w , u(1) = 0. repeat t←t+1 z̃(t) = ẑ(t−1) − u(t)  b(t) = StandardCompress z̃(t)  ,θ  v̂(t) = StandardDecompress b(t) ṽ(t) = v̂(t) + u(t) −1   ẑ(t) = B∗ A∗ AB + β̃I B∗ A∗ w + β̃ ṽ(t)  u(t+1) = u(t) + v̂(t) − ẑ(t) until stopping criterion is satisfied Output: b(t) , which is the binary compressed data obtained in the last iteration. (14) III. T HEORETIC A NALYSIS FOR THE G AUSSIAN C ASE where z̃(t) = ẑ(t−1) −u(t) and ṽ(t) = v̂(t) +u(t) . Importantly, the compression design, expressed by {S, R}, and the systemspecific operators {A, B} were decoupled by the ADMM to reside in distinct optimization problems that are easier to solve. We identify the first stage (12) as the Lagrangian optimization employed for standard compression (and decompression) tasks considering the regular mean squared error metric. Specifically, the Lagrange multiplier for this standard optimization is λ̃ = βM 2 . Furthermore, we suggest to replace the solution of (12) with the application of a standard compression (and decompression) technique, even one that does not follow the Lagrangian optimization formulated in (12). We denote the standard compression and decompression via   b(t) = StandardCompress z̃(t) , θ (15)   v̂(t) = StandardDecompress b(t) (16) where θ is a general parameter that extends the Lagrange multiplier role in determining the rate-distortion tradeoff (see Algorithm 1). This important suggestion defines our method as a generic approach that can optimize any compression technique with respect to the specific system it resides in. In this section we use the rate-distortion theory framework to further explore the fundamental problem of systemoptimized compression. We consider the case of a cyclostationary Gaussian signal and system involving linear shiftinvariant operators and no noise, yet, the obtained results exhibit the prominent ideas of the general problem and the operational method presented in Section II. A. Problem Formulation and Solution The source signal is modeled here as x ∼ N (0, Rx ), i.e., a zero-mean Gaussian random vector with a circulant autocorrelation n omatrix Rx . The eigenvalues of Rx are de(x) N −1 noted as λk . The first processing part of the system k=0 produces the signal w = Ax, where here A is a real-valued N × N circulant matrix. Evidently, the signal w is a zeromean Gaussian random vector with autocorrelation matrix Rw = ARx A∗ . Here A and B are circulant N × N matrices, thus, diagonalized by the N × N Discrete Fourier Transform (DFT) matrix F as FAF∗ = ΛA and FBF∗ = ΛB , where ΛA and N −1 ΛB are diagonal matrices formed by the elements aF k k=0  N −1 and bF k k=0 , respectively. Accordingly, the pseudoinverse + matrix of A is defined as A+ = F∗ Λ+ A F, where ΛA is the pseudoinverse of ΛA , an N × N diagonal matrix with the F k th diagonal component aF,+ = 1/aF k for k where ak 6= 0, k F,+ F and ak = 0 for k where ak = 0. The matrix B has corresponding definitions to those given above for A. Recall that the system output is y = Bv, where here v is the random vector representing the decompressed signal. Accordingly, in the theoretic framework here, the rate is associated with the mutual information I (w, y). In (7) we formulated the operational rate-distortion optimization describing our practical task, cast here in the theoretic framework to min I (w, Bv) s.t. n o (18) 2 N E {D0 } ≤ E kw − ABvk2 ≤ N (E {D0 } + D) pv|w where pv|w is the conditional probability-density-function of v given w, and D ≥ 0 determines the allowed expected distortion. The value E {D0 }, stemming from (6) and the noiseless settings here, is the minimal expected distortion evaluated (see Appendix A) as X 1 2 (x) aF E {D0 } = λk . (19) k N F F k:ak 6=0 , bk =0 We state that the basic rate-distortion optimization problem in (18) is equivalent to (see proof in Appendix B) min pv|w̃ s.t. I (w̃, PB PA v) n o 2 E kAB (w̃ − v)k2 ≤ N D (20) where w̃ = B+ A+ w is the pseudoinverse filtered compression-input w. Here PA and PB are projection matrices corresponding to the  range of A andFB, respectively. We define the set KAB , k : aF k 6= 0 and bk 6= 0 that contains the DFT-domain component indices belonging to the range of the joint operator AB. Since w̃ is a cyclo-stationary Gaussian random vector, we transform the optimization (20) into a Fourier-domain distortion-allocation problem considering independent Gaussian variables (see proof in Appendix C), namely, ! (w̃) X 1 λk log min 2 Dk {Dk }k∈K AB k∈KAB X 2 (21) F s.t. aF Dk ≤ N D k bk k∈KAB (w̃) 0 ≤ Dk ≤ λk (w̃) λk , k ∈ KAB . (w) 2 F where for k ∈ KAB the value = λk / aF is the k bk th variance of the k DFT-coefficient of w̃. The solution of problem (21), obtained using Lagrangian optimization and the KKT conditions, is given by the following distortion allocation: for k ∈ KAB ( F 2 F 2 (w̃) θ/ aF , for 0 ≤ θ < aF λk k bk k bk Dk = (w̃) F 2 (w̃) λk , for θ ≥ aF b λ k k k , (22) where θ is set such that P k∈KAB F aF k bk 2 Dk = N D is satisfied. Importantly, for k ∈ / KAB the rate is Rk = 0 and the distortion is set to Dk = 0 (see Appendix C). The optimal rates corresponding to (22) assign for k ∈ KAB that also F 2 (w̃) obeys 0 ≤ θ < aF λk k bk ! (w̃) 1 F F 2 λk Rk = log ak bk (23) 2 θ and otherwise Rk = 0. Eq. (23) shows that the optimal rate assignments include compensation for the modulation applied beforehand in the pseudoinverse filtering of the input w. Moreover, DFT components belonging to the null spaces of A and B are not coded (i.e., get zero rates). B. Problem Solution in Theory and Practice While the theoretic framework above considers a cyclostationary Gaussian signal and a noiseless system composed of linear shift-invariant operators, the solution presented exhibits important ideas that also appear in the practical method of Section II. Recall that our method is designed for the operational settings of the problem treating non-Gaussian signals and general linear operators, hence, the resemblances between the above theory and practice are at the conceptual level and may materialize differently. We addressed the theoretic problem (18) using a simple inverse filtering of the input data w, transforming the problem into (20) and (21) that were solved using an extended version of the standard reverse water-filling procedure. Analogously, our practical method (Algorithm 1) repeatedly compresses a signal formed by an `2 -constrained deconvolution filtering, that can be rewritten also as a pseudoinverse filtering of the input followed by a weighted averaging with ṽ(t) , i.e.,  −1   ẑ(t) = B∗ A∗ AB + β̃I B∗ A∗ ABw̃ + β̃ ṽ(t) . (24) This shows that, in practice as well as in theory, the input w should go through a pseudoinverse filtering (softened via (24)) as a preceding stage to compression. The second prominent principle of the theoretic solution, exhibited in (23), is to compensate for the modulation applied by the pseudoinverse filter corresponding to the effective system operator AB. Similarly in Algorithm 1, the constrained deconvolution stage (24) implements this idea by better preserving w̃ components corresponding to higher energy parts of AB. This is clearly observed in the particular case of circulant A and B, where the filtering (24) reduces to the DFT-domain component-level operation of     F,(t) F,(t) F 2 F F 2 ẑk = aF w̃k + β̃ṽk / aF + β̃ (25) k bk k bk F,(t) where w̃kF and ṽk ṽ(t) , respectively. are the k th DFT-coefficients of w̃ and IV. E XPERIMENTAL R ESULTS In this section we employ Algorithm 1 to adjust standard compression designs to acquisition-rendering systems where (a) (b) (c) (d) Fig. 2. Experiment for one-dimensional signal and adaptive tree-based coding in an acquisition-rendering system. (a) the chirp source signal. Note that we present the high-resolution discrete signal as an approximation of the continuous time interval [0, 1]. Figures (b) and (c) show the system output (rendered) signals resulting from regular compression and the proposed method, respectively. (d) Comparison of PSNR-bitrate curves. the compression is an intermediate stage. Specifically, we model the source as a high-resolution discrete signal, acquired via linear shift-invariant low-pass filtering and uniform subsampling. Then, this acquired signal is available for compression, and after decompression it is linearly rendered back to the source resolution by replicating each decompressed sample (in a uniform pattern matching the source sub-sampling). 1) Coding of One Dimensional Signals: The compression approach here relies on adaptive tree-based segmentation of the signal (for another instance of this prevalent idea see [13]). Specifically, here we compress a one-dimensional signal using an operational rate-distortion optimization determining a binary-tree corresponding to a non-uniform segmentation of the signal, where each segment is represented by a constant value defined by the quantized average-value of the interval (see more details in Appendix D). We consider the system flow of acquisition-compression-decompression-rendering for the source signal depicted in Fig. 2a. Figures 2b and 2c exhibit the system output (i.e., the rendered signal) resulting from the use of a regular compression at 4.71 bpp and from employing our method at 3.69 bpp, respectively. Evidently, our method outperforms the regular approach in terms of PSNR and also in reproducing the chirp signal peaks. Comparing our method to the regular approach at various bit-rates (Fig. 2d) shows significant PSNR gains at medium/high bit-rates. 2) Video Coding: We evaluated our method also for adjusting the HEVC coding standard [10] to a simplified acquisitionrendering system, considering the spatial dimensions of the frames (more details are provided in Appendix E). The PSNRbitrate curves in Fig. 3 and the visual results (see Appendix E) show the capability of our approach for generically adapting a complicated compression method to a given system structure. V. C ONCLUSION In this paper we considered a system employing lossy compression as an intermediate stage, and proposed a methodology to optimize the system rate-distortion performance from the compression standpoint. We presented a generic operational method and explained its main ideas using rate-distortion theory of Gaussian signals. We provided experimental demonstrations of the effectiveness of our approach for coding of 1D signals and video sequences. (a) ’Stockholm’ video (b) ’Shields’ video Fig. 3. HEVC coding of 10 video frames. The curves present the PSNR of the system rendered output with respect to the high-resolution source. R EFERENCES [1] S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein, “Distributed optimization and statistical learning via the alternating direction method of multipliers,” Foundations and Trends in Machine Learning, vol. 3, no. 1, pp. 1–122, 2011. [2] Y. Dar, M. Elad, and A. M. Bruckstein, “Restoration by compression,” arXiv preprint arXiv:1711.05147, 2017. [3] ——, “Optimized pre-compensating compression,” arXiv preprint arXiv:1711.07901, 2017. [4] M. V. Afonso, J. M. Bioucas-Dias, and M. A. Figueiredo, “Fast image recovery using variable splitting and constrained optimization,” IEEE Trans. Image Process., vol. 19, no. 9, pp. 2345–2356, 2010. [5] S. V. Venkatakrishnan, C. A. Bouman, and B. Wohlberg, “Plug-and-play priors for model based reconstruction,” in IEEE GlobalSIP, 2013. [6] Y. Dar, A. M. Bruckstein, M. Elad, and R. Giryes, “Postprocessing of compressed images via sequential denoising,” IEEE Trans. Image Process., vol. 25, no. 7, pp. 3044–3058, 2016. [7] A. Rond, R. Giryes, and M. Elad, “Poisson inverse problems by the plug-and-play scheme,” Journal of Visual Communication and Image Representation, vol. 41, pp. 96–108, 2016. [8] Y. Romano, M. Elad, and P. Milanfar, “The little engine that could: Regularization by denoising (red),” SIAM Journal on Imaging Sciences, vol. 10, no. 4, pp. 1804–1844, 2017. [9] A. Kipnis, A. J. Goldsmith, Y. C. Eldar, and T. Weissman, “Distortion rate function of sub-Nyquist sampled Gaussian sources,” IEEE Trans. Inf. Theory, vol. 62, no. 1, pp. 401–429, 2016. [10] G. J. Sullivan, J. Ohm, W.-J. Han, and T. Wiegand, “Overview of the high efficiency video coding (hevc) standard,” IEEE Trans. Circuits and Systems for Video Technology, vol. 22, no. 12, pp. 1649–1668, 2012. [11] Y. Shoham and A. Gersho, “Efficient bit allocation for an arbitrary set of quantizers,” IEEE Trans. Acoust., Speech, Signal Process., vol. 36, no. 9, pp. 1445–1453, 1988. [12] A. Ortega and K. Ramchandran, “Rate-distortion methods for image and video compression,” IEEE Signal Process. Mag., vol. 15, no. 6, pp. 23–50, 1998. [13] R. Shukla, P. L. Dragotti, M. N. Do, and M. Vetterli, “Rate-distortion optimized tree-structured compression algorithms for piecewise polyno- mial images,” IEEE Trans. Image Process., vol. 14, no. 3, pp. 343–359, 2005. [14] P. A. Chou, T. Lookabaugh, and R. M. Gray, “Optimal pruning with applications to tree-structured source coding and modeling,” IEEE Trans. Inf. Theory, vol. 35, no. 2, pp. 299–315, 1989. [15] H. Everett III, “Generalized lagrange multiplier method for solving problems of optimum allocation of resources,” Operations research, vol. 11, no. 3, pp. 399–417, 1963. Now, let us develop the distortion expression appearing in the constraint of optimization (18):  2 I − HH+ w + HH+ w − Hv 2   2 = I − HH+ w + H H+ w − v 2   2 = I − HH+ w 2 + H H+ w − v  ∗ + H+ w − v H∗ I − HH+ w  ∗ +w∗ I − HH+ H H+ w − v   2 = I − HH+ w 2 + H H+ w − v = A PPENDIX A T HE T HEORETIC S ETTINGS : M INIMAL E XPECTED D ISTORTION The minimal distortion was defined in (6) for the operational settings. Here we will formulate its expected value, needed for the statistical settings of Section III. Expecting (6), considering M = N and no noise, gives o 1 n 2 E {D0 } = E kA (I − PB ) xk2 N o 1 n 2 = E kF∗ ΛA FF∗ (I − ΛPB ) Fxk2 N o 1 n 2 = E ΛA (I − ΛPB ) xF 2 N    X 1  2 F = E aF x k k  N  F F k:ak 6=0 , bk =0 1 = N X aF k 2 (x) λk , (26) A PPENDIX B T HE T HEORETIC S ETTINGS : E QUIVALENCE OF O PTIMIZATION P ROBLEMS (18) AND (20) Let us begin by proving the equivalence between the distortion constraints of optimizations (18) and (20). We define the matrix H , AB jointing the two linear operators of the system. In Section III we considered A and B to be N × N circulant matrices and, thus, H is also a N × N circulant matrix. Consequently, H is diagonalized by the N × N DFT matrix F via FHF∗ = ΛH , where ΛH is a diagonal matrix F F formed by the elements hF k = ak bk for k = 0, ..., N − 1. The pseudoinverse matrix of H is defined as H+ = F∗ Λ+ H F, where Λ+ H is the pseudoinverse of ΛH , an N × N diagonal matrix with the k th diagonal component ( 1 , for k ∈ KAB F F,+ aF k bk (27) hk = 0 , for k ∈ / KAB .  F where KAB , k : aF k 6= 0 and bk 6= 0 includes the DFTdomain component indices defining the range of the joint operator AB. 2 2 2 2 (28) where the last equality readily stems from the relation  H∗ I − HH+ = 0. (29) We use the DFT-based diagonalization of H to continue developing the expression of the first term in (28):   2 2 I − HH+ w 2 = I − F∗ ΛH FF∗ Λ+ HF w 2  2 = F∗ I − ΛH Λ+ H Fw 2  F 2 = I − ΛH Λ+ H w 2 X F 2 = wk = k:hF k =0 F k:aF k 6=0 , bk =0 where xF , Fx. Furthermore, we used the circulant structure of PB (as it is the projection matrix corresponding to the range of the circulant matrix B) providing the DFT-based diagonalization via FPB F∗ = ΛPB . Moreover, we utilized the formation of the diagonal matrix ΛPB where the (k, k) entry is 1 for k corresponding to bF k 6= 0, and otherwise the (k, k) entry is 0. 2 2 kw − ABvk2 = kw − Hvk2 = X F aF k xk 2 (30) F k:aF k 6=0,bk =0 where we used the DFT-domain expression of the k th comF F ponent of wF as wkF = aF k xk , reducing to wk = 0 when F ak = 0. Taking the expectation of (30), noting that the source signal x and the noise n are independent, yields o n X  2 (x) 2 I − HH+ w 2 = E aF λk . (31) k F k:aF k 6=0 , bk =0 Then, using (28) and (31) we get that o o n n 2 2 (32) E kw − ABvk2 = E kAB (w̃ − v)k2 X 2 (x) aF λk , + k F k:aF k 6=0 , bk =0 where w̃ = B+ A+ w. Eq. (26) implies X N E {D0 } = aF k k:aF k 6=0 , 2 (x) λk (33) bF k =0 that jointly with (32) yields the transformation of the expected distortion constraint in the optimization (18), namely, n o 2 N E {D0 } ≤ E kw − ABvk2 ≤ N (E {D0 } + D) (34) into n o 2 0 ≤ E kAB (w̃ − v)k2 ≤ N D. (35) Since (35) is the distortion constraint in optimization (20), we proved that the distortion constraints of optimizations (18) and (20) are interchangeable. We continue by showing the equivalence of the mutual information terms appearing in the optimization costs of (18) and (20). We start with I (w, Bv) used in (18). By the data processing inequality, the compression-input w and its filtered version A+ w obey  I (w, Bv) ≥ I A+ w, Bv . (36) In the theoretic settings we consider the noiseless case where w = Ax, hence, A+ w = PA x. Recall that PA is the projection matrix of the range of A. Since A is circulant, PA is also circulant and diagonalized by the DFT matrix via FPA F∗ = ΛPA where ΛPA = ΛA Λ+ A . Accordingly, we can write AA+ w = APA x = Ax = w (37) exhibiting w as a processing of A+ w, thus, by the data processing inequality we get  I (w, Bv) ≤ I A+ w, Bv (38) that together with (36) implies  I (w, Bv) = I A+ w, Bv . (39) us develop the mutual information in (40) to leverage the mentioned structures and the decomposition (41):  I A+ w, PB v =  = I FA+ w, FPB v (44)  + F F (45) = I ΛA w , ΛPB v   X  F,+ X  F,+ I ak wkF , 0 (46) I ak wkF , vkF + ≥ k:bF k =0 k:bF k 6=0 = X  F F I aF,+ k wk , vk  (47) k:bF k 6=0 where (44) is due to the preservation of mutual information under a unitary transformation. The lower bound in (46) emerges from the independence of the DFT-domain variables wkF , k = 0, ..., N − 1, since they originate in the cyclostationary Gaussian signal x processed by the circulant matrix A. In Appendix C we exhibit a backward channel construction based on independent components vkF in the DFT domain, therefore, satisfying the inequality (46) with equality. Using (47) and pending on the construction shown in Appendix C, we state that  X  F,+  I A+ w, PB v = I ak wkF , vkF k:bF k 6=0 The above showed that since w is in the range of A, its processing via A+ is invertible and, thus, the mutual information is preserved under such processing of w. Similar to the above arguments, we can show that since the system output Bv is in the range of B, its processing via B+ is invertible and, therefore, the mutual information is preserved under such filtering of Bv:   I A+ w, Bv = I A+ w, B+ Bv  = I A+ w, PB v . (40) Consider the decomposition of A+ w based on its projections on B’s range and nullspace, namely, A+ w = PB A+ w + (I − PB ) A+ w. (41) Observe that (I − PB ) A+ w = F∗ (I − ΛPB ) FF∗ Λ+ A Fw F = F∗ (I − ΛPB ) Λ+ Aw (42) and the second random variable considered by the mutual information in (40) is PB v = F∗ ΛPB Fw = F∗ ΛPB wF (43) where wF is the DFT-domain representation of w. Note that the diagonal projection matrices ΛPB , ΛB Λ+ B and I − ΛPB appearing in (43) and (42), respectively, imply that the DFT-domain representations of (I − PB ) A+ w and PB v have complementary non-overlapping supports (defined by the component indices where the value may be nonzero). Let = I PB A+ w, PB v  (48) + Note that PB A w is in the range of A, hence, using similar arguments to those given in the last paragraph, one can show that   I PB A+ w, PB v = I PB A+ w, PA PB v (49) Furthermore, since PB A+ w belongs also to the range of B, its processing via B+ is invertible, thus,   I PB A+ w, PA PB v = I B+ A+ w, PA PB v . (50) Due to the circulant structure of PA and PB , they commute and, therefore,   I PB A+ w, PA PB v = I B+ A+ w, PB PA v , (51) that is the mutual information in the cost of problem (20). To conclude, we showed the equivalence of the costs (based on the backward-channel construction presented next in Appendix C) and the constraints of problems (18) and (20), therefore, these optimization problems are interchangeable . A PPENDIX C T HE T HEORETIC S ETTINGS : E QUIVALENCE OF O PTIMIZATION P ROBLEMS (20) AND (21) Since A matrices, the expected disn and B are circulant o 2 tortion E kAB (w̃ − v)k2 , appearing in the constraint of (20), has the following additively-separable form in the DFT domain n o n  2o 2 E kAB (w̃ − v)k2 = E ΛA ΛB w̃F − vF 2 = N −1 X k=0 F aF k bk 2 E n w̃kF − vkF 2 o . (52) This expected distortion formulation motivates us to address the entire rate-distortion optimization in the DFT domain and with respect to a pseudoinverse filtered version of the input w. For this purpose we will treat next the optimization cost of the problem given in (20). Since w̃ , B+ A+ w is a cyclo-stationary Gaussian signal, we apply the following familiar lower bounds: definitions given above. Consider the following construction for a backward channel producing w̃ from v. Let  v ∼ N 0, H+ Rw H+∗ − H+ F∗ ΛD̂ FH+∗ (59)  + ∗ +∗ z ∼ N 0, H F ΛD̂ FH (60) be two independent random vectors, constructing w̃ via w̃ = v + z, I (w̃, PB PA v) = I (Fw̃, FPB PA v) = I w̃F , ΛPB ΛPA vF X  I w̃kF , vkF ≥ (53)  (54) (55) k∈KAB where (53) is due to the invariance of mutual information under a unitary transformation, (54) exhibits the diagonal forms of the projection matrices, and the bound (55) is due to N −1 the independence of the DFT coefficients w̃kF k=0 stemming from cyclo-stationary Gaussian characteristics of w̃. Moreover, note that (55) refers only to mutual information of DFT components belonging to the range of AB, this is due to (54) where vF components corresponding to the nullspace of AB are zeroed (hence, they yield zero mutual information and zero rate). The next lower bound emerges from the definition of the rate-distortion function for each of the components, i.e., X X  I w̃kF , vkF ≥ Rk (Dk ) (56) k∈KAB k∈KAB " X = k∈KAB 1 log 2 (w̃) λk Dk !# (57) + where the last equality relies on the rate-distortion function formulation for a scalar Gaussian source. The k th variable (w̃) here is w̃kF , having the a variance denoted as λk . Here, the k th -component rate corresponds n to an expected o squared-error 2 distortion denoted as Dk , E w̃kF − vkF . The mutual-information lower bound in (57) is further minimized under the total distortion constraint that expresses the weights introduced in (52) for each of the DFT components, i.e., the distortion-allocation optimization is ! (w̃) X 1 λk min log 2 Dk {Dk }k∈K AB k∈KAB X (58) F 2 s.t. aF Dk ≤ N D k bk k∈KAB (w̃) 0 ≤ Dk ≤ λk , k ∈ KAB . where the operator [·]+ in (57) was replaced with componentwise constraints. The optimization (58) is solved using Lagrangian optimization and the n KKT o conditions. We denote N −1 here the optimal distortions as D̂k k=0 , where for k ∈ / KAB we set D̂k = 0, and use them next for showing the achievability of the mutual-information lower bound. We define ΛD̂ as the N ×N diagonal matrix with D̂k as the k th diagonal value. Also recall that H , AB and the related (61) hence, w̃ ∼ N (0, H+ Rw H+∗ ), agreeing with w̃ = H+ w where w ∼ N (0, Rw ). Additionally, the construction (59)(61) leads to n o n o 2 2 E kH (w̃ − v)k2 = E kHzk2 = E {z∗ H∗ Hz} = E {T race {z∗ H∗ Hz}} = E {T race {Hzz∗ H∗ }} = T race {HRz H∗ }  = T race HH+ F∗ ΛD̂ FH+∗ H∗  +∗ ∗ = T race F∗ ΛH Λ+ H ΛD̂ ΛH ΛH F  ∗ = T race F ΛD̂ F  = T race ΛD̂ = ND (62) that reaches the maximal allowed distortion in (58). We used +∗ ∗ here the relation ΛH Λ+ H ΛD̂ ΛH ΛH = ΛD̂ , emerging from the fact that D̂k = 0 for components in the nullspace of H. This construction fulfills (46), (55) and (56) with equality, thus, proves the equivalence of the optimization problems (18), (20), and (21). A PPENDIX D A DDITIONAL D ETAILS ON THE E XPERIMENTS FOR C ODING OF O NE -D IMENSIONAL S IGNALS 1) The Tree-based Coding Method for One-Dimensional Signals: We consider a coding procedure that relies on a nonuniform segmentation of the signal based on a binary tree structure. The method presented here is influenced by the general framework given in [14] for optimizing tree-structures, and by the ratedistortion Lagrangian optimization in [11], [12]. We consider the coding of a M -length vector w ∈ RM , where M = 2d0 for some positive integer d0 . The procedure starts with a full d-depth binary-tree (d ≤ d0 ), which is the initial tree, describing a uniform partitioning of the vector components wk , k = 0, ..., M − 1, into 2d sub-vectors of M · 2−d length. The segmentation of the vector is represented by the leaves of the binary tree: the sub-vector location and length are determined by the leaf place in the tree, in particular, the sub-vector length is defined by the tree-level that the leaf belongs to. The examined nonuniform segmentations are induced by all the trees obtained by repeatedly pruning neighboring-leaves having the same parent node. The initial d-depth full-tree together with all its pruned subtrees form the set of relevant trees, denoted here as Td . The leaves of a tree T ∈ Td form a set denoted as L(T ), where the number of leaves is referred to as |L(T )|. Accordingly, the tree T represents a (possibly) nonuniform partitioning of the M -length vector into |L(T )| segments. A leaf l ∈ L(T ) resides in the h(l)h level of the itree t right and corresponds to the indexing interval alef of (l) , ..., a(l) length ∆ (l) = M · 2−h(l) . A segment, corresponding to the leaf l ∈ L(T ), is represented by its average value aright ŵ(l) (l) X 1 wk = ∆ (l) lef t (63) k=a(l) that is further uniformly quantized using qb = 8 bits. The quantized sample corresponding to the lth leaf (segment) is Q denoted as ŵ(l) . This coding structure leads to reconstruction squared-error induced by the tree T ∈ Td and calculated based on its leaves, L(T ), via aright (l) E 2 (T ) = X X  Q wk − ŵ(l) 2 . (64) l∈L(T ) k=alef t (l) M For a given signal w ∈ R and a budget of ρ bits, one can formulate the optimization of a tree-structured nonuniform coding as minimize T ∈Td E 2 (T ) (65) subject to qb |L(T )| = ρ, namely, the optimization searches for the tree associated with a bit-cost of ρ bits that provides minimal reconstruction squarederror. The unconstrained Lagrangian form of (65) is  min E 2 (T ) + ν (qb |L(T )|) , (66) T ∈Td where ν ≥ 0 is a Lagrange multiplier that corresponds to qb |L(T )| = ρ. However, it should be noted that due to the discrete nature of the problem such ν does not necessarily exist for any ρ value (see details, e.g., in [14], [15]). The problem (66) can also be written as   right   (l)  X aX   2 Q min wk − ŵ(l) + νqb |L(T )| . (67) T ∈Td   l∈L(T ) k=alef t  (l) Importantly, since the representation intervals do not overlap, the contribution of a leaf, l ∈ L(T ), to the Lagrangian cost is aright (l) 2 X  Q wk − ŵ(l) + νqb . C (l) = (68) t k=alef (l) The discrete optimization problem (67) of optimizing the tree for a given signal and a Lagrange multiplier ν is practically addressed as follows. Start from the full d-depth tree and determine the corresponding segments and their quantized samples, squared errors, and contributions to the Lagrangian cost (68). Go through the tree levels from bottom and up, in each tree level find the pairs of neighboring leaves having the same parent node and evaluate the pruning condition: if C (left child) + C (right child) > C (parent) (69) is true, then prune the two leaves – implying that two segments are merged to form a single sub-vector of double length (thus, the total bit-cost is reduced by qb ). If the condition (69) is false, then the two leaves (and the associated representation segments) are kept. This evaluation is continued until reaching a level where no pruning is done, or when arriving to the root of the tree. 2) The Experiment Settings used for Adjusting Compression of One-Dimensional Signals to an Acquisition-Rendering System: The source signal x is the chirp presented in Fig. 2a, defined by sampling its mathematical formulation using 1024 samples uniformly spread in the ”time” interval [0, 1). Note that the chirp signal values are in the range [0, 1], a property used in the PSNR computation shown in the result evaluation in Fig. 2d. The acquisition is modeled here by a low-pass filtering applied using a convolution with a Gaussian kernel (standard deviation 15) and support of 15 samples, followed by subsampling in a factor of 4, and an additive white Gaussian noise with standard deviation 0.001. This procedure results with the 256-samples signal w that is given to the compression. After decompression the rendering operator is applied by replicating each sample of v four times such that the piecewise-constant signal y is formed, having a size of 1024 samples. We tested two compression strategies. The first is a regular compression using the tree-based procedure, described in the former subsection, applied based on some Lagrange multiplier ν. The experiment for this regular flow was repeated for various values of the Lagrange multiplier ν to produce the PSNR-bitrate curve in Fig. 2d. The second approach relied on the implementation of the proposed method (Algorithm 1) as the compression stage that leverages the standard tree-based coding described in the former subsection. This approach was evaluated for a range of ν values to obtain the corresponding PSNR-bitrate curve in Fig. 2d. The implementation of our iterative method (Algorithm 1) run a maximum of 40 iterations or until convergence is detected. A PPENDIX E A DDITIONAL D ETAILS ON THE E XPERIMENTS FOR V IDEO C ODING The source signal x is a sequence of 10 frames, each of 480 × 480 pixels. The acquisition is modeled here by a low-pass filtering carried out by a convolution with a two-dimensional Gaussian kernel (standard deviation 1) and support of 5 × 5 pixels, followed by horizontal and vertical sub-sampling in a factor of 2, and an additive white Gaussian noise with standard deviation 0.001. This procedure results with the 10-frame sequence w with a frame size of 240 × 240 pixels. The rendering applied after decompression is simply done by replicating each pixel of v in a 2 × 2 pixels square (a) Source (b) Regular (c) Proposed Fig. 4. Coding a group of 10 frame from the ’Stockholm’ sequence (spatial portion of 480x480 pixels). (a) The third source frame. (b) the rendered frame using regular compression (28.29 dB at 2.37 bpp). (c) the rendered frame using the proposed compression (29.45 dB at 1.34 bpp). such that the rendered signal y has frames of 480 × 480 pixels having spatial piecewise-constant form. We evaluated two compression approaches. One, is to employ a regular compression using the HEVC video coding standard (using its reference software, version HM 15.0, available at http://hevc.hhi.fraunhofer.de/). The experiment for this regular approach was repeated for various values of the quality parameter of the HEVC to produce the PSNR-bitrate curve in Fig. 3. The second strategy implemented the proposed method (Algorithm 1) as the compression procedure that utilizes the HEVC standard. This approach was evaluated for a range of HEVC quality parameters to provide the corresponding PSNRbitrate curve in Fig. 3. The implementation of our iterative method (Algorithm 1) run a maximum of 10 iterations or until convergence is detected. In Fig. 3 we presented the PSNR-bitrate curves for the compression of segments of two video signals: ’Stockholm’ and ’Shields’. Here, in Figures 4 and 5, we show the third frame from the sequence, in its original form and in its rendered form using the regular approach and via the proposed method. Clearly, our method provides a more vivid image (also having higher PSNR) at a lower bit-rate. (a) Source (b) Regular (c) Proposed Fig. 5. Coding a group of 10 frame from the ’Shields’ sequence (spatial portion of 480x480 pixels). (a) The third source frame. (b) the rendered frame using regular compression (27.93 dB at 2.41 bpp). (c) the rendered frame using the proposed compression (29.31 dB at 1.31 bpp).
7cs.IT
Communication-Optimal Convolutional Neural Nets James Demmel∗, Grace Dinh†, arXiv:1802.06905v1 [cs.DS] 19 Feb 2018 February 21, 2018 Abstract Efficiently executing convolutional neural nets (CNNs) is important in many machinelearning tasks. Since the cost of moving a word of data, either between levels of a memory hierarchy or between processors over a network, is much higher than the cost of an arithmetic operation, minimizing data movement is critical to performance optimization. In this paper, we present both new lower bounds on data movement needed for CNNs, and optimal sequential algorithms that attain these lower bounds. In most common cases, our optimal algorithms can attain significantly more data reuse than matrix multiplication. 1 Introduction Convolutional neural networks are a bottleneck in many machine learning applications, and as such must be efficiently implemented on modern architectures. To do so, it is important to understand where most of the time (and energy) goes when executing a program on a current architecture. There are two costs to consider: arithmetic and communication, i.e. moving data, either between levels of a memory hierarchy or between processors over a network. The cost to move one word of data can be orders of magnitude larger than the cost to perform one arithmetic operation, and this difference in cost is growing over time, following technological trends [GSP05, FM11]. Avoiding communication has long motivated optimization efforts (many of which have in fact managed to attain known communication lower bounds) in numerical linear algebra, resulting in tuned libraries (e.g. the BLAS and LAPACK) that attain a high fraction of machine peak. We seek to extend this optimization approach to CNNs. In this paper, we consider one phase of CNNs, which can be written most simply as seven nested loops combining a four-dimensional Image array and a four-dimensional Filter array to compute a four-dimensional Out array, which may be most simply stated as follows1 : for {b, c, k, w, h, r, s} = 0 : { B, C, K, W, H, R, S} − 1 Out(k, h, w, b)+ = Image(r + σw w, s + σh h, c, b) × Filter (k, r, s, c) We consider all possible ways to reorganize this computation, performing the same arithmetic operations in an arbitrary order, and ask which order minimizes communication. We use a simple sequential architectural model where there is one memory large enough to hold all the input and output data, and a smaller cache of size M where data needs to reside to perform arithmetic; we ∗ Computer Science Div. and Mathematics Dept., Univ. of California, Berkeley, CA 94720 ([email protected]). Science Div., Univ. of California, Berkeley, CA 94720 ([email protected]). 1 We ignore boundary conditions in this paper and focus solely on asymptotic optimization. † Computer 1 wish to minimize the number of words moved between the large memory and cache (we also show how to generalize this simple architectural model to more complicated and realistic ones). Our first contribution is to prove new communication lower bounds that hold for all possible loop bounds on the seven nested loops, all strides, and all cache sizes M. Our second contribution is to show how to attain these lower bounds in all cases, using appropriate loop reorganizations and tilings. Both the lower bounds and optimal tilings are more complicated than, say, those for matrix multiplication because the seven loop bounds and two stride values lead to many more possible situations than the three loop bounds of matrix multiplication (which we will briefly review for contrast). Not all loop bounds and strides may be used in practice, but we consider them all for completeness. Fortunately, the lower bound can be tersely written as the maximum of five simple algebraic expressions in the seven loop bounds and cache size M: max(σH σW KHWB, CHWB, KCRS, KCHWBRS/M, KCHWB(σh σw RS/M)1/2 ) (see Theorem 1 in section 4). Any one of these five expressions may be much larger than the others, depending on the loop bounds, the stride values, and M. Notice that in many common cases (small filter, arrays too big to fit entirely in cache), the fifth term in the above expression is the maximum. If we were only able to achieve as much data reuse as in conventional O(n3 ) matrix multiplication (or the many other dense linear algebra operations for which matrix multiply is a bottleneck), this term would be equal to KCHWBRS/M1/2 . In contrast, we see our bound is smaller (better) than this by a factor min( M1/2 , ( RS/σh σw )1/2 ). The proof (which can be skipped on a first reading) uses techniques from functional analysis, group theory and lattice theory. The optimal tilings that attain these lower bounds lead to a large number of cases. We determine these cases by formulating the problem of finding an optimal tiling as an optimization problem, where we want to choose loop tile sizes that both fit in fast memory and maximize the amount of work that can be done. By taking logarithms, this becomes a linear program over the tiling parameters, with constraints restricting the tiling parameters to feasible tilings that fit inside memory. We show in section 5 that for all possible values of the loop bounds and strides, there is a feasible solution of this linear program that attains the corresponding lower bound. A practical implementation of our result might be done either by formulating and solving the linear program, or by using the cases precomputed using the method described in Section 5. The remainder of this paper is organized as follows. Section 2 describes the seven-nested loop version of a CNN in more detail, and the simplifications we make for the purpose of our analysis. Section 3 briefly reviews lower bounds and optimal algorithms for matrix multiplication, to set the stage for our more complicated analysis of CNNs. Section 4 presents our new lower bounds, and Section 5 presents the matching upper bounds, i.e. optimal algorithms. 2 CNN Model As stated in the Introduction, we consider the following CNN computation: for {b, c, k, w, h, r, s} = 0 : { B, C, K, W, H, R, S} − 1 Out(k, h, w, b)+ = Image(r + σw w, s + σh h, c, b) × Filter (k, r, s, c) (1) where Image has dimensions (σw W + R) × (σh H + S) × C × B, Out has dimensions K × H × W × B, and Filter has dimensions K × R × S × C. B is the number of images, C is the number of input 2 channels, K is the number of output channels, W and H are the width and height of the output image, R and S are the sizes of one convolution, σw is the stride size in the w dimension, and σh is the stride size in the h dimension. We assume that the filter size is smaller than the input image size, i.e. R ≤ σw W and S ≤ σh H, and typically, they are much smaller, though our analysis does not require this. We also assume that σw ≤ R and σh ≤ S (i.e. all elements of Image are used in the computation); we can reduce any problem onto one where this assumption holds using no more communication than is necessary to read the useful elements in Image. Thus Filter has total size KCRS, Out has total size KHWB, and Image has total size C (σh H + S)(σw W + R) B, which is usually close to, and at most four times, CHWBσh σw . These three array sizes will appear in our communication bounds. We will use the expression CHWBσh σw to simplify our algebra later, since we are only interested in the asymptotics. 3 Review of Matrix Multiplication In this section we review the well-known case of matrix multiplication (matmul), both to compare to our analogous but more complicated result for CNNs, and because the lower bound for matmul is used in the CNN lower bound proof. We consider only “classical” matmul, i.e. the algorithm that does mnk multiplies and adds to multiply an m-by-n matrix times an n-by-k matrix (we discuss Strassen-like algorithms briefly below). To keep it simple, we consider n-by-n times n-by-k matmul C = A ∗ B, where the matrix A and B originally reside in main memory, the result C is stored in main memory at the end of execution, 1 ≤ k ≤ n, and the cache has size M. In this case, the attainable lower bound on the number WMM of words moved between main memory and cache is WMM = Ω(max(n2 , n2 k/M1/2 )) (2) The n2 term arises because it is obviously necessary to read the input matrices from main memory to cache at least once, and write the output matrix to main memory at least once. The n2 k/M1/2 term is the interesting one, dominating n2 for large enough k, and a decreasing function of M. In the square n = k case, it is attained by the well-known tiling approach, i.e. breaking matrices A, B and C into square submatrices of dimension ( M/3)1/2 , so one submatrix of A, B and C can all fit in cache simultaneously. The tiled algorithm then loops over tiles, multiplying two tiles of A and B and updating one tile of C. As k decreases, the same tiling approach works until k = ( M/3)1/2 , at which point one tile just fits in the n-by-k matrices B and C, and the two terms n2 and n2 k/M1/2 in WMM become equal (to within a modest constant factor). As k decreases further, the WMM remains equal to n2 , and this is attained by continuing to use an ( M/3)1/2 -by-( M/3)1/2 tile for A, but ( M/3)1/2 -by-k tiles for B and C. We will see an analogous, but more complicated transitioning of optimal tilings for CNNs. The lower bound n2 k/M1/2 was first derived for sequential classical matmul in [HK81], generalized to parallel implementations in [ITT04], and to classical linear algebra more generally in [BDHS11]. We will apply a further generalization of these bounds [CDK+ 13a, CDK+ 15, Kni15] that apply to more general nested loops accessing arrays to CNNs in section 4. The case of Strassen-like matmul was addressed in [BDHS12, Sco15]. 4 Communication Lower Bounds In this section, we state and prove our communication lower bound for the CNN in (1). We first state the bound for the following basic memory model, and then show how to generalize it to 3 other models, following [BDHS11]. We assume the input data initially resides in a large main memory, and that at the end of the computation the answer also resides in the main memory. The main memory is attached to a cache of smaller size M, to which data can be loaded, and from which data can be stored back to main memory. Arithmetic can only be performed on data in cache, with the operands and result of an operation needing to fit in cache. Our goal is to find a lower bound the number of loads and stores needed to complete the algorithm. In the simplest case, when M is large enough to hold all the inputs and outputs, an optimal algorithm would move all the inputs from main memory to cache, perform the algorithm without any more loads or stores, and store the answer back to main memory at the end. This would attain the trivial lower bound on the number of loads and stores, equal to the size of all the inputs plus the size of all the outputs. The interesting case is when M is not large enough to do this. In this case, following the approach of [CDK+ 13b], we will proceed as follows: consider the algorithm as a sequence of instructions, including load instructions that transfer data from slow to fast memory, store instructions that transfer data from fast to slow memory, and F arithmetic operations. Break the sequence into R rounds of consecutive instructions, with each round containing exactly M load and store operations (with the possible exception of the last); this provides a 2M upper bound on the amount of data that can be used as input by operations in a single bound - the M words already available at the beginning, and the at most M words loaded into fast memory at the beginning of a round. If we can show that at most G operations can be computed with 2M inputs and outputs (i.e. in one round), then the number of rounds must be R ≥ b F/G c and the number of words transferred in the execution must be M b F/G c . (3) This approach can be used for more general memory models. For example, we can bound the communication between two consecutive levels of a multilevel memory hierarchy by treating the smaller and faster of the two levels as the “fast memory” and everything slower and larger than it as “slow memory”. For distributed memory parallel computations, following the approach of [ITT04, BDHS11, CDK+ 13b, Kni15], we can bound the memory traffic in and out of any node by treating the memory on that node as the “fast memory”, and the memory on all the other processors as ”slow memory”. 4.1 Communication Lower Bounds for CNNs The main result of this section is Theorem 1 Any execution order of (1) moves WCNN words between main memory and a cache of size M, where WCNN = Ω(max( BKW H, σW σH BCW H, CKRS, BCKW HRS/M, BCKW H ( RSσW σH /M)1/2 )) (4) To provide some intuition for this, note that the first three terms in the max() are the sizes of the output and inputs Out, Image and Filter respectively. The fourth term uses the results in [CDK+ 13a, CDK+ 15], which apply to general loop nests accessing arrays, though we will see that more work is required to apply these results concretely. This lower bound has the same power of M in the denominator as the direct n-body problem. The fifth term is new, and is larger than the fourth term if and only if RS < MσW σH , which is a common case. 4 4.2 Proof of the lower bound BCKW HRS/M We will apply the general communication lower bounds for perfectly nested loops accessing arrays, whose subscripts can be arbitrary affine functions of the loops indices, that were developed in [CDK+ 13a, CDK+ 15, Kni15]. Without going deeply into the significant theory developed in these papers, we sketch the approach, and the additional information we need to apply it. Each loop iteration may be identified with a 7-tuple of integers (b, c, k, w, h, r, s), and the data required be in fast memory to execute it by 3 projections φ1 (b, c, k, w, h, r, s) = (b, k, w, h) (the subscripts of Out), φ2 (b, c, k, w, h, r, s) = (b, c, r + σw w, s + σh h) (the subscripts of Image), and φ3 (b, c, k, w, h, r, s) = (c, k, r, s) (the subscripts of Filter). So if V is a set of 7-tuples of integers, φ1 (V ), φ2 (V ) and φ3 (V ) represent the sets of entries of Out, Image and Filter, respectively, needed to execute V. We seek a bound G ≥ |V |, subject to φ1 (V ), φ2 (V ) and φ3 (V ) all fitting in fast memory, i.e. |φ1 (V )| ≤ M, |φ2 (V )| ≤ M and |φ3 (V )| ≤ M (again, ignoring constant factors). The discrete Hölder-Brascamp-Lieb (HBL) inequalities developed in the above (and many previous) publications tell us that there are nonnegative constants s1 , s2 and s3 such that for all finite V, 3 |V | ≤ ∏ |φi (V )|si (5) i =1 which implies 3 | V | ≤ G = ∏ M s i = M ∑ i =1 s i 3 (6) i =1 is the bound we seek. A set (s1 , s2 , s3 ) satisfies (5) for all V if and only if they satisfy the linear inequalities 3 rank( H ) ≤ ∑ si · rank(φi ( H )) (7) i =1 for all subgroups H of the abelian group Z7 of 7-tuples of integers under addition, and where rank( H ) is analogous to the dimension of a vector space. Since there are an infinite number of possible subgroups H, this looks like an infinite number of inequalities, but in fact there are only finitely many, since each rank( H ) and rank(φi ( H )) is an integer between 0 and 7. So to get the best (smallest) bound G, we want to minimize ∑3i=1 si subject to (7), a linear program. It will turn out that the minimal value of ∑3i=1 si is 2, leading to G = M2 , and using (3) the desired lower bound of Mb F/G c = M b BCKW HRS/M2 c = O( BCKW HRS/M ) (8) The challenge is identifying a finite set of subgroups H that generate enough inequalities (7) to get the correct solution to the linear program. An algorithm for this is proposed in [CDK+ 15], with a sketch of a simpler one based on [Val10], which is the approach we take. This requires us to generate the lattice of subgroups generated by the kernels of φ1 , φ2 and φ3 . A lattice of subgroups (see [Bir63] for more background) is the set of all possible sums and intersections that can be generated starting from a set of generators, i.e. subgroups (we note that all subgroups discussed here are subgroups of Z7 and so abelian). Since the sum or intersection of two subgroups is a subgroup, the lattice consists of subgroups of Z7 . We will always include {0} in our lattices, since this does not change other members of the lattice, and simplifies some expressions below. We need some machinery to help describe the lattice we need (or a superset) in a finite way. 5 Suppose A = { A1 , ..., An } and B = { B1 , ..., Bm } are finite sets of subgroups of an abelian group. We will call them independent if ∑ A i ∩ ∑ B j = {0} i j Let lattice( A) denote the lattice generated by the subgroups in A, and similarly for lattice( B); recall that we will add {0} to these lattices if they do not already contain it. Then from the definition of a lattice it is easy to see that lattice( A) and lattice( B) are independent if A and B are independent, in which case we have Lemma 4.1 Suppose A and B are independent. Then lattice( A ∪ B) = lattice( A) + lattice( B) ≡ {C + D : C ∈ lattice( A), D ∈ lattice( B)} Proof: A ∪ B ⊂ lattice( A) + lattice( B) since both lattices include {0}. It suffices to show that if A1 + B1 and A2 + B2 are both in lattice( A) + lattice( B) ⊆ lattice( A ∪ B), then so are their sum and intersection. The sum ( A1 + B1 ) + ( A2 + B2 ) = ( A1 + A2 ) + ( B1 + B2 ) ∈ lattice( A) + lattice( B) follows from being abelian, and a lattice being closed under addition. The intersection ( A1 + B1 ) ∩ ( A2 + B2 ) = ( A1 ∩ A2 ) + ( B1 ∩ B2 ) follows from independence, and a lattice being closed under intersection.  The advantage of this is that if we have simple descriptions of lattice( A) and lattice( B) (say finite lists of each), then it is easy to describe lattice( A ∪ B). More generally, let Ci = {Ci,1 , ..., Ci,n(i) } be a set of n(i ) subgroups, for i = 1, ..., m. We call them independent if for all i ∑ Ci,j ∩ ∑ ∑ Ck,j = {0} j k 6 =i j This is a natural generalization of the case where each Ci,j is a vector space. Then, as above the lattice(Ci ) are independent, and lattice(∪i Ci ) = ∑ lattice(Ci ) i and if we have finite lists of the members of each lattice(Ci ), we can also list the members of lattice(∪i Ci ). Now suppose we start with some sets of the form D1 = ∑ Ci,m(1,i) , . . . , Dk = i ∑ Ci,m(k,i) (9) i Each of the above sums may be over a subset of the possible values of i. In other words, each D j is gotten by choosing at most one member of each Ci , and adding them. Later we will choose these D j to be the kernels of the projections φi in the CNN. Then for any such D1 , · · · , Dk , we have lattice(∪i Di ) ⊆ lattice(∪i Ci ) = ∑ lattice(Ci ) i Now we tie this to code for CNNs. The projections φi and their kernels are = (b, k, w, h), ker(φ1 ) = {(0, c, 0, 0, 0, r, s)} φ2 ((b, c, k, w, h, r, s)) = (b, c, r + σw w, s + σh h), ker(φ2 ) = {(0, 0, k, w, h, −σw w, −σh h)} φ3 ((b, c, k, w, h, r, s)) = (c, k, r, s), ker(φ3 ) = {(b, 0, 0, w, h, 0, 0)} φ1 ((b, c, k, w, h, r, s)) 6 (10) Our goal is a finite list of subgroups H that is a superset of lattice(K ), where K = {ker(φ1 ), ker(φ2 ), ker(φ3 )} , and where for each such H we can write down the inequality (7). Then by [CDK+ 15, Val10], solving the linear program that minimizes ∑3i=1 si subject to these constraints will give us our 3 desired bound G = M∑i=1 si . There are 5 groups of subscripts, {k }, { h, s, s + σh h}, {w, r, r + σw w}, {c}, and {b}, that are independent of one another. From these we define the following 5 sets of subgroups: C1 = {(0, 0, k, 0, 0, 0, 0)} = {C1,1 } C2 = {(0, 0, 0, 0, h, 0, 0), (0, 0, 0, 0, 0, 0, s), (0, 0, 0, 0, h, 0, −σh h)} = {C2,1 , C2,2 , C2,3 } C3 = {(0, 0, 0, w, 0, 0, 0), (0, 0, 0, 0, 0, r, 0), (0, 0, 0, w, 0, −σw w, 0)} = {C3,1 , C3,2 , C3,3 } C4 = {(0, c, 0, 0, 0, 0, 0)} = {C4,1 } C5 = {(b, 0, 0, 0, 0, 0, 0)} = {C5,1 } Then we can write ker(φ1 ) = C2,2 + C3,2 + C4,1 ker(φ2 ) = C1,1 + C2,3 + C3,3 ker(φ3 ) = C2,1 + C3,1 + C5,1 which we identify with D1 , D2 and D3 in (9) above. So by (10), all we need are finite lists of members of each lattice(Ci ) to write down a finite list of subgroups H containing lattice(K ). Since each Ci is small, it is easy to confirm the following facts: lattice(C1 ) = C1 ∪ {0} lattice(C2 ) = C2 ∪ {(0, 0, 0, 0, h, 0, s)} ∪ {0} lattice(C3 ) = C3 ∪ {(0, 0, 0, w, 0, r, 0)} ∪ {0} lattice(C4 ) = C4 ∪ {0} lattice(C5 ) = C5 ∪ {0} where we have added {0} to lattice(C1 ), lattice(C4 ) and lattice(C5 ). Since the cardinalities of these five lattices are 2, 5, 5, 2 and 2, respectively, the number of possibly different subgroups in ∑i lattice(Ci ) in (10) is at most 2 · 5 · 5 · 2 · 2 = 200. It turns out that we only need 1 + 4 + 4 + 1 + 1 = 11 subgroups, or more generally ∑i (|Ci | − 1), not ∏i |Ci |. This simplification is a generalization of the “Product Case” in section 6.3 of [CDK+ 13a]. The idea is that if H ∈ ∑i lattice(Ci ), so that H = ∑i Ci,j(i) where Ci,j(i) ∈ lattice(Ci ), then by independence of the Ci we get rank( H ) = ∑i rank(Ci,j(i) ), and we also get rank(φk ( H )) = ∑i rank(φk (Ci,j(i) )) by the construction of the Ci from the φk . Thus (7) follows from adding all the inequalities 3 rank(Ci,j(i) ) ≤ ∑ sk · rank(φk (Ci,j(i) )) . (11) k =1 There are only 11 such inequalities, because using Ci,j(i) = {0} only yields the trivial inequality 0 ≤ 0. The table below has one row for each Ci,j(i) , one column for rank(Ci,j(i) ), 3 columns for each rank(φk (Ci,j(i) )), and the rightmost column for the resulting inequality (11). 7 Ci,j(i) rank(Ci,j(i) ) rank(φ1 (Ci,j(i) )) rank(φ2 (Ci,j(i) )) rank(φ3 (Ci,j(i) )) C1,1 C2,1 C2,2 C2,3 C2,4 C3,1 C3,2 C3,3 C3,4 C4,1 C5,1 1 1 1 1 2 1 1 1 2 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 Inequality (11) 1≤ 1≤ 1≤ 1≤ 2≤ 1≤ 1≤ 1≤ 2≤ 1≤ 1≤ s1 + s3 s1 + s2 s2 + s3 s1 + s3 s1 + s2 + s3 s1 + s2 s2 + s3 s1 + s3 s1 + s2 + s3 s2 + s3 s1 + s2 Removing redundant inequalities, we get just the following four: 1 ≤ s1 + s2 , 1 ≤ s1 + s3 , 1 ≤ s2 + s3 , 2 ≤ s1 + s2 + s3 We see that minimizing ∑3i=1 si subject to these inequalities yields the desired value of 2, say by choosing s1 = s2 = s3 = 2/3. The solution (s1 , s2 , s3 ) is not unique, but their sum is. 4.3 Proof of the lower bound BCKW H ( RSσMW σH )1/2 [RD16] shows how to attain the communication lower bound (3) for any algorithm expressible as perfectly nested loops accessing arrays whose subscripts are all affine functions of the loop indices, including CNNs. It does this by showing how to construct an optimal tiling in all such cases (tilings are explained in more detail in Section 5). But this is not the end of the story, because [RD16] assumes the loop bounds are big enough to fit an entire tile. For CNNs, however, this is often not the case: if the size RS of individual convolution is sufficiently small, the optimal tile size given by [RD16] may have block sizes for r and s bigger than the array bounds R and S. In this case, a tighter lower bound holds. Using the notation introduced above, we still want to bound the number of lattice points |V | in any set V of 7-tuples (b, c, k, w, h, r, s) of integers, given the bounds |φi (V )| ≤ M for i ∈ {1, 2, 3}. However, we want a bound that is tighter than M2 when RS is small. We will begin by rewriting the loop indices as r = σw r 0 + r 00 and s = σh s0 + s00 , where r 00 ∈ [0, σw − 1] and s00 ∈ [0, σh − 1]. Replace the loop over r with loops over r 0 (from 0 to R/σw − 1) and r 00 (from 0 to σw − 1), and replace the loop over s similarly. Since each r, s maps uniquely onto a single r 0 , r 00 , s0 , s00 , we can lift both Image and Filter onto a higher dimension. There is a one-to-one correspondence between every point in the original seven-dimensional lattice and every point in the lifted nine-dimensional lattice. Therefore, it suffices to bound the number of lattice points |V | of any set V of 9-tuples (b, c, k, w, h, r 0 , r 00 , s0 , s00 ) such that |φi0 (V )| ≤ M, with φi0 defined as follows: φ10 (b, c, k, w, h, r 0 , r 00 , s0 , s00 ) = (b, k, w, h) φ20 (b, c, k, w, h, r 0 , r 00 , s0 , s00 ) = (b, c, r 0 , r 00 , w, s0 , s00 , h) φ30 (b, c, k, w, h, r 0 , r 00 , s0 , s00 ) = (c, k, r 0 , r 00 , s0 , s00 ) 8 Lemma 4.2 Let V be any set of 9-tuples of integers (b, c, k, w, h, r 0 , r 00 , s0 , s00 ) where |φi0 (V )| ≤ M for i ∈ {1, 2, 3}, and 1 ≤ r 0 ≤ R/σW and 1 ≤ s ≤ S/σH . Then |V | ≤ ( RS)1/2 M3/2 . (σW σH )1/2 This bound is obviously tighter than M2 precisely when RS < MσW σH . Plugging G = ( RS)1/2 M3/2 (σW σH )−1/2 into (3) immediately yields: Corollary 4.3 The number of reads and writes to execute a CNN with a fast memory of size M is at least BCKW H ( RSσW σH /M )1/2 . Proof of Lemma 4.2: Let V (r 0 , s0 ) denote the restriction of V to a given value of r 0 , s0 , so that V = ∪r0 ,s0 V (r 0 , s0 ) is a disjoint union of sets and |V | = ∑r0 ,s0 |V (r 0 , s0 )|. Note that φ30 (V ) = ∪r0 ,s0 φ30 (V (r 0 , s0 )) is also a disjoint union of sets, so |φ30 (V )| = |φ30 (V (r 0 , s0 ))| ≤ M ∑ 0 0 (12) r ,s Also |φ10 (V (r 0 , s0 ))| ≤ |φ10 (V )| ≤ M and |φ20 (V (r 0 , s0 ))| ≤ |φ20 (V )| ≤ M. We want to bound |V (r 0 , s0 )| in terms of these bounds on |φ10 (V (r 0 , s0 ))|, |φ20 (V (r 0 , s0 ))|, and |φ30 (V (r 0 , s0 ))|. This is another application of the HBL inequalities discussed in section 4.2. Since each of the loop indices appear in exactly two of the three φi0 , this is a special case of a tensor contraction, for which the optimal exponents are s1 = s2 = s3 = 1/2 as shown in Section 6.3 of [CDK+ 13a]. This yields: |V | = |V (r 0 , s0 )| ∑ 0 0 r ,s ≤ |φ10 (V (r 0 , s0 ))|1/2 · |φ20 (V (r 0 , s0 ))|1/2 · |φ30 (V (r 0 , s0 ))|1/2 ∑ 0 0 r ,s ≤ M1/2 · M1/2 · |φ30 (V (r 0 , s0 ))|1/2 ∑ 0 0 r ,s = M · ∑ |φ30 (V (r 0 , s0 ))|1/2 r 0 ,s0 We want to maximize this subject to (12). Since we are summing RS/(σw σh ) terms, a simple application of Lagrange multipliers tells us that this maximum is attained when all |φ30 (V (r 0 , s0 ))| = M/( RS/(σw σh )), yielding the desired |V | ≤ ( RS 1/2 3/2 ) M . σw σh  5 Communication Optimal Algorithms In this section we show that the lower bounds in Theorem 1 are always attainable by an appropriate tiling, analogous to the one for matrix multiplication in section 3. We will prove this by constructing a tiling for any possible set of array bounds, and verifying that the tiling attains one 9 of lower bounds from (4). The tile sizes we construct may also be useful starting points for optimization in practice, although the exact tile sizes may not necessarily give the best performance (due to constant factors omitted from our analysis). Following the approach of [RD16], we will achieve this tiling by blocking each variable into contiguous blocks, except for r and s, which we will rewrite as r = σw r 0 + r 00 and s = σh s0 + s00 (with r 00 ∈ [0, σw − 1] and s00 ∈ [0, σh − 1]) respectively. That is, we will rewrite our loop as follows, where we use for i = α : β : γ to denote iterating from α to γ with a step size of β: for {b, c, k, w, h}1 = 0 : b{b,c,k,w,h} : { B, C, K, W, H } − b{b,c,k,w,h} , for r10 = 0 : br0 : R/σw − br0 , for r100 = 0 : br00 : σw − br00 , for s10 = 0 : bs0 : S/σh − bs0 , for s100 = 0 : bs00 : σh − bs00 , for {b, c, k, w, h}2 = 0 : b{b,c,k,w,h} − 1 for r20 = 0 : br0 − 1, for r200 = 0 : br00 − 1, for s20 = 0 : bs0 − 1, for s200 = 0 : bs00 − 1, {b, c, k, w, h, r 0 , r 00 , s0 , s00 } = {b, c, k, w, h, r 0 , r 00 , s0 , s00 }1 + {b, c, k, w, h, r 0 , r 00 , s0 , s00 }2 Out(k, h, w, b)+ = Image(r 00 + σw (r 0 + w), s00 + σh (s0 + h), c, b) × Filter (k, σw r 0 + r 00 , σh s0 + s00 , s, c) To minimize the communication cost, it suffices to maximize the size of each block (that is, bb bc bk bw bh br0 br00 bs0 bs00 ) subject to the following constraints: 1. Each block size must be positive: b{b,c,k,w,h,r0 ,r00 ,s0 ,s00 } ≥ 1 2. The block size in each dimension is smaller than the loop bound for that dimension. For the first five indices, we have: b{b,c,k,w,h} ≤ { B, C, K, W, H } The loop bounds on r 00 and s00 (given by their definitions) give the following two constraints: br00 bs00 ≤ σw ≤ σh To ensure that the blocks for r 0 and s0 are of appropriate size, recall that r = σw r 0 + r 00 and s = σh s0 + s00 , which gives σw br0 + br00 σh bs0 + bs00 ≤ R ≤ S Since br00 ≤ σw and bs00 ≤ σh , we can safely omit those from the inequality (since their effect on left-hand side is at most equivalent to adding 1 to br0 and bs0 , and we are only interested in asymptotics) to get σw br0 σh bs0 10 ≤ R ≤ S 3. The size of each block does not exceed the size of fast memory M. This is straightforward for Out: bb bk bw b h ≤ M as well as Filter: bc bk br0 br00 bs0 bs00 ≤ M . 0 0 ], a block of r 00 is [r 00 , r 00 ] and a block for For Image, notice that if a block for r 0 is [rstart , rend start end w is [wstart , wend ], then the indices of Image in the w-dimension accessed will be of the form 00 , r 00 ] and j ∈ [ w 0 0 i + σw j, where i ∈ [rstart start + rstart , wend + rend ]. As a result, the number of end indices in the w-dimension accessed is (bw + br0 )br00 ; similarly for the h-dimension. Therefore, the total number of elements accessed from Image must be: bb bc (bw + br0 )(bh + bs0 )br00 bs00 ≤ M . As we will see shortly, it is convenient to recast our maximization problem as a linear program by taking logs; for this to happen, we only want products in the inequality. Multiplying out the left-hand side of the above gives a sum of four terms; bounding each of them by M is sufficient for an asymptotic analysis. Therefore, we get: ≤ ≤ ≤ ≤ bb bc bw bh br00 bs00 bb bc bw bs0 br00 bs00 bb bc br0 bh br00 bs00 bb bc br0 bs0 br00 bs00 M M M M Taking the log base M of the objective and all the constraints, we get the following linear program, with l{b,...,s00 } = log M b{b,...,s00 } : max lb + lc + lk + lw + lh + lr0 + lr00 + ls0 + ls00 s.t. l{b,c,k,w,h,r0 ,r00 ,s0 ,s00 } ≥ 0 l{b,c,k,w,h} ≤ {log M B, log M C, log M K, log M W, log M H } lr00 ls00 log M σw + lr0 log M σh + ls0 lb + lk + lw + lh lc + lk + lr0 + lr00 + ls0 + ls00 lb + lc + lw + lh + lr00 + ls00 lb + lc + lw + ls0 + lr00 + ls00 lb + lc + lr0 + lh + lr00 + ls00 lb + lc + lr0 + ls0 + lr00 + ls00 ≤ ≤ ≤ ≤ ≤ ≤ ≤ ≤ ≤ ≤ log M σw log M σh log M R log M S 1 1 1 1 1 1 (13) We will first determine a closed-form solution for this linear program; that is, we will partition the space of possible input parameters (i.e. the array bounds and strides) into convex polytopes, within each of which the optimal tiling and communication cost it achieves are described by a single linear function of the input parameters. We will then use this closed-form solution to verify optimality of the tiling (and attainability of the lower bound) by showing that the communication 11 cost of the optimal tiling is always equal to a communication lower bound for every point in the parameter space. Although this construction and verification can in theory be performed by hand (see Appendix A for a hand analysis of the case where σw = σh = 1), the size of the result - the partition we find is a set of 200 regions - makes it far more expedient to automate the analysis, which will also allow us to more easily extend this approach to other problems. An implementation of the algorithm, as well as a table of partitions, optimal tilings, and optimal communication costs in each of these partitions, may be found at https://people.eecs.berkeley.edu/~dinh/papers/ DD18/partitioning.nb. 5.1 Determining the optimal tiling Algorithms for determining a closed-form solution to the parameterized linear programs have been studied extensively in the context of control theory [GN72, BBM03, STJ05, JBM07]. We used the geometric algorithm from [BBM03], which we briefly describe in this section and fully specify in Figure 1.; see the original paper for a proof of correctness. For convenience, represent the LP (13) as min c T x s.t Gx ≤ w + Fθ where c = [−1, ..., −1] T , x = [lb , lc , ..., ls00 ], G is the coefficient matrix for the left-hand side of the inequalities, θ = [log M B, log M C, ..., log M σh ] T , and F and w are the coefficient matrix and vector, respectively, for the right-hand side of the inequalities. The intuition for the algorithm is as follows: start with a (possibly open) polytope in parameter space; during the first iteration of the algorithm, this is the set of all possible valid loop bounds and strides (i.e. nonnegative parameters, filter fitting inside the input). Pick a random point (not necessarily uniformly) inside that region, setting the parameters to its coordinates. Solve the linear program at that point using a method, such as simplex, that guarantees that the solution produced will be a vertex of the polytope, and note which constraints are made tight. The number of tight constraints should be at least to the number of variables in the linear program, which is nine in this case, since our solution is a vertex of the polytope. If there are more than nine constraints, there are two possibilities: either (a) when the constraints are set to equality (to ensure tightness), there are redundant constraints, and the number of non-redundant constraints is nine, or (b) the point we selected lies on the border of two partitions in parameter space. Since the borders of partitions are of lower dimension than the parameter space itself (and since we selected our initial point randomly), the probability that we encounter case (b) is zero2 . If there are nine tight constraints at our solution, the optimizer x ∗ (θ ) at this point is the solution to Gt x = wt + Ft θ, where Gt , wt , and Ft correspond to G, w, and F restricted to the tight constraints. The polytope (in parameter space) within which x ∗ (θ ) is the optimizer is given by Gs x ∗ (θ ) ≤ ws + Fs θ, where Gs , ws , and Fs are the restrictions of G, w, and F to slack constraints. Similarly, if there are more than nine tight constraints, we set the tight constraints to equality and solve to get the optimizer; the polytope is defined as the region where the slack constraints remain slack at the optimizer (see Figure 1 for details). 2 Because of the discreteness of random number generators in practice, as well as the possibility of using a nonuniform sampler for performance, the probability may not be exactly zero. Nevertheless, randomly resampling a point or perturbing our initial point if we see case (b) is sufficient. 12 Data: An initial region R = Aθ ≤ b to explore Result: A set {( Ri , x̂i (θ ))}, where Ri form a partition of R and x̂i (θ )) are logs (base M) of the optimal tile sizes for θ ∈ Ri if R is lower dimension or empty then return ∅ end Randomly sample element θ0 ∈ R x0∗ ← optimizer for min c T x s.t. Gx ≤ w + Fθ0 (solve using simplex) A(θ0 ) ← indices of zeros of Gx0∗ − Fθ ( Gt , wt , Ft ) ← rows A(θ0 ) of ( G, w, F ) ( Gs , ws , Fs ) ← rows {1, ..., |w|}\ A(θ0 ) of ( G, w, F ) if | A| = 9 then x̂1 (θ ) ← Gt−1 Ft θ + Gt−1 wt else    x ∗ (θ )  Row-reduce the linear system Gt − Ft = wt to θ  ∗     x (θ ) q U P = 0 D θ r if D, r 6= 0 then // This occurs w.p. 0 Resample θ0 and restart. end x̂1 (θ ) ← −U −1 p + U −1 q end R1 ← {θ : Gs x ∗ (θ ) ≤ ws + Fs θ } Si ← polytope consisting of points that violates the ith of R1 and satisfies constraints 1 through i − 1 Recursively partition each Si to get set of regions, optimizers Ti . return {( R1 , x̂1 (θ ))} ∪ T1 ∪ T2 ... Figure 1: Algorithm for partitioning parameter space Once we have obtained this polytope, we partition the remainder of our initial polytope into convex polytopes and recursively partition each one using this algorithm. We terminate when the remainder is either empty or is of lower dimension than parameter space. 5.2 Verifying optimality of the tiling In order to verify the optimality of the tiling and the attainability of the lower bound, we must ensure that the communication cost attained by the tiling equals the maximum of the five lower bounds for every possible element. Define the function C p (θ ) as the log of the communication cost at point θ using the tiling provided by the algorithm above for partition p, that is: C p (θ ) := log M B + log M C + log M K + log M W + log M H + log M R + log M S +1 − p x̂b (θ ) + p x̂c (θ ) + p x̂k (θ ) + p x̂w (θ ) + 13 p x̂h (θ ) + p x̂r0 (θ ) + p x̂r00 (θ ) + x̂s0 (θ ) + (14)  p x̂s00 (θ ) p p where x̂b , ..., x̂s00 represent the closed-form optimizers in region p as a function of θ, and let Li (θ ) be the ith lower bound from (4) as a function of θ. It suffices to show that for every partition p and parameter set θ ∈ p, C p (θ ) is equal to the maximum of the five lower bounds; in other words, that the quantity max C p (θ ) − Li (θ ) s.t. θ θ Li ( θ ) ∈ ≥ p L j (θ ) ∀ j 6= i is zero for all i ∈ {1, ..., 5} and for all partitions p. This is not precisely the case - in the cases where all the inputs and outputs fit inside fast memory, the result may be nonzero since the computation in Equation 14 assumes that M words are transmitted in each round (which is obviously more than the number of words transmitted if everything fits in cache); as a result, we exclude regions where the communication lower bound is less than M. The LP solutions can easily be checked to be correct using an LP solver; for our code and results, see https://people.eecs.berkeley.edu/ ~dinh/papers/DD18/partitioning.nb. As a sanity-check, we can also ensure that no tiling generated by our LP breaks any of our lower bounds, i.e. min C p (θ ) − Li (θ ) s.t. θ θ ∈ p should be nonnegative for all p, i. This is confirmed by our code as well. 6 Conclusions and Future Work We have found an asymptotic lower bound on communication required to evaluate a convolutional neural net, and provided an optimal reordering of the nested loops to attain the lower bound in every case by taking advantage of significantly more data reuse than is possible with matrix multiply or many other dense linear algebra operations. We see two main avenues for future research: Implementation and benchmarking: The tilings we generate are asymptotically optimal in terms of communication. However, many factors, such as cache locality and processor architecture (tile sizes that are multiples of a processor’s vector width are likely to be more efficient), can provide significant constant-factor changes to the real-world performance (both in terms of time and energy). Implementing and benchmarking our algorithms would allow programmers determining the most important parameters to tune for real-world performance while maintaining asymptotic efficiency at all input dimensions. Furthermore, while our model does allow us to bound per-node communication in a multiprocessor setup, an efficient parallel implementation requires a significant amount of tuning to optimize all the constant factors. Generalizing to arbitrary nested loops: Our lower bound in the “small filter” case rests on a problem-specific lifting of the HBL LP to a higher dimension; similarly, our approach for finding a closed form for optimal tilings (which is necessary for checking if a lower bound is always attainable) relies on the creation of a linear program tailored to this specific problem. Generalizing this to arbitrary nested loops would move us closer to being able to automatically optimize arbitrary loop nests for communication, e.g. at a compiler level. 14 References [BBM03] F. Borrelli, A. Bemporad, and M. Morari. Geometric algorithm for multiparametric linear programming. Journal of Optimization Theory and Applications, 118(3):515–540, Sep 2003. [BDHS11] G. Ballard, J. Demmel, O. Holtz, and O. Schwartz. Minimizing communication in numerical linear algebra. SIAM J. Mat. Anal. Appl., 32(3):866–901, 2011. [BDHS12] G. Ballard, J. Demmel, O. Holtz, and O. Schwartz. Graph expansion and communication costs of fast matrix multiplication. JACM, 59(6), Dec 2012. [Bir63] G. Birkhoff. Lattice Theory. American Math Society, 1963. [CDK+ 13a] M. Christ, J. Demmel, N. Knight, T. Scanlon, and K. Yelick. Communication lower bounds and optimal algorithms for programs that reference arrays - part 1. arxiv.org/abs/1308.0068, 2013. [CDK+ 13b] M. Christ, J. Demmel, N. Knight, T. Scanlon, and K. Yelick. Communication lower bounds and optimal algorithms for programs that reference arrays - part 1. Tech Report UCB/EECS-2013-61, UC Berkeley Computer Science Division, May 2013. [CDK+ 15] M. Christ, J. Demmel, N. Knight, T. Scanlon, and K. Yelick. On HolderBrascamp-Lieb inequalities for torsion-free discrete Abelian groups. https://arxiv.org/abs/1510.04190, 2015. [FM11] Samuel H. Fuller and Lynette I. Millett, editors. The Future of Computing Performance: Game Over or Next Level? The National Academies Press, Washington, DC, 2011. [GN72] Tomas Gal and Josef Nedoma. Multiparametric linear programming. Management Science, 18(7):406–422, 1972. [GSP05] Susan L. Graham, Marc Snir, and Cynthia A. Patterson, editors. Getting Up to Speed: The Future of Supercomputing. The National Academies Press, Washington, DC, 2005. [HK81] X. Hong and H. T. Kung. I/O complexity: the red blue pebble game. In Proceedings of the 13th Symposium on the Theory of Computing, pages 326–334. ACM, 1981. [ITT04] D. Irony, S. Toledo, and A. Tiskin. Communication lower bounds for distributedmemory matrix multiplication. J. Parallel Distrib. Comput., 64(9):1017–1026, 2004. [JBM07] C.N. Jones, M. Baric, and M. Morari. Multiparametric linear programming with applications to control. European Journal of Control, 13(2):152 – 170, 2007. [Kni15] N. Knight. Communication-Optimal Loop Nests. PhD thesis, University of California, Berkeley, California, August 2015. [RD16] A. Rusciano and J. Demmel. arxiv.org/abs/1611.05944, 2016. [Sco15] J. Scott. An I/O-Complexity Lower Bound for All Recursive Matrix Multiplication Algorithms by Path-Routing. PhD thesis, UC Berkeley, Mathematics Dept., Berkeley, CA, 2015. Parallelepipeds obtaining HBL lower bounds. 15 [STJ05] Jørgen Spjøtvold, Petter Tøndel, and Tor A. Johansen. A method for obtaining continuous solutions to multiparametric linear programs. IFAC Proceedings Volumes, 38(1):253 – 258, 2005. 16th IFAC World Congress. [Val10] S. Valdimarsson. The Brascamp-Lieb polyhedron. Canadian J. Math., 62(4):870–888, 2010. 16 Appendix A: Manual Exploration of Tilings In this section we show, by hand, that the lower bounds in Theorem 1 are attainable in the case where σw = σh = 1 . The advantage of this approach appears is that it seems to be possible to attain far more compact representations of the optimal tiling function than with an automated exploration, which produced well over twice as many cases (for the one-stride case) as the hand exploration in this section. There are a number of cases, depending on which of the five terms in Theorem 1 is largest, and other inequalities. To simplify the presentation, we present the overall result as a decision tree, where each leaf of the tree represents a disjoint subset of the possible lower bounds and optimal algorithms. After stating the result, we will give some intuition for the decision tree, as arising from a linear program, and then prove the theorem by providing an algorithm and communication cost analysis, with a separate lemma for each leaf. Theorem 2 The following cases describe which of the lower bound expressions in Theorem 1 are attainable. The abbreviation ALB stands for Attainable Lower Bound: if min(CHWB, KCRS, KHWB) ≤ M Case 1: ALB = O(max(CHWB, KCRS, KHWB)) else (Case 2) if RS ≥ M Case 2.1: ALB = O(KCHWBRS/M) else (Case 2.2) if MRS ≥ ( BHW )2 Case 2.2.1: ALB = O(KCRS) else (Case 2.2.2) if min(C, K ) ≥ ( M/( RS))1/2 Case 2.2.2.1: ALB = O(KCHWB( RS/M)1/2 ) else Case 2.2.2.2: ALB = O(max(KHWB, CHWB)) Here is some intuition for why the cases in Theorem 2 arise, and some notation we will use later in the proof. Suppose we tile the b loop with block size bB, the k loop with bK, the h loop with bH, and so on. Then the algorithm becomes: Algorithm BlockCNN (b|bB, c|bC, k|bK, w|bW, h|bH, r |bR, s|bS, ) : for {b, c, k, w, h, r, s}1 = 0 : b{b,c,k,w,h} : { B, C, K, W, H, R, S} − b{b,c,k,w,h,r,s} for {b, c, k, w, h, r, s}2 = 0 : b{b,c,k,w,h,r,s} − 1 {b, c, k, w, h, r, s} = {b, c, k, w, h, r, s}1 + {b, c, k, w, h, r, s}2 Out(k, h, w, b)+ = Image(r 00 + σw (r 0 + w), s00 + σh (s0 + h), c, b) × Filter (k, σw r 0 + r 00 , σh s0 + s00 , s, c) The argument list in the name is meant to indicate both the order of the nested loops, via the notation b|, k |, h|, etc., and the block sizes. A natural way to try to optimize this code is to pick the block sizes so that all the data accessed in the 7 innermost loops fits in fast memory of size M, and to maximize the number of loop iterations that can be performed by these loops, namely bB · bK · bH · bW · bR · bS · bC. It is easy to see that the submatrix of Out accessed by these loops is of size bK · bH · bW · bB, the submatrix of Filter accessed is of size bK · bR · bS · bC, and the 17 submatrix of Image accessed is of size bC · (bS + bH ) · (bR + bW ) · bB. Since R ≤ W, we will assume bR ≤ bW, and similarly bS ≤ bH, which means the submatrix of C accessed is of size at most 4 · bC · bH · bW · bB; we will ignore the constant 4 for simplicity, since it does not change our Big-O analysis below. This yields the following optimization problem: maximize G = bB · bK · bH · bW · bR · bS · bC subject to the constraints bK · bH · bW · bB ≤ M bC · bH · bW · bB ≤ M bK · bR · bS · bC ≤ M bR ≤ bW, bS ≤ bH bB ≤ B, bK ≤ K, bH ≤ H, bW ≤ W, bR ≤ R, bS ≤ S, bC ≤ C bB ≥ 1, bK ≥ 1, bH ≥ 1, bW ≥ 1, bR ≥ 1, bS ≥ 1, bC ≥ 1 We call a tiling admissible if it satisfies the constraints above. (The reader may wonder why the first 3 constraints do not use the upper bound M/3 instead of M, to be sure all three submatrices fit in fast memory simultaneously; this would only change the value of G by a constant factor, which would not change the following Big-O analysis.) Then assuming the 3 submatrices are each read or written just once in the innermost 7 loops, the total number of reads and writes is O( BKHWCRSM/G ), since BKHWCRS is the total number of loop iterations, BKHWCRS/G is the number of iterations of the outermost 7 loops, and there are O( M ) reads/writes per iteration of the outermost 7 loops. This last statement about O( M) read/writes per iteration may depend on the cache replacement policy in the hardware, but again it will not change the Big-O analysis. If we now replace each quantity by its logarithm base M, so B by lB = log M B, bB by lbB = log M bB and so on, we get the following linear program: maximize lG = lbB + lbK + lbH + lbW + lbR + lbS + lbC subject to the constraints lbK + lbH + lbW + lbB ≤ 1 lbC + lbH + lbW + lbB ≤ 1 lbK + lbR + lbS + lbC ≤ 1 lbR ≤ lbW, lbS ≤ lbH lbB ≤ lB, lbK ≤ lK, lbH ≤ lH, lbW ≤ lW, lbR ≤ lR, lbS ≤ lS, lbC ≤ lC lbB ≥ 0, lbK ≥ 0, lbH ≥ 0, lbW ≥ 0, lbR ≥ 0, lbS ≥ 0, lbC ≥ 0 Exploring the finite number of corners of the polytope defined by this linear program lead to the cases in Theorem 2. While the proof of Theorem 2 requires this exploration by hand, and confirming that the lower bound of Theorem 1 is attained, in practice the linear program could be used to determine the optimal block sizes. We note that this linear program has 7 variables and 12 constraints (besides nonnegativity), so as many as 12-choose-7 = 792 corners in the feasible polytope to explore; fortunately only a few turn out to be important. To keep the proofs short, we will use the notation BlockCNN above, and the cost expression O( BKHWCRSM/G ), to describe the optimal algorithm in each case. We will use the expression LB = max(KHWB, CHWB, KCRS, KCHWBRS/M, KCHWB( RS/M )1/2 ) to denote the lower bound from Theorem 1. To capture (some of) the non-uniqueness of the optimal solutions, we will use the following two functions to help solve linear programs: Function ( x, y) = f 2 ( x̄, ȳ, s) takes 3 nonnegative arguments satisfying x̄ + ȳ ≥ s, and returns some 0 ≤ x ≤ x̄ and 0 ≤ y ≤ ȳ satisfying x + y = s. Function ( x, y, z) = f 3 ( x̄, ȳ, z̄, s) similarly takes 4 nonnegative 18 arguments satisfying x̄ + ȳ + z̄ ≥ s, and returns some 0 ≤ x ≤ x̄, 0 ≤ y ≤ ȳ and 0 ≤ z ≤ z̄ satisfying x + y + z = s. Lemma 6.1 Upper Bound Case 1: Suppose min(CHWB, KCRS, KHWB) ≤ M, i.e. at least one of the 3 arrays Image, Filter and Out fits in fast memory. Then the attainable communication lower bound is O(max(CHWB, KCRS, KHWB)). Proof: Case 1 in turn breaks down into a number of subcases (again, we ignore constant factors): Case 1.1.: CHWB ≤ M, KCRS ≤ M, KHWB ≤ M. Use BlockCNN(b| B, k |K, h| H, w|W, r | R, s|S, c|C), i.e. the original unblocked algorithm, LB = max(CHWB, KHWB, KCRS) because KCRS ≤ M implies RS ≤ M implies KCHWBRS/M ≤ KCHWB( RS/M )1/2 ≤ KCHWB(KC )−1/2 = (KC )1/2 HWB ≤ max(K, C ) HWB Case 1.2.: CHWB ≥ M, KCRS ≤ M, KHWB ≤ M. Use BlockCNN(b|1, k |K, h| H, w|W, r | R, s|S, c|( M/( HW )). It is straightforward to confirm that this tiling is admissible. Then G = KHWRS( M/( HW )) = KRSM, and so the number of read/writes is O(CHWB). The same inequalities as in Case 1.1 show KCHWBRS/M ≤ KCHWB( RS/M)1/2 ≤ max(K, C ) HWB = CHWB so that LB = max(CHWB, KHWB, KCRS). Case 1.3.: CHWB ≤ M, KCRS ≤ M, KHWB ≥ M. Swap the roles of C and K in Case 1.2. Case 1.4.: CHWB ≤ M, KCRS ≥ M, KHWB ≤ M, KC ≤ M. Let (lbR, lbS) = f 2 (lR, lS, 1 − lK − lC ), and then bR = MlbR and bS = MlbS . Then use BlockCNN(b| B, k |K, h| H, w|W, r |bR, s|bS, c|C). Admissibility follows from the definition of f 2 (). Then G = KHWB( M/KC )C = HW MB, and the number of reads/writes is O(KCRS). To show LB = max(CHWB, KHWB, KCRS) we first note CHWB ≤ M implies HWB ≤ M implies KCHWBRS/M ≤ KCRS. Multiplying the first 3 inequalities defining Case 1.4 yields KCRS · M · M ≥ M · CHWB · KHWB, or RS ≥ ( RS/M)1/2 HWB, and thus KCRS ≥ KCHWB( RS/M)1/2 . Case 1.5.: CHWB ≤ M, KCRS ≥ M, KHWB ≤ M, KC ≥ M. RS ≤ HW ≤ M, so lR + lS ≤ 1. Let (lbK, lbC ) = f 2 (lK, lC, 1 − lR − lS), and then bK = MlbK and bC = MlbC . Then use BlockCNN(b| B, k |bK, h| H, w|W, r | R, s|S, c|bC). Admissibility follows from the definition of f 2 (). Then G = ( M/( RS)) HWRSB = HW MB, and the number of reads/writes is O(KCRS). Showing LB = max(CHWB, KHWB, KCRS) is identical to Case 1.4. Case 1.6: CHWB ≥ M, KCRS ≤ M, KHWB ≥ M. KC ≤ M so max(K, C ) ≤ M. Let (lbB, δh , δw ) = f 3 (lB, lH − lS, lW − lR, 1 − max(lC, lK ) − lR − lS). This is well-defined because lH − lS ≥ 0 is equivalent to H ≥ S, lW − lR ≥ 0 is equivalent to W ≥ R, 1 − max(lC, lK ) − lR − lS ≥ 0 is equivalent to M ≥ max(KRS, CRS), which is implied by KCRS ≤ M, and lB + lH − lS + lW − lR ≥ 1 − max(lC, lK ) − lR − lS is equivalent to max(KHWB, CHWB) ≥ M. Now let lbH = lS + δh ≤ lH, lbW = lR + δw ≤ lW, bB = MlbB , bH = MlbH and bW = MlbW . Thus S ≤ bH ≤ H and R ≤ bW ≤ W. Then 19 use BlockCNN(b|bB, k |K, h|bH, w|bW, r | R, s|S, c|C). Admissibility follows from KCRS ≤ M and lbB + lbH + lbW = 1 − max(lC, lK ), so bB · bH · bW = M/ max(K, C ), and max(K · bH · bW · bB, C · bH · bW · bB) = M. Then G = KC ( M/ max(K, C )) RS = min(K, C ) MRS, and the number of reads/writes is O(max(KHWB, CHWB)). To show LB = max(CHWB, KHWB, KCRS) we note KCHWBRS/M ≤ HWB ≤ max(CHWB, KHWB) and KCHWB( RS/M)1/2 ≤ KCHWB(1/(KC ))1/2 = (KC )1/2 HWB ≤ max(K, C ) HWB. Case 1.7: CHWB ≥ M, KCRS ≥ M, KHWB ≤ M, K ≥ HWB. Use BlockCNN(b| B, k |K, h| H, w|W, r |1, s|1, c|( M/K )). Admissibility follows from ( M/K ) HWB ≤ M. Then G = MHWB and the number of reads/writes is O(KCRS). Note that KCRS ≥ HWBCRS ≥ CHWB ≥ KHWB and KCHWBRS/M ≤ KCRS. KHWB ≤ M and K ≥ HWB together imply HWB ≤ M1/2 ≤ ( MRS)1/2 , and hence KCHWB( RS/M)1/2 ≤ KCRS. So altogether LB = max(KCRS, CHWB, KHWB). Case 1.8: CHWB ≥ M, KCRS ≥ M, KHWB ≤ M, K ≤ HWB. Let (lbR, lbS) = f 2 (lR, lS, min(lR + lS, lH + lW + lB − lK )), and then bR = MlbR and bS = MlbS . Note that lH + lW + lB − lK ≥ 0 because K ≤ HWB. Use BlockCNN(b| B, k |K, h| H, w|W, r |bR, s|bS, c|( M/( HWB)). Admissibility follows since K · ( M/( HWB)) · bR · bS ≤ K · ( M/HWB) · ( HWB/K ) = M. Then G = BKHW ( M/HWB) min( RS, HWB/K ) = min(KMRS, MHWB) and the number of reads/writes is O(KCRSHWBM/ min(KMRS, MHWB)) = O(max(CHWB, KCRS)). KHWB ≤ M implies HWB ≤ M implies KCRSHWB/M ≤ KCRS. If KRS ≤ HWB, then K ( RS)1/2 M1/2 1/2 1/2 ) ) ≤ K( HWB/K = (KHWB ≤ 1, implying CHWB ≥ KCHWB( RS/M)1/2 . AlternaM1/2 M1/2 tively, if KRS ≥ HWB, then M ≥ KHWB ≥ ( HWB)2 /RS, so RS( HWB)2 /M ≤ ( RS)2 , and KCRS ≥ KCHWB( RS/M )1/2 . So altogether LB = max(KCRS, CHWB, KHWB). Case 1.9: CHWB ≤ M, KCRS ≥ M, KHWB ≥ M, C ≥ HWB. Swap the roles of C and K in Case 1.7. Case 1.10: CHWB ≤ M, KCRS ≥ M, KHWB ≥ M, C ≤ HWB. Swap the roles of C and K in Case 1.8.  Lemma 6.2 Upper Bound Case 2.1: Suppose RS ≥ M. Then the attainable communication lower bound is O(KCHWRSB/M). Proof: Note that HW ≥ RS ≥ M implies min(CHWB, KHWB, KCRS) ≥ M. Let (lbR, lbS) = f 2 (lR, lS, 1), lbW = lbR and lbH = lbS, and then bR = MlbR , bS = MlbS , bW = bR and bH = bS. Use BlockCNN(b|1, k |1, c|1, h|bH, w|bW, r |bR, s|bS). Admissibility follows from bR · bS = bH · bW = M. Then G = M2 , so the number of reads/writes is O(KCHWRSMB/G ) = O(KCHWRSB/M ). HW ≥ RS ≥ M implies KCHWRSB/M ≥ max(CHWB, KHWB, KCRS). RS ≥ M also implies KCHWBRS/M ≥ KCHWB( RS/M )1/2 . So LB = KCHWRSB/M.  Lemma 6.3 Upper Bound Case 2.2.1: Suppose min(CHWB, KCRS, KHWB) ≥ M, RS ≤ M and MRS ≥ ( HWB)2 . Then the attainable communication lower bound is O(KCRS). 20 Proof: Note that MHW ≥ MRS ≥ ( HWB)2 , so M ≥ B2 HW. Let bC = M/( HWB) ≥ 1, and so bC ≤ CHWB/( HWB) = C. Also KHWB ≥ M ≥ ( HWB)2 /( RS) so K ≥ HWB/( RS). Let bK = HWB/( RS) ≥ 1, and so bK ≤ K. Use BlockCNN(b| B, k |bK, h| H, w|W, r | R, s|S, c|bC). Admissibility follows from bC · HWB = M, bK · HWB = ( HWB)2 /( RS) ≤ M, and bC · bK · RS = M/( HWB) · HWB/( RS) · RS = M. Then G = bK · bC · HWRSB = HW MB, so the number of reads/writes is O(KCHWRSBM/( HW MB)) = O(KCRS). ( HWB)2 ≤ MRS implies HWB( RS/M)1/2 ≤ RS implies KCHWB( RS/M)1/2 ≤ KCRS. RS ≤ M implies KCHWBRS/M ≤ KCHWB( RS/M)1/2 ≤ KCRS. ( HWB)2 /RS ≤ M ≤ KHWB implies HWB ≤ KRS implies CHWB ≤ KCRS. Similarly, ( HWB)2 /RS ≤ M ≤ CHWB implies HWB ≤ CRS implies KHWB ≤ KCRS. Thus LB = KCRS.  Lemma 6.4 Upper Bound Case 2.2.2.1: Suppose min(CHWB, KCRS, KHWB) ≥ M, RS ≤ M, MRS ≤ ( HWB)2 and min(C, K ) ≥ ( M/( RS))1/2 . Then the attainable communication lower bound is O(KCHWB( RS/M)1/2 ). Proof: Let bK = bC = ( M/( RS))1/2 ≤ min(C, K ), and bR = R and bS = S. Let (lbB, δh , δw ) = f 3 (lB, lH − lS, lW − lR, (1 − lR − lS)/2). This is well-defined because lH − lS ≥ 0 is equivalent to H ≥ S, lW − lR ≥ 0 is equivalent to W ≥ R, (1 − lR − lS)/2 ≥ 0 is equivalent to ( M/RS)1/2 ≥ 1 or M ≥ RS, and lB + lH − lS + lW − lR ≥ (1 − lR − lS)/2 is equivalent to HWB/( RS) ≥ ( M/RS)1/2 , or ( HWB)2 ≥ MRS. Now let lbH = lS + δh ≤ lH, lbW = lR + δw ≤ lW, bH = MlbH , bW = MlbW and bB = MlbB . Then bS ≤ bH ≤ H, bR ≤ bW ≤ W, and bH · bW · bB = ( MRS)1/2 . Use BlockCNN(b|bB, k |bK, h|bH, w|bW, r |bR, s|bS, c|bC). Admissibility follows from bK · bH · bW · cB = bC · bH · bW · bB = bK · bC · bR · bS = M. Then G = bB · bK · bC · bH · bW · RS = M3/2 ( RS)1/2 , and the number of reads/writes is O(KCHWRSBM/( M3/2 ( RS)1/2 )) = O(KCHWB( RS/M)1/2 ). K ≥ ( M/( RS))1/2 implies KCHWB( RS/M )1/2 ≥ CHWB. C ≥ ( M/( RS))1/2 implies KCHWB( RS/M )1/2 ≥ KHWB. HWB ≥ ( MRS)1/2 implies KCHWB( RS/M)1/2 ≥ KCRS. RS ≤ M implies KCHWB( RS/M )1/2 ≥ KCHWBRS/M. Thus LB = KCHWB( RS/M)1/2 .  Lemma 6.5 Upper Bound Case 2.2.2.2: Suppose min(CHWB, KCRS, KHWB) ≥ M, RS ≤ M, MRS ≤ ( HWB)2 and min(C, K ) ≤ ( M/( RS))1/2 . Then the attainable communication lower bound is O(max(KHWB, CHWB)). Proof: Suppose w.l.o.g that C ≤ K, so C ≤ ( M/( RS))1/2 and KCRS ≥ M implies K ≥ M/(CRS) ≥ ( M/( RS))1/2 . Let bC = C, bK = C, bR = R and bS = S. Let (lbB, δh , δw ) = f 3 (lB, lH − lS, lW − lR, 1 − lC − lR − lS). This is well-defined because lH − lS ≥ 0 is equivalent to H ≥ S, lW − lR ≥ 0 is equivalent to W ≥ R, 1 − lC − lR − lS ≥ 0 is equivalent to M/(CRS) ≥ 1, which is implied by C ≤ ( M/RS)1/2 ≤ M/RS, and lB + lH − lS + lW − lR ≥ 1 − lC − lR − lS being equivalent to lC + lH + lW + lB ≥ 1 or CHWB ≥ M. Now let lbH = lS + δh ≤ lH, lbW = lR + δw ≤ lW, bH = MlbH , bW = MlbW and bB = MlbB . Then bS ≤ bH ≤ H, bR ≤ bW ≤ W, and bH · bW · bB = M/C. Use BlockCNN(b|bB, k |bK, h|bH, w|bW, r |bR, s|bS, c|bC). Admissibility follows from bK · bH · bW · bB = bC · bH · bW · bB = C · M/C = M, and bK · bC · bR · bS = C2 RS ≤ M. Then G = bB · bK · bC · bH · bW · bR · bS = C · C · M/C · R · S = CRSM, and the number of reads/writes is O(KCHWRSBM/(CRSM)) = O(KW HB). KHWB ≥ CHWB by assumption. HWB ≥ ( MRS)1/2 ≥ CRS implies KHWB ≥ KCRS. C ≤ ( M/( RS))1/2 ≤ M/( RS) implies KHWB ≥ KCHWB( RS/M )1/2 ≥ KCHWBRS/M. Thus LB = KHWB.  This completes the proof of Theorem 2. 21
8cs.DS
Distributed Construction of Purely Additive Spanners∗ Keren Censor-Hillel† Telikepalli Kavitha‡ Ami Paz† Amir Yehudayoff§ arXiv:1607.05597v1 [cs.DS] 19 Jul 2016 July 20, 2016 Abstract This paper studies the complexity of distributed construction of purely additive spanners in the CONGEST model. We describe algorithms for building such spanners in several cases. Because of the need to simultaneously make decisions at far apart locations, the algorithms use additional mechanisms compared to their sequential counterparts. We complement our algorithms with a lower bound on the number of rounds required for computing pairwise spanners. The standard reductions from set-disjointness and equality seem unsuitable for this task because no specific edge needs to be removed from the graph. Instead, to obtain our lower bound, we define a new communication complexity problem that reduces to computing a sparse spanner, and prove a lower bound on its communication complexity using information theory. This technique significantly extends the current toolbox used for obtaining lower bounds for the CONGEST model, and we believe it may find additional applications. 1 Introduction A graph spanner is a sparse subgraph that guarantees some bound on how much the original distances are stretched. Graph spanners, introduced in 1989 [PS89, PU89a], are fundamental graph structures which are central for many applications, such as synchronizing distributed networks [PU89a], information dissemination [CHKM12], compact routing schemes [Che13a, PU89b, TZ01], and more. Due to the importance of spanners, the trade-offs between their possible sparsity and stretch have been the focus of a huge amount of literature. Moreover, finding time-efficient constructions of spanners with optimal guarantees has been a major goal for the distributed computing community, with ingenious algorithms given in many studies (see, e.g., [EP04, Elk05, EZ06, DGPV09, BKMP10, BS07, DG08, DGP07, DGPV08, DMP+ 05, Pet10]). One particular type of spanners are purely additive spanners, in which the distances are promised to be stretched by no more than an additive term. However, distributed constructions of such spanners have been scarce, with the only known construction being a (+2)-additive spanner construction with O(n3/2 log n) edges in √ O( n log n + D) rounds in a network of size n and diameter D [LP13] (also follows from [HW12]). The absence of distributed constructions of purely additive spanners is explicitly brought into light by Pettie [Pet10], and implicitly mentioned in [DGP07]. † Department of Computer Science, Technion, Israel. {ckeren,amipaz}@cs.technion.ac.il. Supported by ISF individual research grant 1696/14. Part of this work was done while Ami Paz was visiting TIFR, Mumbai. ‡ Tata Institute of Fundamental Research, India. [email protected]. § Department of Mathematics, Technion, Israel. [email protected]. ∗ An extended abstract of this work will be presented in DISC 2016. 1 This paper remedies this state of affairs, by providing a study of the complexity of constructing sparse purely additive spanners in the synchronous CONGEST model [Pel00], in which each of n nodes can send an O(log n)-bit message to each of its neighbors in every round. Our contribution is twofold: first, we provide efficient constructions of several spanners with different guarantees, and second, we present new lower bounds for the number of rounds required for such constructions, using tools that are not standard in this context. 1.1 The Challenge A subgraph H of an undirected unweighted graph G = (V, E) is called a purely additive spanner with stretch β if for every every pair (u, v) ∈ V ×V , we have δ H (u, v) ≤ δ G (u, v)+β, where δ H (u, v) is the u-v distance in H and δ G (u, v) is the u-v distance in G. The goal in spanner problems is to construct a subgraph H that is as sparse as possible with β as small as possible, i.e., we seek a sparse subgraph of G which approximates all distances with a small stretch. The problem of computing sparse spanners with small stretch β is well-studied and we know how to construct sparse purely additive spanners for β = 2, 4, 6. These have sizes O(n3/2 ) [ACIM99], Õ(n7/5 ) [Che13b], and O(n4/3 ) [BKMP10], respectively. In a very recent breakthrough, it was √ log n) 4/3 O( [AB16a]. shown that there is no purely additive spanner of size at most n /2 In a bid to get sparser subgraphs than all-pairs spanners with the same stretch, the following relaxation of pairwise spanners has attracted recent interest. Here we are given P ⊆ V × V : these are our “relevant pairs” and we seek a sparse subgraph which approximates distances between all pairs in P with a small stretch. That is, for every pair (u, v) ∈ P, the graph H should satisfy δ H (u, v) ≤ δ G (u, v) + β and for pairs (u, v) outside P, the value δ H (u, v) could be arbitrarily large. Such a subgraph H is called a (+β)-pairwise spanner. We use τ (P) to denote the number of nodes appearing in P, i.e. τ (P) = |{u | ∃v : {u, v} ∈ P}|. The problem of constructing sparse pairwise spanners was first studied by Coppersmith and Elkin [CE06] who showed sparse subgraphs where distances for pairs in P were exactly preserved; these subgraphs were called pairwise preservers. A natural case for P is when P = S × V , where S ⊆ V is a set of source nodes — here we seek for a sparse subgraph that well-approximates s-v distances for all (s, v) ∈ S × V . Such pairwise spanners are called sourcewise spanners. Another natural setting is when P = S × S and such pairwise spanners are called subsetwise spanners. Purely additive spanners are usually built in three steps: first, building clusters which contain all high-degree nodes and adding all the edges of the unclustered nodes; second, building BFS trees which (+2)-approximate all the paths with many missing edges; and third, adding more edges to approximate the other paths. While our constructions follow the general outline of known sequential constructions of pairwise additive spanners [Kav15, KV13], their techniques cannot be directly implemented in a distributed setting. In the sequential setting, the clustering phase is implemented by repeatedly choosing a high-degree node and adding some of its edges to the spanner; these neighbors are marked and ignored in the rest of the phase. In the distributed setting, going over high degree nodes one by one, creating clusters and updating the degrees is too costly. Instead, we choose the cluster centers at random, as done by Thorup and Zwick [TZ05], Baswana and Sen [BS07], and Chechik [Che13b] (see also Aingworth et al. [ACIM99] for an earlier use of randomization for the a dominating set problem). Sources for BFS trees are carefully chosen in the sequential setting by approximately solving a set-cover problem, in order to cover all paths with many missing edges. Once again, this cannot 2 be directly implemented in the distributed setting, as the knowledge of all paths cannot be quickly gathered in one location, so we choose the BFS sources randomly [Che13b]. In both the clustering and BFS phases, the number of edges increases by a multiplicative logc n factor, for c < 1. The main challenge left is to choose additional edges to add to the spanner in order to approximate the remaining paths well. To this end, we make heavy use of the parallel-BFS technique of Holzer and Wattenhofer [HW12], which allows to construct BFS trees rooted at s different nodes in O(s + D) rounds. We use this technique to count edges in a path, to count missing edges in it, and to choose which edges to add to the spanner. Yet, interestingly, we are unable to match the guarantee on the number of edges of more sophisticated algorithms [BKMP10, Kav15, Woo10]. Some of these algorithms use the value of a path, which is roughly the number of pairs of cluster that get closer if the path is added to the spanner. We are not able to measure this quantity efficiently in the distributed setting, and this is one of the reasons we are unable to introduce (+6)-all-pairs spanner matching the sequential constructions. 1.2 Our Contribution We provide various spanner constructions in the CONGEST model, as summarized in Tables 1 and 2. Spanner Type (+2)-sourcewise (+2)-pairwise (+4)-pairwise (+4)-all-pairs (+8)-all-pairs (+2)-subsetwise (+4)-subsetwise Number of Edges — Distributed   1/4 O n5/4 |S| log3/4 n (Thm.1)   O n |P|1/3 log2/3 n (Thm.9)   2/7 6/7 O n |P| log n (Thm.13)   O n7/5 log4/5 n (Thm.5)   10/11 15/11 O n log n (Thm.18)   2/3 O n |S| log2/3 n (Cor.17)   4/7 6/7 O n |S| log n (Cor.17) Number of Edges — Sequential  1/4 O n5/4 |S| log1/4 n [KV13]   [AB16b] O n |P|1/3   2/7 3/7 O n |P| log n [Kav15]   O n7/5 log1/5 n [Che13b]  4/3 O n [BKMP10]   1/2 [Pet09, CGK13] O n |S|   1/2 O n |S| [Pet09, CGK13]  Table 1: The number of edges in our new constructions versus prior, sequential work. We compare our (+4)-subsetwise with a sequential construction of a (+2)-subsetwise spanner, and our (+8)-allpairs spanner with a (+6)-all-pairs spanner. The distributed spanner construction algorithms we present have three main properties: stretch, number of edges, and running time. All three properties hold w.h.p. (with high probability). That is, the algorithm stops in the desired time, with the desired number of edges and the spanner produced has the desired stretch with probability 1 − n−c , where c is constant of choice. However, we can trade the properties and guarantee two of the three to always hold: if the spanner is too dense or the stretch is too large, we can repeat the algorithm; if the running time exceeds some threshold, we can stop the execution and output the whole graph to get 0 stretch, or output an empty graph to get the desired number of edges. The edges of the constructed spanner can be counted over a BFS tree in G within O(D) rounds. In sourcewise, subsetwise and pairwise spanners, the stretch is measured by running BFS from the relevant nodes (nodes of S of appearing in P) for O(D) rounds in G and again in H; in all-pairs spanners, the stretch is measured by measuring the stretch of the underlying sourcewise or subsetwise spanner. 3 Spanner Type Number of Rounds (+2)-sourcewise O (|S| + D) (Thm.1) (+2)-pairwise O (τ (P) + D) (Thm.9) (+4)-pairwise (+4)-all-pairs O (τ (P) + D) O(n 3/5 log 1/5 (Thm.13) n + D) 1/11 (Thm.5) (+8)-all-pairs O(n7/11 log (+2)-subsetwise O(|S| + D) (Cor.17) (+4)-subsetwise O(|S| + D) (Cor.17) n + D) (Thm.18) Lower Bounds n  3/8  o n min Ω̃ |S| , Ω (D) 1/8 o n  1/2  n , Ω (D) min Ω̃ |P| 1/6   |P| Ω n log n o n  1/2  n , Ω (D) min Ω̃ |P| 1/7   |P| Ω n log n n o  min Ω̃ n3/10 , Ω (D) n o  min Ω̃ n7/22 , Ω (D) n  1/2  o n min Ω̃ |S| , Ω (D) 1/3 o n  1/2  n min Ω̃ |S|2/7 , Ω (D) [Pet10] [Pet10] (Thm.23) [Pet10] (Thm.26) [Pet10] [Pet10] [Pet10] [Pet10] Table 2: Running time: algorithms versus lower bounds, for number of edges as in Table 1. Ω̃ hides polylogarithmic factors. We complement our algorithms with some lower bounds for the CONGEST model. We show that any algorithm that constructs an additive (+2)-pairwise spanner with m edges on p ≤ m pairs must have at least Ω(p/(n log n)) rounds, as long as m ≤ n3/2 . For example, a CONGEST √ construction of a (+2)-pairwise spanner must take Ω̃( n) rounds. We also prove lower bounds for (α, β)-pairwise spanners (i.e., for which δ H (u, v) ≤ α δ G (u, v)+β). We show that any algorithm that constructs an (α, β)-pairwise spanner with m edges on p ≤ m pairs must have at least Ω(p/(n log n)) 4 rounds, as long as m ≤ n1+ 9α+3β−10 , where the constant in the Ω notation depends on α, β. We believe the difficulty in obtaining this lower bound arises from the fact that standard reductions from set-disjointness and equality are unsuitable for this task. At a high level, in most standard reductions the problem boils down to deciding the existence of an edge (which can represent, e.g., the intersecting element between the inputs); when constructing spanners, no specific edge needs to be added to the spanner or omitted from it, so the solution is allowed a considerable amount of slack that is not affected by any particular edge alone. Instead, to obtain our lower bound, we define a new communication complexity problem that reduces to computing a sparse spanner, and prove a lower bound on its communication complexity using information theory. In this new problem, which we call PART-COMPm,p , Alice has a set x ⊆ {1, . . . , m} of size |x| = p, and Bob has to output a set y ⊆ {1, . . . , m} of size |y| = m/2 so that x ∩ y = ∅. We show that any protocol that solves PART-COMPm,p must convey Ω(p) bits of information about the set x. This technique significantly extends the current toolbox used for obtaining lower bounds for the CONGEST model. As such, we believe it may find additional applications, especially in obtaining lower bounds for computing in this model. Roadmap: We conclude this section with a further discussion of related work. Section 2 contains the definition of the model and some basic routines. In Section 3 we present distributed algorithms for computing the various types of spanners discussed above. In Section 4 we present our new lower bounds, and we conclude with a short discussion in Section 5. 4 1.3 Related Work Sparse spanners with a small multiplicative stretch are well-understood: Althöfer et al. [ADD+ 93] in 1993 showed that any weighted graph G on n vertices has a spanner of size O(n1+1/k ) with multiplicative stretch 2k − 1, for every integer k ≥ 1. Since then, several works [BS07, DHZ00, EP04, Elk05, Knu14, Pet09, RTZ05, RZ11, TZ06] have considered the problem of efficiently constructing sparse spanners with small stretch and have used spanners in the applications of computing approximate distances and approximate shortest paths efficiently. For unweighted graphs, one seeks spanners where the stretch is purely additive and as mentioned earlier, an almost tight bound of n4/3 is known for how sparse a purely additive spanner can be. Bollobás et al. [BCE05] were the first to study a variant of pairwise preservers called distance preservers, where the set of relevant pairs is P = {(u, v) : δ G (u, v) ≥ d}, p for a given parameter √ |P|) and O(n + |P| n) d. Coppersmith and Elkin [CE06] showed pairwise preservers of size O(n p  for any P ⊆ V × V . For |P | = ω n3/4 , the bound of O(n |P|) for pairwise preservers has very recently been improved to O(n2/3 |P|2/3 + n|P|1/3 ) by Bodwin and Williams [BW16]. The problem of designing sparse pairwise spanners was first considered by Cygan et al. [CGK13] who showed a tradeoff between the additive stretch and size of the spanner. The current sparsest pairwise spanner with purely additive stretch has size O(n|P|1/4 ) and additive stretch 6 [Kav15]. Woodruff [Woo10] and Abboud and Bodwin [AB16b, AB16a] showed lower bounds for additive spanners and pairwise spanners. Parter [Par14] showed sparse multiplicative sourcewise spanners and a lower bound of Ω(n|S|1/k /k) on the size of a sourcewise spanner with additive stretch 2(k−1), for any integer k ≥ 1. Distributed construction of sparse spanners with multiplicative stretch was addressed in several studies [BKMP10, BS07, DG08, DGP07, DGPV08, DMP+ 05, Pet10]. Constructions of (α, β)spanners were addressed in [BKMP10, DGPV09, Pet10]. Towards the goal of obtaining purely additive spanners, for which α = 1, Elkin and Peleg [EP04] introduced nearly-additive spanners, for which α = 1 + ǫ. Additional distributed constructions of nearly-additive spanners are given in [Elk05, EZ06, DGPV09, Pet10]. Finally, somewhat related, are constructions of various spanners in the streaming model, and in dynamic settings, both centralized and distributed [BKS12, Bas08, BS08, Elk07a, Elk07b]. In his seminal paper, Pettie [Pet10] presents lower bounds for the number of rounds needed by distributed algorithms in order to construct several families of spanners. Specifically, it is shown that computing an all-pair additive β-spanner with size n1+ρ in expectation, for a constant β, requires Ω n(1−ρ)/2 rounds of communication. Because this is an indistinguishability-based lower bound, it holds even for the less restricted LOCAL mode, where message lengths can be unbounded. The lower bound is obtained by showing an n-node graph with diameter D = Θ n(1−ρ)/2 where, roughly speaking, removing wrong edges induces a stretch that is too large, and identifying  these wrong edges takes Ω(D) rounds. This gives a lower bound of min Ω n(1−ρ)/2 , Ω (D) rounds. Examining the construction in detail, it is not hard to show it works for other types of spanners as well: even for a single pair of nodes, or a set S of size 2, at least Ω(D) rounds are necessary in order to avoid removing wrong edges. 5 2 Preliminaries The Model: The distributed model we assume is the well-known CONGEST model [Pel00]. Such a system consists of a set of n computational units, who exchange messages according to an undirected communication graph G = (V, E), |V | = n, where nodes represent the computational units and edges the communication links. Each node has a unique identifier which can be encoded using O(log n) bits. The diameter of G is denoted by D. When the computation starts, each node knows its own identifier and the identifiers of its neighbors; when there is a set S of nodes or a set P of node-pairs involved in the computation, it also knows if it belongs to S, or all the pairs in P it belongs to. The computation proceeds in rounds, where in each round each node sends an O(log n)-bits message to each of its neighbors, receives a message from each neighbor, and performs a computation. We use the number of rounds as our complexity measure, while ignoring the local computation time; however, in our algorithms all local computations take polynomial time. When the computation ends, each node knows which of its neighbors is also its neighbor in the new graph H = (V, E ′ ) generated. We do not assume that the global structure of H is known to any of the nodes. Clustering and BFS: The first building block in all of our algorithms is clustering. A cluster Ci around a cluster center ci is a subset of ΓG (ci ), the set of neighbors of ci in G (which does not include ci itself). A node belonging to a cluster is clustered, while the other nodes of G are unclustered. We use C to denote the set of cluster centers and Cˆ to denote the set of clusters. In the clustering phase of our algorithms we divide some of the nodes into clusters. We create a new graph containing all the edges connecting a clustered node to its cluster center, and all the edges incident on unclustered nodes. Another building block is BFS trees. A BFS tree in a graph G, rooted at a node r, consists of shortest paths from r to all other nodes in G. The process of creating a BFS tree, known as BFS search, is well-known in the sequential setting. In the distributed setting, a single BFS tree can be easily constructed by a techniques called flooding (see, e.g. [Pel00, §3]), and a celebrated result of Holzer and Wattenhofer [HW12] asserts that multiple BFS trees, rooted at a set S of nodes, can be constructed in O(|S| + D) rounds. Here, D denotes the diameter of the graph, i.e. the maximal distance between two nodes. We use this technique to add BFS trees to the spanner we construct, and to measure distances in the original graph. 3 Building Spanners In this section we present distributed algorithms for building several types of additive spanners. For each spanner, we first describe a template for constructing it independently of a computational model and analyze its stretch and number of edges. Then, we provide a distributed implementation of the algorithm in the CONGEST model and analyze its running time. In a nutshell, our algorithms have three steps: first, each node tosses a coin to decide if it will serve as a cluster center; second, each cluster center tosses another coin to decide if it will serve as a root of a BFS tree; third, add to the current graph edges that are part of certain short paths. The parameters of the coins and the meaning of “short” are carefully chosen, depending on the input to the problem and the desired stretch. 6 Proving that the algorithms perform well is about analyzing the probability of failure. This analysis uses the graph structure as well as standard concentration bounds. In all of our algorithms, c is a constant that can be chosen according to the desired exponent of 1/n in the failure probability. 3.1 A (+2)-Sourcewise Spanner Our first algorithm constructs a (+2)-sourcewise spanner. Given a set S ⊆ V , the algorithm returns a subgraph H of G satisfying δH (s, v) ≤ δG (s, v) + 2 for all (s, v) ∈ S × V , with guarantees as given in the following theorem. Theorem 1. Given a graph G on n nodes and a set of sources S, a (+2)-sourcewise spanner with O(n5/4 |S|1/4 log3/4 n) edges can be constructed in O(|S|+D) rounds in the CONGEST model w.h.p. This is only a factor O(log1/2 n) more than the number of edges given by the best sequential algorithm known for this type of spanners [KV13]. Lemmas 2 and 3 analyze the size and stretch of Algorithm 2S given below. The number of rounds of its distributed implementation is analyzed in Lemma 4, giving Theorem 1. 3.1.1 Algorithm 2S Input: a graph G = (V, E); a set of source nodes S ⊆ V Output: a subgraph H Initialization: n = |V |, h = (n |S|)1/4 log3/4 n, and H = (V, ∅) n Clustering Pick each node as a cluster center w.p. c log h , and denote the set of selected nodes by {c1 , c2 , . . .}. For each node v ∈ V , choose a neighbor ci of v which is a cluster center, if such a neighbor exists, add the edge (v, ci ) to H, and add v to Ci ; if none of the neighbors of v is a cluster center, add to H all the edges v belongs to. BFS Pick each cluster center as a root of a BFS tree w.p. at each chosen root. h2 cn log n , and add to H a BFS tree rooted ˆ build a temporary set of paths, Path Buying For each source-cluster pair (s, Ci ) ∈ S × C: containing a single, arbitrary shortest path from s to each x ∈ Ci ; omit from the set all paths with 2 2 n more than 2c nhlog missing edges (i.e. edges in G but not in H); if any paths are left, add to H 2 the shortest among them. 3.1.2 Analysis of Algorithm 2S We now study the properties of the spanner H created by the algorithm; in the next section, we describe the implementation of the different phases in the CONGEST model and analyze the running time of the algorithm. Lemma 2. Given a graph G = (V, E) with |V | = n and a set S ⊆ V , Algorithm 2S outputs a graph H = (V, E ′ ), E ′ ⊆ E, with |E ′ | = O(n5/4 |S|1/4 log3/4 n) edges w.p. at least 1 − O(n−c+2 ). 7 Proof. The algorithm starts with H = (V, ∅), and adds to it only edges from G. We analyze the number of edges added in each phase. In the first part of the clustering phase, each node adds to H at most one edge, connecting it to a single cluster center, for a total of O(n) edges. Then, the probability that a node of degree at n h −c least h is left unclustered is at most (1 − c log h ) which is O(n ). A union bound implies that all −c+2 nodes of degree at least h are clustered w.p. 1−O(n ), and thus the total number of edges added to H by unclustered nodes in the second part of the clustering phase is O(nh) w.p. 1 − O(n−c+2 ). A node becomes a root in the BFS phase if it is chosen as a cluster center and then as a 2 n root, which happens with probability c log · cn hlog n = nh . Letting T denote the set of trees gives h E[|T |] = nh · n = h, and a Chernoff bound implies that Pr[|T | > 4h] ≤ exp(−h). As h ≥ c log n we have exp(−h) = O(n−c ), and the BFS phase adds at most 4h trees, which are O(nh) edges. n Finally, each of the n nodes is chosen as a cluster center with probability c log h , so E[|C|] = cn log n n . A Chernoff bound implies Pr[|C| > 4cn hlog n ] ≤ exp(− cn log ); as h < n3/4 , we have h h 2 n ˆ at most 2c2 n log edges are exp(− cn log n ) < exp(−cn1/4 ) = o(n−c ). For each pair in S × C, 2 h 2 2 3 h n n n log n added in the path buying phase, for a total of O(|S| · n log · h2 ) = O( |S|n hlog ) edges. 3 h 1/4 3/4 3/4 1/4 5/4 Substituting h = (n |S|) log n gives a total of O(n |S| log n) edges, as claimed. Lemma 3. Given a graph G = (V, E) with |V | = n and a set S ⊆ V , the graph H constructed by Algorithm 2S satisfies δH (s, v) ≤ δG (s, v) + 2 for each pair (s, v) ∈ S × V w.p. at least 1 − O (n−c ). Proof. Consider a shortest path ρ between s ∈ S and v ∈ V in G. 2 2 n missing edges in H after the clustering phase, then it traverses If ρ has more than 2c nhlog 2 2 2 n more than c n hlog clusters, as otherwise there is a shorter path between s and v in G. The 2 probability that none of the centers of these clusters is chosen as a root in the BFS phase is at most c2 n log2 n/h2  2 = O(exp(−c log n)) = O (n−c ) . Let Ci be a cluster that ρ traverses, and let 1 − cn hlog n u be a node in ρ∩Ci . Adding a BFS tree rooted at ci ensures that δH (s, ci ) = δG (s, ci ) ≤ δG (s, u)+1 and similarly δH (ci , v) = δG (ci , v) ≤ δG (u, v) + 1. By the triangle inequality δH (s, v) ≤ δH (s, ci ) + δH (ci , v) ≤ δG (s, u) + δG (u, v) + 2 which equals δG (s, v) + 2 since u is on ρ. This completes the proof for ρ with many missing edges. 2 2 n Consider the complementary case, where ρ has at most 2c nhlog missing edges in H after the 2 clustering phase. If ρ traverses no clusters, then it is contained in H, and δH (s, v) = δG (s, v). Otherwise, if v belongs to some cluster Ci , then there is a node v ′ ∈ Ci (possibly v itself) such that the shortest path between s and v ′ is added to the graph H in the path buying phase. The nodes v and v ′ both belong to the same cluster, so δH (v, v ′ ) ≤ 2 and the triangle inequality implies δH (s, v) ≤ δH (s, v ′ ) + δH (v ′ , v) ≤ δH (s, v ′ ) + 2, as claimed. Finally, consider the case where ρ traverses at least one cluster and v is unclustered; let u be the clustered node closest to v on ρ. The sub-path from v to u is contained in H, so δH (v, u) = δG (v, u) and by the previous analysis δH (s, u) ≤ δG (s, u) + 2; the triangle inequality implies δH (s, v) ≤ δH (s, u) + δH (u, v) ≤ δG (s, u) + 2 + δG (u, v) and since u is on ρ, we have δG (s, u) + δG (u, v) = δG (s, v) and the claim follows. 8 3.1.3 Implementing Algorithm 2S in the CONGEST Model We now discuss the implementation of Algorithm 2S in the CONGEST model. Lemma 4. Algorithm 2S can be implemented in O(|S| + D) rounds in the CONGEST model, w.p. at least 1 − o(n−c ). Proof. We present distributed implementations for each of the phases in Algorithm 2S, and analyze their running time. Preprocessing In order to run the algorithm properly, we need each node to know the parameter h, which in turn depends on |S| and n. These parameters are not given in advance to all graph nodes, but they can be gathered along a BFS tree rooted at a predetermined node, e.g. the node with minimal identifier, and then spread to all the nodes over the same tree. This is done in O(D) rounds. Clustering The clustering phase is implemented as follows: first, each node becomes a cluster n and sends a message to all its neighbors; then, each node that gets at least one center w.p. c log h message joins a cluster of one of its neighbors, by sending a message to that neighbor and adding their connecting edge to the graph; finally, nodes that are not neighbors of any cluster center send a message to all their neighbors and add all their incident edges to the graph. The round complexity of this phase is constant. 2 BFS Each cluster center becomes a root of a BFS tree w.p. n ch log n , which is done without communication. Then, all BFS roots run BFS searches in parallel. The number of BFS trees is O(h) w.p. o (n−c ), as seen in the proof of Lemma 2, and this number of BFS searches can be run in parallel in O(D + h) rounds, using an algorithm of Holzer and Wattenhofer [HW12, §6.1]. Their algorithm outputs the distances along the BFS trees, whereas we wish to mark the BFS tree edges and add them to the graph; this requires a simple change to the algorithm, which does not affect its correctness or asymptotic running time. Path Buying This phase starts with measuring all the distances between pairs of nodes in S ×V , and the number of missing edges in each shortest path measured. To find all distances from a node s ∈ S to all other nodes, we run a BFS search from s; moreover, we augment each BFS procedure with a counter that counts the missing edges in each path from the root to a node on the BFS tree. Running BFS searches from all the nodes of S is done in O(|S| + D) rounds, as before, and adding a counter does not change the time complexity. When a node v ∈ V receives a message of a BFS initiated by some s ∈ S, it learns its distance from s and the number of missing edges on one shortest path from s to v, which lies within the BFS tree; we refer to this path as the shortest path from s to v. After all the BFS searches complete, each clustered node x sends to its cluster center the distance from each s ∈ S to x, and the number of missing edges on the corresponding path. This sub-phase takes O(|S|) rounds to complete. Each cluster center ci now knows, for each s ∈ S, the length of the shortest path from s to each x ∈ Ci , and the number of missing edges in each such path; it then locally chooses the shortest 2 2 n missing edges. Finally, for each chosen (x, s) path, ci sends among all paths with at most 2c nhlog 2 9 a message to x containing the identifier of s. All BFS searches are now executed backwards, by sending all the messages in opposite direction and order; when x runs backwards the BFS search initiated by s, it marks the message to his parent with a “buy” bit, which is passed up the tree and makes each of its receivers add the appropriate edge to the graph. This sub-phase requires O(|S| + D) rounds as well. In total, the running time of the algorithm is O(h + |S| + D), w.p. at least 1 − o(n−c ), which completes the proof for the case h = O(|S|). In the case h = Ω(|S|), we can replace the algorithm by a simpler algorithm that returns the union of BFS trees rooted at all nodes of S. This creates a graph that exactly preserves all distances among pairs (s, v) ∈ S × V , and takes O(|S| + D) rounds to complete. The number of edges in the created spanner is O(n |S|), and the assumption h = Ω(|S|) implies O(n |S|) = O(nh), as desired. 3.2 A (+4)-All-Pairs Spanner Recall that a subgraph H of G is a (+4)-all-pairs spanner if δH (u, v) ≤ δG (u, v) + 4 for all pairs (u, v) ∈ V × V . We present an algorithm, based on Algorithm 2S, which builds a (+4)-all-pairs spanner and has the properties guaranteed by the following theorem.   4/5 7/5 Theorem 5. Given a graph G on n nodes, a (+4)-all-pairs spanner with O n log n edges can be constructed in O(n3/5 log1/5 n + D) rounds in the CONGEST model w.h.p. The main idea is that cluster centers are now sources for a (+2)-sourcewise spanner, which, as we show, promises a (+4)-stretch to all pairs. Lemmas 6 and 7 analyze the size and the stretch of Algorithm 4AP below. Lemma 8 analyzes the running time of its distributed implementation, completing the proof of Theorem 5. 3.2.1 Algorithm 4AP Input: G = (V, E) Output: a subgraph H Initialization: n = |V |, h = n2/5 log4/5 n, and H = (V, ∅) Clustering Run clustering as in Algorithm 2S. BFS and Path Buying Run the BFS and path buying phases from Algorithm 2S, with cluster centers as sources, i.e. S = C. 3.2.2 Analysis of Algorithm 4AP ′ Lemma 6. Given a graph G = (V, E)   with |V | = n, Algorithm 4AP outputs a graph H = (V, E ), E ′ ⊆ E, with |E ′ | = O n7/5 log4/5 n edges w.p. at least 1 − O(n−c+2 ). Proof. The lemma follows from the proof of Lemma 2: in Algorithm 4AP, S is the set of all cluster  n centers, whose amount is |C|, and by the proof |C| ≤ 4cn hlog n w.h.p. Substituting |S| = O n log h and h = n2/5 log4/5 n in Lemma 2, we get that the graph created by Algorithm 4AP contains O(n7/5 log4/5 n) edges w.p. at least 1 − O(n−c+2 ). 10 Lemma 7. Given a graph G = (V, E) with |V | = n, Algorithm 4AP outputs a graph H satisfying δH (u, v) ≤ δG (u, v) + 4 for each pair of vertices (u, v) ∈ V × V w.p. at least 1 − O(n−c ). Proof. Let (u, v) ∈ V × V be an arbitrary pair of nodes, and set a shortest path ρ in G between them. If ρ is not incident on any clustered node, then all its nodes are unclustered and all its edges are present in H. Otherwise, let x be the first clustered node on ρ, when traversing it from u to v, and let Ci be the cluster containing x. The sub-path of ρ from u to x exists in H, as all nodes on this sub-path except for x are unclustered; the distance from ci to v satisfies δH (ci , v) ≤ δG (ci , v) + 2, as the stretch of (ci , v) in H is at most 2 by Lemma 3, w.p. at least 1 − O(n−c ). The triangle inequality completes the proof: δH (u, v) ≤ δH (u, x) + δH (x, ci ) + δH (ci , v) ≤ δG (u, x) + 1 + δG (ci , v) + 2 ≤ δG (u, x) + δG (ci , x) + δG (x, v) + 3 = δG (u, v) + 4. 3.2.3 Implementing Algorithm 4AP Running Algorithm 4AP is done by executing Algorithm 2S with a specific set S; thus, their running times are identical, as stated in the next lemma. Lemma 8. Algorithm 4AP can be implemented in the CONGEST model in O(n3/5 log1/5 n + D) rounds w.p. at least 1 − o(n−c ). Proof. The lemma follows from the proof of Lemmas 2 and 4: in Algorithm 4AP, S is the set of cluster centers, whose amount is |C|, and by the proof of lemma 2, |C| ≤ 4cn hlog n w.h.p. Substin 2/5 log4/5 n in Lemma 4, we get that the algorithm completes in tuting |S| = O( n log h ) and h = n O(n3/5 log1/5 n + D) rounds, with the claimed probability. 3.3 A (+2)-Pairwise Spanner Recall that a (+2)-pairwise spanner, for a set of pairs P ⊆ V × V , is subgraph H of G satisfying δH (u, v) ≤ δG (u, v) + 2 for all pairs (u, v) ∈ P. Recall that τ (P) denotes the number of nodes appearing in P, i.e. τ (P) = |{u | ∃v : {u, v} ∈ P}|. We present a distributed algorithm, Algorithm 2P, which returns a (+2)-pairwise spanner with the properties described in the following theorem. Theorem 9. Given a graph G on n nodes and a set P of pairs of nodes in G, a (+2)-pairwise spanner with O(n |P|1/3 log2/3 n) edges can be constructed in O(τ (P)+D) rounds in the CONGEST model w.h.p. If τ (P) < 2c2 |P|1/3 log2/3 n, achieving the desired spanner is simple: for each u appearing in P,  1/3 add to H a BFS from u. The number of edges is O (nτ (P)) = O n |P| log2/3 n , the stretch is 0 for all pairs in P, and the running time is O(τ (P) + D), as desired. Otherwise, Lemmas 10 and 11 prove the claimed size and stretch of Algorithm 2P below. Lemma 12 proves the running time of its distributed implementation, giving Theorem 9. 11 3.3.1 Algorithm 2P Input: G = (V, E), P ⊆ V × V Output: a subgraph H Initialization: n = |V |, h = |P|1/3 log2/3 n, and H = (V, ∅) Clustering and BFS Algorithm 2S. Run clustering and add BFS trees from selected cluster centers, as in Path Buying For each pair (u, v) ∈ P, if the shortest path between u and v in G has at most 2c2 n log2 n missing edges in H, add it to H. h2 3.3.2 Analysis of Algorithm 2P Lemma 10. Given a graph G = (V, E) with |V | = n and a set P ⊆ V × V , Algorithm 2P outputs  a graph H = (V, E ′ ), E ′ ⊆ E, with |E ′ | = O(n |P|1/3 log2/3 n) edges, w.p. at least 1 − O n−c+2 . Proof. The lemma follows from the proof of Lemma 2: the clustering and BFS phases add O(nh)  edges to the graph w.p. at least 1 − O n−c+2 , as long as c log n ≤ h ≤ n3/4 . The first inequality comes from the comment after the statement of Theorem 9, the fact that τ (P) ≤ 2 |P| and the choice of h, and the second inequality is immediate. 2 2 n edges are added for each pair in P, for a total of In the path buying phase, at most 2c nhlog 2     |P|n log2 n 1/3 1/3 2/3 2/3 O edges. Substituting h = |P| log n, we get a total of O n |P| log n edges 2 h in H. Lemma 11. Given a graph G = (V, E) with |V | = n, Algorithm 2P outputs a graph H satisfying δH (u, v) ≤ δG (u, v) + 2 for each pair of vertices (u, v) ∈ P, w.p. at least 1 − O (n−c ). Proof. Let (u, v) ∈ P be an arbitrary pair of nodes, and fix a shortest path ρ in G between them. 2 2 n missing edges in H before the path buying phase, it is added to If ρ has at most 2c nhlog 2 H, and δG (u, v) = δH (u, v). Otherwise, ρ has more than c2 n log2 n h2 2c2 n log2 n h2 missing edges before the BFS phase, so it traverse at least clusters. As in the proof of Lemma 3, at least one of the corresponding cluster centers is chosen as a root of a BFS tree w.p. at least 1 − O (n−c ), and δH (u, v) ≤ δG (u, v) + 2, as claimed. 3.3.3 Implementing Algorithm 2P Lemma 12. Algorithm 2P can be implemented in O(τ (P) + |P|1/3 log2/3 n + D) rounds in the CONGEST model w.p. at least 1 − o (n−c ). Proof. We can implement the clustering and path buying phases in O(h + D) = O(τ (P) + D) rounds with success probability 1 − o (n−c ), as seen in the proof of Lemma 4. In order to count missing edges in paths, we run a BFS search in G from each node appearing in P. Then, the BFS search is run backwards, and is used to add the “cheap” paths: for a pair (u, v) in P, if the BFS 2 2 n missing edges, then u sends back a “buy” message from v arrives at u traversing at most 2c nhlog 2 up the tree, and the path is added. We may end up adding two shortest path for a pair (u, v) ∈ P, 12 but this does not affect the asymptotic number of edges or the time complexity. This phase is implemented in O(τ (P) + D) rounds, by running the τ (P) BFS searches in parallel. 3.4 A (+4)-Pairwise Spanner We present an algorithm for constructing a (+4)-pairwise spanner, with the parameters described by the following theorem. Theorem 13. Given   a graph G on n nodes and a set P of pairs, a (+4)-pairwise spanner with 2/7 6/7 O n |P| log n edges can be constructed in O(τ (P) + D) rounds in the CONGEST model w.h.p. If |P| < log4 n, the (+2)-pairwise spanner from Theorem 9 is sparser than the one promised by Theorem 13, and can be constructed in the same running time. Otherwise, Lemmas 14 and 15 show the claimed size and stretch of Algorithm 4P below, which together with Lemma 16, which analyzes the running time of its distributed implementation, proves Theorem 13. 3.4.1 Algorithm 4P Input: a graph G = (V, E); a set of pairs P ⊆ V × V Output: a subgraph H 3 n and H = (V, ∅) Initialization: n = |V |, h = |P|2/7 log6/7 n, ℓ = n hlog 5/2 Clustering and BFS Algorithm 2S. Run clustering and add BFS trees from selected cluster centers, as in Prefix-Suffix Buying For each pair (u, v) ∈ P, let ρ be a shortest path from u to v. Add to H the first ℓ missing edges and the last ℓ missing edges in ρ. Choosing Cluster Centers Construct a set A of cluster centers by adding to it each cluster n . center independently w.p. 16c log ℓ Path Buying For each pair (c1 , c2 ) ∈ A × A: fix a set of paths containing a single shortest path 2 2 n from c1 to each x ∈ C2 ; omit all paths with more than 2c nhlog missing edges in H; if any paths 2 are left, add to H the shortest among them. 3.4.2 Analysis of Algorithm 4P Lemma 14. Given a graph G = (V, E) with|V | = n and a set  P ⊆ V × V , Algorithm 4P outputs  2/7 6/7 ′ ′ ′ a graph H = (V, E ), E ⊆ E, with |E | = O n |P| log n edges w.p. at least 1 − O n−c+2 .  Proof. The clustering and BFS phases add O(nh) edges to the graph w.p. at least 1 − O n−c+2 , as seen in the proof of Lemma 2, as long as c log n < h < n3/4 . The first inequality comes from the discussion below the statement of Theorem 13, and the second is immediate. In the prefix-suffix buying phase, at most O(ℓ) edges are bought for each pair in P, for a total    2/7 n log3 n 6/7 = O n |P| log n edges. of O |P| · h5/2 13 Finally, in the path buying phase we add to H at most |A|2 paths, with O edges in each. Each node is chosen to be a cluster center w.p. 16c log n hℓ , c log n h , 2/7  n log2 n h2  missing and then to enter A w.p. 3/7 n 16c2 n log2 n ·i 16c log = = 16c2 |P| log n. A Chernoff bound implies ℓ hℓ   3/7 n ≤ exp −16c2 |P| log2/7 n = O(n−c ); the last equality holds un- c log n h 2/7 so E[|A|] = n · Pr |A| > 64c2 |P|3/7 log der the assumption |P| ≥ log n, as discussed below of Theorem the number  9. Hence,  the statement 2   2 3/7 2/7 n log n |P| log2/7 n · h2 = O( n |P| log6/7 n of edges added in the path buying step is O    edges. In total, H has O( n |P|2/7 log6/7 n edges w.p. at least 1 − O n−c+2 . Lemma 15. Given a graph G = (V, E) with |V | = n, Algorithm 4P outputs a graphH satisfying δH (u, v) ≤ δG (u, v) + 4 for each pair of vertices (u, v) ∈ P w.p. at least 1 − O n−c+2 . Proof. Let (u, v) ∈ P be an arbitrary pair of nodes, and let ρ be an arbitrary shortest path from u to v. If ρ has at most 2ℓ missing edges in H after the clustering phase, it is added to H in the prefix-suffix buying phase and δG (u, v) = δH (u, v). Otherwise, the prefix of ρ with ℓ missing edges is incident on at least ℓ/2 clusters. Each cluster n center is added to A independently w.p. 16c log so the expected number of clusters in A which are ℓ also incident on the prefix is 8c log n, and a Chernoff bound implies that the probability that less than 4c log n of the centers of these clusters are chosen to A is at most O(exp(−c log n)) = O (n−c ). The same argument shows that the suffix of ρ is incident on a cluster in A, and a union bound  implies that all prefixes and suffixes are incident on clusters in A w.p. at least 1 − O n−c+2 . Let c1 be a center of a cluster in A which is incident on the prefix of ρ, and c2 a center of a cluster incident on the suffix of ρ. Let u′ and v ′ be nodes in ρ ∩ C1 and ρ ∩ C2 respectively, and let σ be a path between c1 and v ′ in G. 2 2 n , then If the number of edges of σ missing in H after the clustering phase is more than 2c nhlog 2 2 2 n σ is incident on at least c n hlog clusters. In this case, a cluster incident on σ is a source of a BFS 2 −c tree w.p. at least 1 − O (n ), as seen in the proof of Lemma 3. Let Ci be such a cluster, then after adding the BFS trees it holds that δH (u′ , v ′ ) ≤ 1 + δH (c1 , v ′ ) ≤ 1 + δH (c1 , ci ) + δH (ci , v ′ ) ≤ δG (c1 , v ′ )+3 ≤ δG (u′ , v ′ )+4, which implies δH (u, v) ≤ δH (u, u′ )+δH (u′ , v ′ )+δH (v ′ , v) ≤ δG (u, u′ )+ δG (u′ , v ′ ) + 4 + δG (v ′ , v) = δG (u, v) + 4. 2 2 n missing edges then a path between c1 and some x ∈ C2 is added to If σ has less than 2c nhlog 2 H in the path buying phase, satisfying δH (c1 , x) ≤ δG (c1 , v ′ ) ≤ δG (u′ , v ′ ) + 1. Hence, δH (u, v) ≤ δH (u, u′ )+δH (u′ , c1 )+δH (c1 , x)+δH (x, v ′ )+δH (v ′ , v) ≤ δG (u, u′ )+1+δG (u′ , v ′ )+1+2+δG (v ′ , v) = δG (u, v) + 4, as required. 3.4.3 Implementing Algorithm 4P Lemma 16. Algorithm 4P can be implemented in O (τ (P) + D) rounds in the CONGEST model w.p. at least 1 − o (n−c ). Proof. We can implement the clustering and path buying phases in O(h + D) rounds with success probability 1 − o (n−c ), as seen in the proof of Lemma 4. The prefix-suffix buying phase is implemented as follows: run a BFS from each u appearing in P, counting missing edges on each path. Roll back the BFS, and when passing a node v such that (u, v) ∈ P, it sends a “buy-suffix” message with a counter initiated to ℓ; when a node receives such 14 a counter it adds the edge to the parent to H and decreases the counter by 1, unless the edge is already on H; if the counter reaches another node in v ′ satisfying (u, v ′ ) ∈ P, it is set to ℓ again. When the counter is 0, no more edges are bought but the counter is passed up the tree, until it arrives at a node whose count of missing edges in the original BFS was ℓ. This node replaces it with a simple “buy” message, adds the edge to its parent to H and sends it to the parent; each receiver of the “buy” message does the same, all the way to the tree root. This phase takes O(τ (P) + D) rounds. The choice of A is simple, requiring no communication. The path buying phase is implemented similarly to its implementation in Algorithm 2S, in the proof of Lemma 4. Measuring distances and counting missing edges on a path from each c1 ∈ A to each other node is done by running a BFS from each cluster center with the appropriate counters; each clustered node reports its cluster’s center the above parameters in O(|A|) rounds; each c2 ∈ A then chooses which paths to buy, and reports the appropriate node in its cluster; running the BFS searches backwards, each node may send “buy” messages up the trees, as decided by c2 . This phase takes O(|A| + D) rounds.   The proof of Lemma 14 implies |A| = O |P|3/7 log2/7 n w.p. at least 1 − O (n−c ). This, to- gether with the assumption |P| ≥ log4 (n) and with the choice of h, imply O (h + |A| + τ (P) + D) = O (τ (P) + D); hence, the above implementation takes O (τ (P) + D) rounds with the same probability. 3.5 Subsetwise Spanners Recall that a (+β)-subsetwise spanner for a set S ⊆ V is a subgraph H of G satisfying δH (u, v) ≤ δG (u, v) + 2 for all pairs (u, v) ∈ S × S. We show how to build such spanners for β = 2 and β = 4, with O(n |S|2/3 log2/3 n) edges and O(n |S|4/7 log6/7 n) edges respectively, in O(|S| + D) rounds w.h.p. The algorithms follow immediately from Algorithm 2P and Algorithm 4P: set P = S × S and run Algorithm 2P or Algorithm 4P. The number of edges follows from the fact |P| = |S|2 , and the running time from τ (P) = |S|. Finally, note that in the case |S| > n3/5 log1/5 n, Algorithm 2S gives a sparser spanner than Algorithm 2P in the same running time, and with a stretch of +2 for all S × V pairs. Similarly, when |S| > n7/10 log−1/10 n, Algorithm 4AP gives a sparser spanner than Algorithm 4P in a shorter running time, with a stretch of +4 on all pairs of nodes in the graph. Corollary 17. Given a graph G on n nodes ando a set S of nodes, a (+2)-subsetwise spann 2/3 1/4 2/3 3/4 5/4 ner with O min n |S| log n, n |S| log n edges and a (+4)-subsetwise spanner with  n o O min n |S|4/7 log6/7 n, n7/5 log4/5 n edges, can both be constructed in at most O(|S|+D) rounds in the CONGEST model w.h.p. 3.6 A (+8)-All-Pairs Spanner Recall that a subgraph H of G is a (+8)-all-pairs spanner if δH (u, v) ≤ δG (u, v) + 8 for all pairs (u, v) ∈ V × V . We present an algorithm, based on Algorithm 4P, which builds a (+8)-all-pairs spanner and has the properties guaranteed by the next theorem. 15   Theorem 18. Given a graph G on n nodes, a (+8)-all-pairs spanner with O n15/11 log10/11 n edges can be constructed in O(n7/11 log1/11 n + D) rounds in the CONGEST model w.h.p. Lemmas 19 and 20 provide the required size and stretch of Algorithm 8AP below, while Lemma 21 gives the running time f its distributed implementation, proving Theorem 18. 3.6.1 Algorithm 8AP Input: G = (V, E) Output: a subgraph H Initialization: n = |V |, h = n4/11 log10/11 n, and H = (V, ∅) Clustering Run clustering as in Algorithm 4P. Rest of Algorithm 4P Run the rest of Algorithm 4P on all pairs of cluster centers, i.e. P = C ×C. 3.6.2 Analysis of Algorithm 8AP Lemma 19. Given a graph G = (V, E) with |V | = n, Algorithm 8AP outputs a graph H = (V, E ′ ),  E ′ ⊆ E, with |E ′ | = O n15/11 log10/11 n edges w.p. at least 1 − O(n−c+2 ). Proof. We follow the outline of previous proofs. By the proof  of Lemma 2, the BFS phase2 adds 4cn log n −c+2 . In Algorithm 8AP, |P| = |C| , and O(nh) edges, and |C|≤ h  , w.p. at least 1 − O n n2 log2 n h2 and h = n4/11 log10/11 n in Lemma 14 gives that the graph created  by Algorithm 8AP contains O(n15/11 log10/11 n) edges w.p. at least 1 − O n−c+2 . substituting |P| = O Lemma 20. Given a graph G = (V, E) with |V | = n, Algorithm 8AP outputs a graph H satisfying δH (u, v) ≤ δG (u, v) + 8 for each pair of vertices (u, v) ∈ V × V w.p. at least 1 − O(n−c ). Proof. Let (u, v) ∈ V × V be an arbitrary pair of nodes, and set a shortest path ρ in G between them. If ρ is not incident on any clustered node, then all its nodes are unclustered and all its edges are present in H. Otherwise, let x be the first clustered node on ρ, when traversing it from u to v, and let y the last clustered node on ρ. Let C1 be the cluster containing x, and C2 the cluster containing y. The sub-paths of ρ from u to x and from y to v exist in H, as all the nodes on these sub-path except for x and y are unclustered. By Lemma 15, δH (c1 , c2 ) ≤ δG (c1 , c2 ) + 4 as c1 , c2 ∈ C = S; moreover, δG (c1 , c2 ) ≤ δG (x, y) + 2 by the triangle inequality. Finally, δH (u, v) ≤ δH (u, x) + δH (x, c1 ) + δH (c1 , c2 ) + δH (c2 , y) + δH (y, v) ≤ δG (u, x) + 1δG (x, y) + 6 + δG (y, v) + 1 = δG (u, v) + 8 as desired. 16 3.6.3 Implementing Algorithm 8AP Running Algorithm 8AP is done by executing Algorithm 4P with a specific set P; thus, their running times are identical, as stated in the next lemma. Lemma 21. Algorithm 8AP can be implemented in the CONGEST model in O(n7/11 log1/11 n + D) rounds w.p. at least 1 − o(n−c ). Proof. The lemma follows from the proof  of Lemmas 2 and 16: in Algorithm 8AP, τ (P) = |C|, n w.p. at least 1 − O(n−c+2 ). Substituting this and and by the proof of Lemma 2, |C| = O n log h h = n4/11 log10/11 n in Lemma 16, we get that the algorithm completes in O(n7/11 log1/11 n + D) rounds with the desired probability. 4 Lower Bounds In this section we prove lower bounds on the number of rounds that are needed for constructing spanners in the CONGEST model. All previous lower bounds for the distributed construction of spanners [Pet10] use an indistinguishability argument: while many edges should be omitted from the graph in order to create a sparse spanner, there are few edges that must not be omitted. However, in order to distinguish these few edges from the rest, some nodes must learn a considerable part of the graph. In a nutshell, the heart of the proof is that information must travel a constant portion of the diameter D, and thus the lower bound is Ω(D). The lower bounds from [Pet10] apply also to the LOCAL model, where the message sizes are unbounded. Here, we present the first lower bound that is specific for the CONGEST model. As in previous lower bounds for the CONGEST model, our proof uses a reduction from a communication complexity problem. However, previous lower bounds used reductions either from the equality problem [PR99] or from set-disjointness, e.g., [DSHK+ 12, DKO14, FHW12, HP14, CGK14, GK13]. These seem unsuitable for our purposes, and hence we diverge from this approach and define a new communication complexity problem we call partial complement. We bound the communication complexity of this problem from below, using information theory. We first prove a lower bound for the construction of a (+2)-pairwise spanner. Then, we generalize the bound for the construction of an (α, β)-pairwise spanner, for any α ≥ 1, β ≥ 0. 4.1 A Communication Complexity Problem Let m, p be two positive integers so that p ≤ m/3. The partial complement communication problem, denoted PART-COMPm,p , is defined as follows: Alice has a set x ⊆ {1, . . . , m} of size |x| = p, and Bob has to output a set y ⊆ {1, . . . , m} of size |y| = m/2 so that x ∩ y = ∅. Note that the goal of this communication problem is to compute a relation, not a function. In this section we prove that the randomized communication complexity of the partial complement problem is high (for formal definitions in communication complexity see the textbook [KN97]). Theorem 22. If π is a (1/3)-error randomized protocol computing PART-COMPm,p then the length of π is at least p/100. The proof uses information theory. The basic idea is to prove that any protocol that solves PART-COMPm,p must contain Ω(p) bits of information about the set x. We now define the basic notions we use in the proof (see the textbook [CT06] for more background and useful properties). 17 The entropy of a random variable X is defined as X H(X) = Pr[X = x] log(1/ Pr[X = x]). x It is well-known that entropy is maximal for the uniform distribution: if X is an element chosen at random from a set T of size t, then, by convexity, X H[X] = Pr[X = x] log(1/ Pr[X = x]) ≤ log t. (1) x∈T Shannon’s coding theorem says that H[X] is a lower bound on the expected length of a prefix-free encoding of X. The entropy of a random variable X conditioned on a random variable Y is defined as H(X|Y ) = H(X, Y ) − H(Y ). The mutual information between X and Y is I[X; Y ] = H[X] − H[X|Y ]. Intuitively, it measures the reduction in uncertainty about X given the value of Y . Proof of Theorem 22. Let π be a randomized protocol computing PART-COMPm,p with c bits of communication and error probability 1/3. Note that we can assume without loss of generality that only Alice speaks in π. Below, we feed into π a random set X, so we may assume that π is deterministic. Denote by Π = Π(x) the transcript of π with input x. Denote by Y = Y (x) the subset of {1, . . . , m} of size m/2 that Bob outputs when receiving message Π(x). The distribution on X is defined as follows. Let I1 , . . . , Ip be p consecutive intervals in {1, . . . , m}, each of size k = ⌊m/p⌋. From each interval Ii , choose one element Xi uniformly at random and independently. Set X = {X1 , . . . , Xp }. First, we compute the entropy of X. For each i, we have H[Xi ] = log k. Thus, independence implies that p X H[Xi ] = p log k. H[X] = i=1 Second, we analyze the entropy of X conditioned on Y and on the protocol outputting the correct answer. Let E be the indicator of the event {x ⊂ {1, . . . , m} : |x| = p, Y (x) ∩ x = ∅}. Note that since the protocol has an error probability bounded by 1/3, it holds that Pr[E = 1] ≥ 2/3. Given y of size m/2, split the intervals into two sets:     k k , S2 (y) = i ∈ {1, . . . , p} : |Ii ∩ y| > . S1 (y) = i ∈ {1, . . . , p} : |Ii ∩ y| ≤ 10 10 18 Since |S1 (y)| + |S2 (y)| = p, it holds that m = |y| 2 k + |S2 (y)| k + k 10 pk 9k ≤ + |S2 (y)| + k, 10 10 which by a simple calculation implies ≤ |S1 (y)| 10 4 |S2 (y)| ≥ p − . 9 9 In addition, for each y and i ∈ S1 (y), using (1), we have H[Xi |Y = y, E = 1] ≤ log k. For each y and i ∈ S2 (y), conditioned on E = 1 and Y = y, the element Xi is chosen from Ii \ y, k whose size is at most k − 10 = 9k 10 . Thus, for each y and i ∈ S2 (y), H[Xi |Y = y, E = 1] ≤ log 9k . 10 We can conclude this part as follows:1 H[X|Y, E = 1] ≤ ≤  X Pr[Y = y|E = 1]  X  y y X i∈S1 (y) H[Xi |Y = y, E = 1] + i∈S2 (y)  H[Xi |Y = y, E = 1] (sub-additivity) Pr[Y = y|E = 1] (p − |S2 (y)|) log k + |S2 (y)| log  10 ≤ Pr[Y = y|E = 1] p log k − |S2 (y)| log 9 y   4 10 ≤ p log k − log + 2. 9 9 X X k 10   Thus, using (1), H[X|Y, E] = Pr[E = 1] · H[X|Y, E = 1] + Pr[E = 0] · H[X|Y, E = 0]     10 4 1 2 (Pr[E = 1] ≥ 2/3) p log k − log + 2 + · p log k ≤ 3 9 9 3 10 4p log . ≤ 2 + p log k − 9 9 We now have I[X; Y ] = I[X; Y, E] − I[E; X|Y ] = H[X] − H[X|Y, E] − I[E; X|Y ] 4p 10 ≥ log − 3, 9 9 1 Note the difference between conditioning on an event and conditioning on a random variable. 19 (chain rule) where the last inequality holds since E contains at most one bit of information. Therefore, c ≥ H(Π) (Shannon’s coding theorem) ≥ I(X; Π) ≥ I(X; Y ) 10 4p log −3 ≥ 9 9 ≥ p/100; (information processing inequality) (we may assume p > 100) where c is the length of π, completing the proof. 4.2 A Lower Bound for constructing a (+2)-Pairwise Spanner In this section we prove the following lower bound. Theorem 23. There is a constant c > 0 so that the following holds. Any distributed protocol for the CONGEST model with success probability at least 2/3 which, given a graph with n nodes and a set of p ≤ cn3/2 pairs of nodes, outputs a (+2)-pairwise spanner with at most cn3/2 edges, must p take Ω( n log n ) rounds to complete. The lower bound holds even for graphs with constant diameter. √ The theorem implies a lower bound of Ω ( n/ log n) on the number of rounds needed for an algorithm in the CONGEST model to output a (+2)-pairwise spanner, when |P| = Θ(n3/2 ). For comparison, the time for constructing such a spanner using Algorithm 2P can (roughly) vary between n3/4 and n, depending on the structure of P. The graph G for which the lower bound is proved is defined as follows. Let n be such that there is a finite projective plane with n/4 points and n/4 lines. Let G′ be the point-line incidence graph with n/2 nodes (see e.g. [Mat02, §4.5]). The graph G′ has Θ(n3/2 ) edges, girth 6 and diameter 3.2 ′ }. The graph G consists of G′ , an additional n/2 We denote the nodes of G′ by VB = {v1′ , . . . , vn/2 nodes denoted VA = {v1 , . . . , vn/2 }, and an additional n/2 edges of the form (vi , vi′ ). In the pairwise spanner we construct, we wish to approximately preserve distances between pairs of nodes in VA , i.e. P ⊆ VA × VA . The main observation is that, since the girth of G′ is 6, if e′ = {vi′ , vj′ } is an edge of G′ then the following holds. If (vi , vj ) ∈ P then any (+2)-pairwise spanner must contain the edge e′ , as otherwise the distance is stretched from 3 to 7, which exceeds the required +2 stretch. On the other hand, if (vi , vj ) ∈ / P then the edge e′ can be safely omitted from the spanner. Proof of Theorem 23. Fix a distributed protocol σ for constructing a (+2)-pairwise spanner with at most m/2 edges. Let G be the graph described above, and denote the edges of G′ by e1 , . . . , em . We describe a reduction from PART-COMPm,p to σ. Assume Alice has a set x ⊆ {1, . . . , m} of size p, and Bob has to output a set y ⊆ {1, . . . , m} of size m/2 satisfying x ∩ y = ∅. Alice and Bob simulate σ on the graph G with the set of pairs  P = (vi , vj ) : ∃k ∈ x ek = {vi′ , vj′ } . That is, a pair (vi , vj ) is in P if the corresponding pair (vi′ , vj′ ) is an edge ek whose index k is in x. Alice simulates the nodes in VA , and Bob simulates the nodes VB and the edges among them. 2 The girth of a graph is the length of the shortest simple cycle in it. 20 To simulate communication on edges of the form (vi , vi′ ), Alice and Bob communicate. Note that P contains only pairs of nodes that are simulated by Alice. The spanner constructed is a subgraph H of G with at most m/2 edges, satisfying δH (vi , vj ) ≤ δG (vi , vj ) + 2 for all (vi , vj ) ∈ P. For each such pair, by definition of P, we have δG (vi , vj ) = 3, which implies δH (vi , vj ) ≤ 5 and δH (vi′ , vj′ ) ≤ 3. The fact that G′ has girth 6 implies that the edge {vi′ , vj′ } must be in H. Let y = {k : ek ∈ EG \ EH } . The spanner size implies |y| ≥ m/2, while the above discussion implies x ∩ y = ∅. Thus, Bob can output a subset of y of size m/2, solving the communication complexity problem. By the communication complexity lower bound, Alice and Bob must communicate Ω(p) bits during the simulation. The number of edges they simulate together  and O(log n) bits are  is n/2, |P| sent over each edge at each round. Thus, the protocol must take Ω n log n rounds to complete. 4.3 Generalization: A Lower bound for constructing an (α, β)-Pairwise Spanner Recall that an (α, β)-pairwise spanner for a graph G and a set P of pairs of nodes is a subgraph H of G satisfying δH (u, v) ≤ αδG (u, v) + β for every (u, v) ∈ P. To obtain our lower bound for any α ≥ 1, β ≥ 0, we first study the tradeoff between the girth and number of edges in a graph. The most relevant claim for this question is Erdős’ girth conjecture: Conjecture 24 (Erdős’ Girth Conjecture [Erd64]). For every g there is a constant c such that there exists a graph on n nodes with girth g and cn 1 1+ ⌈g/2⌉−1 edges. For example, for g = 3, the complete graph on n nodes has roughly n2 /2 edges, and for g = 4 the full bipartite graph has n2 /4 edges. For g = 5 and g = 6 there exist a graph with n3/2 edges, which we used in the last section. The conjecture is known to be true for a few values of g, while for the other values there are constructions with slightly less edges: Theorem 25 (see, e.g. [Mat02,  §15.3]). For every g ≥ 3 and n ≥ 2 there is a graph on n vertices 4 1+ 3g−10 edges. For g ∈ {3, 4, 5, 6, 9, 10} there is a constant c such that for with girth g and Ω n every n ≥ 2 there is a graph on n vertices with girth g and cn 1 1+ ⌈g/2⌉−1 edges. Theorem 23 and its proof extend to (α, β)-pairwise spanners for any α ≥ 1 and β ≥ 0, with the appropriate choice of G′ . The only thing left is to make sure the diameter is constant even if the diameter of G′ is not. Bounding the diameter also allows us to derive a lower bound conditioned on Erdős’ girth conjecture, a conjecture which claims nothing about the diameter of the graph. Theorem 26. Let α ≥ 1, β ≥ 0 be constants, and g = 3α + β. There is a constant c = c(g) so that the following holds. Any distributed protocol for the CONGEST model with success probability 4 3g−10 pairs of nodes, outputs at least 2/3 which, given a graph with n nodes and a set of p ≤ cn1+   1+ 4 p an (α, β)-pairwise spanner with at most cn 3g−10 edges, must take Ω n log n rounds to complete. The lower bound holds even for graphs with diameter O(g). For g ∈ {3, 4, 5, 6, 9, 10}, and for any constant g if Erdős’ girth conjecture is true, the bound on p and on the number of edges can be replaced by cn 21 1 1+ ⌈g/2⌉−1 . The theorem implies a lower bound of Ω (n/ log(n)) rounds for any algorithm in the CONGEST model which outputs pairwise preserver with o(n2 ) edges, when |P| = Θ(n2 ). The trivial algorithm that builds a BFS tree from any node appearing in P runs in O(n) rounds and returns a spanner with O(n2 ) edges. Hence, we cannot expect to asymptotically improve upon the running time and upon the number of edges simultaneously. For (+4)-pairwise spanners, the theorem implies a lower bound of Ω(n4/11 / log n) rounds for |P| = Θ(n15/11 ). Algorithm 4P constructs such a spanner in roughly O(n107/77 log6/7 n) rounds. Assuming Erdős’ conjecture, we can choose P satisfying |P| = Θ(n4/3 ), and get a lower bound of Ω(n1/3 / log n) rounds and an algorithm running in O(n29/21 log6/7 n) rounds. The graph G for which the lower bound is proved is defined similarly to the graph in the proof of Theorem 23, with an extra construction that ensures that the diameter of G is constant. Let G′ be a graph on n′ nodes with girth g = 3α + β and m edges, where m = m(n′ , g) is the maximal possible number of edges for these n′ and g. Let v1′ , . . . , vn′ ′ be the nodes of G′ . Add to G′ a new node u and connect each node vi′ to u by a disjoint path of ⌊g/2⌋ new nodes. This increases the number of nodes in G′ and the number of edges by a multiplicative g factor, does not decrease the girth, and ensures the diameter is O(g). The lower bound graph G consists of G′ , the node u, the nodes and paths connecting each vi′ to u, and for each vi′ another node vi connected to it by an edge (vi , vi′ ). Let VA = {v1 , . . . , vn′ } and VB be the set of all other nodes. The pairwise spanner we construct approximately preserves distances between pairs of nodes in VA , i.e. P ⊆ VA × VA . Since the girth of G′ is 3α + β, if e′ = {vi′ , vj′ } is an edge in G′ and (vi , vj ) ∈ P, then any (α, β)-pairwise spanner must contain the edge e′ : in G, the distance between vi and vj is 3; and if there is a path in H connecting vi and vj with length at most 3α + β, then this path connects vi′ and vj′ in G′ with 3α + β − 2 edges, which together with e′ closes a cycle of length 3α + β − 1 < g in G′ . On the other hand, if (vi , vj ) ∈ / P then the edge e′ can be omitted from the spanner. Proof of Theorem 26. Fix a distributed protocol σ for constructing an (α, β)-pairwise spanner. Let G be the graph described above, and denote the edges of G′ by e1 , . . . , em . Theorem 25 gives the 4 bound m ≥ 2cn1+ 3g−10 for some constant c > 0. We use the same reduction from PART-COMPm,p to σ: Alice has a set x ⊆ {1, . . . , m} of size p, and Bob has to output a set y ⊆ {1, . n . . , m} of size m/2 satisfying xo ∩ y = ∅. They simulate σ on the graph G and the set of pairs P = (vi , vj ) : ∃k ∈ x ek = {vi′ , vj′ } ; Alice simulates the nodes in VA and Bob simulates the nodes VB and the edges among them. To simulate communication on edges of the form (vi , vi′ ), Alice and Bob communicate. The bound on p in the theorem statement comes from the fact that |P| ≤ m/2. The spanner constructed is a subgraph H of G with at most m/2 edges, satisfying δH (vi , vj ) ≤ α · δG (vi , vj ) + β for all (vi , vj ) ∈ P. For each such pair, the edge {vi′ , vj′ } must be in H, as explained above. Let y = {k : ek ∈ EG \ EH } . The spanner size implies |y| ≥ m/2, while the above discussion implies x ∩ y = ∅. Thus, Bob can output a subset of y of size m/2, solving the communication complexity problem. By the communication complexity lower bound, Alice and Bob must communicate Ω(p) bits during the simulation. The number of edges they simulate together is at most n, and O(log n) bits  |P| are transferred over each edge at each round. Thus, the protocol must take Ω n log n rounds to complete. 22 5 Discussion This paper presents various algorithms for computing sparse purely additive spanners in the CONGEST model. Our algorithms exhibit tradeoffs between the running time and the sparsity of the constructed spanners. By choosing different values for the parameter h, one can obtain a spanner with the same stretch in a smaller number of rounds but at the expense of increasing the density. This tradeoff is an important direction for future work. Our lower bound uses a new communication complexity problem, and leverages the distributed nature of the system by using the fact that each node initially only knows the pairs in P to which it belongs3 . That is, the topology of the graph used for the lower bound reduction is known completely to both Alice and Bob, regardless of their inputs to the PART-COMPm,p instance, while the uncertainty about the identity of the pairs in P is what makes the problem hard. While it might be unnatural to assume that other nodes know about these pairs, it is theoretically interesting to ask whether one can design faster distributed constructions given this information. Finally, we believe that our new lower bound technique can be useful for proving additional lower bounds in the CONGEST model, as it diverges from reducing to the set-disjointness problem. Acknowledgements We thank Merav Parter for a helpful discussion on the lower bound, and the anonymous referees of DISC 2016 for valuable comments. References [AB16a] Amir Abboud and Greg Bodwin. The 4/3 additive spanner exponent is tight. In ACM SIGACT Symposium on Theory of Computing, STOC, 2016. [AB16b] Amir Abboud and Greg Bodwin. Error amplification for pairwise spanner lower bounds. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 841–854, 2016. [ACIM99] Donald Aingworth, Chandra Chekuri, Piotr Indyk, and Rajeev Motwani. Fast estimation of diameter and shortest paths (without matrix multiplication). SIAM J. Comput., 28(4):1167–1181, 1999. [ADD+ 93] Ingo Althöfer, Gautam Das, David P. Dobkin, Deborah Joseph, and José Soares. On sparse spanners of weighted graphs. Discrete & Computational Geometry, 9:81–100, 1993. [Bas08] Surender Baswana. Streaming algorithm for graph spanners - single pass and constant processing time per edge. Inf. Process. Lett., 106(3):110–114, 2008. [BCE05] Béla Bollobás, Don Coppersmith, and Michael Elkin. Sparse distance preservers and additive spanners. SIAM J. Discrete Math., 19(4):1029–1055, 2005. [BKMP10] Surender Baswana, Telikepalli Kavitha, Kurt Mehlhorn, and Seth Pettie. Additive spanners and (alpha, beta)-spanners. ACM Trans. Algorithms, 7(1):5, 2010. [BKS12] 3 Surender Baswana, Sumeet Khurana, and Soumojit Sarkar. Fully dynamic randomized algorithms for graph spanners. ACM Trans. Algorithms, 8(4):35, 2012. In fact, our lower bound holds even if all nodes in pairs in P know all of P. 23 [BS07] Surender Baswana and Sandeep Sen. A simple and linear time randomized algorithm for computing sparse spanners in weighted graphs. Random Struct. Algorithms, 30(4):532–563, 2007. [BS08] Surender Baswana and Soumojit Sarkar. Fully dynamic algorithm for graph spanners with poly-logarithmic update time. In Proceedings of the Nineteenth Annual ACMSIAM Symposium on Discrete Algorithms, SODA, pages 1125–1134, 2008. [BW16] Greg Bodwin and Virginia Vassilevska Williams. Better distance preservers and additive spanners. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 855–872, 2016. [CE06] Don Coppersmith and Michael Elkin. Sparse sourcewise and pairwise distance preservers. SIAM J. Discrete Math., 20(2):463–501, 2006. [CGK13] Marek Cygan, Fabrizio Grandoni, and Telikepalli Kavitha. On pairwise spanners. In 30th International Symposium on Theoretical Aspects of Computer Science, STACS, pages 209–220, 2013. [CGK14] Keren Censor-Hillel, Mohsen Ghaffari, and Fabian Kuhn. Distributed connectivity decomposition. In ACM Symposium on Principles of Distributed Computing, PODC, pages 156–165, 2014. [Che13a] Shiri Chechik. Compact routing schemes with improved stretch. In ACM Symposium on Principles of Distributed Computing, PODC, pages 33–41, 2013. [Che13b] Shiri Chechik. New additive spanners. In Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 498–512, 2013. [CHKM12] Keren Censor-Hillel, Bernhard Haeupler, Jonathan A. Kelner, and Petar Maymounkov. Global computation in a poorly connected world: fast rumor spreading with no dependence on conductance. In Proceedings of the 44th Symposium on Theory of Computing Conference, STOC, pages 961–970, 2012. [CT06] Thomas M. Cover and Joy A. Thomas. Elements of Information Theory (Wiley Series in Telecommunications and Signal Processing). Wiley-Interscience, 2006. [DG08] Bilel Derbel and Cyril Gavoille. Fast deterministic distributed algorithms for sparse spanners. Theor. Comput. Sci., 399(1-2):83–100, 2008. [DGP07] Bilel Derbel, Cyril Gavoille, and David Peleg. Deterministic distributed construction of linear stretch spanners in polylogarithmic time. In Distributed Computing, 21st International Symposium, DISC, pages 179–192, 2007. [DGPV08] Bilel Derbel, Cyril Gavoille, David Peleg, and Laurent Viennot. On the locality of distributed sparse spanner construction. In Proceedings of the 27th Annual ACM Symposium on Principles of Distributed Computing, PODC, pages 273–282, 2008. [DGPV09] Bilel Derbel, Cyril Gavoille, David Peleg, and Laurent Viennot. Local computation of nearly additive spanners. In Distributed Computing, 23rd International Symposium, DISC, pages 176–190, 2009. [DHZ00] Dorit Dor, Shay Halperin, and Uri Zwick. All-pairs almost shortest paths. SIAM J. Comput., 29(5):1740–1759, 2000. 24 [DKO14] Andrew Drucker, Fabian Kuhn, and Rotem Oshman. On the power of the congested clique model. In ACM Symposium on Principles of Distributed Computing, PODC, pages 367–376, 2014. [DMP+ 05] Devdatt P. Dubhashi, Alessandro Mei, Alessandro Panconesi, Jaikumar Radhakrishnan, and Aravind Srinivasan. Fast distributed algorithms for (weakly) connected dominating sets and linear-size skeletons. J. Comput. Syst. Sci., 71(4):467–479, 2005. [DSHK+ 12] Atish Das Sarma, Stephan Holzer, Liah Kor, Amos Korman, Danupon Nanongkai, Gopal Pandurangan, David Peleg, and Roger Wattenhofer. Distributed verification and hardness of distributed approximation. SIAM J. Comput., 41(5):1235–1265, 2012. [Elk05] Michael Elkin. Computing almost shortest paths. ACM Trans. Algorithms, 1(2):283– 323, 2005. [Elk07a] Michael Elkin. A near-optimal distributed fully dynamic algorithm for maintaining sparse spanners. In Proceedings of the Twenty-Sixth Annual ACM Symposium on Principles of Distributed Computing, PODC, pages 185–194, 2007. [Elk07b] Michael Elkin. Streaming and fully dynamic centralized algorithms for constructing and maintaining sparse spanners. In Automata, Languages and Programming, 34th International Colloquium, ICALP, pages 716–727, 2007. [EP04] Michael Elkin and David Peleg. (1+epsilon, beta)-spanner constructions for general graphs. SIAM J. Comput., 33(3):608–631, 2004. [Erd64] P. Erdős. Extremal problems in graph theory. In Theory of graphs and its applications: proceedings of the symposium held in Smolenice in June 1963, pages 29–36. Pub. House of the Czechoslovak Academy of Sciences, 1964. [EZ06] Michael Elkin and Jian Zhang. Efficient algorithms for constructing (1+epsilon, beta)spanners in the distributed and streaming models. Distributed Computing, 18(5):375– 385, 2006. [FHW12] Silvio Frischknecht, Stephan Holzer, and Roger Wattenhofer. Networks cannot compute their diameter in sublinear time. In Proceedings of the Twenty-Third Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 1150–1162, 2012. [GK13] Mohsen Ghaffari and Fabian Kuhn. Distributed minimum cut approximation. In Distributed Computing - 27th International Symposium, DISC, pages 1–15, 2013. [HP14] Stephan Holzer and Nathan Pinsker. Approximation of distances and shortest paths in the broadcast congest clique. CoRR, abs/1412.3445, 2014. [HW12] Stephan Holzer and Roger Wattenhofer. Optimal distributed all pairs shortest paths and applications. In ACM Symposium on Principles of Distributed Computing, PODC, pages 355–364, 2012. [Kav15] Telikepalli Kavitha. New pairwise spanners. In 32nd International Symposium on Theoretical Aspects of Computer Science, STACS, pages 513–526, 2015. [KN97] Eyal Kushilevitz and Noam Nisan. Communication Complexity. Cambridge University Press, New York, NY, USA, 1997. 25 [Knu14] Mathias Bæk Tejs Knudsen. Additive spanners: A simple construction. In 14th Scandinavian Symposium and Workshops on Algorithm Theory, SWAT, pages 277–281, 2014. [KV13] Telikepalli Kavitha and Nithin M. Varma. Small stretch pairwise spanners. In 40th International Colloquium on Automata, Languages, and Programming, ICALP, pages 601–612, 2013. [LP13] Christoph Lenzen and David Peleg. Efficient distributed source detection with limited bandwidth. In ACM Symposium on Principles of Distributed Computing, PODC, pages 375–382, 2013. [Mat02] Jiri Matousek. Lectures on Discrete Geometry. Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2002. [Par14] Merav Parter. Bypassing erdős’ girth conjecture: Hybrid stretch and sourcewise spanners. In 41st International Colloquium on Automata, Languages, and Programming, ICALP, pages 608–619, 2014. [Pel00] David Peleg. Distributed Computing: A Locality-Sensitive Approach. Monographs on Discrete Mathematics and Applications. Society for Industrial and Applied Mathematics, 2000. [Pet09] Seth Pettie. Low distortion spanners. ACM Trans. Algorithms, 6(1), 2009. [Pet10] Seth Pettie. Distributed algorithms for ultrasparse spanners and linear size skeletons. Distributed Computing, 22(3):147–166, 2010. [PR99] David Peleg and Vitaly Rubinovich. A near-tight lower bound on the time complexity of distributed MST construction. In 40th Annual Symposium on Foundations of Computer Science, FOCS, pages 253–261, 1999. [PS89] David Peleg and Alejandro A. Schäffer. Graph spanners. Journal of Graph Theory, 13(1):99–116, 1989. [PU89a] David Peleg and Jeffrey D. Ullman. An optimal synchronizer for the hypercube. SIAM J. Comput., 18(4):740–747, 1989. [PU89b] David Peleg and Eli Upfal. A trade-off between space and efficiency for routing tables. J. ACM, 36(3):510–530, 1989. [RTZ05] Liam Roditty, Mikkel Thorup, and Uri Zwick. Deterministic constructions of approximate distance oracles and spanners. In 32nd International Colloquium on Automata, Languages and Programming, ICALP, pages 261–272, 2005. [RZ11] Liam Roditty and Uri Zwick. On dynamic shortest paths problems. Algorithmica, 61(2):389–401, 2011. [TZ01] Mikkel Thorup and Uri Zwick. Compact routing schemes. In SPAA, pages 1–10, 2001. [TZ05] M. Thorup and U. Zwick. Approximate distance oracles. J. ACM, 52(1), 2005. [TZ06] Mikkel Thorup and Uri Zwick. Spanners and emulators with sublinear distance errors. In Proceedings of the 17th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 802–809, 2006. [Woo10] David P. Woodruff. Additive spanners in nearly quadratic time. In 37th International Colloquium on Automata, Languages and Programming, ICALP, pages 463–474, 2010. 26
8cs.DS
Competitive caching with machine learned advice Thodoris Lykouris∗ Sergei Vassilvitskii† arXiv:1802.05399v1 [cs.DS] 15 Feb 2018 Abstract Traditional online algorithms encapsulate decision making under uncertainty, and give ways to hedge against all possible future events, while guaranteeing a nearly optimal solution as compared to an offline optimum. On the other hand, machine learning algorithms are in the business of extrapolating patterns found in the data to predict the future, and usually come with strong guarantees on the expected generalization error. In this work we develop a framework for augmenting online algorithms with a machine learned oracle to achieve competitive ratios that provably improve upon unconditional worst case lower bounds when the oracle has low error. Our approach treats the oracle as a complete black box, and is not dependent on its inner workings, or the exact distribution of its errors. We apply this framework to the traditional caching problem — creating an eviction strategy for a cache of size k. We demonstrate that naively following the oracle’s recommendations may lead to very poor performance, even when the average error is quite low. Instead we show how to modify the Marker algorithm to take into account the oracle’s predictions, and prove that this combined approach achieves a competitive ratio that both (i) decreases as the oracle’s error decreases, and (ii) is always capped by O(log k), which can be achieved without any oracle input. We complement our results with an empirical evaluation of our algorithm on real world datasets, and show that it performs well empirically even using simple off-the-shelf predictions. ∗ Cornell University, [email protected]. Work supported under NSF grant CCF-1563714. Part of the work was done while the author was interning at Google. † Google Research, [email protected]. 1 Introduction Despite the success and prevalence of machine learned systems across many application domains, there are still a lot of hurdles that one needs to overcome to deploy an ML system in practice [SHG+ 15]. As these systems are rarely 100% perfect, a key challenge is dealing with errors that inevitably arise. There are many reasons that learned systems may exhibit errors when deployed. First, most of them are trained to be good on average, minimizing some expected loss. In doing so, the system may invest its efforts on reducing the error on the majority of inputs, at the expense of increased error on a handful of outliers. Another problem is that generalization error guarantees only apply when the train and test examples are drawn from the same distribution. If this assumption is violated, either due to distribution drift or adversarial examples [SZS+ 14], the machine learned predictions may be very far from the truth. In all cases, any system backed by machine learning needs to be robust enough to handle occasional errors. While machine learning is in the business of predicting the unknown, online algorithms provide guidance on how to act without any knowledge of future inputs. These powerful methods show how to hedge decisions so that, regardless of what the future holds, the online algorithm performs nearly as well as the optimal offline algorithm. However these guarantees come at a cost: since they protect against the worst case, online algorithms may be overly cautious which translates to high competitive ratios even for seemingly simple problems. In this work, we ask: What if the online algorithm is equipped with a machine learned oracle? How can one use this oracle to combine the predictive power of machine learning with the robustness of online algorithms? We focus on a prototypical example of this area: the online paging, or caching problem. In this setting, a series of requests arrives one at a time to a server equipped with a small amount of memory. Upon processing a request, the server places the answer in the memory (in case an identical request comes in the future). Since the local memory has limited size, the server must decide which of the current elements to evict. It is well known that, if the local memory or cache has size k, then any deterministic algorithm incurs competitive ratio Ω(k). However, an O(k) bound can be also achieved by almost any reasonable strategy, thus this metric fails to distinguish between algorithms that perform well in practice and those that perform poorly. The competitive ratio of the best randomized algorithm is Θ(log k) which, despite far from trivial, is also much higher than observed in practice. In contrast, we show how p to use machine learned predictions to achieve a competitive ratio of approximately 2 + O(min( η/Opt, log k), when using a hypothesis with total absolute loss η (see Section 3 for a precise statement of results). Thus when the predictions are accurate (small η), our approach circumvents the worst case lower bounds. On the other hand, even when the oracle is inaccurate (large η), the performance degrades gracefully to almost match the worst case bound. 1.1 Our contribution The conceptual contribution of the paper lies in formalizing the interplay between machine learning and competitive analysis by introducing a general framework (Section 2), and a set of desiderata for online algorithms that use a machine learned oracle. We look for approaches that: 1 • Make minimal assumptions on the machine learned oracle. Specifically, since most machine learning guarantees are on the expected performance, our results are parametric as a function of the error in the oracle η, and not the distribution of the error. • Are robust: a better oracle (one with lower η) should result in lower competitive ratios. • Are worst-case competitive: no matter the performance of the oracle on the particular instance, the algorithm should behave comparably to the best online algorithm for the problem. We instantiate the general framework to the online caching problem, specifying the prediction made by the oracle, and presenting an algorithm that uses that prediction effectively (Section 3). Along the way we show that algorithmic innovation is necessary: simply following the recommendations of the predictor may lead to poor performance, even when the average error is small (Section 3.1). Instead, we adapt the Marker algorithm [FKL+ 91] to carefully incorporate the feedback of the predictor. The resulting approach, which we call Predictive Marker has guarantees that capture the best of both worlds: the algorithm performs better as the error of the oracle decreases, but performs nearly as well as the best online algorithm in the worst case. Our analysis generalizes to multiple potential loss functions (such as absolute loss and squared loss). This freedom in the loss function with the black-box access to the oracle allows our results to be strengthened with future progress in machine learning and reduces the task of designing better algorithms to the task of finding better predictors. We complement our theoretical findings with empirical results (Section 4). We test the performance of our algorithm on public data using off-the-shelf machine learning models. We compare the performance to the Least Recently Used (LRU) algorithm, which serves as the gold standard, the original Marker algorithm, as well as directly using the predictor. In all cases, the Predictive Marker algorithm outperforms known approaches. Before moving to the main technical content, we provide a simple example that highlights the main concepts of this work. 1.2 Example: Faster Binary Search Consider the classical binary search problem. Given a sorted array A on n elements and a query element q, the goal is to either find the index of q in the array, or state that it is not in the set. The textbook method is binary search: compare the value of q to that of the middle element of A, and recurse on the correct half of the array. After O(log n) probes, the method either finds q or returns. Instead of applying a binary search, one can train a classifier, h, to predict the position of q in the array. (Although this may appear to be overly complex, Kraska et.al [KBC+ 17] empirically demonstrate the advantages of such a method.) How to use such a classifier? A simple approach is to first probe the location at h(q); if q is not found there, we immediately know whether it is smaller or larger. Suppose q is larger than the element in A[h(q)] and the array is sorted in increasing order. We probe elements at h(q) + 2, h(q) + 4, h(q) + 8, and so on, until we find an element smaller than q (or we hit the end of the array). Then we simply apply binary search on the interval that’s guaranteed to contain q. What is the cost of such an approach? Let t(q) be the true position of q in the array (or the position of the largest element smaller than q if it is not in the set). The absolute loss of the classifier on q is 2 then q = |h(q) − t(q)|. On the other hand, the cost of running the above algorithms starting at h(q) is at most 2(log |h(q) − t(q)|) = 2 log q . If the queries q come from a distribution, then the expected cost of the algorithm is: h i h i 2Eq log (|h(q) − t(q)|) ≤ 2 log Eq |h(q) − t(q)| = 2 log Eq [q ], where the inequality follows by Jensen’s inequality. This gives a trade-off between the performance of the algorithm and the absolute loss of the predictor. Moreover, since q is trivially bounded by n, √ this shows that even relatively weak classifiers (those with average error of n) this can lead to an improvement in performance. 1.3 Related work Our work builds upon the foundational work on competitive analysis and online algorithms; for a great introduction see the book by Borodin and El-Yaniv [BEY98]. Specifically we look at the standard caching problem, see, for example, [MR95]. While many variants of caching have been studied over the years, our main starting point will be the Marker algorithm by Fiat et al. [FKL+ 91]. As we mentioned earlier, competitive analysis fails to distinguish between algorithms that perform well in practice, and those that perform well only in theory. Several fixes have been proposed to address these concerns, ranging from resource augmentation, where the online algorithm has a larger cache than the offline optimum [ST85], to models of real-world inputs that restrict the inputs analyzed by the algorithm, for example, insisting on locality of reference [AFG02], or the more general Working Set model [Den68]. The idea of making assumption on the nature of the input to prove better bounds is common in the literature. The most popular of these is that the data arrive in a random order. This is a critical assumption in the secretary problem, and, more generally, in other streaming algorithms, see for instance the survey by McGregor [McG14]. While the assumption leads to algorithms that give good insight into the structure of the problem, it rarely holds true, and is often very hard to verify. Another common assumption on the structure of the input gives rise to Smoothed Analysis, introduced in a pioneering work by Spielman and Teng [ST04] explaining the practical efficiency of the Simplex method. Here, they assume that any worst case instance is perturbed slightly before being passed to the algorithm; the idea is that this perturbation may be due to measurement error, or some other noise inherent in the data. The goal then is to show that the worst case inputs are brittle, and do not survive addition of random noise. Since its introduction this method has been used to explain the unusual effectiveness of many practical algorithms such as ICP [AV06], Lloyd’s method [AMR11], and local search [ERV16], in the face of exponential worst case bounds. The prior work that is closest in spirit to ours looks for algorithms that, under some data distribution assumption, do (almost) as well as their counterparts that assume something about the data, but also have worst case guarantees. These may assume that the data follows some predicted patterns [MNS12] or arrives from a stochastic distribution [MGZ12, BS12]. On a related note, Ailon et al. [ACC+ 11] consider “self-improving” algorithms that effectively learn the input distribution, and adapt to be nearly optimal in that domain. We do not make any such assumption, rather we aim to classify instances into “easy” and “hard” depending on their predictability by a machine learned oracle. The “easy” examples are those on 3 which the latest machine learning technology, be it perceptrons, decision trees, SVMs, Deep Neural Networks, GANs, LSTMs, or whatever else may come in the future, has small error. Importantly, our approach is completely agnostic to the inner workings of the predictor and treats it as a black box. The “hard” examples, are those where the prediction quality is poor, and we have to rely more on classical competitive analysis to get good results. One avenue of research close to our setting, asks what happens if the algorithm cannot view the whole input, but must rely on a sample of the input to make its choices. Introduced in the seminal work of Cole and Roughgarden [CR14], this notion of Learning from Samples, can be viewed as first designing a good prediction function, h, and then using it in the algorithms. Indeed, some of the follow up work [MR16, BRS17] proves tight bounds on precisely how many samples are necessary to achieve good approximation guarantees. In contrast, we assume that the online algorithm is given access to a machine learned oracle, but does not know any details of its inner workings—we know neither the average performance of the oracle, nor the distribution of the errors. Very recently, two papers explored domains similar to ours. Medina and Vassilvitskii [MV17] showed how to use a machine learned oracle to optimize revenue in repeated posted price auctions. Their work has a mix of offline calculations and online predictions and focuses on the specific problem of revenue optimization. Kraska et al. [KBC+ 17] demonstrated empirically that introducing machine learned components to classical algorithms (in their case index lookups) can result in significant speed and storage gains. However, unlike this work, their results are experimental, and they do not provide trade-offs on the performance of their approach vis-à-vis the error of the machine learned oracle. 2 Online Algorithms with Machine Learned Advice In this section, we introduce a general formulation to combine online algorithms with machine learning predictions, which we term Online with Machine Learned Advice model (OMLA). Before introducing the model, we review some basic notions from machine learning and online algorithms. 2.1 Preliminaries Machine learning basics We are given a feature space X , describing the salient characteristics of each item and a set of labels Y. An example is a pair (x, y), where x ∈ X describes the specific features of the example, and y ∈ Y gives the corresponding label. In the binary search application, x can be thought as the query element q searched and y as its true position t(x). A hypothesis is a mapping h : X → Y and can be probabilistic in which case the output on x ∈ X is some probabilistically chosen y ∈ Y. In binary search, h(x) corresponds to the predicted position of the query. To measure the performance of a hypothesis, we first define a loss function ` : Y ×Y → R≥0 . When the labels lie in a metric space, we define absolute loss `1 (y, ŷ) = |y − ŷ|, squared loss `2 (y, ŷ) = (y − ŷ)2 , and classification loss `c (y, ŷ) = 1y6=ŷ . Given a sequence of labels, σ = y1 , y2 , . . . , yn and a set of predictions Pσ̂n = ŷ1 , . . . , ŷn , we will abuse notation and define `(σ, σ̂) as the total loss on the sequence, `(σ, σ̂) = i=1 `(yi , ŷi ). 4 Competitive analysis To obtain worst-case guarantees for an online algorithm (that must make decisions as each element arrives), we compare its performance to that of an offline optimum (that has the benefit of hindsight). Let σ be the input sequence of elements for a particular online decision making problem, cost A (σ) be the cost incurred by an offline algorithm A on this input, and cost ? (σ) be the cost incurred by the optimal offline algorithm. Then algorithm A is called α-competitive if cost A (σ) ≤ α · cost ? (σ). The Caching Problem The caching (or online paging) problem considers a system with two levels of memory: a slow memory of size m, and a fast memory of size k. A caching algorithm is faced with a sequence of requests for elements. If the requested element is in the fast memory, a cache hit occurs and the algorithm can satisfy the request at no cost. If the requested item is not in the fast memory, a cache miss occurs, the algorithm fetches the item from the slow memory, and places it in the fast memory before satisfying the request. If the fast memory is full, then one of the items must be evicted. The eviction strategy forms the core of the caching online algorithmic problem. The goal is to find an eviction policy that results in the fewest number of cache misses. It is well known that the optimal offline algorithm at time t evicts the element from the cache that will arrive the furthest in the future. On the other hand, without the benefit of foresight, any deterministic caching algorithm achieves a competitive ratio of Ω(k), and any randomized caching algorithm achieves a competitive ratio of Ω(log k), see for instance [MR95]. 2.2 OMLA Definition We first specify the input and the predictions made by the machine learned oracle. The online input consists of a set of elements Z. For a specific input σ, its elements are denoted by z1 , z2 , . . . and its length by |σ|. Formalizing the machine learning task, we assume a feature space X and a label space Y. The i-th element zi has features xi ∈ X and a label yi ∈ Y. In defining the framework we are not concerned with the semantics of the labels, i.e. what is the quantity that h is predicting or how it was trained – we are only interested in its performance. We define the respective total loss functions: P • Total Classification Loss: ηc = i `c (yi , h(xi )), P • Total Absolute Loss: η1 = i `1 (yi , h(xi )), and P • Total Squared Loss: η2 = i `2 (yi , h(xi )). Definition 1. In the Online with Machine Learned Advice (OMLA) model, we are given: • An input σ = {z1 , z2 , . . . , z|σ| }; each zi ∈ Z has features xi ∈ X and labels yi ∈ Y. • A hypothesis function h : X → Y that predicts a label for each x ∈ X . • Finally, given σ and h, we can define ηc , η1 , and η2 as specified above. Our goal is to create online algorithms that can use the advice h to achieve a good competitive ratio. Note that, in each problem instance, the algorithms depend both on the semantics of the prediction (i.e. what is being predicted) and the quality of the predictor h as measured by η. 5 Importantly, we do not alter the definition of the competitive ratio—we expect our algorithms to work well on any sequence σ; however, the competitive ratio may depend on the total loss η. Suppose that an algorithm A uses a predictor h with loss η to achieve a competitive ratio c(η). Definition 2. A is α-robust for some function α(η), if c(η) is non-decreasing and c(η) = O(α(η)). Definition 3. A is β-consistent if c(0) = β. Definition 4. Let c? denote the best offline optimum solution. A is γ-competitive if c(η) ≤ γc? for all values of η. The holy grail is to find 1-consistent, robust, and most competitive algorithms: they are never worse than the algorithms that do not use the ML oracle, and perform as well as the offline optimum when the oracle is perfect. 2.3 Caching with ML Advice To instantiate the framework for the caching problem, we need to define the oracle, the label space of the predictions, and their semantics. The element space Z corresponds to the universe of elements that may be requested. The input sequence σ = z1 , z2 , · · · , zn is the actual sequence of elements that are requested (fixed in advance and oblivious to the choices of the algorithm but unknown to it). Each element zi ∈ Z has corresponding feature xi . This feature can encapsulate everything that is known about zi at the time i, for example, the times that zi arrived in the past. The exact choice of X is orthogonal to our setting, though of course richer features typically lead to smaller errors. The machine learning task is to predict the next time a particular element is going to appear. As such, the label space Y is a set of positions in the sequence, Y = N+ . Given a sequence z1 , z2 , . . . , zn , yi = minτ >i {τ : zτ = zi }. If the element is never seen again, we set yi = n + 1. Note that yi is completely determined by the sequence σ. We use h(xi ) to denote the outcome of the prediction on an element with features xi . To simplify notation, we denote this quantity by hi . 3 Algorithms Before describing our algorithm in detail, we show that simply trusting the oracle and following its predictions can lead to poor results even when the oracle is relatively good. This motivates the need to combine the oracle’s predictions with classic tools from competitive analysis. 3.1 Black-box approaches An immediate way to use the oracle is to treat its output as truth. This corresponds to a strategy that evicts the element that is predicted by h to appear furthest into the future. This approach, however, can lead to bad competitive ratios, even when the oracle is quite accurate on average. Consider the case when k = 2 and there are three elements a, b, c. The initial configuration of the cache has a, b, at which point c comes. The actual sequence has length T and, after the first element, consists of bcbcbcbc.... In contrast, for these elements, the oracle predicts acbcbcbc..., i.e. it predicts 6 that a will reappear instantly, but is correct about all future predictions. The optimal approach in this example has one cache miss while the algorithm incurs T cache misses, because it never evicts a. Thus the algorithm incurs cache miss almost every time, leading to an unbounded competitive ratio, even though the average absolute loss is η1/T = 1. It is tempting to “fix” this approach by evicting elements whose predicted times have passed, but follow the same idea otherwise. Formally, let h(j, t) denote the last prediction about zj at or prior to time t. At time t this “fixed” approach evicts an arbitrary item from the set St = {j : h(j, t) < t} if St 6= ∅ and arg maxzi ∈Cache(t) h(i, t) otherwise. We show that the competitive ratio of this algorithm is also unbounded even when the average absolute loss is constant. Assume a cache of size k = 3 and four elements a, b, c, d. The initial configuration is a, b, c, when element d arrives. Let the total length of the sequence be T . The true sequence has element b at the last time T , element c at times 2r + 1 where r is odd, d at times 2r + 1 where r is even, and a at all other times. The oracle predicts the next appearance of a and b correctly but is incorrect on elements c and d and always predicts their next appearance time at T + 1. The optimal algorithm evicts b, and has two cache misses (when d arrives for the first time, and when b arrives at time T ). On the other hand, the described algorithm keeps a, b always in the cache and incurs a cache miss for each appearance of c, d, a total of log(T ) misses. This is despite the fact that the average absolute loss is again a constant: η1/T = 3 as the errors form a geometric series. The common problem in both examples is that there is an element that should be removed but the algorithm is tricked into keeping it in the cache. To deal with this in practice, most popular heuristics such as LRU (Least Recently Used) and FIFO (First In First Out) avoid evicting recent elements when some elements have been dormant for a long time. However, this imposes a strict eviction policy, and adding additional information provided by the oracle is not straightforward. The above examples highlight the difficulty in finding robust algorithms, i.e. those that lead to low error when the oracle error is small. We remark that turning a robust algorithm into a competitive one can be done in a black box manner, albeit suboptimally. Theorem 1. For the caching problem, let A be an α-robust algorithm and B a γ-competitive algorithm. We can then create a black-box algorithm ALG that is both 9α-robust and 9γ-competitive. Proof. We proceed by simulating A and B in parallel on the dataset, and maintaining the cache state and the number of misses incurred by each. Our algorithm switches between following the strategy of A and the strategy of B. Let ct (A) and ct (B) denote the cost (number of misses) of A and B up to time t. Without loss of generality, let ALG begin by following strategy of A; it will do so until a time t where ct (A) = 2 · ct (B). At this point ALG switches to following the eviction strategy of B, doing so until the simulated cost of B is double that of A: a time t0 with ct0 (B) = 2 · ct0 (A). At this point it switches back to following eviction strategy of A, and so on. When ALG switches from A to B, the elements that A has in cache may not be the same as those that B has in the cache. In this case, it needs to reconcile the two. However, this can be done lazily (at the cost of an extra cache miss for every element that needs to be reconciled). To prove the bound on the performance of the algorithm, we need to show that ct (ALG) ≤ 9 · min(ct (A), ct (B)) for all t. We decompose the cost incurred by ALG into that due to following the different algorithms, which we denote by ft (ALG), and that due to reconciling caches, rt (ALG). We prove a bound on the following cost ft by induction on the number of switches. Without loss of generality, suppose that at time t, ALG switched from A to B, and at time t0 it switches from B back to A. By induction, suppose that ft (ALG) ≤ 3 min(ct (A), ct (B)) = 3ct (B), where the equality follows since ALG switched from A to B at time t. In both cases, assume that caches are instantly 7 reconciled. Then: ft0 (ALG) = ft (ALG) + (ct0 (B) − ct (B)) = ft (ALG) + 2ct0 (A) − 1/2ct (A) ≤ 3ct (B) + 2(ct0 (A) − ct (A)) + 3/2 · ct (A) = 3ct (A) + 2(ct0 (A) − ct (A)) ≤ 3ct0 (A) = 3 min(ct0 (A), ct0 (B)) What is left is to bound the following cost for the time since the last switch. Let s denote the time of the last switch and, assume without loss of generality that it was done from A to B. Let s0 denote the last time step. By the previous set of inequalities (changing the second equation to inequality) and the fact that the algorithm never switched back to A after s, it holds that fs0 (ALG) ≤ 3cs0 (A) ≤ 6 min(cs0 (A), cs0 (B)). To bound the reconciliation cost, assume the switch at time t is from A to B. We charge reconciling each element in B \ A to the cache miss when the element was last evicted by A. Therefore the overall reconciliation cost is bounded by rt (ALG) ≤ ct (A) + ct (B) ≤ 3 min(ct (A), ct (B). While the above approach gives a black-box manner to transform consistent algorithms into consistent and competitive ones, it is far from efficient or practical. In the next section we show how to carefully modify a proposed consistent algorithm to make it more competitive. 3.2 Predictive Marker Algorithm We now present our main technical contribution, an oracle-based p adaptation of the Marker algorithm [FKL+ 91] that achieves a competitive ratio of 2 · min(2 + 2 η1 /OP T , 2Hk ). Classic Marker algorithm We begin by recalling the Marker algorithm and the analysis on its performance. The algorithm runs in phases. At the beginning of each phase, all elements are unmarked. When an element arrives and is already in the cache, the element is marked. If it is not in the cache, a random unmarked element is evicted, the newly arrived element is placed in the cache and is marked. Once all elements are marked and a new cache miss occurs, the phase ends and we unmark all of the elements. For the purposes of analysis, an element is called clean for phase r if it appears during phase r, but does not appear during phase r − 1. In contrast, elements that also appeared in the previous phase are called stale. The marker algorithm has competitive ratio of 2Hk − 1 and the analysis is tight [ACN00]. We use a slightly simpler analysis that achieves competitive ratio of 2Hk below. The crux of the upper bound lies in two lemmas. The first relates the performance of the optimal offline algorithm to the number of clean elements L by proving that Opt ≥ 2L (Lemma 1). The second comes from bounding the performance of the algorithm as a function of the number of clean elements by proving that it is at most L · Hk in expectation (Lemma 2). For completeness, we provide the proofs of these lemmas in Appendix A. Lemma 1 ([FKL+ 91]). Let L be the number of clean elements. Then the optimal algorithm suffers at least L/2 cache misses. 8 Lemma 2 ([FKL+ 91]). Let L be the number of clean elements. Then the expected number of cache misses of the marker algorithm is L · Hk when randomly tie-breaking across unmarked elements. Predictive Marker Delving into the analysis of the Marker algorithm, observe that it never evicts marked elements when there are unmarked elements present. This gives an upper bound of O(k) on the competitive ratio for any tie-breaking rule that selects an unmarked element for eviction. It is natural then to use the predictions made by the oracle for tie-breaking, specifically by evicting the element whose predicted next appearance time is furthest in the future. When the oracle is perfect (and has zero error), then stale elements never result in cache misses, and therefore, by Lemma 1, the algorithm has a competitive ratio of 2. On the other hand, by using the Marker algorithm and not blindly trusting the oracle, guarantees a worst-case ratio of O(k). This is a promising direction, however an imperfect oracle may lead to high competitive ratios and perform much worse than the best offline algorithm. The problem arises when the oracle’s errors are concentrated in one phase, here the above algorithm may have a high competitive ratio. We therefore focus on creating a tie-breaking rule that gives a 2-consistent algorithm: as the oracle error goes to 0, the competitive ratio goes towards 2 while, at the same time being (approximately) competitive, i.e. keeping a worst-case O(Hk ) competitive ratio. To achieve this, we combine the oracle-based tie-breaking rule with the random tie-breaking rule. Suppose an element e is evicted during the phase. We construct a blame graph to understand the reason why e is evicted. There are two cases: either it was evicted when a clean element c arrived, in which case we add a directed edge from e to c, or it was evicted because a stale element, s, arrived, but s was previously evicted. In this case, we add a directed edge from e to s. Note that the graph is always a set of chains (paths). The total length of the chains represents the total number of evictions incurred by the algorithm during the phase, whereas the number of distinct chains represents the number of clean elements; we call the lead element in every chain, the representative and denote it by ω(r, c), where r is the index of the phase and c the index of the chain in the phase. Our modification is simple—when a stale element arrives, it evicts a new element in an oracle-based manner if the corresponding clean element has slack (its chain has length less than Hk ). Otherwise it evicts a random unmarked element. (In expectation this results in at most Hk elements added to any one chain during the course of the phase by the analysis of Lemma 2). This guarantees that the competitive ratio is at most 4Hk in expectation; we make the argument formal in Theorem 2. The crux to the analysis is the fact that the chains are disjoint, thus the interactions between eviction can be decomposed cleanly. We give a formal version of the algorithm in Algorithm 1. 3.3 Analysis In order to analyze the performance of the proposed algorithm, we begin with a technical definition that captures how slowly a loss function ` can grow. Definition 5. Let AT = a1 , a2 , . . . , aT , be a sequence of increasing integers of length T , that is a1 < a2 < . . . < aT , and BT = b1 , b2 , . . . , bT a sequence of non-decreasing reals of length T , b1 ≤ b2 ≤ . . . ≤ bT . For a fixed loss function `, we define its spread S` : N+ → R+ as: S` (m) = min{T : min `(AT , BT ) ≥ m} AT ,BT 9 Algorithm 1 Predictive Marker with oracle-based and random tie-breaking based on clean chains Require: Cache C of size k initially empty (C ← ∅). 1: Initialize phase counter r ← 1, unmark all elements (M ← ∅), and set round i ← 1. 2: Initialize clean element counter `r ← 0 and clean set S ← ∅. 3: Element zi arrives, and the oracle gives a prediction hi . Save prediction p(zi ) ← hi . 4: if zi does not result in cache miss (zi ∈ C or |C| < k) then 5: Add to cache C ← C ∪ {zi } and go to step 26 6: end if 7: if |M| = |C| (all cache elements are marked) then 8: Increase phase (r ← r + 1), initialize clean counter (`r ← 0), save cache as clean set (S → C), and unmark elements (M ← ∅). 9: end if 10: if zi is a clean element (zi ∈ S) then 11: Increase number of clean elements: `r ← `r + 1. 12: Initialize size of new clean chain: n(r, `r ) ← 1. 13: Select to evict unmarked element with highest predicted time: e = arg maxz∈C−M p(z). 14: end if 15: if zi is a stale element (zi ∈ / S) then 16: It is the representative of some clean chain. Let c be this clean chain: zi = ω(r, c). 17: Increase length of the clean chain n(r, c) ← n(r, c) + 1. 18: if n(r, c) ≤ Hk then 19: Select to evict unmarked element with highest predicted time: e = arg maxz∈C−M p(z). 20: else 21: Select to evict a random unmarked element e ∈ C − M. 22: end if 23: Update cache by evicting e: C ← C ∪ {zi } − {e}. 24: Set e as representative for the chain: ω(r, c) ← e. 25: end if 26: Mark incoming element (M ← M ∪ {zi }), increase round (i ← i + 1), and go to step 3. The following Lemma is proved in the Appendix: √ P Lemma 3. For absolute loss,P`1 (A, B) = i |ai − bi |, the spread of `1 √ is S`1 (m) ≤ 4m + 1. For squared loss, `2 (A, B) = (ai − bi )2 , the spread of `2 is S`2 (m) ≤ 3 14m. We now provide the main theorem of the paper. Theorem 2. Suppose that the oracle has total loss η under a loss function ` with spread bounded by S` . If S` is concave, then the competitive ratio is at most   η   2 · min 1 + 2S` , 2Hk . Opt Proof. Fix a phase of the marker algorithm, consider a particular clean element c that arrives and evicts a stale element s1 . Until s1 arrives again, the effect of this eviction is non-existent (as no other element is affected). When s1 arrives, it evicts another element which we call s2 , and so on. Consider the clean chain consisting of c, s1 , s2 , . . . . For the first Hk elements of this chain, the predicted times are in weakly decreasing order since the reason why we evicted si instead of sj with i < j was because the predicted time of the former was no earlier than the one of the latter (as both of them were unmarked at the time since sj was also later evicted within the phase). However, the actual 10 arriving times are in increasing order. Therefore, if the total loss on these elements in the chain is at most , then the number of stale elements (and the number of misses) is at most S` (). If this is higher than Hk , then the algorithm switched to random eviction which by Lemma 2 results in at most another Hk stale elements in expectation. As a result, the expected number of stale elements is never more than 2Hk and is less than S` () when this quantity is less than Hk ; it is therefore upper bounded by min(2 · S` (), 2Hk ). Let L be the number of clean elements (and therefore also chains). Since both S` and the minimum operator are concave functions, the way to maximize the number of stale elements in each chain is to apportion the total error, η, equally across all of the chains. Thus there are L chains with error η/L each. The total number of stale elements is then: L · min(2 · S` (η/L), 2Hk ). By Lemma 1, L/2 ≤ Opt, which implies the result since also trivially Opt ≤ L. We now specialize the results for the absolute and squared losses. Corollary 1. The competitive   ratio of Algorithm 1 when the oracle has `1 error η1 is at most p 4·η 1 /Opt + 1, 4Hk . min 2 + 2 Corollary 2. The competitive ratio of Algorithm 1 when the oracle has squared loss η2 , is at most   p 3 14·η 2 min 2 + 2 /Opt, 4Hk . 3.4 Discussion and Extensions We have shown how to tie the loss of the machine learned oracle, h, to the performance of the Predictive Marker, and gave a bound on the interplay of the two. We explore additional extensions to the algorithm below, giving a more general trade-off between its robustness and competitiveness, as well as giving a tighter analysis on its performance. Finally, we show how to view the LRU algorithm as a variant of Predictive Marker with a specific, easy to compute objective function. Robustness vs. Competitiveness One of the free parameters in Algorithm 1 is on the length of the chain when the algorithm switches from following the oracle to random unmarked evictions. If the switch occurs after chains grow to γHk in length, this provides a trade-off between competitiveness and robustness. Theorem 3. Suppose that, for some γ > 0, the algorithm uses γHk as switching point, the oracle has total loss η under a loss function ` with spread bounded by S` . If S` is concave, then the competitive ratio is at most   1+γ  η  2 · min 1 + S` , (1 + γ)Hk . γ Opt Note that setting γ close to 0 makes the algorithm more conservative (switching to random evictions earlier), and thus reduces the competitive ratio when the oracle error is large. On the other hand, setting γ high has the algorithm trusting the oracle more, and reduces the competitive ratio when the oracle error is small. 11 Tighter Analysis Standard loss functions like absolute and squared loss are defined on a per element basis. On the other hand, we can get a tighter bound on the performance of Predictive Marker, if we compare the sequence generated by the oracle with the ground truth. Formally, let (e, i) be the pair that corresponds to the i-th arrival of element e. Create the sequence AT by putting these pairs in increasing order of their true arrival time and BT by putting them in increasing order of their predicted arrival time. The edit distance, `ed , between these two sequences precisely captures the performance of Predictive Marker. Theorem 4. The competitive ratio of Algorithm 1 when the oracle has `ed error ηed is at most  ηed min 3 + 2 Opt , 4Hk Proof. Note that for any clean chain, the first m ≤ Hk stale elements are in inverse order in AT and BT ; else they would not be evicted. Therefore these elements are certainly misplaced in the edit distance metric and contribute an error of m − 1. The rest of the proof follows the same steps as the one of Theorem 2. Unifying Framework for Caching We remark that one can express the popular Least Recently Used (LRU) algorithm for caching in the framework above. Suppose for an element that appears at time i we predict its next appearance at time −i. Then the element that is predicted to appear furthest in the future is exactly the one that has appeared least recently. PredictiveMarker with these predictions exactly simulates LRU when the switching thrshold is k. The reason is that just like Marker, such an implementation of LRU never removes a marked element (that appeared more recently) when an ummarked element (that appeared earlier) is present. This implies that we can make LRU more robust by combining it with random eviction in case there are many errors accumulated in some phase. Similarly, the Classic Marker algorithm can be written in the framework with any predictor and a switching threshold of 0 (which implies that we always immediately move to random eviction). In the subsequent section, we present empirical results to show how Predictive Marker compares to these algorithms. 4 Experiments In this section we evaluate our approach on real world datasets, empirically demonstrate its dependence on the errors in the oracle, and compare it to standard baselines, like LRU and Marker. Datasets and Metrics We consider two datasets taken from different domains to demonstrate the wide applicability of our approach. • BK is data extracted from BrightKite, a now defunct social network. We consider sequences of checkins, and extract the top 100 users with the longest non-trivial check in sequences—those where the optimum policy would have at least 50 misses. This dataset is publicly available at [CML11, Bri]. Each of the user sequences represents an instance of the caching problem. • Citi is data extracted from CitiBike, a popular bike sharing platform operating in New York City. We consider citi bike trip histories, and extract stations corresponding to starting points 12 Dataset BK Citi Num Sequences 100 24 Sequence Length 2,101 25,000 Unique Elements 67– 800 593 – 719 Table 1: Number of sequences; sequence length; min and max number of elements for each dataset. of each trip. We create 12 sequences, one for each month of 2017 for the New York City dataset. We consider only the first 25,000 events in each file. This data is publicly available at [Cit]. We give some additional statistics about each datasets in Table 1. Our main metric for evaluation will be the competitive ratio of the algorithm, defined as the number of misses incurred by the particular strategy divided by the optimum number of misses. Predictions We run experiments with both synthetic predictions to showcase the sensitivity of our methods to learning errors, and with preditions using an off the shelf classifier, published previously [AKTV14]. • Synthetic Predictions. For each element, we first compute the true next arrival time, setting it to n + 1 if it does not appear in the future. To simulate the performance of an ML system, we set h(t) = y(t) + , where  is drawn i.i.d. from a lognormal distribution with mean parameter 0 and standard deviation σ. We chose the lognormal distribution of errors to demonstrate the sensitivity to rare but large failures of the learning algorithm. Finally, observe since we only compare the relative predicted times for each method, adding a bias term to the predictor would not change the rsults. • PLECO Predictions. In their work Anderson et al. [AKTV14] developed a simple framework to model repeat consumption, and published the parameters of their PLECO (Power Law with Exponential Cut Off) model for the BrightKite dataset. While their work focused on predicting the relative probabilities of each element (re)appearing in the subsequent time step, we modify it to predict the next time an element will appear. Specifically, we set h(t) = t + 1/p(t), where p(t) represents the probability that element that appeared at time t will re-appear at time t + 1. Algorithms We consider multiple algorithms for evaluation. • LRU is the Least Recently Used policy that is wildly successful in practice. • Marker is the classical Marker algorithm due to Fiat et al. [FKL+ 91]. • PredictiveMarker is the algorithm we develop in this work. We set the switching cost to k, and therefore never switch to random evictions. • Blind Oracle is the algorithm described in Section 3.1, which evicts the element predicted to appear furthest in the future. 4.1 Results We set k = 10, and summarize the synthetic results on the BK dataset in Figure 1. Observe that the performance of Predictive Marker is consistently better than LRU and standard Marker, and 13 Figure 1: Ratio of average number of evictions as compared to optimum for varying levels of oracle error. Algorithm Blind Oracle LRU Marker Predictive Marker Competitive Ratio on BK 2.049 1.280 1.310 1.266 Competitive Ratio on Citi 2.023 1.859 1.869 1.810 Table 2: Competitive Ratio using PLECO model. degrades slowly as the average error increases, as captured by the theoretical analysis. Second, we empirically verify that blindly following the oracle works well when the error is very low, but quickly becomes incredibly costly. The results using the PLECO predictor are shown in Table 2, where we keep k = 10 for the BK dataset and set k = 100 for Citi; we note that the ranking of the methods is not sensitive to the cache size, k. We can again see that the Predictive Marker algorithm outperforms all others, and is 2.5% better than the next best method, LRU. While the gains appear modest, we note they are statistically significant at p < 0.001. Moreover, the off the shelf PLECO model was not tuned or optimized for predicting the next appearance of each element. 5 Conclusion In this work, we introduce the study of online algorithms with the aid of machine learned oracles. This combines the empirical success of machine learning with the rigorous guarantees of online algorithms. We model the setting for the classical caching problem and give an oracle-based algorithm whose competitive ratio is directly tied to the accuracy of the machine learned oracle. Our work opens up two avenues for future work. On the theoretical side, it would be interesting to see similar oracle-based algorithms for other online settings such as the k-server problem. On the practical side, our caching algorithm shows how we can use machine learning in a safe way, avoiding problems caused by rare wildly inaccurate predictions. At the same time, our experimental results show that even with simple predictors, our algorithm provides an improvement compared to LRU. In essence, we have reduced the worst case performance of the caching problem to that of finding a good (on average) predictor. This opens up the door for practical algorithms that need not be tailored towards the worst-case or specific distributional assumptions, but still yield provably good performance. 14 Acknowledgements The authors would like to thank Andrés Muñoz-Medina and Éva Tardos for valuable discussions as well as an anonymous reviewer for pointing towards the direction of Theorem 1. References [ACC+ 11] Nir Ailon, Bernard Chazelle, Kenneth L. Clarkson, Ding Liu, Wolfgang Mulzer, and C. Seshadhri. Self-improving algorithms. SIAM J. Comput., 40(2):350–375, 2011. [ACN00] Dimitris Achlioptas, Marek Chrobak, and John Noga. Competitive analysis of randomized paging algorithms. Theor. Comput. Sci., 234(1-2):203–218, 2000. [AFG02] Susanne Albers, Lene M. Favrholdt, and Oliver Giel. On paging with locality of reference. In Proceedings of the Thiry-fourth Annual ACM Symposium on Theory of Computing, STOC ’02, pages 258–267, New York, NY, USA, 2002. ACM. [AKTV14] Ashton Anderson, Ravi Kumar, Andrew Tomkins, and Sergei Vassilvitskii. The dynamics of repeat consumption. In Proceedings of the 23rd International Conference on World Wide Web, WWW ’14, pages 419–430, New York, NY, USA, 2014. ACM. [AMR11] David Arthur, Bodo Manthey, and Heiko Röglin. Smoothed analysis of the k-means method. J. ACM, 58(5):19:1–19:31, 2011. [AV06] David Arthur and Sergei Vassilvitskii. Worst-case and smoothed analysis of the ICP algorithm, with an application to the k-means method. In 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2006), 21-24 October 2006, Berkeley, California, USA, Proceedings, pages 153–164, 2006. [BEY98] Allan Borodin and Ran El-Yaniv. Online Computation and Competitive Analysis. Cambridge University Press, New York, NY, USA, 1998. [Bri] Brightkite data. http://snap.stanford.edu/data/loc-brightkite.html. [BRS17] Eric Balkanski, Aviad Rubinstein, and Yaron Singer. The limitations of optimization from samples. In STOC, 2017. [BS12] Sébastien Bubeck and Aleksandrs Slivkins. The best of both worlds: Stochastic and adversarial bandits. In COLT 2012 - The 25th Annual Conference on Learning Theory, June 25-27, 2012, Edinburgh, Scotland, pages 42.1–42.23, 2012. [Cit] Citibike system data. http://https://www.citibikenyc.com/system-data. [CML11] Eunjoon Cho, Seth A. Myers, and Jure Leskovec. Friendship and mobility: User movement in location-based social networks. In Proceedings of the 17th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’11, pages 1082–1090, New York, NY, USA, 2011. ACM. [CR14] Richard Cole and Tim Roughgarden. The sample complexity of revenue maximization. In Symposium on Theory of Computing, STOC 2014, New York, NY, USA, May 31 June 03, 2014, pages 243–252, 2014. 15 [Den68] Peter J. Denning. The working set model for program behavior. Commun. ACM, 11(5):323–333, May 1968. [ERV16] Matthias Englert, Heiko Röglin, and Berthold Vöcking. Smoothed analysis of the 2-opt algorithm for the general TSP. ACM Trans. Algorithms, 13(1):10:1–10:15, 2016. [FKL+ 91] Amos Fiat, Richard M. Karp, Michael Luby, Lyle A. McGeoch, Daniel D. Sleator, and Neal E. Young. Competitive paging algorithms. J. Algorithms, 12(4):685–699, December 1991. [KBC+ 17] Tim Kraska, Alex Beutel, Ed H. Chi, Jeff Dean, and Neoklis Polyzotis. The case for learned index structures. 2017. [McG14] Andrew McGregor. Graph stream algorithms: A survey. SIGMOD Rec., 43(1):9–20, May 2014. [MGZ12] Vahab S. Mirrokni, Shayan Oveis Gharan, and Morteza Zadimoghaddam. Simultaneous approximations for adversarial and stochastic online budgeted allocation. In Proceedings of the Twenty-Third Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2012, Kyoto, Japan, January 17-19, 2012, pages 1690–1701, 2012. [MNS12] Mohammad Mahdian, Hamid Nazerzadeh, and Amin Saberi. Online optimization with uncertain information. ACM Trans. Algorithms, 8(1):2:1–2:29, 2012. [MR95] Rajeev Motwani and Prabhakar Raghavan. Randomized Algorithms. Cambridge University Press, New York, NY, USA, 1995. [MR16] Jamie Morgenstern and Tim Roughgarden. Learning simple auctions. In Proceedings of the 29th Conference on Learning Theory, COLT 2016, New York, USA, June 23-26, 2016, pages 1298–1318, 2016. [MV17] Andrés Muñoz Medina and Sergei Vassilvitskii. Revenue optimization with approximate bid predictions. CoRR, abs/1706.04732, 2017. [SHG+ 15] D. Sculley, Gary Holt, Daniel Golovin, Eugene Davydov, Todd Phillips, Dietmar Ebner, Vinay Chaudhary, Michael Young, Jean-Francois Crespo, and Dan Dennison. Hidden technical debt in machine learning systems. In Proceedings of the 28th International Conference on Neural Information Processing Systems, NIPS’15, pages 2503–2511, Cambridge, MA, USA, 2015. MIT Press. [ST85] Daniel D. Sleator and Robert E. Tarjan. Amortized efficiency of list update and paging rules. Commun. ACM, 28(2):202–208, February 1985. [ST04] Daniel A. Spielman and Shang-Hua Teng. Smoothed analysis of algorithms: Why the simplex algorithm usually takes polynomial time. J. ACM, 51(3):385–463, 2004. [SZS+ 14] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations, 2014. 16 A Proofs for Marker Algorithm In this section, we provide the proofs of two crucial lemmas in the classical Marker algorithm analysis. The proofs are due to Fiat et al. [FKL+ 91] and are stated for completeness. Lemma 1 restated: Let L be the number of clean elements. Then the optimal algorithm suffers at least L/2 cache misses. Proof. We denote by `r the number of clean elements at phase r. Let dIr be the number of elements that are in the cache of the optimal solution but not in the cache of the algorithm’s solution at the beginning of phase r and let dFr be the number of elements that are in this set at the end of the phase. Then, the number of cache misses of the optimal solution are at least the difference `r − dIr (as any clean element that was not in the initial complement would cause one cache miss) and also at least dFr (since these many elements did not arise during the phase and the offline algorithm has for sure incurred these many misses). Hence, for each r, we know that:  `r − dIr + dFr #cache misses in opt during phase r ≤ min `r − dIr , dFr ≤ . 2 Telescoping and using that dI0 = 0 (since both start with the same cache elements) concludes the lemma. Lemma 2 restated: Let L be the number of clean elements. Then the expected number of cache misses of the marker algorithm is L · Hk when randomly tie-breaking across unmarked elements. Proof. We again denote by `r the number of clean elements at phase r. The worst-case scenario is that all the clean elements come in the beginning since the algorithm needs to remove more elements without knowing whether it should. After all `r elements have arrived, there are k − `r stale elements that the algorithm unfortunately does not know. The expected number of misses of the algorithm is the expected number of stale elements that are not in the cache when requested. Let’s think of this probability for the i-th such element. Every clean element removes another element. If it is stale and before the position k − i − `r , another element will be removed when its turn comes. So, for the i-th stale element, each clean element corresponds to the removal of one element in the last k − i + 1 slots and this is uniformly at random. Since there are `r of those, the probability that i-th element `r will be the one removed is at most k−i+1 for the i-th time where i ∈ [1, `r − 1]. Summing over all those positions, the number of cache misses of Marker in this phase is at most `r Hk . B Proof of Lemma 3 In this section, we provide the proof of the lemma connecting spread to absolute and squared loss. Before doing so, we provide a useful auxiliary lemma. Lemma 4. For odd T = 2n + 1, one pair (AT , BT ) minimizing either absolute or squared loss subject to the constraints of the spread definition is A2n+1 = (0 . . . 2n) and BT = (n . . . n). Proof. First we show that there exists a BT minimizing the loss with bi = bj for all i, j. Assume otherwise; then there exist two subsequent i, j with b0i > b0j . Since ai < aj + 1 by the assumption on 17 spread, minx∈bi ,bj {`(ai , b) + `(aj , b)} ≤ `(ai , bi ) + `(aj , bj ). Applying this recursively, we conclude that such a BT exists. Second, we show that there exist an AP T that consists of elements ai+1 = ai + 1. Since the elements of BT are all equal to b, the sequence 2n i=0 `(ai , b) is minimized for both absolute and squared loss when ai = b + i − n. Last, the exact value of b does not make a difference and therefore we can set it to be b = n concluding the lemma. √ P Lemma 3 restated: For absolute loss, ` (A, B) = |a −b |, the spread of ` is S (m) ≤ 4m + 1. 1 i i 1 ` 1 i √ P For squared loss, `2 (A, B) = (ai − bi )2 , the spread of `2 is S`2 (m) ≤ 3 14m. Proof. It will be easier to restrict ourselves to odd T = 2n + 1 and also assume that T ≥ 3. This will give an upper bound on the spread (which is tight up to small constant factors). By Lemma 4, a pair of sequence minimizing absolute/squared loss is AT = (0, . . . , 2n) and BT = (n, . . . , n). We now provide bounds on the spread based on this sequence, that is we find a T = 2n + 1 that satisfies the inequality `(AT , BT ) ≤ m. Absolute loss: The absolute loss of the above sequence is: `(AT , BT ) = 2 · n X j =2· j=1 n(n + 1) T −1 T +1 T2 − 1 = n(n + 1) = · = . 2 2 2 4 A T that makes `(AT , BT ) ≥ m is T = √ 4m + 1. Therefore, for absolute loss S` (m) ≤ √ 4m + 1. Squared loss: The squared loss of the above sequence is: `(AT , BT ) = 2 · n X j=1 j2 = 2 · n(n + 1)(2n + 1) (T 2 − 1) · T T3 − T 8T 3 2T 3 = = ≥ = 6 12 12 9 · 12 27 where the inequality holds because T ≥ 3. √ √ A T that makes `(AT , BT ) ≥ m is T = 3 14m. Therefore, for squared loss S` (m) ≤ 3 14m. 18
8cs.DS
Learning Graphical Models Using Multiplicative Weights Adam R. Klivans∗ Raghu Meka† arXiv:1706.06274v1 [cs.LG] 20 Jun 2017 Abstract We give a simple, multiplicative-weight update algorithm for learning undirected graphical models or Markov random fields (MRFs). The approach is new, and for the well-studied case of Ising models or Boltzmann machines, we obtain an algorithm that uses a nearly optimal number of samples and has running time Õ(n2 ) (where n is the dimension), subsuming and improving on all prior work. Additionally, we give the first efficient algorithm for learning Ising models over non-binary alphabets. Our main application is an algorithm for learning the structure of t-wise MRFs with nearlyoptimal sample complexity (up to polynomial losses in necessary terms that depend on the weights) and running time that is nO(t) . In addition, given nO(t) samples, we can also learn the parameters of the model and generate a hypothesis that is close in statistical distance to the true MRF. All prior work runs in time nΩ(d) for graphs of bounded degree d and does not generate a hypothesis close in statistical distance even for t = 3. We observe that our runtime has the correct dependence on n and t assuming the hardness of learning sparse parities with noise. Our algorithm– the Sparsitron– is easy to implement (has only one parameter) and holds in the on-line setting. Its analysis applies a regret bound from Freund and Schapire’s classic Hedge algorithm. It also gives the first solution to the problem of learning sparse Generalized Linear Models (GLMs). ∗ Department of Computer Science, University of Texas at Austin, [email protected]. Part of this work was done while the authors were visiting the Simons Institute for Theoretical Computer Science, Berkeley. † Department of Computer Science, UCLA, [email protected]. Supported by NSF Career Award CCF-1553605. 1 Introduction Undirected graphical models or Markov random fields (MRFs) are one of the most well-studied and influential probabilsitic models with applications to a wide range of scientific disciplines [KF09, Lau98, MRS13, HS86, KFL01, Sal09, Cli90, JEMF06]. Here we focus on binary undirected graphical models which are distributions (Z1 , . . . , Zn ) on {1, −1}n with an associated undirected graph G - known as the dependency graph - on n vertices where each Zi conditioned on the values of (Zj : j adjacent to i in G) is independent of the remaining variables. Developing efficient algorithms for inferring the structure of the underlying graph G from random samples from D is a central problem in machine learning, statistics, physics, and computer science [AKN06, KS01, WRL06, BMS13, NBSS12, TR14] and has attracted considerable attention from researchers in these fields. A famous early example of such an algorithmic result is due to Chow and Liu from 1968 [CL68] who gave an efficient algorithm for learning graphical models where the underlying graph is a tree. Subsequent work considered generalizations of trees [ATHW11] and graphs under various strong assumptions (e.g., restricted strong convexity [NRWY10] or correlation decay [BMS13, RSS12]). The current frontier of MRF learning has focused on the Ising model (also known as Boltzmann machines) on bounded-degree graphs, a special class of graphical models with only pairwise interactions and each vertex having degree at most d in the underlying dependency graph. We refer to [Bre15] for an extensive historical overview of the problem. Two important works of note are due to Bresler [Bre15] and [VMLC16] who learn Ising models on bounded degree graphs. Bresler’s algorithm is a combinatorial (greedy) approach that runs in time Õ(n2 ) but requires doubly exponential in d many samples from the distribution (only singly exponential is necessary). [VMLC16] use machinery from convex programming to achieve nearly optimal sample complexity for learning Ising models with zero external field and with running time Õ(n4 ). Neither of these results are proved to hold over non-binary alphabets or for general MRFs. 1.1 Our Results The main contribution of this paper is a simple, multiplicative-weight update algorithm for learning MRFs. Using our algorithm we obtain the following new results: • An efficient online algorithm for learning Ising models on arbitrary graphs with nearly optimal sample complexity and running time Õ(n2 ) per example (precise statements can be found in Section 5). In particular, for bounded degree graphs we achieve a run-time of Õ(n2 ) with nearly optimal sample complexity. This subsumes and improves all prior work including the above mentioned results of Bresler [Bre15] and [VMLC16]. Our algorithm is the first that works even for unbounded-degree graphs as long as the `1 norm of the weight vector of each neighborhood is bounded, a condition necessary for efficiency (see discussion following Corollary 5.4). • An algorithm for learning the dependency graph of binary t-wise Markov random fields with nearly optimal sample complexity and run-time nO(t) (precise statements can be found in Section 7). Moreover, given access to roughly nO(t) samples (suppressing necessary terms depending on the weights), we can also reconstruct the parameters of the model and output a t-wise MRF that gives a point-wise approximation to the original distribution. 1 As far as we are aware, these are the first efficient algorithms for learning higher-order MRFs. All previous work on learning general t-wise MRFs runs in time nΩ(d) (where d is the underlying degree of the graph) and does not output a function f that can generate an approximation to the distribution in statistical distance, even for the special case of t = 3. We give evidence that the nO(t) dependence in our running time is nearly optimal by applying a simple reduction from the problem of learning sparse parities with noise on t variables to learning t-wise MRFs due to Bresler, Gamarnik, and Shah [BGS14] (learning sparse parities with noise is a notoriously difficult challenge in theoretical computer science). Bresler [Bre15] observed that even for the simplest possible Ising model where the graph has a single edge, beating O(n2 ) run-time corresponds to fast algorithms for the well-studied light bulb problem [Val88], for which the best known algorithm runs in time O(n1.62 ) [Val15]. Moreover, our algorithm is easy to implement, has only one tunable parameter, and works in an on-line fashion. The algorithm– the Sparsitron– solves the problem of learning a sparse Generalized Linear Model. That is, given examples (X, Y ) ∈ [−1, 1]n × [0, 1] drawn from a distribution D with the property that E[Y |X = x] = σ(w · x) for some monotonic, Lipschitz σ and unknown w with kwk1 ≤ λ, the Sparsitron efficiently outputs a w0 such that σ(w0 ·x) is close to σ(w·x) in squared-loss and has sample complexity O(λ2 log n). In an independent and concurrent work, Hamilton, Koehler, and Moitra [HKM17] generalized Bresler’s approach to hold for both higher-order MRFs as well as MRFs over general (non-binary) alphabets. For learning binary MRFs on bounded-degree—degree at most d—graphs, under the same non-degeneracy assumption taken by Hamilton et al.,1 we obtain sample complexity that is singly exponential in dt , whereas theirs is doubly exponential in dt (both of our papers obtain sample complexity that depends only logarithmically on n, the number of vertices). 1.2 Our Approach For a graph G = (V, E) on n vertices, let Ct (G) denote all cliques of size at most t in G. We use the Hammersley-Clifford characterization of Markov random fields and define a binary t-wise Markov random field on G to be a distribution D on {1, −1}n where   X Pr [Z = z] ∝ exp  ψI (z) , Z∼D I∈Ct (G) and each ψI : Rn → R is a function that depends only on the variables in I. For ease of exposition, we will continue with the case of t = 2, the Ising model, and subsequently describe the extension to larger values of t. Let σ(z) denote the sigmoid function. That is σ(z) = 1/1 + e−z . Since t = 2, we have   X X Pr [Z = z] ∝ exp  Aij zi zj + θi zi  i6=j∈[n] i for a weight matrix A ∈ Rn×n and θ ∈ Rn ; here, a weight Aij 6= 0 if and only if {i, j} is an edge in the underlying dependency graph. For a node Zi , it is easy to see that the probability 1 A previous version of this manuscript needed a slightly stronger non-degeneracy assumption. 2 Zi = −1 conditioned on any setting of the remaining nodes to some value x ∈ {−1, 1}[n]\{i} is equal to σ(w · x + θ) where w ∈ R[n]\{i} , wj = −2Aij , θ = −θi . As such, if we set X ≡ (Zj : j 6= i) and Y = (1 − Zi )/2, then the conditional expectation of Y given X is equal to a sigmoid with an unknown weight vector w and threshold θi . We can now rephrase our original unsupervised learning task as the following supervised learning problem: Given random examples (X, Y ) with conditional mean function E[Y |X = x] = σ(w · x + θ), recover w and θ. Learning a conditional mean function of the form u(w · x) with a fixed, known transfer function u : R → R is precisely the problem of learning a Generalized Linear Model or GLM and has been studied extensively in machine learning. The first provably efficient algorithm for learning GLMs where u is both monotone and Lipschitz was given by Kalai and Sastry [KS09], who called their algorithm the “Isotron”. Their result was simplified, improved, and extended by Kakade, Kalai, Kanade, and Shamir [KKKS11] who introduced the “GLMtron” algorithm. Notice that σ(z) is both monotone and 1-Lipschitz. Therefore, directly applying the GLMtron in our setting will result in a w0 and θ0 such that E[(σ(w0 · x + θ0 ) − σ(w · x + θ))2 ] ≤ ε. (1.1) Unfortunately, the sample complexity of the GLMtron depends on kwk2 , which results in suboptimal bounds on sample complexity for our setting2 . We desire sample complexity dependent on kwk1 , essentially the sparsity of w. In addition, we need an exact recovery algorithm. That is, we need to ensure that w0 itself is close to w and not just that the `2 -error as in Equation 1.1 is small. We address these two challenges next. Our algorithm, the Sparsitron, uses a multiplicative-weight update rule for learning w, as opposed to the GLMtron or Isotron, both of which use additive update rules. This enables us to achieve essentially optimal sample complexity. The Sparsitron is simple to describe (see Algorithm 2) and depends on only one parameter λ, the upper bound on the `1 -norm. Its analysis only uses a regret bound from the classic Hedge algorithm due to Freund and Schapire [FS97]. Although the Sparsitron algorithm finds a vector w0 ∈ Rn such that EX [(σ(w0 · X + θ0 ) − σ(w · X + θ))2 ] is small, we still must prove that w0 is actually close to w. Achieving such strong recovery guarantees for arbitrary distributions is typically a much harder problem (and can be provably hard in some cases for related problems [FGKP09, GR09]). In our case, we exploit the nature of MRFs by a clean property of such distributions: Call a distribution D on {1, −1}n δ-unbiased if each variable Zi is 1 or −1 with probability at least δ conditioned on any setting of the other variables. It turns out that under conditions that are necessary for reconstruction, the distributions of MRFs are δ-unbiased for a non-negligible δ. We show that for such δ-unbiased distributions achieving reasonably small `2 -error as in Equation 1.1 implies that the recovered coefficient w0 is in fact close to w. To obtain our results for learning t-wise Markov random fields, we generalize the above approach to handle functions of the form σ(p(x)) where p is a degree t multilinear polynomial. Sparsitron can be straightforwardly extended to handle low-degree polynomials by linearizing such polynomials (i.e., working in the (nt )-dimensional space of coefficients). We then have to show that achieving small `2 -error - EX [(σ(p(X)) − σ(q(X)))2 ]  1 - implies that the polynomials p, q are close. This 2 GLMtron in our setting would require Ω(n) samples; we are aiming for an information-theoretically optimal logarithmic dependence in the dimension n. 3 presents several additional technical challenges; still, in a self-contained proof, we show this holds whenever the underlying distribution is δ-unbiased as is the case for MRFs. 1.3 Best-Experts Interpretation of Our Algorithm Our algorithm can be viewed as a surprisingly simple weighted voting scheme (a.k.a. “Best-Experts” strategy) to uncover the underlying graph structure G = ({v1 , . . . , vn }, E) of a Markov random field. Consider an Ising model where for a fixed vertex vi , we want to determine vi ’s neighborhood and edge weights. Let Z = (Z1 , . . . , Zn ) denote random draws from the Ising model. • Initially, all vertices vj (j 6= i) could be neighbors. We create a vector of “candidate” neighbors of length 2n − 2 with entries (j, +) and (j, −) for all j 6= i. Intuitively, since we do not know if node vj will be negatively or positively correlated with vi , we include two candidate neighbors, (j, +), (j, −) to cover the two cases. • At the outset, every candidate is equally likely to be a neighbor of vi and so receives an initial weight of 1/(2n − 2). Now consider a random draw from the Ising model Z = (Z1 , . . . , Zn ). For each j 6= i we view each Zj (and its negation -Zj ) as the vote of (j, +) for the value Zi (respectively of (j, −)). The overall prediction p of our candidates is equal to a weighted sum of their votes (we always assume the weights are non-negative and normalized appropriately). • For a candidate neighbor vj , let the penalty of the prediction p (as motivated by the conditional mean function) be equal to `j = (σ(−2p)−(1−Zi )/2)Zj . Each candidate vj ’s weight is simply multiplied by β `j (for some suitably chosen learning rate β 3 ). It is easy to see that candidates who predict Zi correctly will be penalized less than neighbors whose predictions are incorrect. Remarkably, the weights of this algorithm will converge to the weights of the underlying Ising model, and the rate of this convergence is optimal. Weights of vertices that are not neighbors of vi will rapidly decay to zero. For clarity, we present the updates for a single iteration of our Sparsitron algorithm applied to Ising model in Algorithm 1. The iterative nature of the algorithm is reminiscent of algorithms such as belief propagation and stochastic gradient descent that are commonly used in practice. Exploring connections with these algorithms (if any) is an intriguing question. 1.4 Organization We begin by describing the Sparsitron algorithm for learning sparse generalized models and prove its correctness. We then show, given a hypothesis output by the Sparsitron, how to recover the underlying weight vector exactly under δ-unbiased distributions. For ease of exposition, we begin by assuming that we are learning an Ising model. We then describe how to handle the more general case of learning t-wise MRFs. This requires working with multilinear polynomials, and studying their behavior (especially, how small they can be) under δ-unbiased distributions. 3 For our analysis, the learning rate can be set using standard techniques, e.g., β = 1 − T examples. 4 p log n/T when processing Algorithm 1 Updates for Sparsitron applied to learning Ising models Initialize Wij+ = Wij− = 1/2(n − 1) and Âij = 0 for i 6= j. Parameters: Sparsity bound λ. 1: for each new example (Z1 , . . . , Zn ) do: P 2: Compute the current predictions: pi = j6=i Âij Zj for all i. 3: for each i 6= j do 4: Compute the penalties: Set `ij = (σ(−2pi ) − (1 − Zi )/2) · Zj . 5: Update the weights: Set Wij+ = Wij+ · β `ij ; Wij− = Wij− · β −`ij . 6: 7: 2 for each i 6= j do Compute edge weights: Âij = P λ + − `6=i (Wi` +Wi` )   · Wij+ − Wij− . Preliminaries We will use the following notations and conventions. • For a vector x ∈ Rn , x−i ∈ R[n]\{i} denotes (xj : j 6= i). P Q • We write multilinear polynomials p : RnQ→ R as p(x) = I p̂(I) i∈I xi ; in particular, p̂(I) P denotes the coefficient of the monomial i∈I xi in the polynomial. Let kpk1 = I |p̂(I)|. Q P • For a multilinear polynomial p : Rn → R, we let ∂i p(x) = J:J63i p̂(J ∪{i}) j∈J Pxj denote the partial Q derivative of p with respect to xi . Similarly, for I ⊆ [n], let ∂I p(x) = J:J∩I=∅ pb(J ∪ I) j∈J xj denote the partial derivative of p with respect to the variables (xi : i ∈ I). • For a multilinear polynomial p : Rn → R, we say I ⊆ [n] is a maximal monomial of p if p̂(J) = 0 for all J ⊃ I (i.e., there is no non-zero monomial that strictly contains I). 3 Learning Sparse Generalized Linear Models We first describe our Sparsitron algorithm for learning sparse GLMs. In the next section we show how to learn MRFs using this algorithm. The main theorem of this section is the following: Theorem 3.1. Let D be a distribution on [−1, 1]n × {0, 1} where for (X, Y ) ∼ D, E[Y |X = x] = u(w · x) for a non-decreasing 1-Lipschitz function u : R → [0, 1]. Suppose that kwk1 ≤ λ for a known λ ≥ 0. Then, there exists an algorithm that for all ε, δ ∈ [0, 1] given T = O(λ2 (ln(n/δε))/ε2 ) independent examples from D, produces a vector v ∈ Rn such that with probability at least 1 − δ, E [(u(v · X) − u(w · X))2 ] ≤ ε. (3.1) (X,Y )←D The run-time of the algorithm is O(nT ). Moreover, the algorithm can be run in an online manner. Proof. We assume without loss of generality that wi ≥ 0 for all i and that kwk1 = λ; if not, we can map examples (x, y) to ((x, −x, 0), y) and work in the new space. For any vector v ∈ Rn , define the risk of v ε(v) = E(X,Y )∼D [(u(v · X) − u(w · X))2 ]. Let 1 denote the all 1’s vector. 5 Our approach is to use the regret bound for the Hedge algorithm of Freund and Schapire [FS97]. Let T ≥ 1, β ∈ [0, 1] be parameters to be chosen later and M = C 000 T ln(1/δ)/ε2 for a constant C 000 to be chosen later. The algorithm is shown in Algorithm 2. The inputs to the algorithm are T + M independent examples (x1 , y 1 , ), . . . , (xT , y T ) and (a1 , b1 ), . . . , (aM , bM ) drawn from D. Algorithm 2 Sparsitron 1: Initialize w 0 = 1/n. 2: for t = 1, . . . , T do 3: Let pt = wt−1 /kwt−1 k1 . 4: Define `t ∈ Rn by `t = (1/2)(1 + (u(λpt · xt ) − y t )xt ). t 5: Update the weight vectors wt : for each i ∈ [n], set wit = wit−1 · β `i . for t = 1, . . . , T do 7: Compute the empirical risk 6: ε̂(λpt ) = (1/M ) M X u(λpt · aj ) − bj 2 . j=1 8: Return v = λpj for j = arg mint∈[T ] ε̂(λpt ). We add the 1 in Step 4 of Algorithm 2 to be consistent with [FS97] who work with loss vectors in [0, 1]n . We next analyze our algorithm and show that for suitable parameters β, T, M , it achieves the guarantees of the theorem. We first show that the sum of the risks ε(λp1 ), . . . , ε(λpT ) is small with high probability over the examples; the claim then follows by a simple Chernoff bound to argue that for M sufficiently big, the empirical estimates of the risk, ε̂(λp1 ), . . . , ε̂(λpT ) are close to the true risks. Observe that `t ∈ [0, 1]n and associate each i = 1, . . . , n with an expert and then apply the analysis of Freund and Schapire (c.f. [FS97], Theorem 5). In particular, setting β = 1/(1 + p (ln n)/T ), we get that T X pt ·`t ≤ min i∈[n] t=1 Let random variable Qt = pt ·`t T X √ `ti + O( T ln n + (ln n)). (3.2) t=1 − (w/λ)·`t . Note that Qt ∈ [−1, 1]. Let Z t = Qt − E [Qt | (x1 , y 1 ), . . . , (xt−1 , y t−1 )]. (xt ,y t ) Then, Z 1 , . . . , Z T form a martingale difference sequence with respect to the sequence (x1 , y 1 ), . . . , (xT , y T ) and are bounded between [−2, 2]. Therefore, by Azuma-Hoeffding inequality for bounded martinp PT t ≤ O( T ln(1/δ)). gale difference sequences, with probability at least 1 − δ, we have t=1 Z Thus, with probability at least 1 − δ, T X t=1 E [Qt | (x1 , y 1 ), . . . , (xt−1 , y t−1 )] ≤ (xt ,y t ) T X t=1 6 Qt + O( p T ln(1/δ)). (3.3) Now, for a fixed (x1 , y 1 ), . . . , (xt−1 , y t−1 ), taking expectation with respect to (xt , y t ), we have   E [Qt | (x1 , y 1 ), . . . , (xt−1 , y t−1 )] = E (pt − (1/λ)w)·`t (xt ,y t ) (xt ,y t )   = (1/2) E (pt − (1/λ)w)·(u(λpt ·xt ) − y t )xt (xt ,y t )   = (1/2λ) E (λpt ·xt − w·xt )(u(λpt ·xt ) − u(w·xt )) xt   ≥ (1/2λ) E (u(λpt ·xt ) − u(w·xt ))2 xt (for all a, b ∈ R, (a − b)(u(a) − u(b)) ≥ (u(a) − u(b))2 ). = (1/2λ) · ε(λpt ). Therefore, for a fixed (x1 , y 1 ), . . . , (xt−1 , y t−1 ), we have (1/2λ)ε(λpt ) ≤ E [Qt | (x1 , y 1 ), . . . , (xt−1 , y t−1 )]. (xt ,y t ) Combining the above with Equations 3.2, 3.3, we get that with probability at least 1 − δ, (1/2λ) T X ε(λpt ) ≤ T X t=1 p Qt + O( T ln(1/δ)) t=1 ≤ min i∈[n] Now, let L = PT t t=1 ` . T X `ti − t=1 T X p √ (w/λ)·`t + O( T ln n + (ln n)) + O( T ln(1/δ)). t=1 Then, min i∈[n] T X t=1 `ti − T X (1/λ)w · `t = min Li − (w/λ) · L ≤ 0, i∈[n] t=1 where the last inequality follows as kwk1 = λ. Therefore, with probability at least 1 − δ, (1/2λ) T X p √ ε(λpt ) = O( T ln(1/δ)) + O( T ln n + (ln n)). t=1 In particular, for T > 1 − δ, C 00 λ2 (ln(n/δ))/ε2 for a sufficiently big constant C 00 , with probability at least p √ T ln(1/δ) + T ln n + ln n min ε(λp ) ≤ O(λ) · ≤ ε/2. T t∈[T ] t Now set M = C 000 ln(T /δ)/ε2 so that by a Chernoff-Hoeffding bound as in Fact 3.2, with probability at least 1 − δ, for every t ∈ [T ], ε(λpt ) − ε̂(λpt ) ≤ ε/4. Therefore, with probability at least 1 − 2δ, ε(v) ≤ ε/4 + ε̂(v) ≤ ε. Note that the number of samples needed is T + M = O(λ2 ln(n/εδ)/ε2 ). The theorem follows. Fact 3.2. There exists a constant C > 0 such that the following holds. Let v ∈ Rn and let (a1 , b1 ), . . . , (aM , bM ) be independent examples from D. Then, for all ρ, γ ≥ 0, and M ≥ C ln(1/ρ)/γ 2 ,     M X Pr  (1/M )  (u(v · aj ) − bj )2  − ε(v) ≥ γ  ≤ ρ. j=1 7 4 Recovering affine functions from `2 minimization In this section we show that running the Sparsitron algorithm with sufficiently low error parameter ε will result in an `∞ approximation to the unknown weight vector. We will use this strong approximation to reconstruct the dependency graphs of Ising models as well as the edge weights. Our analysis relies on the following important definition: Definition 4.1. A distribution D on {1, −1}n is δ-unbiased if for X ∼ D, i ∈ [n], and any partial assignment x to (Xj : j 6= i), min(Pr[Xi = 1|X−i = x], Pr[Xi = −1|X−i = x]) ≥ δ. We will use the following elementary property of sigmoid. Claim 4.2. For a, b ∈ R, |σ(a) − σ(b)| ≥ e−|a|−3 · min (1, |a − b|) . Proof. Fix a ∈ R and let γ = min(1, |a − b|). Then, since σ is monotonic |σ(a) − σ(b)| ≥ min(σ(a + γ) − σ(a), σ(a) − σ(a − γ)). Now, it is easy to check by a case-analysis that for all a, a0 ∈ R, |σ(a) − σ(a0 )| ≥ min(σ 0 (a), σ 0 (a0 )) · |a − a0 |. Further, for any t, σ 0 (t) = 1/(2 + et + e−t ) ≥ e−|t| /4. Combining the above two, we get that σ(a + γ) − σ(a) ≥ (1/4) min(e−|a+γ| , e−|a| ) · γ ≥ (1/4)e(−|a|−γ) γ. Similarly, we get σ(a) − σ(a − γ) ≥ 4 min(e−|a−γ| , e−|a| ) · γ ≥ (1/4)e(−|a|−γ) γ. The claim now follows by substituting γ = min(1, |a − b|) (and noting that 1/4 ≥ e−2 ). Lemma 4.3. Let D be a δ-unbiased distribution on {1, −1}n . Suppose that for two vectors v, w ∈ Rn and α, β ∈ R, EX∼D [(σ(w · X + α) − σ(v · X + β))2 ] ≤ ε where ε < δ · exp(−2kwk1 − 2|α| − 6). Then, p kv − wk∞ ≤ O(1) · ekwk1 +|α| · ε/δ. Proof. For brevity, let p(x) = w · x + α, and q(x) = v · x + β. Fix an index i ∈ [n] and let X ∼ D. Now, for any x ∈ {1, −1}n , by Claim 4.2, |σ(p(x)) − σ(q(x))| ≥ e−kwk1 −|α|−3 · min (1, |p(x) − q(x)|) . Let xi,+ ∈ {1, −1}n (respectively xi,− ) denote the vector obtained from x by setting xi = 1 (respectively xi = −1). Note that p(xi,+ ) − p(xi,− ) = 2wi and q(xi,+ ) − q(xi,− ) = 2vi . Therefore, p(xi,+ ) − q(xi,+ ) − (p(xi,− ) − q(xi,− )) = 2(wi − vi ). 8 Thus, max p(xi,+ ) − q(xi,+ ) , p(xi,− ) − q(xi,− )  ≥ |wi − vi | . Therefore, for any fixing of X−i , as X is δ-unbiased, Pr [|p(X) − q(X)| ≥ |wi − vi |] ≥ δ. Xi |X−i Hence, combining the above inequalities,     ε ≥ E (σ(p(X)) − σ(q(X)))2 ≥ e−2kwk1 −2|α|−6 · δ · min 1, |wi − vi |2 . X As ε < e−2kwk1 −2|α|−6 δ, the above inequality can only hold if |wi − vi | < 1 so that p |wi − vi | < ekwk1 +|α|+3 · ε/δ. The claim now follows. 5 Learning Ising Models Definition 5.1. Let A ∈ Rn×n be a weight matrix and θ ∈ Rn be a mean-field vector. The associated n-variable Ising model is a distribution D(A, θ) on {1, −1}n given by the condition   X X Pr [Z = z] ∝ exp  Aij zi zj + θ i zi  . Z←D(A,θ) i i6=j∈[n] The dependency graphPof D(A, θ) is the graph G formed by all pairs {i, j} with |Aij | 6= 0. We define λ(A, θ) = maxi ( j |Aij | + |θi |) to be the width of the model. We give a simple, sample-efficient, and online algorithm for recovering the parameters of an Ising model. Theorem 5.2. Let D(A, θ) be an n-variable Ising model with width λ(A, θ) ≤ λ. There exists an algorithm that given λ, ε, ρ ∈ (0, 1), and N = O(λ2 exp(O(λ))/ε4 )·(log(n/ρε)) independent samples Z 1 , . . . , Z N ← D(A, θ) produces  such that with probability at least 1 − ρ, kA − Âk∞ ≤ ε. The run-time of the algorithm is O(n2 N ). Moreover, the algorithm can be run in an online manner. Proof. The starting point for our algorithm is the following observation. Let Z ← D(A, θ). Then, for any i ∈ [n] and any x ∈ {1, −1}[n]\{i} , Pr[Zi = −1|Z−i = x] = 1 1 + exp(2 P j6=i Aij xj + θi ) = σ(w(i) · x + θi ), (5.1) where we define w(i) ∈ R[n]\{i} with w(i)j = −2Aij for j 6= i. This allows us to use our Sparsitron algorithm for learning GLMs. 9 For simplicity, we describe our algorithm to infer the coefficients Anj for j = 6 n; it extends straightforwardly to recover the weights {Aij : j 6= i} for each i. Let Z ← D(A, θ) and let X ≡ (Z1 , . . . , Zn−1 , 1), and Y = (1 − Zn )/2. Then, from the above we have that E[Y |X] = σ(w(n) · X), where w(n) ∈ Rn with w(n)j = −2Anj for j < n, and w(n)n = θi . Note that kw(n)k1 ≤ 2λ. Further, σ is a monotone 1-Lipschitz function. Let γ ∈ (0, 1) be a parameter to be chosen later. We now apply the Sparsitron algorithm to compute a vector v(n) ∈ Rn so that with probability at least 1 − ρ/n2 , E[(σ(w(n) · X) − σ(v(n) · X))2 ] ≤ γ. (5.2) We set Ânj = −(v(n)j )/2 for j < n. We next argue that Equation 5.2 in fact implies kw(n) − v(n)k∞  1. To this end, we will use the following easy fact (see e.g. Bresler [Bre15]): Fact 5.3. For Z ← D(A, θ), i ∈ [n], and any partial assignment x to Z−i , min (Pr[Zi = −1|Z−i = x], Pr[Zi = 1|Z−i = x]) ≥ (1/2)e−2λ(A,θ) ≥ (1/2)e−2λ . P −2λ That is, the distribution P Z is δ-unbiased for δ = (1/2)e . Note that w(n)·X = j<n w(n)j Zj + w(n)n and v(n) · X = j<n v(n)j Zj + v(n)n . Therefore, as (Z1 , . . . , Zn−1 ) is δ-unbiased, by Lemma 4.3 and Equation 5.2, we get max |v(n)j − w(n)j | ≤ O(1) exp(2λ) · j<n p γ/δ, if γ ≤ cδ · exp(−4λ) ≤ c exp(−5λ) for a sufficiently small c. Thus, if we set γ = c0 exp(−5λ)ε2 for a sufficiently small constant c0 , then we get max |Anj − Ânj | = (1/2)kv(n) − w(n)k∞ ≤ ε. j<n By a similar argument for i = 1, . . . , n − 1 and taking a union bound, we get estimates Âij for all i 6= j so that with probability at least 1 − ρ, max |Aij − Âij | ≤ ε. i6=j Note that by Theorem 3.1, the number of samples needed to satisfy Equation 5.2 is O((λ/γ)2 · (log(n/ργ))) = O(λ2 exp(10λ)/ε4 ) · (log(n/ρε)). This proves the theorem. The above theorem immediately implies an algorithm for recovering the dependency graph of an Ising model with nearly optimal sample complexity. Corollary 5.4. Let D(A, θ) be an n-variable Ising model with width λ(A, θ) ≤ λ and each non-zero entry of A at least η > 0 in absolute value. There exists an algorithm that given λ, η, ρ ∈ (0, 1), and N = O(exp(O(λ))/η 4 ) · (log(n/ρη)) independent samples Z 1 , . . . , Z N ← D(A, θ) recovers the underlying dependency graph of D(A, θ) with probability at least 1−ρ. The run-time of the algorithm is O(n2 N ). Moreover, the algorithm can be run in an online manner. 10 Proof. The claim follows immediately from Theorem 5.2 by setting ε = η/2 to compute  and taking the edges E to be {{i, j} : |Âij | ≥ η/2}. It is instructive to compare the upper bounds from Corollary 5.4 with known unconditional lower bounds on the sample complexity of learning Ising models with n vertices due to Santhanam and Wainwright [SW12]. They prove that, even if the weights of the underlying graph are known, λ/4 n any algorithm for learning the graph structure must use Ω( 2 η·2·log ) samples. Hence, the sample 3η complexity of our algorithm is near the best-known information-theoretic lower bound. 6 Recovering polynomials from `2 minimization In order to obtain results for learning general Markov Random Fields, we need to extend our learning results from previous sections to the case of sigmoids of low-degree polynomials. In this section, we prove that for any polynomial p : Rn → R, minimizing the `2 -loss with respect to a sigmoid under a δ-unbiased distribution D also implies closeness as a polynomial. That is, for two polynomials p, q : Rn → R if EX∼D [(σ(p(X)) − σ(q(X)))2 ] is sufficiently small, then kp − qk1  1 (Lemma 6.4) and that the coefficients of maximal monomials of p can be inferred from q (Lemma 6.2). These results will allow us to recover the structure and parameters of MRFs when combined with Sparsitron. The exact statements and arguments here are similar in spirit to Lemma 4.3 and its proof but are more subtle. To start with, we need the following property of δ-unbiased distributions which says that low-degree polynomials are not too small with non-trivial probability (aka anti-concentration) under δ-unbiased distributions. Lemma 6.1. There is a constant c > 0 such that the following holds. Let D be a δ-unbiased distribution on {1, −1}n . Then, for any multilinear polynomial s : Rn → R, and any maximal monomial I 6= ∅ ⊆ [n] in s, Pr [|s(X)| ≥ |b s(I)|] ≥ δ |I| . X∼D Proof. We prove the claim by induction on |I|. For an i ∈ [n], let xi,+ ∈ {1, −1}n (respectively xi,− ) denote the vector obtained from x by setting xi = 1 (respectively xi = −1). Note that xi,+ , xi,− only depend on x−i . Let X ∼ D. Suppose I = {i} so that s(x) = sb({i})xi + s0 (x−i ) for some polynomial s0 that only depends on x−i . Note that max(|s(xi,+ )|, |s(xi,− )|) ≥ |b s({i})|. Therefore, for any fixing of X−i , as X is δ-unbiased, Pr [|s(X)| ≥ |b s({i})|] ≥ δ. Xi |X−i Now, suppose |I| = ` ≥ 2 and that the claim is true for all polynomials and all monomials of size at most ` − 1. Let i ∈ I. Then, s(x) = xi · ∂i (s(x−i )) + s0 (x−i ) for some polynomial s0 that only depends on x−i . Thus, max(|s(xi,+ )|, |s(xi,− )|) ≥ |∂i s(x−i )|. Therefore, for any fixing of X−i , as X is δ-unbiased, Pr [|s(X)| ≥ |∂i s(X−i )|] ≥ δ. Xi |X−i Now, let J = I \ {i} and observe that J is a maximal monomial in r(x−i ) ≡ ∂i s(x−i ) with rb(J) = sb(I). Therefore, by the induction hypothesis, Pr [|∂i s(X−i )| ≥ |b s(I)|] ≥ δ `−1 . X−i 11 Combining the last two inequalities, we get that Pr[|s(X)| ≥ sb(I)] ≥ δ ` . The claim now follows by induction. The next lemma shows that for unbiased distributions D, and two low-degree polynomials p, q : Rn → R, if EX∼D [(σ(p(x)) − σ(q(x))2 ] is small, then one can infer the coefficients of the maximal monomials of p from q 4 . Lemma 6.2. Let D be a δ-unbiased distribution on {1, −1}n . Let p, q be two multilinear polynomials p, q : Rn → R such that EX∼D [(σ(p(x)) − σ(q(x))2 ] ≤ ε. Then, for every maximal monomial I ⊆ [n] of p, and any ρ > 0, e2kpk1 +6 ε Pr [|b p(I) − ∂I q(X)| > ρ] ≤ . X∼D ρ2 δ |I| Proof. Let X ∼ D and fix a maximal monomial I ⊆ [n] in p. Now, for any x ∈ {1, −1}n , by Claim 4.2, |σ(p(x)) − σ(q(x))| ≥ e−kpk1 −3 · min (1, |p(x) − q(x)|) . Therefore, h  i E min 1, |p(X) − q(X)|2 ≤ e2kpk1 +6 ε. Hence, for every ρ ∈ (0, 1), Pr [|p(X) − q(X)| > ρ] ≤ e2kpk1 +6 ε/ρ2 . X Now consider a fixing of all variables not in I to z ∈ {1, −1}[n]\I and let rz (xI ) be the polynomial obtained by the resulting fixing. Now, X Pr [|p(X) − q(X)| > ρ] = Pr[X[n]\I = z] · Pr[|rz (XI )| > ρ | X[n]\I = z]. X z∈{1,−1}[n]\I Further, rb(I) = pb(I) − ∂I q(z) as I is maximal in p. Conditioned on the event that |b r(I)| > ρ, for a random choice of X[n]\I , we have from Lemma 6.1 |I| that PrXI [|rz (XI )| > ρ] ≥ δ . Thus we have Pr [|p(X) − q(X)| > ρ] ≥ δ |I| · Pr X X[n]\I   pb(I) − ∂I q(X[n]\I ) > ρ . Combining the above equations we get that Pr [|b p(I) − ∂I q(X)| > ρ] ≤ X e2kpk1 +6 ε . ρ2 δ |I| The next claim shows that under the assumptions of Lemma 6.2, the highest degree monomials of p, q are close to each other. 4 Note that under the hypothesis of the lemma, the coefficients of p and q can nevertheless be far. 12 Lemma 6.3. Let D be a δ-unbiased distribution on {1, −1}n . Let p, q be two multilinear polynomials p, q : Rn → R such that EX∼D [(σ(p(x)) − σ(q(x))2 ] ≤ ε where ε < e−2kpk1 −6 δ |I| . Then, for every maximal monomial I ⊆ [n] of (p − q), q |b p(I) − qb(I)| ≤ ekpk1 +3 · ε/δ |I| . Proof. Fix a maximal monomial I ⊆ [n] in (p − q). Now, for any X, by Claim 4.2, |σ(p(X)) − σ(q(X))| ≥ e−kpk1 −3 · min (1, |p(X) − q(X)|) . On the other hand, as X is δ-unbiased, by Lemma 6.1, with probability at least δ |I| , |p(X) − q(X)| ≥ |b p(I) − qb(I)|. Therefore, h i   ε ≥ E (σ(p(X)) − σ(q(X)))2 ≥ e−2kpk1 −6 · δ |I| · min 1, |b p(I) − qb(I)|2 . X As ε < e−2kpk1 −6 δ |I| , the above inequality can only hold if |b p(I) − qb(I)| < 1 so that q |b p(I) − qb(I)| < ekpk1 +3 ε/δ |I| . The claim follows. We next show that if EX∼D [(σ(p(x)) − σ(q(x))2 ]  n−t is sufficiently small, then kp − qk1  1. Lemma 6.4. Let D be a δ-unbiased distribution on {1, −1}n . Let p, q be two multilinear polynomials p, q : Rn → R of degree t such that EX∼D [(σ(p(x)) − σ(q(x))2 ] ≤ ε where ε < e−2kpk1 −6 δ t . Then,   p n t kpk1 t kp − qk1 = O(1) · (2t) e · ε/δ · . t Proof. For a polynomial s : Rn → R of degree at most t, and ` ≤ t, let s≤` denote the polynomial obtained from s by only taking monomials of degree at most ` and let s=` denote the polynomial obtained from s by only taking monomials of degree exactly `. For brevity, let r = p − q, and for ` ≤ t, let ρ` = kr=` k1 = kp=` − q=` k1 . We will inductively bound ρt , ρt−1 , . . . , ρ1 . From Lemma 6.3 applied to the polynomials p, q, we immediately get that   p n kpk1 +3 t ρt = kr=t k1 ≤ e · ε/δ · ≡ ε0 . (6.1) t Now consider I ⊆ [n] with |I| = `. Then, by an averaging argument, there is some fixing of the variables not in XI so that for the polynomials pI , qI obtained by this fixing, and for the resulting distribution DI on {1, −1}I , E [(σ(pI (Y )) − σ(qI (Y )))2 ] ≤ ε. Y ∼DI Note that DI is also δ-unbiased. Therefore, by Lemma 6.3 applied to the polynomials p, q, letting rI = pI − qI , we get that q |b rI (I)| = |pbI (I) − qbI (I)| ≤ ekpk1 +3 · ε/δ |I| . 13 We next relate the coefficients of rI to that of r. As the polynomial rI is obtained from r by fixing the variables not in I to some values in {1, −1}, X |b rI (I)| ≥ |b r(I)| − |b r(J)| . J:J⊃I Combining the above two inequalities, we get that q X kpk1 +3 |b r(J)| . |b r(I)| ≤ e · ε/δ ` + J⊃I Summing the above equation over all I of size exactly `, we get !   q X X X n |b r(I)| ≤ ekpk1 +3 · ε/δ ` · kr=` k1 = + |b r(J)| ` I:|I|=` I:|I|=` J⊃I ! X X |b r(J)| ≤ ε0 + J⊃I I:|I|=`       t t X X X j j = ε0 + · |b r(J)| = ε0 + kr=j k1 . ` ` j=`+1 j=`+1 J:|J|=j Therefore, we get the recurrence,   t X j ρj . ρ` ≤ ε0 + ` (6.2) j=`+1 We can solve the above recurrence by induction on `. Specifically, we claim that the above implies ρj ≤ (2t)t−j · ε0 . For j = t, the claim follows  from Equation 6.1. Now, suppose the inequality holds for all j > `. Then, by Equation 6.2, as j` ≤ j j−` , ρ` ≤ ε0 + t X j j−` t−j (2t) ε0 ≤ ε0 + j=`+1 t X tj−` (2t)t−j ε0 j=`+1  ≤ tt−` · ε0 · 1 +  t X 2t−j  = tt−` · ε0 · 2t−` . j=`+1 Therefore, krk1 = t X `=0 t X kr=` k1 ≤ (2t)t−` ε0 ≤ ε0 · 2t+1 tt . `=0 The lemma now follows by plugging in the value of ε0 . 7 Learning Markov Random Fields We now describe how to apply the Sparsitron algorithm to recover the structure as well as parameters of binary t-wise MRFs. 14 We will use the characterization of MRFs via the Hammersley-Clifford theorem. Given a graph G = (V, E) on n vertices, let Ct (G) denote all cliques of size at most t in G. A binary t-wise MRF with dependency graph G is a distribution D on {1, −1}n where the probability density function of D can be written as ! X Pr [Z = x] ∝ exp ψI (x) , Z∼D I∈S Rn where S ⊆ Ct (G) and each ψI : → R is a function that depends only on thePvariables in I. Note that if t = 2, this corresponds exactly to the Ising model. We call ψ(x) = I∈S ψI (x) the factorization polynomial of the MRF and G the dependency graph of the MRF. Note that the factorization polynomial is a polynomial of degree at most t. However, different graphs and factorizations (i.e., functions {ψI }) could potentially lead to the same polynomial. To get around this we enforce the following non-degeneracy condition: Definition 7.1. For a t-wise MRF D on {1, −1}n we say an associated dependency graph G and factorization ! X Pr [Z = x] ∝ exp ψI (x) , Z∼D I∈S for S ⊆ Ct (G) is η-identifiable if for every maximal monomial J in ψ(x) = and every edge in G is covered by a non-zero monomial of ψ. P I∈S b ψI (x), ψ(J) ≥η We now state our main theorems for learning MRFs. Our first result is about structure learning, i.e., recovering the underlying dependency graph of a MRF. Roughly speaking, using N = 2O(λt) log(n/η)/η 4 samples we can recover the underlying dependency graph of a η-identifiable MRF where λ is the maximum `1 -norm of the derivatives of the factorization polynomial. The run-time of the algorithm is O(M · nt ). Note that maxi k∂i ψk1 is analogous to the notion of width for Ising models (as in Corollary 5.4). Thus, exponential dependence on it is necessary as in the Ising model and our sample complexity is in fact nearly optimal in all parameters. Theorem 7.2. Let D be a t-wise MRF on {1, −1}n with underlying dependency graph G and factorP ization polynomial p(x) = I∈Ct (G) pI (x) with maxi k∂i pk1 ≤ λ. Suppose that D is η-identifiable. Then, there exists an algorithm that given λ, η, ρ ∈ (0, 1/2), and N= eO(t) eO(λt) · (log(n/ρη)) η4 independent samples from D, recovers the underlying dependency graph G with probability at least 1 − ρ. The run-time of the algorithm is O(N · nt ). Moreover, the algorithm can be run in an online manner. Along with learning the dependency graph, given more samples, we can also approximately learn the parameters of the MRF: i.e., compute a t-wise MRF whose distribution is close as a pointwise-approximation to the original probability density function. 15 n Theorem 7.3. Let D be a t-wise P MRF on {1, −1} with underlying dependency graph G and factorization polynomial ψ(x) = I∈Ct (G) ψI (x) with maxi k∂i ψk1 ≤ λ. There exists an algorithm that given λ, and ε, ρ ∈ (0, 1/2), and N= (2t)O(t) eO(λt) 4t · n · (log(n/ρε)) ε4 independent samples Z 1 , . . . , Z N P ← D produces a t-wise MRF D0 with dependency graph H and a factorization polynomial ϕ(x) = I∈Ct (H) ϕI (x) such that with probability at least 1 − ρ: ∀x, Pr [Z = x] = (1 ± ε) Pr 0 [Z = x]. Z∼D Z∼D The algorithm runs in time O(N nt ) and can be run in an online manner. We in fact show how to recover the parameters of a log-polynomial density defined as follows: Definition 7.4. A distribution D on {1, −1}n is said to be a log-polynomial distribution of degree t if for some multilinear polynomial p : Rn → R of degree t, Pr [X = x] ∝ exp(p(x)). X∼D Theorem 7.5. Let D be a log-polynomial distribution of degree at most t on {1, −1}n with the associated polynomial p : Rn → R such that maxi k∂i pk1 ≤ λ. There exists an algorithm that given λ, and ε, ρ ∈ (0, 1) and (2t)O(t) · eO(λt) · (log(n/ρε)), N= ε4 independent samples Z 1 , . . . , Z N ← D, finds a multilinear polynomial q : Rn → R such that with probability at least 1 − ρ   n kp − qk1 ≤ ε · . t Moreover, we can also find coefficients (ŝ(I) : I ⊆ [n], |I| ≤ t) such that with probability at least 1 − ρ, for every maximal monomial I of p, we have |b p(I) − sb(I)| < ε. The run-time of the algorithm is O(N · nt ) and the algorithm can be run in an online manner. 7.1 Learning the structure of MRFs The following elementary properties of MRFs play a critical role in our analysis. n Lemma 7.6. Let D be a t-wise P MRF on {1, −1} with underlying dependency graph G and factorization polynomial p(x) = I∈Ct (G) pI (x) with maxi k∂i pk1 ≤ λ. Then, the following hold for Z ← D: • For any i, and a partial assignment x ∈ {1, −1}[n]\{i} , Pr[Zi = −1|Z−i = x] = σ(−2∂i p(x)). • D is (e−2λ /2)-unbiased. 16 Proof. For any x ∈ {1, −1}[n]\{i} , Pr[Zi = 1|Z−i = x] = exp(2∂i p(x)). Pr[Zi = −1|Z−i = x] Thus, Pr[Zi = −1|Z−i = x] = σ(−2∂i p(x)). Next, for each i, and any partial assignment x to Z−i , min (Pr[Zi = −1|Z−i = x], Pr[Zi = 1|Z−i = x]) = min (σ(−2∂i p(x)), 1 − σ(−2∂i p(x))) ≥ (1/2)e−2k∂i pk1 ≥ (1/2)e−2λ . We also need the following elementary fact about median: Claim 7.7. Let X be a real-valued random variable such that for some α, γ ∈ R, Pr[|X − α| > γ] < 1/4. Then, for K independent copies of X, X1 , X2 , . . . , XK , Pr[|Median(X1 , . . . , XK ) − α| > γ] ≤ 2 exp(−Ω(K)). Proof of Theorem 7.2. We will show how to recover neighbors of the vertex n (for ease of notation). By repeating the argument for all i ∈ [n], we will get the graph G. The starting point for our algorithm is Lemma 7.6 that allow us to use Sparsitron algorithm via feature expansion and the properties of δ-unbiased distributions developed in Section 6. Concretely, let p0 =Q−2∂n p and p0 = (pb0 (I) : I ⊆ [n − 1], |I| ≤ t − 1). Similarly, for x ∈ {1, −1}n−1 , let v(x) = ( i∈I xi : I ⊆ [n − 1], |I| ≤ t − 1). Let Z ∼ D and X be the distribution of v(Z−n ) and let Y = (1 − Zn )/2. Then, by Lemma 7.6, we have E[Y |X] = σ(p0 · X). Let δ = e−2λ /2, and let ε ∈ (0, 1), K ≥ 1 be parameters to be chosen later. Our algorithm is shown in Figure 3. The intuition is as follows: We first apply Sparsitron to recover a polynomial q that approximates ∂n p in the sense that E[(σ(−2∂n p(Z)) − σ(−2q(Z)))2 ] < ε. Z However, the above does not guarantee that the coefficients of q are close to those of ∂n p. To overcome this, we exploit Lemma 6.2 that guarantees that for any maximal monomial I in ∂n p, ∂I q(Z) is close to ∂d n p(I) with high probability for Z ∼ D; concretely, in steps (4), (5), (6), we draw fresh samples from D and use the median evaluation of ∂I q( ) as our estimate for ∂d n p(I). We next argue that for a suitable choice of ε, K, with probability at least 1 − ρ/n, the graph H contains all edges of G adjacent to vertex n. Observe that by our definitions of p0 , q, X h i E (σ(−2∂n p(Z)) − σ(−2q(Z))2 = E[(σ(p0 · X) − σ(q · X))2 ] ≤ ε. Z 17 Algorithm 3 MRF Recovery 1: Initialize H = ∅ to be the empty graph. 2: Apply the Sparsitron algorithm as in Theorem 3.1 to compute a vector q such that with probability at least 1 − ρ/2n2 , E[(σ(p0 · X) − σ(q · X))2 ] ≤ ε. Define a polynomial q : Rn−1 → R by setting qb(I) = (−1/2)qI for all I ⊆ [n − 1]. 4: Let Z 1 , . . . , Z K be additional independent samples from D. 5: for each I ⊆ [n − 1], |I| ≤ t − 1 do  6: If median ∂I q(Z 1 ), . . . , ∂I q(Z K ) > η/2, then add the complete graph on {n} ∪ I to H. 3: (Here, we abuse notation and write q(Z) = q(Z1 , . . . , Zn−1 ) as the latter does not depend on Zn .) Further, as Z is δ-unbiased by Lemma 7.6, by Lemma 6.2 for any maximal monomial I ⊆ [n − 1] of ∂n p, we have h i 16e2kpk1 +6 ε Pr ∂d . n p(I) − ∂I q(Z) > η/4 < η 2 δ |I| Let ε = e−2λ−6 η 2 δ t /64 so that h i Pr ∂d n p(I) − ∂I q(Z) > η/4 < 1/4. Therefore, by Claim 7.7, h i Pr Median(∂I q(Z 1 ), ∂I q(Z 2 ), . . . , ∂I q(Z K )) − ∂d n p(I) > η/4 < 2 exp(−Ω(K)). Taking K = C log(nt /ρ) for a sufficiently big constant C, we get that with probability at least 1−ρ/n, for all maximal monomials I of ∂n p, Median(∂I q(Z 1 ), ∂I q(Z 2 ), . . . , ∂I q(Z K )) − ∂d n p(I) < η/4. Now, whenever the above happens, as the coefficients of maximal monomials of p are at least η in magnitude (by η-identifiability), our algorithm will add the complete graph on the variables of all maximal monomials of p involving vertex n to H. Thus, the algorithm recognizes the neighbors of vertex n exactly with probability at least 1−ρ/n. Repeating the argument for each vertex i ∈ [n] and taking a union bound over all vertices gives us the recovery guarantee of the theorem. It remains to bound the sample-complexity. Note that kp0 k1 = 2k∂n pk1 ≤ 2λ. Therefore, by Theorem 3.1, the number of samples needed for the call to Sparsitron in Step (2) of Algorithm 3 is O(λ2 · ln(nt /ρε)/ε2 ) = eO(t) · eO(λ·t) · ln(n/ρη) · (1/η 4 ). As K = Ct ln(n/ρ), the above bound dominates the number of samples proving the theorem. 7.2 Learning log-polynomial densities and parameters of MRFs We first observe that Theorem 7.5 implies Theorem 7.3 18 Proof of Theorem 7.3. We apply Theorem 7.5 with error ε0 = εn−t to samples from D to obtain a polynomial ϕ : Rn → R such that kψ − ϕk1 ≤ ε. We build a new graph H as follows: For each monomial I ⊆ [n] with ϕ(I) b 6= 0, add all the edges in I to H. Let D0 denote the t-wise MRF with dependency graph H and factorization polynomial ϕ. Since, kψ − ϕk1 ≤ ε, it follows that for all x, |ψ(x) − ϕ(x)| < ε. Therefore, for all x, exp(ψ(x)) = exp(ϕ(x) ± ε) = (1 ± 2ε) exp(ϕ(x)). The theorem now follows. We next prove Theorem 7.5. The proof is similar to that of Theorem 5.2 and Theorem 7.2. Proof of Theorem 7.5. For each i, we will show how to recover a polynomial qi such that k∂i p −  n . We can then combine these polynomials to obtain a polynomial q. One way to do qi k1 < ε · t−1 so is as follows: For each I ⊆ [n], let i = arg min(I), and define qb(I) = qbi (I \ {i}). Then, kp − qk1 = X |b p(I) − qb(I)| = ≤ i=1 X |b p(I) − qb(I)| i=1 I:arg min(I)=i I n X n X   n k∂i p − qi k ≤ ε · n · . t−1 Here we show how to find a polynomial qn such that with probability at least 1 − ρ/n,   n k∂n p − qn k1 < ε · . t−1 (7.1) The other cases can be handled similarly and the theorem then follows from the above argument. As in Theorem 7.2, we exploit Lemma 7.6 to employ our Sparsitron algorithm for learning 0 0 b0 GLMs via feature expansion. Concretely, let Q p = −2∂n p and p = (p (I) : I ⊆ [n − 1], |I| ≤ t − 1). n−1 Similarly, for x ∈ {1, −1} , let v(x) = ( i∈I xi : I ⊆ [n − 1], |I| ≤ t − 1). Let Z ∼ D and X be the distribution of v(x) and let Y = (1 − Zn )/2. Then, from the above arguments, we have E[Y |X] = σ(p0 · X). Note that kp0 k1 = 2k∂n pk1 ≤ 2λ. Let γ ∈ (0, 1) be a parameter to be chosen later. We now apply the Sparsitron algorithm as in Theorem 3.1 to compute a vector q 0 ∈ Rn such that with probability at least 1 − ρ/n, E[(σ(p0 · X) − σ(q 0 · X))2 ] ≤ γ. We define polynomial qn by setting qbn (I) = (−1/2) · qI0 for all I ⊆ [n − 1]. Then, the above implies that h i E (σ(−2∂n p(Z)) − σ(−2qn (Z))2 ≤ γ. (7.2) Z Now, an argument similar to that of Lemma 7.6 shows that Z is δ-unbiased for δ = e−2λ /2. Therefore, by Equation 7.2, and Lemma 6.4, for γ < c exp(−4λ)·δ −t for a sufficiently small constant c, we get     p n n t 2λ t k∂n p − qn k1 ≤ O(1)(2t) · e · γ/δ · ≤ε· , t−1 t−1 19 where γ = ε2 ·exp(−Cλt)/C(2t)2t for a sufficiently large constant C > 0. Note that by Theorem 3.1, the number of samples needed to satisfy Equation 7.2 is O((λ/γ)2 · (log(n/ργ)) = (2t)O(t) · eO(λt) · (log(n/ρε)). ε4 This proves Equation 7.1 and hence the main part of the theorem. The moreover part of the statement follows from an argument nearly identical to that of Theorem 7.2 and is omitted here. 8 Extension of the Ising Model to general alphabet Here we extend our results for the Ising model from Section 5 to work over general alphabet. Definition 8.1. Let W = (Wij ∈ Rk×k : i 6= j ∈ [n]) be a collection of matrices and θ ∈ R[n]×[k] . Then, the non-binary Ising model D ≡ D(W, θ) is the distribution on [k]n where   n X X Pr [X = x] ∝ exp  Wij (xi , xj ) + θi (xi ) . X∼D i=1 i6=j The dependency graph G of D is the graph formed by pairs {i, j} such that Wij 6= 0. The width  P of D is λ(D) = maxi,a j6=i maxb∈[k] |Wij (a, b)| + θi (a) . It is easy to see that for k = 2, the above description corresponds exactly to our discussion of Ising models in Section 5. Our goal here is to learn the structure and parameters of a general alphabet model as above given samples from it. We will show that arguments from Section 5 can be extended to case of general alphabet as well leading to algorithms to learn the structure and parameters of distributions D(W, θ) with nearly optimal sample complexity. First, we address some necessary non-degeneracy conditions. Note that as described above, different parameter settings can lead to the same probability density function. To get around this, throughout this section we assume without loss of generality that for every {i, j}, the rows and columns of the matrices Wij ∈ Rk×k are centered, i.e., sum to zero. We can do so because of the following elementary claim: Fact 8.2. Given D(W, θ) as above, we may assume without loss of generality that for every i, j, the rows and columns of the matrix Wij are centered, i.e., have mean zero. Proof. For simplicity fix a particular x = x1 , . . . , xn . The above pdf simplifies to   X X Pr [X = x] ∝ exp  Wij (xi , xj ) + θi (xi ) . i i6=j 0 Now define Wij0 (x P Pi , xj ) equal to Wij (xi , xj ) − (1/k) a Wij (a, xj ) and define0 θj (xj ) equal to θj (xj ) + i<j (1/k) xj ). Then by inspection P P a Wij (a, P P 0 the column sums of Wij equal zero and 0 j θj (xj ) = ij Wij (xi , xj ) + j θ (xj ). Repeating the argument for rows gives ij Wij (xi , xj ) + us the claim. P Next, we make the following identifiability assumption analogous to our assumptions for the Ising model. 20 Definition 8.3. D(W, θ) is η-identifiable if for every edge in the dependency graph of D, kWij k∞ = maxa,b (|Wij (a, b)|) ≥ η (assuming the matrices Wij are centered). We prove the following extension of Theorem 5.2 to non-binary Ising models: Theorem 8.4. Let D(W, θ) be an n-variable non-binary Ising model with alphabet size k, width λ that is η-identifiable. There exists an algorithm that given λ, η, ρ ∈ (0, 1), and N = O(exp(O(λ))/η 4 )· (log(n/ρη)) · k 3 independent samples Z 1 , . . . , Z N ← D(A, θ) recovers the underlying dependency graph of D(W, θ) with probability at least 1 − ρ. The run-time of the algorithm is O(k 2 n2 N ). Moreover, the algorithm can be run in an online manner. At a high-level, the proof proceeds as follows. Let Z ∼ D(W, θ). For each i ∈ [n], a partial assignment x ∈ [k][n]\{i} , and for each α 6= β ∈ [k],    X Pr [Zi = β | Zi ∈ {α, β} ∧ Z−i = x] = σ  Wij (α, xj ) − Wij (β, xj ) + θi (α) − θi (β) . j6=i This is analogous to Equation 5.1 and allows us to use an argument similar to that used in Theorem 5.2. To this end, we first show an analogue of unbiasedness for non-binary Ising models. We say a distribution D on [k]n is δ-unbiased if for any i ∈ [n], and any partial assignment x to (Xj : j 6= i), mina (Pr[Xi = a|X−i = x]) ≥ δ. Just as for Ising models, non-binary Ising models D(W, θ) also turn out to be δ-unbiased for δ depending on the width of the distribution. Lemma 8.5. A non-binary Ising distribution D(W, θ) on [k]n is δ-unbiased for δ = (e−2λ /k) where λ is the width of D(W, θ). Proof. Let X ∼ D(W, θ). Note that for any α, β ∈ [k], i ∈ [n], and a partial assignment x ∈ [k][n]\{i} ,  P W (α, x ) + θ (α) exp ij j i j6=i Pr[Xi = α|X−i = x]  ≤ exp(−2λ). P = Pr[Xi = β|X−i = x] W (β, x ) + θ (β) exp j6=i ij j i Therefore, minα Pr[Xi = α|X−i = x] ≥ exp(−2λ)/k. We are now ready to prove Theorem 8.4. Proof of Theorem 8.4. Just as in the proof of Theorem 5.2, the starting point is the following connection to learning GLMs. Let Z ∼ D(W, θ). Then, for any α, β ∈ [k], i ∈ [n], and a partial assignment x ∈ [k][n]\{i} , P  exp W (α, x ) + θ (α) ij j i j6 = i Pr [Zi = α | Z−i = x] P . = Pr [Zi = β | Z−i = x] exp W (β, x ) + θ (β) j6=i ij j i Thus, Pr [Zi = β | Z−i = x] Pr [Zi = α | Z−1 = x] + Pr [Zi = β | Z−1 = x]    X = σ  Wij (α, xj ) − Wij (β, xj ) + θi (α) − θi (β) . j6=i 21 In the following we show how to recover the edges of the dependency graph involving vertex n; we can repeat the argument for each of the other vertices to infer the graph. Fix α, β ∈ [k]. We will show how to approximate Wni (α, b) − Wni (β, b) for all i ∈ [n − 1] and b ∈ [k]. Once we have such an approximation, we can recover the values Wni (α, b) as X (Wni (α, b) − Wni (β, b)). Wni (α, b) = β To this end, let Z 0 ≡ Z | Zn ∈ {α, β}. Note that we can obtain independent draws from Z 0 by restricting to examples where Zn takes only values in {α, β}. This will not cost us too much in sample complexity as by Lemma 8.5 Pr[Zn ∈ {α, β}] ≥ 2 exp(−2λ)/k. Let e : [k] 7→ {0, 1}k be a function that maps an alphabet symbol a to a string of length k that e be a string of length is all zeros except for a 1 in position a. Then for a string x ∈ [k]n−1 , let x k(n − 1) equal to (e(x1 ), . . . , e(xn−1 )). Let w be a string broken into n blocks each of size k where the b’th value of block i denoted wi (b) is Wni (α, b) − Wni (β, b). Then, from the above arguments, we have ! ! X  0 Pr[Zn = β | Z−n = x] = σ x + θ0 , Wni (α, xi ) − Wni (β, xi ) + θi (α) − θi (β) = σ w·e i<n where θ0 = θi (α) − θi (β). P Note that as the matrices Wij are centered, we have a∈[k] wj (a) = 0 for all j < n. Let X be 0 the distribution of zg −n for z drawn from Z and let Y = 1 if Zn = β and 0 if Zn = α. Then, E[Y |X] = σ(w·X + θ0 ). Now, for some parameter γ, ρ0 ∈ (0, 1) to be chosen later, assume we ran our Sparsitron algorithm as in Theorem 3.1 to obtain a vector u ∈ R(n−1)k and θ00 ∈ R such that with probability at least 1 − ρ0 , h 2 i E σ(w·X + θ0 ) − σ(u·X + θ00 ) ≤ γ. P Here, we also assume that for each i ∈ [n − 1], a∈[k] ui (a) = 0; for if not, we can set u0i (a) = P P P ui (a) − (1/k) b ui (b) and θ000 = θ00 + (1/k) i b ui (b). Next, analogous to Lemma 4.3, we show that the above condition implies that kw − uk∞  1. Claim 8.6. Let Y be a δ-unbiased distribution on [k]n−1 Pand let w = P(wi (a) : i < n, a ∈ [k]), u = (ui (a) : i < n, a ∈ [k]) be centered (i.e., for every i, w (a) = a i a ui (a) = 0) and for some 0 |−6 0 −2kwk −2|θ 1 θ, θ ∈ R, γ < e δ,  2  0 00 e e E σ(w·Y + θ ) − σ(u·Y + θ ) ≤ γ. 0 Then, kw − u|k∞ ≤ O(1) · ekwk1 +|θ | p γ/δ. Indeed, from the above claim and by Lemma 8.5, we get that for every i < n, a ∈ [k], p |Wni (α, a) − Wni (β, a) − ui (a)| < O(1)eO(λ) kγ. 22 The above argument was for a fixed α, β ∈ [k]. Repeating the argument for all α, β ∈ [k], we find estimates Uiα,β (a) for i < n and a ∈ [k] such that p Wni (α, a) − Wni (β, a) − Uiα,β (a) < O(1)eO(λ) kγ. P α,β Now, set U (α, a) = (1/k) ni β Ui (a). Then, by the above inequality and the fact that P β Wni (β, a) = 0, we get that for every i < n and α, a ∈ [k], p |Wni (α, a) − Uni (α, a)| < O(1)eO(λ) kγ < η/2 if we set γ = η 2 e−Cλ /Ck for a sufficiently big constant C. Now, given the above, we can identify the neighbors of vertex n as follows: For each i < n if maxα,a |Uni (α, a)| > η/2, i is a neighbor of n. This works as D(W, θ) is η-identifiable. It remains to bound the number of samples needed. As per Theorem 3.1, the number of samples of Z 0 needed is O(λ2 log(n/ρ0 γ)/γ 2 = O(1)k 2 · eO(λ) log(n/ρ0 η) = N 0 . Finally, as Z is δ-unbiased for δ = e−2λ /k, to get the above number of samples of Z 0 with probability 1 − ρ/n2 k 2 , it suffices to take O(N 0 /δ) = O(1)k 3 eO(λ) log(n · n2 k 2 /ρη) samples. Finally, we can take a union bound over vertices i ∈ [n] and α, β ∈ [k]. This completes the proof of the theorem. Proof of Claim 8.6. For y ∈ [k]n−1 define p(y) = hw, yei + θ0 and q(y) = hu, yei + θ00 . Let y i,a be the string obtained from y by setting the ith coordinate of y to a. Fix an index i < n. Then, as in the binary case, by Claim 4.2 and the fact that Y is drawn from a δ-unbiased distribution, we have  i  h e 1 −|θ0 |−3 (8.1) · min 1, max |p(Y i,a ) − q(Y i,a )|2 . E (σ(p(Y )) − σ(q(Y )))2 ≥ δ · e−kwk a Yi |Y−i Since we assumed that the sum of the values in each block of w are zero, we have that  X X p(y i,a ) − p(y i,b ) = (wi (a) − wi (b)) = kwi (a). b (8.2) b and similarly X  X q(y i,a ) − q(y i,b ) = (ui (a) − ui (b)) = kui (a). b (8.3) b Subtracting equation 8.3 from equation 8.2 and applying the triangle inequality we obtain k · | (wi (a) − ui (a)) | ≤ X |p(y i,a ) − q(y i,a )| + |p(y i,b ) − q(y i,b )| (8.4) b ≤ 2k · max |p(y i,b ) − q(y i,b )|. b∈[k] 23 (8.5) Thus we have maxb∈[k] |p(y i,b ) − q(y i,b )| ≥ 1/2 · maxa∈[k] |wi (a) − ui (a)|. We also have, that h i EY (σ(p(Y )) − σ(q(Y )))2 ≤ γ. We therefore must have max |wi (a) − ui (a)| ≤ O(1) · p 0 γ/δ · ekwk1 +|θ | . a∈[k] References [AKN06] Pieter Abbeel, Daphne Koller, and Andrew Y. Ng. Learning factor graphs in polynomial time and sample complexity. Journal of Machine Learning Research, 7:1743–1788, 2006. [ATHW11] Animashree Anandkumar, Vincent Y. F. Tan, Furong Huang, and Alan S. Willsky. High-dimensional structure estimation in ising models: Local separation criterion. 40(3), August 20 2011. Comment: Published in at http://dx.doi.org/10.1214/12AOS1009 the Annals of Statistics (http://www.imstat.org/aos/) by the Institute of Mathematical Statistics (http://www.imstat.org). [BGS14] Guy Bresler, David Gamarnik, and Devavrat Shah. Structure learning of antiferromagnetic ising models. In Zoubin Ghahramani, Max Welling, Corinna Cortes, Neil D. Lawrence, and Kilian Q. Weinberger, editors, NIPS, pages 2852–2860, 2014. [BMS13] Guy Bresler, Elchanan Mossel, and Allan Sly. Reconstruction of markov random fields from samples: Some observations and algorithms. SIAM J. Comput, 42(2):563–578, 2013. [Bre15] Guy Bresler. Efficiently learning ising models on arbitrary graphs. In STOC, pages 771–782. ACM, 2015. [CL68] C. Chow and C. Liu. Approximating discrete probability distributions with dependence trees. IEEE Trans. Information Theory, 14(11):462–467, November 1968. [Cli90] P. Clifford. Markov random fields in statistics. In G. R. Grimmett and D. J. A. Welsh, editors, Disorder in Physical Systems. A Volume in Honour of John M. Hammersley, pages 19–32, Oxford, 1990. Clarendon Press. [FGKP09] Vitaly Feldman, Parikshit Gopalan, Subhash Khot, and Ashok Kumar Ponnuswami. On agnostic learning of parities, monomials, and halfspaces. SIAM J. Comput., 39(2):606– 645, 2009. [FS97] Yoav Freund and Robert Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. JCSS: Journal of Computer and System Sciences, 55, 1997. [Gol95] Oded Goldreich. Three XOR-lemmas - an exposition. Electronic Colloquium on Computational Complexity (ECCC), 2(56), 1995. [GR09] Venkatesan Guruswami and Prasad Raghavendra. Hardness of learning halfspaces with noise. SIAM J. Comput., 39(2):742–765, 2009. 24 [HKM17] Linus Hamilton, Frederic Koehler, and Ankur Moitra. Information theoretic properties of markov random fields, and their algorithmic applications. 2017. https://arxiv.org/pdf/1705.11107.pdf. [HS86] G. Hinton and T. Sejnowski. Learning and relearning in boltzmann machines. In Rummelhart and McClelland, editors, Parallel Distributed Processing, pages 283–335, 1986. [JEMF06] Ariel Jaimovich, Gal Elidan, Hanah Margalit, and Nir Friedman. Towards an integrated protein-protein interaction network: A relational markov network approach. Journal of Computational Biology, 13(2):145–164, 2006. [KF09] D. Koller and N. Friedman. Probabilistic Graphical Models: Principles and Techniques. MIT Press, 2009. [KFL01] Frank R. Kschischang, Brendan J. Frey, and Hans-Andrea Loeliger. Factor graphs and the sum-product algorithm. IEEE Trans. Information Theory, 47(2):498–519, 2001. [KKKS11] Sham M. Kakade, Adam Kalai, Varun Kanade, and Ohad Shamir. Efficient learning of generalized linear and single index models with isotonic regression. In John ShaweTaylor, Richard S. Zemel, Peter L. Bartlett, Fernando C. N. Pereira, and Kilian Q. Weinberger, editors, NIPS, pages 927–935, 2011. [KS01] Karger and Srebro. Learning markov networks: Maximum bounded tree-width graphs. In SODA: ACM-SIAM Symposium on Discrete Algorithms (A Conference on Theoretical and Experimental Analysis of Discrete Algorithms), 2001. [KS09] Adam Tauman Kalai and Ravi Sastry. The isotron algorithm: High-dimensional isotonic regression. In COLT, 2009. [Lau98] S. L. Lauritzen. Graphical Models. Oxford University Press, 1998. [MRS13] Elchanan Mossel, Sébastien Roch, and Allan Sly. Robust estimation of latent tree graphical models: Inferring hidden states with inexact parameters. IEEE Trans. Information Theory, 59(7):4357–4373, 2013. [NBSS12] Praneeth Netrapalli, Siddhartha Banerjee, Sujay Sanghavi, and Sanjay Shakkottai. Greedy learning of markov network structure, 2012. [NRWY10] Sahand N. Negahban, Pradeep Ravikumar, Martin J. Wainwright, and Bin Yu. A unified framework for high-dimensional analysis of M-estimators with decomposable regularizers. Statistical Science, 27(4), March 12 2010. http://dx.doi.org/10.1214/12STS400. [RSS12] Avik Ray, Sujay Sanghavi, and Sanjay Shakkottai. Greedy learning of graphical models with small girth. In Allerton, pages 2024–2031. IEEE, 2012. [Sal09] Ruslan Salakhutdinov. Learning in markov random fields using tempered transitions. In Yoshua Bengio, Dale Schuurmans, John D. Lafferty, Christopher K. I. Williams, and Aron Culotta, editors, NIPS, pages 1598–1606. Curran Associates, Inc, 2009. 25 [SW12] Narayana P. Santhanam and Martin J. Wainwright. Information-theoretic limits of selecting binary graphical models in high dimensions. IEEE Trans. Information Theory, 58(7):4117–4134, 2012. [TR14] Rashish Tandon and Pradeep Ravikumar. Learning graphs with a few hubs. In ICML, volume 32 of JMLR Workshop and Conference Proceedings, pages 602–610. JMLR.org, 2014. [Val88] L. G. Valiant. Functionality in neural nets. In Proceedings of the First Annual Workshop on Computational Learning Theory, COLT ’88, pages 28–39, San Francisco, CA, USA, 1988. Morgan Kaufmann Publishers Inc. [Val15] Gregory Valiant. Finding correlations in subquadratic time, with applications to learning parities and the closest pair problem. J. ACM, 62(2):13:1–13:45, May 2015. [VMLC16] Marc Vuffray, Sidhant Misra, Andrey Y. Lokhov, and Michael Chertkov. Interaction screening: Efficient and sample-optimal learning of ising models. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett, editors, NIPS, pages 2595–2603, 2016. [WRL06] A Martin J. Wainwright, Pradeep Ravikumar, and John D. Lafferty. High-dimensional graphical model selection using `1 -regularized logistic regression. In Bernhard Schölkopf, John C. Platt, and Thomas Hofmann, editors, NIPS, pages 1465–1472. MIT Press, 2006. Hardness of Learning t-wise Markov random fields Bresler, Gamarnik, and Shah [BGS14] showed how to embed parity learning as a Markov random field and showed that a restricted class of algorithms must take time nΩ(d) to learn degree MRFs defined on degree d graphs. Here we use the same construction, and for completeness we give a proof. The conclusion is that, assuming the hardness of learning sparse parities with noise, for degree d graphs, learning t-wise MRFs (t < d) will require time nΩ(t) . Our positive results match this conditional lower bound. • Let χS : {−1, 1}n → {−1, Q 1}n be an unknown parity function on a subset S, |S| ≤ k, of n inputs bits (i.e., f (x) = i∈S xi ). Let Ck be the concept class of all parity functions on subsets S of size at most k. Let D be the uniform distribution on {−1, 1}n . • Fix an unknown c ∈ Ck and consider the following random experiment: x is drawn according to D and with probability 1/2 + η (for some constant η), the tuple (x, c(x)) is output. With probability 1/2 − η, the tuple (x, c(x)0 ) is output where c0 (x) is the complement of c(x). • The k-LSPN problem is as follows: Given i.i.d. such tuples as described above, find h such that Prx [h(x) 6= c(x)] ≤ ε. Now we reduce k-LSPN to learning the graph structure of a (k + 1)-wise Markov random field. Let S denote the k indices of the unknown parity function Let G be a graph on n + 1 vertices 26 X1 , . . . , Xn , Y equal to a clique on the set of vertices corresponding to set S and vertex Y . Consider the probability distribution Pr[Z = (x1 , . . . , xn , y)] ∝ exp (γχS (x)y) for some constant γ. A case analysis shows that p1 = Pr[Y = χS (X)] ∝ eγ and p2 = Pr[Y 6= χS (X)] ∝ e−γ . Hence the ratio p1 /p2 is approximately 1 + 2γ. Since p1 + p2 = 1, by choosing γ to be a sufficiently small, we will have p1 ≥ 1/2 + η and p2 ≤ 1/2 − η for some small (but constant) η. Further, it is easy to see that the parity of any subset of Xi ’s is unbiased. By the Vazirani XOR lemma [Gol95], this implies that the Xi s are uniformly distributed. Therefore, the distribution encoded by this (k + 1)-wise MRF is precisely the distribution described in the k-LSPN problem. If we could discover the underlying clique in the Markov random field, we would be able to learn the underlying sparse parity. Hence, learning k + 1-MRFs is harder than k-LSPN. The current best algorithm for learning k-LSPN is due to Valiant [Val15] and runs in time nΩ(0.8k) . Any algorithm running in time no(k) would be a major breakthrough in theoretical computer science. 27
10math.ST
Robust ergodicity and tracking in antithetic integral control of stochastic biochemical reaction networks arXiv:1607.07080v1 [math.OC] 24 Jul 2016 Corentin Briat and Mustafa Khammash Abstract— Controlling stochastic reactions networks is a challenging problem with important implications in various fields such as systems and synthetic biology. Various regulation motifs have been discovered or posited over the recent years, the most recent one being the so-called Antithetic Integral Control (AIC) motif [1]. Several favorable properties for the AIC motif have been demonstrated for classes of reaction networks that satisfy certain irreducibility, ergodicity and output controllability conditions. Here we address the problem of verifying these conditions for large sets of reaction networks with fixed topology using two different approaches. The first one is quantitative and relies on the notion of interval matrices while the second one is qualitative and is based on sign properties of matrices. The obtained results lie in the same spirit as those obtained in [1] where properties of reaction networks are independently characterized in terms of control theoretic concepts, linear programming conditions and graph theoretic conditions. Index Terms— Cybergenetics; Antithetic Integral Control; Stochastic reaction networks; Robustness I. I NTRODUCTION Homeostasis [2] is the ability of living organisms to adapt to external and dynamical stimuli. At the cellular level, homeostasis can be physiologically achieved through perfect adaptation [3], a mechanism ensuring properties in living cells analogous to robustness and disturbance rejection in control systems. Several homeostatic motifs achieving perfect or near-perfect adaptation have been discovered and proposed over the past years. Important examples are the incoherent feedforward motif and the negative feedback loop motif ; see e.g. [4]–[6]. It is notably shown in [7] that bacterial chemotaxis involves integral feedback and, as pointed out in [5], that this integral feedback is implemented as a negative feedback loop motif with a buffering node. More recently, two novel integral control motifs have been proposed: the antithetic integral control motif [1] and an autocatalytic integral control motif [8]. The antithetic integral motif benefits from several interesting properties: it can achieve tracking and perfect adaptation for the controlled network, its metabolic load can be made arbitrarily close to the constitutive bound1 via a suitable choice for its parameters, and it can be used in both deterministic and stochastic settings. It is also the first homeostatic motif that is proved to work in the stochastic setting, implying then that it can perfectly achieve its function in the low copy number regime. An unexpected and intriguing property, which is exclusive Corentin Briat and Mustafa Khammash are with the Department of Biosystems Science and Engineering, ETH-Zürich, Switzerland; email: {corentin.briat,mustafa.khammash}@bsse.ethz.ch; url: http://www.bsse.ethz.ch/ctsb, http://www.briat.info 1 The constitutive bound is defined here as the metabolic cost of a constitutive open-loop controller that would achieve the same steady-state. to the stochastic setting, is that of controller innocuousness: the antithetic integral control motif cannot make the closedloop network non-ergodic (i.e. make the closed-loop network trajectories to grow without bound). This has to be contrasted with the common understanding that setting a too high gain for the integral action will likely result in a destabilization of the closed-loop system (unless quite restrictive conditions are met by the open-loop system). As this feature is only present in the stochastic setting, we can conclude that this property emerges from the presence of noise in the dynamics and, therefore, that the antithetic integral control exploits this noise for achieving its function. Several other networks, such as the bistable switch of [9] and the circadian clock model of [10], have been reported to heavily rely upon noise to realize their function – their deterministic counterparts indeed fail in achieving any similar function Sufficient conditions for the open-loop network that characterize whether the antithetic integral controller would ensure the desired tracking and adaptation properties for the closed-loop network have been stated in [1] for the case of unimolecular reaction networks and a particular class of bimolecular reaction networks. In the unimolecular case, these conditions are 1) the irreducibility of the state-space of the closed-loop network, 2) the output-controllability of the open-loop network, and 3) the Hurwitz stability of the characteristic matrix of the open-loop network. These conditions lie in the same spirit as the conditions obtained in [11] for establishing the long-term behavior of stochastic reaction networks where computationally cheap and versatile conditions were reported. The irreducibility of the state-space is tacitly assumed to hold in [1], [11] but can be efficiently checked using the method described in [12]. Interestingly, the irreducibility of the state-space of the closed-loop network, the Hurwitz stability of the characteristic matrix, and the output controllability of the open-loop network can all be cast as a mixture of linear programs and linear algebraic conditions. The complexity of these conditions depends linearly on the number of distinct of species involved in the open-loop network, which makes the approach highly scalable and suitable for considering biological networks consisting of a large number of distinct molecular species. The conditions in [1] are formulated for networks with fixed rate parameters, which is equivalent to having a fixed characteristic matrix in the unimolecular case. The objective of the current paper is to extend these results to families of characteristic matrices that arise from uncertainties at the level of the rate parameters while, at the same time, preserving the scalability of the approach. We show here that this can be achieved in, at least, two different ways. The first is quantitative and assumes that the characteristic matrix is an interval-matrix, i.e. the entries of the characteristic matrix lie within some known and fixed intervals. We prove several results in this regard, the most important one assessing that all the matrices in the interval are Hurwitz stable if and only if the upper-bound is so, and that all the matrices in the interval are output-controllable if and only if the lowerbound is so. This readily translates to a linear program having the exact same complexity has the one stated in [1] dealing with the ergodicity and output-controllability of a network with fixed rates. The second approach is qualitative and assumes that only the sign pattern of the characteristic matrix is known. In this case, we are interested in assessing properties for all the matrices sharing the same sign pattern – an approach often referred to as qualitative analysis. Several results obtained in [13] are revisited and extended to the current problem. The main result states that, given a known sign pattern, all the characteristic matrices sharing this sign pattern are Hurwitz stable and output-controllable if and only if the digraph associated with the sign pattern is acyclic and has a path connecting the input node to the output node. As in the nominal and the robust cases, these conditions can be recast as computationally inexpensive linear programs that can be applied to large scale networks. Outline. We recall in Section II several definitions and results related to reaction networks and antithetic integral control. Section III is concerned with the extension of the results in [1] to characteristic interval-matrices whereas Section IV addresses the structural case where only the sign pattern of the characteristic matrix is known. An illustrative example is finally considered in Section V. Notations. The set of positive (nonnegative) vectors is defined as Rd>0 (Rd≥0 ). The natural basis of Rn is denoted by {ei }ni=1 , the set of nonnegative integers, natural numbers and integers are denoted by Z≥0 , Z>0 and Z, respectively. II. P RELIMINARIES A. Reaction networks We consider here a reaction network with d molecular species X1 , . . . , Xd that interacts through K reaction channels R1 , . . . , RK formulated as Rk : d X i=1 ρk l ζk,i Xi −−−→ d X r ζk,i Xi , k = 1, . . . , K (1) i=1 l r where ρk ∈ R>0 is the rate and ζk,i , ζk,i ∈ Z≥0 . Each reaction is described by a stoichiometric vector and a propensity function. The stoichiometric vector of reaction Rk is denoted r r by ζk := ζkr − ζkl ∈ Zd where ζkr = col(ζk,1 , . . . , ζk,d ) and l l l ζk = col(ζk,1 , . . . , ζk,d ). Hence, when the reaction Rk fires, the state jumps from x to x+ζ the stoichiometry   k . We define matrix S ∈ Zd×K as S := ζ1 . . . ζK . When the kinetics is mass-action, theQpropensity function of reaction Rk is given d xi ! by λk (x) = ρk i=1 (xi −ζ l )! and is such that λk (x) = 0 if k,i x ∈ Zd≥0 and x+ ζk ∈ / Zd≥0 . We denote this reaction network by (X, R). B. Antithetic integral control Antithetic integral control has been introduced in [1] for solving the perfect adaptation problem in stochastic reaction networks. The key idea is to adjoin to the open-loop network (X, R) a set of additional species and reactions (the controller) in such a way that, by acting on the production rate of the first molecular species X1 , referred to as the actuated species, we can steer the mean value of the controlled species Xℓ , ℓ ∈ {1, . . . , d}, to a desired set-point (the reference). The controller is also required to be able to reject constant disturbances and to accommodate with possible sporadic changes in the rate parameters (perfect adaptation). As proved in [1], the antithetic integral control motif (Z, Rc ) defined with µ η θX kZ 1 ℓ X1 ∅ −−−→ Z1 , ∅ −−−→ Z2 , Z1 +Z2 −−−→ ∅, ∅ −−−→ (2) solves this control problem with the set-point being equal to µ/θ. Above, Z1 and Z2 are the controller species, namely, the actuating species and the sensing species, respectively. The four controller parameters µ, θ, η, k > 0 are assumed to be freely assignable to any desired value. The first reaction is the reference reaction as it encodes part of the reference value µ/θ as its own rate. The second one is the measurement reaction that produces the sensing species Z2 at a rate proportional to the current population of the controlled species Xℓ . The third reaction is the comparison reaction as it compares the populations of the controller species and annihilates one molecule of each when these populations are both positive. Note also that this reaction is the one that closes the overall (negative) control loop. Finally, the fourth reaction is the actuation reaction that produces the actuated species X1 at a rate proportional to the actuating species Z1 . C. Summary of the results for unimolecular networks In the unimolecular reaction networks case, the propensity functions are nonnegative affine functions of the current state of the network. Hence, we can write λ(x) = W (ρ)x + w0 (ρ), RK×d ≥0 , RK ≥0 (3) nρ R>0 is the where W (ρ) ∈ w0 (ρ) ∈ and ρ ∈ positive vector of reaction rates, as defined in Section II-A. Before pursuing any further, it is convenient to introduce some terminologies and results. Definition 2.1: The characteristic matrix A(ρ) and the offset vector b0 (ρ) of a unimolecular reaction network (X, R) are defined as A(ρ) := SW (ρ) and b0 := Sw0 (ρ). (4) A particularity of unimolecular reaction networks is that the matrix A(ρ) is always Metzler; i.e. all the off-diagonal elements are nonnegative. This property plays an essential role in the derivation of the results of [1] and will also be essential for the derivation of the main results of this paper. Definition 2.2: The closed-loop reaction network obtained from the interconnection of the open-loop reaction network (X, R) and the controller network (Z, Rc ) is denoted as ((X, Z), R ∪ Rc ). We will also need the following result on the output controllability of linear SISO positive systems: Lemma 2.3 ( [1]): Let M ∈ Rd×d be a Metzler matrix. Then, the following statements are equivalent: (a) The linear system ẋ(t) y(t) = = M x(t) + ei u(t) eTj x(t) (5) is output  controllable.  (b) rank eTj ei eTj M ei . . . eTj M d−1 ei = 1. (c) There is a path from node i to node j in the directed graph GM = (V, E) defined with V := {1, . . . , d} and E := {(m, n) : eTn M em 6= 0, m, n ∈ V, m 6= n}. △ Interestingly, the conditions stated in the above result can be numerically verified by checking the feasibility of the following linear program Find s.t. P1. the closed-loop reaction network ((X, Z), R∪Rc ) is ergodic, P2. the mean of the controlled species satisfies E[Xℓ (t)] → µ/θ as t → ∞, P3. the second-order moment matrix E[X(t)X(t)T ] is uniformly bounded and globally converges to its unique stationary value. III. ROBUST (6) is asymptotically stable and output controllable; i.e. the characteristic matrix A of the network (X, R) is Hurwitz stable and   rank eTℓ e1 eTℓ Ae1 . . . eTℓ Ad−1 e1 = 1. (7) Moreover, when one of the above statements holds, then for any values for the controller rate parameters η, k > 0, the properties P1., P2. and P3. hold provided that where c > 0 and v ∈ Rd>0 verify v T (A + cI) ≤ 0. A. Preliminaries The results obtained in the previous section apply when the characteristic matrix A = A(ρ0 ) is fixed as the linear programming problem (9) can only be solved for a single and known characteristic matrix A(ρ). The goal is to generalize these results to the case where the characteristic matrix A(ρ) and the offset vector b0 (ρ) are uncertain and belong to the sets  A := M ∈ Rd×d : A− ≤ M ≤ A+ , A− ≤ A+ , (10)  − + + B := b ∈ Rd≥0 : b− 0 ≤ b ≤ b0 , 0 ≤ b0 ≤ b0 , (a) There exist vectors v ∈ Rd>0 , w ∈ Rd≥0 , w1 > 0, such that v T A < 0 and wT A + eTℓ = 0. (b) The positive linear system describing the dynamics of the first-order moments given by µ v T b0 > T θ ceℓ v ERGODICITY OF THE CLOSED - LOOP NETWORK and We can now recall the main result of [1] on unimolecular reaction networks: Theorem 2.4 ( [1]): Assume that the open-loop reaction network (X, R) is unimolecular and that the state-space of the closed-loop reaction network ((X, Z), R ∪ Rc ) is irreducible. Let us also assume that the vector of reaction rates ρ is fixed and equal to some nominal value ρ0 . In this regard, we set A = A(ρ0 ) and b0 = b0 (ρ0 ). Then, the following statements are equivalent: dE[X(t)] = AE[X(t)] + e1 u(t) + b0 (ρ0 ) dt y(t) = eTℓ E[X(t)] (9) which involves 2d variables, 3d inequality constraints and d equality constraints. Moreover, when the matrix M is Hurwitz stable, then the above statements are also equivalent to: (e) The inequality eTj M −1 ei 6= 0 holds or, equivalently, the static-gain of the system (5) is nonzero. △ Before stating the main result, it is convenient to define here the following properties that will be recurrently satisfied whenever the conditions of the main results are satisfied: v ∈ Rd>0 , w ∈ Rd≥0 w T e1 > 0 vT A < 0 wT A + eTℓ = 0 (8) △ (11) where the inequality signs are componentwise and the ex+ tremal Metzler matrices A+ , A− and vectors b− 0 , b0 are known. These bounds can be determined such that the inequalities + A− ≤ A(ρ) ≤ A+ and b− 0 ≤ b0 (ρ) ≤ b0 (12) hold for all ρ ∈ P ⊂ RK >0 where P is the compact set containing all the possible values for the rate parameters. We have the following preliminary result: Lemma 3.1: The following statements are equivalent: (a) All the matrices in A are Hurwitz stable; (b) The matrix A+ is Hurwitz stable. △ Proof: The proof that (a) implies (b) is immediate. The converse can be proved using the fact that for two Metzler matrices M1 , M2 ∈ Rd×d verifying the inequality M1 ≤ M2 , we have that λF (M1 ) ≤ λF (M2 ) where λF (·) denotes the Frobenius eigenvalue (see e.g. [14]). Hence, we have that λF (M ) ≤ λF (A+ ) < 0 for all M ∈ A. The conclusion then readily follows. B. Main result We are now in position to state the following generalization of Theorem 2.4: Theorem 3.2: Let us consider a unimolecular reaction network (X, R) with characteristic matrix A in A and offset vector b0 in B. Assume also that the state-space of the closedloop reaction network ((X, Z), R∪Rc ) is irreducible. Then, the following statements are equivalent: (a) All the matrices in A are Hurwitz stable and for all A ∈ A, there exists a vector w ∈ Rd≥0 such that w1 > 0 and wT A + eTℓ = 0. (b) There exist two vectors v+ ∈ Rd>0 , w− ∈ Rd≥0 such that T + T T − v+ A < 0, w− e1 > 0 and w− A + eTℓ = 0. Moreover, when one of the above statements holds, then for any values for the controller rate parameters η, k > 0 and any (A, b0 ) ∈ A × B, the properties P1., P2. and P3. hold provided that T + −1 + q (A − ∆) b µ > T + θ cq (A − ∆)−1 eℓ and (13) q T (c(A+ − ∆)−1 + Id ) ≥ 0 Rd>0 (14) + − for some c > 0, q ∈ and for all ∆ ∈ [0, A − A ]. △ Proof: The proof that (a) implies (b) is immediate. So let us focus on the reverse implication. Define A(∆) := A+ −∆, ∆ ∈ ∆ := [0, A+ −A− ], where the set membership symbol is componentwise. The Hurwitz-stability of all the matrices in A directly follows for the theory of linear positive systems and Lemma 3.1. We need now to construct a suitable positive vector v(∆) ∈ Rd>0 such that v(∆)T A(∆) < 0 for T + all ∆ ∈ ∆ provided that v+ A < 0. We prove now that such a v(∆) is given by v(∆) = (Id + ∆(A+ − ∆)−1 )T v+ . Since A(∆) = A+ − ∆, then we immediately get that T + v(∆)T A(∆) = v+ A < 0. Hence, it remains to prove the positivity of the vector v(∆) for all ∆ ∈ ∆. The difficulty here is that the product ∆(A+ − ∆)−1 is a nonnegative matrix since ∆ ≥ 0 and (A+ − ∆)−1 ≤ 0, the latter being the consequence of the fact that A+ − ∆ is Metzler and Hurwitz stable (see e.g. [14]). Therefore, there may exist values for v+ ∈ Rd>0 for which we have v(∆) ≯ 0. To rule this possibility out, we restrict the analysis to all T + those v+ ∈ Rd>0 for which we have v+ A < 0. We can parameterize all these v+ as v+ (q) = −(A+ )−T q where q ∈ Rd>0 is arbitrary. We prove now that the vector v(∆) = −(Id + ∆(A+ − ∆)−1 )T (A+ )−T q > 0 is positive for all q ∈ Rd>0 and for all ∆ ∈ ∆. This is done by showing below that the matrix M := −(Id + ∆(A+ − ∆)−1 )T (A+ )−T is nonnegative and invertible. Indeed, we have that M = −(Id + ∆(A+ − ∆)−1 )T (A+ )−T = − (A+ )−1 + (A+ )−T ∆(A+ − ∆)−1 T T = − (A+ )−1 + (A+ )−T ∆(Id − (A+ )−1 ∆)−1 A+ = −(A+ − ∆)−T (15) where the latter expression follows from the Woodbury matrix identity. Since (A+ − ∆) = A(∆) is Metzler and Hurwitz stable for all ∆ ∈ ∆, then A+ − ∆ is invertible and we have −(A+ − ∆)−1 ≥ 0, which proves the result. Let us now consider then the output controllability condition and define A(∆) as A(∆) := A− +∆ where ∆ ∈ ∆. We use a similar approach as previously and we build a w(∆) that verifies the expression w(∆)T A(∆) + eTℓ = 0 for all T − ∆ ∈ ∆ provided that w− A + eTℓ = 0. We prove that such a w(∆) is given by w(∆) := (A− (A− + ∆)−1 )T w− . We first prove that this w(∆) is nonnegative and that it verifies eT1 w(∆) > 0 for all ∆ ∈ ∆. To show this, we rewrite this w(∆) as w(∆) = (Id − ∆(A− + ∆)−1 )T w− and using the fact that (A− +∆)−1 ≤ 0 since (A− +∆) is a Hurwitz stable Metzler matrix for all ∆ ∈ ∆, then we can conclude that w(∆) ≥ w− ≥ 0 for all ∆ ∈ ∆. An immediate consequence T is that w(∆)T e1 ≥ w− e1 > 0 for all ∆ ∈ ∆. This proves the first part. We now show that this w(∆) verifies the output controllability condition. Evaluating then w(∆)T (A− + ∆) yields T w(∆)T (A− + ∆) = w− (A− (A− + ∆)−1 )(A− + ∆) T − = w− A = −eTℓ (16) where the last row has been obtained from the assumption T − that w− A + eTℓ = 0. This proves the second part. Finally, the condition (13) is obtained by substituting the expression for v(∆) defined above in (8). This completes the proof. As in the nominal case, the above result can be exactly formulated as the linear program Find s.t. v ∈ Rd>0 , w ∈ Rd≥0 w T e1 > 0 v T A+ < 0 wT A− + eTℓ = 0 (17) which has exactly the same complexity as the linear program (9). Hence, checking the possibility of controlling a family of networks defined by a characteristic interval-matrix is not more complicated that checking the possibility of controlling a single network. IV. S TRUCTURAL ERGODICITY OF THE CLOSED - LOOP NETWORK In the previous section, we were interested in uncertain networks characterized in terms of a characteristic intervalmatrix. We consider here a different approach based on the qualitative analysis of matrices in which we assume that only the sign-pattern of the characteristic matrix is known. In such a case, we are interested in formulating tractable conditions establishing whether all the characteristic matrices sharing the same sign-pattern verify the conditions of Theorem 2.4. To this aim, let us consider the set of sign symbols S := {0, ⊕, ⊖} and define a sign-matrix as a matrix with entries in S. The qualitative class Q(Σ) of a sign-matrix Σ ∈ Sm×n is defined as  Q(Σ) := M ∈ Rm×n : sgn(M ) = sgn(Σ) (18) where the signum function   1 [sgn(Σ)]ij := −1  0 sgn(·) is defined as if Σij ∈ R>0 ∪ {⊕}, if Σij ∈ R<0 ∪ {⊖}, otherwise. (19) The following result proved in [13] will turn out to be a key ingredient for deriving the main result of this section: Lemma 4.1 ( [13]): Let Σ ∈ Sd×d be a given Metzler sign-matrix. Then, the following statements are equivalent: (a) All the matrices in Q(Σ) are Hurwitz stable. (b) The matrix sgn(Σ) is Hurwitz stable. (c) The diagonal elements of Σ are negative and the directed graph GΣ = (V, E) defined with • V := {1, . . . , d} and T • E := {(m, n) : en Σem 6= 0, m, n ∈ V, m 6= n}. is an acyclic directed graph. △ We are now ready to state the main result of this section: Theorem 4.2: Let SA ∈ Sd×d be Metzler and Sb ∈ {0, ⊕}d be some given sign patterns for the characteristic matrix and the offset vector of some unimolecular reaction network (X, R). Assume that ℓ 6= 1 and that the state-space of the closed-loop reaction network ((X, Z), R ∪ Rc ) is irreducible. Then, the following statements are equivalent: (a) All the matrices in Q(SA ) are Hurwitz stable and, for all A ∈ Q(SA ), there exists a vector w ∈ Rd≥0 such that w1 > 0 and wT A + eTℓ = 0. (b) The diagonal elements of SA are negative and the directed graph GSA is acyclic and contains a path from node 1 to node ℓ. (c) There exist vectors v1 ∈ Rd>0 , v2 , v3 ∈ Rd≥0 , ||v2 + v3 ||1 = 1, such that the conditions v1T sgn(SA ) < 0 (20) and v2 − sgn(sgn(SA ) + e1 eTℓ )v3 = 0 (21) hold. Moreover, when one of the above statements holds, then for any values for the controller rate parameters η, k > 0 and any (A, b0 ) ∈ Q(SA ) × Q(Sb ), the properties P1., P2. and P3. hold provided that µ v T b0 > T θ ceℓ v (22) where c > 0 and v ∈ Rd>0 verify v T (A + cI) ≤ 0. △ Proof: The equivalence between the statement (a) and statement (b) follows from Lemma 2.3 and Lemma 4.1. Hence, we simply have to prove the equivalence between statement (c) and statement (b). The equivalence between the Hurwitz-stability of sgn(SA ) and all the matrices in Q(SA ) directly follows from Lemma 4.1. Note that if GSA has a cycle, then there exists at least an unstable matrix in Q(SA ). Let us assume then for the rest of the proof that there is no cycle in GSA and let us focus now on the statement equivalent to the output controllability condition. From Lemma 4.1, we know that since all the matrices in Q(SA ) are Hurwitz stable, then the graph GSA is an acyclic directed graph and SA has negative diagonal entries. From Lemma 2.3, we know that the network is output controllable if and only if there is a path from node 1 to node ℓ in the graph GA . To algebraically formulate this, we introduce the sign matrix SC ∈ Sd×d for which the associated graph GSC := (V, E ∪ (ℓ, 1)), where ℓ 6= 1 by assumption, consists of the original graph to which we add an edge from node ℓ to node 1. Note that if (ℓ, 1) ∈ E, then SA = SC . The output controllability condition then equivalently turns into the existence of a cycle in the graph GSC (recall the no cycle assumption for GSA as, otherwise, some matrices in Q(SA ) would not be Hurwitz stable). Considering again Lemma 2.3, we can turn the existence condition of a cycle in GSC into an instability condition for some of the matrices in Q(SC ). Since SC is a Metzler signmatrix, then there exist some unstable matrices in Q(SC ) if and only if v T sgn(SC ) ≮ 0 for all v > 0. Using Farkas’ lemma [15], this is equivalent to saying that there exist v2 , v3 ∈ Rd≥0 , ||v2 +v3 ||1 = 1 such that v2 −sgn(SC )v3 = 0. Therefore, the existence of v2 , v3 verifying the conditions above is equivalent to saying that for all A ∈ Q(SA ), there exists a w ≥ 0, w1 > 0, such that wT A + eTℓ = 0. Noting, finally, that sgn(SC ) = sgn(sgn(SA ) + eℓ eT1 ) yields the result. Remark 4.3: In the case ℓ = 1, the output controllability condition is trivially satisfied as the actuated species coincides with the controlled species and hence we only need to check the Hurwitz stability condition v T sgn(SA ) < 0 for some v ∈ Rd>0 . As in the nominal and robust cases, the above result can also be naturally reformulated as the linear feasibility problem: Find s.t. v1 ∈ Rd>0 , v2 , v3 ∈ Rd≥0 v1T sgn(A) < 0 1Td (v2 + v3 ) = 1 v2 − sgn(sgn(SA ) + e1 eTℓ )v3 = 0 (23) where 1d the d-dimensional vector of ones. The computational complexity of this program is slightly higher (i.e. 3d variables, 4d inequality constraints and 2d + 1 equality constraints) but is still linear in d and, therefore, this program will remain tractable even when d is large. V. E XAMPLE We propose to illustrate the results by considering a variation of the stochastic switch [9] described by the set of reactions given in Table I, where the functions f1 and f2 are valid nonnegative functions (e.g. mass-action or Hilltype). Our goal is to control the mean population of X2 by actuating X1 . We further assume that α1 , α2 , γ1 , γ2 > 0, which implies that the state-space of the open-loop network is irreducible. Scenario 1. In this scenario, we simply assume that f1 and f2 are bounded functions with respective upper-bounds β1 > 0 and β2 > 0. Then, using the results in [11], the ergodicity of the network in Table I can be established by checking the ergodicity of a comparison network obtained by substituting the functions f1 and f2 by their upper-bound. In the current case, the comparison network coincides with a unimolecular network with mass-action kinetics defined with     −γ1 0 α + β1 A= and b0 = 1 . (24) k12 −γ2 α2 + β2 It is immediate to see that the characteristic matrix is Hurwitz stable and that the system is output controllable provided that k12 6= 0 since eT2 A−1 e1 = −k12 /(γ1 γ2 ) (see Lemma 2.3). Hence, tracking is achieved provided that the lower bound condition (8) in Theorem 2.4 is satisfied. Moreover, we can see that for any α1 , α2 , β1 , β2 , γ1 , γ2 , k12 > 0, we have that A ∈ Q(SA ) and b0 ∈ Q(Sb ) where     ⊖ 0 ⊕ SA = and Sb = . (25) ⊕ ⊖ ⊕ All the matrices in Q(SA ) are Hurwitz stable since the matrix sgn(SA ) is Hurwitz stable or, equivalently, since the graph associated with SA given by GSA = {(1, 2)} is acyclic (Lemma 4.1). Moreover, this graph trivially contains a path from node 1 to node 2, proving then that tracking will be ensured by the AIC motif provided that the inequality (22) is satisfied (Theorem 4.2). Alternatively, we can prove this by augmenting the graph GSA with the edge {(2, 1)} (see the proof of Theorem 4.2) to obtain the graph GSC with associated sign matrix   ⊖ ⊕ SC = , (26) ⊕ ⊖ which is not sign-stable since the matrix sgn(SC ) has an eigenvalue located at 0 or, equivalently, since the graph GSC has a cycle (Lemma 4.1). To arrive to the same result, we can also check that the vectors v1 = (2, 1), v2 = (0, 0) and v3 = (1/2, 1/2) solve the linear program (23). Scenario 2. We slightly modify here the previous scenario by making the function f1 affine in X2 , i.e. f1 (X2 ) = k21 X2 + δ1 , k21 , δ1 ≥ 0. It is immediate to see that the structural result fails as the resulting characteristic matrix has the same sign pattern as the matrix SC . Hence, the network is not structurally ergodic but it can be robustly ergodic. To illustrate this, we define the following intervals − for the parameters γ1 ∈ [1, 2], γ2 ∈ [3, 4], k12 ∈ [k12 , 2] and + − + k21 = [0, k21 ], where 0 ≤ k12 ≤ 2 and k21 ≥ 0. Hence, we have that    + −2 0 −1 k21 − + = A ≤ A ≤ A = . (27) − k12 −4 2 −3 The stability of all the matrices A in this interval is established through the stability of A+ (Lemma 3.1), which + holds provided that k21 < 2/3. This can also be checked by + T verifying that v A < 0 for v = (5, k21 + 1) under the very + same condition on k21 . Regarding the output controllability, we need to consider the matrix A− (Theorem 3.2) and − observe that if k21 = 0 then output controllability does not hold as there is no path from node 1 to node 2 in the graph (Lemma 2.3). Alternatively, we can check that, in this case, eT2 (A− )−1 e1 = 0 (Theorem 3.2) or that the linear − program (17) is not feasible. To conclude, when k21 > 0 and + k21 < 2/3, then the linear program (17) is feasible with the + − vectors v = (5, k21 + 1) and w = (k12 /8, 1/4), proving then that, in this case, the AIC motif will ensure robust tracking for the controlled network provided that the condition (13) is satisfied. Finally, admissible ratios µ/θ can be chosen such that the conditions (13) and (14) are verified. TABLE I M ODIFIED STOCHASTIC SWITCH OF [9] R1 R2 R3 R4 Reaction ∅ −−−→ X1 X1 −−−→ ∅ ∅ −−−→ X2 X2 −−−→ ∅ Propensity α1 + f1 (X2 ) γ1 X1 α2 + f2 (X1 ) + k12 X1 γ2 X2 VI. C ONCLUSION Two extensions of the nominal result (Theorem 2.4) initially proposed in [1] have been obtained. Even if the interval and structural representations for the characteristic matrix of the network are not be necessarily exact, the resulting conditions can be exactly cast as scalable linear programs that remain applicable to networks involving a large number of distinct molecular species. A straightforward extension would be concerned with the use of mixed matrices (see e.g. [13]), which contain both interval and sign entries, in order to overcome the topological restrictions on the graph of the network imposed by structural analysis. In this case, scalable linear programming conditions can also be obtained using similar ideas. The example section demonstrates that the method is also applicable on networks with non mass-action kinetics. However, its extension to bimolecular networks is more difficult but might be possible by merging the results obtained in [1], [13] together. In this case, however, the problem will likely become NP-Hard (of complexity O(2d )), but will remain applicable to networks of reasonable size. Finally, methods capturing more explicitly the exact parametric dependency, such as those in [16], [17], can also be considered but will necessarily lead to more complex computational problems. Their development is left for future research. R EFERENCES [1] C. Briat, A. Gupta, and M. Khammash, “Antithetic integral feedback ensures robust perfect adaptation in noisy biomolecular networks,” Cell Systems, vol. 2, pp. 17–28, 2016. [2] L. Banci, Ed., Metallomics and the cell. Dordrecht: Springer, 2013. [3] J. M. Berg, J. L. Tymoczko, G. J. Gatto, Jr., , and L. Stryer, Biochemistry (8th edition). New York: W. H. Freeman, 2015. [4] U. Alon, “Network motifs: theory and experimental approaches,” Nature Review Genetics, vol. 8, pp. 450–461, 2007. [5] W. Ma, A. Trusina, H. El-Samad, W. A. Lim, and C. Tang, “Defining network topologies that can achieve biochemical adaptation,” Cell, vol. 138, pp. 760–773, 2009. [6] J. E. Ferrell, Jr., “Perfect and near-perfect adaptation,” Cell Systems, vol. 2(2), pp. 62—67, 2016. [7] T.-M. Yi, Y. Huang, M. I. Simon, and J. Doyle, “Robust perfect adaptation in bacterial chemotaxis through integral feedback control,” Proceedings of the National Academy of Sciences, vol. 97(9), pp. 4649–4653, 2000. [8] C. Briat, C. Zechner, and M. Khammash, “Design of a synthetic integral feedback circuit: dynamic analysis and DNA implementation,” ACS Synthetic Biology (in press), 2016. [9] T. Tian and K. Burrage, “Stochastic models for regulatory networks of the genetic toggle switch,” Proc. Natl. Acad. Sci., vol. 103(22), pp. 8372–8377, 2006. [10] J. M. G. Vilar, H. Y. Kueh, N. Barkai, and S. Leibler, “Mechanisms of noise-resistance in genetic oscillator,” Proc. Natl. Acad. Sci., vol. 99(9), pp. 5988–5992, 2002. [11] A. Gupta, C. Briat, and M. Khammash, “A scalable computational framework for establishing long-term behavior of stochastic reaction networks,” PLOS Computational Biology, vol. 10(6), p. e1003669, 2014. [12] A. Gupta and M. Khammash, “Determining the long-term behavior of cell populations: A new procedure for detecting ergodicity in large stochastic reactionnetworks,” in 19th IFAC World Congress, Cape Town, South Africa, 2014, pp. 1711–1716. [13] C. Briat and M. Khammash, “Structural properties of Metzler matrices and their applications.” [Online]. Available: http://arxiv.org/abs/1512.07043 [14] A. Berman and R. J. Plemmons, Nonnegative matrices in the mathematical sciences. Philadelphia, USA: SIAM, 1994. [15] S. Boyd and L. Vandenberghe, Convex Optimization. Cambridge, MA, USA: Cambridge University Press, 2004. [16] C. Briat, “Robust stability and stabilization of uncertain linear positive systems via integral linear constraints - L1 - and L∞ -gains characterizations,” International Journal of Robust and Nonlinear Control, vol. 23(17), pp. 1932–1954, 2013. [17] F. Blanchini, P. Colaneri, and M. E. Valcher, “Switched positive linear systems,” Foundations and Trends in Systems and Control, vol. 2(2-3), pp. 101–273, 2015.
3cs.SY
Minimax Rate-optimal Estimation of High-dimensional arXiv:1605.04358v1 [stat.ME] 14 May 2016 Covariance Matrices with Incomplete Data ∗ T. Tony Cai and Anru Zhang Abstract Missing data occur frequently in a wide range of applications. In this paper, we consider estimation of high-dimensional covariance matrices in the presence of missing observations under a general missing completely at random model in the sense that the missingness is not dependent on the values of the data. Based on incomplete data, estimators for bandable and sparse covariance matrices are proposed and their theoretical and numerical properties are investigated. Minimax rates of convergence are established under the spectral norm loss and the proposed estimators are shown to be rate-optimal under mild regularity conditions. Simulation studies demonstrate that the estimators perform well numerically. The methods are also illustrated through an application to data from four ovarian cancer studies. The key technical tools developed in this paper are of independent interest and potentially useful for a range of related problems in high-dimensional statistical inference with missing data. ∗ T. Tony Cai is Dorothy Silberberg Professor of Statistics, Department of Statistics, The Wharton School, University of Pennsylvania, Philadelphia, PA (E-mail: [email protected]); Anru Zhang is Assistant Professor, University of Wisconsin-Madison, Madison, WI (E-mail: [email protected]). The research of Tony Cai and Anru Zhang was supported in part by NSF Grant DMS-1208982 and DMS-1403708, and NIH Grant R01 CA127334. 1 Keywords: Adaptive thresholding, bandable covariance matrix, generalized sample covariance matrix, missing data, optimal rate of convergence, sparse covariance matrix, thresholding. 1 Introduction The problem of missing data arises frequently in a wide range of fields, including biomedical studies, social science, engineering, economics, and computer science. Statistical inference in the presence of missing observations has been well studied in classical statistics. See, e.g., Ibrahim and Molenberghs [18] for a review of missing data methods in longitudinal studies and Schafer [26] for literature on handling multivariate data with missing observations. See Little and Rubin [20] and the references therein for a comprehensive treatment of missing data problems. Missing data also occurs in contemporary high-dimensional inference problems, whose dimension p can be comparable to or even much larger than the sample size n. For example, in large-scale genome-wide association studies (GWAS), it is common for many subjects to have missing values on some genetic markers due to various reasons, including insufficient resolution, image corruption, and experimental error during the laboratory process. Also, different studies may have different volumes of genomic data available by design. For instance, the four genomic ovarian cancer studies discussed in Section 4 have throughput measurements of mRNA gene expression levels, but only one of these also has microRNA measurements (Cancer Genome Atlas Research Network [11], Bonome et al. [4], Tothill et al. [27] and Dressman et al. [15]). Discarding samples with any missingness is highly inefficient and could induce bias due to non-random missingness. It is of significant interest to integrate multiple high-throughput studies of the same disease, not only to boost statistical power but also to improve the biological interpretability. However, considerable challenges arise when integrating such studies due to missing data. Although there have been significant recent efforts to develop methodologies and theories 2 for high dimensional data analysis, there is a paucity of methods with theoretical guarantees for statistical inference with missing data in the high-dimensional setting. Under the assumption that the components are missing uniformly and completely at random (MUCR), Loh and Wainwright [21] proposed a non-convex optimization approach to high-dimensional linear regression, Lounici [23] introduced a method for estimating a low-rank covariance matrix and Lounici [22] considered sparse principal component analysis. In these papers, theoretical properties of the procedures were analyzed. These methods and theoretical results critically depend on the MUCR assumption. Covariance structures play a fundamental role in high-dimensional statistics. It is of direct interest in a wide range of applications including genomic data analysis, particularly for hypothesis generation. Knowledge of the covariance structure is critical to many statistical methods, including discriminant analysis, principal component analysis, clustering analysis, and regression analysis. In the high-dimensional setting with complete data, inference on the covariance structure has been actively studied in recent years. See Cai, Ren and Zhou [7] for a survey of recent results on minimax and adaptive estimation of high-dimensional covariance and precision matrices under various structural assumptions. Estimation of high-dimensional covariance matrices in the presence of missing data also has wide applications in biomedical studies, particularly in integrative genomic analysis which holds great potential in providing a global view of genome function (see Hawkins et al. [17]). In this paper, we consider estimation of high-dimensional covariance matrices in the presence of missing observations under a general missing completely at random (MCR) model in the sense that the missingness is not dependent on the values of the data. Let X1 , . . . , Xn be n independent copies of a p dimensional random vector X with mean µ and covariance matrix Σ. Instead of observing the complete sample {X1 , . . . , Xn }, one observes the sample with missing values, where the observed coordinates of Xk are indicated by a vector Sk ∈ {0, 1}p , k = 1, ..., n. That is, Xjk is observed if Sjk = 1 and Xjk is missing if Sjk = 0. 3 (1) Here Xjk and Sjk are respectively the jth coordinate of the vectors Xk and Sk . We denote the incomplete sample with missing values by X∗ = {X∗1 , . . . , X∗n }. The major goal of the present paper is to estimate Σ, the covariance matrix of X, with theoretical guarantees based on the incomplete data X∗ in the high-dimensional setting where p can be much larger than n. This paper focuses on estimation of high-dimensional bandable covariance matrices and sparse covariance matrices in the presence of missing data. These two classes of covariance matrices arise frequently in many applications, including genomics, econometrics, signal processing, temporal and spatial data analyses, and chemometrics. Estimation of these highdimensional structured covariance matrices have been well studied in the setting of complete data in a number of recent papers, e.g., Bickel and Levina [2, 3], Karoui [16], Rothman et al. [24], Cai and Zhou [10], Cai and Liu [5], Cai et al. [6, 9] and Cai and Yuan [8]. Given an incomplete sample X∗ with missing values, we introduced a “generalized” sample covariance matrix, which can be viewed as an analog of the usual sample covariance matrix in the case of complete data. For estimation of bandable covariance matrices, where the entries of the matrix decay as they move away from the diagonal, a blockwise tridiagonal estimator is introduced and is shown to be rate-optimal. We then consider estimation of sparse covariance matrices. An adaptive thresholding estimator based on the generalized sample covariance matrix is proposed. The estimator is shown to achieve the optimal rate of convergence over a large class of approximately sparse covariance matrices under mild conditions. The technical analysis for the case of missing data is much more challenging than that for the complete data, although some of the basic ideas are similar. To facilitate the theoretical analysis of the proposed estimators, we establish two key technical results, first, a large deviation result for a sub-matrix of the generalized sample covariance matrix and second, a large deviation bound for the self-normalized entries of the generalized sample covariance matrix. These technical tools are not only important for the present paper, but also useful for other related problems in high-dimensional statistical inference with missing data. A simulation study is carried out to examine the numerical performance of the proposed 4 estimation procedures. The results show that the proposed estimators perform well numerically. Even in the MUCR setting, our proposed procedures for estimating bandable, sparse covariance matrices, which do not rely on the information of the missingness mechanism, outperform the ones specifically designed for MUCR. The advantages are more significant under the setting of missing completely at random but not uniformly. We also illustrate our procedure with an application to data from four ovarian cancer studies that have different volumes of genomic data by design. The proposed estimators enable us to estimate the covariance matrix by integrating the data from all four studies and lead to a more accurate estimator. Such high-dimensional covariance matrix estimation with missing data is also useful for other types of data integration. See further discussions in Section 4.4. The rest of the paper is organized as follows. Section 2 considers estimation of bandable covariance matrices with incomplete data. The minimax rate of convergence is established for the spectral norm loss under regularity conditions. Section 3 focuses on estimation of highdimensional sparse covariance matrices and introduces an adaptive thresholding estimator in the presence of missing observations. Asymptotic properties of the estimator under the spectral norm loss is also studied. Numerical performance of the proposed methods is investigated in Section 4 through both simulation studies and an analysis of an ovarian cancer dataset. Section 5 discusses a few related problems. Finally the proofs of the main results are given in Section 6 and the Supplement. 2 Estimation of Bandable Covariance Matrices In this section, we consider estimation of bandable covariance matrices with incomplete data. Bandable covariance matrices, whose entries decay as they move away from the diagonal, arise frequently in temporal and spatial data analysis. See, e.g., Bickel and Levina [2] and Cai et al. [7] and the references therein. The procedure relies on a “generalized” sample covariance matrix. We begin with basic notation and definitions that will be used throughout the rest of 5 the paper. 2.1 Notation and Definitions Matrices and vectors are denoted by boldface letters. For a vector β ∈ Rp , we denote the pPp P > > q Euclidean q-norm by kβkq , i.e., kβkq = q i=1 |βi | . Let A = UDV = i λi (A)ui vi be the singular value decomposition of a matrix A ∈ Rp1 ×p2 , where D = diag{λ1 (A), . . .} with λ1 (A) ≥ · · · ≥ 0 being the singular values. For 1 ≤ q ≤ ∞, the Schatten-q norm kAkq is pP P 2 defined by kAkq = { i λqi (A)}1/q . In particular, kAk2 = i λi (A) is the Frobenius norm of A and will be denoted as kAkF ; kAk∞ = λ1 (A) is the spectral norm of A and will be simply denoted as kAk. For 1 ≤ q ≤ ∞ and A ∈ Rp1 ×p2 , we denote the operator `q norm of A by kAk`q which is defined as kAk`q = maxx∈Rp2 kAxkq /kxkq . The following are well known facts about the various norms of a matrix A = (aij ), kAk`1 = max j p1 X |aij |, kAk`2 = kAk = λ1 (A), i=1 kAk`∞ = max i p2 X |aij |, (2) j=1 and, if A is symmetric, kAk`1 = kAk`∞ ≥ kAk`2 . When R1 , R2 are two subsets of {1, . . . , p1 }, {1, . . . , p2 } respectively, we note AR1 ×R2 = (aij )i∈R1 ,j∈R2 as the sub-matrix of A with indices R1 and R2 . In addition, we simply write AR1 ×R1 as AR1 . We denote by X1 , . . . , Xn a complete random sample (without missing observations) from a p-dimensional distribution with mean µ and covariance matrix Σ. The sample mean and sample covariance matrix are defined as n 1X Xk , X̄ = n k=1 n  > 1X Σ̂ = Xk − X̄ Xk − X̄ . n k=1 (3) Now we introduce the notation related to the incomplete data with missing observations. Generally, we use the superscript “∗” to denote objects related to missing values. Let S1 , ..., Sn be the indicator vectors for the observed values (see (1)) and let X∗ = {X∗1 , . . . , X∗n } be the observed incomplete data where the observed entries are indexed by the vectors S1 , ..., Sn ∈ 6 {0, 1}p . In addition, we define n∗ij = n X Sik Sjk , 1 ≤ i, j ≤ p. (4) k=1 Here n∗ij is the number of vectors X∗k in which the ith and j th entries are both observed. For convenience, we also denote n∗min = min n∗ij . n∗i = n∗ii , (5) i,j Given a sample X∗ = {X∗1 , . . . , X∗n } with missing values, the sample mean and sample covariance matrix can no longer be calculated in the usual way. Instead, we propose the “generalized sample mean” X̄∗ defined by ∗ X̄ = (X̄i∗ )1≤i≤p with X̄i∗ n 1 X = ∗ Xik Sik , ni k=1 1 ≤ i ≤ p, (6) where Xik is the ith entry of Xk , and the “generalized sample covariance matrix” Σ̂∗ defined by Σ̂∗ = (σ̂ij∗ )1≤i,j≤p with σ̂ij∗ = n 1 X (Xik − X̄i∗ )(Xjk − X̄j∗ )Sik Sjk . n∗ij k=1 (7) As will be seen later, the generalized sample mean X̄∗ and the generalized sample covariance matrix Σ̂∗ play similar roles as those of the conventional sample mean and sample covariance matrix in inference problems, but the technical analysis can be much more involved. Some distinctions between the generalized sample covariance matrix Σ̂∗ and the usual sample covariance matrix Σ̂ are that Σ̂∗ is in general not non-negative definite, and each entry σ̂ij∗ is the average of a varying number (n∗ij ) of samples, which create additional difficulties in the technical analysis. Regarding the mechanism of missingness, the assumption we use for the theoretical analysis is missing completely at random. This is a more general setting than the one considered previously by Loh and Wainwright [21] and Lounici [22]. Assumption 2.1 (Missing Completely at Random (MCR)) S = {S1 , . . . , Sn } is not dependent on the values of X. Here S can be either deterministic or random, but independent of X. 7 We adopt Assumption 1 in Chen et al. [13] and assume that the random vector X is sub-Gaussian satisfying the following assumption. Assumption 2.2 (Sub-Gaussian Assumption) X = {X1 , . . . , Xn }. Here the columns Xk are i.i.d. and can be expressed as Xk = ΓZk + µ, k = 1, . . . , n, (8) where µ is a fixed p-dimensional mean vector, Γ ∈ Rp×q is a fixed matrix with q ≥ p so that ΓΓ> = Σ, Zk = (Z1k , . . . , Zmk )> is an m-dimensional random vector with the components mean 0, variance 1, and i.i.d. sub-Gaussian, with the exception of i.i.d. Rademacher. More 2 specifically, each Zik satisfies that EZik = 0, var(Zik ) = 1, 0 < var(Zik ) < ∞, and there exists τ > 0 such that EetZik ≤ exp(τ t2 /2) for all t > 0. Note that the exclusion of the Rademacher distribution in Assumption 2.2 is only required for estimation of sparse covariance matrices. See Remark 3.3 for further discussions. 2.2 Rate-optimal Blockwise Tridiagonal Estimator We follow Bickel [2] and Cai et al. [9] and consider estimating the covariance matrix Σ over the parameter space Uα = Uα (M0 , M ) where ( ) X Uα (M0 , M ) = Σ : max {|σij | : |i − j| > k} ≤ M k −α for all k, kΣk ≤ M0 . j (9) i Suppose we have n i.i.d. samples with missing values X∗1 , . . . , X∗n with covariance matrix Σ ∈ Uα (M0 , M ). We propose a blockwise tridiagonal estimator Σ̂bt to estimate Σ. We begin by dividing the generalized sample covariance matrix Σ̂∗ given by (7) into blocks of size k×k for some k. More specifically, pick an integer k and let N = dp/ke. Set Ij = {(j − 1)k + 1, . . . , jk} for 1 ≤ j ≤ N − 1, and IN = {(N − 1)k + 1, . . . , p}. For 1 ≤ j, j 0 ≤ N and A = (ai1 ,i2 )p×p , define AIj ×Ij0 = (ai1 ,i2 )i1 ∈Ij ,i2 ∈Ij0 8 and define the blockwise tridiagonal estimator Σ̂bt by  0  Σ̂∗ Ij ×Ij 0 , if |j − j | ≤ 1; Σ̂Ij ×Ij0 =  0, otherwise. (10) That is, Σ̂Ij ×Ij0 is estimated by its sample counterpart if and only if j and j 0 differ by at most 1. The weight matrix of the blockwise tridiagonal estimator Σ̂bt is illustrated in Figure 1. Figure 1: Weight matrix for the blockwise tridiagonal estimator. Theorem 2.1 Suppose Assumptions 2.1 and 2.2 hold. Then, conditioning on S, the blockwise tridiagonal Σ̂bt with k = (n∗min )1/(2α+1) satisfies sup EkΣ̂bt − Σk2 ≤ C(n∗min )−2α/(2α+1) + C Σ∈Uα (M,M0 ) ln p , n∗min (11) where C is a constant depending only on M , M0 , and τ from Assumption 2.2. The optimal choice of block size k depends on the unknown “smoothness parameter” α. In practice, k can be chosen by cross-validation. See Section 4.1 for further discussions. Moreover, the convergence rate in (11) is optimal as we also have the following lower bound result. 9 Proposition 2.1 For any n0 ≥ 1 such that p ≤ exp(γn0 ) for some constant γ > 0, conditioning on S we have inf Σ̂   ln p E kΣ̂ − Σk2 ≥ C(n0 )−2α/(2α+1) + C . n0 Σ∈Uα (M,M0 ) sup S:n∗min ≥n0 Remark 2.1 (Tapering and banding estimators) It should be noted that the same rate of convergence can also be attained by tapering and banding estimators with suitable choices of tapering and banding parameters. Specifically, let Σ̂tp and Σ̂bd be respectively the tapering and banded estimators proposed in Cai et al. [9] and Bickel and Levina [2] with tp ∗ Σ̂tp = Σ̂tp k = (wij σ̂ij )1≤i,j≤p bd ∗ and Σ̂bd = Σ̂bd k = (wij σ̂ij )1≤i,j≤p , (12) tp bd and wij are the weights defined as where wij tp wij   1,    = 2−     0, when |i − j| ≤ k/2, |i−j| , kh bd and wij when k/2 < |i − j| < k   1, when |i − j| ≤ k, . (13) =  0, otherwise otherwise Then the estimators Σ̂tp and Σ̂bd with k = (n∗min )1/(2α+1) attains the rate given in (11). The proof of Theorem 2.1 shares some basic ideas with that for the complete data case (See, e.g. Theorem 2 in Cai et al. [9]). However, it relies on a new key technical tool which is a large deviation result for a sub-matrix of the generalized sample covariance matrix under the spectral norm. This random matrix result for the case of missing data, stated in the following lemma, can be potentially useful for other, related high-dimensional missing data problems. The proof of Lemma 2.1, given in Section 6, is more involved than the complete data case, as in the generalized sample covariance matrix each entry, σ̂ij∗ , is the average of a varying number of samples. Lemma 2.1 Suppose Assumptions 2.1 and 2.2 hold. Let Σ̂∗ be the generalized sample covariance matrix defined in (7) and let A and B be two subsets of {1, . . . , p}. Then, conditioning 10 on S, the submatrix Σ̂∗A×B satisfies Pr  kΣ̂∗A×B − ΣA×B k ≤ x ( |A∪B| ≥1 − C · (49) exp  −cn∗min x2 x , 4 τ kΣA kkΣB k τ 2 (kΣA kkΣB k)1/2 min !) (14) for all x > 0. Here C > 0 and c > 0 are two absolute constants. 3 Estimation of Sparse Covariance Matrices In this section, we consider estimation of high-dimensional sparse covariance matrices in the presence of missing data. We introduce an adaptive thresholding estimator based on incomplete data and investigate its asymptotic properties. 3.1 Adaptive Thresholding Procedure Sparse covariance matrices arise naturally in a range of applications including genomics. Estimation of sparse covariance matrices has been considered in several recent papers in the setting of complete data (see, e.g., Bickel and Levina [3], El Karoui [16], Rothman et al. [24], Cai and Zhou [10] and Cai and Liu [5]). Estimation of a sparse covariance matrix is intrinsically a heteroscedastic problem in the sense that the variances of the entries of the sample covariance matrix can vary over a wide range. To treat the heteroscedasticity of the sample covariances, Cai and Liu [5] introduced an adaptive thresholding procedure which adapts to the variability of the individual entries of the sample covariance matrix and outperforms the universal thresholding method. The estimator is shown to be simultaneously rate optimal over collections of sparse covariance matrices. In the present setting of missing data, the usual sample covariance matrix is not available. Instead we apply the idea of adaptive thresholding to the generalized sample covariance matrix Σ̂∗ . The procedure can be described as follows. Note that Σ̂∗ defined in (7) is a nearly unbiased 11 estimate of Σ, we may write it element-wise as s θij σ̂ij∗ ≈ σij + zij , n∗ij 1 ≤ i, j ≤ p, where zi is approximately normal with mean 0 and variance 1, and θij describes the uncertainty of estimator σij∗ to σij such that θij = var {(Xi − µi )(Xj − µj ) − σij } . We can estimate θij by ∗ θ̂ij = n 1 X (Xik − X̄i∗ )(Xjk − X̄j∗ ) − σ̂ij∗ n∗ij k=1 2 Sik Sjk . (15) ∗ is a good estimate of θij . Lemma 3.1 given at the end of this section shows that θ̂ij Since the covariance matrix Σ is assumed to be sparse, it is natural to estimate Σ by ∗ ∗ . Define the according to its own variability as measured by θ̂ij individually thresholding θ̂ij thresholding level λij by s λij = δ ∗ θ̂ij ln p , n∗ij 1 ≤ i, j ≤ p, where δ is a thresholding constant which can be taken as 2. Let Tλ be a thresholding function satisfying the following conditions, (1). |Tλ (z)| ≤ cT |y| for all z, y such that |z − y| ≤ λ; (2). Tλ (z) = 0 for |z| ≤ λ; (3). |Tλ (z) − z| ≤ λ, for all z ∈ R. These conditions are met by many well-used thresholding functions, including the soft thresholding rule Tλ (z) = sgn(z)(z − λ)+ , where sgn(z) is the sign function such that sgn(z) = 1 if z > 0, sgn(z) = 0 if z = 0, and sgn(z) = −1 if z < 0, and the adaptive lasso rule Tλ (z) = z(1 − |λ/z|η )+ with η ≥ 1 (see Rothman et al. [24]). The hard thresholding function does not satisfy Condition (1), but our analysis also applies to hard thresholding under similar conditions. 12 The covariance matrix Σ is estimated by Σ̂at = (σ̂ijat )1≤i,j≤p where σ̂ijat is the thresholding estimator defined by σ̂ijat = Tλij (σ̂ij∗ ). (16) Note that here each entry σ̂ij∗ is thresholded according to its own variability. 3.2 Asymptotic Properties We now investigate the properties of the thresholding estimator Σ̂at over the following parameter space for sparse covariance matrices, ( ( ) ) p X |σ | ij H(cn,p ) = Σ = (σij ) : max min (σii σjj )1/2 , p ≤ cn,p . 1≤i≤p (ln p)/n j=1 (17) The parameter space H(cn,p ) contains a large collection of sparse covariance matrices and does not impose any constraint on the variances σii , i = 1, ..., p. The collection H(cn,p ) contains some other commonly used classes of sparse covariance matrices in the literature, including P an `q ball assumption maxi pj=1 |σij |q ≤ sn,p in Bickel and Levina [3], and a weak `q ball  q assumption max1≤j≤p σj[k] ≤ sn,p /k for each integer k in Cai and Zhou [10] where σj[k] is the kth largest entry in magnitude of the jth row (σij )1≤i≤p . See Cai et al. [7] for more discussions. We have the following result on the performance of Σ̂at over the parameter space H(cn,p ). Theorem 3.1 Suppose that δ ≥ 2, ln p = o((n∗min )1/3 ) and Assumptions 2.1 and 2.2 hold. Then, conditioning on S, there exists a constant C not depending on p, n∗min or n such that for any Σ ∈ H(cn,p ), s Pr Σ̂at − Σ ≤ Ccn,p ln p n∗min !  ≥ 1 − O (ln p)−1/2 p−δ+2 . (18) Moreover, if we further assume that p ≥ (n∗min )ξ and δ ≥ 4 + 1/ξ, we in addition have   ln p E kΣ̂at − Σk2 ≤ Cc2n,p ∗ . nmin 13 (19) Moreover, the lower bound result below shows that the rate in (19) is optimal. 1/2 Proposition 3.1 For any n0 ≥ 1 and cn,p > 0 such that cn,p ≤ M n0 (ln p)−3/2 for some constant M > 0, conditioning on S we have inf sup  2 E kΣ̂ − Σk Σ̂ Σ∈H(cn,p ) S:n∗min ≥n0  ≥ Cc2n,p ln p . n0 Remark 3.1 (`q norm loss) We focus in this paper on estimation under the spectral norm loss. The results given in Theorem 3.1 can be easily generalized to the general matrix `q norm for 1 ≤ q ≤ ∞. The results given in Equations (18) and (19) remain valid when the spectral norm is replaced by the matrix `q norm for 1 ≤ q ≤ ∞. Remark 3.2 (Positive definiteness) Under mild conditions on Σ, the estimator Σ̂at is positive definite with high probability. However, Σ̂at is not guaranteed to be positive definite for a given data set. Whenever Σ̂at is not positive semi-definite, a simple extra step can make the final estimator Σ̂at + positive definite and also rate-optimal. P Write the eigen-decomposition of Σ̂at as Σ̂at = pi=1 λ̂i v̂i v̂i> , where λ̂1 ≥ · · · ≥ λ̂p are the eigenvalues and v̂i are the corresponding eigenvectors. Define the final estimator   ln p at at Σ̂+ = Σ̂ + |λ̂p | + ∗ I{λ̂p < 0} · Ip×p , nmin where Ip×p is the p × p identity matrix. Then Σ̂at + is a positive definite matrix with the at same structure as that of Σ̂at . It is easy to show that Σ̂at attains the same rate of + and Σ̂ convergence over H(cn,p ). See Cai, Ren and Zhou [7] for further discussions. ∗ Remark 3.3 (Exclusion of the Rademacher Distribution) To guarantee that θ̂ij is a good estimate of θij , one important condition needed in the theoretical analysis is that √ θij / σii σjj is bounded from below by a positive constant. However when the components of √ Zk in (8) are i.i.d. Rademacher, it is possible that θij / σii σjj = 0. For example, If Z1 and Z2 are i.i.d. Rademacher and Xi = Z1 +Z2 and Xj = Z1 −Z2 , then var(Xi Xj ) = var(Z12 −Z22 ) = 0, √ and this implies θij / σii σjj = 0. 14 A key technical tool in the analysis of the adaptive thresholding estimator is a large deviation result for the self-normalized entries of the generalized sample covariance matrix. The following lemma, proved in Section 6, plays a critical role in the proof of Theorem 3.1 and can be useful for other high-dimensional inference problems with missing data. Lemma 3.1 Suppose ln p = o((n∗min )1/3 ) and Assumptions 2.1 and 2.2 hold. For any constants δ ≥ 2, ε > 0, M > 0, conditioning on S, we have ! s  |σ̂ij∗ − σij | ln p Pr ≥δ , ∀1 ≤ i, j ≤ p = O (ln p)−1/2 p−δ+2 , ∗ ∗ 1/2 nij (θ̂ij ) ∗ |θ̂ij − θij | Pr max ≥ε ij σii σjj (20) ! = O(p−M ). (21) In addition to optimal estimation of a sparse covariance matrix Σ under the spectral norm loss, it is also of significant interest to recover the support of Σ, i.e., the locations of the nonzero entries of Σ. The problem has been studied in the case of complete data in, e.g., Cai and Liu [5] and Rothman et al. [24]. With incomplete data, the support can be similarly recovered through adaptive thresholding. Specifically, define the support of Σ = (σij )1≤i,j≤p by supp(Σ) = {(i, j) : σij 6= 0}. Under the condition that the non-zero entries of Σ are sufficiently bounded away from zero, the adaptive thresholding estimator Σ̂at recovers the support supp(Σ) consistently. It is noteworthy that in the support recovery analysis, the sparsity assumption is not directly needed. Theorem 3.2 (Support Recovery) Suppose ln p = o((n∗min )1/3 ) and Assumptions 2.1 and 2.2 hold. Let γ be any positive constant. Suppose Σ satisfies s θij ln p , for all (i, j) ∈ supp(Σ). |σij | > (4 + γ) n∗ij (22) Let Σ̂at be the adaptive thresholding estimator with δ = 2, then, conditioning on S, we have n o Pr supp(Σ̂at ) = supp(Σ) → 1 as 15 n, p → ∞. (23) 4 Numerical Results We investigate in this section the numerical performance of the proposed estimators through simulations. The proposed adaptive thresholding procedure is also illustrated with an estimation of the covariance matrix based on data from four ovarian cancer studies. The estimators Σ̂bt and Σ̂at introduced in the previous sections all require specification of the tuning parameters (k or δ). Cross-validation is a simple and practical data-driven method for the selection of these tuning parameters. Numerical results indicate that the proposed estimators with the tuning parameter selected by cross-validation perform well empirically. We begin by introducing the following K-fold cross-validation method for the empirical selection of the tuning parameters. 4.1 Cross-validation For a pre-specified positive integer N , we construct a grid T of non-negative numbers. For  bandable covariance matrix estimation, we set T = 1, dp1/N e, . . . , dpN/N e , and for sparse covariance matrix estimation, we let T = {0, 1/N, . . . , 4N/N }. Given n samples X∗ ∈ Rp×n with missing values, for a given positive integer K, we randomly divide them into two groups of size n1 ≈ n(K − 1)/K, n2 ≈ n/K for H times. For h = 1, . . . , H, we denote by J1h and J2h ⊆ {1, . . . , n} the index sets of the two groups for the h-th split. The proposed estimator, Σ̂bt for bandable covariance matrices, or Σ̂at for sparse covariance matrices, is then applied to the first group of data X∗J h with each value of the 1 tuning parameter t ∈ T and denote the result by Σ̂bt h (t) or Σ̂at h (t) respectively. Denote the generalized sample covariance matrix of the second group of data X∗J h by Σ̂∗h and set 2 H 1 X kΣ̂h (t) − Σ̂∗h k2F , R̂(t) = H h=1 (24) where Σ̂h (t) is either Σ̂bt (t) for bandable covariance matrices, or Σ̂at (t) for sparse covariance matrices. 16 The final tuning parameter is chosen to be t∗ = arg min R̂(t) T bt and the final estimator Σ̂ at (or Σ̂ ) is calculated using this choice of the tuning parameter t∗ . In the following numerical studies, we will use 5-fold cross-validation (i.e., K = 5) to select the tuning parameters. Remark 4.1 The Frobenius norm used in (24) can be replaced by other losses such as the spectral norm. Our simulation results indicate that using the Frobenius norm in (24) works well, even when the true loss is the spectral norm loss. 4.2 Simulation Studies In the simulation studies, we consider the following two settings for the missingness. The first is MUCR where each entry Xik is observed with probability 0 < ρ ≤ 1, and the second is missing not uniformly but completely at random (MCR) where the complete data matrix X is divided into four equal-size blocks,   X(11) X(12) , X= X(21) X(22) p n X(11) , X(12) , X(21) , X(22) ∈ R 2 × 2 , and each entry of X(11) and X(22) is observed with probability ρ(1) and each entry of X(12) and X(21) is observed with probability ρ(2) , for some 0 < ρ(1) , ρ(2) ≤ 1. As mentioned in the introduction, high-dimensional inference for missing data has been studied in the case of MUCR and we would like to compare our estimators with the corresponding estimators based on a different sample covariance matrix designed for the MUCR case. Under the assumption that EX = 0 and each entry of X is observed independently with probability ρ, Wainwright [21] and Lounici [23] introduced the following substitute of the usual sample covariance matrix Σ̂• = (σij• )1≤i,j≤p with σ̂ij• =        17 1 n(1−ρ)2 Pn k=1 ∗ ∗ Xik Xjk , i 6= j (25) 1 n(1−ρ) Pn k=1 ∗ ∗ Xik Xjk , i=j where the missing entries of X∗ are replaced by 0’s. It is easy to show that Σ̂• is a consistent estimator of Σ under MUCR and could be used similarly as the sample covariance matrix in the complete data setting. For more general settings where EX 6= 0 and the coordinates X1 , X2 , ..., Xp are observed with different probabilities ρ1 , . . . , ρp , Σ̂• can be generalized as  Pn  1 ∗ ∗   n(1−ρ̂i )(1−ρ̂j ) k=1 Xik,c Xjk,c , i 6= j Σ̂• = (σ̂ij• )1≤i,j≤p with σ̂ij• =  Pn  1 ∗ ∗  i=j k=1 Xik,c Xjk,c , n(1−ρ̂i ) P ∗ ∗ where for i = 1, . . . , p and k = 1, . . . , n, ρ̂i = n1 nk=1 Sik and Xik,c = Xik − X̄i∗ . (26) Based on Σ̂• , we can analogously define the corresponding blockwise tridiagonal estimator Σ̂bt• for bandable covariance matrices, and adaptive thresholding estimator Σ̂at• for sparse covariance matrices. We first consider estimation of bandable covariance matrices and compare the proposed blockwise tridiagonal estimator Σ̂bt with the corresponding estimator Σ̂bt• . For both methods, the tuning parameter k is selected by 5-fold cross-validation with N varying from 20 to 50. The following bandable covariance matrices are considered: 1. (Linear decaying bandable model) Σ = (σij )1≤i,j≤p with σij = max{0, 1 − |i − j|/5}. 2. (Squared decaying bandable model) Σ = (σij )1≤i,j≤p with σij = (|i − j| + 1)−2 . For missingness, both MUCR and MCR are considered and (25) and (26) are used to calculate Σ̂• respectively. The proposed procedure Σ̂bt is compared with the estimator Σ̂bt• , which is based on Σ̂• . The results for the spectral norm, `1 norm and Frobenius norm losses are reported in Table 1. It is easy to see from Table 1 that the proposed estimator Σ̂bt generally outperforms Σ̂bt• , especially in the fast decaying setting. Now we consider estimation of sparse covariance matrices with missing values under the following two models. 1. (Permutation Bandable Model) Σ = (σij )1≤i,j≤p , where σij = max(0, 1−0.2·|s(i)−s(j)|) and s(i), i = 1, . . . , p is a random permutation of {1, . . . , p}. 18 Spectral norm (p, n) Σ̂bt Σ̂bt• `1 norm Σ̂bt Frobenius norm Σ̂bt• Σ̂bt Σ̂bt• Linear Decay Bandable Model, MUCR ρ = .5 (50, 50) 2.78(0.17) 2.88(0.18) 4.37(0.57) 4.57(0.76) 7.73(0.85) 7.85(0.80) (50, 200) 1.44(0.06) 1.56(0.07) 2.52(0.17) 2.71(0.19) 3.91(0.18) 4.16(0.16) (200, 100) 2.25(0.13) 2.44(0.16) 3.83(0.32) 4.22(0.46) 10.27(0.29) 10.89(0.29) (200, 200) 1.67(0.07) 1.82(0.08) 2.81(0.19) 3.08(0.22) 7.19(0.19) 7.68(0.14) (500, 200) 2.00(0.07) 2.18(0.10) 3.45(0.16) 3.74(0.27) 12.10(0.36) 12.87(0.42) Squared Decay Bandable Model, MUCR ρ = .5 (50, 50) 1.34(0.08) 1.40(0.11) 2.28(0.16) 2.37(0.21) 3.78(0.19) 3.91(0.18) (50, 200) 0.82(0.01) 0.84(0.01) 1.47(0.03) 1.49(0.02) 2.24(0.02) 2.30(0.02) (200, 100) 1.13(0.01) 1.17(0.02) 2.12(0.05) 2.18(0.07) 5.74(0.04) 5.91(0.05) (200, 200) 0.92(0.00) 0.94(0.00) 1.66(0.02) 1.72(0.03) 4.49(0.02) 4.61(0.01) (500, 200) 0.97(0.00) 0.98(0.00) 1.80(0.02) 1.86(0.02) 7.15(0.01) 7.35(0.01) Linear Decay Bandable Model, MCR ρ(1) = .8, ρ(2) = .2 (50, 50) 2.76(0.26) 3.46(1.43) 4.24(0.73) 5.87(2.91) 7.03(1.25) 8.47(1.29) (50, 200) 1.51(0.11) 2.64(0.40) 2.52(0.30) 4.29(0.99) 3.62(0.30) 5.77(0.45) (200, 100) 2.32(0.22) 3.93(0.67) 3.73(0.47) 6.21(1.11) 9.04(0.48) 13.47(0.84) (200, 200) 1.67(0.10) 3.23(0.27) 2.71(0.26) 4.91(0.49) 6.32(0.11) 11.32(0.49) (500, 200) 1.98(0.09) 3.78(0.20) 3.19(0.20) 5.70(0.42) 10.39(0.12) 18.48(0.49) Squared Decay Bandable Model, MCR ρ(1) = .8, ρ(2) = .2 (50, 50) 1.26(0.08) 1.49(0.13) 2.21(0.23) 2.60(0.28) 3.48(0.14) 4.18(0.23) (50, 200) 0.82(0.01) 0.88(0.04) 1.47(0.05) 1.77(0.11) 2.18(0.04) 2.68(0.11) (200, 100) 1.06(0.01) 1.30(0.04) 1.96(0.04) 2.44(0.07) 5.32(0.02) 6.51(0.06) (200, 200) 0.90(0.00) 0.96(0.03) 1.60(0.02) 1.99(0.06) 4.27(0.02) 5.26(0.15) (500, 200) 0.93(0.00) 1.03(0.01) 1.69(0.01) 2.11(0.03) 6.73(0.01) 8.25(0.04) Table 1: Comparsion between Σ̂bt and Σ̂bt• in different settings of bandable covariance matrix estimation. 19 2. (Randomly Sparse Model) Σ = Ip +(D+D> )/(kD+D> k+0.01), where D is randomly generated as D = (dij )1≤i,j≤p ,   1 w.p. 0.1    dij = 0 w.p. 0.8     −1 w.p. 0.1 for i 6= j; dii = 0. Similar to the sparse covariance matrix estimation, for missingness, we consider both MUCR and MCR. The results for the spectral norm, matrix `1 norm and Frobenius norm losses are summarized in Table 2. It can be seen from Table 2 that, even under the MUCR setting, the proposed estimator Σ̂at based on the generalized sample covariance matrix is uniformly better than the one based on Σ̂• . In the more general MCR setting, the difference in the performance between the two estimators is even more significant. 4.3 Comparison with Complete Samples For covariance matrix estimation with missing data, an interesting question is: what is the “effective sample size”? That is, for samples with missing values, we would like to know the equivalent size of complete samples such that the accuracy for covariance matrix estimation is approximately the same. We now compare the performance of the proposed estimator based on the incomplete data with the corresponding estimator based on the complete data for various sample sizes. We fix the dimension p = 100. For the incomplete data, we consider n = 1000 and MUCR with ρ = .5. The covariance matrix Σ is chosen as • Linear Decaying Bandable Model (in Bandable Covariance Matrix Estimation); • Permutation Bandable Model (in Sparse Covariance Matrix Estimation); Correspondingly, we consider the similar settings for the complete data with the same Σ and p, but different sample size nc , where nc can be one of the following three values, 1. n∗pair = Pn i,j=1 n∗ij /p2 : the average number of pairs of (xi , xj )’s that can be observed within the same sample; 20 Spectral norm (p, n) Σ̂at Σ̂at• `1 norm Σ̂at Frobenius norm Σ̂at• Σ̂at Σ̂at• Permutation Bandable Model, MUCR ρ = .5 (50, 50) 4.26(0.24) 4.45(0.41) 5.58(0.58) 6.19(7.54) 11.34(0.79) 11.73(1.08) (50, 200) 1.70(0.05) 1.74(0.06) 3.31(0.32) 3.42(0.38) 4.93(0.09) 5.07(0.16) (200, 100) 3.48(0.07) 3.66(0.58) 5.80(0.39) 6.23(14.89) 18.34(0.81) 19.37(5.50) (200, 200) 2.12(0.04) 2.20(0.03) 4.17(0.29) 4.44(0.32) 11.46(0.14) 11.94(0.13) (500, 200) 2.28(0.03) 3.51(0.17) 4.17(0.15) 6.55(0.72) 16.85(0.10) 21.96(0.49) Randomly Sparse Model, MUCR ρ = .5 (50, 50) 1.76(0.07) 1.96(0.62) 3.69(0.24) 4.20(5.89) 5.75(0.51) 6.27(2.95) (50, 200) 1.05(0.00) 1.06(0.00) 2.73(0.04) 2.74(0.05) 3.75(0.03) 3.77(0.04) (200, 100) 1.40(0.01) 1.45(0.01) 4.88(0.08) 4.94(0.09) 8.34(0.07) 8.50(0.07) (200, 200) 1.07(0.00) 1.09(0.01) 4.44(0.03) 4.46(0.03) 7.42(0.02) 7.43(0.02) (500, 200) 1.14(0.01) 1.31(0.01) 6.39(0.04) 6.65(0.08) 11.73(0.01) 12.23(0.05) Permutation Bandable Model, MCR ρ(1) = .8, ρ(2) = .2 (50, 50) 4.23(0.38) 4.71(1.17) 6.67(2.30) 7.46(8.92) 11.22(1.34) 11.71(2.01) (50, 200) 1.64(0.05) 2.79(0.39) 2.94(0.21) 4.52(0.95) 4.41(0.13) 6.29(0.46) (200, 100) 3.17(0.06) 4.16(0.57) 5.73(0.66) 8.11(1.87) 15.93(0.53) 18.03(0.77) (200, 200) 2.00(0.03) 3.22(0.18) 3.65(0.16) 5.70(0.60) 9.83(0.11) (500, 200) 2.22(0.03) 3.45(0.17) 4.09(0.17) 6.44(0.96) 16.80(0.14) 21.93(0.45) 13.29(0.55) Randomly Sparse Model, MCR ρ(1) = .8, ρ(2) = .2 (50, 50) 2.15(0.46) 2.19(0.49) 4.21(0.94) 4.47(4.65) 6.36(0.96) 7.25(1.57) (50, 200) 1.09(0.02) 1.16(0.04) 2.82(0.19) 2.99(0.32) 3.83(0.10) 4.00(0.20) (200, 100) 1.46(0.02) 1.82(0.03) 4.96(0.12) 5.61(0.21) 8.45(0.07) 10.10(0.14) (200, 200) 1.08(0.00) 1.20(0.01) 4.46(0.04) 4.57(0.05) 7.43(0.02) 7.66(0.04) (500, 200) 1.12(0.01) 1.33(0.01) 6.35(0.04) 6.60(0.07) 11.71(0.02) 12.20(0.06) Table 2: Comparsion between Σ̂at and Σ̂at• in different settings of sparse covariance matrix estimation. 21 Setting sample size Spectral norm `1 norm Frobenius norm Bandable Covariance Matrix Estimation Missing Data n = 1000 0.72(0.01) 1.25(0.03) 2.40(0.01) Complete Data nc = n∗pair 0.97(0.03) 1.49(0.05) 2.48(0.04) Complete Data nc = n∗s 0.65(0.01) 1.01(0.03) 1.69(0.03) Complete Data nc = n 0.48(0.01) 0.73(0.01) 1.22(0.01) Sparse Covariance Matrix Estimation Missing Data n = 1000 0.75(0.01) 1.37(0.04) 2.90(0.02) Complete Data nc = n∗pair 0.83(0.02) 1.31(0.05) 2.94(0.04) Complete Data nc = n∗s 0.65(0.01) 1.01(0.03) 1.86(0.04) Complete Data nc = n 0.45(0.01) 0.64(0.01) 1.12(0.01) Table 3: Comparison between incomplete samples and complete samples. 2. n∗s = Pn i=1 n∗i /p: the average number of single xi ’s can be observed; 3. n: the same number of samples with the missing values. The results for all the settings are summarized in Table 3. It can be seen that the equivalent sample size depends on the loss function and in general it is between n∗pair and n∗s . Overall, the average risk under the missing data setting is most comparable to that under the complete data setting for the sample size of nc = n∗pair , the average number of observed pairs. 4.4 Analysis of Ovarian Cancer Data In this section, we illustrate the proposed adaptive thresholding procedure with an application to data from four ovarian cancer genomic studies, Cancer Genome Atlas Research Network [11] (TCGA), Bonome et al. [4] (BONO), Dressman et al. [15] (DRES) and Tothill et al. [27] (TOTH). The method introduced in Sections 3 enables us to estimate the covariance matrix by integrating data from all four studies and thus yields a more accurate estimator. The 22 data structure is illustrated in Figure 2. The gene expression markers (the first 426 rows) are observed in all four studies without any missingness (the top black block in Figure 2). The miRNA expression markers are observed in 552 samples from the TCGA study (the bottom left block in Figure 2) and completely missing in the 881 samples from the TOTH, DRES, BONO and part of TCGA studies (the white block in Figure 2). n1=552 n – n1=881 Gene Expression Markers p1=426 miRNA Expression Markers p-p1=799 Figure 2: Illustration of the ovarian cancer dataset. Black block = completely observed; White block = completely missing. Our goal is to estimate the covariance matrix Σ of the 1225 variables with the particular interest in the cross-covariances between the gene and miRNA expression markers. It is clear that the missingness here is not uniformly at random. On the other hand, it is reasonable to assume the missingness does not depend on the value of the data and thus missing completely at random (Assumption 2.1) can be assumed. We apply the adaptive thresholding procedure with δ = 2 to estimate the covariance matrix and recover its support based on all the observations. The support of the estimate is shown in a heatmap in Figure 3. The left panel is for the whole covariance matrix and the right panel zooms into the cross-covariances between the gene and miRNA expression markers. It can be seen from Figure 3 that the two diagonal blocks, with 12.24% and 8.39% nonzero off-diagonal entries respectively, are relatively dense, indicating that the relationships among 23 0 0 200 400 300 600 400 500 800 600 1000 miRNA Expression Markers 100 200 700 0 200 400 600 800 1000 1200 1200 0 100 200 300 400 Gene Expression Markers (a) Covariance matrix of the gene and miRNA (b) Cross-covariances between the gene expression markers. and miRNA expression markers. The gene expression markers are marked with lines. 1294 (.38%) gene-miRNA pairs were detected. Figure 3: Heatmaps of the covariance matrix estimate with all the observed data. the gene expression markers and those among the miRNA expression markers, as measured by their covariances, are relatively close. In contrast, the cross-covariances between gene and miRNA expression markers are very sparse with only 0.38% of significant gene-miRNA pairs. The gene and miRNA expression markers affect each other through different mechanisms, the cross-covariances between the gene and miRNA markers are of significant interest (see Ko et al. [19]). It is worthwhile to take a closer look at the cross-covariance matrix displayed on the right panel in Figure 3. For each given gene, we count the number of miRNAs whose covariances with this gene are significant, and then rank all the genes by the counts. Similarly, we rank all the miRNAs. The top 5 genes and the top 5 miRNA expression markers are shown in Table 4.4. Many of these gene and miRNA expression markers have been studied before in the literature. For example, the miRNA expression markers hsa-miR-142-5p and hsa-miR-142-3p have been demonstrated in Andreopoulos and Anastassiou [1] as standing out among the miRNA 24 Gene Expression Marker Counts miRNA Expression Marker Counts ACTA2 61 hsa-miR-142-5p 31 INHBA 57 hsa-miR-142-3p 29 COL10A1 53 hsa-miR-22 26 BGN 46 hsa-miR-21* 24 NID1 41 hsa-miR-146a 21 Table 4: Genes and miRNA’s with most selected pairs markers as having higher correlations with more genes, as well as methylation sites. Carraro et al. [12] finds that inhibition of miR-142-3p leads to ectopic expression of the gene marker ACTA2. This indicates strong interaction between miR-142-3p and ACTA2. To further demonstrate the robustness of our proposed procedure against missingness, we consider a setting with additional missing observations. We first randomly select half of the 552 complete samples (where both gene and miRNA expression markers are observed) and half of the 881 incomplete samples (where only gene expression markers are observed), and then independently mask each entry of the selected samples with probability 0.05. The proposed adaptive thresholding procedure is then applied to the data with these additional missing values. The estimated covariance matrix is shown in heatmaps in Figure 4. These additional missing observations do not significantly affect the estimation accuracy. Figure 4 is visually very similar to Figure 3. To quantify the similarity between the two estimates, we calculate the Matthews correlation coefficient (MCC) between them. The value of MCC is equal to 0.9441, which indicates that the estimate based on the data with the additional missingness is very close to the estimate based on the original samples. We also pay close attention to the cross-covariance matrix displayed on the right panel in Figure 4 and rank the gene and miRNA expression markers in the same way as before. The top 5 genes and the top 5 miRNA expression markers, listed in Table 5, are nearly identical to those given in Table 4.4, which are based on the original samples. These results indicate that the proposed method is robust 25 against additional missingness. 0 0 200 400 300 600 400 500 800 600 1000 miRNA Expression Markers 100 200 700 0 200 400 600 800 1000 1200 1200 0 100 200 300 400 Gene Expression Markers (a) Covariance matrix of the gene and miRNA (b) Cross-covariances between the gene expression markers. and miRNA expression markers. The gene expression markers are marked with lines. 1176 (.35%) gene-miRNA pairs were detected. Figure 4: Heatmaps of the covariance matrix estimate with additional missing values. 5 Discussions We considered in the present paper estimation of bandable and sparse covariance matrices in the presence of missing observations. The pivotal quantity is the generalized sample covariance matrix defined in (7). The technical analysis is more challenging due to the missing data. We have mainly focused on the spectral norm loss in the theoretical analysis. Performance under other losses such as the Frobenius norm can also be analyzed. To illustrate the proposed methods, we integrated four ovarian cancer studies. These methods for high-dimensional covariance matrix estimation with missing data are also useful for other types of data integration. For example, linking multiple data sources such as electronic data records, medicare data, registry data and patient reported outcomes could greatly 26 Gene Expression Marker Counts miRNA Expression Marker Counts ACTA2 60 hsa-miR-142-3p 31 INHBA 56 hsa-miR-142-5p 30 COL10A1 50 hsa-miR-146a 21 BGN 43 hsa-miR-150 21 NID1 40 hsa-miR-21* 21 Table 5: Genes and miRNA’s with most selected pairs after masking increase the power of exploratory studies such as phenome-wide association studies (Denny et al. [14]). However, missing data inevitably arises and may hinder the potential of integrative analysis. In addition to random missingness due to unavailable information on a small fraction of patients, many variables such as the genetic measurements may only exist in one or two data sources and are hence structurally missing for other data sources. Our proposed methods could potentially provide accurate recovery of the covariance matrix in the presence of missingness. In this paper, we allowed the proportion of missing values to be non-negligible as long as the minimum number of occurrences of any pair of variables n∗min is of order n. An interesting question is what happens when the number of observed values is large but n∗min is small (or even zero). We believe that the covariance matrix Σ can still be well estimated under certain global structural assumptions. This is out of the scope of the present paper and is an interesting problem for future research. The key ideas and techniques developed in this paper can be used for a range of other related problems in high-dimensional statistical inference with missing data. For example, the same techniques can also be applied to estimation of other structured covariance matrices such as Toeplitz matrices, which have been studied in the literature in the case of complete data. When there are missing data, we can construct similar estimators using the generalized sample covariance matrix. The large deviation bounds for a sub-matrix and self-normalized 27 entries of the generalized sample covariance matrix developed in Lemmas 3.1 and 2.1 would be helpful for analyzing the properties of the estimators. The techniques can also be used on two-sample problems such as estimation of differential correlation matrices and hypothesis testing on the covariance structures. The generalized sample covariance matrix can be standardized to form the generalized sample correlation matrix which can then be used to estimate the differential correlation matrix in the two-sample case. It is also of significant interest in some applications to test the covariance structures in both one- and two-sample settings based on incomplete data. In the one-sample case, it is of interest to test the hypothesis {H0 : Σ = I} or {H0 : R = I}, where R is the correlation matrix. In the two-sample case, one wishes to test the equality of two covariance matrices {H0 : Σ1 = Σ2 }. These are interesting problems for further exploration in the future. 6 Proofs We prove Theorem 2.1 and the key technical result Lemma 6.1 for the bandable covariance matrix estimation in this section. 6.1 Proof of Lemma 2.1 To prove this lemma, we first introduce the following technical tool for the spectral norm of the sub-matrices. Lemma 6.1 Suppose Σ ∈ Rp×p is any positive semi-definite matrix, A, B ∈ {1, . . . , p}, then kΣA×B k ≤ (kΣA kkΣB k)1/2 . (27) The proof of Lemma 6.1 is provided later and now we move back to the proof of Lemma 2.1. Without loss of generality, we assume that µ = EX = 0. We further define Σ̆∗ = (σ̆ij∗ )1≤i,j≤p , σ̆ij∗ = 28 n 1 X Xik Xjk Sik Sjk . n∗ij k=1 (28) Also for convenience of presentation, we use C, C1 , c, . . . to denote uniform constants, whose exact values may vary in different senarios. The lemma is now proved in the following steps: 1. We first consider for fixed unit vectors a, b ∈ Rp with supp(a) ⊆ A, supp(b) ⊆ B, the tail bound of a> (Σ̂∗ − Σ)b. We would like to show that there exist uniform constants C1 , c > 0 such that for all x > 0,   o a> Σ̂∗ − Σ b ≥ x    x x2 ∗ , ≤C1 exp −cnmin min . τ 4 kΣA kkΣB k τ 2 (kΣA kkΣB k)1/2 Pr n (29) Specifically, we will bound a> (Σ̆∗ − Σ̂)b and a> (Σ̆∗ − Σ)b separately in the next two steps. 2. We consider a> (Σ̆∗ − Σ̂)b first. Since σ̆ij∗ − σ̂ij∗ n 1 X (Xjk X̄i∗ + Xik X̄j∗ )Sik Sjk − X̄i∗ X̄j∗ , = ∗ nij k=1 a> (Σ̆∗ − Σ̂∗ )b can be written as > ∗ ∗ a (Σ̆ − Σ̂ )b = p X ai bj (σ̆ij∗ − σ̂ij∗ ) i,j=1 p Pn Pn Xik Sik Xjl Sil Sjl = ai b j · l=1 ∗ ∗ ni nij i,j=1 ! Pn Pn Pn Pn X S S X S X S X S jl jl ik ik jl jl ik ik jk · l=1 ∗ − k=1 ∗ · l=1 ∗ + k=1 ∗ nij nj ni nj   p n X X Sik Sil Sjl Sik Sjk Sjl Sik Sjl = Xik Xjl ai bj + − ∗ ∗ . ∗ ∗ ∗ ∗ n n n n ni nj i ij ij j i,j=1 k,l=1 X k=1 29 (30) We can calculate from (30) that Ea> (Σ̆∗ − Σ̂∗ )b   p n X X Sik Sik Sjk Sik Sjk Sjk Sik Sjk = + − ∗ ∗ σij ai bj ∗ ∗ ∗ ∗ n n n n ni nj i ij ij j i,j=1 k=1 p X p p n X X X ai bj Sik ai Sjk bj σij ∗ bj + = ai ∗ σij − σij ni nj n∗i n∗j i,j=1 i,j=1 k=1 i,j=1    > a1 ap b1 bp > ≤ , . . . , ∗ Σb + a Σ ,..., ∗ n∗1 np n∗1 np   >  n X Spk ap S1k b1 Spk bp S1k a1 + ,..., Σ ,..., ∗ ∗ ∗ ∗ n n n np 1 1 p k=1 kak2 kbk2 kak2 kbk2 + kΣA×B k ∗ nmin n∗min (   n X 1 S1k a1 Spk ap kΣA×B k · + ,..., ∗ 2 n n∗p 1 k=1 (31) ≤kΣA×B k 2  + 2 S1k b1 Spk bp ,..., ∗ ∗ n1 np  2) . 2 For the last term in (31), we have the following bound, (   2   2) n X S1k b1 S1k a1 Spk ap Spk bp 1 ,..., + ,..., ∗ kΣA×B k · ∗ ∗ ∗ 2 n n n np 1 1 p 2 2 k=1   p n X X 1 Sik a2 Sik b2 i =kΣA×B k + ∗2i ∗2 2 n ni i k=1 i=1   p X 1 a2i + b2i =kΣA×B k 2 n∗i i=1 ≤kΣA×B k p X a2 + b 2 i i=1 i 2n∗min ≤ (kΣA kkΣB k)1/2 . n∗min Thus, by (31) and the inequality above, we have Ea> (Σ̆∗ − Σ̂∗ )b ≤ 3(kΣA kkΣB k)1/2 . n∗min (32) The last term of (30) can be treated as a quadratic form of the vectorization of X : vec(X) ∈ Rpn . We note the last term as vec(X)> Qvec(X), where Q ∈ Rpn×pn and   Sik Sil Sjl Sik Sjk Sjl Sik Sjl Q(i,k),(j,l) = ai bj + − ∗ ∗ , 1 ≤ i, j ≤ p, 1 ≤ k, l ≤ n. n∗i n∗ij n∗ij n∗j ni nj 30 Q has the following properties, kQk2F = p n X X a2i b2j  Sik Sil Sjl Sik Sjk Sjl Sik Sjl + − ∗ ∗ n∗i n∗ij n∗ij n∗j ni nj i,j=1 k,l=1 p n  X X Sik Sil Sjl 2 2 2 ∗2 ∗2 + ≤ ai b j ni nij i,j=1 k,l=1 p X 5kak22 kbk22 5 a2i b2j ∗2 = ≤ nmin n∗2 min i,j=1 2 Sik Sjk Sjl Sik Sjl 2 ∗2 ∗2 + ∗2 ∗2 nij nj ni nj = 5 n∗2 min √ kQk ≤ kQkF ≤  , since Sik ∈ {0, 1}; (33) ; √ 5kak2 kbk2 5 ≤ ∗ . ∗ nmin nmin (34) For vec(X) ∈ Rpn , since its segments {Xk , k = 1, . . . , p} are independent and Xk = ΓZk , we can further write vec(X) = DΓ vec(Z), where DΓ ∈ Rpn×qn is with n diagonal blocks of Γ, vec(Z) is a (qn)-dimensional i.i.d. sub-Gaussian random vector. Based on Hanson-Wright’s inequality (Theorem 1.1 in Rudelson and Vershynin [25]), Pr n > a  ∗ ∗ Σ̆ − Σ̂  > b − Ea  ∗ ∗ Σ̆ − Σ̂  b ≥x o vec(X)> Qvec(X) − Evec(X)> Qvec(X) ≥ x   > > = Pr vec(Z)> D> Γ QDΓ vec(Z) − E vec(Z) DΓ QDΓ vec(Z)    x2 x . , 2 ≤2 exp −c min 2 τ 4 kD> Γ QDΓ kF τ kDΓ QDΓ k = Pr  ≥x  (35) Here c > 0 is a uniform constant. Since Q is supported on {(i, k), (j, l) : i ∈ A, j ∈ > |A|n×qn B}, we have D> , DΓB ∈ R|B|n×qn are Γ QDΓ = DΓA QA×B DΓB . Here DΓA ∈ R with n diagonal block ΓA×[q] and ΓB×[q] , respectively, where [q] = {1, . . . , q}. Since > ΓA×[q] Γ> A×[q] = ΣA , ΓB×[q] ΓB×[q] = ΣB , we know kDΓA k = kΓA×[q] k ≤ kΣA k1/2 , 31 kΓB×[q] k ≤ kDΓB k ≤ kΣB k1/2 . Then we further have n     o > ∗ ∗ > ∗ ∗ Pr a Σ̆ − Σ̂ b − Ea Σ̆ − Σ̂ b ≥ x ( !) x2 x ≤2 exp −c min , 2 > 2 τ 4 kD> ΓA QA×B DΓB kF τ kDΓA QA×B DΓB k !) ( x x2 (36) , 2 ≤2 exp −c min 2 > 2 τ 4 kDΓB k2 kD> ΓA k kQkF τ kDΓB kkDΓA kkQk    x x2 , ≤2 exp −c min τ 4 kΣA kkΣB kkQk2F τ 2 (kΣA kkΣB k)1/2 kQk    x2 n∗2 xn∗min min ≤2 exp −c min , . τ 4 kΣA kkΣB k τ 2 (kΣA kkΣB k)1/2  We define x0 = max x − 3(kΣA kkΣB k)1/2 /n∗min , 0 , combining the inequality above and (32), we have n  o n   o  > 0 ∗ ∗ ∗ ∗ > ∗ Pr a Σ̆ − Σ̂ b ≥ x ≤ Pr a Σ̆ − Σ̂ b − Ea Σ̂ b ≥ x    (x0 )2 n∗2 x0 n∗min min ≤2 exp −c min , τ 4 kΣA kkΣB k τ 2 (kΣA kkΣB k)1/2      x2 n∗2 xn∗min 1 1 min 0 , , ≤2 exp −c min + C max τ 4 kΣA kkΣB k τ 2 (kΣA kkΣB k)1/2 τ4 τ2    x2 n∗2 xn∗min min 0 , . ≤C exp −c min τ 4 kΣA kkΣB k τ 2 (kΣA kkΣB k)1/2 > (37) In the last inequality above, we used a fact that τ is lower bounded by a uniform constant. This is due to Assumption 2.2 that E(Z) = 0, var(Z) = 1, E exp(tZ) ≤ exp(t2 τ 2 /2). Then, ∞ X 22k EZ 2k 1 exp(4τ /2) ≥ {E exp(2Z) + E exp(−2Z)} = ≥ 2EZ 2 = 2, 2 (2k)! k=0 2 which implies τ 2 ≥ 12 ln(2). 32 3. It is easy to see that EΣ̆∗ = Σ, so Ea> (Σ̆∗ − Σ)b = 0. Then a> (Σ̆∗ − Σ)b = = p X n 1 X Xik Xjk Sik Sjk n∗ij k=1 ai b j i,j=1 p n X X  ! −E p X i,j=1 n ai b j 1 X Xik Xjk Sik Sjk n∗ij k=1  ! ai bj Sik Sjk ai bj Sik Sjk Xik Xjk − E Xik Xjk ∗ nij n∗ij (38) k=1 i,j=1 n X  k > k , X> k C Xk − EXk C Xk k=1 n X  > k > > k = Z> k Γ C ΓZk − EZk Γ C ΓZk . k=1 Here Ck ∈ Rp×p is a matrix such that Cijk = ai bj Sik Sjk /n∗ij . Note that Ck is supported on A × B, we can prove the following properties of Ck . q  > k kΓ C ΓkF = tr Ck ΓΓ> Ck> ΓΓ> q  > k> = tr CkA×B ΓB×[q] Γ> B×[q] CA×B ΓA×[q] ΓA×[q] p ≤kΓB×[q] kkΓA×[q] k tr(Ck Ck> ) p ≤(kΣA kkΣB k)1/2 tr(Ck Ck> ); n X > kΓ C k Γk2F ≤ kΣA kkΣB kkCk k2F = kΣA kkΣB k 2 p  n X X ai bj Sik Sjk k=1 i,j=1 k=1 n∗ij p p n X X X Sik Sjk a2i b2j a2i b2j =kΣA kkΣB k = kΣ kkΣ k A B n∗2 n∗ij ij i,j=1 k=1 i,j=1 ≤kΣA kkΣB k (39) (40) kak22 kbk22 kΣA kkΣB k = ; ∗ nmin n∗min p kΓ> Ck Γk ≤kΓ> Ck ΓkF ≤ (kΣA kkΣB k)1/2 tr(Ck Ck> ) v uX  2 u p ai bj Sik Sjk 1/2 t ≤(kΣA kkΣB k) n∗ij i,j=1 v p uX u p a2i b2j kΣA kkΣB k 1/2 t ≤(kΣA kkΣB k) ≤ . ∗2 ∗ n n min min i,j=1 33 (41) Now, note that the last line of (38) can be also equivalently written as vec(Z)> Ccon vec(Z)> − Evec(Z)> Ccon vec(Z)> , con C  Γ> C1 Γ   .. = .   Γ> Cn Γ    ∈ R(qn)×(qn) ,  where vec(Z) is the vectorization of Z, which is an qn-dimensional i.i.d. sub-Gaussian vector. Based on the properties of Ck above, we have kCcon k2F = n X (40) kΓ> Ck Γk2F ≤ k=1 (41) kCcon k ≤ max kΓ> Ck Γk ≤ 1≤k≤n kΣA kkΣB k , n∗min (kΣA kkΣB k)1/2 . n∗min Now applying Hanson-Wright’s inequality (Theorem 1.1 in Rudelson and Vershynin [25]), we have vec(Zk )> Ccon vec(Zk ) − Evec(Zk )> Ccon vec(Zk ) ≥ x    x2 x ≤2 exp −c min , τ 4 kCcon k2F τ 2 kCcon k    x2 x ∗ ≤2 exp −cnmin min , . τ 4 kΣA kkΣB k τ 2 (kΣA kkΣB k)1/2 Pr  (42) Thus, n > ∗ o a (Σ̆ − Σ)b ≥ x    x x2 ∗ , . ≤2 exp −cnmin min τ 4 kΣA kkΣB k τ 2 (kΣA kkΣB k)1/2 Pr (43) Here c is a uniform constant. Combining (43) and (37), we have (29). 4. Next, we use the ε-net technique to give the bound on kΣ̂∗A×B − ΣA×B k. Denote D∗ = A B Σ̂∗A×B − ΣA×B . Suppose S1/3 is the (1/3)-net for all unit vectors in R|A| ; similarly S1/3 is the (1/3)-net for all unit vectors in R|B| . Based on the proof of Lemma 3 in Cai et al. 34 A B [9], we can let Card(S1/3 ) ≤ 7k , Card(S1/3 ) ≤ 7k . Since for all a, a0 ∈ R|A| , b, b0 ∈ R|B| , ∗ > ∗ > ∗ > ∗ > ∗ a> D∗ b − a> 0 D b0 ≤ a D b − a0 D b0 ≤ (a − a0 ) D b + a0 D (b − b0 ) ≤ (ka − a0 k2 + kb − b0 k2 ) kD∗ k, (44) A B we have for all a ∈ R|A| , b ∈ R|B| , kak2 = kbk2 = 1, we can find a0 ∈ S1/3 , b0 ∈ S1/3 such that ka0 − ak2 ≤ 1/3, kb0 − bk2 ≤ 1/3, then 2 ∗ 2 ∗ ∗ ∗ |a> D∗ b| ≤ |a> sup |a> 0 D b0 | + kD k ≤ 0 D b0 | + kD k, 3 3 a0 ∈S A ,b0 ∈S B 1/3 kD∗ k = |a> D∗ b| ≤ sup 1/3 sup A ,b ∈S B a0 ∈S1/3 0 1/3 a∈R|A| ,b∈R|B| , kak2 =kbk2 =1 2 ∗ ∗ |a> 0 D b0 | + kD k, 3 which yields kΣ̂∗A×B − ΣA×B k = kD∗ k ≤ 3 sup A ,b ∈S B a0 ∈S1/3 0 1/3 ∗ |a> 0 D b0 |. (45) Finally, by combining (29) and the inequality above, we know there exist uniform constants C1 , c > 0 such that for all t > 0,     Pr kΣ̂∗A×B − ΣA×B k ≥ x ≤ Pr   ≤C1 (7)|A|+|B| exp −cn∗min min sup A ,b ∈S B a0 ∈S1/3 0 1/3  x ∗ |a> 0 D b0 | ≥ 2 τ 4 kΣA kkΣB k , τ 2 (kΣ x 3  x 1/2 A kkΣB k) Since |A| + |B| ≤ 2|A ∪ B|, we have finished the proof of Lemma 2.1. (46) .  Proof of Lemma 6.1. Since Σ is positive semi-definite, we can find the Cholesky decompo> sition such that Σ = VV> . Then ΣA×B = VA×[p] VB×[p] and kΣA×B k = max x∈R|A| ,y∈R|B| > x> VA×[p] VB×[p] y kxk2 =kyk2 =1 ≤ = 1/2 max > x> VA×[p] VA×[p] x max 1/2 > 1/2 x> Σ A x y ΣB y = kΣA kkΣB k. x∈R|A| ,y∈R|B| kxk2 =kyk2 =1 x∈R|A| ,y∈R|B| kxk2 =kyk2 =1 Here we have used the Cauchy-Schwarz inequality. 35  > y> VB×[p] VB×[p] y 1/2 6.2 Proof of Theorem 2.1 Define B = (bij )1≤i,j≤p such that bij = σij if i ∈ Is , j ∈ Is0 and |s − s0 | ≤ 1, and 0 otherwise. Let ∆ = Σ − B. Then kΣ̂bt − Σk ≤ kΣ̂bt − Bk + k∆k. It is easy to see that X k∆k ≤ k∆k`1 ≤ max |σij | ≤ M k −α . i j:|i−j|≥k To bound kΣ̂bt − Bk, note that kΣ̂bt − Bk = hu, (Σ̂bt − B)ui . sup u∈Rp :kuk2 =1 For any u ∈ Rp , kuk2 = 1, we have D X hu, (Σ̂bt − B)ui ≤ uIs , (Σ̂∗Is ×Is0 − ΣIs ×Is0 )uIs0 E s,s0 :|s−s0 |≤1 X ≤ kuIs k2 kuIs0 k2 kΣ̂∗Is ×Is0 − ΣIs ×Is0 k s,s0 :|s−s0 |≤1   ≤ X  kuIs k2 kuIs0 k2  s,s0 :|s−s0 |≤1 max |s−s0 |≤1 kΣ̂∗Is ×Is0  − ΣIs ×Is0 k . The Cauchy-Schwarz inequality yields X s,s0 :|s−s0 |≤1 1 kuIs k2 kuIs0 k2 ≤ 2 X kuIs k22 + kuIs0 k22  ≤3 s,s0 :|s−s0 |≤1 N X kuIs k22 = 3. s=1 Therefore, kΣ̂bt − Σk ≤kΣ̂∗ − Bk + k∆k ≤ 3 max 0 |s−s |≤1 Σ̂∗Is ×Is0 − ΣIs ×Is0 + M k −α , which yields bt 2 EkΣ̂ − Σk ≤ 18E  max |s−s0 |≤1 Σ̂∗Is ×Is0 36 2 − ΣIs ×Is0 + 2M 2 k −2α . (47) According to lemma 2.1, there exists constant C, c > 0 which only depend on τ such that for all x > 0,  Pr  max kΣ̂Is ×Is0 − ΣIs ×Is0 k ≥ x |s−s0 |≤1  2   x p x k ∗ ≤Cd e(49) exp −cnmin min . (48) , k kΣk2 kΣk Now we set t = C 0 (k + ln p)/n∗min for C 0 large enough. The spectral norm risk satisfies EkΣ̂bt − Σk2 ≤18E max Σ̂∗Is ×Is0 + 2M 2 k −2α |s−s0 |≤1  Z ∞  2 Pr max kΣ̂Is ×Is0 − ΣIs ×Is0 k ≥ x dx + 2M 2 k −2α ≤18 0 |≤1 |s−s 0  Z ∞  2 ≤18t + 18 Pr max kΣ̂Is ×Is0 − ΣIs ×Is0 k ≥ x dx + 2M 2 k −2α 0 |s−s |≤1 t Z ∞ o n  1 p k 0 ∗ 2 dx + 2M 2 k −2α exp −c nmin min x, x ≤18t + Cd e(49) k t p 1 ≤18t + Cd e(49)k ∗ exp (−c0 n∗min t) + 2M 2 k −2α , k nmin (49) then (49) yields bt 2  EkΣ̂ − Σk ≤ C  k + ln p −2α +k , n∗min (50) where C only depends on τ, M, M0 . We can finally finish the proof of Theorem 2.1 by taking k = (n∗min )1/(2α+1) .  Acknowledgments We thank Tianxi Cai for the ovarian cancer data set and for helpful discussions. We also thank the Editor, the Associate editor, one referee and Zoe Russek for useful comments which have helped to improve the presentation of the paper. References [1] B. Andreopoulos and D. Anastassiou. Integrated analysis reveals hsa-mir-142 as a representative of a lymphocyte-specific gene expression and methylation signature. Cancer Informatics, 11:61–75, 2012. 37 [2] P. J. Bickel and E. Levina. Regularized estimation of large covariance matrices. Ann. Statist., 36:199–227, 2008. [3] P. J. Bickel and E. Levina. Covariance regularization by thresholding. Ann. Statist., 36:2577–2604, 2008. [4] T. Bonome, J.-Y. Lee, D.-C. Park, M. Radonovich, C. Pise-Masison, J. Brady, G. J. Gardner, K. Hao, W. H. Wong, J. C. Barrett, and et al. Expression profiling of serous low malignant potential, low-grade, and high-grade tumors of the ovary. Cancer Research, 65:10602–10612, 2005. [5] T. T. Cai and W. Liu. Adaptive thresholding for sparse covariance matrix estimation. J. Amer. Statist. Assoc., 106:672–684, 2011. [6] T. T. Cai, Z. Ma, and Y. Wu. Optimal estimation and rank detection for sparse spiked covariance matrices. Probab. Theory Rel., 161:781–815, 2015. [7] T. T. Cai, Z. Ren, and H. H. Zhou. Estimating structured high-dimensional covariance and precision matrices: Optimal rates and adaptive estimation. Electron. J. Stat., 10:1– 59, 2016. [8] T. T. Cai and M. Yuan. Adaptive covariance matrix estimation through block thresholding. Ann. Statist., 40:2014–2042, 2012. [9] T. T. Cai, C.-H. Zhang, and H. Zhou. Optimal rates of convergence for covariance matrix estimation. Ann. Statist., 38:2118–2144, 2010. [10] T. T. Cai and H. Zhou. Optimal rates of convergence for sparse covariance matrix estimation. Ann. Statist., 40:2389–2420, 2012. [11] Cancer Genome Atlas Research Network. Integrated genomic analyses of ovarian carcinoma. Nature, 474:609–615, 2011. 38 [12] G. Carraro, A. Shrestha, J. Rostkovius, A. Contreras, C.-M. Chao, E. El Agha, B. MacKenzie, S. Dilai, D. Guidolin, M. M. Taketo, et al. mir-142-3p balances proliferation and differentiation of mesenchymal cells during lung development. Development, 141(6):1272–1281, 2014. [13] S. X. Chen, L. X. Zhang, and P. S. Zhong. Tests for high-dimensional covariance matrices. J. Amer. Statist. Assoc., 105:810–819, 2010. [14] J. C. Denny, M. D. Ritchie, M. A. Basford, J. M. Pulley, L. Bastarache, K. Brown-Gentry, D. Wang, D. R. Masys, D. M. Roden, and D. C. Crawford. Phewas: demonstrating the feasibility of a phenome-wide scan to discover gene-disease associations. Bioinformatics, 26:1205–1210, 2010. [15] H. K. Dressman, A. Berchuck, G. Chan, J. Zhai, A. Bild, R. Sayer, J. Cragun, J. Clarke, R. S. Whitaker, and e. a. Li, L. An integrated genomic-based approach to individualized treatment of patients with advanced-stage ovarian cancer. J. Clin. Oncol., 25:517–525, 2007. [16] N. El Karoui. Operator norm consistent estimation of large-dimensional sparse covariance matrices. Ann. Statist., 36:2717–2756, 2008. [17] R. D. Hawkins, G. C. Hon, and B. Ren. Next-generation genomics: an integrative approach. Nat. Rev. Genet., 11:476–486, 2010. [18] J. G. Ibrahim and G. Molenberghs. Missing data methods in longitudinal studies: a review. Test, 18:1–43, 2009. [19] S. Y. Ko, N. Barengo, A. Ladanyi, J. S. Lee, F. Marini, E. Lengyel, and H. Naora. Hoxa9 promotes ovarian cancer growth by stimulating cancer-associated fibroblasts. J. Clin. Invest., 122:3603–3617, 2012. 39 [20] R. J. A. Little and D. B. Rubin. Statistical Analysis with Missing Data. 2nd Edition. John Wiley & Sons, New York, 2002. [21] P.-L. Loh and M. Wainwright. High-dimensional regression with noisy and missing data: Provable guarantees with non-convexity. Ann. Statist., 40:1637–1664, 2012. [22] K. Lounici. Sparse principal component analysis with missing observations. High dimensional probability VI, 66 of Prog. Proba., Institute of Mathematical Statistics (IMS) Collections:327–356, 2013. [23] K. Lounici. High-dimensional covariance matrix estimation with missing observations. Bernoulli, to appear, 2014. [24] A. J. Rothman, E. Levina, and J. Zhu. Generalized thresholding of large covariance matrices. J. Amer. Statist. Assoc., 104:177–186, 2009. [25] M. Rudelson and R. Vershynin. Hanson-wright inequality and sub-gaussian concentration. Electron. Commun. Probab., 18:1–9, 2013. [26] J. L. Schafer. Analysis of Incomplete Multivariate Data. CRC press, 2010. [27] R. W. Tothill, A. V. Tinker, J. George, R. Brown, S. B. Fox, S. Lade, D. S. Johnson, M. K. Trivett, D. Etemadmoghadam, and B. e. a. Locandro. Novel molecular subtypes of serous and endometrioid ovarian cancer linked to clinical outcome. Clin. Cancer Res., 14:5198–5208, 2008. 40 Appendix: Proofs In this appendix we collect the proofs for the main results of the sparse covariance matrix estimation and Propositions 2.1 and 3.1. Proof of Lemma 3.1 The main strategy for the proof of this lemma is similar to that for Lemma 2 in Cai and Liu [5]. Without loss of generality, we can translate X and assume that EX = µ = 0. First, we show the following property on θij cσii σjj ≤ θij ≤ Cσii σjj . (51) Here c, C > 0 only depend on the distribution of Z. Denote a, b as the i-th and j-th row vector of Γ, then kak22 = var(Xi ) = σii , kbk22 = σjj . Recall that θij = var(Xi Xj − σij ) = var(a> Zb> Z − Ea> Zb> Z), thus  2 p θij = var Z> ab> Z ≤ E Z> ab> Z ≤ E(Z> a)4 E(Z> b)4 . Since 4 E Z> a ≤ q X s=1 4 similarly E Z> b (52) ! a4s EZs4 + 6 X a2s a2t EZs2 EZt2 ≤ 3kak42 EZ 4 ≤ Cτ σii2 , 1≤s<t≤q 2 ≤ Cτ σjj , we know θij ≤ Cτ σii σjj for some constant Cτ only depending on τ. On the other hand, since the entries of Z are i.i.d. with mean 0 and variance 1 and 41 var(Z 2 ) > 0, we know EZ 4 > (EZ 2 )2 = 1. We can calculate that θij =var(Xi Xj ) = E(Xi Xj )2 − (EXi Xj )2 )2 ( q X X as bs Zs2 + (as bt + at bs )Zs Zt − =E = q X s=1 1≤s<t≤q a2s b2s EZs4 X + s=1 = q X q X !2 as bs s=1 a2s b2t + a2t b2s + 4as bs at bt EZs2 Zt2  − q X s=1 !2 as b s s=1 1≤s<t≤q a2s b2s (EZ 4 − 3) + q X q X ! a2s s=1 ! b2t + t=1 q X !2 as b s . s=1 When EZ 4 ≥ 3, it is clear that q X θij ≥ ! a2s s=1 when EZ 4 < 3, note ξ = EZ 4 , x = q X ! b2s = kak22 kbk22 = σii σjj ; s=1 P P as bs , y = − s:as bs <0 as bs , then x, y ≥ 0 and ! ! ! ! q q q q X X X X 3 − ξ ξ − 1 θij ≥ − (3 − ξ)(x2 + y 2 ) + (x − y)2 + b2s + b2s a2s a2s 2 2 s=1 s=1 s=1 s=1 !2 q 3−ξ X ξ−1 ≥ − (3 − ξ)(x2 + y 2 ) + (x − y)2 + |as bs | + kak22 kbk22 2 2 s=1 s:as bs ≥0 = − (3 − ξ)(x2 + y 2 ) + (x − y)2 + ≥ 3−ξ ξ−1 (x + y)2 + kak22 kbk22 2 2 ξ−1 ξ−1 (x − y)2 + σii σjj ≥ cσii σjj . 2 2 Here c = (ξ − 1)/2 only depends on the distribution of Z. Now we further normalize each row of Γ such that kΓi· k2 = 1 var(Xi ) = var(Γi Z) = 1 for 1 ≤ i ≤ p. The rest of the proof is essentially the same as Lemma 2 in Cai and Liu [5] thus we will not go into details. Let ∗ θ̃ij n 2 1 X = ∗ Xik Xjk − σ̃ij∗ Sik Sjk , nij k=1 σ̃ij∗ n 1 X = ∗ Xik Xjk Sik Sjk . nij k=1 (53) We would like to show   q ∗ ∗ ∗ Pr max |θ̂ij − θ̃ij | ≥ C1 ln p/nij = O(p−M ). ij 42 (54) (j)∗ (j)∗ Denote Xi as the average of Xi ’s for those samples Xi , Xk are both observed, i.e. Xi Pn ∗ k=1 Sik Sjk Xik /nij . Then, ∗ θ̂ij n  2 1 X (j)∗ (i)∗ ∗ ∗ ∗ = ∗ Sik Sjk Xik Xjk − X̄i Xjk − X̄j Xki − σ̃ij + X̄i X̄j + X̄j X̄i nij k=1 n    (j)∗ 2 X (i)∗ ∗ + ∗ =θ̃ij Sik Sjk Xik Xjk − σ̃ij∗ X̄i X̄j∗ + X̄j X̄i∗ − X̄i∗ Xjk − X̄j∗ Xik nij k=1 n  2 1 X (j)∗ (i)∗ + ∗ Sik Sjk X̄i X̄i∗ + X̄j X̄i∗ − X̄i∗ Xjk − X̄j∗ Xik . nij k=1 Similarly to Lemma 2 in Cai and Liu [5], we could have ! s  ln p (j)∗ −M = O p , Pr max |X̄i | ≥ C2 i,j n∗ij n 1 X 2 Pr max ∗ Sik Sjk Xik Xjk X̄j∗ ≥ C5 ij nij k=1 s ln p n∗ij = (55) (56) ! . (57) and similar bounds for the other terms in the right hand side of (55). Hence we have proved (54). By (51), we can directly get Pr   ∗ θ̃ij − θij ≥ ε = O(p−M ), (58) by applying the result in Lemma 2 in Cai and Liu [5] on the samples Xk , k ∈ {k : Sik = Sjk = 1}. Combining (54) and (58), we can proved (21). The proof of (20) is omitted here because it is essentially the same as that of Lemma 2 in [5].  Proof of Theorem 3.1 First without loss of generality, we can assume that µ = EXk = 0. Based on Assumption 2.2, we have for each k, Xk = ΓZk , where Zk is an i.i.d. sub-Gaussian random vector. Based on the proof of Lemma 3.1, we know cσii σjj ≤ θij ≤ Cσii σjj , where c, C are constants which only depend on the distribution of Z. We will prove Theorem 3.1 in several steps. 43 1. For ε > 0, we first consider the loss under the event that  q ∗ ≤ δ ln p/n∗ij , ∀1 ≤ i, j ≤ p, Q = |σ̂ij∗ − σ|/θ̂ij ∗ max |θ̂ij ij and  − θij |/(σii σjj ) ≤ ε. . (59) q ∗ ∗ Since |σ̂ij − σij | ≤ δ θ̂ij ln p/n∗ij = λij , by Condition (1) of Tλij , we have |Tλij (σ̂ij∗ ) − σij | ≤ cT |σij |. Besides, by condition (3) of Tλij , |Tλij (σ̂ij∗ ) s ≤2δ − σij | ≤ ∗ θ̂ij ln p ≤ 2δ n∗ij |Tλij (σ̂ij∗ ) s − σ̂ij∗ | + |σ̂ij∗ s (59) − σij | ≤ λij + δ (θij + εσii σjj ) ln p ≤C n∗ij s ∗ θ̂ij ln p n∗ij σii σjj ln p . n∗ij Since n∗min ≤ n∗ij ≤ n, thus kΣ̂at − Σk`1 ≤ max p X i Tλij (Σ̂∗ij ) − σij ≤ max i j=1 s (17) ≤ Ccn,p p X ( C min |σij |, j=1 s σii σjj ln p n∗ij ) ln p . n∗min Since Σ̂at − Σ is a symmetric matrix, we have s kΣ̂at − Σk`q ≤ kΣ̂at − Σk`1 ≤ Ccn,p ln p n∗min for all 1 ≤ q ≤ ∞.  By Lemma 3.1, we know (59) happens with probability at least 1−O (ln p)−1/2 p−δ+2 , which implies (18). 2. Next we consider (19). We apply Lemma 2.1 by restricting Σ on {i, j} × {i, j} and set A = {i}, B = {j}, then there exists C1 , c1 > 0 such that Pr |σ̂ij∗   − σij | ≤ x ≥ 1 − C1 exp 44 −c1 n∗ij  min x x2 , σii σjj (σii σjj )1/2  (60) holds for all x > 0. Therefore,   Pr |σ̂ij∗ − σij | ≤ x(σii σjj )1/2 , ∀1 ≤ i, j ≤ p ≥ 1 − C1 p2 exp −c1 n∗min min(x, x2 ) . We also have |Tλij (σ̂ij∗ ) − σij | ≤ cT |σ̂ij∗ | + |σij | ≤ (1 + cT )|σij | + cT |σ̂ij∗ − σij |. Thus, at EkΣ̂ − Z Σk2`1 at kΣ̂ − = Σk2`1 dP Z + Q ln p ≤Cc2n,p ∗ + nmin max i Qc ln p ≤Cc2n,p ∗ + C nmin Qc !2 p Z X |Tλij (σ̂ij ) − σij | dP (61) j=1 Z max p X i Qc kΣ̂at − Σk2`1 dP !2 |σij | Z dP + C max Qc j=1 i p X !2 |σ̂ij∗ − σij | dP. j=1 For the second term above, we have )#2 !2 ( Z Z " p p X X |σ | ij dP C max |σij | dP ≤C max min (σii σjj )1/2 , p ∗ i i c c ln p/n Q Q min j=1 j=1 ≤C Pr(Qc )c2n,p ≤ Cc2n,p p−δ+2 (ln p)−1/2 . Based on the assumption that p ≥ (n∗min )ξ , δ ≥ 4 + 1/ξ, we have Z C max Qc i p X j=1 45 !2 |σij | ≤ Cc2n,p ln p . n∗min (62) We denote K = maxi σii , then K ≤ cn,p . For the third term above in (61), we have Z max C i Qc 2 p X Z  x Pr 0 2 Z |σ̂ij∗ − σij | 2 Z dP ≤ Cp Qc j=1 ∞ ≤Cp !2 K  {max |σ̂ij∗ ij {max |σ̂ij∗ ij c − σij | ≥ x} ∩ Q ij  − σij | ≥ x} ∩ Q c  2 ∗ max |σ̂ij − σij | dP dx  dx   Z ∞ ∗ c 2 x Pr {max |σ̂ij − σij | ≥ x} ∩ Q dx + Cp ij K    Z ∞ x2 x 2 2 c 2 ∗ ≤Cp K Pr(Q ) + Cp x exp −c1 nmin min , dx maxi σii2 maxi σii K Z ∞ 2 2 −δ+2 −1/2 2 ≤Cp cn,p p (ln p) + Cp x exp(−c1 n∗min x/K)dx x Pr =Cp 0 K ≤Cp−δ+4 (ln p)−1/2 c2n,p + Cp2 c2n,p exp(−cn∗min ). Based on the assumption ln p = o((n∗min )1/3 ) and p ≥ (n∗min )ξ , δ ≥ 4 + 1/ξ, we have Z max C i Qc p X !2 |σ̂ij∗ − σij | dP ≤ Cc2n,p j=1 ln p . n∗min (63) Combining (62), (63) and (61), we have finished the proof of (19) under the additional assumption that p ≥ (n∗min )ξ , δ ≥ 4 + 1/ξ.  Proof of Theorem 3.2. By Lemma 3.1, we know  s Pr |σ̂ij∗ − σij | ≥ 2 ∗ ln pθ̂ij , ∃1 n∗ij   ≤ i, j ≤ p = O (ln p)−1/2 ; (64) for all ε > 0, Pr  ∗ |θ̂ij  √ − θij |/ σii σjj ≥ ε, ∃1 ≤ i, j ≤ p = O(p−M ). (65) Also by the proof of Lemma 3.1, there exists c > 0 such that √ θij / σij σij > c. 46 (66) When δ = 2, the thresholding level is s λij = 2 ∗ θ̂ij ln p . n∗ij (67) Therefore, n o Pr supp(Σ̂at ) 6= supp(Σ)   / supp(Σ) = Pr Tλij (σ̂ij∗ ) = 0, ∃(i, j) ∈ supp(Σ) + Pr Tλij (σ̂ij∗ ) 6= 0, ∃(i, j) ∈   ≤ Pr |σ̂ij∗ | ≤ λij , ∃(i, j) ∈ supp(Σ) + Pr |σ̂ij∗ | > λij , ∃(i, j) ∈ / supp(Σ)   s ∗ (67) θ̂ij ln p ≤ Pr |σ̂ij∗ − σij | ≥ 2 , ∃1 ≤ i, j ≤ p n∗ij   s   ∗ θ̂ij ln p + Pr |σij | ≤ 4 , ∃(i, j) ∈ supp(Σ)   n∗ij   s s   ∗ (64)  θ̂ θij ln p ij −1/2 ≤ O (ln p) + Pr (4 + γ) ≤4 , ∃(i, j) ∈ supp(Σ)   n∗ij n∗ij ) ( 2 ∗  − θij θ̂ij 4+γ −1/2 ≤O (ln p) , ∃(i, j) ∈ supp(Σ) + Pr −1≤ 4 θij (65)(66) = o(1), n o at which means Pr supp(Σ̂ ) 6= supp(Σ) = o(1).  Proof of Propositions 2.1 and 3.1. For given n0 ≥ 1, we again consider a special pattern of missingness S0 :   1, 1 ≤ i ≤ n0 , 1 ≤ j ≤ p (S0 )ij =  0, n + 1 ≤ i ≤ n, 1 ≤ j ≤ p. 0 Under this missingness pattern, n∗min = n0 , and the problem essentially becomes complete data problem with n0 samples. Now, Propositions 2.1, 3.1 directly follow Theorem 3 of Cai et al. [9] and Theorem 2 of Cai and Zhou [10], respectively. 47
10math.ST
Robustness to unknown error in sparse regularization arXiv:1705.10299v2 [cs.IT] 21 Nov 2017 Simone Brugiapaglia∗ and Ben Adcock† November 23, 2017 (To appear in IEEE Transactions on Information Theory) Abstract Quadratically-constrained basis pursuit has become a popular device in sparse regularization; in particular, in the context of compressed sensing. However, the majority of theoretical error estimates for this regularizer assume an a priori bound on the noise level, which is usually lacking in practice. In this paper, we develop stability and robustness estimates which remove this assumption. First, we introduce an abstract framework and show that robust instance optimality of any decoder in the noise-aware setting implies stability and robustness in the noise-blind setting. This is based on certain sup-inf constants referred to as quotients, strictly related to the quotient property of compressed sensing. We then apply this theory to prove the robustness of quadratically-constrained basis pursuit under unknown error in the cases of random Gaussian matrices and of random matrices with heavy-tailed rows, such as random sampling matrices from bounded orthonormal systems. We illustrate our results in several cases of practical importance, including subsampled Fourier measurements and recovery of sparse polynomial expansions. 1 Introduction The purpose of this paper is to address the recovery error analysis of the QuadraticallyConstrained Basis Pursuit (QCBP) optimization program in the presence of unknown sources of error corrupting the measurements. The QCBP program is defined as follows: min kzk1 , s.t. kAz − yk2 ≤ η. z∈CN (1) This optimization problem has a long history [21, 27], but here we are particularly interested in its application in Compressed Sensing (CS) [14, 20, 24]. We call A ∈ Cm×N the sensing matrix, y ∈ Cm the vector of measurements, and η > 0 the threshold parameter. When η = 0, (1) is also referred to as Basis Pursuit (BP). We assume to have measurements y = Ax + e, where x ∈ CN is the target solution that we aim to recover and e ∈ Cm is an unknown error term corrupting the measurements. Moreover, in the CS framework, we are interested in the case where m ≪ N . ∗ Simon † Simon Fraser University, Burnaby, BC, Canada. e-mail: [email protected] Fraser University, Burnaby, BC, Canada. e-mail: [email protected] 1 While there is a rich literature on recovery error estimates for QCBP in the CS literature, almost all results (with a few exceptions, see Section 1.3) are based on an a priori estimate of the error term of the form kek2 ≤ η. (2) However, in many, if not all applications of CS, a bound of the form (2) is unlikely to be known, due to the various ways in which errors arise in practice. Several common sources of such errors are as follows: • Physical noise: In signal acquisition (magnetic resonance imaging, tomography, radar, etc.) there is an intrinsic source of error due to physical noise that corrupts the measurements of any sensing device. At best, one may have a reasonable statistical model for this noise, but a bound (2) is usually unobtainable. • Model error : In applications such as MRI and tomography there is always a discrepancy between the physics of the sensing device and the formulation of the acquisition process as a linear model y = Ax + e. The Fourier and Radon transforms – the standard operators used to describe these sensing devices – are, in the end, only approximations of the ‘true’ physical model, and in certain situations may lead to significant model errors. Moreover, it is commonplace to replace the continuous Fourier and Radon transforms by their discrete analogues, leading to an additional source of error. Since such errors are dependent on the unknown signal x, a bound (2) typically fails to hold. Similar model errors may arise due to nonlinearity of the acquisition process, or quantization of the measurements. • Truncation error : In function approximation and interpolation based on CS [1, 2, 33], the choice of the finite-dimensional approximation space introduces a truncation error in addition to any noise in the measurements. This usually depends on the regularity of the function to approximate, which is by definition unknown. • Numerical error : In recent applications of CS to the numerical treatment of PDEs, there are at least two further sources of errors. In uncertainty quantification, where the measurements correspond to pointwise samples of the solution manifold of a parametric PDE, each sample is based on a black-box PDE solver whose accuracy may not be known in practice [5, 22, 32, 38]. Another example is given by the CORSING approach for deterministic PDEs, where the measurements and entries of the sensing matrix A are computed using numerical quadrature routines [8, 10, 11]. In both instances, bounds of the form (2) are usually unavailable. Despite this issue, the QCBP program is used frequently in applications of CS. Indeed, it is not difficult to observe numerically that QCBP is often quite robust even when (2) does not hold. In Figure 1 we plot the absolute recovery error achieved by BP (η = 0) and by QCBP with η = 10−3 for kek2 = 10−3 as a function of m when recovering an exactly sparse solution. We repeat the same experiment for three different types of measurements: random Gaussian measurements, partial discrete Fourier transform, and nonharmonic Fourier measurements. In all cases, the QCBP shows to be quite robust even when (2) is not satisfied, especially (at least for the first and third types of measurements) in the case where m ≪ N . Interestingly, for discrete Fourier measurements there is no reduction in robustness as m approaches N . This figure is illustrative of the recovery properties of QCBP in practice. However, outside of the Gaussian case there are few theoretical results in the literature that explain this behavior, and correspondingly, the success of QCBP in applications of CS. The main aim of this paper is to reduce this gap between theory and practice. We do so by analyzing the robustness of QCBP without assuming any prior knowledge on the error e corrupting the measurements. In particular, our main estimates provide a first theoretical explanation of some of the observed empirical behavior of QCBP shown in Figure 1. 2 Figure 1: Robustness of QCBP to unknown error for different sensing matrices. We plot the recovery error as a function of m on exactly sparse solutions, averaged over 25 runs. The error on the measurement is of magnitude kek2 = 10−3 . We compare the performance of BP (η = 0) and of QCBP with threshold η = 10−3 for random Gaussian measurements, partial discrete Fourier transform, and nonharmonic Fourier measurements (see (43)). The recovery is quite robust even when (2) does not hold. More details about this experiment are given in Section 5.1. 1.1 Problem setting In order to formalize the problem more precisely, let us fix the notation. Notation For every N ∈ N, we define [N ] := {1, . . . , N }. Given a subset S ⊆ [N ], the vector zS is the restriction of z to the components in S. The complement set of S ⊆ [N ] is denoted as S = [N ] \ S. The bar notation is also used to indicate the conjugate of a complex number, but the difference will be clear from the context. Given a vector z ∈ CN , z∗ denotes its conjugate transpose (the same holds for a matrix A and its Hermitian transpose A∗ ) and h·, ·i is the standard inner product of CN . Given a set X, we denote its power set as P(X). We denote the ℓ0 norm of z as kzk0 = |{j ∈ [N ] : zj 6= 0}| and define the set of s-sparse vectors of N CN as ΣN : kzk0 ≤ s}. Moreover, we denote the best s-term approximation error s := {z ∈ C of z with respect to the ℓq norm as σs (z)q := min kz − wkq . w∈ΣN s For any matrix A ∈ Cn×k , kAk2 denotes the matrix norm induced by the ℓ2 norm. The letters c, d, C, D, E will be reserved to indicate universal constants. They do not depend on any other parameter, unless otherwise stated. The notation X . Y hides the presence of a constant C independent of X and Y such that X ≤ CY . Moreover, we use the notation X ∼ Y when X . Y and X & Y hold simultaneously. In our context, it is convenient to formalize the measurement-recovery process in terms of encoder-decoder pairs. 3 Definition 1.1 (Encoder-decoder pair). We call encoder a matrix A ∈ Cm×N that maps (or, equivalently, encodes) vectors from CN onto Cm as x 7→ Ax, i.e., that computes the measurements of the signal x. A decoder is a function ∆ : Cm → P(CN ), where P(CN ) denotes the power set of CN . The function ∆ recovers (or, equivalently, decodes) an encoded vector of Cm to a set of vectors in CN . Any pair (A, ∆) will be referred to as an encoder-decoder pair.1 The QCBP decoder studied in this paper corresponds to (1) and it is defined as follows: Definition 1.2 (Quadratically-constrained basis pursuit decoder). Given η ≥ 0, the function ∆η : Cm → P(CN ) defined as b (η) = arg min kzk1 , s.t. kAz − yk ≤ η, ∆η : y 7−→ x z∈CN (3) is said to be the Quadratically-Constrained Basis Pursuit (QCBP) decoder with threshold η relative to the norm k · k on Cm . In particular, ∆0 is called the Basis Pursuit (BP) decoder. b (η) = {0}. When the set {z ∈ CN : kAz − yk ≤ η} of feasible vectors is empty, we define x Usually, assuming kek2 ≤ η, and for A fulfilling suitable hypotheses based on the restricted isometry property or on similar conditions, the recovery error estimates for the QCBP decoder take the form (see, for example, [24]) σs (x) kx − ∆η (Ax + e)k2 . √ + η. s (4) In this paper, we provide recovery error estimates of the form σs (x) kx − ∆η (Ax + e)k2 . √ + η + max{kek2 − η, 0}, s (5) where the hypothesis kek2 ≤ η is removed. For the sake of clarity, let us point out that, for any norm k · k on CN , we define kx − ∆η (y)k = sup z∈∆η (y) kx − zk, since ∆η (y) is a subset of CN . For a more detailed discussion about the nature of the minimizing set ∆η (y), see [34]. In the next section, we summarize the main contributions of the paper, describing what are the assumptions required to prove the validity of inequalities of the form (5). 1.2 Main contributions We present the main results of the paper. In order to simplify the exposition, we assume the recovery error to be measured with respect to the ℓ2 norm, even if the results are proved for the ℓq norm, with q ≥ 1. 1.2.1 Robustness to unknown error The general robustness analysis of QCBP is carried out in Section 2 and it is built upon the concepts of quotients and robust instance optimality. 1 The codomain of the decoder ∆ is not just CN since uniqueness of the decoded solution is not required and it is not a particular concern in our framework. 4 The quotients are sup-inf constants of two types: the ℓ1 -quotient (Definition 2.6) Qλ (A)1 := sup inf √ N e∈Cm z∈C e6=0 Az=e kzk1 , λ kek2 and the simultaneous (ℓ2 , ℓ1 )-quotient (Definition 2.8) √ λkzk2 + kzk1 √ Qλ (A)2,1 := sup inf . m z∈CN λkek2 e∈C e6=0 Az=e These two quantities are strictly related to the constants involved in the quotient property and in the simultaneous quotient property, respectively [23, 37] (see Section 2.2.2 for a detailed discussion). The notion of robust instance optimality generalizes the concept of instance optimality, already known in CS [17]. An encoder-decoder pair (A, ∆η ) is said to be η-robustly instance optimal (Definition 2.19) if kx − ∆η (Ax + e)k2 . σs (x)1 √ + η, s ∀x ∈ CN , ∀e ∈ Cm s.t. kek2 ≤ η. This definition corresponds to the usual robustness results proved in CS, assuming an a priori estimate on the error norm. Employing these two notions, in our first result we prove that robust instance optimality implies robustness to unknown error, where the resulting error estimate is of the form (5) and the unknown error is multiplied by the simultaneous quotient Qs (A)2,1 (Theorem 2.21). In other words, an instance optimal decoder for the noise-aware setting can be applied in the noise-blind case with an explicit error bound. The version of this result specialized to the ℓ2 norm reads as follows: Theorem 1.3 (Robust instance optimality ⇒ Robustness to unknown error). Assume that the pair (A, ∆η ) is η-robustly instance optimal. Then for every x ∈ CN , e ∈ Cm , the following holds σs (x)1 kx − ∆η (Ax + e)k2 . √ + η + Qs (A)2,1 max{kek2 − η, 0}. s Now, we recall that the sth restricted isometry constant δs (A) of A is the smallest constant δ such that (1 − δ)kzk22 ≤ kAzk22 ≤ (1 + δ)kzk22 , ∀z ∈ ΣN s . Moreover, A is said to have the restricted isometry property if δs (A) < 1 (see Definition 2.3). √ It is well-known in CS that the QCBP decoder is robustly instance optimal when δ2s (A) < 4/ 41 (see [24, Theorem 6.12]). Moreover, we show that under the restricted isometry property – or, more in general, under the ℓ2 -robust null space property (Definition 2.1) – we can control the simultaneous quotient by the quotient Qλ (A)2,1 . Qλ (A)1 (Proposition 2.12). We prove that QCBP is robust to unknown error under the restricted isometry property in Corollary 2.23, which corresponds to the following result.2 Theorem 1.4 (Restricted isometry property ⇒ Robustness √ under unknown error). If the (2s)th restricted isometry constant of A satisfies δ2s (A) < 4/ 41, then kx − ∆η (Ax + e)k2 . σs (x)1 √ + η + Qs (A)1 max{kek2 − η, 0}, s where ∆η is the QCBP decoder defined in (3). √ reason why we do not use the less restrictive (and sharp) condition δ2s (A) < 1/ 2 given in [12] is discussed in Remark 2.5 2 The 5 Therefore, we establish robustness to unknown error – up to the magnitude of Qs (A)1 – whenever the sensing matrix has the restricted isometry property. In practice, this translates into a condition on the measurements of the form m & s L(N, s), where L(N, s) is a polylogarithmic factor depending on the random model considered for the sensing matrix (see also Remark 4.11). We also note that the term max{kek2 − η, 0} in the right-hand side of the recovery error estimate suggests that there is a benefit to estimating the noise well and to calibrating the threshold parameter η accordingly. 1.2.2 Random Gaussian matrices In Section 3 we prove the robustness of QCBP in the case of Gaussian measurements. The main result is Theorem 3.3, which reads as follows in the ℓ2 norm case: Theorem 1.5 (Robustness to unknown error of QCBP with Gaussian measurements). Let s ≤ m ≤ N/2 and A = m−1/2 G, where G ∈ Cm×N is a random Gaussian matrix with independent standard normal entries and let m & s ln(eN/s) + ln(ε−1 ). Then for every x ∈ CN , e ∈ Cm , and s ≤ s∗ = m/ ln(eN/m), we have kx − ∆η (Ax + e)k2 . σs (x)1 √ + η + max{kek2 − η, 0} s with probability at least 1 − ε, where ∆η is the QCBP decoder defined in (3). This result extends the previously known robustness result for BP with Gaussian measurements (see Section 1.3) and based on already known upper bounds to the quotient Qs∗ (A)1 with s∗ = m/ ln(eN/m) in probability (see Theorem 3.1). 1.2.3 Random matrices with heavy-tailed rows While Gaussian random matrices have convenient mathematical properties, they are generally of limited use in applications of CS. In Section 4 we apply our robustness theory to a large class of random sampling matrices with heavy-tailed rows. First, we consider the case of a random sampling matrix A from a Bounded Orthonormal Systems (BOSs) [31], namely 1 Aij = √ φj (ti ), m ∀j ∈ [N ], ∀i ∈ [m], where the functions φj : D → C form an orthonormal system with respect to the probability measure ν on D and are uniformly bounded, namely kφj kL∞ (D) ≤ K, with K ≥ 1 (see Definition 4.9). This is a large class of random matrices, which includes the partial discrete Fourier transform, nonharmonic Fourier measurements, random sampling from orthogonal polynomials, and subsampled isometries (with independent rows) all of which occur commonly in applications of CS. In the BOS case, the restricted isometry property is known to hold with high probability (Theorem 4.10). Therefore, in order to prove robustness to unknown error of QCBP in this framework, we only need to control the ℓ1 -quotient. With this aim, we show that the ℓ1 -quotient Qλ (A)1 can be bounded as follows (Proposition 4.1): r 1 m p Qλ (A)1 ≤ , ∗) λ σmin ( m A N 6 m×N for every , not necessarily associated with a BOS. p We also show that Qλ (A)1 ≥ p A∈ C K −1 pm/λ when maxij |Aij | ≤ K; in other words, the factor m/λ is optimal. Notice that A∗ ) is related to the minimum eigenvalue of the Gram matrix m AA∗ , and not of σmin ( m N N ∗ A restricted isometry property in CS. The scaling p A usually considered when provingpthe m/N factor is required so that σmin ( m A∗ ) ≈ 1 under suitable conditions on m and N . N p In order to control σmin ( m A∗ ), we employ tools from the spectral theory of random maN trices with heavy-tailed columns [36]. In particular, we consider the cross coherence parameter (Definition 4.4)   m 2  X E max |haj , ak i|2 , µ= k∈[m] N j∈[m]\{k} and the distrotion parameter (Definition 4.5)   m ξ = E max kak k22 − 1 , k∈[m] N where a1 , . . . , am are the rows of A. They control the off-diagonal and the diagonal part of the m Gram matrix M AA∗ , respectively. In Theorem 4.6 we prove the following deviation inequality in expectation q p A∗ ) − 1| . ξ + (1 + ξ)µ ln(m). E |σmin ( m N This allows us to prove robustness results for random matrices with heavy-tailed rows. In the case of BOSs we have Theorem 4.12, stated in a simplified version below. Theorem 1.6 (Robustness to unknown error of QCBP for BOSs). Let A ∈ Cm×N be the random sampling matrix (30) associated with a BOS with constant K ≥ 1, whose distortion parameter satisfies r 2  m ln(m) ξ . min ,1 . N Then there exist a function L(N, s, ε, K) depending at most polylogarithmically on N and s such that the following holds. For every N ∈ N and ε ∈ (0, 1), assume that the sparsity s satisfies √ ε N s. , 1 L(N, s, ε, K) ln 2 (N ) and consider a number of measurements m ∼ s L(N, s, ε, K). Let ∆η be the QCBP decoder defined in (3). Then for every x ∈ CN , e ∈ Cm , the following robust error estimate holds kx − ∆η (Ax + e)k2 . 1 σs (x)1 √ + η + L 2 (N, s, ε, K) max{kek2 − η, 0}, s with probability at least 1 − ε. A possible choice for L(N, s, ε, K) is given by (31) with δ = 1/2 and ε/2 in place of ε. The recovery result does not rely on any assumption on the error e, but it has three main limitations: (1) The term max{kek2 − η, 0} in the error estimate is multiplied by a polylogarithmic factor. (2) We require an upper bound to the distortion parameter ξ, which has to√be computed on a case-by-case basis. (3) The sparsity level is limited to the regime s . ε N . In particular, the linear dependence on ε prevents us from asserting that the theorem holds with ‘overwhelmingly’ high probability. 7 In Section 4.4 we discuss the case of subsampled isometries with random independent samples. This allows us to employ the theory showed for BOSs (notice that in this case we have ξ = 0), resulting in Theorem 4.13. √ The dependence of s on ε is improved, in that the sparsity 2 is required to satisfy s . ln( 2−ε ) N. Finally, in Section 4.5 we discuss robustness to unknown error for subsampled isometries randomly generated via Bernoulli selectors and with the random subset model. p In∗both cases, the sensing matrix A cannot have repeated rows and, consequently, σmin ( m A ) = 1 with N probability 1. Therefore, robustness to unknown error is guaranteed under the restricted isometry property due to Corollary 2.23 (or, more in general, under the robust null space property due to Theorem 2.22). In particular, for subsampled isometries via Bernoulli selectors, provided that the isometry U ∈ CN×N to be subsampled satisfies K max |Uij | ≤ √ , N i,j∈[N] and that m ∼ K 2 s ln2 (s) ln2 (N ), the following robust recovery error estimate holds for every x ∈ CN and e ∈ Cm with high probability: kx − ∆η (Ax + e)k2 . σs (x)1 √ + η + K ln(s) ln(N ) max{kek2 − η, 0}, s where ∆η is the QCBP decoder defined in (3). Remarkably, there is no need to assume any restriction on the sparsity level as in the previous results. In particular, being s independent of the probability of failure of the recovery error estimate, in this case QCBP is robust to unknown error with ‘overwhelmingly’ high probability. Moreover, there is no restriction on m, in contrast to the Gaussian case where m ≤ N/2. 1.2.4 Examples Section 5 is devoted to discussing the application of our robustness analysis to concrete examples of BOSs, usually employed in CS: (1) The partial discrete Fourier transform, which is a particular case of subsampled isometry with K = 1. (2) Nonharmonic Fourier measurements, where K = 1 and ξ = 0. (3) Random sampling from orthogonal Chebyshev polynomials, where p K > 1 and the distortion ξ can be explicitly bounded from above as ξ . m/N (Proposition 5.1). Finally, we present some numerical experiments to show the reliability of our analysis and discuss an application to one-dimensional polynomial approximation. 1.3 Related literature Here we review the main results on the robustness analysis of CS. This is not intended to be an exhaustive literature review, due to the large volume of papers published on CS after 2006. For a wider discussion we refer the reader to [24, Chapter 11]. 1.3.1 Basis pursuit When considering the BP program, it is possible to show recovery estimates analogous to (4) where η is replaced by kek2 in the case of random Gaussian matrices [37]. Namely, kx − ∆0 (Ax + e)k2 . 8 σs (x)1 √ + kek2 . s These estimates are based on the so-called quotient property (introduced in the context of CS in [37]), which is known to be fulfilled only by random Gaussian matrices [37] and by Weibull matrices [23]. In [19] the quotient property relative to the modified norm kyk(N,m) := p max{kyk2 , ln(eN/m))kyk∞ } is shown for Bernoulli matrices, i.e., kek2 is replaced by kek(N,m) above. See Sections 2.2 and 3 for further comments on these results. 1.3.2 Quadratically-constrained basis pursuit In [26] the authors study the robustness of QCBP under noise, where both the matrix and the measurements are perturbed, namely (A + E)x = y + e. The sth restricted isometry constant of A + E is shown to depend on the sth restricted isometry constant of A and on a suitable (s) constant εA that controls the sensing matrix’s perturbation, namely kEk(s) (s) ≤ εA , kAk(s) where, given an m × N matrix M, the quantity kMk(s) denotes the maximum over all the spectral norms of the m × s submatrices of M (see [26, Theorem 1]). Moreover, the authors give a robust recovery result for QCBP associated with the perturbed sensing matrix and with the perturbed measurement vector. In [26, Theorem 2] it is proved that the recovery error of QCBP satisfies (4) when the parameter η is chosen in a suitable way. (s) However, the sufficient condition on η depends on the perturbation measure εA , on similar measures controlling the perturbation e over the measurements, on the sparsity level s, and on the exact solution x. In particular, this result is still dependent on some a priori information on kek2 . 1.3.3 Alternatives to basis pursuit Similar robust recovery estimates are also available for algorithms such as Iterative Hard Thresholding (IHT), Compressive Sampling Matching Pursuit (CoSaMP), and Orthogonal Matching Pursuit (OMP). In all these cases it is possible to prove that kx − ∆s (Ax + e)k2 . σs (x)1 √ + kek2 , s where ∆s is the decoder associated with the aforementioned algorithms, depending on the desired sparsity level s. Although not requiring any information about the error e, all these techniques require an a priori knowledge of the sparsity level s that is not necessary for QCBP. The robustness analysis of IHT, CoSaMP, and OMP can be found in [24, Theorem 6.21], [24, Theorem 6.25], and [24, Theorem 6.28], respectively. These results are improvement over arguments presented in [4] for IHT, [28] for CoSaMP, and [39] for OMP. It is also worth mentioning the recovery analysis carried out in [13]. The authors study the LASSO unconstrained minimization program min kzk1 + λkAz − yk22 z∈CN The main advantage of their “RIPless” theory is that – as suggested by the name – it is not based on the RIP, but mainly on the notion of incoherent measurements. However, the choice of the parameter λ depends on the variance of the noise e (here assumed to be Gaussian). As a consequence, some a priori information about the measurement corruption is still required. In [30] the authors provide recovery error estimates for the so-called K-LASSO optimization program min kAz − yk2 , s.t. z ∈ K, z∈CN 9 Figure 2: Conceptual map of the robustness theory presented in this paper. where K is a given subset of CN , which usually models some structure in the signal. Moreover, y is assumed to depend nonlinearly on Ax, as in the case of 1-bit CS [6] and of binary statistical models [18, 29]. 2 Robustness to unknown error In this section we present the theoretical analysis that establishes the robustness to unknown error for QCBP in a very general framework. After recalling the concepts of robust null space property and of restricted isometry property of CS in Section 2.1, we introduce the notions of quotient and simultaneous quotient in Section 2.2. Finally, in Section 2.3 we introduce the notion of robust instance optimality and prove that under the robust null space property (or the restricted isometry property) and under a suitable control over the quotient, QCBP is robust to unknown error. See also Figure 2 for a conceptual map of the notions and results presented in this section. 2.1 Robust null space and restricted isometry properties We introduce the robust null space property and the restricted isometry constants. These are nowadays considered standard tools for the theoretical analysis of CS. We refer the reader to [24, Chapter 4] and [24, Chapter 6] for more details and an extensive literature review. For the sake of generality, in this section and in the following one we will present the definitions and the results considering the ℓq norm with q ≥ 1 on CN and a generic norm k · k 10 on Cm . However, it is worth keeping in mind that the framework corresponding to q = 2 and k · k = k · k2 is of particular interest. Definition 2.1 (ℓq -robust null space property). Given q ≥ 1, the matrix A ∈ Cm×N satisfies the ℓq -robust null space property of order s relative to a norm k · k on Cm with constants 0 < ρ < 1 and τ > 0 if, for any set S ⊆ [N ] with |S| ≤ s, the following inequality holds kzS kq ≤ s1/q−1 ρkzS k1 + τ kAzk, ∀z ∈ CN . Under the robust null space property, it is possible to prove a useful and quite general technical result that will be a fundamental building block to produce robust recovery error estimates for QCBP with respect to the ℓp norm. This is stated in the following result (see [24, Theorem 4.25]): Theorem 2.2. Given 1 ≤ p ≤ q, suppose that the matrix A ∈ Cm×N satisfies the ℓq -robust null space property of order s with constants 0 < ρ < 1 and τ > 0 relative to k · k. Then for any z, w ∈ CN , the following inequality holds kz − wkp ≤ C D (kzk1 − kwk1 + 2σs (w)1 ) + 1/q−1/p kA(z − w)k, s1−1/p s where C := (1 + ρ)2 /(1 − ρ) and D := (3 + ρ)τ /(1 − ρ). We recall the definition of restricted isometry constants and of restricted isometry property, ubiquitous in the CS literature. Definition 2.3 (Restricted isometry constants). The sth restricted isometry constant δs (A) of a matrix A ∈ Cm×N is the smallest constant δ ≥ 0 such that (1 − δ)kzk22 ≤ kAzk22 ≤ (1 + δ)kzk22 , ∀z ∈ ΣN s . (6) If (6) holds with 0 < δ < 1, then A is said to have the restricted isometry property. The following result gives a sufficient condition on the (2s)th restricted isometry constant for the ℓ2 -robust null space property to hold (see [24, Theorem 6.13]). Theorem 2.4. If the (2s)th restricted isometry constant of A ∈ Cm×N obeys 4 δ2s (A) < √ ≈ 0.6247, 41 then the matrix A satisfies the ℓ2 -robust null space property of order s relative to k · k2 on Cm with constants 0 < ρ < 1 and τ > 0 depending only on δ2s (A). In particular, p 1 + δ2s (A) δ2s (A) , τ = p . (7) ρ= p 2 1 − δ2s (A) − δ2s (A)/4 1 − δ2s (A)2 − δ2s (A)/4 Theorems 2.2 and 2.4 immediately imply robust recovery error estimates with respect to the ℓp norm for 1 ≤ p ≤ 2 for QCBP under the regime kek ≤ η and when δ2s (A) is bounded. p Remark 2.5. We note (t − 1)/t with t ≥ 4/3 (that √ that in [12] the condition δts (A) < becomes δ2s (A) < 1/ 2 by choosing t = 2) has been proved to guarantee robust recovery of QCBP when kek2 ≤ η. Yet, in our analysis we need a sufficient condition on the restricted isometry constant such that the ℓ2 -robust null space property holds and this is√not explicitly discussed in [12]. For this reason, we decided to keep the condition δ2s (A) < 4/ 41. 11 2.2 Quotients and quotient properties The quotient property is the main tool underlying all the the robust recovery results published in the CS literature so far (see Section 1.3). This property was introduced in the CS context by Wojaszczyk in [37] and generalized later by Foucart in [23]. It has been proved to hold for random Gaussian, subgaussian (in particular, Bernoulli), and Weibull matrices. See [24, Chapter 11] for further details and more pointers to the literature. In this section, we revisit the quotient property by proposing a novel formalization of it based on some sup-inf constants called quotients. These objects will make the role played by the quotient property more transparent and will allow us to generalize some CS robustness results in Section 2.3. The section is divided in two main parts. First, we introduce the notions of quotient and of simultaneous quotient and study how they interrelate (Section 2.2.1). Then we examine the tight link between the quotients and the quotient property in its different declinations and make some historical remarks on the different versions of quotient property published in the literature so far (Section 2.2.2). 2.2.1 Quotients We introduce some sup-inf constants called quotients, that will be directly linked to the constants used in the quotient property. In particular, we define two different types of quotients, called the ℓq -quotient and the simultaneous (ℓq , ℓ1 )-quotient. First, we define the concept of ℓq -quotient. For every error e ∈ Cm with kek > η, it measures the discrepancy between the amount of error norm exceeding the QCBP threshold η and the ℓq norm of the vectors in the feasible set of QCBP with measurements y = e. Definition 2.6 (Quotient). Given q ≥ 1, λ > 0, and A ∈ Cm×N , we define the ℓq -quotient of order λ and threshold η relative to the norm k · k on Cm as Qλ (A, η)q := sup inf z∈CN e∈Cm kek>η kAz−ek≤η λ1/2−1/q kzkq . kek − η (8) In order to simplify the notation, we also define Qλ (A)q := Qλ (A, 0)q . m If there exists a vector e ∈ C with kek > η such that the feasible set {z ∈ C is empty, then we define Qλ (A, η)q = +∞. (9) N : kAz − ek ≤ η} Notice the presence of the threshold parameter η, which will let us generalize the robust recovery results for BP to novel robust recovery results for QCBP. Remark 2.7. In (8), the infimum is actually a minimum because of the convexity of the map z 7→ kzkq for q ≥ 1 and of the set {z ∈ CN : kAz − ek ≤ η}. We also define the simultaneous quotient, strictly related to the simultaneous quotient property. For every error e ∈ Cm with kek > η, the simultaneous (ℓq , ℓ1 )-quotient measures the discrepancy between the amount of error norm exceeding the QCBP threshold η and a suitable combination between the ℓq norm and the ℓ1 norm of the vectors in the feasible set of QCBP with measurements y = e. Definition 2.8 (Simultaneous quotient). We define the simultaneous (ℓq , ℓ1 )-quotient of order λ and threshold η relative to the norm k · k on Cm as Qλ (A, η)q,1 := sup m inf N z∈C e∈C kek>η kAz−ek≤η 12 λ1/2−1/q kzkq + λ−1/2 kzk1 . kek − η (10) In order to simplify the notation, we also define Qλ (A)q,1 := Qλ (A, 0)q,1 . If there exists a vector e ∈ Cm with kek > η such that the feasible set {z ∈ CN : kAz − ek ≤ η} is empty, then we define Qλ (A, η)q,1 = +∞. Remark 2.9. Analogously to Remark 2.7, we notice that the infimum in (10) is actually a minimum. The following lemma shows that the quotients Qλ (A)1 and Qλ (A)q,1 control all the quotients of the same order for any value of the threshold parameter η. Lemma 2.10. For every η ≥ 0, q ≥ 1, and λ > 0, the following upper bounds hold Qλ (A, η)q ≤ Qλ (A)q and Qλ (A, η)q,1 ≤ Qλ (A)q,1 . m Proof. We prove the first upper z ∈ CN such that √ bound. For any e ∈ C , consider a vector e Ae z = e and that ke zkq /(kek λ) ≤ Qs (A)1 (such a vector exists due to Remark 2.7). Then, defining z := (1 − η/kek)e z, we have kAz − ek = η and λ1/2−1/q kzkq λ1/2−1/q ke zkq = ≤ Qλ (A)1 . kek − η kek Since e ∈ Cm was arbitrary, we get Qλ (A, η)1 ≤ Qλ (A)1 . The inequality Qλ (A, η)q,1 ≤ Qλ (A)q,1 can be proved using an analogous argument and recalling Remark 2.9. Now, we prove a crucial property of the quotients. Under the ℓq -robust null space property, the simultaneous (ℓq , ℓ1 )-quotient is dominated by the ℓ1 -quotient up to a multiplicative constant and an additive constant that are related to the ℓq -robust null space property. Therefore, the ℓ1 -quotient Qλ (A)1 is the only object that needs to be studied in order to control all the other (simultaneous) quotients. Let us first we recall a technical lemma that relates the best s-term approximation with respect to the ℓq norm and the ℓp norm of a vector (see [24, Proposition 2.3]). Lemma 2.11. For every 0 < p ≤ q, we have σs (x)q ≤ s1/q−1/p kxkp . Proposition 2.12. Fix q ≥ 1 and A ∈ Cm×N . Then, if A satisfies the ℓq -robust null space property of order s with constants 0 < ρ < 1 and τ > 0 relative to the rescaled norm s1/q−1/2 k·k on Cm , the following bound holds Qs (A)q,1 ≤ (ρ + 2)Qs (A)1 + τ, (11) where the quotients are relative to the norm k · k on Cm . Proof. Fix an arbitrary vector e ∈ Cm and choose a vector z ∈ CN such that Az = e and that kzk1 ≤ s1/2 Qs (A)1 kek. (12) Now, consider a set S ⊆ [N ] of cardinality s that contains the s largest entries of z. Lemma 2.11 with p = 1 ensures that kzS kq = σs (z)q ≤ s1/q−1 kzk1 . (13) Additionally, the ℓq -robust null space property relative to the rescaled norm s1/q−1/2 k·k implies kzS kq ≤ ρs1/q−1 kzS k1 + τ s1/q−1/2 kAzk ≤ ρs1/q−1 kzk1 + τ s1/q−1/2 kek. 13 (14) Therefore, considering the splitting z = zS + zS and combining inequalities (12), (13), and (14) yields kzkq ≤ kzS kq + kzS kq ≤ (ρ + 1)s1/q−1 kzk1 + τ s1/q−1/2 kek ≤ s1/q−1/2 [(ρ + 1)Qs (A)1 + τ ]kek. Finally, using the latter inequality and (12) again, we have s1/2−1/q kzkq + s−1/2 kzk1 ≤ [(ρ + 2)Qs (A)1 + τ ]kek, which implies (11) since e ∈ Cm was arbitrary. 2.2.2 Quotient properties In order to put the concepts of quotient and of simultaneous quotient in context, we discuss the notions of quotient property and of simultaneous quotient property. In particular, after reviewing various versions of quotient property published in the literature, we will establish some rigorous relation between quotients and quotient properties. We start by introducing the original definition of quotient property given by Wojtaszczyk [37] and its generalization due to Foucart [23]. Definition 2.13 (Quotient property of Wojtaszczyk). We say that A ∈ Cm×N satisfies the ℓ1 -quotient property with constant α > 0 if AB1N ⊇ αB2m , where Bpn denotes the ℓp -unit ball in Cn . Definition 2.14 (Quotient property of Foucart). Given p ≥ 1, the matrix A ∈ Cm×N is said to satisfy the ℓq -quotient property with constant d relative to a norm k · k on Cm if ∀e ∈ Cm , ∃z ∈ CN such that Az = e and kzkq ≤ ds1/q−1/2 kek, ∗ where m . (15) ln(eN/m) These two quotient properties are actually equivalent and the constants α and d employed in their definitions are strictly related to the quotient Qλ (A)1 . s∗ := Proposition 2.15. For any A ∈ Cm×N , the following are equivalent: (i) A satisfies the ℓ1 -quotient property of Foucart with constant d and relative to k · k2 ; (ii) A satisfies the ℓ1 -quotient property of Wojtaszczyk with α = 1/(ds∗ ) and s∗ defined as in (15). Moreover, A satisfies the ℓq -quotient property of Foucart with constant d and relative to k · k if and only if Qs∗ (A)q ≤ d, where Qs∗ (A)q is the quotient defined in (9). Proof. If (i) holds, then for every e ∈ αB2m , there exists a z ∈ CN such that Az = e and kzk1 ≤ ds∗ α. Since α = 1/(ds∗ ), we get (ii). Conversely, assume (ii). Then, for every e ∈ Cm , define ê = αe/kek2 ∈ αB2m . Thanks to (ii), there exists a ẑ ∈ B1N such that Aẑ = ê, i.e., such that A(ẑkek2 /α) = e. We conclude by observing that z = ẑkek2 /α satisfies kzk1 ≤ kek2 /α. Let us now deal with the second part of the statement. On the one hand, recalling (8) and Remark 2.7, we see that 1/2−1/q Qs∗ (A)q = sup min e∈Cm \{0} z∈CN Az=e 14 s∗ kek kzkq , implies the property ∀e ∈ Cm \ {0}, ∃z ∈ CN such that Az = e and kzkq ≤ Qs∗ (A)q s1/q−1/2 kek. ∗ Note that the case e = 0 is trivial. On the other hand, if ∀e ∈ Cm , ∃z ∈ CN such that Az = e and kzkq ≤ ds1/q−1/2 kek, ∗ then we have 1/2−1/q sup e∈Cm \{0} min s∗ z∈CN Az=e kek kzkq ≤ d, which reads Qs∗ (A)q ≤ d. A variation on the idea of ℓq -quotient property, is the simultaneous (ℓq , ℓ1 )-quotient property. We define this property and the corresponding simultaneous quotient. This idea was originally used in the works of Wojtaszczyk, but its formalization is due to Foucart Definition 2.16 (Simultaneous quotient property). Given q ≥ 1, a matrix A ∈ Cm×N has the simultaneous (ℓq , ℓ1 )-quotient property with constants d and d′ relative to a norm k · k on Cm if, ( 1/q−1/2 kzkq ≤ ds∗ kek, m N ∀e ∈ C , ∃z ∈ C such that Az = e and 1/2 kzk1 ≤ d′ s∗ kek, where s∗ is defined as in (15). We clarify the relation between the simultaneous (ℓq , ℓ1 )-quotient property and Qλ (A)q,1 in the following result, whose proof is similar to that of Proposition 2.15 and is therefore left to the reader. Proposition 2.17. Fix A ∈ Cm×N and define s∗ as in (15). Then, the following facts hold: (i) If A satisfies the simultaneous (ℓq , ℓ1 )-quotient property with constants d and d′ relative to k · k, then Qs∗ (A)q,1 ≤ d + d′ . (ii) A satisfies the simultaneous (ℓq , ℓ1 )-quotient property with constants d = d′ = Qs∗ (A)q,1 relative to k · k (notice that, as a limit case, we can have d = d′ = +∞). 2.3 Robust instance optimality Equipped with the notions of quotient and simultaneous quotients introduced in Section 2.2, in this section we provide robust recovery results under unknown error. The roadmap is the following. First, after recalling the definition of instance optimality for an encoder-decoder pair (Definition 2.18), we generalize it by introducing the concept of robust instance optimality (Definition 2.19). Then, we prove that robust instance optimality implies robust recovery error estimates under unknown error depending on the simultaneous quotient Qs (A)q,1 (Theorem 2.21). Finally, taking advantage of Proposition 2.12, we prove robust recovery error estimates under unknown error for the QCBP decoder depending on the quotient Qs (A)1 , based on the robust null space property (Theorem 2.22) and on the restricted isometry property (Corollary 2.23). We start by recalling the notion of instance optimality for an encoder-decoder pair, introduced in the context of CS in 2008 by Cohen, Dahmen, and DeVore [17]. Definition 2.18 (Instance optimality). Given a matrix A ∈ Cm×N and a decoder ∆ : Cm → P(CN ), the pair (A, ∆) is called mixed (ℓq , ℓp )-instance optimal of order s with constant C if kx − ∆(Ax)kq ≤ C σs (x)p , s1/p−1/q 15 ∀x ∈ CN . Notice that this definition considers only the noise-free setting, i.e. with e = 0. Moreover, the exponent 1/p − 1/q of s is optimal (see [24, Remark 11.3]). In order to take care of the noisy setting, where e 6= 0, we generalize the notion of mixed (ℓq , ℓp )-instance optimality by introducing the η-robust mixed (ℓq , ℓp )-instance optimality, where a noise of limited norm is admitted in the model, i.e., kek ≤ η. Definition 2.19 (Robust instance optimality). Given η ≥ 0, a matrix A ∈ Cm×N , and a decoder ∆η : Cm → P(CN ), the pair (A, ∆η ) is said to be η-robustly mixed (ℓq , ℓp )-instance optimal of order s with constants C, D > 0 relative to the norm k · k on Cm if kx − ∆η (Ax + e)kq ≤ 1 1 C σs (x)p + Ds q − 2 η, s1/p−1/q ∀x ∈ CN , ∀e ∈ Cm s.t. kek ≤ η. Observe that for η = 0 we recover the previous notion of mixed (ℓq , ℓp )-instance optimality. The next theorem is the generalization of a well-known result, that states that the robust null space property for a matrix A is a sufficient condition for the pair (A, ∆η ), where ∆η is the QCBP decoder defined in (3), to be η-robustly mixed instance optimal. The very first version of this result dates back to the dawn of CS, where the null space property was called cone constraint [15]. The result stated here generalizes [24, Theorem 4.22] with a general norm k · k on Cm in place of k · k2 and the ℓq -robust null space property in place of the ℓ2 -robust null space property. Theorem 2.20 (Robust null space property ⇒ Robust instance optimality). Suppose that the matrix A ∈ Cm×N satisfies the ℓq -robust null space property of order s with constants 0 < ρ < 1 and τ > 0 relative to the rescaled norm s1/q−1/2 k · k on Cm . Then, the pair (A, ∆η ), where ∆η : Cm → P(CN ) is the QCBP decoder (3), is η-robustly mixed (ℓp , ℓ1 )-instance optimal of order s for every 1 ≤ p ≤ q, with constants C = 2(1 + ρ)2 /(1 − ρ) and D = 2(3 + ρ)τ /(1 − ρ) relative to k · k. b(η). Proof. This is a direct consequence of Theorem 2.2 with z = x Moreover, the following theorem shows that robust instance optimality implies robustness to unknown error up to the quotient Qs (A)q,1 : Theorem 2.21 (Robust instance optimality ⇒ Robustness to unknown error). Let η ≥ 0, A ∈ Cm×N , and ∆η : Cm → P(CN ) be a decoder. Fix s ≤ m. If the pair (A, ∆η ) is η-robustly (ℓq , ℓ1 )-instance optimal of order s with constants C, D and with respect to k · k. Then, for every x ∈ CN and e ∈ Cm , it holds kx − ∆η (Ax + e)kq ≤ 1−1 C σs (x)1 + s q 2 (D η + E max{kek − η, 0}), 1−1/q s where E = max{C, 1} Qs (A)q,1 . Proof. Fix η ≥ 0 and consider an arbitrary vector e ∈ Cm . If kek ≤ η, the result is proved by definition of η-robust mixed (ℓq , ℓ1 )-instance optimality. Let us therefore assume kek > η. Recalling Lemma 2.10, we pick a vector z ∈ CN such that kAz − ek ≤ η and that s1/2−1/q kzkq + s−1/2 kzk1 ≤ Qs (A)q,1 . kek − η (16) Notice that if such a vector z does not exists, we have Qs (A)q,1 = +∞ (see Remark 2.9) and, as a consequence, the thesis holds trivially. 16 Now, taking advantage of the η-robust mixed (ℓq , ℓ1 )-instance optimality property of order s, for any x ∈ CN we have the chain of inequalities kx − ∆η (Ax + e)kq = kx + z − ∆η (Ax + Az + e − Az) − zkq ≤ k(x + z) − ∆η (A(x + z) + (e − Az))kq + kzkq 1 1 C ≤ 1−1/q σs (x + z)1 + Ds q − 2 η + kzkq s 1 1 kzk1 C ≤ 1−1/q σs (x)1 + Ds q − 2 η + C 1−1/q + kzkq . s s Note that we used the inequality σs (x + z)1 ≤ σs (x)1 + kzk1 in the last step. To conclude, we observe that C kzk1 s1/2−1/q kzkq + s−1/2 kzk1 + kzkq ≤ max{C, 1} (kek − η), 1−1/q s s1/2−1/q (kek − η) and exploit inequality (16). As a result, the robust null space property for A is a sufficient condition to have robustness to unknown error up to Qs (A)1 . Theorem 2.22 (Robust null space property ⇒ Robustness to unknown error of QCBP). Consider a matrix A ∈ Cm×N that satisfies the ℓq -robust null space property of order s with constants 0 < ρ < 1 and τ > 0 relative to the rescaled norm s1/q−1/2 k · k. Then, for every x ∈ CN , e ∈ Cm , η ≥ 0, and 1 ≤ p ≤ q the following estimate holds kx − ∆η (Ax + e)kp ≤ 1−1 C σs (x)1 + s p 2 (Dη + E max{kek − η, 0}), 1−1/p s (17) where ∆η is the QCBP decoder defined in (3) and C= 2(1 + ρ)2 , 1−ρ D= 2(3 + ρ)τ , 1−ρ E = C [(ρ + 2)Qs (A)1 + τ ]. (18) Proof. Thanks to Theorem 2.20, the pair (A, ∆η ) is robustly (ℓp , ℓ1 )-instance optimal with constants C = 2(1 + ρ)2 /(1 − ρ) and D = 2(3 + ρ)τ /(1 − ρ) for every 1 ≤ p ≤ q. The conclusion follows by applying Lemma 2.21 and by noticing that Qs (A)q,1 ≤ (ρ + 2)Qs (A)1 + τ thanks to Lemma 2.12. The estimate (17) depends linearly on max{kek − η, 0} and the effect of this term amplified essentially only by the ℓ1 -quotient Qs (A)1 , where s is the order the robust null space property that A satisfies. As an immediate consequence, we have that the restricted isometry property implies a robust recovery result up to the quotient Qs (A)1 . Remarkably, in (17) the constants C, D, which multiply the best s-term approximation error and the threshold parameter η, depend only on δ2s (A) and E, which multiplies the norm of the unknown error, depends on δ2s (A) and on Qs (A)1 . This makes the role of the quotient totally transparent. Corollary 2.23 (Restricted isometry property ⇒ Robustness to unknown error of QCBP). Assume that the (2s)th restricted isometry constant of A ∈ Cm×N satisfies 4 δ2s (A) < √ . 41 Then, for every x ∈ CN , e ∈ Cm , η ≥ 0, and 1 ≤ p ≤ 2 the following estimate holds kx − ∆η (Ax + e)kp ≤ 1 1 C σs (x)1 + s p − 2 (Dη + E max{kek − η, 0}), s1−1/p 17 where C, D, E are defined as in (18) and where, in turn, the dependency of 0 < ρ < 1 and τ > 0 on δ2s is expressed as in (7). In particular, the constants C, D depend only on δ2s (A) and E depends on δ2s (A) and on Qs (A)1 . Proof. Thanks to Theorem 2.4 the matrix A satisfies the ℓ2 -robust null space property of order s relative to k·k with constants 0 < ρ < 1 and τ > 0 defined as in (7). We conclude by applying Theorem 2.22 with q = 2. Using Corollary 2.23, we can produce robust recovery error estimates for QCBP whenever we are able to control δ2s (A) and Qs (A)1 in probability. This will be the strategy followed in the forthcoming sections. 3 Random Gaussian matrices We apply the general theory of Section 2 to the case of random Gaussian matrices. In particular, in order to obtain bounds of the form Qs (A)1 . 1 in probability, we exploit already published results, mainly corresponding to the works [19, 37] for Gaussian and subgaussian matrices. Notice that these results can be extended to random Weibull matrices by resorting to the results shown in [23]. Our main reference for this section is [24, Chapter 11]. In this section, we consider m × N sensing matrices A with real entries defined as A = m−1/2 G, (19) where G is a random Gaussian matrix. Namely, the entries of G are independent standard Gaussian random variables Gij ∼ N (0, 1). We start by recalling an already known result. Namely, the ℓ1 -quotient Qs∗ (A)1 , with s∗ defined as in (15), of a random Gaussian matrix A is uniformly bounded from above with high probability. Lemma 3.1 (Quotient bound in probability for random Gaussian matrices). Let A be an m × N random Gaussian matrix defined as in (19). Then, provided m ≤ N/2, we have P{Qs∗ (A)1 ≤ 34} ≥ 1 − exp(−m/100). where s∗ = m/ ln(eN/m) and the ℓ1 -quotient is relative to k · k2 on Cm . Proof. The lemma is a direct consequence of [24, Theorem 11.19], and Proposition 2.15. The following restricted isometry property result for random Gaussian matrices is a direct consequence of [24, Theorem 9.27] and of [24, Remark 9.28]. Lemma 3.2 (Restricted isometry property for Gaussian matrices). Let A be an m × N matrix defined as in (19) with m < N . There exists a universal constant c < 81 such that the following holds. For δ, ε ∈ (0, 1), assume that m ≥ c δ −2 [s ln(eN/s) + ln(2ε−1 )]. Then, P{δs (A) ≤ δ} ≥ 1 − ε. Combining these two results, we give a robust recovery result for QCBP with random Gaussian measurements. 18 Theorem 3.3. Let s ≤ m ≤ N/2 and A be a random Gaussian matrix defined as in (19). Then, there exist universal constants c, C, D, E > 0 such that the following holds. Consider a number of measurements m ≥ c (s ln(eN/s) + ln(3ε−1 )). (20) Then, for every x ∈ CN , e ∈ Cm , 1 ≤ p ≤ 2, and s ≤ s∗ = m/ ln(eN/m), the following estimate holds Cσs (x)1  s∗  p1 − 21 (Dη + E max{kek2 − η, 0}), (21) kx − ∆η (Ax + e)kp ≤ 1−1/p + s c with probability at least 1 − ε. Proof. We define the events ΩRIP := {δ2s (A) ≤ δ} and ΩQ := {Qs∗ (A)1 ≤ 34}. Observe that condition (20) with c = 1417 implies m ≥ c(s ln(eN/(2s)), which, in turn, implies the condition   2c′ δ −2 m≥ s ln(eN/(2s)), 1 + c′ δ −2 /300 √ with c′ = 81, δ = 0.62 < 4/ 41. This is, in turn, equivalent to m ≥ c′ δ −2 [2s ln(eN/(2s)) + ln(2/e ε)], where εe = 2 exp(−m/300). Therefore, thanks to Lemma 3.2, we have P(ΩRIP ) ≥ 1 − 2 exp(−m/300). Moreover, condition (20) also implies s≤ s∗ m ≤ . c ln(eN/s) c (22) Therefore, after observing that P(ΩRIP ∩ ΩQ ) ≥ 1 − exp(−m/100) − 2 exp(−m/300) ≥ 1 − 3 exp(−m/300), we apply Corollary 2.23 inside the event ΩRIP ∩ ΩQ with s = ⌊s∗ /c⌋, which is a valid choice due to (22). Noticing that the function s 7→ σs (x)1 /s1−1/p is nonincreasing and that, inside ΩQ , we have s √ s∗ /c √ Q⌊s∗ /c⌋ (A) = cQs∗ (A) ≤ 2cQs∗ (A) ≤ 1811, ⌊s∗ /c⌋ we conclude that (21) holds with probability at least 1 − 3 exp(−m/300). Finally, notice that we have 3 exp(−m/300) ≤ ε for m ≥ 300 ln(3ε−1 ), which is, in turn, ensured by (20) since c = 1147 ≥ 300. Remark 3.4. Tracking the constants in the proof of Theorem 3.3, and using the fact that c′ < 81 (see Lemma 3.2), we can show some upper bounds for the universal constants, employing relations (18) and (7). Namely, c ≤ 1417, C ≤ 517, D ≤ 1057, and E ≤ 5707478. These bounds can be further optimized by replacing Lemma 3.2 with more accurate restricted isometry property results for random Gaussian matrices (see [24, Theorem 9.27]). Moreover, notice that choosing δ < 0.62 in the proof leads to larger values for c and smaller values for C, D, and E. It is possible to prove a result analogous to Theorem 3.3 for subgaussian matrices by replacing k · k2 with the norm p k · k(m,N) = max{k · k2 , ln(eN/m)k · k∞ }. A particular application in this case are random Bernoulli matrices. For further details, we refer the reader to [24, Chapter 11]. 19 4 Random matrices with heavy-tailed rows While Gaussian random matrices lead to convenient estimates in the noise-blind case, they are largely impractical in applications of CS. The goal of this section is to produce robust recovery error estimates for QCBP when the sensing matrix A has heavy-tailed rows, taking advantage of the general robustness analysis based on quotients carried out in Section 2. First, in Section 4.1 we provide upper and lower bounds for the ℓ1 -quotient based on the minimum singular p ∗ value of the matrix m A . Then, in Section 4.2 we deal with deviation inequalities in probaN bility and in expectation for the singular values of random matrices with heavy-tailed columns. Finally, combining results from Sections 4.1 and 4.2, we prove the robustness to unknown error of QCBP for random sampling matrices associated with bounded orthonormal systems (Section 4.3), which includes the case of subsampled isometries with random independent samples (Section 4.4) and in Section 4.5 we discuss robustness to unknown error for subsampled isometries randomly generated via Bernoulli selectors and with the random independent subset model. 4.1 Quotient estimates based on singular value analysis We prove a lemma that links the ℓ1 -quotient to the minimum singular value of the matrix p mfirst ∗ A . In the following, we will arrange the singular values of the N × m matrix A∗ as N σmax (A∗ ) = σ1 (A∗ ) ≥ σ2 (A∗ ) ≥ · · · ≥ σm (A∗ ) = σmin (A∗ ), recalling that they are the eigenvalues of the m × m matrix (AA∗ )1/2 . Proposition 4.1 (Quotient bounds). For any matrix A ∈ Cm×N , the following upper bound holds r m 1 pm , (23) Qλ (A)1 ≤ σmin ( N A∗ ) λ where the quotient is relative to k · k2 on Cm . Moreover, if there exists a constant K > 0 such that K max |Aij | ≤ √ , (24) i∈[m], j∈[N] m the following lower bound holds r m 1 . (25) Qλ (A)1 ≥ K λ Proof. We first deal with the upper bound. Notice that if A does not have full rank, then the claim is trivial since the right-hand side of (23) is equal to +∞. Therefore, we assume A of full rank. In this case, the matrix A admits a right Moore-Penrose pseudoinverse A† = A∗ (AA∗ )−1 . Consequently, we produce an upper bound to the ℓ1 -quotient by considering the ansatz z = A† e, for every e ∈ Cm . In particular, after observing that √ √ √ N kek2 mkek2 p kA† ek1 ≤ N kA† k2 kek2 = , = σmin (A∗ ) σmin ( m A∗ ) N and that A(A† e) = e, we have the estimate kA† ek1 kzk1 ≤ sup √ . Qλ (A)1 = sup inf √ e∈Cm e∈Cm z∈CN λkek2 λkek2 Az=e Combining the two latter inequalities yields (23). 20 Conversely, assume that the matrix A ∈ Cm×N satisfies (24). Then, considering a vector f ∈ Cm with f1 = 1, for any z ∈ CN such that Az = f , we have 1 = f1 = (Az)1 = N X j=1 Aij zj ≤ Kkzk1 √ . m (Notice that if such a vector z does not exist, then, by definition, Qλ (A)1 = +∞ and (25) holds trivially). As a consequence, the ℓ1 -quotient can be bounded from below as r kzk1 1 m kzk1 Qλ (A)1 = sup inf √ ≥ inf √ ≥ . N K λ z∈CN λkek2 λkei k2 e∈Cm z∈C e6=0 Az=e Az=ei This completes the proof. This result shows that we can produce robustprecovery estimates for arbitrary sensing A∗ ). In the following section, we will matrices A whenever we are able to estimate σmin ( m Np provide a recipe to estimate the probability that σmin ( m A∗ ) & 1. As a consequence, this N p will imply that Qs (A)1 . m/s in probability. In the case of random sampling from bounded orthonormal systems, discussed in Section 4.3, p condition (24) holds and Proposition 4.1 shows thatp Qs (A)1 scales like m/s up to a constant factor larger than 1/K and smaller than 1/σmin ( m A∗ ). In particular, the upper bound N p m/s is sharp. 4.2 Deviation inequalities for singular values In this section, we prove deviation inequalities in expectation and in probability for the minimum singular value of random matrices having heavy-tailed independent isotropic columns, employing tools and ideas from [36]. First, we recall the definition of an isotropic random vector. Definition 4.2 (Isotropic random vector). A random vector z is isotropic if E[zz∗ ] = I. It is immediate to verify the following property (see [36, Lemma 5.20]). Lemma 4.3. Let z, w ∈ CN be independent isotropic random vectors. Then, E[kzk22 ] = E[|hz, wi|2 ] = N . In order to produce asymptotic estimates in expectation for the singular values of a random matrix with random independent isotropic rows, we define two parameters called cross coherence and distortion. The cross coherence controls the angles between the rows of A. It can m also interpreted as an a priori control of the off-diagonal part of the Gram matrix N AA∗ pbe ∗ 3 m of A . N Definition 4.4 (cross coherence). Given a random matrix A ∈ Cm×N with rows a1 , . . . , am , we define its cross coherence as   m 2  X µ= E max |haj , ak i|2 . (26) k∈[m] N j∈[m]\{k} The distortion parameter quantifies how far the rows of A are from being “correctly” norpm AA∗ of A∗ is from having a unit malized, or, equivalently, how far the Gram matrix m N N diagonal. 3 The cross coherence is referred to as “incoherence” in [36], but we preferred to change its name in order to avoid possible confusion with other definitions of coherence given in CS. 21 Definition 4.5 (Distortion). Given a random matrix A ∈ Cm×N with rows a1 , . . . , am , we define its distortion as   m kak k22 − 1 . (27) ξ = E max k∈[m] N Observe that when A is a randomly subsampled isometry (see Section 4.4), the distortion is ξ = 0. We provide an upper bound in expectation for the singular values of a random matrix with heavy-tailed columns, based on the cross coherence and on the distortion. This is a generalization of [36, Theorem 5.62], where it is assumed that ξ = 0. For the sake of readability, we postpone the proof of this result to Appendix A. Theorem 4.6 (Deviation inequality in expectation). Let A be an m × N matrix (m ≤ N ) √ whose rescaled rows mak are independent isotropic random vectors of CN . Then, there exists a universal constant C > 0 such that q p E max σk ( m A∗ ) − 1 ≤ ξ + C (1 + ξ)µ ln m. N k∈[m] In the following, we prove a deviation inequality in probability for the minimum singular value of a random matrix with heavy-tailed columns, assuming a suitable decay of the distortion parameter with respect to N . This particular decay property will be verified for random sampling matrices associated with Chebyshev polynomials in Section 5.2. Proposition 4.7 (Deviation inequality in probability). Let A ∈ Cm×N be a random matrix √ whose rescaled rows maj are independent isotropic random vectors. Moreover, assume that there exist two constants D1 , D2 > 0 independent of N and m such that  r 2  m ln(m) ξ ≤ min D1 (28) , D2 . N Then, there exists a constant C > 0 depending only on D1 and D2 such that r   q 1 Cm2 ln(m) ∗ A ) ≥ ≥ 1 − . P σmin ( m N 2 N √ In particular, C = 4(D1 + C ′ 1 + D2 )2 , where C ′ is the universal constant of Theorem 4.6. √ Proof. Thanks to the isotropy of the rescaled rows maj , Lemma 4.3 yields the following equality √ √ √ m2 E[|haj , ak i|2 ] = E[|h maj , mak i|2 ] = E[k maj k22 ] = N. As a consequence, the cross coherence µ of A∗ satisfies     X  m 2  X m 2 µ= E max |haj , ak i|2 ≤ E j∈[m] N N j∈[m] k∈[m]\{j} k∈[m]\{j} = 1 X N2 X j∈[m] k∈[m]\{j} X m2 E[|haj , ak i|2 ] ≤ m2 . N |haj , ak i|2  (29) Now, using this estimate and applying Theorem 4.6, there exists a universal constant C ′ > 0 such that r q (1 + ξ)m ln(m) 1 1 ξ ′ ∗ √ + C E[|σmin ( √1N A∗ ) − √ |] = √ E[|σmin ( m A ) − 1|] ≤ . N N m m m 22 Using the upper bound for ξ assumed in (28), we obtain E[|σmin ( √1N 1 A ) − √ |] ≤ C ′′ m ∗ r m ln(m) , N √ with C ′′ = D1 + C ′ 1 + D2 . Then, applying the Markov inequality for t > 0 yields r   C ′′ m ln(m) 1 ∗ 1 P |σmin ( √N A ) − √ | ≥ t ≤ , t N m √ and the choice t = 1/(2 m) gives the estimate     q 1 1 ∗ ∗ √1 A ) ≤ √ A ) ≥ = 1 − P σ ( P σmin ( m min N N 2 2 m   1 1 ∗ ≥ 1 − P |σmin ( √1N A ) − √ | ≥ √ m 2 m r 2 m ln(m) ≥ 1 − 2C ′′ . N The proof is completed by setting C := (2C ′′ )2 . Remark 4.8 (Distortion decay property). If we replace hypothesis (28) with the more general assumption o n p ξ ≤ min D1 µ ln(m), D2 , following the same steps in the proof of Proposition 4.7, we obtain   q p 1 ∗ A ) ≥ ≥ 1 − C µ ln(m). P σmin ( m N 2 This would lead to an improved deviation inequality when a cross coherence upper bound better than µ ≤ m2 /N is available. Numerical experiments suggest that improving this estimate is possible only for large values of m (see Figure 3). 4.3 Random sampling from bounded orthonormal systems In this section, we prove robustness to unknown error of QCBP for random sampling matrices associated with bounded orthonormal systems (BOSs). We start by recalling the definition of BOS and of random sampling matrix associated with a BOS. This is a wide class of structured random matrices containing, for example, the random partial Fourier transform, subsampled isometries, random sampling from orthogonal polynomials. For further details we refer the reader to [31] and [24, Chapter 12]. Definition 4.9 (Random sampling from a bounded orthonormal system). Let D ⊆ Rd be endowed with probability measure ν. Then, a set Φ = {φ1 , . . . , φN } of complex-valued functions on D is called a Bounded Orthonormal System (BOS) with constant K if it satisfies Z φj (τ )φk (τ )dν(τ ) = δjk , ∀j, k ∈ [N ], D and if kφj k∞ := sup |φj (τ )| ≤ K, ∀j ∈ [N ]. Moreover, given m independent random variables τ1 , . . . , τm , distributed according to ν, we define the random sampling matrix A ∈ Cm×N associated with the BOS Φ as Aij := m−1/2 φj (τi ), 23 ∀i ∈ [m], j ∈ [N ]. (30) Assuming a linear dependence between m and s and an inverse proportionality between m and δ 2 (up to logarithmic factors), the sth restricted isometry constant is bounded from above by δ with overwhelmingly high probability. This results corresponds to [16, Theorem 2.2], but it admits analogous versions with different polylogarithmic factors L(N, s, ε, δ, K). In the following, by polylogarithm we mean a polynomial of logarithms and of logarithm of logarithms of the variables.4 Theorem 4.10 (Restricted isometry property for a BOS). Let A ∈ Cm×N be the random sampling matrix (30) associated with a BOS with constant K ≥ 1 and let ε, δ ∈ (0, 1). Then, there exists a universal constant c > 0 and a function function L(N, s, ε, δ, K) depending at most polylogarithmically on s and N such that, provided m ≥ c s L(s, N, ε, δ, K), the s th restricted isometry constant of A satisfies P{δs (A) ≤ δ} ≥ 1 − ε. In particular, we can choose (  2   2  2  K2 K s K s K s 1 1 L(N, s, ε, δ, K) = 2 ln max ln ln ln(N ), ln δ δ2 δ4 δ2 δ2 δ 2 ln( Kδ2s ) εδ !) . (31) Remark 4.11 (Choice of the polylogarithmic factor). Notice that the expression (31) for the polylogarithmic factor L(N, s, ε, δ, K) can be replaced by similar formulas associated with other restricted isometry property results available in the literature. For example, considering [24, Theorem 12.32] and [24, Remark 12.33-(b)] leads to the choice   2   K s K2 −1 ln(N ) ln(N ), ln(ε ) . (32) L(N, s, ε, δ, K) = 2 max ln2 (s) ln δ δ2 Similar options can be considered, based on the recent restricted isometry results in [7, 25, 33]. We√ are now in a position to prove robust recovery for BOSs. Assuming a sparsity level s . ε N (up to logarithmic factors), a suitable decay of the distortion parameter with respect to N , and a linear scaling between m and s (up to logarithmic factors), Theorem 4.12 provides a recovery error estimate for QCBP that does not assume any prior knowledge of the error term e, with probability at least 1 − ε. It is worth pointing out that the term max{kek2 − η, 0} in the error estimate is only amplified by logarithmic factors. Theorem 4.12 (Robustness to unknown error of QCBP for BOSs). Let A ∈ Cm×N be the random sampling matrix (30) associated with a BOS with constant K ≥ 1, whose distortion parameter satisfies  r 2  m ln(m) ξ ≤ min D1 (33) , D2 , N for suitable constants D1 , D2 , independent of m and N . Then, there exist constants c, d, C, D, E > 0 and a function L(N, s, ε, K) depending at most polylogarithmically on N and s such that the following holds. For every N ∈ N and ε ∈ (0, 1), assume that the sparsity s satisfies √ ε N , (34) s≤ 1 c L(N, s, ε, K) ln 2 (N ) 4 We decided to use the notation L(N, s, ε, δ, K) in order to make our results independent on the particular polylogarithmic factors associated with the minimum number of measurements required in the various restricted isometry property results published in the literature (see also Remark 4.11). 24 and consider a number of measurements m = ⌈d s L(N, s, ε, K)⌉, (35) and let ∆η be the QCBP decoder defined in (3). Then, for every x ∈ CN , e ∈ Cm , and 1 ≤ p ≤ 2, the following robust error estimate holds kx − ∆η (Ax + e)kp ≤ 1−1 1 Cσs (x)1 + s p 2 (D η + E L 2 (N, s, ε, K) max{kek2 − η, 0}), 1−1/p s with probability at least 1 − ε. In particular, the constant c depends on D1 and D2 , whereas the constants d, C, D, E are universal. A possible choice for L(N, s, ε, K) is given by (31) with δ = 1/2 and ε/2 in place of ε. Proof. First, define the event ΩRIP := {δ2s (A) ≤ 1/2}. Then, consider a universal constant d and a function L(N, s, ε, K) such that Theorem 4.10 applied with δ = 1/2 and with failure probability ε/2 ensures P(ΩRIP ) ≥ 1 − ε/2. for every m ≥ d s L(N, s, ε, K). √ In order to apply Proposition 4.7, we need to verify that the rows of mA are isotropic. Indeed, recalling Definition 4.9, for every i ∈ [m], we have Z √ √ E[( mai )( mai )∗ )jk ] = E[φj (τi )φk (τi )] = φj (τ )φk (τ )dν(τ ) = δjk , ∀j, k ∈ [N ]. D Hence, defining the event ΩSV :=  σmin ( q m A∗ ) N  ≥ , 1 2 p Proposition 4.7 ensures that P(ΩSV ) ≥ 1 − c′ m2 ln(m)/N , where c′ depends on D1 and D2 . Now, employing (34) and (35), we obtain r r ε c′ m2 ln(m) c′ (d + 1)2 s2 L2 (N, s, ε, K) ln(N ) ≤ ≤ , N N 2 √ where c = 2 c′ (d + 1). Note that c depends on c′ and d, and, consequently only on D1 and D2 . Finally, inside the event ΩRIP ∩ ΩSV Corollary 2.23 holds with constants C, D, and E ′ depending on ρ and τ , which are fixed since δ = 1/2. Then, we apply Lemma 4.1 and obtain the estimate p p m/s p m ∗ ≤ 2 (d + 1)L(N, s, ε, K), Qs (A)1 ≤ σmin ( N A ) √ and conclude by letting E = C[2(ρ + 2) d + 1 + τ }. In Section 5.2, we will discuss the application of Theorem 4.12 to the case of Chebyshev polynomials, providing an explicit estimate for the distortion ξ that ensures the validity of (33). 25 4.4 Subsampled isometries with random independent samples In this section, we examine the case of subsampled isometries where the rows of the isometry matrix are chosen by drawing m random independent samples from the set of rows of an N × N isometry. This allows us to take advantage of the theory for BOSs. The following robustness result for the QCBP decoder in the case of subsampled isometries improves Theorem 4.12 in two ways: a factor ln1/2 (N ) is removed at the denominator for the constraint on the sparsity level and the dependence of the sparsity level on the probability of failure is more favorable. Theorem 4.13 (Robustness to unknown error of QCBP for subsampled isometries). Let N ∈ N, K ≥ 1, and U ∈ CN×N be a unitary matrix such that K max |Uij | ≤ √ . N (36) i,j∈[N] Draw m indices τ1 , . . . , τm uniformly and independently at random from [N ] and consider the resulting subsampled isometry matrix A ∈ Cm×N defined as q Uτi j , ∀i ∈ [m], ∀j ∈ [N ]. (37) Aij = N m Then, fixed ε ∈ (0, 1), there exist universal constants c, d, C, D, E and a function L(N, s, ε, K) depending at most polylogarithmically on N and s such that the following holds. For every N ∈ N and ε ∈ (0, 1), assume that the sparsity s satisfies 1 s≤ 2 ln 2 ( 2−ε ) √ N, c L(N, s, ε, K) (38) and consider a number of measurements m = ⌈d s L(N, s, ε, K)⌉. N (39) m Then, for every x ∈ C , e ∈ C , 1 ≤ p ≤ 2 the following robust error estimate holds kx − ∆η (Ax + e)kp ≤ 1−1 1 Cσs (x)1 + s p 2 (D η + E L 2 (N, s, ε, K) max{kek2 − η, 0}), 1−1/p s (40) with probability at least 1 − ε, where ∆η is the QCBP decoder defined in (3). A possible choice for L(N, s, ε, K) is given by (31) with δ = 1/2 and ε/2 in place of ε. Proof. Similarly top the proof  of Theorem 4.12, we consider the events ΩRIP = {δ2s (A) ≤ 1/2} ∗ m and ΩSV = {σmin A ≥ 1/2}. N √ Thanks to (36), the columns of the matrix N U form a BOS with respect to the uniform measure on D = [N ]. Thus, according to Definition 4.9, A is a random sampling matrix associated with a BOS. Thus, Theorem 4.10 applied with δ = 1/2 and with failure probability ε/2 ensures the existence of a universal constant d > 0 and of a suitable function L(N, s, ε, K) such that P(ΩRIP ) ≥ 1 − ε/2 for every m ≥ d s L(N, s, ε, K). Besides, we observe that n q  o m ΩSV = σmin A∗ = 1 = {τ1 , . . . , τm are distinct} . N Therefore, using Taylor expansion, there exist ζ1 , . . . , ζm ∈ R such that P(ΩSV ) = m−1 Y  k=1 1− k N  = m−1 Y  e−k/N + e−ζk k=1 26 k2 2N 2  ≥ m−1 Y k=1 2 e−k/N ≥ e−m /(4N) . q 2 In particular, P(ΩSV ) ≥ 1 − ε/2 whenever m ≤ 2 ln( 2−ε )N , which is implied by (38) and (39) where c = (d + 1)/2. Inside the event ΩSV , notice that the ℓ1 -quotient can be controlled as r 1 1 m ≤ 2(c + 1) 2 L 2 (N, s, ε, K), Qs (A)1 ≤ 2 s thanks to Lemma 4.1. Finally, employing Corollary 2.23 inside the event ΩRIP ∩ ΩSV implies the thesis. √ The proof of Theorem 4.13 highlights that the assumption s . N (up to logarithmic factors and discarding the dependence on the failure probability ε) on the sparsity level is due to the need of having repeated rows in A with low probability. 4.5 Subsampled isometries with Bernoulli selectors and random subset model We discuss subsampled isometries randomly generated according to two random matrix models: the Bernoulli selectors and the uniform random subset model. These two study cases are of particular interest since the resulting sensing matrix A cannot have repeated rows. This implies that n q  o m P σmin A∗ = 1 = 1. N As a consequence, Proposition 4.1 allows us to control the ℓ1 -quotient as follows: r   m = 1. P Qs (A)1 ≤ s (41) Therefore, we only need to prove that the restricted isometry property (or the robust null space property) holds with high probability and apply Corollary 2.23 (or Theorem 2.22, respectively) to obtain robustness to unknown error. Subsampled isometries via Bernoulli selectors. Consider N independent random variables δ1 , . . . , δN identically distributed such that P{δi = 1} = m N and P{δi = 0} = 1 − m , N called Bernoulli selectors. Then, we define the corresponding subsampled isometry as r N N X δi ei e∗i U, A= m i=1 where e1 , . . . , eN are the standard unit vectors of CN . Notice that A is N × N , but it has m nonzero rows in expectation. In this case, following the same steps of [24, Theorem 12.32] it is possible to show that A has the restricted isometry property of order s and constant δ with high probability, provided that m & δ −2 N max |Uij |2 s ln2 (s) ln2 (N ). i,j∈[N] 27 Comparing this condition with (32), we notice the presence of a suboptimal factor ln(N ) in place of ln(s). Therefore, assuming that K max |Uij | ≤ √ , N i,j∈[N] and provided that m ∼ K 2 s ln2 (s) ln2 (N ), Corollary 2.23 combined with (41), implies that for every x ∈ CN , e ∈ Cm , and 1 ≤ p ≤ 2, the following robust recovery error estimate holds with high probability for the QCBP decoder: kx − ∆η (Ax + e)kp . 1 1 σs (x)1 + s p − 2 (η + K ln(s) ln(N ) max{kek2 − η, 0}). s1−1/p It is worth noting that there is no need to add any additional hypothesis on the sparsity level of the form (38). In particular, the fact that s is independent of the probability of failure of the restricted isometry property implies that the robust recovery error estimate holds with ‘overwhelmingly’ high probability. Moreover, there is no need to require any upper bound on m, in contrast to the Gaussian case where m ≤ N/2. Subsampled isometries with random subset model. Consider the subsampled isometry model A= q N P U, m Tm (42) where Tm is a random subset of [N ] having cardinality m. In this case, carrying out an analysis analogous to Theorem 4.13 combined with a conversion argument from the random matrix model (42) to the model (37) with random independent samples (see [24, Section 12.6]) it is √ possible to prove an error estimate analogous to (40) with a suboptimal factor m multiplying η and max{kek2 − η, 0}. How to get rid of this suboptimal factor is currently an open issue. 5 Examples In this section, we apply the robustness theory presented in the paper to some case studies of practical importance in CS. In particular, we consider random Gaussian measurements, the partial discrete Fourier transform, and nonharmonic Fourier measurements in Section 5.1 and presents some results for random sampling from Chebyshev polynomials in Section 5.2. For further numerical experiments we refer the reader to [9]. All the numerical experiments presented in this section have been performed using MATLAB 2016b version 9.1 on a MacBook Pro equipped with a 3 GHz Intel Core i7 processor and with 8 GB DDR3 RAM. In all the experiments involving BP and QCBP the convex optimization is performed using the MATLAB package SPGL1 [35]. 5.1 Gaussian and Fourier measurements We define two notable examples of BOS. Namely, the partial discrete Fourier transform and the nonharmonic Fourier measurements. Partial discrete Fourier transform. The BOS is defined as φj (t) = exp  2πi(j − 1)(t − 1) N 28  , j ∈ [N ], and the measure ν(t) is the uniform measure over D = [N ]. This is a BOS with constant K = 1. The resulting random matrix A is called partial discrete Fourier transform. This is also an example of subsampled isometry, as defined in (37), where U is the classical Fourier matrix, namely   2πi(j − 1)(k − 1) 1 Ukj = √ exp , k, j ∈ [N ]. N N The distortion parameter defined in (27) is ξ = 0. Nonharmonic Fourier measurements. A further example of BOS is given by      N φj (t) = exp 2πi j − t , 2 j ∈ [N ], (43) where D = [0, 1] and ν(t) is the uniform distribution over D. This set forms a BOS with constant K = 1, but it is not a subsampled isometry. The distortion parameter defined in (27) is ξ = 0. We now discuss some aspects of the robustness analysis employing these two BOSs and the random Gaussian measurements. Numerical robustness of BP and QCBP. The first numerical experiment corresponds to Figure 1, which we have already discussed briefly in Section 1, where the robustness of BP and QCBP is assessed for different types of sensing matrices. We consider random Gaussian measurements as defined in (19), the partial discrete Fourier transform, and nonharmonic Fourier measurements. We plot the recovery error kb x(η) − xk2 as a function of m averaged over 25 runs, where x is a randomly generated sparse solution with s = 15 nonzero entries (the support of x is a random subset of [N ] and the entries are generated independently at random according to the normal distribution). In particular, we fix N = 512 and consider m = ⌈kN/10⌉, with k ∈ [10]. For each run, we generate a random noise of magnitude kek2 = 10−3 as e = 10−3 · f /kf k2 , where f is a standard Gaussian vector. In the case of BP, we are of course in the regime kek2 > η since η = 0. For QCBP, we set η = 10−3 in order to have kek2 ≤ η. We notice that for every type of measurement, QCBP is very robust, and achieves a recovery error below the level kek2 . Also BP is quite robust, but the accuracy slightly deteriorates in the case of Gaussian and nonharmonic Fourier measurements, where the error starts to increase (although in a moderate way) when m gets too large. Interestingly, BP turns out to be extremely robust with the partial discrete Fourier transform, achieving an accuracy below the error magnitude for every value of m. Sharpness of the cross coherence estimate for BOSs. In the proof of Proposition 4.7, we have employed the upper bound (29) to the cross coherence parameter µ defined in (26). Namely, m2 µ≤ . N In Figure 3, we check that that this inequality is sharp in the case of the partial discrete Fourier transform and for small values of m, which is the regime considered in this paper and of interest in CS. This is showed by plotting the quantity N µ for different values of N and m and by verifying that its growth is proportional to m2 . 29 Figure 3: Logarithmic plot of the quantity N µ, where µ is the cross coherence parameter defined in (26), as a function of m, for various values of N in the case of the subsampled Fourier transform. For each value of m and N , µ is computed by averaging over 500 random trials. The values considered are N = 4, 8, 16, 32, 64, 128 and m = 2k , with k = 1, . . . , log2 (N ). The quantity N µ is compared with the upper bound m2 , employed in the proof of Proposition 4.7 (see (29)). Intrinsic limitations of the robustness analysis for BOSs. This experiment aims at showing numerically thepintrinsic limitations of the robustness analysis based on the minimum singular value σmin ( m A∗ ) in the case of bounded orthonormal systems that do not N correspond to subsampled isometries. In particular, we consider nonharmonic Fourier measurements and the BP solver (η = 0). In Figure show the boxplot of the absolute error p 4, we k∆0 (Ax + e) − xk2 and of the quantity σmin ( m A∗ ) as a function of s computed over 100 N random runs, where x is a random s-sparse vector (the support is a random subset of [N ] of cardinality s and the nonzero entries are normally distributed). We fix N = 1024 and for each value of s we set m = ⌈s ln(N )⌉. The additive noise is e = 10−3 · f /kf k2 , where f is a standard Gaussian vector, so that kek2 = 10−3 . We see that the absolute recovery error is quite stable around the level 10−3 (apart from the 1-sparse case, where m = ⌈1 ln(1024)⌉ = 7 measurements are probably too few). On the contrary, the minimum singular value gets smaller and smaller as s gets larger. In the s-sparse case, we have σs (x)1 = 0. Consequently, recalling Corollay 2.23 and Proposition 4.1, we have a robust recovery error estimate of the form r 1 m p k∆0 (Ax + e) − yk2 . Qs (A)1 kek2 . kek2 . n σmin ( m A∗ ) N Therefore, the fact that the minimum singular value gets smaller and smaller means that the second inequality becomes more and more crude as s gets larger. This shows an intrinsic fundamental limitation of our analysis in the general BOS case. In particular, it suggests that the upper bound to the quotient given in Proposition 4.1 can be improved. 30 p ∗ Figure 4: Limitations of the error analysis based on the quantity σmin ( m N A ) in the case of nonharmonic Fourier measurements. The boxplots show the absolute error k∆0 (Ax + e)k2 (left) p ∗ and the quantity σmin ( m N A ) (right) as a function of s computed over 100 random runs, where x is a randomly generated s-sparse vector. We fix N = 1024 and m = ⌈s ln(N )⌉ for every value of s. The error is randomly generated with kek2 = 10−3 . 5.2 Chebyshev polynomials In this section we specialize the robustness error analysis for general BOSs provided by Theorem 4.12 to the case of random sampling from Chebyshev orthogonal polynomials. The main motivation is the interest that ℓ1 minimization has recently received in the context of polynomial approximation [2, 33]. A major application is the uncertainty quantification of PDEs with random inputs, where the function to approximate is usually high-dimensional (see [3] and the references therein). Here, we limit our discussion to one-dimensional polynomial approximation and refer to reader to [3] for numerical experiments regarding the multi-dimensional case. We consider the Chebyshev orthogonal polynomials on D = [−1, 1], defined as φ1 (t) ≡ 1, ∀t ∈ D √ φj+1 (t) := 2 cos(j arccos(t)), (44) ∀t ∈ D, ∀j ∈ [N − 1]. (45) For every N ∈ N, the set {φj }j∈[N] is a BOS with respect to the Chebyshev measure ν(t) = π −1 (1 − t2 )−1/2 , ∀t ∈ D. (46) √ Note that in this case, we have K = 2 > 1. The analysis is based on a suitable estimate of the distortion ξ defined in (27). Indeed, the following result, whose proof is postponed p to Appendix B for the sake of compactness, shows that ξ can be bounded from above by m/N up to a universal constant. The sharpness of this estimate is numerically confirmed in Figure 5. Proposition 5.1 (Distortion bound for Chebyshev polynomials). For every 1 < m ≤ N , the distortion parameter associated with the BOS of Chebyshev polynomials with respect to the Chebyshev measure satisfies √ r 9 6 m ξ≤ . (47) 2π 1/4 N 31 Figure 5: Sharpness of the upper bound (47) to the distortion ξ provided in Proposition 5.1. On the left, we show that p the distortion only depends on the ratio m/N . On the right, we check that the growth rate is m/N , as predicted by the theory. An immediate consequence of Theorem 4.12 and Proposition 5.1 is the robustness of the QCBP decoder for random sampling from Chebyshev polynomials. Theorem 5.2 (Robustness to unknown error of QCBP for Chebyshev polynomials). Let A be the random sampling matrix (30) associated with the BOS of Chebyshev polynomials (44)-(45) with respect to the Chebyshev measure (46). Then, there exist universal constants c, d, C, D, E > 0 such that the following holds. For every N ∈ N and ε ∈ (0, 1), assume that the sparsity s satisfies √ ε N , s≤ 1 c L(N, s, ε, K) ln 2 (N ) and consider a number of measurements m = ⌈d s L(N, s, ε, K)⌉. Then, for every x ∈ CN , e ∈ Cm , and 1 ≤ p ≤ 2, the following robust error estimate holds kx − ∆η (Ax + e)kp ≤ 1 1 1 Cσs (x)1 + s p − 2 (D η + E L 2 (N, s, ε, K) max{kek2 − η, 0}), s1−1/p with probability at least 1 − ε, where ∆η is the QCBP decoder defined in (3). A possible choice for L(N, s, ε, K) is given by (31) with δ = 1/2 and ε/2 in place of ε. We conclude this section with two numerical illustrations. Sharpness of the distortion estimate. In Figure 5 we show the sharpness of the upper bound (47) to the distortion parameter given in Proposition 5.1. In particular, we consider N = 10, 20, . . . , 100 and set m = CN for C = 0.1, 0.2, . . . , 1. Then, for each value of N and m, we approximate the distortion by averaging the quantity maxi∈[m] |(m/N )kai k22 − 1| over 10000 trials. In Figure 5 (left), we plot the resulting approximate distortion as a function of N and C. We can see that the resulting only depends on C = m/N p. In particular, it is increasing in m/N . In Figure 5 (right), we check that the growth rate is m/N by considering the average of the approximate distortion over N , for each value of C = m/N . 32 Figure 6: Numerical assessment for polynomial approximation with Chebyshev polynomials through QCBP from pointwise samples. The figure shows the absolute approximation error kf − fbη kL2 as a function of η for f and fη defined as in (48) and (49), respectively. The boxplots correspond to 50 random runs. In the left figure, we consider accurate pointwise samples. In the right figure, the pointwise samples are subject to an additive noise e with kek2 = 10−3 . We can see that in both cases the choice of η affects the quality of the computed approximation. Polynomial approximation via ℓ1 minimization. Here, we assess the robustness of QCBP when employed in one-dimensional polynomial approximation. Consider the function f : [−1, 1] → R defined as f (t) = cos(πt)e−t , ∀t ∈ [−1, 1]. (48) We want to compute a sparse approximation of f with respect to the Chebyshev polynomials from a few noisy pointwise samples. Namely, we want to find fbη (t) = N X j=1 x bj (η)φj (t), ∀t ∈ [−1, 1], (49) b (η) = ∆η (y + e) is the QCBP solution relative to the random sampling matrix A from where x the Chebyshev system, with measurements y defined as yi = m−1/2 f (ti ), and where the error is defined as e = E · f /kf k2 , where f is a normal Gaussian vector, so that kek2 = E. In Figure 6 we assess the performance of QCBP by plotting the absolute approximation error kf − fbkL2 as a function of η for different values of the error level E on the measurements. In particular, we consider E = 0 and E = 10−3 . It is worth pointing out that when E = 0, the pointwise samples f (ti ) are exact, but there is still a source of unknown error due to the truncation of the Chebyshev expansion at level N [1, 2]. We fix N = 500 and consider m = 100 pointwise samples. We let η range from 10−8 to 10 by choosing η = 10k , with k belonging to a uniform grid of 12 points on [−8, 1]. The box plots show the results over 50 random trials.5 In both cases, underestimating η is better than overestimating it. When E = 0, there seems to be an optimal choice of η around 10−4 where the mean and the standard deviation of the approximation error are minimized. However, in both cases, QCBP shows to be quite robust 5 Notice that the outliers are sometimes aligned in Figure 6. This is due to the structure of the proposed numerical experiment: for each randomized choice of A, y, and e (over 50 trials), all the values of η are tested using the same sampling matrix, vector of measurements, and noise vector. 33 with respect to the choice of η, that does not seem to worsen the recovery performance significantly when underestimated. Furthermore, this numerical experiment confirms that estimating the noise level accurately and tuning the threshold parameter accordingly improves the recovery performance of QCBP, as empirically observed when η is estimated via cross validation [22]. This behavior can be justified from a theoretical perspective by the presence of the term max{kek2 − η, 0} in the recovery error estimate of Theorem 5.2. 6 Conclusions We have presented a theoretical analysis of the robustness of the quadratically-constrained basis pursuit decoder employed in compressed sensing when there is no a priori information available on the the error corrupting the measurements. Our analysis relies on the concepts of robust null space property, restricted isometry property, quotient, simultaneous quotient, and robust instance optimality. This analysis has been applied to the case of random Gaussian matrices and random matrices with heavy-tailed rows, including random sampling from Bounded Orthonormal Systems (BOSs). The study cases assessed in detail are subsampled isometries, partial discrete Fourier transform, nonharmonic Fourier measurements, and random sampling from Chebyshev polynomials. The main open problems brought to light by our analysis are the following: • The assumption (33) on the distortion in Theorem 4.12 requires an ad hoc estimation of ξ for each particular BOS under exam, as the one carried out in Proposition 5.1 for the Chebyshev polynomials. An open problem is to find an upper bound for ξ in the general BOS case. • Comparing the robust recovery result for BOSs (Theorem 4.12) and for subsampled isometries with independent samples (Theorem 4.13) it emerges that in the assumption on the sparsity regime there is a suboptimal ln1/2 (N ) factor at the denominator (due to the suboptimal factor ln(m) in Theorem 4.6) and that linear dependence between s and ε 2 could be improved to ln( 2−ε ). • Based on the numerical results p in Figure 4, the upper bound for the ℓ1 -quotient based on m A∗ given in Proposition 4.1 seems to not be sharp in the minimum singular value of N the general BOS case, where the minimum singular value could decay too fast as m → N . Therefore, an improvement of the upper bound for the ℓ1 -quotient given in Proposition 4.1 may be necessary. To conclude, we would like to draw the reader’s attention to Figure 1 – presented in the introduction – and examine to what extent our theoretical analysis is able to explain the phenomena observed therein. Firstly, for every type of measurement (i.e., random Gaussian measurements, partial discrete Fourier transform, and nonharmonic Fourier measurements) the figure shows how the accuracy of quadratically-constrained basis pursuit improves when the threshold parameter η is tuned according to a reliable estimate of the noise level. This behavior is theoretically explained by the presence of the term max{kek2 − η, 0} in all the recovery error estimates provided in our analysis (Section 2). Secondly, we are able to understand the Gaussian case more deeply, since robustness under unknown error is now proved not only for basis pursuit, but also for quadratically-constrained basis pursuit for any value of the threshold parameter η (Section 3). Thirdly, our analysis is able to explain – to a certain extent – why the partial discrete Fourier transform outperforms random Gaussian measurements. Indeed, considering the subsampled isometry model based on Bernoulli selectors, the discussion carried out in Section 4.5 shows that no upper bound on s (nor m) is needed to obtain robust recovery, as opposed to the Gaussian case where m ≤ N/2 and s ≤ m/ ln(eN/m). However, the reason 34 why the performance of basis pursuit is similar to that of quadratically-constrained basis pursuit for the partial discrete Fourier transform with noisy measurements still remains an interesting open question. 7 Acknowledgements The authors gratefully acknowledge Simon Foucart, Michael Friedlander, Yaniv Plan, Paul Tupper, Ozgur Yilmaz for the insightful discussions about the material presented in this paper. The authors acknowledge the support of the Alfred P. Sloan Foundation and the Natural Sciences and Engineering Research Council of Canada through grant 611675. The first author also acknowledges the Postdoctoral Training Center in Stochastics of the Pacific Institute for the Mathematical Sciences for the support. A Proof of Theorem 4.6 The aim of this section is to prove Theorem 4.6 about the expected singular values of a tall random matrix with heavy-tailed random isotropic columns. The proof of Theorem 4.6 relies on the results from [36], that is the main reference to keep handy throughout the appendix. In particular, Theorem 4.6 is a generalization to [36, Theorem 5.62], which provides bounds for the expected singular values of a tall random matrix with heavy-tailed random isotropic columns based on the cross coherence (referred to as coherence in [36]) and defined as in (26), assuming a suitable normalization hypothesis on the columns of the random matrix considered. This normalization hypothesis turns out to be too restrictive for the application to BOSs. Therefore, we relax it by means of the the distortion parameter ξ associated with the random matrix, defined in (27), following the remarks in [36, Section 5.7, paragraph “For Section 5.5”]. The appendix is divided in two subsections. In the first subsection, we provide some technical results about random matrices that will be useful to prove Theorem 4.6 in the second subsection. A.1 Preliminary results We prove a generalization of [36, Lemma 5.63] regarding matrix decoupling. The proof provided here is analogous to that in [36] and relies on a simpler scalar decoupling result (see [36, Lemma 5.60]), based on random selectors. Lemma A.1 (Matrix decoupling). Let M ∈ Cm×N be a random matrix. Denote the rows of M as m1 , . . . , mm . Then, E kMM∗ − Ik2 ≤ E max |kmi k22 − 1| + 4 max E kMT MT∗ k2 , i∈[m] T ⊆[m] where MT is the restriction of M to the rows in T and T = [m] \ T . Proof. First we notice that, thanks to the diagonalizability of MM∗ , we have kMM∗ − Ik2 = sup |x∗ (MM∗ − I)x| = sup |kM∗ xk22 − 1|. x∈Cm kxk2 =1 x∈Cm kxk2 =1 35 (50) Furthermore, for every x ∈ Cm with kxk2 = 1, we can split X X X xi xk hmi , mk i |xi |2 kmi k22 + kM∗ xk22 = i∈[m] k∈[m]\{i} i∈[m] =1+ X i∈[m] 2 |xi | (kmi k22 − 1) + X X i∈[m] k∈[m]\{i} xi xk hmi , mk i. Therefore, we obtain the estimate |kM∗ xk22 − 1| ≤ max |kmi k22 − 1| + i∈[m] X X i∈[m] k∈[m]\{i} xi xk hmi , mk i . (51) In order to deal with the second addendum in the right-hand side of (51), we introduce a random set T = {i ∈ [m] : θi = 1}, where θ1 , . . . , θm are independent random selectors such that E[θi ] = 1/2. Moreover, let us denote as EM and ET the expectations with respect to the random matrix M and to the random set T , respectively. Then, observing that ET [θi (1 − θk )] = 1/4 for every i 6= k, we have XX X X ET θi (1 − θk )xi xk hmi , mk i xi xk hmi , mk i = ET i∈T k∈T i∈[m] k∈[m]\{i} 1 X = 4 X i∈[m] k∈[m]\{i} xi xk hmi , mk i. (52) Combining (50),(52), and (51), and employing Jensen’s inequality, we obtain EM kMM∗ − Ik2 ≤ EM max |kmi k22 − 1| + 4 EM ET sup i∈[m] x∈Cm kxk2 =1 XX i∈T k∈T xi xk hmi , mk i . Bounding from above the expectation with respect to T with the maximum over T concludes the argument. We need two further technical results before proceeding with the proof of Theorem 4.6. Both results are proved in [36] for random matrices with real entries, but the reader can check that they hold as well in the complex case. The first result is about the expected singular values of random matrices with heavy-tailed rows. This result corresponds to [36, Theorem 5.45]. Lemma A.2 (Expected singular values of a random matrix with isotropic √ independent √ rows). Let A ∈ Cm×N , with m ≤ N , be a random matrix whose rescaled rows ma1 , . . . , mam are independent isotropic random vectors in CN . Then, there exists a universal constant C > 0 such that  h 1/2 i E max |σk (A) − 1| ≤ C E max kai k22 ln(m) . k∈[N] i∈[m] The second technical result provides an upper bound in expectation for the singular values of a random matrix with independent (but not necessarily isotropic) heavy-tailed rows. Lemma A.3 (Expected norm of a random matrix with independent rows.). Let M ∈ Cn×k be a random matrix whose rows m1 , . . . , mn are independent random vectors in Ck with second moment matrices Ki = E[mi m∗i ], ∀i ∈ [n]. 36 Then, there exists a universal constant C > 0 such that E kMk2 ≤ n X 1/2 Ki i=1 2  h 1/2 i + C E max kmi k22 ln(min{n, k}) . i∈[n] (53) Proof. We can bound (E kMk22 )1/2 by the right-hand side of (53) using [36, Theorem 5.48] and [36, Remark 5.49]. Then, we observe that E kMk2 ≤ (E kMk22 )1/2 thanks to Jensen’s inequality. We are now in a position to prove Theorem 4.6. A.2 Proof of Theorem 4.6 We start by applying the matrix decoupling Lemma A.1 with M = definition (27) of the distortion parameter ξ, we obtain AA∗ − Ik2 ≤ ξ + E km N pm N A. Recalling the 4 4 max E kmAT A∗T k2 = ξ + max E kGT k2 , N T ⊆[m] N T ⊆[m] (54) where GT ∈ C|T |×|T | denotes the decoupled Gram matrix GT = mAT A∗T , √ whose entries contain the inner products between the rows of mA relative to T against the √ rows of mA relative to its complement set T = [m] \ T . Namely,6 √ √ (GT )ik = h mai , mak i, ∀i ∈ T, ∀k ∈ T . The next goal is to provide an estimate for E kGT k2 , which is uniform in T . Given a set S ⊆ [m], we denote by EAS the expectation with respect to AS . In particular, notice that E = EAT EAT . Now, we first estimate EAT kGT k2 . Indeed, fixing AT we see that the matrix GT has independent (but not necessarily isotropic) rows. This allows for an application of Lemma A.3, which yields EAT kGT k2 ≤ ≤ X 1/2 KT,i 2 i∈T √  1/2 h i + C EAT max kgT,i k22 ln(min{|T |, |T |}) , i∈T 1/2 m · max kKT,i k2 i∈T +C  EAT h 1/2 i max kgT,i k22 ln(m) , i∈T (55) where gT,i is the ith row of GT , C > 0 is a universal constant, and KT,i = EAT [(gT,i )(gT,i )∗ ], ∀i ∈ T, is the second moment matrix of the random vector gT,i . In order to estimate the right-hand side of (55), we first provide an upper bound to kKT,i k, uniform in i. Notice that, due to the diagonalizability of KT,i , kKT,i k2 = sup |x∗ EAT [(gT,i )(gT,i )∗ ]x| = sup EAT |hgT,i , xi|2 . x∈C|T | kxk2 =1 (56) x∈C|T | kxk2 =1 6 We should write j ∈ [|T |] and k ∈ [|T |] instead of j ∈ T and k ∈ T , respectively. We are sure that the reader will forgive this small abuse of notation, committed for the sake of readability. 37 For every x ∈ C|T | with kxk2 = 1, using the isotropy of the vectors see that X √ √ h mai , mak ixk EAT |hgT,i , xi|2 = EAT = 2 = EAT k∈T X√ D√ √ mai , 2 k∈T X√ k∈T 2 mak xk mai and Lemma 4.3, we mak xk E = mkx⊺ AT k22 ≤ mkAT k22 , 2 (57) Combining (56) and (57), it follows that max kKT,i k2 ≤ mkAT k22 . (58) i∈T In order to deal with the second addendum in the right-hand side of (55), we provide an upper estimate to EAT maxi∈T kgT,i k22 . We observe that X √ X √ max kgT,i k22 = max |h mai , mak i|2 ≤ m2 max |hai , ak i|2 , i∈T i∈T i∈[m] k∈T which, in turn, implies EAT where Z := h  k∈[m]\{i} i max kgT,i k22 ≤ N 2 EAT [Z], (59) i∈T m N 2 max i∈[m] X k∈[m]\{i} |hai , ak i|2 . Notice that the random variable Z is defined such that its expected value is the cross coherence parameter defined in (26), namely E[Z] = µ. Plugging the inequalities (58) and (59) into (55), we see that EAT kGT k2 ≤ mkAT k2 + CN (EAT [Z] ln(m))1/2 , (60) Finally, in order to estimate the quantity E kGT k2 , we take the expectation of both sides of (60) with respect to AT . Considering the expectation of first addendum in the right-hand side of (60), we observe that EAT kAT k2 = E kAT k2 ≤ E kAk2 . Moreover, noting that the rows ai of A satisfy  q N m E max kai k22 = a 1 + E max N i i∈[m] i∈[m] m (61)  N − 1 ≤ (1 + ξ), m 2 2 Lemma A.2 yields E kAk2 = E[σmax (A)] ≤ 1 + C ′ r (1 + ξ)N ln(m) ≤ 2C ′ m r (1 + ξ)N ln(m) , m (62) for a suitable universal constant C ′ > 0. About the expectation of the second addendum in the right-hand side of (60), Jensen’s inequality implies p (63) EAT (EAT [Z] ln(m))1/2 ≤ (EAT EAT [Z] ln(m))1/2 = (E[Z] ln(m))1/2 = µ ln(m). 38 Therefore, considering the expectation of (60) with respect to AT and using (61), (62), and (63), we obtain p p p E kGT k2 ≤ 2C ′ (1 + ξ)mN ln(m) + CN µ ln(m) ≤ C ′′ N (1 + ξ)µ ln(m), where we have used the√fact that µ ≥ (m −√1)/N ≥ m/(2N ) (thanks to Lemma 4.3 and to the isotropy of the vectors mai ) and C ′′ = 2 2C ′ + C. Recalling (54), this shows that p AA∗ − Ik2 ≤ ξ + C ′′ (1 + ξ)µ ln(m), Ekm N where the constant C ′′ > 0 is universal. Finally, we observe that q q m kN AA∗ − Ik2 = max |σk ( m A∗ )2 − 1| ≥ max |σk ( m A∗ ) − 1|. N N k∈[m] k∈[m] This completes the proof. B Proof of Proposition 5.1 This appendix is devoted to the proof of Proposition 5.1, which provides an upper bound to the distortion parameter ξ defined in (27) in the case of the Chebyshev polynomials defined in (44)-(45). The crucial tool employed here is the normalized Christoffel function. Definition B.1 (Normalized Christoffel function). We define the normalized Christoffel function associated with a BOS Φ = {φj }N j=1 as CN (t) := N 1 X |φj (t)|2 . N j=1 In the case of Chebyshev polynomials, defining x = arccos(t), we have CN (t) = = N N−1 N−1 1 1 X 2 X 1 X (φj (t))2 = cos2 (jx) = 1 + cos(2jx) + N j=1 N N j=1 N j=1 N −1 sin((2N − 1)x) + . N N sin(x) (64) We prove a technical result that reveals a tight link between the asymptotic behavior of the normalized Christoffel function and the decay of the distortion parameter ξ for any BOS associated with the one-dimensional Chebyshev measure. Lemma B.2 (Distortion bound based on the Christoffel function). Consider a BOS Φ = {φj }N j=1 associated with the Chebyshev measure (46). Fix 0 < ε < 1 and τ > 0 and assume that there exists a positive integer N ε,τ such that, for every N ≥ N ε,τ , the following holds kCN − 1kL∞ (−1+ε,1−ε) ≤ τ. Then, for every N ≥ N ε,τ , the distortion parameter ξ defined in (27) satisfies p ξ ≤ τ + 2(K 2 + 1)m ε/π. 39 (65) Proof. For any random matrix A ∈ Cm×N with rows ai built as in (30), considering the random variable m kai k22 − 1 , X(A) = max i∈[m] N we have ξ = E[X(A)]. Since mkai k22 ≤ K 2 N , we have |X(A)| ≤ K 2 + 1. This, in turn, implies ξ ≤ τ + (K 2 + 1) P{X > τ }, ∀τ > 0. (66) Now, in order to estimate P{X(A) > τ }, we notice that (m/N )kai k22 = CN (ti ) and, exploiting the independence of the sampling points ti , we resort to a union bound     [  |CN (ti ) − 1| > τ P{X(A) > τ } = P max |CN (ti ) − 1| > τ = P i∈[m] i∈[m]   ≤ m P |CN (t1 ) − 1| > τ ≤ m P{t1 ∈ [−1, 1] \ (−1 + ε, 1 − ε)}, | {z } (67) =:λε where in the last inequality hinges on (65). The next step is to estimate the probability λε that the distance of a sample t1 from the boundary is less than ε. By direct computation Z 1−ε Z 1−ε λε = 1 − dν(t) = 1 − π −1 (1 − t2 )−1/2 dt −1+ε −1+ε = 1 − π −1 (arcsin(1 − ε) − arcsin(−1 + ε)) p √ √ ≤ 1 − π −1 (π/2 − πε + π/2 − πε) = 2 ε/π. (68) The last inequality hinges on the estimates arcsin(x) ≥ π/2 − arcsin(x) ≤ −π/2 + which, in turn, can be deduced from p p π(1 − x), ∀x ∈ [0, 1], π(1 + x), ∀x ∈ [−1, 0], sin(x) ≥ −1 + (x + π/2)2 /π, sin(x) ≤ 2 1 − (x − π/2) /π, ∀x ∈ [−π/2, 0] ∀x ∈ [0, π/2]. Combining (66), (67), and (68) completes the proof. An immediate consequence of Lemma B.2 is that when the normalized Christoffel function CN → 1 uniformly on every interval of the from [−1 + ε, 1 − ε] for N → ∞, then the distortion ξ → 0 for N → ∞ and m fixed. Recalling (64), the reader can verify that this is the case for the Chebyshev polynomials. Moreover, we are able to track the dependency on m and N in the decay of ξ to 0 as N → 0. We are now in a position to prove Proposition 5.1. Proof of Proposition 5.1. The idea is to employ Lemma B.2, giving an explicit value for N ε,τ that guarantees the validity of relation (65). First, recalling (64), notice that |1 − CN (t)| = 1 − 1 sin((2N − 1)x) 1 sin((2N − 1)x) N −1 ≤ . − + N N sin(x) N N sin(x) Now, fixed 0 < ε < 1, for every t ∈ [−1 + ε, 1 − ε], we have p p √ | sin(x)| ≥ sin(arccos(1 − ε)) = 1 − (1 − ε)2 = ε(2 − ε) ≥ ε. 40 Therefore, we obtain k1 − CN (t)kL∞ (−1+ε,1−ε) ≤ 2 1 1 ≤ √ , +√ N εN εN √ and, consequently, (65) holds with N ε,τ = ⌈2/( ετ )⌉. Now, if we choose p p τ = τ (ε) = (K 2 + 1)m ε/π = 3m ε/π, we have that, for every 0 < ε < 1, the following implication holds √ p 2 π N≥ =⇒ ξ ≤ 9m ε/π. 3mε √ In particular, for√every 1 < m ≤ N , we can choose√ 0 < ε < 1 such that N = ⌈2 π/(3mε)⌉. √ 2 π , and, finally, Then, we have 23mεπ ≤ N ≤ 23mεπ + 1. Thus, ε ≤ 3m(N−1) √ r √ r 3 6 9 6 m m ξ ≤ 1/4 ≤ , N −1 π 2π 1/4 N which is the desired conclusion. References [1] B. Adcock. Infinite-dimensional compressed sensing and function interpolation. Found. Comput. Math., to appear, 2017. [2] B. Adcock. Infinite-dimensional ℓ1 minimization and function approximation from pointwise data. Constr. Approx., 45(3):345–390, 2017. [3] B. Adcock, S. Brugiapaglia, and C. G. Webster. Compressed sensing approaches for polynomial approximation of high-dimensional functions. arXiv:1703.06987, 2017. [4] T. Blumensath and M. E. Davies. Iterative hard thresholding for compressed sensing. Appl. Comput. Harmon. Anal., 27(3):265–274, 2009. [5] J.-L. Bouchot, B. Bykowski, H. Rauhut, and C. Schwab. Compressed sensing PetrovGalerkin approximations for parametric PDEs. In Sampling Theory and Applications (SampTA), 2015 International Conference on, pages 528–532. IEEE, 2015. [6] P. T. Boufounos and R. G. Baraniuk. 1-bit compressive sensing. In Information Sciences and Systems, 2008. CISS 2008. 42nd Annual Conference on, pages 16–21. IEEE, 2008. [7] J. Bourgain. An Improved Estimate in the Restricted Isometry Problem. In Geom. Asp. Funct. Anal., pages 65–70. Springer International Publishing, 2014. [8] S. Brugiapaglia. COmpRessed SolvING: sparse approximation of PDEs based on compressed sensing. PhD thesis, MOX - Politecnico di Milano, 2016. [9] S. Brugiapaglia, B. Adcock, and R. K. Archibald. Recovery guarantees for compressed sensing with unknown errors. In Sampling Theory and Applications (SampTA), 2017 International Conference on. IEEE, 2017. [10] S. Brugiapaglia, S. Micheletti, and S. Perotto. Compressed solving: A numerical approximation technique for elliptic PDEs based on Compressed Sensing. Comput. Math. with Appl., 70(6), 2015. 41 [11] S. Brugiapaglia, F. Nobile, S. Micheletti, and S. Perotto. A theoretical study of COmpRessed SolvING for advection-diffusion-reaction problems. Math. Comp., to appear, 2017. [12] T. T. Cai and A. Zhang. Sparse representation of a polytope and recovery of sparse signals and low-rank matrices. IEEE Trans. Inform. Theory, 60(1):122–132, 2014. [13] E. J. Candès and Y. Plan. A probabilistic and RIPless theory of compressed sensing. IEEE Trans. Inform. Theory, 57(11):7235–7254, 2011. [14] E. J. Candès, J. Romberg, and T. Tao. Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information. IEEE Trans. Inform. Theory, 52(2):489–509, 2006. [15] E. J. Candès, J. K. Romberg, and T. Tao. Stable signal recovery from incomplete and inaccurate measurements. Comm. Pure Appl. Math., 59(8):1207–1223, 2006. [16] A. Chkifa, N. Dexter, H. Tran, and C. G. Webster. Polynomial approximation via compressed sensing of high-dimensional functions on lower sets. Math. Comp., to appear, 2017. [17] A. Cohen, W. Dahmen, and R. DeVore. Compressed sensing and best k-term approximation. J. Amer. Math. Soc, 22:211–231, 2008. [18] M. A. Davenport, Y. Plan, E. Berg, and M. Wootters. 1-Bit Matrix Completion. Inf. Inference, 3(3):189–223, 2014. [19] R. DeVore, G. Petrova, and P. Wojtaszczyk. Instance-optimality in probability with an ℓ1 -minimization decoder. Appl. Comput. Harmon. Anal., 27(3):275–288, 2009. [20] D. L. Donoho. Compressed Sensing. IEEE Trans. Inform. Theory, 52(4):1289–1306, 2006. [21] D. L. Donoho and B. F. Logan. Signal Recovery and the Large Sieve. SIAM J. Appl. Math., 52(2):577–591, 1992. [22] A. Doostan and H. Owhadi. A non-adapted sparse approximation of PDEs with stochastic inputs. J. Comput. Phys., 230(8):3015–3034, 2011. [23] S. Foucart. Stability and robustness of ℓ1 -minimizations with Weibull matrices and redundant dictionaries. Linear Algebra Appl., 441:4–21, 2014. [24] S. Foucart and H. Rauhut. A Mathematical Introduction to Compressive Sensing. Appl. Numer. Harmon. Anal. Springer Science+Business Media, New York, 2013. [25] I. Haviv and O. Regev. The Restricted Isometry Property of Subsampled Fourier Matrices. In B. Klartag and E. Milman, editors, Geometric Aspects of Functional Analysis: Israel Seminar (GAFA) 2014–2016, pages 163–179. Springer International Publishing, Cham, 2017. [26] M. A. Herman and T. Strohmer. General Deviants: An Analysis of Perturbations in Compressed Sensing. IEEE J. Sel. Top. Signal Process., 4(2):342–349, jul 2010. [27] B. F. Logan. Properties of high-pass signals. PhD thesis, Columbia University, 1965. [28] D Needell and J. A. Tropp. CoSaMP: Iterative signal recovery from incomplete and inaccurate samples. Appl. Comput. Harmon. Anal., 26(3):301–321, 2009. [29] S. N. Negahban, R. Pradeep, B. Yu, and M. J. Wainwright. A Unified Framework for High-Dimensional Analysis of M-Estimators with Decomposable Regularizers. Stat. Sin., 27(4):538–557, 2012. [30] Y. Plan and R. Vershynin. The generalized Lasso with non-linear observations. IEEE Trans. Inform. Theory, 62(3):1528–1537, 2016. 42 [31] H. Rauhut. Compressive sensing and structured random matrices. In M Fornasier, editor, Theor. Found. Numer. Methods Sparse Recover., volume 9 of Radon Series on Computational and Applied Mathematics, pages 1–92. deGruyter, 2010. [32] H. Rauhut and C. Schwab. Compressive sensing Petrov-Galerkin approximation of highdimensional parametric operator equations. Math. Comp., 86(304):661–700, 2017. [33] H. Rauhut and R. Ward. Interpolation via weighted ℓ1 minimization. Appl. Comput. Harmon. Anal., 40(2):321–351, 2016. [34] M. Unser, J. Fageot, and H. Gupta. Representer Theorems for Sparsity-Promoting ℓ1 Regularization. IEEE Trans. Inf. Theory, 62(9):5167–5180, 2016. [35] E Van Den Berg and M. P. Friedlander. SPGL1: A solver for large-scale sparse reconstruction, 2007. [36] R. Vershynin. Introduction to the non-asymptotic analysis of random matrices. In Y. Eldar and G. Kutyniok, editors, Compressed Sensing: Theory and Applications. Cambridge University Press, Cambridge, 2012. [37] P. Wojtaszczyk. Stability and instance optimality for Gaussian measurements in compressed sensing. Found. Comput. Math., 10(1):1–13, 2010. [38] X. Yang and G. E. Karniadakis. Reweighted ℓ1 minimization method for stochastic elliptic differential equations. J. Comput. Phys., 248:87–108, 2013. [39] T. A. Zhang. Sparse recovery with orthogonal matching pursuit under RIP. IEEE Trans. Inform. Theory, 57(9):6215–6221, 2011. 43
7cs.IT
arXiv:1310.1250v1 [cs.NE] 15 Aug 2013 Learning ambiguous functions by neural networks Rui Ligeiro∗ and R. Vilela Mendes∗† Abstract It is not, in general, possible to have access to all variables that determine the behavior of a system. Having identified a number of variables whose values can be accessed, there may still be hidden variables which influence the dynamics of the system. The result is model ambiguity in the sense that, for the same (or very similar) input values, different objective outputs should have been obtained. In addition, the degree of ambiguity may vary widely across the whole range of input values. Thus, to evaluate the accuracy of a model it is of utmost importance to create a method to obtain the degree of reliability of each output result. In this paper we present such a scheme composed of two coupled artificial neural networks: the first one being responsible for outputting the predicted value, whereas the other evaluates the reliability of the output, which is learned from the error values of the first one. As an illustration, the scheme is applied to a model for tracking slopes in a straw chamber and to a credit scoring model. 1 Introduction When dealing with real-world problems, some degree of uncertainty can rarely be avoided. When modelling physical or social systems, either as a way for further understanding or as a guide for decision processes, dealing with uncertainty is a critical issue. Uncertainty has been formalized in different ways leading to several uncertainty theories [1]. Here we will be concerned with uncertainty in the construction of models from observed data. In this context uncertainty may arise either from imprecision in the measurement of the observed variables or from the fact that the variables that can be measured do not provide a complete specification of the behavior of the system. In the context of construction of models of physical phenomena by neural networks, the problem of learning from data with error bars has been addressed before by several authors (see for example [2] [3]). Here we will be mostly ∗ INOV INESC – Instituto de Novas Tecnologias, Rua Alves Redol 9, 1000-029 Lisboa Portugal; [email protected] † CMAF - Instituto Investigação Interdisciplinar, Univ. Lisboa, Av.Gama Pinto 2, 1649-003 Lisboa, Portugal; [email protected], [email protected] 1 concerned not with imprecision in the input data but with the fact that the observed variables do not completely specify the output. In practice this situation is rather complex mainly because, in general, the uncertainty is not uniform throughout the parameter space. That is, there might be regions of the parameter space where the input variables provide an unambiguous answer and others where they are not sufficient to provide a precise answer. For example in credit scoring, which we will use here as an example, the ”no income, no job, no asset”1 situation is a clear sign of no credit reliability, but most other situations are not so clear-cut. Therefore it would be desirable to develop a method that, for each region of parameter space, provides the most probable outcome but at the same time tells us how reliable the result is. The purpose of this paper is to develop such a system based on neural networks that learn in a supervised way. In short, the system consists of two coupled networks, one to learn the most probable output value for each set of inputs and the other to provide the expected error (or variance) of the result for that particular input. The system is formalized as the problem of learning random functions in the next section. Then we study two application examples, the first being the measurement of track angles by straw chambers in high-energy physics and the other a credit scoring model. 2 Learning the average and variance of random functions The general setting which will be analyzed is the following: −→ The signal to be learned is a random function y x with distribution n−→o F−x→ (y). For simplicity we take y to be a scalar and the index set x to be −→ vector-valued, x ∈ Ri . Notice that we allow for different distribution functions at different points of the index set. −→ In the straw chamber example, to be discussed later, x would be the set of −→ delay times and y the track angle. For the credit score example, x would be the set of client parameters and y the credit reliability. −→ In our learning system the x values are inputs to network   a (feedforward) −→ with connection strengths {W }, the output being fW x . The aim is to chose a set of connection strengths {W } that annihilates the expectation value     X  −→ −→2  fW x − y x =0 E    n−→o x However, what, for example, the backpropagation algorithm does is to minimize −→ −→2  −→ E fW x − y x for each realization of the random variable x . Let us 1 Nevertheless many of these so called NINJA scores were financed during the subprime days 2 −→ −→ fix x and consider fW x evolving in learning time. That is, we are considering, in the learning process, the subprocess corresponding to the sampling of a particular fixed region of the index set. Then −→  ∂f −→  W = fW x , t + • ∆W fW x , t + 1 ∂W −→  ∂e ∂fW • = fW x , t − η ∂W ∂W −→  −→ −→ ∂f ∂f  W = fW x , t − 2η • fW x − y x ∂W ∂W −→ −→2  ∂e , η being the learning rate and e = fW x − y x where ∆W = −η ∂W the error function. If the learning rate η is sufficiently small for the −→  learning time scale to be much smaller than the sampling rate of the y x random variable, the last equality may be approximated by −→ ∂f −→ −→  −→  ∂f  W • fW x − y x fW x , t + 1 = fW x , t − 2η ∂W ∂W −→ y x denoting the average value of the random variable y at the argument −→ x . Then a fixed point is obtained for −→ − −→ fW x = y x −→ −→ x tends to the average value of the random variable y at x . −→ Similarly if a second network (with output gW ′ x ) and the same input That is, fW −→ x is constructed according to the learning law  −→  ∂g ′ −→ W gW ′ x , t + 1 = gW ′ x , t + • ∆W ′ ∂W ′ with error function e′ =  gW ′ −→2 2 −→  −→ x − fW x − y x ′ ∂e and ∆W ′ = −η ′ ∂W ′ , then  −→  −→ −→  −→ −→2   ′ ∂gW ′ ∂gW ′ gW ′ x − fW x − y x gW ′ x , t + 1 = gW ′ x , t −2η • ∂W ′ ∂W ′ and, underthe same assumptions as before concerning the smallness of learning −→ rates, gW ′ x has the fixed point gW ′ −→  −→ −→2 x = y x −y x 3 In conclusion: the first network reproduces the average value of the random −→ function y for each input x and the second one, receiving as data the errors of −→ the first, reproduces the variance of the function at x . Instead of the variance, the second network might to learn the expected value of −→as  well be programed  − −→ the absolute error E y x − y x . Actually, for numerical convenience, we will use this alternative in the examples of the next section (Fig.3). In practice the training of the second network should start after the first one because, before the first one becomes to converge, its errors are not representative of the fluctuations of the random function. In general it seems reasonable to have η ′ (t) < η (t)with η (t)decreasing in time towards a small fixed value 6= 0. 3 3.1 Examples: Measuring track angles by straw chambers One of the first applications of neural networks to the processing of high-energy physics data was the work by Denby, Lessner and Lindsey [4] on the slopes of particle tracks in straw tube drift chambers. In a straw chamber (Fig.1) each wire receives a signal delayed by a time proportional to the distance of closest approach of the particle to the wire. n−→o The neural network receives these times as inputs x , with as many −→ inputs as the number of wires and, for the training, the track angle y x is the objective function. The half cell shift of alternate layers in the straw chamber solves some of the left-right ambiguities but this ambiguity still remains for many directions (Fig.2). The authors of [4] required the training and test events to pass through at least four straws to avoid edge effects. Nevertheless they consistently find large non-Gaussian error tails when testing the trained network. The authors have not separated the contribution to the tails coming from the ambiguities from those arising from eventual inadequacies on training or network architecture. We have repeated the simulations and our results essentially reproduce those of [4], showing that the non-Gaussian tails do indeed originate from the left-right ambiguities. If edge effects are allowed for, including in the training set events that pass through less than four straws, the degree of ambiguity and the tails increase even further. This example is therefore a typical example of the situation described in the introduction, where some regions of the input data correspond to a unique event but others have an ambiguous identification. As the example shows it is not easy to separate the ambiguous regions from the non-ambiguous ones because they are mixed all over parameter space. It is therefore important to have a system that not only provides an answer but also states how reliable that answer is. We have applied to this example the two-network scheme (Fig.3) described before. Both networks have the same architecture and train using the same exact 4 Figure 1: A particle track through a straw chamber. The input values to the neural networks are the delay times, proportional to the distances of the particle to the wires input data, the first one (at left in Fig.3) with the objective track angles and the second (at right in Fig.3) with the absolute value of the errors of the first. To avoid big fluctuations in training convergence, the second network starts learning after the first has stabilized and finished training. Both networks have a feed-forward network architecture with three neuron layers: input, hidden and output. They both train using a supervised backpropagation algorithm. The neuron activation function is the logistic sigmoid. For the results presented here we use 14 input neurons (representing the drift times in each straw), 25 hidden neurons and an output neuron for the slope of each track. We use Monte Carlo generated data coded as follows: If the track does not meet the straw the input value is zero and if the track crosses the straw the input value is the difference between the straw radius and the distance to the wire in the center of the straw. The output is the angle in degrees of the track slope. A training sample of 25000 simulated tracks was generated which trained for 12.5 × 106 iterations. After training, the performance of the network 5 Figure 2: An example with two different beam track angles generating the same input signal was tested using a new set of 5000 independent tracks. Fig.4 shows a plot of the first network errors obtained with the test set. The distribution does present large non-Gaussian tails because of the left-right ambiguity. Fig.5 compares the actual error of the first network with the uncertainty predicted by the second. One sees that the largest actual errors do indeed correspond to good uncertainty predictions by the second network. Of course in a few cases large uncertainty is predicted when the actual error is small. It only means that particular result is unreliable in the sense that it was by chance that it fell in the middle of the error bar interval. Now that we are equipped with a system that predicts both an angle and its probable uncertainty, it makes sense to state that the result of a measurement is θ ± ∆ann , θ being the output of the first network and ∆ann the output of the second. In this sense we will count an output as an error only when the objective value is outside the error bars. The effective error will be the distance of the objective value to the boundary of the error bars. Fig.6 plots the effective error for a sample of 1000 tracks. Comparison with Fig.4 shows how the reliability of 6 Figure 3: A two-network system that, given inputs Xi and objective values θk , learns the average values Yk (Xi ) and average errors |Yk − θk |for each set {Xi }of input values the system is improved, because each time an output value is obtained one has a good estimate of how accurate it is. 3.2 A credit scoring model Defaulting on loans has recently increased, promoting the search for accurate techniques of credit evaluation by financial institutions. Credit scoring is a quantitative method, based on credit report information that helps lenders in the credit granting decision. The objective is to categorize credit applicants into two separate classes: the ”good credit” class, that is, the one likely to repay loans on time and the ”bad credit” class to which credit should be denied, due to a high probability of defaulting. For a more detailed understanding of credit scoring models, with and without neural networks, we refer to [5] [6] [7] [8]. Here we have developed a credit scoring model based on the two-network scheme discussed before. Because complete information on the credit applicants is impossible to obtain and human behavior is dependent on so many factors, credit scoring is also a typical example of a situation where one is trying to predict an outcome based on incomplete information. For the purpose of an open illustration of our system we use here a publicly available credit data of anonymous clients, downloaded from UCI Irvine Machine [9]. It is composed of 1000 cases, one per applicant, of which 700 cases correspond to creditworthy applicants and 300 cases correspond to applicants which were later found to be in the bad credit class. Each instance corresponds to 24 attributes (e.g., loan amount, credit history, employment status, personal information, etc.) with the corresponding credit status of each applicant coded as good (1) or bad (0). Inspecting the database, it is clear that some apparently good attributes correspond, in the end, to bad credit performance 7 8000 7000 SC − #Entries 6000 5000 4000 3000 2000 1000 0 −15 −10 −5 0 5 SC − Degrees (Network error) 10 15 Figure 4: Error distribution in the first network (straw chamber data) and conversely, putting into evidence the incomplete information nature of the problem. For our system the attributes are numerically coded and we use a neural network architecture with 24 input neurons (representing the 24 numerical attributes), 14 hidden neurons and an output neuron indicating good or bad credit. The network trained 1000000 times. To ensure that the network learns evenly, we randomly alternate between good and bad applicants instances. After training, the performance of the network was tested. Fig.7 shows a plot of the errors of the first network after training. Although, in general, the network provides good estimations, there are several customers classified as good when they are bad and vice-versa. In fact, there are some extremely incorrect network predictions, as can easily been perceived by the bins at the two ends of the histogram. These bins clearly reveal lack of information in the dataset. As in the previous example, Fig.8 shows the comparison of the errors in the first network with the estimated uncertainty obtained by the second network and Fig.9 shows the effective error distribution. Similarly to the previous straw chamber example, one obtains good uncertainty predictions by the second network. The second network wrongly classified very few cases: only two occurrences with no actual errors were predicted having maximum uncertainty and only three critical errors were unsuccessfully predicted without uncertainty. Looking at the effective error distribution plot, it is easy to confirm the 8 10 9 SC − Second network output 8 7 6 5 4 3 2 1 0 −10 −5 0 5 SC − Degrees (First network error) 10 Figure 5: Comparison of the actual error of the first network and the estimated uncertainty predicted by the second network (straw chamber data) refinement in the degree of certainty in each estimation. Nevertheless, there still are a very few occurrences of estimations outside the error bar interval. Complexity of the human behavior? 3.3 Conclusions The goal of this research was to develop a computational scheme with the ability to evaluate the degree of reliability of predictive models. Two application examples were studied, the first one being the measurement of track angles by straw chambers in high-energy physics and the other a credit scoring model. Both examples use data with incomplete information. A two-network system is used which, although not perfect, greatly improves the reliability check of the predicted results. References [1] G. J. Klir; Developments in uncertainty-based information, Advances in Computers 36 (1993) 255-332. 9 500 450 400 SC − #Entries 350 300 250 200 150 100 50 0 −6 −4 −2 0 2 SC − Degrees (Effective error) 4 6 Figure 6: Effective error (straw chamber data) [2] K. A. Gernoth and J. W. Clark; A modified backpropagation algorithm for training neural networks on data with error bars, Computer Physics Commun. 88 (1995) 1-22. [3] B. Gabrys and A. Bargiela; Neural network based decision support in presence of uncertainties, ASCE J. of Water Resources Planning and Management 125 (1999) 272-280. [4] B. Denby, E. Lessner and C. S. Lindsey; Test of track segment and vertex finding with neural networks, Proc. 1990 Conf. on Computing in High Energy Physics, Sante Fe, NM. 1990, AIP Conf Proc. 209, 211. [5] D. Lando; Credit Risk Modeling, Princeton U. P. 2004. [6] T. Van Gestel and B. Baesens; Credit Risk Management: Basic concepts: Financial risk components, Rating analysis, models, economic and regulatory capital, Oxford, 2009. [7] E. M. Lewis; An Introduction to Credit Scoring, Fair, Isaac and Co., San Rafael 1992. [8] D. West; Neural network credit scoring models, Computers and Operations Research 27 (2000) 1131-1152. 10 900 800 Scoring − #Entries 700 600 500 400 300 200 100 0 −1 −0.5 0 Scoring (Error of the network) 0.5 1 Figure 7: Error distribution in the first network (credit scoring) [9] UCI Machine Learning Repository; URL http://archive.ics.uci.edu/ml/ 11 1 0.9 Scoring − Output of the second network 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 −1 −0.5 0 Scoring (Error of the first network) 0.5 1 Figure 8: Comparison of the actual error of the first network and the estimated uncertainty predicted by the second network (credit scoring) 12 1000 900 800 Scoring − #Entries 700 600 500 400 300 200 100 0 −1 −0.5 0 Scoring (Effective error.) 0.5 Figure 9: Effective error (credit scoring) 13 1
9cs.NE
Multiscale Granger Causality L. Faes and G. Nollo Bruno Kessler Foundation, Trento, Italy and BIOtech, Dept. of Industrial Engineering, University of Trento, Italy S. Stramaglia Dipartimento di Fisica, Universitá degli Studi Aldo Moro, Bari, Italy and INFN, Sezione di Bari, Italy D. Marinazzo arXiv:1703.08487v2 [stat.ME] 25 Oct 2017 Data Analysis Department, Ghent University, Ghent, Belgium (Dated: October 27, 2017) In the study of complex physical and biological systems represented by multivariate stochastic processes, an issue of great relevance is the description of the system dynamics spanning multiple temporal scales. While methods to assess the dynamic complexity of individual processes at different time scales are well-established, multiscale analysis of directed interactions has never been formalized theoretically, and empirical evaluations are complicated by practical issues such as filtering and downsampling. Here we extend the very popular measure of Granger causality (GC), a prominent tool for assessing directed lagged interactions between joint processes, to quantify information transfer across multiple time scales. We show that the multiscale processing of a vector autoregressive (AR) process introduces a moving average (MA) component, and describe how to represent the resulting ARMA process using state space (SS) models and to combine the SS model parameters for computing exact GC values at arbitrarily large time scales. We exploit the theoretical formulation to identify peculiar features of multiscale GC in basic AR processes, and demonstrate with numerical simulations the much larger estimation accuracy of the SS approach compared with pure AR modeling of filtered and downsampled data. The improved computational reliability is exploited to disclose meaningful multiscale patterns of information transfer between global temperature and carbon dioxide concentration time series, both in paleoclimate and in recent years. PACS numbers: 02.50.Ey, 05.45.Tp, 87.10.Mn, 92.70.Gt I. INTRODUCTION Granger causality (GC) is a powerful tool for assessing directional interactions from time series data according to the notion of time lagged influence first proposed by Wiener [1] and then formalized by Granger [2] and Geweke [3, 4] in the framework of vector autoregressive (AR) modeling of stochastic processes. Since its formulation, GC has gained increasing popularity and is nowadays ubiquitously employed in several scientific fields ranging from econometrics to social and climate sciences, neuroscience and physiology [5–8]. The great success of this measure comes from its conceptual simplicity, data-driven nature, and relative ease of implementation. An additional appealing property of GC is the principled interpretation of its generalized probabilistic formulation, which is closely related to the the information-theoretic concept of transfer entropy [9]. Many processes in physics, biology and other fields exhibit dynamics spanning multiple temporal scales [10– 14]. The multiscale properties of an observed stochastic process can be explored first resampling at different temporal scales the originally measured realization of the process, and then assessing the dynamical complexity of the rescaled series [15]. This approach has been followed with great success to quantify the multiscale behavior of the individual dynamics of scalar processes [11–14]. However, its extension to the multiscale computation of the information transfer between processes, though attempted in empirical studies [16, 17], is far less straightforward. In fact, the multiscale evaluation of lagged influence measures such as the GC is severely complicated by theoretical and practical issues [18, 19]. These issues arise from the rescaling procedure, which essentially consists in a filtering step eliminating the fast temporal scales (classically performed by averaging [15]) followed by a downsampling step that coarse-grains the time series around the selected scale. The filtering step leaves theoretically unchanged the GC values, but degrades severely their estimation affecting reliability, stability and data demand [20]. The downsampling step is even more problematic, as it alters GC values in a way that was unknown until very recently [18, 19] and impacts consistently detectability and accuracy of GC estimates. For these reasons, research on the data-driven inference of the multiscale structure of coupled processes, though holding a great potential, is still largely undeveloped. In order to provide a formal extension of GC to multiscale analysis, here we introduce for the first time an analytical frame for its computation on linear multivariate stochastic processes subjected to averaging and downsampling. We exploit the theory of state space (SS) models [18, 19, 21] to yield exact GC values for for coupled processes observed at different time scales. The high 2 computational reliability of the associated multiscale GC estimator is demonstrated in simulated AR processes and then used to explore, spanning a wide range of time scales, the patterns of information transfer between anthropogenic emissions and global temperatures. II. GRANGER CAUSALITY A. Definition To lay the groundwork for multiscale GC computation and introduce notations, we start resuming the calculation of GC for general multivariate processes [2, 4]. Let us consider a discrete-time, stationary vector stochastic process composed of M real-valued zero-mean scalar processes, Yn = [y1,n · · · yM,n ]T , −∞ < n < ∞, and assume the process yj as the target and the process yi as the driver (the remaining M − 2 processes form the vector Yk , where k = {1, . . . , M }\{i, j}). Then, denoting the present and the past of vector and scalar variT T Yn−2 · · · ], ables respectively as Yn , yn , and Yn− = [Yn−1 − yn = [yn−1 yn−2 · · · ], GC from yi to yj (conditional on − Yk ) quantifies the extent to which yi,n improves the prediction of yj,n above and beyond the extent to which − − yj,n is predicted by yj,n and Yk,n . This definition is assessed in the time domain performing a regression of the present of the target on the past of all processes, yielding the prediction error ej|ijk,n = yj,n − E[yj,n |Yn− ], and on the past of all processes except the driver, yielding − − the prediction error ej|jk,n = yj,n − E[yj,n |yj,n , Yk,n ] (E is the expectation operator). The prediction error variances resulting from these ”full” and ”restricted” regressions, λj|ijk = E[e2j|ijk,n ] and λj|jk = E[e2j|jk,n ] are then combined to yield GC from yi to yj as [4] Fi→j = ln λj|jk . λj|ijk where X is the state (unobserved) process, and W and V are zero-mean white noise processes with covariances Ξ≡E[Wn WnT ] and Ψ≡E[Vn VnT ], and cross-covariance Θ≡E[Wn VnT ]. The SS process has an equivalent representation, referred to as ”innovations form” SS (ISS), evidencing the innovations En = Yn − E[Yn |Yn− ], i.e., the residuals of the linear regression of Yn on its infinite past Yn− , whose covariance matrix is Φ≡E[En EnT ]. The ISS representation, which is typically associated with Kalman filtering, is characterized by the state process Zn = E[Xn |Yn− ] and by the Kalman Gain matrix K: Zn+1 = AZn + KEn Yn = CZn + En . (3a) (3b) The SS and ISS representations share the state and observation matrices A and C, and differ in the noise matrices (Ξ, Ψ, Θ) and (K, Φ). To find the ISS parameters (A, C, K, Φ) from the SS parameters (A, C, Ξ, Ψ, Θ) it is necessary to solve a so-called discrete algebraic Ricatti equation (DARE ), formulated in terms of the state error variance matrix P: P = APAT + Ξ − (APCT + Θ)(CPCT + Ψ)−1 (CPAT + ΘT ), (4) from which K and Φ are obtained as Φ = CPCT + Ψ K = (APCT + Θ)Φ−1 . (5) Then, GC can be computed from the ISS parameters as follows [18]. The error variance of the full regression is simply the j − th diagonal element of the innovation covariance, λj|ijk = Φ(j, j). The error of the restricted regression is obtained by forming a submodel that excludes the driver process, i.e. considering a state space model with state equation (3a) and observation equation (1) Yn(jk) = C(jk) Zn + En(jk) (6) (a) The measure (1) is the log-likelihood ratio for the two linear regressions associated with the projections E[yj,n |Yn− ] − − and E[yj,n |yj,n , Yk,n ] [18]. According to the axiomatic definition of transfer entropy and its equivalence (up to a factor 2) to Eq.(1) for Gaussian variables [9], the GC can be interpreted as the rate of ”information transfer” from driver to target. B. State-Space Formulation Following the derivations of a recent work by Barnett et al. [18], now we move to describe the computation of GC for state state space (SS) processes. The very well known linear SS representation of an observed multivariate process Y is given by [22] Xn+1 = AXn + Wn Yn = CXn + Vn (2a) (2b) where the superscript denotes selection of the rows with indices a of a matrix. Of note, this technique represents one of the key elements in the derivation of a rigorous formalism for defining the information flow between the states of both discrete stochastic mappings and continuous time stochastic systems [23]. Here, we have that the submodel (3a, 6) is an SS model with parameters (A, C(jk) , KΦKT , Φ(jk, jk), KΦ(:, jk)), which can be converted to an ISS model with innovation covariance ΦR solving the DARE (4,5), so that the restricted error variance becomes λj|jk = ΦR (j, j). This shows that GC can be computed numerically from the ISS parameters (A, C, K, Φ) of an observed process Y . III. MULTISCALE GRANGER CAUSALITY In this Section we develop our framework for the multiscale computation of GC for linear multivariate processes. Here we consider the most common operalization 3 of GC, i.e. that grounded on the AR representation of multivariate processes [2, 7–9]: Yn = p X Ak Yn−k + Un , (7) k=1 where p is the model order, Ak are M ×M matrices of coefficients, and Un = [u1,n · · · uM,n ]T is a vector of M zero mean Gaussian innovation processes with covariance matrix Σ≡E[Un UnT ]. To study the observed process Y at the temporal scale identified by the scale factor τ , we apply to each constituent process ym , m = 1, . . . , M ,the following transformation which performs a weighted average of q consecutive samples of the process: ȳm,n = q X bl ym,nτ −l . (8) where Bl = bl IM (IM is the M × M identity matrix). Hence, the change of scale introduces a moving average (MA) component of order q in the original AR(p) process, transforming it into an ARMA(p, q) process. Then, exploiting the close relation between ARMA and SS models [21], the process (10) is turned into an ISS model by definT T T T ing the state process Z̃n = [Yn−1 · · · Yn−p Un−1 · · · Un−q ]T that, together with Ỹn , obeys the state equations (3) with parameters (Ã, C̃, K̃, Φ̃), where   C̃ = A1 · · · Ap B1 · · · Bq ,  C̃    IM (p−1) 0M (p−1)×M (q+1) , Ã =    0M ×M (p+q) 0M (q−1)×M p IM (q−1) 0M (q−1)×M l=0 This rescaling operation corresponds to transform the original process Y through a two-step procedure that consists of the following filtering and downsampling steps, performed respectively with a filter of order q and a rate of downsampling equal to τ . The filtering and downsampling steps yield respectively the processes Ỹ and Ȳ defined as: Ỹn = q X bl Yn−l , (9a) Ȳn = Ỹnτ , n = 1, . . . , N/τ. (9b) l=0 The change of scale in (8) generalizes the averaging procedure originally proposed in [15], which sets q = τ − 1 and bl = 1/τ . In this study we identify the bl as the coefficients of a linear lowpass filter with cutoff frequency set at fτ = 1/2τ to avoid aliasing in the subsequent downsampling step. Here, we develop a FIR filter of order q using the window method and implementing a Hamming window [24]. The design of a causal filter which performs one-side filtering was chosen on purpose to avoid that past and future samples mix up in the filtering process with potentially harmful consequences on the evaluation of causality. The use of one-side filtering is in agreement with the adoption of a Euler forward scheme, rather than a central differencing scheme, in the definition of causal measures of information flow (see, e.g., [25, 26]). Moreover, the use of a FIR filter achieves better elimination of the fast temporal scales with respect to the averaging procedure commonly adopted in multiscale complexity analysis [15]; in our preliminary work [27] we have shown indeed that the use of simple averaging may induce the detection of spurious causal influences over uncoupled directions. Substituting (7) in (9a), the filtering step leads to the process representation: Ỹn = p X k=1 Ak Ỹn−k + q X l=0 Bl Un−l (10)  T K̃ = IM 0M ×M (p−1) B−T 0M ×M (q−1) , 0 and where Φ̃ = B0 ΣBT0 is the covariance of the innovations Ẽn = B0 Un . Moreover, the downsampled process Ȳn can be put in ISS form directly from the ISS formulation of the filtered process Ỹn : exploiting a recent result (theorem III in [19]), we find that Ȳn = Ỹnτ has an ISS representation with state process Z̄n = Z̃nτ , innovation process Ēn = Ẽnτ , and parameters (Ā, C̄, K̄, Φ̄), where Ā = Ãτ , C̄ = C̃, and where K̄ and Φ̄ are obtained solving the DARE (4,5) for the SS model (Ā, C̄, Ξτ , Φ̃, Θτ ) with Θτ = Ãτ −1 K̃Φ̃ Ξτ = ÃΞτ −1 ÃT + K̃Φ̃K̃T , τ ≥ 2 (11) Ξ1 = K̃Φ̃K̃T , τ = 1. FIG. 1. Schematic representation of a linear multivariate AR process (left) and of its multiscale representation obtained through filtering (FLT) and downsampling (DWS) steps. At each step, an innovation state space (ISS) model can be defined which describes the multivariate process; then ISS submodels can be formed and, after solving a discrete algebraic Ricatti Equation (DARE), GC can be computed for any scale factor τ ≥ 1 (τ = 1 yields GC for the non-rescaled processes). The overall procedure for multiscale analysis is depicted in Fig. 1: filtering with cutoff fτ the AR(p) process Y yields an ARMA(p, q) process, which is equivalent 4 to an ISS process; the subsequent downsampling yields a different SS process, which in turn can be converted to the ISS form solving the DARE. Thus, both filtered and downsampled processes are described by ISS models, whose parameters can be used to compute GC by forming a submodel in which the target is observed without considering the driver process (eq. (6)) and solving the DARE for this submodel. This procedure allows analytical computation of GC measures for multiscale (filtered and downsampled) processes, which is illustrated in the following for simulated and real time series. IV. A. SIMULATION STUDY VAR process with time delayed causal interactions Theoretical analysis and simulations are first performed for the bivariate AR process with equations: y1,n = c11 y1,n−d11 + c12 y2,n−d12 + u1,n y2,n = c22 y2,n−d22 + c21 y1,n−d21 + u2,n FIG. 2. Multiscale GC analysis of the AR process (12) configured to unidirectional coupling from y1 to y2 . Plots depict the theoretical values (black lines) and distribution of estimates (median: white lines; interquartile range: grey areas) of GC computed as a function of the time scale after filtering (FLT) and downsampling (DWS). Estimates are obtained using the naı̈ve AR approach (a) and the proposed framework implemented using a lowpass FIR filter of order q = 6 (b). (12a) (12b) with iid noise processes u1,n , u2,n ∼ N (0, 1). The parameters in (12) are set to generate autonomous dynamics with strength cii and lag dii for each scalar process yi , and causal interactions with strength cij and lag dij from yj to yi (i, j = 1, 2). We consider two parameter configurations: unidirectional interaction at lag 2 from y1 to y2 , obtained setting c12 = 0 and c21 = 0.5, d21 = 2, where also autonomous dynamics are generated for y1 but not for y2 (c11 = 0.5, d11 = 1, c22 = 0); bidirectional interactions with different lags and strengths (c12 = 0.75, d12 = 2; c21 = 0.5, d21 = 7) in the presence of autonomous dynamics for both processes (c11 = c22 = 0.5, d11 = d22 = 1). First, we study the exact values of multiscale GC obtained from the true AR parameters. The theoretical trends depicted in Figs. 2 and 3 (black solid lines) document from the perspective of SS modeling the invariance of GC under filtering, already proven in [20]. The behavior of the information transfer across multiple temporal scales is thus shaped by the downsampling step, revealing the tendency of GC to peak at scales corresponding with the lag of the imposed causal interactions: maximal information transfer is found at τ = 2 for F1→2 in the unidirectional scheme (Fig. 3a,b), and at τ = 7 for F1→2 and τ = 2 for F2→1 in the bidirectional scheme (Fig. 3c). The behavior is general, in the sense that it was observed also for different parameter configurations. Next, we test reliability of multiscale GC estimates obtained from finite length realizations of (12) (a) following a naı̈ve approach whereby GC is computed performing full and restricted regressions on the filtered and downsampled time series, and (b) performing AR identification on the original time series and then applying the new proposed framework to the estimated AR parame- FIG. 3. Multiscale GC analysis of the AR process (12) configured to bidirectional coupling between y1 and y2 . Plots and symbols are as in Fig. 2. ters [28]. Application of the two approaches to 100 process realizations of 500 points is depicted in Figs. 2a, 3a and in Figs. 2b, 3b respectively, and indicates the need of state-space analysis: while the computation of GC after filtering and downsampling returns strongly biased and highly variable estimates, the new framework yields accurate detection of GC across multiple scales. B. VAR process with multiscale causal interactions As a second simulation example, we consider the case of coupled stochastic processes displaying multiscale structure and scale-dependent causal interactions. Specifically, we consider the bivariate process Yn = [y1,n y2,n ]T obtained as the instantaneous mixing of pairs of scalar processes taken from the two bivariate AR pro- 5 cesses Xn = [x1,n x2,n ]T and Zn = [z1,n z2,n ]T : x1,n x2,n z1,n z2,n y1,n y2,n = 1.9x1,n−1 − 0.9025x1,n−2 + u1,n = 0.5x1,n−1 + u2,n , = 1.6929z1,n−1 − 0.9025z1,n−2 + w1,n = z1,n−1 + w2,n , = x1,n + z2,n = x2,n + z1,n . (13a) (13b) (13c) (13d) (13e) (13f) In the bivariate processes X and Z, autonomous dynamics are set for the subprocesses x1 and z1 according to Eqs. (13a, 13c); the autonomous rhythms are obtained by placing a pole with modulus ρx1 = ρz1 = 0.95 in the complex plane representation of each individual subprocess, and the phase of the poles is varied to obtain slow oscillations for x1 (φx1 = 0) and faster oscillations for z1 (φz1 = 0.47). Moreover, causal interactions are imposed from x1 to x2 and from z1 to z2 according to Eqs. (13b, 13d); in this study, the variances of the uncorrelated innovations are set to λu1 = 0.25, λu2 = 0.5, for the process U , and to λw1 = 1, λw2 = 0.5, for the process W . Then, the mixing obtained with Eqs. (13e, 13f) is such that the bivariate process Y exhibits causal interactions from y2 to y1 visible at small time scales for the faster oscillations, as well as causal interactions from y1 to y2 visible at larger time scales for the slower oscillations. To test the ability of our framework to detect these multiscale behaviors, we performed VAR identification on realizations of 1000 data points of the observed process Y and then computed the GC for temporal scales ranging from 1 to 15; the model order was optimized using the BIC criterion, and the order of the lowpass FIR filter was set to q = 6. The results of the analysis are reported in Fig. 4. The exemplary realizations shown in Fig. 4(a) display multiscale patterns characterized by a slow rhythm (cycle of ∼ 70 points) superimposed to faster oscillations (cycle of ∼ 13 points); the multiscale GC analysis reveals that the direction of interaction is from y2 to y1 for the fast oscillations (Fy2 →y1 is maximum at low time scales), and from y1 to y2 for the slower rhythm (Fy1 →y2 emerges at higher time scales when fast oscillations are filtered out). These results are confirmed by the analysis extended to several process realizations reported in Fig. 4(b), which indicates that GC peaks at scale τ = 2 along the direction y2 → y1 , and at scales τ = 4 and τ = 8 along the direction y1 → y2 , thus detecting the multiscale patterns of bidirectional interaction imposed in the simulation. V. PRACTICAL APPLICATION As a practical application, we consider the multiscale analysis of GC between carbon dioxide concentration (CO2 ) and global temperature (GT ). It is widely considered that the raise of CO2 is a main cause of global warming [29], although the validity of such causal relation FIG. 4. Multiscale GC analysis of the bivariate process Y defined as in Eq. (13). Plots depict two exemplary realizations of the observed process Yn = [y1,n y2,n ] together with the GC computed as a function of the time scale τ along the two directions of interaction (a) and the distribution of estimates (median: solid lines; interquartile range: shaded areas) obtained over 100 realizations of the process (b). is still under debate. The problem of understanding the causes of climate change is usually tackled by numerical experiments using Global Climate Models [30] which aim at catching the complexity of climate dynamics. However, data-driven approaches, as GC, are also fruitful in assessing cause-effect relationships between temperature and external forcings. In [31] it has been shown that CO2 Granger causes temperature, based on data from 1860 to 2008, partly from ice cores, and analyzing second differences of both CO2 and GT . Similar conclusions were found in [32], using GC, in [33] by estimating the time rate of information flowing from one time series to the other, and in [6] using a physical approach. Here, we first analyze the global land-ocean temperature index [34] and CO2 concentration [35] measured at monthly resolution from March 1958 to February 2017. The measured time series, lasting 708 data points, are shown in Fig. 5(a). To fulfill stationarity criteria, we detrended the two series applying an L1 norm filter. The analyzed time series, normalized to zero mean and unit variance, are shown in Fig. 5(b). We applied the proposed framework to compute GC along the two directions of interaction for time scales ranging from 1 to 100 years. To test the statistical significance of the estimated multiscale patterns of causality, the analysis was performed both for the original time series and for a set of 100 pairs of uncoupled time series sharing the autocorrelation and amplitude distribution of the original series; these surrogate series are generated using the iterative amplitudeadjusted Fourier transform (IAAFT) algorithm [36]. 6 The results depicted in Fig. 5(c) show that the GC along both directions is not distinguishable from the corresponding surrogate counterparts at τ equal one year, i.e. when standard GC analysis not encompassing multiple time scales is performed. On the other hand, the multiscale approach reveals, at longer time scales (> 10 years), that GC is significantly higher than the surrogate threshold along both directions of interaction, thus showing the need of a multiscale approach to put in evidence this mutual interdependency between CO2 and GT . Moreover we remark that the GC along the direction CO2 → GT is characterized by a higher value of the statistics computed on the original time series, but also by higher values for the surrogate time series, compared with the direction GT → CO2 . FIG. 6. Multiscale GC analysis of global temperature (GT) and CO2 concentration for paleoclimate data. Plots depict: (a) the original paleoclimatological time series; (b) the time series superimposed after uniform resampling of the time axis and normalization; and (c) the multiscale GC computed on the normalized time series (solid lines) and over 100 IAAFT surrogates (median: white lines; 5th − 95th percentiles: shaded areas). Computations are performed using the proposed framework implemented with an order-6 FIR lowpass filter. The AR model order, set by the BIC criterion, is p = 3. FIG. 5. Multiscale GC analysis of global temperature (GT) and CO2 concentration for modern climate data. Plots depict: (a) the original GT and CO2 time series; (b) the time series superimposed after de-trending and normalization; and (c) the multiscale GC computed on the normalized time series (solid lines) and over 100 IAAFT surrogates (median: white lines; 5th −95th percentiles: shaded areas). Computations are performed using the proposed framework implemented with an order-6 FIR lowpass filter. The AR model order, set by the BIC criterion, is p = 14. Next, we dramatically change the time scales and turn to consider paleoclimatological data, so as to analyze the GC between GT and CO2 concentration on the Vostok Ice Core data from 400,000 to 6,000 years ago, extended by the EPICA Dome C data which go back to 800,000 years ago [37]. The two time series, which are sampled with non-uniform time spacing, are shown in Fig. 6(a). Here, we studied the data resampled to an uniform time spacing of 729.77 years, corresponding to a time series length of 1095 points, and after normalization to zero mean and unit variance (Fig. 6(b)); results of multiscale GC analysis did not change substantially if the original non-uniformly sampled time series were considered, or applying slightly different uniform resampling. In [38], empirical evidences for the existence of Granger causal influences along both directions CO2 → GT and GT → CO2 have been found after correcting for deterministic trends on the same data. Here, applying our framework for multiscale causality analysis we obtained the GC curves reported in Fig. 6(c). We find that, at paleolithic time scales, the GC GT → CO2 is highly significant and peaks around 1000 and 10000 years. This result may be related to the lags between Antarctic deglacial warming and CO2 increase reported in [39], and also confirms the good evidences reported on the fact that higher global temperatures do promote a rise of greenhouse gas levels [40]. The opposite causal influence from CO2 to GT is much less pronounced and exceeds the 7 IAAFT threshold for statistical significance only at very small time scales. VI. CONCLUSIONS Summarizing, our results show that carbon dioxide and temperature changes are interdependent at multiple time scales, with a predominance of GT → CO2 effects at paleolithic scales, and the presence of bidirectional causal interactions between GT and CO2 at the time scales of modern climate. These results support the expectations that changing temperatures could be held responsible for changes in greenhouse gas concentrations on paleolithic time scales, while during the last 60 years the effect of human activities becomes evident as anthropogenic radiactive forcings are seemingly driving the global temperature changes. These causal relationships between CO2 and global warming have been recently demonstrated in [33]: in that work, the use of the rigorous formulation of information flow provided by [25] led to evidence a clear unidirectional nature for the causal relation GT → CO2 in paleoclimatological data, and for the causal relation CO2 → GT in modern climate data; in the same work, the application of the standard GC index to modern climate data suggested the presence of bidirectional effects CO2 → GT and GT → CO2 , thus pointing to some ambiguity in the assessment of a predominant direction of interaction using GC. Our results agree with this interpretation, as we do not find a prevalent causal direction using the classical GC index computed at the smallest time scale, and the use of surrogate data indicates the lack of statistical significance (Fig. 5). Nevertheless, the analysis performed at higher time scales reveals the existence of significant GC CO2 → GT and, for the first time to our knowledge, a nontrivial GC GT → CO2 also in modern climate. Although this result needs to be confirmed by the implementation of more robust measures of information flow, it may be of great relevance for climate studies as it is indicative of a positive feedback which will increase the effect of anthropogenic emissions on global temperatures. The present study makes the first step toward the theoretical understanding of multiscale causal relations between coupled stochastic processes, and opens the way to the reliable estimation of these relations starting from simple AR identification. This will likely boost new impetus for research in the area of data-driven causality analysis, both in physics and in a wide variety of applicative fields. The proposed framework is flexible enough to encompass more general model representations that may unveil important multiscale features of coupled processes. For instance, integrating the standard AR representation with fractional integrated (FI) innovation modeling [41] would be straightforward as ARFI models have an SS representation, and would easily lead to assess multiscale GC in the presence of long-range correlations. The proposed setting provides also the basis to expand the applicability of multiscale GC to nonstationary and nonlinear SS processes [42], and to formalize exact computation of cross-scale information transfer within and between multivariate processes [17], thus opening new avenues of research in the evaluation of causal interactions among coupled processes. Of particular interest in this context is the recent formalization of the notion of information flow based on first principles, rather than axiomatic postulates or empirical proposals, implemented in [23]. The latter work completes the rigorous formalism introduced in [43, 44] and provides a well-principled alternative to the operational implementation of GC, and of transfer entropy intended as its non-parametric generalization, which are known to be complicated in many practical settings to an extent that spurious causalities may be revealed (e.g., in the presence of unobserved variables, measurement noise, or inappropriate time resolution) [45–48]. Hence, the availability of a rigorous derivation of the information flowing among the components of discrete time stochastic mapping, provided in [23] and extended therein to continuous time stochastic mappings and to deterministic systems, certainly constitutes a firm basis for the design of a more faithful analysis of causality between dynamical system components operated across multiple temporal scales. [1] N. Wiener, Modern mathematics for engineers 1, 125 (1956). [2] C. W. Granger, Econometrica: Journal of the Econometric Society , 424 (1969). [3] J. Geweke, Journal of the American statistical association 77, 304 (1982). [4] J. F. Geweke, J. Am. Stat. Ass. 79, 907 (1984). [5] J. R. Freeman, American Journal of Political Science , 327 (1983). [6] D. A. Smirnov and I. I. Mokhov, Physical Review E 80, 016208 (2009). [7] S. L. Bressler and A. K. Seth, Neuroimage 58, 323 (2011). [8] A. Porta and L. Faes, Proceedings of the IEEE (2015), 10.1109/JPROC.2015.2476824. [9] L. Barnett, A. B. Barrett, and A. K. Seth, Phys. Rev. Lett. 103, 238701 (2009). [10] P. Ivanov, L. Nunes Amaral, A. Goldberger, S. Havlin, M. Rosenblum, Z. Struzik, and H. Stanley, Nature 399, 461 (1999). [11] X. Kang, X. Jia, R. Geocadin, and N. V. Thakor, IEEE Trans. Biomed. Eng. 5, 1023 (2009). [12] J. Valencia, A. Porta, M. Vallverdú, F. Clariá, R. Baranowski, E. Orlowska-Baranowska, and P. Caminal, IEEE Trans. Biomed. Eng. 56, 2202 (2009). 8 [13] C.-M. Chou, Entropy 13, 241 (2011). [14] J. Wang, P. Shang, X. Zhao, and J. Xia, International Journal of Modern Physics C 24, 1350006 (2013). [15] M. Costa, A. L. Goldberger, and C.-K. Peng, Phys. Rev. Lett. 89, 068102 (2002). [16] M. Lungarella, A. Pitti, and Y. Kuniyoshi, Phys. Rev. E 76 (2007). [17] M. Paluš, Entropy 16, 5263 (2014). [18] L. Barnett and A. K. Seth, Phys. Rev. E 91, 040101 (2015). [19] V. Solo, Neural computation 28, 914 (2016). [20] L. Barnett and A. Seth, J. Neurosci. Methods 201, 404 (2011). [21] M. Aoki and A. Havenner, Econ. Rev. 10, 1 (1991). [22] B. D. Anderson and J. B. Moore, Englewood Cliffs 21, 22 (1979). [23] X. S. Liang, Phys. Rev. E 94, 052201 (2016). [24] A. V. Oppenheim and R. W. Schafer, Digital signal processing (Prentice-Hall Englewood Cliffs, NJ, 1975). [25] X. S. Liang, Phys. Rev. E 90, 052150 (2014). [26] X. S. Liang, Phys. Rev. E 92, 022126 (2015). [27] L. Faes, A. Montalto, S. Stramaglia, G. Nollo, and D. Marinazzo, arXiv preprint arXiv:1602.06155 (2016). [28] in this study AR models were identified through ordinary least squares and using the Bayesian Information Criterion (BIC) to set the model order as seen e.g. in S. L. Marple, Digital spectral analysis: with applications, Vol. 5 (Prentice-Hall Englewood Cliffs, NJ, 1987). [29] B. B. B. Booth, C. D. Jones, M. Collins, I. J. Totterdell, P. M. Cox, S. Sitch, C. Huntingford, R. A. Betts, G. R. Harris, and J. Lloyd, Environmental Research Letters 7, 024002 (2012). [30] T. L. Delworth, A. J. Broccoli, A. Rosati, R. J. Stouffer, V. Balaji, J. A. Beesley, W. F. Cooke, K. W. Dixon, J. Dunne, K. A. Dunne, et al., Journal of Climate 19, 643 (2006). [31] E. Kodra, S. Chatterjee, and A. R. Ganguly, Theoretical and Applied Climatology 104, 325 (2011). [32] A. Attanasio, Theoretical and Applied Climatology 110, 281 (2012). [33] A. Stips, D. Macias, C. Coughlan, E. Garcia-Gorriz, and X. S. Liang, Scientific Reports 6, 21691 (2016). [34] “Nasa - goddard institute for space studies,” https:// data.giss.nasa.gov/, accessed: 2017-03-23. [35] “Earth system research laboratory,” https://www.esrl. noaa.gov/, accessed: 2017-03-23. [36] T. Schreiber and A. Schmitz, Phys. Rev. Lett. 77, 635 (1996). [37] “National oceanic and atmospheric administration,” https://www.ncdc.noaa.gov/data-access/ paleoclimatology-data/datasets/ice-core, accessed: 2017-03-23. [38] J. Kang and R. Larsson, Theoretical and Applied Climatology 116, 537 (2014). [39] N. Caillon, Science 299, 1728 (2003). [40] M. Scheffer, V. Brovkin, and P. M. Cox, Geophysical Research Letters 33, L10702 (2006). [41] R. J. Sela and C. M. Hurvich, Journal of Time Series Analysis 30, 631 (2009). [42] G. Kitagawa, Journal of the American statistical association 82, 1032 (1987). [43] X. S. Liang and R. Kleeman, Physica D: Nonlinear Phenomena 231, 1 (2007). [44] X. S. Liang and R. Kleeman, Physica D: Nonlinear Phenomena 227, 173 (2007). [45] D. A. Smirnov, Phys. Rev. E 87, 042917 (2013). [46] D. W. Hahs and S. D. Pethel, Phys. Rev. Lett. 107, 128701 (2011). [47] H. Nalatore, M. Ding, and G. Rangarajan, Phys. Rev. E 75, 031123 (2007). [48] D. Chicharro and S. Panzeri, Frontiers in Neuroinformatics 8, 64 (2014).
10math.ST
Static vs Dynamic SAGAs∗ Ivan Lanese Focus Team, University of Bologna/INRIA Bologna, Italy [email protected] SAGAs calculi (or simply SAGAs) have been proposed by Bruni et al. as a model for long-running transactions. The approach therein can be considered static, while a dynamic approach has been proposed by Lanese and Zavattaro. In this paper we first extend both static SAGAs (in the centralized interruption policy) and dynamic SAGAs to deal with nesting, then we compare the two approaches. 1 Introduction Computing systems are becoming more and more complex, composed by a huge number of components interacting in different ways. Also, interactions are frequently loosely-coupled, in the sense that each component has scarce information on its communication partners, which may be unreliable (e.g., they may disconnect, or may not follow the expected protocol). Communication may be unreliable too, for instance in the case of wireless networks. Nevertheless, applications are expected to provide reliable services to their users. For these reasons, a main concern is the management of unexpected events. In the case of loosely-coupled distributed systems (e.g., for web services), unexpected events are managed according to the long-running transaction approach. A long-running transaction is a computation that either commits (i.e., succeeds), or it aborts and is compensated. Compensating a (long-running) transaction means executing a sequence of actions that revert the effect of the actions that lead to abortion, so as to reach a consistent state. This is a relaxation of the properties of ACID transactions from database theory [12], based on the fact that in the systems we are interested in rollback cannot always be perfect (e.g., one can not undo the sending of an e-mail, and if one tries to undo an airplane reservation, (s)he may have to pay some penalty). Recently, many proposals of formal models to reason about properties of long-running transactions, and about systems exploiting them, have been put forward. We concentrate on process calculi, since they are a good tool to experiment with different primitives and compare their relative merits and drawbacks. Later on, the results of these experiments can drive the design of real languages. Process calculi approaches to long-running transactions divide in two main categories: interaction-based calculi and flow composition approaches. Interaction-based calculi are obtained by extending name passing calculi with dedicated primitives, and one of their main concerns is the interplay between communication and transactions. We recall among them the π t-calculus [1], c-join [5], webπ [15], dcπ [18], the ATc calculus [2] and SOCK [11]. Flow composition approaches instead deal with the composition of atomic activities, studying how to derive compensations for complex activities from compensations of basic ones. We recall for instance SAGAs [10], StAC [8], cCSP [7] and the SAGAs calculi [6]. Some of the primitives for long-running transactions have been introduced in real languages such as WS-BPEL [17] and Jolie [16]. Long-running transactions have also been analyzed in a choreographic setting in [9]. However, only a ∗ Research partially supported by the Project FP7-231620 HATS. Bliudze, Bruni, Grohmann, Silva (Eds.): Third Interaction and Concurrency Experience (ICE 2010) EPTCS 38, 2010, pp. 51–65, doi:10.4204/EPTCS.38.7 c I. Lanese This work is licensed under the Creative Commons Attribution License. Static vs dynamic SAGAs 52 few works [3, 14, 13] until now have tried to clarify the relationships between the different approaches. We want to go forward in the understanding of those relationships. As shown in [13], a main distinction to be done is between static compensations, where essentially the order of execution of compensations depends on the syntactic structure of the program, and dynamic compensations, where it depends on the order of execution of the activities at runtime and cannot be determined statically. The analysis in [13] has been carried on in the case of interaction-based calculi. However compensations are also heavily studied in the framework of flow composition languages. The only dynamic approach to compensations in the framework of flow composition languages we are aware of is the one of dynamic SAGAs [14]. There however only non-nested SAGAs have been defined, and they have been contrasted with the dynamic interaction-based calculus SOCK [11], but not with the classic static SAGAs calculi [6]. Here we want to carry on this last comparison. More precisely, since different flavors of static SAGAs calculi exist, we contrast them with the centralized interruption policy defined in [3]. Here “interruption” means that, if there are many concurrent flows of computation and one of them aborts, the other ones are stopped. “Centralized” instead means that the compensation procedure of parallel flows of computation is started only after all forward flows have been stopped. We have chosen this approach since it is the one that more closely matches the behavior of systems programmed in WS-BPEL or Jolie. Actually, also this flavor of SAGAs has been defined only in the non-nested case, while we are interested in the nested case too. In fact, nested SAGAs are fundamental to model complex flows of activities. Thus the contributions of this paper are: • a description of the semantics of nested SAGAs, both under the static centralized interruption approach (Section 2) and the dynamic approach (Section 3); both the extensions are non trivial, as we will show when we present their semantics; • a comparison between the two semantics (Section 4), showing that the computations allowed by the dynamic semantics are a strict subset of the ones allowed by the static semantics, and this is due to the fact that the dynamic semantics is more strict on the possible orders of execution of compensations of parallel activities; this comparison has also been used as a sanity check for the formalization of the two semantics. 2 Static SAGAs SAGAs calculi [6] (SAGAs from now on) are calculi for defining compensating processes. A process is composed of activities, ranged over by A, B, . . . , and each activity may have its own compensating activity. Processes form long-running transactions, called sagas in this context. A saga either commits (i.e., succeeds), or it aborts and is compensated. Abortion of the compensation causes a failure, which is recognized as a catastrophic event and terminates the whole process. We are interested in nested sagas, thus sagas are processes too. Definition 1 (Sagas). Saga processes are defined by the following grammar: P : : = 0 | A | A ÷ B | P; P | P|P | {[P]} Processes can be the empty activity 0, an activity A without a specified compensation, or an activity A ÷ B specifying B as compensation for A. Processes can be composed in sequence (P; P) or in parallel (P|P). Sagas can be nested, thus a saga {[P]} is a process too. In the following we will disregard activities A, since they can be considered as a particular instance of compensable activities A ÷ B where B = 0. The idea underlying the static SAGA semantics is that compensations of sequential activities are executed in reverse order, while compensations of parallel activities are executed in parallel. In particular, I. Lanese 53 (ZERO) (S - ACT) 0 A Γ ⊢ h0, β i − →s h, β i A 7→ , Γ ⊢ hA ÷ B, β i − →s h, B; β i (S - STEP ) α (F - ACT) →s h⊠, β i A 7→ ⊠, Γ ⊢ hA ÷ B, β i − (A - STEP ) α′ Γ ⊢ hP, β i − →s h, β ′′ i Γ ⊢ hQ, β ′′ i −→s h, β ′ i 0 α ;α ′ Γ ⊢ hP; Q, β i −−→s h, β ′ i α Γ ⊢ hP, β i − →s h, β ′ i  6=  α Γ ⊢ hP; Q, β i − →s h, β ′ i (S - PAR) α α 1 2 Γ ⊢ hP, 0i −→ → s h1 , β1 i Γ ⊢ hQ, 0i − s h2 , β2 i 1 , 2 ∈ {, ⊠, ⊠} α1 |α2 Γ ⊢ hP|Q, β i −−−→s h1 ∧ 2 , (β1 |β2 ); β i (F - PAR) α α 1 2 → Γ ⊢ hP, 0i −→ s h1 , β1 i Γ ⊢ hQ, 0i − s h2 , β2 i 2 ∈ {, , ⊞} α1 |α2 Γ ⊢ hP|Q, β i −−−→s h1 ∧ 2 , 0i (FORCED - ABT) 0 (FORCED - FAIL) 0 Γ ⊢ hP, β i − →s h⊠, β i Γ ⊢ hP, β i − →s h, 0i (SUB - ABT) (SUB - CMT) α Γ ⊢ hP, 0i − →s →s h, 0i Γ ⊢ hP, 0i − →s h⊠, β ′ i Γ ⊢ hβ ′ , 0i − α α ;β ′ Γ ⊢ h{[P]}, β i − →s h, β ′ ; β i (SUB - FAIL -1) β′ α h, β ′ i Γ ⊢ h{[P]}, β i −−→s h, β i (SUB - FAIL -2) α Γ ⊢ hP, 0i − →s h, 0i  ∈ {, , ⊞} β ′′ α →s h⊠, β ′ i Γ ⊢ hβ ′ , 0i −→s h⊠, 0i Γ ⊢ hP, 0i − α α ;β ′′ Γ ⊢ h{[P]}, β i − →s h, 0i Γ ⊢ h{[P]}, β i −−−→s h, 0i (SUB - FORCED -1) β ′′ α Γ ⊢ hP, 0i − →s h⊠, β ′ i Γ ⊢ hβ ′ , 0i −→s h, 0i α ;β ′′ Γ ⊢ h{[P]}, β i −−−→s h, 0i (SUB - FORCED -2) β ′′ α →s h⊠, β ′ i Γ ⊢ hβ ′ , 0i −→s h1 , 0i 2 = Γ ⊢ hP, 0i − α ;β ′′ Γ ⊢ h{[P]}, β i −−−→s h2 , 0i n ⊠ if  =  1 ⊞ if 1 ∈ {⊠, } Table 1: Static semantics of nested SAGAs. Static vs dynamic SAGAs 54 the possible orders of execution for compensation activities can be determined statically, looking at the structure of the process. However, as shown by [3], different design choices concerning the behavior of parallel activities are possible. As already said, we consider the semantics with interruption of parallel activities and centralized compensations proposed in [3]. According to this semantics parallel activities are stopped when one of them aborts, while in the semantics without interruption they are run to the end (and then compensated). Also, compensations are handled in a centralized way (but for subtransactions), while in the semantics with distributed compensations each flow is responsible for executing its own compensations. The semantics presented in [3] however does not consider nested sagas, while we consider them important both from a theoretical and a practical point of view. From a practical point of view, nesting is fundamental to model large systems in a compositional way. From a theoretical point of view nesting raises interesting questions on the interplay between the behavior of a saga and of its subsagas. For this reason we extend the semantics to deal with nested SAGAs, taking inspiration from the one in [6], which has however distributed compensations. Definition 2 (Static semantics of SAGAs). The static semantics − →s of SAGAs is the LTS defined in Table 1 (we assume symmetric rules for parallel composition). A saga may commit, abort or fail, denoted respectively by , ⊠ and . Also, a saga may acknowledge an external abortion or failure, and these two possibilities are denoted by ⊠ and  respectively. Finally, a saga may answer an external abortion with a failure (when an external abort causes it to compensate a subsaga, and the compensation fails), denoted as ⊞. Note that this situation never occurs without nesting. In fact, under the centralized compensation approach, only subsagas are compensated locally, while other processes are compensated at the top level. The behavior of a saga is determined by the behavior of its constituent activities, which is specified by an environment Γ mapping each activity to either  or ⊠. The semantics of SAGAs is given as a α relation Γ ⊢ hP, β i − →s h, β ′ i, defined in the big-step style. Here label α is the observation, showing the successfully executed activities. Observations are obtained by combining activities in sequence and in parallel. If one considers an interleaving setting, label A|B can be considered as a shortcut for the two possible sequences, A; B and B; A. We consider observations up to the following axioms: 0; α = α , α ; 0 = α , 0|α = α , α |0 = α . Also, β is the compensation stored for execution at the beginning of the computation and β ′ the final stored compensation. Finally,  ranges over {, ⊠, , ⊠, , ⊞}, the possible outcomes of the saga. The first three rules execute the empty activity and basic activities. Note that rule (F - ACT) does not execute the compensation (differently from the rules for distributed compensations in the literature), since this will be executed in a centralized way (see rule (SUB - ABT)). Rule (S - STEP) deals with sequential composition when the first part of the computation succeeds. Rule (A - STEP) deals with all the other cases. Rules (S - PAR) and (F - PAR) concern parallel composition. The operator ∧ in these rules is the symmetric closure of the one defined in the table below: ∧  ⊠ ⊠   ⊞   ⊠ ⊠   ⊞ ⊠ ⊠   ⊞ − ⊠ − −  ⊠ − − − −  −  ⊞ − The two rules differ since in the first case the compensation is stored, in the second one it is discarded (since a failure is involved). Rules (FORCED - ABT) and (FORCED - FAIL) show that a process can be I. Lanese 55 stopped either by an external abort or by an external failure. In the second case the compensation is discarded. Rule (SUB - CMT) allows a saga to commit upon commit of its internal computation. Rule (SUB - ABT) instead allows a saga to commit upon abort of the internal computation and successful compensation. Rule (SUB - FAIL -1) propagates to a saga a catastrophic outcome of its internal computation. Rule (SUB - FAIL -2) establishes failure for an aborted saga whose compensation aborts too. Rule (SUB FORCED -1) allows an external failure to interrupt a compensating saga. Finally, rule (SUB - FORCED -2) deals with external requests of abortion for sagas. The saga is interrupted and compensated. If the compensation is not successful then a failure is propagated to the outer level. Note that it is not possible to make a saga abort while it is executing its own compensation: the execution of a compensation is protected from further aborts. Compensations of sagas are executed locally, in parallel with the normal flow of external activities, and before starting the compensations of external sagas containing them. We show now a few derivable transitions to clarify the semantics. Example 1. Consider a ship for transporting goods. Assume that two different kinds of goods, A and B, have to be loaded, and the order is not relevant. Also, A is not necessary, while B is. After loading the ship can leave. This can be modeled using a SAGA process P = ({[loadA ÷ unloadA]}|loadB ÷ unloadB); leave. Assume that all the activities but leave succeed. We can derive as a big-step: loadA|loadB Γ ⊢ hP, 0i −−−−−−−→s h⊠, unloadA|unloadBi thus the process has aborted. If we put the whole process inside a saga then compensation is actually executed and the saga succeeds: (loadA|loadB);(unloadA|unloadB) Γ ⊢ h{[P]}, 0i −−−−−−−−−−−−−−−−−−−→s h, 0i Assume now that all the activities but loadB and unloadA succeed. If the failure of loadB occurs before the execution of loadA then we have the transition: 0 Γ ⊢ hP, 0i → − s h⊠, 0i derived using rule (S - PAR) where the left component performs ⊠ (derived using rule (SUB - FORCED -2) 0 with left premise Γ ⊢ hloadA ÷ unloadA, 0i − →s h⊠, 0i) and the right one performs ⊠. If the failure of loadB occurs after the execution of loadA we have instead the transition: loadA Γ ⊢ hP, 0i −−−→s h, 0i derived using rule (S - PAR) where the left component performs ⊞ (derived using rule (SUB - FORCED -2) loadA with left premise Γ ⊢ hloadA ÷ unloadA, 0i −−−→s h⊠, unloadAi) and the right one performs ⊠. Having ⊠ or  instead of ⊞ (which is novel of this semantics) would not faithfully model the intuition. In fact, in the first case the result of the transition would be ⊠ instead of , while in the second case the transition would not be derivable at all, since ⊠ ∧  is undefined (otherwise an abort could make a transaction fail, even if compensations were successful). Example 2. We consider here a modification of the example above, so to clarify another aspect of the semantics. We consider a SAGA process P′ = {[loadA1 ÷ unloadA1; loadA2 ÷ unloadA2]}|(loadB1 ÷ unloadB1; loadB2 ÷ unloadB2), where each load activity has been split in two subactivities. Assume that activity loadB2 aborts, while all the other activities succeed. On the right-hand side we have a transition: loadB1 Γ ⊢ hloadB1 ÷ unloadB1; loadB2 ÷ unloadB2, 0i −−−−→s h⊠, unloadB1i This interacts with a left transition of the form: loadA1;unloadA1 Γ ⊢ h{[loadA1 ÷ unloadA1; loadA2 ÷ unloadA2]}, 0i −−−−−−−−−→s h0, ⊠i Thus the label of the whole transition is (loadA1; unloadA1)|loadB1. In particular, the compensation of the left branch, unloadA1, can be executed before loadB1, i.e. before the fault actually happens. This can be justified by considering an asynchronous scenario, where the observer receives events from different Static vs dynamic SAGAs 56 parallel processes out-of-order. The same problem occurs with the distributed semantics [3], and is due to the fact that sagas are compensated locally. We will see that the dynamic semantics solves this problem. An approach for solving the problem also in the static scenario can be found in [4]. 3 Dynamic SAGAs Dynamic SAGAs have been proposed in [14], in the non-nested case, to reduce the degree of nondeterminism in saga execution. In static SAGAs, in fact, the compensation of A1 %B1 |A2 %B2 is B1 |B2 . Thus both the orders B1 ; B2 and B2 ; B1 are allowed, independently of the order in which activities A1 and A2 have been executed. Dynamic SAGAs specify instead that compensations of parallel activities are executed in reverse order: if the execution of normal activities has been A1 ; A2 then the execution of compensations is B2 ; B1 . Thus the order of execution of compensations depends on runtime information on the execution of the basic activities. While the semantics of static SAGAs is normally given in the big-step style, the semantics of dynamic SAGAs is given in the small-step one. A more detailed motivation for this will be given in the next section. Static and dynamic SAGAs have the same syntax, differing only in the semantics. However, to define the semantics of dynamic SAGAs, we find it convenient to exploit an extended syntax: P : : = . . . | {[P, P]} | JPK | JPK⊠ Here {[P, β ]} is a running saga, where P is the body and β a stored compensation (syntactically, a process obtained as sequential composition of basic activities). From now on, {[P]} stands for {[P, 0]}. Also, JPK and JPK⊠ are executing compensations. Notation JPK ranges over both of them. Compensations should be executed in a protected way since we do not want further abortions to stop them. Similar solutions are exploited for instance in SOCK [11], WS-BPEL [17] and others. The difference between JPK and JPK⊠ is that JPK has been triggered by the transition itself and commits if P commits, while JPK⊠ has been activated by an external abort, thus it has to re-raise the abort if P commits. We need to extract the protected compensations from a process (to actually protect them, cfr. rule (A - PAR - D)), and we will use to this end the function extr(•) defined below. Similar functions are used, e.g., in SOCK [11] and dcπ [18]. extr(0) extr(A ÷ B) extr(P; Q) extr(P|Q) extr({[P, β ]}) extr(JPK ) = = = = = = 0 0 extr(P) extr(P)|extr(Q) extr(P); β P Finally, we assume a predicate null(P), which holds if P has no behavior: null(0) null(P; Q) null(P|Q) null({[P, β ]}) null(JPK ) null(JPK ) = = = = = = true null(P) ∧ null(Q) null(P) ∧ null(Q) null(P) null(P) f alse otherwise I. Lanese 57 The dynamic semantics of SAGAs that we present extends the one in [14] to deal with nested sagas. The extension is non trivial: for instance for the non-nested case neither the function extr(•) nor the auxiliary runtime syntax were needed. Definition 3 (Dynamic semantics of SAGAs). The dynamic semantics − →d of SAGAs is the LTS defined in Table 2 (we assume symmetric rules for parallel composition). Basic steps are as for the standard semantics. Rules for composition operators allow deriving both a a →d hP′ , β ′ i and final steps Γ ⊢ hP, β i − →d h, β ′ i (here  ranges over intermediate steps Γ ⊢ hP, β i − {, ⊠, } and a is an activity name). Also † is a possible label, denoting an abortion which is delayed to wait for termination of running compensation activities. Rules (STEP - D), (K - STEP - D), (S - STEP - D), (A - STEP - D) and (F - STEP - D) deal with the possible evolutions of sequential composition. Rules (PAR - D), (S - PAR - D) and (F - PAR - D) concern normal computation, commit and failure of one branch of parallel composition, respectively. Rule (A - PAR - D) deals with abortion of one branch. If the other branch includes some running compensations, then abortion is delayed and compensation execution is completed first. Running compensations are extracted by function extr(P) and thus preserved, while other parallel activities are discarded. Delayed abortion is propagated using label †. Label † is propagated by rule (K - PAR - D), extracting running compensations from parallel processes. When all the compensations have been completed (rule (A - PAR - FIN - D)) abortion is raised again. Rules (SAGA - D), (S - SAGA - D) and (F - SAGA - D) deal with normal computation, commit and failure of the internal computation in a saga, respectively. Rule (K - SAGA - D) stops the propagation of label †. Rule (A - SAGA - D) deals with abortion of the internal computation of a saga: the stored compensation is executed in a protected way. The behavior of protection (of the two kinds) is defined by rules (PROT- D) for normal steps, rule (K - PROT- D) for delayed abortion (actually, this can happen only for JPK⊠ ) and rule (A - PROT- D) for abortion (producing a failure). The two kinds of protection differ in case of commit of the internal computation: JPK commits (rule (S - PROT- D)) while JPK⊠ aborts (rule (S - KILLED - D)), re-raising the delayed abortion. We show a few computations as examples. Example 3. Let us consider the saga process defined in Example 1. Remember that P = ({[loadA ÷ unloadA]}|loadB ÷ unloadB); leave. Assume that all the activities but leave succeed. We can derive, e.g., the following computation: loadA Γ ⊢ hP, 0i −−−→d h(loadB ÷ unloadB); leave, unloadAi loadB −−−→d hleave, unloadB; unloadAi 0 → −d h⊠, unloadB; unloadAi thus the process has aborted. If we put the whole process inside a saga then compensation is actually executed and the saga succeeds: loadA loadB Γ ⊢ h{[P]}, 0i −−−→d −−−→d h{[leave, unloadB; unloadA]}, 0i 0 →d − hJunloadB; unloadAK , 0i unloadB hJunloadAK , 0i unloadA h, 0i −−−−→d −−−−→d We consider here another possible computation, so to clarify one of the most tricky cases of the dynamic semantics. Assume that instead of activity loadA with compensation unloadA we have a sequential composition of two activities, loadA1 with compensation unloadA1 and loadA2 with compensation Static vs dynamic SAGAs 58 (S - ACT- D) (ZERO - D) 0 A →d h, β i Γ ⊢ h0, β i − A 7→ , Γ ⊢ hA ÷ B, β i − →d h, B; β i (STEP - D) (F - ACT- D) a →d hP′ , β ′ i Γ ⊢ hP, β i − 0 A 7→ ⊠, Γ ⊢ hA ÷ B, β i − →d h⊠, β i a Γ ⊢ hP; Q, β i − →d hP′ ; Q, β ′ i (K - STEP - D) (S - STEP - D) † a →d hP′ , β ′ i Γ ⊢ hP, β i − Γ ⊢ hP, β i − →d h, β ′ i a Γ ⊢ hP; Q, β i − →d hP′ , β ′ i Γ ⊢ hP; Q, β i − →d hQ, β ′ i (A - STEP - D) (F - STEP - D) † 0 →d Γ ⊢ hP, β i − 0 h⊠, β ′ i Γ ⊢ hP, β i − →d h, 0i 0 0 Γ ⊢ hP; Q, β i − →d h⊠, β ′ i Γ ⊢ hP; Q, β i − →d h, 0i (PAR - D) (K - PAR - D) a Γ ⊢ hP, β i − →d † hP′ , β ′ i →d hP′ , β ′ i Γ ⊢ hP, β i − a Γ ⊢ hP|Q, β i − →d hP′ |Q, β ′ i Γ ⊢ hP|Q, β i − →d hP′ |Jextr(Q)K⊠ , β ′ i (S - PAR - D) (A - PAR - D) a Γ ⊢ hP, β i − →d † 0 →d h⊠, β ′ i extr(Q) = β ′′ Γ ⊢ hP, β i − h, β ′ i a Γ ⊢ hP|Q, β i − →d hQ, β ′ i † Γ ⊢ hP|Q, β i − →d hJβ ′′ K⊠ , β ′ i (F - PAR - D) (A - PAR - FIN - D) 0 →d Γ ⊢ hP, β i − h⊠, β ′ i extr(Q) = β ′′ 0 Γ ⊢ hP|Q, β i − →d h⊠, β ′ i null(β ′′ ) 0 Γ ⊢ hP, β i − →d h, 0i 0 Γ ⊢ hP|Q, β i − →d h, 0i (K - SAGA - D) (SAGA - D) a Γ ⊢ hP, β i − →d hP′ , β ′ i a † →d hP′ , β ′ i Γ ⊢ hP, β i − Γ ⊢ h{[P, β ]}, β ′′ i − →d h{[P′ , β ′ ]}, β ′′ i Γ ⊢ h{[P, β ]}, β ′′ i − →d h{[P′ , β ′ ]}, β ′′ i (S - SAGA - D) (A - SAGA - D) a →d Γ ⊢ hP, β i − h, β ′ i a 0 0 →d h⊠, β ′ i Γ ⊢ hP, β i − Γ ⊢ h{[P, β ]}, β ′′ i − →d h, β ′ ; β ′′ i Γ ⊢ h{[P, β ]}, β ′′ i − →d hJβ ′ K , β ′′ i (F - SAGA - D) (PROT- D) 0 0 a →d h, 0i Γ ⊢ hP, β i − →d hP′ , β ′ i Γ ⊢ hP, β i − a Γ ⊢ h{[P, β ]}, β ′′ i − →d h, 0i Γ ⊢ hJPK , β i − →d hJP′ K , β ′ i (K - PROT- D) (S - PROT- D) 0 † Γ ⊢ hP, β i − →d h, β ′ i Γ ⊢ hJPK⊠ , β i − →d hJP′ K⊠ , β ′ i † Γ ⊢ hJPK , β i − →d h, β ′ i (S - KILLED - D) (A - PROT- D) a Γ ⊢ hP, β i − →d hP′ , β ′ i a Γ ⊢ hP, β i − →d h, β ′ i a Γ ⊢ hJPK⊠ , β i − →d h⊠, β ′ i a 0 Γ ⊢ hP, β i − →d h⊠, β ′ i 0 Γ ⊢ hJPK , β i − →d h, 0i Table 2: Dynamic semantics of nested SAGAs. ¬null(β ′′ ) I. Lanese 59 unloadA2. Assume also that activity loadB aborts, while the other activities succeed. Γ ⊢ hP′′ , 0i loadA1 −−−−→d † →d − unloadA1 h({[loadA2, unloadA1]}|loadB ÷ unloadB); leave, 0i hJunloadA1K⊠ , 0i −−−−−→d h⊠, 0i Here loadB aborts when the parallel saga is still running, thus abortion is postponed. After compensation has been performed, the abortion is raised again. Example 4. We show now the behavior of the saga in Example 2 when executed under the dynamic semantics. loadA1 Γ ⊢ hP′ , 0i −−−−→d h{[loadA2 ÷ unloadA2, unloadA1]}|loadB1 ÷ unloadB1; loadB2 ÷ unloadB2, 0i Here unloadA1 is not enabled, and it becomes enabled only after loadB1 is observed and loadB2 is executed, triggering the abort: loadA1 h{[loadA2 ÷ unloadA2, unloadA1]}|loadB1 ÷ unloadB1; loadB2 ÷ unloadB2, 0i loadB1 h{[loadA2 ÷ unloadA2, unloadA1]}|loadB2 ÷ unloadB2, unloadB1i Γ ⊢ hP′ , 0i −−−−→d −−−−→d † →d − unloadA1 hJunloadA1K⊠ , unloadB1i −−−−−→d h⊠, unloadB1i 4 Static vs Dynamic SAGAs In this section we compare the static and dynamic semantics of nested SAGAs. In particular, we show that each computation obtained from the dynamic semantics is compatible with a big-step of the static semantics. We show also that the static semantics allows for more nondeterminism in the order of execution of activities, i.e. it allows for some computations not valid according to the dynamic semantics. Labels of a big-step correspond to sets of computations of small-steps (assuming an interleaving a1 an α →d · · · − →d . We interpretation for parallel composition). We write =⇒ with α = a1 ; . . . ; an to denote − remove from α both 0 and †. However, big-step labels may also include parallel composition operators, thus to perform the comparison we have to introduce the concept of linearization. We consider the set of linearizations lin(α ) of a big-step label α , which is defined by structural induction on α : lin(A) = {A} lin(α ; α ′ ) = {γ ; γ ′ | γ ∈ lin(α ) ∧ γ ′ ∈ lin(α ′ )} lin(α |α ′ ) = [ γ 9 γ′ γ ∈lin(α )∧γ ′ ∈lin(α ′ ) where 9 is defined as follows: 0 9 γ = {γ } γ 9 0 = {γ } A; γ 9 A′ ; γ ′ = {A; γ ′′ | γ ′′ ∈ γ 9 A′ ; γ ′ } ∪ {A′ ; γ ′′ | γ ′′ ∈ A; γ 9 γ ′ } Static vs dynamic SAGAs 60 In words, 9 computes the set of all possible interleavings of the sequences of actions in its two arguments. Summarizing, a big-step label α corresponds to the set of small-step computations with labels in lin(α ). Next lemma discusses the properties of †-labeled transitions. † Lemma 1. If Γ ⊢ hP, β i =⇒ hP′ , β ′ i then P′ is a parallel composition of terms of the form JPi K⊠ . We can now prove our main theorems, relating the behavior of static and dynamic semantics for SAGAs. We have two theorems, one for each direction. γ α Theorem 1. If Γ ⊢ hP, β i =⇒ h, β ′ i with  ∈ {, ⊠, } then there is a big-step Γ ⊢ hP, β i − →s h, β ′′ i with γ ∈ lin(α ) and β ′ ∈ lin(β ′′ ). Proof. The proof is by structural induction on P. Actually for the induction we need a stronger hypothesis, requiring also that: γ γ′ γ γ′ α ;α ′ • if Γ ⊢ hP, β i =⇒ hP′ , β ′ i and Γ ⊢ hextr(P′ ), 0i =⇒ h, 0i, then there is a big-step Γ ⊢ hP, β i −−→s h⊠, β ′′ i with γ ∈ lin(α ), γ ′ ∈ lin(α ′ ) and β ′ ∈ lin(β ′′ ); • if Γ ⊢ hP, β i =⇒ hP′ , β ′ i and Γ ⊢ hextr(P′ ), 0i =⇒ h, 0i with  ∈ {⊠, }, then there is a big-step α ;α ′ Γ ⊢ hP, β i −−→s h⊞, 0i with γ ∈ lin(α ) and γ ′ ∈ lin(α ′ ); γ α • if Γ ⊢ hP, β i =⇒ hP′ , β ′ i, then there is a big-step Γ ⊢ hP, β i − →s h, 0i with γ ∈ lin(α ). We have the following cases: 0 0 P = 0: the only non trivial computation is Γ ⊢ h0, β i − →d h, β i. The big-step Γ ⊢ h0, β i − →s h, β i derived from rule (ZERO) satisfies the thesis. As far as the empty computation is concerned the 0 0 two big-steps Γ ⊢ h0, β i − →s h⊠, β i and Γ ⊢ h0, β i − →s h, 0i, derived from rules (FORCED - ABT) and (FORCED - FAIL) respectively, satisfy the thesis. P = A ÷ B: we have a case analysis according to Γ(A). If Γ(A) =  then the only non trivial computation A →d h, B; β i, and we have a corresponding big-step, derived from rule (S - ACT). is Γ ⊢ hA ÷ B, β i − Similarly for the case Γ(A) = ⊠, using rule (F - ACT). The empty computations can be matched as before. γ P = P1 ; P2 : assume that there is a computation Γ ⊢ hP1 ; P2 , β i =⇒ h, β ′ i with  ∈ {, ⊠, }. We have to consider the three cases  = ,  = ⊠ and  = .  = : let us consider the first part of the computation. The only possibility is to have the first zero or more steps derived using as last rule (STEP - D) followed by one step derived using as last rule (S - STEP - D). By concatenating the premises we have a computation Γ ⊢ γ′ α′ hP1 , β i =⇒ h, β ′′ i. By inductive hypothesis we have a big-step Γ ⊢ hP1 , β i −→s h, δ ′′ i with γ ′ ∈ lin(α ′ ) and β ′′ ∈ lin(δ ′′ ). Also, using the last part of the computation we have a α ′′ big-step Γ ⊢ hP2 , β ′′ i −→s h, δ ′ i with γ ′ ∈ lin(α ′′ ), β ′ ∈ lin(δ ′ ) and γ = γ ′ ; γ ′′ . The thesis follows by rule (S - STEP). It is not possible to have the first zero or more steps derived using as last rule (STEP - D) followed by one step derived using as last rule (K - STEP - D) since this computation can not succeed (see Lemma 1).  = ⊠: we have a few possibilities here, according to which is the first rule applied different from (STEP - D). If it is rule (S - STEP - D) then the thesis follows by inductive hypothesis applying rule (S - STEP). If it is rule (A - STEP - D) then the thesis follows by inductive hypothesis applying rule (A - STEP). If it is rule (K - STEP - D) then the thesis follows by inductive hypothesis, again applying rule (A - STEP). I. Lanese 61  = : similar to the one above. As far as computations leading to processes are concerned, a similar reasoning can be done. The thesis follows from rule (A - STEP) if the computation is only composed by steps from rule (STEP D ). If the computation includes also a step from rule (S - STEP - D ) then the thesis follows from rule (S - STEP). If the computation includes also a step from rule (K - STEP - D) then the thesis follows from rule (A - STEP). γ P = P1 |P2 : assume that there is a computation Γ ⊢ hP1 |P2 , β i =⇒ h, β ′ i with  ∈ {, ⊠, }. We have to consider the three cases  = ,  = ⊠ and  = .  = : let us consider the first part of the computation. The only possibility is to have the first zero or more steps derived using as last rule (PAR - D) followed by one step derived using as last rule (S - PAR - D). Assume for simplicity that (S - PAR - D) eliminates the first component of the parallel composition. By concatenating the premises of those transitions that concern the γ′ first component we have a computation Γ ⊢ hP1 , 0i =⇒ h, β ′′ i. By inductive hypothesis we α′ have a big-step Γ ⊢ hP1 , 0i −→s h, δ ′′ i with γ ′ ∈ lin(α ′ ) and β ′′ ∈ lin(δ ′′ ). Also, using the premises of the transitions involving the second component and the last part of the computaα ′′ tion we have a big-step Γ ⊢ hP2 , β i −→s h, δ ′′′ i with γ ′′ ∈ lin(α ′′ ) and β ′′′ ∈ lin(δ ′′′ ). Also, γ is an interleaving of γ ′ and γ ′′ and β ′ is obtained by prefixing β with an interleaving of β ′′ and β ′′′ . The thesis follows by rule (S - PAR) (since  ∧  = ). It is not possible to have the first zero or more steps derived using as last rule (STEP - D) followed by one step derived using as last rule (K - STEP - D) since this computation can not succeed (see Lemma 1).  = ⊠: we have a few possibilities here, according to which is the first rule applied different from (PAR - D). If it is (S - PAR - D) then the thesis follows by inductive hypothesis applying rule (S - PAR) (since  ∧ ⊠ = ⊠). If it is (A - PAR - D) then from the premises concerning P we can derive an abortion for P. From Q we can derive a computation leading to Q′ and an abortion for Jextr(Q′ )K⊠ , i.e. a commit for extr(Q′ ). Thus we can derive a big-step leading to ⊠ for Q. The thesis follows from rule (S - PAR) (since ⊠ ∧ ⊠ = ⊠). The case of rule (K - PAR - D) is similar, with the abortion coming after all compensations have been consumed (i.e., when rule (A - PAR - FIN - D) is triggered).  = : we have a few possibilities here, according to which is the first rule applied different from (PAR - D). If it is (S - PAR - D) then the thesis follows by inductive hypothesis applying rule (F - PAR) (since  ∧  = ). If it is (A - PAR - D) then from the premises concerning P we can derive an abortion for P. From Q we can derive a computation leading to Q′ and a failure for Jextr(Q′ )K⊠ , i.e. an abort or a failure for extr(Q′ ). Thus we can derive a big-step leading to ⊞ for Q. The thesis follows from rule (F - PAR) (since ⊠ ∧ ⊞ = ). The case of rule (K - PAR - D) is similar. The case of rule (F - PAR - D) follows from rule (F - PAR), since  ∧  = . As far as computations leading to processes are concerned, a similar reasoning can be done. One has to distinguish interrupt from abort and interrupt from failure. In the first case the thesis follows by inductive hypothesis applying rule (S - PAR) (with ⊠ ∧ ⊠ = ⊠) if both the compensations succeed. If at least one of the compensations fails then the other one is interrupted by a failure and the thesis follows by inductive hypothesis applying rule (F - PAR) (with ⊞ ∧  = ⊞). If interruption is from a failure, then the thesis follows from rule (F - PAR) (with  ∧  = ). γ P = {[P1 ]}: assume that there is a computation Γ ⊢ h{[P1 ]}, β i =⇒ h, β ′ i with  ∈ {, ⊠, }. We have to consider the three cases  = ,  = ⊠ and  = . Static vs dynamic SAGAs 62  = : we have two possibilities here. The first one is to have the first zero or more steps derived using as last rule (SAGA - D) followed by one step derived using as last rule (S - SAGA - D). γ By concatenating the premises of those transitions we have a computation Γ ⊢ hP1 , 0i =⇒ α h, β ′ i. By inductive hypothesis we have a big-step Γ ⊢ hP1 , 0i − →s h, δ ′ i with γ ∈ lin(α ) and β ′ ∈ lin(δ ′ ). The thesis follows by rule (SUB - CMT). The second case exploits rule (SAGA - D) at the beginning (or possibly (K - SAGA - D)), then one transition from rule (A - SAGA D ), then some transitions from rule (PROT- D ) and finally one transition from rule (S - PROT- D ). Here by considering the premises of the first part of the computation we have a computation γ′ γ ′′ Γ ⊢ hP1 , 0i =⇒ h⊠, β ′′ i. From the second part we get a computation Γ ⊢ hβ ′′ , 0i =⇒ h, 0i. The thesis follows from the inductive hypothesis by applying rule (SUB - ABT).  = ⊠: there is no possibility for a saga computation to lead to an abort, thus this case can never happen.  = : we have two possibilities here. The first one is to have the first zero or more steps derived using as last rule (SAGA - D) (and possibly some (K - SAGA - D)) followed by one step derived using as last rule (F - SAGA - D). By concatenating the premises of those transitions γ we have a computation Γ ⊢ hP1 , 0i =⇒ h, 0i. By inductive hypothesis we have a big-step α Γ ⊢ hP1 , 0i − →s h, 0i with γ ∈ lin(α ). The thesis follows by rule (SUB - FAIL -1). The second case exploits rule (SAGA - D) at the beginning, then one transition from rule (A - SAGA - D), then some transitions from rule (PROT- D) and finally one transition from rule (A - PROT- D). Here by considering the premises of the first part of the computation we have a computation γ′ γ ′′ Γ ⊢ hP1 , 0i =⇒ h⊠, β ′ i. From the second part we get a computation Γ ⊢ hβ ′ , 0i =⇒ h⊠, β ′′ i. The thesis follows from the inductive hypothesis by applying rule (SUB - FAIL -2). As far as computations leading to processes are concerned, a similar reasoning can be done. If the computation is only composed by applications of rules (SAGA - D) or (K - SAGA - D) then the thesis follows by inductive hypothesis from rule (SUB - FAIL -1) or from rule (SUB - FORCED -2). If there is an application of rule (A - SAGA - D) then the thesis follows from rule (SUB - FORCED -1). The following theorem considers the other direction. α Theorem 2. If Γ ⊢ hP, β i − →s h, β ′′ i with  ∈ {, ⊠, } then there are γ ∈ lin(α ) and β ′ ∈ lin(β ′′ ) γ such that Γ ⊢ hP, β i =⇒ h, β ′ i Proof. The proof requires a case analysis similar to the one of Theorem 1. We omit the details. Example 5. Consider the ship example and its two executions at the beginning of Example 1 (with static semantics) and Example 3 (with dynamic semantics). It is easy to see for instance that loadA; loadB ∈ lin(loadA|loadB) and unloadB; unloadA ∈ lin(unloadA|unloadB). Thus the dynamic computation is compatible with the static big-step, for a suitable choice of the interleaving of parallel activities. Notably, it is not possible to prove Theorem 2 by requiring a computation for each possible linearization of α . In fact the chosen linearization depends on the runtime execution of activities. For instance, in Example 3 it is not possible to have as observation loadA; loadB and as compensation unloadA; unloadB. Also, abortion of nested sagas is managed in a different way, as shown in the example below. I. Lanese 63 Example 6. Consider the saga in Example 2. According to the static semantics it has a big-step with label (loadA1; unloadA1)|loadB1. In particular, loadA1; unloadA1; loadB1 is a possible linearization of (loadA1; unloadA1)|loadB1. However, as shown in Example 4, there is no dynamic computation with this behavior. There is however a dynamic computation compatible with the big-step, as shown in Example 4, considering the linearization loadA1; loadB1; unloadA1. These are the main differences between static and dynamic SAGAs: among all the computations compatible with the static semantics, only some are acceptable for the dynamic semantics, and whether a computation is acceptable or not depends on the relation between the order of execution of activities and of their compensations and on the interplay between nesting and parallel composition. This also explains why we used a small-step semantics for dynamic SAGAs (while classic semantics for static SAGAs is big-step): it is difficult to catch the dependencies between the order of execution of activities and the order of execution of compensations using big-step semantics. For instance, a rule such as (S - PAR) in Table 1 tailored for dynamic SAGAs should require that the interleaving chosen for activities in α1 |α2 is the same as the one chosen for their compensations in β1 |β2 , and one would need to track the correspondence between activities and their compensations. Summarizing, the theorems above provide the following insights: • the static and the dynamic semantics are strongly related, in the sense that for each static big-step there is (at least) one dynamic computation compatible with it, and for each dynamic computation there is a compatible big-step; • the two semantics are not equivalent, since not all the computations compatible with a big-step are valid dynamic computations; • in the dynamic semantics the order of execution of compensations depends on the order of execution of basic activities, while this is not the case for the static semantics; • in the dynamic semantics compensations of subtransactions can be observed only after the abort itself has been observed. 5 Conclusion We have presented two semantics for nested SAGAs, a static semantics following the centralized interruption policy and a dynamic semantics. The two semantics are a non trivial step forward w.r.t. the non-nested case presented in the literature (cfr. [3] and [14]). Even the static semantics is quite different from the (static) semantics of nested SAGAs with distributed interruption presented in [6]. The main difference relies in the different ways compensations have to be managed in the two cases. Actually, we think that the semantics with distributed interruption is realistic only in asynchronous settings since, as said in [3], it “includes a “guessing mechanism” that allows branches on the forward flow to compensate even before an activity aborts”. This forbids for instance an encoding into a lower-level framework such as the one in [14]. A similar behavior occurs also in our static semantics, but only in the case of nested transactions. As far as future work is concerned, many different proposals of primitives and models for longrunning transactions have been put forward in the last years, yet a coherent picture of the field is still far. Understanding the relationships between the different formalisms is fundamental so to understand which of them are best suited to be introduced in real languages. Even restricting our attention to SAGAs, the interplay between dynamicity and the different approaches presented in [3] has to be fully analyzed. Static vs dynamic SAGAs 64 Also, we are currently working [4] on a static semantics for SAGAs which is distributed but does not require the guessing mechanism described above. 6 Bibliography References [1] L. Bocchi, C. Laneve & G. Zavattaro (2003): A Calculus for Long-Running Transactions. In: Proc. of FMOODS’03, LNCS 2884, Springer, pp. 124–138. Available at http://springerlink.metapress.com/ openurl.asp?genre=article%&issn=0302-9743&volume=2884&spage=124. [2] L. Bocchi & E. Tuosto (2010): A Java Inspired Semantics for Transactions in SOC. In: Proc. of TGC 2010, LNCS 6084, Springer. To appear. [3] R. Bruni, M. J. Butler, C. Ferreira, C.A.R. Hoare, H.C. Melgratti & U. Montanari (2005): Comparing Two Approaches to Compensable Flow Composition. In: Proc. of CONCUR’05, LNCS 3653, Springer, pp. 383– 397. Available at http://dx.doi.org/10.1007/11539452_30. [4] R. Bruni, A. Kersten, I. Lanese & G. Spagnolo: A new Strategy for Distributed Compensations with Interruption in Long-Running Transactions. Working draft. [5] R. Bruni, H. Melgratti & U. Montanari (2004): Nested Commits for Mobile Calculi: Extending Join. In: Proc. of IFIP TCS’04, Kluwer, pp. 563–576. [6] R. Bruni, H. Melgratti & U. Montanari (2005): Theoretical foundations for compensations in flow composition languages. In: Proc. of POPL ’05, ACM Press, pp. 209–220. [7] M. Butler, C.A.R. Hoare & C. Ferreira (2004): A Trace Semantics for Long-Running Transactions. In: 25 Years Communicating Sequential Processes, LNCS 3525, Springer, pp. 133–150. Available at http://dx. doi.org/10.1007/11423348_8. [8] M. J. Butler & C. Ferreira (2004): An Operational Semantics for StAC, a Language for Modelling Long-Running Business Transactions. In: Proc. of COORDINATION’04, LNCS 2949, Springer, pp. 87–104. Available at http://springerlink.metapress.com/openurl.asp? genre=article%&issn=0302-9743&volume=2949&spage=87. [9] M. Carbone, K. Honda & N. Yoshida (2008): Structured Interactional Exceptions for Session Types. In: Proc. of Concur’08, LNCS 5201, Springer, pp. 402–417. Available at http://dx.doi.org/10.1007/ 978-3-540-85361-9_32. [10] H. Garcia-Molina, D. Gawlick, J. Klein, K. Kleissner & K. Salem (1990): Coordinating Multi-Transaction Activities. Technical Report CS-TR-2412, University of Maryland, Dept. of Computer Science. [11] C. Guidi, I. Lanese, F. Montesi & G. Zavattaro (2008): On the Interplay between Fault Handling and RequestResponse Service Invocations. In: Proc. of ACSD’08, IEEE Computer Society Press, pp. 190–198. [12] T. Härder & A. Reuter (1983): Principles of Transaction-Oriented Database Recovery. ACM Comput. Surv. 15(4), pp. 287–317. Available at db/journals/csur/HarderR83.html. [13] I. Lanese, C. Vaz & C. Ferreira (2010): On the Expressive Power of Primitives for Compensation Handling. In: Proc. of ESOP 2010, LNCS 6012, Springer, pp. 366–386. Available at http://dx.doi.org/10.1007/ 978-3-642-11957-6_20. [14] I. Lanese & G. Zavattaro (2009): Programming Sagas in SOCK. In: Proc. of SEFM’09, IEEE Computer Society Press, pp. 189–198. [15] C. Laneve & G. Zavattaro (2005): Foundations of Web Transactions. In: Proc. of FOSSACS’05, LNCS 3441, Springer, pp. 282–298. Available at http://springerlink.metapress.com/openurl.asp? genre=article%&issn=0302-9743&volume=3441&spage=282. I. Lanese 65 [16] F. Montesi, C. Guidi, I. Lanese & G. Zavattaro (2008): Dynamic Fault Handling Mechanisms for ServiceOriented Applications. In: Proc. of ECOWS’08, IEEE Computer Society Press, pp. 225–234. [17] Oasis (2007): Web Services Business Process Execution Language Version 2.0. http://docs. oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html. [18] C. Vaz, C. Ferreira & A. Ravara (2008): Dynamic Recovering of Long Running Transactions. In: Proc. of TGC’08, LNCS 5474, Springer, pp. 201–215. Available at http://dx.doi.org/10.1007/ 978-3-642-00945-7_13.
6cs.PL
Analysis of Wireless-Powered Device-to-Device Communications with Ambient Backscattering Xiao Lu† , Hai Jiang†, Dusit Niyato‡ , Dong In Kim⋆ , and Ping Wang‡ Dept. of Electrical & Computer Engineering, University of Alberta, Canada ‡ School of Computer Science and Engineering, Nanyang Technological University, Singapore School of Information and Communication Engineering, Sungkyunkwan University (SKKU), South Korea † arXiv:1709.07182v1 [cs.NI] 21 Sep 2017 ⋆ Abstract—Self-sustainable communications based on advanced energy harvesting technologies have been under rapid development, which facilitate autonomous operation and energy-efficient transmission. Recently, ambient backscattering that leverages existing RF signal resources in the air has been invented to empower data communication among low-power devices. In this paper, we introduce hybrid device-to-device (D2D) communications by integrating ambient backscattering and wireless-powered communications. The hybrid D2D communications are self-sustainable, as no dedicated external power supply is required. However, since the radio signals for energy harvesting and backscattering come from external RF sources, the performance of the hybrid D2D communications needs to be optimized efficiently. As such, we design two mode selection protocols for the hybrid D2D transmitter, allowing a more flexible adaptation to the environment. We then introduce analytical models to characterize the impacts of the considered environment factors, e.g., distribution, spatial density, and transmission load of the ambient transmitters, on the hybrid D2D communications performance. Extensive simulations show that the repulsion factor among the ambient transmitters has a non-trivial impact on the communication performance. Additionally, we reveal how different mode selection protocols affect the performance metrics. Index terms- Internet-of-Things (IoT), Ambient backscatter, wireless-powered communications, D2D communications, RF energy harvesting. I. I NTRODUCTION With the advent of the Internet-of-Things (IoT) [1], [2], intelligent devices, such as smart household devices [3], renewable sensors [4], vehicular communicators, RFID tags, and wearable health-care gadgets, have become increasingly interconnected at an unprecedented scale. In this context, device-to-device (D2D) communications [5], which empower devices in proximity to establish direct connections without an involvement of any cellular base stations, appear to be a cost-effective and energyefficient solution. Recent research efforts [6], [7] have shown that D2D communications have achieved evident performance gains in terms of network coverage and capacity, peak rates, throughput, communication latency and user experience. Therefore, it is envisioned to be an intrinsic part of the IoT. Lately, ambient backscatter communications [8] have appeared to be a promising self-sustainable communication paradigm. In ambient backscattering, the information transmission is done by load modulation which does not involve active RF generation. In particular, an ambient backscattering device tunes the antenna load reflection coefficient by switching between two or more impedances, resulting in a varied amount of incident signal to be backscattered. In principle, when the impedance of the chosen load matches with that of the antenna, a small amount of the signal is reflected, exhibiting a signal absorbing state. Conversely, if the impedances are not matched, a large amount of the signal is reflected, indicating a signal reflecting state. A backscatter transmitter can use an absorbing state or reflecting state to transmit a ‘0’ or ‘1’ bit. Based on the detection of the amount of the reflected signal, the transmitted information is decoded at the receiver. Unlike conventional backscatter communication (e.g., for passive sensors and RFID tags), ambient backscattering functions without the need of a dedicated carrier emitter (e.g., an RFID reader). Instead, an ambient backscatter device utilizes exogenous and incident RF waves as both energy resource to scavenge and signal resource to reflect. Moreover, ambient backscattering is featured with coupled backscattering and energy harvesting processes [9]. To initiate information transmission, the device first extracts energy from incident RF waves through rectifying. Once the rectified DC voltage is above an operating level of the circuit, the device is activated to conduct load modulation. Simultaneously, backscatter modulation is done on the reflected wave, enabling a full-time transmission. For example, a recent experiment in [10] demonstrated that a 1 Mbps transmission rate can be achieved at the distance of 7 feet, when the incident RF power available is above -20 dBm. Despite many benefits, ambient backscatter communications have drawbacks that limit their applicability for D2D communications. Specifically, ambient backscattering achieves relatively low data rate, typically ranging from several to tens of kbps [8], [11], which largely constrains the applications. A relatively high signal-to-noise ratio (SNR) is required to realize a low-error transmission with modulated backscatter. Moreover, the transmission distance is limited, typically ranging from several feet to tens of feet [8], [10] due to severe propagation attenuation and embedded modulation for an intended receiver. To address these shortcomings, in this paper, we introduce a novel hybrid D2D communication paradigm that integrates ambient backscattering and wireless-powered communications [12]–[14] as a self-sustainable communication method. For communication, the proposed hybrid D2D transmitter harvests energy from ambient RF signals and can select to perform ambient backscattering or wireless-powered communications with the aim of extending the applicability as well as functionality. Through the analysis, we show that these two technologies can well complement each other and result in better performance for D2D communications. Notations: In the following, we use E[·] to denote the average over all random variables in [·], EX [·] to denote the expectation over the random variable X, and P[E] to denote the probability that an event E occurs. Besides, kxk is used to represent the Euclidean norm between the coordinate x and the origin of the Euclidean space. z̄ and |z| denote the complex conjugate and modulus of the complex number z, respectively. The notations fX (·), FX (·), MX (·) and LX (·) are used to denote, respectively, the probability density function (PDF), cumulative distribution function (CDF), moment generating function (MGF), and Laplace transform of a random variable X. II. A MBIENT BACKSCATTERING A SSISTED W IRELESS -P OWERED C OMMUNICATIONS We now propose a novel hybrid transmitter that combines two self-sustainable communication approaches, i.e., ambient backscatter communications and wireless-powered communications. On one hand, ambient backscatter communications can be operated with very low power consumption. Thus, ambient backscattering may still be performed when the power density of ambient RF signals is low. On the other hand, the wireless-powered communications, also referred to as harvestthen-transmit (HTT) [15], [16], though have higher power consumption, can first accumulate harvested energy and achieve possibly longer transmission distance through active RF transmission. Therefore, these two approaches can well complement each other and result in better transmission performance. We depict the block diagrams of the hybrid transmitter and hybrid receiver in Fig. 1. With the proposed architecture, the hybrid transmitter is flexible to perform active data transmission, backscattering, and RF energy harvesting. At the receiver, a dual-mode circuit can demodulate data from both the modulated backscatter and active RF transmission. The mode selection can be done by the hybrid transmitter through signaling. We consider the hybrid D2D communications coexisting with ambient RF transmitters, e.g., cellular base stations and mobiles. Fig. 1 illustrates our proposed system model. We consider two groups of coexisting ambient transmitters, denoted as Φ and Ψ, respectively, which work on different frequency bands. The RF energy harvester of the hybrid transmitter denoted as S scavenges on the transmission frequency of Φ (e.g., ambient base stations). If the hybrid transmitter is in ambient backscattering mode, it performs load modulation on the incident signals from Φ. Alternatively, when the hybrid transmitter is in HTT mode, it harvests energy from ambient transmitters in Φ, and transmits over a different frequency band used by ambient transmitters in Ψ (e.g., ambient mobile users). The received signal at the hybrid receiver denoted as D from the hybrid transmitter is impaired by the interference from Ψ. We assume Φ and Ψ follow independent  α-Ginibre point process (GPP) [17], where α ∈ 0, 1 represents the repulsion factor which measures the correlation among the spatial points in Φ and Ψ, respectively. Without loss of generality, the point processes Φ and Ψ are assumed to be supported on the circular observation windows OS and OD with radius R, which are centered at S and D, respectively. The transmit power of the ambient transmitters Fig. 1. Illustration of the hybrid D2D communication. belonging to Φ and Ψ are denoted as PA and PB , respectively. Let ζA and ζB denote the spatial density of Φ and Ψ, respectively. Let A (and B) denote the set of active ambient transmitters of Φ (and Ψ) observed in OS (and OD ). We assume that the probability that an ambient transmitter in Φ (and Ψ) is active is an independent and identically distributed (i.i.d.) random variable, denoted as lA (and lB ). lA and lB can also be interpreted as the transmission load, which measures the fraction of time that an ambient transmitter in Φ and Ψ, respectively, is active. It is worth noting that the sets of active transmitters in Φ and Ψ in the reference time are independent thinning point processes of Φ and Ψ with spatial density lA ζA and lB ζB , respectively. Let ξ represent the ratio between ζB and ζA , i.e., ξ = ζB /ζA , referred to as the interference ratio. A larger value of ξ indicates a higher level of interference. Let xS represent the location of the hybrid transmitter. The power of the incident P RF signals at the antenna of S can be calculated as PI = PA a∈A ha,S kxa −xS k−µ , where ha,S represents the channel gain between the ambient transmitter a ∈ A and S, and µ denotes the path loss exponent. The circuit of the hybrid transmitter becomes functional if it can extract sufficient energy from the incident RF signals. When the hybrid transmitter works in different modes (i.e., either HTT or ambient backscattering), the hardware circuit consumes different amounts of energy.1 Let ρB and ρH denote the circuit power consumption rates (in Watt) in ambient backscattering and HTT modes, respectively. If the hybrid transmitter cannot harvest sufficient energy, an outage occurs. In the ambient backscattering mode, if the instantaneous energy harvesting rate (in Watt) exceeds ρB , the hybrid transmitter can perform backscatter modulation. During backscattering process, a fraction of the incident signal power, denoted as PH , is rectified for conversion from RF signal to direct current (DC), and the residual amount of signal power, denoted as PR , is reflected to carry the modulated information. In the ambient backscattering 1 The typical power consumption rate of an RF-powered transmitter ranges from hundreds of micro-Watts to a few milli-Watts [18]–[20], while that of a backscatter transmitter ranges from a few micro-Watts to hundreds of microWatts [10]. mode, the energy harvesting rate (in Watt) can be represented as [21], [22] PEB = βPH = βηPI , where 0 < β ≤ 1 denotes the efficiency of RF-to-DC energy conversion, and η represents the fraction of the incident RF power for RF-to-DC energy conversion. Note that the value of η depends on the symbol constellation adopted for multi-level load modulation [21]. For example, η is 0.625 on average assuming equiprobable symbols if binary constellations are adopted with modulator impedance values set at 0.5 and 0.75 [22]. Let xD represent the location of the hybrid receiver. d=kxS − xD k denotes the distance between S and D. Then, in ambient backscattering mode, the power of the received backscatter at D from S can be calculated as PS,D = δPI (1 − η)hS,D d−µ if PEB > ρB and PS,D = 0 otherwise, where 0 < δ ≤ 1 is the backscattering efficiency of the transmit antenna, which is related to the antenna aperture [23], and hS,D denotes the channel gain between S and D on the transmission frequency of Φ. If S is active in the ambient backscattering mode, the resulted SNR at D is δPI (1 − η)hS,D PS,D , (1) νB = 2 = σ dµ σ 2 where σ 2 is the power spectrum density of additive white Gaussian noise (AWGN). If the received SNR νB is above a threshold τB , D is able to successfully decode information from the modulated backscatter at a pre-designed rate TB (in bits per second (bps)). This backscatter transmission rate is dependent on the setting of resistor-capacitor circuit elements [8]. When the hybrid transmitter S chooses to adopt active RF transmission, it is operated by the HTT protocol [15]. In the HTT mode, the hybrid transmitter works in a time-slot based manner. Specifically, in each time slot, the first period, with time fraction ω, is for harvesting energy, during which the impedance of the matching network is tuned to fully match to that of the antenna to maximize the energy conversion efficiency. The corresponding energy harvesting rate is PEH = ωβPI . This harvested energy is first utilized to power the circuit. Then the remaining energy, if available, is stored in an energy storage. If the harvested energy is enough to operate the circuit, the hybrid transmitter spends the rest of the period (1 − ω) to perform active transmission with the stored energy. In the active transmission phase, the transmit power of S is P H −ρ PS = E1−ω H if PEH > ρH and PS = 0 otherwise. Then, the received signal-to-interference-and-noise ratio (SINR) at D can be expressed as νH = P hS,D d−µ PS e , −µ + σ 2 b∈B PB hb,D kxb − xD k (2) where e hS,D denotes the channel gain between S and D on the transmit frequency of Ψ, and hb,D is the channel gain from ambient transmitter b ∈ B to D. As the hybrid D2D communications and the transmission from ambient transmitters may be performed in different environments, we consider different fading channels for hS,D , e hS,D , ha,S and hb,D . Specifically, hS,D and e hS,D are assumed to follow Rayleigh distribution. Both ha,S and hb,D follow i.i.d. Nakagami-m distribution, which is a general channel fading model that contains Rayleigh distribution as a special case when m = 1. This channel model allows a flexible evaluation of the impact of the ambient signals. Let G(x, y) represent the gamma distribution with shape parameter x and scale parameter y, and E(x) represent the exponential distribution with rate parameter x. Thus, the channel gain coefficients are expressed as ha,S , hb,D ∼ G(m, 1/m) and hS,D , e hS,D ∼ E(1). For the operation of our proposed hybrid transmitter, we consider two mode selection protocols, namely, power thresholdbased protocol (PTP) and SNR threshold-based protocol (STP). • With PTP, a hybrid transmitter first detects the available energy harvesting rate PEH . If PEH is below the threshold which is needed to power the RF transmitter circuit (for active transmission), i.e., PEH ≤ ρH , the ambient backscattering mode will be used. Otherwise, the HTT mode will be adopted. • With STP, the hybrid transmitter first attempts to transmit by backscattering. If the achieved SNR at the receiver is above the threshold which is needed to decode information from the backscatter, i.e., νB > τB , the transmitter will be in the ambient backscattering mode. Otherwise, it will switch to the HTT mode. III. P ERFORMANCE A NALYSIS In this section, we focus on analyzing the coverage probability of the hybrid D2D transmitter which is defined as the probability that the hybrid transmitter can successfully transmit data to its receiver. The transmission of the hybrid transmitter is successful if the achieved SNR or SINR at the associated receiver exceeds its corresponding target threshold τB or τH in backscattering mode or in HTT mode, respectively. Let CM denote the coverage probability of the hybrid transmitter being in mode M ∈ {B, H}. Then, the overall coverage probability is defined as   C , E[EM [CM |M]] = E EM [P[νM > τM , PEM > ρM |M]] . (3) In the following, the performance analysis of the hybrid D2D communication is based on a general class of stochastic geometry tool, namely α-GPP [17]. α-GPP is a repulsive point process which allows to characterize the repulsion among the distribution of the randomly located points and has the Poisson point process (PPP) as a special case (i.e., when α → 0). Recently, α-GPP has attracted considerable attention in wireless network modeling [24]–[27] because it renders tractable analytical expressions in terms of Fredholm determinants. The Fredholm determinant is a generalized determinant of a matrix defined by bounded operators on a Hilbert space and has shown to be an efficient way for numerical evaluation of the relevant quantities [28]. We refer to [17], [28] for a formal definition of an α-GPP and the mathematical details. Based on the α-GPP framework, we have the coverage probability of PTP described as follows. Theorem 1. The coverage probability of the hybrid D2D communications under PTP is   ρ Z ∞ τB dµ σ 2 H CPTP = FPI fPI (ρ)dρ exp − ωβ ρB /βη δρ (1 − η)     ρ  Z ∞ τH dµ σ 2 (1 − ω) H + 1−FPI exp − ωβ ωβρ − ρH ρH /βω −1/α × Det (Id + αBΨ (ρ)) fPI (ρ)dρ (4) where Det(·) represents the Fredholm determinant [28], FPI (ρ) and fPI (ρ) are the CDF and PDF of PI given, respectively, as   Det(Id + αAΦ (s))−1/α −1 FPI (ρ) = L (ρ), (5) s and fPI (ρ) = L−1 {Det(Id + αAΦ (s))−1/α }(ρ), (6) wherein L−1 means inverse Laplace transform and AΦ (s) is given by s  −m sPA AΦ (s) = 1 − 1 + GΦ (x, y) mkx − xS kµ s  −m sPA × 1− 1+ , (7) mky − xS kµ and BΨ (ρ) is s  −m τH dµ (1−ω)PB GΨ (x, y) BΨ (ρ) = 1− 1+ m(ωβρ−ρH )kx−xD kµ s  −m τH dµ (1−ω)PB × 1− 1+ , (8) m(ωβρ−ρH )ky−xD kµ wherein GΨ is the Ginibre kernel of Ψ defined as GΨ (x, y) = lB ζB eπlB ζB xȳ e− πlB ζB 2 (|x|2 +|y|2 ) , x, y ∈ B. (9) Proof. We first determine the distribution of the aggregated received power from ambient transmitters at the origin by calculating its Laplace transform. Specifically, we have " −m !!#  X sPA LPI (s) = E exp ln 1+ mkx − xS kµ a∈A (i) = Det(Id + αAΦ (s))−1/α , (10) where Mh (·) is the MGF of ha,S and (i) follows by applying [28, Theorem 2.3], and AΦ is given in (7). Given the Laplace transforms of PI , by definition, the PDF of PI is attained by taking the inverse Laplace transform as follows fPI(ρ) = L−1 {Det(Id + αAΦ (s))−1/α}(ρ), Furthermore, integrating PDF in (11) yields ) ( 1 −α −1 Det(Id + αAΦ (s)) (ρ). FPI(ρ) = L s (11) (12) One notices that the probability that S is in ambient backscattering mode under PTP, denoted as BPTP , is equal to the CDF ρH of PI evaluated at ωβ , which is expressed as      −1/α ρH ρH −1 Det(Id+αAΦ (s) BPTP = FPI =L . (13) ωβ s ωβ We then continue to calculate the coverage probability in the ambient backscattering mode. By the definition of CB , we have " " # # τB dµ σ 2 CB = EPI P hS,D > PI 1PI >ρB /βη δPI (1 − η)   Z ∞ τB dµ σ 2 exp − = (14) fPI (ρ)dρ. δρ (1 − η) ρB /βη where 1E denotes the indicator function of an event E which is equal to 1 when P E holds and 0 otherwise. Let Q = ξ b∈B PB hb,D kxb − xD k−µ denote the aggregated interference at the receiver. From (3), we then derive the coverage probability in the HTT mode as in (15) after some mathematical manipulations.   Z ∞ τH dµ σ 2 (1 − ω) CH = exp − ωβρ − ρH ρH /βω −1/α × Det (Id + αBΨ (ρ)) fPI (ρ)dρ, (15) where BΨ (ρ) is defined in (8). By definition in (3), the coverage probability under PTP can be written as CPTP = BPTP CB + (1 − BPTP )CH . (16) Then, by plugging BPTP in (13), CB in (14) and CH in (15) into (16), we have (4). Moreover, we derive the coverage probability for STP in the following Theorem. Theorem 2. The coverage probability of the hybrid D2D communications under STP is given as   Z ∞ τH dµ σ 2 (1−ω) CSTP = exp − Det(Id+αBΨ (ρ))−1/α ρH ωβρ−ρ H βω #2 "Z   ∞ τB dµ σ 2 fPI (ρ)dρ × fPI (ρ)dρ × exp − ρB δρ(1 − η) βη   Z ρβηB τB dµ σ 2 + (17) fPI (ρ)dρ, exp − δρ(1 − η) 0 where fPI (ρ) has been obtained in (6), and BΨ (ρ) have been defined in (8). Proof. Let BSTP denote the probability that S is in ambient backscattering mode under STP. According to the criteria of STP, CSTP can be expressed by CPTP in (16) with BPTP replaced by BSTP . One simply notes that the definition of BSTP is equivalent to the expression of CB in (14). Hence, we have   Z ∞ τB dµ σ 2 (18) fPI (ρ)dρ. exp − BSTP = δρ (1 − η) ρB /βη Therefore, (17) can be obtained from (4) through the aforementioned replacement. IV. P ERFORMANCE E VALUATION AND A NALYSIS In this section, we validate our derived analytical expressions and conduct performance analysis based on numerical simulations. The transmit power levels of the transmitters in Φ and Ψ are set to be PA = PB = 0.2 W, which are within the typical 1 1 0.9 0.9 lA=lB=1, m=4 0.8 0.7 0.6 0.5 0.4 lA=lB=0.5, m=4 GPP (α=−1), Analysis GPP (α=−0.5), Analysis PPP, Analysis GPP (α=−1), Simulation GPP (α=−0.5), Simulation PPP, Simulation 0.3 0.2 0.1 lA=lB=1, m=0.5 0 0.01 0.02 0.03 ζA 0.04 0.05 Coverage Probability Coverage Probability 0.8 0.7 0.6 0.5 0.4 0.3 PTP STP Pure Ambient Backscattering Pure HTT 0.2 0.1 0 0.06 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 ζ Fig. 2. CPTP as a function of ζA . 1 1 0.9 A B 0.5 lA=lB=0.5, m=0.5 0.4 GPP (α=−1), Analysis GPP (α=−0.5), Analysis PPP, Analysis GPP (α=−1), Simulation GPP (α=−0.5), Simulation PPP, Simulation 0.3 0.2 0.1 0.01 0.02 0.03 0.04 ζ 0.05 0.06 0.07 0.08 A Fig. 3. CSTP as a function of ζA . Coverage Probability Coverage Probability 0.8 l =l =1, m=4 0.6 0 PTP STP Pure Ambient Backscattering Pure HTT 0.9 lA=lB=1, m=0.5 0.8 0.7 A (a) 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 ζA (b) Fig. 4. Comparison of coverage probabilities as a function of ζA . ((a) ξ = 0.2, (b) ξ = 0.8) range of uplink transmit power for mobile devices. When the hybrid transmitter is in the HTT mode, we assume equal time duration for energy harvesting and information transmission. In the ambient backscattering mode, the hybrid transmitter functions with power consumption ρB = 8.9 µW and achieves a data rate of TB =1 kbps if the transmission is successful. The other system parameters adopted in this section are listed in Table I unless otherwise stated. For comparison purpose, we evaluate the performance of a pure wireless-powered transmitter operated by the HTT protocol and a pure ambient backscatter transmitter as references, the plots of which are labeled as “Pure HTT” and “Pure Ambient Backscattering”, respectively. The performance of a pure wireless-powered transmitter (called pure HTT transmitter) and a pure ambient backscatter transmitter can be obtained by setting the hybrid transmitter in HTT mode and ambient backscattering mode, respectively, in all conditions. Specifically, the coverage probabilities of the pure ambient backscatter transmitter and the pure HTT transmitter can be evaluated by CB in (14) and CH in (15), respectively. Fig. 2 and Fig. 3 illustrate how the coverage probabilities CPTP and CSTP obtained in (4) and (17), respectively, vary with ambient transmitter density ζA . The accuracy of the coverage probability expressions is validated by the simulation results with different values of α under different transmission loads and Nakagami fading coefficients. In principle, the improvement of the coverage probability can be achieved with increased transmit power at the hybrid transmitter (either in ambient backscattering mode or HTT mode), thus requiring more incident power. Correspondingly, the incident power becomes higher with larger density ζA , repulsion factor α, transmission load lA , and Nakagami shape parameter m. The mentioned tendencies of the coverage probability have been verified for both PTP and STP in Fig. 2 and Fig. 3, respectively, which indicates that both CPTP and CSTP are monotonically increasing functions of ζA , α, lA and m. Note that from Fig. 2, with the increase of ζA , the coverage probability approaches a value smaller than 1. This is because, given an interference ratio ξ, the increase of ζA not only provides the hybrid transmitter with more harvested energy to transmit, but also leads to more interference that harms the transmission. Fig. 4 compares coverage probability (as a function of density ζA ) of PTP, STP, pure ambient backscattering, and pure HTT. When ξ is small (i.e., ξ = 0.2) as shown in Fig. 4a, the pure HTT transmitter achieves significantly higher coverage probabilities. However, in the case with high interference ratio (i.e., ξ = 0.8) as depicted in Fig. 4b, their performance gap becomes smaller and pure ambient backscattering outperforms pure HTT when ζA is TABLE I PARAMETER S ETTING . Symbol Value µ 4 d 5m R 100 m η 0.625 β 30 % large (e.g., above 0.06). This is because with this condition, CH is adversely affected by the high interference. We also observe that PTP achieves similar performance to that of STP under small ζA and is obviously outperformed by STP as ζA grows larger (e.g., above 0.06). The reason behind this is that PTP selects operation mode solely based on the incident power and is unaware of the interference level. Consequently, it remains in the HTT mode even when the achieved SINR is low. This reflects that STP is more suitable for the use in an interference rich environment. V. C ONCLUSION In this paper, we have introduced a novel paradigm of hybrid D2D communications that integrate ambient backscattering and wireless-powered communications. To enable the operation of our proposed hybrid transmitter in diverse environments, two mode selection protocols, namely PTP and STP, have been devised based on the energy harvesting rate and received SNR of the modulated backscatter, respectively. Through repulsive point process modeling, we have characterized the coverage probability of the hybrid D2D communications. The performance analysis has shown that the self-sustainable D2D communications benefit from larger repulsion, transmission load and density of the ambient transmitters. Moreover, we have found that PTP is more suitable for the use in the scenarios with a large density of ambient transmitters and low interference level. On the contrary, STP becomes favorable in the scenarios when the interference level and density of ambient transmitters are both low or both high. VI. ACKNOWLEDGEMENT This work was supported by the Natural Sciences and Engineering Research Council of Canada, National Research Foundation of Korea Grant Funded by the Korean Government (MSIP) under Grant 2014R1A5A1011478, and Singapore MOE Tier 1 (RG33/16 and RG18/13) and MOE Tier 2 (MOE2014-T2-2-015 ARC4/15 and MOE2013-T2-2-070 ARC16/14). R EFERENCES [1] A. Al-Fuqaha et al., “Internet of Things: A Survey on Enabling Technologies, Protocols, and Applications,” IEEE Communications Surveys & Tutorials, vol. 17, no. 4, pp. 2347-2376, Fourthquarter 2015. [2] D. Niyato et al., “Economics of Internet of Things (IoT): An Information Market Approach,” IEEE Wireless Communications, vol. 23, no. 4, pp. 136145, August 2016. [3] D. Niyato, X. Lu, and P. Wang, “Machine-to-Machine Communications for Home Energy Management System in Smart Grid,” IEEE Communications, vol. 49, no. 4, pp. 53-59, April 2011. [4] D. Niyato et al., “Distributed Wireless Energy Scheduling for Wireless Powered Sensor Networks,” in Proc. of IEEE ICC, Kuala Lumpur, Malaysia, 23-27, May 2016. [5] D. Camps-Mur et al., “Device-to-Device Communications with Wi-Fi Direct: Overview and Experimentation,” IEEE Wireless Communications, vol, 20, no, 3 pp. 96-104, July 2013. [6] J. Liu et al., “Device-to-Device Communication in LTE-Advanced Networks: A Survey,” IEEE Communications Surveys & Tutorials, vol. 17, no. 4, 1923-1940, December 2015. δ 1 τH -40 dB τB 5 dB ρH 113 µW σ2 -90 dBm [7] X. Lu, P. Wang, and D. Niyato, “Hierarchical Cooperation for OperatorControlled Device-to-Device Communications: A Layered Coalitional Game Approach,” in Proc. of IEEE WCNC, New Orleans, LA, USA, March 2015. [8] V. Liu et al., “Ambient Backscatter: Wireless Communication Out of Thin Air,” in Proceedings of the 2013 ACM conference on SIGCOMM, Hong Kong, China, August 2013. [9] X. Lu et al., “Ambient Backscatter Assisted Wireless Powered Communications” to appear in IEEE Wireless Communications. [10] A. N. Parks et al., “Turbocharging Ambient Backscatter Communication,” in Proceedings of the 2014 ACM conference on SIGCOMM, Chicago, IL, August 2014. [11] B. Kellogg et al., “Wi-Fi Backscatter: Internet Connectivity for RF-powered Devices,” in Proceedings of the 2014 ACM conference on SIGCOMM, Chicago, IL, August 2014. [12] X. Lu et al., “Wireless Networks with RF Energy Harvesting: A Contemporary Survey,” IEEE Communications Surveys and Tutorials, vol. 17, no. 2, pp. 757-789, Second Quarter 2015. [13] D. Niyato et al., “Game Theoretic Modeling of Jamming Attack in Wireless Powered Networks,” in Proc. of IEEE ICC, London, UK, June 2015. [14] D. Niyato et al., “Performance Analysis of Delay-Constrained Wireless Energy Harvesting Communication Networks under Jamming Attacks,” in Proc. of IEEE WCNC, New Orleans, LA, USA, March 2015. [15] H. Ju and R. Zhang, “Throughput Maximization in Wireless Powered Communication Networks,” IEEE Transactions on Wireless Communications, vol. 13, no. 1, pp. 418-428, January 2014. [16] X. Lu et al., “Wireless Charging Technologies: Fundamentals, Standards, and Network Applications,” IEEE Communications Surveys and Tutorials, vol. 18, no. 2, pp. 1413-1452, Second Quarter, 2016. [17] L. Decreusefond et al.,“Efficient Simulation of the Ginibre Point Process.” Adv. Appl. Probab., vol. 52, no. 4, pp. 1003-1012, October 2015. [18] X. Lu et al., “Dynamic Spectrum Access in Cognitive Radio Networks with RF Energy Harvesting,” IEEE Wireless Communications, vol. 21, no. 3, pp. 102-110, June 2014. [19] X. Lu et al., “Resource Allocation in Wireless Networks with RF Energy Harvesting and Transfer,” IEEE Network, vol. 29, no. 6, pp. 68-75, Dec. 2015. [20] X. Lu et al., “Wireless Charger Networking for Mobile Devices: Fundamentals, Standards, and Applications,” IEEE Wireless Communications, vol. 22, no. 2, pp. 126-135, April 2015. [21] C. Boyer and S. Roy, “Coded QAM Backscatter Modulation for RFID,” IEEE Transactions on Communications, vol. 60, pp. 1925-1934, July 2012. [22] C. Boyer and S. Roy, “Backscatter Communication and RFID: Coding, Energy, and MIMO Analysis,” IEEE Transactions on Communications, vol. 62, no. 3, pp. 770-785, March 2014. [23] P. V. Nikitin and K. Rao, “Theory and Measurement of Backscattering from RFID Tags,” IEEE Antennas Propagat. Mag., vol. 48, no. 6, December 2006. [24] X. Lu et al., “Self-Sustainable Communications with RF Energy Harvesting: Ginibre Point Process Modeling and Analysis,” Journal on Selected Areas in Communications (JSAC), vol. 34, no. 5, pp. 1518-1535, May 2016. [25] I. Flint et al., “Performance Analysis of Ambient RF Energy Harvesting with Repulsive Point Process Modelling,” IEEE Transactions on Wireless Communications, vol. 14, no. 10, pp. 5402-5416, May 2015. [26] X. Lu et al., “Performance Analysis for Simultaneously Wireless Information and Power Transfer with Ambient RF Energy Harvesting,” in Proc. of IEEE WCNC, New Orleans, LA, USA, March 2015. [27] I. Flint et al., “Performance Analysis of Ambient RF Energy Harvesting: A Stochastic Geometry Approach,” in Proc. of IEEE Globecom, Austin, USA, December 2014. [28] L. Decreusefond et al.,“Determinantal Point Processes,” Advances in applied probability, vol. 52, no. 4. August 2015.
7cs.IT
Change-point detection using the conditional entropy of ordinal patterns arXiv:1510.01457v2 [math.ST] 15 Jul 2017 Anton M. Unakafov∗1,2 and Karsten Keller1 1 2 Institute of Mathematics, University of Lübeck Graduate School for Computing in Medicine and Life Sciences, University of Lübeck July 18, 2017 Abstract This paper is devoted to change-point detection using only the ordinal structure of a time series. A statistic based on the conditional entropy of ordinal patterns characterizing the local up and down in a time series is introduced and investigated. The statistic requires only minimal a priori information on given data and shows good performance in numerical experiments. Keywords: Change-point detection; Conditional entropy; Ordinal pattern. 1 Introduction Most of real-world time series are non-stationary, that is some of their properties change over time. A model for some non-stationary time series is provided by a piecewise stationary stochastic process: its properties are locally constant except for certain time-points called change-points, where some properties change abruptly [8]. Detecting change-points is a classical problem and there are many methods for tackling it [8–10,12,27]. However, most of the existing methods have a common drawback: they require certain a priori information about the time series. It is necessary to know either a family of stochastic processes providing a model for the time series (see for instance [13] where AR processes are considered) or at least to know which characteristics (mean, standard deviation, etc.) of the time series reflect the Corresponding address: Institute of Mathematics, University of Lübeck, Ratzeburger Allee 160, Building 64, 23562 Lübeck, Germany. e-mail: [email protected] (A.M. Unakafov) ∗ 1 change (see [10, 34]). In real-world applications such information is often unavailable [11]. Here we suggest a new method for change-point detection that requires minimal a priori knowledge: we only assume that the changes affect the evolution rule linking the past of the process with its future (a formal description of the considered processes is provided by Definition 4). A natural example of such change is an alteration of the increments distribution. Our method is based on ordinal pattern analysis, a promising approach to real-valued time series analysis [1, 6, 7, 22, 23, 33, 47]. In ordinal pattern analysis one considers order relations between values of a time series instead of the values themselves. These order relations are coded by ordinal patterns; specifically, an ordinal pattern of an order d ∈ N describes order relations between (d + 1) successive points of a time series. The main step of ordinal pattern analysis is the transformation of an original time series into a sequence of ordinal patterns. A result of this transformation is demonstrated in Figure 1 for order d = 1. Figure 1: A part of a piecewise stationary time series with a change-point at t = L/2 (marked by a vertical line) and corresponding ordinal patterns of order d = 1 (below the plot) L For detecting a change-point t∗ ∈ N in a time series x = x(t) t=0 with values in R, one generally considers x as a realization of a stochastic process X and computes for x a statistic S(t; x) that should reach its maximum at t = t∗ . Here we suggest a statistic on the basis of the conditional entropy of ordinal patterns introduced in [46]. Let us provide an ‘obvious’ example only to motivate our approach and to illustrate its idea. L Example 1. Consider a time series x(t) t=0 , its central part is shown in Figure 1. The time series is periodic before and after L/2, but at L/2 there occurs a change (marked by a vertical line): the “oscillations” become faster. Figure 1 also presents the ordinal patterns π(t) of order d = 1 at times t underlying the time series. Note that there are only two ordinal patterns of order 1: the increasing (coded by 0) and the decreasing (coded by 1). Both ordinal patterns occur with the same frequency before and after the change-point. 2 However, the transitions between successive ordinal patterns are changed at L2 . Indeed, before the change-point L/2 both ordinal patterns have two possible successors (for instance, the ordinal pattern π(L/2 − 5) = 0 is succeeded by the ordinal pattern π(L/2 − 4) = 0, which in turn is succeeded by the ordinal pattern π(L/2 − 3) = 1), whereas after the change-point the ordinal patterns 0 and 1 are alternating. A measure of diversity of transitions between ordinal patterns is provided by the conditional entropy of them. L For the sequence π(k) k=1 of ordinal patterns of order 1 the (empirical) conditional entropy for t = 2, 3, . . . , L is defined as follows: eCE  1 X 1 X t  ni,j (t) ni,j (t) ln π(k) k=1 = − t−1 ni (t) i=0 j=0 with ni,j (t) = #{l = 1, 2, . . . , t − 1 | π(l) = i, π(l + 1) = j}, ni (t) = #{l = 1, 2, . . . , t − 1 | π(l) = i} (throughout the paper, 0 ln 0 := 0 and 0/0 := 0, and #A denotes the number of elements of a set A). To detect change-points we use a test statistic for d = 1 defined as follows:  L  CEofOP(θL) =(L − 2) eCE π(k) k=1  θL  − (θL − 1) eCE π(k) k=1    L − L − (θL + 1) eCE π(k) k=θL+1 , for θ ∈ (0, 1) with θL ∈ N. According to the properties of conditional entropy (see Section 3 for details), CEofOP(θL) attains its maximum when θL coincides with a change-point. Figure 2 demonstrates this for the time series from Figure 1. CEofOP(θL) 0.20L 0.15L 0.10L 0.05L 0 0.1 0.2 0.3 0.4 0.5 θ 0.6 0.7 0.8 0.9 1 Figure 2: Statistic CEofOP(θL) for the sequence of ordinal patterns of order 1 for the time series from Figure 1 For simplicity and in view of real applications, in Example 1 we define ordinal patterns and the CEofOP statistic immediately for concrete time 3 series. However, for theoretical consideration it is necessary to define the CEofOP statistic for stochastic processes. For this we refer to Section 3. To illustrate applicability of the CEofOP statistic let us discuss a realworld data example: Example 2. Here we consider EEG recording 14 from the sleep EEG dataset kindly provided by Vasil Kolev (details and other results for this dataset are provided in [45, Subsection 5.3.2]). We employ the following procedure for an automatic discrimination between sleep stages from the EEG time series: first we split time series into pseudo-stationary intervals by finding changepoints with the CEofOP statistic (change-points are detected in each EEG channel separately), then we cluster all the obtained intervals. Figure 3 illustrates the outcome of the proposed discrimination for single EEG channel in comparison with the manual scoring by an expert; the automated identification of a sleep type (waking, REM, light sleep, deep sleep) is correct for 79.6% of 30-second epochs. Note that the borders of the segments (that is the detected change-points) in most cases correspond to the changes of sleep stage. Error W S1 S2 S3 S4 REM 1 2 3 4 time, hours 5 6 7 Figure 3: Hypnogram (bold curve) and the results of ordinal-patterns-based discrimination of sleep EEG. Here ordinate axis represents the results of the expert classification: W stands for waking, stages S1, S2 and S3, S4 indicate light and deep sleep, respectively, REM stands for REM sleep and Error – for unclassified samples. Results of ordinal-patterns-based discrimination are represented by the background colour: white colour indicates epochs classified as waking state, light gray – as light sleep, gray – as deep sleep, dark gray – as REM, red colour indicates unclassified segments The CEofOP statistic was first introduced in [23], where we have employed it as a component of a method for sleep EEG discrimination. However no theoretical details of the method for change-point detection were provided 4 there. This paper aims to fill in this gap and provides a justification of the CEofOP statistic. This paper is organized as follows. In Section 2 we provide a brief introduction into ordinal pattern analysis. In particular, we define the conditional entropy of ordinal patterns and discuss its properties. In Section 3 we investigate the properties of the CEofOP statistic. We also suggest there a method for detecting multiple change-points via the CEofOP statistic. Section 4 is devoted to a comparison of this method with two other (classical and ordinal-patterns-based) methods for change-point detection by performing experiments on realizations of piecewise stationary stochastic processes. In Section 5 we summarize the results and state open problems. Finally, in supplementary Section 6 we investigate the asymptotic properties of the CEofOP statistic. 2 Preliminaries m Central objects of the following are stochastic processes X = X(t) t=n on a probability space (Ω, A, P) with values in R. Here n ∈ N0 and m ∈ N ∪ {∞} allowing both finite and infinite lengths of processes. We consider only univariate stochastic processes to keep notation simple, though there m are no principal restrictions on the dimension of a process. X = X(t) t=n is stationary if for all t1 , t2 , . . . , tk , s with t1 , t2 , . . . , tk , t1 + s, t2 + s, . . . , tk + s ∈ {n, n + 1, . . . , m} the distributions of (Xti )ki=1 and (Xti +s )ki=1 coincide. Throughout this paper we discuss detection of change-points in a piecewise stationary stochastic process. Simply speaking, a piecewise stationary stochastic process is obtained by “gluing” several pieces of stationary stochastic processes (for a formal definition of piecewise stationarity see, for instance, [42, Section 3.1]). In this section we recall the basic facts from ordinal pattern analysis (Subsection 2.1), present the idea of ordinal-patterns-based change-point detection (Subsection 2.2), and define the conditional entropy of ordinal patterns (Subsection 2.3). 2.1 Ordinal patterns Let us recall the definition of an ordinal pattern [22,23,47]. For d ∈ N denote the set of permutations of {0, 1, . . . , d} by Sd . Definition 1. We say that a real vector (x0 , x1 , . . . , xd ) has ordinal pattern OP(x0 , x1 , . . . , xd ) = (r0 , r1 , . . . , rd ) ∈ Sd of order d ∈ N if xr 0 ≥ xr 1 ≥ . . . ≥ xr d and rl−1 > rl for xrl−1 = xrl . 5 As one can see there are (d + 1)! different ordinal patterns of order d. L Definition 2. Given a stochastic process X = X(t) t=0 for L ∈ N ∪ {∞}, L the sequence Πd = Π(t) t=d with  Π(t) = OP X(t − d), X(t − d + 1), . . . , X(t) is called the abstract sequence of ordinal patterns of order d ∈ N of the process X, the sequence of ordinal X. Similarly, given x = (x(t))L t=0 a realization of  L d,L patterns of order d of x is defined as π = π(t) t=d with  π(t) = OP x(t − d), x(t − d + 1), . . . , x(t) . For simplicity, we say that L in the case L ∈ N is the length of the sequence π d,L though, in fact, it consists of (L − d + 1) elements. L Definition 3. A stochastic process X = X(t) t=0 for L ∈ N ∪ {∞} is said  to be ordinal-d-stationary if for all i ∈ Sd the probability P Π(t) = i does not depend on t for d ≤ t ≤ L. In this case we call  pi = P Π(t) = i (1) the probability of the ordinal pattern i ∈ Sd in X. The idea of ordinal pattern analysis is to consider the sequence of ordinal patterns and the ordinal patterns distribution obtained from it instead of the original time series. Though implying the loss of all the metric information, this often allows to extract some relevant information from a time series, in particular, when it comes from a complex system. For example, ordinal pattern analysis provides estimators of the Kolmogorov-Sinai entropy [5, 21, 46] of dynamical systems, measures of time series complexity [6, 23, 32], measures of coupling between time series [20, 33] and estimators of parameters of stochastic processes [7, 40], see also [1, 2] for a review of applications to real-world time series. Methods of ordinal pattern analysis are invariant with respect to strictly-monotone distortions of time series [22], do not need information about range of measurements, and are computationally simple [47]. This qualifies it for application in the case that no much is known about the system behind a time series, possibly as a first exploration step. For a discussion of the properties of a sequence of ordinal patterns we refer to [4, 7, 16, 39, 40]. For the following we need two results stated below.  Lemma 1 (Corollary 2 from [39]). Each process X = X(t) t∈N0 with associated stationary increment process (X(t)−X(t−1))t∈N is ordinal-d-stationary for each d ∈ N. The next result is a direct consequence of [46, Lemma 4] and generalizes the main result of [30]. 6 Theorem 2. If X is a Markov chain with values in a two-element-set (contained in R), then the corresponding abstract sequence Πd of ordinal patterns also forms a Markov chain for every order d ∈ N. In relation to this theorem, note that in general one does not need values in R but in a totally ordered set. It is shown in [30] and [45, Subsection 3.3.3] that if X is a Markov chain in a finite set of more than two elements, Πd does not generally form a Markov chain. Probability distributions of ordinal patterns are known only for some special cases of stochastic processes [7, 16, 39]. In general one estimates probabilities of ordinal patterns by their empirical probabilities. Consider a sequence π d,L of ordinal patterns. For any t ∈ {d + 1, d + 2, . . . , L} the frequency of occurrence of an ordinal pattern i ∈ Sd among the first (t − d) ordinal patterns of the sequence is given by ni (t) = #{l ∈ {d, d + 1, . . . , t − 1} | π(l) = i}. (2) A natural estimator of the probability of an ordinal pattern i in the ordinald-stationary case is provided by its relative frequency in the sequence π d,L : 2.2 pbi = ni (L) . L−d Detecting change-points in the sequence of ordinal patterns Sequences of ordinal patterns are invariant to certain changes in the original stochastic process X, such as shifts (adding a constant to the process) [1, Subsection 3.4.3] and scaling (multiplying the process with a positive constant) [22]. However, in many cases changes in the original process X affect also the corresponding abstract sequences of ordinal patterns and ordinal patterns distributions. On the one hand, this impedes application of ordinal pattern analysis to non-stationary time series since most of ordinal-patternsbased quantities require ordinal-d-stationarity of a time series [1, 6, 33] and may be unreliable when this condition fails. On the other hand, one can detect change-points in the original process by detecting changes in the sequence of ordinal patterns. First ideas of using ordinal patterns for detecting change-points were formulated in [4, 35, 38, 41, 49]. The advantage of the ordinal-patterns-based methods is that they require less information than most of the existing methods for change-point detection: it is assumed neither that the stochastic process is from a specific family nor that the change affects specific characteristic of the process. Instead, we consider further change-points with the following property. 7 L Definition 4. Let X(t) t=0 with L ∈ N ∪ {∞} be a piecewise stationary stochastic process with a change-point t∗ ∈ N. We say that t∗ is a ordinal change-point if there exist some m, n ∈ N with m < t∗ < n ≤ L and some n t∗ d ∈ N such that X(t) t=m and X(t) t∗ +1 are ordinal-d-stationary but n X(t) t=m is not. This approach seems to be natural for many stochastic processes and real-world time series. Remark. Note that a change-point where the change in mean occurs, need not be ordinal, since the mean is irrelevant for the distribution of ordinal patterns [1, Subsection 3.4.3]. However, there are many methods that effectively detect changes in mean; the method proposed here is intended for use in a more complex case, when there is no classical method, or it is not clear, which of them to apply. We illustrate Definition 4 by two examples. Piecewise stationary autoregressive processes considered in Example 3 are classical and provide models for linear time series. Since many real-world time series are non-linear, further we introduce in Example 4 a process originated from non-linear dynamical systems. These two types of processes are used throughout the paper for empirical investigation of change-point detection methods. Example 3. A first order piecewise stationary autoregressive (AR) process with change-points t∗1 , t∗2 , . . . , t∗Nst −1 is defined as  L AR (φ1 , φ2 , . . . , φNst ), (t∗1 , t∗2 , . . . , t∗Nst −1 ) = AR(t) t=0 , where φ1 , φ2 , . . . , φNst ∈ [0, 1) are the parameters of the autoregressive model and AR(t) = φk AR(t − 1) + ǫ(t), for all t ∈ {t∗k−1 + 1, t∗k−1 + 2, . . . , t∗k } for k = 1, 2, . . . , Nst , where t∗0 := 0 and t∗Nst := L, with ǫ being the standard white Gaussian noise, and AR(0) := ǫ(0). AR processes are often used for the investigation of methods for changepoints detection (see, for instance, [38, 41]), since they provide models for a wide range of real-world time series. Figure 4a illustrates a realization of a ‘two piece’ AR process with a change-point at L/2. By [7, Proposition 5.3] the distributions of ordinal patterns of order d ≥ 2 reflect change-points for piecewise stationary AR processes. Figure 4c illustrates this for the realization from Figure 4a: empirical probability distributions of ordinal patterns of order d = 2 before and after the change-point L/2 differ significantly. Example 4. A classical example of non-linear system is provided by a logistic map on the unit interval:  x(t) = rx(t − 1) 1 − x(t − 1) , (3) 8 with t ∈ N, for x(0) ∈ [0, 1] and r ∈ [1, 4]. The behaviour of this map significantly varies for different value r; we are especially interested in r ∈ [3.57, 4] with chaotic behaviour. In the latter situation there exists an invariant ergodic measure absolutely continuous with respect to the Lebesgue measure [29, 44], therefore (3) defines a stationary stochastic process NL0 :  NL0 (t) = r 1 − NL0 (t − 1) NL0 (t − 1), with NL0 (0) ∈ [0, 1] being a uniformly distributed random number. Note that for almost all r ∈ [3.57, 4] (more generally, for all r ∈ [0, 4]), either the map NL0 is chaotic or hyperbolic roughly meaning that an attractive periodic orbit is dominating it. This is a deep result in one-dimensional dynamics (see [29] for details). In the hyperbolic case after some transient behaviour numerically one only sees some periodic orbit, which has long periods in the interval r ∈ [3.57, 4]. From the practical viewpoint, i.e. when considering short orbits, dynamics for that interval can be considered as chaotic since already small changes of r provide chaotic behaviour also in the theoretical sense. Let us include some observational noise by adding standard white Gaussian noise ǫ to an orbit: NL(t) = NL0 (t) + σǫ(t), where σ > 0 is the level of noise. Orbits of logistic maps, particularly with observational noise, are often used as a studying and illustrating tool of non-linear time series analysis (see [15,28]). This justifies as a natural object for study a piecewise stationary noisy logistic (NL) process with change-points t∗1 , t∗2 , . . . , t∗Nst −1 , defined as  L NL (r1 , . . . , rNst ), (σ1 , . . . , σNst ), (t∗1 , t∗2 , . . . , t∗Nst −1 ) = NL(t) t=0 , where r1 , . . . , rNst ∈ [3.57, 4] are the values of control parameter, σ1 , . . . , σNst > 0 are the levels of noise, and NL(t) = NL0 (t) + σk ǫ(t), with  NL0 (t) = rk 1 − NL0 (t − 1) NL0 (t − 1), for all t ∈ {t∗k−1 + 1, t∗k−1 + 2, . . . , t∗k } for k = 1, 2, . . . , Nst , with t∗0 := 0, t∗Nst := L and NL0 (0) = ǫ(0). Figure 4b shows a realization of a ‘two-piece’ NL process with a changepoint at L/2; as one can see in Figure 4d, the empirical distributions of ordinal patterns of order d = 2 before the change-point and after the changepoint do not coincide. In general, the distributions of ordinal patterns of order d ≥ 1 reflect change-points for the NL processes (which can be easily checked). 9 0 −2 L/2−100 L/2 t L/2+100 NL((3.95, 4), 0.2, L/2) AR((0.1, 0.5), L/2) 2 2 1 0 −1 0.2 0.1 0 1 2 3 4 5 0 1 2 3 4 5 ordinal patterns L/2 t L/2+100 (b) empirical probability empirical probability (a) L/2−100 0.2 0.1 0 1 2 3 4 5 0 1 2 3 4 5 ordinal patterns (c) (d) Figure 4: Upper row: parts of realizations of AR (a) and NL (b) process with change-points marked by vertical lines, L = 20000. Lower row: empirical probability distributions of ordinal patterns of order d = 2 before and after the change-point for the realizations of AR (c) and NL (d) process The NL and AR processes considered have rather different ordinal patterns distributions, being the reason for using them for empirical investigation of change-point detection methods in Section 4. We now consider the classical problem of detecting a change-point t∗ on the basis of a realization x of a stochastic process X having at most one change-point, that is it holds either Nst = 1 or Nst = 2 (compare [12]). To solve this problem one estimates a tentative change-point b t∗ as the time-point that maximizes a test statistic S(t; x). Then the value of S(b t∗ ; x) is compared to a given threshold in order to decide whether b t∗ is a change-point. The idea of ordinal change-point detection is to find change-points in a stochastic process X by detecting changes in the sequence π d,L of ordinal patterns for a realization of X. Given at most one ordinal change-point t∗ in X, one estimates its position b t∗ by using the fact that • π(d), π(d + 1), . . . , π(t∗ ) characterize the process before the change; • π(t∗ + 1), π(t∗ + 2), . . . , π(t∗ + d − 1) correspond to the transitional state; • π(t∗ + d), π(t∗ + d + 1), . . . , π(L) characterize the process after the change. 10 Therefore, a position of a change-point can be estimated by an ordinalpatterns-based statistic S(t; π d,L ) that, roughly speaking, measures dissimt ilarity between the distributions of ordinal patterns for π(k) k=d and for L π(k) k=t+d . Then an estimate of the change-point t∗ is given by b t∗ = arg max S(t; π d,L ). t=d,d+1,...,L A method for detecting one change-point can be extended to an arbitrary number of change-points using the binary segmentation [48]: one applies a single change-point detection procedure to the realization x; if a changepoint is detected then it splits x into two segments in each of which one is looking for a change-point. This procedure is repeated iteratively for the obtained segments until all of them either do not contain change-points or are too short. The key problem in this paper is the selection of an appropriate ordinalpatterns-based test statistic S(t; π d,L ) for detecting changes. We suggest an appropriate test statistic in Section 3, but first we introduce in Subsection 2.3 the conditional entropy of ordinal patterns being the cornerstone of this statistic. 2.3 Conditional entropy of ordinal patterns L Let us call a process X = X(t) t=0 for L ∈ N ∪ {∞} ordinal-d+ -stationary if for all i, j ∈ Sd the probability of pairs of ordinal patterns  pi,j = P Π(t) = i, Π(t + 1) = j does not depend on t for d ≤ t ≤ L − 1 (compare with Definition 3). Obviously, ordinal-d + 1-stationarity implies ordinal-d+ -stationarity. For an ordinal-d+ -stationary stochastic process, consider the probability of an ordinal pattern j ∈ Sd to occur after an ordinal pattern i ∈ Sd ; similarly to (1), it is given by:  pi,j pj|i = P Π(t + 1) = j | Π(t) = i = pi for pi 6= 0. If pi = 0, let pj|i = 0. Definition 5. The conditional entropy of ordinal patterns of order d ∈ N of an ordinal d+ -stationary stochastic process X is defined by: X X X pi ln pi pi pj|i ln(pi pj|i ) + CE(X, d) = − i∈Sd i∈Sd j∈Sd =− X X pi pj|i ln pj|i . i∈Sd j∈Sd 11 (4) For brevity, we refer to CE(X, d) as the “conditional entropy” when no confusion can arise. The conditional entropy characterizes the mean diversity of successors j ∈ Sd of a given ordinal pattern i ∈ Sd . This quantity often provides a good practical estimation of the Kolmogorov-Sinai entropy for dynamical systems; for a discussion of this and other theoretical properties of conditional entropy we refer to [46]. One can estimate the conditional entropy from a time series by using the empirical conditional entropy of ordinal patterns [23]. Consider a sequence π d,L of ordinal patterns of order d ∈ N with length L ∈ N. Similarly to (2), the frequency of occurrence of an ordinal patterns pair i, j ∈ Sd is given by ni,j (t) = #{l ∈ {d, d + 1, . . . , t − 1} | π(l) = i, π(l + 1) = j} (5) for t ∈ {d + 1, d + 2, . . . , L}. The empirical conditional entropy of ordinal patterns for π d,L is defined by  eCE π d,L = − 1 X 1 X X ni,j (L) ln ni,j (L) + ni (L) ln ni (L) L−d L−d i∈Sd j∈Sd i∈Sd 1 X X ni,j (L) =− ni,j (L) ln . L−d ni (L) (6) i∈Sd j∈Sd As a direct consequence of Lemma 1 the empirical conditional entropy approaches the conditional entropy under certain assumptions, namely it holds the following. Corollary 3. For the sequence π d,∞ of ordinal patterns  of order d ∈ N of a realization of an ergodic stochastic process X = X(t) t∈N0 with associated stationary increment process (X(t)− X(t − 1))t∈N , it holds almost surely that  L  (7) lim eCE π(k) k=d = CE(X, d). L→∞ 3 Statistic for change-point detection based of on the conditional entropy of ordinal patterns We suggest to use the following statistic for detecting ordinal change-points of a process on the basis of a sequence π d,L of ordinal patterns for d, L ∈ N of a realization of the process:   L  CEofOP t; π d,L = (L − 2d) eCE π(k) k=d  t  − (t − d) eCE π(k) k=d (8)    L − L − (t + d) eCE π(k) k=t+d . 12 for all t ∈ N with d < t < L − d. The intuition behind this statistic comes from the concavity of conditional entropy (not only for ordinal patterns but in general, see [19, Subsection 2.1.3]). It holds eCE   L  t  t−d π(k) k=d ≥ eCE π(k) k=d L − 2d   L L − (t + d) + eCE π(k) k=t+d . L − 2d (9) ∗ Therefore, if the probabilities of ordinal patterns change at  some point t , ∗ d,L but do not change before and after t , then CEofOP t; π tends to attain ∗ its maximum at t = t . If the probabilities do not change at all, then for L being sufficiently large, (9) tends to hold with equality (see Corollary 6 in Section 6). Let ni (t) and ni,j (t) be the frequencies of occurrence of an ordinal pattern i ∈ Sd and of an ordinal patterns pair i, j ∈ Sd (given by (2) and (5), respectively). Set mi (t) = ni (L)−ni (t+d) and mi,j (t) = ni,j (L)−ni,j (t+d), then using (6) we rewrite (8) in a straightforward form:  ni,j (L) L − 2d X X ni,j (L) ln CEofOP t; π d,L = − L−d ni (L) (10) i∈Sd j∈Sd + X X ni,j (t) ln i∈Sd j∈Sd ni,j (t) X X mi,j (t) mi,j (t) ln + . ni (t) mi (t) i∈Sd j∈Sd This statistic was first introduced and applied to the segmentation of sleep EEG time series in [23]. In the rest of this section, we present a motivating example (Subsection 3.1), show the relation of the CEofOP statistic to the likelihood ratio statistic for a piecewise stationary Markov chain (Subsection 3.2) and formulate an algorithm for detecting multiple change-points by means of the CEofOP statistic in Subsection 3.3. 3.1 Motivating example We demonstrate a “non-linear” nature of the CEofOP statistic by means of Example 5 concerning transition from a time series to its surrogate. Although being in a sense tailor-made, this example shows that CEofOP discerns changes that cannot be detected by conventional “linear” methods. Remark. The question whether a time series is linear or non-linear often arises in data analysis. For instance, linearity should be verified before using such powerful methods as Fourier analysis. For this one usually employs a procedure known as surrogate data testing [36, 37, 43]. It utilises the fact that a linear time series is statistically indistinguishable from any time series sharing some of its properties (for instance, second moments and amplitude 13 spectrum). Therefore one can generate surrogates having the certain properties of the original time series without preserving other properties, irrelevant for a linear system. If such surrogates are significantly different from the original series then non-linearity is assumed. Example 5. Consider a time series consisting of a realisation of a noisy logistic process NL r, σ of length L/2 without changes, glued with its surrogate of the same length (to generate surrogates we use the iterative AAFT algorithm suggested by [37] and implemented by [17]). This compound time series has a change-point at t∗ = L/2, which conventional methods may fail to detect since the surrogate has the same autocorrelation function as the original process (for instance this is the case for the Brodsky-Darkhovsky method considered further in Section 4). However, the ordinal pattern distributions for the original time series and its surrogate generally are significantly different. Therefore the CEofOP statistic detects the change-point, which is illustrated by Figure 5. 100 90 CEofOP(t) 80 70 60 50 40 30 20 0 1000 2000 t 3000 4000 Figure 5: Statistic CEofOP(θL) for a time series, obtained by “gluing” a  realization of a noisy logistic stochastic process NL 4, 0.2 with its surrogate at t∗ = 2000 Remark. Although the idea that ordinal structure is a relevant indicator of time series linearity/non-linearity is not new [1, 6], to our knowledge, it was not rigorously proved that the distribution of ordinal patterns is altered by surrogates. This is clearly beyond the scope of this paper and will be discussed elsewhere as a separate study; here it is sufficient for us to provide an empirical evidence for this. 14 3.2 CEofOP statistic for a sequence of ordinal patterns forming a Markov chain In this subsection we show that there is a connection between the CEofOP statistic and the classical likelihood ratio statistic. Though taking place only in a particular case, this connection reveals the nature of the CEofOP statistic. First we set up necessary notations. Consider a sequence π d,L of ordinal patterns for that transition probabilities of ordinal patterns may change at some t ∈ {d, d + 1 . . . , L}. The basic statistic for testing whether there is a change in the transition probabilities is the likelihood ratio statistic [8, Subsection 2.2.3]:    LR t; π d,L = −2 ln Lkl H0 | π d,L + 2 ln Lkl HA | π d,L , (11)  where Lkl H | π d,L is the likelihood of the hypothesis H given a sequence π d,L of ordinal patterns, and the hypotheses are given by   H0 : pj|i (t) i,j∈S = qj|i(t) i,j∈S , d d   HA : pj|i (t) i,j∈S 6= qj|i(t) i,j∈S , d d where pj|i (t), qj|i (t) are transition probabilities of ordinal patterns before and after t, respectively. Proposition 4. If an abstract sequence Πd of ordinal patterns of order d ∈ N forms a Markov chain with at most one change-point, then for a sequence L π d,L = π(k) k=d of ordinal patterns being a realization of Πd of length L ∈ N, it holds    LR t; π d,L = 2 CEofOP t; π d,L + 2d · eCE π d,L . Proof. First we estimate the probabilities and the transition probabilities before (p) and after (q) the change [3, Section 2]: ni (t) , t−d mi (t) , qbi (t) = L − (t + d) pbi (t) = 15 ni,j (t) , ni (t) mi,j (t) qbj|i (t) = . mi (t) pbj|i(t) = Then, as one can see from [3, Section 3.2], we have Lkl H0 | π d,L  = pbπ(d) (L) = pbπ(d) (L) L−1 Y l=d pbπ(l+1)|π(l) (L) Y Y i∈Sd j∈Sd n (L) pbj|i (L) i,j , L−1 t Y Y  qbπ(l+1)|π(l) (t) pbπ(l+1)|π(l) (t) Lkl HA | π d,L = pbπ(d) (t) l=t+d l=d = pbπ(d) (t) Y Y i∈Sd j∈Sd m (t) n (t) Y Y qbj|i (t) i,j . pbj|i (t) i,j i∈Sd j∈Sd Assume that the first ordinal pattern π(d) is fixed in order to simplify the computations. Then pbπ(d) (L) = pbπ(d) (t) and it holds: X X   ni,j (L) ln ni,j (L) − ln ni (L) LR t; π d,L = −2 i∈Sd j∈Sd +2 X X i∈Sd j∈Sd +2 X X i∈Sd j∈Sd Since P  ni,j (t) ln ni,j (t) − ln ni (t)  mi,j (t) ln mi,j (t) − ln mi (t) . ni,j (t) = ni (t), one finally obtains: j∈Sd 3.3   L  LR t; π d,L =2(L − d) eCE π(k) k=d  t  − 2(t − d) eCE π(k) k=d    L − 2 L − (t + d) eCE π(k) k=t+d    =2 CEofOP t; π d,L + 2d · eCE π d,L . Change-point detection via the CEofOP statistic Consider a sequence π d,L of ordinal patterns of order d ∈ N with length L ∈ N, corresponding to a realization of some piecewise stationary stochastic process. To detect a single change-point via the CEofOP statistic we first estimate its possible position by b t∗ = arg max S(t; π d,L ), t=Tmin +d,...,L−Tmin where Tmin is a minimal length of a sequence of ordinal patterns that is sufficient for a reliable estimation of empirical conditional entropy. 16 Remark. From the representation (8) it follows that for a reasonable computation of the CEofOP statistic, a reliable estimation of eCE before and after the assumed change-point is required. To satisfy this requirement the stationary parts of a process are assumed to be sufficiently long. We take Tmin = (d + 1)!(d + 1), which is equal to the number of all possible pairs of ordinal patterns of order d (see [23] for details). Consequently, the length L of a time series should satisfy L > 2Tmin = 2(d + 1)!(d + 1). (12) Note that this does not impose serious limitations on the suggested method, since condition (12) is not too restrictive for d ≤ 3. However it implies using of either d = 2 or d = 3, since d = 1 does not provide effective change-point detection (see Examples 6 and 3), while d > 3 in most applications demands too large sample sizes. Then in order to check whether b t∗ is an actual change-point we test between the hypotheses: H0 : parts π(d), π(d + 1), . . . , π(b t∗ ) and π(b t∗ + d), . . . , π(L) of the sequence d,L π come from the same distribution; HA : parts π(d), π(d + 1), . . . , π(b t∗ ) and π(b t∗ + d), . . . , π(L) of the sequence π d,L come from different distributions.  t∗ ; π d,L to a threshold h, This test is performed by comparing CEofOP b such that if the value of CEofOP is above the threshold then one rejects H0 in favour of HA , otherwise H0 is accepted. The choice of the threshold is ambiguous: the higher h, the higher the possibility of false acceptance of the hypothesis H0 is; on the contrary, the lower h, the higher the possibility of false rejection of H0 in favour of HA (false alarm) is. As it is usually done, we consider the threshold h as a function of the desired probability α of false alarm; for computing the threshold h(α) we use block bootstrapping from the sequence π d,L of ordinal patterns (bootstrapping is often used in change-point detection for computing a threshold, see [14, 25] for a theoretical discussion and [24, 31] for applications of bootstrapping with detailed and clear explanations). Algorithm 1 describes the detection of at most one change-point via the CEofOP statistic. To detect multiple change-points we use an algorithm that consists of two steps: Step 1: preliminary estimation of boundaries of the stationary segments with a threshold h(2α) computed for doubled nominal probability of false alarm (that is with a higher risk of detecting false change-points). Step 2: verification of the boundaries and exclusion of false change-points: a change-point is searched for a merging of every two adjacent intervals. 17 Algorithm 1 Detecting at most one change-point tend of ordinal patterns of order d, nominal Input: sequence π = π(k) k=t start probability α of false alarm Output: estimate of a change-point b t∗ if change-point is detected, otherwise return 0. 1: function DetectSingleCP(π, α) 2: Tmin ← (d + 1)!(d + 1); 3: if tend − tstart < 2Tmin then 4: return 0; ⊲ sequence is too short, no change-point can be detected 5: end if b CEofOP(t; π); 6: t∗ ← arg max t=tstart +Tmin ,...,tend −Tmin ⊲ number Nboot ← ⌊ α5 ⌋; of bootstrap samples for computing threshold 8: for l = 1, 2, . . . , Nboot do ⊲ computing threshold by bootstrapping 9: ξ ← randomly shuffled blocks of length (d + 1) from π; 10: cj ← arg max CEofOP(t; ξ); 7: t=tstart +Tmin ,...,tend −Tmin 11: 12: 13: 14: 15: 16: 17: 18: 19: end for cj ← Sort(cj ); ⊲ sort the maximal values of CEofOP for bootstrap samples in decreasing order h ← c⌊αNboot ⌋ if S(b t∗ ; π) < h then return 0; else return b t∗ ; end if end function Details of these two steps are displayed in Algorithm 2. While Step 1 is the usual binary segmentation procedure as suggested in [48], Step 2 improves the obtained solution following the idea suggested in [11]. 4 Experiments In this section we empirically investigate performance of the method for change-point detection via the CEofOP statistic. We apply it to the noisy logistic processes and to autoregressive processes (see Subsection 2.2) and compare performances of change-point detection by the suggested method and by the following methods. • The ordinal-patterns-based method for detecting change-points via the CMMD statistic [38, 41]: A time series is split into windows of equal 18 Algorithm 2 Detecting multiple change-points L Input: sequence π = π(k) k=d of ordinal patterns of order d, nominal probability α of false alarm. bst of stationary segments and of their Output: estimates of the number N  b N t∗k st . boundaries b k=0 function DetectAllCP(π, α) bst ← 1; b N t∗0 ← 0; b t∗1 ← L; k ← 0 3: repeat  bt∗ b 4: t∗ ← DetectSingleCP π(k) k+1∗ 1: 2: ⊲ Step 1  , 2α ; k=b t +d k 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: if b t∗ > 0 then Insert b t∗ to the list of change-points after b t∗i ; bst ← N bst + 1; N else k ← k + 1; end if bst ; until k < N k ← 0; repeat   bt∗ b t∗ ← DetectSingleCP π(k) k+2∗ , α ; ⊲ Step 2 k=b tk +d if b t∗ > 0 then b t∗ ; t∗k+1 ← b k ← k + 1; else Delete b t∗k+1 from the change-points list; bst ← N bst − 1; N end if bst − 1; until k < N Nbst bst , b t∗k k=0 ; return N end function lengths W ∈ N, empirical probabilities of ordinal patterns are estimated in every window. If there is a ordinal change-point in the time series, then the empirical probabilities of ordinal patterns should be approximately constant before the change-point and after the changepoint, but they change at the window with the change-point. To detect this change authors have introduced the CMMD statistic1 . In the 1 Note that the definition of the CMMD statistic in [38] contains a mistake, which is corrected in [41]. The results of numerical experiments reported in [38] also do not comply with the actual definition of the CMMD statistic, see [45, Subsections 4.2.1.1, 4.5.1.1] for details. 19 original papers [38,41] authors do not estimate change-points, but only the corresponding window numbers; for the algorithm of change-point estimation by means of the CMMD statistic we refer to [45, Subsection 4.5.1]. • Two versions of the classical Brodsky-Darkhovsky method [11]: The Brodsky-Darkhovsky method can be used for detecting changes in varL ious characteristics of a time series x = x(t) t=1 , but the characteristic of interest should be selected in advance. In this paper we consider detecting changes in mean which is just the basic characteristic, and in correlation function corr(x(t), x(t+1)) which reflects relations between the future and the past of a time series and seems to be a natural choice for detecting ordinal change-points. Changes in mean are detected by the generalized version of the Kolmogorov-Smirnov statistic [11]: exp BD (t; x, δ) =  t(L − t) L2 δ t L X 1X 1 x(l) − x(l) , t L−t l=1 l=t+1 where the parameter δ ∈ [0, 1] regulates properties of the statistic, δ = 0 is basically used (see [11] for details). Changes in the correlation function are detected by the following statistic: L−1  BDcorr (t; x, δ) = BDexp t; y(t) t=1 , δ with y(t) = x(t)x(t + 1). Remark. Note that we consider the statistic BDexp , which is intended to detect changes in mean, though ordinal-patterns-based statistics do not detect these changes. This is motivated by the fact that changes in the noisy logistic processes are on the one hand changes in mean, and in the other hand – ordinal changes in the sense of Definition 4. Therefore, they can be detected both by BDexp and by ordinal-patterns-based statistics. In general, by the nature of ordinal time series analysis, changes in mean and in the ordinal structure are in some sense complementary. We carry out experiments for order d = 3 of ordinal patterns (lower orders may provide worse results because of reduced sensitivity, while higher orders are applicable only to rather long time series due to condition (12)). For the CMMD statistic; we take the window size W = 256. (There are no special reasons for this choice except the fact that W = 256 is sufficient for estimating probabilities of ordinal patterns of order d = 3 inside the windows, since 256 > 120 = 5(d + 1)! [1, Section 9.3]. Results of the experiments remain almost the same for 200 ≤ W ≤ 1000.) In Subsection 4.1 we study how well the statistics for change-point detection estimate the position of a single change-point. Since we expect that the performance of the statistics for change-point detection may strongly 20 depend on the length of realization, we check this in Subsection 4.2. Finally, we investigate the performance of various statistics for detecting multiple change-points in Subsection 4.3. 4.1 Estimation of the position of a single change-point L Consider N = 10000 realizations xj = xj (t) t=0 with j = 1, . . . , N for each of the processes listed in Table  1. A single change occurs at a random time t∗ uniformly distributed in L4 − W, L4 − W + 1, . . . , L4 + W . For all processes, length L = 80 W of sequences of ordinal patterns is taken. Short name NL, 3.95 → 3.98, σ = 0.2 NL, 3.95 → 3.80, σ = 0.3 NL, 3.95 → 4.00, σ = 0.2 AR, 0.1 → 0.3 AR, 0.1 → 0.4 AR, 0.1 → 0.5 Complete designation  NL (3.95, 3.98), (0.2, 0.2), t∗  NL (3.95, 3.80), (0.3, 0.3), t∗  NL (3.95, 4.00), (0.2, 0.2), t∗  AR (0.1, 0.3), t∗  AR (0.1, 0.4), t∗  AR (0.1, 0.5), t∗ Table 1: Processes used for investigation of the change-point detection To measure the overall accuracy of change-point detection via some statistic S as applied to the process X we use three quantities. Let us first determine the error of the change-point estimation provided by the statistic S for the j-th realization of a process X:   errj (S, X) = b t∗ (S; xj ) − t∗ , where t∗ is the actual position of the change-point and b t∗ (S; xj ) is its estimate obtained by using S. Then the fraction of satisfactorily estimated changepoints sE (averaged over N realizations) is defined by:  # j ∈ {1, 2, . . . , N } : |errj (S, X)| ≤ MaxErr , sE(S, X) = N where MaxErr is the maximal satisfactory error, we take MaxErr = W = 256. The bias and the root mean squared error are respectively given by N 1 X j err (S, X), B(S, X) = N j=1 v u N u1 X 2 t errj (S, X) . RMSE(S, X) = N j=1 21 The larger sE is and the more near to zero the bias and the RMSE are, the more accurate the estimation of a change-point is. Results of the experiments are presented in Tables 2, 3 for NL and AR processes, respectively. For every process the best values of performance measures are shown in bold. Statistic CMMD CEofOP BDexp BDcorr NL, 3.95 → 3.98 σ = 0.2 NL, 3.95 → 3.80 σ = 0.3 NL, 3.95 → 4.00 σ = 0.2 sE B RMSE sE B RMSE sE B RMSE 0.34 0.61 0.62 0.44 698 53 78 85 1653 397 351 656 0.50 0.65 0.78 0.71 -51 1 -6 13 306 256 145 202 0.68 0.88 0.89 0.77 -13 20 43 43 206 99 96 189 Table 2: Performance of different statistics for estimating change-point in NL processes Statistic CMMD CEofOP BDexp BDcorr AR, 0.1 → 0.3 AR, 0.1 → 0.4 AR, 0.1 → 0.5 sE B RMSE sE B RMSE sE B RMSE 0.32 0.39 0.00 0.79 616 126 1626 1838 -14 0 368 234 184 110 >104 >104 >104 >104 >104 31 151 21 73 0.68 0.86 0.00 0.97 -48 0 >103 0.54 0.68 0.00 0.92 21 50 Table 3: Performance of different statistics for estimating change-point in AR processes Let us summarize: For the considered processes the CEofOP statistic estimates change-point more accurately than the CMMD statistic. For the NL processes the CEofOP statistic has almost the same performance as the Brodsky-Darkhovsky method; for the AR processes performance of the classical method is better, though CEofOP has lower bias. In contrast to the ordinal-patterns-based methods, the Brodsky-Darkhovsky method is unreliable when there is lack of a priori information about the time series. For instance, changes in NL processes only slightly influence the correlation function and BDcorr does not provide a good indication of changes (cf. performance of BDcorr and CEofOP in Table 2). Meanwhile, changes in the AR processes do not influence the expected value (see Example 3), which does not allow to detect them using BDexp (see Table 3). Therefore we do not consider the BDexp statistic in further experiments. 22 4.2 Estimating position of a single change-point for different lengths of time series Here we study how the accuracy of change-point estimation for the three considered statistics depends on the length L of a time series. We take N = 50000 realizations of NL, 3.95 → 3.98, σ = 0.2 and AR, 0.1 → 0.4 for realization lengths L = 24 W, 28  W, . . . , 120 W . Again, we consider a single change at a random time t∗ ∈ L4 − W, L4 − W + 1, . . . , L4 + W . Results of the experiment are presented in Figure 6. 0.6 MMD CEofOP BDcorr 800 0.55 0.5 600 Bias sE 0.45 0.4 400 0.35 0.3 200 MMD CEofOP BDcorr 0.25 0.2 40 60 80 L, windows 100 0 120 40 (a) 60 80 L, windows 100 120 (b) MMD CEofOP BDcorr 400 0.9 350 0.8 300 250 sE Bias 0.7 0.6 200 150 100 0.5 MMD CEofOP BDcorr 0.4 40 60 80 L, windows 100 50 0 40 120 (c) 60 80 L, windows 100 120 (d) Figure 6: Measures of change-point detection performance for NL (a, b) and AR (c, d) processes with different lengths, where L is the product of window numbers given on the abscissa axis with window length W = 256 Summarizing, performance of the CEofOP statistic strongly depends on the length of time series but is generally better than for the CMMD statistic. In comparison with the classical Brodsky-Darkhovsky method, CEofOP has better performance for NL processes (see Figures 6a,b), and lower bias for AR processes (see Figure 6d). 23 4.3 Detecting multiple change-points Here we investigate how well the considered statistics detect multiple changepoints. Methods for change-point detection via the CEofOP and the CMMD statistics are implemented according to Subsection 3.3 and [45, Subsection 4.5.1], respectively. The Brodsky-Darkhovsky method is implemented according to [11] with only one exception: to compute a threshold for it we use bootstrapping, which in our case provided better results than the technique described in [11]. Nominal probability of a false alarm α = 0.05 has been taken for all methods (in the case of the CMMD statistic we have used the equivalent value 0.001, see [45, Subsection 4.3.2]).  ∗ , t∗ , t∗ ) and We consider here two processes, AR (0.3, 0.5, 0.1, 0.4), (t 3 2 1  ∗ , t∗ ) , with change-points t∗ beNL (3.98, 4, 3.95, 3.8), (0.2, 0.2, 0.2, 0.3), (t∗1 , t 2 3 k ing independent and uniformly distributed in t∗k − W, t∗k − W + 1, . . . , t∗k + W for k = 1, 2, 3 with t∗1 = 0.3L, t∗2 = 0.7L, t∗3 = 0.9L, and L = 100 W . For both processes we generate N = 10000 realizations xj with j = 1, . . . , N . We consider unequal lengths of stationary segments to study methods for change-point detection in more realistic conditions. As we apply change-point detection via a statistic S to realization xj , bst (S; xj ) of stationary segments and of we obtain estimates of the number N j ∗ bst (S; xj ) − 1. Since the change-points positions b tl (S; x ) for l = 1, 2, . . . , N number of estimated change-points may be different from the actual number of changes, we suppose that the estimate for t∗k is provided by the nearest b t∗l (S; xj ). Therefore the error of estimation of the k-th change-point provided by S is given by errjk (S, X) = min bst (S;xj )−1 l=1,2,...,N b t∗l (S; xj ) − t∗k . To assess the overall accuracy of change-point detection, we compute two quantities. The fraction sEk of satisfactory estimates of a change-point t∗k , k = 1, 2, 3 is given by  # j ∈ {1, 2, . . . , N } | errjk (S, X) ≤ MaxErr , sEk (S, X) = N where MaxErr is the maximal satisfactory error; we take MaxErr = W = 256. The average number of false change-points is defined by: fCP(S, X) = N   P bst (S; xj ) − 1 − # k ∈ {1, 2, 3} | errj (S, X) ≤ MaxErr N k j=1 N . Results of the experiment are presented in Tables 4 and 5, the best values are shown in bold. In summary, since distributions of ordinal patterns for NL and AR processes have different properties, results for them differ significantly. The 24 Statistic fCP cMMD CEofOP BDcorr 1.17 0.62 1.34 Fraction sEk of satisfactory estimates 1st change 2nd change 3rd change average 0.465 0.753 0.296 0.642 0.882 0.737 0.747 0.930 0.751 0.618 0.855 0.595 Table 4: Performance of change-point detection methods for the process with three change-points NL (3.98, 4, 3.95, 3.8), (0.2, 0.2, 0.2, 0.3), (t∗1 , t∗2 , t∗3 ) Statistic fCP CMMD CEofOP BDcorr 1.17 1.12 0.53 Fraction sEk of satisfactory estimates 1st change 2nd change 3rd change average 0.340 0.368 0.783 0.640 0.834 0.970 0.334 0.517 0.931 0.438 0.573 0.895 Table 5: Performance of change-point detection methods for the process with  three change-points AR (0.3, 0.5, 0.1, 0.4), (t∗1 , t∗2 , t∗3 ) CEofOP statistic provides good results for the NL processes. However, for the AR processes its performance is much worse: only the most prominent change is detected rather well. Weak results for two other change-points are caused by the fact that the CEofOP statistic is rather sensitive to the lengths of stationary segments (we have already seen this in Subsection 4.2), and in this case they are not very long. 5 Conclusions and open points In this paper we have introduced a method for change-point detection via the CEofOP statistic and have tested it for time series coming from two classes of models having quite different distributions, namely piecewise stationary noisy logistic and autoregressive processes. The empirical investigations suggest that the method proposed provides better detection of ordinal change-points than the ordinal-patterns-based method introduced in [38, 41]. Performance of our method for the two model classes considered is particularly comparable to that for the classical Brodsky-Darkhovsky method, but in contrast to it, ordinal-patterns-based methods require less a priori knowledge about the time series. This can be especially useful in the case of considering non-linear models where the autocorrelation function does not describe distributions completely. Here the point is that with exception of the mean much of the distribution is captured by its ordinal structure. So (together with methods finding changes in mean) 25 the CEofOP statistic can be used at least for a first exploration step. Although numerical experiments and tests to real-world data cannot replace rigorous theoretical studies, the results of the current study show the potential of the change-point detection via the CEofOP statistic. However, there are some open points listed below. 1. A method for computing a threshold h for the CEofOP statistic without using bootstrapping is of interest, since the bootstrapping procedure is rather time consuming. One possible solution is to utilize Theorem 5 (Section 6) and to precompute thresholds using the values of ∆dγ,θ (P, Q). However, this approach requires further investigation. 2. The binary segmentation procedure [48] is not the only possible method for detecting multiple change-points. In [26,27] an alternative approach bst is estimated by is suggested: the number of stationary segments N optimizing a contrast function, then the positions of the change-points are adjusted. Likewise one can consider a method for multiple changepoint detection based on maximizing the following generalization of CEofOP statistic:  L  b CEofOP(t) = (L − dNst ) eCE π(k) k=d − bst N X l=1     b t∗l , t∗l−1 + d , . . . , π b t∗l − b t∗l−1 − d eCE π b bst ∈ N is an estimate of number of stationary segments, b where N t∗1 = 0, b ∈ N are estimates of change-points. t∗b t∗2 , . . . , b t∗1 , b t∗b = L and b Nst −1 Nst Further investigation in this direction could be of interest. 3. As we have seen in Subsection 4.2, CEofOP statistic requires rather large sample sizes to provide reliable change-point detection. This is due to the necessity of the empirical conditional entropy estimation (see Subsection 3.3). In order to reduce the required sample size, one may consider more effective estimates of the conditional entropy, for instance, the Grassberger estimate (see [18] and [45, Subsection 3.4.1]). However elaboration of this idea is beyond the scope of this paper. 4. In this paper only one-dimensional time series are considered, though there is no principal limitation for applying ordinal-patterns-based methods to multivariate data (see [21]). Discussion of using ordinalpatterns-based methods for detecting change-point in multivariate data (for instance, in multichannel EEG) is therefore of interest. 5. We have considered here only the “off-line” detection of changes, which is used when the acquisition of a time series is completed. Meanwhile, 26 in many applications it is necessary to detect change-points “on-line”, based on a small number of observations after the change [8]. Development of on-line versions of ordinal-patterns-based methods for changepoint detection may be an interesting direction of a future work. 6 Asymptotic behavior of the CEofOP statistic Here we consider the values of CEofOP for the case when segments of a stochastic process before and after the change-point have infinite length. Let us first introduce some notation. Given an ordinal-d+ -stationary stochastic process X for d ∈ N the distribution of pairs of ordinalpatterns is denoted by P = (pi,j )i,j∈Sd , with pi,j = P Π(t) = i, Π(t + 1) = j = pj|i pi for all i, j ∈ Sd . One easily sees the following: The conditional entropy of ordinal patterns is represented as CE(X, d) = H(P ), where  X XX X X pi,j ln pi,j + pi,j ln pi,j . H(P ) = − i∈Sd j∈Sd Here recall that pi = P i∈Sd j∈Sd j∈Sd pi,j . j∈Sd Theorem 5. Let Y = (Yt )t∈N and Z = (Zt )t∈N be ergodic d+ -ordinal-stationary stochastic processes on a probability space (Ω, A, P) with probabilities of pairs of ordinal patterns of order d ∈ N given by P = (pi,j )i,j∈Sd and Q = (qi,j )i,j∈Sd , respectively. For L ∈ N and γ ∈ (0, 1), let ΠL,γ be the abstract sequence of ordinal patterns of order d of (Y1 , . . . , Y⌊γL⌋ , Z⌊γL⌋+1 , Z⌊γL⌋+2 , . . . , ZL ). (13) Then, for all θ ∈ (0, 1) it holds   lim CEofOP ⌊θL⌋; ΠL,γ = L ∆dγ,θ (P, Q) L→∞ P-almost sure, where (  1−γ  H γP + (1−γ)Q − θH(P ) − (1−θ)H γ−θ P + d 1−θ 1−θ Q , θ < γ .  ∆γ,θ (P, Q) = γ θ−γ  H γP + (1−γ)Q − θH θ P + θ Q − (1−θ)H(Q), θ≥γ By definition, (13) is a stochastic process of length L + 1 with a potential ordinal change-point t∗ = ⌊θL⌋, i.e. the position of t∗ relative to L is principally the same for all L, and the statistics considered are stabilizing for increasing L. (13) can be particularly interpreted as a part of a stochastic process including exactly one ordinal chance point. We omit the proof of Theorem 5 since it is a simple computation. 27 Due to the properties of the conditional entropy, it holds  max ∆dγ,θ (P, Q) = ∆dγ,γ (P, Q) = H γP +(1−γ)Q −γH(P )−(1−γ)H(Q). θ∈(0,1) Values of ∆dγ,θ (P, Q) can be computed for a piecewise stationary stochastic process with known probabilities of ordinal patterns before and after the change-point2 . In [7] authors compute probabilities of ordinal patterns of orders d = 2 (Proposition 5.3) and d = 3 (Theorem 5.5) for stationary Gaussian processes (in particular, for autoregressive processes). Here we use these results to provide Example 6 illustrating Theorem 5.  Example 6. Consider an autoregressive process AR (φ1 , φ2 ), t∗ with a single change-point t∗ = L/2 for L ∈ N. Using the results from [7] we compute distributions P φ1 , P φ2 of ordinal pattern pairs for orders d = 1, 2 and on  this basis we calculate the values of ∆d0.5,0.5 P φ1 , P φ2 for different values of φ1 and φ2 . The results are presented in Tables 6 and 7. ❍ ❍❍ φ1 0.00 φ2 ❍❍ ❍ 0.00 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 0.99 0 0.02 0.07 0.15 0.26 0.40 0.56 0.74 0.95 1.18 1.44 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 0.99 0.02 0 0.02 0.06 0.14 0.25 0.37 0.53 0.71 0.91 1.13 0.07 0.02 0 0.02 0.06 0.13 0.23 0.36 0.51 0.68 0.88 0.15 0.06 0.02 0 0.01 0.06 0.13 0.22 0.34 0.49 0.66 0.26 0.14 0.06 0.01 0 0.01 0.06 0.12 0.22 0.33 0.48 0.40 0.25 0.13 0.06 0.01 0 0.01 0.05 0.12 0.21 0.33 0.56 0.37 0.23 0.13 0.06 0.01 0 0.01 0.05 0.12 0.21 0.74 0.53 0.36 0.22 0.12 0.05 0.01 0 0.01 0.05 0.12 0.95 0.71 0.51 0.34 0.22 0.12 0.05 0.01 0 0.01 0.05 1.18 0.91 0.68 0.49 0.33 0.21 0.12 0.05 0.01 0 0.01 1.44 1.13 0.88 0.66 0.48 0.33 0.21 0.12 0.05 0.01 0  Table 6: Values of 100 ∆10.5,0.5 P φ1 , P φ2 for an autoregressive process (coefficient 100 here is only for the sake of readability) L According to Theorem 5, for π d,L = π(k) k=d being a sequence of ordinal  patterns of order d for a realization of AR (φ1 , φ2 ), L/2 it holds almost sure that    1 max CEofOP ⌊θL⌋; π d,L −−−−→ ∆d0.5,0.5 P φ1 , P φ2 . L→∞ L θ∈(0,1) 2 To apply Theorem 5 one needs probabilities of pairs of ordinal patterns of order d. They can be calculated from the probabilities of ordinal patterns of order (d + 1): as one can easily verify, probability Pi,j of any pair (i, j) of ordinal patterns i, j ∈ Sd is equal either to the probability of a certain ordinal pattern of order (d + 1) or to the sum of two such probabilities. 28 ❍❍ φ ❍ 1 0.00 φ2 ❍❍ ❍ 0.00 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 0.99 0 0.04 0.15 0.33 0.56 0.85 1.18 1.55 1.95 2.40 2.88 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 0.99 0.04 0 0.04 0.14 0.31 0.53 0.80 1.12 1.48 1.89 2.34 0.15 0.04 0 0.03 0.13 0.29 0.51 0.77 1.08 1.44 1.85 0.33 0.14 0.03 0 0.03 0.13 0.28 0.49 0.75 1.06 1.43 0.56 0.31 0.13 0.03 0 0.03 0.12 0.27 0.48 0.74 1.06 0.85 0.53 0.29 0.13 0.03 0 0.03 0.12 0.27 0.48 0.74 1.18 0.80 0.51 0.28 0.12 0.03 0 0.03 0.12 0.27 0.48 1.55 1.12 0.77 0.49 0.27 0.12 0.03 0 0.03 0.12 0.28 1.95 1.48 1.08 0.75 0.48 0.27 0.12 0.03 0 0.03 0.13 2.40 1.89 1.44 1.06 0.74 0.48 0.27 0.12 0.03 0 0.03 2.88 2.34 1.85 1.43 1.06 0.74 0.48 0.28 0.13 0.03 0  Table 7: Values of 100 ∆20.5,0.5 P φ1 , P φ2 for an autoregressive process Figure 7 shows how fast this convergence is. Note that the CEofOP statistic for orders d = 1, 2 allows to distinguish between change and no change in the considered processes for L ≥ 20 · 103 . For L = 105 the values of the CEofOP statistic for order d = 2 is already very close to its theoretical values, whereas for d = 1 this length does not seem sufficient. −3 −3 4 x 10 x 10 14 AR,0.1→0.1 AR,0.1→0.3 AR,0.1→0.4 AR,0.1→0.5 3 AR,0.1→0.1 AR,0.1→0.3 AR,0.1→0.4 AR,0.1→0.5 12 10 8 2 6 4 1 2 0 1 2 5 10 L, x103 20 (a) Figure 7: Convergence of 50 1 100 2 5 10 L, x103 20 50 100 (b)  max CEofOP ⌊θL⌋; π d,L to the theoretical 1 L θ∈(0,1) values ∆d0.5,0.5 as L increases for autoregressive processes for d = 1 (a) and  d = 2 (b). Here AR, φ1 → φ2 stands for the process AR (φ1 , φ2 ), L/2 . The provided empirical values are obtained either as 5th percentile (for φ1 6= φ2 ) or as 95th percentile (for φ1 = φ2 ) from 1000 trials 29 The following result is a simple consequence of Theorem 5. Corollary 6. Let X = (Xt )t∈N0 be an ergodic d+ -ordinal-stationary stochastic process on a probability space (Ω, A, P). For L ∈ N let Πd,L be the abstract sequence of ordinal patterns of order d of (X0 , X1 , . . . , XL ). Then for any θ ∈ (0, 1) it holds   (14) lim CEofOP ⌊θL⌋; Πd,L = 0 L→∞ P-almost sure. Acknowledgement This work was supported by the Graduate School for Computing in Medicine and Life Sciences funded by Germany’s Excellence Initiative [DFG GSC 235/1]. References [1] J. M. Amigó. Permutation complexity in dynamical systems. Ordinal patterns, permutation entropy and all that. Berlin Heidelberg: Springer, 2010. [2] J. M. Amigó and K. Keller. Permutation entropy: One concept, two approaches. European Physical Journal Special Topics, 222(2):263–273, 2013. [3] T. W. Anderson and L. A. Goodman. Statistical inference about markov chains. Annals of Mathematical Statistics, 28:89–110, 1957. [4] C. Bandt. Autocorrelation type functions for big and dirty data series. arXiv preprint arXiv:1411.3904, 2003. [5] C. Bandt, G. Keller, and B. Pompe. Entropy of interval maps via permutations. Nonlinearity, 15(5):1595–1602, 2002. [6] C. Bandt and B. Pompe. Permutation entropy: A natural complexity measure for time series. Physical Review Letters, 88(174102), 2002. [7] C. Bandt and F. Shiha. Order patterns in time series. Journal of Time Series Analysis, 28(5):646–665, 2007. [8] M. Basseville and I. V. Nikiforov. Detection of abrupt changes: theory and application. Upper Saddle River, NJ: Prentice-Hall, Inc., 1993. [9] B. E. Brodsky and B. S. Darkhovsky. Nonparametric methods in changepoint problems. Dordrecht: Kluwer Academic Publishers, 1993. 30 [10] B. E. Brodsky and B. S. Darkhovsky. Non-parametric statistical diagnosis. Problems and methods. Dordrecht: Kluwer Academic Publishers, 2000. [11] B. E. Brodsky, B. S Darkhovsky, A. Ya. Kaplan, and S. L. Shishkin. A nonparametric method for the segmentation of the EEG. Computer Methods and Programs in Biomedicine, 60(2):93–106, 1999. [12] E. Carlstein, H. G. Muller, and D. Siegmund. Change-point problems. Hayward, CA: Institute of Mathematical Statistics, 1994. [13] R. A. Davis, T. C. M. Lee, and G. A. Rodriguez-Yam. Structural break estimation for nonstationary time series models. Journal of the American Statistical Association, 101(473):223–239, 2006. [14] A. C. Davison and D. V. Hinkley. Bootstrap Methods and their Applications. Cambridge: Cambridge University Press, 1997. [15] C. Diks. Nonlinear Time series analysis: Methods and Applications. World Scientific, 1999. [16] S. Elizalde and M. Martinez. The frequency of pattern occurrence in random walks. arXiv preprint arXiv:1412.0692, 2014. [17] T. Gautama. Surrogate Data. MATLAB Central File Exchange. https:// www.mathworks.com/matlabcentral/fileexchange/4612surrogate-data, 2005. [18] P. Grassberger. Entropy estimates from insufficient samplings. e-print – arXiv preprint physics/0307138, 2003. [19] T. S. Han and K. Kobayashi. Mathematics of information and coding. Transl. from the Japanese by J. Suzuki. Providence: American Mathematical Society, 2002. [20] T. Haruna and K. Nakajima. Permutation complexity and coupling measures in hidden Markov models. Entropy, 15(9):3910–3930, 2013. [21] K. Keller. Permutations and the Kolmogorov-Sinai entropy. Discrete and Continuous Dynamical Systems, 32(3):891–900, 2012. [22] K. Keller, M. Sinn, and J. Emonds. Time series from the ordinal viewpoint. Stochastics and Dynamics, 7(2):247–272, 2007. [23] K. Keller, A. M. Unakafov, and V. A. Unakafova. Ordinal patterns, entropy, and EEG. Entropy, 16(12):6212–6239, 2014. [24] A. Y. Kim, C. Marzban, D. B. Percival, and W. Stuetzle. Using labeled data to evaluate change detectors in a multivariate streaming environment. Signal Processing, 89(12):2529–2536, 2009. 31 [25] S. N. Lahiri. Resampling methods for dependent data. Springer, 2003. New York: [26] M. Lavielle. Detection of multiple changes in a sequence of dependent variables. Stochastic Processes and their Applications, 83(1):79–102, 1999. [27] M. Lavielle and G. Teyssière. Adaptive detection of multiple changepoints in asset price volatility. In G. Teyssière and A. P. Kirman, editors, Long Memory in Economics, pages 129–156. Berlin Heidelberg: Springer, 2007. [28] SJ Linz and M Lücke. Effect of additive and multiplicative noise on the first bifurcations of the logistic model. Physical Review A, 33(4):2694, 1986. [29] M. Lyubich. Forty years of unimodal dynamics: on the occasion of Artur Avila winning the Brin prize. Journal of Modern Dynamics, 6(2):183– 203, 2012. [30] H. N. Nagaraja. On the non-Markovian structure of discrete order statistics. Journal of Statistical Planning and Inference, 7:29–33, 1982. [31] A. M. Polansky. Detecting change-points in Markov chains. Computational Statistics & Data Analysis, 51(12):6013–6026, 2007. [32] B. Pompe. The LE-statistic. The European Physical Journal Special Topics, 222(2):333–351, 2013. [33] B. Pompe and J. Runge. Momentary information transfer as a coupling measure of time series. Physical Review E, 83:051122, 2011. [34] P. Preuss, R. Puchstein, and H. Dette. Detection of multiple structural breaks in multivariate time series. Journal of the American Statistical Association, 110(510):654–668, 2015. [35] A. Schnurr and H. Dehling. Testing for structural breaks via ordinal pattern dependence. arXiv preprint arXiv:1501.07858, 2015. [36] T. Schreiber and A. Schmitz. Surrogate time series. Physica D: Nonlinear Phenomena, 142(3):346–382, 2000. [37] Thomas Schreiber and Andreas Schmitz. Improved surrogate data for nonlinearity tests. Physical Review Letters, 77(4):635, 1996. [38] M. Sinn, A. Ghodsi, and K. Keller. Detecting change-points in time series by maximum mean discrepancy of ordinal pattern distributions. In Uncertainty in Artificial Intelligence, Proceedings of the 28th Conference, pages 786–794, 2012. 32 [39] M. Sinn and K. Keller. Estimation of ordinal pattern probabilities in fractional brownian motion. arXiv preprint arXiv:0801.1598, 2008. [40] M. Sinn and K. Keller. Estimation of ordinal pattern probabilities in gaussian processes with stationary increments. Computational Statistics & Data Analysis, 55(4):1781–1790, 2011. [41] M. Sinn, K. Keller, and B. Chen. Segmentation and classification of time series using ordinal pattern distributions. European Physical Journal Special Topics, 222(2):587–598, 2013. [42] D. S. Stoffer. Frequency Domain Techniques in the Analysis of DNA Sequences. In T. S. Rao, S. S. Rao, and C. R. Rao, editors, Handbook of Statistics: Time Series Analysis: Methods and Applications, pages 261–296. Elsevier, 2012. [43] J. Theiler, S. Eubank, A. Longtin, B. Galdrikian, and J.D. Farmer. Testing for nonlinearity in time series: the method of surrogate data. Physica D: Nonlinear Phenomena, 58(1-4):77–94, 1992. [44] H. Thunberg. Periodicity versus chaos in one-dimensional dynamics. SIAM Review, 43(1):3–30, 2001. [45] A. M. Unakafov. Ordinal-patterns-based segmentation and discrimination of time series with applications to EEG data. PhD thesis, University of Lübeck, 2015. [46] A. M. Unakafov and K. Keller. Conditional entropy of ordinal patterns. Physica D, 269:94–102, 2014. [47] V. A. Unakafova and K. Keller. Efficiently measuring complexity on the basis of real-world data. Entropy, 15(10):4392–4415, 2013. [48] L. Yu. Vostrikova. Detecting disorder in multidimensional random processes. Soviet Mathematics Doklady, 24(1):55–59, 1981. [49] Y.-J. Yuan, X. Wang, Z.-T. Huang, and Z.-C. Sha. Detection of Radio Transient Signal Based on Permutation Entropy and GLRT. Wireless Personal Communications, pages 1–11, 2015. 33
10math.ST
Firefighting on Trees Beyond Integrality Gaps David Adjiashvili∗ Andrea Baggio† Rico Zenklusen‡ arXiv:1601.00271v2 [cs.DS] 14 Mar 2016 March 15, 2016 Abstract The Firefighter problem and a variant of it, known as Resource Minimization for Fire Containment (RMFC), are natural models for optimal inhibition of harmful spreading processes. Despite considerable progress on several fronts, the approximability of these problems is still badly understood. This is the case even when the underlying graph is a tree, which is one of the most-studied graph structures in this context and the focus of this paper. In their simplest version, a fire spreads from one fixed vertex step by step from burning to adjacent non-burning vertices, and at each time step, B many non-burning vertices can be protected from catching fire. The Firefighter problem asks, for a given B, to maximize the number of vertices that will not catch fire, whereas RMFC (on a tree) asks to find the smallest B that allows for saving all leaves of the tree. Prior to this work, the best known approximation ratios were an O(1)-approximation for the Firefighter problem and an O(log∗ n)-approximation for RMFC, both being LP-based and essentially matching the integrality gaps of two natural LP relaxations. We improve on both approximations by presenting a PTAS for the Firefighter problem and an O(1)approximation for RMFC, both qualitatively matching the known hardness results. Our results are obtained through a combination of the known LPs with several new techniques, which allow for efficiently enumerating subsets of super-constant size of a good solution to obtain stronger LPs. 1 Introduction The Firefighter problem was introduced by Hartnell [24] as a natural model for optimal inhibition of harmful spreading phenomena on a graph. Despite considerable interest in the problem and progress on several fronts, our understanding of how well this and related problems can be approximated is still very limited. Interestingly, this is even true when the underlying graph is a spanning tree, which is one of the most-studied graph structures in this context and also the focus of this paper. The Firefighter problem on trees is defined as follows. We are given a graph G = (V, E) which is a spanning tree and a vertex r ∈ V , called root. The problem is defined over discretized time steps. At time 0, a fire starts at r and spreads step by step to neighboring vertices. During each time step 1, 2, . . . an arbitrary non-burning vertex u can be protected, preventing u from burning in any future time step. In its original form, the goal is to find a protection strategy minimizing the number of vertices that will catch fire. A closely related problem, called Resource Minimization for Fire Containment (RMFC) on trees, was introduced by Chalermsook and Chuzhoy [8]. Here the task is to determine the smallest number B ∈ Z>0 such that if one can protect B vertices at each time step (instead of just 1), then there is a protection strategy where none of the leaves of the tree catches fire. In this context, B is referred to as the number of firefighters. ∗ Department of Mathematics, ETH Zurich, Zurich, Switzerland. Email: [email protected]. Supported by Seed Project “Risk Protection in Complex Networks” of ETH Zurich Risk Center. † Department of Mathematics, ETH Zurich, Zurich, Switzerland. Email: [email protected]. Supported by EU grant FP7-PEOPLE-2012-ITN no. 316647, “Mixed-Integer Nonlinear Optimization”. ‡ Department of Mathematics, ETH Zurich, Zurich, Switzerland. Email: [email protected]. 1 Both the Firefighter problem and RMFC—both restricted to trees as defined above—are known to be computationally hard problems. More precisely, Finbow, King, MacGillivray and Rizzi [17] showed NPhardness for the Firefighter problem on trees with maximum degree three. For RMFC on trees, it is NP-hard to decide whether one firefighter, i.e., B = 1, is sufficient [27]; thus, unless P = NP, there is no (efficient) approximation algorithm with an approximation factor strictly better than 2. On the positive side, several approximation algorithms have been suggested for the Firefighter problem and RMFC. Hartnell and Li [25] showed that a natural greedy algorithm is a 12 -approximation for the Firefighter problem. This approximation guarantee was later improved by Cai, Verbin and Yang [6] to 1 − 1e , using a natural linear programming (LP) relaxation and dependent randomized rounding. It was later observed by Anshelevich, Chakrabarty, Hate and Swamy [1] that the Firefighter problem on trees can be interpreted as a monotone submodular function maximization (SFM) problem subject to a partition matroid constraint. This leads to alternative ways to obtain a (1 − 1e )-approximation by using a recent (1 − 1e )approximation for monotone SFM subject to a matroid constraint [34, 12]. The factor 1 − 1e was later only improved for various restricted tree topologies (see [26]) and hence, for arbitrary trees, this is the best known approximation factor to date. For RMFC on trees, Chalermsook and Chuzhoy [8] presented an O(log∗ n)-approximation, where n = |V | is the number of vertices.1 Their algorithm is based on a natural linear program which is a straightforward adaptation of the one used in [6] to get a (1 − 1e )-approximation for the Firefighter problem on trees. Whereas there are still considerable gaps between current hardness results and approximation algorithms for both the Firefighter problem and RMFC on trees, the currently best approximations essentially match the integrality gaps of the underlying LPs. More precisely, Chalermsook and Vaz [9] showed that for any ǫ > 0, the canonical LP used for the Firefighter problem on trees has an integrality gap of 1 − 1e + ǫ. This generalized a previous result by Cai, Verbin and Yang [6], who showed the same gap if the integral solution is required to lie in the support of an optimal LP solution. For RMFC on trees, the integrality gap of the underlying LP is Θ(log∗ n) [8]. It remained open to what extent these integrality gaps may reflect the approximation hardnesses of the problems. This question is motivated by two related problems whose hardnesses of approximation indeed matches the above-mentioned integrality gaps for the Firefighter problem and RMFC. In particular, many versions of monotone SFM subject to a matroid constraint—which we recall was shown in [1] to capture the Firefigther problem on trees as a special case—are hard to approximate up to a factor of 1 − 1/e + ǫ for any constant ǫ > 0. This includes the problem of maximizing an explicitly given coverage function subject to a single cardinality constraint, as shown by Feige [16]. Moreover, as highlighted in [8], the Asymmetric k-center problem is similar in nature to RMFC, and has an approximation hardness of Θ(log∗ n). The goal of this paper is to fill the gap between current approximation ratios and hardness results for the Firefighter problem and RMFC on trees. In particular, we present approximation ratios that nearly match the hardness results, thus showing that both problems can be approximated to factors that are substantially better than the integrality gaps of the natural LPs. Our results are based on several new techniques, which may be of independent interest. 1.1 Our results Our main results show that both the Firefighter problem and RMFC admit strong approximations that essentially match known hardness bounds, showing that approximation factors can be achieved that are substantially stronger than the integrality gaps of the natural LPs. In particular, we obtain the following result for RMFC. 1 log∗ n denotes the minimum number k of logs of base two that have to be nested such that log log . . . log n ≤ 1. | {z } k logs 2 Theorem 1. There is a 12-approximation for RMFC. Recalling that RMFC is hard to approximate within any factor better than 2, the above result is optimal up to a constant factor, and improves on the previously best O(log∗ n)-approximation of Chalermsook and Chuzhoy [8]. Moreover, our main result for the Firefighter problem is the following, which, in view of NP-hardness of the problem, is essentially best possible in terms of approximation guarantee. Theorem 2. There is a PTAS for the Firefighter problem on trees.2 Notice that the Firefighter problem does not admit an FPTAS3 unless P = NP, since the optimal value of any Firefighter problem on a tree of n vertices is bounded by O(n).4 We introduce several new techniques that allow us to obtain approximation factors well beyond the integrality gaps of the natural LPs, which have been a barrier for previous approaches. We start by providing an overview of these techniques. Despite the fact that we obtain approximation factors beating the integrality gaps, the natural LPs play a central role in our approaches. We start by introducing general transformations that allow for transforming the Firefighter problem and RMFC into a more compact and better structured form, only losing small factors in terms of approximability. These transformations by themselves do not decrease the integrality gaps. However, they allow us to identify small substructures, over which we can optimize efficiently, and having an optimal solution to these subproblems we can define a residual LP with small integrality gap. Similar high-level approaches, like guessing a constant-size but important subset of an optimal solution are well-known in various contexts to decrease integrality gaps of natural LPs. The best-known example may be classic PTASs for the knapsack problem, where the integrality gap of the natural LP can be decreased to an arbitrarily small constant by first guessing a constant number of heaviest elements of an optimal solution. However, our approach differs substantially from this standard enumeration idea. Apart from the above-mentioned transformations which, as we will show later, already lead to new results for both RMFC and the Firefighter problem, we will introduce new combinatorial approaches to gain information about a super-constant subset of an optimal solution. In particular, for the RMFC problem we define a recursive enumeration algorithm which, despite being very slow for enumerating all solutions, can be shown to reach a good subsolution within a small recursion depth that can be reached in polynomial time. This enumeration procedure explores the space step by step, and at each step we first solve an LP that determines how to continue the enumeration in the next step. We think that this LP-guided enumeration technique may be of independent interest. For the Firefighter problem, we use a well-chosen enumeration procedure to identify a polynomial number of additional constraints to be added to the LP, that improves its integrality gap to 1 − ǫ. 1.2 Further related results Iwaikawa, Kamiyama and Matsui [26] showed that the approximation guarantee of 1 − 1e can be improved for some restricted families of trees, in particular of low maximum degree. Anshelevich, Chakrabarty, Hate and Swamy [1] studied the approximability of the Firefighter problem in general graphs, which they prove admits no n1−ǫ -approximation for any ǫ > 0, unless P = NP. In a different model, where the protection also spreads through the graph (the Spreading Model), the authors show that the problem admits a polyno√ mial (1 − 1e )-approximation on general graphs. Moreover, for RMFC, an O( n)-approximation for general graphs and an O(log n)-approximation for directed layered graphs is presented. The latter result was obtained independently by Chalermsook and Chuzhoy [8]. Klein, Levcopoulos and Lingas [28] introduced a 2 A polynomial time approximation scheme (PTAS) is an algorithm that, for any constant ǫ > 0, returns in polynomial time a (1 − ǫ)-approximate solution. 3 A fully polynomial time approximation scheme (FPTAS) is a PTAS with running time polynomial in the input size and 1ǫ . 4 The nonexistence of FPTASs unless P = NP can often be derived easily from strong NP-hardness. Notice that the Firefighter problem is indeed strongly NP-hard because its input size is O(n), in which case NP-hardness is equivalent to strong NP-hardness. 3 geometric variant of the Firefighter problem, proved its NP-hardness and provided a constant-factor approximation algorithm. The Firefighter problem and RMFC are natural special cases of the Maximum Coverage Problem with Group Constraints (MCGC) [10] and the Multiple Set Cover problem (MSC) [14], respectively. The input in MCGC is a set system consisting of a finite set X of elements with nonnegative weights, a collection of subsets S = {S1 , · · · , Sk } of X and an integer k. The sets in S are partitioned into groups G1 , · · · , Gl ⊆ S. The goal is to pick a subset H ⊆ S of k sets from S whose union covers elements of total weight as large as possible with the additional constraint that |H ∩ Gj | ≤ 1 for all j ∈ [l] := {1, . . . , l}. In MSC, instead of the fixed bounds for groups and the parameter k, the goal is to choose a subset H ⊆ S that covers X completely, while minimizing maxj∈[l] |H ∩ Gj |. The Firefighter problem and RMFC can naturally be interpreted as special cases of the latter problems with a laminar set system S. The Firefighter problem admits polynomial time algorithms in some restricted classes of graphs. Finbow, King, MacGillivray and Rizzi [17] showed that, while the problem is NP-hard on trees with maximum degree three, when the fire starts at a vertex with degree two in a subcubic tree, the problem is solvable in polynomial time. Fomin, Heggernes and van Leeuwen [20] presented polynomial algorithms for interval graphs, split graphs, permutation graphs and Pk -free graphs. Several sub-exponential exact algorithms were developed for the Firefighter problem on trees. Cai, √ Verbin and Yang [6] presented a 2O( n log n) -time algorithm. Floderus, Lingas and Persson [19] presented a simpler algorithm with a slightly better running time, as well as a sub-exponential algorithm for general graphs in the spreading model and an O(1)-approximation in planar graphs under some further conditions. Additional directions of research on the Firefighter problem include parameterized complexity (Cai, Verbin and Yang [6], Bazgan, Chopin and Fellows [3], Cygan, Fomin and van Leeuwen [13] and Bazgan, Chopin, Cygan, Fellows, Fomin and van Leeuwen [2]), generalizations to the case of many initial fires and many firefighters (Bazgan, Chopin and Ries [4] and Costa, Dantas, Dourado, Penso and Rautenbach [11]), and the study of potential strengthenings of the canonical LP for the Firefighter problem on trees (Hartke [23] and Chalermsook and Vaz [9]). Computing the Survivability of a graph is a further problem closely related to Firefighting that has attracted considerable attention (see [7, 5, 31, 15, 21, 29]). For a graph G and a parameter k ∈ Z≥0 , the k-survivability of G is the average fraction of nodes that one can save with k firefighters in G, when the fire starts at a random node. For further references we refer the reader to the survey of Finbow and MacGillivray [18]. 1.3 Organization of the paper We start by introducing the classic linear programming relaxations for the Firefighter problem and RMFC in Section 2. Section 3 outlines our main techniques and algorithms. Some proofs and additional discussion are deferred to later sections, namely Section 4, providing details on a compression technique that is crucial for both our algorithms, Section 5, containing proofs for results related to the Firefighter problem, and Section 6, containing proofs for results related to RMFC. Finally, Appendix A contains some basic reductions showing how to reduce different variations of the Firefighter problem to each other. 2 Classic LP relaxations and preliminaries Interestingly, despite the fact that we obtain approximation factors considerably stronger than the known integrality gaps of the natural LPs, these LPs still play a central role in our approaches. We thus start by introducing the natural LPs together with some basic notation and terminology. Let L ∈ Z≥0 be the depth of the tree, i.e., the largest distance—in terms of number of edges—between r and any other vertex in G. Hence, after at most L time steps, the fire spreading process will halt. For 4 ℓ ∈ [L] := {1, . . . , L}, let Vℓ ⊆ V be the set of all vertices of distance ℓ from r, which we call the ℓ-th level of the instance. For brevity, we use V≤ℓ = ∪ℓk=1 Vk , and we define in the same spirit V≥ℓ , V<ℓ , and V>ℓ . Moreover, we denote by Γ ⊆ V the set of all leaves of the tree, and for any u ∈ V , the set Pu ⊆ V \ {r} denotes the set of all vertices on the unique u-r path except for the root r. The relaxation for RMFC used in [8] is the following: min B x(Pu ) ≥ 1 x(V≤ℓ ) ≤ B · ℓ V \{r} x ∈ R≥0 , ∀u ∈ Γ ∀ℓ ∈ [L] (LPRMFC ) P where x(U ) := u∈U x(u) for any U ⊆ V \ {r}. Indeed, if one enforces x ∈ {0, 1}V \{r} and B ∈ Z in the above relaxation, an exact description of RMFC is obtained where x is the characteristic vector of the vertices to be protected and B is the number of firefighters: The constraints x(Pu ) ≥ 1 for u ∈ Γ enforce that for each leaf u, a vertex between u and r will be protected, which makes sure that u will not be reached by the fire; moreover, the constraints x(V≤ℓ ) ≤ B · ℓ for ℓ ∈ [L] describe the vertex sets that can be protected given B firefighters per time step (see [8] for more details). Also, as already highlighted in [8], there is an optimal solution to RMFC (and also to the Firefighter problem), that protects with the firefighters available at time step ℓ only vertices in Vℓ . Hence, the above relaxation can be transformed into one with same optimal objective value by replacing the constraints x(V≤ℓ ) ≤ B · ℓ ∀ℓ ∈ [L] by the constraints x(Vℓ ) ≤ B ∀ℓ ∈ [L]. The natural LP relaxation for the Firefighter problem, which leads to the previously best (1 − 1/e)approximation presented in [6], is obtained analogously. Due to higher generality, and even more importantly to obtain more flexibility in reductions to be defined later, we work on a slight generalization of the Firefighter problem on trees, extending it in two ways: (i) Weighted version: vertices u ∈ V \ {r} have weights w(u) ∈ Z≥0 , and the goal is to maximize the total weight of vertices not catching fire. In the classical Firefighter problem all weights are one. (ii) General budgets/firefighters: We allow for having a different number of firefighters at each time step, say Bℓ ∈ Z>0 firefighters for time step ℓ ∈ [L].5 Indeed, the above generalizations are mostly for convenience of presentation, since general budgets can be reduced to unit budgets (see Appendix A for a proof): Lemma 3. Any weighted Firefighter problem on trees with n vertices and general budgets can be transformed efficiently into an equivalent weighted Firefighter problem with unit-budgets and O(n2 ) vertices. We also show in Appendix A that up to an arbitrarily small error in terms of objective, any weighted Firefighter instance can be reduced to a unit-weighted one. In what follows, we always assume to deal with a weighted Firefighter instance if not specified otherwise. Regarding the budgets, we will be explicit about whether we work with unit or general budgets, since some techniques are easier to explain in the unit-budget case, even though it is equivalent to general budgets by Lemma 3. An immediate extension of the LP relaxation for the unit-weighted unit-budget Firefighter problem used in [6]—which is based on an IP formulation presented in [30]—leads to the following LP relaxation for the weighted Firefighter problem with general budgets. For u ∈ V , we denote by Tu ⊆ V the set of all vertices in the subtree starting at u and including u, i.e., all vertices v such that the unique r-v path in G contains u. 5 Without loss of generality we exclude Bℓ = 0, since a level with zero budget can be eliminated through a simple contraction operation. For more details we refer to the proof of Theorem 4 which, as a sub-step, eliminates zero-budget levels. 5 max X u∈V \{r} xu w(Tu ) x(Pu ) ≤ 1 ℓ X Bi x(V≤ℓ ) ≤ ∀u ∈ Γ ∀ℓ ∈ [L] i=1 V \{r} x ∈ R≥0 (LPFF ) . The constraints x(Pu ) ≤ 1 exclude redundancies, i.e., a vertex u is forbidden of being protected if another vertex above it, on the r-u path, is already protected. This elimination of redundancies allows for writing the objective function as shown above. We recall that the integrality gap of LPRMFC was shown to be Θ(log∗ n) [8], and the integrality gap of LPFF is asymptotically 1 − 1/e (when n → ∞) [9]. Throughout the paper, all logarithms are of base 2 if not indicated otherwise. When using big-O and related notations (like Ω, Θ, . . .), we will always be explicit about the dependence on small error terms ǫ—as used when talking about (1 − ǫ)-approximations—and not consider it to be part of the hidden constant. To make statements where ǫ is part of the hidden constant, we will use the notation Oǫ and likewise Ωǫ , Θǫ , . . .. 3 Overview of techniques and algorithms In this section, we present our main technical contributions and outline our algorithms. We start by introducing a compression technique in Section 3.1 that works for both RMFC and the Firefighter problem and allows for transforming any instance to one on a tree with only logarithmic depth. One key property we achieve with compression, is that we can later use (partial) enumeration techniques with exponential running time in the depth of the tree. However, compression on its own already leads to interesting results. In particular, it allows us to obtain a QPTAS for the Firefighter problem, and a quasipolynomial time 2approximation for RMFC.6 However, it seems highly non-trivial to transform these quasipolynomial time procedures to efficient ones. To obtain the claimed results, we develop two (partial) enumeration methods to reduce the integrality gap of the LP. In Section 3.2, we provide an overview of our PTAS for the Firefighter problem, and Section 3.3 presents our O(1)-approximation for RMFC. 3.1 Compression Compression is a technique that is applicable to both the Firefighter problem and RMFC. It allows for reducing the depth of the input tree at a very small loss in the objective. We start by discussing compression in the context of the Firefighter problem. To reduce the depth of the tree, we will first do a sequence of what we call down-pushes. Each downpush acts on two levels ℓ1 , ℓ2 ∈ [L] with ℓ1 < ℓ2 of the tree, and moves the budget Bℓ1 of level ℓ1 down to ℓ2 , i.e., the new budget of level ℓ2 will be Bℓ1 + Bℓ2 , and the new budget of level ℓ1 will be 0. Clearly, down-pushes only restrict our options for protecting vertices. However, we can show that one can do a sequence of down-pushes such that first, the optimal objective value of the new instance is very close to the one of the original instance, and second, only O(log L) levels have non-zero budgets. Finally, levels with 0-budget can easily be removed through a simple contraction operation, thus leading to a new instance with only O(log L) depth. 6 The running time of an algorithm is quasipolynomial if it is of the form 2polylog(hinputi) , where hinputi is the input size of the problem. A QPTAS is an algorithm that, for any constant ǫ > 0, returns a (1 − ǫ)-approximation in quasipolynomial time. 6 Theorem 4 below formalizes our main compression result for the Firefighter problem, which we state for unit-budget Firefighter instances for simplicity. Since Lemma 3 implies that every general-budget Firefighter instance with n vertices can be transformed into a unit-budget Firefighter instance with O(n2 ) vertices—and thus O(n2 ) levels—Theorem 4 can also be used to reduce any Firefighter instance on n vertices to one with O( logδ n ) levels, by losing a factor of at most 1 − δ in terms of objective. Theorem 4. Let I be a unit-budget Firefighter instance on a tree with depth L, and let δ ∈ (0, 1). Then one can efficiently construct a general budget Firefighter instance I with depth L′ = O( logδ L ), and such that the following holds, where val(OPT(I)) and val(OPT(I)) are the optimal values of I and I, respectively. (i) val(OPT(I)) ≥ (1 − δ) val(OPT(I)), and (ii) any solution to I can be transformed efficiently into a solution of I with same objective value. For RMFC we can use a very similar compression technique leading to the following. Theorem 5. Let G = (V, E) be a rooted tree of depth L. Then one can construct efficiently a rooted tree G′ = (V ′ , E ′ ) with |V ′ | ≤ |V | and depth L′ = O(log L), such that: (i) If the RMFC problem on G has a solution with budget B ∈ Z>0 at each level, then the RMFC problem on G′ with non-uniform budgets, where level ℓ ≥ 1 has a budget of Bℓ = 2ℓ · B, has a solution. (ii) Any solution to the RMFC problem on G′ , where level ℓ has budget Bℓ = 2ℓ · B, can be transformed efficiently into an RMFC solution for G with budget 2B. Interestingly, the above compression results already allow us to obtain strong quasipolynomial approximation algorithms for the Firefighter problem and RMFC, using dynamic programming. Consider for example the RMFC problem. We can first guess the optimal budget B, which can be done efficiently since B ∈ {1, . . . , n}. Consider now the instance G′ claimed by Theorem 5 with budgets Bℓ = 2ℓ B. By Theorem 5, this RMFC instance is feasible and any solution to it can be converted to one of the original RMFC problem with budget 2B. It is not hard to see that, for the fixed budgets Bℓ , one can solve the RMFC problem on G′ in quasipolynomial time using a bottom-up dynamic programming approach. More precisely, starting with the leaves and moving up to the root, we compute for each vertex u ∈ V the following table. Consider a subset of the available budgets, which can be represented as a vector q ∈ [B1 ] × · · · × [BL′ ]. For each such vector q we want to know whether or not using the sub-budget described by q allows for disconnecting u from all leaves below it. Since L′ = O(log L) and the size of each budget Bℓ is at most the number of vertices, the table size is quasipolynomial. Moreover, one can check that these tables can be constructed bottom-up in quasipolynomial time. Hence, this approach leads to a quasipolynomial time 2-approximation for RMFC. We recall that there is no efficient approximation algorithm with an approximation ratio strictly below 2, unless P = NP. A similar dynamic programming approach for the Firefighter problem on a compressed instance leads to a QPTAS. However, our focus is on efficient algorithms, and it seems non-trivial to transform the above quasipolynomial time dynamic programming approaches into efficient procedures. To obtain our results, we therefore combine the above compression techniques with further approaches to be discussed next. 3.2 Overview of PTAS for Firefighter problem Despite the fact that LPFF has a large integrality gap —which can be shown to be the case even after compression7 —it is a crucial tool in our PTAS. Consider a general-budget Firefighter instance, and let x be a vertex solution to LPFF . We say that a vertex u ∈ V \ {r} is x-loose, or simply loose, if u ∈ supp(x) := {v ∈ V \ {r} | x(v) > 0} and x(Pu ) < 1. Analogously, we call a vertex u ∈ V \ {r} x-tight, or simply 7 This follows from the fact that through compression with some parameter δ ∈ (0, 1), both the optimal value and optimal LP value change at most by a δ-fraction. 7 tight, if u ∈ supp(x) and x(Pu ) = 1. Hence, supp(x) can be partitioned into supp(x) = V L ∪ V T , where V L and V T are the set of all loose and tight vertices, respectively. Using a sparsity argument for vertex solutions of LPFF we can bound the number of x-loose vertices. Lemma 6. Let x be a vertex solution to LPFF for a Firefighter problem with general budgets. Then the number of x-loose vertices is at most L, the depth of the tree. Having a vertex solution x to LPFF , we can consider a simplified LP obtained from LPFF by only allowing to protect vertices that are x-tight. A simple yet useful property of x-tight vertices is that for any u, v ∈ V T with u 6= v we have u 6∈ Pv . Indeed, if u ∈ Pv , then x(Pu ) ≤ x(Pv ) − x(v) < x(Pv ) = 1 because x(v) > 0. Hence, no two tight vertices lie on the same leaf-root path. Thus, when restricting LPFF to V T , the path constraints x(Pu ) ≤ 1 for u ∈ Γ transform into trivial constraints requiring x(v) ≤ 1 for v ∈ V T , and one can easily observe that the resulting constraint system is totally unimodular because it describes a laminar matroid constraint given by the budget constraints (see [33, Volume B] for more details on of objective value at least P matroid optimization). P Re-optimizing over this LP we get an integral solution T is still feasible for the new LP. x w(T ), because the restriction of x to V x w(T ) − L u u u u u∈V \{r} u∈V P In particular, if u∈V L xu w(Tu ) was at most ǫ · val(OPT), where val(OPT) is the optimal value of the instance, then this would lead to a PTAS. Clearly, this is not true in general, since it would contradict the (1 − 1e )-integrality gap of LPFF . In the following, we will present techniques to limit the loss in terms of LP-value when re-optimizing only over variables corresponding to tight vertices V T . Notice that when we work with a compressed instance, by first invoking Theorem 4 with δ = ǫ, we have |V L | = O( logǫ N ), where N is the number of vertices in the original instance. Hence, a PTAS would be 2 achieved if for all u ∈ V L , we had w(Tu ) = Θ( logǫ N ) · val(OPT). One way to achieve this in quasipolyno- mial time is to first guess a subset of Θ( logǫ2N ) many vertices of an optimal solution with highest impact, i.e., among all vertices u ∈ OPT we guess those with largest w(Tu ). This techniques has been used in various other settings (see for example [32, 22] for further details) and leads to another QPTAS for the Firefighter problem. Again, it is unclear how this QPTAS could be turned into an efficient procedure. The above discussion motivates to investigate vertices u ∈ V \ {r} with w(Tu ) ≥ η for some η = 2 Θ( logǫ N ) val(OPT). We call such vertices heavy; later, we will provide an explicit definition of η that does not depend on the unknown val(OPT) and is explicit about the hidden constant. Let H = {u ∈ V \ {r} | w(u) ≥ η} be the set of all heavy vertices. Observe that G[H ∪ {r}]—i.e., the induced subgraph of G over the vertices H ∪ {r}—is a subtree of G, which we call the heavy tree. Recall that by the above discussion, if we work on a compressed instance with L = O( logǫ N ) levels, and if an optimal vertex solution to LPFF has no loose vertices that are heavy, then an integral solution can be obtained of value at least 1 − ǫ times the LP value. Hence, if we were able to guess the heavy vertices contained in an optimal solution, the integrality gap of the reduced problem would be small since no heavy vertices are left in the LP, and can thus not be loose anymore. Whereas there are too many options to enumerate over all possible subsets of heavy vertices that an optimal solution may contain, we will do a coarser enumeration. More precisely, we will partition the heavy vertices into Oǫ (log N ) subpaths and guess for each subpath whether it contains a vertex of OPT. For this to work out we need that the heavy tree has a very simple topology; in particular, it should only have Oǫ (log N ) leaves. Whereas this does not hold in general, we can enforce it by a further transformation making sure that OPT saves a constant-fraction of w(V ) which—as we will observe next—indeed limits the number of leaves of the heavy tree to Oǫ (log N ). Furthermore, this transformation is useful to complete our definition of heavy vertices by explicitly defining the threshold η. Lemma 7. Let I be a general-budget Firefighter instance on a tree G = (V, E) with weights w. Then for any λ ∈ Z≥1 , one can efficiently construct a new Firefighter instance I on a subtree G′ = (V ′ , E ′ ) of G with same budgets, by starting from I and applying node deletions and weight reductions, such that 8  (i) val(OPT(I)) ≥ 1 − λ1 val(OPT(I)), and (ii) val(OPT(I)) ≥ λ1 w′ (V ′ ), where w′ ≤ w are the vertex weights in instance I. The deletion of u ∈ V corresponds to removing the whole subtree below u from G, i.e., all vertices in Tu . Since Lemma 7 constructs a new instance using only node deletions and weight reductions, any solution to the new instance is also a solution to the original instance of at least the same objective value. Our PTAS for the Firefighter problem first applies the compression Theorem 4 with δ = ǫ/3 and then Lemma 7 with λ = ⌈ 3ǫ ⌉ to obtain a general budget Firefighter instance on a tree G = (V, E). We summarize the properties of this new instance G = (V, E) below. As before, to avoid confusion, we denote by N the number of vertices of the original instance. Property 8. (i) The depth L of G satisfies L = O( logǫ N ). (ii) val(OPT) ≥ ⌈ 3ǫ ⌉−1 w(V ) ≥ 14 ǫw(V ). (iii) The optimal value val(OPT) of the new instance is at least a (1 − 32 ǫ)-fraction of the optimal value of the original instance. (iv) Any solution to the new instance can be transformed efficiently into a solution of the original instance of at least the same value. Hence, to obtain a PTAS for the original instance, it suffices to obtain, for any ǫ > 0, a (1 − 3ǫ )approximation for an instance satisfying Property 8. In what follows, we assume to work with an instance satisfying Property 8 and show that this is possible. Due to the lower bound on val(OPT) provided by Property 8, we now define the threshold η = Θ( logǫ N ) val(OPT) in terms of w(V ) by η= 1 ǫ2 w(V ), 12 L which implies that we can afford losing L times a weight of η, which will sum up to a total loss of at most 1 1 2 12 ǫ w(V ) ≤ 3 ǫ val(OPT), where the inequality is due to Property 8. Consider again the heavy tree G[H ∪{r}]. Due to Property 8 its topology is quite simple. More precisely, the heavy tree has only O( logǫ3N ) leaves. Indeed, each leaf u ∈ H of the heavy tree fulfills w(Tu ) ≥ η, and two different leaves u1 , u2 ∈ H satisfy Tu1 ∩ Tu2 = ∅; since the total weight of the tree is w(V ), the heavy tree has at most w(V )/η = 12L/ǫ2 = O( logǫ3N ) many leaves. In the next step, we define a well-chosen small subset Q of heavy vertices whose removal (together with r) from G will break G into components of weight at most η. Simultaneously, we choose Q such that removing it together with r from the heavy tree breaks it into paths, over which we will do an enumeration later. Lemma 9. One can efficiently determine a set Q ⊆ H satisfying the following. (i) |Q| = O( logǫ3N ). (ii) Q contains all leaves and all vertices of degree at least 3 of the heavy tree, except for the root r. (iii) Removing Q ∪ {r} from G leads to a graph G[V \ (Q ∪ {r})] where each connected component has vertices whose weight sums up to at most η. For each vertex q ∈ Q, let Hq ⊆ H be all vertices that are visited when traversing the path Pq from q to r until (but not including) the next vertex in Q ∪ {r}. Hence, Hq is a subpath of the heavy tree such that Hq ∩ Q = {q}, which we call for brevity a Q-path. Moreover the set of all Q-paths partitions H. We use an enumeration procedure to determine on which Q-paths to protect a vertex. Since Q-paths are subpaths of leaf-root paths, we can assume that at most one vertex is protected in each Q-path. Our 9 algorithm enumerates over all 2|Q| possible subsets Z ⊆ Q, where Z represents the Q-paths on which we will protect a vertex. Incorporating this guess into LPFF , we get the following linear program LPFF (Z): X max xu w(Tu ) u∈V \{r} x(Pu ) ≤ 1 ℓ X Bi x(V≤ℓ ) ≤ i=1 x(Hq ) = 1 x(Hq ) = 0 V \{r} x ∈ R≥0 . ∀u ∈ Γ ∀ℓ ∈ [L] (LPFF (Z)) ∀q ∈ Z ∀q ∈ Q \ Z We start with a simple observation regarding LPFF (Z). Lemma 10. The polytope over which LPFF (Z) optimizes is a face of the polytope describing the feasible region of LPFF . Consequently, any vertex solution of LPFF (Z) is a vertex solution of LPFF . Proof. The statement immediately follows by observing that for any q ∈ Q, the inequalities x(Hq ) ≤ 1 and x(Hq ) ≥ 0 are valid inequalities for LPFF . Notice that x(Hq ) ≤ 1 is a valid inequality for LPFF because Hq is a subpath of a leaf-root path, and the load on any leaf-root path is limited to 1 in LPFF . Analogously to LPFF we define loose and tight vertices for a solution to LPFF (Z). A crucial implication of Lemma 10 is that Lemma 6 also applies to any vertex solution of LPFF (Z). We will show in the following that for any choice of Z ⊆ Q, the integrality gap of LPFF (Z) is small and we can efficiently obtain an integral solution of nearly the same value as the optimal value of LPFF (Z). Our PTAS then follows by enumerating all Z ⊆ Q and considering the set Z ⊆ Q of all Q-paths on which OPT protects a vertex. The low integrality gap of LPFF (Z) will follow from the fact that we can now limit the impact of loose vertices. More precisely, any loose vertex outside of the heavy tree has LP contribution at most η by definition of the heavy tree. Furthermore, for each loose vertex u on the heavy tree, which lies on some Q-path Hq , its load x(u) can be moved to the single tight vertex on Hq . As we will show, such a load redistribution will decrease the LP-value by at most η, due to our choice of Q. We are now ready to state our (1 − 3ǫ )-approximation for an instance satisfying Property 8, which, as discussed, implies a PTAS for the Firefighter problem. Algorithm 1 describes our (1 − 3ǫ )-approximation. Algorithm 1: A (1− 3ǫ )-approximation for a general-budget Firefighter instance satisfying Property 8. 1. Determine heavy vertices H = {u ∈ V | w(Tu ) ≥ η}, where η = 1 ǫ2 12 L w(V ). 2. Compute Q ⊆ H using Lemma 9. 3. For each Z ⊆ Q, obtain an optimal vertex solution to LPFF (Z). Let Z ∗ ⊆ Q be a set for which the optimal value of LPFF (Z∗ ) is largest among all subsets of Q, and let x be an optimal vertex solution to LPFF (Z∗ ). 4. Let V T be the x-tight vertices. Obtain an optimal vertex solution to LPFF restricted to variables corresponding to vertices in V T . The solution will be a {0, 1}-vector, being the characteristic vector of a set U ⊆ V T which we return. The following statement completes the proof of Theorem 2. 10 Theorem 11. For any general-budget Firefighter instance satisfying Property 8, Algorithm 1 computes efficiently a feasible set of vertices U ⊆ V \ {r} to protect that is a (1 − 3ǫ )-approximation. Proof. First observe that the linear program solved in step 4 will indeed lead to a characteristic vector with only {0, 1}-components. This is the case since no two x-tight vertices can lie on the same leaf-root path. Hence, as discussed previously, the linear program LPFF restricted to variables corresponding to V T is totally unimodular; indeed, the leaf-root path constraints x(Pu ) ≤ 1 for u ∈ Γ reduce to x(v) ≤ 1 for v ∈ V T , and the remaining LP corresponds to a linear program over a laminar matroid, reflecting the budget constraints. Moreover, the set U is clearly budget-feasible since the budget constraints are enforced by LPFF . Also, Algorithm 1 runs in polynomial time because |Q| = O( logǫ3N ) by Lemma 9 and hence, the 1 number of subsets of Q is bounded by N O( ǫ3 ) . It remains to show that U is a (1 − 3ǫ )-approximation. Let OPT be an optimal solution to the considered Firefighter instance with value val(OPT). Observe first that the value ν ∗ of LPFF (Z∗ ) satisfies ν ∗ ≥ val(OPT), because one of the sets Z ⊆ Q corresponds to OPT, namely Z = {q ∈ Q | Hq ∩OPT 6= ∅}, and for this Z the characteristic vector χOPT ∈ {0, 1}V \{r} of OPT is feasible for LPFF (Z). We complete the proof of Theorem 11 by showing that the value val(U ) of U satisfies val(U ) ≥ (1 − 3ǫ )ν ∗ . For this we show how to transform an optimal solution x of LPFF (Z∗ ) into a solution y to LPFF (Z∗ ) with supp(y) ⊆ V T and such that the objective value val(y) of y satisfies val(y) ≥ (1 − 3ǫ )ν ∗ . Let V L ⊆ supp(x) be the set of x-loose vertices, and let H be all heavy vertices, as usual. To obtain y, we start with y = x and first set y(u) = 0 for each u ∈ V L \ H. Moreover, for each u ∈ V L ∩ H we do the following. Being part of the heavy vertices and fulfilling x(u) > 0, the vertex u lies on some Q-path Hqu for some qu ∈ Z ∗ . Because x(Hqu ) = 1, there is a tight vertex v ∈ Hqu . We move the y-value from vertex u to vertex v, i.e., y(v) = y(v) + y(u) and y(u) = 0. This finishes the construction of y. Notice that y is feasible for LPFF (Z∗ ), because it was obtained from x by reducing values and moving values to lower levels. To upper bound the reduction of the LP-value when transforming x into y, we show that the modification done for each loose vertex u ∈ V L decreased the LP-value by at most η. Clearly, for each u ∈ V L \ H, since u is not heavy we have w(Tu ) ≤ η; thus setting y(u) = 0 will have an impact of at most η on the LP value. Similarly, for u ∈ V L ∩ H, moving the y-value of u to qu decreases the LP objective value by y(u) · (w(Tu ) − w(Tv )) ≤ w(Tu ) − w(Tv ) = w(Tu \ Tv ) ≤ η, where the last inequality follows by observing that Tu \ Tv ⊆ Tu \ Tqu are vertices in the same connected component of G[V \ (Q ∪ {r})], and thus have a total weight of at most η by Lemma 9. Hence, val(x) − val(y) ≤ |V L | · η ≤ L · η, where the second inequality follows by Property 8. This completes the proof by observing that |V L | ≤ L by Lemma 6, and thus val(y) = val(x) + (val(y) − val(x)) ≥ val(OPT) + val(y) − val(x) ≥ val(OPT) − L · η   1 1 2 = val(OPT) − ǫ w(V ) ≥ 1 − ǫ val(OPT), 12 3 where the last inequality is due to Property 8. 3.3 Overview of O(1)-approximation for RMFC Also our O(1)-approximation for RMFC uses the natural LP, i.e, LPRMFC , as a crucial tool to guide the algorithm. Throughout this section we will work on a compressed instance G = (V, E) of RMFC, obtained through Theorem 5. Hence, the number of levels is L = O(log N ), where N is the number of vertices of 11 the original instance. Furthermore, the budget on level ℓ ∈ [L] is given by Bℓ = 2ℓ B. The advantage of working with a compressed instance for RMFC is twofold. First, we will again apply sparsity reasonings to limit in certain settings the number of loose (badly structured) vertices by the number of levels of the instance. Second, the fact that low levels—i.e., levels far away from the root—have high budget, will allow us to protect a large number of loose vertices by only increasing B by a constant. For simplicity, weP work with a slight variation of LPRMFC , where we replace, for ℓ ∈ [L], the budget constraints x(V≤ℓ ) ≤ ℓi=1 Bi by x(Vℓ ) ≤ Bℓ . For brevity, we define n o V \{r} PB = x ∈ R≥0 x(Vℓ ) ≤ B · 2ℓ ∀ℓ ∈ [L] . As previously mentioned (and shown in [8]), the resulting LP is equivalent to LPRMFC . Furthermore, since the budget B for a feasible RMFC solution has to be chosen integral, we require B ≥ 1. Hence, the resulting linear relaxation asks to find the minimum B ≥ 1 such that the following polytope is non-empty: n o V \{r} P̄B = PB ∩ x ∈ R≥0 x(Pu ) ≥ 1 ∀u ∈ Γ . We start by discussing approaches to partially round a fractional point x ∈ P̄B , for some fixed budget B ≥ 1. Any leaf u ∈ Γ is fractionally cut off from the root through the x-values on Pu . A crucial property we derive and exploit is that leaves that are (fractionally) cut off from r largely on low levels, i.e., there is high x-value on Pu on vertices far away from the root, can be cut off from the root via a set of vertices to be protected that are budget-feasible when increasing B only by a constant. To exemplify the above statement, consider the level h = ⌊log L⌋ as a threshold to define top levels Vℓ as those with indices ℓ ≤ h and bottom levels when ℓ > h. For any leaf u ∈ Γ, we partition the path Pu into its top part Pu ∩ V≤h and its bottom part Pu ∩ V>h . Consider all leaves that are cut off in bottom levels by at least 0.5 units: W = {u ∈ Γ | x(Pu ∩ V>h ) ≥ 0.5}. We will show that there is a subset of vertices R ⊆ V>h on bottom levels to be protected that is feasible for budget B̄ = 2B + 1 ≤ 3B and cuts off all leaves in W from the root. We provide a brief sketch why this result holds, and present a formal proof later. If we set all entries of x on top levels V≤h to zero, we get a vector y with supp(y) ⊆ V>h such that y(Pu ) ≥ 0.5 for u ∈ W . Hence, 2y fractionally cuts off all vertices in W from the root and is feasible for budget 2B. To increase sparsity, we can replace 2y by a vertex z̄ of the polytope n o V \{r} Q = z ∈ R≥0 z(Vℓ ) ≤ 2B · 2ℓ ∀ℓ ∈ [L], z(V≤h ) = 0, z(Pu ) ≥ 1 ∀u ∈ W , which describes possible ways to cut off W from r only using levels V>h , and Q is non-empty since 2y ∈ Q. Exhibiting a sparsity reasoning analogous to the one used for the Firefighter problem, we can show that z has no more than L many z-loose vertices. Thus, we can first include all z-loose vertices in the set R of vertices to be protected by increasing the budget of each level ℓ > h by at most L ≤ 2h+1 ≤ 2ℓ . The remaining vertices in supp(z) are well structures (no two of them lie on the same leaf-root path), and an integral solution can be obtained easily. The new budget value is B̄ = 2B + 1, where the “+1” term pays for the loose vertices. The following theorem formalizes the above reasoning and generalizes it in two ways. First, for a leaf u ∈ Γ to be part of W , we required it to have a total x-value of at least 0.5 within the bottom levels; we will allow for replacing 0.5 by an arbitrary threshold µ ∈ (0, 1]. Second, the level h defining what is top and bottom can be chosen to be of the form h = ⌊log(q) L⌋ for q ∈ Z≥0 , where log(q) L := log log . . . log L is the value obtained by taking q many logs of L, and by convention we set log(0) L := L. The generalization in terms of h can be thought of as iterating the above procedure on the RMFC instance restricted to V≤h . Theorem 12. Let B ∈ R≥1 , µ ∈ (0, 1], q ∈ Z≥1 , and h = ⌊log(q) L⌋. Let x ∈ PB with supp(x) ⊆ V>h , and we define W = {u ∈ Γ | x(Pu ) ≥ µ}. Then one can efficiently compute a set R ⊆ V>h such that 12 (i) R ∩ Pu 6= ∅ ∀u ∈ W , and (ii) χR ∈ PB ′ , where B ′ = µq B + 1 and χR ∈ {0, 1}V \{r} is the characteristic vector of R. Theorem 12 has several interesting consequences. It immediately implies an LP-based O(log∗ N )approximation for RMFC, thus matching the currently best approximation result by Chalermsook and Chuzhoy [8]: It suffices to start with an optimal LP solution B ≥ 1 and x ∈ P̄B and invoke the above theorem with µ = 1, q = 1 + log∗ L. Notice that by definition of log∗ we have log∗ L = min{α ∈ Z≥0 | ∗ log(α) L ≤ 1}; hence h = ⌊log(1+log L) L⌋ = 0, implying that all levels are bottom levels. Since the integrality gap of the LP is Ω(log∗ N ) = Ω(log∗ L), Theorem 12 captures the limits of what can be achieved by techniques based on the standard LP. Interestingly, Theorem 12 also implies that the Ω(log∗ L) integrality gap is only due to the top levels of the instance. More precisely, if, for any q = O(1) and h = ⌊log(q) L⌋, one would know what vertices an optimal solution R∗ protects within the levels V≤h , then a constant-factor approximation for RMFC follows easily by solving an LP on the bottom levels V>h and using Theorem 12 with µ = 1 to round the obtained solution. Also, using Theorem 12 it is not hard to find constant-factor approximation algorithms for RMFC if the optimal budget BOPT is large enough, say B ≥ log L.8 The main idea is to solve the LP and define h = ⌊log L⌋. Leaves that are largely cut off by x on bottom levels can be handled using Theorem 12. For the remaining leaves, which are cut off mostly on top levels, we can resolve an LP only on the top levels V≤h to cut them off. This LP solution is sparse and contains at most h ≤ B loose nodes. Hence, all loose vertices can be selected by increasing the budget by at most h ≤ B, leading to a well-structured residual problem for which one can easily find an integral solution. The following theorem summarizes this discussion. A formal proof for Theorem 13 can be found in Section 6. Theorem 13. There is an efficient algorithm that computes a feasible solution to a (compressed) instance of RMFC with budget B ≤ 3 · max{log L, BOPT }. In what follows, we therefore assume BOPT < log L and present an efficient way to partially enumerate vertices to be protected on top levels, leading to the claimed O(1)-approximation. Partial enumeration algorithm Throughout our algorithm, we set h = ⌊log(2) L⌋ to be the threshold level defining top vertices V≤h and bottom vertices V>h . Within our enumeration procedure we will solve LPs where we explicitly include some vertex set A ⊆ V≤h to be part of the protected vertices, and also exclude some set D ⊆ V≤h from being protected. Our enumeration works by growing the sets A and D throughout the algorithm. We thus define the following LP for two disjoint sets A, D ⊆ V≤h : min B x B x(u) x(u) ∈ ≥ = = P̄B 1 1 0 (LP(A, D)) ∀u ∈ A ∀u ∈ D . Notice that LP(A, D) is indeed an LP even though the definition of P̄B depends on B (but it does so linearly). 8 Actually, the argument we present in the following works for any B = log(O(1)) L. However, we later only need it for B ≥ log L and thus focus on this case. 13 Throughout our enumeration procedure, the disjoint sets A, D ⊆ V≤h that we consider are always such that for any u ∈ A ∪ D, we have Pu \ {u} ⊆ D. In other words, the vertices A ∪ D ∪ {r} form the vertex set of a subtree of G such that no root-leaf path contains two vertices in A. We call a disjoint pair of sets A, D ⊆ V≤h with this property a clean pair. Before formally stating our enumeration procedure, we briefly discuss the main idea behind it. Let OPT ⊆ V \ {r} be an optimal solution to our (compressed) RMFC instance corresponding to some budget BOPT ∈ Z≥1 . We assume without loss of generality that OPT does not contain redundancies, i.e., there is precisely one vertex of OPT on each leaf-root path. Assume that we already guessed some clean pair A, D ⊆ V≤h of vertex sets to be protected and not to be protected, respectively, and that this guess is compatible with OPT, i.e., A ⊆ OPT and D ∩ OPT = ∅. Let (x, B) be an optimal solution to LP(A, D). Because we assume that the sets A and D are compatible with OPT, we have B ≤ BOPT because (BOPT , χOPT ) is feasible for LP(A, D). We define   2 Wx = u ∈ Γ x(Pu ∩ V>h ) ≥ 3 to be the set of leaves cut off from the root by an x-load of at least µ = 23 within bottom levels. For each u ∈ Γ \ Wx , let fu ∈ V≤h be the vertex closest to the root among all vertices in (Pu ∩ V≤h ) \ D, and we define Fx = {fu | u ∈ Γ \ Wx } \ A. (1) Notice that by definition, no two vertices of Fx lie on the same leaf-root path. Furthermore, every leaf u ∈ Γ \ Wx is part of the subtree Tf for precisely one f ∈ Fx . The main motivation for considering Fx is that to guess vertices in top levels, we can show that it suffices to focus on vertices lying below some vertex in Fx , i.e., vertices in the set Qx = V≤h ∩ (∪f ∈Fx Tf ). To exemplify this, we first consider the special case OPT ∩ Qx = ∅, which will also play a central role later in the analysis of our algorithm. We show that for this case we can get an O(1)-approximation to RMFC, even though we may only have guessed a proper subset A ( OPT ∩ V≤h of the OPT-vertices within the top levels. Lemma 14. Let (A, D) be a clean pair of vertices that is compatible with OPT, i.e., A ⊆ OPT, D ∩ OPT = ∅, and let x be an optimal solution to LP(A, D). Moreover, let (y, B̄) be an optimal solution to LP(A, V≤h \ A). Then, if OPT ∩ Qx = ∅, we have B̄ ≤ 52 BOPT . Furthermore, if OPT ∩ Qx = ∅, by applying Theorem 12 to y ∧ χV>h with µ = 1 and q = 2, a set R ⊆ V>h is obtained such that R ∪ A is a feasible solution to RMFC with respect to the budget 6 · BOPT .9 Proof. Notice that OPT ∩ Qx = ∅ implies that for each u ∈ Γ \ Wx , we either have A ∩ Pu 6= ∅ and thus a vertex of A cuts u off from the root, or the set OPT contains a vertex on Pu ∩ V>h . Indeed, consider a leaf u ∈ Γ \ Wx such that A ∩ Pu = ∅. Then OPT ∩ Qx = ∅ implies that no vertex of Tfu ∩ V≤h is part of OPT. Furthermore, Pfu \ Tfu ⊆ D because (A, D) is a clean pair and fu is the topmost vertex on Pu that is not in D. Therefore, OPT ∩ Pu ∩ V≤h = ∅, and since OPT must contain a vertex in Pu , we must have OPT ∩ Pu ∩ V>h 6= ∅. However, this observation implies that z = 32 (x ∧ χV>h ) + (χOPT ∧ χV>h ) + χA satisfies z(Pu ) ≥ 1 for all u ∈ Γ. Moreover we have z ∈ P 3 B+BOPT due to the following. First, x ∧ χV>h ∈ PB and 2 χOPT ∈ PBOPT , which implies z − χA ∈ P 3 B+BOPT . Furthermore, χA ∈ PB , and the vertices in A are all 2 on levels V≤h which are disjoint from the levels on which vertices in supp(z − χA ) ⊆ V>h lie, and thus do not compete for the same budget. Hence, (z, 32 B + BOPT ) is feasible for LP(A, V≤h \ A), and thus B̄ ≤ 23 B + BOPT ≤ 25 BOPT , as claimed. 9 For two vectors a, b ∈ Rn we denote by a ∧ b ∈ Rn the component-wise minimum of a and b. 14 The second part of the lemma follows in a straightforward way from Theorem 12. Observe first that each leaf u ∈ Γ is either fully cut off from the root by y on only top levels or only bottom levels because y is a {0, 1}-solution on the top levels V≤h , since on top levels it was fixed to χA because it is a solution to LP(A, V≤h \ A). Reusing the notation in Theorem 12, let W = {u ∈ Γ | (y ∧ χV>h )(Pu ) ≥ 1} be all leaves cut off from the root by y ∧ χV>h . By the above discussion, every leaf is thus either part of W or it is cut off from the root by vertices in A. Theorem 12 guarantees that R ⊆ V>h cuts off all leaves in W from the root, and hence, R ∪ A indeed cuts off all leaves from the root. Moreover, by Theorem 12, the set R ⊆ V>h is feasible with respect to the budget 5BOPT + 1 ≤ 6BOPT . Furthermore, A is feasible for budget BOPT because it is a subset of OPT. Since A ⊆ V≤h and R ⊆ V>h are on disjoint levels, the set R ∪ A is feasible for the budget 6BOPT . Our final algorithm is based on a recursive enumeration procedure that computes a polynomial collection of clean pairs (A, D) such that there is one pair (A, D) in the collection with a corresponding LP solution x of LP(A, D) satisfying that the triple (A, D, x) fulfills the conditions of Lemma 14, and thus leading to a constant-factor approximation. Our enumeration algorithm Enum(A, D, γ) is described below. It contains a parameter γ ∈ Z≥0 that bounds the recursion depth of the enumerations. Enum(A, D, γ) : Enumerating triples (A, D, x) to find one satisfying the conditions of Lemma 14. 1. Compute optimal solution (x, B) to LP(A, D). 2. If B > log L: stop. Otherwise, continue with step 3. 3. Add (A, D, x) to the family of triples to be considered. 4. If γ 6= 0 : //recursion depth not yet reached For u ∈ Fx : //Fx is defined as in (1) Recursive call to Enum(A ∪ {u}, D, γ − 1). Recursive call to Enum(A, D ∪ {u}, γ − 1). Notice that for any clean pair (A, D) and u ∈ Fx , the two pairs (A ∪ {u}, D) and (A, D ∪ {u}) are clean, too. Hence, if we start Enum(A, D, γ) with a clean pair (A, D), we will encounter only clean pairs during all recursive calls. The key property of the above enumeration procedure is that only a small recursion depth γ is needed for the enumeration algorithm to explore a good triple (A, D, x), which satisfies the conditions of Lemma 14, if we start with the trivial clean pair (∅, ∅). Furthermore, due to step 2, we always have B ≤ log L whenever the algorithmm is in step 4. As we will see later, this allows us to prove that |Fx | is small, which will limit the width of our recursive calls, and leads to an efficient procedure as highlighted in the following Lemma. Lemma 15. Let γ̄ = 2(log L)2 log(2) L. The enumeration procedure Enum(∅, ∅, γ̄) runs in polynomial time. Furthermore, if BOPT ≤ log L, then Enum(∅, ∅, γ̄) will encounter a triple (A, D, x) satisfying the conditions of Lemma 14, i.e., (i) (A, D) is a clean pair, (ii) A ⊆ OPT, (iii) D ∩ OPT = ∅, and (iv) OPT ∩ Qx = ∅. Hence, combining Lemma 15 and Lemma 14 completes our enumeration procedure and implies the following result. 15 Corollary 16. Let I be an RMFC instance on L levels on a graph G = (V, E) with budgets Bℓ = 2ℓ · B. Then there is a procedure with running time polynomial in 2L , returning a solution (Q, B) for I, where Q ⊆ V \ {r} is a set of vertices to protect that is feasible for budget B, satisfying the following: If the optimal budget BOPT for I satisfies BOPT ≤ log L, then B ≤ 6BOPT . Proof. It suffices to run Enum(∅, ∅, γ̄) to first efficiently obtain a family of triples (Ai , Di , xi )i , where (Ai , Di ) is a clean pair, and xi is an optimal solution to LP(Ai , Di ). By Lemma 15, one of these triples satisfies the conditions of Lemma 14. (Notice that these conditions cannot be checked since it would require knowledge of OPT.) For each triple (Ai , Di , xi ) we obtain a corresponding solution for I following the construction described in Lemma 14. More precisely, we first compute an optimal solution (yi , B̄i ) to LP(Ai , V≤h \ Ai ). Then, by applying Theorem 12 to yi ∧ χV>h with µ = 1 and q = 2, a set of vertices Ri ⊆ V>h is obtained such that Ri ∪ Ai is feasible for I for some budget Bi . Among all such sets Ri ∪ Ai , we return the one with minimum Bi . Because Lemma 15 guarantees that one of the triples (Ai , Di , xi ) satisfies the conditions of Lemma 14, we have by Lemma 14 that the best protection set Q = Rj ∪ Aj among all Ri ∪ Ai has a budget Bj satisfying Bj ≤ 6BOPT . Summary of our O(1)-approximation for RMFC Starting with an RMFC instance I orig on a tree with N vertices, we first apply our compression result, Theorem 5, to obtain an RMFC instance I on a graph G = (V, E) with depth L = O(log N ), and nonuniform budgets Bℓ = 2ℓ B for ℓ ∈ [L]. Let BOPT ∈ Z≥1 be the optimal budget value for B for instance orig I—recall that B = BOPT in instance I implies that level ℓ ∈ [L] has budget 2ℓ · BOPT —and let BOPT be orig orig the optimal budget for I . By Theorem 5, we have BOPT ≤ BOPT , and any solution to I using budget B can efficiently be transformed into one of I orig of budget 2B. We now invoke Theorem 13 and Corollary 16. Both guarantee that a solution to I with certain properties can be computed efficiently. Among the two solutions derived from Theorem 13 and Corollary 16, we consider the one (Q, B) with lower budget B, where Q ⊆ V \ {r} is a set of vertices to protect, feasible for budget B. If B ≥ log L, then Theorem 13 implies B ≤ 3BOPT , otherwise Corollary 16 implies B ≤ 6BOPT . Hence, in any case we have a 6-approximation for I. As mentioned before, Theorem 5 implies that the solution Q can efficiently be transformed into a solution for the original instance I orig that orig is feasible with respect to the budget 2B ≤ 12BOPT ≤ 12BOPT , thus implying Theorem 1. 4 Details on compression results In this section, we present the proofs for our compression results, Theorem 4 and Theorem 5. We start by proving Theorem 4. The same ideas are used with a slight adaptation in the proof of Theorem 5. We call an instance I obtained from an instance I by a sequence of down-push operations a pushdown of I. We prove Theorem 4 by proving the following result, of which Theorem 4 is an immediate consequence, as we will soon show. Theorem 17. Let I be a unit-budget Firefighter instance with depth L, and let δ ∈ (0, 1). Then one can efficiently construct a push-down I of I such that (i) val(OPT(I)) ≥ (1 − δ) val(OPT(I)), and (ii) I has nonzero budget on only O( logδ L ) levels. Before we prove Theorem 17, we show how it implies Theorem 4. Proof of Theorem 4. We start by showing how levels of zero budget can be removed through the following contraction operation. Let ℓ ∈ {2, . . . , L} be a level whose budget is zero. For each vertex u ∈ Vℓ−1 we 16 contract all edges from u to its children and increase the weight w(u) of u by the sum of the weights of all of its children. Formally, if u has children vP 1 , . . . , vk ∈ Vℓ , the vertices u, v1 , . . . , uk are replaced by a single vertex z with weight w(z) = w(u) + ki=1 w(vi ), and z is adjacent to the parent of u and to all children of v1 , . . . , vk . One can easily observe that this is an “exact” transformation in the sense that any solution before the contraction remains one after contraction and vice versa (when identifying the vertex z in the contracted version with v); moreover, solutions before and after contraction have the same value. Now, by first applying Theorem 17 and then applying the latter contraction operations level by level to all levels ℓ ∈ {2, . . . , L} with zero budget (in an arbitrary order), we obtain an equivalent instance with the desired depth, thus satisfying the conditions of Theorem 4. It remains to prove Theorem 17. Proof of Theorem 17. Consider a unit-budget Firefighter instance on a tree G = (V, E) with depth L. The push-down I that we construct will have nonzero budgets precisely on the following levels L ⊆ [L]:       log L j ∪ {L}. j ∈ 0, . . . , L = (1 + δ) log(1 + δ) log L For simplicity, let L = {ℓ1 , . . . , ℓk } with 1 = ℓ1 < ℓ2 < · · · < ℓk = L. Hence, k = O( log(1+δ) ) = O( logδ L ). The push-down I is obtained by pushing any budget on a level not in L down to the next level in L. Formally, for i ∈ [k], the budget Bℓi at level ℓi is given by Bℓi = ℓi − ℓi−1 , where we set ℓ0 = 0. Moreover, Bℓ = 0 for ℓ ∈ [L] \ L. Clearly, the instance I can be constructed efficiently. Furthermore, the number of levels with nonzero budget is equal to k = O( logδ L ) as desired. It remains to show point (i) of Theorem 17. solution S ∗ ⊆ V of I; hence, val(OPT(I)) = P To show (i), consider an optimal redundancy-free ∗ u∈S ∗ w(Tu ) and no two vertices of S lie on the same leaf-root path. We will show that there is a feasible solution S to I such that S ⊆ S ∗ and the value of S is at least (1 − δ) val(OPT(I)). Notice that since S ∗ is redundancy-free, any subset of S ∗ is also redundancy-free. Hence, the value of the set S to construct will P be equal to u∈S w(Tu ). The set S ∗ being (budget-)feasible for I implies |S ∗ ∩ V≤ℓ | ≤ ℓ ∀ℓ ∈ [L]. (2) Analogously, a set S ⊆ V is feasible for I if and only if |S ∩ V≤ℓ | ≤ ℓ X Bi i=1 ∀ℓ ∈ [L]. (3) P Hence, we want to show that there is a set S satisfying the above system and such that u∈S w(Tu ) ≥ (1 − δ) val(OPT(I)). Notice that in (3), the constraint for any ℓ ∈ [L − 1] such that Bl+1 = 0 is redundant due to the constraint for level ℓ + 1 which has the same right-hand side but a larger left-hand side. Thus, system (3) is equivalent to the following system |S ∩ V≤ℓi+1 −1 | ≤ ℓi |S ∩ V | ≤ L. ∀i ∈ [k − 1], (4) To show that there is a good subset S ⊆ S ∗ that satisfies (4) we use a polyhedral approach. Observe that (3) is the constraint system of a laminar matroid (see [33, Volume B] for more information on matroids). Hence, 17 the convex hull of all characteristic vectors χS ∈ {0, 1}V of sets S ⊆ S ∗ satisfying (4) is given by the following polytope P =      x(V≤ℓi+1 −1 ) ≤ ℓi ∀i ∈ [k − 1], x ∈ [0, 1]V x(V ) ≤ L,    .   x(V \ S ∗ ) = 0 Alternatively, to see that P indeed describes the correct polytope, without relying on matroids, one can observe that its constraint matrix is totally unimodular because it has the consecutive-ones property with respect to the columns. P Thus there exists a set S ⊆ S ∗ with u∈S w(Tu ) ≥ (1 − δ) val(OPT(I)) if and only if ) ( X (5) max x(u) · w(Tu ) x ∈ P ≥ (1 − δ) val(OPT(I)). u∈S ∗ To show (5), and thus complete the proof, we show that y = the objective value of y satisfies X u∈S ∗ y(u) · w(Tu ) = 1 S∗ 1+δ χ ∈ P . This will indeed imply (5) since 1 val(OPT(I)) ≥ (1 − δ) val(OPT(I)). 1+δ 1 1 To see that y ∈ P , notice that y(V \ S ∗ ) = 0 and y(V ) = 1+δ |S ∗ | ≤ 1+δ L ≤ L, where the first ∗ inequality follows by S satisfying (2) for ℓ = L. Finally, for i ∈ [k − 1], we have y(V≤ℓi+1 −1 ) = 1 1 |S ∗ ∩ V≤ℓi+1 −1 | ≤ (ℓi+1 − 1), 1+δ 1+δ where the inequality follows from S ∗ satisfying (2) for ℓ = ℓi+1 − 1. It remains to show ℓi+1 − 1 ≤ (1+ δ)ℓi to prove y ∈ P . Let α ∈ Z≥0 be the smallest integer for which we have ℓi+1 = ⌈(1 + δ)α ⌉. In particular, this implies ℓi = ⌈(1 + δ)α−1 ⌉. We thus obtain ℓi+1 − 1 ≤ (1 + δ)α = (1 + δ)(1 + δ)α−1 ≤ (1 + δ)ℓi , as desired. We conclude with the proof of Theorem 5. Proof of Theorem 5. We start by describing the construction of G′ = (V ′ , E ′ ). As is the case in the proof of Theorem 4, we first change the budget assignment of the instance and then contract all levels with zero budgets. Notice that, for a given budget B per layer, we can consider an RMFC instance as a Firefighter instance, where each leaf u ∈ Γ has weight w(u) = 1, and all other weights are zero. Since our goal is to save all leaves, we want to save vertices of total weight |Γ|. For simplicity of presentation we assume that L is a power of 2. This assumption does not compromise generality, as one can always augment the original tree with one path starting from the root and going down to level 2⌈log L⌉ . The set of levels in which the transformed instance will have nonzero budget is  L = 2j − 1 j ∈ {1, . . . , log L} . 18 However, instead of down-pushes we will do up-pushes were budget is moved upwards. More precisely, the budget of any level ℓ ∈ [L] \ L will be assigned to the first level in L that is above ℓ, i.e., has a smaller index than ℓ. As for the Firefighter case, we now remove all 0-budget levels using contraction, which will lead to a new weight function w′ on the vertices. Since our goal is to save the weight of the whole tree, we can remove for each vertex u with w′ (u) > 0, the subtree below u. This does not change the problem since we have to save u, and thus will anyway also save its subtree. This finishes our construction of G′ = (V ′ , E ′ ), and the task is again to remove all leaves of G′ . Notice that G′ has L′ ≤ |L| = log L many levels, and level ℓ ∈ [L′ ] has a budget of B2ℓ as desired. Analogous to the discussion for compression in the context of the Firefighter problem we have that if the original problem is feasible, then so is the RMFC problem on G′ with budgets B2ℓ . Indeed, before performing the contraction operations (which do not change the problem), the original RMFC problem was a push-down of the one we constructed. Similarly, one can observe that before contraction, the instance we obtained is itself a push-down of the original instance with budgets 2B on each level. Hence, analogously to the compression result for the Firefighter case, any solution to the RMFC problem on G′ can efficiently be transformed into a solution to the original RMFC problem on G with budgets 2B on each level. 5 Missing details for Firefighter PTAS In this section we present the missing proofs for our PTAS for the Firefighter problem. We start by proving Lemma 6, showing that any vertex solution x to LPFF has few x-loose vertices. More precisely, the proof below shows that the number of x-loose vertices is upper bounded by the number of tight budget constraints. The precise same reasoning used in the proof of Lemma 6 can also be applied in further contexts, in particular for the RMFC problem. Proof of Lemma 6 Let x be a vertex of the polytope defining the feasible set of LPFF . Hence, x is uniquely defined by |V \ {r}| many linearly independent and tight constraints of this polytope. Notice that the tight constraints can be partitioned into three groups: (i) Tight nonnegativity constraints, one for each vertex in F1 = {u ∈ V \ {r}P| x(u) = 0}. (ii) Tight budget constraints, one for each level in F2 = {ℓ ∈ [L] | x(V≤ℓ ) = ℓi=1 Bi }. (iii) Tight leaf constraints, one for each vertex in F3 = {u ∈ Γ | x(Pu ) = 1}. Due to potential degeneracies of the polytope describing the feasible set of LPFF there may be several options to describe x as the unique solution to a full-rank linear subsystem of the constraints described by F1 ∪ F2 ∪ F3 . We consider a system that contains all tight nonnegativity constraints, i.e., constraints corresponding to F1 , and complement these constraints with arbitrary subsets F2′ ⊆ F2 and F3′ ⊆ F3 of budget and leaf constraints that lead to a full rank linear system corresponding to the constraints F1 ∪F2′ ∪F3′ . Hence |F1 | + |F2′ | + |F3′ | = |V | − 1. (6) Let V L ⊆ supp(x) and V T ⊆ supp(x) be the x-loose and x-tight vertices, respectively. We first show ≤ |V T |. For each leaf u ∈ F3′ , let fu ∈ V T be the first vertex on the unique u-root path that is part of supp(x). In particular, if u ∈ supp(x) then fu = u. Clearly, fu must be an x-tight vertex because the path constraint with respect to u is tight. Notice that for any distinct vertices u1 , u2 ∈ F3′ , we must have fu1 6= fu2 . Assume by sake of contradiction that fu1 = fu2 . However, this implies χPu1 − χPu2 ∈ span({χv | v ∈ F1 }), since Pu1 ∆Pu2 := (Pu1 \ Pu2 ) ∪ (Pu2 \ Pu1 ) ⊆ F1 , and leads to a contradiction |F3′ | 19 because we exhibited a linear dependence among the constraints corresponding to F3′ and F1 . Hence, fu1 6= fu2 which implies that the map u 7→ fu from F3′ to V T is injective and thus |F3′ | ≤ |V T |. (7) We thus obtain | supp(x)| = |V | − 1 − |F1 | = ≤ |F2′ | + |F2′ | + |F3′ | T |V | (supp(x) consists of all u ∈ V \ {r} with x(u) 6= 0, i.e., u 6∈ F1 ) (by (6)) (by (7)), which leads to the desired result since |V L | = | supp(x)| − |V T | ≤ |F2′ | ≤ L. Proof of Lemma 7 Within this proof we focus on protection sets where the budget available for any level is spent on the same level (and not a later one). As discussed, there is always an optimal protection set with this property. Let Bℓ ∈ Z≥0 be the budget available at level ℓ ∈ [L] and let λℓ = λBℓ . We construct the tree G′ using the following greedy procedure. Process the levels of G from the first one to the last one. At every level ℓ ∈ [L], pick λℓ vertices uℓ1 , · · · , uℓλℓ at the ℓ-th level of G greedily, i.e., pick each next vertex such that the subtree corresponding to that vertex has largest weight among all remaining vertices in the level. After each selection of a vertex the greedy procedure can no longer select any vertex in the corresponding subtree in subsequent iterations.10 Now, the tree G′ is constructed by deleting from G any vertex that is both not contained in any subtree Tuℓ , and not contained in any path Puℓ for ℓ ∈ [L] and i ∈ [λℓ ]. In other words, if U ⊆ V is the set of all i i leaves of G that were disconnected from the root by the greedy algorithm, then we consider the subtree of G induced by the vertices ∪u∈U Pu . Finally, the weights of vertices on the paths Puℓ \ {uℓi } for ℓ ∈ [L] and i i ∈ [λℓ ] are reduced to zero. This concludes the construction of G′ = (V ′ , E ′ ) and the new weight function w′ . Denote by Dℓ = {uℓ1 , · · · , uℓλℓ } the set of vertices chosen by the greedy procedure in level ℓ, and let D = ∪ℓ∈[L] Dℓ . Observe that by construction we have that each vertex with non-zero weight is in the subtree of a vertex in D, i.e., X w′ (V ′ ) = w′ (Tu′ ). u∈D The latter immediately implies point (ii) of Lemma 7 because the vertices D can be partitioned into λ many vertex sets that are budget-feasible and can thus be protected in a Firefighter solution. Hence an optimal solution to the Firefighter problem on G′ covers at least a λ1 -fraction of the total weight of G′ . It remains to prove point (i) of the Lemma. Let S ∗ = S1∗ ∪ · · · ∪ SL∗ be the vertices protected in some optimal solution in G, where Sℓ∗ ⊆ Vℓ are the vertices protected in level ℓ (and hence |Sℓ∗ | ≤ Bℓ ). Without loss of generality, we assume that S ∗ is redundancy-free. For distinct vertices u, v ∈ V we say that u covers v if v ∈ Tu \ {u}. For ℓ ∈ [L], let Iℓ = Sl∗ ∩ Dℓ be the set of vertices protected by the optimal solution that are also chosen by the greedy algorithm in level ℓ. Furthermore, let Jℓ ⊆ Sℓ∗ be the set of vertices of the optimal 10 For λ = 1 this procedure produces a set of vertices, which comprise a coincides with the greedy algorithm of Hartnell and Li [25]. 20 1 -approximation 2 for the Firefighter problem, as it solution that are covered by vertices chosen by the greedy algorithm in earlier iterations, i.e., Jℓ = Sℓ∗ ∩ S ∗ u∈D1 ∪···∪Dℓ−1 Tu . Finally, let Kℓ = Sℓ \ (Iℓ ∪ Jℓ ) be all other optimal vertices in level ℓ. Clearly, ∗ ∗ Sℓ = Iℓ ∪ Jℓ ∪ Kℓ is a partition of Sℓ . Consider a vertex u ∈ Kℓ for some ℓ ∈ [L]. From the guarantee of the greedy algorithm it holds that for every vertex v ∈ Dℓ we have w′ (Tv ) = w(Tv ) ≥ w(Tu ). The same does not necessarily hold for covered vertices. On the other hand, covered vertices are contained in G′ with their original weights. We exploit these two properties to prove the existence of a solution in G′ of almost the same weight as S ∗ . To prove the existence of a good solution we construct a solution A = A1 ∪ · · · ∪ AL with Aℓ ⊆ Vℓ and |Aℓ | ≤ Bℓ randomly, and prove a bound on its expected quality. We process the levels of the tree G′ top-down to construct A step by step. This clearly does not compromise generality. Recall that we only need to prove the existence of a good solution, and not compute it efficiently. We can hence assume the knowledge of S ∗ in the construction of A. To this end assume that all levels ℓ′ < ℓ were already processed, and the corresponding sets Aℓ′ were constructed. The set Aℓ is constructed as follows: 1. Include in Aℓ all vertices in Iℓ . 2. Include in Aℓ all vertices in Jℓ that are not covered by vertices in A1 ∪ · · · ∪ Aℓ−1 (vertices selected so far). 3. Include in Aℓ a uniformly random subset of |Kℓ | vertices from Dℓ \ Iℓ . It is easy to verify that the latter algorithm returns a redundancy-free solution, as no two chosen vertices in A lie on the same path to the root. Next, we show that the expected weight of vertices saved by A is at least (1 − λ1 ) val(OPT(I)), which will prove our claim, since then at least one solution has the desired quality. Since we only need a bound on the expectation we can focus on a single level ℓ ∈ [L] and show that the contribution of vertices in Aℓ is in expectation at least 1 − λ1 times the contribution of the vertices in Sℓ∗ . Observe that the vertices in Iℓ are contained both in Sℓ∗ and in Aℓ , hence it suffices to show that the contribution of Aℓ \Iℓ is at least 1− λ1 times the contribution of Sℓ∗ \Iℓ , in expectation. Also, recall that every vertex in Dℓ contributes at least as much as any vertex in Kℓ , by the greedy selection rule. It follows that the |Kℓ | randomly selected vertices in Aℓ have at least as much contribution as the vertices in Kℓ . Consequently, to prove the claim is suffices to bound the expected contribution of vertices in Aℓ ∩ Jℓ with respect to the contribution of Jℓ . Since Aℓ ∩ Jℓ ⊆ Jℓ it suffices to show that every vertex u ∈ Jℓ is also present in Aℓ with probability at least 1 − λ1 . To bound the latter probability we make use of the random choices in the construction of A as follows. Let ℓ′ < ℓ be the level at which for some w ∈ Dℓ′ it holds that u ∈ Tw . In other words, ℓ′ is the level that contains the ancestor of u that was chosen by the greedy construction of G′ . Now, since S ∗ is redundancyfree, and by the way that A is constructed, it holds that if u 6∈ Aℓ then w ∈ Aℓ′ , namely if u is covered, it can only be covered by the unique ancestor w of u that was chosen in the greedy construction of G′ . Furthermore, in such a case the vertex w was selected randomly in the third step of the ℓ′ -th iteration. Put differently, the probability that the vertex u is covered is exactly the probability that its ancestor w is chosen randomly to be part of Aℓ′ . Since these vertices are chosen to be a random subset of |Kℓ′ | vertices from the set Dℓ′ \ Iℓ′ , this probability is at most |Kℓ′ | 1 |Kℓ′ | = ≤ , |Dℓ′ | − |Iℓ′ | λBℓ′ − |Iℓ′ | λ where the last inequality follows from |Kℓ′ | + |Iℓ′ | ≤ Bℓ′ . This implies that u ∈ Aℓ with probability of at least 1 − λ1 , as required and concludes the proof of the lemma. 21 Proof of Lemma 9 We construct the set Q in two phases as follows. First we construct a set Q ⊆ H of vertices fulfilling the first and the third properties, i.e., it will satisfy |Q| = O( logǫ3N ), as well as the property that G[V \ Q ∪ {r}] has connected components each of weight at most η. Then, we add to Q all vertices of H of degree at least three to arrive at the final set Q. It will be convenient to define heavy vertices and heavy tree with respect to any subtree G′ = (V ′ , E ′ ) of G which contains the root r. Concretely, we define HG′ = {u ∈ V ′ \ {r} | w(Tu′ ) ≥ η} to be the set of G′ -heavy vertices. The G′ -heavy tree is the subtree G′ [HG′ ∪ {r}] of G′ . Observe that H = HG and that HG′ ⊆ H for every subtree G′ of G. To construct Q we process the tree G in a bottom-up fashion starting with Q = ∅. We will also remove parts of the tree in the end of every iteration. The first iteration starts with G′ = G. In every iteration that starts with tree G′ , include in Q an arbitrary leaf u ∈ HG′ of the heavy tree and remove u and all vertices in its subtree from G′ . The procedure ends when there is either no heavy vertex in G′ anymore, or when r is the only heavy vertex in G′ . Let us verify that the claimed properties indeed hold. The fact that |Q| = O( logǫ3N ) follows from the fact that at each iteration we remove a G′ -heavy vertex including all its subtree from the current tree G′ . This implies that the total weight of the tree G′ decreases by at least η in every iteration. Since we only include ) one vertex in every iteration we have |Q| ≤ w(V = O( logǫ3N ). η The third property follows from the fact that we always remove a leaf of the G′ -heavy tree. Observe that the connected components of G[V \ (Q ∪ {r})] are contained in the subtrees we disconnect in every iteration in the construction of Q. By definition of G′ -heavy leaves, in any such iteration where a G′ -heavy leaf u is removed from the tree, these parts have weight at least η, but any subtree rooted at any descendant of u has weight strictly smaller than η (otherwise this descendant would be G′ -heavy as well, contradicting the assumption that it has a G′ -heavy leaf u as an ancestor). Now, since u is included in Q, the connected components are exactly these subtrees, so the property indeed holds. To construct Q and conclude the proof it remains to include in Q all remaining nodes of degree at least three in the heavy tree. The fact that also all leaves of the heavy tree are included in Q is readily implied by the construction of Q, so the second property holds for Q. Clearly, by removing more vertices from the heavy tree, the sizes of connected components only get smaller, so Q also satisfies the third condition, since Q already did. Finally, the number of vertices of degree at least three in the heavy tree is strictly less than the number of its leaves, which is O( logǫ3N ); for otherwise a contradiction would occur since the tree would have an average degree of at least 2. This implies that, in total, |Q| = O( logǫ3N ), so the first property also holds. To conclude the proof of the lemma it remains to note that the latter construction can be easily implemented in polynomial time. 6 Missing details for O(1)-approximation for RMFC This section contains the missing proofs for our 12-approximation for RMFC. Proof of Theorem 12 To prove Theorem 12 we first show the following result, based on which Theorem 12 follows quite directly. 22 Lemma 18. Let B ∈ R≥1 , η ∈ (0, 1], k ∈ Z≥1 , and ℓ1 = ⌊log(k) L⌋, ℓ2 = ⌊log(k−1) L⌋. Let x ∈ PB with supp(x) ⊆ V(ℓ1 ,ℓ2 ] := V>ℓ1 ∩ V≤ℓ2 , and we define Y = {u ∈ Γ | x(Pu ) ≥ η}. Then one can efficiently compute a set R ⊆ V(ℓ1 ,ℓ2 ] such that (i) R ∩ Pu 6= ∅ ∀u ∈ Y , and (ii) χR ∈ PB̄ , where B̄ = η1 B + 1. We first observe that Lemma 18 indeed implies Theorem 12. Proof of Theorem 12. For k = 1, . . . , q, let ℓk1 = ⌊log(k) L⌋ and ℓk2 = ⌊log(k−1) L⌋, and we define xk ∈ PB P V k k by xk = x ∧ χ (ℓ1 ,ℓ2 ] . Hence, x = qk=1 xk . For each k ∈ [q], we apply Lemma 18 to xk with η = µq to obtain a set Rk ⊆ V(ℓk ,ℓk ] satisfying 1 2 (i) Rk ∩ Pu 6= ∅ ∀u ∈ Y k = {u ∈ Γ | xk (Pu ) ≥ η}, and k (ii) χR ∈ PB̄ , where B̄ := η1 B + 1 = µq B + 1 =: B ′ . We claim that R = ∪qk=1 Rk is a set satisfying the conditions of Theorem 12. The set R clearly satisfies k χR ∈ PB ′ since χR ∈ PB ′ for k ∈ [q] and the sets Rk are on disjoint levels. Furthermore, Pq for keach u ∈ W = {v ∈ Γ | x(Pv ) ≥ µ} we indeed have Pu ∩ R 6= ∅ due to the following. Since x = k=1 x and x(Pu ) ≥ µ there exists an index j ∈ [q] such that xj (Pu ) ≥ η = µq , and hence Pu ∩ R ⊇ Pu ∩ Rj 6= ∅. Thus, it remains to prove Lemma 18. Proof of Lemma 18. Let B̃ = η1 B. We start by determining an optimal vertex solution y to the linear program min{z(V \ {r}) | z ∈ Q}, where Q = {z ∈ PB̃ | z(u) = 0 ∀u ∈ V \ (V(ℓ1 ,ℓ2 ] ∪ {r}), z(Pu ) ≥ 1 ∀u ∈ Y }. Notice that Q 6= ∅ since η1 x ∈ Q; hence, the above LP is feasible. Furthermore, notice that y(Pu ) ≤ 1 for u ∈ Γ; for otherwise, there is a vertex v ∈ supp(y) such that y(Pv ) > 1, and hence y − ǫχ{v} ∈ Q for a small enough ǫ > 0, violating that y is an optimal vertex solution. Let V L be all y-loose vertices. We will show that the set R = V L ∪ {u ∈ V \ {r} | y(u) = 1} fulfills the properties claimed by the lemma. Clearly, R ⊆ V(ℓ1 ,ℓ2 ] since supp(y) ⊆ V(ℓ1 ,ℓ2 ] . To see that condition (i) holds, let u ∈ Y , and notice that we have y(Pu ) = 1. Either |Pu ∩ supp(y)| = 1, in which case the single vertex v in Pu ∩ supp(y) satisfies y(u) = 1 and is thus contained in R; or |Pu ∩ supp(y)| > 1, in which case Pu ∩ V L 6= ∅ which again implies R ∩ Pu 6= ∅. To show that R satisfies (ii), we have to show that R does not exceed the budget B̄ · 2ℓ = ( η1 B + 1)2ℓ of any level ℓ ∈ {ℓ1 + 1, . . . , ℓ2 }. We have |R ∩ Vℓ | ≤ y(Vℓ ) + |V L | ≤ B̃2ℓ + |V L | = 1 ℓ B2 + |V L |, η where the second inequality follows from y ∈ Q. To complete the proof it suffices to show |V L | ≤ 2ℓ . This follows by a sparsity reasoning analogous to Lemma 6 implying that the number of y-loose vertices is bounded by the number of tight budget constraints, and thus |V L | ≤ ℓ2 − ℓ1 ≤ ℓ2 = ⌊log(k−1) L⌋. 23 (8) Furthermore, 2ℓ ≥ 2ℓ1 +1 = 2⌊log (k) L⌋+1 ≥ 2log (k) L = log(k−1) L, which, together with (8), implies |V L | ≤ 2ℓ and thus completes the proof. Proof of Theorem 13 Let (y, B) be an optimal solution to the RMFC relaxation min{B | x ∈ P̄B } and let h = ⌊log L⌋. Hence, B ≤ BOPT . We invoke Theorem 12 with respect to the vector y ∧ χV>h and µ = 0.5 to obtain a set R1 ⊆ V>h satisfying (i) R1 ∩ Pu 6= ∅ ∀u ∈ W , and (ii) χR1 ∈ P2B+1 , where W = {u ∈ Γ | y(Pu ∩ V>h ) ≥ 0.5}. Hence, R1 cuts off all leaves in W from the root by only protecting vertices on levels V>h and using budget bounded by 2B + 1 ≤ 3B ≤ 3 max{log L, BOPT }. We now focus on the leaves Γ \ W , which we will cut off from the root by protecting a vertex set R2 ⊆ V≤h feasible for budget 3 max{log L, BOPT }. Let (z, B̄) be an optimal vertex solution to the following linear program  (9) min B̄ x ∈ PB̄ , x(Pu ) = 1 ∀u ∈ Γ \ W . First, notice that (9) is feasible for B̄ ≤ 2B. This follows by observing that the vector q = 2(y ∧ χV≤h ) satisfies q ∈ P2B since y ∈ PB . Moreover, for u ∈ Γ \ W , we have q(Pu ) = 2y(Pu ∩ V≤h ) = 2(1 − y(Pu ∩ V>h )) > 1, where the last inequality follows from y(Pu ∩ V>h ) < 0.5 because u ∈ Γ \ W . Finally, there exists a vector q ′ < q such that q ′ (Pu ) = 1 for u ∈ Γ \ W . The vector q ′ can be obtained from q by successively reducing values on vertices v ∈ supp(q) satisfying q(Pv ) > 1. This shows that (q ′ , 2B) is a feasible solution to (9) and hence B̄ ≤ 2B. Consider the set of all z-loose vertices V L = {u ∈ supp(z) | z(Pu ) < 1}. We define R2 = V L ∪ {u ∈ supp(z) | z(u) = 1}. Notice that for each u ∈ Γ \ W , the set R2 contains a vertex on the path from u to the root. Indeed, either | supp(z) ∩ Pu | = 1 in which case there is a vertex v ∈ Pu with z(v) = 1, which is thus contained in R2 , or | supp(z) ∩ Pu | > 1 in which case the vertex v ∈ supp(z) ∩ Pu that is closest to the root among all vertices in supp(z) ∩ Pu is a z-loose vertex. Hence, the set R = R1 ∪ R2 cuts off all leaves from the root. It remains to show that it is feasible for budget 3 max{log L, BOPT }. Using an analogous sparsity reasoning as in Lemma 6, we obtain that |V L | is bounded by the number of tight budget constraints, which is at most h = ⌊log L⌋ ≤ log L. Hence, for any level ℓ ∈ [h], we have |R2 ∩ Vℓ | ≤ |V L | + z(Vℓ ) ≤ log L + 2ℓ B̄ ((z, B̄) feasible for (9)) ℓ ≤ log L + 2 · (2B) ≤ 2ℓ · (3 max{log L, BOPT }). (B̄ ≤ 2B) (B ≤ BOPT ) Thus, both R1 and R2 are budget-feasible for budget 3 max{log L, BOPT }, and since they contain vertices on disjoint levels, R = R1 ∪ R2 is feasible for the same budget. 24 Proof of Lemma 15 To show that the running time of Enum(∅, ∅, γ̄) is polynomial, we show that there is only a polynomial number of recursive calls to Enum(A, D, γ). Notice that the number of recursive calls done in one execution of step 4 of the algorithm is equal to 2|Fx |. We thus start by upper bounding |Fx | for any solution (x, B) to LP(A, D) with B < log L. Consider a vertex fu ∈ Fx , where u ∈ Γ \ Wx . Since u is a leaf not in Wx , we have x(Pu ∩ V≤h ) > 13 , and thus x(Tfu ∩ V≤h ) > 1 3 ∀fu ∈ Fx . Because no two vertices of Fx lie on the same leaf-root path, the sets Tfu ∩ V≤h are all disjoint for different fu ∈ Fx , and hence X 1 |Fx | < x(Tf ∩ V≤h ) 3 f ∈Fx ≤ x(V≤h ) ≤ h X 2ℓ B ℓ=1 h+1 <2 (disjointness of sets Tf ∩ V≤h for different f ∈ Fx ) (x satisfies budget constraints of LP(A, D) ) B < 2(log L)2 . (h = ⌊log(2) L⌋ and B < log L) Since the recursion depth is γ̄ = 2(log L)2 log(2) L, the number of recursive calls is bounded by  (2) 2 O (2|Fx |)γ̄ = (log L)O((log L) log L) = 2o(L) = o(N ), thus showing that Enum(∅, ∅, γ̄) runs in polynomial time. It remains to show that Enum(∅, ∅, γ̄) finds a triple satisfying the conditions of Lemma 14. For this we identify a particular execution path of the recursive procedure Enum(∅, ∅, γ̄) that, at any point in the algorithm, will maintain a clean pair (A, D) that is compatible with OPT, i.e., A ⊆ OPT and D ∩OPT = ∅. At the beginning of the algorithm we clearly have compatibility with OPT since A = D = ∅. To identify the execution path we are interested in, we highlight which recursive call we want to follow given that we are on the execution path. Hence, consider a clean pair (A, D) that is compatible with OPT and assume we are within the execution of Enum(A, D, γ). Let (x, B) be an optimal solution to LP(A, D). Notice that B ≤ BOPT ≤ log L, because (A, D) is compatible with OPT. If OPT ∩ Qx = ∅, then (A, D, x) fulfills the conditions of Lemma 14 and we are done. Hence, assume OPT ∩ Qx 6= ∅, and let f ∈ Fx be such that OPT ∩ Tf ∩ V≤h 6= ∅. If f ∈ OPT, then consider the execution path continuing with the call of Enum(A ∪ {f }, D, γ − 1); otherwise, if f 6∈ OPT, we focus on the call of Enum(A, D ∪ {f }, γ − 1). Notice that compatibility with OPT is maintained in both cases. To show that the thus identified execution path of Enum(∅, ∅, γ̄) indeed leads to a triple satisfying the conditions of Lemma 14, we measure progress as follows. For any clean pair (A, D) compatible with OPT, we define a potential function Φ(A, D) ∈ Z≥0 in the following way. For each u ∈ OPT ∩ V≤h , let du ∈ Z≥0 be the distance of u to the first vertex in A ∪ D ∪ {r} when following the unique u-r path. P We define Φ(A, D) = u∈OPT∩V≤h du . Notice that as long as we have a triple (A, D, x) on our execution path that does not satisfy the conditions of Lemma 14, then the next triple (A′ , D ′ , x′ ) on our execution path satisfies Φ(A′ , D ′ ) < Φ(A, D). Hence, either we will encounter a triple on our execution path satisfying the conditions of Lemma 14 while still having a strictly positive potential, or we will encounter a triple (A, D, x) compatible with OPT and Φ(A, D) = 0, which implies OPT ∩ V≤h = A, and we thus correctly 25 guessed all vertices of OPT ∩ V≤h implying that the conditions of Lemma 14 are satisfied for the triple (A, D, x). Since Φ(A, D) ≥ 0 for any compatible clean pair (A, D), this implies that a triple satisfying the conditions of Lemma 14 will be encountered if the recursion depth γ̄ is at least Φ(∅, ∅). To evaluate Φ(∅, ∅) we have to compute the sum of the distances of all vertices u ∈ OPT ∩ V≤h to the root. The distance of u to the root is at most h since u ∈ V≤h . Moreover, |OPT ∩ V≤h | < 2h+1 BOPT due to the budget constraints. Hence, Φ(∅, ∅) < h · 2h+1 · BOPT ≤ 2 log(2) L · (log L)2 (h = ⌊log(2) L⌋ and BOPT ≤ log L) = γ̄, implying that a triple fulfilling the conditions of Lemma 14 is encountered by Enum(∅, ∅, γ̄). Acknowledgements We are grateful to Noy Rotbart for many stimulating discussions and for bringing several relevant references to our attention. References [1] E. Anshelevich, D. Chakrabarty, A. Hate, and C. Swamy. Approximability of the firefighter problem. Algorithmica, 62(1-2):520–536, 2012. [2] C. Bazgan, M. Chopin, M. Cygan, M. R. Fellows, F. Fomin, and E. J. van Leeuwen. Parameterized complexity of firefighting. Journal of Computer and System Sciences, 80(7):1285–1297, 2014. [3] C. Bazgan, M. Chopin, and M. R. Fellows. Parameterized complexity of the firefighter problem. In Proceedings of the 22nd International Symposium on Algorithms and Computation (ISAAC), pages 643–652. Springer-Verlag, 2011. [4] C. Bazgan, M. Chopin, and B. Ries. The firefighter problem with more than one firefighter on trees. Discrete Applied Mathematics, 161(7):899–908, 2013. [5] L. Cai, Y. Cheng, E. Verbin, and Y. Zhou. Surviving rates of graphs with bounded treewidth for the firefighter problem. SIAM Journal on Discrete Mathematics, 24(4):1322–1335, 2010. [6] L. Cai, E. Verbin, and L. Yang. Firefighting on trees:(1 − 1/e)–approximation, fixed parameter tractability and a subexponential algorithm. In Proceedings of the 19th International Symposium on Algorithms and Computation (ISAAC), pages 258–269. Springer-Verlag, 2008. [7] L. Cai and W. Wang. The surviving rate of a graph for the firefighter problem. SIAM Journal on Discrete Mathematics, 23(4):1814–1826, 2009. [8] P. Chalermsook and J. Chuzhoy. Resource minimization for fire containment. In Proceedings of the 21st Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1334–1349, 2010. [9] P. Chalermsook and D. Vaz. New integrality gap results for the firefighters problem on trees, 2016. http://arxiv.org/abs/1601.02388. 26 [10] C. Chekuri and A. Kumar. Maximum coverage problem with group budget constraints and applications. In International Workshop an Approximation Algorithms for Combinatorial Optimization Problems (APPROX), pages 72–83. Springer, 2004. [11] V. Costa, S. Dantas, M. C. Dourado, L. Penso, and D. Rautenbach. More fires and more fighters. Discrete Applied Mathematics, 161(16):2410–2419, 2013. [12] G. Călinescu, C. Chekuri, M. Pál, and J. Vondrák. Maximizing a monotone submodular function subject to a matroid constraint. SIAM Journal on Computing, 40(6):1740–1766, 2011. [13] M. Cygan, F. Fomin, and E. van Leeuwen. Parameterized complexity of firefighting revisited. In Parameterized and Exact Computation, pages 13–26. Springer, 2012. [14] M. Elkin and G. Kortsarz. An approximation algorithm for the directed telephone multicast problem. Algorithmica, 45(4):569–583, 2006. [15] L. Esperet, J. van den Heuvel, F. Maffray, and F. Sipma. Fire containment in planar graphs. Journal of Graph Theory, 73(3):267–279, 2013. [16] U. Feige. A threshold of ln n for approximating set cover. Journal of the ACM, 45:634–652, 1998. [17] S. Finbow, A. King, G. MacGillivray, and R. Rizzi. The firefighter problem for graphs of maximum degree three. Discrete Mathematics, 307(16):2094–2105, 2007. [18] S. Finbow and G. MacGillivray. The firefighter problem: a survey of results, directions and questions. Australasian Journal of Combinatorics, 43:57–77, 2009. [19] P. Floderus, A. Lingas, and M. Persson. Towards more efficient infection and fire fighting. International Journal of Foundations of Computer Science, 24(01):3–14, 2013. [20] F. V. Fomin, P. Heggernes, and E. J. van Leeuwen. Making life easier for firefighters. In Fun with Algorithms, pages 177–188. Springer, 2012. [21] P. Gordinowicz. Planar graph is on fire. arXiv preprint arXiv:1311.1158, 2013. [22] F. Grandoni, R. Ravi, M. Singh, and R. Zenklusen. New approaches to multi-objective optimization. Mathematical Programming, Series A, 146(1):525–554, 2014. [23] S. G. Hartke. Attempting to narrow the integrality gap for the firefighter problem on trees. Discrete Methods in Epidemiology, 70:179–185, 2006. [24] B. Hartnell. Firefighter! an application of domination. In 24th Manitoba Conference on Combinatorial Mathematics and Computing, 1995. [25] B. Hartnell and Q. Li. Firefighting on trees: how bad is the greedy algorithm? In Proceedings of Congressus Numerantium, volume 145, pages 187–192, 2000. [26] Y. Iwaikawa, N. Kamiyama, and T. Matsui. Improved approximation algorithms for firefighter problem on trees. IEICE Transactions on Information and Systems, 94(2):196–199, 2011. [27] A. King and G. MacGillivray. The firefighter problem for cubic graphs. Discrete Mathematics, 310(3):614–621, 2010. 27 [28] R. Klein, C. Levcopoulos, and A. Lingas. Approximation algorithms for the geometric firefighter and budget fence problems. In 11th Latin American Symposium on Theoretical Informatics (LATIN), pages 261–272. Springer, 2014. [29] J. Kong, L. Zhang, and W. Wang. The surviving rate of digraphs. Discrete Mathematics, 334:13–19, 2014. [30] G. MacGillivray and P. Wang. On the firefighter problem. Journal of Combinatorial Mathematics and Combinatorial Computing, 47:83–96, 2003. [31] P. Pralat. Sparse graphs are not flammable. SIAM Journal on Discrete Mathematics, 27(4):2157–2166, 2013. [32] R. Ravi and M. X. Goemans. The constrained minimum spanning tree problem. In Proceedings of 5th Scandinavian Workshop on Algorithm Theory (SWAT), pages 66–75, 1996. [33] A. Schrijver. Combinatorial optimization: polyhedra and efficiency, volume 24. Springer, 2003. [34] J. Vondrák. Optimal approximation for the submodular welfare problem in the value oracle model. In Proceedings of the 40th Annual ACM Symposium on Theory of Computing (STOC), pages 67–74, 2008. A Basic transformations for the Firefighter problem In this section we provide some basic transformations showing how different natural variations of the Firefighter problem can be reduced to each other. We start by proving Lemma 3. Proof of Lemma 3. Consider an instance of the weighted Firefighter problem with general budgets consisting of a tree G = (V, E) of depth L rooted at the vertex r ∈ V , weights w(u) ∈ Z≥0 for all u ∈ V \ {r} and budgets Bℓ ∈ Z>0 for all ℓ ∈ [L]. We transform the instance into an equivalent instance with unit budgets by performing the following simple steps for all levels Vℓ for ℓ ∈ [L]: • For every u ∈ Vℓ , subdivide the edge connecting u to its ancestor in G into a path with Bℓ edges, by introducing Bℓ − 1 new vertices. Denote the nodes on this path, excluding the ancestor of u in G, by Yu . • Set the weight of all new vertices to zero, while maintaining the weight w(u) for the original vertex u. Denote the resulting tree by G′ = (V ′ , E ′ ). To conclude the construction it remains to allow one unit of budget in every level of the transformed tree. It is easy to verify that feasible solutions to the Firefighter problem for the two instances are in correspondence. A feasible solution for G is transformed to a solution in G′ by replacing the Bℓ vertices Sℓ protected in any level Vℓ of G with any Bℓ vertices on the corresponding paths {Yu | u ∈ Sℓ } in G′ , one in each of the Bℓ distinct levels of G′ that are in correspondence with Vℓ . The opposite transformation selects for every protected vertex u ∈ V ′ in a feasible solution for G′ the vertex u ∈ V such that u′ ∈ Yu . It is straightforward to verify that in both transformations the obtained solutions are feasible and that they have weights identical to the original solutions. Finally, since Bℓ ≤ n can be assumed for every ℓ ∈ [L], each one of the n − 1 edges in G is subdivided into a path of length at most n, thus the number of vertices in G′ is at most O(n2 ). 28 We remark that a construction analogous to the one used in the proof of Lemma 3 can be used to show that RMFC with non-uniform budgets can be reduced to the uniform budget case. In an RMFC instance with non-uniform budgets, the budget on level ℓ is equal to B · aℓ , where aℓ ∈ Z>0 for ℓ ∈ [L] are given as input, and the goal is still to find the minimum B to protect vertices that cut off all leaves from the root and fulfill the budget constraints. Next, we show how a weighted instance of the Firefighter problem can be transformed into a unit-weight one with only an arbitrarily small loss in term of the objective function. Lemma 19. Let δ > 0 and α ∈ (0, 1]. Any weighted unit-budget Firefighter problem on a tree G = (V, E) and weights w(u) ∈ Z≥0 for u ∈ V \ {r} can be transformed efficiently into a polynomial-size unit-weight unit-budget Firefighter problem on a tree G′ = (V ′ , E ′ ) such that any α-approximate feasible solution for G′ can be efficiently transformed into a (1 − δ)α-approximate solution for G. Proof. Assume w(V ) > 0, i.e., not all weights are zero, since for otherwise the result trivially holds. Notice that this assumption also implies that the value val(OPT) of an optimal Firefighter solution in G satisfies val(OPT) ≥ 1. For simplicity we present the transformation in two steps, each losing at most a 2δ -fraction in terms of objective. First we use a standard scaling and rounding technique to obtain a new weight function that is bounded by a polynomial in the size of the tree. Concretely, we construct weights w′ (u) ∈ Z≥0 for u ∈ V \ {r} such that w′ (u) = O( nδ ) for every u ∈ V , and for a well-chosen parameter D ∈ R>0 we have: Dw′ (S) ≤ w(S) ≤ Dw′ (S) + δ val(OPT) 2 ∀S ⊆ V \ {r}. (10) In a second phase discussed below we use the obtained instance to construct a unit-weight instance with the desired property. Let wmax = maxu∈V \{r} w(u) be the maximum weight of any vertex in G. Define D = δwmax /2n, where n = |V |, and for every u ∈ V \ {r} set w′ (u) = ⌊w(u)/D⌋. Observe that val(OPT) ≥ wmax since any single vertex can be protected. The latter scaling indeed fulfills the desired properties as w′ (u) ≤ 2n/δ = O(n/δ), and for every S ⊆ V \ {r} we have Dw′ (S) ≤ w(S) ≤ Dw′ (S) + D|S| ≤ Dw′ (S) + δ val(OPT), 2 where the first two inequalities follows from w′ (u) = ⌊w(u)/D⌋ ∀u ∈ V \ {r}, and the last one from D|S| ≤ Dn = δwmax /2 ≤ δ val(OPT)/2. This shows (10). We show next that the latter transformation loses at most a 2δ -fraction in the objective function. More precisely, let S ′ ⊆ V \ {r} be a set of vertices that will not burn in an α-approximate solution to the Firefighter problem with respect to the weights w′ . We will show that w(S ′ ) ≥ (1− δ2 )α val(OPT), implying that the same solution is (1 − 2δ )α-approximate with respect to the original weights w. Let S ∗ ⊆ V \ {r} be the vertices that will not burn at the end of the process in an optimal solution for G. By (10) we have Dw′ (S ∗ ) + 2δ val(OPT) ≥ w(S ∗ ) = val(OPT), implying Dw′ (S ∗ ) ≥ (1 − 2δ ) val(OPT). We conclude:   δ val(OPT) ≤ Dw′ (S ∗ ) 1− 2 1 ≤ Dw′ (S ′ ) (S ′ corresponds to an α-approximate solution for weights w′ ) α 1 ≤ w(S ′ ), (since w′ (u) = ⌊w(u)/D⌋ for u ∈ V \ {r}) α which yields w(S ′ ) ≥ (1 − 2δ )α val(OPT), as desired. 29 Next we present the second transformation, which, given a weighted Firefighter problem with tree G = (V, E) and integer weights w(u) ∈ Z≥0 bounded by O(n), transforms it into a unit-weight instance on a new tree G′ = (V ′ , E ′ ) by losing at most a 2δ -fraction in terms of objective. 4n The tree G′ is obtained from G by taking a copy of G and attaching ⌊ αδ w(u)⌋ new leaves to every vertex u ∈ V \ {r}. For brevity, for a vertex set R ⊆ V \ {r}, we denote by sv(R) ⊆ V the set of all vertices that will not burn in G if one protects the set R, i..e, sv(R) = ∪u∈R Tu . Similarly, for R′ ⊆ V ′ \ {r}, we denote by sv′ (R′ ) = ∪u∈R′ Tu′ ⊆ V ′ all vertices in G′ that will not burn if R′ gets protected. Consider a solution that protects a set R′ ⊆ V ′ \ {r} of vertices in G′ . Observe that V ∩ R′ is a feasible set of vertices to protect in G. We can upper bound the objetive value of R′ in G′ as follows, where w′ is the unit-weight function used in G′ :    X 4n ′ ′ ′ ′ ′ ′ w(u) w (sv (R )) = |sv (R )| ≤ |R \ V | + 1+ αδ u∈sv(R′ ∩V )   X 4n (11) ≤n+ 1+ w(u) αδ ′ u∈sv(R ∩V ) ≤ 2n + 4n w(sv(R′ ∩ V )). αδ Moreover, for any set of vertices R ⊆ V \ {r} in G we have ′ ′ X  ′ w (sv (R)) = |sv (R)| = ≥ = X u∈sv(R) u∈sv(R)   4n 1+ w(u) αδ 4n w(u) αδ (12) 4n w(sv(R)). αδ We complete the rest of the proof similar to the proof of the first transformation. Let R∗ ⊆ V \ {r} be an optimal set of vertices to protect in G, and let R′ ⊆ V ′ \ {r} be an α-approximation for the unit-weight Firefighter instance on G′ . Our goal is to show that R′ ∩ V is a solution to the Firefighter problem on G of value at least (1 − 2δ )α val(OPT). Indeed, we have val(OPT) = w(sv(R∗ )) ≤ αδ ′ ′ ∗ w (sv (R )) 4n (by (12)) δ ′ ′ ′ w (sv (R )) 4n δ 1 ≤ + w(sv(R′ ∩ V )) 2 α 1 δ ≤ val(OPT) + w(sv(R′ ∩ V )), 2 α ≤ (since R′ is an α-approximation for G′ ) (by (11)) (because val(OPT) ≥ 1) which implies ′ w(sv(R ∩ V )) ≥  δ 1− 2  α val(OPT), as desired. Finally, both transformations can be implemented in polynomial time. For the first transformation this is trivial, while for the second transformation one uses the fact that the input weights are polynomially bounded, and hence G′ has polynomial size. 30
8cs.DS
Running Head: Applications of Artificial Intelligence (AI) to Network Security Applications of Artificial Intelligence (AI) to Network Security Alberto Perez Veiga University of Maryland University College ITEC 625 - Information Systems Infrastructure March 2018 1 Applications of Artificial Intelligence (AI) to Network Security 2 Abstract Attacks to networks are becoming more complex and sophisticated every day. Beyond the so-called script-kiddies and hacking newbies, there is a myriad of professional attackers seeking to make serious profits infiltrating in corporate networks. Either hostile governments, big corporations or mafias are constantly increasing their resources and skills in cybercrime in order to spy, steal or cause damage more effectively. With the ability and resources of hackers growing, the traditional approaches to Network Security seem to start hitting their limits and it’s being recognized the need for a smarter approach to threat detections. This paper provides an introduction on the need for evolution of Cyber Security techniques and how Artificial Intelligence (AI) could be of application to help solving some of the problems. It provides also, a high-level overview of some state of the art AI Network Security techniques, to finish analysing what is the foreseeable future of the application of AI to Network Security. Applications of Artificial Intelligence (AI) to Network Security 3 Introduction To add up to the fact that cyber-attacks are alarmingly growing in amount and complexity, one of the scariest facts about Cybersecurity for companies and organizations is the lack of readiness, mostly from a business perspective. The problem is wider than the technical gap. Management layer lack awareness and understanding of the real needs, therefore not providing the required support. This lack of support causes for many organizations the subsequent lack of traction, attention and willingness to commit funding and resources to Cybersecurity. It’s especially important to mention the lack of properly trained personnel to fill all the short-term future needs for Cybersecurity positions. If this tendency continues, in 2021 approximately there 3.5 million positions needed related with Cybersecurity will be unfilled and cybercrime may cost a total of $3 trillion around the world (Morgan, 2017). Given the current status, it’s easy to realize why Cybersecurity experts have been seriously looking into Artificial Intelligence (AI) and how it could help alleviate some of these issues. As an example, Machine Learning (ML), used by many of the most recent AI algorithms can greatly help with the detection of malware, increasingly difficult to identify and isolate. With malicious software becoming more capable of adapting to linear traditional security solutions, ML provides the ability to learn not only how malware looks like and acts, but also how it may evolve. AI systems could help, additionally, not only providing detection, but also take proactive actions that could take steps to remediate certain situations, and also sort and categorize events and threats, eventually freeing up technicians from repetitive, activities (Kh, 2017). Some studies estimate that the need for reliable data will boost the investment in big data analytics and intelligence up to $96 million by 2021. Sectors in need of the best security solutions such as defence or banking are pushing these technologies, adopting them and Applications of Artificial Intelligence (AI) to Network Security 4 investing. Established antimalware companies such as Symantec are pushing the boundaries of their technologies and started embedding AI algorithms in their solutions (Abi Research, 2017). Other companies, however, have jumped directly into AI to develop security products. Machine Learning The first that has to be mentioned is that, beyond all the buzz of many companies claiming to be using AI in their Cybersecurity appliances, AI is not fully applied, for now, in the field of Cybersecurity. To be fair, the current applications of AI are mostly restricted to Machine Learning (ML). While we could consider AI to have the ultimate objective to make machines function with some sort of intelligence or, in other words, being what we consider “smart”, ML is a subfield of AI which studies the way in which computers can learn the better way to perform their intended function without the need of being explicitly programmed to perform such functions. ML may encompass techniques such as statistics, mathematical optimizations, or data mining (Crosby, 2017). ML algorithms try to make decisions about their behaviour and find ways to solve problems by inferring them from models based on sample inputs that represent real-life scenarios. One of the main challenges for Network Security consists in the fact that attacks change often their appearance and vectors. When a new kind of attack or malware strikes, is not possible for traditional system to detect and identify these behaviours, as there are no stablished rules or previous patterns against which it can be matched. A typical example of this situation are zero-day attacks. When an attacker uses a zero-day, exploits certain vulnerability that has been discovered by someone, but not yet known or patched by the vendor. These undiscovered vulnerabilities are so effective that they have a huge demand in criminal forums, being sold in black markets in the dark web, some of them for large amounts of money. Applications of Artificial Intelligence (AI) to Network Security 5 The approach from traditional systems is to stop malware before it executes, trying to match patterns of code with known signatures. However, when they fail to do it, there is usually little to no remediation left. The malware executes and it’s very difficult to stop. ML algorithms try to identify in real-time when the malware has just stroke and, together with AI-assisted decisions, machine and network isolation techniques, isolate the infected computer or whole network segments in milliseconds, providing a way to stop the spread of the malicious code. In any case, when applying AI or ML to network security, one of the most relevant problems still seems to be how to identify useful patterns and how to understand when a deviation from them constitutes a security event, classify it and act upon it accordingly. Statistic deviations from normal network traffic may result interesting from a “normality” perspective, however, not all of them constitute necessarily security incidents. A negative detection can be as problematic as a huge number of false positives. Supervised ML Supervised ML tries to reach the state where the computer learns a function to map some input to an output based on samples data which provides such mapping examples from real-life scenarios. In general, these algorithms try to infer this function from the sampled data, creating a function that will map inputs (x) to outputs (Y) in the form Y=f(x). The function is supposed to become precise enough to calculate new outputs accurately from new inputs. Supervised problems can be grouped into two main groups: Classification and Regression problems. The first one, classification is where the output of the function is a classification, e.g. a colour: Red, blue, etc. In the case of Regression problems, the output is a value such as a measure, weight, cost, etc. Applications of Artificial Intelligence (AI) to Network Security 6 Unfortunately, there are some areas, such as the detection of attacks based on network traffic, of direct application to Intrusion Detection Systems (IDS) and Intrusion Prevention Systems (IPS), where the lack of sample data is a problem. During the last two decades, it’s been proven very difficult to find comprehensive sets of data samples. Although some good efforts have been made in order to sample network traffic and provide analysis, such as MIT datasets provided for years 1998, 1999 and 2000 (MIT, n.d.), these samples have been found to be irrelevant or biased (McHugh, 2000). Despite the caveats, supervised ML is probably the field of AI which has delivered, until now, the best results for Cybersecurity. The immense databases containing malware files, allow to train these algorithms deeply, improving accurate detection and reducing the number of false positives and negatives. The same applies to spam detection, which benefits from huge samples databases, constantly expanding with the help of users and Internet Services Providers reporting spam messages. ML provides a smarter, more effective approach, rather than the traditional text-based string-matching or address blacklisting. Classification algorithms can separate between “spam” and “legitimate” emails by inferring the classification from the presence of intentionally misspelled words (V!4GRA, S11mming P1lls, etc…), or the presence in the email body of URL links to sites delivering malware or of doubtful reputation (Kanal, 2017). Another example of the application of Supervised ML to Network Security would be the use of Recurrent Neural Networks (RRN) to separate human-generated DNS records from those automatically generated by ransomware. Blacklisting techniques based on signatures are completely useless for this case, as malicious names keep constantly growing in number, changing and evolving. However, ML with RRN can be used to achieve more accurate results by using linguistic analysis, thanks to the fact that malware-generated domains tend to Applications of Artificial Intelligence (AI) to Network Security 7 have strange vowel/consonants ratios that can be identified and isolated using RRNs (Machine Learning…, 2017) Figure 1, graph depicting a partial view of Machine Learning algorithms and their applications to Cybersecurity (Marty, 2018) Unsupervised ML Despite the fact that Supervised ML has probably delivered the best results until now, it’s important to mention that due to its inherent limitations, the focus in research when it comes to Network Security seems to be shifting towards Unsupervised ML. For Unsupervised ML, no sample labelled data is provided to the ML algorithm. The computer, in this case, is expected to learn the underlying structure from the data and ultimately infer proper outputs. Unsupervised ML is much more subjective and patterns obtained don’t often make sense without the human expertise to make sense of them and understand which of those patterns are really useful. Some interesting techniques with application to Cybersecurity are: Clustering, Association Rule Learning and Dimensionality Reduction. Clustering techniques try to group objects that are similar in clusters, which can be used to find out i.e. if there is an abnormal amount of network traffic in a certain host, a Applications of Artificial Intelligence (AI) to Network Security 8 significant number or wrong login events, a user accessing data which is normally not accessed by him, users working out of their usual working hours, connections from unusual locations, etc. Association Rule Learning techniques try to discover the relationships and their rules between elements in large databases. Fig. 2 Data Clustering applied to the detection of online fraud (Microsoft, 2017) Dimensionality Reduction techniques may be particularly helpful for Network Security. The whole idea behind them is to find the way to reduce the number of features in a set of data that may be of application to solve a certain problem. A feature is, in general, a particular attribute of the different elements in a set of data. Let’s take as an example a capture of network traffic. In this particular case, there may be multiple features: origin IP, destination IP, protocol, port, payload, MAC addresses, TTL, routing, etc. Analysing all the features of the captured data might be computationally ineffective to solve a particular security problem. The problem could become completely unsolvable if we are dealing with real-time analysis. If the ML algorithm can, however, learn how to reduce the number of relevant features to a few (Feature selection techniques), or group them into more Applications of Artificial Intelligence (AI) to Network Security 9 manageable sets (Feature Extraction) to solve the problem, that would make it easier to be solved. Self-Organising Maps (SOMs) are a type of Neural Network in which each neuron is connected to its neighbours and represents a point in a multidimensional space, although they are represented in a bi-dimensional space. SOMs, together with clustering techniques can help identifying malicious IP traffic. When feeding the system with sample data, the closest neuron to normal traffic moves towards it, “pulling” the neighbour neurons with it. When feeding real data, the neurons will cluster around normal data, while anomalous data will do the opposite and be isolated or separated, helping identifying patterns of anomalies, which probably constitute malicious traffic (Machine learning…, 2017). Figure 3 depicts an example of a SOM constituted by the automated analysis of more than 3.000 applications to the University of Finland. No parsers, classifications or taxonomies were used to achieve it, but only the analysis of the documents. Fig. 3. Example of Self Organizing Map (Honkela, 2011) It’s interesting to mention how Data Science can be combined with unsupervised ML in order to achieve more accurate results. An example of this is the application of Hidden Markov Models (HMMs). These models have been traditionally applied to fields such as Applications of Artificial Intelligence (AI) to Network Security 10 speech recognition or biological analysis. A Markov Model is essentially a mathematical a model that produces future data based on the values of present data, rather than past states. This model is of application e.g. to weather or economic predictions. A Hidden Markov Model is nothing else than a model which generates an educated guess. Based on the knowledge about Markov Models, which we can use it to deduct the underlying Markov Model (Alghamdi, 2016). HMMs are, therefore, of application when analysing data in an unsupervised ML environment, where there is no network traffic sample data with clear states and outputs from which infer a Markov Model. Practical case - Darktrace Different companies are applying these techniques in order to increase the effectivity of their solutions. There are other companies such as Darktrace, which are heavily investing in AI and ML in order to achieve spectacular results fighting against emerging threats. Darktrace is a technology company founded in the UK in 2013 by experts in AI from the University of Cambridge, together with experts from different government intelligence Agencies. They base their whole business model in security solutions fully developed on the top of AI and Machine Learning techniques. Darktrace’s main marketing point consists in the way they use AI within their products to detect and defend against malicious activity: they claim to have patented an algorithm known as “Enterprise Immune System”, capable of defending an enterprise network emulating the way the human body defends against infections: being able of differentiate “good” cells from “bad” cells, attacking and isolating the bad cells in the same manner as human antibodies work. Human body is capable of understand, in most of the cases, when a virus or a bacteria is causing any harm, as soon as it starts causing it. Applications of Artificial Intelligence (AI) to Network Security 11 Darktrace claims to be able to catch network attacks without the use of rules, using Machine Learning techniques that grant real-time detection. They benefit particularly from Unsupervised ML techniques, which grant the ability to catch unknown threats due to the fact that the learning is not based on known datasets, rules, or models, allowing the computer to self-learn patterns of normality and abnormal behavior. Some of the successful use cases claimed by Darktrace include i.e. the detection of a new strain of complex Ransomware attacks. In this particular case, an employee accessed its personal email from the corporate network, allowing the malicious software to enter the network and start accessing SMB shares and encrypting them. This behavior was understood as malicious by the engine, which flagged it as a threat nine seconds later. As this happened during the weekend, the security team was gone. 24 seconds later the engine took autonomously the decision to stop the anomalous writing activities to the SMB drives, stopping the attack before it was able to spread further, neutralizing the attack and limiting the damage to a small amount of data. Another interesting example could be the detection of the exfiltration of information carried on by a disgruntled employee. The engine was able to detect that a large amount of data was being transferred to an external cloud provider. Given the fact that the server from which it was being transferred was not usually carrying on those types of transactions, this was considered as an unusual behavior and flagged it as a possible threat and reported. The information was found to be thousands of records containing personal data from clients of the company being exfiltrated by a disgruntled employee. The security of the Internet of Things (IoT) has been proven to be a constant nightmare, due to the fact that most of these devices embed little to no security mechanisms at all. A good example of how these engines can help with this problem is how a biometric scanner was compromised and an attacker started changing data exploiting telnet connections Applications of Artificial Intelligence (AI) to Network Security 12 from an external computer and then pivoting to other servers in the network to eventually gain more privileges. Given the fact that the engine had learned about the “normal profile” of the device, understood that this kind of activity was deviating from it and flagged it as an alert. Investigation revealed that the vulnerability and data of these Biometric Scanners were exposed in the search engine Shodan and actively exploited for malicious purposes. All these examples highlight cases for which traditional approaches will be most likely completely ineffective. The detection of Ransomware has been proven to be a nightmare for most traditional Anti-Virus (AV) solutions, due to its constant shifting in the way they operate, the vectors used and even encryption techniques. Activities such as data thief carried on by internal employees are also very difficult to detect, as the employee is not usually carrying an activity that can be easily flagged as malicious: the employee usually has the access rights to the data. Besides these application cases, there are many other in which unsupervised ML could definitely help. The foreseeable future of AI in Cyber Security Despite all the significant advances that the world of Network Security has experienced during the last years, especially in terms of the adoption of AI, it seems wise to be cautious about the range of applications of it. It’s a temptation to believe that AI is the silver bullet that can solve all the Cyber Security problems, or blindly believing that it will success in every pitfall where traditional techniques have failed. Behind all the buzz behind the words “Artificial Intelligence”, we should be clearly aware that we are not there yet. There are, for now, only certain techniques that are actually being used with good results in security applications, and these are constrained to Machine Learning. Although systems are far from being “Intelligent” and aware of their own level of knowledge, as it’s expected from AI, Supervised ML has delivered some interesting results Applications of Artificial Intelligence (AI) to Network Security 13 until now and Unsupervised ML seems to be the focusing most of the research in this discipline, as well as delivering some spectacular results and achieve levels of accuracy not possible only a few years ago. However, Unsupervised ML is still highly dependent on human expertise to have context and knowledge to make sense of data. It seems, therefore, that the future steps in AI will be to keep exploring the path of Unsupervised ML and keep working to try and eliminate as much as possible the need for human interaction. It’s important to keep working towards finding algorithms capable to understand the context where they are operating. I.e. understanding that the traffic generated by a DNS server is the way it is because it’s a DNS server, rather than having to blindly build a “normality profile” that would flag as malicious traffic something as usual as the federation with another DNS server to delegate zones. In other words, algorithms need to evolve to understand why there is a particular pattern behind a particular behaviour, rather than learning and assuming it blindly. Additionally, the next step would be to build algorithms capable of providing expert knowledge, rather than needing humans in order to identify i.e. the patterns discovered by SOMs or clustering techniques. One of the concepts that seems to be gaining traction in this direction is the utilization of Bayesian Belief Networks (BNs) in order to create expert systems. BNs, also known as Causal Probabilistic networks are a way to represent relationships among different events in terms of probability. Finally, it’s important to keep working in the visualization of data to improve the ability of security analysts to understand a broader range of threats, in less time with less effort and resources committed to it. With the booming of Big Data, the ability to store and analyse immense amounts of data is becoming a pressing need where ML is playing an important role. However, it’s not only important to be able to analyse it, but also to present it in a format that can be easily understood at multiple levels in an organization. Data Applications of Artificial Intelligence (AI) to Network Security 14 visualization is, therefore, one of the aspects where ML will most likely play a prominent role in the future. Conclusion The IT market has, a tendency to quickly assimilate buzz words pushed by marketing departments. During the last years, technologies such as Big Data, Cloud Computing, Artificial Intelligence, etc., have been repeated again and again in multiple forums, in many cases without a clear understanding of their significance or their application to solving real problems effectively. It’s a known fact that when humans don’t completely understand a technology, two kinds of effects usually occur: either the technology is irrationally rejected (e.g. new operating systems) or, if it’s properly marketed, it’s assumed to be the silver bullet capable of solving every problem (Artificial Intelligence). It usually takes some time, even years, for the dust to settle down and for the market to realize the true potential of it. The irruption of ML in in Cyber Security is forcing a paradigm shift from proactive rule-based prevention, to reactive real-time detection. Security threats have become so varied, different and smart, that traditional techniques, based on rules inferred from known attacks, that stop the attack before it happens, don’t seem to be a viable approach anymore. Many attacks escape these mechanisms and cause tremendous damage that can’t be stopped once it has started. ML aims at identifying attacks in real-time, with little to no human interaction and stopping them before they provoke serious harm. We can conclude that Artificial Intelligence is not being used nowadays, as it’s expected to be, to solve Network or Cyber Security problems in general. For now, only Machine Learning, a branch of AI, is being successfully applied to solve a small part of the problems. Supervised ML has delivered a number of interesting practical solutions, however, there is ongoing research, particularly towards the utilization of Unsupervised ML, as the Applications of Artificial Intelligence (AI) to Network Security 15 ultimate goal is to reduce human interaction as much as possible when detecting threats. The only viable way to evolve Security and get AI closer to what it’s expected to deliver is to keep investigating and find new techniques capable of providing context, expertise and enhanced data visualization, as well as achieving a tighter integration with Data Science techniques and ML-enhanced data analytics. Applications of Artificial Intelligence (AI) to Network Security 16 References ABI Research. (2017, January 30). Machine Learning in Cybersecurity to Boost Big Data, Intelligence, and Analytics Spending to $96 Billion by 2021. Retrieved March 24, 2018, from https://www.abiresearch.com/press/machine-learning-cybersecurity-boostbig-data-inte/ Alghamdi, R. (2016). Hidden Markov Models (HMMs) and Security Applications. International Journal of Advanced Computer Science and Applications, 7(2). doi:10.14569/ijacsa.2016.070205 Crosby, S. (2017, August 21). Separating fact from fiction: The Role Of Artificial Intelligence In Cybersecurity. Retrieved March 16, 2018, from https://www.forbes.com/sites/forbestechcouncil/2017/08/21/separating-fact-fromfiction-the-role-of-artificial-intelligence-in-cybersecurity/2/#47045fb329bc Darktrace. (n.d.). Technology. Retrieved March 15, 2018, from https://www.darktrace.com/technology/ Honkela, T. (2011). Multimodally Grounded Translation. Retrieved March 20, 2018, from http://lodel.irevues.inist.fr/tralogy/index.php?id=259&format=print Kanal, E. (2017, January). Machine Learning in Cybersecurity. Carnegie Mellon University – Software Engineering Institute. Retrieved March 9, 2018 from https://insights.sei.cmu.edu/sei_blog/2017/06/machine-learning-in-cybersecurity.html Machine Learning Techniques Applied to Cyber Security. (2017, September 10). Retrieved March 18, 2018, from https://towardsdatascience.com/machine-learning-techniquesapplied-to-cyber-security-d58a8995b7d7 Marty, R. (2018, January 01). AI and Machine Learning in Cyber Security – Towards Data Science. Retrieved March 16, 2018, from https://towardsdatascience.com/ai-andmachine-learning-in-cyber-security-d6fbee480af0 Applications of Artificial Intelligence (AI) to Network Security 17 Marty, R. (2018, January 11). AI in Cybersecurity: Where We Stand & Where We Need to Go. Retrieved March 12, 2018, from https://www.darkreading.com/threatintelligence/ai-in-cybersecurity-where-we-stand-and-where-we-need-to-go/a/did/1330787 McHugh, J. (2000). Testing Intrusion detection systems: A critique of the 1998 and 1999 DARPA intrusion detection system evaluations as performed by Lincoln Laboratory. ACM Transactions on Information and System Security (TISSEC), 3(4), 262-294. Retrieved March 12, 2018. Microsoft. (2017, December 18). How to choose machine learning algorithms. Retrieved March 24, 2018, from https://docs.microsoft.com/en-us/azure/machinelearning/studio/algorithm-choice MIT. (n.d.). DARPA Intrusion Detection Data Sets. Retrieved March 17, 2018, from https://www.ll.mit.edu/ideval/data/ Morgan, S. (2017, June 06). Cybersecurity labor crunch to hit 3.5 million unfilled jobs by 2021. Retrieved March 10, 2018, from https://www.csoonline.com/article/3200024/ security/cybersecurity-labor-crunch-to-hit-35-million-unfilled-jobs-by-2021.html Kh, R. (2017, December 01). How AI is the Future of Cybersecurity. Retrieved March 10, 2018, from https://www.infosecurity-magazine.com/next-gen-infosec/ai-futurecybersecurity/
2cs.AI
Composing DTI Visualizations with End-user Programming Haipeng Cai, Jian Chen, Alexander P. Auchus, and David H. Laidlaw arXiv:1310.2923v1 [cs.GR] 10 Oct 2013 A BSTRACT We present the design and prototype implementation of a scientific visualization language called Z IFAZAH for composing 3D visualizations of diffusion tensor magnetic resonance imaging (DT-MRI or DTI) data. Unlike existing tools allowing flexible customization of data visualizations that are programmer-oriented, we focus on domain scientists as end users in order to enable them to freely compose visualizations of their scientific data set. We analyzed end-user descriptions extracted from interviews with neurologists and physicians conducting clinical practices using DTI about how they would build and use DTI visualizations to collect syntax and semantics for the language design, and have discovered the elements and structure of the proposed language. Z IFAZAH makes use of the initial set of lexical terms and semantics to provide a declarative language in the spirit of intuitive syntax and usage. This work contributes three, among others, main design principles for scientific visualization language design as well as a practice of such language for DTI visualization with Z IFAZAH. First, Z IFAZAH incorporated visual symbolic mapping based on color, size and shape, which is a sub-set of Bertin’s taxonomy migrated to scientific visualizations. Second, Z IFAZAH is defined as a spatial language whereby lexical representation of spatial relationship for 3D object visualization and manipulations, which is characteristic of scientific data, can be programmed. Third, built on top of Bertin’s semiology, flexible data encoding specifically for scientific visualizations is integrated in our language in order to allow end users to achieve optimal visual composition at their best. Along with sample scripts representative of our language design features, some new DTI visualizations as the running results created by end users using the novel visualization language have also been presented. Keywords: End-user programming, visual language design, scientific visualization, DTI Index Terms: H.5.2 [User Interfaces]: Programming Language— ; I.3.6 [Methodology and Techniques]: Languages— 1 attributed to their capabilities of empowering users to design their own visualizations, what if domain scientists have a visualization tool that is powerful but easy to maneuver so that they can fully control the design elements and visual components to create whatever visualization they really want in mind? A recent advanced MRI technique, diffusion tensor imaging (DTI) has proven advantageous over other imaging techniques in that it enables in vivo investigation of biological tissues and, through three-dimensional (3D) tractography [8], explorations of the distribution and connectivity of neural pathways in fibrous tissues like brain whiter matter and muscles. Further, as one way to visualize DTI data, 3D visualization of the streamline data model derived from the tractography can illustrate the connectivity of fiber tracts and structures of anatomy, and therefore provides a powerful means that assists neuroscientists in clinical diagnosis and neurosurgical planning. We proposed a visualization language as the first tool of this kind for DTI visualizations because DTI is complex enough to stimulate a design that would be useful for simpler and similar visualization problems such as that of flow visualization. Although mainly driven by neurologists’ need for conducting their clinical tasks with DTI visualizations, our language design would also be reusable in a broader range in 3D SciVis. Motivated by the needs of spatial explorations in 3D scientific visualizations because of the spatial constraints within the data, the present language is particularly useful in empowering domain scientists to build 3D visualizations that best meet their specific needs. Furthermore, the language can facilitate domain scientists’ effective use and exploration of the visualizations as well, because it allows them to customize essential elements of visualization with the maximal flexibility by applying their best understanding of the domain data to the visualization composition process. Illuminated by Bertin’s Semiology of Graphics [9], we design the language to allow users to compose symbols in 3D visualizations, including visual encoding methods and other causes that affect visualization task performance. I NTRODUCTION Visualization tools often support user customization, which allows changes of the visualization so as to help users gain better understanding of the underlying data thus to facilitate knowledge discoveries about the data that would be hard to achieve otherwise. However, the support of user creativity is usually constrained by the limits of predefined options or functionalities for the customizations. An effective way to address these constraints is to offer users a programming environment in which they can freely compose towards desirable visualizations of their data through a visualization language. While such languages have been proposed and successful in the information visualization (InfoVis) community [17, 25, 12], there is a lack of end-user visualization language for 3D scientific visualization (SciVis). Based on our many discussions with domain users, we have recognized that domain scientists want a visualization of their own data to be designed and built by themselves. Now that the success of visualization languages for InfoVis is probably Figure 1: A screenshot of the Z IFAZAH programming interface, consisted of a programming text board (upper left), a simple debugging output window (bottom left) and the visualization view (right). To capture the design elements of the language, we have conducted experimental studies with domain scientists in DTI who are expected users of our language and summarized design principles for the language out of their descriptions of visualization making and exploration, from which basic lexical terms such as verbs, prepositions and conjunctions were also reduced. With these principles and language elements, we have developed a language prototype, named Z IFAZAH, as an initial implementation of the visualization language we are proposing. To target non-programmer users like neural medical doctors, Z IFAZAH is designed to be a high-level declarative language. Also, for an easier usage for users without any programming skills and experiences, Z IFAZAH is currently developed as a procedural language that contains only an intuitive type of control structure, i.e. the sequential structure. As such, users can write Z IFAZAH scripts simply as if they verbally describe the process of authoring visualizations in sequence. Figure 1 gives an outlook of the Z I FAZAH programming interface. The following usage scenarios briefly show the utility of Z I FAZAH . In the first scenario, an end user first loads a whole DTI model and then programs to vary tube size in the default streamtube visualization by fractional anisotropy and tube color by fiber distance to the viewing point in a specific brain structure. In the end of his task, the user can change the streamtube representation of another brain region to ribbons. In the second one, an user filters fibers according to an estimate of linear anisotropy threshold and then gradually adjusts the threshold until satisfied. The user then further cuts off the selected fibers outside a target brain region through spatial commands with precisely calculated movements and thus reaches the tubes of interest. As the final example, an user can get the size of a brain structure in terms of the number of fibers, average fractional anisotropy in a brain region, and other common DTI metrics after reaching the target fibers. In each of these scenarios, the user achieves each step by writing a declarative program statement in the script editor and the results are reflected in the visualization view (see section 5). Apart from a visualization language that helps domain scientists build DTI visualizations by themselves to exactly meet their specific needs with the visualizations, our work also contributes several design features to general DTI visualizations including: (1) visual symbolic mapping based on color, size and shape, as is new for scientific visualizations, (2) lexical representations of spatial relationships for 3D object visualization and manipulations and (3) data encoding flexibility built upon the migration of Bertin’s semiological principles to scientific visualizations. The following snippet gives a quick view of how a Z IFAZAH program looks like. This script describes an exploratory process of an end user with the streamtube model [32] of a human brain DTI data set, in which different fiber bundles (CC, CST, etc.) are filtered according to threshold of DTI metrics (LA, FA, etc.) and customized with various visual encoding methods (shape, color, size, etc.). LOAD "/tmp/allfb_tagged.data" SELECT "CC" SELECT "FA in [0.2,0.25]" IN "IFO" UPDATE color BY FA IN "CC" SELECT "LA > 0.35" IN "CST" UPDATE shape BY line IN "CC" UPDATE shape BY tube IN "IFO" UPDATE size BY FA WITH 0.1,20 IN "IFO" As shown in this example, a Z IFAZAH program is essentially an intuitive sequence of steps each carrying out a single visual transformation of data. Although the script is written in a textual form as in a traditional computer programming language, each of the statements is more like a high-level command. Also, there is no any other logic structures than the sequential one in Z IFAZAH, which makes this language fairly easy to learn and use for end users in medical field. The rest of this paper is organized as follows. We first give general background and discuss related work in Section 2. In Section 3 we detail design principles and supporting language elements and then brief implementation issues in the following Section 4. Section 5 expands the details of the three usage scenarios introduced above and gives the corresponding Z IFAZAH scripts and running results. We discuss other design features of our language that have not yet been fully implemented but are integral to our overall language design in Section 6 before finally concluding the paper in Section 7. 2 BACKGROUND AND R ELATED W ORK In this section, we describe previous work related to our visualization language design and especially compare them against Z I FAZAH . 2.1 Visualization of DTI Models In general, DTI data set can be visualized using various approaches ranging from direct volume rendering of tensor field [21] to geometry rendering of the fiber model derived from tensor field. With geometry rendering, DTI fibers are usually depicted as streamlines [20], streamtubes and streamsurfaces [32]. In order to explore 3D visualizations of the fiber geometries, 2D embedding and multiple coordinated views [19] along with various interactive techniques [10, 29] have been employed. Many other powerful tools have also been developed for exploring DTI visualizations [6, 19, 13, 7, 10]. However, due to the data complexity, domain users’ needs for performing their various tasks in daily practice have not yet been fully satisfied by using those tools. To give users more flexibility, some of the visualization tools are made highly configurable by allowing a wide range of settings [31, 29]. Nevertheless, it is still challenging to design a thoroughly effective visualization tool to meet all the needs of users. For instance, although sometimes able to meet specific requirements, higher flexibility of a visualization tool may even make the tool more complex to use for domain users [22]. 2.2 Composable Visualizations Since pioneered the automatic generation of graphic representation [24], Mackinlay’s work has been extended lately into a visual analysis system armed with a set of interface commands and defaults representing the best practices of graphical design [25], upon which a commercial software Tableau was developed. In his work, the generation of visualizations was automated thanks to the application of a series of design rules and made adaptable to users with a wide range of design expertise via constrained flexibilities by those design rules. With Z IFAZAH, we also intend to provide an environment in which end users can flexibly build their own visualizations like Tableau. However, instead of targeting visual analysis in the context of two-dimensional (2D) information visualization, Z IFAZAH primarily aims at end-user visualization making and exploration with 3D scientific data such as DTI. Also, compared to the visual specifications in Tableau like those in its predecessor Polaris [30], textual programming is the main means for end users to interact with visualizations of interest in Z IFAZAH. Similar to Polaris in terms of using visual operations to build visualizations, the tool designed in [29] aims to support retrieving DTI fibers instead of querying relational database in Polaris. As a toolkit, ProtoVis gives users high-level usage flexibility even programmability yet imposes constraints upon user programs through implicit rules to produce effective visualizations [12]. This tool has been evolved into its descendant named D3 [27] for a better support of animation and interaction. Z IFAZAH shares some Protovis features like addressing non-programmer audience and having concise and easy-to-learn grammar. However, different from Protovis that uses simple graphical primitives called marks to construct information visualizations and mainly targets web and interaction designers, Z IFAZAH targets neuroscientists instead and enables them not only to flexibly construct but effectively explore in the context of scientific visualizations exemplified by that of DTI data. 2.3 Visualization Languages Processing [17] is more a full-blown programming language and environment than a traditional visualization tool. Built with the full Java programming language facilities, Processing integrates the underlying visual design rules to help user build beautiful yet informative visualizations with the support of interaction design. Although developed to be accessible for new users and non-programmers, Processing is more oriented to users with certain level of programming skills and might be still challenging for domain users like neuroscientists who are the primary audience we address. A sister visual programming language of Processing, Processing.js [2] also targets web developers. By contrast, Z IFAZAH is distinct in that it empowers end users to explore scientific data through intuitive syntax within a sequential structure rather than offering a full set of programming features in a traditional computer language as Processing does. Like Z IFAZAH, Impure [1] is also a programming language for data visualizations that targets non-programmers. Although supporting various data sources, this completely visual language is developed for information design and rather than for scientific visualizations. Although a natural language like WordsEye [11] for visualizations might be appealing to ordinary users without any programming knowledge, we do not attempt the entirely descriptive nature for Z IFAZAH as WordsEye did at current stage. In terms of lexical and syntax design, Z IFAZAH is similar to Yahoo!’s Pig Latin [14], which is a new data processing language associated with Yahoo! Pig data handling environment that balances between a declarative language and a low-level procedural one. The language supports data filtering and grouping with parallelism by its map-reduce programming capability. However, this language did not handle visualizations or any form of graphical representations but focusing on ad-hoc data analysis. Also, Z IFAZAH sets it apart from Pig Latin in the target audience again since the latter mainly served software engineers. The Protovis specification language [18] is a declarative domainspecific language (DSL) that supports specification of interactive information visualizations with animated transitions, providing an approach to composing custom views of data using graphical primitives called marks that are able encode data by dynamic properties, which is similar to the mapping of object properties to graphical representations in another InfoVis language presented by Lucas and Shieber [23]. To some extent, both languages are comparable to the Microsoft’s ongoing project Vedea aimming at a new visualization language [4] in terms of syntactic design and programming style, although its design goals are closer to that of Processing. Also in the InfoVis domain, Trevil [3] is a programming language based on its predecessor Trevis [5], a framework used for context tree visualization and analysis. It supports composing visualizations but dedicates to the visualization of unordered trees. Another specific-purpose language is one presented in [28] that serves the composition of visualizations of mathematical concepts like those in basic algebra and calculus. Recently Metoyer et. al. [26] report from an exploratory study a set of design implications for the design of visualization languages and toolkits. More specifically, their findings inform visualization language design through the way end users describe visualizations and their inclination to using ambiguous and relative, instead of definite and absolute, terms that can be refined later via a feedback loop provided by the language. Emphatically, their findings also disclose that end users tend to express in generally high-level semantics. During the design of our visualization language, we have benefited from these findings and actually have reflected them in the development of Z IFAZAH. 3 L ANGUAGE D ESIGN In this section, we first summarize end-user descriptions on composing DTI visualizations from which design requirements and principles, as follow a summary of the language symbols and description of Z IFAZAH data model, are extracted and motivated respectively. The development of Z IFAZAH is driven by end-user requirements with DTI visualizations and the design principles are embodied in the language features of Z IFAZAH. After each of the language features, Z IFAZAH language elements that meet the feature are detailed, including related lexical terms and syntactic patterns. Instead of describing the implementation techniques, which are briefed in Section 4, this section emphasizes how the design principles and language elements address the end-user requirements. 3.1 Design Motivations The design of Z IFAZAH is motivated by the needs of typical end users we target for composing DTI visualizations by themselves, which can be derived from their verbal descriptions about visualizations they would desire in our many interviews and discussions with them. We report just a few representative example comments of them on visualizations produced beforehand by computer scientists. Our participants include neurologists and neural physicians, both conducting clinical diagnosis with DTI data visualizations. In a typical interview, participants are presented visualizations of a same DTI brain data set composed differently by manipulating various visual elements and the compositions are done by computer scientists, who then revise the composing process according to the comments of participants. As results, either the unsatisfactory visualizations are finally modified to meet participants’ requirements or suggestions for achieving the desirable visualizations are received if current tool is not capable of composing the desirable ones. As an example, multiple visual mappings of depth values to size and color does not enhance the visualization of DTI model as expected. Surprisingly, “...it is misleading to have the different size” while color has already been used to discern depth, and “...would rather have it stay the same size as I spin it around.”. However, visual mapping of depth to color is still preferable since “...I like it with the color. That is what I need to look at”. Nevertheless, the composed coloring scheme in which color is mapped by depth might be also useful “...if determined by the principal eigen values”. And, “...I think that color is a good idea but prefer color by orientation...”, etc. There is also a call for doing analysis in the composing environment (“...Also, one thing for fibers, I am looking at for analysis purposes”). Emphatically, both classes of participant unanimously “want to do the analysis over here on the same page, that will be good, too, rather than opening it up again and trying to do it... It will all come together. It will all be integrated into one...”. These observations all suggest that domain users, exemplified by the typical end users of Z IFAZAH above, potentially ask for a highlevel tool allowing them to define a self-control sequence of operations that works towards a visualization precisely meeting their own specific needs. By allowing users to compose with well-designed visual elements, a programming environment can provide the capabilities for neurologists to create their own visualizations, by which our present work is justified. Furthermore, our work with Z IFAZAH is substantially grounded upon the semiology of the graphic sign-system and especially the taxonomy about the properties and characteristics of retinal variables [9] in terms of the syntax and semantics design for the scientific visualization language. Z IFAZAH incorporates a subset of the properties and characteristics that are most relevant, according to neurologists’ verbal descriptions about DTI visualizations, to the language structure and content: size variation, color variation and shape variation. For one thing, corresponding syntax terms are built into the language core as basic symbols. For another, semantics associated with these terms are designed to support composing DTI visualizations with respect to these retinal variables by allowing free manipulations of the attributes of related variables. While the semiology and taxonomy is originally formulated to guide the design of 2D graphical representations, we extend them into the 3D graphical environment and employ in the case of DTI visualizations. Further, we expand the scope of this taxonomy particularly for 3D visualizations by including a dimension related to depth perception, called ”depth separation” in our language design in addition to the legacy retinal dimension. Correspondingly, composing the depth separation is enabled through built-in support in Z IFAZAH. Primary visual elements such as value, transparency, color and size are employed once again but now for the purpose of the depth-dimension composition. It is fairly noteworthy, and common as well, in participants’ verbal descriptions that spatial terms are frequently used and most of the terms related to spatial locations are relative rather than measured in precise units. That Z IFAZAH is designed to be a spatial language is exactly in response to the concerns of our target end users with the spatial relationship of data components in the scientific data model being visualized. The participants’ descriptions are also in accordance with the fact that spatial constraint is a defining data characteristic scientific visualization. Consequently, Z IFAZAH includes a set of syntactic and semantic supports for spatial operations in order to meet end-user needs for composing 3D scientific visualizations like that of DTI models. Intending to be an initiative of an end-user programming approach to scientific visualizations, Z IFAZAH is designed to support an environment in which domain scientists as end users can compose highly customizable visualizations reflecting their thinking process with the graphical representations of their data set. Since Z IFAZAH is incubated from DTI visualizations, the language design primarily deals with DTI data. In this context, language elements of the present Z IFAZAH are derived from experimental study with neuroscientists using diffusion MRI data models. As a matter of fact, the symbols and syntax of current Z IFAZAH are extracted from verbal descriptions of neurologists using DTI about how they would create and explore DTI visualizations. As we often refer as end users, neuroscientists, neurologists and other medical experts who conduct clinical practice with DTI data and its visualizations are the primary audience our Z IFAZAH language targets. 3.2 Language Symbols The core content of Z IFAZAH itself is a simple set of language symbols and keywords. End-user actions intended with DTI visualizations are triggered through five key verbs that are all complete words in natural English. Prepositions are used for targeting scope of data of interest and conjunctives for connecting statement terms. All operators used in Z IFAZAH are exactly the same as those used in elementary math. Specifically, [] serves range operator here for giving a numerical bound that is used in conditional expressions and + and − are relative (increment and decrement) operators rather than serving arithmetical operations (addition and subtraction). Several built-in routines are provided in Z IFAZAH for simple data statistics and analysis in DTI visualizations: AvgFA and AvgLA calculates the average FA and average LA of a scope of fibers respectively, and NumFiber stats the number of fibers in a fiber bundle. Among the reversed Z IFAZAH constants, the aforementioned five major fiber bundles in human brain model are included. In these language symbols, all verbs and prepositions are directly picked up from our neurologist collaborators’ common descriptions of visualization composition and exploration in natural language. Fiber bundle constants are also suggested by them and operators, built-in routines and other constants are reduced from our requirement analysis of their verbal descriptions. As shown in the Table 1, current Z IFAZAH implementation contains a small set of symbols. However, our language has been designed to be scalable to increase in each type of the symbols listed in terms of implementation techniques. Table 1: Z IFAZAH language symbols and keywords Verbs Prepositions Conjunctives Operators built-in routines Constants 3.3 LOAD, SELECT, LOCATE, UPDATE, CALCULATE IN, OUT BY, WITH [], <, <=, >, >=, ==, =, +, − AvgFA, AvgLA, NumFiber shape, color, size, depth, FA, LA, sagittal, axial, coronal, CC, CST, CG, IFO, ILF DEFAULT, RESET Data Model and Input To meet the design goals when targeting our domain end users, our visual language is intended to be straightforward for programming. Therefore, Z IFAZAH does not involve any distinction of specific data types. It does not require uses to deal with any low-level data processing procedures either. Instead, Z IFAZAH focuses on visual transformations in 3D visualization. As previous examples disclose, we have used a classified geometrical data model derived from DTI volumes, in which fibers are clustered in terms of brain anatomy. In our present data model as input to Z IFAZAH, each fiber has been manually tagged with anatomical cluster identity as one of the five major bundles. In practice, Z IFAZAH’s ability to recognize the constants for the major anatomical bundles depends on these cluster tags in the structure of the data model input. However, our language design is not restricted to only handling clustered data. Actually, Z IFAZAH is freely adaptable to an unclustered data model, although data target specification with the major bundle constants will be processed as the whole model then. Nevertheless, Z IFAZAH’s capability of spatial operations empowers users to explore ROIs in the unclustered data models. In a Z IFAZAH program, the first step is to indicate the source of data model by giving the name of a data file. As an example, a Z IFAZAH data input statement is written as: normalBrain = LOAD "data/normalS1.dat" where the LOAD command parses the input file and creates data structures that fully describe the data model, including to identify the cluster tags. This input specification statement can also update current data model at the beginning of the visualization pipeline if it is not the first step in a Z IFAZAH script. The evaluation is optional and, when provided, saves the result to a variable (normalBrain here) for later references. This is not used in current version of Z I FAZAH but is required for exploring multiple data sets concurrently (see Section 6). 3.4 Task-driven Language The language design of Z IFAZAH is originally driven by the visualization tasks that domain users need to perform in their ordinary clinical practices. Among others, some of their typical tasks are (1) checking integrity of neural structures of a brain as a whole, (2) examining fiber orientation in a region of interest (ROI) or fiber connectivity across ROIs, (3) comparing fiber bundle sizes between brain regions, (4) tracing the variation of DTI quantities such as FA along a group of fibers and (5) picking particular fibers according to a quantitative threshold, etc. When using DTI visualizations, not only looking for the whole data model, neurologists are also inclined to concentrate on regional details. In the case of brain DTI visualizations, they often narrow down the view scope toward a relatively large anatomical area in the first place and then dive into a specific ROI. In other words, they tend to pay more attentions to ROIs than to the whole brain. More specifically, in the visualizations where neural pathways are depicted as streamtubes, the ROIs are usually clusters of fiber tracts called fiber bundles. For instance, at the beginning of a visualization exploration, one of our neurologist collaborators intends to look into frontal lobe fibers within the intersection of two fiber bundles, CST and CC, and ignores all other regions of the model. Further, suspicious of fibers with average FA under 0.5 for a cerebral disease with which the brain is probably afflicted, the user goes on to examine exactly the suspect fibers. Later on, the user focuses on the small fiber region to see how it differs from typical ones, in terms of orientation and DTI metrics, say. Z IFAZAH is designed as a task-driven language to support this requirement process through high-level primitives such as SELECT and common arithmetical conditional operators including a range operator in. Z IFAZAH is mainly featured with facilities for stepby-step data filtering with these primitives. For example, suppose the user above is to explore the fibers of interest, he can write in Z IFAZAH as: SELECT "FA < 0.5" IN "CST" SELECT "FA < 0.4" IN "CC" As the result, fibers in both interested bundles with average FA under 0.5 will be highlighted to help users focus on the local data being explored. On top of this, the user can customize the visualization of the filtered fibers through various visual encoding methods using the UPDATE syntax. This is particularly useful when he wants to keep the data already reached in focus before moving to explore other relevant local data in order to add more fibers into his focus area, or when he simply seeks for a more legible visualization of the data firstly reached. The instance below, following the same example, illustrates how a better depth perception achieved by a type of depth encoding, together with a differentiating shape encoding, are added up to the two selected fiber bundles respectively. SELECT SELECT UPDATE UPDATE "FA < "FA < depth shape 0.5" IN "CST" 0.4" IN "CC" BY color IN "CST" BY ribbon IN "CC" This simple sequence of commands help users locate desirable fiber tracts with high accuracy while allowing flexible customization upon current visualizations. With this language, users compose intuitive steps to finish their tasks that are difficult to achieve by visual interactions. In this case, tracts of interest (TOIs) are first focused and then further differentiated for more effective exploration through improved legibility. In general, Z IFAZAH design emphasizes this task-driven process of visualization exploration, which fits the thinking process of end users with the present visualizations. Figure 2 shows the resulting visualization. Figure 2: Illustration of the task-driven design of Z IFAZAH. Filtering data in order to reach a ROI is an operation quite, nearly the most, frequently used during our neurologist collaborators’ explorations in DTI visualizations. Z IFAZAH offers two commands for data filtering: SELECT and LOCATE. The data filtering syntax pattern in Z IFAZAH is: SELECT condition|spatialOperation IN|OUT target result = LOCATE condition IN|OUT target With similar functionality, these two commands have different semantics: SELECT executes filtering in an immediate mode by highlighting target fibers while LOCATE commits an offline filtering operation, retrieving target fibers and sending the result to a variable without causing any change in the present visualization. Also, SELECT provides relative spatial operations through moving anatomical cutting planes. In fact, it is tempting to combine these two commands into one while differentiating the two semantics (by recognizing the presence of variable evaluation and taking spatial operations as an alternative to the condition term). However, we still keep these two commands separately based on end-user comments asking for a more straightforward understanding of the semantics and easier memory of language usage. For example, SELECT "LA <= 0.72" IN "ALL" partialILF = LOCATE "FA in [0.5,0.55]" OUT "ILF" The SELECT statement will filter fibers in the whole DTI model with average anisotropy greater than 0.72 (by putting them in the contextual background) and highlight all other fibers. In comparison, the LOCATE statement will not update the visualization but pick up fibers outside the ILF bundle having average FA value in the specified range. Note that when no specific data encoding applied, different colors will be applied to ROI fibers in different major bundles in Z IFAZAH for discerning one ROI from another when there is more than one highlighted. Also, filtered fibers will still be in semi-transparency as the contextual background rather than being removed from the visualization. 3.5 Data Encoding Flexibility According to Bertin’s semiotic taxonomy [9], graphically encoding data with key visual elements such as color, size and shape play a critical role in the legibility of 2D graphical representations. In 3D visualizations, occlusion effect, an import factor considered in depth perception, has detrimental effects on impact on the overall legibility, and depth cue (DC) is an ordinal dimension in the design space of 3D occlusion management for the visualizations [16]. Therefore, we combined both aspects in our Z IFAZAH language design: symbolic mapping of color, size and shape for 2D graphical legibility enhancement and depth encoding, also via common visual elements such as color, size, value (amount of ink) and transparency, as depth cues for occlusion reduction in the 3D environment. As already shown in the previous example scripts, Z IFAZAH allows end users to freely customize DTI visualizations using either a single data encoding scheme alone or compound encoding scheme by flexibly combining multiple encoding methods. The latter leads to a mixed visualization as illustrated in Figure 1. In their composing or exploratory process with DTI visualizations, users often attempt to examine more than one data focus simultaneously and would like to differentiate one focused ROI from others so that they will not get lost themselves within the multiple ROIs. There are also other occasions under which the users have difficulty in navigate along the depth dimension even in a single ROI. The data encoding flexibility in Z IFAZAH is driven by both of the two user attempts. For an example, suppose a user has composed the streamtube visualization of a brain DTI data set with default data encoding (uniform size, color and shape without depth cues) and now wants the overall encoding scheme to be different across fiber bundles. In order to achieve this effect, an example Z IFAZAH snippet can be written as follows: SELECT UPDATE UPDATE UPDATE UPDATE UPDATE "ALL" shape BY LINE IN "CST" size BY FA IN "CG" color BY FA IN "IFO" depth BY transparency IN "CG" depth BY value IN "CC" WITH 0.2,0.8 UPDATE depth BY color IN "ILF" Then, in the resulting visualization, each of the five major bundles will be visually disparate from others since all these bundles are encoded differently. Figure 3 shows the resulting visualization. Z IFAZAH allows users to impose various data encoding schemes upon data targets. Such visualization customization is done by the UPDATE command, which always works in an immediate mode causing update in the current visualization after execution. The general UPDATE syntax pattern is: UPDATE var1 BY var2 WITH para1,...,paraN IN|OUT target where var1 indicates an attribute, such as shape, color, size, depth, etc., of current visualization to be modified, and var2 gives how the actual updating operation is to be performed in terms of its relation to var1. The parameter list ending the statement presents extra information the updating requires, as is specific to a particular data encoding operation. Like the target specification (optional with all commands as stated before), the BY clause and WITH clause are both optional. Table 2 lists all possible combinations of var1, var2 and associated parameter list already developed in present Z IFAZAH. In the table, “lower,upper” gives the bound of Table 2: Combination rule of constants in UPDATE statement of current Z IFAZAH implementation var1 var2 parameters shape color size depth line, tube, ribbon FA, LA FA, LA size,color,value, transparency N/A N/A N/A N/A minimal,scale lower,upper DEFAULT RESET N/A N/A depth mapping and “minimal,scale” indicates the minimum and the scale of variation in size encoding. DEFAULT and RESET, when going with the verb UPDATE, act as a command for revoking all data filtering and data encoding operations respectively. The following script shows how to inspect the change of FA along fibers in a ROI by mapping FA value to tube size, which results in a more intuitive perception of the FA variation in that ROI. UPDATE RESET partialILF = LOCATE "FA in [0.5,0.55]" OUT "ILF" UPDATE size BY FA IN "partialILF" Figure 3: Flexible data encoding built in the design of Z IFAZAH. Oftentimes, once one ROI or more filtered out, it is also necessary to examine the selected fibers more carefully. For this purpose, 3.6 Spatial Exploration One of our main design goals with Z IFAZAH is to provide a language with which users are able to operate spatial structures. We found that our neurologist collaborators tend to frequently use spatial terms such as “para-sagittal”, “in”, “out”, “mid-axial” and “near coronal”, etc. in their descriptions about DTI visualizations in the 3D space. They also use a set of other general spatial terms including “above”, “under”, “on top of”, “across” and “between”, etc. like those found in [26] and more domain-specific ones such as “frontal”, “posterior” and “dorsal”, etc. At present stage, Z IFAZAH only contains a subset rather than all of these spatial terms. In such a 3D data model as that from DTI, spatial relationships between data components are one of the essential characters, which are actually typical of 3D scientific data in general. Accordingly, composing a DTI visualization necessitates the capability of using spatial operators with domain conventional terms in order to describe the process of visualization authoring. In response, Z I FAZAH supports spatial operations through two approaches combined. First of all, three visible cutting planes that help guide in the three conventional anatomical views, namely the axial, coronal and sagittal view respectively, are integrated in the visualization view (see Figure 1). Then, flexible manipulating operations upon the three planes are built into the Z IFAZAH spatial syntax definitions. This enables end users to navigate in the dense 3D data model with a highly precise filtering capability exactly as they examine a brain model in clinical practice. For instance, suppose the streamtube representation of a DTI model being programmed is derived using unit seeding resolution from DTI volumes with a size of 256 × 256 × 31 captured at a voxel resolution of 0.9375mm × 0.9375mm × 4.52mm, and suppose both the axial and coronal planes are located at their initial position so that nothing is cut along these two views. In order to examine suspect anomaly in the brain region of occipital lobe, a medical doctor attempts to filter the data model as such that approximately only this region will be kept. For this task, the corresponding Z IFAZAH script can be written as: SELECT "coronal +159.25" SELECT "axial -27.5" Similarly, relative movements can be imposed on the sagittal plane as well. These simple relative operators included in Z IFAZAH in support of spatial exploration is also informed by the design implications given in [26] although mainly comes from user requirements of performing DTI visualization tasks pertaining to spatial operations. Figure 4 shows the resulting visualization. these two missed control structures through two approaches addressing the requirements for them. First, requirement for an iteration structure usually stems from the needs to operate on multiple targets. Here in Z IFAZAH, operation target is a common term in all syntax patterns to indicate the scope of data to focus on. We address this requirement through enumeration and target term defaults in Z IFAZAH syntax patterns. On the one hand, with enumeration, end users simply list all targets in the target term to avoid iteration. For example, suppose a user intends to select three bundles and then to change size encoding for two of them, his Z IFAZAH script can include: SELECT "CST,CC,CG" UPDATE size BY FA IN "CST,CG" As such, no iteration structure for looping through the multiple targets is needed. On the other hand, with term default, when missing a target term in single statement, ”ALL” will be assumed as a default scope meaning the whole data model to be the target. This rule is applicable for all types of Z IFAZAH statement, which means that target term is optional in all Z IFAZAH syntax patterns. Second, requirement for a conditional structure comes from users’ requests for a means to express conditional processing. For example, they often filter fibers according to FA thresholds. In Z I FAZAH , conditional expression can be flexibly embedded in a statement to avoid this structure. It has been shown in previous examples how to embed conditional expressions in SELECT statement. For syntactic simplicity, condition is expressed in UPDATE statement indirectly through variable reference as the following another example snippet shows. suspfibers = LOCATE "FA in [0.2,0.25]" IN "CST,ILF" UPDATE size BY FA IN "suspfibers" where LOCATE is an alternative to SELECT but it results in a storage of the fibers filtered into a variable for later reference instead of highlighting those fibers immediately as SELECT does (see Section 3 for detailed language elements). Figure 5 shows the resulting visualization. Figure 4: Illustration of the design of Z IFAZAH as a spatial language. 3.7 Flat Control Structure Our another main design goal with Z IFAZAH is to provide a declarative language environment for domain end users who have neither any programming skill and experience nor basic understanding of computer program structures. Consequently, we purposely eliminate the conditional and iteration structures from the language design of Z IFAZAH and only keep the most intuitive one, i.e. the sequential structure, since this simple structure is much more intuitive than the other two. This features Z IFAZAH with a flat control structure that is essential for achieving the design goal. Alternatively, Z IFAZAH uses high-level semantics to overcome its otherwise weakness in expressing user task requirements for lack of Figure 5: Illustration of the flat control structure of Z IFAZAH program. 3.8 Fully Declarative Language Since the end users of Z IFAZAH are medical experts who prefer natural descriptions to programming style of thinking according to our talks to them, elements even merely close to those in a computer programming language have been changed to be as declarative as possible. In Z IFAZAH, all types of statement are designed to be in a consistent pattern: started with a verb, followed by operations and ended by, optionally, data target specification, with optional evaluation of statement result to a variable for later reference if provided. This syntax consistency has been applied to even the data measurement statement where invocation of built-in numerical routines is involved. To measure the number of fibers in a selected bundle, for instance, instead of writing as: CALCULATE NumFibers("CST") users with Z IFAZAH write CALCULATE NumFibers IN "CST" In addition, all keywords in Z IFAZAH are case insensitive in order to reduce typing errors. Neuroscientists comment that these features make the language easy to learn and intuitive to use. Figure 6 shows the resulting visualization. Figure 6: Result of an example script showing Z IFAZAH as a fully declarative language. As exemplified above, besides visually examining the graphical representations, medical experts often need to investigate the DTI data itself in a quantitative manner. In clinical practice of neuroscientists using DTI, quantities such as average FA and number of fibers are important DTI tractography-based metrics for assessing cerebral white matter integrity [15]. In fact, these metrics are usually used in our end-user description of DTI visualizations as well. Accordingly, Z IFAZAH provides capabilities to calculate some DTI metrics most frequently used in end users’ practice of diagnosis through built-in numerical routines. The following pattern shows the Z IFAZAH data analysis syntax. val = CALCULATE metricRoutine IN|OUT target At current stage of Z IFAZAH development, metricRoutine can be one of AvgFA, AvgLA and NumFibers, whose functions have been described before. More routines can be extended later based on further comments of our end users. In this syntax pattern, keeping the resulting value by evaluation is optional and sometimes useful when being referred to afterwards (see usage scenario 3 described in Section 5). For example, in order to sum up fibers with average FA falling within a particular range and then figure out average LA of the target fibers, an end user can write following script in Z IFAZAH: frontalmix = LOCATE "FA >= 0.35" IN "CST,CC" CALCULATE NumFibers IN "frontalmix" CALCULATE AvgLA IN "frontalmix" After running, the script above will dump result in the output window in the Z IFAZAH programming environment as shown in Figure 1. 4 I MPLEMENTATION Z IFAZAH is declarative in its general form with support of certain programming language features such as variable referencing and arithmetical and logical operations. At this early stage, the language scripts are not executed via a fully-featured interpreter or compiler but a string-parsing based translator of descriptive text to visualization pipeline components and manipulations upon them. The core of Z IFAZAH is implemented on top of the Visualization Toolkit (VTK) using C++. The rendering engine is driven by the visualization pipeline and legacy VTK components ranging from various geometry filters to data mappers. However, in order to support language features such as mixed data encoding and depth mapping in Z IFAZAH, a group of new pipeline components like those for view-dependent per-vertex depth value ordering has been extended on top of related VTK classes, and many legacy VTK components have been tailored for specific needs of visualizations in Z IFAZAH. In particular, the core of Z IFAZAH, the script interpreter has also been implemented primarily as data filters in the VTK visualization pipeline. For instance, filtering according to thresholds of DTI metrics is developed as a set of separate VTK filters each serving a specific metric. As such, interpreting a Z IFAZAH script is to translate the text, according to defined syntax and semantics, to data transformations in the VTK pipeline. For achieving the data encoding flexibility, multiple VTK data transformation pipelines have been employed in current Z IFAZAH implementation. Additionally, the overall programming interface is implemented using Qt for C++. For example, interactions like triggering execution of a Z IFAZAH program, serializing and deserializing the text script, etc. are all developed with Qt widgets, although the interactions with the visualization itself are handled using legacy VTK facilities with necessary extensions. Figure 1 illustrates the outlook of current Z IFAZAH programming interface. Both the code editor and ”debugging” information window are of dockable widgets, which facilitate the script programming by allowing free positioning and resizing as opposed to the visualization view. Since our language is definitely non-programmer oriented, program debugging skills are not expected of users. Consequently, instead of building a full-blown debugging environment as seen in almost all integrated development environments (IDEs), we simply use a dockable output window to prompt users all error messages caused by invalid syntax or unrecognized language symbols. We have made use of GUI utilities of Qt for C++ to dump, after running a script, those messages to tell what and where is wrong in natural language description with different levels of errors (fatal, warning and notice, etc.) differentiated by different combinations of font size, type and color of the text. Resulting values out of running data analyzing statements are also displayed in this output window. We do not set a separate window for displaying those numerical results in order to simplify the programming interface and, alternatively, we use remarkably disparate text background and underscore to highlight them among other messages. Also, natural language description has been used to present those numerical results so that they are easy to read and understand for end users. Although there is no special requirement regarding hardware platform configuration, a high-speed graphics card like those having, for instance, 512M VRAM and 50MHz GPU is preferred for rendering the dense 3D DTI data model efficiently, which makes the Z IFAZAH programming environment work smoothly as a whole. 5 U SAGE S CENARIOS In this section, we describe several sample tasks done by neurologists with visualizations of a brain DTI model using the Z IFAZAH language. The usage scenarios associated with the sample tasks are representative of some typical real-world visualization tasks of neuroscientists and neurological physicians with expertise in DTI in their clinical practices. The usages range from visualization customization and exploration to DTI data analysis, covering the main language features and functionalities of our current Z IFAZAH implementation. In the following scenarios, Josh, an end user of Z IFAZAH, has a geometrical model derived from a brain DT-MRI data set wants to compose and explore visualizations of the data for diagnosis purpose. For each of the scenarios, Josh fulfills his task by programming a Z IFAZAH script that describes his thinking process for that task and then clicks the ”Run” button to execute the script. Josh programs with Z IFAZAH syntax references showing on a help window and corrects any term that is typed incorrectly with the assistance of error messages displayed in the output window. Once the script is interpreted correctly, either the visualization gets changed or numerical values coming out in the output window, as the results of script execution. Scripts and running results are presented at the end of the description of each usage scenario. 5.1 Scenario 1: composing visualizations To start with, Josh specifies a data file that contains the geometries of the brain DTI model using the LOAD command. As used in examples throughout this paper, the model contains five major fiber bundles that have been marked in its storage structure in a text file: corpus callosum (CC), corticospinal tracts (CST), cingulum (CG), inferior longitudinal fasciculus (ILF) and inferior frontal occipital fasciculus (IFO). By default, running this single statement gives a streamtube visualization of the model with uniform visual encoding across all major bundles and without depth encoding. Suspicious of the association of a known disease named CorpusCallosum-Agenesis (CCA) with the distribution of neural pathways at the intersection of the CC and CST bundles, Josh continues to customize the streamtube representation by mapping fractional anisotropy (FA) to tube radius along each CST fiber since he is interested in the FA changes of CST at the intersection, and encoding depth values of CC fibers to colors so that he can easily discern the genu and splenium fibers in the CC bundle along the depth dimension in the coronal view. Finally, josh also wants to highlight the IFO fibers preferably represented with ribbons. Since the IFO bundle is roughly perpendicular to the CST bundle, he likes to take it as a reference as well. To achieve this task, Josh wrote the final script after error corrections as follows and got the result in the visualization view as shown in Figure 7. LOAD "/home/josh/braindti.data" SELECT "CC,CST,IFO" UPDATE size BY FA IN "CST" UPDATE depth BY color IN "CC" UPDATE shape BY ribbon IN "IFO" Figure 7: Screenshot of the visualization resulted from running the Z IFAZAH program written in scenario 1. 5.2 Scenario 2: examining ROIs It is quite common that neurologists tend to examine particular regions of interest (ROIs) rather than the whole brain when using DTI visualizations. In this task, Josh is only interested in all fibers within the temporal lobe area that belong to the CG bundle and CST fibers in the parietal lobe area that have average linear anisotropy (LA) value no larger than a threshold to be determined. The SELECT command with relative spatial operations using the anatomical planes enables Josh to precisely reach the ROIs he desires. To start with, Josh firstly aims to filter fiber tracts outside the temporal and parietal area by adjusting the three cutting planes with relative movements and then starts trying to reach the exact target fiber tracts using both fiber bundle filters and conditional expression related to LA. With respect to the LA threshold undecided, Josh initially begins with an estimate and then keeps refining until he gets the accurate selection of target fibers. In the end, he has a workable script written in Z IFAZAH as follows. As a result, Figure 8 shows the ROIs that Josh programs for. LOAD "/home/josh/braindti.data" SELECT "axial +63.35" SELECT "sagittal +71" SELECT "coronal -48.5" SELECT "sagittal -0.25" SELECT "axial +7.2" SELECT "CG" SELECT "LA <= 0.275" IN "CST" 5.3 Scenario 3: calculating metrics Beyond visual examinations, neurologists often request quantitative investigations of their DTI models as well. In this scenario, Josh attempts to check the white matter integrity in his brain model due to the limited reliability of DTI tractography. For a rough estimation of the integrity, he uses the CALCULATE command to retrieve the size, in terms of the number of fibers, and average FA of both the whole brain and representative bundles. Further, with the average FA he has requested before, Josh goes further to make use of it to kick out CST fibers with average FA below the bundle-wise average. Josh writes the following script and obtains what he needs. Figure 8: Screenshot of the result after running the Z IFAZAH program that examines ROIs in scenario 2. LOAD "/home/josh/braindti.data" SELECT "ALL" CALCULATE NumFibers CALCULATE AvgFA cstFAavg = CALCULATE AvgFA in "CC" CALCULATE NumFibers in "CST" UPDATE RESET IN "ALL" SELECT "FA >= cstFAavg IN "CC" Figure 9 shows both the numerical values computed and the updated visualization using one of the values through variable reference. Figure 9: Screenshot of the running result of Z IFAZAH script written for an end-user task in scenario 3. 6 D ISCUSSION Since our language addresses scientific visualizations and targets non-programmer users, it is designed to be fully declarative with flat control structure. While these two design features make the language easy to use for domain users, it can cause difficulties in debugging the script since many low-level computations and control logics behind the high-level syntax are hidden for the users. In order to minimize such drawbacks of the current Z IFAZAH design, the script interpreter has been developed to strictly check each current statement and stop further executions of the script once current return signals abnormal behaviours such as importing invalid data input and referring to unknown variables. In addition, regarding the execution mode, the current implementation of Z IFAZAH does not follow a real-time interactive running mode by which the visualization is updated once the script changes. Instead, the programming interface requires a separate user interaction, such as clicking a button or pressing a key, for running the present script. This design is for the interface simplicity and lower computational performance requirement, although a programming environment with otherwise real-time update is easy to implement. While at the prototype stage, Z IFAZAH is still under active development with an intention to add more useful features to our visualization language for the purpose of better user experience and more powerful language expressiveness from end-user prospectives in scientific domains. Some of the promising features are outlined as follows, which are also in our future plan for Z IFAZAH design and development. Concurrent multiple-model exploration: While exploring more than one DTI models in order, i.e. switching data input from one to another using the LOAD command, has been supported, concurrent exploration of multiple models has not yet. However, requirements for doing so do exist among our end users. As an example, one typical case is to examine two brain models in which one is known as normal and another suspicious of a brain disease. This is not rarely seen in clinical practice since the side-by-side comparison is helpful for efficient recognition of cerebral anomalies or simply finding structural differences. Corresponding Z IFAZAH commands and related other type of symbols can be extended for such concurrent explorations. Among other changes, the evaluation of LOAD statement result to an identifier (a handle for instance) can be utilized to identify a specific model out of multiple ones simultaneously explored. Visual-aids for programming: Even though programming provides controls more precise than visual interaction in many cases, such as moving the axial plane by 22.5cm, in a 3D visualization environment, under some occasions it is hard to describe exploratory steps in the visualization. For example, with only an unverified picture in mind about the outline of a fiber bundle that features human brain suffering a particular type of disease, a neurologist would like to check if a given brain is afflicted with such disease by looking for any fiber bundles characteristic of the outline. In this context, a visual aid that allows the user to sketch the outline for matching target fiber bundles can be fairly effective while describing such outline in script is pretty difficult or at least far from being intuitive. Such visual aids can be integrated into Z IFAZAH, with which users are enabled to designate a semantic term in the language through visual sketching or drawing. Improved usability: Although Z IFAZAH has been designed to be fully declarative and many features have been developed expressly for maximal usability, such as flat control structure and consistent syntax pattern, the usability of the overall programming environment can be further improved from two aspects. First of all, apart from a help window showing all symbols and syntactical details which has already been implemented, context -aware automatic word completion can be built into the script editor so that users would not need remember language keywords. Also, statement templates can be provided in the interface so that users can program a statement simply by filling blanks followed by clicking a button to confirm (then the statement will be added into the editor). Secondly, instead of only displaying error message after execution, highlighting error-prone words when they are being typed is an additional editor feature. 7 C ONCLUSION We presented a visualization language for exploring 3D DTI visualizations and described the design principles and language features of it derived from end-user descriptions about how to customize and explore such visualizations. We have already developed some functions and features carefully selected of the proposed language, Z IFAZAH, and described the elements of the language. A primary design goal with Z IFAZAH is to initiate a scientific visualization language that is non-programmer oriented especially for domain scientists who have no any programming experience and skill to create and explore in their own visualizations. For this purpose, we emphasized design features of Z IFAZAH that particularly aim at our design goals. We have also described representative usage scenarios of Z I FAZAH apart from many example scripts written in the language before presenting its main content. These scenarios show that our new language is appealing to domain users and it is promising to further develop the prototype towards a more capable and usable language for exploring more scientific visualizations. While the development of our language as a whole is still at its early stage, the language core has already been implemented and more features are being extended on top of current design. Among many possible directions to follow up, we briefly discussed two main prospective features to follow up. By Z IFAZAH we have presented a new approach, i.e. the end-user programming approach, to exploring DTI visualizations in 3D environment. This approach, as a complement to visual interactive environments, has a good potential to help narrow down the gap between visualization designers and end users with respect to the understanding of their underlying domain-specific data sets. 8 ACKNOWLEDGEMENTS The authors are grateful to medical experts in DTI for their participation in our experimental studies, from which the design features and principles of our visual programming language were abstracted. We would also like to thank their valuable comments for further enhancements of Z IFAZAH language when using it as end users. R EFERENCES [1] Impure: A new visualization programming language for nonprogrammers. http://www.impure.com/. [2] Processing.js. http://processingjs.org/. [3] Trevil - tree visualization language. http://sape.inf.usi. ch/tools/trevil. [4] The vedea project. http://research.microsoft.com/ en-us/projects/vedea/. [5] A. Adamoli and M. Hauswirth. Trevis: A context tree visualization & analysis framework and its use for classifying performance failure reports. In ACM Symposium on Software Visualization, pages 73–82, October 2010. [6] D. Akers. Cinch: a cooperatively designed marking interface for 3d pathway selection. In Proceedings of the 19th annual ACM symposium on User interface software and technology, pages 33–42, New York, NY, USA, 2006. [7] D. Akers, N. Gluhbegovich, and J. Jew. Wizard of oz for participatory design: Inventing a gestural interface for 3d selection of neural pathway estimates. In SIGCHI Works in Progress. ACM Press, 2006. [8] P. J. Basser, S. Pajevic, C. Pierpaoli, J. Duda, and A. Aldroubi. In vivo fiber tractography using DT-MRI data. Magnetic Resonance in Medicine, 44:625–632, 2000. [9] J. Bertin. Semiology of graphics: diagrams, networks, maps. University of Wisconsin Press, 1983. [10] J. Blaas, C. Botha, B. Peters, F. Vos, and F. Post. Fast and reproducible fiber bundle selection in DTI visualization. In IEEE Conference on Visualization, pages 59–64, 2005. [11] C. Bob and S. Richard. Wordseye: an automatic text-to-scene conversion system. In Proceedings of ACM SIGGRAPH, pages 487–496, New York, NY, USA, 2001. [12] M. Bostock and J. Heer. Protovis: A graphical toolkit for visualization. IEEE Transactions on Visualization and Computer Graphics, pages 1121–1128, 2009. [13] W. Chen, S. Zi’ang Ding, A. MacKay-Brandt, S. Correia, H. Qu, J. Crow, D. Tate, Z. Yan, and Q. Peng. A novel interface for interactive exploration of dti fibers. IEEE Transactions on Visualization and Computer Graphics, pages 1433–1440, 2009. [14] O. Christopher, R. Benjamin, S. Utkarsh, K. Ravi, and T. Andrew. Pig latin: a not-so-foreign language for data processing. In Proceedings of the ACM SIGMOD international conference on Management of data, pages 1099–1110, 2008. [15] S. Correia, S. Lee, T. Voorn, D. Tate, R. Paul, S. Zhang, S. Salloway, P. Malloy, and D. Laidlaw. Quantitative tractography metrics of white matter integrity in diffusion-tensor mri. Neuroimage, 42(2):568–581, 2008. [16] N. Elmqvist and P. Tsigas. A taxonomy of 3d occlusion management for visualization. IEEE Transactions on Visualization and Computer Graphics, pages 1095–1109, 2008. [17] B. Fry. Computational information design. PhD thesis, Massachusetts Institute of Technology, 2004. [18] J. Heer and M. Bostock. Declarative language design for interactive visualization. IEEE Transactions on Visualization and Computer Graphics, 16(6):1149–1156, 2010. [19] R. Jianu, C. Demiralp, and D. H. Laidlaw. Exploring 3D DTI fibertracts with linked 2D representations. IEEE Transactions on Visualization and Computer Graphics, 15(6):1449–1456, 2009. [20] G. Kindlmann. Visualization and analysis of diffusion tensor fields. PhD dissertation, The University of Utah, 2004. [21] G. Kindlmann, D. Weinstein, and D. Hart. Strategies for direct volume rendering of diffusion tensor fields. IEEE Transactions on Visualization and Computer Graphics, pages 124–138, 2000. [22] Y. Li, C. Fu, and A. Hanson. Scalable wim: Effective exploration in large-scale astrophysical environments. IEEE Transactions on Visualization and Computer Graphics, pages 1005–1012, 2006. [23] W. Lucas and S. Shieber. A simple language for novel visualizations of information. Software and Data Technologies, pages 33–45, 2009. [24] J. Mackinlay. Automating the design of graphical presentations of relational information. ACM Transactions on Graphics, 5(2):110–141, 1986. [25] J. Mackinlay, P. Hanrahan, and C. Stolte. Show me: Automatic presentation for visual analysis. IEEE Transactions on Visualization and Computer Graphics, pages 1137–1144, 2007. [26] R. Metoyer, B. Lee, N. Riche, and M. Czerwinski. Understanding the verbal language and structure of end-user descriptions of data visualizations. ACM SIGCHI Conference on Human Factors in Computing Systems, 2012. [27] B. Mike. Data-driven documents. http://mbostock.github. com/d3/. [28] J. Peterson. A language for mathematical visualization. In Proceedings of Functional and Declarative Languages in Education, October 2002. [29] A. Sherbondy, D. Akers, R. Mackenzie, R. Dougherty, and B. Wandell. Exploring connectivity of the brain’s white matter with dynamic queries. IEEE Transactions on Visualization and Computer Graphics, 11:419–430, July 2005. [30] C. Stolte and P. Hanrahan. Polaris: A system for query, analysis and visualization of multi-dimensional relational databases. IEEE Transactions on Visualization and Computer Graphics, 8:52–65, 2002. [31] N. Toussaint, J. Souplet, and P. Fillard. MedINRIA: Medical image navigation and research tool by INRIA. In Proceedings of MICCAI, volume 7, pages 1–8, 2007. [32] S. Zhang, C. Curry, D. S. Morris, and D. H. Laidlaw. Visualizing diffusion tensor mr images using streamtubes and streamsurfaces. IEEE Transactions on Visualization and Computer Graphics, pages 454– 462, 2003.
6cs.PL
One-Sided Unsupervised Domain Mapping Sagie Benaim1 and Lior Wolf1,2 arXiv:1706.00826v2 [cs.CV] 18 Nov 2017 1 The Blavatnik School of Computer Science , Tel Aviv University, Israel 2 Facebook AI Research Abstract In unsupervised domain mapping, the learner is given two unmatched datasets A and B. The goal is to learn a mapping GAB that translates a sample in A to the analog sample in B. Recent approaches have shown that when learning simultaneously both GAB and the inverse mapping GBA , convincing mappings are obtained. In this work, we present a method of learning GAB without learning GBA . This is done by learning a mapping that maintains the distance between a pair of samples. Moreover, good mappings are obtained, even by maintaining the distance between different parts of the same sample before and after mapping. We present experimental results that the new method not only allows for one sided mapping learning, but also leads to preferable numerical results over the existing circularity-based constraint. Our entire code is made publicly available at https://github.com/sagiebenaim/DistanceGAN. 1 Introduction The advent of the Generative Adversarial Network (GAN) [6] technology has allowed for the generation of realistic images that mimic a given training set by accurately capturing what is inside the given class and what is “fake”. Out of the many tasks made possible by GANs, the task of mapping an image in a source domain to the analog image in a target domain is of a particular interest. The solutions proposed for this problem can be generally separated by the amount of required supervision. On the one extreme, fully supervised methods employ pairs of matched samples, one in each domain, in order to learn the mapping [9]. Less direct supervision was demonstrated by employing a mapping into a semantic space and requiring that the original sample and the analog sample in the target domain share the same semantic representation [22]. If the two domains are highly related, it was demonstrated that just by sharing weights between the networks working on the two domains, and without any further supervision, one can map samples between the two domains [21, 13]. For more distant domains, it was demonstrated recently that by symmetrically leaning mappings in both directions, meaningful analogs are obtained [28, 11, 27]. This is done by requiring circularity, i.e., that mapping a sample from one domain to the other and then back, produces the original sample. In this work, we go a step further and show that it is possible to learn the mapping between the source domain and the target domain in a one-sided unsupervised way, by enforcing high crossdomain correlation between the matching pairwise distances computed in each domain. The new constraint allows one-sided mapping and also provides, in our experiments, better numerical results than circularity. Combining both of these constraints together often leads to further improvements. Learning the new constraint requires comparing pairs of samples. While there is no real practical reason not to do so, since training batches contain multiple samples, we demonstrate that similar constraints can even be applied per image by computing the distance between, e.g., the top part of the image and the bottom part. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 1.1 Related work Style transfer These methods [5, 23, 10] typically receive as input a style image and a content image and create a new image that has the style of the first and the content of the second. The problem of image translation between domains differs since when mapping between domains, part of the content is replaced with new content that matches the target domain and not just the style. However, the distinction is not sharp, and many of the cross-domain mapping examples in the literature can almost be viewed as style transfers. For example, while a zebra is not a horse in another style, the horse to zebra mapping, performed in [28] seems to change horse skin to zebra skin. This is evident from the stripped Putin example obtained when mapping the image of shirtless Putin riding a horse. Generative Adversarial Networks GAN [6] methods train a generator network G that synthesizes samples from a target distribution, given noise vectors, by jointly training a second network D. The specific generative architecture we and others employ is based on the architecture of [18]. In image mapping, the created image is based on an input image and not on random noise [11, 28, 27, 13, 22, 9]. Unsupervised Mapping The work that is most related to ours, employs no supervision except for sample images from the two domains. This was done very recently [11, 28, 27] in image to image translation and slightly earlier for translating between natural languages [24]. Note that [11] proposes the “GAN with reconstruction loss” method, which applies the cycle constraint in one side and trains only one GAN. However, unlike our method, this method requires the recovery of both mappings and is outperformed by the full two-way method. The CoGAN method [13], learns a mapping from a random input vector to matching samples from the two domains. It was shown in [13, 28] that the method can be modified in order to perform domain translation. In CoGAN, the two domains are assumed to be similar and their generators (and GAN discriminators) share many of the layers weights, similar to [21]. As was demonstrated in [28], the method is not competitive in the field of image to image translation. Weakly Supervised Mapping In [22], the matching between the source domain and the target domain is performed by incorporating a fixed pre-trained feature map f and requiring f -constancy, i.e, that the activations of f are the same for the input samples and for mapped samples. Supervised Mapping When provided with matching pairs of (input image, output image) the supervision can be performed directly. An example of such method that also uses GANs is [9], where the discriminator D receives a pair of images where one image is the source image and the other is either the matching target image (“real” pair) or a generated image (“fake” pair); The linking between the source and the target image is further strengthened by employing the U-net architecture [19]. Domain Adaptation In this setting, we typically are given two domains, one having supervision in the form of matching labels, while the second has little or no supervision. The goal is to learn to label samples from the second domain. In [3], what is common to both domains and what is distinct is separated thus improving on existing models. In [2], a transformation is learned, on the pixel level, from one domain to another, using GANs. In [7], an unsupervised adversarial approach to semantic segmentation, which uses both global and category specific domain adaptation techniques, is proposed. 2 Preliminaries In the problem of unsupervised mapping, the learning algorithm is provided with unlabeled datasets from two domains, A and B. The first dataset includes i.i.d samples from the distribution pA and the second dataset includes i.i.d samples from the distribution pB . Formally, given i.i.d {xi }m i=1 such that xi ∼ pA and i.i.d {xj }nj=1 such that xj ∼ pB , our goal is to learn a function GAB , which maps samples in domain A to analog samples in domain B, see examples below. In previous work [11, 28, 27], it is necessary to simultaneously recover a second function GBA , which similarly maps samples in domain B to analog samples in domain A. Justification In order to allow unsupervised learning of one directional mapping, we introduce the constraint that pairs of inputs x, x0 , which are at a certain distance from each other, are mapped to pairs of outputs GAB (x), GAB (x0 ) with a similar distance, i.e., that the distances kx − x0 k and 2 Figure 1: Each triplet shows the source handbag image, the target shoe as produced by CycleGAN’s [28] mapper GAB and the results of approximating GAB by a fixed nonnegative linear transformation T , which obtains each output pixel as a linear combination of input pixels. The linear transformation captures the essence of GAB showing that much of the mapping is achieved by a fixed spatial transformation. kGAB (x) − GAB (x0 )k are highly correlated. As we show below, it is reasonable to assume that this constraint approximately holds in many of the scenarios demonstrated by previous work on domain translation. Although approximate, it is sufficient, since as was shown in [21], mapping between domains requires only little supervision on top of requiring that the output distribution of the mapper matches that of the target distribution. Consider, for example, the case of mapping shoes to edges, as presented in Fig. 4. In this case, the edge points are simply a subset of the image coordinates, selected by local image criterion. If image x is visually similar to image x0 , it is likely that their edge maps are similar. In fact, this similarity underlies the usage of gradient information in the classical computer vision literature. Therefore, while the distances are expected to differ in the two domains, one can expect a high correlation. Next, consider the case of handbag to shoe mapping (Fig. 4). Analogs tend to have the same distribution of image colors in different image formations. Assuming that the spatial pixel locations of handbags follow a tight distribution (i.e., the set of handbag images share the same shapes) and the same holds for shoes, then there exists a set of canonical displacement fields that transform a handbag to a shoe. If there was one displacement, which would happen to be a fixed permutation of pixel locations, distances would be preserved. In practice, the image transformations are more complex. To study whether the image displacement model is a valid approximation, we learned a nonnegative 2 ×642 linear transformation T ∈ R64 that maps, one channel at a time, handbag images of size + 64 × 64 × 3 to the output shoe images of the same size given by the CycleGAN method. T ’s columns can be interpreted as weights that determine the spread of mass in the output image for each pixel location in the input image. It was estimated by minimizing the squared error of mapping every channel (R, G, or B) of a handbag image to the same channel in the matching shoe. Optimization was done by gradient descent with a projection to the space of nonnegative matrices, i.e., zeroing the negative elements of T at each iteration. Sample mappings by the matrix T are shown in Fig. 1. As can be seen, the nonnegative linear transformation approximates CycleGAN’s multilayer CNN GAB to some degree. Examining the elements of T , they share some properties with permutations: the mean sum of the rows is 1.06 (SD 0.08) and 99.5% of the elements are below 0.01. In the case of adding glasses or changing gender or hair color (Fig 3), a relatively minor image modification, which does not significantly change the majority of the image information, suffices in order to create the desired visual effect. Such a change is likely to largely maintain the pairwise image distance before and after the transformation. In the case of computer generated heads at different angles vs. rotated cars, presented in [11], distances are highly correlated partly because the area that is captured by the foreground object is a good indicator of the object’s yaw. When mapping between horses to zebras [28], the texture of a horse’s skin is transformed to that of the zebra. In this case, most of the image information is untouched and the part that is changed is modified by a uniform texture, again approximately maintaining pairwise distances. In Fig 2(a), we compare the L1 distance in RGB space of pairs of horse images to the distance of the samples after mapping by the CycleGAN Network [28] is performed, using the public implementation. It is evident that the cross-domain correlation between pairwise distances is high. We also looked at Cityscapes image and ground truth label pairs in Fig 2(c), and found that there is high correlation between the distances. This is the also the case in many other literature-based mappings between datasets we have tested and ground truth pairs. While there is little downside to working with pairs of training images in comparison to working with single images, in order to further study the amount of information needed for successful alignment, we also consider distances between the two halves of the same image. We compare the L1 distance 3 (a) (b) (c) (d) Figure 2: Justifying the high correlation between distances in different domains. (a) Using the CycleGAN model [28], we map horses to zebras and vice versa. Green circles are used for the distance between two random horse images and the two corresponding translated zebra images. Blue crosses are for the reverse direction translating zebra to horse images. The Pearson correlation for horse to zebra translation is 0.77 (p-value 1.7e−113) and for zebra to horse it is 0.73 (p-value 8.0e−96). (b) As in (a) but using the distance between two halves of the same image that is either a horse image translated to a zebra or vice-versa. The Pearson correlation for horse to zebra translation is 0.91 (p-value 9.5e−23) and for zebra to horse it is 0.87 (p-value 9.7e−19). (c) Cityscapes images and associated labels. Green circles are used for distance between two cityscapes images and the two corresponding ground truth images The Pearson correlation is 0.65 (p-value 6.0e−16). (d) As in (c) but using the distance between two halves of the same image. The Pearson correlation is 0.65 (p-value 1.4e−12). between the left and right halves as computed on the input image to that which is obtained on the generated image or the corresponding ground truth image. Fig. 1(b) and Fig. 1(d) presents the results for horses to zebras translation and for Cityscapes image and label pairs, respectively. As can be seen, the correlation is also very significant in this case. From Correlations to Sum of Absolute Differences We have provided justification and empirical evidence that for many semantic mappings, there is a high degree of correlations between the pairwise distances in the two domains. In other words, let dk be a vector of centered and unit-variance normalized pairwise distances in one domain and let d0k be the vector of normalized distances obtained P in the other domain by translating each image out of each pair between the domains, then dk d0k should be high. When training the mapper GAB , the mean and variance used for normalization in each domain are precomputed based on the training samples in each domain, which assumes that the post mapping distribution of samples is similar to the training distribution. P The pairwise distances in the source domain dk are fixed and maximizing dk d0k causes pairwise distances dk with large absolute value the optimization. Instead, we propose to minimize P to dominate 0 the sum of absolute differences k |dk − dk |, which spreads the error in distances uniformly. The P P two losses − dk d0k and k |dk − d0k | are highly related and the negative correlation between them was explicitly computed for simple distributions and shown to be very strong [1]. 4 3 Unsupervised Constraints on the Learned Mapping There are a few types of constraints suggested in the literature, which do not require paired samples. First, one can enforce the distribution of GAB (x) : x ∼ pA , which we denote as GAB (pA ), to be indistinguishable from that of pB . In addition, one can require that mapping from A to B and back would lead to an identity mapping. Another constraint suggested, is that for every x ∈ B GAB (x) = x. We review these constraints and then present the new constraints we propose. Adversarial constraints Our training sets are viewed as two discrete distributions p̂A and p̂B that are sampled from the source and target domain distributions pA and pB , respectively. For the learned network GAB , the similarity between the distributions GAB (pA ) and pB is modeled by a GAN. This involves the training of a discriminator network DB : B → {0, 1}. The loss is given by: LGAN (GAB , DB , p̂A , p̂B ) =ExB ∼p̂B [log DB (xB )] + ExA ∼p̂A [log(1 − DB (GAB (xA ))] This loss is minimized over GAB and maximized over DB . When both GAB and GBA are learned simultaneously, there is an analog expression LGAN (GBA , DA , p̂B , p̂A ), in which the domains A and B switch roles and the two losses (and four networks) are optimized jointly. Circularity constraints In three recent reports [11, 28, 27], circularity loss was introduced for image translation. The rationale is that given a sample from domain A, translating it to domain B and then back to domain A should result in the identical sample. Formally, the following loss is added: Lcycle (GAB , GBA , p̂A ) = Ex∼p̂A kGBA (GAB (x)) − xk1 The L1 norm employed above was found to be mostly preferable, although L2 gives similar results. Since the circularity loss requires the recovery of the mappings in both directions, it is usually employed symmetrically, by considering Lcycle (GAB , GBA , p̂A ) + Lcycle (GBA , GAB , p̂B ). The circularity constraint is often viewed as a definite requirement for admissible functions GAB and GBA . However, just like distance-based constraints, it is an approximate one. To see this, consider the zebra to horse mapping example. Mapping a zebra to a horse means losing the stripes. The inverse mapping, therefore, cannot be expected to recover the exact input stripes. Target Domain Identity A constraint that has been used in [22] and in some of the experiments in [28] states that GAB applied to samples from the domain B performs the identity mapping. We did not experiment with this constraint and it is given here for completeness: LT-ID (GAB , p̂B ) = Ex∼p̂B kx − GAB (x)k2 Distance Constraints The adversarial loss ensures that samples from the distribution of A are translated to samples in the distribution of B. However, there are many such possible mappings. Given a mapping for n samples of A to n samples of B, one can consider any permutation of the samples in B as a valid mapping and, therefore, the space of functions mapping from A to B is very large. Adding the circularity constraint, enforces the mapping from B to A to be the inverse of the permutation that occurs from A to B, which reduces the amount of admissible permutations. To further reduce this space, we propose a distance preserving map, that is, the distance between two samples in A should be preserved in the mapping to B. We therefore consider the following loss, which is the expectation of the absolute differences between the distances in each domain up to scale: Ldistance (GAB , p̂A ) = Exi ,xj ∼p̂A | 1 1 (kxi − xj k1 − µA ) − (kGAB (xi ) − GAB (xj )k1 − µB )| σA σB where µA , µB (σA , σB ) are the means (standard deviations) of pairwise distances in the training sets from A and B, respectively, and are precomputed. In practice, we compute the loss over pairs of samples that belong to the same minibatch during training. Even for minibatches with 64 samples, as in DiscoGAN [11], considering all pairs is feasible. If needed, for even larger mini-batches, one can subsample the pairs. When the two mappings are simultaneously learned, Ldistance (GBA , p̂B ) is similarly defined. In both cases, the absolute difference of the L1 distances between the pairs in the two domains is considered. 5 In comparison to circularity, the distance-based constraint does not suffer from the model collapse problem that is described in [11]. In this phenomenon, two different samples from domain A are mapped to the same sample in domain B. The mapping in the reverse direction then generates an average of the two original samples, since the sample in domain B should be mapped back to both the first and second original samples in A. Pairwise distance constraints prevents this from happening. Self-distance Constraints Whether or not the distance constraint is more effective than the circularity constraint in recovering the alignment, the distance based constraint has the advantage of being one sided. However, it requires that pairs of samples are transfered at once, which, while having little implications on the training process as it is currently done, might effect the ability to perform on-line learning. Furthermore, the official CycleGAN [28] implementation employs minibatches of size one. We, therefore, suggest an additional constraint, which employs one sample at a time and compares the distances between two parts of the same sample. Let L, R : Rh×w → Rh×w/2 be the operators that given an input image return the left or right part of it. We define the following loss: L self- (GAB , p̂A ) distance 1 (kL(x) − R(x)k1 − µA ) σA 1 − (kL(GAB (x)) − R(GAB (x))k1 − µB )| σB = Ex∼p̂A | (1) where µA and σA are the mean and standard deviation of the pairwise distances between the two halves of the image in the training set from domain P A, and similarly for µB and σB , e.g., given the training set {xj }nj=1 ⊂ B, µB is precomputed as n1 j kL(xj ) − R(xj )k1 . 3.1 Network Architecture and Training When training the networks GAB , GBA , DB and DA , we employ the following loss, which is minimized over GAB and GBA and maximized over DB and DA : α1A LGAN (GAB , DB , p̂A , p̂B ) + α1B LGAN (GBA , DA , p̂B , p̂A ) + α2A Lcycle (GAB , GBA , p̂A )+ α2B Lcycle (GBA , GAB , p̂B ) + α3A Ldistance (GAB , p̂A ) + α3B Ldistance (GBA , p̂B )+ α4A Lself-distance (GAB , p̂A ) + α4B Lself-distance (GBA , p̂B ) where αiA , αiB are trade-off parameters. We did not test the distance constraint and the self-distance constraint jointly, so in every experiment, either α3A = α3B = 0 or α4A = α4A = 0. When performing one sided mapping from A to B, only α1A and either α3A or α4A are non-zero. We consider A and B to be a subset of R3×s×s of images where s is either 64, 128 or 256, depending on the image resolution. In order to directly compare our results with previous work and to employ the strongest baseline in each dataset, we employ the generator and discriminator architectures of both DiscoGAN [11] and CycleGAN [28]. In DiscoGAN, the generator is build of an encoder-decoder unit. The encoder consists of convolutional layers with 4 × 4 filters followed by Leaky ReLU activation units. The decoder consists of deconvolutional layers with 4 × 4 filters followed by a ReLU activation units. Sigmoid is used for the output layer and batch normalization [8] is used before the ReLU or Leaky ReLU activations. Between 4 to 5 convolutional/deconvolutional layers are used, depending on the domains used in A and B (we match the published code architecture per dataset). The discriminator is similar to the encoder, but has an additional convolutional layer as the first layer and a sigmoid output unit. The CycleGAN architecture for the generator is based on [10]. The generators consist of two 2stride convolutional layers, between 6 to 9 residual blocks depending on the image resolution and two fractionally strided convolutions with stride 1/2. Instance normalization is used as in [10]. The discriminator uses 70 × 70 PatchGANs [9]. For training, CycleGAN employs two additional techniques. The first is to replace the negative log-likelihood by a least square loss [25] and the second is to use a history of images for the discriminators, rather then only the last image generated [20]. 6 Table 1: Tradeoff weights for each experiment. Experiment α1A α1B α2A α2B α3A α3B α4A α4B DiscoGAN Distance → Distance ← Dist+Cycle Self Dist → Self Dist ← 0.5 0.5 0 0.5 0.5 0 0.5 0.5 0.5 0 0 0 0 0 0 0 0.5 0 0 0 0.5 0 0 0 0.5 0 0 0.5 0.5 0.5 0.5 0.5 0 0 0 0 0 0 0 0.5 0 0.5 0 0 0 0 0 0.5 Table 2: Normalized RMSE between the angles of source and translated images. Method car2car car2head DiscoGAN Distance Dist.+Cycle Self Dist. 0.306 0.135 0.098 0.117 0.137 0.097 0.273 0.197 4 Experiments We compare multiple methods: the DiscoGAN or the CycleGAN baselines; the one sided mapping using Ldistance (A → B or B → A); the combination of the baseline method with Ldistance ; the self distance method. For DiscoGAN, we use a fixed weight configuration for all experiments, as shown in Tab. 1. For CycleGAN, there is more sensitivity to parameters and while the general pattern is preserved, we used different weight for the distance constraint depending on the experiment, digits or horses to zebra. Models based on DiscoGAN Datasets that were tested by DiscoGAN are evaluated here using this architecture. In initial tests, CycleGAN is not competitive on these out of the box. The first set of experiments maps rotated images of cars to either cars or heads. The 3D car dataset [4] consists of rendered images of 3D cars whose degree varies at 15◦ intervals. Similarly, the head dataset, [17], consists of 3D images of rotated heads which vary from −70◦ to 70◦ . For the car2car experiment, the car dataset is split into two parts, one of which is used for A and one for B (It is further split into train and test set). Since the rotation angle presents the largest source of variability, and since the rotation operation is shared between the datasets, we expect it to be the major invariant that the network learns, i.e., a semantic mapping would preserve angles. A regressor was trained to calculate the angle of a given car image based on the training data. Tab. 2 shows the Root Mean Square Error (RMSE) between the angle of source image and translated image. As can be seen, the pairwise distance based mapping results in lower error than the DiscoGAN one, combining both further improves results, and the self distance outperforms both DiscoGAN and pairwise distance. The original DiscoGAN implementation was used, but due to differences in evaluation (different regressors) these numbers are not compatible with the graph shown in DiscoGAN. For car2head, DiscoGAN’s solution produces mirror images and combination of DiscoGAN’s circularity constraint with the distance constraint produces a solution that is rotated by 90◦ . We consider these biases as ambiguities in the mapping and not as mistakes and, therefore, remove the mean error prior to computing the RMSE. In this experiment, distance outperforms all other methods. The combination of both methods is less competitive than both, perhaps since each method pulls toward a different solution. Self distance, is worse than circularity in this dataset. Another set of experiments arises from considering face images with and without a certain property. CelebA [26, 14] was annotated for multiple attributes including the person’s gender, hair color, and the existence of glasses in the image. Following [11] we perform mapping between two values of each of these three properties. The results are shown in the appendix with some examples in Fig. 3. It is evident that the DiscoGAN method (using the unmodified authors’ implementation) presents many more failure cases than our pair based method. The self-distance method was implemented 7 Table 3: MNIST classification on mapped SHVN images. Method Accuracy CycleGAN Distance Dist.+Cycle Self Dist. 26.1% 26.8% 18.0% 25.2% Table 4: CelebA mapping results using the VGG face descriptor. Male → Female Method Cosine Similarity Separation Accuracy DiscoGAN Distance Distance+Cycle Self Distance 0.23 0.32 0.35 0.24 0.87 0.88 0.87 0.86 DiscoGAN Distance Distance+Cycle Self Distance 0.22 0.26 0.31 0.24 0.86 0.87 0.89 0.91 Blond → Black Cosine Similarity Separation Accuracy Glasses → Without Cosine Similarity 0.15 0.89 0.13 0.24 0.92 0.42 0.24 0.91 0.41 0.24 0.91 0.34 ———— Other direction ———— 0.14 0.91 0.10 0.22 0.96 0.30 0.22 0.95 0.30 0.19 0.94 0.30 Separation Accuracy 0.84 0.79 0.82 0.80 0.90 0.89 0.85 0.81 with the top and bottom image halves, instead of left to right distances, since faces are symmetric. This method also seems to outperform DiscoGAN. In order to evaluate how well the face translation was performed, we use the representation layer of VGG faces [16] on the image in A and its output in B. One can assume that two images that match will have many similar features and so the VGG representation will be similar. The cosine similarities, as evaluated between input images and their mapped versions, are shown in Tab. 4. In all cases, the pair-distance produces more similar input-output faces. Self-distance performs slightly worse than pairs, but generally better than DiscoGAN. Applying circularity together with pair-distance, provides the best results but requires, unlike the distance, learning both sides simultaneously. While we create images that better match in the face descriptor metric, our ability to create images that are faithful to the second distribution is not impaired. This is demonstrated by learning a linear classifier between the two domains based on the training samples and then applying it to a set of test image before and after mapping. The separation accuracy between the input test image and the mapped version is also shown in Tab. 4. As can be seen, the separation ability of our method is similar to that of DiscoGAN (it arises from the shared GAN terms). We additionally perform a user study to asses the quality of our results. The user is first presented with a set of real images from the dataset. Then, 50 random pairs of images are presented to a user for a second, one trained using DiscoGAN and one using our method. The user is asked to decide which image looks more realistic. The test was performed on 22 users. On shoes to handbags translation, our translation performed better on 65% of the cases. For handbags to shoes, the score was 87%. For male to female, both methods showed a similar realness score (51% to 49% of DiscoGAN’s). We, therefore, asked a second question: given the face of a male, which of the two generated female variants is a better fit to the original face. Our method wins 88% of the time. In addition, in the appendix we compare the losses of the GAN discriminator for the various methods and show that these values are almost identical. We also measure the losses of the various methods during test, even if these were not directly optimized. For example, despite this constraints not being enforced, the distance based methods seem to present a low circularity loss, while DiscoGAN presents a relatively higher distance losses. Sample results of mapping shoes to handbags and edges to shoes and vice versa using the DiscoGAN baseline architecture are shown in Fig. 3. More results are shown in the appendix. Visually, the results of the distance-based approach seem better then DiscoGAN while the results of self-distance are somewhat worse. The combination of DiscoGAN and distance usually works best. 8 Input Disco GAN Distance Distance +cycle Self distance (a) (b) (c) (d) (e) (f) Figure 3: Translations using various methods on the celebA dataset: (a,b) Male to and from Female. (c,d) Blond to and from black hair. (e,f) With eyeglasses to from without eyeglasses. Models based on CycleGAN Using the CycleGAN architecture we map horses to zebras, see Fig. 4 and appendix for examples. Note that on the zebra to horse mapping, all methods fail albeit in different ways. Subjectively, it seems that the distance + cycle method shows the most promise in this translation. In order to obtain numerical results, we use the baseline CycleGAN method as well as our methods in order to translate from Street View House Numbers (SVHN) [15] to MNIST [12]. Accuracy is then measured in the MNIST space by using a neural net trained for this task. Results are shown in Tab. 3 and visually in the appendix. While the pairwise distance based method improves upon the baseline method, there is still a large gap between the unsupervised and semi-supervised setting presented in [22], which achieves much higher results. This can be explained by the large amount of irrelevant information in the SVHN images (examples are shown in the appendix). Combining the distance based constraint with the circularity one does not work well on this dataset. We additionally performed a qualitative evaluation using FCN score as in [28]. The FCN metric evaluates the interoperability images by taking a generated cityscape image and generating a label using semantic segmentation algorithm. The generated label can then be compared to the ground truth label. FCN results are given as three measures: per-pixel accuracy, per-class accuracy and Class IOU. Our distance GAN method is preferable on all three scores (0.53 vs. 0.52, 0.19 vs. 0.17, and 0.11 vs 0.11, respectively). The paired t-test p-values are 0.29, 0.002 and 0.42 respectively. In a user study similar to the one for DiscoGAN above, our cityscapes translation scores 71% for realness when comparing to CycleGAN’s. When looking at similarity to the ground truth image we score 68%. 5 Conclusion We have proposed an unsupervised distance-based loss for learning a single mapping (without its inverse), which empirically outperforms the circularity loss. It is interesting to note that the new loss is applied to raw RGB image values. This is in contrast to all of the work we are aware of that computes image similarity. Clearly, image descriptors or low-layer network activations can be used. However, by considering only RGB values, we not only show the general utility of our method, but also further demonstrate that a minimal amount of information is needed in order to form analogies between two related domains. Acknowledgements This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant ERC CoG 725974). The authors would like to thank Laurens van der Maaten and Ross Girshick for insightful discussions. 9 Input Disco/ CycleGAN Distance Distance +cycle Self distance (a) (b) (c) (d) (e) (f) Figure 4: (a,b) Handbags to and from shoes. (c,d) Edges to/from shoes. (e,f) Horse to/from zebra. References [1] Werner Van Belle. Correlation between the inproduct and the sum of absolute differences is -0.8485 for uniform sampled signals on [-1:1]. Available at http: // werner. yellowcouch. org/ Papers/ sadvssip/ index. html , 2006. [2] Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In CVPR, 2017. [3] Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 343–351. Curran Associates, Inc., 2016. [4] Sanja Fidler, Sven Dickinson, and Raquel Urtasun. 3d object detection and viewpoint estimation with a deformable 3d cuboid model. In NIPS, 2012. [5] Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In CVPR, 2016. [6] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS. 2014. [7] Judy Hoffman, Dequan Wang, Fisher Yu, and Trevor Darrell. Fcns in the wild: Pixel-level adversarial and constraint-based adaptation. 12 2016. [8] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. [9] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017. [10] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, 2016. [11] Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jungkwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. arXiv preprint arXiv:1703.05192, 2017. [12] Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. [13] Ming-Yu Liu and Oncel Tuzel. Coupled generative adversarial networks. In NIPS, pages 469–477. 2016. [14] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), 2015. 10 [15] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011. [16] O. M. Parkhi, A. Vedaldi, and A. Zisserman. Deep face recognition. In British Machine Vision Conference, 2015. [17] Pascal Paysan, Reinhard Knothe, Brian Amberg, Sami Romdhani, and Thomas Vetter. A 3d face model for pose and illumination invariant face recognition. In AVSS, 2009. [18] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. [19] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In MICCAI, 2015. [20] Ashish Shrivastava, Tomas Pfister, Oncel Tuzel, Josh Susskind, Wenda Wang, and Russ Webb. Learning from simulated and unsupervised images through adversarial training. arXiv preprint arXiv:1612.07828, 2016. [21] Ilya Sutskever, Rafal Jozefowicz, Karol Gregor, Danilo Rezende, Tim Lillicrap, and Oriol Vinyals. Towards principled unsupervised learning. In ICLR workshop, 2016. [22] Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. In International Conference on Learning Representations (ICLR), 2017. [23] D. Ulyanov, V. Lebedev, A. Vedaldi, and V. Lempitsky. Texture networks: Feed-forward synthesis of textures and stylized images. In ICML, 2016. [24] Yingce Xia, Di He, Tao Qin, Liwei Wang, Nenghai Yu, Tie-Yan Liu, and Wei-Ying Ma. Dual learning for machine translation. arXiv preprint arXiv:1611.00179, 2016. [25] X.Mao, Q.Li, H.Xie, R.Y. Lau, and Z.Wang. Multi-class generative adversarial networks with the l2 loss function. arXiv preprint arXiv:1611.04076, 2016. [26] Shuo Yang, Ping Luo, Chen Change Loy, and Xiaoou Tang. From facial parts responses to face detection: A deep learning approach. In ICCV, pages 3676–3684, 2015. [27] Zili Yi, Hao Zhang, Ping Tan Gong, et al. Dualgan: Unsupervised dual learning for image-toimage translation. arXiv preprint arXiv:1704.02510, 2017. [28] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networkss. arXiv preprint arXiv:1703.10593, 2017. 11 (a) Input (b)DiscoGAN (c) Distance (d) Cycle+dist (e) Selfdistance (Male to female) (Female to male) Figure 5: Results for celebA Male to Female transfer (a) Input (b) DiscoGAN model. (c) Distance model (our model) trained with A and B simultaneously. (d) DiscoGAN and Distance model. (e) Distance model where distances are compared within the image s.t the distance from top half to bottom half is preserved. A Experiments with the DiscoGAN architecture Tab. 5 presents the eight losses measured for each of the methods. For example, we can measure the distance loss for the DiscoGAN method even tough it is not part of its loss. To allow the computation of circularity, here, the distance method was run in both directions at once. Table 5: Losses measured for each method on the CelebA dataset. Method LGAN (A) LGAN (B) Lcycle (B) Lcycle (B) Ldist (A) Ldist (B) Lselfd (A) Lselfd (B) (A) Male to (B) Female: DiscoGAN 4.300 Distance 3.702 Distance+Cycle 4.280 Self Distance 3.322 2.996 2.132 1.651 3.131 0.036 0.026 0.017 0.092 0.024 0.026 0.016 0.091 0.466 0.047 0.046 0.048 0.457 0.047 0.043 0.050 0.441 0.038 0.042 0.045 0.422 0.044 0.040 0.044 (A) Blond to (B) Black hair: DiscoGAN 2.511 Distance 0.932 Distance+Cycle 1.045 Self Distance 0.965 3.297 2.243 2.484 2.867 0.019 0.021 0.013 0.022 0.018 0.017 0.012 0.018 0.396 0.046 0.043 0.049 0.399 0.042 0.043 0.048 0.396 0.046 0.043 0.049 0.399 0.042 0.042 0.048 (A) With or (B) Without eyeglasses: DiscoGAN 5.734 3.621 Distance 7.697 0.804 Distance+Cycle 5.730 0.924 Self Distance 8.242 0.795 0.110 0.046 0.024 0.040 0.040 0.036 0.017 0.018 0.535 0.023 0.027 0.029 0.337 0.065 0.048 0.051 0.535 0.023 0.028 0.029 0.074 0.065 0.048 0.050 Fig. 5, 6, 7, 8, 9 present images from multiple mapping experiments that employ the same network architecture as DiscoGAN. 12 (a) Input (b)DiscoGAN (c) Distance (d) Cycle+dist (e) Selfdistance (Blond to black hair) (Black to blond hair) Figure 6: Same as Fig. 5 but with black to blond hair conversion (a) Input (b) DiscoGAN (c) Distance (d) Cycle+dist (e) Selfdistance (With to without eyeglasses) (Without to with eyeglasses) Figure 7: Same as Fig. 5 but with eyeglasses to no eyeglasses and no eyeglasses to eyeglasses conversion. 13 (a) Input (b) DiscoGAN (c) Distance (d) Cycle+dist (e) Selfdistance (Handbags to shoes) (Shoes to handbags) Figure 8: Same as Fig. 5 but with handbags to shoes and shoes to handbags conversion. (a) Input (b) DiscoGAN (c) Distance (d) Cycle+dist (e) Selfdistance (Edges to shoes) (Shoes to edges) Figure 9: Same as Fig. 5 but edges to shoes and shoes to edges conversion. 14 B Experiments with the CycleGAN architecture Fig. 10 gives a translation between images of horses to zebra. Fig. 11 gives a translation between images of zebra to horse. Fig. 12 presents examples of transforming SVHN images to MNIST digits. (a) Input (c)CycleGAN (d) Distance (e) Cycle+dist (f) Selfdistance Figure 10: Translation from horse to zebra based on the CycleGAN architecture. 15 (a) Input (c)CycleGAN (d) Distance (e) Cycle+dist (f) Selfdistance Figure 11: Translation from zebra to horse based on the CycleGAN architecture. 16 (a) CycleGAN (b) Distance (c) Dist. + cycle (d) Self distance Figure 12: Translating SVHN to MNIST with a CycleGAN architecture 17 (a) Input (c)CycleGAN (d) Distance Figure 13: Translation from labels to cityscapes images based on the CycleGAN architecture. 18
1cs.CV
MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means arXiv:1802.04784v2 [stat.ML] 15 Feb 2018 Matthieu Lerasle 1 Zoltán Szabó 2 Guillaume Lecué 3 Gaspar Massiot 4 Eric Moulines 2 Abstract Mean embeddings provide an extremely flexible and powerful tool in machine learning and statistics to represent probability distributions and define a semi-metric (MMD, maximum mean discrepancy; also called N-distance or energy distance), with numerous successful applications. The representation is constructed as the expectation of the feature map defined by a kernel. As a mean, its classical empirical estimator, however, can be arbitrary severely affected even by a single outlier in case of unbounded features. To the best of our knowledge, unfortunately even the consistency of the existing few techniques trying to alleviate this serious sensitivity bottleneck is unknown. In this paper, we show how the recently emerged principle of median-of-means can be used to design minimax-optimal estimators for kernel mean embedding and MMD, with finitesample strong outlier-robustness guarantees. 1. Introduction Kernel methods form the backbone of a tremendous number of successful applications in machine learning thanks to their power in capturing complex relations (Aronszajn, 1950; Shawe-Taylor & Cristianini, 2004; Schölkopf & Smola, 2002; Berlinet & Thomas-Agnan, 2004; Steinwart & Christmann, 2008). The main idea behind these techniques is to map the data points to a feature space (RKHS, reproducing kernel Hilbert space) determined by the kernel, and apply linear methods in the feature space, without the need to explicitly compute the map. One crucial component contributing to this flexibility and 1 Laboratoire de Mathématiques d’Orsay, Univ. Paris-Sud; CNRS, Université Paris Saclay, France 2 Center for Applied Mathematics (CMAP), École Polytechnique, Palaiseau, France 3 CREST ENSAE ParisTech, France 4 ONERA - The French Aerospace Lab, Chemin de la Hunière - BP 80100, 91123 Palaiseau Cedex, France. Correspondence to: Matthieu Lerasle <[email protected]>, Zoltán Szabó <[email protected]>. efficiency (beyond the solid theoretical foundations) is the versatility of domains where kernels exist; examples include trees (Collins & Duffy, 2001; Kashima & Koyanagi, 2002), time series (Cuturi, 2011), strings (Lodhi et al., 2002), mixture models, hidden Markov models or linear dynamical systems (Jebara et al., 2004), sets (Haussler, 1999; Gärtner et al., 2002), fuzzy domains (Guevara et al., 2017), distributions (Hein & Bousquet, 2005; Martins et al., 2009; Muandet et al., 2011), groups (Cuturi et al., 2005) such as specific constructions on permutations (Jiao & Vert, 2016), or graphs (Vishwanathan et al., 2010; Kondor & Pan, 2016). Given a kernel-enriched domain (X, K) one can represent probability distributions on X as a mean Z ϕ(x)dP(x) ∈ HK , ϕ(x) := K(·, x), µP = X which is a point in the RKHS determined by K. This representation called mean embedding (Berlinet & Thomas-Agnan, 2004; Smola et al., 2007) induces (Smola et al., 2007; Gretton et al., 2012) a semi-metric1 on distributions named as maximum mean discrepancy (MMD) MMDK (P, Q) = kµP − µQ kHK . (1) Specializing the kernel, classical integral transforms widely used in probability theory and statistics can be recovered by µP ; for example K(x, y) = ehx,yi gives the well-known 2 moment-generating function, the K(x, y) = eγkx−yk2 (γ > 0) choice results in the Weierstrass transform. As it has been shown (Sejdinovic et al., 2013) energy distance (Baringhaus & Franz, 2004; Székely & Rizzo, 2004; 2005)—also known as N-distance (Zinger et al., 1992; Klebanov, 2005) in the statistical literature—coincides with MMD. Mean embedding and maximum mean discrepancy have been applied successfully, in kernel Bayesian inference (Song et al., 2011; Fukumizu et al., 2013), approximate Bayesian computation (Park et al., 2016), model criticism (Lloyd et al., 2014; Kim et al., 2016), two-sample (Baringhaus & Franz, 2004; Székely & Rizzo, 2004; 2005; 1 Fukumizu et al. (2008); Sriperumbudur et al. (2010) provide conditions when MMDK is a metric, i.e. µ is injective. MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means Harchaoui et al., 2007; Gretton et al., 2012), independence (Gretton et al., 2008; Pfister et al., 2017) and goodness-offit testing (Jitkrittum et al., 2017; Balasubramanian et al., 2017), domain adaptation (Zhang et al., 2013) and generalization (Blanchard et al., 2017), probabilistic programming (Schölkopf et al., 2015), post selection inference (Yamada et al., 2016), distribution classification (Muandet et al., 2011; Zaheer et al., 2017) and regression (Szabó et al., 2016; Law et al., 2018), causal discovery (Mooij et al., 2016; Pfister et al., 2017) or topological data analysis (Kusano et al., 2016), among many others; Muandet et al. (2017) provide an in-depth review on the topic. Crucial to the success of these applications is the efficient and robust approximation of the mean embedding and MMD. As a mean, the most natural approach to estimate µP is the empirical average. Plugging this estimate to Eq. (1) produces directly an approximation of MMD, which can also be made unbiased (by a small correction) or approximated recursively. These are the V-statistic, U-statistic and online approaches (Gretton et al., 2012). Kernel mean shrinkage estimators (Muandet et al., 2016) represent an other successful direction: they improve the efficiency of the mean embedding estimation by taking into account the Stein phenomenon. Minimax results have recently been established: the optimal rate of mean embedding estimation given N samples from P is N −1/2 (Tolstikhin et al., 2017) for discrete measures and the class of measures with infinitely differentiable density when K is a continuous, shift-invariant kernel on X = Rd . For MMD, using N1 −1/2 −1/2 and N2 samples from P and Q, it is N1 + N2 (Ilya Tolstikhin & Schölkopf, 2016) in case of radial universal kernels defined on X = Rd . A critical property of an estimator is its robustness w.r.t. contaminated data, outliers which are omnipresent in currently available massive and heterogenous datasets. To the best of our knowledge, systematically designing outlierrobust mean embedding and MMD estimators has hardly been touched in the literature; this is the focus of the current paper. The issue is particularly serious in case of unbounded kernels when for example even a single outlier can ruin completely a classical empirical average based estimator. Examples for unbounded kernels are the exponential kernel (see the example above about moment-generating functions), polynomial kernel, string or graph kernels. Existing related techniques comprise robust kernel density estimation (KDE) (Kim & Scott, 2012): the authors elegantly combine ideas from the KDE and M-estimator literature to arrive at a robust KDE estimate of density functions. They assume that the underlying smoothing kernels2 2 Smoothing kernels extensively studied in the non-parametric statistical literature (Györfi et al., 2002) are assumed to be non- are shift-invariant on X = Rd and reproducing, and interpret KDE as a weighted mean in HK . The idea has been (i) adapted to construct outlier-robust covariance operators in RKHSs in the context of kernel canonical correlation analysis (Alam et al., 2017), and (ii) relaxed to general Hilbert spaces (Sinova et al., 2018). Unfortunately, the consistency of the investigated empirical M-estimators is unknown, except for finite-dimensional feature maps (Sinova et al., 2018). To achieve our goal, we leverage the idea of MedianOf-meaNs (MON). Intuitively, MONs replace the linear operation of expectation with the median of averages taken over non-overlapping blocks of the data, in order to get a robust estimate thanks to the median step. MONs date back to Jerrum et al. (1986); Alon et al. (1999); Nemirovski & Yudin (1983) for the estimation of the mean of real-valued random variables. Their concentration properties have been recently studied by Devroye et al. (2016); Minsker & Strawn (2017); the idea of systematically investigating estimators from a deviation point of view goes back to Catoni (2012). The point is that such a study can then be used to extend from the estimation of the mean of realvalued random variables to more general prediction problems in learning theory by minmax aggregation of pairwise comparisons (Audibert & Catoni, 2011). Independently of Audibert & Catoni (2011), there have been several attempts to extend the usage of MON estimators from R to more general settings. For example, Minsker (2015); Minsker & Strawn (2017) consider the problem of estimating the mean of a Banach-valued random variable using “geometrical” MONs. The estimators in (Minsker, 2015; Minsker & Strawn, 2017) are computationally tractable but the deviation bounds are slightly suboptimal compared to those one can prove for the empirical mean under subgaussian assumptions. Lugosi & Mendelson (2016; 2017) proposed to combine the classical MON estimators on R in a “tournament” procedure that can be seen as a Le Cam type aggregation of tests (Le Cam, 1973). The remarkable achievement in (Lugosi & Mendelson, 2016; 2017) is that they were able to obtain optimal deviation bounds for the resulting estimator using the powerful so-called “small-ball method” of Mendelson (2015). Catoni & Giulini (2017) have recently improved the constants in (Lugosi & Mendelson, 2016; 2017), reaching almost optimal constants in the deviation bounds for the estimation of the mean in Rd and least-squares regression under a slightly stronger moment assumption. In this paper, we extend the results of Lugosi & Mendelson (2017) to mean embedding and MMD estimation in RKHS. In order to attain this goal, we modify the aggregation step negative functions integrating to one. MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means of Lugosi & Mendelson (2016; 2017) using the minmax formulation of Audibert & Catoni (2011). As a result we get a conceptually simpler aggregation, which simultaneously serves as a novel application of the small-ball method. A further statistically appealing property of our estimator is that it satisfies rate-optimal subgaussian deviation bounds under minimal assumptions (assuming that the underlying covariance operators are of trace class). Our contributions can be summarized as follows: • We design novel mean embedding and MMD estimators based on the MON principle. • We establish their finite-sample and outlier-robustness properties. The obtained MONK estimators are consistent, their convergence speed match the discussed minimax rates, and they are tolerant to excessive contamination. Section 2 contains definitions and problem formulation. Our results are given in Section 3. Section 4 is about proofs. 2. Definitions & Problem Formulation In this section, we formally introduce the goal of our paper. Notations: Z+ is the set of positive integers. [M ] := {1, . . . , M }, uS := (um )m∈S , S ⊆ [M ]. For a set S, |S| denotes its cardinality. E stands for expectation. medq∈[Q] {zq } is the median of the (zq )q∈[Q] numbers. Let X be a separable topological space endowed with the Borel σ-field, x1:N denotes a sequence of i.i.d. random variables on X with law P (shortly, x1:N ∼ P). K : X × X → R is a continuous (reproducing) kernel on X, HK is the reproducing kernel Hilbert space associated to K; h·, ·iK := h·, ·iHK , k·kK := k·kHK .3 The reproducing property of the kernel means that evaluation of functions in HK can represented by inner products f (x) = hf, K(·, x)iK X where the integral is meant in Bochner sense; µP exists iff Z Z p kK(·, x)kK dP(x) = K(x, x)dP(x) < ∞. X It is well-known that the mean embedding has meanreproducing property Pf := Ex∼P f (x) = hf, µP iK (∀f ∈ HK ) , µP = argminf ∈HK Z 2 X kf − K(·, x)kK dP(x) . (4) The solution of this problem can be obtained by solving the following minmax optimization µP = argminf ∈HK sup J(f, g), (5) g∈HK i h J(f, g) = Ex∼P kf − K(·, x)k2K − kg − K(·, x)k2K . The equivalence of (4) and (5) is obvious since the expectation is linear. Nevertheless, this equivalence is essential in the construction of our estimators because we will below replace the expectation by a non-linear estimator of this quantity. More precisely, the unknown expectations are computed by using the Median-of-meaN estimator (MON). Given a partition of the dataset into blocks, the MON estimator is the median of the empirical means over each block. MON estimators are naturally robust thanks to the median step. More precisely, the procedure goes as follows. For any map f : X → RP and any non-empty subset S ⊆ [N ], denote by 1 PS := |S| i∈S δxi the empirical measure associated to P 1 the subset xS and PS f = |S| i∈S f (xi ); we will use the shorthand µS := µPS . Assume that N ∈ Z+ is divisible by Q ∈ Z+ and let (Sq )q∈[Q] denote a partition of [N ] into subsets with the same cardinality |Sq | = N/Q (∀q ∈ [Q]). The Median Of meaN (MON) is defined as   MONQ [f ] := medq∈[Q] PSq f = medq∈[Q] f, µSq K , where the second equality is a consequence of the meanreproducing property of µP [Eq. (3)]. We define the MONbased estimator associated to kernel K (MONK) as ˜ g), µ̂P,Q = µ̂P,Q (x1:N ) ∈ argminf ∈HK sup J(f, g∈HK (∀x ∈ X, f ∈ HK ). The mean embedding of a probability measure P is defined as Z K(·, x)dP(x) ∈ HK , (2) µP = X and (3) 3 HK is separable by the separability of X and the continuity of K (Steinwart & Christmann, 2008, Lemma 4.33). h ˜ g) = MONQ kf − J(f, 2 K(·, x)kK − kg − 2 K(·, x)kK (6) i . One can use the mean embedding [Eq. (2)] to get a semimetric on probability measures: the maximum mean discrepancy (MMD) of P and Q is MMD(P, Q) := kµP − µQ kK = sup hf, µP − µQ iK , f ∈BK where BK = {f ∈ HK : kf kK ≤ 1} is the closed unit ball around the origin in HK . The 2nd equality shows that MMD is a specific integral probability metric (Müller, 1997; Zolotarev, 1983). Assume that we have access to x1:N ∼ P, y1:N ∼ Q samples.4 Denote by PS,x := 4 The size of the two samples is assumed to be the same for simplicity. MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means 1 |S| P i∈S δxi the empirical measure associated to the subset xS (PS,y is defined similarly for y), µSq ,P := µPSq ,x , µSq ,Q := µPSq ,y . We propose the following MON-based MMD estimator  \ Q (P, Q) = sup med f, µSq ,P − µSq ,Q MMD . K f ∈BK q∈[Q] Our goal is to lay down the foundations and study the finite-sample behaviour, establish the consistency and \ Q (P, Q) outlier-robustness properties of the µ̂P,Q and MMD MONK estimators. A few more notations will be needed throughout the paper. S1 \S2 is the difference of set S1 and S2 . For any linear operator A : HK → HK , denote by kAk := sup06=f ∈HK kAf kK / kf kK the operator norm of A. Let L(HK ) = {A : HK → HK linear operator : kAk < ∞} be the space of bounded linear operators. For any A ∈ L(HK ), let A∗ ∈ L(HK ) denote the adjoint of A, that is the operator such that hAf, giK = hf, A∗ giK for all f, g ∈ HK . An operator A ∈ L(HK ) is called non-negative if hAf, f iK ≥ 0 for all f ∈ HK . By the separability of HK , there exists a countable orthonormal basis (ONB) (ei )i∈I in HK . An operator A ∈ L(HK )Eis called (i) trace-class if P D < ∞ and in this case kAk1 := i∈I (A∗ A)1/2 ei , ei K P Tr(A) := i∈I hAei , ei iK < ∞,5 (ii) Hilbert-Schmidt if P kAk22 := Tr (A∗ A) = i∈I hAei , Aei iK < ∞. Denote by L1 (HK ) := {A ∈ L(HK ) : kAk1 < ∞} and L2 (HK ) := {A ∈ L(HK ) : kAk2 < ∞} the class of trace-class and (Hilbert) space of Hilbert-Schmidt operators on HK , respectively.6 The tensor product of a, b ∈ HK is (a ⊗ b)(c) = a hb, ciK , (∀c ∈ HK ). a⊗b ∈ L2 (HK ), L2 (HK ) ∼ = HK ⊗HK where ⊗ is the tensor product of Hilbert spaces and ka ⊗ bk2 = kakK kbkK . Whenever Z Z K(x, x)dP(x) < ∞, kK(·, x) ⊗ K(·, x)k2 dP(x) = X X let ΣP denote the covariance operator ΣP = Ex∼P ([K(·, x) − µP ] ⊗ [K(·, x) − µP ]) ∈ L2 (HK ), where the expectation (integral) is again meant in Bochner sense. ΣP is non-negative, self-adjoint, moreover it has covariance-reproducing property 2 hf, ΣP f iK = Ex∼P [f (x) − Pf ] . (7) It is known that kAk ≤ kAk2 ≤ kAk1 . 5 If A is a non-negative and self-adjoint, then A is trace class iff Tr(A) < ∞; this will hold for the covariance operator (ΣP ). 6 One can show that these definitions are independent of the choice of the ONB (ei )i∈I . 3. Results Below we present our main results on the MONK estimators. We allow that from the x1:N samples Nc is arbitrarily corc rupted ((xnj )N j=1 ); the resulting dataset is used for estimahalf tion.7 The measure of contamination can be (almost)  of the block size, in other words, ∃δ ∈ 0, 21 such that Nc ≤ Q( 21 − δ).8 Theorem 1 (Consistency & outlier-robustness of µ̂√ P,Q). Assume that ΣP ∈ L1 (HK ), and let c1 = 2 1 + 2 . Qδ2 Then, with probability at least 1 − e− 72 ! r r 3 kΣP k Q 12 Tr (ΣP ) kµ̂P,Q − µP kK ≤ c1 max . , δN δ N Theorem 2 (Consistency & outlier-robustness of \ Q (P, Q)). Assume that ΣP and ΣQ ∈ L1 (HK ). MMD Then, with probability at least 1 − e− Qδ2 72 \ M MDQ (P, Q) − MMDQ (P, Q) ≤ q  q 3(kΣP k+kΣQ k)Q 12 Tr (ΣP )+Tr (ΣQ ) ≤ 2 max . , δ δN N Remarks: • These finite-sample guarantees show that the MONK estimators – have optimal N −1/2 -rate—by recalling Ilya Tolstikhin & Schölkopf (2016); Tolstikhin et al. (2017)’s discussed results—, and – they are robust to outliers, providing consistent estimates with high probability even under excessive contamination. • Theorem 2 also implies that fixing the trace of the covariance operators of P and Q, the MON-based MMD estimator can separate P and Q at the rate of N −1/2 . 4. Proofs In this section we provide the proofs of our results. Theorem 1 (Theorem 2) is in the focus of Section 4.1 (Section 4.2); few lemmas are relegated to the supplement. 4.1. Proof of Theorem 1 The structure of the proof is as follows: √ 1. We show that kµ̂P,Q − µP kK ≤ (1 + 2)rQ,N , where h i rQ,N = sup MOMQ hf, K(·, x) − µP iK . | {z } f ∈BK f (x)−Pf 7 8 c In MMD estimation {(xnj , ynj )}N j=1 can be contaminated. Nc = 0, or equivalently the δ = 21 case, means clean data. MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means In other words, the analysis can be reduced to BK . 2. Then rQ,N is bounded using empirical processes. The Nc corrupted samples can affect (at most) Nc of the (Bq )q∈[Q] blocks. Let U := [Q]\C stand for the indices of the uncorrupted sets, where C := {q ∈ [Q] : ∃nj s.t. nj ∈ Sq , j ∈ [Nc ]} contains the indices of the corrupted sets. If Step-1: Since HK is a Euclidean space, for any f ∈ HK 2 2 kf − K(·, x)kK − kµP − K(·, x)kK = 2 = kf − µP kK − 2 hf − µP , K(·, x) − µP iK . (8) Hence, by denoting e = µ̂P,Q − µP , g̃ = g − µP we get 2 kekK (a) − 2rQ,N kekK 2 ≤ kekK − 2MONQ (b) ≤ MONQ (c)  kek2K  −2  e , K(·, x) − µP kekK   e , K(·, x) − µP kekK  K kekK g∈HK h i 2 2 ≤ sup MONQ kµP − K(·, x)kK − kg − K(·, x)kK (e) g∈HK h n i o 2MOMQ hg̃, K(·, x) − µP iK − kg̃k2K {z } | g∈HK = sup kg̃kK D g̃ kg̃kK ,K(·,x)−µP E K n o (h) (g) 2 2 = sup 2 kg̃kK rQ,N − kg̃kK ≤ rQ,N , (9) g∈HK where we used in (a) the definition of rQ,N , (b) the linearity9 of MONQ [·], (c) Eq. (8), (d) supg , (e) the definition of µ̂P,Q , (f) Eq. (8) and the linearity of MONQ [·], (g) the definition of rQ,N . In step (h), by denoting a = kg̃kK , r = rQ,N , the argument of the sup takes the form 2ar − a2 ; 2ar − a2 ≤ r2 ⇔ 0 ≤ r2 − 2ar + a2 = (r − a)2 . 2 2 In Eq. (9), we obtained an equation a − 2ra ≤ r where a := kek r2 + 2ra a2 ≥ 0, r1,2 = √K ≥ 0. Hence √−    −2a ± 4a2 + 4a2 /2 = −1 ± 2 a, thus by the non√ √ r negativity of a, r ≥ (−1 + 2)a, i.e., a ≤ √2−1 =( 2+ 1)r. In other words, we arrived at  √  kµ̂P,Q − µP kK ≤ 1 + 2 rQ,N . (10) It remains to upper bound rQ,N . Step-2: Our goal is to provide a probabilistic bound on rQ,N = sup MONQ [hf, K(·, x) − µP iK ] f ∈BK = sup med { f, µSq − µP K }. {z } f ∈BK q∈[Q] | =:r(f,q) 9 Ir(f,q)≥ǫ • Controlling r(f, q): For any f ∈ BK the random variables hf, k(·, xi ) − µP iHK = f (xi ) − Pf are independent, have zero mean, and  h i 2 2 ≤ MONQ kµ̂P,Q − K(·, x)kK − kµP − K(·, x)kK h i (d) 2 2 ≤ sup MONQ kµ̂P,Q − K(·, x)kK − kg − K(·, x)kK (f ) q∈U (11) then for ∀f ∈ BK , medq∈[Q] {r(f, q)} ≤ ǫ, i.e. supf ∈BK medq∈[Q] {r(f, q)} ≤ ǫ. Thus, our task boils down to controlling the event in (11) by appropriately choosing ǫ. kekK K Q ∀f ∈ BK : |{q ∈ U : r(f, q) ≥ ǫ}| +Nc ≤ , {z } | 2 P MONQ [c1 + c2 f ] = c1 + c2 MONQ [f ] for any c1 , c2 ∈ R. 2 Exi ∼P hf, k(·, xi ) − µP iK = hf, ΣP f iK ≤ ≤ kf kK kΣP f kK ≤ kf k2K kΣP k = kΣP k (12) using the reproducing property of the kernel and the covariance operator, the Cauchy-Bunyakovsky-Schwarz (CBS) inequality and kf kHK = 1. For a zero-mean random variable z by the Chebyshev’s  2 2 inequality P (z > a)  ≤pP (|z| > a) ≤ E z /a , which implies P z > E (z 2 ) /α ≤ α by a  2 2 α = E z /a substitution. With z := r(f, q)   2 (q ∈ U ), using E z 2 = E f, µSq − µP K = 2 Q N Exi ∼P hf, k(·, xi ) − µP iK and Eq. (12) one gets that for all f ∈ BK , α ∈ (0, 1) and q ∈ U : ! r kΣP k Q ≤ α. P r(f, q) > αN q  P kQ This means P r(f, q) > 2ǫ ≤ α with ǫ ≥ 2 kΣαN . • Reduction to φ: As a result X  ǫ ≤ |U |α ⇔ P r(f, q) ≥ 2 q∈U X Ir(f,q)≥ǫ ≤ |U |α + q∈U +  Xh ǫi Ir(f,q)≥ǫ − P r(f, q) ≥ =: A. 2} | {z q∈U h i E Ir(f,q)≥ ǫ 2 Let us introduce the φ(t) = (t−1)I1≤t≤2 +It≥2 notation. φ is 1-Lipschitz and satisfies I2≤t ≤ φ(t) ≤ I1≤t for any t ∈ R. Hence, we can upper bound A as   X   2r(f, q)  2r(f, q) − Eφ A ≤ |U |α + φ ǫ ǫ q∈U MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means by noticing that ǫ ≤ r(f, q) ⇔ 2 ≤ 2r(f, q)/ǫ and ǫ/2 ≤ r(f, q) ⇔ 1 ≤ 2r(f, q)/ǫ, and by using the I2≤t ≤ φ(t) and the φ(t) ≤ I1≤t bound, respectively. Taking supremum over BK we arrive at sup X f ∈BK q∈U Ir(f,q)≥ǫ ≤ ExV Ee sup Q X f ∈BK q=1 (a)   X   2r(f, q)  2r(f, q) − Eφ . ≤ |U |α + sup φ ǫ ǫ f ∈BK q∈U | {z } =:Z • Concentration of Z around its mean: Notice that Z is a function of xV , the samples in the uncorrupted blocks; V = ∪q∈U Sq . By the bounded difference property of Z (Lemma 4) for any β > 0, the McDiarmid inequality (Lemma 6; we choose τ := Qβ 2 /8 to get linear scaling in Q on the r.h.s.) implies that P (Z < ExV [Z] + Qβ) ≥ 1 − e− Qβ 2 8 . • Bounding ExV [Z]: Let M = N/Q denote the number of elements in Sq -s. The G = {gf : f ∈ BK } class with 1 PM gf : XM → R and PM := M m=1 δum defined as gf (u1:M ) = φ  hf, µPM − µP iK ǫ  ExV [Z] ≤ 2ExV Ee sup X f ∈BK q∈U eq φ  2r(f, q) ǫ  , where e = (eq )q∈U ∈ R|U| with i.i.d. Rademacher entries [P(eq = ±1) = 21 (∀q)]. • Discarding φ: Since φ(0) = 0 and φ is 1-Lipschitz, by Talagrand’s concentration inequality of Rademacher processes (Ledoux & Talagrand, 1991), (Koltchinskii, 2011, Theorem 2.3) one gets X f ∈BK q∈U eq φ ≤ 2ExV Ee sup  2r(f, q) ǫ  2Q Ex Ee′ ≤ ǫN V f ∈BK q∈U 2r(f, q) eq . ǫ • Switching from |U | to N terms: Applying an other symmetrization [(a)], the CBS inequality, f ∈ BK , and r(f, q) ≤ ǫ sup f ∈BK X e′n n∈V | =hf, P # hf, K(·, xn ) − µP iK n∈V {z e′n [K(·,xn )−µP ]i } K X 2Q ≤ e′n [K(·, xn ) − µP ] ExV Ee′  sup kf kK ǫN {z } | f ∈BK =1 n∈V X 2Q e′n [K(·, xn ) − µP ] ExV Ee′ ǫN n∈V K v u X 2Q u tE E ′ ≤ e′n [K(·, xn ) − µP ] xV e ǫN n∈V p (b) 2Q |V | Tr(ΣP ) = . ǫN K = 2 K In (a), we proceeded as follows: ExV Ee sup X = ExV Ee sup eq X f ∈BK q∈U (c) ≤ = r(f, q) = ǫ eq f, µSq − µP ǫ K X 2Q e′n e′′n hf, K(·, xn ) − µP iK ExV Ee Ee′ sup Nǫ f ∈BK n∈V X 2Q e′n hf, K(·, xn ) − µP iK , ExV Ee′ sup Nǫ f ∈BK n∈V where in (c) we applied symmetrization, e′ = (e′n )n∈V ∈ R|V | with i.i.d. Rademacher entries, e′′n = eq if n ∈ Sq (q ∈ U ), and we used that (e′n e′′n hf, K(·, xn ) − µP iK )n∈V (e′n hf, K(·, xn ) − µP iK )n∈V . In step (b), we had ExV Ee′ ≤ eq  X = ExV Ee′ n∈V X n∈V X " f ∈BK q∈U is uniformly bounded separable Carathéodory (Lemma 5), hence the symmetrization technique (Steinwart & Christmann, 2008, Prop. 7.10), (Ledoux & Talagrand, 1991) gives ExV Ee sup the Jensen inequality e′n [K(·, xn ) − µP ] 2 K distr = = 2 [e′n ] hK(·, xn ) − µP , K(·, xn ) − µP iK = |V |Ex∼P hK(·, x) − µP , K(·, x) − µP iK = |V |Ex∼P Tr ([K(·, x) − µP ] ⊗ [K(·, x) − µP ]) = |V | Tr(ΣP ) exploiting the independence of e′n -s and [e′n ]2 = 1.   MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means \Q (P, Q) ≤ rQ,N : Let • MMDQ (P, Q) − MMD Until q this point we showed that for all α ∈ (0, 1), β > 0, if kΣP kQ αN ǫ≥2 Q X sup f ∈BK q=1 then af := hf, µP − µQ iK ,  bf := med f, (µP − µQ ) − (µSq ,P − µSq ,Q ) p 8Q |V | Tr(ΣP ) ≤ |U |α + Qβ + ǫN Ir(f,q)≥ǫ q∈[Q] Then 2 − Qβ 8 with probability . Thus, to ensure that PQ at least 1 − e supf ∈BK q=1 Ir(f,q)≥ǫ + Nc ≤ Q/2 it is sufficient to choose (α, β, ǫ) such that p 8Q |V | Tr(ΣP ) Q + Nc ≤ , |U |α + Qβ + ǫN 2 √ and in this case kµ̂P,Q − µP kK ≤ (1 + 2)ǫ. Applying the |U | ≤ Q and |V | ≤ N bounds, we want to have p 8Q Tr(ΣP ) Q √ (13) + Nc ≤ . Qα + Qβ + 2 ǫ N af − bf = hf, µP − µQ iK +  + medq∈[Q] f, (µSq ,P − µSq ,Q ) − (µP − µQ )  = medq∈[Q] f, µSq ,P − µSq ,Q K \Q (P, Q) ≥ MMDQ (P, Q)− MMD  − sup med f, (µP − µQ ) − (µSq ,P − µSq ,Q ) q∈[Q] f ∈BK | {z − med {hf,(µSq ,P −µSq ,Q )−(µP −µQ )i } K q∈[Q] in Eq.(13), the sum of the first  q q 3kΣP kQ 24 Tr (ΣP ) 2δ two terms is Q 3 ; ǫ ≥ max 2 δN , δ N gives ≤ Q 3δ for the Nc ≤ Q( 21 − δ). ≥ MMDQ (P, Q) −  − sup med f, (µSq ,P − µSq ,Q ) − (µP − µQ ) third term. Theorem 1 follows since f ∈BK q∈[Q] | 4.2. Proof of Theorem 2  f, µSq ,P − µSq ,Q − (µP − µQ ) K \Q (P, Q) = MMD   = sup med f, µSq ,P − µSq ,Q ∓ (µP − µQ ) f ∈BK q∈[Q]   f, µSq ,P − µSq ,Q − (µP − µQ ) f ∈BK | med   f, µSq ,P − µSq ,Q − (µP − µQ ) +MMDQ (P, Q). {z =rQ,N . sup med {r(f, q)} ≤ ǫ ∀f ∈ BK : |{q : r(f, q) ≤ −ǫ}| ≤ Q/2, and ∀f ∈ BK |{q : r(f, q) ≥ ǫ}| ≤ Q/2 : |{q : |r(f, q)| ≥ ǫ}| ≤ Q/2. ⇔ ⇐ ⇐ Thus, Q , 2 implies supf ∈BK medq∈[Q] {r(f, q)} ≤ ǫ. K • Controlling |r(f, q)|: For any f ∈ BK the random variables [f (xi ) − f (yi )] − [Pf − Qf ] are independent, zeromean and f ∈BK q∈[Q] . ∀f ∈ BK : |{q ∈ U : |r(f, q)| ≥ ǫ}| + Nc ≤ K + sup hf, µP − µQ iK ≤ sup } • Median rephrasing: ∀f ∈ BK : −ǫ ≤ medq∈[Q] {r(f, q)} ≤ ǫ \Q (P, Q)−MMDQ (P, Q) ≤ rQ,N : By the subaddi• MMD tivity of supremum [supf (af +bf ) ≤ supf af +supf bf ] one gets ≤ sup med K f ∈BK q∈[Q] Step-1: f ∈BK q∈[Q] {z The relevant quantities which change compared to the proof of Theorem 1 are as follows. where • Then rQ,N is bounded. . K rQ,N r(f, q) := f, (µSq ,P − µSq ,Q ) − (µP − µQ ) \Q (P, Q) − MMDQ (P, Q) ≤ rQ,N , MMD f ∈BK q∈[Q] } n o rQ,N = supf ∈BK medq∈[Q] r(f, q) , where • First we prove that  K Step-2: Our goal is to control The reasoning is similar to Theorem 1; we detail the differences below. The high-level structure of the proof is as follows: rQ,N = sup med K by medq∈[Q] {−zq } = −medq∈[Q] {zq }. Applying the supf (af − bf ) ≥ supf af − supf bf inequality (it follows from the subadditivity of sup): δ 3 Choosing α = β = . K K } E(x,y)∼P⊗Q ([f (x) − Pf ] − [f (y) − Qf ])2 = = Ex∼P [f (x) − Pf ]2 + Ey∼Q [f (y) − Qf ]2 ≤ kΣP k + kΣQ k , MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means where P ⊗ Q is the product measure. The Chebyshev argument with z = |r(f, q)| implies that ∀α ∈ (0, 1) ! r (kΣP k + kΣQ k) Q ≤ α. (P ⊗ Q) |r(f, q)| > αN This q means (P ⊗ Q) (|r(f, q)| > ǫ/2) ≤ α with ǫ ≥ Q k)Q . 2 (kΣP k+kΣ αN • Switching from |U | to N terms: With (xy)V = {(xi , yi ) : i ∈ V }, in ’(b)’ with x̃n := K(·, xn ) − µP , ỹn := K(·, yn ) − µQ we arrive at Baringhaus, Ludwig and Franz, C. On a new multivariate two-sample test. Journal of Multivariate Analysis, 88: 190–206, 2004. Berlinet, Alain and Thomas-Agnan, Christine. Reproducing Kernel Hilbert Spaces in Probability and Statistics. Kluwer, 2004. Blanchard, Gilles, Deshmukh, Aniket Anand, Dogan, Urun, Lee, Gyemin, and Scott, Clayton. Domain generalization by marginal transfer learning. Technical report, 2017. (https://arxiv.org/abs/1711.07910). 2 E(xy)V Ee′ X n∈V = E(xy)V Ee′ X n∈V e′n (x̃n − ỹn ) = K 2 [e′n ] hx̃n − ỹn , x̃n − ỹn iK = |V |E(xy)∼P k[K(·, x) − µP ] − [K(·, y) − µQ ]kK = |V |E(xy)∼P Tr ([K(·, x) − µP ] − [K(·, y) − µQ ] ⊗ ⊗ [K(·, x) − µP ] − [K(·, y) − µQ ]) = |V | [Tr (ΣP ) + Tr (ΣQ )] . • These results imply p 8Q Tr (ΣP ) + Tr (ΣQ ) √ Qα + Qβ + + Nc ≤ Q/2. ǫ N   q q Tr (ΣP )+Tr (ΣQ ) Q k)Q 24 , , ǫ ≥ max 2 3(kΣP k+kΣ δN δ N α=β= δ 3 choice finishes the proof of Theorem 2. References Alam, Md. Ashad, Fukumizu, Kenji, and Wang, YuPing. Influence function and robust variant of kernel canonical correlation analysis. Technical report, 2017. (https://arxiv.org/abs/1705.04194). Alon, Noga, Matias, Yossi, and Szegedy, Mario. The space complexity of approximating the frequency moments. Journal of Computer and System Sciences, 58 (1, part 2):137–147, 1999. Aronszajn, Nachman. Theory of reproducing kernels. Transactions of the American Mathematical Society, 68: 337–404, 1950. Catoni, Olivier. Challenging the empirical mean and empirical variance: a deviation study. Annales de l’Institut Henri Poincaré Probabilités et Statistiques, 48(4):1148– 1185, 2012. Catoni, Olivier and Giulini, Ilaria. Dimension-free PAC-Bayesian bounds for matrices, vectors, and linear least squares regression. Technical report, 2017. (https://arxiv.org/abs/1712.02747). Collins, Michael and Duffy, Nigel. Convolution kernels for natural language. In NIPS, pp. 625–632, 2001. Cuturi, Marco. Fast global alignment kernels. In ICML, pp. 929–936, 2011. Cuturi, Marco, Fukumizu, Kenji, and Vert, Jean-Philippe. Semigroup kernels on measures. Journal of Machine Learning Research, 6:1169–1198, 2005. Devroye, Luc, Lerasle, Matthieu, Lugosi, Gábor, and Oliveira, Roberto I. Sub-Gaussian mean estimators. The Annals of Statistics, 44(6):2695–2725, 2016. Fukumizu, Kenji, Gretton, Arthur, Sun, Xiaohai, and Schölkopf, Bernhard. Kernel measures of conditional dependence. In NIPS, pp. 498–496, 2008. Fukumizu, Kenji, Song, Le, and Gretton, Arthur. Kernel Bayes’ rule: Bayesian inference with positive definite kernels. Journal of Machine Learning Research, 14: 3753–3783, 2013. Gärtner, Thomas, Flach, Peter A., Kowalczyk, Adam, and Smola, Alexander. Multi-instance kernels. In ICML, pp. 179–186, 2002. Audibert, Jean-Yves and Catoni, Olivier. Robust linear least squares regression. The Annals of Statistics, 39(5): 2766–2794, 2011. Gretton, Arthur, Fukumizu, Kenji, Teo, Choon Hui, Song, Le, Schölkopf, Bernhard, and Smola, Alexander J. A kernel statistical test of independence. In NIPS, pp. 585– 592, 2008. Balasubramanian, Krishnakumar, Li, Tong, and Yuan, Ming. On the optimality of kernel-embedding based goodness-of-fit tests. Technical report, 2017. (https://arxiv.org/abs/1709.08148). Gretton, Arthur, Borgwardt, Karsten M., Rasch, Malte J., Schölkopf, Bernhard, and Smola, Alexander. A kernel two-sample test. Journal of Machine Learning Research, 13:723–773, 2012. MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means Guevara, Jorge, Hirata, Roberto, and Canu, Stéphane. Cross product kernels for fuzzy set similarity. In FUZZIEEE, pp. 1–6, 2017. Györfi, László, Kohler, Michael, Krzyzak, Adam, and Walk, Harro. A Distribution-Free Theory of Nonparametric Regression. Springer, New-york, 2002. Harchaoui, Zaid, Bach, Francis, and Moulines, Eric. Testing for homogeneity with kernel Fisher discriminant analysis. In NIPS, pp. 609–616, 2007. Kondor, Risi and Pan, Horace. The multiscale Laplacian graph kernel. In NIPS, pp. 2982–2990, 2016. Kusano, Genki, Fukumizu, Kenji, and Hiraoka, Yasuaki. Persistence weighted Gaussian kernel for topological data analysis. In ICML, pp. 2004–2013, 2016. Law, Ho Chung Leon, Sutherland, Dougal J., Sejdinovic, Dino, and Flaxman, Seth. Bayesian approaches to distribution regression. In AISTATS, 2018. Le Cam, Lucien. Convergence of estimates under dimenHaussler, David. Convolution kernels on discrete strucsionality restrictions. The Annals of Statistics, 1:38–53, tures. Technical report, Department of Computer 1973. Science, University of California at Santa Cruz, 1999. Ledoux, Michel and Talagrand, Michel. Probability in Ba(http://cbse.soe.ucsc.edu/sites/default/files/convolutions.pdf). nach spaces. Springer-Verlag, 1991. Hein, Matthias and Bousquet, Olivier. Hilbertian metrics Lloyd, James Robert, Duvenaud, David, Grosse, Roger, and positive definite kernels on probability measures. In Tenenbaum, Joshua B., and Ghahramani, Zoubin. AuAISTATS, pp. 136–143, 2005. tomatic construction and natural-language description of Ilya Tolstikhin, Bharath K. Sriperumbudur and Schölkopf, nonparametric regression models. In AAAI Conference Bernhard. Minimax estimation of maximal mean dison Artificial Intelligence, pp. 1242–1250, 2014. crepancy with radial kernels. In NIPS, pp. 1930–1938, Lodhi, Huma, Saunders, Craig, Shawe-Taylor, John, Cris2016. tianini, Nello, and Watkins, Chris. Text classification Jebara, Tony, Kondor, Risi, and Howard, Andrew. Probusing string kernels. Journal of Machine Learning Reability product kernels. Journal of Machine Learning search, 2:419–444, 2002. Research, 5:819–844, 2004. Lugosi, Gábor and Mendelson, Shahar. Jerrum, Mark R., G.Valiant, Leslie, and V.Vazirani, Vijay. Risk minimization by median-of-means Random generation of combinatorial structures from a tournaments. Technical report, 2016. uniform distribution. Theoretical Computer Science, 43 (https://arxiv.org/abs/1608.00757). (2-3):169–188, 1986. Lugosi, Gábor and Mendelson, Shahar. SubJiao, Yunlong and Vert, Jean-Philippe. The Kendall and gaussian estimators of the mean of a ranMallows kernels for permutations. In ICML (PMLR), dom vector. Technical report, 2017. volume 37, pp. 2982–2990, 2016. (https://arxiv.org/abs/1702.00482). Jitkrittum, Wittawat, Xu, Wenkai, Szabó, Zoltán, FukuMartins, André F. T., Smith, Noah A., Xing, Eric P., Aguiar, mizu, Kenji, and Gretton, Arthur. A linear-time kernel Pedro M. Q., and Figueiredo, Mário A. T. Nonextensive goodness-of-fit test. In NIPS, pp. 261–270, 2017. information theoretic kernels on measures. The Journal Kashima, Hisashi and Koyanagi, Teruo. Kernels for semistructured data. In ICML, pp. 291–298, 2002. Kim, Been, Khanna, Rajiv, and Koyejo, Oluwasanmi O. Examples are not enough, learn to criticize! criticism for interpretability. In NIPS, pp. 2280–2288, 2016. Kim, JooSeuk and Scott, Clayton D. Robust kernel density estimation. Journal of Machine Learning Research, 13: 2529–2565, 2012. of Machine Learning Research, 10:935–975, 2009. Mendelson, Shahar. Learning without concentration. Journal of the ACM, 62(3):21:1–21:25, 2015. Minsker, Stanislav. Geometric median and robust estimation in Banach spaces. Bernoulli, 21(4):2308–2335, 2015. Klebanov, Lev. N-Distances and Their Applications. Charles University, Prague, 2005. Minsker, Stanislav and Strawn, Nate. Distributed statistical estimation and rates of convergence in normal approximation. Technical report, 2017. (https://arxiv.org/abs/1704.02658). Koltchinskii, Vladimir. Oracle Inequalities in Empirical Risk Minimization and Sparse Recovery Problems. Springer, 2011. Mooij, Joris M., Peters, Jonas, Janzing, Dominik, Zscheischler, Jakob, and Schölkopf, Bernhard. Distinguishing cause from effect using observational data: Methods and MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means benchmarks. Journal of Machine Learning Research, 17: 1–102, 2016. Smola, Alexander, Gretton, Arthur, Song, Le, and Schöolkopf, Bernhard. A Hilbert space embedding for distributions. In ALT, pp. 13–31, 2007. Muandet, Krikamol, Fukumizu, Kenji, Dinuzzo, Francesco, and Schölkopf, Bernhard. Learning from distributions via support measure machines. In NIPS, pp. 10–18, 2011. Song, Le, Gretton, Arthur, Bickson, Danny, Low, Yucheng, and Guestrin, Carlos. Kernel belief propagation. In AISTATS, pp. 707–715, 2011. Muandet, Krikamol, Sriperumbudur, Bharath K., Fukumizu, Kenji, Gretton, Arthur, and Schölkopf, Bernhard. Kernel mean shrinkage estimators. Journal of Machine Learning Research, 17:1–41, 2016. Sriperumbudur, Bharath K., Gretton, Arthur, Fukumizu, Kenji, Schölkopf, Bernhard, and Lanckriet, Gert R.G. Hilbert space embeddings and metrics on probability measures. Journal of Machine Learning Research, 11: 1517–1561, 2010. Muandet, Krikamol, Fukumizu, Kenji, Sriperumbudur, Bharath, and Schölkopf, Bernhard. Kernel mean embedding of distributions: A review and beyond. Foundations and Trends in Machine Learning, 10(1-2):1–141, 2017. Müller, Alfred. Integral probability metrics and their generating classes of functions. Advances in Applied Probability, 29:429–443, 1997. Nemirovski, Arkadi S. and Yudin, D. B. Problem complexity and method efficiency in optimization. John Wiley & Sons Ltd., 1983. Park, Mijung, Jitkrittum, Wittawat, and Sejdinovic, Dino. K2-ABC: Approximate Bayesian computation with kernel embeddings. In AISTATS (PMLR), volume 51, pp. 51:398–407, 2016. Pfister, Niklas, Bühlmann, Peter, Schölkopf, Bernhard, and Peters, Jonas. Kernel-based tests for joint independence. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 2017. ISSN 1467-9868. Schölkopf, Bernhard and Smola, Alexander J. Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond. MIT Press, 2002. Schölkopf, Bernhard, Muandet, Krikamol, Fukumizu, Kenji, Harmeling, Stefan, and Peters, Jonas. Computing functions of random variables via reproducing kernel Hilbert space representations. Statistics and Computing, 25(4):755–766, 2015. Sejdinovic, Dino, Sriperumbudur, Bharath K., Gretton, Arthur, and Fukumizu, Kenji. Equivalence of distancebased and RKHS-based statistics in hypothesis testing. Annals of Statistics, 41:2263–2291, 2013. Steinwart, Ingo and Christmann, Andreas. Support Vector Machines. Springer, 2008. Szabó, Zoltán, Sriperumbudur, Bharath, Póczos, Barnabás, and Gretton, Arthur. Learning theory for distribution regression. Journal of Machine Learning Research, 17 (152):1–40, 2016. Székely, Gábor J. and Rizzo, Maria L. Testing for equal distributions in high dimension. InterStat, 5, 2004. Székely, Gábor J. and Rizzo, Maria L. A new test for multivariate normality. Journal of Multivariate Analysis, 93: 58–80, 2005. Tolstikhin, Ilya, Sriperumbudur, Bharath K., and Muandet, Krikamol. Minimax estimation of kernel mean embeddings. Journal of Machine Learning Research, 18:1–47, 2017. Vishwanathan, S.V. N., Schraudolph, Nicol N., Kondor, Risi, and Borgwardt, Karsten M. Graph kernels. Journal of Machine Learning Research, 11:1201–1242, 2010. Yamada, Makoto, Umezu, Yuta, Fukumizu, Kenji, and Takeuchi, Ichiro. Post selection inference with kernels. Technical report, 2016. (https://arxiv.org/abs/1610.03725). Zaheer, Manzil, Kottur, Satwik, Ravanbakhsh, Siamak, Póczos, Barnabás, Salakhutdinov, Ruslan R., and Smola, Alexander J. Deep sets. In NIPS, pp. 3394–3404, 2017. Zhang, Kun, Schölkopf, Bernhard, Muandet, Krikamol, and Wang, Zhikun. Domain adaptation under target and conditional shift. Journal of Machine Learning Research, 28(3):819–827, 2013. Shawe-Taylor, John and Cristianini, Nello. Kernel Methods for Pattern Analysis. Cambridge University Press, 2004. Zinger, A. A., Kakosyan, A. V., and Klebanov, L. B. A characterization of distributions by mean values of statistics and certain probabilistic metrics. Journal of Soviet Mathematics, 1992. Sinova, Beatriz, Gonzlez-Rodrı́guez, Gil, and Aelst, Stefan Van. M-estimators of location for functional data. Bernoulli, 24:2328–2357, 2018. Zolotarev, V. M. Probability metrics. Theory of Probability and its Applications, 28:278–302, 1983. MONK – Outlier-Robust Mean Embedding Estimation by Median-of-Means Supplement The supplement contains a few technical lemmas used during the proofs of our results (Section A), and the McDiarmid inequality for self-containedness (Section B). A. Technical Lemmas Lemma 3 (Supremum). sup af − sup bf ≤ sup |af − bf |. f f f Proof. By using the subadditive property of sup: f f f ≤ sup |af − bf | + sup af , f < ∞ where kgk∞ = 1. supf ∈BK kgf k∞ supu1:M ∈XM |g(u1:M )|. 2. u1:M 7→ gf (u1:M ) is measurable for all f ∈ BK . 3. f 7→ gf (u1:M ) is continuous for all u1:M ∈ XM . 4. BK is separable. f sup af = sup(af − bf + bf ) ≤ sup(af − bf ) + sup bf f f f f ≤ sup |af − bf | + sup bf . f f   These two inequalities imply ± supf af − supf bf ≤ supf |af − bf |, from which the statement follows. Lemma 4 (Bounded difference property of Z). Let N ∈ Z+ , (Sq )q∈[Q] be a partition of [N ], K : X × X → R be a kernel, µ be the mean embedding associated to K, x1:N be i.i.d. random  variables on X, Z(xV  ) = P 2hf,µSq −µP i 2hf,µSq −µP i K K − Eφ , φ sup ǫ ǫ f ∈BK q∈U where U ⊆ [Q], V = ∪q∈U Sq . Let x′Vi be xV except for the i ∈ V -th coordinate; xi is changed to x′i . Then  Z (xV ) − Z x′Vi ≤ 4, ∀i ∈ V. sup xV ∈X|V | ,x′i ∈X Proof. Since (Sq )q∈[Q] is a partition of [Q], (Sq )q∈U forms a partition of V and there exists a unique r ∈ U such that i ∈ Sr . Let Yq := Yq (f, xV ), =φ q∈U 2 f, µSq − µP ǫ K ! 2 f, µSq − µP ǫ − Eφ K Yr′ := Yr (f, x′Vi ). In this case Z (xV ) − Z = sup x′Vi  1. |φ(t)| ≤ 1 for any t, hence kgf k∞ ≤ 1 for all f ∈ BK . 2. Any f ∈ BK is continuous since HK ⊂ C(X) = {h : X → R continuous}, so u1:M 7→ (f (u1 ), . . . , f (uM )) is continuous. φ is Lipschitz, specifically continuous. The continuity of these two maps imply that of u1:M 7→ gf (u1:M ), specifically it is Borelmeasurable. 3. The statement follows by the continuity of f 7→ hf, hiK (h = µPM − µP ) and that of φ. 4. BK is separable since HK is so by assumption. B. External Lemma Below we state the McDiarmid inequality for selfcontainedness. , Lemma 6 (McDiarmid inequality). Let x1:N be X-valued independent random variables. Assume that f : XN → R satisfies the bounded difference property: X u1 ,...,uN ,u′r ∈X =  Yq − sup  f ∈BK X q∈U\{r} (b) ≤ sup |Yr − Yr′ | ≤ sup f ∈BK ! Proof. sup f ∈BK q∈U (a) Lemma 5 (Uniformly bounded separable Carathéodory family). Let ǫ > 0, N ∈ Z+ , Q ∈ Z+ , M = N/Q ∈ Z+ , φ(t) = (t − 1)I1≤t≤2 + It≥2 , K : X × X → R is a continuous kernel on the separable topological domainP X, µ is the M 1 mean embedding associated to K, PM := M m=1 δum , M G = {gf : f ∈ BK }, where gf : X → R is defined as   2 hf, µPM − µP iK gf (u1:M ) = φ . ǫ Then G is a uniformly bounded separable Carathéodory family: sup bf = sup(bf − af + af ) ≤ sup(bf − af ) + sup af f where in (a) we used Lemma 3, (b) the triangle inequality and the boundedness of φ [|φ(t)| ≤ 1 for all t]. f ∈BK   Yq + Yr′  |Yr | + |Yr′ | |{z} |{z} ≤2 ≤2  ≤ 4, |f (u1:N ) − f (u′1:N )| ≤ c, ∀n ∈ [N ], where u′1:N = (u1 , . . . , un−1 , u′n , un+1 , . . . , uN ). Then for any τ > 0 ! r τN ≥ 1 − e−τ . P f (x1:N ) < Ex1:N [f (x1:N )] + c 2
10math.ST
Can Balloons Produce Li-Fi? A Disaster Management Perspective Atchutananda Surampudi1, Sankalp Sirish Chapalgaonkar1 and Paventhan Arumugam2 arXiv:1712.04687v1 [cs.IT] 13 Dec 2017 1 Department of Electrical Engineering, Indian Institute of Technology Madras, 2 ERNET, IIT Madras Research Park. 1 {ee16s003, ee15b018}@ee.iitm.ac.in, 2 [email protected] Abstract—Natural calamities and disasters disrupt the conventional communication setups and the wireless bandwidth becomes constrained. A safe and cost effective solution for communication and data access in such scenarios is long needed. Light-Fidelity (Li-Fi) which promises wireless access of data at high speeds using visible light can be a good option. Visible light being safe to use for wireless access in such affected environments, also provides illumination. Importantly, when a Li-Fi unit is attached to an air balloon and a network of such Li-Fi balloons are coordinated to form a Li-Fi balloon network, data can be accessed anytime and anywhere required and hence many lives can be tracked and saved. We propose this idea of a Li-Fi balloon and give an overview of it’s design using the Philips Li-Fi hardware. Further, we propose the concept of a balloon network and coin it with an acronym, the LiBNet. We consider the balloons to be arranged as a homogenous Poisson point process in the LiBNet and we derive the mean co-channel interference for such an arrangement. Index Terms- Attocell dimension, interference, Li-Fi, light emitting diode, photodiode, rate, time division multiple access. I. I NTRODUCTION Visible-light-communications (VLC) or Light-Fidelity (Li-Fi) has gained a lot of prominence among the research groups around the world for it’s secure, safe, energy efficient and high speed data transfer characteristics over a wireless medium. The use of visible light, which has given life to the planet, is now paving the path for a new form of wireless communications [1]. This technology has both the characteristics of providing data access and illumination at the same time over linear-time-invariant optical wireless channels [2], [3]. Natural disasters like earthquakes or floods, disrupt the available wireless communication infrastructure and as a result the wireless bandwidth becomes scarce. But, in such scenarios, communication becomes an important aspect of the emergency response. A safe, high speed, energy efficient and spectrum efficient wireless access technology is the need of the hour. There have been several technologies in use for emergency communications, like the ham radio [4], cognitive radio [5], [6] etc. But, when the demand becomes large or large number of people have to be saved, these technologies remain sub-optimal due to the limited radio frequency (RF) spectrum available in such a situation. Also, if floods are considered, the people trapped below flood waters have to be saved immediately. Communicating with them, or to at least receive their location using some uplink signatures becomes a priority. RF waves cannot penetrate through flood waters, whereas the light wave can. So, Li-Fi can be a reliable and energy efficient option to improve the communication capacity along with illuminating the affected area. Lately, for practical purposes and outdoor applications, Li-Fi has been implemented using fixed light-emitting-diode (LED) sources [7]. The question that arises is, can these Li-Fi LEDs fly in the air, without any constraints, at a given height near the ground at around 10 to 15 metres, to provide the same data access whenever and wherever required? This idea of a mobile Li-Fi unit can be a good solution during such natural calamities. This can be achieved by using a bunch of centrally monitored balloons, which can carry the Li-Fi LEDs operated by low power batteries to illuminate as well as provide data access (or broadcast services) to a given region for a given period of time. A. Our approach and contributions Our contributions are as follows. • The Li-Fi Balloon - We present an overview of the design for the balloon using the Philips Li-Fi hardware. • The concept of LiBNet and the overall functioning. • The mean co-channel interference is derived for homogenous Poisson arrangement of balloons in one and two dimensions. B. Context of application: 1) Earthquakes: During earthquakes, every other communication infrastructure above or below the ground gets disrupted. Also, the problem deepens when any gas leaks happen and become susceptible to combustion. So, using the LiBNet, both illumination and high speed data services can be provided, in a safe way, without interfering with the RF frequencies. 2) Floods: In a flood affected region, LiBNet will be able to send a broadcast inside the water surface and receive any uplink messages from the people or pets trapped below. The balloons can coordinate to provide tracking services as well. The further organisation of the paper is as follows. In section II, we give a brief overview of the design of the Li-Fi balloon using the hardware from Philips. In section III, we present the concept of LiBNet and assuming a poisson point process arrangement, we derive the mean co-channel interference in such a scenario. The paper concludes with section IV. II. T HE L I -F I BALLOON The Li-Fi balloon can be designed with the outline presented in Fig. 1. R Table I DIMENSIONS OF THE BALLOON Part of the Balloon Diameter of the base Height of the basket Radius of the balloon sheet Diameter of the area for downlink and uplink components (Shaded area) Height of the Downlink LED Height of the wireless node(fixed near the roof of the basket) Length of the wireless node Width of the wireless node Symbol used Db hb Dimension 90cm 45cm R 70cm Dl 30cm hl 15cm hw 10cm lw 10cm ww 10cm Table II COMPONENTS USED PER BALLOON . hw hl Component Name Quantity Luxspace DN561B Philips downlink LiFi transmitter 4 Philips modem board Xitanium 20W LED power driver 1 Payload (max. value) 0.4 × 4 = 1.6kg 0.2kg 1 0.3kg hb FRONT VIEW Philips modem board LBRD1514-1 lw ww Dl Db TOP VIEW Figure 1. This figure is to a scale of 1:30. The front and top views of the Li-Fi balloon have been shown. All dimensions are in centimetres (cm) as given in Table I. The balloon’s aerial structure can be of any shape depending on the aerodynamical aspects. In the top view, the dashed circular boundary depicts the base of the balloon. There are four shaded regions on the base, on each of which a Li-Fi LED and an uplink receiver are placed. The space in the centre of the base is reserved for the LED drivers, constant power source and signal processing modem. For inter-balloon communication, at the corners of the base, four wireless nodes are placed (filled regions), with beamforming capability. A. The Base A Li-Fi balloon will contain all the necessary communication equipment and the power source. The construction of the balloon is as follows. It consists of a base (closed basket) onto which four downlink LEDs and uplink receivers are placed (shaded area). The shaded areas surround the empty area at the centre, where the power and LBRD14016-3 Uplink-IR Receiver 4 0.1 × 4 = 0.4kg DC Power supply Rechargeable power supply 1 2kg D-Link wireless access points Wireless nodes A 4 4 0.5 2kg Motion and Position sensor Sensor 1 (each) 0.1kg DC × = signal processing modem is placed. Four wireless nodes (with beam forming) are placed in alternate corners of the base, for inter-balloon communication. The material used for the basket can be any strong waterproof and non-conducting fiber [8]. Distribution of weight should be uniform and homogenous to stabilize the balloon at a given height. So, a symmetric arrangement of components is desired. B. The balloon sheet The frame of the balloon’s arial sheet, can be of circular or hexagonal shape, appropriate to the aerodynamic balancing aspects [9]. The material used can be a thin rigid polymer as proposed in [10] and [11] or water resistant polymers as in [12]. Light weight composites are preferred. C. Components and Hardware The Li-Fi components used are shown in Table II. From Table II, we have the total payload per balloon as 6.6kg. The dimensions in Table I suggest that the balloon will be closely packed. We now discuss the use of each component in Table II. The Philips Luxspace DN561B is a Li-Fi downlink transmitter and LBRD14016-3 is an uplink infrared receiver. These are used for illumination and data access with various emission properties [13]. In [14], these components have been used to characterize outage in an indoor Li-Fi environment. The LBRD1514-1 is a set of LED power drivers which are an integral part for intensity modulation (IM) purposes. The modem board acts as a central switch for all the LEDs and for IM. The modem board, drivers and the DC power supply can be appropriately fitted in the central space provided. The sensors will help in stabilizing the position and the inclination of the balloon. The wireless nodes will be useful to form an interconnected wireless balloon network. III. T HE L I BN ET A network of Li-Fi balloons is called LiBNet. Each balloon, using the wireless nodes, forms an interconnected wireless network. The balloons can be assumed to be arranged as a Poisson point process1 , as in [15], in both one and two dimensions which is shown in Fig. 2 and Fig. 3 respectively. For any arrangement, we consider all the balloons to be stabilized at a uniform height h and have an effective2 Lambertian emission − ln(2) . θh is the effective half-power-semiorder m = ln(cos(θ h )) angle (HPSA) of the balloon. The trapped victim is assumed to be at a distance z from the tagged balloon, which is nearest to the victim. The balloon network in one dimension tagged-balloon h h victim / trapped pet z attocell (0, 0) (z, 0) x Figure 2. (One dimension model) This figure shows the one dimension balloon network. The balloons can be assumed to be arranged deterministically or as a Poisson point process ψ, stabilized at a height h (black circular dots). The rectangular dotted regions on ground depict the attocells corresponding to each balloon above. The trapped victim (small cuboid) at (z, 0) (inside one of the attocell), receives data wirelessly from the tagged-balloon corresponding to the attocell in which he/she is located. Here, that attocell is highlighted as dash-dot. All other balloons become the co-channel interferers. Here, we assume that the victim can be trapped only along the thick line on ground. Every balloon is interconnected with each other wirelessly. A. How does the LiBNet work? Each balloon with the necessary Li-Fi equipment will cover a certain affected region via illumination. Uplink signatures from the trapped lives, can be received and downlink broadcast can be done. The sensing of uplink signatures can be done efficiently by using machine learning as in [16] for cognitive radio networks. All the balloons will be interconnected wirelessly and linked to a fusion centre (FC) which is in-turn 1 This assumption gives the worst case co-channel interference in the network. 2 Effective, because each balloon has four downlink LEDs. The balloon network in two dimensions tagged-balloon h victim at (dx , dy , 0) x z (0, 0, 0) attocell Figure 3. (Two dimension model) This figure shows the two dimension balloon network. The balloons can be assumed to be arranged deterministically or as a Poisson point process ψ, stabilized at a height h (black circular dots). The rectangular dotted regions on ground depict the attocells corresponding to each balloon above. The trapped victim (small cuboid) at (dx , dy , 0) (inside one of the attocell), receives data wirelessly from the tagged-balloon corresponding to the attocell in which it is located. Here, that attocell is highlighted as dashdot. All other balloons become the co-channel interferers. Here we assume that the victim can be trapped anywhere on the ground plane. Every balloon is interconnected with each other wirelessly. connected to the Internet. The uplink and downlink data will be routed through the network and through the FC as a gateway to the Internet. This model can be assumed similar to a wireless sensor network (WSN) in a cooperative sensing environment [17]. Now, various routing protocols can be used or devised [18], [19] to route the data efficiently. So, such a network of Li-Fi balloons can be used anywhere in the affected region. Their interconnected network can be used to track the lives of many and save them immediately. B. The mean co-channel interference Let all the points in the given balloon network be arranged as a Poisson point process ψ, in both one and two dimensions. Given an origin, let the balloons be at a distance x from the origin. The user photodiode (PD) is at a distance of z from the origin. Let the tagged balloon be at origin i.e. x = 0. Now, assuming a wavelength reuse factor of unity, all other balloons become co-channel interferers. We now derive the mean cochannel interference in the Poisson network of balloons with the assumptions in [20]. For a distance Dx between the PD and the balloon, the Signal-to-Interference-plus-Noise-Ratio (SINR) for such a network is given as γ(z) = P (z 2 + h2 )−m−3 ρ(D0 ) , 2 2 −m−3 ρ(D ) + Ω x x∈ψ\0 ((x + z) + h ) (1) where, ρ(Dx ) is the field-of-view (FOV) θf constraint function of the PD used by the trapped victim, which is defined as  1, |Dx | ≤ h tan(θf ), ρ(Dx ) = 0, |Dx | > h tan(θf ). The co-channel interference Ix is X f (x), Ix = x∈ψ\0 Converting to polar coordinates (r, θ), we have Z h tan(θf ) 1 E(Ix ) = 2π dr. 2 (r + h2 ) z where f (x) is given as ((x + z)2 + h2 )−m−3 ρ(Dx ). Hence, we state the theorem for mean interference below. Theorem 1. Consider a photodiode, with FOV θf radians, situated at a distance z (inside an attocell) from the origin, in a Poisson distributed balloons of Li-Fi LEDs, emitting light with an effective Lambertian emission order m, installed at a height h. Then, for a wavelength reuse factor of unity, the mean co-channel interference caused by the Poisson distributed cochannel interferers of intensity λ(x) at the photodiode is Z E(Ix ) = λ(x)f (x)dx, S where, E(.) is the expectation operator over all possible random arrangements in the Poisson point process and S is the support of the integration. Proof. The proof is provided in Appendix A.  We now extend Thm. 1 to one and two dimension LiBNets in the following Lem. 1 and 2 respectively. Lemma 1. The mean co-channel interference in a one dimension LiBNet with homogenously distributed Poisson point balloons is given as    2 1−2β E(Ix ) = λ h tan(θf )2 F1 0.5, β; 1.5; − tan (θf )   z2 − zh−2β 2 F1 0.5, β; 1.5; − 2 , h where, 2 F1 (.; .; .) is the ordinary hypergeometric function and β = m + 3. Proof. From Thm. 1, with the support S = [z, h tan(θf )] we have Z h tan(θf ) λ(x)f (x)dx, (2) E(Ix ) = z because, the interferers are present only after a distance z limited by the FOV of the PD. Now, for a one dimension network 1 f (x) = 2 (x + h2 )β and λ(x) = λ for a homogenous point process. Hence, integrating the same in (2) derives the result.  Lemma 2. The mean co-channel interference in a two dimension LiBNet homogenously distributed Poisson point balloons is given as   πh2−2β cos2β−2 (θf ) π(h2 + z 2 )1−β . − E(Ix ) = λ β−1 β−1 where, β = m + 3. Proof. For a two dimension homogenous Poisson point process of balloons we have λ(x) = λ and f (x, y) = (x2 +y12 +h2 ) . So, from Thm. 1, we can write Z Z 1 dxdy. λ 2 E(Ix ) = 2 + h2 ) (x + y S Integrating further, derives the result.  IV. C ONCLUSION In this paper, a novel idea of using balloons for Li-Fi has been proposed. A disaster or a natural calamity has been taken as a use case. An overview of the physical design of the balloon has been given. Given the payload, the installation of the communication components has been proposed using the Philips Li-Fi equipments. Symmetry of installation has been kept in mind. Further, the functioning of a network of such Li-Fi balloons has been discussed and coined an acronym of LiBNet. The mean co-channel interference in both one and two dimension LiBNets has been derived, assuming the balloons are arranged as a homogenous Poisson point process. Given the problems of contemporary interest, the possibilities of future work are extensive. Li-Fi, being a safe and high speed alternative to RF emergency communication set-ups, this concept, if implemented can save the lives of many. Tracking and positioning of people / pets becomes easier. But, Li-Fi, requiring too much line of sight, will have to co-exist with blockages. Hence an extension to a blockage model is desired. Also, as a future work, this concept can be further standardised and practically implemented. R EFERENCES [1] H. Haas, L. Yin, Y. Wang, and C. Chen, “What is LiFi?” Journal of Lightwave Technology, vol. 34, no. 6, pp. 1533–1544, 2016. [2] F. R. Gfeller and U. Bapst, “Wireless In-House Data Communication via Diffuse Infrared Radiation,” Proceedings of the IEEE, vol. 67, no. 11, pp. 1474–1486, 1979. [3] J. R. Barry, J. M. Kahn, E. A. Lee, and D. G. Messerschmitt, “HighSpeed Nondirective Optical Communication for Wireless Networks,” IEEE Network, vol. 5, no. 6, pp. 44–54, 1991. [4] R. C. Coile, “The Role of Amateur Radio in Providing Emergency Electronic Communication for Disaster Management,” Disaster Prevention and Management: An International Journal, vol. 6, no. 3, pp. 176–185, 1997. [5] E. Hossain, D. Niyato, and Z. Han, Dynamic Spectrum Access and Management in Cognitive Radio Networks. Cambridge university press, 2009. [6] A. Ghassemi, S. Bavarian, and L. Lampe, “Cognitive Radio for Smart Grid Communications,” in Smart Grid Communications (SmartGridComm), 2010 First IEEE International Conference on. IEEE, 2010, pp. 297–302. [7] H. Haas, “LiFi is a Paradigm-Shifting 5G Technology,” Reviews in Physics, 2017. [8] H. Von Blucher, H. Von Blucher, and E. De Ruiter, “Waterproof and Moisture-Conducting Fabric Coated with Hydrophilic Polymer,” Jun. 12 1984, uS Patent 4,454,191. [9] K. Kamnani and C. Suratkar, “A Review Paper on Google Loon Technique,” International Journal of Research In Science & Engineering, vol. 1, no. 1, pp. 167–171, 2015. [10] P. Podsiadlo, A. K. Kaushik, E. M. Arruda, A. M. Waas, B. S. Shim, J. Xu, H. Nandivada, B. G. Pumplin, J. Lahann, A. Ramamoorthy et al., “Ultrastrong and Stiff Layered Polymer Nanocomposites,” Science, vol. 318, no. 5847, pp. 80–83, 2007. [11] G. G. Tibbetts, M. L. Lake, K. L. Strong, and B. P. Rice, “A Review of the Fabrication and Properties of Vapor-Grown Carbon Nanofiber/Polymer Composites,” Composites Science and Technology, vol. 67, no. 7, pp. 1709–1718, 2007. [12] J.-W. Rhim, “Physical and Mechanical Properties of Water Resistant Sodium Alginate Films,” LWT-Food Science and Technology, vol. 37, no. 3, pp. 323–330, 2004. [13] P. Lighting, Lighting manual. Phillips Lighting Company, 1981. [14] A. Surampudi, S. S. Chapalgaonkar, and P. Arumugam, “Experimental Tests for Outage Analysis in SISO Li-Fi Indoor Communication Environment,” Proceedings of the Asia-Pacific Advanced Network, vol. 44, pp. 54–60, 2017. [15] M. M. Azari, Y. Murillo, O. Amin, F. Rosas, M.-S. Alouini, and S. Pollin, “Coverage Maximization for a Poisson Field of Drone Cells,” arXiv preprint arXiv:1708.06598, 2017. [16] A. Surampudi and K. Kalimuthu, “An Adaptive Decision Threshold Scheme for the Matched Filter Method of Spectrum Sensing in Cognitive Radio using Artificial Neural Networks,” in Information Processing (IICIP), 2016 1st India International Conference on. IEEE, 2016, pp. 1–5. [17] J. Yick, B. Mukherjee, and D. Ghosal, “Wireless Sensor Network Survey,” Computer Networks, vol. 52, no. 12, pp. 2292–2330, 2008. [18] A. Surampudi and K. Kalimuthu, “An Energy Efficient Spectrum Sensing in Cognitive Radio Wireless Sensor Networks,” arXiv preprint arXiv:1711.09255, 2017. [19] K. Akkaya and M. Younis, “A Survey on Routing Protocols for Wireless Sensor Networks,” Ad-Hoc Networks, vol. 3, no. 3, pp. 325–349, 2005. [20] C. Chen, S. Videv, D. Tsonev, and H. Haas, “Fractional Frequency Reuse in DCO-OFDM-Based Optical Attocell Networks,” Journal of Lightwave Technology, vol. 33, no. 19, pp. 3986–4000, 2015. A PPENDIX A P ROOF OF M EAN I NTERFERENCE Proof. The Laplace transform of the Interference Ix is given as LIx (s) = Eψ (e−sIx ), P = Eψ (e−s x∈ψ\0 f (x) ),   Y e−sf (x) , = Eψ (a) = e x∈ψ\0 R (1−e−sf (x) )dx R −λ(x) , (3) where, (a) follows from the definition of expectation operator. Now, taking the nth order derivative on L.H.S of (3) w.r.t s, we have ∂n (−1)n n (E(e−sIx )) = E(Ixn e−sIx ). ∂s Using the result in (3), we can write for n = 1 as E(Ix e−sIx ) = (−1)e−λ(x) R (−1) λ(x) R (1−e−sf (x) )dx Z R  (−1)(−f (x))dx . (4) Substituting s = 0 in (4) we have Z E(Ix ) = λ(x)f (x)dx, R proving the theorem. 
7cs.IT
Counterexamples and Proof Loophole for the C/C++ to POWER and ARMv7 Trailing-Sync Compiler Mappings Caroline Trippel Daniel Lustig∗ Michael Pellauer∗ Margaret Martonosi ∗ Princeton University NVIDIA {manerkar,ctrippel,mrm}@princeton.edu {dlustig,mpellauer}@nvidia.com arXiv:1611.01507v2 [cs.PL] 17 Nov 2016 Yatin A. Manerkar Abstract The C and C++ high-level languages provide programmers with atomic operations for writing highperformance concurrent code. At the assembly language level, C and C++ atomics get mapped down to individual instructions or combinations of instructions by compilers, depending on the ordering guarantees and synchronization instructions provided by the underlying architecture. These compiler mappings must uphold the ordering guarantees provided by C/C++ atomics or the compiled program will not behave according to the C/C++ memory model. In this paper we discuss two counterexamples to the well-known trailing-sync compiler mappings for the Power and ARMv7 architectures that were previously thought to be proven correct. In addition to the counterexamples, we discuss the loophole in the proof of the mappings that allowed the incorrect mappings to be proven correct. We also discuss the current state of compilers and architectures in relation to the bug. 1 Introduction The C and C++ high-level languages provide programmers with atomic memory operations for writing high-performance concurrent code. Different types of atomic memory operations provide different levels of memory ordering guarantees. Stronger memory ordering guarantees usually correlate to lower performance and weaker memory ordering guarantees to higher performance. Users can utilise different types of atomic memory operations depending on the guarantees and performance they require. At the assembly language level, C and C++ atomics get mapped down to individual instructions or combinations of instructions by compilers, depending on the ordering guarantees and synchronization instructions provided by the underlying architecture. These compiler mappings must uphold the ordering guarantees provided by C/C++ atomics or the compiled program will not behave according to the C/C++ memory model. In this report we discuss two counterexamples to the well-known trailing-sync compiler mappings for the Power and ARMv7 architectures that were supposedly proven correct [6]. In these counterexamples, a particular execution of the program is forbidden by C/C++ but incorrectly allowed by the compiled program. In addition to the counterexamples, we discuss the loophole in the proof of the mappings that allowed the incorrect mappings to be proven correct. We also discuss the current state of compilers and architectures in relation to the bug. Section 2 provides background information on C/C++ atomic memory operations and the relations in the memory model relevant to the counterexamples, as well as the relevant compiler mappings for ARMv7 and Power. Sections 3 and 4 discuss the two counterexamples for the trailing-sync mapping (variants of the well-known IRIW and RWC litmus tests respectively) at both the C/C++ level and the Power/ARM level. Section 5 discusses the loophole in the proof of the mappings [6] that allowed the incorrect mappings to be proven correct. Section 6 discusses the current state of compilers and architectures in relation to the bug, and Section 7 concludes. 1 2 Background Information 2.1 C/C++ atomics and Relevant Memory Model Relations C/C++ introduced atomic objects and operations in the C/C++11 standards, along with a new memory model governing the order in which C/C++ threads are allowed to observe each others’ memory accesses. The C/C++ memory model is based on the data-race-free and properly-labeled models of Adve and Hill and Gharachorloo et al. respectively [2, 9], which guarantee sequential consistency for programs that do not contain any data races. Here we provide a brief overview of the portions of C/C++ atomics and the C/C++ memory model that are relevant to our counterexamples. We refer the reader to the large body of work on the C/C++ memory model for further details [8, 10, 4, 15, 5]. Different operations can be conducted on C/C++ atomic objects, such as load, store, and compare-andexchange operations. Each such operation can be given a memory order, including memory order seq cst, memory order release, and memory order acquire, which represent sequentially consistent (SC) operations, release operations, and acquire operations respectively. Different memory orders provide different guarantees with respect to the ordering of the atomic memory access with other accesses in the program. Conceptually, a release operation is a write which ensures that prior accesses are made visible before the release. Likewise, an acquire operation is conceptually a read which ensures that memory operations after the acquire are made visible after the acquire itself. A release corresponds to granting permission to access a set of shared locations, while an acquire is performed to gain access to a set of shared locations [1]. Note that an SC read is also an acquire operation and an SC store is also a release operation. SC operations have further constraints on their execution, which are detailed below. In a given C/C++ execution, the rf relation relates a write operation to a read operation which reads the value of that write. The mo relation enforces a total order on all write operations to the same address, and all threads must observe writes to a given address in this mo order. The fr relation relates a given read to the writes that follow the source write of the read in mo-order. The happens-before relation hb is the transitive closure of the sequenced-before relation sb, which corresponds to program order on an individual C/C++ thread, and the synchronizes-with relation sw, which relates release store operations (and stores in their release sequence) to acquire read operations that read the release store (or a store in its release sequence). (Release sequences are not necessary for understanding the counterexamples in this paper.) The total order on sequentially consistent operations sc must obey the following constraints [10, 5]: • It must be a total order on SC operations, so any two SC operations must be ordered with respect to each other. • It must be consistent with hb and mo restricted to SC atomics. In other words, it is forbidden for two accesses to be related by hb/mo in one direction and sc in the other direction. These first two conditions are henceforth referred to as the consistent sc order property, using the terminology of Batty et al. [6]. • SC reads (i.e. reads annotated with memory order seq cst) must either read from the latest SC write before them in the sc order, or they must read from a non-SC write that does not happen-before the latest SC write to that location. This condition is henceforth referred to as the sc accesses sc reads restricted property, again using the terminology of Batty et al. [6]. Thus, according to the C/C++ memory model, the sc order must be consistent with hb, and any two SC operations must be ordered with respect to each other by sc. Thus, if a hb edge exists between two SC atomics, an sc edge must also exist between them in the same direction. 2.2 C/C++ Compiler Mappings to Power and ARMv7 The Power and ARMv7 architectures are two well-known architectures in use today. They are notable for their weak memory models, which allow a great deal of reordering and can require careful use of dependencies and synchronization instructions in order to ensure desired outcomes. Here we provide a brief overview of the 2 relevant instructions in the Power and ARMv7 memory models. We refer the reader to existing work on the memory models of these architectures for further details [12, 3]. In Power, an lwsync is a fence which cumulatively orders all reads and writes prior to the fence before any writes after the fence. An lwsync does not order writes prior to the fence with respect to reads after the fence. A sync in Power is a fence which cumulatively orders all reads and writes prior to the fence before all reads and writes after the fence. The ARMv7 dmb ish fence is analogous to the Power sync. There are two commonly-accepted compiler mappings from C/C++ to Power and ARMv7: the leadingsync mapping and the trailing-sync mapping [6, 13]. The relevant portions of these mappings are provided in Tables 1 and 2 for reference. A notable difference between the Power and ARMv7 versions of each mapping is that ARMv7 does not have an equivalent of the Power lightweight lwsync fence. It only has the heavyweight dmb ish fence which provides orderings mostly equivalent to Power’s heavyweight sync fence. Thus, the ARMv7 implementations of store releases and trailing-sync SC stores utilise a dmb ish fence where the corresponding Power mappings use an lwsync. The “cmp; bc; isync” and “teq; beq; isb” instruction sequences are known as ctrlisync and ctrlisb respectively. The combination of a conditional branch followed by an isync (on Power) or an isb (on ARMv7) instruction is enough to enforce that all instructions after the isync/isb begin execution after a load which the branch depends on. This initially appears to be enough to implement the orderings required by C/C++ memory order acquire primitives, but as our counterexamples show, issues can arise when acquires interoperate with SC atomics. As stated above, SC loads are also acquires and SC stores are also releases. In addition to providing acquire and release semantics respectively, SC loads and stores must also obey the aforementioned constraints on the total sc order. Part of these constraints requires ensuring that an SC store followed by an SC load in sb appear in that order to all cores. This requires a heavyweight sync or dmb ish fence between the SC store and the SC load on Power and ARMv7. Such a fence can either be incorporated into the mapping before all SC loads (which gives the leading-sync mapping) or after all SC stores (which gives the trailing-sync mapping). Only the instruction sequences for SC loads and stores change between the leading and trailing-sync mappings. C/C++ Atomic Operation Load Acquire Load Seq Cst Store Release Store Seq Cst Power Mapping ld; cmp; bc; isync sync; ld; cmp; bc; isync lwsync; st sync; st ARMv7 Mapping ldr; teq; beq; isb dmb ish; ldr; teq; beq; isb dmb ish; str dmb ish; str Table 1: Leading-sync compiler mapping from certain C/C++11 atomic operations to Power and ARMv7. C/C++ Atomic Operation Load Acquire Load Seq Cst Store Release Store Seq Cst Power Mapping ld; cmp; bc; isync ld; sync lwsync; st lwsync; st; sync ARMv7 Mapping ldr; teq; beq; isb ldr; dmb ish dmb ish; str dmb ish; str; dmb ish Table 2: Trailing-sync compiler mapping from certain C/C++11 atomic operations to Power and ARMv7. Examining the mappings at a high level, one can notice the following: • The lwsync/sync or dmb ish prior to a release or SC store ensures that accesses before the release or SC store are made visible to other cores before they observe the release. • The ctrlisync/ctrlisb following a load acquire enforces that all accesses after the acquire begin execution after the acquire. • The extra sync/dmb ish before SC loads or after SC stores enforces ordering between SC stores and subsequent SC loads in program order. 3 Initial conditions: a: x=0, b: y=0 T0 T1 T2 T3 c: st(x, 1, seq cst) d: st(y, 1, seq cst) e: r1 = ld(x, acquire) g: r3 = ld(y, acquire) f: r2 = ld(y, seq cst) h: r4 = ld(x, seq cst) Outcome forbidden by C/C++: r1=1, r2=0, r3=1, r4=0 Figure 1: The IRIW counterexample, specifically the case where both of the first loads on the reading cores are acquires. In this figure, memory order x is abbreviated to x for brevity. a:Wna x=0 sb mo sw c:Wsc x=1 mo, sw d:Wsc y=1 sw sc_hb b:Wna y=0 sc_fr sc_fr e:Racq x=1 sbsw sc_hb f:Rsc y=0 g:Racq y=1 sb h:Rsc x=0 Figure 2: Execution graph of the IRIW counterexample generated with the help of CPPMEM [7], with relevant edges showing why the execution is forbidden by the C/C++ memory model. Both the leading and trailing-sync mappings were supposedly proven correct by Batty et al. [6]. However, we discovered a loophole in their proof which allowed the incorrect trailing-sync mappings to be proven correct. The loophole is detailed in Section 5. The next two sections discuss the counterexamples we discovered for the trailing-sync mapping. These counterexamples were discovered using a framework [14] capable of exhaustively enumerating common C11 litmus tests with varied combinations of memory orders and comparing their outcomes against those of the equivalent ISA-level litmus tests (obtained by compiling with a given mapping) on a variety of microarchitectural implementations defined using the µspec language (as seen in the COATCheck paper [11]). Specifically, these counterexamples were observed during runs of the framework on a microarchitecture with Power/ARMv7-like features and using a trailing-sync compiler mapping. The runtimes of the framework are very reasonable. 3 The IRIW Counterexample The first counterexample is a variant of the well-known Independent Reads Independent Writes (IRIW) litmus test, where at least one of the first loads on the reading cores is an acquire operation. All other accesses in the test are SC accesses. The case where both of the first loads on the reading cores are acquires is shown in Figure 1. The rest of this section focuses on this particular case of the counterexample, though the reasoning for the cases where only one load is an acquire is very similar. We begin by showing why this outcome is forbidden under the current C/C++ memory model. One execution graph for the test’s outcome is shown in Figure 2. Note that the SC stores c and d synchronize-with the acquire operations e and g respectively, as the acquires read the values of the SC stores, and SC stores are also releases. As per the current C/C++ memory model, both the sc fr and sc hb edges must be part of the sc total order. The sc fr edges (marked in dark red) from h → c and f → d shadow the fr edges between these operations, and must be part of the sc order to abide by the sc accesses sc reads restricted axiom mentioned in Section 2. This is because both the SC reads f and h read from the non-SC initial writes (b and a respectively) which hb all other writes. If the sc order contained the reverse of one of the sc fr edges, then the initial writes (accesses b and a) that the SC reads read from would hb the latest SC writes to the locations (d and c respectively), thus causing the SC reads to fail the sc accesses sc reads restricted axiom. Meanwhile, there is a hb edge from c → f through the transitive composition of the sw edge from c → e and the sb edge from e → f . Likewise, there is a hb edge from d → h through the transitive composition of the sw edge from d → g and the sb edge from g → h. Thus, in order to keep the sc order consistent with hb, there must also be sc edges from c → f and d → h, which correspond to the sc hb edges in Figure 2. 4 Initial conditions: x=0, y=0 C0 C1 C2 C3 sync sync st x = 1 st y = 1 r1 = ld x r3 = ld y ctrlisync ctrlisync sync sync r2 = ld y r4 = ld x ctrlisync ctrlisync Forbidden: r1=1, r2=0, r3=1, r4=0 Initial conditions: x=0, y=0 C0 C1 C2 C3 dmb ish dmb ish st x = 1 st y = 1 r1 = ld x r3 = ld y ctrlisb ctrlisb dmb ish dmb ish r2 = ld y r4 = ld x ctrlisb ctrlisb Forbidden: r1=1, r2=0, r3=1, r4=0 Figure 3: IRIW counterexample compiled to Power (left) and ARMv7 (right) using the leading-sync compiler mapping. Instructions relevant to the outcome are in bold. The heavyweight sync/dmb ish fences between the pairs of loads on C2 and C3 are sufficient to disallow the forbidden outcome on ARMv7 and Power. Initial conditions: x=0, y=0 C0 C1 C2 C3 lwsync lwsync st x = 1 st y = 1 r1 = ld x r3 = ld y sync sync ctrlisync ctrlisync r2 = ld y r4 = ld x sync sync Allowed: r1=1, r2=0, r3=1, r4=0 Initial conditions: x=0, y=0 C0 C1 C2 C3 dmb ish dmb ish st x = 1 st y = 1 r1 = ld x r3 = ld y dmb ish dmb ish ctrlisb ctrlisb r2 = ld y r4 = ld x dmb ish dmb ish Allowed: r1=1, r2=0, r3=1, r4=0 Figure 4: IRIW counterexample compiled to Power (left) and ARMv7 (right) using the trailing-sync compiler mapping. Instructions relevant to the outcome are in bold. The absence of heavyweight sync/dmb ish fences between the pairs of loads on C2 and C3 result in the outcome being allowed by both Power and ARMv7 models (and visible on Power hardware). The combination of the sc hb edges with the sc fr edges results in a cycle in the sc order, which means it is not a total order and is thus invalid. As a result, there are no consistent executions of the listed outcome of this C/C++ program as it is impossible to create a total sc order for the outcome that abides by both the consistent sc order and sc accesses sc reads restricted axioms. The compilation of this test program to Power and ARMv7 using the leading-sync mapping is shown in Figure 3. The heavyweight sync (or dmb ish in the case of ARMv7) fences between each pair of loads on C2 and C3 are enough to disallow the forbidden outcome of the test in this case. These compiled Power and ARMv7 tests are forbidden by the Power and ARMv7 models of Alglave et al. [3], and the corresponding outcomes are not observable on Power or ARMv7 hardware. On the other hand, when the C/C++ program is compiled to Power and ARMv7 using the trailing-sync mapping, the resultant programs are shown in Figure 4. In this case, there is only a ctrlisync (or ctrlisb in the case of ARMv7) between each pair of loads on C2 and C3. This is not sufficient to disallow the forbidden outcome of the test, which is allowed by both the Power and ARMv7 models of Alglave et al. [3]. Furthermore, Alglave et al. have observed the forbidden C/C++ outcome of the trailing-sync Power version of this test on Power hardware [3]. The problem which results in this bug is that the counterexample program induces a hb edge between two SC accesses (such as c and f in Figure 2) by means of the transitive composition of hb edges to and from an intermediate non-SC access (in this case, the sw and sb edges from c → e and e → f respectively). The requirement of the C/C++ memory model that sc be consistent with hb thus requires that c be before f in sc. In other words, no thread can observe f before it observes c. Both Power and ARMv7 require a heavyweight sync/dmb ish fence between accesses e and f in order to guarantee this property. Similarly, there must exist a sync/dmb ish fence between accesses g and h in order to guarantee the other sc edge induced by the requirement that hb is consistent with sc. When the test is compiled using the leading-sync mapping, a sync/dmb ish fence is correctly added between each pair of loads to provide the required guarantees. However, in the version of the test compiled 5 Initial conditions: a: x=0, b: y=0 T0 T1 T2 c: st(x, 1, seq cst) d: r1 = ld(x, acquire) f: st(y, 1, seq cst) e: r2 = ld(y, seq cst) g: r3 = ld(x, seq cst) Outcome forbidden by C/C++: r1=1, r2=0, r3=0 Figure 5: The RWC counterexample. In this figure, memory order x is abbreviated to x for brevity. a:Wna x=0 sb mo sw c:Wsc x=1 sw sc_hb mo, sw b:Wna y=0 d:Racq x=1 sb sc_fr e:Rsc y=0 f:Wsc y=1 sc_fr sb, sc_hb g:Rsc x=0 Figure 6: Execution graph of the RWC counterexample generated with the help of CPPMEM [7], with relevant edges showing why the execution is forbidden by the C/C++ memory model. using the trailing-sync mapping, there is only a ctrlisync/ctrlisb between each pair of loads, which is not enough to provide the required guarantees. This results in the forbidden C/C++ outcome being allowed by the Power and ARMv7 models (and observable on Power hardware). 4 The RWC Counterexample The second counterexample is a variant of the well-known Read-to-Write-Causality (RWC) litmus test, where the first load on the second core is an acquire operation. All other accesses in the test are SC accesses. The C/C++ code for this test is shown in Figure 5. Once again, we begin by showing why the execution is forbidden under the C/C++ memory model. An execution graph for the test’s outcome is shown in Figure 6. As in the IRIW counterexample, the total order on SC operations must include the sc fr edges as well as the sc hb edges. The sc fr edges from e → f and g → c are required to satisfy sc accesses sc reads restricted, since both the SC reads read from non-SC writes. Meanwhile, the sc hb edges from c → e and f → g are required to satisfy consistent sc order, since there are hb edges from c → e and f → g. The hb edge from c → e arises through the transitive composition of sw and sb edges from c → d and d → e respectively. Meanwhile, the accesses f and g are directly related by sequenced-before (and thus hb), and not through an intermediate access. The combination of the sc fr and sc hb edges generates a cycle in the sc order, which means it is not a total order as C/C++ requires. Thus, there is no consistent execution of this program that generates the listed outcome under the C/C++ memory model, as it is impossible to construct a correct sc order for such an execution. The compiled versions of this program to Power and ARMv7 using the leading-sync and trailing-sync mappings are shown in Figures 7 and 8 respectively. As in the IRIW counterexample, to enforce the sc ordering from c → e, there must be a heavyweight sync/dmb ish between accesses d and e. In the version compiled with the leading-sync mapping, there are sync/dmb ish fences between each pair of reads (including between accesses d and e), and the overall outcome is correctly forbidden by both the Power and ARMv7 models of Alglave et al. [3]. On the other hand, when compiled with the trailing-sync mapping, there is only a ctrlisync/ctrlisb between accesses d and e, which is not enough to enforce the sc ordering from c → e. Thus, the versions of the test compiled with the trailing-sync mapping incorrectly allow the forbidden C/C++ outcome according to the Power and ARMv7 models of Alglave et al. In addition, Alglave et al. have observed the forbidden C/C++ outcome of the trailing-sync Power version on Power hardware [3]. It is noteworthy that although the sc edge between accesses f and g is required because sc must be consistent with hb, the accesses are directly related through sb, and not through an intermediate access. 6 Initial conditions: x=0, y=0 C0 C1 C2 sync sync st x = 1 r1 = ld x st y = 1 ctrlisync sync sync r2 = ld y r3 = ld x ctrlisync ctrlisync Forbidden: r1=1, r2=0, r3=0 Initial conditions: x=0, y=0 C0 C1 C2 dmb ish dmb ish st x = 1 r1 = ld x st y = 1 ctrlisb dmb ish dmb ish r2 = ld y r3 = ld x ctrlisb ctrlisb Forbidden: r1=1, r2=0, r3=0 Figure 7: RWC counterexample compiled to Power (left) and ARMv7 (right) using the leading-sync compiler mapping. Instructions relevant to the outcome are in bold. The heavyweight sync/dmb ish fences between the pairs of loads on C1 and C2 are sufficient to disallow the forbidden outcome on ARMv7 and Power. Initial conditions: x=0, y=0 C0 C1 C2 lwsync lwsync st x = 1 r1 = ld x st y = 1 sync ctrlisync sync r2 = ld y r3 = ld x sync sync Forbidden: r1=1, r2=0, r3=0 Initial conditions: x=0, y=0 C0 C1 C2 dmb ish dmb ish st x = 1 r1 = ld x st y = 1 dmb ish ctrlisb dmb ish r2 = ld y r3 = ld x dmb ish dmb ish Forbidden: r1=1, r2=0, r3=0 Figure 8: RWC counterexample compiled to Power (left) and ARMv7 (right) using the trailing-sync compiler mapping. Instructions relevant to the outcome are in bold. The absence of heavyweight sync/dmb ish fences between the pairs of loads on C1 results in the outcome being allowed by both Power and ARMv7 models (and visible on Power hardware). Ordering between SC accesses in program order on the same core is guaranteed by the sync/dmb ish fences used to implement SC accesses in both the leading-sync and trailing-sync mappings. As a result, the required sync/dmb ish fence between accesses f and g exists in the versions compiled using either mapping. Similarly, in the cases of the IRIW counterexample where both of the reads on T2 or T3 are SC reads, a sync/dmb ish fence will always exist between them. It is only in the case where the hb edge between two SC accesses arises due to an intermediate non-SC access (as in the case from c → e in the RWC counterexample) that the choice of mapping affects the correctness of compilation. 5 Loophole in the Compilation Proof of Batty et al. The correctness of compilation from C/C++ to Power (and by analogy, to ARMv7) using both the leadingsync and trailing-sync mappings was supposedly proven by Batty et al. [6]. Given the above counterexamples, there must be a loophole in the proof that allowed the incorrect mappings to be proven correct. We examined the proof and discovered that the authors did not correctly check whether a given mapping enforced the consistency of the sc and hb relations with respect to each other. This allowed a mapping like the trailing-sync mapping (which does not always ensure that sc is consistent with hb) to be proven correct. sc As part of their proof, the authors state that the sc order is an arbitrary linearization of (posc t ∪ cot ∪ sc sc ∗ f rt ∪ erft ) (which is – at a high level – the combination of program order edges and coherence edges directly between SC accesses). Later in the proof, they state that enforcing that the sc order is an arbitrary linearization of the above relation is enough to ensure that sc is consistent with hb. These claims are not sc sc sc ∗ always true. (posc t ∪ cot ∪ f rt ∪ erft ) does not take into account hb edges between SC accesses that can arise through the transitive composition of hb edges to and from an intermediate non-SC access. (Such edges arise in both our counterexamples.) Per C/C++ memory model requirements, the sc order must sc sc sc ∗ be consistent with these hb edges, but an arbitrary linearization of (posc t ∪ cot ∪ f rt ∪ erft ) may not be consistent with them. This also means that enforcing that the sc order is an arbitrary linearization of 7 sc sc sc ∗ (posc t ∪ cot ∪ f rt ∪ erft ) is not enough to guarantee that the compiled code enforces the constraint that sc and hb are consistent with each other. This loophole allows the trailing-sync mapping, which does not provide this guarantee (as seen in Sections 3 and 4), to be proven correct. We contacted Batty et al. regarding this loophole in their proof, and they graciously confirmed our findings. 6 Current State of Compilers and Architectures The previous sections have established that the trailing-sync compiler mapping is invalid for the current C/C++ memory model. Luckily, as of this paper, neither GCC nor Clang implement the exact trailingsync mapping in Table 2 for either Power or ARMv7. Specifically, GCC and Clang use the leading-sync compiler mapping for Power, and while they use a trailing-sync mapping for ARMv7, the mapping for load acquire operations is ld; dmb ish (or stronger). Thus, when compiled for ARMv7 with GCC or Clang, the trailing-sync counterexamples do have sync/dmb ish fences between each pair of loads, which, as outlined in Sections 3 and 4, is enough to disallow the forbidden C/C++ outcome. Architecturally speaking, the forbidden C/C++ outcomes of both counterexamples have been observed on Power hardware when the tests are compiled using the trailing-sync mapping [3]. While the ARMv7 model of Alglave et al. allows the forbidden C/C++ outcome when the test is compiled to ARMv7 using the trailing-sync mapping, the behaviour has not been observed on ARMv7 hardware [3]. Finally, while the leading-sync compiler mapping is not vulnerable to the counterexamples discussed in this paper, Vafeiadis et al. have recently also found a counterexample for the leading-sync compiler mapping [16], which they will be publishing separately. The combination of these counterexamples means that it is currently impossible to correctly compile C/C++ to Power or ARMv7 with either mapping, and either the mappings or the C/C++ memory model will need to change for correct compilation to be possible. 7 Conclusion In this paper we have outlined two counterexamples for the trailing-sync compiler mappings from C/C++ to Power and ARMv7, as well as the loophole in a prior proof of correctness of these mappings that allowed them to be proven correct. Looking forward, either the mappings or the C/C++ memory model will need to change in order to ensure that the guarantees of the high-level language memory model are respected by compiled programs running on the Power and ARMv7 architectures. 8 Acknowledgements This work was supported in part by C-FAR, one of the six SRC STARnet Centers, sponsored by MARCO and DARPA. References [1] Sarita Adve and Kourosh Gharachorloo. Shared memory consistency models: A tutorial. IEEE Computer, 29(12):66–76, 1996. [2] Sarita V. Adve and Mark D. Hill. Weak ordering – a new definition. In Proceedings of the 17th Annual International Symposium on Computer Architecture, ISCA ’90, pages 2–14, New York, NY, USA, 1990. ACM. [3] Jade Alglave, Luc Maranget, and Michael Tautschnig. Herding cats: Modelling, simulation, testing, and data mining for weak memory. ACM Transactions on Programming Languages and Systems (TOPLAS), 36(2):7:1–7:74, July 2014. [4] Mark Batty. The C11 and C++11 Concurrency Model. PhD thesis, University of Cambridge, Cambridge, UK, 2014. 8 [5] Mark Batty, Alastair F. Donaldson, and John Wickerson. Overhauling SC atomics in C11 and OpenCL. In 43rd Annual Symposium on Principles of Programming Languages (POPL), 2016. [6] Mark Batty, Kayvan Memarian, Scott Owens, Susmit Sarkar, and Peter Sewell. Clarifying and compiling C/C++ concurrency: From C++11 to POWER. In Proceedings of the 39th Annual ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, POPL ’12, pages 509–520, New York, NY, USA, 2012. ACM. [7] Mark Batty, Scott Owens, Susmit Sarkar, Peter Sewell, and Tjark Weber. Mathematizing C++ concurrency. In 38th Annual Symposium on Principles of Programming Languages (POPL), 2011. [8] Hans-J. Boehm and Sarita V. Adve. Foundations of the C++ concurrency memory model. In 29th Conference on Programming Language Design and Implementation (PLDI), 2008. [9] Kourosh Gharachorloo, Daniel Lenoski, James Laudon, Phillip Gibbons, Anoop Gupta, and John Hennessy. Memory consistency and event ordering in scalable shared-memory multiprocessors. 17th International Symposium on Computer Architecture (ISCA), 1990. [10] ISO/IEC. Programming Languages – C++, 2014. [11] Daniel Lustig, Geet Sethi, Margaret Martonosi, and Abhishek Bhattacharjee. ”COATCheck: Verifying Memory Ordering at the Hardware-OS Interface. In Proceedings of the 21st International Conference on Architectural Support for Programming Languages and Operating Systems, 2016. [12] Susmit Sarkar, Peter Sewell, Jade Alglave, Luc Maranget, and Derek Williams. Understanding power multiprocessors. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’11, pages 175–186, New York, NY, USA, 2011. ACM. [13] Peter Sewell. C/C++11 mappings to processors. 2016. [14] Caroline Trippel, Yatin A. Manerkar, Daniel Lustig, Michael Pellauer, and Margaret Martonosi. Exploring the trisection of software, hardware, and ISA in memory model design. CoRR, abs/1608.07547, 2016. [15] Viktor Vafeiadis, Thibaut Balabonski, Soham Chakraborty, Robin Morisset, and Francesco Zappa Nardelli. Common compiler optimisations are invalid in the C11 memory model and what we can do about it. In 42nd Symposium on Principles of Programming Languages (POPL), 2015. [16] Viktor Vafeiadis and Ori Lahav. Personal communication, Sept. 27th, 2016. 9
6cs.PL
An Exploration of 2D and 3D Deep Learning Techniques for Cardiac MR Image Segmentation Christian F. Baumgartner?1 , Lisa M. Koch?2 , Marc Pollefeys2 , Ender Konukoglu1 arXiv:1709.04496v2 [cs.CV] 10 Oct 2017 1 2 Computer Vision Lab, ETH Zurich Computer Vision and Geometry Group, ETH Zurich Abstract. Accurate segmentation of the heart is an important step towards evaluating cardiac function. In this paper, we present a fully automated framework for segmentation of the left (LV) and right (RV) ventricular cavities and the myocardium (Myo) on short-axis cardiac MR images. We investigate various 2D and 3D convolutional neural network architectures for this task. Experiments were performed on the ACDC 2017 challenge training dataset comprising cardiac MR images of 100 patients, where manual reference segmentations were made available for end-diastolic (ED) and end-systolic (ES) frames. We find that processing the images in a slice-by-slice fashion using 2D networks is beneficial due to a relatively large slice thickness. However, the exact network architecture only plays a minor role. We report mean Dice coefficients of 0.950 (LV), 0.893 (RV), and 0.899 (Myo), respectively with an average evaluation time of 1.1 seconds per volume on a modern GPU. 1 Introduction Cardiovascular diseases are a major public health concern and currently the leading cause of death in Europe [12]. Automated segmentation of cardiac structures from medical images is an important step towards analysing normal and pathological cardiac function on a large scale, and ultimately towards developing diagnosis and treatment methods. Until recently, the field of anatomical segmentation was dominated by atlasbased techniques (e.g. [2]), which have the advantage of providing strong spatial priors and yielding robust results with relatively little training data. With more data becoming available and recent advances in machine learning and parallel computing infrastructure, segmentation techniques based on deep convolutional neural networks (CNN) are emerging as the new state-of-the-art [15,9]. This paper is dedicated to the segmentation of cardiac structures on shortaxis MR images and is accompanied by a submission to the automated cardiac diagnosis challenge (ACDC) 2017. Short-axis MR images consist of a stack of 2D MR images acquired over multiple cardiac cycles which are often not perfectly aligned and typically have a low through-plane resolution of 5 − 10 mm. ? both authors contributed equally 2 In this paper, we investigate the suitability of state-of-the-art 2D and 3D CNNs for the segmentation of three cardiac structures. A specific focus is to answer the question if 3D context is beneficial for this task in light of the low through-plane resolution. Furthermore, we explore different network architectures and employ a variety of techniques which are known to enhance training and inference performance in deep neural network such as batch normalisation [6], and different loss functions [11]. The proposed framework was evaluated on the training set for the ACDC 2017 segmentation challenge. Accurate segmentation results were obtained with a fast inference time of 1.1 s per 3D image. 2 Method In the following, we will outline the individual steps focusing on the pre-processing, network architectures, optimisation and post-processing of the data. 2.1 Pre-Processing Since the data were recorded at varying resolutions, we resampled all images and segmentations to a common resolution. For the networks operating in 2D, the images were resampled to an in-plane resolution of 1.37 × 1.37 mm. We did not perform any resampling in the through-plane direction to avoid any losses in accuracy in the up- and downsampling steps. Part of the data had a relatively low through-plane resolution of 10 mm and we found that losses incurred by resampling artefacts can be significant. For the 3D network we chose a resolution of 2.5×2.5×5 mm. Higher resolutions were not possible due to GPU memory restrictions. We then placed all the resampled images centrally into images of constant size, padding with zeros where necessary. The exact image size depended on the network architecture and will be discussed below. Lastly, each image was intensity-normalised to zero mean and unit variance. 2.2 Network Architectures We investigated four different network architectures. The fully convolutional segmentation network (FCN) proposed by [10] is a 2D segmentation network widely used for natural images. In this architecture deep, and thus coarse, feature maps are upsampled to the original image resolution by using transposed convolutions. In order to fuse the semantic information available in the deeper layers with the spatial information available in the shallower stages, the authors proposed to use skip connections. In the present work, we used the best performing incarnation which is based on the VGG-16 architecture and uses three skip connections (FCN-8) [10]. We used an image size of 224 × 224 pixels for this architecture. Another popular segmentation architecture is the 2D U-Net initially proposed for the segmentation of neuronal structures in electron microscopy stacks and cell tracking in light microscopy images [15]. Inspired by [10] the authors employ an architecture with symmetric up- and downsampling paths and skip connections 3 within each resolution stage. Since this architecture does not employ padded convolutions, a larger image size of 396 × 396 pixels was necessary, which led to segmentation masks of size 212 × 212 pixels. Inspired by the fact that the FCN-8 produces competitive results despite having a simple upsampling path with few channels, we speculated that the full complexity of the U-Net upsampling path may not be necessary for our problem. Therefore, we additionally investigated a modified 2D U-Net with number of feature maps in the transpose convolutions of the upsampling path set to the number of classes. Intuitively, each class should have at least one channel. Çiçek et al. recently extended the U-Net architecture to 3D [4] by following the same symmetric design principle. However, for data with few slices in one orientation, the repeated pooling and convolving may be too aggressive. We found that using the 3D U-Net for our data all spatial information in the through-plane direction was lost before the third max pooling step. We thus also investigated a slightly modified version of the 3D U-Net in which we performed only one max-pooling (and upsampling) step in the through-plane direction. This had two advantages: 1) The spatial information in the through-plane was retained and thus available in the deeper layers, 2) it allowed us to work with a slightly higher image resolution because less padding in the through-plane direction (and thus less GPU memory) was required. In preliminary experiments we found that the modified 3D U-Net led to improvements of around 0.02 of the average Dice score over the standard 3D U-Net. In the interest of brevity we only included the modified version in the final results of this paper. Here, we used an input image size of 204 × 204 × 60, which led to output masks of size 116 × 116 × 28. We used batch normalisation [6] on the outputs of every convolutional and transposed convolutional layer for all architectures. We found that this not only led to faster convergence, as reported in [4], but also consistently yielded better results and allowed the training of some networks to converge that did not converge otherwise. 2.3 Optimisation We trained the networks introduced above (i.e. FCN-8, 2D U-Net, 2D U-Net (mod.) and 3D U-Net (mod.)) from scratch with the weights of the convolutional layers initialised as described in [5]. We investigated three different cost functions. First, we used the standard pixel-wise cross entropy. To account for the class imbalance between the background and the foreground classes, we also investigated a weighted cross entropy loss. We used a weight of 0.1 for the background class, and 0.3 for the foreground classes in all experiments in this paper, which corresponds approximately to the inverse prevalence of each label in the dataset. Lastly, we investigated optimising the Dice coefficient directly. In order to get more stable gradients we calculated the Dice loss on the softmax output as follows: PK PN tnk ynk , Ldice = 1 − PKk=2PNn=1 k=2 n=1 tnk + ynk 4 where K is the number of classes, N the number of pixels/voxels, y is the softmax output, t is a one-hot vector encoding the true label per location. To minimise the respective cost functions we used the ADAM optimiser [7] with a learning rate of 0.01, β1 = 0.9 and β2 = 0.999. The best results were obtained without using any weight regularisation. The training of each of the models took approximately 24 hours on a Nvidia Titan Xp GPU. 2.4 Post-Processing Since training and inference were performed in a different resolution, the predictions had to be resampled to each subject’s initial resolution. To avoid resampling artefacts, this step was carried out on the softmax (i.e. continuous) network outputs for each label using linear interpolation. The final discrete segmentation was then obtained in the final resolution by choosing the label with the highest score at each voxel. Interpolation on the softmax output, rather than the output masks, led to consistent improvements of around 0.005 in the average Dice score. We occasionally observed spurious predictions of structures in implausible locations. To compensate for this, we applied simple post-processing to the segmentation results by keeping only the largest connected component for every structure. Since the segmentations are already quite accurate without post-processing this only lead to an average Dice increase of approximately 0.0003, however, it reduced the Hausdorff distance considerably, which by definition is very sensitive to outliers. Other post-processing techniques such as the commonly used spatial regularisation method based on fully connected conditional random fields [8] did not yield improvements in our experiments. 3 Experiments and Results 3.1 Data The experiments in this paper were performed on cardiac cine-MRI training data of the ACDC challenge3 . The publicly available training dataset consists of 100 patient scans each including a short-axis cine-MRI acquired on 1.5T and 3T systems with resolutions ranging from 0.70 × 0.70 mm to 1.92 × 1.92 mm in-plane and 5 mm to 10 mm through-plane. Furthermore, segmentation masks for the myocardium (Myo), the left ventricle (LV) and the right ventricle (RV) are available for the end-diastolic (ED) and end-systolic (ES) phases of each patient. The dataset includes, in equal numbers, patients diagnosed with previous myocardial infarction, dilated cardiomyopathy, hypertrophic cardiomyopathy, abnormal right ventricles, as well as normal controls. We did not employ any external data for training or pre-training of the networks. The dataset was divided into a training and validation set comprising 80 and 20 subjects, respectively, with a stratified split w.r.t. patient diagnosis. All images were pre-processed as described in Sec. 2.1. 3 https://www.creatis.insa-lyon.fr/Challenge/acdc (last accessed 26 July 2017) 5 Table 1: Segmentation accuracy obtained by optimising the modified 2D U-Net using different cost functions. Dice (LV) ASSD (LV) Crossentropy 0.950 (0.029) 0.43 (0.41) W. Crossentropy 0.950 (0.036) 0.52 (0.75) Dice Loss 0.944 (0.051) 0.56 (0.77) 3.2 Dice (RV) ASSD (RV) 0.891 (0.084) 1.06 (1.04) 0.893 (0.083) 1.04 (1.06) 0.843 (0.137) 2.13 (2.03) Dice (Myo) ASSD (Myo) 0.888 (0.031) 0.52 (0.22) 0.899 (0.032) 0.51 (0.35) 0.891 (0.029) 0.55 (0.24) Evaluation Measures We evaluated the segmentation accuracy achieved with the different network architectures and optimisation techniques using three measures: the Dice coefficient, the Hausdorff distance and the average symmetric surface distance (ASSD). Furthermore, for the best performing experiment configuration, the correlations to commonly measured clinical variables were calculated. 3.3 Experiment 1: Comparison of Loss Functions In the first experiment we focused on the modified 2D U-Net architecture for which we obtained good initial results, and compared the performance using the different cost functions introduced in Sec. 2.3. In Table 2 we report the Dice score and ASSD averaged over both cardiac phases. It can be seen that using cross entropy led to better results than optimising the Dice directly. Weighted and unweighted cross entropy performed similarly, with the weighted loss function leading to marginally better results. We conclude that for the task at hand, the class imbalance does not seem to be an issue. Nevertheless, for the comparison of the network architectures in the next section we continued using the unweighted cross entropy as a loss function due to the slightly better results. 3.4 Experiment 2: Comparison of Network Architectures This experiment focuses on the comparison of the different 2D and 3D network architectures described in Sec. 2.2. The results are shown in Table 2. It can be seen that the 2D U-Net (both the original and modified version) outperformed FCN-8 and the (modified) 3D U-Net. While both versions of the 2D U-Net perform similarly, the modified version leads to slightly better results. Clinical measures for the best performing method (the modified 2D U-Net) are shown in Table 3. A detailed description of the measures is provided by ACDC3 . Figure 1 shows example segmentation results at three slice positions using the above method. Inference on a single volume took approximately 1.1 s for the 2D networks and 2.2 s for the 3D networks using a Nvidia Titan Xp GPU. 3.5 Discussion and Conclusion In this work we evaluated the suitability of state-of-the-art neural network architectures for the task of fully automatic cardiac segmentation. We also investigated modified versions of those networks which yielded marginal improvements 6 Table 2: Segmentation accuracy measures for different network architectures. Each table entry depicts the mean (std) value accuracy measure obtained for a specific structure and cardiac phase. Left Ventricle (ED) Dice FCN-8 0.960 (0.018) 2D U-Net 0.965 (0.014) 2D U-Net (mod.) 0.966 (0.017) 3D U-Net (mod.) 0.939 (0.022) Left Ventricle (ES) ASSD HD Dice ASSD HD 0.41 (0.49) 0.36 (0.38) 0.37 (0.48) 0.63 (0.50) 5.77 (3.05) 5.63 (2.79) 5.71 (4.22) 8.69 (4.25) 0.926 (0.061) 0.937 (0.051) 0.935 (0.042) 0.905 (0.039) 0.64 (0.80) 0.54 (0.64) 0.67 (0.92) 0.70 (0.38) 7.31 (3.39) 6.85 (3.52) 8.23 (8.29) 9.13 (4.10) Right Ventricle (ED) Dice ASSD FCN-8 0.932 (0.025) 2D U-Net 0.936 (0.028) 2D U-Net (mod.) 0.934 (0.039) 3D U-Net (mod.) 0.888 (0.069) 0.57 (0.45) 0.65 (0.48) 0.66 (0.74) 1.17 (1.21) HD Right Ventricle (ES) Dice 12.24 (5.51) 0.835 (0.100) 1.63 (1.07) 12.43 (6.13) 0.838 (0.085) 1.72 (1.22) 12.17 (6.02) 0.852 (0.095) 1.42 (1.19) 14.91 (5.02) 0.781 (0.101) 2.26 (1.40) Myocardium (ED) Dice FCN-8 0.869 (0.029) 2D U-Net 0.885 (0.027) 2D U-Net (mod.) 0.892 (0.027) 3D U-Net (mod.) 0.802 (0.053) ASSD 0.55 (0.23) 0.52 (0.29) 0.45 (0.22) 0.91 (0.34) ASSD HD 13.89 (4.24) 14.52 (5.28) 13.46 (6.24) 16.24 (5.39) Myocardium (ES) HD Dice ASSD 9.16 (6.74) 0.890 (0.027) 0.62 (0.24) 9.01 (7.66) 0.904 (0.029) 0.55 (0.28) 8.65 (6.02) 0.906 (0.034) 0.56 (0.44) 11.87 (6.25) 0.839 (0.066) 0.90 (0.42) HD 9.69 (5.28) 10.06 (5.79) 9.66 (6.21) 10.95 (3.47) in performance. In particular, we found that using fewer feature maps in the upsampling path of the 2D U-Net yielded minor but consistent improvements. We speculate that for this problem the full complexity of the upsampling path is not necessary. Furthermore, the “bottlenecks” may force the downsampling layers to learn more semantically meaningful features. Lastly, having fewer parameters may also make the problem easier to optimise. Further investigation into the significance of the upsampling path complexity will be necessary. Overall we found that the exact architecture played a minor role in the accuracy of the system. However, the use of batch normalisation as well as the choice of the cost function had a big impact on the performance. Moreover, we found that resampling of the predictions to the original image resolution was a significant source of errors. This could be reduced by resampling the softmax output with linear interpolation, rather than the predicted masks. One goal of this paper was to investigate if 3D context is helpful for the segmentation of short-axis MR images. Our experiments revealed that all 2D approaches consistently outperformed the (modified) 3D U-Net. There are at least three possible reasons for this: (1) when using 3D data, the amount of training images is drastically reduced which complicates training. (2) Since the through-plane resolution is low (and the cardiac structures typically appear in the top and bottom slices already), border effects from 3D convolutions may compromise the information available at intermediate representations. (3) GPU 7 Table 3: Clinical measurements: correlation, bias and limits of agreement (LoA) for the LV and RV ejection fraction (EF) and all structure volumes. Correlation EF Vol (ED) Vol (ES) 0.998 0.961 0.995 0.994 0.965 0.988 Vol (ED) Vol (ES) −0.45[−9.68; 8.78] 1.28[−7.27; 9.83] 2.55[−14.86; 19.96] 6.25[−13.08; 25.58] −0.45[−28.89; 27.99] −8.08[−33.87; 17.71] −5.24[−15.27; 4.79] −0.71[−17.89; 16.47] apical mid basal LV 0.972 RV 0.868 Myo - Bias [LoA] EF best median worst Fig. 1: Example segmentations at ED obtained using the 2D U-Net (mod.) for subjects with the highest, median, and lowest Dice coefficients on the Myocardium (left to right). Ground truth (left) and predicted segmentation (right) are shown for a basal, mid-ventricular and apical slice (top to bottom). memory restrictions required a substantial downsampling of the data for training and prediction, potentially leading to a loss of information. The segmentation scores reported in this work compare favourably to the related literature. However, it should be noted that a direct comparison is complicated by the fact that different datasets were used in the different works. For the LV cavity two recent deep learning methods [1,14] report Dice scores of around 0.94, while the modified 2D U-Net discussed here achieved a slightly higher value of 0.95. For automated segmentation of the RV cavity, [3,13] report similar results to ours. Segmentation of the myocardium is a more challenging task than the LV and RV cavities, which is reflected by lower Dice scores of around 0.81 reported in recent literature [2,14]. We achieved substantially higher results using all 2D architectures. In particular, the modified 2D U-Net architecture produced a Dice score of 0.899 for this structure. While these results are encouraging, further analysis on common datasets is necessary. Specifically, we observed that the field of view in many images of the ACDC challenge dataset 8 does not include the apex and basal region of the heart, which are particularly challenging to segment. The code and pretrained models for all examined network architectures are publicly available at https://github.com/baumgach/acdc_segmenter. References 1. Avendi, R.M.R., Kheradvar, A., Jafarkhani, H.: A combined deep-learning and deformable-model approach to fully automatic segmentation of the left ventricle in cardiac MRI. Med Image Anal 30, 108–119 (2016) 2. Bai, W., Shi, W., Ledig, C., Rueckert, D.: Multi-atlas segmentation with augmented features for cardiac MR images. Med Image Anal 19(1), 98–109 (2015) 3. Bai, W., Shi, W., O’Regan, D.P., Tong, T., Wang, H., Jamil-Copley, S., Peters, N.S., Rueckert, D.: A probabilistic patch-based label fusion model for multi-atlas segmentation with registration refinement: application to cardiac MR images. IEEE Transactions on Medical Imaging 32(7), 1302–15 (2013) 4. Çiçek, Ö., Abdulkadir, A., Lienkamp, S.S., Brox, T., Ronneberger, O.: 3D U-Net: Learning Dense Volumetric Segmentation from Sparse Annotation. In: MICCAI. pp. 424–432 (2016) 5. He, K., Zhang, X., Ren, S., Sun, J.: Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification. In: ICCV. pp. 1026–34 (2015) 6. Ioffe, S., Szegedy, C.: Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. In: ICML. pp. 448–456 (2015) 7. Kingma, D.P., Ba, J.L.: ADAM: A Method for Stochastic Optimization. In: ICLR (2015) 8. Krähenbühl, P., Koltun, V.: Efficient Inference in Fully Connected CRFs with Gaussian Edge Potentials. In: NIPS. pp. 109–117 (2011) 9. Litjens, G., Kooi, T., Bejnordi, B.E., Setio, A.A.A., Ciompi, F., Ghafoorian, M., van der Laak, J.A.W.M., van Ginneken, B., Sánchez, C.I.: A Survey on Deep Learning in Medical Image Analysis. arXiv:1702.05747 (2017) 10. Long, J., Shelhamer, E., Darrell, T.: Fully Convolutional Networks for Semantic Segmentation. In: CVPR. pp. 343 –3440 (2015) 11. Milletari, F., Navab, N., Ahmadi, S.A.: V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation. In: 3D Vision. pp. 565 – 571 (2016) 12. Nichols, M., Townsend, N., Scarborough, P., Rayner, M.: Cardiovascular disease in Europe 2014 : epidemiological update. European heart journal (2014) 13. Oktay, O., Bai, W., Guerrero, R., Rajchl, M., de Marvao, A., O’Regan, D.P., Cook, S.A., Heinrich, M.P., Glocker, B., Rueckert, D.: Stratified Decision Forests for Accurate Anatomical Landmark Localization in Cardiac Images. IEEE Trans Med Imag 36(1), 332–342 (2017) 14. Oktay, O., Ferrante, E., Kamnitsas, K., Heinrich, M., Bai, W., Caballero, J., Guerrero, R., Cook, S., de Marvao, A., Dawes, T., O’Regan, D., Kainz, B., Glocker, B., Rueckert, D.: Anatomically Constrained Neural Networks (ACNN): Application to Cardiac Image Enhancement and Segmentation. arXiv:1705.08302 (2017) 15. Ronneberger, O., Fischer, P., Brox, T.: U-Net: Convolutional Networks for Biomedical Image Segmentation. In: MICCAI. pp. 234–241 (2015)
1cs.CV
Published as a conference paper at ICLR 2017 L IE -ACCESS N EURAL T URING M ACHINES Greg Yang and Alexander M. Rush {gyang@college,srush@seas}.harvard.edu Harvard University Cambridge, MA 02138, USA arXiv:1611.02854v2 [cs.NE] 5 Mar 2017 A BSTRACT External neural memory structures have recently become a popular tool for algorithmic deep learning (Graves et al., 2014; Weston et al., 2014). These models generally utilize differentiable versions of traditional discrete memory-access structures (random access, stacks, tapes) to provide the storage necessary for computational tasks. In this work, we argue that these neural memory systems lack specific structure important for relative indexing, and propose an alternative model, Lieaccess memory, that is explicitly designed for the neural setting. In this paradigm, memory is accessed using a continuous head in a key-space manifold. The head is moved via Lie group actions, such as shifts or rotations, generated by a controller, and memory access is performed by linear smoothing in key space. We argue that Lie groups provide a natural generalization of discrete memory structures, such as Turing machines, as they provide inverse and identity operators while maintaining differentiability. To experiment with this approach, we implement a simplified Lie-access neural Turing machine (LANTM) with different Lie groups. We find that this approach is able to perform well on a range of algorithmic tasks. 1 I NTRODUCTION Recent work on neural Turing machines (NTMs) (Graves et al., 2014; 2016) and memory networks (MemNNs) (Weston et al., 2014) has repopularized the use of explicit external memory in neural networks and demonstrated that these networks can be effectively trained in an end-to-end fashion. These methods have been successfully applied to question answering (Weston et al., 2014; Sukhbaatar et al., 2015; Kumar et al., 2015), algorithm learning (Graves et al., 2014; Kalchbrenner et al., 2015; Kaiser & Sutskever, 2015; Kurach et al., 2015; Zaremba & Sutskever, 2015; Grefenstette et al., 2015; Joulin & Mikolov, 2015), machine translation (Kalchbrenner et al., 2015), and other tasks. This methodology has the potential to extend deep networks in a general-purpose way beyond the limitations of fixed-length encodings such as standard recurrent neural networks (RNNs). A shared theme in many of these works (and earlier exploration of neural memory) is to re-frame traditional memory access paradigms to be continuous and possibly differentiable to allow for backpropagation. In MemNNs, traditional random-access memory is replaced with a ranking approach that finds the most likely memory. In the work of Grefenstette et al. (2015), classical stack-, queue-, and deque-based memories are replaced by soft-differentiable stack, queue, and deque datastructures. In NTMs, sequential local-access memory is simulated by an explicit tape data structure. This work questions the assumption that neural memory should mimic the structure of traditional discrete memory. We argue that a neural memory should provide the following: (A) differentiability for end-to-end training and (B) robust relative indexing (perhaps in addition to random-access). Surprisingly many neural memory systems fail one of these conditions, either lacking Criterion B, discussed below, or employing extensions like REINFORCE to work around lack of differentiability (Zaremba & Sutskever, 2015). We propose instead a class of memory access techniques based around Lie groups, i.e. groups with differentiable operations, which provide a natural structure for neural memory access. By definition, their differentiability satisfies the concerns of Criterion A. Additionally the group axioms provide identity, invertibility, and associativity, all of which are desirable properties for a relative indexing scheme (Criterion B), and all of which are satisfied by standard Turing machines. Notably though, 1 Published as a conference paper at ICLR 2017 simple group properties like invertibility are not satisfied by neural Turing machines, differentiable neural computers, or even by simple soft-tape machines. In short, in our method, we construct memory systems with keys placed on a manifold, and where relative access operations are provided by Lie groups. To experiment with this approach, we implement a neural Turing machine with an LSTM controller and several versions of Lie-access memory, which we call Lie-access neural Turing machines (LANTM). The details of these models are exhibited in Section 4.1 Our main experimental results are presented in Section 5. The LANTM model is able to learn non-trivial algorithmic tasks such as copying and permutating sequences with higher accuracy than more traditional memory-based approaches, and significantly better than fixed memory LSTM models. The memory structures and key transformation learned by the model resemble interesting continuous space representations of traditional discrete memory data structures. 2 BACKGROUND : R ECURRENT N EURAL N ETWORKS WITH M EMORY This work focuses particularly on recurrent neural network (RNN) controllers of abstract neural memories. Formally, an RNN is a differentiable function RNN : X × H → H, where X is an arbitrary input space and H is the hidden state space. On input (x(1) , . . . , x(T ) ) ∈ X T and with initial state h(0) ∈ H, the RNN produces states h(1) , . . . , h(T ) based on the recurrence, h(t) := RNN(x(t) , h(t−1) ). These states can be used for downstream tasks, for example sequence prediction which produces outputs (y (1) , . . . , y (T ) ) based on an additional transformation and prediction layer y (t) = F (h(t) ) such as a linear-layer followed by a softmax. RNNs can be trained end-to-end by backpropagationthrough-time (BPTT) (Werbos, 1990). In practice, we use long short-term memory (LSTM) RNNs (Hochreiter & Schmidhuber, 1997). LSTM’s hidden state consists of two variables (c(t) , h(t) ), where h(t) is also the output to the external world; we however use the above notation for simplicity. An RNN can also serve as the controller for an external memory system (Graves et al., 2014; Grefenstette et al., 2015; Zaremba & Sutskever, 2015), which enables: (1) the entire system to carry state over time from both the RNN and the external memory, and (2) the RNN controller to collect readings from and compute additional instructions to the external memory. Formally, we extend the recurrence to, h(t) := RNN([x(t) ; ρ(t−1) ], h(t−1) ), Σ(t) , ρ(t) := RW(Σ(t−1) , h(t) ), where Σ is the abstract memory state, and ρ(t) is the value read from memory, and h is used as an abstract controller command to a read/write function RW. Writing occurs in the mutation of Σ at each time step. Throughout this work, Σ will take the form of an ordered set {(ki , vi , si )}i where ki ∈ K is an arbitrary key, vi ∈ Rm is a memory value, and si ∈ R+ is a memory strength. In order for the model to be trainable with backpropagation, the memory function RW must also be differentiable. Several forms of differentiable memory have been proposed in the literature. We begin by describing two simple forms: (neural) random-access memory and (neural) tape-based memory. For this section, we focus on the read step and assume Σ is fixed. Random-Access Memory Random-access memory consists of using a now standard attentionmechanism or MemNN to read a memory (our description follows Miller et al. (2016)). The controller hidden state is used to output a random-access pointer, q 0 (h) that determines a weighting of memory vectors via dot products with the corresponding keys. This weighting in turn determines the read values via linear smoothing based on a function w, X si exp hq, ki i wi (q, Σ) := P ρ := wi (q 0 (h), Σ)vi . s exp hq, k i j j j i The final read memory is based on how “close” the read pointer was to each of the keys, where closeness in key space is determined by w. 1 Our implementations are available at https://github.com/harvardnlp/lie-access-memory 2 Published as a conference paper at ICLR 2017 Tape-Based Memory Neural memories can also be extended to support relative access by maintaining read state. Following notation from Turing machines, we call this state the head, q. In the simplest case the recurrence now has the form, Σ0 , q 0 , ρ = RW(Σ, q, h), and this can be extended to support multiple heads. In the simplest case of soft tape-based memory (a naive version of the much more complicated neural Turing machine), the keys ki indicate one-hot positions along a tape with ki = δi . The head q is a probability distribution over tape positions. It determines the read value by directly specifying the weights. The controller can only “shift” the head by outputting a kernel K(h) = (K−1 , K0 , K+1 ) in the probability simplex ∆2 and applying convolution. q 0 (q, h) := q ∗ K(h), qj0 = qj−1 K+1 + qj K0 + qj+1 K−1 i.e. We can view this as the soft version of a single-step discrete Turing machine where the kernel can softly shift the “head” of the machine one to the left, one to the right, or remain in the same location. The value returned can then be computed with linear smoothing as above, X si hq, ki i wi (q, Σ) := P wi (q 0 (q, h), Σ)vi . ρ := j sj hq, kj i i 3 L IE G ROUPS FOR M EMORY Let us now take a brief digression and consider the standard (non-neural) Turing machine (TM) and the movement of its head over a tape. A TM has a head q ∈ Z indicating the position on a tape. Between reads, the head can move any number of steps left or right. Moving a + b steps and then c steps eventually puts the head at the same location as moving a steps and then b + c steps — i.e. the head movement is associative. In addition, the machine should be able to reverse a head shift, for example, in a stack simulation algorithm, going from push to pop — i.e. each head movement should also have a corresponding inverse. Finally, the head should also be allowed to stay put, for example, to read a single data item and use it for multiple time points, an identity. These movements correspond directly to group actions: the possible head movements should be associative, and contain inverse and identity elements. This group acts on the set of possible head locations. In a TM, the set of Z-valued head movement acts on the set of locations on the Z-indexed infinite tape. By our reasoning above, if a Turing machine is to store data contents at points in a general space K (instead of an infinite Z-indexed tape), then its head movements should form a group and act on K via group actions. For a neural memory system, we desire the network to be (almost everywhere) differentiable. The notion of “differentiable” groups is well-studied in mathematics, where they are known as Lie groups, and “differentiable group actions” are correspondingly called Lie group actions. In our case, using Lie group actions as generalized head movements on a general key space (more accurately, manifolds) would most importantly mean that we can take derivatives of these movements and perform the usual backpropagation algorithm. 4 L IE -ACCESS N EURAL T URING M ACHINES These properties motivate us to propose Lie access as an alternative formalism to popular neural memory systems, such as probabilistic tapes, which surprisingly do not satisfy invertibility and often do not provide an identity.2 Our Lie-access memory will consist of a set of points in a manifold K. 2 The Markov kernel convolutional soft head shift mechanism proposed in Graves et al. (2014) and sketched in Section 2 does not in general have inverses. Indeed, the authors reported problems with the soft head losing “sharpness” over time, which they dealt with by sharpening coefficients. In the followup work, Graves et al. (2016) utilize a temporal memory link matrix for actions. They note, “the operation Lw smoothly shifts the focus forwards to the locations written ... whereas L> w shifts the focus backwards” but do not enforce this as a true inverse. They also explicitly do not include an identity, noting “Self-links are excluded (the diagonal of the link matrix is always 0)”; however, they could ignore the link matrix with an interpolation gate, which in effect acts as the identity. 3 Published as a conference paper at ICLR 2017 We replace the discrete head with a continuous head q ∈ K. The head moves based on a set of Lie group actions a ∈ A generated by the controller. To read memories, we will rely on a distance measure in this space, d : K × K → R≥0 .3 Together these properties describe a general class of possible neural memory architectures. Formally a Lie-access neural Turing machine (LANTM) computes the following function, 0 , ρ := RW(Σ, q, q(w) , h) Σ0 , q 0 , q(w) where q, q(w) ∈ K are resp. read and write heads, and Σ is the memory itself. We implement Σ, as above, as a weighted dictionary Σ = {(ki , vi , si )}i . 4.1 A DDRESSING P ROCEDURE The LANTM maintains a read head q which at every step is first updated to q 0 and then used to read from the memory table. This update occurs by selecting a Lie group action from A which then acts smoothly on the key space K. We parametrize the action transformation, a : H 7→ A by the hidden state to produce the Lie action, a(h) ∈ A. In the simplest case, the head is then updated based on this action (here · denotes group action): q 0 := a(h) · q. For instance, consider two possible Lie groups: (1) A shift group R2 acting additively on R2 . This means that A = R2 so that a(h) = (α, β) acts upon a head q = (x, y) by, a(h) · q = (α, β) + (x, y) = (x + α, y + β). (2) A rotation group SO(3) acting on the sphere S 2 = {v ∈ R3 : kvk = 1}. Each rotation can be described by its axis ξ (a unit vector) and angle θ. An action (ξ, θ) · q is just the appropriate rotation of the point q, and is given by Rodrigues’ rotation formula, a(h) · q = (ξ, θ) · q = q cos θ + (ξ × q) sin θ + ξhξ, qi(1 − cos θ). Here × denotes cross product. 4.2 R EADING AND W RITING M EMORIES Recall that memories are stored in Σ, each with a key, ki , memory vector, vi , and strength, si , and that memories are read using linear smoothing over vectors based on a key weighting function w, P 0 ρ := w (q , Σ)vi . While there are many possible weighting schemes, we use one based on i i the distance of each memory address from the head in key-space assuming a metric d on K. We consider two different weighting functions (1) inverse-square and (2) softmax. There first uses the polynomial law and the second an annealed softmax of the squared distances: (1) wi (q, Σ) := P j si d(q, ki )−2 sj d(q, kj )−2 (2) wi (q, Σ, T ) := P j si exp(−d(q, ki )2 /T ) sj exp(−d(q, kj )2 /T ) , where we use the convention that it takes the limit value when q → ki and T is a temperature that represents the certainty of its reading, i.e. higher T creates more uniform w. The writing procedure is similar to reading. The LANTM maintains a separate write head q(w) that 0 moves analogously to the read head, i.e. with action function a(w) (h) and updated value q(w) . At 0 each call to RW, a new memory is automatically appended to Σ with k = q(w) . The corresponding 3 This metric should satisfy a compatibility relation with the Lie group action. When points x, y ∈ X are simultaneously moved by the same Lie group action v, their distance should stay the same (One possible mathematical formalization is that X should be a Riemannian manifold and the Lie group should be a subgroup of X’s isometry group.): d(vx, vy) = d(x, y). This condition ensures that if the machine writes a sequence of data along a “straight line” at points x, vx, v 2 x, . . . , v k x, then it can read the same sequence by emitting a read location y close to x and then follow the “v-trail” y, vy, v 2 y, . . . , v k y. 4 Published as a conference paper at ICLR 2017 read value ρ weight scheme mem. vec. vi key manifold K address ki read key q Figure 1: Retrieval of value from memory via a key. Weightings with unit sum are assigned to different memories depending on the distances from the addresses to the read key. Linear smoothing over values is used to emit the final read value. Both inverse-square and softmax schemes follow this method, but differ in their computations of the weightings. memory v and strength s are created by MLP’s v(h) ∈ Rm and s(h) ∈ [0, 1] taking h as input. After writing, the new memory set is, 0 Σ0 := Σ ∪ {(q(w) , v(h), s(h))}. No explicit erase mechanism is provided, but to erase a memory (k, v, s), the controller may in theory write (k, −v, s). 4.3 C OMBINING WITH R ANDOM ACCESS Finally we combine this relative addressing procedure with direct random-access to give the model the ability for absolute address access. We do this by outputting an absolute address each step and simply interpolating with our current head. Write t(h) ∈ [0, 1] for the interpolation gate and q̃(h) ∈ K for our proposed random-access layer. For key space manifolds K like Rn , 4 there’s a well defined straight-line interpolation between two points, so we can set q 0 := a · (tq + (1 − t)q̃) where we have omitted the implied dependence on h. For other manifolds like the spheres S n that have well-behaved projection functions π : Rn → S n , we can just project the straight-line interpolation to the sphere: q 0 := a · π(tq + (1 − t)q̃). In the case of a sphere S n , π is just L2 -normalization.5 5 E XPERIMENTS We experiment with Lie-access memory on a variety of algorithmic learning tasks. We are particularly interested in: (a) how Lie-access memory can be trained, (b) whether it can be effectively utilized for algorithmic learning, and (c) what internal structures the model learns compared to systems based directly on soft discrete memory. In particular Lie access is not equipped with an explicit stack or tape, so it would need to learn continuous patterns that capture these properties. Setup. Our experiments utilize an LSTM controller in a version of the encoder-decoder setup (Sutskever et al., 2014), i.e. an encoding input pass followed by a decoding output pass. The encoder reads and writes memories at each step; the decoder only reads memories. The encoder is given hsi, Or in general, manifolds with convex embeddings in Rn . Technically, in the sphere case, dom π = Rd − {0}. But in practice one almost never gets 0 from a straight-line interpolation, so computationally this makes little difference. 4 5 5 Published as a conference paper at ICLR 2017 followed by an the input sequence, and then h/si to terminate input. The decoder is not re-fed its output or the correct symbol, i.e. we do not use teacher forcing, so x(t) is a fixed placeholder input symbol. The decoder must correctly emit an end-of-output symbol h/ei to terminate. Models and Baselines. We implement three main baseline models including: (a) a standard LSTM encoder-decoder, without explicit external memory, (b) a random access memory network, RAM using the key-value formulation as described in the background, roughly analogous to an attentionbased encoder-decoder, and (c) an interpolation of a RAM/Tape-based memory network as described in the background, i.e. a highly simplified version of a true NTM (Graves et al., 2014) with a sharpening parameter. Our models include four versions of Lie-access memory. The main model, LANTM, has an LSTM controller, with a shift group A = R2 acting additively on key space K = R2 . We also consider a model SLANTM with spherical memory, utilizing a rotation group A = SO(3) acting on keys in the sphere K = S 2 . For both of the models, the distance function d is the Euclidean (L2 ) distance, and we experiment with smoothing using inverse-square (default) and with an annealed softmax.6 Model Setup. For all tasks, the LSTM baseline has 1 to 4 layers, each with 256 cells. Each of the other models has a single-layer, 50-cell LSTM controller, with memory width (i.e. the size of each memory vector) 20. Other parameters such as learning rate, decay, and intialization are found through grid search. Further hyperparameter details are give in the appendix. Tasks. Our experiments are on a series of algorithmic tasks shown in Table 1a. The C OPY, R E VERSE , and B IGRAM F LIP tasks are based on Grefenstette et al. (2015); the D OUBLE and I NTER LEAVED A DD tasks are designed in a similar vein. Additionally we also include three harder tasks: O DD F IRST, R EPEAT C OPY, and P RIORITY S ORT. In O DD F IRST, the model must output the oddindexed elements first, followed by the even-indexed elements. In R EPEAT C OPY, each model must repeat a sequence of length 20, N times. In P RIORITY S ORT, each item of the input sequence is given a priority, and the model must output them in priority order. We train each model in two regimes, one with a small number of samples (16K) and one with a large number of samples (320K). In the former case, the samples are iterated through 20 times, while in the latter, the samples are iterated through only once. Thus in both regimes, the total training times are the same. Training is done by minimizing negative log likelihood with RMSProp. Prediction is performed via argmax/greedy prediction at each step. To evaluate the performance of the models, we compute the fraction of tokens correctly predicted and the fraction of all answers completely correctly predicted, respectively called fine and coarse scores. We assess the models on 3.2K randomly generated out-of-sample 2x length examples, i.e. with sequence lengths 2k (or repeat number 2N in the case of R EPEAT C OPY) to test the generalization of the system. More precisely, for all tasks other than repeat copy, during training, the length k is varied in the interval [lk , uk ] (as shown in table 1ba). During test time, the length k is varied in the range [uk + 1, 2uk ]. For repeat copy, the repetition number N is varied similarly, instead of k. Results. Main results comparing the different memory systems and read computations on a series of tasks are shown in Table 1b. Consistent with previous work the fixed-memory LSTM system fails consistently when required to generalize to the 2x samples, unable to solve any 2x problem correctly, and only able to predict at most ∼ 50% of the symbols for all tasks except interleaved addition, regardless of training regime. The RAM (attention-based) and the RAM/tape hybrid are much stronger baselines, answering more than 50% of the characters correctly for all but the 6-O DD F IRST task. Perhaps surprisingly, RAM and RAM/tape learned the 7-R EPEAT C OPY task with almost perfect generalization scores when trained in the large sample regime. In general, it does not seem that the simple tape memory confers much advantage to the RAM model, as the generalization performances of both models are similar for the most part, which motivates more advanced NTM enhancements beyond sharpening. The last four columns illustrate the performance of the LANTM models. We found the inversesquare LANTM and SLANTM models to be the most effective, achieving > 90% generalization 6 Note that the read weight calculation of a SLANTM with softmax is essentially the same as the RAM model: For head q, exp(−d(q, ki )2 /T ) = exp(−kq − ki k2 /T ) = exp(−(2 − 2hq, ki i)/T ), where the last equality comes from kqk = kki k = 1 (key-space is on the sphere). Therefore the weights 2 i ) /T ) i i/T ) wi = Psisexp(−d(q,k = Psisexp(−2hq,k , which is the RAM weighting scheme. exp(−d(q,k )2 /T ) j exp(−2hq,kj i/T ) j j j j 6 Published as a conference paper at ICLR 2017 Task Input Output 1 - C OPY 2 - R EVERSE 3 - B IGRAM F LIP 4 - D OUBLE 5 - I NTERLEAVED A DD 6 - O DD F IRST 7 - R EPEAT C OPY 8 - P RIORITY S ORT a1 a2 a3 · · · ak a1 a2 a3 · · · ak a1 a2 a3 a4 · · · a2k−1 a2k a1 a2 · · · ak a1 a2 a3 a4 · · · a2k−1 a2k a1 a2 a3 a4 · · · a2k−1 a2k N a1 · · · a20 5a5 2a2 9a9 · · · a1 a2 a3 · · · ak ak ak−1 ak−2 · · · a1 a2 a1 a4 a3 · · · a2k a2k−1 2 × |ak · · · a1 | |a2k a2k−2 · · · a2 | + |a2k−1 · · · a1 | a1 a3 · · · a2k−1 a2 a4 · · · a2k a1 · · · a20 · · · a1 · · · a20 (N times) a1 a2 a3 · · · ak Size k |V| [2, 64] [2, 64] [1, 16] [2, 40] [2, 16] [1, 16] N ∈ [1, 5] [2, 10] 128 128 128 10 10 128 128 128 (a) Task descriptions and parameters. |ak · · · a1 | means the decimal number repesented by decimal digits ak · · · a1 . Arithmetic tasks have all numbers formatted with the least significant digits on the left and with zero padding. The D OUBLE task takes an integer x ∈ [0, 10k ) padded to k digits and outputs 2x in k + 1 digits, zero padded to k + 1 digits. The I NTERLEAVED A DD task takes two integers x, y ∈ [0, 10k ) padded to k digits and interleaved, forming a length 2k input sequence and outputs x + y zero padded to k + 1 digits. The last two tasks use numbers in unary format: N is the shorthand for a length N sequence of a special symbol @, encoding N in unary, e.g. 3 = @@@. Base LSTM S 1 2 3 4 5 6 7 8 16/0 26/0 30/0 44/0 60/0 29/0 24/0 46/0 L Memory RAM/Tape LANTM LANTM-s L S S RAM S S L L 21/0 61/0 61/1 70/2 70/1 ? ? ? 32/0 58/2 54/2 24/1 43/2 ? ? 97/44 39/0 56/5 54/9 64/8 69/9 ? ? ? 47/0 72/8 74/15 70/12 71/6 ? ? ? 61/0 74/13 76/17 77/23 67/19 99/93 99/93 90/38 42/0 31/5 46/4 43/8 62/8 99/91 99/95 90/29 37/0 98/56 99/98 71/18 99/93 67/0 70/0 17/0 53/0 60/5 80/22 78/15 66/9 87/35 98/72 99/95 Lie SLANTM SLANTM-s L S L S L ? 98/88 99/94 ? 94/57 50/0 48/0 99/99 ? 99/96 99/99 ? 99/91 49/7 99/91 ? ? ? 97/67 ? 99/97 56/8 99/78 99/99 ? ? 93/60 ? 98/78 74/15 96/41 98/79 ? ? 90/43 ? ? 76/16 99/51 ? (b) Main results. Numbers represent the accuracy percentages on the fine/coarse evaluations on the out-ofsample 2× tasks. The S and L columns resp. indicate small and large sample training regimes. Symbol ? indicates exact 100% accuracy (Fine scores above 99.5 are not rounded up). Baselines are described in the body. LANTM and SLANTM use inverse-square while LANTM-s and SLANTM-s use softmax weighting scheme. The best scores, if not 100% (denoted by stars), are bolded for each of the small and large sample regimes. accuracy on most tasks, and together they solve all of the tasks here with > 90% coarse score. In particular, LANTM is able to solve the 6-O DD F IRST problem when no other model can correctly solve 20% of the 2x instances; SLANTM on the other hand is the only Lie access model able to solve the 7-R EPEAT C OPY problem. The best Lie access model trained with the small sample regime beats or is competitive with any of the baseline trained under the large sample regime. In all tasks other than 7-R EPEAT C OPY, the gap in the coarse score between the best Lie access model in small sample regime and the best baseline in any sample regime is ≥ 70%. However, in most cases, training under the large sample regime does not improve much. For a few tasks, small sample regime actually produces a model with better generalization than large sample regime. We observed in these instances, the generalization error curve under a large sample regime reaches an optimum at around 2/3 to 3/4 of training time, and then increases almost monotonically from there. Thus, the model likely has found an algorithm that works only for the training sizes; in particular, this phenomenon does not seem to be due to lack of training time. 6 D ISCUSSION Qualitative Analysis. We did further visual analysis of the different Lie-access techniques to see how the models were learning the underlying tasks, and to verify that they were using the relative addressing scheme. Figure 2 shows two diagrams of the LANTM model of the tasks of priority sort and repeat copy. Figure 3 shows two diagrams of the SLANTM model for the same two tasks. Fig7 Published as a conference paper at ICLR 2017 @@79 @@@@98 @5 @@@107 119 dec. reads 119 5 79 107 98 $ (a) (b) Figure 2: Analysis of the LANTM model. (a) PCA projection from key space R2 to 1D for the memories Σ and read heads q of LANTM for the unary 8-P RIORITY S ORT task. In this task, the encoder reads a priority, encoded in unary, and then a value; the decoder must output these values in priority order. In this example the sequence is [@, @, 79, @, @, @, @, 98, @, 5, @, @, @, 107, @, 119], where the special symbol @ is a unary encoding of the priority. From top to bottom, each row indicates the movement of the encoder write head q(w) as it is fed each input character. Fill indicates the strength si of memory write (black indicates high strength). Position of a dot within its row indicates the PCA projection of the key ki . The last line indicates the movement of decoder read head q. Interestingly, we note that, instead of writing to memory, the controller remembers the item 119 itself. (b) Raw coordinates in key space R2 of writes (red) and reads (blue) from LANTM on 7-R EPEAT C OPY. Red line indicates the writes, which occur along a straight line during the encoding phase. Blue line indicates the reads, which zip back and forth in the process of copying the input sequence 6 times. 7 62 80 73 39 28 88 102 74 43 Enc. Writes Dec. Reads (a) (b) Figure 3: Analysis of the SLANTM model. (a) PCA projection from the spherical key space S 2 to 2D of the memories Σ and read heads q of SLANTM for the task of 7-R EPEAT C OPY. Here the model is to repeatedly output the sequence 10 times. Input is 10 repetitions of special symbol @ followed by [28, 74, 43, 102, 88, 39, ... ]. Left: the positions of write head q(w) during the encoding phase. Fill indicates strength si (black means high strength); number indicates the character stored. SLANTM traverses in a circle clockwise starting at point 28, and stores data at regular intervals. Right: the positions of read head q during the decoding phase. Starting from the blue dot, the reads move clockwise around the sphere, and end at the red dot. For the sake of clarity, read positions are indicated by bends in the blue line, instead of by dots. Intriguingly, the model implements a cyclic list data structure, taking advantage of the spherical structure of the memory. (b) Raw coordinates in key space S 2 of writes (red) and reads (blue) from SLANTM on a non-unary encoded variant of the priority sort task. Red line indicates the movements of the write-head q(w) to place points along a sub-manifold of K (an arc of S 2 ) during the encoding phase. Notably, this movement is not sequential, but random-access, so as to store elements in correct priority order. Blue line indicates the simple traversal of this arc during decoding. 8 Published as a conference paper at ICLR 2017 Figure 4: Memory access pattern of LANTM on 6-O DD F IRST. Left: In the middle of training. LANTM learns to store data in a zigzag such that odd-indexed items fall on one side and even-indexed items fall on the other. However reading is only half correct. Right: After training. During reading, the model simply reads the odd-indexed items in a straight line, followed by the even-indexed items in a parallel line. ure 4 shows the memory access pattern of LANTM on 6-O DD F IRST task. Additionally, animations tracing the evolution of the memory access pattern of models over training time can be found at http://nlp.seas.harvard.edu/lantm. They demonstrate that the models indeed learn relative addressing and internally are constructing geometric data structures to solve these algorithmic tasks. Unbounded storage One possible criticism of the LANTM framework could be that the amount of information stored increases linearly with time, which limits the usefulness of this framework for long timescale tasks. This is indeed the case with our implementations, but need not be the case in general. There can be many ways of limiting physical memory usage. For example, a simple way is to discard the least recently used memory, as in the work of Graves et al. (2016) and Gulcehre et al. (2016). Another way is to approximate with fixed number of bits the read function that takes a head position and returns the read value. For example, noting that this function is a rational function on the head position, keys, and memory vectors, we can approximate the numerators and denominators with a fixed degree polynomial. Content address Our Lie-access framework is not mutually exclusive from content addressing methods. For example, in each of our implementations, we could have the controllers output both a position in the key space and a content addresser of the same size as memory vectors, and interpolated the read values from Lie-access and the read values from content addressing. 7 C ONCLUSION This paper introduces Lie-access memory as an alternative neural memory access paradigm, and explored several different implementations of this approach. LANTMs follow similar axioms as discrete Turing machines while providing differentiability. Experiments show that simple models can learn algorithmic tasks. Internally these models naturally learn equivalence of standard data structures like stack and cyclic lists. In future work we hope to experiment with more groups and to scale these methods to more difficult reasoning tasks. For instance, we hope to build a general purpose encoder-decoder model for tasks like question answering and machine translation that makes use of differentiable relative-addressing schemes to replace RAM-style attention. 9 Published as a conference paper at ICLR 2017 R EFERENCES Alex Graves, Greg Wayne, and Ivo Danihelka. Neural Turing Machines. arXiv:1410.5401 [cs], October 2014. URL http://arxiv.org/abs/1410.5401. arXiv: 1410.5401. Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwińska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, et al. Hybrid computing using a neural network with dynamic external memory. Nature, 538 (7626):471–476, 2016. Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to Transduce with Unbounded Memory. arXiv:1506.02516 [cs], June 2015. URL http://arxiv. org/abs/1506.02516. arXiv: 1506.02516. Caglar Gulcehre, Sarath Chandar, Kyunghyun Cho, and Yoshua Bengio. Dynamic Neural Turing Machine with Soft and Hard Addressing Schemes. arXiv:1607.00036 [cs], June 2016. URL http://arxiv.org/abs/1607.00036. arXiv: 1607.00036. Sepp Hochreiter and Jrgen Schmidhuber. Long Short-Term Memory. Neural Comput., 9(8):1735– 1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL http://dx. doi.org/10.1162/neco.1997.9.8.1735. Armand Joulin and Tomas Mikolov. Inferring Algorithmic Patterns with Stack-Augmented Recurrent Nets. arXiv:1503.01007 [cs], March 2015. URL http://arxiv.org/abs/1503.01007. arXiv: 1503.01007. ukasz Kaiser and Ilya Sutskever. Neural GPUs Learn Algorithms. arXiv:1511.08228 [cs], November 2015. URL http://arxiv.org/abs/1511.08228. arXiv: 1511.08228. Nal Kalchbrenner, Ivo Danihelka, and Alex Graves. Grid Long Short-Term Memory. arXiv:1507.01526 [cs], July 2015. URL http://arxiv.org/abs/1507.01526. arXiv: 1507.01526. Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, and Richard Socher. Ask Me Anything: Dynamic Memory Networks for Natural Language Processing. arXiv:1506.07285 [cs], June 2015. URL http://arxiv.org/abs/1506.07285. arXiv: 1506.07285. Karol Kurach, Marcin Andrychowicz, and Ilya Sutskever. Neural Random-Access Machines. arXiv:1511.06392 [cs], November 2015. URL http://arxiv.org/abs/1511.06392. arXiv: 1511.06392. John Lee. Introduction to Smooth Manifolds. Number 218 in Graduate Texts in Mathematics. Springer, 2 edition, 2012. ISBN 978-1-4419-9981-8. A. Marthinsen. Interpolation in Lie Groups. SIAM Journal on Numerical Analysis, 37(1):269–285, January 1999. ISSN 0036-1429. doi: 10.1137/S0036142998338861. URL http://epubs. siam.org/doi/abs/10.1137/S0036142998338861. Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. CoRR, abs/1606.03126, 2016. URL http://arxiv.org/abs/1606.03126. Tatiana Shingel. Interpolation in special orthogonal groups. IMA Journal of Numerical Analysis, 29(3):731–745, July 2009. ISSN 0272-4979, 1464-3642. doi: 10.1093/imanum/drn033. URL http://imajna.oxfordjournals.org/content/29/3/731. Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-To-End Memory Networks. arXiv:1503.08895 [cs], March 2015. URL http://arxiv.org/abs/1503.08895. arXiv: 1503.08895. Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to Sequence Learning with Neural Networks. arXiv:1409.3215 [cs], September 2014. URL http://arxiv.org/abs/1409.3215. arXiv: 1409.3215. 10 Published as a conference paper at ICLR 2017 Paul J. Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560, 1990. URL http://ieeexplore.ieee.org/xpls/abs_all.jsp? arnumber=58337. Jason Weston, Sumit Chopra, and Antoine Bordes. Memory Networks. arXiv:1410.3916 [cs, stat], October 2014. URL http://arxiv.org/abs/1410.3916. arXiv: 1410.3916. Wojciech Zaremba and Ilya Sutskever. Reinforcement Learning Neural Turing Machines - Revised. arXiv:1505.00521 [cs], May 2015. URL http://arxiv.org/abs/1505.00521. arXiv: 1505.00521. 11 Published as a conference paper at ICLR 2017 Appendices A E XPERIMENTAL DETAILS We obtain our results by performing a grid search over the hyperparameters specified in Table A.1 and also over seeds 1 to 3, and take the best scores. We bound the norm of the LANTM head shifts by 1, whereas we try both bounding and not bounding the angle of rotation in our grid for SLANTM. We initialize the Lie access models to favor Lie access over random access through the interpolation mechanism discussed in section 4.3. The RAM model read mechanism is as discussed in section 2, and writing is done by appending new (k, v, s) tuples to the memory Σ. The only additions to this model in RAM/tape is that left and right keys are now computed using shifted convolution with the read weights: X kL := wi+1 ki i kR := X wi−1 ki i and these keys kL and kR are available (along with the random access key output by the controller) to the controller on the next turn to select from via interpolation. We also considered weight sharpening in the RAM/Tape model according to Graves et al. (2014): the controller can output a sharpening wγ coefficient γ ≥ 1 each turn, so that the final weights are w̃i = P iwγ . We included this as a feature j j to grid search over. LANTM(-s) SLANTM(-s) RAM(/tape) LSTM rnn size embed decay delay init learning rate key dim custom 50 × 1 50 × 1 50 × 1 256×{1 to 4} 14 14 14 128 {300, 600} {300, 600} {300, 600} {500, 700} {1, *} {1, *} {1, *} * {1, 2, 4}e-2 {1, 2, 4}e-2 {1, 2, 4}e-2 2e-{1 to 4} 2 3 {2, 20} - ∠ bound sharpen - Table A.1: Parameter grid for grid search. LANTM(-s) means LANTM with invnorm or SoftMax; similarly for SLANTM(-s). RAM(/tape) means the ram and hybrid ram/tape models. Initialization: both initialization options set the forget gate of the LSTMs to 1. The number 1 in the init column means initialization of all other parameters uniformly from [−1, 1]. The symbol * in init column means initialization of all linear layers were done using the torch default, which initializes weights uniformly from (−κ, κ), where κ is (input size)−1/2 . For models with memory, this means that the LSTM input to hidden layer is initialized approximately from [−0.07, 0.07] (other than forget gate). Angle bound is a setting only available in SLANTM. If angle bound is true, we bound the angle of rotation by a learnable magnitude value. Sharpening is a setting only available in RAM/tape, and it works as explained in the main text. We found that weight sharpening only confers small advantage over vanilla on the C OPY, B IGRAM F LIP, and D OUBLE tasks, but deteriorates performance on all other tasks. B ACTION I NTERPOLATION We also experimented with adding an interpolation between the last action a(t−1) with a candidate action a(h) via a gate r(h) ∈ [0, 1] to produce the final action a(t) . Then the final equation of the new head is q 0 := a(t) · π(tq + (1 − t)q̃). This allows the controller to easily move in “a straight line” by just saturating both t and r. For example, for the translation group we have straight-line interpolation, a(t) := ra+(1−r)a(t−1) . For the rotation group SO(3), each rotation is represented by its axis ξ ∈ S 2 and angle θ ∈ (−π, π], 12 Published as a conference paper at ICLR 2017 LANTM 1 2 3 4 5 6 7 8 LANTM-s S L S ?:?/?:? ?:?/?:? ?:?/?:? ?:?/?:? 99:?/93:? 99:50/91:0 67:52/0:0 87:97/35:76 ?:?/?:? ?:?/?:? ?:99/?:77 ?:?/?:? 99:?/93:? 99:54/95:0 70:22/0:0 98:93/72:38 ?:?/?:? 97:85/44:60 ?:99/?:93 ?:?/?:? 90:99/38:80 90:56/29:0 17:82/0:0 99:81/95:24 SLANTM L S SLANTM-s L S L ?:?/?:? ?:?/?:? ?:?/?:? ?:99/?:83 ?:99/?:99 98:91/88:55 99:99/96:98 ?:?/?:? ?:?/?:? ?:?/?:? 99:92/94:17 99:?/99:? 97:99/67:73 93:99/60:62 90:92/43:57 ?:?/?:? ?:?/?:? ?:?/?:? ?:?/?:? ?:?/?:? 94:99/57:84 99:96/91:61 99:99/97:99 98:99/78:99 ?:?/?:? 50:57/0:0 49:73/7:33 56:76/8:27 74:92/15:45 76:81/16:31 48:98/0:8 99:?/91:? 99:97/78:21 96:90/41:22 99:99/51:99 99:50/99:0 ?:99/?:99 99:99/99:95 98:95/79:60 ?:98/?:80 2 0.8 0.4 4 4 3 0.25 3 2 0.50 1 1 Table B.2: Comparison between scores of model with action interpolation and without action interpolation. Numbers represent the accuracy percentages on the fine/coarse evaluations on the outof-sample 2× tasks. The S and L columns resp. indicate small and large sample training regimes. Symbol ? indicates exact 100% accuracy (Fine scores above 99.5 are not rounded up). Each entry is of the format A:B/C:D, where A and C are respectively the fine and coarse scores of the model without action interpolation (same as in table 1b), and B and C are those for the model with action interpolation. 5 0.0 0.4 7 7 6 0.25 6 5 0.00 0.8 8 8 0.50 lantm lantm­s slantm slantm­s lantm lantm­s slantm slantm­s Figure B.1: The additive difference between the fine (left) and coarse (right) scores of models without action interpolation vs models with action interpolation. Positive value means model without interpolation performs better. For each model, the left column displays the difference in small sample regime, while the right column displays the difference in large sample regime. and we just interpolate each separately ξ (t) := π(rξ + (1 − r)ξ (t−1) ) and θ(t) := rθ + (1 − r)θ(t−1) . where π is L2 -normalization.7 We perform the same experiments, with the same grid as specified in the last section, and with the initial action interpolation gates biased toward the previous action. The results are given in table B.2. Figure B.1 shows action interpolation’s impact on performance. Most notably, interpolation seems to improve performance of most models in the 5-I NTERLEAVED A DD task and of the spherical memory models in the 6-O DD F IRST task, but causes failure to learn in many situations, most significantly, the failure of LANTM to learn 6-O DD F IRST. 7 There is, in fact, a canonical way to interpolate the most common Lie groups, including all of the groups mentioned above, based on the exponential map and the Baker-Campbell-Hausdorff formula (Lee, 2012), but the details are outside the scope of this paper and the computational cost, while acceptable in control theory settings, is too hefty for us. Interested readers are referred to Shingel (2009) and Marthinsen (1999). 13
9cs.NE
arXiv:1307.1738v1 [cs.LO] 5 Jul 2013 Towards Extracting Explicit Proofs from Totality Checking in Twelf ∗ Yuting Wang Gopalan Nadathur University of Minnesota, USA [email protected] University of Minnesota, USA [email protected] Abstract The Edinburgh Logical Framework (LF) is a dependently type λ-calculus that can be used to encode formal systems. The versatility of LF allows specifications to be constructed also about the encoded systems. The Twelf system exploits the correspondence between formulas and types to give specifications in LF a logic programming interpretation. By interpreting particular arguments as input and others as output, specifications can be seen as describing nondeterministic functions. If particular such functions can be shown to be total, they represent constructive proofs of metatheorems of the encoded systems. Twelf provides a suite of tools for establishing totality. However, all the resulting proofs of meta-theorems are implicit: Twelf’s totality checking does not yield a certificate that can be given to a proof checker. We begin the process here of making these proofs explicit. We treat the restricted situation in Twelf where context definitions (regular worlds) and lemmas are not used. In this setting we describe and prove correct a translation of the steps in totality checking into an actual proof in the companion logic M2 . We intend in the long term to extend our translation to all of Twelf and to use this work as the basis for producing proofs in the related Abella system. 1. Introduction The Edinburgh Logical Framework (LF) is a general framework for formalizing systems that are presented in a rulebased and syntax-directed fashion [2]. LF is based on a dependently-typed λ-calculus and, as such, supports the higher-order abstract syntax approach to representing binding structure. Because of its features, LF has proven to be extremely versatile in encoding formal systems such as programming languages and logics. One of the purposes for specifying a formal system is to be able to prove properties about it; such properties are usually called meta-theorems. There are two approaches to doing this relative to LF specifications. One of these approaches is implemented by the Twelf system that is ∗ Draft of January 9, 2018 Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. Copyright c ACM [to be supplied]. . . $15.00 based on according a logic programming interpretation to LF specifications [4, 8]. In essence, Twelf interprets types as relations and thereby transforms the question of validity of a relation into one about the inhabitation of a type. Twelf also allows such relations to be moded, i.e., it lets some arguments to be designated as inputs and others to be identified as outputs. Relations thus define non-deterministic functions from inputs to outputs. Twelf complements such a treatment with tools for determining if particular relational specifications represent total functions from ground inputs to ground outputs. When the relations are about types that specify particular aspects of formal systems, something that is possible to do in the rich types language of LF, such verifications of totality correspond to implicit, constructive proofs of meta-theorems. The second approach is to proving meta-theorems is to do this explicitly within a suitable logic. The M2 logic has been described for the specific purpose of constructing such proofs over LF specifications [9, 10]. Meta-theorems are represented by M2 formulas and proved by applying the derivation rules in M2 . A successful proof returns a certificate in the form of a proof term that can be checked independently by another (simpler) program. Of the two approaches, totality checking has proven to be vastly more popular: a large number of verifications based on it have been described in the literature. By contrast, although an automatic theorem prover based on M2 has been developed [9], it has, to our knowledge, not been used in many reasoning tasks. However, there is a potential drawback to using totality checking in verification: this process does not yield an outcome that can be provided to a third party that can, for instance, easily check its correctness. This paper begins an effort to address the abovementioned shortcoming by developing a method for extracting an explicit proof from totality checking. In this first step, we limit ourselves to a subset of the kinds of verification treated by Twelf. In particular, we do not consider meta-theorems that require the use of contexts (defined via regular worlds in Twelf) and also disallow the use of lemmas in specifications. In this setting, we describe and prove correct a procedure for obtaining a proof in M2 from the work done by Twelf towards establishing totality. The rest of the paper is organized as follows. Section 2 recalls LF and its interpretation in Twelf and introduces some associated terminology needed in the paper. Section 3 describes totality checking. The components that make it up have been presented in different settings (e.g., see [6, 8, 11]) and some aspects (such as output coverage checking) have not been described in the formality needed for what we do in this paper. Thus, this section represents our attempt to describe these aspects with in a coordinated and precise fashion. Section 4 presents the M2 logic. Section 5 finally tackles the generation of M2 proofs from totality checking. Section 6 concludes the paper with a brief discussion of future directions to this work. 2. The Edinburgh Logical Framework We provide a brief summary of the Edinburgh Logical Framework (LF) in this section and explain its use in encoding the syntax and derivation rules of formal systems. We then introduce the Twelf system that provides LF specifications a logic programming interpretation, which becomes a basis for proving meta-theoretic properties of systems encoded in LF. We conclude the section with the definitions of a few technical notions like substitution and unification related to LF that will be needed in later parts of this paper. 2.1 Syntax and Typing Judgments The syntax of LF is that of a λ-calculus that has three categories of expressions: kinds, type families and objects. Kinds classify type families and type families classify objects. The special kind for types is type. We use the symbol a for type level constants, c for object level constants and x for object-level variables. The different categories of expressions are given by the rules below; we use K, possibly with subscripts, as a schematic variable for kinds, A and B for type families, M and N for objects, and U and V for either type families or objects. Kinds Type Families Objects K ::= type | Πx : A.K A, B ::= a | Πx : A.B | A M M, N ::= c | x | λx : A.M | M N Here, λ and Π are binding operators. LF is dependently typed in the sense that kinds and type families might depend on object terms: we have kinds of the form Πx : A.K and type families of the form Πx : A.B, where Π binds occurrences of the (object) variable x of type A in the kind K and type family B, respectively. We write Πx1 : A1 , . . . , xn : An .B as an abbreviation for Πx1 : A1 . . . . Πxn : An .B and similarly for Πx1 : A1 . . . . Πxn : An .K. The expression Πx : A.B will also be written as A → B if the variable x does not occur in B. We take → to be a right associative operator. LF terms are constructed relative to signatures, denoted schematically by Σ, that keep track of types and kinds assigned to constants, and contexts, denoted schematically by Γ, that keep track of types assigned to variables. Signatures and contexts are given by the following rules: Signatures Contexts Σ ::= · | Σ, a : K | Σ, c : A Γ ::= · | Γ, x : A Here, · denotes the empty sequence. Since Πx1 : A1 , . . . , xn : An .B has list of binders that look like an LF context, we will sometimes write it as ΠΓ.B where Γ = x1 : A1 , . . . , xn : An . LF is equipped with rules for deriving the following judgments: Γ `Σ M ≡ N and Γ `Σ A ≡ B for equality between objects and types; ` Σ, `Σ Γ and Γ `Σ K representing the validity of signatures, contexts and kinds; and Γ `Σ A : K and Γ `Σ M : A asserting the well-typedness of type families and objects. Fig.1 shows the rules for the last two judgments; the full collection can be found in [3]. We will sometimes leave the signature implicit in these judgments, writing them simply as Γ ` A : K and Γ ` M : A. The notation U [V /x] used in the rules stands for the capture avoiding substitution of V for the variable x in U . The equality relation ≡ between type families and objects corresponds to βη-conversion. The LF type theory guarantees that every well-typed LF term has an unique βη-long normal form called its canonical form. Thus, two well-typed LF terms are equal iff their canonical forms are identical up to a renaming of bound variables. We will often confuse a well-typed LF term with its canonical form. 2.2 LF as a Specification Language LF can be used to encode varied formal systems via the types as judgments, objects as proofs and inhabitation as provability principles. We illustrate this aspect by considering the encoding of the untyped λ-calculus; this example will be used also in later parts of the paper. The object system syntax is given by the following rule: M ::= λx.M | M1 M2 We shall represent these terms using the LF type tm and object-level constants app : tm → tm → tm and abs : (tm → tm) → tm. The precise encoding d·e is given as follows: dxe = x dM N e = app dM e dN e dλx.M e = abs (λx : tm.dM e) Note that we are representing binding in the λ-calculus here by binding in LF. For example, λx.x is encoded as an LF term abs (λx : tm.x). Object system judgments are typically represented in LF via types. Thus, consider the call-by-name evaluation relation between the λ-terms that is defined by the following rules: M  λx.M 0 λx.M  λx.M evAbs M 0 [N/x]  V MN V evApp This relation can be represented by the LF type family eval : tm → tm → type: the judgment M  N would then be encoded as the LF type eval dM e dN e. The derivability of a judgment M  N then boils down to the inhabitation of eval dM e dN e in LF. To determine such inhabitation, we introduce the following object-level constants into the LF signature: eval-app : ΠM : tm.ΠM 0 : tm → tm.ΠN : tm.ΠV : tm. eval M (abs M 0 ) → eval (M 0 N ) V → eval (app M N ) V . eval-abs : ΠM : tm → tm.eval (abs M ) (abs M ). Given these constants, the object system derivation λx.x  λx.x evAbs x[λy.y/x]  λy.y (λx.x) (λy.y)  λy.y evAbs evApp would be represented by the LF object eval-app (abs (λx : tm.x)) (λx : tm.x) (abs (λy : tm.y)) (abs (λy : tm.y))(eval-abs (λx : tm.x)) (eval-abs (λy : tm.y)). This expression has the type eval (app (abs (λx : tm.x)) (abs (λy : tm.y))) (abs (λy : tm.y)) which is the LF encoding of (λx.x) (λy.y)  λy.y. Suppose that our object system also encompasses typing judgments of the form ∆ . M : T where ∆ = x1 : T1 , . . . , xn : Tn : such a judgment asserts that M has type T under the assumption that, for 1 ≤ i ≤ n, xi has type Ti . Moreover, let these judgments be defined by the rules ∆, x : T1 . M : T2 ∆ . (λx.M ) : T1 → T2 ofAbs ∆ . M : T1 → T2 ∆ . N : T1 ofApp ∆ . M N : T2 with the ofAbs rule having the side condition that x does not occur in ∆. We use the LF type ty and the LF (object-level) constant arr : ty → ty → ty to represent the types of the Valid Families: a : K ∈ Σ `Σ Γ Γ `Σ a : K Γ, x : A `Σ B : K Γ `Σ λx : A.B : Πx : A.K Γ, x : A `Σ B : type Γ `Σ Πx : A.B : type Γ `Σ A : Πx : B.K Γ `Σ M : B Γ `Σ A M : K[M/x] Γ `Σ A : K Γ `Σ K 0 Γ `Σ K ≡ K 0 Γ `Σ A : K 0 Valid Objects: c : K ∈ Σ `Σ Γ Γ `Σ c : A Γ, x : A `Σ M : B Γ `Σ λx : A.M : Πx : A.B x : A ∈ Γ `Σ Γ Γ `Σ x : A Γ `Σ M : Πx : A.B Γ `Σ N : A Γ `Σ M N : B[N/x] Γ `Σ M : A Γ `Σ A0 : type Γ `Σ M : A Γ `Σ A ≡ A0 0 Figure 1. Rules for Valid Type Families and Objects object system: the d·e mapping is extended to λ-calculus types in such a way that dT1 → T2 e = arr dT1 e dT2 e. The typing rules for the λ-calculus can then be encoded in LF using the signature: of : tm → ty → type. of-app : ΠM : tm.ΠN : tm.ΠT1 : ty.ΠT : ty. of M (arr T1 T ) → of N T1 → of (app M N ) T . of-abs : ΠM : tm.ΠT1 : ty.ΠT : ty. (Πx : tm.of x T1 → of (M x) T ) → of (abs M ) (arr T1 T ) We assume here that ∆.M : T is encoded as d∆e ` dM e : dT e, where d∆e is an LF context resulting from transforming every xi : Ti in ∆ into xi : tm, yi : of xi dTi e. LF expressions contain a lot of verbose type information. This situation can be eased by making some of the outermost binders in the types assigned to object level constant implicit by using tokens beginning with uppercase letters for the variables they bind. Thus, the constants for encoding the evaluation and typing rules for the λ-calculus can be shown by means of the following signature: eval-app : eval M (abs M 0 ) → eval (M 0 N ) V → eval (app M N ) V. eval-abs : eval (abs M ) (abs M ). of-app : of M (arr T1 T ) → of N T1 → of (app M N ) T. of-abs : (Πx : tm.of x T1 → of (M x) T ) → of (abs M ) (arr T1 T ). When we make the binding implicit in this way, it will always be the case that the types for the bound variables can be uniquely inferred by a type reconstruction process [7]. When showing terms, we will also leave out the arguments for constants that correspond the implicitly bound variables, assuming that these too can be inferred. Using this convention, the LF object for the evaluation derivation considered earlier can be written as follows: eval-app (eval-abs : eval (abs (λx : tm.x)) (abs (λx : tm.x))) (eval-abs : eval (abs (λy : tm.y)) (abs (λy : tm.y))) The missing arguments of eval-app and the two occurrences of eval-abs will be filled in here by type reconstruction. 2.3 Twelf and Logic Programming in LF Twelf is a tool based on LF that uses the representation principles just discussed for specifying and reasoning about formal systems. Twelf permits A ← B as an alternative syntax for B → A, treating ← as a left associative operator. An important idea underlying Twelf is that LF types can be given a logic programming interpretation so that they can be executed. The full description of the operational semantics of Twelf can be found in [4]. We consider here only the interpretation for constant definitions of the form c : a M 1 . . . M n ← a M 11 . . . M 1n ← . . . ← a M m 1 . . . M m n where a : Πx1 : A1 , . . . , xn : An .type is an LF type family. In the logic programming setting, this definition of c is called a clause that has a M1 . . . Mn as its head and a Mi1 . . . Min (1 ≤ i ≤ m) as its premises. We think of such a clause in the same way we would a Prolog clause. Thus, we call the type family a a predicate and we think of the clause as one for a. Given a set of clauses for a, we query Twelf for the solutions of goals of the form M : a M10 . . . Mn0 . Twelf interprets this as a question that asks if a well-formed term of type a M10 . . . Mn0 exists, treating M and the free variables in M1 , . . . , Mn as logic variables. Twelf performs goal-directed proof search using backchaining similar to Prolog, using unification to instantiate logic variables as needed to solve the inhabitation question [4]. We assume that the search will be based on trying the premises in left to right order. 2.4 Substitution and Unification in LF A substitution σ in LF is a type-preserving mapping from variables to objects that differs from the identity at only finitely many places. We write σ as (M1 /x1 , . . . , Mn /xn ) where Mi /xi (1 ≤ i ≤ n) are the only non-identity mappings. For any LF term t, t[σ] is the term obtained by applying σ in a capture avoiding way to the free variables in t. Substitutions transform terms that are well-typed in one context into ones that are well-typed in another context, something that is asserted by the judgment Γ `Σ σ : Γ0 that is defined by the following rules: Γ `Σ · : · subst-ept Γ `Σ M : A[σ] Γ `Σ σ : Γ0 Γ `Σ (σ, M/x) : (Γ0 , x : A) subst-typ Given a σ and a Γ0 , there is a unique Γ with the smallest domain such that Γ `Σ σ : Γ0 is derivable. We shall intend to pick out this Γ when we use this judgment in later sections. We will also want to use the judgment Γ `Σ σ : Γ0 when the domain of σ is a subset of that of Γ0 . We will assume in this case that the domain of σ is extended with identity substitutions to match that of Γ0 . If Γ is the context x1 : A1 , . . . , xn : An , we write Γ[σ] to represent the context x1 : A1 [σ], . . . , xn : An [σ]. The composition of substitutions σ ◦ θ is defined as follows: ·◦θ =· (σ, M/x) ◦ θ = (σ ◦ θ, M [θ]/x) The following lemmas are easily proved by induction on typing derivations related to substitutions: Lemma 1. If Γ2 `Σ σ1 : Γ1 and Γ3 `Σ σ2 : Γ2 are derivable then so is Γ3 `Σ σ1 ◦ σ2 : Γ1 [σ2 ]. 0 sr-app : subred (eval-app Dev1 Dev2 ) (of-app Dty1 Dty2 ) Dty ← subred (Dev1 : eval M (abs M 0 )) 0 Lemma 2. If Γ `Σ σ : Γ and Γ `Σ U : V are derivable then so is Γ `Σ U [σ] : V [σ]. A unification problem S is a finite multiset of equations {ti = si | 1 ≤ i ≤ n} where, for 1 ≤ i ≤ n, ti and si are LF terms of the same kind or type. A substitution σ such that ti [σ] = si [σ] for all i such that 1 ≤ i ≤ n is a unifier for S. It is a most general unifer (mgu) if for any unifer θ of S there exists a substitution γ such that for any term t we have t[θ] = t[σ][γ]. Not every unification problem in LF has an mgu and unifiability is also not decidable in general. However, these properties hold when all occurrences of free variables in the terms determining the unification problem are strict as per the following definition [5]. Definition 3. An occurrence of a free variable is strict if it is not in the argument of a free variable and all its arguments are distinct bound variables. We will also be interested often in matching, i.e., unification where free variables occur in the terms on only one side of the equations. In this case decidability and the existence of most general solutions follows if every free variable has at least one strict occurrence in the terms. We refer to a term that satisfies this property as a strict term. Given a context Γ = x1 : A1 , . . . , xn : An we will often write M Γ to mean M x1 . . . xn . Similarly, given a substitution σ = (M1 /x1 , . . . , Mn /xn ) we will write M σ to mean M M1 . . . Mn . 3. Totality Checking in Twelf Under the logic programming interpretation of LF specifications in Twelf, a type family a : ΠΓ.type represents a relation between its arguments. This relation can be read as a meta-theorem about the system specified by interpreting particular arguments as inputs and others as outputs. For instance, the subject reduction theorem for the λ-calculus (STLC) states that the evaluation preserves types: for all terms E and V and types T , if E  V and · . E : T hold, then · . V : T holds. Based on our encoding of evaluation and typing for the λ-calculus, we can define the following type family: subred : eval E V → of E T → of V T → type. By assigning E, V , T and the first two arguments to subred as inputs and the third argument to subred as output, the proof search for subred D1 D2 D3 becomes directional: it queries the existence of a derivation D3 for of V T given derivations D1 for eval E V and D2 for of E T . Thus, we can interpret subred operationally as a non-deterministic function that computes a ground output D3 from ground inputs E, V, T, D1 , D2 . If we can show that this function is total, i.e., that, given any ground terms for the inputs, proof search will be able to find a satisfying ground term for the output in a finite number of steps, then we would have obtained a constructive proof for the subject reduction theorem. Twelf uses the above approach to interpret meta-theorems as totality assertions and their proofs as totality checking. In Twelf notation, the subject reduction theorem is expressed as follows: subred : eval E V → of E T → of V T → type. %mode subred +D1 +D2 -D3 . (Dty1 : of M (arr T1 T2 )) (of-abs (Dty3 : Πx : tm.of x T1 → of (M 0 x) T2 )) ← subred (Dev2 : eval (M 0 N ) V ) (Dty3 N (Dty2 : of N T1 )) (Dty : of V T ). sr-abs : subred eval-abs Dty Dty. Figure 2. LF signature for subred %total D (subred D ). The mode declaration that begins with %mode designates the explicit arguments prefixed by + as inputs and those prefixed by - as outputs; such a designation must be extended to also include the implicit arguments. The declaration that begins with %total asserts that subred represents a total non-deterministic function in the indicated mode. This declaration also identifies an argument on which to base a termination argument as we shall see presently. To facilitate totality checking, the user must provide clauses for deriving typing judgments of the kind in question. For subred, these clauses might be the ones shown in Fig 2. Observe that these clauses essentially describe a recursive method for constructing a derivation of the output type given ones for the input types; the object constants sr-app and sr-abs are used to encode these constructions. Totality checking in Twelf is broken into mode checking, termination checking, input coverage checking and output coverage checking; it can be shown that the successful completion of each of these checks ensures totality of the non-deterministic function. Our interest is in extracting a proof from Twelf’s verification process. For this, we only need to know the structure of each of the checks and we elide a discussion of how they guarantee totality. 3.1 Mode Checking Given a type family a : Πx1 : A1 , . . . , xn : An .type, we shall refer to the variables x1 , . . . , xn as its parameters. A mode declaration assigns polarities p1 , . . . , pn to these parameters, where pi is either a positive polarity + that designates xi to be an input parameter or a negative polarity - that designates xi to be an output parameter. A mode declaration for a is well-defined if for any i, 1 ≤ i ≤ n, such that pi = +, the parameters occurring in Ai have polarity +. Thus, the input parameters in a type family with a well-defined mode never depend on its output parameters; this property is necessary for assigning a meta-theorem reading to the moded type family. The binder of a type family with a well-defined mode can always be rearranged so that it has the form a : ΠΓI .ΠΓO .type, where ΓI and ΓO contain parameters that are assigned only positive and negative polarities, respectively. In the following discussion, we will consider only type families with well-defined modes whose binders also have this special form. A type family a with a well-defined mode represents the meta-theorem that given any ground terms r̄ for the parameters in ΓI , there exists a derivation D : a r̄ s̄ that computes ground terms s̄ for the parameters in ΓO . We write this meta-theorem formally as ∀ΓI .∃ΓO .∃D : a ΓI ΓO .>. The requirement that input parameters must not depend on output parameters provides us a means for extending polarity assignments for explicit parameters to cover also the implicit parameters. For example, consider the mode declaration %mode subred +D1 +D2 -D3 that designates the first two explicit parameters for subred as input the last as output. The elaborated kind of subred is: is determined by the mode checking algorithm described in the Twelf manual [6]. ΠE : tm.ΠV : tm.ΠT : ty.eval E V → of E T → of V T → type Termination checking verifies that, given a well-moded LF signature and a goal whose input arguments are ground, backchaining on any clause will result in a finite computation. Termination is checked using a termination ordering. The fundamental termination ordering used in Twelf is the subterm ordering: M  N if M is a strict subterm of N . For example, the totality declaration %total D (subred D ) tells Twelf to verify termination of subred using the subterm ordering on its first argument that has type eval E V . Other orderings such as lexicographical ordering and simultaneous ordering are also supported [6]. Termination checking assumes that the input arguments involved in termination ordering are ground, a condition that must hold if the signature is well-moded and mode consistent and the input arguments of the original goal are all ground. For every clause, it checks that the input arguments of premises involved in termination ordering are smaller than corresponding inputs in the clause head. For instance, the two premises in sr-app have Dev1 and Dev2 , respectively, as their first (explicit) argument. These are strict subterms of the input eval-app De1 De2 in the head of sr-app. The following theorem is proved in [8]. Since the implicit parameters E, V , and T occur in the types of the first two explicit parameters, well-definedness of mode dictates that they have the polarity +. Correspondingly, the meta-theorem represented by subred is ∀E : tm, V : tm, T : ty, D1 : eval E V, D2 : of E T. ∃D3 : of V T.∃D : subred E V T D1 D2 D3 .>. Given a type family a with a well-defined mode, mode checking verifies that the clauses for a that represent a proof for the relevant meta-theorem respect the moding, i.e., that, given ground terms for the input parameters, if backchaining on the clause succeeds, then it will result in ground terms being produced for the output parameters. To formalize mode checking, we need the definitions of groundedness with respect to a context and of input and output consistency [8]. Definition 4. An LF term M is ground with respect to an LF context Γ if all variables in the canonical form of M are bound in Γ. Observe that ground terms are a special instance of this definition, i.e., they are terms that are ground with respect to the empty context. Definition 5. Let a : Πx1 : A1 , . . . , xn : An .type be a type family and let p1 , . . . , pn be a well-defined mode for a. We say that a M1 . . . Mn is input consistent relative to Γ if for all i such that 1 ≤ i ≤ n and pi = + it is the case that Mi is ground with respect to Γ. Similarly, a M1 . . . Mn is output consistent relative to Γ if for all i such that 1 ≤ i ≤ n and pi = - it is the case that Mi is ground with respect to Γ. A term that a is applied to is called an input argument or an output argument, depending on whether it corresponds to an input parameter or an output parameter. Variables occurring in input arguments (output arguments) are called input variables (resp. output variables). Definition 6. Let a : ΠΓI .ΠΓO .type be a type family with a well-defined mode, where ΓI is x1 : A01 , . . . , xk : A0k and ΓO is xk+1 : A0k+1 , .., xn : A0n . Let c : A ← A1 ← · · · ← Am be a clause for a where A = a M1 . . . Mn and Ai = a Mi1 . . . Min for 1 ≤ i ≤ m. Let Γ0 be the context containing only the input variables that have a strict occurrence in A and for 1 ≤ i ≤ m let Γi be the context Γi−1 , Γi0 , where Γi0 contains only the output variables that have a strict occurrence in Ai . The clause c is mode consistent if, for 1 ≤ i ≤ m, Ai is input consistent relative to Γi−1 and A is output consistent relative to Γm . A type family a is well-moded if it has a well-defined mode and every clause for a is mode consistent. An LF signature is well-moded if every type family in it is well-moded. The restriction to only strict occurrences in the above definition is based on the fact that the instantiations of only variables that have such occurrences are guaranteed to be ground when matching with a ground term. As an example of the application of these definitions, it is easy to see that the mode provided for subred is well-defined and that sr-app and sr-abs are mode consistent. Thus the type family subred and the LF signature in Fig. 2 are wellmoded. The definition of mode consistency formalizes what 3.2 Termination Checking Theorem 7. Given a well-moded and termination-checked LF signature Σ, every execution path for a well-typed and input consistent goal A will have only finitely many steps. By the theorem if a type family a passes mode checking and termination checking, then any call to a with ground inputs will terminate. This does not, however, guarantee that a can be interpreted as a total function from its ground inputs to its ground outputs: for some ground inputs the execution might not be able to make progress. For this stronger guarantee, it must pass the input and output coverage checking. 3.3 Input Coverage Checking Coverage checking is the general problem of deciding whether any closed term is an instance of at least one of a given set of patterns [11]. For example, in functional programming languages such as ML, coverage checking is used to decide if a function definition is exhaustive over a given data type. The complexity of coverage checking depends on the underlying term algebra. In ML which only involves simple types and prefix polymorphism, the coverage checking is simple. Coverage checking is significantly more complex in LF since it contains dependent types and we also have to consider patterns with variables of higher-order type. A coverage goal and a coverage pattern in LF are both given by a term and a context with respect to which it is ground. Definition 8. A coverage goal or pattern is a valid LF typing judgment Γ `Σ U : V , where U is either an object or type and V is either a type or kind. A coverage goal or pattern represents the collection of closed terms obtained by instantiating the variables in the context. Given a set of coverage patterns and a coverage goal, the task, as already noted, is to determine if every instance of the goal is an instance of one of the patterns. One possibility is that the goal is immediately covered by one of the patterns in the set. Definition 9. A coverage goal Γ `Σ U : V is immediately covered by a pattern Γ0 `Σ U 0 : V 0 if there exists a substitution Γ `Σ σ : Γ0 such that Γ `Σ U 0 [σ] : V 0 [σ] and U ≡ U 0 [σ], V ≡ V 0 [σ]. A coverage goal is immediately covered by a finite set of patterns if it is immediately covered by one of the patterns in the set. In the more general case, different instances of the coverage goal may be covered by different patterns. Definition 10. Γ `Σ U : V is covered by a set of patterns P if, for every (ground) substitution σ such that · `Σ σ : Γ, it is the case that · `Σ U [σ] : V [σ] is immediately covered by P. If it can be shown that the given coverage goal is immediately covered by the given set of patterns, then the task of coverage checking is obviously done. If the goal is not immediately covered by the patterns, then we consider applying a splitting operation to the goal. Splitting uses knowledge of the signature to generate a set of subgoals whose simultaneous coverage implies coverage of the original goal. We consider here only a restricted form of the operation defined in [11] that disallows splitting on variables of function type and hence the use of context definitions (regular worlds) in Twelf proofs. Definition 11. Let Γ `Σ U : V be a coverage goal and let Γ be Γ1 , x : Ax , Γ2 where Ax is an atomic type. Suppose that for every constant c : ΠΓc .Ac in Σ it is the case that either the unification problem (Ax = Ac , x = c Γc ) does not have a solution or it has an mgu. Splitting is then applicable in this case and it generates the following set of subgoals: 0 {Γ , Γ2 [σ] `Σ U [σ] : V [σ] | c : ΠΓc .Ac ∈ Σ, (Ax = Ac , x = c Γc ) is unifiable and σ is its mgu and Γ0 `Σ σ : (Γ1 , x : Ax , Γc )}. Note that splitting is finitary, i.e., its application produces only finitely many subgoals from a given goal. The following theorem, proved in [11], shows that splitting preserves the coverage: Theorem 12. Let Γ `Σ U : V be a coverage goal and let {Γi `Σ Ui : Vi | 1 ≤ i ≤ n} result from it by splitting. Γ `Σ U : V is covered by a set of patterns iff Γi `Σ Ui : Vi is covered for i such that 1 ≤ i ≤ n. The general notion of coverage checking described here is specialized in Twelf to input coverage checking that verifies that there is some clause to backchain on for any call to a with ground inputs. The coverage patterns and goal to be used in the framework of general coverage checking for this purpose are defined as follows. Definition 13. For a given type family a : ΠΓI .ΠΓO .type in a well-moded LF signature Σ, the input coverage goal is ΓI ` a ΓI : ΠΓO .type. Corresponding to a clause c for a whose head is a M1 . . . Mn , let σcI be the substitution (M1 /x1 , . . . , Mk /xk ) where k is the length of ΓI and let ΓcI be the context containing the variables occurring in M1 , . . . , Mk . The set of input patterns for a relative to Σ then consists of the following: {ΓcI `Σ a σcI : ΠΓO [σcI ].type | c is a clause for a in Σ}. The input coverage patterns for a are derived from the clauses for a by fixing the input arguments to a to be those for the head of the respective clause. Moreover, these arguments in the input coverage goal are set to be variables. Thus, if coverage checking as per Definition 10 verifies that this goal is covered by the corresponding patterns, then any call to a with ground input arguments and variables for the output arguments will match the head of at least one clause for a, thus guaranteeing the possibility of backchaining on it. A terminating procedure for (input) coverage checking that is based on a repeated use of splitting and immediate coverage is described for LF in [11]. We do not present this procedure here since our interest is in the extraction of an explicit proof from the results of totality checking. In particular, we assume that we are presented at the outset with a sequence of splitting operations applied to an input coverage goal that lead to a set of subgoals that pass immediate coverage checking. 3.4 Output Coverage Checking The premises in a clause for the type family correspond to recursive calls. The output arguments in such recursive calls could potentially limit the success set. Since coverage checking based on input coverage assumes success any time the input arguments in a goal match those in the head of a clause, it is necessary to verify that the output arguments of premises do not falsify this assumption. We describe here a method for ensuring that this is the case; this presentation is a formalization of what we understand output coverage checking to be in Twelf [6]. One way in which the success set may get constrained is if a output variable appears in an input argument. Output freshness is a criterion designed to avoid such a possibility. Definition 14. A clause c : A ← A1 ← · · · ← Am satisfies the output freshness property iff, for 1 ≤ i ≤ m, the sets of output and input variables of Ai are disjoint. We assume output freshness for clauses in what follows. A more involved requirement is that the form of the output arguments not limit the coverage of the clause. To formalize this we first identify output coverage goals and patterns. Definition 15. Let a : ΠΓI .ΠΓO .type be a type family in a well-moded LF signature Σ, where ΓI is x1 : A01 , . . . , xk : A0k and ΓO is xk+1 : A0k+1 , . . . , xn : A0n . Further, let c : A ← A1 ← · · · ← Am be a clause in Σ, where A is a M1 . . . Mn and, for 1 ≤ i ≤ m, Ai is a Mi1 . . . Min . Finally, for 1 ≤ i ≤ m, let σiI be the substitution (Mi1 /x1 , . . . , Mik /xk ). Then the output coverage pattern for Ai is ΓiI , ΓiO `Σ Ai : type where ΓiI and ΓiO are contexts formed respectively from the input and output variables of Ai . The output coverage goal for Ai is ΓiI ; ΓO [σiI ] `Σ a σiI ΓO : type. Intuitively, the output coverage pattern corresponding to a premise Ai is Ai itself. The output coverage goal, on the other hand, is obtained by retaining the inputs to Ai while maximally generalizing its outputs. To check if an output coverage goal is covered by the single pattern, we may split on an output variable but a way that ensures no variable other than the one being split on is instantiated. Definition 16. Let ΓI ; ΓO `Σ A : type be an output coverage goal where ΓO is Γ1 , x : Ax , Γ2 for some atomic type Ax . Suppose that for every constant c : ΠΓc .Ac in Σ it is the case that either Ax is not an instance of Ac or there is a most general substitution σ such that Ax = Ac [σ]; such a substitution must obviously not instantiate any variable in ΓI , ΓO . Then, output splitting generates the set of subgoals {ΓI ; Γ1 , Γc0 , Γ2 [σ] `Σ A[σ] : type | c : ΠΓc .Ac ∈ Σ, Ax is an instance of Ac , σ 0 is a most general substitution such that Ax = Ac [σ 0 ], 0 0 σ = ((c Γc )[σ ]/x, σ ) and Γc0 4.1 `Σ σ : Γc ).} Eventually we want every output coverage subgoal that is produced by splitting to be equivalent to the sole output coverage pattern for each premise. Immediate output coverage captures the relevant equivalence notion. Γ `Σ σ : Γ1 An output coverage goal is covered by an output coverage pattern if every subgoal that is produced from it by some applications of output splitting is immediately covered by the pattern. In summary, output coverage checking ensures output freshness for every clause in the signature and it further checks that the output coverage goal for every premise of every clause is covered by the corresponding output coverage pattern for the premise. Explicit Proofs for Meta-Theorems Meta-theorems about formal systems can also be stated and proved in a logic. The logic M2 is designed for doing this based on the LF encodings of such systems [10]. M2 is a constructive logic formally presented via a sequent calculus. Formulas in M2 have the form ∀Γ1 .∃Γ2 .>, where Γ1 and Γ2 are valid LF contexts. The universal (existential) quantification is omitted when Γ1 (Γ2 ) is empty. As we can see, the formulas in M2 are limited to the Π10 form, where all existential quantifiers follow the universal ones. Although this may not seem very expressive, we have seen in Section 3 that every theorem proved through totality checking has this form. The judgments in the sequent calculus are of the form Γ; ∆ −→ P ∈ F , where F is a formula, P is a proof term, ∆ is a set of assumptions and Γ is a valid LF context containing all free variables occurring in P and F . Proof terms and assumptions are defined as follows: Proof Terms: P ::= let y = x σ in P | LΓ.P | Assumptions: split x as hΓi in P | hσi ∆ ::= · | ∆, P ∈ F A meta-theorem represented by the formula ∀Γ1 .∃Γ2 .>, is proved by deriving the judgment ·; · −→ P ∈ ∀Γ1 .∃Γ2 .>. The proof term P is obtained as an output of the derivation. The resulting P represents a total function, as shown by the following theorem that is proved in [9]. Theorem 18. If ·; · −→ P ∈ ∀Γ1 .∃Γ2 .> is derivable for some P , then for every closed substitution · `Σ σ1 : Γ1 there exists a substitution · `Σ σ2 : Γ2 [σ1 ]. As an example of this theorem, recall from Section 3 the formula stating the subject reduction theorem: ∀E : tm, V : tm, T : ty, D1 : eval E V, D2 : of E T. ∃D3 : of V T.∃D : subred E V T D1 D2 D3 .>. If we can get a proof term for this formula, then we can conclude that for any closed terms D1 : eval E V and D2 : of E T , there exists a term D3 : of V T . Given the adequacy of the LF encoding, we can conclude the subject reduction theorem holds for the actual system. The subsections that follow present the derivation rules for M2 . Γ; ∆1 , x ∈ ∀Γ1 .F1 , ∆2 , y ∈ F1 [σ] −→ P ∈ F2 ∀-L Γ; ∆1 , x ∈ ∀Γ1 .F1 , ∆2 −→ let y = x σ in P ∈ F2 Γ, Γ1 ; ∆1 , x ∈ ∃Γ1 .>, ∆2 −→ P ∈ F Definition 17. An output coverage goal ΓI ; ΓO `Σ M 0 : type is immediately covered by an output coverage pattern Γ0 `Σ M : type if M ≡ M 0 [σ] for a substitution σ that only renames variables and is such that Γ `Σ σ : ΓI , ΓO . 4. The Quantifier Rules 0 ∃-L Γ; ∆1 , x ∈ ∃Γ1 .>, ∆2 −→ split x as hΓ1 i in P ∈ F Γ, Γ1 ; ∆ −→ P ∈ F Γ `Σ σ : Γ1 ∀-R Γ; ∆ −→ LΓ1 .P ∈ ∀Γ1 .F ∃-R Γ; ∆ −→ hσi ∈ ∃Γ1 .> Figure 3. Quantifier Rules The quantifier rules for M2 that are presented in Fig. 3 are the most basic ones for the logic. If we ignore the proof terms in boxes, we can see that these rules are similar to the conventional ones for an intuitionistic logic. The ∃-L and ∀-R rules introduce fresh eigenvariables to the context. The ∀-L rule instantiates an assumption with a witnessing substitution to get a new assumption. ∃-R finds a witnessing substitution and finishes the proof. Note that weakening is implicit in ∃-R. 4.2 Recursion The recursion rule is Γ; ∆, x ∈ F −→ P ∈ F recur Γ; ∆ −→ µx ∈ F.P ∈ F with the proviso that µx ∈ F.P must terminate in x. This rule adds the goal formula as an inductive hypothesis to the set of assumptions. For a proof based on this rule to be valid, the proof term must represent a terminating computation as the side condition guarantees. This condition is presented formally in Definition 7.8 of [9] using the termination ordering on LF terms that was discussed in Section 3.2. 4.3 Case Analysis The case analysis rule considers all the possible top-level structures for a ground term instantiating an eigenvariable x of atomic type Ax in the context Γ in a judgment of the form Γ; ∆ −→ P ∈ F . Since Ax is atomic, the only cases to consider are those where the head of the term is a constant from the LF signature. To state the rule, we need to extend the definition of proof terms with a case construct: Patterns: Cases: Proof Terms: R ::= Γ0 ; Γ00 . M Ø ::= · | Ø, R 7→ P P ::= ... | case x of Ø The case rule is Γ1 , x : Ax , Γ2 ; ∆ −→Σ Ø ∈ F case Γ; ∆ −→ case x of Ø ∈ F where Γ1 , x : Ax , Γ2 is a valid permutation of Γ and Ax depends on all the variables in Γ1 . The new judgment Γ1 , x : Ax , Γ2 ; ∆ −→Σ Ø ∈ F is derived by considering all constants in Σ whose target type unifies with Ax . The derivation rules for this judgment are shown in Fig. 4. The siguni rule produces a new premise (and a new case in the proof term) for every constant c in Σ that has a type ΠΓc .Ac Γ1 , x : Ax , Γ2 ; ∆ −→Σ Ø ∈ F signonuni, Ax and Ac do not unify signempty Γ1 , x : Ax , Γ2 ; ∆ −→· ∗ ∈ F Γ1 , x : Ax , Γ2 ; ∆ −→Σ,c:ΠΓc .Ac Ø ∈ F Γ0 , Γ2 [σ]; ∆[σ] −→ P ∈ F [σ] Γ1 , x : Ax , Γ2 ; ∆ −→Σ Ø ∈ F siguni Γ1 , x : Ax , Γ2 ; ∆ −→Σ,c:ΠΓc .Ac Ø, (Γ0 ; Γ2 [σ] . (c Γc )[σ] 7→ P ) ∈ F Γ0 ` σ : (Γ1 , x : Ax , Γc ) where σ = mgu(Ax = Ac , x = c Γc ) Figure 4. Rules for Γ1 , x : Ax , Γ2 ; ∆ −→Σ Ø ∈ F proofs generated from clauses such that Ac unifies with Ax . The situation where Ax and Ac do not unify is dealt with by the signonuni rule. Interpretation of Proof Rules At an intuitive level, the proof rules of M2 function as follows: • recur introduces an inductive hypothesis as an assump- tion, usually as the first step, reading proofs upwards; • ∀-L followed by ∃-L corresponds to an application of the inductive hypothesis; D1 case initial analysis step steps 4.4 • ∀-R introduces hypotheses into the context; the context. 5. Explicit Proofs from Totality Checking Totality checking is a proof verification tool that asserts if the user-defined LF signatures represent proofs for metatheorems. This section describes an algorithm for generating M2 proofs from totality checking that does not use contexts and lemmas and the proof for its correctness. The algorithm consists of two steps. Firstly, a well-moded type family, which can always be stated as a : ΠΓI .ΠΓO .type where ΓI contains input parameters and ΓO contains output parameters, is translated into an M2 formula ∀ΓI .∃ΓO .∃D : a ΓI ΓO .>. Secondly, an M2 proof tree for the sequent ·; · −→ P ∈ ∀ΓI .∃ΓO .∃D : a ΓI ΓO .> is generated by applying M2 proof rules translated from totality checking until a complete proof tree is built. The validity of those applications is guaranteed by totality checking, as we will show in the correctness proof for the algorithm. In the following subsections, we first give an overview of the proof generation process. Then we discuss the individual steps for constructing the proof tree. Finally, we prove the correctness of the proof generation algorithm. 5.1 Overview of the Proof Generation Totality checking verifies that an LF signature provided by user represents a total function that computes ground outputs from ground inputs. This interpretation of proofs is translated into an M2 proof tree as shown in Fig. 5. The proof tree consists of several segments, each consisting of applications of proof rules translated from different components in totality checking. It is constructed as follows: first there is an initial step that introduces an inductive hypothesis and other hypotheses. Then follows the case analysis steps that translate input coverage checking into applications of case. Then every clause for a in the LF signature is translated into a proof branch. For each frontier sequent resulting from case analysis steps, there exists a proof branch that, when instantiated, is the proof for that sequent. Plugging in the proof for those frontier sequents finishes the proof. Dj Di .. . case S1 ... ... Dl .. . case Sk Do ... ΓI ; ∆ −→ ∃ΓO .∃D : a ΓI ΓO .> Dp ... .. . case Sn case .. . ·; · −→ ∀ΓI .∃ΓO .∃D : a ΓI ΓO .> Figure 5. Overview of the Proof Generation • case corresponds to case analysis on a hypothesis; • ∃-R finishes a proof branch by constructing witness from ... For simplicity we omit proof terms in M2 sequents in the following discussions. The translation can be extended to generate M2 proofs with proof terms in a straightforward manner. The proof term for the end sequent in a translated proof represents a total function, whose termination property is ensured by termination checking. 5.2 Initial Step Starting with the initial sequent ·; · −→ ∀ΓI .∃ΓO .∃D : a ΓI ΓO .>, we apply the recur rule to introduce the goal formula as an inductive hypothesis. Then we apply the ∀-R rule to introduce hypotheses in ΓI into the LF context. ΓI ; ∀ΓI .∃ΓO .∃D : a ΓI ΓO .> −→ ∃ΓO .∃D : a ΓI ΓO .> ·; ∀ΓI .∃ΓO .∃D : a ΓI ΓO .> −→ ∀ΓI .∃ΓO .∃D : a ΓI ΓO .> ·; · −→ ∀ΓI .∃ΓO .∃D : a ΓI ΓO .> ∀-R recur Figure 6. Introducing Hypotheses 5.3 Case Analysis Steps In this phase, we translate input coverage checking into applications of the case rule. We assume that input coverage checking succeeds and returns a sequence of splitting operations that leads to subgoals covered by input patterns. We show that every splitting operation can be translated into an application of case. In Section 3.3, we described that splitting on the variable x in an input coverage goal Γ1I , x : Ax , Γ2I `Σ A : ΠΓO .type produces a subgoal Γ0 , Γ2I [σ] `Σ A[σ] : ΠΓO [σ].type for every constant c : ΠΓc .Ac such that Ac and Ax unifies and Γ0 `Σ σ = mgu(Ax = Ac , x = c Γc ) : (Γ1I , x : Ax , Γc ). From the definitions of case in Section 4.3, we can see that splitting on a variable x : A corresponds exactly to case analysis of x. To formally prove the equivalence, we define a relation between input coverage goals and M2 sequents: Definition 19. Let ≡I be a binary relation between input coverage goals and M2 sequents. G ≡I S holds if and only if G is an input coverage goal ΓI `Σ A : ΠΓO .type and S is an M2 sequent ΓI ; ∆ −→ ∃ΓO .∃D : A ΓO .> where ∆ = ∀ΓI .∃ΓO .∃D : a ΓI ΓO .>. Definition 23. Let S be an M2 sequent Γ; ∆ −→ F and σ be a substitution such that Γ0 `Σ σ : Γ. The instantiation of S under σ is Γ0 ; ∆[σ] −→ F [σ]. We overload the ≡I relation with finite sets of coverage goals and M2 sequents: The following lemma shows that immediate coverage in input coverage checking can be reflected into instantiation of M2 sequents. Definition 20. Given a finite set of input coverage goals G = {Gi | 1 ≤ i ≤ n} and M2 sequents S = {Si | 1 ≤ i ≤ n}, G ≡I S if and only if Gi ≡I Si for 1 ≤ i ≤ n. Then we have the following lemma: Lemma 21. Given G ≡I S where G is Γ1I , x : Ax , Γ2I `Σ A : ΠΓO .type and S is Γ1I , x : Ax , Γ2I ; ∆ −→ ∃ΓO .∃D : A ΓO .>, if G is the set of subgoals resulting from splitting on x in G and S is the set of frontier sequents resulting from applying case to x in S, then G ≡I S. Proof. Let Gi be a subgoal Γ0 , Γ2I [σ] `Σ A[σ] : ΠΓO [σ].type resulting from splitting for some constant c : ΠΓc .Ac such that Ac and Ax unifies and Γ0 `Σ σ = mgu(Ax = Ac , x = c Γc ) : (Γ1I , x : Ax , Γc ). By the definition of case analysis, there must be a sequent Si = Γ0 , Γ2I [σ]; ∆ −→ ∃ΓO [σ].∃D : A[σ] ΓO [σ].> resulting from applying siguni. Thus we have Gi ≡I Si by the definition of ≡I . Since goals in G one-to-one correspond to sequents in S, we have G ≡I S. The following lemma leads to an algorithm for translating splittings to applications of case: Lemma 22. Given a set of input coverage goals G and a partial M2 proof with frontier sequents S such that G ≡I S, if for some Gk ∈ G such that Gk = Γ1I , x : Ax , Γ2I `Σ A : ΠΓO .type, splitting on x results in a new set of coverage goals G0 , then applying the case rule on x in Sk where Gk ≡I Sk results in a partial M2 proof with frontier sequents S0 such that G0 ≡I S0 . Proof. The coverage goals Gi ∈ G for i 6= k and frontier sequents Si ∈ S for i 6= k are still present and related by ≡I after splitting and applying case. The new coverage goals generated by splitting are related to the new frontier sequents generated by applying case by Lemma 21. Starting with the partial M2 proof resulting from the initial step, we translate input coverage checking into applications of case. We maintain a set of input coverage goals G and a partial proof with frontier sequents S such that G ≡I S for the translation. Initially, G is a singleton containing ΓI `Σ a ΓI : ΠΓO .> and S is a singleton containing ΓI ; ∀ΓI .∃ΓO .∃D : a ΓI ΓO .> −→ ∃ΓO .∃D : a ΓI ΓO .> that is the frontier sequent of the proof in Figure 6. By Lemma 22, for every splitting operation on some Gi ∈ G, we are able to apply the case rule to the corresponding frontier sequent Si ∈ S where Gi ≡I Si to get G0 and S0 such that G0 ≡I S0 . In the end, we get a set of input coverage goals G0 that are immediately covered and a partial proof tree with frontier sequents S0 such that G0 ≡I S0 . 5.4 Generating Proof Trees from Clauses Let G0 = {Gi | 1 ≤ i ≤ n0 } and S0 = {Si | 1 ≤ i ≤ n0 }, where G0 ≡I S0 , be the input coverage goals and sequents resulting from case analysis steps. To finish the M2 proof, we need to derive sequents in S0 . For this we define the instantiation of an M2 sequent: Lemma 24. Given an input coverage goal G0 and an input coverage pattern G such that G0 is immediately covered by G under a substitution σ, if S and S 0 are M2 sequents for which G ≡I S and G0 ≡I S 0 hold, then S 0 is the instantiation of S under σ. Proof. Straightforward from definitions of immediate coverage, instantiation and ≡I relation. Let Gi ∈ G and Si ∈ S where Gi ≡I Si and G ≡I S where G is a pattern derived from a clause c that immediately covers Gi . We are going to translate c into an M2 proof with the end sequent S. By Lemma 24, the instantiation of the proof for S under the substitution for the immediate coverage of Gi by G is a proof for Si . The instantiation of a proof generated from a clause is also a valid proof, which we will prove after describing the translation of clauses. 5.4.1 Translation of Clauses into Proofs We first describe the translation of clauses into M2 proofs. Let a : ΠΓI .ΠΓO .type be a type family where ΓI = x1 : A1 , ..., xk : Ak and ΓO = xk+1 : Ak+1 , ..., xn : An , c : a M1 ... Mn ← a M11 ... M1n ← ... ← a Mm1 ... Mmn be a clause for a, σcI = (M1 /x1 , ..., Mk /xk ) be the substitution containing input arguments to the head and ΓcI be the context containing variables in σcI . The input coverage pattern G derived from c is ΓcI `Σ a σcI : ΠΓO [σcI ].type. Let S be the sequent ΓcI ; ∆ −→ ∃ΓO [σcI ].∃D : a σcI ΓO .> such that G ≡I S, where ∆ contains the inductive hypothesis ∀ΓI .∃ΓO .∃D : a ΓI ΓO .>. The M2 proof for S is translated from the operational interpretation of c as a function that computes ground outputs from ground inputs. Starting with the input arguments to the head, this function recursively calls a. Each recursive call to a is represented by a premise a Mi1 ... Min for some i such that 1 ≤ i ≤ m. After the recursive calls, it constructs outputs from initial inputs and the results of recursive calls. We describe the translation from c to a proof for S as a recursive procedure. In the base step, we translate the construction of outputs into an application of the ∃-R rule. In each recursive step, we translate a recursive call to a into applications of ∀-L, ∃-L and case rules and recursively generate the sub-proof. Before describing the translation steps, we present some notations that will be used in our discussion and an alternative definition of output coverage checking in order to simplify the discussion. Definition 25. Let a : ΠΓI .ΠΓO .type be a type family with well-defined mode, where ΓI = x1 : A01 , ..., xk : A0k and ΓO = xk+1 : A0k+1 , .., xn : A0n . Let c : A ← A1 ← ... ← Am be a clause for a where A = a M1 ... Mn and Ai = a Mi1 ... Min for 1 ≤ i ≤ m. Let σcI = (M1 /x1 , ..., Mk /xk ) be the substitution containing input arguments to the head of c. A set of contexts {Γci | 0 ≤ i ≤ m} is recursively defined as follows: Γc0 contains input variables in A and Γci = Γci−1 , Γi0 for 1 ≤ i ≤ m where Γi0 contains output variables in Ai and the variable Di : Ai . A set of sequents {Sci | 0 ≤ i ≤ m} is defined where Sci = Γci ; ∆i −→ ∃ΓO [σcI ].∃D : a σcI ΓO .> The following lemma relates this definition to mode checking: Lemma 26. Given a clause c, the context Γci as defined in Definition 25 is a superset of the context Γi as defined in Definition 6 for i such that 0 ≤ i ≤ m. Proof. It is easy to see that Γi can be obtained by removing variables Dj for 1 ≤ j ≤ i and variables that do not have a strict occurrence in the type of c from Γci . By this lemma and the definition of mode consistency, we know that for a constant c : A ← A1 ← ... ← Am the input variables to Ai are contained in Γci−1 for 1 ≤ i ≤ m. The output coverage goals and patterns in Definition 15 are redefined as follows: the output coverage pattern for Ai is now Γci−1 , ΓiO `Σ Ai : type and the output coverage goal for Ai is now Γci−1 , ΓO [σiI ] `Σ a σiI ΓO : type. This is a superfluous change from Definition 15: since the context ΓiI containing input variables to Ai is closed and a subset of Γci−1 , splitting and immediate coverage will never affect variables that are not in ΓiI . Thus splitting and immediate coverage in Definition 16 and 17 are adopted to this new definition in a straightforward manner. By the definition, Sc0 is the sequent S. We construct a proof for S by recursively constructing proofs for {Sci | 0 ≤ i ≤ m}. In the base step we construct a proof for Scm . In the recursive steps we construct proof for Sci−1 for 1 ≤ i ≤ m. Base Step. In the base step we translate the construction of outputs into an application of ∃-L to Scm as shown in Figure 7. By Definition 25, Γcm contains D1 : Γcm `Σ σm : (ΓO [σcI ], D : a σcI ΓO ) Γcm ; ∆m −→ ∃ΓO [σcI ].∃D : a σcI ΓO .> ∃-L A1 , ..., Dm : Am . Letting Mk+1 , ..., Mn be the output arguments to the head of c and σcO = (Mk+1 /xk+1 , ..., Mn /xn ), σm = (σcO , (c Dm ..., D1 )/D) in Figure 7. Lemma 27. Γcm `Σ σm : (ΓO [σcI ], D : a σcI ΓO ) holds. Proof. By the definition of mode consistency and Lemma 26, A is output consistent relative to Γcm . Thus Γcm contains all free variables in σcO . By the well-typedness of A, Γcm `Σ σcO : ΓO [σcI ] holds. Thus we have Γcm `Σ c Dm ... D1 : A Γcm `Σ σm : (ΓO [σcI ], D : a σcI ΓO ) Γci−1 ; ∆0i−1 −→ F Γci−1 ; ∆i−1 −→ F where ∆0i−1 = ∆i−1 , ∃Γ O [σiI ].∃Di : a σiI ∃-L ∀-L ΓO .> and F = ∃ΓO [σcI ].∃D : a σcI ΓO .> Figure 8. Applying the Inductive Hypothesis cases the output arguments in Ai are not variables. For example, in the subred example, the first premise of eval-app is subred (Dev1 : eval M (abs M 0 )) (Dty1 : of M (arr T1 T )) (of-abs (Dty3 : Πx : tm.of x T1 → of (M 0 x) T )) which has an output of-abs Dty3 . By applying the inductive hypothesis on Dev1 and Dty1 , we get an new variable D3 : of (abs M 0 ) (arr T1 T ) in the context. We need to perform an inversion (case analysis) on D3 to introduce the output variable Dty3 into the context. The inversion consists of case rules translated from the output coverage checking. The translation is similar to translating input coverage checking. First we define a relation between output coverage goals and M2 sequents. Definition 28. Let ≡O be a binary relation between output coverage goals and M2 sequents. G ≡O S iff G is an output coverage goal ΓI , ΓO `Σ A : type where ΓI contains input parameters and ΓO contains output parameters and S is an M2 sequent ΓI , ΓO , D : A; ∆ −→ F where ∆ contains the inductive hypothesis and F = ∃ΓO [σcI ].∃D : a σcI ΓO .>. Definition 29. Given a finite set of output coverage goals G = {Gi | 1 ≤ i ≤ n} and M2 sequents S = {Si | 1 ≤ i ≤ n}, G ≡O S if and only if Gi ≡O Si for 1 ≤ i ≤ n. Then the following lemma holds: Figure 7. Finishing the Proof by Applying ∃-R Rule Γcm `Σ σcO : ΓO [σcI ] Γci−1 , ΓO [σiI ], Di : a σiI ΓO ; ∆0i−1 −→ F Γci−1 `Σ σiI : ΓI subst-typ Recursive Steps. For i such that 1 ≤ i ≤ m, we create a proof tree for Sci−1 by first translating the recursive call represented by Ai = a Mi1 ... Min and then recursively generating the proof for Sci . A recursive call can be translated to an application of the inductive hypothesis in the M2 proof as shown in Figure 8, in which σiI = (Mi1 /x1 , ..., Mik /xk ) is a substitution containing input arguments to Ai . In the simple case when the output arguments Mik+1 ...Min to Ai are variables, the frontier sequent resulting from applying ∀-L and ∃-L is exactly Sci . By recursively generating the proof for Sci we finish the translation. However, in many Lemma 30. Given G ≡O S where G is ΓI , Γ1O , x : Ax , Γ2O `Σ A : type and S is ΓI , Γ1O , x : Ax , Γ2O , D : A; ∆ −→ F , if G is the set of subgoals resulting from splitting on x in G and S is the set of sequents resulting from applying case rule to x in S, then G ≡O S. Proof. Similar to Lemma 21. Note that all free variables in F are bound in ΓI . Since variables in ΓI are not instantiated by splitting in output coverage checking, they are also not instantiated by applying the corresponding case rule in the M2 proof. Thus F remains the same after applying case. By Lemma 30, we can prove a lemma similar to Lemma 22, from which we derive an algorithm for translating output coverage checking. Let Sc0 i−1 be the frontier sequent resulting from applying the inductive hypothesis (as shown in Figure 8) and G0ci be the output coverage goal for Ai . By the definition of ≡O and output coverage goals, we have G0ci ≡O Sc0 i−1 . Let Gci be the output coverage patterns for Ai . By Definition 25 and output coverage patterns, we have Gci ≡O Sci . The output coverage checking performs a sequence of splitting operations to G0ci and returns a set of subgoal G0 immediately covered by Gci . Those splitting operations are translated into applications of case rules to the frontier sequent Sc0 i−1 , resulting in a partial proof with frontier sequents S0 such that G0 ≡O S0 . To relate the frontier sequents in S0 to Sci , we prove the following lemma, which reflects the immediate coverage in output coverage into equivalence between M2 sequents up to renaming. Lemma 31. Given an output coverage goal G0 and an output coverage pattern G such that G0 is immediately covered by G, if G ≡O S and G0 ≡O S 0 then S 0 is the instantiation of S under σ which is a substitution that only renames variables. Proof. Similar to Lemma 24. Because we restricted the instantiation of immediate coverage to an substitution that only renames variables in output coverage checking, it is reflected into equivalence between M2 sequents up to renaming. 0 0 By applying Lemma 31 to G ≡O S and Gci ≡O Sci , we have that for every S 0 ∈ S0 , S 0 is an instantiation of Sci under a renaming substitution. The following lemma shows that instantiations of M2 proofs under renaming substitutions are also valid proofs. Lemma 32. Let S 0 be an instantiation of S under a renaming substitution, if S has a M2 proof, then so does S 0 . Proof. By induction on the structure of the proof for S and case analysis of the rule applied to S. The proof for most of cases is straightforward. When the rule applied is case, the proof relies on the fact that for a unification problem, compositions of mgus with renaming substitutions are still mgus. At this point, we recursively generate a proof for Sci and apply Lemma 32 to get proofs for sequents in S0 . This finishes the construction of the proof for Sci−1 . 5.4.2 Correctness of the Translation of Clauses The following lemma shows that proofs translated from clauses are valid: Lemma 33. Given a clause c : A ← A1 ← ... ← Am , the input coverage pattern G derived from c and the M2 sequent S such that G ≡I S. The algorithm for translating clauses to M2 proofs generate an M2 proof for S from c. Proof. We define M2 sequents {Sci | 0 ≤ i ≤ m} as in Definition 25. By the definition we have S = Sc0 . We prove that the algorithm constructs a correct proof for S by induction on i. In the base case, Lemma 27 guarantees the ∃-R is correctly applied to get a proof for Scm . In the inductive case, assume we have a correct proof for Sci for some i such that 1 ≤ i ≤ m, we prove that applications of ∀-L, ∃-L and case rules to Sci−1 are correct. By the definition of mode consistency in Definition 6 and Lemma 26, the context Γci−1 in the premise of ∀-L, Γci−1 `Σ σiI : ΓI , contains all variables in σiI . Thus this premise holds by LF typing rules and ∀-L is correctly applied. The correctness of ∃-L and case rules is obvious from their definitions. By Lemma 30 and Lemma 31, after applying those rules we get a partial proof with frontier sequents S, which is completed by applying Lemma 32 to the proof for Sci . 5.4.3 Correctness of the Instantiation of Proofs As described in the beginning of Section 5.4, we have to instantiate the proof generated from clauses to derive frontier sequents in the partial proof resulting from case analysis steps. In general, the provability of an M2 sequent is not closed under instantiations. For instance, a case rule might no longer be applicable after an instantiation because the side condition for case, that every unification problem must either has an mgu or no solution, may no longer hold after the instantiation. In our case, an M2 proof to be instantiated is translated from a totality checked clause, which has a particular structure such that the same rules can be applied to prove the instantiation of the M2 sequent. Specifically, it does not use recur rule and case rules in it are translated from splitting in output coverage checking, which only involves matching problems instead of general unification problems. From those observations, we can prove the following instantiation lemma. Lemma 34. If D is an M2 proof generated from clauses as described in Section 5.4.1 for the sequent S = Γ; ∆ −→ F , then given any substitution Γ0 `Σ σ : Γ and an instantiation S 0 of S under σ there exists a proof D0 for S 0 . Proof. The proof is by induction on the structure of D and case analysis of the rule applied to S in D. The important case is for the case rule, in which we prove that the structure of the case are maintained under instantiation. Proof for other cases is straightforward. See Theorem 38 in the appendix for the details. 5.5 Correctness of the M2 Proof Generation We have shown that almost all applications of the M2 rules in our proof generation are correct, except for recur rule in the initial step which has a side condition that the proof term must represent a terminating computation. Given an totality checked LF signature Σ and a type family a : ΠΓI .ΠΓO .type in Σ such that ΓI = x1 : A1 , ..., xk : Ak , an M2 proof for ·; · −→ P ∈ F is generated by the translation algorithm, where F = ∀ΓI .∃ΓO .∃D : a ΓI ΓO .> and P = µx ∈ F.L(x1 : A1 , ..., xk : Ak ).P 0 . Intuitively, the translation algorithm should reflect the termination ordering in totality checking to that in the proof term P . Then the termination property of P is guaranteed by the termination checking. To formally prove that, we need an instantiation lemma for termination ordering. The following lemma proves that subterm ordering holds under instantiation. Lemma 35. Let  be the subterm ordering between LF terms. If M  N and σ is an substitution, then M [σ]  N [σ]. Proof. The formal definition of  is described in [8]. The proof is by a straightforward induction on the derivation rules for . By this lemma, the same property can be proved easily for lexicographical and simultaneous ordering. These are all orderings supported by M2 . Then we prove that the termination property holds for P . Lemma 36. If P = µx ∈ F.L(x1 : A1 , ..., xk : Ak ).P 0 is the proof term generated by the translation algorithm, then P terminates in x. Proof. Suppose every recursive call x M1 ... Mk in the proof term occurs in a position such that x1 , ..., xk are instantiated by σ = σ1 ◦ ... ◦ σm where σi for 1 ≤ i ≤ m are substitutions in case rules along the execution path and σ is their compositions, we have to prove that M1 , ..., Mk are smaller than x1 [σ], ..., xk [σ] relative to some termination ordering. In our translated proofs, a recursive call corresponds to a premise A in some clause c. Let M1 , ..., Mk be the input arguments to A and M10 , ..., Mk0 be the input arguments to the head of c. By termination checking we have M1 , ..., Mk is smaller than M10 , ..., Mk0 relative to the termination ordering. In the proof term P 0 , the recursive call occurs in a position where x1 , ..., xn are instantiated by the case rules translated from input coverage checking. Letting σ be the composition of substitutions in those case rules, we have xi [σ] = Mi0 [σ 0 ] for i such that 1 ≤ i ≤ k, where σ 0 is the substitution for instantiating the proof translated from c, as described in Section 5.4. By the translation algorithm, this recursive call has the form x (M1 [σ 0 ]) ... (Mk [σ 0 ]). Applying Lemma 35 to the order between M1 , .., Mk and M10 , .., Mk0 , we get (M1 [σ 0 ])...(Mk [σ 0 ]) is smaller than x1 [σ], ..., xk [σ] relative to the termination ordering. Another direction of ongoing inquiry is the correspondence between the formalization and validation of meta-theorems in the LF/Twelf framework and in the two-level logic framework of Abella [1]. It has previously been shown that specifications in LF can be translated into clause definitions in the specification logic used in Abella in a way that preserves essential structure [12]. By exploiting this correspondence, it appears possible to transform M2 (and possibly M+ 2 ) proofs over LF specifications into Abella proofs over the related Abella specifications. The results of this paper and its extension would then yield a path to proofs in another tried and tested logical setup. Then we have our main theorem: Theorem 37. Given an LF signature Σ that is totality checked without using contexts and lemmas, for every type family a : ΠΓI .ΠΓO .> in Σ, the proof generation algorithm generates an M2 proof for ·; · −→ P ∈ ∀ΓI .∃ΓO .∃D : a ΓI ΓO .>. Proof. We prove that every application of an M2 rule is valid. 1. Obviously, the application of ∀-R in the initial step is correct. 2. The applications of case rules translated from input coverage checking are correct by Lemma 22. 3. The translation from clauses to M2 proofs are correct by Lemma 33. By instantiating those proofs the frontier sequents resulting from translating input coverage checking are proved, which is proved by Lemma 24. The instantiated proofs are valid by Lemma 34. 4. Finally, the application of recur rule in the initial step is correct by Lemma 36. Since all the proof rules are correctly applied, we get an M2 proof for ·; · −→ P ∈ ∀ΓI .∃ΓO .∃D : a ΓI ΓO .>. 6. Conclusions and Future Works This paper has described a method for transforming totality checking in a restricted version of Twelf into explicit proofs in the logic M2 . We have also proved this method correct. Towards this end, we have adapted arguments for the correctness of particular components of totality checking into an argument for the correctness of the generated M2 proof. Since M2 is a consistent formal logic with established metaproperties, the existence of such a transformation boosts our confidence in totality checking. More importantly, the transformation yields explicit objects that can be traded as proof certificates and whose correctness can be checked independently of the procedure that generated them. As we have noted already, we have not considered the entire class of specifications for which Twelf supports totality checking. One limitation is that we have not considered the proof of properties that are parameterized by changing signatures that adhere to constraints that are finitely described via regular worlds descriptions in Twelf. Another limitation is that we have not allowed for clauses that contain calls to predicates other than the predicate being defined. We believe our work can be extended to treat totality checking in this more general setting. However, we will need a richer target logic than M2 . In particular, the proofs we produce will have to be in the logic M+ 2 that extends M2 with judgments with generalized contexts and that contains rules for lemma applications. We plan to examine this issue more carefully in the near future. Acknowledgments:This work has been partially supported by the NSF Grant CCF-0917140. Opinions, findings, and conclusions or recommendations expressed in this paper are those of the authors and do not necessarily reflect the views of the National Science Foundation. References [1] A. Gacek, D. Miller, and G. Nadathur. A two-level logic approach to reasoning about computations. J. of Automated Reasoning, 49(2):241–273, 2012. [2] R. Harper, F. Honsell, and G. Plotkin. A framework for defining logics. In 2nd Symp. on Logic in Computer Science, pages 194–204, Ithaca, NY, June 1987. [3] R. Harper, F. Honsell, and G. Plotkin. A framework for defining logics. Journal of the ACM, 40(1):143–184, 1993. [4] F. Pfenning. Logic programming in the LF logical framework. In G. Huet and G. D. Plotkin, editors, Logical Frameworks, pages 149–181. Cambridge University Press, 1991. [5] F. Pfenning. Unification and anti-unification in the Calculus of Constructions. In G. Kahn, editor, 6th Symp. on Logic in Computer Science, pages 74–85. IEEE, July 1991. [6] F. Pfenning and C. Schürmann. Twelf User’s Guide, 1.4 edition, Dec. 2002. [7] B. Pientka. An insider’s look at LF type reconstruction: everything you (n)ever wanted to know. Journal of Functional Programming, 23(1):1–37, Jan. 2013. [8] E. Rohwedder and F. Pfenning. Mode and termination analysis for higher-order logic programs. In Proceedings of the European Symposium on Programming, pages 296–310, Apr. 1996. [9] C. Schürmann. Automating the Meta Theory of Deductive Systems. PhD thesis, Carnegie Mellon University, Oct. 2000. CMU-CS-00-146. [10] C. Schürmann and F. Pfenning. Automated theorem proving in a simple meta-logic for LF. In C. Kirchner and H. Kirchner, editors, 15th Conf. on Automated Deduction (CADE), volume 1421 of Lecture Notes in Computer Science, pages 286–300. Springer, 1998. [11] C. Schürmann and F. Pfenning. A coverage checking algorithm for LF. In Theorem Proving in Higher Order Logics: 16th International Conference, TPHOLs 2003, volume 2758 of LNCS, pages 120–135. Springer, 2003. [12] Z. Snow, D. Baelde, and G. Nadathur. A meta-programming approach to realizing dependently typed logic programming. In ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP), pages 187–198, 2010. Instantiation Theorem for M2 A. Theorem 38. If D is an M2 proof generated from clauses as described in Section 5.4.1 for the sequent S = Γ1 , Γ2 ; ∆ −→ F where Γ1 contains input parameters and Γ2 contains output parameters, then given any substitution Γ10 `Σ σ1 : Γ1 there exists a proof for S 0 = Γ10 , Γ2 [σ1 ]; ∆[σ1 ] −→ F [σ1 ]. Γ10 , Γ2 [σ1 ] `Σ σ ◦ σ1 : Γ3 [σ10 ]. Note that Γ3 [σ10 ] = Γ3 [σ1 ]. We apply ∃-R to conclude this case: Γ10 , Γ2 [σ1 ] ` σ[σ1 ] 0 Γ1 , Γ2 [σ1 ]; ∆[σ1 ] −→ D0 Γ1 , Γ2 ; ∆1 , ∀Γ3 .F3 , ∆2 , F3 [σ] −→ F1 Γ1 , Γ2 ; ∆1 , ∀Γ3 .F3 , ∆2 −→ F1 ∀-L 0 Applying I.H to D , we get D00 Γ10 , Γ2 [σ1 ]; ∆1 [σ1 ], (∀Γ3 .F3 )[σ1 ], ∆2 [σ1 ], F3 [σ][σ1 ] −→ F1 [σ1 ] Since ∀Γ3 .F3 is a closed term (an inductive hypothesis got from applying recur), we have (∀Γ3 .F3 )[σ1 ] = ∀Γ3 .F3 . The proof above is equivalent to D00 Γ10 , Γ2 [σ1 ]; ∆1 [σ1 ], ∀Γ3 .F3 , ∆2 [σ1 ], F3 [σ][σ1 ] D00 Γ10 , Γ2 [σ1 ]; ∆1 [σ1 ], ∀Γ3 .F3 , ∆2 [σ1 ], F3 [σ][σ1 ] −→ F1 [σ1 ] Γ10 , Γ2 [σ1 ]; ∆1 [σ1 ], ∀Γ3 .F3 , ∆2 [σ1 ] −→ F1 [σ1 ] ∀-L Γ10 , x : Ax [σ1 ], Γ2 [σ1 ]; ∆[σ1 ] −→ F [σ1 ] case For a constant c : ΠΓc .Ac in Σ, the unification problem becomes (Ax [σ1 ] = Ac , x = c Γc ), which is equivalent to (Ax = Ac , x = c Γc )[σ1 ] since σ1 does not contain variables in ΠΓc .Ac . If (Ax = Ac , x = c Γc ) does not have a solution, so does (Ax [σ1 ] = Ac , x = c Γc ). Thus we can apply the same signonuni rule in this case. If (Ax = Ac , x = c Γc ) has an mgu σ, according to the translation algorithm the original proof looks like: D1 Γ0 , Γ2 [σ]; ∆[σ] −→ F [σ] D0 Γ1 , Γ2 , Γ3 ; ∆ −→ F ∀-R Γ1 , Γ2 ; ∆ −→ ∀Γ3 .F D2 Γ1 , x : Ax , Γ2 ; ∆ −→Σ F Γ1 , x : Ax , Γ2 ; ∆ −→Σ,c:ΠΓc .Ac F siguni Γ0 ` σ : (Γ1 , x : Ax , Γc ) where σ = mgu(Ax = Ac , x = c Γc ) Because this is translated from splitting in output coverage checking, we have σ = (σid , (c Γc )[σc ]/x, σc ) and Γ0 = Γ1 , Γc0 according to Def. 16, where σid is an identity substitution for Γ1 and σc is the substitution for Γc . Since Γc is disjoint from Γ1 , we have Γ1 , Γc0 `Σ σc : Γc . The proof above is equivalent to By I.H, we have 00 D Γ10 , Γ2 [σ1 ], Γ3 [σ1 ]; ∆[σ1 ] −→ F [σ1 ] We conclude this case by applying ∀-R: Γ10 , Γ2 [σ1 ]; ∆[σ1 ] −→ (∀Γ3 .F )[σ1 ] Since σ1 only instantiate input variables and case rules are applied only on output variables, x and variables in Γ2 will not be instantiated by σ1 (but their types will). For a constant c : ΠΓc .Ac in Σ, we solve the unification problem (Ac = Ax , x = c Γc ). If it does not have a solution, signonuni is applied. If it has an mgu, siguni is applied. If it has an unifier but not an mgu, case rule is not applicable. Thus in a correct proof such as D, the last situation does rise. We prove that after the instantiation, the same rule can be applied to get a correct application of case rule. The application of case rule after unification looks like: Γ10 , x : Ax [σ1 ], Γ2 [σ1 ]; ∆[σ1 ] −→Σ F [σ1 ] Case: ∀-R. The proof looks like: D00 Γ10 , Γ2 [σ1 ], Γ3 [σ1 ]; ∆[σ1 ] −→ F [σ1 ] ∃-L D0 Γ1 , x : Ax , Γ2 ; ∆ −→Σ F case Γ1 , x : Ax , Γ2 ; ∆ −→ F −→ F1 [σ1 ] Let σ10 = (σ1 , σid ) where σid is an identity substitution such that Γ10 , Γ2 [σ1 ] `Σ σ10 : Γ1 , Γ2 . Applying Lemma. 1 to Γ10 , Γ2 [σ1 ] `Σ σ10 : Γ1 , Γ2 and Γ1 , Γ2 `Σ σ : Γ3 , we get Γ10 , Γ2 [σ1 ] `Σ σ ◦ σ10 : Γ3 [σ10 ]. Since Γ3 is closed, Γ3 [σ10 ] = Γ3 . We apply ∀-L to conclude this case, where D000 is the derivation for Γ10 , Γ2 [σ1 ] `Σ σ ◦ σ10 : Γ3 : D000 ∃Γ3 [σ1 ].> Case: case. This is the only non-trivial case. The proof looks like: Proof. By induction on the structure of D. According to the last rule used in D, there are the following cases: Case: ∀-L. The proof looks like Γ1 , Γ2 `Σ σ : Γ3 : Γ3 [σ1 ] D1 Γ1 , Γc0 , Γ2 [σ]; ∆ −→ F ∀-R Γ1 , x : Ax , Γ2 ; ∆ −→Σ,c:ΠΓc .Ac F Case: ∃-L. The proof looks like: D00 Γ10 , Γc0 , Γ2 [σ][σ1 ]; ∆[σ1 ] By I.H., we have D00 Γ10 , Γ2 [σ1 ], Γ3 [σ1 ]; ∆1 [σ1 ], ∃Γ3 [σ1 ].>, ∆2 [σ1 ] −→ F [σ1 ] We apply ∃-L to conclude this case: Γ10 , Γ2 [σ1 ]; ∆1 [σ1 ], ∃Γ3 [σ1 ].>, ∆2 [σ1 ] −→ F [σ1 ] siguni By applying I.H. to D1 , we get the following proof: D0 Γ1 , Γ2 , Γ3 ; ∆1 , ∃Γ3 .>, ∆2 −→ F ∃-L Γ1 , Γ2 ; ∆1 , ∃Γ3 .>, ∆2 −→ F D00 Γ10 , Γ2 [σ1 ], Γ3 [σ1 ]; ∆1 [σ1 ], ∃Γ3 [σ1 ].>, ∆2 [σ1 ] −→ F [σ1 ] D2 Γ1 , x : Ax , Γ2 ; ∆ −→Σ F ∃-L Case: ∃-R. The proof looks like: Γ1 , Γ2 ` σ : Γ3 ∃-R Γ1 , Γ2 ; ∆ −→ ∃Γ3 .> Let σ10 = (σ1 , σid ) where σid is an identity substitution such that Γ10 , Γ2 [σ1 ] `Σ σ10 : Γ1 , Γ2 . Applying Lemma. 1 to Γ10 , Γ2 [σ1 ] `Σ σ10 : Γ1 , Γ2 and Γ1 , Γ2 `Σ σ : Γ3 , we have −→ F [σ1 ] Let σ10 = (σ1 , σid ) such that Γ10 , Γc0 `Σ σ10 : (Γ1 , Γc0 ), we have Γ10 , Γc0 `Σ σc ◦ σ10 : Γc . Let σ 0 = (σid , (c Γc )[σc ◦ σ10 ]/x, σc ◦ σ10 ) Γ10 , Γc0 such that `Σ σ 0 : (Γ10 , x : Ax [σ1 ], Γc ). If σ 0 is an mgu for (Ax [σ1 ] = Ac , x = c Γc ), then we get a proof after instantiation using siguni rule: D00 Γ10 , Γc0 , Γ2 [σ1 ][σ 0 ]; ∆[σ1 ] −→ F [σ1 ] Γ10 , x D20 : Ax [σ1 ], Γ2 [σ1 ]; ∆[σ1 ] −→Σ,c:ΠΓc .Ac F [σ1 ] siguni where D20 is the rest of the instantiated proof. Here we use the fact that Γ2 [σ][σ1 ] = Γ2 [(σ1 , (c Γc )[σc ◦ σ10 ]/x, σc ◦ σ10 )] = Γ2 [σ1 ][σ 0 ]. We then prove that σ 0 is indeed an mgu for (Ax [σ1 ] = Ac , x = c Γc ). 1. σ 0 is a unifier. Since σ is an mgu for (Ax = Ac , x = c Γc ), we have Ax [σ] = Ac [σ] which is equivalent to Ax = Ac [σc ]. Thus Ax [σ1 ][σ 0 ] = Ax [σ1 ] = Ac [σc ][σ1 ] = Ac [σc ◦ σ10 ] = Ac [σ 0 ]. Also x[σ 0 ] = (c Γc )[σc ◦ σ10 ] = (c Γc )[σ 0 ]. 2. σ 0 is an mgu. Let σ2 = (σ12 , M/x, σc2 ) be a unifier for (Ax [σ1 ] = Ac , x = c Γc ) such that Γ2 `Σ σ2 : (Γ10 , x : Ax [σ1 ], Γc ). Let σ100 = (σ1 , σid ) such that Γ10 , x : Ax [σ1 ], Γc `Σ σ100 : (Γ1 , x : Ax , Γc ). We have σ100 ◦ σ2 as a unifer for (Ax = Ac , x = c Γc ) such that Γ2 `Σ σ100 ◦ σ2 : (Γ1 , x : Ax , Γc ). Since σ is an mgu for (Ax = Ac , x = c Γc ), there exists some σ3 = (σ13 , σc3 ) such that Γ2 `Σ σ3 : (Γ1 , Γc0 ) and σ◦σ3 = σ100 ◦σ2 . From σ◦σ3 = σ100 ◦σ2 , we have σ13 = σ1 ◦ σ12 and σc ◦ σ3 = σc2 . Letting σ4 = (σ12 , σc3 ), we prove that σ2 = σ 0 ◦ σ4 . For this we need to prove the following: • σ12 = σid ◦ σ4 . This is obvious. • σc2 = (σc ◦σ10 )◦σ4 . We have σ10 ◦σ4 = (σ1 ◦σ12 , σc3 ) = (σ13 , σc3 ) = σ3 . Thus σc2 = σc ◦ σ3 = σc ◦ (σ10 ◦ σ4 ) = (σc ◦ σ10 ) ◦ σ4 . • M = (c Γc )[σc ◦ σ10 ][σ4 ]. Since x[σ2 ] = (c Γc )[σ2 ], i.e., M = (c Γc )[σ2 ], we have M = (c Γc )[σc2 ] = (c Γc )[(σc ◦ σ10 ) ◦ σ4 ] = (c Γc )[σc ◦ σ10 ][σ4 ] Thus, for any unifier σ2 for (Ax [σ2 ] = Ac , x = c Γc ) there exists a substitution σ4 such that σ2 = σ 0 ◦ σ4 . We conclude that σ 0 is an mgu for (Ax [σ2 ] = Ac , x = c Γc ).
6cs.PL
Proceedings of the 8th Python in Science Conference (SciPy 2009) PaPy: Parallel and distributed data-processing pipelines in Python Marcin Cieślik ([email protected]) – University of Virginia, U.S. Cameron Mura ([email protected]) – University of Virginia, U.S. PaPy, which stands for parallel pipelines in Python, is a highly flexible framework that enables the construction of robust, scalable workflows for either generating or processing voluminous datasets. A workflow is created from user-written Python functions (nodes) connected by ’pipes’ (edges) into a directed acyclic graph. These functions are arbitrarily definable, and can make use of any Python modules or external binaries. Given a user-defined topology and collection of input data, functions are composed into nested higher-order maps, which are transparently and robustly evaluated in parallel on a single computer or on remote hosts. Local and remote computational resources can be flexibly pooled and assigned to functional nodes, thereby allowing facile load-balancing and pipeline optimization to maximimize computational throughput. Input items are processed by nodes in parallel, and traverse the graph in batches of adjustable size - a trade-off between lazy-evaluation, parallelism, and memory consumption. The processing of a single item can be parallelized in a scatter/gather scheme. The simplicity and flexibility of distributed workflows using PaPy bridges the gap between desktop -> grid, enabling this new computing paradigm to be leveraged in the processing of large scientific datasets. Introduction Computationally-intense fields ranging from astronomy to chemoinformatics to computational biology typically involve complex workflows of data production or aggregation, processing, and analysis. Several fundamentally different forms of data - sequence strings (text files), coordinates (and coordinate trajectories), images, interaction maps, microarray data, videos, arrays - may exist in distinct file formats, and are typically processed using available tools. Inputs/outputs are generally linked (if at all) via intermediary files in the context of some automated build software or scripts. The recently exponential growth of datasets generated by high-throughput scientific approaches (e.g. structural genomics [TeStYo09]) or high-performance parallel computing methods (e.g. molecular dynamics [KlLiDr09]) necessitates more flexible and scalable tools at the consumer end, enabling, for instance, the leveraging of multiple CPU cores and computational grids. However, using files to communicate and synchronize processes is generally inconvenient and inefficient, particularly if specialized scientific Python modules (e.g., BioPython [CoAnCh09], 41 PyCogent [Knight07], Cinfony [OBHu08], MMTK [Hinsen00], Biskit [GrNiLe07]) are to be used. Many computational tasks fundamentally consist of chained transformations of collections of data that are independent, and likely of variable type (strings, images, etc.). The scientific programmer is required to write transformation steps, connect them and - for large datasets to be feasible - parallelize the processing. Solutions to this problem generally can be divided into: (i) Make-like software build tools, (ii) workflow management systems (WMS), or (iii) grid engines and frontends. PaPy, which stands for parallel pipelines in Python, is a module for processing arbitrary streams of data (files, records, simulation frames, images, videos, etc.) via functions connected into directed graphs (flowcharts) like a WMS. It is not a parallel computing paradigm like MapReduce [DeGh08] or BSP [SkHiMc96], nor is it a dependency-handling build tool like Scons [Knight05]. Neither does it support declarative programming [Lloyd94]. In a nutshell, PaPy is a tool that makes it easy to structure procedural workflows into Python scripts. The tasks and data are composed into nested higher-order map functions, which are transparently and robustly evaluated in parallel on a single computer or remote hosts. Workflow management solutions typically provide a means to connect standardized tasks via a structured, well-defined data format to construct a workflow. For transformations outside the default repertoire of the program, the user must program a custom task with inputs and outputs in some particular (WMS-specific) format. This, then, limits the general capability of a WMS in utilizing available codes to perform nonstandard or computationally-demanding analyses. Examples of existing frameworks for constructing dataprocessing pipelines include Taverna (focused on webservices; run locally [OiAdFe04]), DAGMan (general; part of the Condor workload management system [ThTaLi05]) and Cyrille2 (focused on genomics; run on SGE clusters [Ham08]). A typical drawback of integrated WMS solutions such as the above is that, for tasks which are not in the standard repertoire of the program, the user has to either develop a custom task or revert to traditional scripting for parts of the pipeline; while such an approach offers an immediate solution, it is not easily sustainable, scalable, or adaptable, insofar as the processing logic becomes hardwired into these script-based workflows. In PaPy, pipelines are constructed from Python functions with strict call semantics. Most general-purpose functions to support input/output, databases, interprocess communication (IPC), serialization, topology, and mathematics are already a part of PaPy. Domainspecific functions (e.g. parsing a specific file-format) M. Cieślik, C. Murain Proc. SciPy 2009, G. Varoquaux, S. van der Walt, J. Millman (Eds), pp. 41–48 PaPy: Parallel and distributed data-processing pipelines in Python must be user-provided, but have no limitations as to functional complexity, used libraries, called binaries or web-services, etc. Therefore, as a general pipeline construction tool, PaPy is intentionally lightweight, and is entirely agnostic of specific application domains. Our approach with PaPy is a highly modular workflowengine, which neither enforces a particular dataexchange or restricted programming model, nor is tied to a single, specific application domain. This level of abstraction enables existing code-bases to be easily wrapped into a PaPy pipeline and benefit from its robustness to exceptions, logging, and parallelism. Architecture and design PaPy is a Python module “papy” written to enable the logical design and deployment of efficient dataprocessing pipelines. Central design goals were to make the framework (i) natively parallel, (ii) flexible, (iii) robust, (iv) free of idiosyncrasies and dependencies, and (v) easily usable. Therefore, PaPy’s modular, object-oriented architecture utilizes familiar concepts such as map constructs from functional programming, and directed acyclic graphs. Parallelism is achieved through the shared worker-pool model [Sunderam90]. The architecture of PaPy is remarkably simple, yet flexible. It consists of only four core component classes to enable construction of a data-processing pipeline. Each class provides an isolated subset of the functionality [Table1], which together includes facilities for arbitrary flow-chart topology, execution (serial, parallel, distributed), user function wrapping, and runtime interactions (e.g. logging). The pipeline is a way of expressing what (functions), where (toplogy) and how (parallelism) a collection of (potentially interdependent) calculations should be performed. Table 1: Components (classes) and their roles. Component IMap1 Piper Worker Dagger Plumber Description and function Implements a process/thread pool. Evaluates multiple, nested map functions in parallel, using a mixture of threads or processes (locally) and, optionally, remote RPyC servers. Processing nodes of the pipeline created by wrapping user-defined functions; also, exception handling, logging, and scattergather functionality. Defines the data-flow and the pipeline in the form of a directed acyclic graph (DAG); allows one to add, remove, connect pipers, and validate topology. Coordinates the starting/stopping of IMaps. Interface to monitor and run a pipeline; provides methods to save/load pipelines, monitor state, save results. c 2009, M. Cieślik, C. Mura Pipelines (see Figure 1) are constructed by connecting functional units (Piper instances) by directed pipes, and are represented as a directed acyclic graph data structure (Dagger instance). The pipers correspond to nodes and the pipes to edges in a graph. The topological sort of this graph reflects the input/output dependencies of the pipers, and it is worth noting that any valid DAG is a valid PaPy pipeline topology (e.g., pipers can have multiple incoming and outgoing pipes, and the pipeline can have multiple inputs and outputs). A pipeline input consists of an iterable collection of data items, e.g. a list. PaPy does not utilize a custom file format to store a pipeline; instead, pipelines are constructed and saved as executable Python code. The PaPy module can be arbitrarily used within a Python script, although some helpful and relevant conventions to construct a workflow script are described in the online documentation. The functionality of a piper is defined by user-written functions, which are Python functions with strict call semantics. There are no limits as to what a function does, apart from the requirement that any modules it utilizes must be available on the remote execution hosts (if utilizing RPyC). A function can be used by multiple pipers, and multiple functions can be composed within a single piper. CPU-intensive tasks with little input data (e.g., MD simulations, collision detection, graph matching) are preferred because of the high speed-up through parallel execution. Within a PaPy pipeline, data are shared as Python objects; this is in contrast to workflow management solutions (e.g., Taverna) that typically enforce a specific data exchange scheme. The user has the choice to use any or none of the structured data-exchange formats, provided the tools for using them are available for Python. Communicated Python objects need to be serializable, by default using the standard Pickle protocol. Synchronization and data communication between pipers within a pipeline is achieved by virtue of queues and locked pipes. No outputs or intermediate results are implicitly stored, in contrast to usage of temporary files by Make-like software. Data can be saved anywhere within the pipeline by using pipers for data serialization (e.g. JSON) and archiving (e.g. file-based). PaPy maintains data integrity in the sense that an executing pipeline stopped by the user will have no pending (lost) results. Parallelism Parallel execution is a major issue for workflows, particularly (i) those involving highly CPU-intensive methods like MD simulations or Monte Carlo sampling, or (ii) those dealing with large datasets (such as arise in astrophysics, genomics, etc.). PaPy provides 1 Note that the IMap class is available as a separate Python module. 42 Proceedings of the 8th Python in Science Conference (SciPy 2009) support for two levels of parallelism, which adress both of these scenarios: (1) parallel processing of independent input data items, (2) multiple parallel jobs for a single input item. The first type of parallelism is achieved by creating parallel pipers - i.e. providing an IMap instance to the constructor. Pipers within a pipeline can share an IMap instance or have dedicated computational resources (Fig. 1). The mixing of serial and parallel pipers is supported; this flexibility permits intelligent pipeline load-balancing and optimization. Per-item parallel jobs are made possible by the produce / spawn / consume (Fig. 2) idiom within a workflow. This idiom consists of at least three pipers. The role of the first piper is to produce a list of N subitems for each input item. Each of those subitems is processed by the next piper, which needs to be spawned N times; finally, the N results are consumed by the last piper, which returns a single result. Multiple spawning pipers are supported. The subitems are typically independent fragments of the input item or parameter sets. Per-item parallelism is similar to the MapReduce model of distributed computing, but is not restricted to handling only data structured as (key, value) pairs. Figure 1. (A) PaPy pipeline and its (B) computational resources. The directed graph illustrates the Dagger object as a container of Piper objects (nodes), connected by pipes (black arrows; in the upstream / downstream sense) or, equivalently, dependency edges (gray arrows). Pipers are assigned to various compute resources as indicated by different colors. The sets of pipes connecting the two processing streams illustrate the flexible construction of workflows. Encapsulation and composition of user-written functions e.g., f, g into a Worker and Piper object is represented as P(W(f,g,...)). Resources used by the sample pipeline are shown in B. Each virtual resource is an IMap object, which utilizes a worker pool to evaluate the Worker on a data item. IMaps are shared by pipers and might share resources. The resources are: a local pool of 20 threads used by a single piper in the pipeline (green); four CPU-cores, of which at most three are used concurrently (red) and one dedicated to handle the input/output functions (yellow); and a pool of Python processes utilizing remote resources exposedby RPyC servers (blue cloud). Parallelism is achieved by pulling data through the pipeline in adjustable batches. 43 Figure 2. The produce / spawn / consume idiom allows for parallel processing of a single input item in addition to parallel processing of items (explanation in text). The parallelism of an IMap instance is defined by the number of local and remote worker processes or threads, and the “stride” argument (Fig. 3), if it processes multiple tasks. The “stride” is the number of input items of task N processed before task N+1 commences. Tasks are cycled until all input items have been processed. In a PaPy pipeline pipers can share a computational resource; they are different tasks of a single IMap instance. The “stride” can also be considered as the number of input items processed by pipers in consecutive rounds, with the order defined by a topological sort of the graph. Therefore, the data traverses the pipeline in batches of “stride” size. A larger “stride” means that potentially more temporary results will have to be held in memory, while a smaller value may result in idle CPUs, as a new task cannot start until the previous one finishes its “stride”. This adjustable memory/parallelism trade-off allows PaPy pipelines to process data sets with temporary results http://conference.scipy.org/proceedings/SciPy2009/paper_6 PaPy: Parallel and distributed data-processing pipelines in Python too large to fit into memory (or to be stored as files), and to cope with highly variable execution times for input items (a common scenario on a heterogenous grid, and which would arise for certain types of tasks, such as replica-exchange MD simulations). Figure 3. The stride as a trade-off between memory consumption and parallelism of execution. Rectangular boxes represent graph traversal in batches. The pipers involved (N-1, N, N+2) are shown on the right (explanation in text). Inter-process communication A major aspect - and often bottleneck - of parallel computing is inter-process communication (IPC; Fig. 4) [LiYa00]. In PaPy, IPC occurs between parallel pipers connected in a workflow. The communication process is two-stage and involves a manager process - i.e, the local Python interpreter used to start the workflow (Fig. 4). A coordinating process is necessary because the connected nodes might evaluate functions in processes with no parent/child relationship. If communication occurs between processes on different hosts, an additional step of IPC (involving a local and a remote RPyC process) is present. Inter-process communication involves data serialization (i.e. representation in a form which can be sent or stored), the actual data-transmission (e.g. over a network socket) and, finally, de-serialization on the recipient end. Because the local manager process is involved in serializing (deserializing) data to (from) each parallel process, it can clearly limit pipeline performance if large amounts of data are to be communicated. of producer and consumer processes, thereby mostly eliminating the manager process from IPC and alleviating the bottleneck described above. Multiple serialization and transmission media are supported. In general, the producer makes data available (e.g. by serializing it and opening a network socket) and sends only information needed by the consumer end to locate the data (e.g. the host and port of the network socket) via the manager process. The consumer end receives this information and reads the data. Direct communication comes at the cost of losing platform-independence, as the operating system(s) have to properly support the chosen transmission medium (e.g. Unix pipes). Table 2 summarizes PaPy’s currently available options. Table 2: Direct inter-process communication methods.2 Method OS socket all pipe file UNIXlike all shm POSIX database all Remarks Communication between hosts connected by a network. Communication between processes on a single host. The storage location needs to be accessible by all processes - e.g over NFS or a SAMBA share. Shared memory support is provided by the posix_shm library; it is an alternative to communication by pipes. Serialized data can be stored as (key, value) pairs in a database. The keys are semi-random. Currently SQLite and MySQL are supported, as provided by mysql-python and sqlite3. Note that it is possible to avoid some IPC by logically grouping processing steps within a single piper. This is done by constructing a single piper instance from a worker instance created from a tuple of user-written functions, instead of constructing multiple piper instances from single function worker instances. A worker instance is a callable object passed to the constructor of the Piper class. Also, note that any linear, non-branching segment of a pipeline can be collapsed into a single piper. This has the performance advantage that no IPC occurs between functions within a single piper, as they are executed in the same process. Additional features and notes Workflow logging Figure 4. Inter-process communication (IPC) between pipers (p1, p2). The dashed arrow illustrates possible direct IPC. Communication between the local and remote processes utilizes RPyC (explanation in text). PaPy provides support for detailed workflow logging and is robust to exceptions (errors) within user-written 2 Currently supported serialization algorithms: pickle, marshall, JSON PaPy provides functionality for direct communication c 2009, M. Cieślik, C. Mura 44 Proceedings of the 8th Python in Science Conference (SciPy 2009) functions. These two features have been a major design goal. Robustness is achieved by embedding calls to user functions in a try ... except clause. If an exception is raised, it is caught and does not stop the execution of the workflow (rather, it is wrapped and passed as a placeholder). Subsequent pipers ignore and propagate such objects. Logging is supported via the logging module from the Python standard library. The papy and IMap packages emit logging statements at several levels of detail, i.e. DEBUG, INFO, ERROR; additionally, a function to easily setup and save or display logs is included. The log is written realtime, and can be used to monitor the execution of a workflow. Usage notes A started parallel piper consumes a sequence of N input items (where N is defined by the “stride” argument), and produces a sequence of N resultant items. Pipers are by default “ordered”, meaning that an input item and its corresponding result item have the same index in both sequences. The order in which result items become available may differ from the order input items are submitted for parallel processing. In a pipeline, result items of an upstream piper are input items for a downstream piper. The downstream piper can process input items only as fast as result items are produced by the upstream piper. Thus, an inefficency arises if the upstream piper does not return an available result because it is out of order. This results in idle processes, and the problem can be addressed by using a “stride” larger then the number of processes, or by allowing the upstream piper to return results in the order they become available. The first solution results in higher memory consumption, while the second irreversibly abolishes the original order of input data. Graphical interface As a Python package, PaPy’s main purpose is to supply and expose an API for the abstraction of a parallel workflow. This has the advantage of flexibility (e.g. usage within other Python programs), but requires that the programmer learn the API. A graphical user interface (GUI) is currently being actively developed (Fig. 5). The motivation for this functionality is to allow a user to interactively construct, execute (e.g. pause execution), and monitor (e.g. view logs) a workflow. While custom functions will still have to be written in Python, the GUI liberates the user from knowing the specifics of the PaPy API; instead, the user explores the construction of PaPy workflows by connecting objects via navigation in the GUI. Workflow construction example The following code listing illustrates steps in the construction of a distributed PaPy pipeline. The first of the two nodes evaluates a function (which simply determines the host on which it is run), and the second prints the result locally. The first piper is assigned to a virtual resource combining local and remote processes. The scripts take two command line arguments: a definition of the available remote hosts and a switch for using TCP sockets for direct inter-process communication between the pipers. The source code uses the imports decorator. This construct allows import statements to be attached to the code of a function. As noted earlier, the imported modules must be available on all hosts on which this function is run. The pipeline is started, for example, via: $ python pipeline.py \ --workers=HOST1:PORT1#2,HOST2:PORT1#4 which uses 2 processes on HOST1 and 4 on HOST2, and all locally-available CPUs. Remote hosts can be started (assuming appropriate firewall settings) by: $ python RPYC_PATH/servers/classic_server.py \ -m forking -p PORT This starts a RPyC server listening on the specified PORT, which forks whenever a client connects. A forking server is capable of utilizing multiple CPU cores. The following example (in expanded form) is provided as part of PaPy’s online documentation.: Figure 5. A screenshot of the PaPy GUI written in Tkinter. Includes an interactive Python console and an intuitive canvas to construct workflows. 45 http://conference.scipy.org/proceedings/SciPy2009/paper_6 PaPy: Parallel and distributed data-processing pipelines in Python #!/usr/bin/env python # Part 0: import the PaPy infrastructure. # papy and IMap are separate modules from papy import Plumber, Piper, Worker from IMap import IMap, imports from papy import workers Discussion and conclusions In the context of PaPy, the factors dictating the computational efficiency of a user’s pipeline are the nature of the individual functions (nodes, pipers), and the nature of the data linkages between the constituent nodes in the graph (edges, pipes). Although distributed and parallel computing methods are becoming ubiquitous in many scientific domains (e.g., biologically meaningful usec-scale MD simulations [KlLiDrSh09]), data post-processing and analysis are not keeping pace, and will become only increasingly difficult on desktop workstations. It is expected that the intrinsic flexibility underly# Part 2: Define the topology ing PaPy’s design, and its easy resource distribution, def pipeline(remote, use_tcp): could make it a useful component in the scientist’s # this creates a IMap instance which uses #’remote’ hosts. data-reduction toolkit. It should be noted that some imap_ = IMap(worker_num=0, worker_remote=remote) data-generation workflows might also be expressible as # this defines the communication protocol i.e. pipelines. For instance, parallel tempering / replica# it creates worker instances with or without exchange MD [EaDe05] and multiple-walker metady# explicit load_item functions. if not use_tcp: namics [Raiteri06] are examples of intrinsically parw_where = Worker(where) allelizable algorithms for exploration and reconstrucw_print = Worker(workers.io.print_) tion of free energy surfaces of sufficient granularity. In else: w_where = Worker((where, workers.io.dump_item), \those computational contexts, PaPy could be used to kwargs=({}, {’type’:’tcp’})) orchestrate data generation as well as data aggregation w_print = Worker((workers.io.load_item, \ / reduction / analysis. workers.io.print_)) # the instances are combined into a piper instance In conclusion, we have designed and implemented p_where = Piper(w_where, parallel=imap_) PaPy, a workflow-engine for the Python programming p_print = Piper(w_print, debug=True) language. PaPy’s features and capabilities include: (1) # piper instances are assembled into a workflow construction of arbitrarily complex pipelines; (2) flex# (nodes of the graph) ible tuning of local and remote parallelism; (3) specifipipes = Plumber() pipes.add_pipe((p_where, p_print)) cation of shared local and remote resources; (4) versareturn pipes tile handling of inter-process communication; and (5) an adjustable laziness/parallelism/memory trade-off. # Part 3: execute the pipeline In terms of usability and other strengths, we note that if __name__ == ’__main__’: # get command-line arguments using getopt PaPy exhibits (1) robustness to exceptions; (2) grace# following part of the code is not PaPy specific ful support for time-outs; (3) real-time logging func# and has the purpose of interpreting commandline tionality; (4) cross-platform interoperability; (5) ex# arguments. import sys tensive testing and documentation (a 60+ page manfrom getopt import getopt ual); and (6) a simple, object-oriented API accompaargs = dict(getopt(sys.argv[1:], ’’, [’use_tcp=’, \ nied by a preliminary version of a GUI. ’workers=’])[0]) # Part 1: Define user functions @imports([’socket’, ’os’, ’threading’]) def where(inbox): result = "input: %s, host:%s, parent %s, \ process:%s, thread:%s" % \ (inbox[0], \ socket.gethostname(), \ # the host name as reported by the OS os.getppid(), \ # get parent process id os.getpid(), \ # get process id threading._get_ident()) # unique python thread identifier return result # parse arguments use_tcp = eval(args[’--use_tcp’]) # bool remote = args[’--workers’] remote = worker_remote.split(’,’) remote = [hn.split(’#’) for hn in remote] remote = [(h, int(n)) for h, n in remote] # create pipeline (see comments in function) pipes = pipeline(remote, use_tcp) # execution # the input to the function is a list of 100 # integers. pipes.start([range(100)]) # this starts the pipeline execution pipes.run() # wait until all input items are processed pipes.wait() # pause and stop (a running pipeline cannot # be stopped) pipes.pause() pipes.stop() # print execution statistics print pipes.stats c 2009, M. Cieślik, C. Mura Availability PaPy is distributed as an open-source, platform- independent Python (CPython 2.6) module at http: //muralab.org/PaPy, where extensive documentation also can be found. It is easily installed via the Python Package Index (PyPI) at http:// pypi.python.org/pypi/papy/ using setuptools by easy_install papy. Acknowledgements We thank the University of Virginia for start-up funds in support of this research. 46 Proceedings of the 8th Python in Science Conference (SciPy 2009) References [TeStYo09] [KlLiDr09] [CoAnCh09] [Knight07] [OBHu08] [Hinsen00] [GrNiLe07] [OiAdFe04] [ThTaLi05] 47 Terwilliger TC, Stuart D, Yokoyama S “Lessons from structural genomics” Ann.Rev. Biophys. (2009), 38, 371-83. Klepeis JL, Lindorff-Larsen K, Dror RO, Shaw DE “Long-timescale molecular dynamics simulations of protein structure and function” Current Opinions in Structural Biology (2009), 19(2), 120-7. Cock PJ, Antao T, Chang JT, et al. “Biopython: freely available Python tools for computational molecular biology and bioinformatics” Bioinformatics (2009), 25(11), 1422-3. Knight, R et al. “PyCogent: a toolkit for making sense from sequence” Genome Biology (2007), 8(8), R171 O’Boyle NM, Hutchison GR “Cinfony combining Open Source cheminformatics toolkits behind a common interface” Chemistry Central Journal (2008), 2, 24. Hinsen K “The Molecular Modeling Toolkit: A New Approach to Molecular Simulations” Journal of Computational Chemistry (2000), 21, 79-85. Grünberg R, Nilges M, Leckner J “Biskit-a software platform for structural bioinformatics” Bioinformatics (2007), 23(6), 769-70. Oinn T, Addis M, Ferris J, et al. “Taverna: a tool for the composition and enactment of bioinformatics workflows” Bioinformatics (2004), 20(17), 3045-54. Thain D, Tannenbaum T, Livny M, “Distributed Computing in Practice: The Condor Experience” Concurrency and Computation: Practice and Experience (2005), [Ham08] [DeGh08] [EaDe05] [Raiteri06] [LiYa00] [SkHiMc96] [Knight05] [Lloyd94] [Sunderam90] [KlLiDrSh09] 17, 2-4, 323-356. Fiers MW, van der Burgt A, Datema E, de Groot JC, van Ham RC “High-throughput bioinformatics with the Cyrille2 pipeline system” BMC Bioinformatics (2008), 9, 96. Dean J, Ghemawat S “MapReduce: Simplified Data Processing on Large Clusters” Comm. of the ACM (2008), 51, 107-113. Earl, D. J. and M. W. Deem “Parallel tempering: Theory, applications, and new perspectives” Phys. Chem. Chem. Phys. (2005) 7(23), 3910-3916. Raiteri P, Laio A, Gervasio FL, Micheletti C, Parrinello M. J J Phys Chem B. (2006), 110(8), 3533-9. Liu, P., Yang, C. “Locality-Preserving Dynamic Load Balancing for Data-Parallel Applications on Distributed-Memory Multiprocessors.”“ (2000) Skillicorn, D. B., Hill, J. M. D. & Mccoll, W. F. ”Questions and answers about BSP“ (1996). Knight S, ”Building Software with SCons,“ Computing in Science and Engineering (2005), 7(1), 79-88. Lloyd JW, ”Practical advantages of declarative programming“ (1994) Sunderam V.S. ”PVM: A framework for parallel distributed computing“ Concurrency: Practice and Experience (1990), 2, 4, 315-339 Klepeis JL, Lindorff-Larsen K, Dror RO, Shaw DE ”Long-timescale molecular dynamics simulations of protein structure and function“ Curr. Opin. Struc. Biol. (2009), 19(2), 120-7. http://conference.scipy.org/proceedings/SciPy2009/paper_6
6cs.PL
Provable and practical approximations for the degree distribution using sublinear graph samples∗ Talya Eden School of Computer Science, Tel Aviv University Tel Aviv, Israel [email protected] Shweta Jain University of California, Santa Cruz Santa Cruz, CA, USA [email protected] arXiv:1710.08607v2 [cs.SI] 19 Jan 2018 Dana Ron School of Computer Science, Tel Aviv University Tel Aviv, Israel [email protected] Ali Pinar Sandia National Laboratories Livermore, CA [email protected] C. Seshadhri University of California, Santa Cruz Santa Cruz, CA [email protected] ABSTRACT 1 The degree distribution is one of the most fundamental properties used in the analysis of massive graphs. There is a large literature on graph sampling, where the goal is to estimate properties (especially the degree distribution) of a large graph through a small, random sample. The degree distribution estimation poses a significant challenge, due to its heavy-tailed nature and the large variance in degrees. We design a new algorithm, SADDLES, for this problem, using recent mathematical techniques from the field of sublinear algorithms. The SADDLES algorithm gives provably accurate outputs for all values of the degree distribution. For the analysis, we define two fatness measures of the degree distribution, called the h-index and the z-index. We prove that SADDLES is sublinear in the graph size when these indices are large. A corollary of this result is a provably sublinear algorithm for any degree distribution bounded below by a power law. We deploy our new algorithm on a variety of real datasets and demonstrate its excellent empirical behavior. In all instances, we get extremely accurate approximations for all values in the degree distribution by observing at most 1% of the vertices. This is a major improvement over the state-of-the-art sampling algorithms, which typically sample more than 10% of the vertices to give comparable results. We also observe that the h and z-indices of real graphs are large, validating our theoretical analysis. In domains as diverse as social sciences, biology, physics, cybersecurity, graphs are used to represent entities and the relationships between them. This has led to the explosive growth of network science as a discipline over the past decade. One of the hallmarks of network science is the occurrence of specific graph properties that are common to varying domains, such as heavy tailed degree distributions, large clustering coefficients, and small-world behavior. Arguably, the most significant among these properties is the degree distribution, whose study led to the foundation of network science [7, 8, 20]. Given an undirected graph G, the degree distribution (or technically, histogram) is the sequence of numbers n(1), n(2), . . ., where n(d) is the number of vertices of degree d. In almost all real-world scenarios, the average degree is small, but the variance (and higher moments) is large. Even for relatively large d, n(d) is still non-zero, and n(d) typically has a smooth non-increasing behavior. In Fig. 1, we see the typical degree distribution behavior. The average degree in a Google web network is less than 10, but the maximum degree is more than 5000. There are also numerous vertices with all intermediate degrees. This is referred to as a “heavy tailed” distribution. The degree distribution, especially the tail, is of significant relevance to modeling networks, determining their resilience, spread of information, and for algorithmics [6, 9, 13, 16, 33–36, 42]. With full access to G, the degree distribution can be computed in linear time, by simply determining the degree of each vertex. Yet in many scenarios, we only have partial access to the graph, provided through some graph samples. A naive extrapolation of the degree distribution can result in biased results. The seminal research paper of Faloutsos et al. claimed a power law in the degree distribution on the Internet [20]. This degree distribution was deduced by measuring a power law distribution in the graph sample generated by a collection of traceroute queries on a set of routers. Unfortunately, it was mathematically and empirically proven that traceroute responses can have a power law even if the true network does not [1, 11, 27, 37]. In general, a direct extrapolation of the degree distribution from a graph subsample is not valid for the ACM Reference format: Talya Eden, Shweta Jain, Ali Pinar, Dana Ron, and C. Seshadhri. 2016. Provable and practical approximations for the degree distribution using sublinear graph samples. In Proceedings of , , , 12 pages. DOI: ∗ Both Talya Eden and Shweta Jain contributed equally to this work, and are joint first authors of this work. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the owner/author(s). , © 2016 Copyright held by the owner/author(s). . DOI: INTRODUCTION The Hidden Degrees Model (HDM) Vertex and neighbor queries allowed, not degree queries: This is a substantially weaker model. In numerous cybersecurity and network monitoring settings, an algorithm cannot query for degrees, and has to infer them indirectly. Observe that this model is significantly harder than the standard model. It takes O((m + n) log n) to determine all the degrees, since one has to at least visit all the edges to find degrees exactly. In this model, we express the number of queries as a fraction of m. We stress that other query models are possible. Recent work of Dasgupta, Kumar, and Sarlos argues that vertex queries are too powerful, especially in social network contexts [14]. In their query model, a small set of random seeds are provided, but only neighbor and degree queries are subsequently allowed. underlying graph. This leads to the primary question behind our work. How can we provably and practically estimate the degree distribution without seeing the entire graph? There is a rich literature in statistics, data mining, and physics on estimating graph properties (especially the degree distribution) using a small subsample [2, 3, 5, 17, 28, 30, 31, 39, 46, 47]. Nonetheless, there is no provable algorithm for the entire degree distribution, with a formal analysis on when it is sublinear in the number of vertices. Furthermore, most empirical studies typically sample 10-30% of the vertices for reasonable estimates. 1.1 Problem description We focus on the complementary cumulative degree histogram (often called the cumulative degree distribution) or ccdh of G. This is Í the sequence {N (d)}, where N (d) = r ≥d n(r ). The ccdh is typically used for fitting distributions, since it averages out noise and is monotonic [12]. Our aim is to get an accurate bicriteria approximation to the ccdh of G, at all values of d. 1.2 Our contributions Our main theoretical result is a new sampling algorithm, the Sublinear Approximations for Degree Distributions Leveraging Edge Samples, or SADDLES. This algorithm provably provides (ε, δ )-approximations for the ccdh. We show how to design SADDLES under both the Standard Model and the Hidden Degrees Model. We apply SADDLES on a variety of real datasets and demonstrate its ability to accurately approximate the ccdh with a tiny sample of the graph. • Sampling algorithm for estimating ccdh: Our algorithm combines a number of techniques in random sampling to get (ε, δ )-estimates for the ccdh. A crucial component is an application of an edge simulation technique, first devised by Eden et al. in the context of triangle counting [18, 19]. This (theoretical) technique shows how to get a collection of weakly correlated uniform random edges from independent uniform vertices. SADDLES employs a weighting scheme on top of this method to estimate the ccdh. • Heavy tails leads to sublinear algorithms: The challenge in analyzing SADDLES is in finding parameters of the ccdh that allow for sublinear query complexity. To that end, we discuss two parameters that measure “heaviness” of the distribution tail: the classic h-index and a newly defined z-index. We prove that the running time of SADDLES is sublinear (for both models) whenever these indices are large. This yields a provably sublinear time algorithm to get accurate (ε, δ )-estimates for the ccdh. • Excellent empirical behavior: We deploy an implementation of SADDLES on a collection of large real-world graphs. In all instances, we achieve extremely accurate estimates for the entire ccdh by sampling at most 1% of the vertices of the graph. Refer to Fig. 1. Observe how SADDLES tracks various jumps in the ccdh, for both graphs in Fig. 1. • Comparison with existing sampling methods: A number of graph sampling methods have been proposed in practice, such as vertex sampling, snowball sampling, forest-fire sampling, induced graph sampling, random walk, edge sampling [5, 17, 28, 30, 38, 39, 47]. A recent work of Zhang et al. explicitly addresses biases in these sampling methods, and fixes them using optimization techniques [47]. We run head-to-head comparisons with all these sampling methods, and demonstrate the SADDLES gives significantly better practical performance. Fig. 1 shows the output of all these sampling methods with a total sample size of 1% of e(d)} is an (ε, δ )-estimate of the Definition 1.1. The sequence {N e(d) ≤ (1 + δ )N ((1 − ε)d). ccdh if ∀d, (1 − δ )N ((1 + ε)d) ≤ N Computing an (ε, δ )-estimate is significantly harder than approximating the ccdh using standard distribution measures. Statistical measures, such as the KS-distance, χ 2 , `p -norms, etc. tend to ignore the tail, since (in terms of probability mass) it is a negligible portion of the distribution. From a network science standpoint, the few vertices that are of extremely high degree are essential for graph analysis. An (ε, δ )-estimate is accurate for all d. The query model: A formal approach requires specifying a query model for accessing G. We look to the subfields of property testing and sublinear algorithms within theoretical computer science for such models [22, 23]. Consider the following three kinds of queries. • Vertex queries: acquire a uniform random vertex v ∈ V . • Neighbor queries: given v ∈ V , acquire a uniform random neighbor u of V . • Degree queries: given v ∈ V , acquire the degree dv . An algorithm is only allowed to make these queries to process the input. It has to make some number of queries, and finally produce an output. We discuss two query models, and give results for both. The Standard Model (SM) All queries allowed: This is the standard model in numerous sublinear algorithms results [18, 19, 22– 24]. Furthermore, most papers on graph sampling implicitly use this model for generating subsamples. Indeed, any method involving crawling from a random set of vertices and collecting degrees is in the Standard Model. This model is the primary setting for our work, and allows for comparison with rich body of graph sampling algorithms. It is worth noting that in the Standard Model, one can determine the entire degree distribution in O(n log n) queries (the extra log n factor comes from the coupon collector bound of finding all the vertices through uniform sampling). Thus, it makes sense to express the number of queries made by an algorithm as a fraction of n. Alternately, the number of queries is basically the number of vertices encountered by the algorithm. Thus, a sublinear algorithm makes o(n) queries. 2 (a) amazon0601 copurchase network (b) web-Google web network (c) cit-Patents citation network (d) com-orkut social network Figure 1: The output of SADDLES on a collection of networks: amazon0601 (403K vertices, 4.9M edges), web-Google (870K vertices, 4.3M edges), cit-Patents (3.8M vertices, 16M edges), com-orkut social network (3M vertices, 117M edges). SADDLES samples 1% of the vertices and gives accurate results for the entire (cumulative) degree distribution. For comparison, we show the output of a number of sampling algorithms from past work, each run with the same number of samples. (Because of the size of com-Orkut, methods involving optimization [47] fail to produce an estimate in reasonable time.) the vertices. Observe how across the board, the methods make erroneous estimates for most of the degree distribution. The errors are also very large, for all the methods. This is consistent with previous work, where methods sample more than 10% of the number of vertices. 1.3 Our main result is more nuanced, and holds for all degree distributions. If the ccdh has a heavy tail, we expect N (d) to be reasonably large even for large values of d. We describe two formalisms of this notion, through fatness indices. Definition 1.4. The h-index of the degree distribution is the largest d such that there are at least d vertices of degree at least d. Theoretical results in detail This is the exact analogy of the bibliometric h-index [26]. As we show in the §2.1, h can be approximated by mind (d + N (d))/2. A more stringent index is obtained by replacing the arithmetic mean by the (smaller) geometric mean. Our main theoretical result is a new sampling algorithm, the Sublinear Approximations for Degree Distributions Leveraging Edge Samples, or SADDLES. We first demonstrate our results for power law degree distributions [7, 8, 20]. Statistical fitting procedures suggest they occur to some extent in the real-world, albeit with much noise [12]. The classic power law degree distribution sets n(d) ∝ 1/d γ , where γ is typically in [2, 3]. We build on this to define a power law lower bound. Definition p1.5. The z-index of the degree distribution is z = mind :N (d )>0 d · N (d). Our main theorem asserts that large h and z indices lead to a sublinear algorithm for degree distribution estimation. Theorem 1.3 is a direct corollary obtained by plugging in values of the indices for power laws. Definition 1.2. Fix γ > 2. A degree distribution is bounded below by a power law with exponent γ , if the ccdh satisfies the following property. There exists a constant τ > 0 such that for all d, N (d) ≥ bτn/d γ −1 c. Theorem 1.6. For any ε > 0, the SADDLES algorithm outputs (with high probability) an (ε, ε)-approximation to the ccdh, and makes the following number of queries. e • SM: O(n/h + m/z 2 ) e • HDM: O(m/z) The following is a corollary of our main result. For convenience, we will suppress query complexity dependencies on ε and log n e factors, using O(·). 1.4 Theorem 1.3. Suppose the degree distribution of G is bounded below by a power law with exponent γ . Let the average degree be denoted by d. For any ε > 0, the SADDLES algorithm outputs (with high probability) an (ε, ε)-approximation to the ccdh and makes the following number of queries. 1 1 e 1− γ + n1− γ −1 d) • SM: O(n Challenges The heavy-tailed behavior of the real degree distribution poses the primary challenge to computing (ε, δ )-estimates to the ccdh. As d increases, there are fewer and fewer vertices of that degree. Sampling uniform random vertices is inefficient when N (d) is small. A natural idea to find high degree vertices to pick a random neighbor of a random vertex. Such a sample is more likely to be a high degree vertex. This is the idea behind methods like snowball sampling, forest fire sampling, random walk sampling, graph sample-and-hold, etc. [5, 17, 28, 30, 38, 39, 47]. But these lead to biased samples, since vertices with the same degree may be picked with differing probabilities. 1 e 1− 2(γ −1) d) • HDM: O(n In most real-world instances, the average degree d is typically constant. Thus, the complexities above are strongly sublinear. For e 1/2 ) for both models. When γ = 3, example, when γ = 2, we get O(n e 2/3 ) and O(n e 3/4 ). we get O(n 3 A direct extrapolation/scaling of the degrees in the observed graph does not provide an accurate estimate. Our experiments show that existing methods always miss the head or the tail. A more principled approach was proposed recently by Zhang et al. [47], by casting the estimation of the unseen portion of the distribution as an optimization problem. From a mathematical standpoint, the vast majority of existing results tend to analyze the KS-statistic, or some `p -norm. As we mentioned earlier, this does not work well for measuring the quality of the estimate at all scales. As shown by our experiments, none of these methods give accurate estimate for the entire ccdh with less than 5% of the vertices. The main innovation in SADDLES comes through the use of a recent theoretical technique to simulate edge samples through vertex samples [18, 19]. The sampling of edges occurs through two stages. In the first stage, the algorithm samples a set of r vertices and sets up a distribution over the sampled vertices such that any edge adjacent to a sampled vertex may be sampled with uniform probability. In the second stage, it samples q edges from this distribution. While a single edge is uniform random, the set of edges are correlated. For a given d, we define a weight function on the edges, such that the total weight is exactly N (d). SADDLES estimates the total weight by scaling up the average weight on a random sample of edges, generated as discussed above. The difficulty in the analysis is the correlation between the edges. Our main insight is that if the degree distribution has a fat tail, this correlation can be contained even for sublinear r and q. Formally, this is achieved by relating the concentration behavior of the average weight of the sample to the h and z-indices. The final algorithm combines this area with vertex sampling to get accurate estimates for all d. The hidden degrees model is dealt with using birthday paradox techniques formalized by Ron and √ Tsur [41]. It is possible to estimate the degree dv using O( dv ) queries neighbor queries. But this adds overhead to the algorithm, especially for estimating the ccdh at the tail. As discussed earlier, we need methods that bias towards higher degrees, but this significantly adds to the query cost of actually estimating the degrees. 1.5 Zhang et al. observe that the degree distribution of numerous sampling methods is a random linear projection of the true distribution [47]. They attempt to invert this (ill-conditioned) linear problem, to correct the biases. This leads to improvement in the estimate, but the empirical studies typically sample more than 10% of the vertices for good estimates. A recent line of work by Soundarajan et al. on active probing also has flavors of graph sampling [44, 45]. In this setting, we start with a small, arbitrary subgraph and try to grow this subgraph to achieve some coverage objective (like discover the maximum new vertices, find new edges, etc.). The probing schemes devised in these papers outperform uniform random sampling methods for coverage objectives. All these results aim to capture numerous properties of the graph, using a single graph sample. Nonetheless, the degree distribution is typically considered as the most important, and empirical analyses always focus on estimating it accurately. Ribiero and Towsley [39] and Stumpf and Wiuf [46] specifically study degree distributions. Ribiero and Towsley [39] do detailed analysis on degree distribution estimates (they also look at the ccdh) for a variety of these sampling methods. Their empirical results show significant errors either at the head or the tail. We note that almost all these results end up sampling up to 20% of the graph to estimate the degree distribution. Some methods try to match the shape/family of the distribution, rather than estimate it as a whole [46]. Thus, statistical methods can be used to estimate parameters of the distribution. But it is reasonably well-established that real-world degree distributions are rarely pure power laws in most instances [12]. Indeed, fitting a power law is rather challenging and naive regression fits on log-log plots are erroneous, as results of Clauset-Shalizi-Newman showed [12]. The subfield of property testing and sublinear algorithms for sparse graphs within theoretical computer science can be thought of as a formalization of graph sampling to estimate properties. Indeed, our description of the main problem follows this language. There is a very rich body of mathematical work in this area (refer to Ron’s survey [40]). Practical applications of graph property testing are quite rare, and we are only aware of one previous work on applications for finding dense cores in router networks [25]. The specific problem of estimating the average degree (or the total number of edges) was studied by Feige [21] and Goldreich-Ron [23]. Gonen et al. and Eden et al. focus on the problem of estimating higher moments of the degree distribution [19, 24]. One of the main techniques we use of simulating edge queries was developed in sublinear algorithms results of Eden et al. [18, 19] in the context of triangle counting and degree moment estimation. We stress that all these results are purely theoretical, and their practicality is by no means obvious. On the practical side, Dasgupta, Kumar, and Sarlos study average degree estimation in real graphs, and develop alternate algorithms [14]. They require the graph to have low mixing time and demonstrate that the algorithm has excellent behavior in practice (compared to implementations of Feige’s and the Goldreich-Ron algorithm [21, 23]). Dasgupta et al. note that sampling uniform random vertices is not possible in many settings, and thus they consider a significantly weaker setting than Model 1. Chierichetti Related Work There is a rich body of literature on generating a graph sample that reveals graph properties of the larger “true” graph. We do not attempt to fully survey this literature, and only refer to results directly related to our work. The works of Leskovec & Faloutsos [30], Maiya & Berger-Wolf [31], and Ahmed, Neville, & Kompella [2, 5] provide excellent surveys of multiple sampling methods. There are a number of sampling methods based on random crawls: forest-fire [30], snowball sampling [31], and expansion sampling [30]. As has been detailed in previous work, these methods tend to bias certain parts of the network, which can be exploited for more accurate estimates of various properties [30, 31, 39]. A series of papers by Ahmed, Neville, and Kompella [2–5] have proposed alternate sampling methods that combine random vertices and edges to get better representative samples. Notably, this yields one of the best streaming algorithms for triangle counting [4]. 4 Proof. Let s = mind max(d, N (d)) and let the minimum be attained at d ∗ . If there are multiple minima, let d ∗ be the largest among them. We consider two cases. (Note that N (d) is a monotonically non-increasing sequence.) Case 1: N (d ∗ ) ≥ d ∗ . So s = N (d ∗ ). Since d ∗ is the largest minimum, for any d > d ∗ , d > N (d ∗ ). (If not, then the minimum is also attained at d > d ∗ .) Thus, d > N (d ∗ ) ≥ N (d). For any d < d ∗ , N (d) ≥ N (d ∗ ) ≥ d ∗ > d. We conclude that d ∗ is largest d such that N (d) ≥ d. Thus, h = d ∗ . If s , h, then d ∗ < N (d ∗ ). Then, N (d ∗ + 1) < N (d ∗ ), otherwise the minimum would be attained at d ∗ + 1. Furthermore, max(d ∗ + 1, N (d ∗ + 1)) > N (d ∗ ), implying d ∗ + 1 > N (d ∗ ). This proves that h + 1 > s. Case 2: d ∗ > N (d ∗ ). So s = d ∗ . For d > d ∗ , N (d) ≤ N (d ∗ ) < ∗ d < d. For d < d ∗ , N (d) ≥ d ∗ > d (if N (d) < d ∗ , then d ∗ would not be the minimizer). Thus, d ∗ − 1 is the largest d such that N (d) ≥ d, and h = d ∗ − 1 = s − 1.  et al. focus on sampling uniform random vertices, using only a small set of seed vertices and neighbor queries [10]. We note that there is a large body of work on sampling graphs from a stream [32]. This is quite different from our setting, since a streaming algorithm observes every edge at least once. The specific problem of estimating the degree distribution at all scales was considered by Simpson et al. [43]. They observe many of the challenges we mentioned earlier: the difficulty of estimating the tail accurately, finding vertices at all degree scales, and combining estimates from the head and the tail. 2 PRELIMINARIES We set some notation. The input graph G has n vertices and m edges. For any vertex v, let Γ(v) be the neighborhood of v, and dv be the degree. As mentioned earlier, n(d) is the number of vertices Í of degree d and N (d) = r ≥d n(r ) is the ccdh at d. We use “u.a.r.” as a shorthand for “uniform at random”. We stress that the all mention of probability and error is with respect to the randomness of the sampling algorithm. There is no stochastic assumption on the input graph G. We use the shorthand A ∈ (1 ± α)B for A ∈ [(1 − α)B, (1 + α)B]. We will apply the following (rescaled) Chernoff bound. The h-index does not measure d vs N (d) at different scales, and a large h-index only ensures that there are ”enough” high-degree vertices. For instance, the h-index does not distinguish between N 1 and N 2 when N 1 (100) = 100 and N 1 (d) = 0 for d > 100 and N 2 (100, 000) = 100 and N 2 (d) = 0 for all other values of d ≥ 100. The h and z-indices are related to each other. √ Claim 2.4. h ≤ z ≤ h. Theorem 2.1. [Theorem 1 in [15]] Let X 1 , X 2 , . . . , X k be a sequence of iid random variables with expectation µ. Furthermore, X i ∈ [0, B]. Í • For ε < 1, Pr[| ki=1 X i − µk | ≥ εµk] ≤ 2 exp(−ε 2 µk/3B). Í • For t ≥ 2eµ, Pr[ ki=1 X i ≥ tk] ≤ 2−t k/B . Proof. Since Np(d) is integral, if N (d) > 0, then N (d) ≥ 1. Thus, for all N (d) > 0, max(d, N (d)) ≤ d · N (d) ≤ max(d, N (d)). We take the minimum over all d to complete the proof.  We will require the following “boosting through medians” lemma, which is a routine application of the Chernoff bound. To give some intuition about these indices, we compute the h and z index for power laws. The classic power law degree distribution sets n(d) ∝ 1/d γ , where γ is typically in [2, 3]. Theorem 2.2. Consider two quantities A < B. Suppose there exists a randomized algorithm (that does not know A or B) of expected running time T that outputs a value in [A, B] with probability at least 2/3. Then, for any 0 < δ < 1/3, there exists a randomized algorithm with expected running time O(T log(1/δ )) that outputs a value in (1 ± ε)A with probability at least 1 − δ . Claim 2.5. If a degree distribution is bounded below by a power 1 Proof. Consider d ≤ τn 1/γ , where τ is defined according to Definition 1.2. Then, N (d) ≥ bτn/(τ 1/γ n (γ −1)/γ )c = Ω(n 1/γ ). This proves the h-index bound. Proof. We simply run k = 200 log(1/δ ) independent invocations of the algorithm and output the median output. Let X i be the indicator random variable for the ith invocation outputting a number in [A, B]. Observe that µ = E[X i ] ≥ 2/3. By Í Theorem 2.1, Pr[| ki=1 X i − µk | ≥ µk/5] ≤ 2 exp(−µk/75) ≤ 2 exp(−(2/3)(200/75) log(1/δ )) ≤ δ . Thus, with probability at least 1 − δ , at least (4/5)(2/3)k > k/2 outputs lie in [A, B]. This implies that the median also lies in [A, B].  1 Set d ∗ = (τn) γ −1 . For d ≤ d ∗ , N (d) ≥ 1 and d · N (d) ≥ 1 (τ /2)n/d γ −2 = Ω(n γ −1 ). If there exists no d > d ∗ such that 1 2(γ −1) ). If there does exist some such d, N (d) > 0, then √ z = Ω(n then z = Ω( d ∗ ) which yields the same value.  √ Plugging in values, for γ = 2, both h and z are Ω( n). For γ = 3, h = Θ(n1/3 ) and z = Θ(n1/4 ). It will be convenient to fix the approximation parameter ε > 0 at the very outset. So we will not pass ε as a parameter to our various subroutines. 2.1 1 law with exponent γ , then h = Ω(n γ ) and z = Ω(n 2(γ −1) ). 2.2 Simulating degree queries for HDM The Hidden Degrees Model does not allow for querying the degree dv of a vertex v. Nonetheless, it is possible to get accurate estimates of dv by sampling u.a.r. neighbors (with replacement) of v. This can be done by using the birthday paradox argument, as formalized by Ron and Tsur [41]. Roughly speaking, one repeatedly samples neighbors until the same vertex is seen twice. If this happens after t samples, t 2 is a constant factor approximation for dv . This argument √ can be refined to get accurate approximations for dv using O( dv ) random edge queries. More on Fatness indices The following characterization of the h-index will be useful for analysis. Since (d + N (d))/2 ≤ max(d, N (d)) ≤ d + N (d), this proves that mind (d + N (d))/2 is a 2-factor approximation to the h-index. Lemma 2.3. mind max(d, N (d)) ∈ {h, h + 1} 5 • HDM: O((m/z)(ε −3 log(n/εδ ))). Theorem 2.6. [Theorem 3.1 of [41], restated] Fix any α > 0. There is an algorithm that outputs a value √ in (1 ± α)dv with probability > 2/3, and makes an expected O( dv /α 2 ) u.a.r. neighbor samples. Observe how a larger h and z-index lead to smaller running times. Ignoring constant factors and assuming m = O(n), asymptotically increasing h and z-indices lead to sublinear algorithms. Suppose the degree distribution was a power law with exponent γ > 1. The average degree is constant, so m = O(n). Using the index calculations in §2.1, for SM, the running time is O(n 1−1/γ ). For √ HDM, it is O(n1−1/2(γ −1) ). For γ = 2, the running times are O( n) for both models. For γ = 3, the running times are O(n2/3 ) and O(n3/4 ) respectively. We now describe the algorithm itself. The main innovation in SADDLES comes through the use of a recent theoretical technique to simulate edge samples through vertex samples [18, 19]. The sampling of edges occurs through two stages. In the first stage, the algorithm samples a set of r vertices and sets up a distribution over the sampled vertices such that any edge adjacent to a sampled vertex may be sampled with uniform probability. In the second stage, it samples q edges from this distribution. For each edge, we compute a weight based on the degrees of its vertices and generate our final ccdh estimate by averaging these weights. Additionally, we use vertex sampling to estimate the head of the distribution. Straightforward Chernoff bound arguments can be used to determine when to use the vertex sampling over the edge sampling method. In the following description, we use c to denote a sufficiently large constant. The same algorithmic structure is used for the Standard Model and the Hidden Degrees Model. The only difference is the use the algorithm of Corollary 2.7 to estimate degrees in the HDM, while the degrees are directly available in the Standard Model. We abuse notation somewhat, and use SADDLES to denote the core sampling procedure. As described, this works for a single choice of d to estimate N (d). The final algorithm simply invokes this procedure for various degrees. For the sake of the theoretical analysis, we will simply assume this theorem. In the actual implementation of SADDLES, we will discuss the specific parameters used. It will be helpful to abstract out the estimation of degrees through the following corollary. The procedure DEG(v) will be repeatedly invoked by SADDLES. This is a direct consequence of setting α − ε/10 and applying Theorem 2.2 with δ = 1/n3 . Corollary 2.7. There is an algorithm DEG that takes as input a vertex v, and has the following properties: • For all v: with probability > 1 − 1/n 3 , the output DEG(v) is in (1 ± ε/10)dv . √ • The expected running time of DEG(v) is O(ε −2 dv log n). We will assume that invocations to DEG with the same arguments use the same sequence of random bits. Alternately, imagine that a call to DEG(v, ε) stores the output, so subsequent calls output the same value. Definition 2.8. The output DEG(v) is denoted by dˆv . The random bits used in all calls to DEG is collectively denoted Λ. (Thus, Λ completely specifies all the values {dˆv }.) We say Λ is good if ∀v ∈ V , dˆv ∈ (1 ± ε/10)dv . The following is a consequence of conditional probabilities. Claim 2.9. Consider any event A, such that for any good Λ, Pr[A|Λ] ≥ p. Then Pr[A] ≥ p − 1/n 2 . Proof. The probability that Λ is not good is at most the probability that for some v, DEG(v) < (1 ± ε/10). By the union bound and Corollary 2.7, the probability is at most 1/n 2 . Note that Í Pr[A] ≥ Λgood Pr[Λ] Pr[A|Λ] ≥ p Pr[Λ is good]. Since Λ is good with probability at least 1−1/n2 , Pr[A] ≥ (1−1/n2 )p ≥ p−1/n 2 .  cΛ (d) to be |{v |dˆv ≥ d}|. We will For any fixed Λ, we set N cΛ -values. perform the analysis of SADDLES with respect to the N 4 cΛ (v) ∈ [N ((1 + Claim 2.10. Suppose Λ is good. For all v, N ε/9)d), N ((1 − ε/9)d)]. Claim 4.1. The following holds with probability > 9/10. If e(d) ∈ (1 ± SADDLES(d, r , q) outputs an estimate in Step 6, then N cΛ (d). If it does not output in Step 6, then N cΛ (d) < (2c/ε 2 )(n/r ). ε/10)N Proof. Since Λ is good, ∀u, dˆu ∈ (1 ± ε/10)du , Furthermore, if du ≥ (1 + ε/9)d, then dˆu ≥ (1 − ε/10)(1 + ε/9)d ≥ d. Analogously, if du ≤ (1 − ε/9)d, then dˆu ≤ (1 + ε/10)(1 − ε/9)d ≤ d. Thus, {u|du ≥ d(1 + ε/9)} ⊆ {u|dˆu ≥ d} ⊆ {u|du ≥ d(1 − ε/9)}.  3 ANALYSIS OF SADDLES The estimate of Step 6 can be analyzed with a direct Chernoff bound. Proof. Each X i is an iid Bernoulli random variable, with success cΛ (d)/n. We split into two cases. probability precisely N c Case 1: N Λ (d) ≥ (c/10ε 2 )(n/r ). By the Chernoff bound of Í cΛ (d)/n| ≥ (ε/10)(r N cΛ (d)/n)] ≤ Theorem 2.1, Pr[| i ≤r X i − r N 2 c 2 exp(−(ε /100)(r N Λ (d)/n) ≤ 1/100. cΛ (d) ≤ (c/10ε 2 )(n/r ). Note that E[Íi ≤r X i ] ≤ c/10ε 2 Case 2: N Í 2 ≤ (c/ε )/2e. By the upper tail bound of Theorem 2.1, Pr[ i ≤r X i ≥ 2 c/ε ] < 1/100. Thus, with probability at least 99/100, if an estimate is output cΛ (d) > (c/10ε 2 )(n/r ). By the first case, with probability in Step 6, N e(d) is a (1 + ε/10)-estimate for N cΛ (d). A union at least 99/100, N bound completes the first part. THE MAIN RESULT AND SADDLES We begin by stating the main result, and explaining how heavy tails lead to sublinear algorithms. Theorem 3.1. There exists an algorithm SADDLES with the following properties. For any ε > 0, β > 0, it outputs an (ε, ε)-approximation of the ccdh with probability > 1 − β. The total representation size is O((log n)/ε). The expected running time depends on the model. • SM: O((n/h + m/z 2 )(ε −3 log(n/εδ ))). 6 Lemma 4.4. Fix any good Λ and d. Suppose r ≥ cε −2n/d. With probability at least 9/10, Õ cΛ (d) wtΛ,d (v) ∈ (1 ± ε/8)(r /n)N Algorithm 1: SADDLES(d, r , q) Inputs: d: degree for which N(d) is to be computed r: budget for vertex samples q: budget for edge samples Output: e(d): estimated N (d) N 1 2 3 4 5 6 7 8 9 10 11 12 13 . Í Proof. Let wt(R) denote v ∈R wtΛ,d (v). By linearity of Í cΛ (d). To expectation, E[wt(R)] = (r /n)· v ∈V wtΛ,d (v) ≥ (r /2n)N apply the Chernoff bound, we need to bound the maximum weight of a vertex. For good Λ, the weight wtΛ,d of any ordered pair is at most 1/(1 − ε/10)d ≤ 2/d. The number of neighbors of v such that cΛ (d). Thus, wtΛ,d (v) ≤ 2N cΛ (d)/d. dˆu ≥ d is at most N By the Chernoff bound of Theorem 2.1 and setting r ≥ cε −2n/d, Repeat for i = 1, . . . , r ; Select u.a.r. vertex v and add it to multiset R ; In HDM, call DEG(v) to get estimate dˆv . In SM, set dˆv to dv . ; If dˆ ≥ d, set X i = 1. Else, X i = 0. ; Í v If i ≤r X i ≥ c/ε 2 ; e(d) = n Íi ≤k X i ; Return N r Í Let dˆR = v ∈R dˆv and D denote the distribution over R where v ∈ R is selected with probability dˆv /dˆR ; Repeat for i = 1, . . . , q ; Sample v ∼ D ; Pick u.a.r. neighbor u of v ; Call DEG(u) to get dˆu ; If dˆu ≥ d, set Yi = 1/dˆu . Else, set Yi = 0 ; q e(d) = n · dˆR Í Yi . Return N r q Pr [|wt(R) − E[wt(R)]| > (ε/20)E[wt(R)]] ! cΛ (d)/2n) ε 2 · (cε −2n/d) · (N < 2 exp − ≤ 1/10 cΛ (d)/d 3 · 202 · 2N With probability at least 9/10, wt(R) ∈ (1 ± ε/20)E[wt(R)]. By cΛ (d). We the arguments given above, E[wt(R)] ∈ (1 ± ε/9)(r /n)N combine to complete the proof.  Now, we determine the number of edge samples required to estimate the weight wtΛ,d (R). e(d) be as defined in Step 13 of SADDLES. Assume Lemma 4.5. Let N cΛ (d)). Then, with Λ is good, r ≥ cε −2n/d, and q ≥ cε −2m/(d N e(d) ∈ (1 ± ε/4)N cΛ (d). probability > 7/8, N i=1 cΛ (d) ≥ (2c/ε 2 )(n/r ), then with probability at Furthermore, if N Í cΛ (d)/n ≥ c/ε 2 . A union boun least 99/100, i ≤r X i ≥ (1 − ε/10)r N proves (the contrapositive of) the second part.  Proof. We define the random set R selected in Step 2 to be Í sound if the following hold. (1) wt(R) = v ∈R wtΛ,d (v) ∈ (1 ± Í cΛ (d) and (2) v ∈R dv ≤ 100r (2m/n). By Lemma 4.4, the ε/8)(r /n)N Í first holds with probability > 9/10. Observe that E[ v ∈R dv ] = r (2m/n), since 2m/n is the average degree. By the Markov bound, the second holds with probability > 99/100. By the union bound, R is sound with probability at least 1 − (1/10 + 1/100) > 8/9. Fix a sound R. Recall Yi from Step 12. The expectation of Yi |R Í Í is v ∈R Pr[v is selected]· u ∈Γ(v) Pr[u is selected]wtΛ,d (hv, ui). We plug in the probability values, and observe that for good Λ, for all v, dˆv /dv ∈ (1 ± ε/10). Õ Õ (1/dv )wtΛ,d (hv, ui) E[Yi |R] = (dˆv /dˆR ) We define weights of ordered edges. The weight only depends on the second member in the pair, but allows for a more convenient analysis. The weight of hv, ui is the random variable Yi of Step 12. Definition 4.2. The d-weight of an ordered edge hv, ui for a given Λ (the randomness of DEG) is defined as follows. We set wtΛ,d (hv, ui) to be 1/dˆu if dˆu ≥ d, and zero otherwise. Í For vertex v, wtΛ,d (v) = u ∈Γ(v) wtΛ,d (hv, ui). The utility of the weight definition is captured by the following e(d), and thus, we claim. The total weight is an approximation of N can analyze how well SADDLES approximates the total weight. Í cΛ (d). Claim 4.3. If Λ is good, v ∈V wtΛ,d (v) ∈ (1 ± ε/9)N Proof. Õ wtΛ,d (v) = v ∈V Õ Õ v ∈V u ∈Γ(v) = Õ v ∈R = u:dˆu ≥d v ∈Γ(u) 1/dˆu = (1/dˆR ) u ∈Γ(v) Õ (dˆv /dv ) v ∈R ∈ 1dˆu ≥d /dˆu Õ v ∈R (1 ± ε/10)(1/dˆR ) Õ wtΛ,d (hv, ui) u ∈Γ(v) Õ Õ wtΛ,d (hv, ui) v ∈R u ∈Γ(v) Õ du /dˆu (1 ± ε/10)(wt(R)/dˆR ) (2) Í ˆ e N (d) = (n/r )(d R /q) i ≤q Yi Note that and Í (n/r )(dˆR /q)E[ i ≤q Yi |R] ∈ (1 ± ε/10)(n/r )wt(R). Since R is cΛ (d). Also, note that sound, the latter is in (1 ± ε/4)N ∈ (1) u:dˆu ≥d Since Λ is good, ∀u, dˆu ∈ (1 ± ε/10)du , and du /dˆu ∈ (1 ± ε/9). Í cΛ (d). Applying in (1), v ∈V wtΛ,d (v) ∈ (1 ± ε/9)N  cΛ (d) c (d) qwt(R) (r /n)N N ≥ = Λ (3) ˆ 4(100r (2m/n) 800m 2d R Í By linearity of expectation, E[ i ≤q Yi |R] = qE[X 1 |R]. Observe that Yi ≤ 1/d. We can apply the Chernoff bound of Theorem 2.1 to E[Yi |R] = E[X 1 |R] ≥ We come to an important lemma, that shows that the weight of the random subset R (chosen in Step 2) is well-concentrated. This is proven using a Chernoff bound, but we need to bound the maximum possible weight to get a good bound on r = |R|. 7 Proof. (of Theorem 3.1) The overall algorithm is the same for both models, involving multiple invocations to SADDLES. The only difference is in DEG, which is trivial when degree queries are allowed. We first argue about correctness. Consider the set D = {b(1 + ε/10)i c|0 ≤ i ≤ 10ε −1 log n}. We will run a boosted version of SADDLES for each degree in D. The e(d 0 ), where d 0 is the largest output for an arbitrary d will be N power of (1 + ε/10) smaller than d (rounding down). The boosting is done through Theorem 2.2, which ensures we can get the desired estimate for each d with probability > 1 − εβ/100n. A union bound over all d ∈ D yields a total error probability of at most β. Observe that the query complexity and running time of SADDLES are within constant factors of each other. Hence, we only focus on the number of queries made. For the Standard Model, the bound for a single invocation of SADDLES is simply O(r + q) = O(ε −2 (n/h + m/z 2 )). For the Hidden Degrees Model, we have to account for the overhead of using Ron-Tsur birthday paradox algorithm of Corollary 2.7 for each degree estimated. The number of queries √ for a single call to DEG(d) is O(ε −2 d log n). The total overhead v √ Í of all calls in Step 3 is E[ v ∈R d√v (ε −2 log n)]. By linearity of expectation, this is O((ε −2 log n)r E[ dv ], where the√expectation is over a uniform random vertex. We can bound r E[ dv ] ≤ r E[dv ] = O(ε −2n(m/n)/h) = O(ε −2n/h). The total overhead of all calls in Step 11 requires more care. Note that when DEG(v) is called multiple times for a fixed v, the subsequent calls require no further queries. (This is because the output of the first call can be stored.) We partition the vertices into two sets S 0 = {v |dv ≤ z 2 } and S 1 = {v |dv > z 2 }. The total query cost of queries to S 0 is at most O(q f ) = O((ε −2 log n)m/z). For the total cost we directly√bound by (ignoring the ε −2 log n √ to S 1 ,Í Í Í factor) v ∈S 1 dv = v ∈S 1 dv / dv ≤ z −1 v dv = O(m/z). All −4 in all, the total query complexity is O((ε log2 )(n/h + m/z)). Since m ≥ n and z ≤ h, we can simplify to O((ε −4 log2 n)(m/z)).  the iid random variables (Yi |R). Õ Õ Õ Pr[| Yi − E[ Yi ]| > (ε/100)E[ Yi ]|R] i  i  · d · qE[X 1 |R] (4) 3 · 1002 We use (3) to bound the (positive) term in the exponent is at least ≤ 2 exp − i ε2 c (d) cε −2m N ε2 · · Λ ≥ 10. 2 cΛ (d) 800m 3 · 100 N Thus, if R is sound, the following bound holds with probability at least 0.99. We also apply (2). cΛ (d) N = (n/r )(dˆR /q) q Õ Yi i=1 ∈ (1 ± ε/100)(n/r )(dˆR /q)qE[Yi |R] ∈ e(d) (1 ± ε/100)(1 ± ε/10)(n/r )wt(R) ∈ (1 ± ε/4)N The probability that R is sound is at least 8/9. A union bound completes the proof.  The bounds on r and q in Lemma 4.5 depend on the degree d. We now bring in the h and z-indices to derive bounds that hold for all d. We also remove the conditioning over a good Λ. Theorem 4.6. Let c be a sufficiently large constant. Suppose r ≥ cε −2n/h and q ≥ cε −2m/z 2 . Then, for all d, with probability ≥ 5/6, e(d) ∈ [(1 − ε/2)N ((1 + ε/2)d), (1 + ε/2)N ((1 − ε/2)d]. N Proof. We will first assume that Λ is good. By Claim 2.10, cΛ (d) ∈ [N ((1 + ε/9)d, N ((1 − ε/9)d)]. N cΛ (d) = 0, so there are no vertices with dˆv ≥ d. By the Suppose N bound above, N ((1 + ε/9)d) = 0, implying that N ((1 + ε/2)d) = 0. e(d) = 0, since the random variables X i and Yi in Furthermore N e(d) = N ((1 + ε/2)d), SADDLES can never be non-zero. Thus, N completing the proof. cΛ (d) > 0. We split into two cases, We now assume that N depending on whether Step 6 outputs or not. By Claim 4.1, with e(d) ∈ (1 ± ε/9)N cΛ (d). probability > 9/10, if Step 6 outputs, then N e(d) holds with By combining these bounds, the desired bound on N probability > 9/10, conditioned on a good Λ. Henceforth, we focus on the case that Step 6 does not output. By cΛ (d) < 2cε −2 (n/r ). By the choice of r and Claim 2.10, Claim 4.1, N cΛ ((1 + ε/9)d) < h. By the characterization of h of Lemma 2.3, N cΛ ((1 + ε/9)d), (1 + ε/9)d) = (1 + ε/9)d. z 2 ≤ max(N cε −2n/d. 5 EXPERIMENTAL RESULTS We implemented our algorithm in C++ and performed our experiments on a MacBook Pro laptop with 2.7 GHz Intel Core i5 with 8 GB RAM. We performed our experiments on a collection of graphs from SNAP [29], including social networks, web networks, and infrastructure networks. The graphs typically have millions of edges, with the largest with more than 100M edges. Basic properties of these graphs are presented in Table 1. We ignore direction and treat all edges as undirected edges. (5) z2 This implies that r ≥ By the definition of z, ≤ N (min(dmax , (1 +ε/9)d)) · min(dmax , (1 +ε/9)d). By the Claim 2.10 cΛ (d) ≥ N ((1+ε/9)d). Since N cΛ (d) > bound in the first paragraph, N 2 c c c 0, N Λ (d) ≥ N Λ (dmax ). Plugging into (5), z ≤ N Λ (d) · (1 + ε/9)d. cΛ (d)). The parameters satisfy the conditions Thus, m ≤ cε −2m/(d N e(d) ∈ (1 ± ε/4)N cΛ (d), and in Lemma 4.5. With probability > 7/8, N e(d) has the desired accuracy. by Claim 2.10, N e(d) All in all, assuming Λ is good, with probability at least 7/8, N has the desired accuracy. The conditioning on a good Λ is removed by Claim 2.9 to complete the proof.  5.1 Implementation Details For the Hidden Degrees Model, we explicitly describe the procedure DEG, which estimates the degree of a given vertex. In the algorithm Algorithm 2: DEG(v) 1 2 3 We finally prove Theorem 3.1. 8 Initialize S = ∅ ; Repeatedly add u.a.r. vertex to S, until the number of pair-wise collisions is at least k = 50 ;  Output |S | /k as estimate dˆv 2 size of n/h + m/z 2 (as given by Theorem 3.1, ignoring constants) is significantly sublinear. This is consistent with our choice of r + q = n/100 leading to accurate estimates for the ccdh. DEG, a “pair-wise collision” refers to a pair of neighbor samples that yield the same vertex. If S has size t, the expected number of pair-wise collisions is t2 /dv . We simply reverse engineer that inequality to get the estimate dˆv . Ron√and Tsur essentially prove that with high probability, |S | = Θ( dv ) and furthermore, this suffices to bound the variance of the estimate [41]. Our implementation of SADDLES is identical to the pseudo-code given in Alg. 1. The only constant to be set is c/ε 2 in Step 5, which our implementation fixes at 25. There are two parameters r and q that are chosen to be typically around 0.005n. To get the entire degree distribution, we run SADDLES on all degrees d = b1.1i c. 5.2 5.3 Comparison with previous work There are several graph sampling algorithms that have been discussed in [2, 17, 28, 30, 38, 39, 47]. We describe these methods below in more detail, and discuss our implementation of the method. • Vertex Sampling (VS, also called egocentric sampling) [5, 17, 28, 30, 38, 39]: In this algorithm, we sample vertices u.a.r. and scale the ccdh obtained appropriately, to get an estimate for the ccdh of the entire graph. • Edge Sampling (ES) [5, 17, 28, 30, 38, 39]: This algorithm samples edges u.a.r. and includes one or both end points in the sampled network. Note that this does not fall into the standard model. In our implementation we pick a random end point. • Random walk with jump (RWJ) [5, 17, 30, 38, 39]: We start a random walk at a vertex selected u.a.r. and collect all vertices encountered on the path in our sampled network. At any point, with a constant probability (0.15 in our implementation, based on previous results) we jump to another u.a.r. vertex. • One Wave Snowball (OWS) [5, 17, 28]: Snowball sampling starts with some vertices selected u.a.r. and crawls the network until a network of the desired size is sampled. In our implementation, we typically stop at the one level since that accumulates enough vertices. • Forest fire (FF) [5, 17, 30]: This method generates random sub-crawls of the network, and is related to snowball sampling. A vertex is picked u.a.r. and randomly selects a subset of its neighbors. In previous work, this is done by choosing x such neighbors, where x is a geometric random variable with mean 0.2. The process is repeated from every selected vertex until it ends. It is then repeated from another u.a.r. vertex. We run all these algorithms on the amazon0601, web-Google, cit-Patents, and com-orkut networks. To make fair comparisons, we run each method until it selects 1% of the vertices. The comparisons are shown in Fig. 1. Observe how none of the methods come close to accurately measuring the ccdh. (This is consistent with previous work, where typically 10-20% of the vertices are sampled for results.) Naive vertex sampling is accurate at the head of the distribution, but completely misses the tail. Except for vertex sampling, all other algorithms are biased towards the tail. Crawls find high degree vertices with disproportionately higher probability, and overestimate the tail. Evaluation of SADDLES The sample size of SADDLES in the Standard Model is exactly r + q. We will typically fix this to be 1% of the number of vertices in our runs, unless otherwise stated. Accuracy over all graphs. We show results of running SADDLES with the parameters discussed above for a variety of graphs. Fig. 1, and Fig. 2 show the results for the Standard Model on all graphs in Tab. 1. For all these runs, we set r + q to be 1% of the number of vertices in the graph. For the Hidden Degrees Model, we show results in Fig. 3. For space reasons, we only show results on HDM for the graphs in Fig. 2, though results are consistent over all our experiments. Again, we set r + q to be 1%, though the number of edges sampled varies quite a bit. The required number of samples are provided in Tab. 1. Note that the number of edges sampled is well within 10% of the total, except for the com-youtube graph. Visually, we can see that the estimates are accurate for all degrees, in all graphs, for both models. This is despite there being sufficient irregular behavior in N (d). For example, the web-BerkStan ccdh (Fig. 1) is quite “bumpy” between degree 102 and 104 , and the extreme tail has sudden jumps. Note that the shape of the various ccdhs are different and none of them form an obvious straight line. Nonetheless, SADDLES captures the distribution almost perfectly in all cases by observing 1% of the vertices. Convergence. To demonstrate convergence, we use the following setup. In the figures, we fix the graph com-orkut, and run SADDLES only for the degrees 10, 100, and 1000. For each choice of degree, we vary the total number of samples r + q. (We set r = q in all runs.) Finally, for each setting of r + q and each degree, we perform 100 independent runs of SADDLES. For each such run, we compute an error parameter α. Suppose the output of a run is M, for degree d. The value of α is the smallest value of ϵ, such that M ∈ [(1 − ϵ)N ((1 + ϵ)d), (1 + ϵ)N ((1 − ϵ)d)]. (It is the smallest ϵ such that M is an (ϵ, ϵ)-approximation of N (d).) Fig. 4 shows the spread of α, for the 100 runs, for each choice of r + q. Observe how the spread decreases as r + q goes to 10%. In all cases, the values of α decay to less than 0.05. We notice that convergence is much faster for d = 10. This is because N (10) is quite large, and SADDLES is using vertex sampling to estimate the value. Inverse method of Zhang et al [47]. An important result of estimating degree distributions is that of Zhang et al [47], that explicitly points out the bias problems in various sampling methods. They propose a bias correction method by solving an ill-conditioned linear system. Essentially, given one of the above sampled networks, it applies a constrained, penalized weighted least-squares approach to solving the problem of debiasing the estimated degree distribution. We apply this method for the sampling methods demonstrated in their paper, namely vertex sampling (VS), one-wave snowball (OWS), and induced sampling (IN) (sample vertices u.a.r. and only retain edges between sampled vertices). We show results in Fig. 1, again with a sample size of 1% of Large value of h and z-index on real graphs. The h and z-index of all graphs is given in Tab. 1. Observe how they are typically in the hundreds. Note that the average degree is typically an order of magnitude smaller than these indices. Thus, a sample 9 Table 1: Graph properties: #vertices (n), #edges (m), maximum degree, h-index and z-index. The last column indicates the median number of samples over 100 runs (as a percentage of m) required by SADDLES under HDM to estimate the ccdh for r + q = 0.01n. For all graphs except one, the number of samples required is < 0.1m. graph loc-gowalla web-Stanford com-youtube web-Google web-BerkStan wiki-Talk as-skitter cit-Patents com-lj soc-LiveJournal1 com-orkut #vertices 1.97E+05 2.82E+05 1.13E+06 8.76E+05 6.85E+05 2.39E+06 1.70E+06 3.77E+06 4.00E+06 4.85E+06 3.07E+06 #edges 9.50E+05 1.99E+06 2.99E+06 4.32E+06 6.65E+06 9.32E+06 1.11E+07 1.65E+07 3.47E+07 8.57E+07 1.17E+08 max. degree 14730 38625 28754 6332 84230 100029 35455 793 14815 20333 33313 avg. degree 4.8 7.0 2.6 4.9 9.7 3.9 6.5 4.3 8.6 17.7 38.1 H-index 275 427 547 419 707 1055 982 237 810 989 1638 Z-index 101 148 121 73 220 180 184 28 114 124 172 Perc. edge samples for HDM) 7.0 6.4 11.7 6.2 5.5 8.5 6.7 5.6 4.7 2.4 2.0 (a) as-skitter (b) loc-gowalla (c) web-Google (d) wiki-Talk (e) soc-LiveJournal (f) com-lj (g) web-BerkStan (h) com-youtube Figure 2: The result of runs of SADDLES on a variety of graphs, for the Standard Model. We set r + q to be 1% of the number of vertices, for all graphs. Observe the close match at all degrees between the true degree distribution and output of SADDLES. the vertices. Observe that no method get even close to estimating the ccdh accurately, even after debiasing. Fundamentally, these methods require significantly more samples to generate accurate estimates. The running time and memory requirements of this method grow superlinearly with the maximum degree in the graph. The maximum degree is not known in advance, but the algorithm needs to know this value , so it uses an upper bound. The largest graph processed by [47] has a few hundred thousand edges, which is on the smaller side of graphs in Tab. 1. SADDLES processes a graph with more than 100M edges in less than a minute, while our attempts to run the [47] algorithm on this graph did not terminate in hours. 6 ACKNOWLEDGEMENTS Ali Pinar’s work is supported by the Laboratory Directed Research and Development program at Sandia National Laboratories. Sandia 10 (a) as-skitter (b) loc-gowalla (c) web-Google (d) wiki-Talk Figure 3: The result of runs of SADDLES on a variety of graphs, for the Hidden Degrees Model. We set r + q to be 1% of the number of vertices, for all graphs. The actual number of edges sampled varies, and is given in Tab. 1. (a) d = 10 (b) d = 100 (c) d = 1000 (d) d = 10000 Figure 4: Convergence of SADDLES: We plot the values of the error parameter α (as defined in §5.2) for 100 runs at increasing values of r + q. We have a different plot for d = 10, 100, 1000, 10000 to show the convergence at varying portions of the ccdh. National Laboratories is a multimission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC., a wholly owned subsidiary of Honeywell International, Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA-0003525. Both Shweta Jain and C. Seshadhri are grateful to the support of the Sandia National Laboratories LDRD program for funding this research. C. Seshadhri also acknowledges the support of NSF TRIPODS grant. This research was partially supported by the Israel Science Foundation grant No. 671/13 and by a grant from the Blavatnik fund. Talya Eden is grateful to the Azrieli Foundation for the award of an Azrieli Fellowship. Both Talya Eden and C. Seshadhri are grateful to the support of the Simons Institute, where this work was initiated during the Algorithms and Uncertainty Semester. [5] Nesreen K Ahmed, Jennifer Neville, and Ramana Kompella. 2014. Network sampling: From static to streaming graphs. TKDD 8, 2 (2014), 7. [6] Sinan G. Aksoy, Tamara G. Kolda, and Ali Pinar. 2017. Measuring and modeling bipartite graphs with community structure. Journal of Complex Networks (2017). to appear. [7] Albert-László Barabási and Réka Albert. 1999. Emergence of Scaling in Random Networks. Science 286 (Oct. 1999), 509–512. [8] A. Broder, R. Kumar, F. Maghoul, P. Raghavan, S. Rajagopalan, R. Stata, A. Tomkins, and J. Wiener. 2000. Graph structure in the web. Computer Networks 33 (2000), 309–320. [9] Deepayan Chakrabarti and Christos Faloutsos. 2006. Graph Mining: Laws, Generators, and Algorithms. Comput. Surveys 38, 1 (2006). DOI:http://dx.doi. org/10.1145/1132952.1132954 [10] F. Chierichetti, A. Dasgupta, R. Kumar, S. Lattanzi, and T. Sarlos. 2016. On Sampling Nodes in a Network. In Conference on the World Wide Web (WWW). [11] A. Clauset and C. Moore. 2005. Accuracy and scaling phenomena in internet mapping. Phys. Rev. Lett. 94 (2005), 018701. [12] A. Clauset, C. R. Shalizi, and M. E. J. Newman. 2009. Power-Law Distributions in Empirical Data. SIAM Rev. 51, 4 (2009), 661–703. DOI:http://dx.doi.org/10.1137/ 070710111 [13] R. Cohen, K. Erez, D. ben Avraham, and S. Havlin. 2000. Resilience of the Internet to Random Breakdowns. Phys. Rev. Lett. 85, 4626fi?!8 (2000). [14] A. Dasgupta, R. Kumar, and T. Sarlos. 2014. On estimating the average degree. In Conference on the World Wide Web (WWW). 795–806. [15] D. Dubhashi and A. Panconesi. 2012. Concentration of Measure for the Analysis of Randomised Algorithms. Cambridge University Press. [16] N. Durak, T.G. Kolda, A. Pinar, and C. Seshadhri. 2013. A scalable null model for directed graphs matching all degree distributions: In, out, and reciprocal. In Network Science Workshop (NSW), 2013 IEEE 2nd. 23–30. DOI:http://dx.doi.org/ 10.1109/NSW.2013.6609190 [17] Peter Ebbes, Zan Huang, Arvind Rangaswamy, Hari P Thadakamalla, and ORGB Unit. 2008. Sampling large-scale social networks: Insights from simulated networks. In 18th Annual Workshop on Information Technologies and Systems, Paris, France. REFERENCES [1] D. Achlioptas, A. Clauset, D. Kempe, and C. Moore. 2009. On the bias of traceroute sampling: Or, power-law degree distributions in regular graphs. J. ACM 56, 4 (2009). [2] N.K. Ahmed, J. Neville, and R. Kompella. 2010. Reconsidering the Foundations of Network Sampling. In WIN 10. [3] N. Ahmed, J. Neville, and R. Kompella. 2012. Space-Efficient Sampling from Social Activity Streams. In SIGKDD BigMine. 1–8. [4] Nesreen K Ahmed, Nick Duffield, Jennifer Neville, and Ramana Kompella. 2014. Graph sample and hold: A framework for big-graph analytics. In SIGKDD. ACM, ACM, 1446–1455. 11 [18] T. Eden, A. Levi, D. Ron, and C. Seshadhri. 2015. Approximately Counting Triangles in Sublinear Time. In Foundations of Computer Science (FOCS), GRS11 (Ed.). 614–633. [19] T. Eden, D. Ron, and C. Seshadhri. 2017. Sublinear Time Estimation of Degree Distribution Moments: The Degeneracy Connection. In International Colloquium on Automata, Languages, and Programming (ICALP), GRS11 (Ed.). 614–633. [20] M. Faloutsos, P. Faloutsos, and C. Faloutsos. 1999. On power-law relationships of the internet topology. In SIGCOMM. 251–262. [21] U. Feige. 2006. On sums of independent random variables with unbounded variance and estimating the average degree in a graph. SIAM J. Comput. 35, 4 (2006), 964–984. [22] O. Goldreich and D. Ron. 2002. Property Testing in Bounded Degree Graphs. Algorithmica (2002), 302–343. [23] O. Goldreich and D. Ron. 2008. Approximating average parameters of graphs. Random Structures and Algorithms 32, 4 (2008), 473–493. [24] M. Gonen, D. Ron, and Y. Shavitt. 2011. Counting stars and other small subgraphs in sublinear-time. SIAM Journal on Discrete Math 25, 3 (2011), 1365–1411. [25] Mira Gonen, Dana Ron, Udi Weinsberg, and Avishai Wool. 2008. Finding a dense-core in Jellyfish graphs. Computer Networks 52, 15 (2008), 2831–2841. DOI: http://dx.doi.org/10.1016/j.comnet.2008.06.005 [26] J. E. Hirsch. 2005. An index to quantify an individual’s scientific research output. Proceedings of the National Academy of Sciences 102, 46 (2005), 16569fi?!16572. [27] A. Lakhina, J. Byers, M. Crovella, and P. Xie. 2003. Sampling biases in IP topology measurements. In Proceedings of INFOCOMM, Vol. 1. 332–341. [28] Sang Hoon Lee, Pan-Jun Kim, and Hawoong Jeong. 2006. Statistical properties of sampled networks. Physical Review E 73, 1 (2006), 016102. [29] Jure Leskovec. 2015. SNAP Stanford Network Analysis Project. http://snap. standord.edu. (2015). [30] Jure Leskovec and Christos Faloutsos. 2006. Sampling from large graphs. In Knowledge Data and Discovery (KDD). ACM, 631–636. [31] A. S. Maiya and T. Y. Berger-Wolf. 2011. Benefits of Bias: Towards Better Characterization of Network Sampling, In Knowledge Data and Discovery (KDD). ArXiv e-prints (2011), 105–113. [32] Andrew McGregor. 2014. Graph stream algorithms: A survey. SIGMOD 43, 1 (2014), 9–20. [33] M. Mitzenmacher. 2003. A Brief History of Generative Models for Power Law and Lognormal Distributions. Internet Mathematics 1, 2 (2003), 226–251. [34] M. E. J. Newman. 2003. The Structure and Function of Complex Networks. SIAM Rev. 45, 2 (2003), 167–256. DOI:http://dx.doi.org/10.1137/S003614450342480 [35] M. E. J. Newman, S. Strogatz, and D. Watts. 2001. Random graphs with arbitrary degree distributions and their applications. Physical Review E 64 (2001), 026118. [36] D. Pennock, G. Flake, S. Lawrence, E. Glover, and C. L. Giles. 2002. Winners don’t take all: Characterizing the competition for links on the web. Proceedings of the National Academy of Sciences 99, 8 (2002), 5207–5211. DOI:http://dx.doi. org/10.1073/pnas.032085699 [37] T. Petermann and P. Rios. 2004. Exploration of scale-free networks. European Physical Journal B 38 (2004), 201–204. [38] Ali Pinar, Sucheta Soundarajan, Tina Eliassi-Rad, and Brian Gallagher. 2015. MaxOutProbe: An Algorithm for Increasing the Size of Partially Observed Networks. Technical Report. Sandia National Laboratories (SNL-CA), Livermore, CA (United States). [39] Bruno Ribeiro and Don Towsley. 2012. On the estimation accuracy of degree distributions from graph sampling. In Annual Conference on Decision and Control (CDC). IEEE, 5240–5247. [40] Dana Ron. 2010. Algorithmic and Analysis Techniques in Property Testing. Foundations and Trends in Theoretical Computer Science 5, 2 (2010), 73–205. [41] Dana Ron and Gilad Tsur. 2016. The Power of an Example: Hidden Set Size Approximation Using Group Queries and Conditional Sampling. ACM Transactions on Computation Theory 8, 4 (2016), 15:1–15:19. [42] C. Seshadhri, Tamara G. Kolda, and Ali Pinar. 2012. Community structure and scale-free collections of Erdös-Rényi graphs. Physical Review E 85, 5 (May 2012), 056109. DOI:http://dx.doi.org/10.1103/PhysRevE.85.056109 [43] Olivia Simpson, C Seshadhri, and Andrew McGregor. 2015. Catching the head, tail, and everything in between: a streaming algorithm for the degree distribution. In International Conference on Data Mining (ICDM). IEEE, 979–984. [44] Sucheta Soundarajan, Tina Eliassi-Rad, Brian Gallagher, and Ali Pinar. 2016. MaxReach: Reducing network incompleteness through node probes. 152–157. DOI:http://dx.doi.org/10.1109/ASONAM.2016.7752227 [45] Sucheta Soundarajan, Tina Eliassi-Rad, Brian Gallagher, and Ali Pinar. 2017. ϵ - WGX: Adaptive Edge Probing for Enhancing Incomplete Networks. In Web Science Conference. 161–170. [46] Michael PH Stumpf and Carsten Wiuf. 2005. Sampling properties of random graphs: the degree distribution. Physical Review E 72, 3 (2005), 036118. [47] Yaonan Zhang, Eric D Kolaczyk, and Bruce D Spencer. 2015. Estimating network degree distributions under sampling: An inverse problem, with applications to monitoring social media networks. The Annals of Applied Statistics 9, 1 (2015), 166–199. 12
8cs.DS
A Multi Objective Reliable Location-Inventory Capacitated Disruption Facility Problem with Penalty Cost Solve with Efficient Meta Historic Algorithms Elham Taghizadeh, Mostafa Abedzadeh, Mostafa Setak  (2005) further improved these algorithms by exploiting certain Abstract— logistics network is expected that opened facilities work special in the models. Meta –heuristics algorithms , Second B. Author, Jr., Thirdstructures C. Author continuously for a long time horizon without any failure; but in real world have also been used to solve these problems (e.g., Azad and problems, facilities may face disruptions. This paper studies a reliable joint Davoudpour, 2008) [1]. inventory location problem to optimize cost of facility locations, customers’ The facilities can be defined as fire station, emergency assignment, and inventory management decisions when facilities face failure shelter, service center, logistics center and telecommunication risks and doesn’t work. In our model we assume when a facility is out of work, its customers may be reassigned to other operational facilities post. The facility may provide service to one or several otherwise they must endure high penalty costs associated with losing service. customer points. Traditional facility location often assumed For defining the model closer to real world problems, the model is proposed that the facilities are always available and never incapacitate; based on p-median problem and the facilities are considered to have limited they will provide service under any Conditions [3]. Many capacities. We define a new binary variable (𝑍𝑖𝑠 ) for showing that customers are not assigned to any facilities. Our problem involve a bi-objective model; facilities are subject to potential operational disruptions from the first one minimizes the sum of facility construction costs and expected time to time. The famous ‘‘lean’’ concept is about allows inventory holding costs, the second one function that mention for the first development of global supply chains problems. From the one is minimizes maximum expected customer costs under normal and terrorist attacks to the catastrophic devastation caused by failure scenarios. For solving this model we use NSGAII and MOSS algorithms have been applied to find the pareto- archive solution. Also Hurricane Katrina [4]. Many people believe that our Response Surface Methodology (RSM) is applied for optimizing the international supply chains are strong and reliable. However in NSGAII Algorithm Parameters. We compare performance of two algorithms reality, these facilities can be unreliable; they will not provide with three metrics and the results show NSGAII is more suitable for our service to customers that allocation to them because of model. maintenance, ranging from natural disasters to temporary shortages of capacity, breakdown or shut down for some Keywords—Joint inventory- location problem, facility location, NSGAII, unknown or known reasons. It is hence of theoretical and MOSS practical notification has been paid to facility location problems where facilities may not be completely reliable in I. INTRODUCTION recent years. When some facilities are not available, their Recently most of the studies focus on facilities location customers either forced to travel excessive distances to access problems, a large number of studies (e.g., Drezner. 1995; their demand or entirely give up the service and pay penalty Owen and Daskin and Owen 1999) focused on the [1]. Reliability is defined as the probability that a system or Uncapacited fixed charge location problem (UFL) that their component performs its intended function within a given time goals is finding the optimal number of facilities and their horizon. A supply chain is reliable if it performs well when locations in a supply chain network to balance the trade-off any parts of the system fail, for example, when a distribution between facility setup costs and day to day shipment or center becomes unavailable due to some reason that we transportation costs [1].However, in UFL problem inventory mentioned. Drezner presented the first mathematical models costs and the other were not usually considered. In many for facility location with unreliable suppliers, who studies the papers where product safekeeping is expensive, the holding unreliable p-median and (p. q)-center location problems, in cost and transportation cost may account for a significant which a facility has a given probability of becoming failure. portion of the total system cost. Utilizing UFL models to cases Snyder and Daskin provided two reliable facility location with significant inventory costs may yield suboptimal design model formulations (based on p-median and UFL models) to and hug system cost estimation. Therefore researchers research the effect of probabilistic facility failure on the introduced joint inventory – location models that optimize optimal facility deployment [5]. They make the strong facility locations to minimize the sum of the inventory costs, assumption that all facilities have the same probability of conclude the facility setup costs and the customer failure. Cui et al. developed their models to address site transportation costs. Various solution algorithms like dependent facility failure probabilities in both discrete and lagrangian relaxation and column generation were used to continuous modeling [6]. Li and Ouyang further improved the solve the joint inventory-location models. Shu et all [2]. continuum approximation model so as to solve problems under complex facility failure patterns [1]. Berman et al. (2007), Lim et al. (2009), Santivanez et al. (2009), Lim et al. Elham Taghizadeh, Industerial Engineering Department, Khaje Nasir Tossi University, Iran, Tehran, Vanak sq., Molasadra Avenue, (2010), Shen et al. (2007), Snyder et al. (2006) and Zhan et al. Number21([email protected]) (2008) all consider models similar to Snyder and Daskin’s but Mostafa Abedzadeh, Industerial Engineering Department, Khaje Nasir Tossi relax the uniform-disruption-probability assumption using a University, Iran, Tehran, Vanak sq., Molasadra Avenue, variety of modeling approaches. Oded Berman, Dmitry Krass Number21([email protected]) introduce a new analytical approach that is based on Mostafa Setak, Industerial Engineering Department, Khaje Nasir Tossi University, Iran, Tehran, Vanak sq., Molasadra Avenue, representing the stochastic problem as a linear combination of Number21([email protected]) deterministic p-median problems with facilities subject to failure facing uniform demand. Snyder et al. provided reliable networks that perform as well as under normal conditions, while also performing well when disruptions. They are using p-robustness criterions for reducing the failure risks and solve their model with improved genetic algorithm [7]. Inventory control under supply chain disruption involves difficult nonlinear cost components, and such problems have been considered in recently (e.g., Ross et al., 2008; Qi et al., 2009; Schmitt et al., 2010). Some very recent studies, in the reliable location design framework, tried to develop models to address the joint inventory and facility location [1]. For example, Qi and Shen studied reliable delivery of finished products to satisfy stochastic customer demand when the supply chain is subject to random yield at the facilities [1]. Qi et al. further investigated the effects of facility failure at two supply chain echelons (e.g., one supplier and multiple retailers) on optimal retailer locations and customer allocations. Nevertheless, both studies assumed that a chain systems, if we allow customers to access backup services from other facilities (when their primary service facility has been disrupted) the supply chain system reliability and overall performance would be considerably improved. Qi Chen et al. proposed a nonlinear binary model to join inventory costs and a more general customer assignment scheme into the reliable facility location design framework. Their model optimizes facility location, customer allocations, and inventory management decisions when facilities are subject to disruption risks [1]. Recently most of studies try to use heuristicall and fuzzy algorithms to solve reliable and risk facility location problem for example, Nezir Aydin and Alper Murat (2012) use a hybrid method (a swarm intelligence based average approximation algorithm) for solving capacitated reliable facilities location problem (CRFLP)[3] and Babak H.Tabrizi and Jafar Razmi (2012) introduce a mixed-integer non- linear fuzzy model for solving risk management in designing supply chain networks Problem [3]. Most of Joint inventory – location models with reliable facility were not considered limited capacity for facilities. Hence, we propose in this paper a bi-objective Joint inventory location problem under the risk of probabilistic facility disruption with limited capacity for them same as in real world. Also we define another objective function that minimize maximum cost (time) of distance between facilities and customers. This objective function use for emergency facilities like fire station and so on. Briefly, our objectives in model are: 1. Cost of inventory and fixed charge located facilities, 2.Maximum cost of transportation based on distance between facilities and customers. The overall goal for this model is finding optimal solution by minimizing the both objectives. A number of case studies are conducted to test the proposed solution approach and draw insights on the optimal facility deployment. The structure of this research is as follows: Section 2 introduces Assumptions and definitions, notation, the model formulation. Section 3 discusses about two methods of solving the problem. Section 4 conducts numerical experiments to test the proposed approach and show results. Finally in section 5, the Conclusion and Future Research are proposed. II. FORMULATION A. Assumptions and definitions We consider the problem of optimally locating n facilities anywhere among a set of proposed location J; and allocating a set of customers I to them. Customers will assign nearby facilities for service and there aren’t any limitations. For the unreliable new facilities, we should assume that the probability of a new facility becomes inactive is known. Each facility may fail with probability q ϵ[0, 1]. Facilities have independent failure probability and in the case where nearest facility failed; the next nearest facility will provide the service, etc. We assumed that when inventory of each facility is emptied, it orders. We assume, when a facility fails it cannot provide any service and their customers will be either allocation to other active facilities or incur certain penalty (Qi Chen& etal, 2011). Customers can get service from a set of 𝑅 ≤ |𝐽| facilities. We assume in the normal Conditions (where no facilities fail) a customer is assigned to its level-0 facility. Whenever a customer’s level –r facility fails (for any r≤R-1) it will be reassigned to its level-(r+1) facility (Qi Chen& etal, 2011). Indeed, facilities in the level-0 have backers in other levels. Note that due to independent failures, the probability for a customer to get service from its level-r facility is (1-q)qr-1, i.e., the probability that its level-r facility is functioning while all lower – level facilities have failed (Qi Chen& etal, 2011). The probability for customer to incur penalty is q s the probability that all of its R assigned facilities have failed. B. Notations Parameters  I is the set of customers location  J is the set of candidate location for facilities for servicing customers i∈ I.  r index of level assignment  dij is the transportation cost from customer i∈ 𝐼 to visit facility in location j∈ 𝐽.(also we can consider as distance between customer i and facility j)  fj initial setup cost when a facility open in location j(installation and operation cost. fj> 0)  q is probability that facility j is unreliable or out of service (fail)  piu is the penalty cost per unit of demand of customer i∈ I when all its R assigned facilities have failed.  γi is annual and given demand at customer location i∈ I.  Kj maximum capacity of facility j∈ J  |J| is the number of non-fail able facility  hj is a holding cost per year for facility j∈ J (hj> 0).  bj is a given order cost for a facility at j∈J (bj> 0).  Pj is a variable cost per unit of order (pj> 0). Decision variable  The binary decision variables Xj, j∈ J determine the facility locations: Xj=1, if a facility opens at location j; 0, otherwise.  The binary decision variables decide how facilities are assigned to the customers: Yijr =1, if customer i is assigned to facility j at level r; 0, otherwise.  The auxiliary binary variable : Zis=1, if customer i is assigned to unfaultable facility at level s, 0, A. NSGAII The primary reason for choosing the NSGAII is their otherwise. ability to find multiple Pareto-optimal solutions in one single run (Kalyanmoy Deb, 2001). Since the virtual reason why a C. Formulation problem has a multi-objective formulation is because it is not 1⁄ 2 |𝐽|−1 |𝐽|−1 𝑟 𝑀𝑖𝑛 ∑𝐽[(2𝑏𝑗 ℎ𝑗 ∑𝐼 ∑𝑟=0 𝛾𝑖 𝑌𝑖𝑗𝑟 (1 − 𝑞)𝑞𝑟 ) + ∑𝐽 ∑𝑟=0 𝛾𝑖 𝑌𝑖𝑗𝑟 𝑃𝑗 (1 − 𝑞)𝑞 + possible to have a single solution which simultaneously optimizes all objectives, an algorithm that gives a large 𝑓𝑗 𝑋𝑗 )]. (1) number of alternative solutions lying on the Pareto-optimal 𝑀𝑖𝑛𝐷. (2) front is of great practical value (Kalyanmoy Deb, 2001). s.t |𝐽|−1 𝑠 The Non-dominated Sorting Genetic Algorithm (NSGA) 𝐷 ≥ ∑𝑟=0 ∑𝐽 𝛾𝑖 𝑌𝑖𝑗𝑟 𝑑𝑖𝑗 𝑞𝑟 (1 − 𝑞) + ∑𝑟−1 𝑠=0 𝛾𝑖 𝑝𝑖𝑢 𝑞 𝑍𝑖𝑠 . (3) proposed in Srinivas and Deb was one of the first such evolutionary algorithms. Over the years, the main criticisms of ∑𝐽 𝑌𝑖𝑗𝑟 + ∑𝑟−1 𝑍 = 1 . 𝑖𝑠 𝑠=0 (4) the NSGA approach have been as follows: High computational complexity of non-dominated sorting: ∑|J|−1 (5) Y ≤ 1 . r=0 ijr The non-dominated sorting algorithm in use until now which |𝐽|−1 (6) in case of large population size is very expensive, especially ∑𝐽 ∑𝑟=0 𝛾𝑖 𝑌𝑖𝑗𝑟 ≤ 𝐾𝑗 𝑋𝑗 . since the population needs to be sorted in every generation (Kalyanmoy Deb, 2001). (7) 𝑌𝑖𝑗𝑟 ≤ 𝑋𝑗 . We address all of these issues and propose a much improved (8) version of NSGA which we call NSGA-II. From the 𝑋𝑗 , 𝑌𝑖𝑗𝑟 , 𝑍𝑖𝑠 ∈ {0,1 } simulation results on a number of hard test problems, we find 𝑋𝑗 , 𝑌𝑖𝑗𝑟 , 𝑍𝑖𝑠 ∈ {0,1 } The first objective function of this reliable joint inventory that NSGA-II has a better advantage in its optimized solutions location problem (RJIL) minimizes the expected total cost than PAES [8]. These results encourage the application of (including the facility setup cost and the inventory cost) across NSGA-II to more complex and real-world multi-objective the all possible facility failure scenarios. The second objective optimization problems [8]. function is minimizing maximum expected weighted sum of distance or transportation cost from each customer to its nearest available facility. The transportation cost is assumed proportional to the moving distance between facilities .Almost the second objective is defined for problem with emergency facilities like ambulance, Fire station, Hospital and others. We generalize our model with defining second objective. In this model we want determining the optimal number of facilities and their locations with minimizing both objective functions. We want keep our model more reliable with minimum cost. Compare of other models in reliability, in this model we define a new binary variable (𝑍𝑖𝑠 ) for showing the case that customers are not assigned to any facilities. Also this variable defines and considers penalty cost. For this propose we define level s that customers incur a penalty cost. The first constraint show maximum transportation cost base on moving distance. Eq. (4) require that for each customer i at each level r is assigned to a facility j or it is assigned to a level-s facility (s < r) that is unfaultable. The Eq. (5) is forbidden a customer from being assigned to a given facility at more than one level. Eq. (6) allowed customers assigned to a facility until its capacity and it shows the limited capacity for facilities. Eq. (7) ensures that a customer can only assign to a location with an opened facility. The last Constraints define binary variable. III. METHODOLOGY Our model is categorized as NP-hard problems, which cannot be solved by exact methods; hence we present a genetic algorithm and a scatter search algorithm for solving our proposed model and reaching to the objective which has been said before. In this step we explain steps of both algorithms in details. B. Method The algorithm and steps of our NSGAII that used in this paper are as follow as: Step1: (Initialization) Generate a set of random solutions for the initial population. Step2: (Evaluation) calculates the two fitness functions values for each individual and finds nondominated solutions. Step3 :( Density Estimation) calculates the average distance of two points on either side of this point along each of the objectives which was named crowding distance. Step4: (survivor selection) Apply selection operation to the population together with newly generated individuals to build the next generation. Step5: (crossover) Apply crossover operation to a prespecified percent of individuals selected from the population. Step6: (Mutation) Apply mutation operation to a prespecified percent of individuals selected from the population. Step7: (Termination) Repeat steps 2 to 6 steps until the termination criterion is met. C. Response Surface Methodology (RSM) The Response Surface Methodology (RSM) has been implemented for optimizing the genetic algorithm parameters. Let first introduce the RSM: RSM is a collection of statistical and mathematical techniques which is useful for developing, improving, and optimizing processes in which a response of interest is influenced by several variables and the objective is to optimize this response. RSM has important application in the design, development and formulation of new products, as well as in the improvement of existing product design. It defines the effect of the independent variables, alone or in combination, on the processes. In addition to analyzing the effects of the independent variables, this experimental methodology generates a mathematical model which describes the chemical or biochemical processes. The RSM has been implemented in 3 following steps: Step1. Preliminary determination of the independent parameters and their levels are carried out. Step2. Selection the experimental design and prediction of the model equation. (a) Run proposed algorithm around center point and set a first-order model. If curvature test is significant, set a second-order model and go to step 3. Else go to (b). (b) Move sequentially along the direction of maximum decrease in the response when the response start to get worse stop and select last point as center, go to (a). Step3. Determination of optimum point and check it. In step 1, after a preliminary analysis of the NSGA algorithm, the three most commonly studied NSGA parameters, including population size, crossover rate and mutation rate are treated as design factors and the number of iterations that is for stopping condition is selected enough big level. After preliminary analysis the initial levels of parameters are selected, that are shown in table 1. The number of iterations is 60. TABLE I The Initial Level of GA Parameters Factor Level Population size [30,50] Crossover rate [0.60,0.70] Mutation rate [0.15,0.25] In step 2 and by using Design Expert software, a 2-Level factorial design has been chosen and by selecting ranges of changing these 3 factors, 13 runs have been generated and for every run the genetic algorithm has been run 10 times and the mean function value has been calculated. Then a new range for new selected parameters has been selected and the steps of the 2-factorial design have been repeated again (13 runs, 10 NSGA runs for each), and then the software proposed the selected factors` values which are as follows: Step1: (Initialization) Generate a set of random solutions for the initial population by genetic algorithm. Step2: (Improvement Method) Apply one point crossover operation to a prespecified percent of individuals selected from the population for this step. Step3 :( Reference Set Formation) for creating Ref-Set choose a set of random solution based on its size. Step4: (Subset Generation Method) Create sub set generation method for subset generation reference set 1 and reference set 2. Step5: (Solution Combination Method) Apply mutation operation to a prespecified percent of individuals selected. Step6: (Reference Set Update Method) Replace improved solution and Update the Ref-Set. Step7: (Termination) Repeat steps 2 to 6 steps until the termination criterion is met. The brief Pseudo Code of MOSS algorithm that used in this paper is as follow as: Initialization:  Initialize N solutions as in it population by algorithm  Initialize an empty set as Pareto archive.  Out loop:  Apply diversification method for current solutions.  In loop:  Apply improvement method (crossover method)  Apply Pareto archive update method.  Apply reference set update method to construction reference set1 and reference set2  Apply sub set generation method for creation binary subset of reference set 1 and reference set 2.  Apply combination method (mutation method) on subset create by subset generation method.  End IN loop  End out loop IV. TABLE II Optimum levels of Parameters Factor Level Population size 60 Crossover rate 0.7 Mutation rate 0.5 We have used these values for our factors in NSGAII algorithm. D.MOSS SS is an example of the so-called evolutionary methods, with the difference (compared to other evolutionary methods) that its mechanism for searching is not based solely on randomization. SS is characterized by the use of a Reference Set (Ref_Set) of solutions. At each step reference solutions are combined to generate new solutions and update the current Reference Set according to some systematic rules. The general steps of MOSS an algorithm is follow as: NUMERICAL EXPERIMENTS In this section use two sets of numerical experiment for testing the proposed model and its solution approach. All the dataset are from Snyder and Daskin (2005): a 49 node set consisting of continental state capital cities as well as Washington, D.C.; an 88 node set consisting of the union of the 49 node set that mentioned and the set of 50 largest cities in the United States. Each city generates a customer demands are adjusted to the state population divided by 105 for the 49 node set and to the city population divided 10 4 for the 88 node set. The fixed cost fj is adjusted to the median home value in the city for both sets. The transportation cost d ij is equal to Squared Euclidean distance between i and j. the penalty costs piu were drawn from uniform distribution: [1000. 7000] and bj=1000. Pj=5. The holding cost hj equals 10-3fj. The capacity of each facility kj were drawn from uniform distribution: [100. 1000]. s= ̅ ∑N−1 i=1 |d−di | ̅ . (N−1)d (9) 𝑑𝑖 Is the Euclidean distance between any two consecutive solutions on the optimal boundary and 𝑑̅ is average of these distances. D= √∑𝑛𝑖=1 max(‖𝑥𝑡𝑖 − 𝑦𝑡𝑖 ‖). First objective A. Comparison metrics For assessment quality and diversity of Metaheuristics algorithms, there are numerous and various comparison metrics. In this paper, we use two important metrics that are spacing(S) and diversification (D) metrics. They are following as: 160000 140000 120000 100000 80000 60000 40000 20000 0 10 40 20 50 30 10 40 20 50 30 q(%) Node 49 Node 88 (10) The equation ‖xti − yti ‖ Represents the Euclidean distance between two adjacent solutions of 𝑥𝑡𝑖 and 𝑦𝑡𝑖 on the boundary is optimal. B. Results The model and solution approach are implemented in Matlab7.8 0 on a PC with 2.80 GHz CPU and 4 GB RAM. In the NSGAII algorithm, we set npop=60. Pm=0.5, pc=0.7, nc= pc×npop ( ) ×2, Max-Iteration=10.The results for 49 node cases 2 are summarized in table 2. In the MOSS algorithm, we set size of Ref-Set (B) =10, npop=6×B, size of Ref-Set1=0.7×B, Pm=0.5, pc=0.7, Max-Iteration=10. The results for 49 node cases are summarized in Table III. In previous models the concept of reliability in facility location problems are considered the expected value of transportation costs. While in many cases, such as determining the location of emergency centers, distribution centers of perishable materials and fire station, aim to serve all customers in the minimum time. Minimize the expected value of distance of every customer location from emergency centers is not a perfect solution. Hence, minimizing the maximum distance of customers’ location from the centers is considered. In our model we defined two objective functions; the first one is including the facility setup cost and the inventory cost and the second is maximum distance of customers’ location from the distribution centers. We minimized both objectives in our model. When serving customers took a long time, customers preferred not to give service from any facilities then the variables z is for these customers obtained one. So in our problems we incurred penalty cost for losing these customers. With the increasing the probability failure of facility, the number of customers who preferred not to give service and penalty cost increase proportionally Also in Fig 1 for two example that solve with NSGAII algorithm, we show The total objective 1 increases continuously with q and problem sizes, because of the enormous additional cost incurred by customer reassignments. Based on table 3 and 5 we can show this result is repeated by MOSS algorithm. Fig .1. Relation between objective one and q& problem size (NSGAII algorithm) Compared to Qi Chen et al (2011), in this paper we define another variable Zis for defining and considering penalty cost. We define level s that customers incur a penalty cost. The numerical results for the 88 node datasets for two algorithms are displayed in Table IV&V. The results show the same behaviors like the 49 node dataset that presents in the example problem with 88 node dataset. Despite the increased problem sizes, the proposed solution approach can still solve our problem with acceptable results and solution time. As shown in tables 3 and 5, when compared with NSGAII algorithm, MOSS algorithm was able to find the same or not worse solution for 49 and 88 node datasets. For comparing these two algorithms, in our paper we calculated two comparison metrics that explained before. We solved our model with two algorithms and show their results in our paper. In other section, for choosing best algorithm with maximum performance, we compare their results and analysis them. C. Compare NSGAII and MOSS We defined 11 problems and solved then with NSGAII and MOSS algorithms. As show in table 6 for obtaining clear analysis from our results we classified our problems in 11 groups. For comparing Performance of two algorithm based on diversity metrics, we obtain value of this metrics (formulate 10) for two algorithms. Minimum metrics value for each algorithm, show its performance is better than the other algorithm. For spacing metric (formulate 9) maximum metrics value for each algorithm, show its performance is better than other algorithm. For our model we solved each problem with defined parameters. For obtaining better solution solved each problem in several times (at least 10 repeated) and calculated two metrics for each times. As show in Table VI we obtained comparison metrics for each problem and each algorithm. For example in problems 1 and 2 based on diversity metrics in 60 percent of cases NSGAII algorithm obtain more better solutions than MOSS algorithm. The same analysis is repeated for other problems and summary of their results gathered in table VI. Finally based on our analysis the NSGAII algorithms obtained better solution for our model and it has best performance. TABLE III . Numerical results for 49 node dataset (NSGAII algorithm) solution No.of Obj-1 Obj-2 time(s) facility N q (%) No. of pareto Diversity spacing 1 10 7 101.184972 5 61272.42 2 20 5 96.092679 5 62286.98 11920.77054 274.0570 0.6276383 1767.930677 189.9962 3 30 5 94.372176 5 0.4308839 67676.37 2228.631881 117.1565 0.446724 4 40 8 90.738473 5 50 9 90.974415 5 68643.8 2377.078786 239.5423 0.876901 5 68341.95 2517.305843 3453.9585 1.5594989 6 10 5 7 20 7 106.224825 7 72588.65 3196.050986 225.4825 0.7704151 100.706728 7 72986.43 5888.693956 3137.5280 8 30 1.639404 6 102.728175 7 73378.67 416050.25 2763.4538 1.6950158 9 40 12 98.951166 7 74247.81 11046.47 3994.1739 0.9948297 10 50 9 92.846686 7 78651.33 46648.83 3398.9173 1.4794568 11 10 8 112.245066 9 86339.29 4001.66 3281.9380 1.4147689 12 20 14 111.489371 9 84668.05 276953.89 4225.8299 1.3220533 13 30 8 113.881259 9 90330.45 4775.891679 3277.9708 1.4113515 14 40 13 110.204682 9 86748.34 547616.0057 3977.7141 1.576746 15 50 14 109.540698 9 88738.76 547906.7849 4038.6427 1.5298482 16 10 15 135.977374 11 104106.6 5370.940906 4358.3878 1.8652998 17 20 16 134.73926 11 96265.57 279481.3724 4365.8759 0.6558345 18 30 10 135.192585 11 91122.67 749514.4714 2757.6830 1.5113448 19 40 14 134.683594 11 93483.98 410027.0929 4051.3596 1.1780568 20 50 12 132.553583 11 106825.9 278275.5644 2854.3656 1.2969906 21 10 12 160.869818 13 106815.8 275810.4988 3723.7085 1.5299496 22 20 11 158.498465 13 99729.59 858261.8213 3731.2863 1.5377558 23 30 12 149.376874 13 119341.9 257142.3153 3718.1845 1.0543052 24 40 16 156.628816 13 80572.73 1023742.863 4406.0547 0.8687226 25 50 20 155.814126 13 106108 281078.0857 4875.7619 1.5316598 TABLE VI Analysis of comparison metrics between two algorithms Problems Solving Method Diversity Metric Spacing Metric 1,2 NSGAII MOSS 60% 40% 50% 50% NSGAII 100% 0% MOSS 0% 100% NSGAII 80% 20% 3,4 5,6 7,8 9,10,11 MOSS 20% 80% NSGAII MOSS NSGAII 60% 40% 60% 50% 50% 80% MOSS 40% 20% For comparing performance of two algorithms, another metrics can be use is the time that each algorithm took to obtain the optimum solution. For this propose in our paper we compared solution times for 49 nodes dataset in three problems (7, 9 and 11 facilities) and their results show in table VII and Fig 2. Fig 2: Compare Solution time(s) for 49 nodes dataset between two algorithms Which algorithms with less solution time for same scale problems has better performance and solver prefers to choose this algorithm. As show in figure 6 their results show that NSGAII is more compatible and suitable for obtaining optimum solution of our model. TABLE VII Compare Solution time(s) for 49 nodes dataset between two algorithms 49 nodes 7 Facilities 9 Facilities 11 Facilities q NSGAII MOSS q NSGAII MOSS q NSGAII MOSS 0.1 106.23 275.88 0.1 112.24 398.15 0.1 135.97 779.51 0.2 100.71 287.95 0.2 111.49 426.51 0.2 134.74 744.06 0.3 102.73 272.09 0.3 113.89 449.25 0.3 135.193 733.37 0.4 98.951 278.72 0.4 110.21 473.34 0.4 134.68 616.71 0.5 92.85 406.84 0.5 109.54 412.59 0.5 132.55 625.97 V. CONCLUSION AND FUTURE RESEARCH This paper proposes a reliable joint inventory facility location model that includes a general customer assignment mechanism and the inventory ordering and holding costs into the reliable facility location design framework with consider limited capacity for facilities. This model determines the optimal number of facilities, customer allocation and inventory management policies that minimize the expected inventory, customer and facility set up costs and minimize the maximums expected transportation cost across all possible facility disruption and in our model we introduce the new variable for missing our customers for the first time. We formulated a compact nonlinear program and developed a customized solution approach to efficiently obtain near optimum solutions. NSGAII and MOSS algorithms have been used for solving the proposed model. We used the Response Surface Methodology (RSM) for optimizing the NSGAII algorithm parameters. The computational results of applying the NSGAII and MOSS algorithms have been presented. Numerical results show that the proposed approach is able to obtain solutions in a short time under various problems settings. Managerial insights about the problem are drawn from these results. For example, we have found that customer demand tend to be joined together for service by only a few facilities when the inventory cost is dominating, while it will be spread to more facilities to reduce the shipment when the transportation cost is controlling over. When the facility failure probability increases, the expected total inventory and fixed setup costs and the number of constructed facilities both increase. This work can be further extended in several directions. The use of lead time or backorders may affect supply chain structure and facility location design. In the real world, due to spatial heterogeneity and dependence of facility failure hazards, facility failure probabilities may present complex patterns such as site dependence and spatial correlation. It would be interesting to study how different facility failure patterns affect facility location design. After these comparisons between two algorithms (NSGAII and MOSS) we concluded the NSGAII algorithm is more suitable and acceptable for our models with this dataset. APPENDIX Appendix A: Table IV- Numerical results for 88 node dataset (NSGAII algorithm) Appendix B: Table V- Numerical results for 88 node dataset (MOSS Algorithm) TABLE IV NUMERICAL RESULTS FOR 88 NODE DATASET(NSGAII ALGORITHM) N q (%) No.of pareto solution time(s) No.of facility Obj-1 Obj-2 diversity Spacing 1 2 10 20 3 4 130.713657 134.380182 5 5 59122.34 60242.97 2248.96 4383.28 100.56 127 0.0251373 1.0811532 3 30 4 129.381309 5 2866.34 196.67 0.4678745 4 40 6 126.433423 5 62848.41 61041.23 5736.92 261.86 0.7108723 5 6 7 50 10 20 6 4 4 129.935916 161.099856 160.953274 5 7 7 59469.09 68154.05 66610.83 5735.94 3091.38 8918.58 234.10 165.57 191.16 0.6280393 1.0192138 0.2863371 8 9 10 30 40 50 3 5 5 164.606765 166.612876 159.255652 7 7 7 72601.01 70053.81 69240.8 2822.75 6437.18 5676.02 208.58 206.21 1047.31 1.5342573 0.3344347 1.8872246 11 12 10 20 3 4 210.598463 198.876889 9 9 87389.37 85111.79 2513.34 3140.99 129.76 161.01 0.0555176 0.2069076 13 30 4 195.296446 9 86173.33 3748.94 130.42 0.7295619 14 40 5 191.393809 9 84341.47 29202.91 561.35 1.0667824 15 50 5 192.820437 9 88515.81 3287.17 236.84 0.574728 16 10 7 241.676739 11 100898.3 4529.91 239.03 0.7638296 17 20 6 233.85527 11 107202.6 2862.57 236.17 0.4338384 18 30 6 236.78055 11 107439.4 3719.57 229.90 0.6351607 19 40 6 230.114748 11 108262.9 4201.83 182.80 0.569148 20 50 3 229.785389 11 110915.5 3093.86 152.60 0.331561 21 10 4 282.072033 13 116219.8 3221.16 175.79 0.1307587 22 20 5 278.559884 13 114405.2 3957.07 166.65 0.5605552 23 30 5 281.930554 13 122003.1 3338.35 240.82 0.6975716 24 40 5 282.465356 13 118921.4 7884.75 239.46 0.9610277 25 50 6 276.668113 13 120688.5 8077.07 175.19 0.9029292 26 10 5 350.234111 15 128152.3 5140.79 157.20 0.4378345 27 20 5 353.28214 15 129483.4 3757.15 174.28 0.4933476 28 30 5 338.075453 15 131679.2 4694.61 204.79 0.7511824 29 40 4 349.229145 15 133884.8 3783.43 145.48 0.7262069 30 50 5 344.557319 15 136050.2 6145.88 165.75 0.3997207 TABLE V NUMERICAL RESULTS FOR 88 NODE DATASET (MOSS ALGORITHM) N q (%) No.of pareto solution time(s) No.of facility Obj-1 Obj-2 diversity Spacing 1 10 6 402.695234 5 5154.588829 2809.304897 158.0479 0.4908 2 20 7 355.138019 5 4719.432706 3285.903412 152.0780 0.3833 3 30 6 372.633894 5 4567.393865 2890.46315 128.5606 0.9519 4 40 5 375.508847 5 4700.062453 2388.141582 135.5558 0.5285 5 50 9 333.74679 5 4198.031217 2715.090008 158.8588 0.2282 6 10 7 662.853849 7 4945.063288 2382.294507 171.0030 0.5247 7 20 7 14462.4891 7 4856.419663 3054.224243 149.6566 0.6223 8 30 6 682.60046 7 4997.179131 2753.816048 149.0160 0.6876 9 40 7 657.446953 7 4696.922304 2693.052924 155.4392 0.9757 10 50 6 629.609051 7 4483.07347 2600.149646 144.3037 0.9233 11 10 7 1182.44306 9 5038.566485 3000.973986 170.1766 0.5808 12 20 5 1284.57948 9 5485.426169 3508.825056 151.3494 0.7531 13 30 8 1213.29309 9 4949.000448 3571.127262 166.1868 0.9575 14 40 5 1090.26183 9 4764.032228 7299.959047 236.8037 0.3063 15 50 5 1144.39334 9 4725.519561 3242.675228 121.4829 0.6767 16 10 3 1985.93572 11 4949.885551 4127.536371 111.2970 0.0612 17 20 7 1751.47139 11 5135.736661 3226.356967 155.1206 0.521 18 30 7 1700.69361 11 5156.676073 3402.370086 159.8952 0.7098 19 40 12 1460.10846 11 5157.33905 4323.873386 225.6348 0.9849 20 50 6 1795.81849 11 5077.900956 5590.556012 232.7815 1.0769 21 10 9 2551.20904 13 4991.171919 3828.50444 271.4356 1.1349 22 20 7 2619.16897 13 5446.659333 4092.735877 217.4775 0.8683 23 30 5 7784.00058 13 5071.744472 3755.247513 132.0950 0.7995 24 40 5 2654.80647 13 5100.20206 3147.428161 130.1145 0.9301 25 50 9 2234.51107 13 5074.676025 4704.772357 294.0055 1.3152 26 10 5 3434.99546 15 5203.101167 3354.416997 124.9490 0.7337 27 20 7 2881.70127 15 5070.496077 4352.931219 177.8327 0.9638 28 30 5 3288.45577 15 5552.113742 3074.771922 157.0172 0.1521 29 40 4 3341.50782 15 5182.341047 3592.640377 114.9154 0.7931 30 50 7 5077.90258 15 5143.390982 3489.619006 155.1265 0.663 R. Zhan, Z. Shen, and M. Daskin, “System reliability with location- specific failure probabilities,” Working paper, University of California, Berkeley, 2007. 21. Shine-Der Lee, Wen-Tin Chang, “On solving the discrete location problems when the facilities are prone to failure”, Applied Mathematical Modelling. 31, 2007, 817-831. 20. REFERENCES Qi Chen, Xiaoping Li, Yanfeng Ouyang, “Joint inventory-location problem under the risk of probabilistic facility disruptions.” Transportation Research Part B 45, 2011, 991-1003. 2. Daskin, M.S., C. Coullard, and Z. J. M. Shen. “An InventoryLocation Model: Formulation, Solution Algorithm and Computational Results,” Annals of Operations Research, 110, 2003, 83-106. 3. Nazir Aydin, Alper Murat, “A swarm intelligence based sample average approximation algorithm for the capacitated reliable facility location problem”. Journal of Production economics. 2012. 4. Babak H.Tabrizi, Jafar Razmi. “Introducing a mixed-integer nonlinear fuzzy model for risk management in designing supply chain networks”, Journal of Manufacturing Systems, http://dx.doi.org/10.1016/j.jmsy.2012.12.001. 5. Lawrence V.Snyder, Mark S.Daskin. “Reliability models for facility location: the expected failure cost case”. Transportation Science. 39, 2005, 400-416. 6. T. Cui, Y. Ouyang, and Z. J. M. Shen, “Reliable facility location design under the risk of disruptions,” Operation Research, vol. 58, 2010, PP.998-1011. 7. Peng, Lawrence V, Snyder, Andrew Lim, Zuli Liu, “Reliable logistics networks design with facility disruptions”, Transportation research part B.45, 2011, 1190-1211. 8. Kalyanmoy Deb, Samir Agrawal, Amrit Pratap, and T Meyarivan. A Fast Elitist Non-Dominated Sorting Genetic Algorithm for Multi-Objective Optimization: NSGA-II. Kanpur Genetic Algorithms Laboratory, KanGal Report NO.200001 9. Burcu B.Keskin, Halit Uster, “Meta-heuristic approaches with memory and evolution for a multi-product production/distribution system design problem”. European Journal of Operational Research. 182, 2007, 663-682. 10. Deniz Aksen, Necati Aras. “a bi-level fixed charge location model for facilities under imminent attack”, Computer & Operation Research 39, 2012, 1364-1381. 11. D. Gade and E. Pohl. “Sample average approximation applied to the capacitated – facilities location problem with unreliable facilities,” Proceeding of the Institution of Mechanical Engineers, part O: Journal of risk and reliability, 223, 2009, PP.259-269. 12. Fan Wang, Lieyun Ding, Hanbin Luo, Peter E.D.Love, “Probabilistic risk of tunneling-induced damage to existing properties”, an international journal of Expert systems with Applications, 2013, http://dx.doi.org/10.1016/j.eswa.2013.06.062, 1. 13. George Mavrotas. “Generation of efficient solutions in Multiobjective Mathematical, Programming problems using GAMS, Effective implementation of the ε-constraint method”. Lecturer, Laboratory of Industrial and Energy Economics. School of Chemical Engineering, 2009. 14. Hung-Ming Chen, Chuan Chien Hou, Yu –Hsiang Wang, “A 3D visualized expert system for maintenance and management of existing building facilities using reliability based method”, Expert System with Applications 40, 2013. 287-299. 15. Jafar Razmi, Amirhossien Zahedi-Anaraki, Mohammad Saleh Zakernia, “A bi-objective stochastic optimization model for reliable warehouse network redesign”, Journal of Mathematical and Computer Modelling, http://dx.doi.org/10.1016/j.mcm.2013.03.009. 16. Jose Santivanez, Emanuel Melachrinoudis, Mary E.Helander, “Network location of a reliable center using the most reliable rout policy”. Computer & operation Research. 36, 2009, 1437-1460. 17. Lian Qi, Zuo-Jun Max Shen. “A supply design model with unreliable supply”. Computer & Operation Research, 25, 2010, PP. 320-340. 18. M. Lim, M. S. Daskin, A. Bassamboo, and S. Chopra, “A facility reliability problem: Formulation, properties and algorithm”. Naval research Logistics (NRL), 57, 2010, PP. 58-70. 19. Oded Berman, Dmitry Krass, “On n-facility median problem with facilities subject to failure facing uniform demand. Discrete Applied Mathematics. 159, 2011, 420-432. View publication stats
8cs.DS
1 Topological mixture estimation Steve Huntsman∗ arXiv:1712.04487v1 [stat.ME] 12 Dec 2017 BAE Systems, 4301 North Fairfax Drive, Arlington, Virginia 22203 (Dated: December 14, 2017) Density functions that represent sample data are often multimodal, i.e. they exhibit more than one maximum. Typically this behavior is taken to indicate that the underlying data deserves a more detailed representation as a mixture of densities with individually simpler structure. The usual specification of a component density is quite restrictive, with log-concave the most general case considered in the literature, and Gaussian the overwhelmingly typical case. It is also necessary to determine the number of mixture components a priori, and much art is devoted to this. Here, we introduce topological mixture estimation, a completely nonparametric and computationally efficient solution to the one-dimensional problem where mixture components need only be unimodal. We repeatedly perturb the unimodal decomposition of Baryshnikov and Ghrist to produce a topologically and information-theoretically optimal unimodal mixture. We also detail a smoothing process that optimally exploits topological persistence of the unimodal category in a natural way when working directly with sample data. Finally, we illustrate these techniques through examples. I. INTRODUCTION Let D(Rd ) denote a suitable space of continuous probability densities (henceforth merely called densities) on Rd . P d ◦ d M ◦ M A mixture on R with M components is a pair (π, p) ∈ ∆M × D(R ) , where ∆M := {π ∈ (0, 1] : m πm = 1}; we write |(π, p)| := M , and note that π cannot have any components equal to zero. The corresponding mixture density PM is hπ, pi := m=1 πm pm . The Jensen-Shannon divergence of (π, p) is [15] J(π, p) := H (hπ, pi) − hπ, H(p)i (1) R where H(p)m := H(pm ) and H(f ) := − f log f dx is the entropy of f . Now J(π, p) is the mutual information between the random variables Ξ ∼ π and X ∼ hπ, pi. Since mutual information is always nonnegative, the same is true of J. The concavity of H gives the same result, i.e. H (hπ, pi) ≥ hπ, H(p)i. If M := |(π, p)| > 1 and    πM −1 pM −1 + πM pM , (π̂, p̂) := (π1 , . . . , πM −2 , πM −1 + πM ) , p1 , . . . , pM −2 , πM −1 + πM then is easy to show that J(π̂, p̂) ≤ J(π, p). We say that a density f ∈ D(Rd ) is unimodal if f −1 ([y, ∞)) is either empty or contractible (within itself, or equivalently, has the homotopy type of a point) for all y: for d = 1, this simply means that any nonempty sets f −1 ([y, ∞)) are intervals. We call a mixture (π, p) unimodal iff each of the component densities pm is unimodal. The unimodal category ucat(f ) is the least integer such that there exists a unimodal mixture (π, p) with ucat(f ) components satisfying f = hπ, pi: in this event we write (π, p) |= f . The unimodal category is a topological invariant that generalizes the geometric category and is related to the Lusternik-Schnirelmann category [4, 12]. The preceding constructions naturally lead us to consider the unimodal Jensen-Shannon divergence J∩ (f ) := sup J(π, p) (2) (π,p)|=f as a simultaneous measure of both the topological and information-theoretical complexity of f , and (π∩ , p∩ ) := arg max J(π, p) (3) (π,p)|=f as an information-theoretically optimal topological mixture estimate (TME). The natural questions are if such an estimate exists (is the supremum attained?), is unique, and if so, how to perform TME in practice. In this paper we address these questions for the case d = 1, and we demonstrate the utility of TME in examples (see Figures 4 and 5). ∗ Electronic address: [email protected] December 14, 2017 Approved for public release; unlimited distribution. c 2017 BAE Systems. All rights reserved. 2 II. RELATED WORK While density estimation enables various clustering techniques [2, 20], mixture estimation is altogether more powerful than clustering: e.g., it is possible to have mixture components that significantly and meaningfully overlap. For example, a cluster with a bimodal density will usually be considered as arising from two unimodal mixture components that are of interest in their own right. In this light and in view of its totally nonparametric nature, our approach can be seen as particularly powerful, particularly when coupled with topological density estimation and deblurring/reblurring (see §VII and §VIII). Still, even for clustering (even in one dimension, where an optimal solution to k-means can be computed efficiently [13, 28, 37]), determining the number of clusters in data [26] is as much an art as a science. All of the techniques we are aware of either require some ad hoc determination to be made, require auxiliary information (e.g., [35]) or are parametric in at least a limited sense (e.g., [34]). While a parametric approach allows likelihoods and thus various information criteria [7] or their ilk to be computed for automatically determining the number of clusters, this comes at the cost of a very strong modeling assumption, and the criteria values themselves are difficult to compare meaningfully [24]. These shortcomings–including determining the number of mixture components–carry over to the more difficult problem of mixture estimation. [22–24] As an example, an ad hoc and empirically derived unimodal mixture estimation technique that requires one of a few common functional forms for the mixture components has been recently employed in [25]. Univariate model-based mixtures of skew distributions admit EM-type algorithms and can outperform Gaussian mixture models [5, 21]: though these generalize to the multivariate case quite effectively (see, e.g., [19]), the EM-type algorithms are generically vulnerable to becoming trapped in local minima without good initial parameter values, and they require some model selection criterion to determine the number of mixture components (though the parameter learning and model selection steps can be integrated as in [10]). A Bayesian nonparametric mixture model that incorporates many–but not arbitrary–unimodal distributions is considered in [32]. Principled work has been done on estimating mixtures of log-concave distributions [36]; [8] describes how densities of discrete unimodal mixtures can be estimated. However, actually estimating generic unimodal mixtures themselves appears to be unaddressed in the literature, even in one dimension. Indeed, even estimating individual modes and their associated uncertainties or significances has only been addressed recently [11, 27]. III. OUTLINE Given f , the “sweep” algorithm of [4] yields (π, p) |= f . We will show how to repeatedly perturb (π, p) to obtain (3) using two key lemmas. The first lemma, that J is convex under perturbations of (π, p) that preserve hπ, pi, is the subject of §IV. The second lemma, a characterization of perturbations of two components of a piecewise affine and continuous (or piecewise constant) mixture that preserve the predicate (π, p) |= f (i.e., that preserve unimodality and the mixture density), is the subject of §V. Together, these results entail that greedy unimodality- and densitypreserving local perturbations of pairs of mixture components converge to (3). The proof in §VI is scarcely more involved than the preceding statement once the lemmas are in hand. Next, in §VII we review the related technique of topological density estimation (TDE) before showing in §VIII how blurring and deblurring mixture estimates can usefully couple TDE and TME. Finally, in §IX we produce examples of TME in action. IV. CONVEXITY The following lemma shows that J is convex as we gradually shift part of one mixture component to another. Lemma. Let |(π, p)| = 3. The function gπ,p : [0, 1] → [0, ∞) defined by    π1 p1 + (1 − t)π2 p2 tπ2 p2 + π3 p3 gπ,p (t) := J (π1 + (1 − t)π2 , tπ2 + π3 ) , , π1 + (1 − t)π2 tπ2 + π3 (4) satisfies gπ,p (t) ≤ t · gπ,p (1) + (1 − t) · gπ,p (0). December 14, 2017 Approved for public release; unlimited distribution. c 2017 BAE Systems. All rights reserved. (5) 3 Proof. The statement as well as the proof of the lemma can be simplified with a bit of extra notation. Define π12,t := π1 + (1 − t)π2 ; π23,t := tπ2 + π3 ; π1 p1 + (1 − t)π2 p2 p12,t := ; π12,t tπ2 p2 + π3 p3 . p23,t := π23,t Now h(π12,t , π23,t ) , (p12,t , p23,t )i = hπ, pi, so gπ,p (t) = J ((π12,t , π23,t ) , (p12,t , p23,t )) = H(h(π12,t , π23,t ) , (p12,t , p23,t )i) − h(π12,t , π23,t ) , (H(p12,t ), H(p23,t ))i = H(hπ, pi) − h(π12,t , π23,t ) , (H(p12,t ), H(p23,t ))i . Furthermore, if we write π12 := π1 + π2 , π23 := π2 + π3 , p12 := π1 p1 +π2 p2 , π12 and p23 := π2 p2 +π3 p3 , π23 (6) then π12,t = tπ1 + (1 − t)π12 ; π23,t = tπ23 + (1 − t)π3 ; tπ1 p1 + (1 − t)π12 p12 p12,t = ; π12,t tπ23 p23 + (1 − t)π3 p3 . p23,t = π23,t It is well known that H is a concave functional: from this it follows that tπ1 (1 − t)π12 H(p1 ) + H(p12 ); π12,t π12,t tπ23 (1 − t)π3 H(p23,t ) ≥ H(p23 ) + H(p3 ). π23,t π23,t H(p12,t ) ≥ Therefore gπ,p (t) = ≤ = = H(hπ, pi) − h(π12,t , π23,t ) , (H(p12,t ), H(p23,t ))i H(hπ, pi) − tπ1 H(p1 ) − (1 − t)π12 H(p12 ) − tπ23 H(p23 ) − (1 − t)π3 H(p3 ) t [H(hπ, pi) − h(π1 , π23 ), (H(p1 ), H(p23 ))i] + (1 − t) [H(hπ, pi) − h(π12 , π3 ), (H(p12 ), H(p3 ))i] t · gπ,p (1) + (1 − t) · gπ,p (0) as claimed.  V. PRESERVING UNIMODALITY Suppose that (π, p) is a unimodal mixture on R with |(π, p)| > 1. We would like to determine how we can perturb two components of this mixture so that the result is still unimodal and yields the same density. In the event that the mixture is piecewise affine and continuous (or piecewise constant) the space of permissible perturbations can be characterized by the following Lemma. For 0 ≤ k ≤ N , let yk ∈ [0, ∞) be such that there are integers `, u satisfying 0 < ` ≤ u < N and 0 = y0 ≤ · · · ≤ y`−1 < y` = · · · = yu > yu+1 ≥ · · · ≥ yN = 0. (7) (That is, y1 , . . . , yN −1 is a nonnegative, nontrivial unimodal sequence.) Then for 1 ≤ r ≤ N − 1 and ε− r ≥ 0, − yk − δkr ε− r is nonnegative and unimodal ⇔ εr ≤ yr − (yr−1 ∧ yr+1 ). December 14, 2017 Approved for public release; unlimited distribution. c 2017 BAE Systems. All rights reserved. (8) 4 Similarly, for ε+ r ≥ 0, ( + yk + δkr ε+ r is nonnegative and unimodal ⇔ εr ≤ ∞ (yr−1 ∨ yr+1 ) − yr if ` − 1 ≤ k ≤ u + 1 otherwise. (9) Proof (sketch). We first sketch ((8),⇐). Nonegativity follows from 0 ≤ yr−1 ∧ yr+1 ≤ yr − ε− r . Unimodality follows from a series of trivial checks for the cases 1 ≤ r < ` − 1, r = ` − 1, r = `, and ` < r < u: the remaining cases r = u, r = u + 1, and u + 1 < r ≤ N − 1 follow from symmetry. For example, in the case 1 ≤ r < ` − 1, we only need to show that yr−1 ≤ yr − ε− r ≤ yr+1 . A sketch of ((8),⇒) amounts to using the same cases and symmetry argument to perform equally trivial checks. For example, in the case 1 ≤ r < ` − 1, we have ε− r ≤ yr − yr−1 ≤ yr − (yr−1 ∧ yr+1 ). The proof of (9) is mostly similar to that of (8): the key difference here is that any argument adjacent to or at a point where the maximum is attained can have its value increased arbitrarily without affecting unimodality (or nonnegativity).  The example in figure 1 is probably more illuminating than filling in the details of the proof sketch above. FIG. 1: A unimodal sequence y with unimodality-saturating perturbations ε± respectively indicated above and below. VI. ALGORITHM Theorem. Let −∞ = x−1 < x0 < · · · < xN < xN +1 = ∞ and f be piecewise constant (or affine) over each [xk , xk+1 ]. Then there is an efficient algorithm to compute (3). Proof. First, compute (π, p) |= f via the “sweep” algorithm of [4]. Then, for each k ∈ [N ] and pair of mixture components, compute the largest possible local perturbation of the mixture according to the lemma in §V. By the lemma in §IV, choosing a resulting maximal value of J and repeating the perturbation-evaluation procedure gives the desired result in O(M N ) iterations. This result is unique by convexity.  VII. TOPOLOGICAL DENSITY ESTIMATION The obvious situation of practical interest for TME is that a density has been obtained from a preliminary estimation process involving some sample data. There is a natural approach to this preliminary estimation process called topological density estimation (TDE) [16] that naturally dovetails with (and as it happens, inspired) TME. We recall the basic idea here. Given a kernel K and sample data Xj for 1 ≤ j ≤ n, and for each proposed bandwidth h, we compute the kernel density estimate [9, 33] n 1X fˆh;X (x) := KXj ,h n j=1 December 14, 2017 Approved for public release; unlimited distribution. c 2017 BAE Systems. All rights reserved. (10) 5 where Kµ,σ (x) := x−µ 1 σ K( σ ). Next, we compute uX (h) := ucat(fˆh;X ) (11) and estimate the unimodal category of the PDF that X is sampled from via m̂X := arg max µ(u−1 X (m)) m (12) where µ denotes an appropriate measure (nominally counting measure or the pushforward of Lebesgue measure under the transformation h 7→ 1/h). That is, (12) gives the most prevalent (and usually in practice, also topologically persistent [12, 31]) value of the unimodal category, i.e., this is a topologically robust estimate of the number of components required to produce the PDF that X is sampled from as a mixture. While any element of u−1 X (m̂X ) is a bandwidth consistent with the estimate (12), we typically make the more detailed nominal specification ĥX := medianµ (u−1 X (m̂X )). (13) TDE turns out to be very computationally efficient relative to the traditional technique of cross-validation (CV). On highly multimodal densities, TDE is competitive or at least reasonably performing relative to CV and other nonparametric density estimation approaches with respect to traditional statistical evaluation criteria. Moreover, TDE outperforms other approaches when qualitative criteria such as the number of local maxima and the unimodal category itself are considered (see Figures 2 and 3). In practice, such qualitative criteria are generally of paramount importance. For example, precisely estimating the shape of a density is generally less important than determining if it has two or more clearly separable modes. j As an illustration, consider µ(j, m) := m+1 , σ(k, m) := 2−(k+2) (m + 1)−2 and the family of distributions m fkm := 1 X Kµ(j,m),σ(k,m) m j=1 (14) for 1 ≤ k ≤ 3 and 1 ≤ m ≤ 10, and where here K is the standard Gaussian density: see Figure 2. Exhaustive details relating to the evaluation of TDE on this family and other densities are presented in the software package and test suite [3]: here, we content ourselves with the performance data for (14) shown in Figure 3. FIG. 2: The densities fkm in (14) for 1 ≤ k ≤ 3 and 1 ≤ m ≤ 6 over the interval [−0.5, 1.5]. Rows are indexed by k and columns are indexed by m; the upper left panel shows f11 and the lower right panel shows f36 . TDE has the very useful feature (shared by essentially no high-performing density estimation technique other than CV) that it requires no free parameters or assumptions. Indeed, TDE can be used to evaluate its own suitability: for unimodal distributions, it is clearly not an ideal choice–but it is good at detecting this situation in the first place. Furthermore, TDE is very efficient computationally. In situtations of practical interest, it is tempting to couple TDE and TME in the obvious way: i.e., perform them sequentially and indepdently. This yields a completely nonparametric estimate of a mixture from sample data alone. However, there is a better way to couple these techniques, as we shall see in the sequel. VIII. BLURRING AND DEBLURRING A. Blurring Recall that a log-concave function is unimodal, and moreover that a function is log-concave iff its convolutions with unimodal functions are identically unimodal. [6, 17, 18] This observation naturally leads to the following question: December 14, 2017 Approved for public release; unlimited distribution. c 2017 BAE Systems. All rights reserved. 6 FIG. 3: (L) Pseudotransparency plots of performance measures relating to the unimodal category for the family (14) depicted in Figure 2 for n = 500 sample points using a Gaussian kernel. Data for CV is shown in red, while data for TDE is shown in blue. Each panel represents data on a particular performance measure (left, ucat for TDE alone; middle, ucat for CV alone; right, the empirical probability that the estimate of ucat is correct) and value of k (top, k = 1; middle, k = 2; bottom, k = 3), with m varying from 1 to 10. (R) As in the left panel, but for the number of local maxima instead of the unimodal category. if (π, p) |= f , how good of an approximation to the δ distribution must a log-concave density g be in order to have (π, p ∗ g) |= f ∗ g? In particular, suppose that g is a Gaussian density: what bandwidth must it have? An answer to this question of how much blurring a minimal unimodal mixture model can sustain defines a topological scale (viz., the persistence of the unimodal category under blurring) that we proceed to illustrate in light of TDE. In this paragraph we assume that K is the standard Gaussian density, so that Kµ,h ∗ Kµ0 ,h0 = Kµ+µ0 ,(h2 +h02 )1/2 and fˆh;X ∗ K0,h0 = fˆ(h2 +h02 )1/2 ;X . Write ĥX for the bandwidth obtained via TDE, whether via the nominal specification −1 ˆ (13) or any other: by construction we have that inf u−1 X (m̂X ) ≤ ĥX ≤ sup uX (m̂X ). Now if (π, p) |= fĥX ;X , then m̂X = uX (ĥX ) = |(π, p)|. In order to have (π, p ∗ K0,h0 ) |= f ∗ K0,h0 , it must be that m̂X = uX (ĥX ) = |(π, p)| = |(π, p ∗ K0,h0 )| = uX ((ĥ2X + h02 )1/2 ), i.e., h0 ≤ 1/2  2 sup u−1 − ĥ2X . X (m̂X ) In particular, we have the weaker inequality involving a purely topological scale:  2  2 1/2 −1 h0 ≤ sup u−1 ( m̂ ) − inf u ( m̂ ) . X X X X (15) (16) The preceding considerations generalize straightforwardly if we define uf (h) := ucat(f ∗ K0,h ), where once again K is a generic kernel. This generalizes (11) so long as we associate sample data with a uniform average of δ distributions. Under reasonable conditions, we can write uf (0) = ucat(f ), and it is easy to see that the analogous bound is h0 ≤ sup u−1 f (uf (0)). (17) Of course, (17) merely restates the triviality that the blurred mixture ceases to be minimal precisely when the number of mixture components exceeds the unimodal category of the mixture density. Meanwhile, the special case furnished by TDE with the standard Gaussian kernel affords sufficient structure for a slightly less trivial statement. B. Deblurring/reblurring The considerations of §VIII A suggest how to couple TDE and TME in a much more effective way than performing them sequentially and independently. The idea is to use a Gaussian kernel and instead of (13), pick the bandwidth (−) ĥX := infµ (u−1 X (m̂X )) December 14, 2017 Approved for public release; unlimited distribution. c 2017 BAE Systems. All rights reserved. (18) 7 and then perform TME; finally, convolve the results with K0,∆h where  ∆h := ĥ2X h i2 1/2 (−) − ĥX . (19) This preserves the result of TDE while giving a smoother, less artificial, and more practically useful mixture estimate than the information theoretically optimal result. Of course, a similar tactic can be performed directly on a density f by considering its Fourier deconvolution F −1 (Ff /FK0,h0 ), where F denotes the Fourier transform and h0 is as in (17): however, any a priori justification for such a tactic is necessarily context-dependent in general, and our experience suggests that its implementation would be delicate and/or prone to aliasing. Nevertheless, this would be particularly desirable in the context of heavy-tailed distributions, where kernel density estimation requires much larger sample sizes in order to achieve acceptable results. In this context it would also be worth considering the use of a symmetric stable density [29, 38] (e.g., a Cauchy density) as a kernel with the aim of recapturing the essence of (19). IX. EXAMPLES We present two phenomenologically illustrative examples. First, in Figure 4 we consider the n = 272 waiting times between eruptions of the Old Faithful geyser from the data set in [14]. Then, in Figure 5 we consider the n = 2107 Sloan Digitial Sky Survey g − r color indices accessed from the VizieR database [30] at http://cdsarc.u-strasbg. fr/viz-bin/Cat?J/ApJ/700/523 and discussed in [1]. FIG. 4: TME applied to n = 272 waiting times between eruptions of the Old Faithful geyser. Left panels, from top to bottom: area plots of unimodal decompositions obtained by (top) the “sweep algorithm” of [4] on a topological density estimate with bandwidth given by (13); (second from top) the result of (3) on a topological density estimate with bandwidth given by (13); (second from bottom) the result of (3) on a topological density estimate with bandwidth given by (18); (bottom) the convolution of the mixture in the preceding panel with a Gaussian kernel with bandwidth given by (19). Note that three of the four mixture estimates have the same density, but that the deblurred density is different (this is why we have used the “*” annotation for this case). Right panels: line plots of the same decompositions. As suggested, several phenomena are readily apparent from these examples. First, mixtures obtained via the sweep algorithm are manifestly parity-dependent, i.e., the direction of sweeping matters; second, mixtures obtained via TME alone exhibit artificial anti-overlapping behavior; third, deblurring followed by reblurring preserves unimodality, the overall density, a topologically persistent invariant (viz., the unimodal category) and the spirit of informationtheoretical optimality while producing an obviously better behaved mixture; fourth and finally, the various techniques involved here can significantly shift classification/decision boundaries based on the dominance of various mixture components. While the data in Figure 4 is at least qualitatively approximated by a two-component Gaussian mixture, it is clear that a three-component Gaussian mixture cannot capture the highly oscillatory behavior of the density in Figure 5. Indeed, this example illustrates how such oscillatory behavior can actually arise from a unimodal mixture with many fewer components than might naively appear to be required. December 14, 2017 Approved for public release; unlimited distribution. c 2017 BAE Systems. All rights reserved. 8 FIG. 5: TME applied to n = 2107 g − r color indices from [1]. Panels are otherwise as in Figure 4. Figure 6 shows that there are strong and independent grounds to conclude that the color index data of Figure 5 is produced by a unimodal mixture of three components, with componentwise modes as suggested by TME, and furthermore that CV undersmooths this data. For each density estimate shown, each componentwise extremum of the corresponding mixture (3) is virtually identical to one of the local extrema of the density estimate itself: this is a consequence of the anti-overlapping tendency described above. In particular, the fourth panel of Figure 6 illustrates that it is possible and potentially advantageous to use TME as an alternative mode identification technique in the LPMode algorithm of [27]. Furthermore, while we have not implemented a reliable Fourier deconvolution/reblurring algorithm of the sort hinted at in §VIII B, the fifth and sixth panels of Figure 6 suggest that this is not particularly important for the narrow task of mode finding/bump hunting. Acknowledgments The author thanks Adelchi Azzalini, Robert Ghrist, Subhadeep Mukhopadhyay, and John Nolan for their helpful and patient discussions. This material is based upon work supported by the Defense Advanced Research Projects Agency (DARPA) and the Air Force Research Laboratory (AFRL). Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of DARPA or AFRL. [1] An, D. et al. “Galactic globular and open clusters in the Sloan Digital Sky Survey. II. Test of theoretical stellar isochrones.” Astrophys. J. 700, 523 (2009). [2] Azzalini, A. and Menardi, G. “Clustering via nonparametric density estimation: the R package pdfCluster”. J. Stat. Soft. 57 (2014). [3] BAE Systems. MATLAB implementation of TDE, available at https://git.io/vyC4l (2017). [4] Baryshnikov, Y. and Ghrist, R. “Unimodal category and topological statistics.” NOLTA (2011). [5] Basso, R. M. et al. “Robust mixture modeling based on scale mixtures of skew-normal distributions.” Comp. Stat. Data Anal. 54, 2926 (2010). [6] Bertin, E. M. J., Cuculescu, I., and Theodorescu, R. Unimodality of Probability Measures. Kluwer (1997). [7] Burnham, K. P. and Anderson, D. R. Model Selection and Multimodal Inference: A Practical Information-Theoretic Approach. 2nd ed. Springer (2003). [8] Chan, S.-O., et al. “Learning mixtures of structured distributions over discrete domains.” SODA (2013). [9] Chen, Y.-C. “A tutorial on kernel density estimation and recent advances.” arXiv:1704.03924 (2017). [10] Figueiredo, M. A. T. and Jain, A. K. “Unsupervised learning of finite mixture models.” IEEE Trans. Pattern Anal. Mach. Intell. 24, 381 (2002). [11] Genovese, C. R. et al. “Non-parametric inference for density modes.” J. Royal Stat. Soc. B 78, 99 (2016). [12] Ghrist, R. Elementary Applied Topology. CreateSpace (2014). [13] Grønlund, A., et al. “Fast exact k-means, k-medians, and Bregman divergence clustering in 1D.” arXiv:1701.07204 (2017). [14] Härdle, W. Smoothing Techniques with Implementation in S. Springer (1991). December 14, 2017 Approved for public release; unlimited distribution. c 2017 BAE Systems. All rights reserved. 9 FIG. 6: Structural analyses of the color index data from Figure 5. Top panel: density estimates obtained via CV, the default LPMode algorithm of [27] (kindly provided by its author), and TDE. Second panel from top: the local extrema of the density estimates above. Third through fifth panels from top: the result of (3) on the CV, LPMode, and topological density estimates, respectively, with extrema of components indicated. Bottom panel: the reblurred mixture from the bottom left panel of Figure 5, with extrema of components additionally indicated. [15] Briët, J. and Harremoës, P. “Properties of classical and quantum Jensen-Shannon divergence.” Phys. Rev. A 79, 052311 (2009). [16] Huntsman, S. “Topological density estimation.” NOLTA (2017). [17] Ibragimov, I. A. “On the composition of unimodal distributions.” Th. Prob. Appl. 1, 255 (1956). [18] Keilson, J. and Gerber, H. “Some results for discrete unimodality.” J. Am. Stat. Ass. 66, 386 (1971). [19] Lee, S. X. and McLachlan, G. J. “Finite mixtures of canonical fundamental skew-t distributions.” Stat. Comput. 26, 573 (2016). [20] Li, J., Ray, S., and Lindsay, B. G. “A nonparametric statistical approach to clustering via mode identification.” J. Machine Learning Res. 8, 1687 (2007). [21] Lin, T. I., Lee, J. C., and Hsieh, W. J. “Robust mixture modeling using the skew t distribution.” Stat. Comput. 17, 81 (2007). [22] McLachlan, G. and Peel, D. Finite Mixture Models. Wiley (2000). [23] McLachlan, G. J. and Rathnayake, S. “On the number of components in a Gaussian mixture model.” WIREs Data Mining Knowl. Disc. 4, 341 (2014). [24] Melnykov, V. and Maitra, R. “Finite mixture models and model-based clustering.” Stat. Surv. 4, 80 (2010). [25] Mints, A. and Hekker, S. “A Unified tool to estimate Distances, Ages, and Masses (UniDAM) from spectrophotometric data.” Astro. Astrophys. 604, A108 (2017). [26] Mirkin, B. “Choosing the number of clusters.” Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery 1, 252 (2011). [27] Mukhopadhyay, S. “Large-scale mode identification and data-driven sciences.” Electronic J. Stat. 11, 215 (2017). [28] Nielsen, F. and Nock, R. “Optimal interval clustering: application to Bregman clustering and statistical mixture learning.” IEEE Sig. Proc. Lett. 21, 1289 (2014). [29] Nolan, J. P. Stable Distributions: Models for Heavy Tailed Data. Birkhaüser (2018). December 14, 2017 Approved for public release; unlimited distribution. c 2017 BAE Systems. All rights reserved. 10 [30] Ochsenbein, F., Bauer, P. and Marcout, J. “The VizieR database of astronomical catalogues.” Astro. Astrophys. Supp. Ser. 143, 23 (2000). [31] Oudot, S. Y. Persistence Theory: From Quiver Representations to Data Analysis. AMS (2015). [32] Rodrı́guez, C. E. and Walker, S. G. “Univariate Bayesian nonparametric mixture modeling with unimodal kernels.” Stat. Comp. 24, 35 (2014). [33] Silverman, B.W. Density Estimation for Statistics and Data Analysis. Chapman & Hall (1986). [34] Sugar, C. A. and James, G. M. “Finding the number of clusters in a dataset: an information-theoretic approach.” J. Am. Stat. Ass. 98, 750 (2003). [35] Tibshirani, R., Walther, G., and Hastie, T. “Estimating the number of clusters in a data set via the gap statistic.” J. Roy. Stat. Soc. B 63, 411 (2001). [36] Walther, G. “Inference and modeling with log-concave distributions.” Stat. Sci. 24, 319 (2009). [37] Wang, H. and Song, M. “Ckmeans.1d.dp: optimal k-means clustering in one dimension by dynamic programming.” R J. 3, 29 (2011). [38] Zolotarev, V. M. and Uchaikin, V. V. Chance and Stability: Stable Distributions and Their Applications. De Gruyter (1999). December 14, 2017 Approved for public release; unlimited distribution. c 2017 BAE Systems. All rights reserved.
7cs.IT
Morphologic for knowledge dynamics: revision, fusion, abduction Isabelle Bloch1 , Jérôme Lang2 , Ramón Pino Pérez3 , Carlos Uzcátegui4 arXiv:1802.05142v1 [cs.AI] 14 Feb 2018 (1) LTCI, Télécom ParisTech, Université Paris-Saclay, Paris, France [email protected] (2) Université Paris-Dauphine, PSL Research University, CNRS, UMR 7243, LAMSADE, 75016 Paris, France - [email protected] (3) Departamento de Matemáticas, Universidad de Los Andes - Merida, Venezuela [email protected] (4) Escuela de Matemáticas, Facultad de Ciencias, Universidad Industrial de Santander Bucaramanga, Colombia - [email protected] Abstract Several tasks in artificial intelligence require to be able to find models about knowledge dynamics. They include belief revision, fusion and belief merging, and abduction. In this paper we exploit the algebraic framework of mathematical morphology in the context of propositional logic, and define operations such as dilation or erosion of a set of formulas. We derive concrete operators, based on a semantic approach, that have an intuitive interpretation and that are formally well behaved, to perform revision, fusion and abduction. Computation and tractability are addressed, and simple examples illustrate the typical results that can be obtained. Key words: Mathematical Morphology, Morphologic, Knowledge Representation, Knowledge Dynamics, Belief Revision, Fusion, Abduction 1. Introduction Several tasks in artificial intelligence require to be able to find models about knowledge dynamics. In particular, how do beliefs change in the light of a new observation, how can we extract a coherent source of information of many sources of information (eventually contradictory), or how can a given observation be explained? All these questions fall more precisely under the following topics: belief revision, belief merging or fusion, and abduction, respectively. Such tasks have been formalized and axiomatized in various logics. It is out of the scope of this paper to review the huge amount of work done in this direction, and we will rely on existing postulates, now rather widely accepted, such as AGM postulates for revision [27], integrity constraints postulates for merging and fusion [30, 31, 32], rationality postulates for abduction and explanatory relations [37, 38]. Here the propositional logic is considered, and propositional formulas are used to encode either pieces of knowledge (which may be generic, for instance integrity constraints, or factual such as observations) or “preference items” (such as beliefs, opinions, desires or goals). Such formulas are then used for complex reasoning or decision making tasks. Preprint submitted February 15, 2018 In this paper, we propose to build tools for modeling knowledge dynamics based on mathematical morphology operators applied to propositional formulas. Mathematical morphology is originally based on set theory. It has been introduced in 1964 by Matheron [34, 35], in order to study porous media. But this theory evolved rapidly to a general theory of shape and its transformations, and was applied in particular in image processing and pattern recognition [48]. Additionally to its set theoretical foundations, it also relies on topology on sets, on random sets, on topological algebra, on integral geometry, on lattice theory. In particular, the general algebraic framework of lattices allows developing mathematical morphology in various domains of information processing, beyond sets and functions, such as fuzzy sets, logics, graphs, hypergraphs, formal concept analysis, etc. [7, 8, 9, 11, 45]. The aim of this paper is to develop mathematical morphology in propositional logics, called morphologic, and to propose concrete morphological operators to perform revision, fusion and abduction, which are tractable and have an intuitive meaning. In particular we will make use of two important operations, dilations and erosions. Intuitively, when applied to a set, the effect of dilation is to expand the set while the effect of erosion is to shrink the set. The following ideas explain intuitively why morphologic is an adequate tool for knowledge dynamics: • Belief revision: let ϕ and ψ be two propositional formulas. The models of the revision ϕ ◦ ψ of ϕ by ψ are the models of ψ which are closest (with respect to a given proximity notion) to a model of ϕ. Intuitively, using the language of morphologic, it means that ϕ has to be dilated enough to become consistent with ψ. • Belief merging: finding the best compromise between a finite set of formulas ϕ1 , ... ϕn amounts to selecting the models which minimize the aggregation (using some given operator) of the distances to each of the ϕi . This amounts intuitively to dilate simultaneously all the ϕi until they constitute a consistent set. • Abductive reasoning: preferred explanations of a formula are defined based on a set of axioms, several of which being closed to properties of morphological operators, in particular erosion. An important noticeable aspect is that the framework of morphologic gives us not only natural and general notions to deal with many tasks of knowledge dynamics, but this approach is also well behaved. Actually, the operators and relations obtained via the morphological tools enjoy good rationality properties. Moreover, last but not least, under certain assumptions there are interesting ways of computing some of our proposed operators. The main contribution of this work is to propose such models in the framework of morphologic, based on a semantic approach. One interesting aspect is that the proposed operators include some of existing ones, and also new ones. For each of them, the properties will be analyzed and discussed. Finally, the outcome is a toolbox of operational methods, among which a user can choose according to the required properties. This paper is organized as follows: Section 2 is devoted to the presentation of concepts in mathematical morphology and to introduce logical morphology 2 (morphologic). Section 3 shows the general techniques of computation of the operators when the metric over the space of valuations is given by the Hamming distance. Section 4 is devoted to show how well-known revision operators can be interpreted in the framework of morphologic. Section 5 proposes a similar analysis in the framework of fusion. It shows how belief merging operators can be interpreted in the framework of morphologic. Section 6 is devoted to abduction (explanatory relations) built on morphological operations aiming to capture the notion of the most central part. Based on a common notion of pre-order relation on models, derived from morphological operators, Section 6.4 presents a unified framework for revision and abduction. In Section 7 we finish with some concluding remarks and perspectives for future work. 2. From mathematical morphology to logical morphology In this section we recall the main concepts and tools used in mathematical morphology and their interpretation in mathematical logic. This interpretation is possible via the identification between a logical formula and a set of interpretations (its models) in the framework of finite propositional logic. 2.1. Algebraic framework: complete lattices Mathematical morphology relies on concepts and tools from various branches of mathematics: algebra (lattice theory), topology, discrete geometry, integral geometry, geometrical probability, partial differential equations, etc. [35, 48]; in fact any mathematical theory that deals with shapes, their combinations or their evolution, can be brought to contribute to morphological theory. When adopting a logics point of view, the algebraic framework is particularly relevant, and we will concentrate on it in the sequel. The basic structure inW this framework isVa complete lattice (L, ≤)1 . We denote the supremum by , the infimum by by V , the W smallest element W V 0L and the greatest element by 1L . We have 0L = L = ∅ and 1L = L = ∅. The framework of complete lattices is fundamental in mathematical morphology, as explained in [25, 46, 45]. All the following definitions and results are detailed in textbooks on mathematical morphology, such as [24, 36, 49]. We restrict the presentation to operators from (L, ≤) into itself. An algebraic dilation is defined as an operator δ on L that commutes with the supremum, and an algebraic erosion as an operator ε that commutes with the infimum, i.e. for every family (xi )i∈I of elements of L (finite or not), where I is an index set, we have: _ _ δ( xi ) = δ(xi ), (1) i∈I ε( ^ i∈I xi ) = i∈I ^ ε(xi ). (2) i∈I 1 Although mathematical morphology has also been extended to complete semi-lattices and general posets [28], based on the notion of adjunction, in this paper we only consider the case of complete lattices. 3 These are the two main operators, from which a lot of others can be built. Among the numerous examples of complete lattices, one will be particularly interesting for the extension to logics: (P(E), ⊆), the set of subsets of a set E, endowed with the set theoretical inclusion. It is a Boolean lattice (i.e. complemented and distributive). The smallest and greatest elements are 0L = ∅ and 1L = E, respectively. Algebraic dilations and erosions in (L, ≤) satisfy the following properties: • δ(0L ) = 0L and ε(1L ) = 1L , • δ and ε are increasing with respect to the partial ordering on L, • in (P(E), ⊆), δ(X) = ∪x∈X δ({x}). Another important concept is the one of adjunction. A pair of operators (ε, δ) defines an adjunction on (L, ≤) if: ∀(x, y) ∈ L2 , δ(x) ≤ y ⇔ x ≤ ε(y). (3) If a pair of operators (ε, δ) defines an adjunction, the following important properties hold: • δ(0L ) = 0L and ε(1L ) = 1L , • δ is a dilation and ε is an erosion (in the algebraic sense expressed by Equations 1 and 2); • δε ≤ Id, where Id denotes the identity mapping on L (i.e. δε is antiextensive); • Id ≤ εδ (i.e. εδ is extensive); • δεδε = δε and εδεδ = εδ, i.e. the composition of a dilation and an erosion are idempotent operators (δε is called a morphological opening and εδ a morphological closing). The following representation theorem holds: an increasing operator δ is an algebraic dilation iff there is an operator ε such that (ε, Wδ) is an adjunction; the operator ε is then an algebraic erosion and ε(x) = {y ∈ L, δ(y) ≤ x}. Similarly, an increasing operator ε is an algebraic erosion iff there is an operator δ such that V (ε, δ) is an adjunction; the operator δ is then an algebraic dilation and δ(x) = {y ∈ L, ε(y) ≥ x}. Finally, let δ and ε be two increasing operators such that δε is anti-extensive and εδ is extensive. Then (ε, δ) is an adjunction. Further properties and derived operators can be found in seminal works such as [24, 48, 49], or in more recent ones [9, 36]. In this paper, the fact that dilations and erosions are increasing operators that commute with the supremum and the infimum, respectively, will play an important role. 4 2.2. Structuring element and morphological dilations and erosions Let us now consider the lattice (P(E), ⊆) of the subsets of E. We have δ(X) = ∪x∈X δ({x}). If E is a vectorial or metric space (e.g. Rn ), and if δ and ε are additionally supposed to be invariant under translation, then it can be proved that there exists a subset B, called structuring element, such that δ(X) = {x ∈ E | B̌x ∩ X 6= ∅} (4) ε(X) = {x ∈ E | Bx ⊆ X}, (5) and where Bx denotes the translation of B at point x (i.e. x + B), and B̌ is the symmetrical of B with respect to the origin. The operators are then called morphological dilations and erosions. Details on these definitions and their properties can be found e.g. in [9, 24, 36, 48]. The structuring element B defines a neighborhood that is considered at each point. This is typically the case in image processing and computer vision, where the underlying lattice is built on sets or functions of the spatial domain. It is a subset of E with fixed shape and size, directly influencing the extent of the morphological operations. It is generally assumed to be compact, so as to guarantee good properties. In the discrete case (that will be considered all through this paper), we assume that it is connected, according to a discrete connectivity defined on E. The general principle underlying morphological operators consists in translating the structuring element at every position in space and checking if this translated structuring element satisfies some relation with the original set (intersection for dilation, Equation 4, inclusion for erosion, Equation 5) [48]. An example on a binary image is displayed in Figure 1. (a) (b) (c) (d) Figure 1: (a) Structuring element B (ball of the Euclidean distance). (b) Subset X in the Euclidean plane (in white). (c) Its dilation δB (X). (d) Its erosion εB (X). The structuring element can also be seen as a binary relation between points [9], i.e. y ∈ Bx iff R(x, y) where R denotes a relation on E × E. Dilation and erosion are then expressed as follows: δ(X) = {x ∈ E | ∃y ∈ X, R(y, x)}, ε(X) = {x ∈ E | ∀y ∈ E, R(x, y) ⇒ y ∈ X}. These formulas apply for any binary relation R. If R is reflexive (i.e. R(x, x) for all x), then δ is extensive (X ⊆ δ(X)) and ε is anti-extensive (ε(X) ⊆ X). 5 These properties hold in the case illustrated in Figure 1. The objects in the original image are then expanded by dilation, to an extent that depends on the shape and the size of the structuring element, and reduced by erosion. Similar interpretations hold for any relation R, and these properties will also be important in the remainder of this paper. 2.3. Lattice of formulas and morpho-logic The idea of using mathematical morphology in a logical framework has been first introduced in [10, 11]. Let P S be a finite set of propositional symbols, with |P S| = N . The set of formulas (generated by P S and the usual connectives) is denoted by Φ. Well-formed formulas are denoted by Greek letters ϕ, ψ... The set of all interpretations for Φ is denoted by Ω = 2|P S| , interpretations are denoted by ω, ω 0 ..., and JϕK = {ω ∈ Ω | ω |= ϕ} is the set of all models of ϕ (i.e. all interpretations for which ϕ is true). The underlying idea for constructing morphological operations on logical formulas is to consider formulas and interpretations from a set theoretical perspective. Since Φ is isomorphic to 2Ω up to the syntactic equivalence, i.e., knowing a formula defines completely the set of its models (and conversely, any set of models corresponds to a subset of Φ built of syntactic equivalent formulas), we can identify ϕ with the set of its models JϕK, and then apply set-theoretic morphological operations. We recall that Jϕ ∨ ψK = JϕK ∪ JψK, Jϕ ∧ ψK = JϕK ∩ JψK, JϕK ⊆ JψK iff ϕ |= ψ, and ϕ is consistent iff JϕK 6= ∅. Considering the inclusion relation on 2Ω , (2Ω , ⊆) is a Boolean complete lattice. Similarly a lattice (which is isomorphic to 2Ω ) is defined on Φ≡ , where Φ≡ denotes the quotient space of Φ by the equivalence relation between formulas (with the equivalence defined as ϕ ≡ ψ iff JϕK = JψK). In the following, this is implicitly assumed, W and we simply use the notation Φ. Any subset {ϕ } of Φ has a supremum i i ϕi , and V an infimum i ϕi (corresponding respectively to union and intersection in 2Ω ). The greatest element is > and the smallest one is ⊥ (corresponding respectively to 2Ω and ∅). Based on this lattice structure, it is straightforward to define a dilation as an operation that commutes with the supremum and an erosion as an operation that commutes with the infimum, as in Equations 1 and 2. They naturally inherit all general properties of the algebraic framework. 2.4. Morphological dilation and erosion of logical formulas Using the previous equivalences, we propose to define morphological dilation and erosion of a formula with a structuring element as follows, according to the preliminary work in [10, 11]. The underlying lattice is (Φ≡ , |=), or equivalently (2Ω , ⊆). Since these two lattices are isomorphic, we will use the same notations for morphological operations on each of them. Definition 1. A morphological dilation of a formula ϕ with a structuring element B (B ∈ 2Ω ) is defined through its models as: JδB (ϕ)K = δB (JϕK) = {ω ∈ Ω | B̌ω ∧ ϕ consistent}. (6) Similarly, a morphological erosion is defined as: JεB (ϕ)K = εB (JϕK) = {ω ∈ Ω | Bω |= ϕ}. 6 (7) In these equations, the structuring element B represents a relationship between worlds, i.e. ω 0 ∈ Bω iff ω 0 satisfies some relationship with ω. The condition in Equation 6 expresses that the set of worlds in relation to ω should be consistent with ϕ. The condition in Equation 7 is stronger and expresses that all worlds in relation to ω should be models of ϕ. Note that in this paper we only consider symmetrical structuring elements. There are several possible ways to define structuring elements in the context of formulas. We suggest here a few ones. The relationship can be any relationship between worlds and defines a “neighborhood” of worlds. If it is symmetrical, it leads to symmetrical structuring elements. If it is reflexive, it leads to structuring elements such that ω ∈ Bω , which leads to interesting properties, as will be seen later. For instance, this relationship can be an accessibility relation as in normal modal logics [26] (see [6] for its use to define modalities as morphological operators). An interesting way to choose the relationship is to base it on distances between worlds. This allows defining sequences of increasing structuring elements defined as the balls of a distance. From any distance d between worlds (d : Ω × Ω → R+ ), a distance from a world to a formula is derived as a distance from a point to a set: d(ω, ϕ) = minω0 |=ϕ d(ω, ω 0 ). The most commonly used distance between worlds in knowledge representation (especially in belief revision [14], belief update [27], merging [30] or preference representation [33]) is the Hamming distance dH where dH (ω, ω 0 ) is the number of propositional symbols that are instantiated differently in both worlds. By default, we take d to be dH , and this is the distance we will use in most of the examples developed in this paper. In this case, the distance takes values in N. The extension of what follows to distances taking values in R+ is straightforward. Note that all what follows applies for general dilations, not necessarily derived from dH . Then dilation and erosion of size n are defined from Equations 6 and 7 by using the distance balls of radius n as structuring elements (i.e. Bωn = {ω 0 | d(ω, ω 0 ) ≤ n}): Jδ n (ϕ)K = {ω ∈ Ω | ∃ω 0 ∈ Ω, ω 0 |= ϕ and d(ω, ω 0 ) ≤ n} = {ω ∈ Ω | d(ω, ϕ) ≤ n}, (8) Jεn (ϕ)K = {ω ∈ Ω | ∀ω 0 ∈ Ω, d(ω, ω 0 ) ≤ n ⇒ ω 0 |= ϕ} = {ω ∈ Ω | d(ω, ¬ϕ) > n}. (9) Note that we have δ 0 (ϕ) = ε0 (ϕ) = ϕ. By convention, when there is no ambiguity, we will set δ(ϕ) = δ 1 (ϕ) and ε(ϕ) = ε1 (ϕ). More generally, whatever the operator f , we define f 1 (ϕ) = f (ϕ) and f n (ϕ) = f (f n−1 (ϕ)) for n > 1. From operations with the unit ball we define the external (respectively internal) boundary of ϕ as δ 1 (ϕ) ∧ ¬ϕ (respectively ϕ ∧ ¬ε1 (ϕ)), corresponding to the worlds that are exactly at distance 1 of ϕ (respectively of ¬ϕ). As an illustrative example, let us consider the case where we have three propositional symbols a, b and c. The set of worlds Ω has then 8 elements, which can be represented as the vertices of a cube. In this example, we consider the unit cube of R3 (for N propositional symbols, this generalizes to the hypercube of RN ). For the sake of simplicity, we assimilate a formula formed by a simple conjunction of symbols with its corresponding model. For instance a ∧ b ∧ c is assimilated to the corresponding world in 2Ω , represented by the point (1, 1, 1) in the unit cube. The edges link two worlds differing by one instantiation 7 of a propositional symbol (i.e. at a Hamming distance of 1). For instance vertices representing a ∧ b ∧ c and ¬a ∧ b ∧ c are linked by an edge (we have d(a ∧ b ∧ c, ¬a ∧ b ∧ c) = 1). This is a convenient representation for graphically illustrating the morphological operations, as shown in Figures 2 and 3. The balls of the Hamming distance are used as structuring elements. In Figure 2, we consider a formula ϕ = (a∧b∧c)∨(¬a∧¬b∧c). Its dilation (of size 1, i.e. by a ball of radius 1) is then δ(ϕ) = ¬((a∧¬b∧¬c)∨(¬a∧b∧¬c)) = (¬a∨b∨c)∧(a∨¬b∨c). The dilation of size one just amounts to add to the vertices representing ϕ the vertices linked by an edge to them. In Figure 3, an example of erosion is illustrated, for ϕ = (a∧b∧c)∨(¬a∧b∧c)∨(a∧¬b∧c)∨(¬a∧¬b∧c)∨(¬a∧¬b∧¬c) = c ∨ (¬a ∧ ¬b). The erosion of size 1 is then ε(ϕ) = ¬a ∧ ¬b ∧ c. It amounts to keep in the result only the vertices having all their neighbors (according to the graph defined by the cube) in ϕ. (0, 1, 1) (1, 1, 1) (0, 0, 1) (1, 0, 1) φ (0, 1, 0) (1, 1, 0) (0, 0, 0) δ(φ) (1, 0, 0) Figure 2: Example of a dilation of size 1: ϕ = (a ∧ b ∧ c) ∨ (¬a ∧ ¬b ∧ c) and δ(ϕ) = (¬a ∨ b ∨ c) ∧ (a ∨ ¬b ∨ c). Note that in all figures, the models of the formulas are represented. (0, 1, 1) (1, 1, 1) (1, 0, 1) (0, 0, 1) φ (0, 1, 0) (1, 1, 0) (0, 0, 0) ε(φ) (1, 0, 0) Figure 3: Example of an erosion of size 1: ϕ = (a ∧ b ∧ c) ∨ (¬a ∧ b ∧ c) ∨ (a ∧ ¬b ∧ c) ∨ (¬a ∧ ¬b ∧ c) ∨ (¬a ∧ ¬b ∧ ¬c)(= c ∨ (¬a ∧ ¬b)) and ε(ϕ) = ¬a ∧ ¬b ∧ c. The main properties of dilation and erosion, which are satisfied in mathematical morphology on sets, hold also in the logical setting proposed here. They are summarized below. The proofs are not given here, but they are straightforward based on set/logic equivalences. The dilations and erosions defined in Equations 6, 7, 8, and 9 have the following properties: Adjunction relation: (εB , δB ) is an adjunction, i.e. δB (ψ) |= ϕ iff ψ |= εB (ϕ), for any structuring element B. This shows that the proposed definitions are a particular case of general algebraic dilations and erosions. 8 Commutativity with union or intersection: Dilation commutes with union or disjunction (this is a fundamental property of dilation as mentioned in the general algebraic framework, and is derived from the adjunction property): m for any family ϕ1 , ...ϕm of formulas, we have: δB (∨m i=1 ϕi ) = ∨i=1 δB (ϕi ). Erosion on the other hand commutes with intersection or conjunction. Note that this property is taken as definition in case of a general algebraic dilation or erosion. In general, dilation (respectively erosion) does not commute with intersection (respectively union), and only an inclusion relation holds: δB (ϕ∧ψ) |= δB (ϕ) ∧ δB (ψ). Monotonicity: Both operators are increasing with respect to ϕ, i.e. if ϕ |= ψ, then δB (ϕ) |= δB (ψ) and εB (ϕ) |= εB (ψ), for any structuring element B. Dilation is increasing with respect to the structuring element, while erosion is decreasing, i.e. if ∀ω ∈ Ω, Bω ⊆ Bω0 , then δB (ϕ) |= δB 0 (ϕ) and εB 0 (ϕ) |= εB (ϕ). Extensivity and anti-extensivity: Dilation is extensive (ϕ |= δB (ϕ)) if and only if B is derived from a reflexive relation (as is the case for distance based dilation, since if ω |= ϕ, then d(ω, ϕ) = 0), and erosion is anti-extensive (εB (ϕ) |= ϕ) under the same conditions. We will always assume extensive dilations and anti-extensive erosions in the following. Iteration: Dilation and erosion satisfy an iteration property: 0 ∀B, B 0 , ∀ϕ, δB (δB )(ϕ) = δδB (B 0 ) (ϕ) εB (ε0B )(ϕ) = εδB (B 0 ) (ϕ). For instance for distance based operations, for a distance satisfying the betweeness property2 , this property can be expressed as: 0 0 0 0 0 0 δ n+n (ϕ) = δ n [δ n (ϕ)] = δ n [δ n (ϕ)], εn+n (ϕ) = εn [εn (ϕ)] = εn [εn (ϕ)]. This means that the effect of these operations increases with the size of the structuring element, and that the computation can be done either by successive applications of “small” structuring elements or directly by the sum of the structuring elements. Duality: Dilation and erosion are dual operators with respect to the negation: εB (ϕ) = ¬δB (¬ϕ) which allows deducing properties of an operator from those of its dual operator. Relations to distances: Equation 8 shows how to derive a dilation from a distance. Conversely, from Equation 8 we have: d(ω, ϕ) = min{n ∈ N | ω |= δ n (ϕ)}, and similarly, we have d(ω, ¬ϕ) = min{n ∈ N | ω |= ¬εn (ϕ)}. 2 Let d be a discrete metric on a set M . We say that d has the betweenness property if for all x, y ∈ M and all k ∈ {0, 1, . . . , d(x, y)} there exists z ∈ M such that δ(x, z) = k and δ(z, y) = d(x, y) − k. The Hamming distance has this property. 9 Distances between formulas can also be derived from dilation, as minimum distance and Hausdorff distance3 . For instance the minimum distance is expressed as: dmin (ϕ, ψ) = minω|=ϕ,ω0 |=ψ dH (ω, ω 0 ) = min{n ∈ N | δ n (ϕ) ∧ ψ 6= ∅ and δ n (ψ) ∧ ϕ 6= ∅}. This means that the minimum distance is attained for the minimum size of dilation of both formulas such that they become consistent. The Hausdorff distance is defined as: dHaus (ϕ, ψ) = max(maxω|=ϕ d(ω, ψ), maxω0 |=ψ d(ω 0 , ϕ)). It can be computed from dilation by dHaus (ϕ, ψ) = min{n ∈ N | ϕ |= δ n (ψ) and ψ |= δ n (ϕ)}. These properties will be used intensively in the applications of these operators for knowledge representation and reasoning. 2.5. Some derived operators Conditional dilation and erosion and reconstruction. In a number of problems and applications, we may want to restrict the result of an operation to stay within some domain, or to satisfy a particular formula. This is typically the case for instance if a result has to satisfy a theory, or a set of integrity constraints. This idea calls for geodesic distances, from which structuring elements are derived, as the balls of this distance. Using these structuring elements in the definitions of dilation and erosion (Equations 6 and 7) leads to the notion of geodesic, or conditional, operators. In the discrete case, that we consider here, the expression of these operators is very simple: δψn (ϕ) = [δ 1 (ϕ) ∧ ψ]n , (10) where ψ denotes the conditioning formula, n is the size of the structuring element, δ 1 denotes the dilation using a ball of radius 1 (not geodesic) and the superscript n means that the succession of dilation of size 1 and conjunction has to be performed n times. This equation is a short writing for the following sequence of operations: begin ϕ0 := ϕ ∧ ψ; For i = 1...n ϕi := δ 1 (ϕi−1 ) ∧ ψ; end for Return ϕn = δψn (ϕ) Similarly the geodesic erosion of ϕ conditionally to ψ can be computed as: εnψ (ϕ) = [ε1 (ϕ) ∨ ψ]n . (11) If the conditional dilations are iterated until convergence, then the result is called reconstruction, and is denoted by R(ϕ | ψ): R(ϕ | ψ) = [δ 1 (ϕ) ∧ ψ]∞ . (12) 3 Note that, in constrast to the Hausdorff distance, the minimum distance is improperly called distance since it does not satisfy all the properties of a true metric. 10 Note that in practice this sequence converges in a finite number of steps, when we consider a finite discrete space, as is the case in this paper. An example is illustrated in Figure 4, with the same type of representation as in the previous figures. The reconstruction results in the only connected component of ψ “marked” by ϕ. φ ( U ) ψ R( φ | ψ ) Figure 4: Reconstruction: only the connected component of ψ which is “marked” by ϕ is reconstructed. Searching for the most central models satisfying a formula. In some problems, it might be interesting to find the most relevant worlds that are models of a formula. This problem is solved in [33] by taking the absolute maximum of the internal distance function (i.e. the function that associates to each world its distance to ¬ϕ). Mathematical morphology offers other tools that could also be interesting: Ultimate erosion is one of them. It consists in eroding iteratively ϕ and, at each step n, keeping the connected components of εn (ϕ) that disappear in εn+1 (ϕ). It corresponds exactly to the regional maxima of the internal distance (i.e. the function that assigns to each model of ϕ the distance to its closest model of ¬ϕ). This approach may provide several components, which represent all parts of ϕ, belonging to different connected components, or connected by narrow sets of worlds. This notion can be formalized using the reconstruction operator (Definition 2). Last-non empty erosion only keeps track of the largest component. Erosions are iterated and the last result before the erosion becomes empty is the final result. The result is then more restrictive than with ultimate erosion, and some component of ϕ may not be represented. Definition 3 formalizes this idea. Morphological skeleton is another approach to represent a formula in a compact and “central” way. It is defined as the union of the centers of maximal balls included in the initial formula (see [48] for definitions on sets and corresponding properties). This approach will not be further investigated in this paper. Definition 2. The ultimate erosion is expressed using the reconstruction operator as:  U E(ϕ) = ∪n∈N εn (ϕ) \ R εn+1 (ϕ) | εn (ϕ) . (13) Again in the finite discrete case, the iterative erosion process stops in a finite number of steps. 11 Definition 3. The last erosion of a formula ϕ, denoted by ε` (ϕ), is the erosion of ϕ of the largest possible size such that the set of worlds where ε` (ϕ) is satisfied is not empty or the smallest size of erosion leading to a fixed point:  n ε (ϕ) 6` ⊥, ε` (ϕ) = εn (ϕ) ⇔ (14) and ∀m > n, εm (ϕ) ` ⊥ or εm (ϕ) = εn (ϕ), with n the smallest value for which this holds, and ε0 (ϕ) = ϕ. In the example of Figure 3, the first erosion is also the last non-empty erosion. It is interesting to note that the idea of successive erosions is related to the notions of supermodels [19] and of preferred explanations [37]. For instance, it is easy to prove that ω |= εk (ϕ) iff ω is a (k, 0)-supermodel of ϕ. The application to preferred explanations will be further investigated in Section 6. Opening and closing. Two other important operators are opening and closing. An algebraic opening is an operator that is increasing, idempotent and antiextensive, and an algebraic closing is an operator that is increasing, idempotent and extensive. Typical examples are δε and εδ where (ε, δ) is an adjunction, as seen in the general algebraic framework. An important property if that any disjunction of openings is an opening, and any conjunction of closings is a closing. Opening and closing of a formula ϕ by a structuring element B are defined respectively as: OB (ϕ) = δB (εB (ϕ)), and CB (ϕ) = εB (δB (ϕ)). These two basic morphological filters can be seen as approximation operators, since they “simplify” formulas by either suppressing some irregularities for opening, or adding some parts of ¬ϕ for closing. Families of filters can be built from these two ones. For instance, granulometry [48] consists in applying successively openings with structuring elements of increasing size, such decomposing a formula in parts of different characteristic sizes. Another example is alternate sequential filters [49], which consist in building sequences of opening/closing (or closing/opening), with structuring elements of increasing size. Such transformations are increasing and idempotent, and allow filtering progressively parts of ϕ and ¬ϕ. Note that ε` is an anti-extensive and idempotent operator, but it is not increasing (and hence not an opening). The same applies for ultimate erosion. 2.6. Morphological ordering Given a formula, a natural ordering can be derived from the sequence of its successive erosions and dilations, for a given elementary structuring element (of size 1). This idea is illustrated on sets in Figure 5. This will be particularly interesting in the following, when considering a theory, and for defining a partial order on the models satisfying this theory (by identifying a theory with an equivalent formula). We call it morphological ordering. Definition 4. Let Σ be a theory (represented by a formula) or a formula. Let n be the maximal size of dilation and m the size of the last non-empty erosion, i.e.: εm (Σ) = ε` (Σ), δ n (Σ) = δ` (Σ), 12 Σ x y z Figure 5: Illustration of a natural partial ordering derived from successive erosions (in blue) and dilations (in red) of Σ. We have x f y f z in this example. where δ` is defined in a similar way as the last erosion (and δ` (Σ) can be either > or a fixed point). Then we define the fundamental sequence (Ti ) of subsets of Ω associated with Σ, from i = 0 to i = n + m, as follows:  m−i Jε (Σ)K if i ≤ m Ti = Jδ i−m (Σ)K if i > m The morphological total pre-order associated to Σ is then defined by: ω f ω 0 def ⇔ ∀k (ω 0 ∈ T k ⇒ ω ∈ T k ). (15) The fact that this defines a pre-order is easy to check. Note that this ordering depends on the choice of the elementary structuring element. As an example, let us consider again three propositional symbols, with the same representation as in Figures 2 and 3, and Σ = {a → c, b → c} (represented by the same formula ϕ as in the example of Figure 3). The models of Σ are Ω\{a∧b∧¬c, a∧¬b∧¬c, ¬a∧b∧¬c}. We have Jδ(Σ)K = Ω, Jε(Σ)K = {¬a∧¬b∧c}, and Jε2 (Σ)K = ∅, as illustrated in Figure 6. (0, 1, 1) (0, 0, 1) (1, 1, 1) (1, 0, 1) Σ ε(Σ) (0, 1, 0) (0, 0, 0) (1, 1, 0) δ(Σ) \ Σ (1, 0, 0) Figure 6: Illustration of the morphological ordering (here n = 1, m = 1). This provides a stratification of the elements of Ω, as given in Table 1. Note that in case the last dilation yields a fixed point different from >, the rank of the models in Ω \ Jδ` (Σ)K is set to +∞ by convention. This amounts to ordering only Jδ` (Σ)K. Proposition 1. The following properties hold: 13 0 1 2 ¬a ∧ ¬b ∧ c ¬a ∧ ¬b ∧ ¬c, a ∧ ¬b ∧ c, ¬a ∧ b ∧ c, a ∧ b ∧ c a ∧ ¬b ∧ ¬c, ¬a ∧ b ∧ ¬c, a ∧ b ∧ ¬c Table 1: Stratification of the elements of Ω according to the morphological ordering associated with Σ = {a → c, b → c}. • The subsets Ti of Ω are nested, i.e. ∀i ∈ [0...(n + m − 1)], Ti ⊆ Ti+1 for the considered dilations and erosions (with structuring elements such that ω ∈ Bω ). • The relation f is reflexive and transitive, i.e. a pre-order, which is moreover total. • Let Re be the relation defined on 2Ω by Re (ω, ω 0 ) iff max{k ∈ [0...(n + m)] | ω ∈ T k } = max{k ∈ [0...(n + m)] | ω 0 ∈ T k }. This relation is an equivalence relation and the ordering induced by f on the quotient space 2Ω /Re is a total ordering. Let us briefly comment on the choice of the structuring element used in the morphological operations. When it is taken as a ball of the Hamming distance, as in all examples in this section so far, then the neighborhood it defines is isotropic and all variables are taken into account in the same way. However, different structuring elements could be used, and their choice is a way to impose preferences, for instance on some variables over other ones. As an example, let us consider the following structuring element, defining the neighborhood of any world ω ∈ Ω: Bωab = {ω 0 ∈ Bω | ω(c) = ω 0 (c)}, where B denotes the ball of radius 1 of the Hamming distance, and ω(c) = ω 0 (c) means that c is instantiated in the same way in ω and in ω 0 . With this structuring element, c is not handled in the same way as variables a and b. Note that when performing successive erosions (respectively dilations) with such a structuring element, we may not end up with ⊥ (respectively >), but we may converge towards a fixed point (a subset of Ω). Figure 7 illustrates the effect of this structuring element on the same example as in Figure 6. The derived morphological ordering and the corresponding stratification of Ω is now given in Table 2. (0, 1, 1) (0, 0, 1) (1, 1, 1) (1, 0, 1) Σ ε(Σ) (0, 1, 0) (0, 0, 0) (1, 1, 0) δ(Σ) \ Σ δ 2(Σ) \δ(Σ) (1, 0, 0) Figure 7: Illustration of the morphological ordering (here n = 2, m = 1), using B ab as structuring element. 14 0 1 2 3 ¬a ∧ ¬b ∧ c, a ∧ ¬b ∧ c, ¬a ∧ b ∧ c, a ∧ b ∧ c ¬a ∧ ¬b ∧ ¬c a ∧ ¬b ∧ ¬c, ¬a ∧ b ∧ ¬c a ∧ b ∧ ¬c Table 2: Stratification of the elements of Ω according to the morphological ordering associated with Σ = {a → c, b → c}, using B ab as structuring element. As another way to handle variables differently, let us note that Ω does not need to be “isotropic”, i.e. the cube in our illustrations could be a parallelepiped, with different lengths of the edges, representing the elementary distances between worlds. A distance between two worlds can then be defined as the length of a shortest path in this weighted graph. Structuring elements can be defined as balls of this distance. However, in general this distance does not satisfy the betweenness property, which makes is less interesting for our purpose. It is important to note that the ordering of the elements of Ω depends on both Σ and the definition of erosion and dilation, in particular the choice of the structuring element. This morphological ordering will be used to unify several reasoning tasks, in particular abduction and revision, in Section 6. 3. Computational issues Unless stated otherwise, for all the operators considered here we assume that the structuring element is the ball of radius 1 for the Hamming distance. 3.1. Dilation The commutativity of dilation with disjunction, along with the iteration property, allows us to recover results of [33]. In particular, the following result holds. Proposition 2. Let ϕ be a consistent conjunction of literals, i.e. ϕ = l1 ∧ l2 ∧ ... ∧ ln , then δ 1 (ϕ) = ∨nj=1 (∧i6=j li ). Similarly, if ϕ is a disjunction of literals, i.e. ϕ = l1 ∨ ... ∨ lm , then the erosion is expressed as: ε1 (ϕ) = ∧m j=1 (∨i6=j li ). In these equations δ 1 (respectively ε1 ) denotes the dilation (erosion) using as structuring element a ball of radius 1 of the Hamming distance. This property, together with the commutation of dilation with disjunction, gives the following result [33]: if k is a fixed integer, then the dilation of size k δ k (ϕ) of a DNF formula ϕ can be computed in time O(nk ) – thus in polynomial time. In a similar way, erosion commutes with intersection and can be computed in polynomial time from a CNF formula. When ϕ is not under DNF, computing δ k (ϕ) directly from ϕ (without rewriting ϕ under DNF first) is a difficult problem. However, we can prove a slightly general result: 15 Proposition 3. If φ1 , . . . , φn are such that for all i, j, φi and φj do not share Wn V variables, then δ(φ1 ∧ . . . ∧ φn ) = j=1 δ(φj ) ∧ k6=j φk . Proof: For every interpretation ω let ωi = ω ↓V ar(ϕi ) be the projection of ω on the language of ϕi (V ar(ϕi )). We have ω |= δ(ϕ1 ∧ . . . ∧ ϕn ) if and only if 0 (1) there exists ωP such that ω 0 |= ϕ1 ∧ . . . ∧ ϕn and d(ω, ω 0 ) ≤ 1. 0 Now, d(ω, ω ) = i=1,...,n d(ωi , ωi0 ) (since the ϕi have no variable in common). Therefore, d(ω, ω 0 ) ≤ 1 if and only if there exists a j, j ≤ n, such that: (a) d(ωj , ωj0 ) ≤ 1, and (b) for every k 6= j, ωk = ωk0 . From this we get that (1) is equivalent to: (2) there exists a j, j ≤ n, such that ωj |= δ(ϕj ) and for every k 6= j, ωk |= ϕk . Now, δ(ϕj ) is equivalent to a formula on the language V ar(ϕi ), therefore ω |= δ(ϕj ) iff ωj |= δ(ϕj ), Moreover, ω |= ϕk iff ωk |= ϕk . Therefore, ω |= V δ(ϕ1 ∧ . . . ∧ ϕn ) if and only if there exists a j, j ≤ n, such that ω |= δ(ϕj ) ∧ k6=j ϕk , from which the result follows.  In particular: • if V ar(ϕ) ∩ V ar(ψ) = ∅, then δ(ϕ ∧ ψ) = (ϕ ∧ δ(ψ)) ∨ (δ(ϕ) ∧ ψ); • if ϕ1 , . . . , ϕn are literals whose associatedWvariables are all different, then V n we recover the identity δ(l1 ∧ . . . ∧ ln ) = j=1 k6=j lk . Now, how hard is it to compute dilations (respectively erosions) when ϕ is not under DNF (respectively CNF)? First of all we have the following complexity results. Proposition 4. 1. Given an interpretation ω and a formula ϕ, deciding whether ω |= δ(ϕ) is NP-complete. 2. Given an interpretation ω and a formula ϕ, deciding whether ω |= ε(ϕ) is coNP-complete. Proof: In both cases membership is straightforward. For hardness for point 1 we consider the following reduction from sat: we map every formula α to hϕ, ωi where ϕ = p ∧ α with p 6= V ar(α), and ω being any interpretation satisfying p. Using Proposition 3 we have δ(p ∧ α) ≡ (p ∧ δ(α)) ∨ (δ(p) ∧ α), which is equivalent to α ∨ (p ∧ δ(α)). Now, if α is satisfiable, then so is δ(α). Therefore, ω |= α ∨ (p ∧ δ(α)). If α is unsatisfiable, then so are δ(α) and α ∨ (p ∧ δ(α)). Therefore ω 6|= α∨(p∧δ(α)). The reduction from unsat for point 2 is similar.  This shows that, a fortiori, computing erosion or dilation in the general case is hard. Moreover, the size of ε(ϕ) and δ(ϕ) is not polysize, except if P = NP. It is not sure that there is a way of computing erosion (dilation) being more efficient than first rewriting ϕ under CNF (DNF). Note that inference from the dilation of a formula is (theoretically) not harder than inference from the formula itself. Namely, given any two formulas ϕ and ψ and any integer k, determining whether δ k (ϕ) |= ψ is coNP-complete. Obviously, a similar result holds for inference from erosion. However, interesting results can be obtained for erosion by decomposing a formula into its connected components. Based on the graph interpretation 16 used all through this paper, a connected component is classically defined as a connected component in the graph: we say that ψ is a connected component of ϕ if JψK is a connected component of the graph associated with ϕ (whose set of vertices is JϕK) and whose set of edges is defined by (ω, ω 0 ) whenever d(ω, ω 0 ) ≤ 1). Proposition 5. If d(ϕ, ψ) ≥ 2, for d being the minimum distance between formulas, then ε(ϕ ∨ ψ) ≡ ε(ϕ) ∨ ε(ψ). Proof: Assume d(ϕ, ψ) ≥ 2. We already know that ε(ϕ) ∨ ε(ψ) |= ε(ϕ ∨ ψ), so it remains to be proven that ε(ϕ ∨ ψ) |= ε(ϕ) ∨ ε(ψ). Let ω |= ε(ϕ ∨ ψ). This implies ω |= ϕ ∨ ψ if the erosion is anti-extensive (which is the case in this paper). Without loss of generality, assume ω |= ϕ. Because d(ϕ, ψ) ≥ 2, we have d(ω, ψ) ≥ 2. Now, assume that ω 6|= ε(ϕ), i.e., d(ω, ¬ϕ) ≤ 1; this means that there exists a ω 0 such that ω 0 |= ¬ϕ and d(ω, ω 0 ) = 1 (d(ω, ω 0 ) = 0 is impossible because ω |= ϕ and ω 0 |= ¬ϕ). Now, we must have ω 0 |= ψ; otherwise we would have ω 0 |= ¬ϕ ∧ ¬ψ, hence d(ω, ¬ϕ ∧ ¬ψ) ≤ 1, which contradicts ω |= ε(ϕ ∨ ψ). Therefore, d(ϕ, ψ) ≤ d(ω, ω 0 ) ≤ 1, which contradicts the assumption that d(ϕ, ψ) ≥ 2.  Proposition 6. Let ϕ1 , . . . , ϕp be the connected components of ϕ. Then we have: p _ ε(ϕ) ≡ ε(ϕi ). i=1 Proof: For any two components ϕi , ϕj ofWϕ we have d(ϕi , ϕj ) ≥ Wp distinct connected Wp p 2, therefore, ε( i=1 ϕpW) ≡ i=1 ε(ϕi ); the fact that ϕ ≡ i=1 ϕp enables us to p conclude that ε(ϕ) ≡ i=1 ε(ϕi ).  Now, we have to find a way of (a) computing the connected components of ϕ and (b) computing ε(ϕ). The first step is easy when ϕ is under DNF. We first note the following fact: Proposition 7. Let ϕ = ψ1 ∨ . . . ∨ ψq be a DNF formula. For any i, j ∈ {1, . . . , q}, d(ψi , ψj ) is equal to the number of disagreeing literals between ψi and ψj . For instance, we have d(a ∧ ¬b ∧ c, b ∧ ¬c ∧ d) = 2, d(a ∧ ¬b ∧ c, b ∧ c ∧ d) = 1, and d(a ∧ ¬b ∧ c, c ∧ d) = 0. Proposition 8. Let ϕ = ψ1 ∨ . . . ∨ ψq be a DNF formula. Let Gϕ be the undirected graph defined by its set of vertices JϕK, which can be grouped into subsets {a1 , . . . , aq } where ai = Jψi K, and containing an edge {ai , aj } iff d(ψi , ψj ) ≤ 1. Then the connected components of Gϕ correspond to the connected components W of ϕ, and {ai , i ∈ I ⊆ {1, . . . , q}} is a connected component of Gϕ iff i∈I ψi is a connected component of ϕ. Example 1. Let us consider ϕ = (a ∧ b) ∨ (a ∧ c) ∨ (b ∧ c) ∨ (¬a ∧ ¬b ∧ ¬c ∧ ¬d) (Figure 8). The graph Gϕ has 8 vertices, grouped into 4 subsets ai , and its edges are {a1 , a2 }, {a1 , a3 }, {a2 , a3 }, plus the reflexive edges {a1 , a1 }, 17 {a2 , a2 }, {a3 , a3 }, {a4 , a4 }. Gϕ has two connected components: {a1 , a2 , a3 } = {(0, 1, 1), (1, 1, 1), (1, 0, 1), (1, 1, 0)} and {a4 } = {(0, 0, 0)} (the valuation of d is not represented here), therefore ϕ has two connected components: ϕ1 = (a ∧ b) ∨ (a ∧ c) ∨ (b ∧ c) and ϕ2 = ¬a ∧ ¬b ∧ ¬c ∧ ¬d, from which we have ε(ϕ) = ε(ϕ1 ) ∨ ε(ϕ2 ) = (a ∧ b ∧ c) ∨ ⊥ = a ∧ b ∧ c. (0, 1, 1) (1, 1, 1) (0, 0, 1) (1, 0, 1) φ1 φ2 (0, 1, 0) (1, 1, 0) ε(φ) (0, 0, 0) (1, 0, 0) Figure 8: Decomposition of ϕ into two connected components ϕ1 and ϕ2 , and its erosion (only a, b and c are considered in this representation). 3.2. About last erosion and ultimate erosion Let us consider the last erosion (Definition 3). Denote by `(ϕ) the number of iterations to reach the last non-empty erosion of ϕ. Proposition 9. If 6|= ϕ and ϕ 6≡ > then `(ϕ) ≤ N − 1, where N is the number of propositional symbols in the language. Proof: Let k = `(ϕ). We have ω |= εk (ϕ) if for all ω 0 |= ¬ϕ we have d(ω, ω 0 ) > k. Therefore, k < N , because it can never be the case that d(ω, ω 0 ) > N .  Actually, we can find a better bound for `(ϕ): Proposition 10. If 6|= ϕ and ϕ 6≡ > then `(ϕ) is less than the length of the shortest prime implicate of ϕ (the set of prime implicates being denoted by P I(ϕ)). V Proof: The result follows easily from ϕ ≡ P I(ϕ), from the fact that erosion commutes with conjunction, and from the following expression of the erosion of a disjunction of literals: ε(l1 ∨ ... ∨ lm ) = ∧m j=1 (∨i6=j li ), this result being obtained by duality from Proposition 2 (or directly by induction on m).  For instance let us consider ϕ = (a ↔ b). We have P I(ϕ) = {a ∨ ¬b, ¬a ∨ b}, i.e., every prime implicate of ϕ is of length 2; ε1 (ϕ) = ⊥, therefore `(ϕ) = 0. This example shows that `(ϕ) can be strictly lower than the bound expressed in Proposition 10. Proposition 9 enables us to say that deciding whether ω |= ε` (ϕ) is in BH2 in the Boolean hierarchy of NP sets. Let us now consider ultimate erosion (Definition 2). The following result directly follows from Proposition 6. 18 Proposition 11. WpLet ϕ1 , . . . , ϕp be the connected components of ϕ. Then we have: U E(ϕ) ≡ i=1 U E(ϕi ). Using Proposition 11, the following algorithm computes the ultimate erosion of ϕ. U E(ϕ): begin decompose ϕ into its connected components ϕ1 , . . . , ϕp ; if p = 1 then if ε(ϕ) ≡ ⊥ then return ϕ else return U E(ε(ϕ)) endif else return U E(ϕ1 ) ∨ . . . ∨ U E(ϕn ) endif 3.3. About opening and skeleton A morphological opening is the composition of an erosion followed by a dilation: O(ϕ) = δ(ε(ϕ)). Computing O(ϕ) is not an easy task. If ϕ is in CNF, then δ(ϕ) is computable in polynomial time, and expressible as a polysize CNF, but then δ(ε(ϕ)) is not (and can be exponentially long). If ϕ is in DNF, then ε(ϕ) is not polynomially computable (and can be exponentially long). Proposition 5 gives a hint on how to compute O(ϕ), when ϕ is under DNF. Proposition Wp 12. Let ϕ1 , . . . , ϕp the connected components of ϕ. Then we have: O(ϕ) ≡ i=1 O(ϕi ). This results directly follows from Proposition 6. Let us now consider the skeleton Sk(ϕ). It is defined as the centers of maximal balls of the Hamming distance included in ϕ. In the finite discrete case, it can be computed by the following algorithm: begin Sk(ϕ) := ϕ ∧ ¬O(ϕ); ψ = ϕ While ψ 6≡ ⊥ do Sk(ϕ) := Sk(ϕ) ∨ (ε(ψ) ∧ ¬O(ε(ψ))); ψ := ε(ψ) end while Return Sk(ϕ) We note that the number of iterations performed by this algorithm is equal to min{i, εi (ϕ) ≡ ⊥} and therefore is no larger than N . Example 2. Let us consider again ϕ = (a ∧ b) ∨ (a ∧ c) ∨ (b ∧ c) ∨ (¬a ∧ ¬b ∧ ¬c), as in Figure 8. We have: • O(ϕ) = (a ∧ b) ∨ (a ∧ c) ∨ (b ∧ c) and ϕ ∧ ¬O(ϕ) = (¬a ∧ ¬b ∧ ¬c) which is the center of a maximal ball of radius 0; 19 • ε(ϕ) = a ∧ b ∧ c, O(ε(ϕ)) = ⊥, and ε(ϕ) ∧ ¬O(ε(ϕ)) = a ∧ b ∧ c, which is the center of a maximal ball of radius 1; • the next erosion provides ⊥, so we stop here and return Sk(ϕ) = (¬a ∧ ¬b ∧ ¬c) ∨ (a ∧ b ∧ c). This is illustrated in Figure 9. (0, 1, 1) (0, 0, 1) (1, 1, 1) (1, 0, 1) φ center of maximal ball of radius 0 (0, 1, 0) (0, 0, 0) (1, 1, 0) center of maximal ball of radius 1 U (1, 0, 0) Skel (φ) Figure 9: Skel(ϕ): it is composed of the centers of maximal balls of radius 0 and 1. We see that computing Sk(ϕ) heavily relies on computing O(ϕ). Using the previous results on erosions and openings, we have: Proposition Wp 13. Let ϕ1 , . . . , ϕp the connected components of ϕ. Then we have: Sk(ϕ) ≡ i=1 Sk(ϕi ). 4. Belief revision In this section, we briefly survey some existing revision operators, and show that they can be equivalently expressed using morphological dilations. This establishes a first link between the proposed morpho-logic formalism and some reasoning tools developed for addressing aspects of knowledge dynamics. The morphological expressions will prove useful in Section 6.4 when proposing a unified framework for several reasoning tasks, using both erosions and dilations, and exploiting the morphological ordering introduced in Section 2.6. We start with some basics about belief revision. The aim of belief revision is to model how to incorporate in a coherent way a piece of information to a corpus of beliefs. In the most studied model, the AGM model [4], the corpus of beliefs is represented by a logical theory K and the (new) piece of information by a formula ψ. The result of incorporating ψ to K, i.e. the revision of K by ψ, is denoted by K ? ψ. We give here a very simple presentation of this model in finite propositional logic due to Katsuno and Mendelzon [27] in which the (old) beliefs K are indeed represented by a formula ϕ (that is, K = Cn(ϕ)) and the revision of ϕ by ψ is denoted ϕ ◦ ψ. Note that ◦ is a function mapping a couple of formulas into a formula. This kind of function is called a revision operator4 when it satisfies the following rationality postulates: (R1) ϕ ◦ ψ ` ψ (Success) 4 It is is easy to see that we can define an AGM operator ? starting from ◦, by letting K ? ψ = Cn(ϕ ◦ ψ) where ϕ satisfies K = Cn(ϕ). 20 (R2) (R3) (R4) (R5) (R6) If ϕ ∧ ψ 0 ⊥ then ϕ ◦ ψ ≡ ϕ ∧ ψ (Minimality) If ψ 0 ⊥ then ϕ ◦ ψ 0 ⊥ (Coherence) If ϕ1 ≡ ϕ2 and ψ1 ≡ ψ2 then ϕ1 ◦ ψ1 ≡ ϕ2 ◦ ψ2 (Syntax independence) (ϕ ◦ ψ) ∧ θ ` ϕ ◦ (ψ ∧ θ) (Superexpansion) If (ϕ ◦ ψ) ∧ θ 0 ⊥ then ϕ ◦ (ψ ∧ θ) ` (ϕ ◦ ψ) ∧ θ (Subexpansion) A very powerful tool in order to construct revision operators is the representation theorem [27], based on the notion of faithful assignment. A faithful assignment is a mapping which associates to each formula ϕ a total pre-order ≤ϕ on Ω such that the following conditions hold: (1) if ω |= ϕ and ω 0 |= ϕ then ω ∼ϕ ω 0 ; (2) if ω |= ϕ and ω 0 |= ¬ϕ then ω <ϕ ω 0 ; (3) if |= ϕ1 ↔ ϕ2 then ≤ϕ1 =≤ϕ2 . The representation theorem proven by Katsuno and Mendelzon [27] is the following one: Theorem 1. An operator ◦ is a revision operator ◦, i.e. that satisfies R1R6, iff there exists a faithful assignment that maps each formula ϕ to a total pre-order ≤ϕ such that for every propositional formula ψ we have5 Jϕ ◦ ψK = min(JψK, ≤ϕ ) Intuitively, the pre-order ≤ϕ is a qualitative way to express the distance of a world ω to ϕ, i.e., ω ≤ϕ ω 0 means that ω is closer to ϕ than ω 0 . Actually, a faithful assignment can be defined from a distance d from a world to a formula in the following way: ω ≤ϕ ω 0 iff d(ω, ϕ) ≤ d(ω 0 , ϕ), where d(ω, ϕ) is defined as min{d(ω, ω 00 ) | ω 00 |= ϕ}. In particular, the revision operator induced by the choice of the distance dH is known as Dalal’s revision operator. Now, let us consider the morphological dilation δ defined using as structuring element the ball of radius one of the distance d. It can be easily seen that we have ϕ ◦ ψ = δ n (ϕ) ∧ ψ, with n = min{k ∈ N | δ k (ϕ) ∧ ψ is consistent}. This approach is very natural since it corresponds to a principle of minimal change. The following example illustrates in a precise manner the behavior of this operator. Example 3 (Revision). John knew Linda6 when both of them were PhD students in Philosophy in a very prestigious university. He remembers Linda’s activism in feminism, her brilliant record and her great beauty. Both obtained their PhD degree at the same time. Since then, five years after, John has no news from Linda. However, he thinks that Linda is for sure an activist in feminism, that she occupies an excellent position in a Philosophy Department of 5 The notation min(A, ≤) where ≤ is a total pre-order, stands for {ω ∈ A | ∀ω 0 ∈ A, ω ≤ ω 0 }. 6 This story is inspired by a famous example in Cognitive Psychology of an experiment by Tversky and Kahneman [50]. 21 one prestigious university and she maintains her beauty. John meets Peter, a common classmate, who says him that, surprisingly, Linda is now a bank teller. With this new piece of information John revises his beliefs and he thinks now that Linda is a bank teller who keeps her feminist activism and keeps her beauty. In this problem we code by the atoms a, b and c the facts Linda is a feminist activist, Linda is beautiful and Linda is a Professor respectively, and by ¬c the fact that Linda is not a Professor (for instance the fact that Linda is a bank teller). The formula ϕ := a ∧ b ∧ c codes the beliefs of the agent (John) and the formula ψ := ¬c codes the new information. Then, following the previous definition of the revision operator ◦, we have ϕ ◦ ψ = δ 1 (ϕ) ∧ ¬c. That is because ϕ∧ψ is inconsistent and δ 1 (ϕ)∧ψ is consistent. We have δ 1 (ϕ)∧¬c = a∧b∧¬c, that is Linda keeps her feminist activism, her beauty and she is a bank teller. This example is illustrated in Figure 10, using the same conventions as in Section 2. (0, 1, 1) (1, 1, 1) (1, 0, 1) (0, 0, 1) φ ψ (1, 1, 0) (0, 1, 0) (0, 0, 0) φοψ (1, 0, 0) Figure 10: Example of revision ϕ ◦ ψ, obtained here for a dilation of size n = 1. It is important to point out that within the previous approach, using as structuring element the standard ball of radius 1 (with respect to the Hamming distance in the example), there always exists n such that δ n (ϕ) ≡ > (when ϕ is consistent). This is essentialy the reason why ϕ ◦ ψ is consistent when ϕ is consistent. Also it is the reason why the so called success postulate in belief revision (ϕ ◦ ψ ` ψ) holds. We have also remarked that there are some cases (with special structuring elements) in which we have a fixed point for the dilation, which is not necessary >. For instance, we can have ϕ and n such that δ n (ϕ) = δ n+1 (ϕ) and δ n (ϕ) 6≡ >. What is interesting is that even in such a case we can define interesting and more general revision operators, namely credibility-limited revision operators [13, 23]. The precise way to do that is as follows:  ϕ◦ψ = δ n (ϕ) ∧ ψ ϕ where n = min{k ∈ N | δ k (ϕ) ∧ ψ is consistent} if there is no k such that δ k (ϕ) ∧ ψ 6` ⊥ What is interesting to note is that in this general case, we can encode the credible worlds (see [13]) as Jδ n (ϕ)K, where n is the least integer such that δ n (ϕ) = δ n+1 (ϕ). Let us now consider the more general case, where δ is not necessarily a dilation defined from a distance. We have the following result: Proposition 14. Let δ be an extensive and exhaustive operator (i.e. satisfying the following fillingness property: ∀ϕ, ∃n ∈ N, δ n (ϕ) ≡ >) on the lattice of 22 propositional formulas. Then the operator ◦ defined by: ∀ϕ, ψ, ϕ ◦ ψ = δ n (ϕ) ∧ ψ with n = min{k ∈ N | δ k (ϕ) ∧ ψ is consistent} (the existence of n is guaranteed by the fillingness property), δ 0 (ϕ) = ϕ and δ k (ϕ) = δ(δ k−1 (ϕ)) for k ≥ 1, is a revision operator satisfying the postulates R1-R6. The proof of the previous proposition is based on Theorem 1. Actually, the mapping which associates ϕ to ≤ϕ defined by: ∀ω, ω 0 , ω ≤ϕ ω 0 ⇔ ∀n ∈ N, ω 0 ∈ Jδ n (ϕ)K ⇒ ω ∈ Jδ n (ϕ)K is a faithful assignment and it is not hard to see that for all ψ, Jϕ ◦ ψK = min(JψK, ≤ϕ ), which by Theorem 1 says that ◦ is a revision operator. Typically, δ can be any extensive and exhaustive dilation, but this proposition is slightly more general since it does not require δ to commute with the supremum, nor to be increasing. The minimality property of revision operators has been widely discussed in the literature (see e.g. [29, 43, 44]). Although it is not easy to define in any context in a general way, let us note that, in the particular case of propositional logic, the proposed morphological definition of revision provides a natural way to achieve this minimality in the sense that the set of models is minimally enlarged, which corresponds to the meaning of minimal change in [27]. The proposed approach also provides sound and precise tools to compute minimal revisions. 5. Belief merging In this section, we briefly survey some existing belief merging operators, and show the link with morphological dilations. We now recall some basics about belief merging7 . Belief merging [30, 31, 32] aims at combining several pieces of information when there is no strict precedence between them. The agent faces several conflicting pieces of information coming from several sources of equal reliability8 , and he has to build a coherent description of the world from them. More precisely the inputs of a merging problem are a profile Φ = {ϕ1 , . . . , ϕn }, defined as a multi-set of propositional formulas encoding the different sources of information, and the integrity constraints encoded by a propositional formula µ. The result of merging Φ under the constraint µ is a propositional formula which will be denoted ∆µ (Φ) (when µ ≡ >, we will write simply ∆(Φ) instead of ∆> (Φ)). Thus, the merging model is based on the study and construction of well behaved functions ∆ mapping a couple (Φ, µ) into a formula ∆µ (Φ). Such functions are called merging operators. More precisely, an integrity constraint merging operator (an IC merging operator for short) is a function ∆ satisfying 7 In knowledge dynamics the fusion of pieces of information having a logical representation is usually called belief merging [30, 31, 32]. 8 Actually the sources can have different reliabilities, but we will focus on the case where all the sources have the same reliability; there is already a lot to say in this case. 23 the following rationality postulates: ∆µ (Φ) ` µ If µ V is consistent, then ∆µ (Φ) is consistent V If Φ is consistent with µ, then ∆µ (Φ) ≡ Φ ∧ µ If Φ1 ≡ Φ2 and µ1 ≡ µ2 , then ∆µ1 (Φ1 ) ≡ ∆µ2 (Φ2 ) If ϕ1 ` µ and ϕ2 ` µ, then ∆µ ({ϕ1 , ϕ2 }) ∧ ϕ1 is consistent if and only if ∆µ ({ϕ1 , ϕ2 }) ∧ ϕ2 is consistent (IC5) ∆µ (Φ1 ) ∧ ∆µ (Φ2 ) ` ∆µ (Φ1 t Φ2 ) (IC6) If ∆µ (Φ1 ) ∧ ∆µ (Φ2 ) is consistent, then ∆µ (Φ1 t Φ2 ) ` ∆µ (Φ1 ) ∧ ∆µ (Φ2 ) (IC7) ∆µ1 (Φ) ∧ µ2 ` ∆µ1 ∧µ2 (Φ) (IC8) If ∆µ1 (Φ) ∧ µ2 is consistent, then ∆µ1 ∧µ2 (Φ) ` ∆µ1 (Φ) V where Φ denotes the conjunction of all the formulas of Φ; Φ1 ≡ Φ2 means that there is a bijection f from Φ1 into Φ2 such that for any formula ϕ ∈ Φ1 , we have ϕ ≡ f (ϕ) (in particular, Φ1 and Φ2 have the same cardinality as multisets); the symbol t stands for the multiset union. For a detailed explanation of these postulates, see [31]. However, let us make a comment about Postulate (IC4), known as the fairness postulate. As a matter of fact, this is a very restrictive postulate. Indeed, the only operators satisfying all the postulates are the operators built from distance and aggregation functions (see [32]). Very natural operators fail to satisfy (IC4). In Section 5.2 of [31] there are interesting results around this problem. An operator ∆ is called an IC quasi-merging operator if it satisfies all the previous postulates except (IC6), but instead of this postulate it satisfies the following one: (IC6’) If ∆µ (Φ1 ) ∧ ∆µ (Φ2 ) is consistent, then ∆µ (Φ1 t Φ2 ) ` ∆µ (Φ1 ) ∨ ∆µ (Φ2 ) (IC0) (IC1) (IC2) (IC3) (IC4) In order to establish a representation theorem we need to introduce the notion of syncretic assignment. This is a function mapping each profile Φ to a total pre-order ≤Φ over interpretations such that for any profiles Φ, Φ1 , Φ2 and for any belief bases ϕ, ϕ0 the following conditions hold: (1) If ω |= Φ and ω 0 |= Φ, then ω 'Φ ω 0 (2) If ω |= Φ and ω 0 6|= Φ, then ω <Φ ω 0 (3) If Φ1 ≡ Φ2 , then ≤Φ1 =≤Φ2 (4) ∀ω |= ϕ ∃ω 0 |= ϕ0 ω 0 ≤ϕtϕ0 ω (5) If ω ≤Φ1 ω 0 and ω ≤Φ2 ω 0 , then ω ≤Φ1 tΦ2 ω 0 (6) If ω <Φ1 ω 0 and ω ≤Φ2 ω 0 , then ω <Φ1 tΦ2 ω 0 When the condition (6) is replaced by the following condition (6’) If ω <Φ1 ω 0 and ω <Φ2 ω 0 , then ω <Φ1 tΦ2 ω 0 the assignment is called a quasi-syncretic assignment, that is a function mapping each profile Φ to a total pre-order ≤Φ over interpretations satisfying (1)-(5) and (6’). Now we can state the following representation theorem for merging operators: Theorem 2 ([31]). An operator ∆ is an IC merging operator (or IC quasimerging operator respectively) if and only if there exists a syncretic assignment (or quasi-syncretic assignment respectively) that maps each profile Φ to a total 24 pre-order ≤Φ such that J∆µ (Φ)K = min(JµK, ≤Φ ) A very useful technique to build such operators is based on a distance (actually a pseudo-distance) between interpretations and a numerical aggregation function. We describe how this works more precisely in what follows. A pseudo-distance9 between interpretations is a function d : Ω × Ω 7→ R+ such that for any ω, ω 0 ∈ Ω: d(ω, ω 0 ) = d(ω 0 , ω), and d(ω, ω 0 ) = 0 iff ω = ω 0 . An aggregation function f is a function mapping for any positive integer n, each n-tuple of non negative reals into a positive real such that for any x1 , . . . , xn , x, y ∈ R+ : • if x ≤ y, then f (x1 , . . . , x, . . . , xn ) ≤ f (x1 , . . . , y, . . . , xn ) (monotony) • f (x1 , . . . , xn ) = 0 iff x1 = . . . = xn = 0 (minimality) • f (x) = x (identity) With the help of d and f , a distance between interpretations and an aggregation function respectively, we can construct a total pre-order ≤Φ on interpretations associated with Φ = {ϕ1 , ..., ϕn } in the following way. First, remember that d(ω, ϕ) is minω0 |=ϕ d(ω, ω 0 ). Then, define d(ω, Φ) = f (d(ω, ϕ1 ) . . . , d(ω, ϕn )). Finally, ω ≤Φ ω 0 iff d(ω, Φ) ≤ d(ω 0 , Φ). This process is, actually, an assignment which is in fact a syncretic (or a quasi-syncretic) assignment when the aggregation function has good additional properties such as symmetry, composition and decomposition (see [32]). For instance when f is the function sum or leximin, we obtain a syncretic assignment by the previous process. When f is the function max, we obtain a quasi-syncretic assignment. Thus, in virtue of Theorem 2, the operator defined by the equation J∆µ (Φ)K = min(JµK, ≤Φ ) is an IC merging operator when the aggregation function used is the sum or leximin (Gmax) and is an IC quasi-merging operator when the aggregation function used is the max. They are called in the literature ∆Σ , ∆Gmax and ∆max respectively10 . Let us now establish the links with dilations. Again we consider a dilation δ defined using the balls of the distance d as structuring elements. Then it is not hard to see the following: ∆max (ϕ1 , ..., ϕm ) = δ n (ϕ1 ) ∧ δ n (ϕ2 ) ∧ ... ∧ δ n (ϕm ) ∧ µ, µ where n = min{k ∈ N | δ k (ϕ1 ) ∧ ... ∧ δ k (ϕm ) ∧ µ is consistent}. _ ∆Σ δ n1 (ϕ1 ) ∧ δ n2 (ϕ2 ) ∧ ... ∧ δ nm (ϕm ) ∧ µ, µ (ϕ1 , ..., ϕm ) = (16) (17) (n1 ,...,nm ) Pm where the values n1 , . . . , nm are such that i=1 ni is minimal with δ n1 (ϕ1 ) ∧ δ n2 (ϕ2 ) ∧ ... ∧ δ nm (ϕm ) ∧ µ consistent. An example illustrating the behavior of ∆max is displayed in Figure 11, with the same conventions as in Section 2 and the Hamming distance. Let us consider ϕ = ¬a ∧ ¬b ∧ ¬c, ψ = a ∧ b ∧ ¬c and µ = >. While ϕ ∧ ψ is not consistent, δ 1 (ϕ) ∧ δ 1 (ψ) is, and ∆max (ϕ, ψ) = δ 1 (ϕ) ∧ δ 1 (ψ) = (a ∧ ¬b ∧ ¬c) ∨ (¬a ∧ b ∧ ¬c) (i.e. the merging provides either a or b, exclusively, and ¬c). 9 The triangle inequality is not required. they are called ∆d,Σ , ∆d,Gmax and ∆d,max respectively, to emphasize the chosen distance d. 10 Strictly, 25 φ ψ ∆ max(φ, ψ) Figure 11: Example of fusion ∆max (ϕ, ψ), obtained for a dilation of size n = 1. Next we give a less abstract example. Example 4 (Fusion). Let us consider two agents who want to travel together but have inconsistent preferences. The set of propositional symbols is the set of all countries in the world. Preferences are denoted by formulas ϕ. In this example, we show how dilation can help reaching an agreement between agents. Let us assume that Agent 1 prefers to travel in Spain: ϕ1 = Spain. On the other hand, Agent 2 prefers to travel in Morocco: ϕ2 = M orocco. Hence the two agents have conflicting preferences. However, each agent is now ready to extend his preferences so that the two agents can travel together. This can be simply modeled by a dilation δ, such that some neighbor countries are included in the preferences: δ(ϕ1 ) = Spain ∨ F rance ∨ P ortugal ∨ M orocco δ(ϕ2 ) = M orocco ∨ Algeria ∨ P ortugal ∨ Spain Now the preferences are no more conflicting. The fusion of the agents’ preferences, denoted ∆(ϕ1 , ϕ2 ), can be expressed as the conjunction of the dilated preferences: ∆(ϕ1 , ϕ2 ) = δ(ϕ1 ) ∧ δ(ϕ2 ) = Spain ∨ P ortugal ∨ M orocco. A solution for traveling can then be found in the set of models of these formulas. To go one step further, we can add constraints the agents have to satisfy. For instance if Agent 1 has to stay in Europe and Agent 2 has to stay in a Mediterranean country, these constraints can be taken into account by conditional dilations, thus modifying preferences as: ϕ01 = δ(ϕ1 ) ∧ ψ1 = Spain ∨ F rance ∨ P ortugal, ϕ02 = δ(ϕ2 ) ∧ ψ2 = δ(ϕ2 ), where ψ1 and ψ2 encode the constraints. Then the new set of consistent preferences is given by ϕ0 = ϕ01 ∧ ϕ02 = Spain ∨ P ortugal. Now suppose that the integrity constraints are encoded by a formula µ, which establishes the fact that one and only one country can be visited except Spain and Morocco. In this case, the fusion of ϕ1 and ϕ2 under the constraint µ, denoted ∆µ (ϕ1 , ϕ2 ) is exactly δ(ϕ1 ) ∧ δ(ϕ2 ) ∧ µ, i.e., ∆µ (ϕ1 , ϕ2 ) = P ortugal 26 Equations 16 and 17 allow defining more general merging operators when δ is an extensive and exhaustive operator congruent with logical equivalence, i.e. if ϕ1 ≡ ϕ2 then δ(ϕ1 ) ≡ δ(ϕ2 ). We are going also to consider the following symmetry property for δ, related to the fairness postulate: (IC4): (sym) δ n (ϕ) ∧ ϕ0 6` ⊥ iff δ n (ϕ0 ) ∧ ϕ 6` ⊥ In particular we have the following results: Proposition 15. Let δ be an extensive and exhaustive operator which is congruent with logical equivalence on the lattice of propositional formulas. Then ∆max defined by: µ n n n ∆max µ (ϕ1 , ..., ϕm ) = δ (ϕ1 ) ∧ δ (ϕ2 ) ∧ ... ∧ δ (ϕm ) ∧ µ, where n = min{k ∈ N | δ k (ϕ1 ) ∧ ... ∧ δ k (ϕm ) ∧ µ is consistent} (the existence of n being guaranteed by the fillingness property), is a merging operator satisfying (IC1-IC3), (IC5), (IC6’) and (IC7-IC8). Moreover it satisfies (IC4) iff δ satisfies (sym). Thus, if δ is an extensive and exhaustive operator which is congruent with logical equivalence and satisfies (sym), the operator ∆max is an IC quasi-merging operator. Proof: Define d(ω, ϕ) = n where n = min{k | ω ∈ Jδ k (ϕK}. This function d is well defined because of exhaustivity of δ. Define d(ω, Φ) = max(d(ω, ϕ1 ), . . . , d(ω, ϕn ))) where Φ = {ϕ1 , . . . , ϕn }. Now let ω ≤Φ ω 0 iff d(ω, Φ) ≤ d(ω 0 , Φ). Finally let ∆µ (Φ) be a formula satisfying the following equation: J∆µ (Φ)K = min(JµK, ≤Φ ). This is well defined because δ is congruent with logical equivalence. It is easy to see that ∆max µ (Φ) = ∆µ (Φ). By the hypothesis about δ and the fact that the aggregation function taken is the max function, it is also easy to check that the assignment Φ 7→≤Φ is a quasi-syncretic assignment (property (4) is indeed equivalent to property (sym)). Thus, by virtue of Theorem 2, ∆max is an IC quasi-merging operator.  Proposition 16. Let δ be an extensive and exhaustive operator which is congruent with logical equivalence on the lattice of propositional formulas. Then ∆Σ µ defined by: _ ∆Σ δ n1 (ϕ1 ) ∧ δ n2 (ϕ2 ) ∧ ... ∧ δ nm (ϕm ) ∧ µ, µ (ϕ1 , ..., ϕm ) = (n1 ,...,nm ) P where the numbers n1 , . . . , nm are such that i ni is minimal with δ n1 (ϕ1 ) ∧ δ n2 (ϕ2 ) ∧ ... ∧ δ nm (ϕm ) ∧ µ consistent, is a merging operator satisfying (IC1IC3), (IC5-IC8). Moreover it satisfies (IC4) iff δ satisfies (sym). Thus, if δ is an extensive and exhaustive operator which is congruent with logical equivalence and satisfies (sym), the operator ∆Σ is an IC merging operator. Proof: Similar to the proof of the previous proposition but using the sum (Σ) function instead of the max function.  This approach has been extended in [21] to first order logic, by combining dilation and comparison ordering operators. The merging postulates are then adapted, and conditions on these two operators are established in order to satisfy these postulates. An implementation using binary decision diagrams has furthermore been proposed in [20]. 27 6. Abduction The process of inferring the best explanation of an observation is usually known as abduction. In the logic-based approach to abduction, the background theory is given by a consistent set of formulas11 Σ. The notion of a possible explanation is defined by saying that a formula γ that is consistent with Σ is an explanation of α if Σ ∪ {γ} ` α (this will be written γ `Σ α). An explanatory relation is a binary relation  where the intended meaning of α  γ is “γ is a preferred explanation of α”. In [37], a set of postulates that should be satisfied by preferred explanatory relations was proposed and discussed. The aim of this section is threefold: first, to propose very natural explanatory relations using morphologic that in some cases are computationally tractable; secondly, to examine the adequacy of logical postulates proposed in [37], and thirdly, the discovery of new logical properties for explanatory reasoning. Morphologic allows us to define the most central part of a formula, according to the fundamental principles of this theory (see e.g. [48, 49], and Section 2). Using this notion we define two explanatory relations. The first one, `ne , has the following intended meaning: γ is a preferred explanation of α if every model of Σ ∪ {γ} belongs to the most central part of Σ ∪ {α}. For the second one, `c , we define a sequence which approximates the most central part of Σ; then we say that γ is a preferred explanation of α if γ `Σ α and moreover every model of Σ ∪ {γ} is one of the closest elements of the sequence which are also model of α. In this section, we mostly consider cases where Σ ∧ α 6` ⊥. 6.1. Explanatory relations based on erosion In this section we define precisely the concept of most central part of a formula with the help of the erosion operator. Then, based on this concept, we define two explanatory relations. 6.1.1. Using the last non-empty erosion In this section, we propose to exploit the idea of last erosion ε` (ϕ), as introduced in Definition 3. φ ε(φ) Figure 12: An example of ϕ and its last erosion, equal to ε(ϕ) in this case. 11 Often in this work we will identify a finite set of formulas Σ with the conjunction of all its formulas and, by abuse of language, we continue to call this formula Σ. Thus, for instance, we denote the conjunction of formulas of Σ ∪ {α} by Σ ∧ α. 28 Let us take (see Figure 12) ϕ = (a ∨ ¬b ∨ ¬c) ∧ (a ∨ b ∨ c), and an erosion defined using the balls of the Hamming distance as structuring elements. Using the properties of erosion, and in particular the fact that it commutes with the conjunction, it is easy to derive: ε1 (ϕ) = (a∨¬b)∧(a∨¬c)∧(¬b∨¬c)∧(a∨b)∧(a∨c)∧(b∨c) = (a∧¬b∧c)∨(a∧b∧¬c). Since ε2 (ϕ) ` ⊥, we have ε1 (ϕ) = ε` (ϕ) (its models are in red in Figure 12). A preferred explanation of α is then defined from this operator applied on Σ ∧ α, more precisely: Definition 5. The explanation relations derived from the last non-empty erosion are defined as follows: α `ne γ 1 def ⇔ γ ≡Σ ε` (Σ ∧ α). (18) α `ne γ 2 def γ `Σ ε` (Σ ∧ α). (19) ⇔ The idea of taking the last erosion of Σ ∧ α can be interpreted in terms of robustness. An erosion of size n of a formula is a formula that can be changed while still proving the initial formula. If at most n symbols are changed in εn (ϕ) then ϕ is always satisfied. Here, considering ε` (Σ ∧ α) means that we are looking at the most reduced formula that satisfies Σ ∧ α, i.e. the one that can be changed the most while satisfying Σ ∧ α. Taking ≡Σ or `Σ in Definition 5 is interesting because γ could then have models outside Σ, which may lead to more interesting explanations from a syntactic point of view (note that the syntax of Σ is not taken into account in the proposed approach, since all operations are performed on the models, at a semantic level). However this may also add noise to the explanations. Two possibilities can be suggested to limit this effect: (i) to use ≡ or `, at the price of loosing meaningful explanations in some cases from a syntactical point of view; (ii) to impose that explanations have to be built from a user defined set of atoms. 0 0 It is interesting to note that using `ne 2 , we have for each γ such that γ ∧ γ `ne 0 `ne is consistent α 2 γ ∧ γ . Using 1 avoids this very strong relations with conjunctions. In the following we illustrate the behavior of `ne (similar illustrations can 2 be provided for `ne ). We denote by P E (α) = {γ | α `ne γ} the set of `ne 2 1 2 preferred explanations of α. We can distinguish a subset of P E`ne (α) that con2 tains the simpler (or purer) preferred explanations of α, denoted P P E`ne (α), 2 defined by the following equation: P P E`ne (α) = {γ | γ ` ε` (Σ ∧ α) and γ is consistent} 2 Actually, it is easy to see that the preferred explanations can be defined starting with the pure preferred explanations and adding a little noise. More precisely, P E`ne (α) = {γ ∨ δ | γ ∈ P P E`ne (α) and δ ∈ R}, where R, the 2 2 noise, is defined by R = {δ | δ ∧ Σ ` ⊥}. Let us take Σ = {a ∨ b ∨ c} and α = ϕ where ϕ is defined as in the previous example (Figure 12). Note that Σ ∧ α = ϕ. Thus, the pure preferred explanations of α are P P E`ne (α) = {(a ∧ ¬b ∧ c), (a ∧ b ∧ ¬c), (a ∧ ¬b ∧ c) ∨ (a ∧ b ∧ ¬c)}. 2 29 Erosion does not take in account all “parts” of a formula. Let us take for instance: Σ ∧ α = (a ∨ b) ∧ (a ∨ c) ∧ (b ∨ c) and Σ ∧ β = ((a ∨ b) ∧ (a ∨ c) ∧ (b ∨ c)) ∨ (¬a ∧ ¬b ∧ ¬c) (Figure 13). Then we have: ε` (Σ ∧ α) = ε` (Σ ∧ β) = a ∧ b ∧ c and P E`ne (α) = P E`ne (β) (as well as P P E`ne (α) = P P E`ne (β)). The 2 2 2 2 set of worlds satisfying Σ ∧ β is disconnected, and the connected component containing only (¬a ∧ ¬b ∧ ¬c) is not represented in the explanations of β. This should not be surprising, since any explanatory relation will select some part of an observation as the most relevant one. However, if this is considered to be a problem, it can be avoided by considering the ultimate erosion instead of the last erosion, which will select at least one element of each connected component of an observation (see Section 2.5). ΣΛα U ΣΛβ ε(Σ Λ α) = ε(Σ Λ β) Figure 13: An example of Σ ∧ α and Σ ∧ β that have the same last erosion. Σ ∧ β has two connected components (blue models on the one hand and the cyan one on the other hand), the second one being not represented in the final result. 6.1.2. Using thew last consistent erosion Another idea consists in eroding Σ as much as possible but still under the constraint that it remains consistent with α: ε`c (Σ, α) = εn (Σ) (20) where  n = sup{k ∈ N | εk (Σ) ∧ α 6` ⊥} if n < +∞ 0 n = min{k ∈ N | ∀k 0 > k, εk (Σ) = εk (Σ), εk (Σ) ∧ α 6` ⊥} otherwise. From this operator, we define the following explanatory relation: Definition 6. The explanation operator derived from the notion of last consistent erosion is defined as: α `c γ def ⇔ γ `Σ ε`c (Σ, α) ∧ α. (21) This definition has a different interpretation. Here we consider erosion of Σ alone, which means that we are looking at the formulas that satisfy α while being the most in the theory, i.e. that can be changed while remaining in the theory. As before, we denote P E`c (α) = {γ | α `c γ} the set of preferred explanations of α. We define the set of simpler (or purer) preferred explanations of 30 α (with respect to the relation `c ), denoted P P E`c (α), by the following equation: P P E`c (α) = {γ | γ ` ε`c (Σ, α) ∧ α and γ is consistent} Also, as in the case of last non-empty erosion, we have P E`c (α) = {γ ∨ δ | γ ∈ P P E`c (α) and δ ∈ R}. α Σ ε(Σ) 2 ε (Σ) Figure 14: An example of last consistent erosion. Let us come back to the illustrative example, and take (see Figure 14): Σ = a ∨ b ∨ c, and α = (a ∧ ¬b ∧ c) ∨ (a ∧ b ∧ ¬c) ∨ (a ∧ ¬b ∧ ¬c). We have: ε1 (Σ) = (a ∨ b) ∧ (a ∨ c) ∧ (b ∨ c), ε2 (Σ) = a ∧ b ∧ c, and finally ε3 (Σ) ` ⊥. Therefore: ε1 (Σ) ∧ α = (a ∧ ¬b ∧ c) ∨ (a ∧ b ∧ ¬c) and ε2 (Σ) ∧ α ` ⊥. The value of n in Equation 20 is then equal to 1. For Definition 6, γ can be anything in the set P P E`c (α) = {(a ∧ ¬b ∧ c), (a ∧ b ∧ ¬c), (a ∧ ¬b ∧ c) ∨ (a ∧ b ∧ ¬c)}. To compare `c with `ne , notice that ε1 (Σ ∧ α) =⊥. Hence α `ne γ for any γ `Σ α. In particular, α `ne (a ∧ ¬b ∧ ¬c) which does not hold for `c . There is an alternative way of looking at `c which will be particularly useful in the next section. The iteration of the erosion operator provides a method of linearly pre-ordering the models of Σ, according to the morphological ordering introduced in Section 2 (Definition 4 and Equation 15, considering here only the sequence of successive erosions). It is not difficult to verify that the following holds: α `c γ if and only if JΣ ∧ γK ⊆ min(JΣ ∧ αK, f ). (22) One of the original features of the proposed approach is that minimality is obtained directly, by construction. There is no need for a second step aiming at selecting minimal explanations among hypotheses obtained in a first step. An interpretation can be that the morphological ordering provides a kind of plausibility order among the possible explanations. The preferred explanation is then the most plausible one according to this ordering. 6.2. Examples We will explore some ways of defining structuring elements which are more appropriate for the task of finding explanations. We will analyze the following example through different structuring elements. 31 Example 5. Let us consider the very simple theory Σ1 = {a → c, b → c} (represented by the same formula ϕ as the one in Figure 3), and suppose that the observation is c. What are the “good” explanations of c? We present three different interpretations where the most natural answers would be different. We usually expect that the causes of c are among a, b. Let us consider the following three interpretations, where different explanations may be expected: 1. a = rained last night b = sprinkle was on c = grass is wet The “common sense cautious explanation” of c is a ∨ b. 2. a = low taxes b = investment increases c = economy grows An explanation that enhances the chances of achieving the goal of making the economy to grow is a ∧ b. 3. a b c = book was left somewhere else = somebody took the book = book is not in the shelf An explanation based on the principle of the “Ockham’s razor” will select either a or b but not both, that is to say, (a ∧ ¬b) ∨ (¬a ∧ b). Example 6. Let Ab be a set of atoms (sometimes are called abducibles). As before, Bω denote the ball of radius 1 centered at ω (with respect to the Hamming distance for instance). Let Bωab = {ω 0 ∈ Bω | ω(x) = ω 0 (x) for all x 6∈ Ab}. Bωab contains those valuations in Bω which agree with ω outside Ab. Recall that in Example 5 we consider the following domain theory:  a → c Σ1 = b → c In this example c is the observation to be explained. We usually expect that the causes of c are among a, b, so we set Ab to be {a, b}. We will work with the notion of explanation given by `c . 1. If we use the standard structuring element Bω we obtain that ε1 (Σ) = ¬a ∧ ¬b ∧ c and ε2 (Σ) = ⊥. Thus a preferred explanation of c is ¬a ∧ ¬b ∧ c. 2. Now we use Bωab as structuring element. Then ε1 (Σ) = ε2 (Σ) = Σ ∧ c. Thus a preferred explanation of c is c. The preferred explanation given in the first example above seems to be “wrong” because the expected causes of c should be among a and b. And the second example says nothing about an explanation of c. We will make some comments about this after the next example. 32 Example 7. Let Σ1 and Ab as in Example 6. Let Σ2 = Σ1 ∪ {a ∨ b}. Notice that Σ2 is logically equivalent to {(a ∧ c) ∨ (b ∧ c)}. It models explicitly that a ∨ b is part of the theory, and then causes of c can be found among a and b. 1. With the standard ball Bω we get ε1 (Σ2 ) = ⊥. Thus, ε`c (Σ2 , c) = Σ2 . In particular, c `c (a ∨ b). 2. Now we use Bωab . Then ε1 (Σ2 ) = a ∧ b ∧ c and ε2 (Σ2 ) = ⊥. Thus c `c (a ∧ b). Notice that c  6 `c (a ∨ b). 3. Consider the following structuring element ab Bω,2 = {ω} ∪ {ω 0 ∈ Ω | d(ω, ω 0 ) = 2 and ω(x) = ω 0 (x) for all x 6∈ Ab} where d denotes the Hamming distance. Then ε1 (Σ2 ) = ε2 (Σ2 ) = (¬a ∧ b ∧ c) ∨ (a ∧ ¬b ∧ c). Thus, c `c (a ∧ ¬b) ∨ (¬a ∧ b). Notice that c  6 `c (a ∧ b). In Example 7 we get the “expected” solutions, as described in Example 5. One way to understand it is as follows. Given Σ and a set of atoms Ab, let AbF orm be the set of formulas that use only atoms from Ab. Given an observation formula α, the cautious explanation of α (with respect to (Σ, Ab)) is defined by: _ ce(α) = {γ ∈ Abf orm | Σ 6` ¬γ and Σ ∪ {γ} ` α}. Since the language is finite, restricting the formulas γ appearing in the definition of ce(α) to be a conjunction of literals from Ab, we get that ce(α) is well defined. For instance, in Example 6 we have ce(c) = a ∨ b. By adding to Σ the cautious explanation of the observation we are imposing an extra constraint that helps to find some of its “natural” explanations. The expanded theory seems to be a useful tool for the task of finding “correct” explanations. All this is illustrated by Example 7, where the choice of an appropriate structuring element allows us to find the expected explanations in the three situations presented in Example 5. Table 3 summarizes the results for the last two examples, for Σ1 and Σ2 and the three considered structuring elements (Figure 15). These examples illustrate how different explanations can be obtained using appropriate structuring elements. Roughly speaking, if a and b are incompatible, ab . If then the exclusive disjunction is appropriate, and it is obtained using Bω,2 they are compatible, a parcimonious explanation is the disjunction (as required for instance in model-based diagnosis), obtained for Bω , while a more sure or constrained explanation is the conjunction, obtained for Bωab . 33 ω Bω Σ1 ab Bω Σ2 ab Bω2 Figure 15: Illustration of Σ1 and Σ2 (left) and of three different structuring elements centered at ω (right). Bω Bωab ab Bω,2 Σ1 ¬a ∧ ¬b ∧ c c c Σ2 a∨b a∧b (a ∧ ¬b) ∨ (¬a ∧ b) Table 3: Explanations of observation c for two backgroung theories and three different structuring elements. 6.3. Rationality postulates In this section we study the properties of the two proposed explanatory relations according to the postulates introduced in [37]. The basic rationality postulates for explanatory relations are the following: LLEΣ : RLEΣ : E-CM: E-C-Cut: RS: ROR: LOR: E-DR: E-R-Cut: E-Reflexivity: E-ConΣ : If `Σ α ↔ α0 and α  γ then α0  γ. If `Σ γ ↔ γ 0 and α  γ then α  γ 0 . If α  γ and γ `Σ β then (α ∧ β)  γ. If (α ∧ β)  γ and ∀δ [α  δ ⇒ δ `Σ β ] then α  γ. If α  γ, γ 0 `Σ γ and γ 0 6`Σ ⊥ then α  γ 0 . If α  γ and α  δ then α  (γ ∨ δ). If α  γ and β  γ then (α ∨ β)  γ. If α  γ and β  δ then (α ∨ β)  γ or (α ∨ β)  δ. If (α ∧ β)  γ and ∃δ [α  δ & δ `Σ β] then α  γ. If α  γ then γ  γ. 6`Σ ¬α iff there is γ such that α  γ. The intended meaning and motivation for these postulates can be found in [37]. It is immediate from the definition of `c and `ne that LLEΣ , RLEΣ , RS, ROR, and E-ConΣ are satisfied. Moreover, from the representation of `c given by Equation 22 and some general results of [37] we get the following proposition. Proposition 17. `c is a causal E-rational explanatory relation. In particular, it satisfies LLEΣ , RLEΣ , RS, ROR, E-ConΣ , E-CM and E-R-Cut. From the results in [37] we also know that by being E-rational, `c also satisfies E-C-Cut, E-Reflexivity, E-DR and LOR. However, the situation for `ne 1 is quite different since the basic postulates E-CM and E-C-Cut do not and `ne 2 hold (for a proof of this claim see Appendix A). 34 We introduce a weaker form of these postulates: If α  γ and β  γ then (α ∧ β)  γ. If (α ∧ β)  γ and ∀δ [α  δ ⇒ β  δ ] then α  γ. E-W-CM: E-W-C-Cut: These new postulates might also look natural. However, `ne and `ne 1 2 are the first natural non trivial examples known in the literature that satisfy E-W-CM and E-W-C-Cut but neither E-CM nor E-C-Cut12 . The next proposition collects all the facts we know about `ne and `ne . 1 2 Proposition 18. The explanatory relations `ne and `ne satisfy LLEΣ , 1 2 `ne RLEΣ , ROR, E-W-CM, and E-ConΣ . Moreover 1 satisfies E-Reflexivity and E-W-C-Cut but `ne does not, and `ne satisfies RS but `ne does not. 2 2 1 The proof of this result can be found in Appendix A. For some properties, they may be required or not, depending on the application. For instance the fact that `ne does not satisfy E-Reflexivity is a good 2 point if one wants to avoid “self-explanations”, i.e. γ  γ. We end this section by considering the postulate LOR. Actually, the relations `ne and `ne do not satisfy the postulate LOR (for a counter-example see 1 2 Appendix A). Since E-DR implies LOR [37], then we already know that E-DR and `ne . fails for `ne 1 2 Table 4 summarizes the results we obtained so far. Property LLE RLE E-CM E-W-CM E-C-Cut E-R-Cut E-W-C-Cut E-Reflexivity ROR RS LOR E-DR E-ConΣ `ne 1 (Equation 18) √ √ `ne 2 (Equation 19) √ √ × √ × √ × × √ × × × × √ √ √ √ × × × √ × × √ `c (Equation 21) √ √ √ √ √ √ √ √ √ √ √ √ √ Table 4: Properties of the proposed relations. 12 E-W-CM in fact was already considered by Flach [18] but he did not provide any example for it not satisfying already the stronger version E-CM. 35 6.4. Unified view using the fundamental pre-order f We present in this section a unified treatment of abduction and revision. In particular, we propose to put in the same framework some of the results of Sections 4 and 6 (and [10, 12]), using the fundamental morphological pre-order relation f . In the following we still assume anti-extensive erosions and extensive dilations. There is an alternative way of looking at `c which will be particularly useful in what follows. The iteration of the erosion operator provides a method of linearly pre-ordering the models of Σ. We have already noted that, when α is consistent with Σ, we have a representation of the relation `c in terms of the morphological order given by the equivalence (22). Actually, if we take the following pre-order over the models of Σ: ω ≤E ω 0 def ⇔ ∀k (ω 0 ∈ εk (Σ) → ω ∈ εk (Σ)), (23) it is clear that ≤E and f coincide over JΣK. Thus equivalence (22) can be rewritten as: α `c γ if and only if Jγ ∧ ΣK ⊆ min(JΣ ∧ αK, ≤E ). (24) Let us now come back to the revision based on dilation. As described in Section 4 (see also [10]), the idea is to dilate Σ (which is not necessarily consistent with α) until it becomes consistent with α. Note that Σ is then no more considered as a fixed theory but rather as a background knowledge, which can evolve. More precisely, we define ◦ as:  n δ (Σ) ∧ α where n = min{k ∈ N | δ k (Σ) ∧ α is consistent} Σ◦α= Σ if there is no k such that δ k (ϕ) ∧ ψ 6` ⊥ (25) The iteration of the dilation operator provides a method of linearly preordering the models of Jδ` (Σ)K. Consider the following relation among models: ω ≤D ω 0 def ⇔ ∀k (ω 0 ∈ δ k (Σ) → ω ∈ δ k (Σ)). (26) Indeed, it is clear that ≤D is a total pre-order over Jδ` (Σ)K; we will call it the total preorder associated with Σ using successive dilations. It is not difficult to verify that the following holds:  min(JαK, ≤D ). if α ∧ δ` (Σ) 6` ⊥ JΣ ◦ αK = (27) JΣK if α ∧ δ` (Σ) ` ⊥ Indeed, it is easy to check that over the set Jδ` (Σ)K \ JΣK the relations ≤D and f coincide. By the representation theorem for credibility-limited revision operators (see [13]), it follows from Equation 27 that ◦ is credibility-limited revision operator [13, 23], operators that generalize the classical AGM-revision operators [4, 27]. The pre-order defined by Equations 23 and 26 can be merged in the morphological ordering f introduced in Section 2. By the previous observations, the morphological order f is ≤E over JΣK and ≤D over the set Jδ` (Σ)K \ JΣK. 36 Based on the morphological ordering, we can associate with each observation α the following set of valuations:  min(JαK, f ) if α ∧ δ` (Σ) 6` ⊥ M (α) = JΣK if α ∧ δ` (Σ) ` ⊥ Note that the criterion used to define M (α) is based on the morphology operators δ and ε. The interpretation we give to M (α) is that it contains those worlds that are (morphologically) more relevant given the observation α. Therefore for the task of revising Σ or explaining α we only look at M (α). This will be made precise in the result that follows. We will denote by C(α) the formula whose models are exactly M (α). Theorem 3. Let Σ, α and γ consistent formulas. 1. If α is consistent with Σ, then α `c γ iff γ ` C(α). 2. If α is inconsistent with Σ, then Σ ◦ α = C(α). The previous result suggests the following definitions α f γ def ⇔ γ ` C(α) (28) and Σ ◦f α = C(α) (29) where α and γ are consistent formulas. As an example, let us consider the example in Figure 6 for Σ = Σ1 . For α = (¬a ∧ ¬b ∧ ¬c) ∨ (¬a ∧ ¬b ∧ c) ∨ (¬a ∧ b ∧ ¬c), α is consistent with Σ and its explanation is γ ≡Σ ¬a ∧ ¬b ∧ c, which corresponds to the rank 0 in Table 1. Now if α is reduced to α = ¬a ∧ b ∧ ¬c, then it is no more consistent with Σ and the revision applies. Some comments about these definitions should be made. First of all, even when an observation is inconsistent with the background theory Σ there is a formula γ such that α f γ. That is to say, we can “explain” more observations with f than with `c . The interpretation we give to this fact is that for explaining an observation it is allowed (if necessary) to “change” the background theory. Thus in the explanatory process described by f the observation is absolutely reliable. Notice also that f makes it explicit that some explanations might not be consistent with Σ. The operator ◦f is not an AGM revision operator for Σ (even not a credibilitylimited revision operator), since when the observation α to be incorporated is consistent with Σ we have only Σ ◦f α ` Σ ∧ α, not the equivalence (the equivalence in the case where α and Σ are consistent is just the vacuity postulate, usually denoted by K*4, which is related to the minimality R2). The reason for this is that ◦f is based on preferences on models of Σ , so even when Σ ∧ α is consistent, some sort of central reason for accepting α has to be found. Note that the previous remark says that ◦f does not satisfy the postulate K*4, which has been criticized by some authors in particular in [47]. Unlike Ryan’s operators, which are based on ordered theory presentations, K*4 and success are the only postulates which are not satisfied by ◦f . However, note that ◦f satisfies the modified version of success of credibility-limited revision operators, that is: Σ ◦ α ` α or Σ ◦ α ≡ Σ. 37 7. Final remarks and perspectives We have given the fundamental concepts and techniques in mathematical morphology, and have shown how to interpret these techniques in terms of mathematical logic, namely in propositional logic. This connection has originated a new domain called morphologic. We have used dilation operators in order to define belief revision operators and belief merging operators. We have shown that we can find some operators defined in the literature when the dilation operators come from a distance. Moreover we have extended the class of belief revision operators and the class of belief merging operators by using a larger class of operators, in particular having the extensivity and exhaustivity properties. A similar work has been done using contraction operators. These operators are used in two ways in order to define explanatory relations. It is interesting to note that the use of different structuring elements is determinant in the way the information is structured. The examples in Section 6.2 point out in a clear way this phenomenon. Under the assumption that the geometry comes from the Hamming distance between interpretations, we have shown how to compute dilation, erosion, last erosion, ultimate erosion, opening and skeleton operators over formulas. These calculations constitute the basis of our applications to different tasks in knowledge representation. We have proven that our general operators of revision and fusion are well behaved, in particular they satisfy the AGM postulates and the postulates of integrity constraints belief merging. We have also proven that the explanatory relations defined using morphologic satisfied suitable structural properties. Potential extensions would be to analyze how minimality criteria for could be expressed in the proposed framework, as the ones proposed for abduction [5, 17, 22], revision for Horn clauses [15, 16, 52] or for description logics [1, 39, 40, 41, 42, 51], or more generally for institutions [2] and satisfaction systems [3]. One interesting feature that is worth to remark is the fact that morphologic allows us to give an ordered structure to the pieces of information. That is, it allows having preferences over the formulas. It is exploited by the morphological total pre-order defined by Equation 15. Note that these preferences depend on the structuring element used for defining dilations and erosions. Finally, our approach provides a reusable framework for performing numerous operations on formulas, and includes computational and axiomatic building blocks, to be applied in different reasoning problems. Future work will aim to apply the tools of morphologic in order to explain multiple observations and for putting dynamics in the explanatory process. We also expect to treat mediation process using the tools developed in this work. A. Proofs In this appendix, we provide proofs of certain technical claims. A counter-example of E-CM for `ne and `ne . 2 1 Note that a counter-example of E-CM for `ne is also a counter-example of 1 E-CM for `ne . 2 38 In this example Σ will be {>}, so we will remove it altogether. Let us consider the following formulas: α = ¬a ∨ b ∨ c, β = (¬a ∨ ¬b ∨ ¬c) ∧ (¬a ∨ b ∨ ¬c) α ∧ β = (¬a ∨ ¬b ∨ ¬c) ∧ (¬a ∨ b ∨ ¬c) ∧ (¬a ∨ b ∨ c). Using the computation formulas for erosion of a formula under CNF (Proposition 2), we get: ε1 (α) = (¬a ∨ b) ∧ (¬a ∨ c) ∧ (b ∨ c), ε2 (α) = ¬a ∧ b ∧ c = ε` (α). A unique world satisfies this formula, and therefore no further erosion can be performed (ε3 (α) ` ⊥). Similarly, we have: ε1 (α ∧ β) = ¬a ∧ b ∧ ¬c = ε` (α ∧ β) which is the last non-empty erosion. It follows that α `ne (¬a ∧ b ∧ c); more1 over (¬a ∧ b ∧ c) ` β, but clearly the formula (¬a ∧ b ∧ c) is not a preferred explanation of α ∧ β. A counter-example of E-C-Cut for `ne and `ne . 1 2 As the same counter-example works for `ne and `ne 1 2 , we omit the subscript in the notation of the relation. Again Σ will be {>}. Consider α = a ∨ b ∨ c and β = a ∨ ¬b ∨ ¬c. We have then: ε1 (α) = (a ∨ b) ∧ (a ∨ c) ∧ (b ∨ c), ε2 (α) = a ∧ b ∧ c = ε` (α), ε1 (β) = (a ∨ ¬b) ∧ (a ∨ ¬c) ∧ (¬b ∨ ¬c), ε2 (β) = a ∧ ¬b ∧ ¬c = ε` (β), α ∧ β = (a ∨ b ∨ c) ∧ (a ∨ ¬b ∨ ¬c), ε(α ∧ β) = (a ∧ b ∧ ¬c) ∨ (a ∧ ¬b ∧ c) = ε` (α ∧ β). Let us now set γ = (a ∧ b ∧ ¬c) ∨ (a ∧ ¬b ∧ c), then (α ∧ β) `ne γ. On the other hand, we have that α `ne δ iff δ ≡ a ∧ b ∧ c (in this case there is no noise because Σ = >). Thus if α `ne δ, then δ `Σ β. But it is clear that α  6 `ne γ. A counter-example of LOR for `ne and `ne . 1 2 Again in this counter-example Σ will be {>}. Consider, for `ne : 2 α = (a ∨ b ∨ c) ∧ (a ∨ ¬b ∨ ¬c) and β = (¬a ∨ ¬b ∨ c) ∧ (a ∨ ¬b ∨ c) ∧ (a ∨ b ∨ c). We have: ε1 (α) = (a ∧ b ∧ ¬c) ∨ (a ∧ ¬b ∧ c) = ε` (α), 39 ε1 (β) = a ∧ ¬b ∧ c = ε` (α), α ∨ β = a ∨ b ∨ c, 1 ε ((α ∨ β)) = (a ∨ b) ∧ (a ∨ c) ∧ (b ∨ c), ε2 (α ∨ β) = a ∧ b ∧ c = ε` (α ∨ β). Let γ = a ∧ ¬b ∧ c. Then α `ne γ and β `ne γ, but (α ∨ β)  6 `ne 2 2 2 γ. `ne Now for `ne 1 , let us consider the example in Figure 16. We have α1 γ and `ne β 1 γ for γ = ¬a¬b¬c. But the explanations of α ∨ β are (¬a¬b¬c) ∨ (a¬b¬c). α β γ ε(αV β) Figure 16: Counter-example for LOR for `ne . 1 Proof of Proposition 18. In what follows, we detail E-W-CM, E-W-C-Cut, and E-Reflexivity for `ne 1 and `ne . The other properties are straightforward. In particular it is clear 2 that `ne does not satisfy RS but `ne does satisfy RS. 1 2 (i) E-W-CM. First we prove this property for `ne . Let us assume that γ ≡Σ 1 ε` (Σ ∧ α) with ε` (Σ ∧ α) = εn (Σ ∧ α), and γ ≡Σ ε` (Σ ∧ β) with ε` (Σ ∧ β) = εm (Σ ∧ β). 1. Let us first consider the case where εn+1 (Σ∧α) = ⊥ and εm+1 (Σ∧β) = ⊥. Let us assume that ε` (Σ ∧ α ∧ β) = εk (Σ ∧ α ∧ β). Since erosion commutes with infimum, we have εk (Σ ∧ α ∧ β) = εk (Σ ∧ α) ∧ εk (Σ ∧ β). If k > n or k > m this conjunction would be inconsistent. Therefore we necessarily have k ≤ n and k ≤ m. Without loss of generality, we take n ≤ m. Then εn (Σ ∧ α ∧ β) = εn (Σ ∧ α) ∧ εn (Σ ∧ β). We have εn (Σ ∧ α) ≡Σ γ and γ `Σ εn (Σ ∧ β) since n ≤ m. Hence εn (Σ ∧ α ∧ β) ≡Σ γ. Moreover εn+1 (Σ ∧ α ∧ β) = ⊥. Finally (α ∧ β) `ne γ. 1 2. Let us now consider the case where εn (Σ ∧ α) and εm (Σ ∧ β) are fixed points, and assume n ≤ m. For k = n, we have εk (Σ ∧ α ∧ β) = εn (Σ ∧ α) ∧ εn (Σ ∧ β) ≡Σ γ, for the same reasons as in the first case. Similarly, εn+1 (Σ∧α∧β) = εn+1 (Σ∧α)∧εn+1 (Σ∧β) = εn (Σ∧α)∧εn+1 (Σ∧β) ≡Σ γ (since γ `Σ εn+1 (Σ∧β), or γ ≡Σ εn+1 (Σ∧β) if n = m). This means that a fixed point has been reached (for n erosions or earlier), and (α ∧ β) `ne 1 γ. 3. If εn+1 (Σ ∧ α) = ⊥ and εm+1 (Σ ∧ β) = εm (Σ ∧ β) (fixed point), then the first relation would imply ε(Σ ∧ γ) = ⊥ and the second one ε(Σ ∧ γ) = εm+1 (Σ ∧ β) which is consistent. This leads to a contradiction and this case is not possible. The same reasoning applies if εn+1 (Σ∧α) = εn (Σ∧α) and εm+1 (Σ ∧ β) = ⊥. 40 Now we prove the property for `ne 2 . Thus, let us assume that γ `Σ ε` (Σ∧α) with ε` (Σ ∧ α) = εn (Σ ∧ α), γ `Σ ε` (Σ ∧ β) with ε` (Σ ∧ β) = εm (Σ ∧ β), and that the next erosions are empty. Let us assume that the last non-empty erosion of Σ ∧ α ∧ β is obtained for k. Since the erosion commutes with the conjunction, we have: ε` (Σ ∧ α ∧ β) = εk (Σ ∧ α ∧ β) = εk (Σ ∧ α) ∧ εk (Σ ∧ β). We necessarily have k ≤ n and k ≤ m since otherwise either εk (Σ ∧ α) or k ε (Σ ∧ β) would be inconsistent. This implies, due to the monotonicity property of erosion that: `Σ εn (Σ ∧ α) → εk (Σ ∧ α) and `Σ εm (Σ ∧ β) → εk (Σ ∧ β) from which we derive: `Σ ε` (Σ ∧ α) ∧ ε` (Σ ∧ β) → ε` (Σ ∧ α ∧ β). This interesting general result proves that γ `Σ ε` (Σ ∧ α ∧ β). The proof for the other two cases is similar to the ones for `ne . 1 (ii) E-W-C-Cut. First we prove this property for `ne 1 . Let γ ≡Σ ε` (Σ ∧ α ∧ β). From E-ConΣ , for each consistent α, there exists δ such that α  δ. Since δ ≡Σ ε(Σ ∧ α), δ is unique modulo Σ. We then have β  δ. From E-W-CM, we have α ∧ β  δ, and since the explanation is unique modulo Σ, δ ≡Σ γ, and α  γ. This is a general result: if explanations are unique, then E-ConΣ and E-W-CM imply E-W-C-Cut. Now, let us examine the property for `ne 2 . Thus assume γ `Σ ε` (Σ∧α∧β) = n m ε (Σ ∧ α ∧ β). For all δ such that α `ne 2 δ, i.e. δ `Σ ε` (Σ ∧ α) = ε (Σ ∧ α), we `ne k have β 2 δ, i.e. δ `Σ ε` (Σ ∧ β) = ε (Σ ∧ β). Let us detail in which situations we have γ `Σ εm (Σ ∧ α). First we consider the case where the erosion of the last non-empty erosion is empty. Since Σ ∧ α ∧ β `Σ Σ ∧ α we have: εn (Σ ∧ α ∧ β) 6`Σ ⊥ ⇒ εn (Σ ∧ α) 6`Σ ⊥. Therefore n ≤ m. For the same reason, we necessarily have n ≤ k. Let us first assume that n < m. Since the set of preferred explanations of α is included in the one of β, we have: εm (Σ ∧ α) `Σ εk (Σ ∧ β). Since m > n, we have: εm (Σ ∧ α ∧ β) = εm (Σ ∧ α) ∧ εm (Σ ∧ β) `Σ ⊥. Let us now assume n < k. Then similarly, we have: εk (Σ ∧ α ∧ β) = εk (Σ ∧ α) ∧ εk (Σ ∧ β) `Σ ⊥. If k > m, we have: εm (Σ ∧ β) 6`Σ ⊥, and, since the erosion is decreasing with respect to the size of the structuring element: εk (Σ∧β) `Σ εm (Σ∧β). Therefore: εm (Σ ∧ α) `Σ εk (Σ ∧ β) `Σ εm (Σ ∧ β), which implies: εm (Σ ∧ α ∧ β) 6`Σ ⊥ which leads to a contradiction. Similarly, if k < m, we have: εk (Σ ∧ α) 6`Σ ⊥, and εm (Σ ∧ α) `Σ εk (Σ ∧ α). Therefore, since we had εm (Σ ∧ α) `Σ εk (Σ ∧ β), we have: εk (Σ ∧ α ∧ β) = εk (Σ ∧ α) ∧ εk (Σ ∧ β) 6`Σ ⊥ which also leads to a contradiction. From these two contradictions, we can conclude that necessarily k = m. Then εm (Σ ∧ α) `Σ εk (Σ ∧ β) becomes εm (Σ ∧ α) `Σ εm (Σ ∧ β) and therefore we have: εm (Σ ∧ α ∧ β) = εm (Σ ∧ α) 6`Σ ⊥ 41 which is in contradiction with n < m. Therefore the case n < m and n < k is not possible. If n = m. In this case, we have: εn (Σ ∧ α ∧ β) `Σ εn (Σ ∧ α) ∧ εn (Σ ∧ β) = εm (Σ ∧ α) ∧ εm (Σ ∧ β) `Σ εm (Σ ∧ α), and therefore: γ `Σ εn (Σ ∧ α ∧ β) ⇒ γ `Σ εm (Σ ∧ α), i.e. α `ne γ. This shows that in this particular case, the property holds. 2 Finally, in the last possibility where n < m and k = n, the property does not hold, as shown by the following counter-example, illustrated in Figure 17: Σ = >, Σ ∧ α ∧ β = Σ ∧ β = ε` (Σ ∧ α ∧ β) = ε` (Σ ∧ β), this last erosion being obtained for n = k = 0. For α, ε` (Σ ∧ α) is obtained for m = 1 and has only one model. It is easy to check that for all δ such that δ `Σ ε` (Σ ∧ α), we have δ `Σ ε` (Σ ∧ β). But there is a γ such that γ `Σ ε` (Σ ∧ α ∧ β) and γ 6`Σ ε` (Σ ∧ α). Σ α Σ β=Σ α β ε(Σ α) γ Figure 17: Counter-example for E-W-C-Cut for `ne . 2 Now consider the case where last erosions can be fixed points. Actually, several cases can occur. But before to explore the possible cases, we establish a useful claim: Claim: Under the assumption that the premises of E-W-C-Cut hold, if εk (Σ∧β) 0 is a fixed point, then εm (Σ ∧ α) `Σ εk (Σ ∧ β) `Σ εk (Σ ∧ β) for all k 0 . The reason is that we have εm (Σ ∧ α) `Σ εk (Σ ∧ β) by the hypothesis. And 0 we have εk (Σ ∧ β) `Σ εk (Σ ∧ β) for k 0 < k because of the decreasingness of 0 erosion with respect to k. Also we have εk (Σ ∧ β) `Σ εk (Σ ∧ β) for k ≤ k 0 because of the fixed point property. Now we examine the possible cases: 1. If the last erosion of Σ∧α∧β is a fixed point, i.e. ε` (Σ∧α∧β) = εn (Σ∧α∧ 0 0 0 β) = εn (Σ ∧ α ∧ β) for all n0 ≥ n. This implies that εn (Σ ∧ α) ∧ εn (Σ ∧ β) 0 can never be inconsistent (for all n ). Hence the last erosions of Σ ∧ α and Σ ∧ β have to be fixed points too. Let us denote by m and k the first size of erosions where these fixed points are reached. By the Claim, 0 εm (Σ ∧ α) `Σ εk (Σ ∧ β) `Σ εk (Σ ∧ β) for all k 0 . If n ≥ m we have n n n ε (Σ ∧ α ∧ β) = ε (Σ ∧ α) ∧ ε (Σ ∧ β) = εn (Σ ∧ α) = εm (Σ ∧ α), and γ `Σ εm (Σ ∧ α). If n < m, then similarly εn (Σ ∧ α ∧ β) = εm (Σ ∧ α ∧ β) = εm (Σ ∧ α) and γ `Σ εm (Σ ∧ α). 42 2. If the last erosion of Σ ∧ α is a fixed point. Then, εm (Σ ∧ α) `Σ εk (Σ ∧ β) implies that the last erosion of Σ ∧ β is a fixed point too. By the Claim, 0 εm (Σ ∧ α) `Σ εk (Σ ∧ β) for all k 0 . This means that εn+1 (Σ ∧ α ∧ β) = εn+1 (Σ ∧ α) ∧ εn+1 (Σ ∧ β) can never be inconsistent, and the last erosion of Σ ∧ α ∧ β is a fixed point too. Hence this case is equivalent to the first one. 3. If the last erosion of Σ ∧ β is a fixed point, and εm+1 (Σ ∧ α) = ⊥. Then εm+1 (Σ ∧ α ∧ β) = ⊥, which implies n ≤ m and εn+1 (Σ ∧ α ∧ β) = ⊥. If n < m, then, by the Claim, εm (Σ ∧ α) `Σ εn+1 (Σ ∧ α) ∧ εn+1 (Σ ∧ β) = εn+1 (Σ ∧ α ∧ β) which can therefore not be inconsistent. Hence n = m. Then we have εn (Σ ∧ α ∧ β) = εm (Σ ∧ α) ∧ εm (Σ ∧ β) = εm (Σ ∧ α), and γ `Σ εm (Σ ∧ α). (iii) E-Reflexivity. The definition of `ne is based on the notion of largest possible 1 erosion, and therefore no further erosion can be performed. More precisely, let α `ne γ and suppose that the last non empty erosion of Σ ∧ α is εn (Σ ∧ α). 1 Then we have γ ≡Σ εn (Σ ∧ α). Let us now consider two cases: 1. If εn+1 (Σ∧α) = ⊥, then ε0 (Σ∧γ) = Σ∧γ and ε1 (Σ∧γ) = εn+1 (Σ∧α) = ⊥. Therefore ε` (Σ ∧ γ) = Σ ∧ γ and γ ≡Σ ε` (Σ ∧ γ). Hence γ `ne γ. 1 2. If εn+1 (Σ∧α) = εn (Σ∧α) (fixed point). Then ε0 (Σ∧γ) = εn (Σ∧α) = Σ∧γ and ε1 (Σ ∧ γ) = εn+1 (Σ ∧ α) = εn (Σ ∧ α) = Σ ∧ γ, which is a fixed point of the erosions. Therefore ε` (Σ ∧ γ) = Σ ∧ γ and γ ≡Σ ε` (Σ ∧ γ). Hence γ `ne γ. 1 Now, if we consider `ne 2 , the same reasoning applies in the first case (when the successive erosions end up with ⊥). However it does not apply in the case of non-empty fixed point. Let us for instance consider erosions performed with B ab , as in Example 6, and let us assume that ε` (Σ ∧ α) = c. Let us take γ = (¬a ∧ b ∧ c) ∨ (a ∧ ¬b ∧ c) ∨ (a ∧ b ∧ c) as an explanation of α (we have γ `Σ ε` (Σ ∧ α)). Then ε1 (Σ ∧ γ) = a ∧ b ∧ c = ε` (Σ ∧ γ) (still with B ab as structuring element). However γ 6`Σ a ∧ b ∧ c and therefore γ is not an explanation of γ in this case.  References [1] M. Aiguier, J. Atif, I. Bloch, C. Hudelot, Belief revision, minimal change and relaxation: Part I - A general framework based on the theory of institutions, CoRR abs/1502.02298. [2] M. Aiguier, J. Atif, I. Bloch, C. Hudelot, Belief revision, minimal change and relaxation: Part II - Instantiation in multiple description logics, arXiv CoRR CoRR abs/1502.07628. [3] M. Aiguier, J. Atif, I. Bloch, C. Hudelot, Belief revision, minimal change and relaxation: A general framework based on satisfaction systems, and applications to description logics, Artificial Intelligence to appear. [4] C. E. Alchourrón, P. Gärdenfors, D. Makinson, On the Logic of Theory Change: Partial Meet Contraction and Revision Functions, Journal of Symbolic Logic 50 (1985) 510–530. 43 [5] M. Bienvenu, Complexity of abduction in the el family of lightweight description logics., in: International Conference on Principles of Knowledge Representation and Reasoning (KR), 2008. [6] I. Bloch, Modal Logics based on Mathematical Morphology for Spatial Reasoning, Journal of Applied Non Classical Logics 12 (3-4) (2002) 399– 424. [7] I. Bloch, Lattices of fuzzy sets and bipolar fuzzy sets, and mathematical morphology, Information Sciences 181 (2011) 2002–2015. [8] I. Bloch, A. Bretto, Mathematical morphology on hypergraphs, application to similarity and positive kernel, Computer Vision and Image Understanding 117 (4) (2013) 342–354. [9] I. Bloch, H. Heijmans, C. Ronse, Mathematical Morphology, in: M. Aiello, I. Pratt-Hartman, J. van Benthem (eds.), Handbook of Spatial Logics, chap. 13, Springer, 2007, pp. 857–947. [10] I. Bloch, J. Lang, Towards Mathematical Morpho-Logics, in: 8th International Conference on Information Processing and Management of Uncertainty in Knowledge based Systems IPMU 2000, vol. III, Madrid, Spain, 2000. [11] I. Bloch, J. Lang, Towards Mathematical Morpho-Logics, in: B. BouchonMeunier, J. Gutierrez-Rios, L. Magdalena, R. Yager (eds.), Technologies for Constructing Intelligent Systems, Springer, 2002, pp. 367–380. [12] I. Bloch, R. Pino Pérez, C. Uzcátegui, Explanatory Relations based on Mathematical Morphology, in: ECSQARU 2001, Toulouse, France, 2001. [13] R. Booth, E. Fermé, S. Konieczny, R. Pino Pérez, Credibility-limited revision operators in propositional logic, in: 13th International Conference on Principles of Knowledge Representation and Reasoning (KR 2012), 2012. [14] M. Dalal, Investigations into a Theory of Knowledge Base Revision: Preliminary Report, in: AAAI’88, 1988. [15] J.-P. Delgrande, P. Peppas, Revising Horn theories, in: T. Walsh (ed.), 22nd International Joint Conference on Artificial Intelligence (IJCAI), IJCAI/AAAI, 2011. [16] J.-P. Delgrande, P. Peppas, Belief revision in Horn theories, Artificial Intelligence 218 (2015) 1–22. [17] T. Eiter, G. Gottlob, The complexity of logic-based abduction, Journal of the ACM 42 (1) (1995) 3–42. [18] P. A. Flach, Rationality Postulates for Induction, in: Y. Shoham (ed.), Sixth Conference of Theoretical Aspects of Rationality and Knowledge (TARK96), The Netherlands, 1996. [19] M. L. Ginsberg, A. J. Parkes, A. Roy, Supermodels and Robustness, in: Fifteenth National Conference on Artificial Intelligence AAAI’98, Madison, Wisconsin, 1998. 44 [20] N. Gorogiannis, A. Hunter, Implementing semantic merging operators using binary decision diagrams, International Journal of Approximate Reasoning 49 (1) (2008) 234–251. [21] N. Gorogiannis, A. Hunter, Merging First-Order Knowledge using Dilation Operators, in: Fifth International Symposium on Foundations of Information and Knowledge Systems, FoIKS’08, vol. LNCS 4932, 2008. [22] K. Halland, K. Britz, ABox abduction in ALC using a DL tableau, in: ACM South African Institute for Computer Scientists and Information Technologists Conference, 2012. [23] S. O. Hansson, E. Fermé, J. Cantwell, M. Falappa, Credibility limited revision, Journal of Symbolic Logic 66 (2001) 1581–1596. [24] H. J. A. M. Heijmans, Morphological Image Operators, Academic Press, Boston, 1994. [25] H. J. A. M. Heijmans, C. Ronse, The Algebraic Basis of Mathematical Morphology – Part I: Dilations and Erosions, Computer Vision, Graphics and Image Processing 50 (1990) 245–295. [26] G. E. Hughes, M. J. Cresswell, An Introduction to Modal Logic, Methuen, London, UK, 1968. [27] H. Katsuno, A. O. Mendelzon, Propositional Kowledge Base Revision and Minimal Change, Artificial Intelligence 52 (1991) 263–294. [28] R. Keshet, Mathematical Morphology on Complete Semilattices and its Applications to Image Processing, Fundamenta Informaticae 41 (2000) 33– 56. [29] S. Konieczny, M. Medina Grespan, R. Pino Pŕez, Taxonomy of improvement operators and the problem of minimal change, in: Proceedings of the 12th International Conference on Principles of Knowledge Representation and Reasoning (KR 2010), 2010. [30] S. Konieczny, R. Pino Pérez, On the Logic of Merging, in: 6th International Conference on Principles of Knowledge Representation and Reasoning, Trento, Italy, 1998. [31] S. Konieczny, R. Pino Pérez, Merging Information: A Qualitative Framework, Journal of Logic and Computation 12 (5) (2002) 773–808. [32] S. Konieczny, R. Pino Pérez, Logic based merging, Journal of Philosophical Logic 40 (2) (2011) 239–270. [33] C. Lafage, J. Lang, Logical Representation of Preferences for Group Decision Making, in: A. G. Cohn, F. Giunchiglia, B. Selman (eds.), 7th International Conference on Principles of Knowledge Representation and Reasoning KR 2000, Morgan Kaufmann, San Francisco, CA, Breckenridge, CO, 2000. [34] G. Matheron, Eléments pour une théorie des milieux poreux, Masson, Paris, 1967. 45 [35] G. Matheron, Random Sets and Integral Geometry, Wiley, New-York, 1975. [36] L. Najman, H. Talbot (eds.), Mathematical morphology: from theory to applications, ISTE-Wiley, 2010. [37] R. Pino Pérez, C. Uzcátegui, Jumping to Explanations versus jumping to Conclusions, Artificial Intelligence 111 (1999) 131–169. [38] R. Pino Pérez, C. Uzcátegui, Preferences and explanations, Artificial Intelligence 149 (1) (2003) 1–30. [39] G. Qi, W. Liu, D.-A. Bell, Knowledge base revision in description logics, in: M. Fisher, W. V. der Hoek, B. Konev, A. Lisitsa (eds.), European Conference on Logics in Artificial Intelligence (JELIA), vol. LNCS 4160, Springer-Verlag, 2006. [40] G. Qi, F. Yang, A survey of revision approaches in description logics, in: D. Calvanese, G. Lausen (eds.), Web Reasoning and Rule Systems (RR), Second International Conference, vol. LNCS 5341, Springer-Verlag, 2008. [41] M.-M. Ribeiro, R. Wassermann, AGM revision in description logics, in: First Workshop on Automated Reasoning about Context and Ontology Evolution (ARCOE), 2009. [42] M.-M. Ribeiro, R. Wassermann, More about AGM revision in description logics, in: Second Workshop on Automated Reasoning about Context and Ontology Evolution (ARCOE), 2010. [43] M.-M. Ribeiro, R. Wassermann, Minimal change in AGM for non-classical logics, in: C. Baral, G. D. Giacomo, T. Eiter (eds.), Fourteenth International Conference on Principles of Knowledge Representation and Reasoning (KR), AAAI Press, 2014. [44] M.-M. Ribeiro, R. Wassermann, G. Flouris, G. Antoniou, Minimal change: Relevance and recovery revisited, Artificial Intelligence 201 (2013) 59–80. [45] C. Ronse, Why Mathematical Morphology Needs Complete Lattices, Signal Processing 21 (2) (1990) 129–154. [46] C. Ronse, H. J. A. M. Heijmans, The Algebraic Basis of Mathematical Morphology – Part II: Openings and Closings, Computer Vision, Graphics and Image Processing 54 (1991) 74–97. [47] M. D. Ryan, Belief Revision and Ordered Theory Presentations, in: A. Fuhrmann, H. Rott (eds.), Logic, Action and Information. Also in Eighth Amsterdam Colloquium on Logic, 1991, De Gruyter, 1994, pp. 129–151. [48] J. Serra, Image Analysis and Mathematical Morphology, Academic Press, London, 1982. [49] J. Serra, Image Analysis and Mathematical Morphology, Part II: Theoretical Advances, Academic Press (J. Serra Ed.), London, 1988. [50] A. Tversky, D. Kahneman, Extension versus intuitive reasoning: The conjunction fallacy in probability judgment, Psychological Review 90 (4) (1983) 293–315. 46 [51] Z. Wang, K. Wang, R.-W. Topor, Revising general knowledge bases in description logics, in: F. Lin, U. Sattler, M. Truszczynski (eds.), Twelfth International Conference on Principles of Knowledge Representation and Reasoning (KR), AAAI Press, 2010. [52] Z.-Q. Zhuang, M. Pagnucco, Y. Zhang, Definability of Horn revision from Horn contraction, in: 23rd International Joint Conference on Artificial Intelligence (IJCAI), IJCAI/AAAI, 2013. 47
2cs.AI
arXiv:1606.07948v1 [math.ST] 25 Jun 2016 Bandwidth selection in deconvolution kernel distribution estimators defined by stochastic approximation method with Laplace errors Yousri Slaoui Université de Poitiers Abstract : In this paper we consider the kernel estimators of a distribution function defined by the stochastic approximation algorithm when the observation are contamined by measurement errors. It is well known that this estimators depends heavily on the choice of a smoothing parameter called the bandwidth. We propose a specific second generation plug-in method of the deconvolution kernel distribution estimators defined by the stochastic approximation algorithm. We show that, using the proposed bandwidth selection and the stepsize which minimize the M ISE (Mean Integrated Squared Error), the proposed estimator will be better than the classical one for small sample setting when the error variance is controlled by the noise to signal ratio. We corroborate these theoretical results through simulations and a real dataset. Key words and phrases: Bandwidth selection; Distribution estimation; Stochastic approximation algorithm; Deconvolution; Plug-in methods 1 Introduction We suppose that we observe the contamined data Y1 , . . . , Yn instead of the uncontamined data X1 , . . . , Xn , where Y1 , . . . , Yn are generated from an additive measurement error model Yi = Xi + εi , i = 1, . . . , n and where X1 , . . . , Xn are independent, identically distributed random variables, and let fX and FX denote respectively the probability density and the distribution function of X1 , the errors ε1 , . . . , εn are identically distributed random variables. We assume that X and ε are mutually independent. The distribution function of ε is denoted by Fε , assumed known. This problem is motivated by a wide set of practical applications in different fields such as, for example, astronomy, public health, and econometrics. In the classical deconvolution literature, the error distributions are classified into two classes: Ordinary smooth distribution and supersmooth distribution Fan (1991). Examples of ordinary smooth distributions include Laplacian, gamma, and symmetric gamma; examples of supersmooth distributions are normal, mixture normal and Cauchy. From a theoretical point of view, the rate of convergence cannot be faster than logarithmic for supersmooth errors, whereas for ordinary smooth errors the rate of convergence of FX is of a much better polynomial rate. For a practical point of view, Delaigle & Gijbels (2004) noted that the deconvolution estimators that assume Laplace error always gives better results than the Gaussian case, and as an application, they consider data from the second National Health and Nutrition Examination Survey (NHANES), which is a cohort study consisting of thousands of women who were investigated about their nutrition habits and then evaluated for evidence of cancer. The primary variable of interest in the study of the long-term log daily saturated fat intake which was known to be imprecisely measured, for more details, see Stefanski & Caroll (1990) and Carroll et al. (1995). Throught out this paper we suppose that ε is a centred double exponentielly distributed, also called Laplace distribution, and denoted by ε ∼ Ed (σ), with σ is the scale parameter. To construct a stochastic algorithm, which approximates the function FX at a given point x, we define an algorithm of search of the zero of the function h : y → FX (x) − y. Following Robbins-Monro’s procedure, this algorithm is defined by setting F0,X (x) ∈ R, and, for all n ≥ 1, Fn,X (x) = Fn−1,X (x) + γn Wn , 1 where Wn (x) is an ”observation” of the function h at the point Fn−1,X (x), and the stepsize (γn ) is a sequence of positive real numbers that goes to zero. To define Wn (x), we follow the approach of Révész (1973, 1977), Tsybakov (1990), Mokkadem et al. (2009a,b), and Slaoui (2013, 2014a,b) and we introduce a bandwidth (hn ) (that is, a sequence of positive real numbers that goes to zero), and a kernel R z K (that is, a function satisfying R K (x) dx = 1), a function K (that is, a function defined by K (z) = K (u) du), and a deconvoluting R −∞ kernel K ε defined as follows: Z 1 φK (t) K ε (u) = e−itu   dt, (1) 2π R φε htn  with φL the Fourier transform of a function or a random variable L, and sets Wn (x) = Kε h−1 n (x − Yn ) − Fn−1,X (x). Then, the estimator Fn,X to estimate the distribution function FX at the point x can be written as  (2) Fn,X (x) = (1 − γn ) Fn−1,X (x) + γn Kε h−1 n (x − Yn ) . This estimator was introduced by Slaoui (2014b) in the Q error-free data. Now, we suppose that F0 (x) = 0, and we let Πn = nj=1 (1 − γj ). Then in this paper we propose to study the following estimator of F at the point x:   n X x − Yk ε . (3) Fn,X (x) = Πn Π−1 γ K k k hk k=1 The aim of this paper is to study the properties of the proposed deconvolution kernel distribution estimator defined by the stochastic approximation algorithm (2), and its comparison with the deconvolution Nadaraya’s kernel distribution estimator defined as   n 1 X ε x − Yi e K . (4) Fn,X (x) = n i=1 hn This estimator was introduced by Nadaraya (1964) in the error-free data and whose large and moderate deviation principles were established by Slaoui (2014c) in the context of error-free data. We first compute the bias and the variance of the proposed estimator Fn,X defined by (2). It turns out that they heavily depend on the choice of the stepsize (γn ), and on the distribution of ε and on the kernel K. Moreover, we proposed a plug-in estimate which minimize an estimate of the mean weighted integrated squared error, using the density function as weight function to implement the bandwith selection of the proposed estimator. The remainder of the paper is organized as follows. In Section 2, we state our main results. Section 3 is devoted to our application results, first by simulations (subsection 3.1) and second using real dataset through a plug-in method (subsection 3.2), we give our conclusion in Section 4, whereas the technical details are deferred to Section 5. 2 Assumptions and main results We define the following class of regularly varying sequences. Definition 1. Let γ ∈ R and (vn )n≥1 be a nonrandom positive sequence. We say that (vn ) ∈ GS (γ) if   vn−1 lim n 1 − = γ. n→+∞ vn (5) Condition (5) was introduced by Galambos & Seneta (1973) to define regularly varying sequences (see also Bojanic & Seneta (1973), and by Mokkadem & Pelletier (2007) in the context of stochastic approximation algorithms. Noting that the acronym GS stand for (Galambos & Seneta). Typical sequences in GS (γ) b b are, for b ∈ R, nγ (log n) , nγ (log log n) , and so on. The assumptions to which we shall refer are the following 2 (A1) ε ∼ Ed (σ), i.e. fε (x) = exp (− |x| /σ) / (2σ).  (A2) The function K equal to K (x) = (2π)−1/2 exp −x2 /2 . (A3) i) (γn ) ∈ GS (−α) with α ∈ (1/2, 1]. ii) (hn ) ∈ GS (−a) with a ∈ (0, 1). iii) limn→∞ (nγn ) ∈ (min {2a, (α − 3a) /2} , ∞]. ′ (A4) fX is bounded, differentiable, and fX is bounded. Remark 1. Assumption (A3) (iii) on the limit of (nγn ) as n goes to infinity is usual  in theframework of stochastic −1 is finite. approximation algorithms. It implies in particular that the limit of [nγn ] Throughout this paper we shall use the following notations: ξ = Πn = j=1 I1 = −1 lim (nγn ) n→∞ n Y Z , (6) (1 − γj ) , fY2 (x) dx, I2 = R Z 2 ′ (fX (x)) fY (x) dx. R Our first result is the following Proposition, which gives the bias and the variance of the proposed recursive deconvolution kernel distribution function. ′ Proposition 1 (Bias and variance of Fn,X ). Let Assumptions (A1) − (A4) hold, and assume that fX is continuous at x, then we have 1. If a ∈ (0, α/7], then E [Fn,X (x)] − FX (x) = If a ∈ (α/7, 1), then  1 ′ h2n fX (x) + o h2n . 2 (1 − 2aξ) E [Fn,X (x)] − FX (x) = o  q . γn h−3 n 2. If a ∈ [α/7, 1), then V ar [Fn,X (x)] = If a ∈ (0, α/7), then (7) σ4 γn 1 √ fY (x) + o 4 π (2 − (α − 3a) ξ) h3n  V ar [Fn,X (x)] = o h4n . (8)  γn h3n  . (9) (10) 3. If limn→∞ (nγn ) > max {2a, (α − 3a) /2}, then (7) and (9) hold simultaneously. The bias and the variance of the estimator Fn,X defined by the stochastic approximation algorithm (3) then heavily depend on the choice of the stepsize (γn ). Let us now state the following theorem, which gives the weak convergence rate of the estimator Fn,X defined in (3). ′ Theorem 1 (Weak pointwise convergence rate). Let Assumptions (A1) − (A4) hold, and assume that fX is continuous at x. 3 1. If there exists c ≥ 0 such that γn−1 h7n → c, then  q D γn−1 h3n (Fn,X (x) − FX (x)) → N  √ σ4 1 c ′ fX (x) , √ fY (x) . 2 (1 − 2aξ) 4 π 2 − (α − 3a) ξ 2. If γn−1 h7n → ∞, then 1 1 P (Fn,X (x) − FX (x)) → f ′ (x) , h2n 2 (1 − 2aξ) X D P where → denotes the convergence in distribution, N the Gaussian-distribution and → the convergence in probability. The convergence rate of the proposed estimator (3) is smaller than the ordinary kernel distribution n estimator Slaoui (2014b). This is the price paid for not measuring {εi }i=1 precisely. In order to measure the quality of our proposed estimator (3), we use the following quantity, Z 2 M ISE ∗ [Fn,X ] = E [Fn,X (x) − FX (x)] fY (x) dx R Z Z 2 = (E (Fn,X (x)) − FX (x)) fY (x) dx + V ar (Fn,X (x)) fY (x) dx. R R Moreover, in the case a = α/7, it follows from the proposition 1 that AM ISE ∗ [Fn,X ] = σ4 1 √ h4n I2 . γn h−3 n I1 + 4 π (2 − (α − 3a) ξ) 4 (1 − 2aξ)2 (11) Let us underline that first term in (11) can be larger than the variance component of the integrated mean squared error of the proposed kernel distribution estimator with error free data Slaoui (2014b). Corollary 1 gives the AM ISE ∗ of the proposed deconvolution kernel estimators (2) using the centred double exponentialle error distribution fε (x) = exp (− |x| /σ) / (2σ). Throughout this paper, we used the standard normal kernel. The following corollary gives the bandwidth which minimize the AM ISE ∗ and the corresponding AM ISE ∗ . Corollary 1. Let Assumptions (A1)−(A4) hold. To minimize the AM ISE ∗ of Fn,X , the stepsize (γn ) must be chosen in GS (−1), the bandwidth (hn ) must equal !  1/7  4 1/7 2/7 I1 3σ (1 − 2aξ) 1/7 √ . γn 4 π (2 − (α − 3a) ξ)1/7 I2 Then, the asymptotic dominating term of the M ISE ∗ is AM ISE ∗ [Fn,X ] = 7 12  3σ 4 √ 4 π 4/7 −6/7 (1 − 2aξ) −4/7 (2 − (α − 3a) ξ) 4/7 3/7 I1 I2 γn4/7 .  The following corollary shows that, for a special choice of the stepsize (γn ) = γ0 n−1 , which fulfilled that limn→∞ nγn = γ0 and that (γn ) ∈ GS (−1), the optimal value for hn depend on γ0 and then the corresponding AM ISE ∗ depend on γ0 . Corollary 2. Let Assumptions (A1)−(A4) hold. To minimize the AM ISE ∗ of Fn,X , the stepsize (γn ) must be chosen in GS (−1), limn→∞ nγn = γ0 , and the bandwidth (hn ) must equal !  1/7  4 1/7 I1 3σ 1/7 −1/7 √ . (12) n (γ0 − 2/7) 8 π I2 Then, the asymptotic dominating term of the M ISE ∗ is  4 4/7 3σ γ02 7 4/7 3/7 ∗ √ I I2 n−4/7 . AM ISE [Fn,X ] = 10/7 1 12 8 π (γ0 − 2/7) 4 −10/7 Moreover, the minimum of γ02 (γ0 − 2/7) is reached at γ0 = 1; then the bandwidth (hn ) must equal !  1/7 I1 −1/7 4/7 n . (13) 0.7634 σ I2 Then, the asymptotic dominating term of the M ISE ∗ is 4/7 3/7 AM ISE ∗ [Fn,X ] = 0.3883 σ 16/7 I1 I2 n−4/7 . (14) In order to estimate the optimal bandwidth (13), we must estimate I1 and I2 . We followed the approach of Altman & Leger (1995), which is called the plug-in estimate, and we use the following kernel estimator of I1 introduced in Slaoui (2014a) to implement the bandwidth selection in recursive kernel estimator of probability density function in the error-free context and in Slaoui (2014b) to implement the bandwidth selection in recursive kernel estimator of distribution function also in the error-free data context:   n Πn X −1 −1 ε Yi − Yk b I1 = Πk γk bk Kb , (15) n bk i,k=1 Kbε where is a deconvoluting kernel and b is the associated bandwidth. In practice, we take   Q3 − Q1 −β , β ∈ (0, 1) bn = n min sb, 1.349 (16) (see Silverman (1986)) with sb the sample standard deviation, and Q1 , Q3 denoting the first and third quartiles, respectively. We followed simlar steps as in the previous works (Slaoui (2014a, 2015a)), we prove that in order to minimize the M ISE of Ib1 , the pilot bandwidth (bn ) should belong to GS (−2/9), and the stepsize  (γn ) should be equal to 1.93 n−1 . Then to estimate I1 , we use Ib1 , with bn equal to (16), and β = 2/9. Furthermore, to estimate I2 , we followed the approach of Slaoui (2014a) and we introduced the following kernel estimator: !   n 2 X Π Yi − Yk Y − Y i j ε(1) ε(1) n −1 −1 ′−2 ′−2 , (17) Ib2 = K Πj Πk γj γk bj bk Kb′ ′ b n b′j b′k i,j,k=1 j6=k ε(1) where Kb′ is the first order derivative of a deconvoluting kernel Kb′ , and b′ the associated bandwidth. Following similar steps as in the previous works (Slaoui (2014a, 2015a)), we prove that in order to minimize the M ISE of Ib2 , the pilot bandwidth (bn ) should belong to GS (−1/6), and the stepsize (γn ) should be equal  to 1.736 n−1 . Then to estimate I2 , we use Ib2 , with bn equal to (16), and β = 1/6. Finally, the plug-in estimator of the bandwidth (hn ) using the proposed algorithm (3) must be equal to   ( )1/7 b1 I 0.7634 σ 4/7 (18) n−1/7  . Ib2 Then, it follows from (14) that the asymptotic dominating term of the M ISE ∗ can be estimated by 4/7 3/7 \ AM ISE ∗ [Fn,X ] = 0.3883 σ 16/7 Ib1 Ib2 n−4/7 . Now, let us recall that under the assumptions (A1), (A2), (A3) ii) and (A4), the asymptotic dominating term of the M ISE ∗ of the deconvolution Nadaraya’s kernel distribution estimator Fen,X is given by i h = AM ISE ∗ Fen,X σ4 1 1 √ I1 + h4n I2 . 4 4 π nh3n Lemma 1 gives the AM ISE ∗ of the deconvolution Nadaraya’s kernel distibution (4) estimator using the centred double exponentialle error distribution. 5 Lemma 1. Let Assumptions (A1), (A2), (A3) ii) and (A4) hold. To minimize the AM ISE ∗ of Fen,X , the bandwidth (hn ) must equal !  1/7 I1 −1/7 4/7 n . (19) 0.884σ I2 Then, the asymptotic dominating term of the M ISE ∗ is i h 4/7 3/7 = 0.357 σ 16/7 I1 I2 n−4/7 . AM ISE ∗ Fen,X (20) To estimate the optimal bandwidth (19), we must estimate I1 and I2 . As suggested by Hall & Maron (1987), we use the following kernel estimator of I1 : Ie1 =   n X 1 Yi − Yj ε K . n (n − 1) bn i,j=1 b bn (21) i6=j where (bn ) equal to (16),with β = 2/9. and to estimate I2 , we use the following kernel estimator: Ie2 =     n X Yi − Yk 1 Yi − Yj ε(1) ε(1) K , K ′ ′ b b n3 b4n b′n b′n (22) i,j,k=1 j6=k where (b′n ) equal to (16),with β = 1/6. Finally, the plug-in estimator of the bandwidth (hn ) using the deconvolution Nadaraya’s kernel distribution estimator (4) must be equal to   ( )1/7 e1 I 0.884σ 4/7 (23) n−1/7  . Ie2 Then, it follows from (20) that the asymptotic dominating term of the M ISE ∗ can be estimated by i h 4/7 3/7 = 0.357 σ 16/7 Ie1 Ie2 n−4/7 . AM ISE ∗ Fen,X The following Theorem gives the conditions under which the expected AM ISE ∗ of the proposed estimator Fn,X will be smaller than the expected AM ISE ∗ of the deconvolution Nadaraya’s kernel distribution estimator Fen,X . Following similar steps as in Slaoui (2014a) and Slaoui (2015a), we prove the following Theorem:  Theorem 2. Let the assumptions (A1) − (A4) hold, and the stepsize (γn ) = n−1 . We have E [AM ISE ∗ [Fn,X ]] ii < 1 for small sample setting h h E AM ISE ∗ Fen,X (24) Then, the expected AM ISE ∗ of the proposed estimator defined by (3) is smaller than the expected AM ISE ∗ of the deconvolution Nadaraya’s kernel distribution estimator defined by (4) for small sample setting. 3 Applications The aim of our applications is to compare the performance of the deconvolution Nadaraya’s kernel estimator defined in (4) with that of the proposed deconvolution distribution kernel estimators defined in (2). 6 3.1 Simulations The aim of our simulation study is to compare the performance of the deconvolution Nadaraya’s kernel estimator defined in (4) with that of the proposed deconvolution distribution kernel estimators defined in (3). When applying Fn,X one need to choose three quantities: • The function K, we choose the standard normal kernel.  • The stepsize (γn ) = [2/3 + c] n−1 , with c ∈ [0, 1]. • The bandwidth (hn ) is chosen to be equal to (12). To estimate I1 , we use the estimator Ib1 given in (15), with Kbε is the standard normal kernel, the pilot bandwidth (bn ) is chosen to be equal  to (16), with β = 2/9, and (γn ) = 1.93 n−1 . Moreover, to estimate I2 , we use the estimator Ib2 given in (17), with Kbε′ is the standard normal kernel, the pilot bandwidth (b′n ) is chosen to be  −1 equal to (16), with β = 1/6, and (γn ) = 1.736 n . When applying Fen one need to choose two quantities: • The function K, we use the normal kernel. • The bandwidth (hn ) is chosen to be equal to (19). To estimate I1 , we used the estimator Ie1 given in (21), with Kbε is the standard normal kernel, the pilot bandwidth (bn ) is chosen to be equal to (16), with β = 2/9. Moreover, to estimate I2 , we used the estimator Ie2 given in (22), with Kbε′ is the standard normal kernel, the pilot bandwidth (b′n ) is chosen to be equal to (16), with β = 1/6. In order to investigate the comparison between the two estimators, we consider ε ∼ Ed (σ) (i.e. centred double exponentielle with the scale parameter σ). The error variance was controlled by the noise to signal ratio, denoted by NSR and defined by NSR = V ar (ε) /V ar (X). We consider three sample sizes: n = 25, n = 50 and 150, and five distribution functions : normal N (0, 1/2) (see Table 1), standard normal N (0, 1) (see Table 2), normal N (0, 2) distribution (see Table 3), the normal mixture 21 N (1/2, 1) + 12 N (−1/2, 1) (see Table 4), the exponential distribution of parameter 1/2 E (1/2) (see Table 5). For each of these five cases, 500 samples of sizes n = 25, n = 50 and 150 were generated. For each fixed NSR ∈ [5%, 30%], the number of simulations is 500. We denote by Fi∗ the reference distribution, and by Fi the test distribution, and P then we compute the following measures : Robust Mean Relative Error (RM RE = n−1 i,|Fi |>ε FFi∗ − 1 ), i (which simply is the mean relative error obtained by removing the observations close to zero) and the linear Correlation (Cor = Cov (Fi , Fi∗ ) σ (Fi )−1 σ (Fi∗ )−1 ). From tables 1, 2, 3, 4 and 5, we conclude that (i) in all the cases,  the RM RE of the proposed distribution estimator (2), with the choice of the stepsize (γn ) = n−1 is smaller than the deconvolution Nadaraya’s kernel distribution estimator (4). (ii) the RM RE decrease as the sample size increase. (iii) the RM RE increase as the value of NSR increase. (iv) the CPU time are approximately two times faster using the proposed distribution estimator (2) compared to the deconvolution Nadaraya’s kernel distribution estimator (4). (v) the Cor increase as the sample size increase. (vi) the RM RE decrease as the value of NSR increase. From figures 1, 2, 3, 4 and 5, we conclude that, our proposed kernel distribution estimator (2), with the choice of the stepsize (γn ) = n−1 can be closer to the true distribution function as compared to the deconvolution Nadaraya’s kernel distribution estimator (4), especially for small NSR. For our last choice of distribution function (see 5), even when the value of NSR is equal to 30% our proposed estimator is closer to the true distribution function. 7 1.0 0.8 0.6 Density Reference Nadaraya Proposed estimator 0.0 0.2 0.4 1.0 0.8 0.6 0.4 0.0 0.2 Density Reference Nadaraya Proposed estimator −2 −1 0 1 2 −2 −1 0 1 2 1 2 1.0 Observation 0.4 0.6 Reference Nadaraya Proposed estimator 0.0 0.0 0.2 0.4 Density 0.6 0.8 Reference Nadaraya Proposed estimator 0.2 Density 0.8 1.0 Observation −2 −1 0 1 2 −2 Observation −1 0 Observation Figure 1: Qualitative comparison between the deconvolution  Nadaraya’s estimator (4) and the proposed estimator (2) with the choice of the stepsize (γn ) = n−1 , for 500 samples of size 200, with NSR equal respectively to 5% (in the top left panel), equal to 10% (in the top right panel), equal to 20% (in the down left panel) and equal to 30% (in the down right panel) for the normal distribution X ∼ N (0, 1/2). 3.2 Real Dataset Salmon Dataset: This data is from Simonoff (1996). It concerns the size of the annual spawning stock and its production of new catchable-sized fish for 1940 through 1967 for the Skeena river sockeye salmon stock (in thousands of fish). The dataset was available in the R package idr and contained 28 observations on the following three variables; year, spawness and recruits, for more details see Simonoff (1996). In order to investigate the comparison between the two estimators, we consider the annual recruits : for 500 samples of Laplacian errors ε ∼ Ed (σ), with NSR ∈ [5%, 30%]. For each fixed NSR, we computed the mean (over the 500 samples) of I1 , I2 , hn and AM ISE ∗ . The plug-in estimators (18), (23) requires two kernels to estimate I1 and I2 . In both cases we use the normal kernel with bn and b′n are given in (16), with β equal respectively to 2/9 and 1/6. ∗ ∗ \ ^ From the table 6, we conclude that, the AM ISE of proposed estimator is quite better than the AM ISE of the deconvolution Nadaraya’s kernel distribution estimator. From the figure 6, we conclude that the two estimators present a quite similar behavior for all the fixed NSR. 4 Conclusion This paper propose an automatic selection of the bandwidth of a distribution function in the case of deconvolution kernel estimators with Laplace measurement errors. The estimators are compared to the deconvolution 8 1.0 0.8 0.6 Density Reference Nadaraya Proposed estimator 0.0 0.2 0.4 1.0 0.8 0.6 0.4 0.0 0.2 Density Reference Nadaraya Proposed estimator −2 −1 0 1 2 −2 −1 0 1 2 1 2 1.0 Observation 0.4 0.6 Reference Nadaraya Proposed estimator 0.0 0.0 0.2 0.4 Density 0.6 0.8 Reference Nadaraya Proposed estimator 0.2 Density 0.8 1.0 Observation −2 −1 0 1 2 −2 Observation −1 0 Observation Figure 2: Qualitative comparison between the deconvolution  Nadaraya’s estimator (4) and the proposed estimator (2) with the choice of the stepsize (γn ) = n−1 , for 500 samples of size 200, with NSR equal respectively to 5% (in the top left panel), equal to 10% (in the top right panel), equal to 20% (in the down left panel) and equal to 30% (in the down right panel) for the standard normal distribution X ∼ N (0, 1).  distribution estimator (4). We showed that using the selected bandwidth and the stepsizes (γn ) = n−1 , the proposed estimator will be better than the estimator (4) for small sample setting and when the error variance is controlled by the noise to signal ratio. The simulation study corroborated these theoretical results. Moreover, the simulation results indicate that the proposed estimator was more computing efficiency than the estimator (4). In conclusion, the proposed estimators allowed us to obtain quite better results then the deconvolution Nadaraya’s estimator. Moreover, we plan to make an extensions of our method in future and to consider the case of a regression function (see Mokkadem et al. (2009b) and Slaoui (2015a,b,b, 2016)) in the error-free context, and to consider the case of supersmooth measurements error distribution (e.g. normal distribution). 9 1.0 0.8 0.6 Density Reference Nadaraya Proposed estimator 0.0 0.2 0.4 1.0 0.8 0.6 0.4 0.0 0.2 Density Reference Nadaraya Proposed estimator −2 −1 0 1 2 −2 −1 0 1 2 1 2 1.0 Observation 0.4 0.6 Reference Nadaraya Proposed estimator 0.0 0.0 0.2 0.4 Density 0.6 0.8 Reference Nadaraya Proposed estimator 0.2 Density 0.8 1.0 Observation −2 −1 0 1 2 −2 Observation −1 0 Observation Figure 3: Qualitative comparison between the deconvolution  Nadaraya’s estimator (4) and the proposed estimator (2) with the choice of the stepsize (γn ) = n−1 , for 500 samples of size 200, with NSR equal respectively to 5% (in the top left panel), equal to 10% (in the top right panel), equal to 20% (in the down left panel) and equal to 30% (in the down right panel) for the normal distribution X ∼ N (0, 2). 5 Technical proofs Throughout this section we use the following notations:   x − Xn Zn (x) = K hn   x − Yn Znε (x) = Kε hn Z z 2 K (z) dz µ2 (K) = R Z ψ (K) = zK (z) K (z) dz (25) (26) R Let us first state the following technical lemma. Lemma 2. Let (vn ) ∈ GS (v ∗ ), (γn ) ∈ GS (−α), and m > 0 such that m − v ∗ ξ > 0 where ξ is defined in (6). We have lim vn Πm n n→+∞ n X k=1 Π−m k 1 γk = . vk m − v∗ ξ 10 1.0 0.8 0.6 Density Reference Nadaraya Proposed estimator 0.0 0.2 0.4 1.0 0.8 0.6 0.4 0.0 0.2 Density Reference Nadaraya Proposed estimator −2 −1 0 1 2 −2 −1 0 1 2 1 2 1.0 Observation 0.4 0.6 Reference Nadaraya Proposed estimator 0.0 0.0 0.2 0.4 Density 0.6 0.8 Reference Nadaraya Proposed estimator 0.2 Density 0.8 1.0 Observation −2 −1 0 1 2 −2 Observation −1 0 Observation Figure 4: Qualitative comparison between the deconvolution  Nadaraya’ estimator (4) and the proposed estimator (2) with the choice of the stepsize (γn ) = n−1 , for 500 samples of size 200, with NSR equal respectively to 5% (in the top left panel), equal to 10% (in the top right panel), equal to 20% (in the down left panel) and equal to 30% (in the down right panel) for the normal mixture distribution X ∼ 1/2N (1/2, 1) + 1/2N (−1/2, 1). Moreover, for all positive sequence (αn ) such that limn→+∞ αn = 0, and all δ ∈ R, " n # X −m γk m lim vn Πn Πk αk + δ = 0. n→+∞ vk k=1 Lemma 2 is widely applied throughout the proofs. Let us underline that it is its application, which requires Assumption (A3)(iii) on the limit of (nγn ) as n goes to infinity. Our proofs are organized as follows. Proposition 1 in Section 5.1, Theorem 1 in Section 5.2. 11 1.0 0.4 Density 0.6 0.8 1.0 0.8 0.6 Reference Nadaraya Proposed estimator 0.0 0.2 Density 0.4 0.0 0.2 Reference Nadaraya Proposed estimator 0 2 4 6 8 10 0 2 4 8 10 1.0 0.8 0.6 Density 0.4 0.8 0.6 0.4 Reference Nadaraya Proposed estimator 0.0 0.0 0.2 Reference Nadaraya Proposed estimator 0.2 Density 6 Observation 1.0 Observation 0 2 4 6 8 10 0 Observation 2 4 6 8 10 Observation Figure 5: Qualitative comparison between the deconvolution  Nadaraya’s estimator (4) and the proposed estimator (2) with the choice of the stepsize (γn ) = n−1 , for 500 samples of size 200, with NSR equal respectively to 5% (in the top left panel), equal to 10% (in the top right panel), equal to 20% (in the down left panel) and equal to 30% (in the down right panel) for the exponetial distribution X ∼ E (1/2). 5.1 Proof of Proposition 1 Proof. In view of (3) and (25), we have Fn,X (x) − FX (x) = (1 − γn ) (Fn−1,X (x) − FX (x)) + γn (Znε (x) − FX (x))   n−1 n X Y  = (1 − γj ) γk (Zkε (x) − FX (x)) + γn (Znε (x) − FX (x)) k=1  + j=k+1 n Y j=1 = Πn n X k=1  (1 − γj ) (F0,X (x) − FX (x)) ε Π−1 k γk (Zk (x) − FX (x)) + Πn (F0,X (x) − FX (x)) . It follows that E (Fn,X (x)) − FX (x) = Πn n X k=1 ε Π−1 k γk (E (Zk (x)) − FX (x)) + Πn (F0,X (x) − FX (x)) . 12 (27) 1.0 0.6 Distribution 0.8 Nadaraya Proposed estimator 0.2 0.4 1.0 0.6 0.4 0.0 0.0 0.2 Distribution 0.8 Nadaraya Proposed estimator 2 4 6 8 10 0 2 4 8 10 1.0 0.6 0.8 Nadaraya Proposed estimator 0.2 0.4 0.6 Distribution 0.8 Nadaraya Proposed estimator 0.0 0.0 0.2 Distribution 6 Observation 0.4 1.0 Observation 0 2 4 6 8 10 0 2 Observation 4 6 8 10 Observation Figure 6: Qualitative comparison between the deconvolution Nadaraya’s kernel estimator (4) and the pro posed estimator (2) with the choice of the stepsize (γn ) = n−1 , for 500 samples of Laplacian errors with NSR equal respectively to 5% (in the top left panel), equal to 10% (in the top right panel), equal to 20% (in the down left panel) and equal to 30% (in the down right panel) for the salmon data of the package idr and through a plug-in method. Moreover, an interchange of expectation and integration, justified by Fubini’s Theorem and assumptions (A1) and (A2), shows that E {Zkε (x) |Xk } = Zk (x) , which ensure that E [Zkε (x)] = E [Zk (x)] . Moreover, by integration by parts, we have E [Zk (x)] = Z R = Z K  x−y hk  fX (y) dy K (z) FX (x + zhk ) dz. (28) R It follows that E [Zk (x)] − F (x) = = Z R h2k 2 K (z) [FX (x + zhk ) − FX (x)] dz ′ fX (x) µ2 (K) + βk (x) , 13 (29) with   1 2 2 ′ K (z) FX (x + zhk ) − FX (x) − zhk fX (x) − z hk fX (x) dz, βk (x) = 2 R Z and, since FX is bounded and continuous at x, we have limk→∞ βk (x) = 0. In the case a ≤ α/7, we have limn→∞ (nγn ) > 2a; the application of Lemma 2 then gives E [Fn,X (x)] − FX (x) 1 ′ f (x) 2 X = Z z 2 K (z) dzΠn R n X k=1 2 Π−1 k γk hk [1 + o (1)] + Πn (F0,X (x) − FX (x))   1 = f ′ (x) µ2 (K) h2n + o (1) , 2 (1 − 2aξ) X p  and (7) follows. In the case a > α/7, we have h2n = o γn h−3 , and limn→∞ (nγn ) > (α − 3a) /2, then n Lemma 2 ensures that E [Fn,X (x)] − FX (x) = = which gives (8). Now, we have Π2n V ar [Fn,X (x)] = Π2n = n X k=1 n X k=1 Πn n X Π−1 k γk o k=1 p  o γn h n .  p γk hk + O (Πn ) 2 ε Π−2 k γk V ar [Zk (x)]     2 2 ε 2 − (E (Zk (x))) . Π−2 k γk E (Zk (x)) (30) Moreover, by integration by parts, we have   2 E (Zkε (x)) = = 2 Z   x−y Kε fY (y) dy hk R Z 2 K ε (z) Kε (−z) FY (x + zhk ) dz R = FY (x) − hk fY (x) ψ (K ε ) + νk (x) , (31) with νk (x) = 2 Z R K ε (z) Kε (−z) [FY (x + zhk ) − FY (x) − zhk fY (x)] dz. Let us now state the following lemma: Lemma 3. Let Assumptions (A1) − (A2) hold, then we have ε ψ (K ) 1 = − √ 4 π  σ hk 4 ! + o (1) . −1  Proof. First, under the assumptions (A1) and (A2), we have φε (t) = 1 + σ 2 t2 and φK (t) = exp −t2 /2 , then, it follows from (1), that   Z 2  1 2σ ε 2 K (u) = exp (−itu) exp −t /2 1 + t 2 dt 2π R hn Z  Z 2   1 σ 2 2 2 = exp − itu + t /2 dt + 2 t exp − itu + t /2 dt . 2π hn R R 14 √   R R Moreover, it is easy to check that R exp − itu + t2 /2 dt = 2π and R t2 exp − itu + t2 /2 dt = √   2π exp −u2 /2 1 − u2 , then, it follows that     1 σ2 K ε (u) = √ exp −u2 /2 1 + 2 1 − u2 . (32) hn 2π  Ru Now, we let φ (u) = √12π −∞ exp −t2 /2 dt, then, we can check that  1 σ2 Kε (u) = φ (u) + √ u exp −u2 /2 . 2 2π hn (33) The combinations of equations (26), (32) and (33) leads to Z Z    1 1 σ2 ε 2 u − u3 exp −u2 /2 φ (u) du ψ (K ) = √ u exp −u /2 φ (u) du + √ 2 h 2π R 2π n R Z 4 Z    1 σ2 σ 1 + u2 − u4 exp −u2 du u2 exp −u2 du + 2π h2n R 2π h4n R  4 Z   1 σ4 σ 2 2 4 . = u − u exp −u du + o 2π h4n R h4n  R  R √ √ Moreover, since R u2 exp −u2 du = π/2 and R u4 exp −u2 du = 43 π, we conclude the proof of Lemma 3. Moreover, it follows from (28), that E [Zk (x)] = FX (x) + Z R K (z) [FX (x + zhk ) − FX (x)] dz = FX (x) + νek (x) , with νek (x) = Z R (34) K (z) [FX (x + zhk ) − FX (x)] dz. Then, it follows from (30), (31) and (34), that V ar [Fn,X (x)] = n n X X  2 2 2 ε 2 FY (x) − FX (x) Π2n Π−2 γ − f (x) Π Π−2 Y k n k k γk hk ψ (K ) k=1 k=1  + νk (x) − 2F (x) νek (x) − νek2 (x) Π2n n X 2 Π−2 k γk . (35) k=1 Since FX and FY is bounded continuous, we have limk→∞ νk (x) = 0 and limk→∞ νek (x) = 0. In the case a ≥ α/7, we have limn→∞ (nγn ) > (α − 3a) /2, and the application of Lemma 2 gives   γn h−3 σ4 γn n 2 , FY (x) − FX (x) + √ fY (x) + o γn h−3 n 2 − αξ π 2 − (α − 3a) ξ  4 which proves (9). Now, in the case a < α/7, we have γn h−3 n = o hn , and limn→∞ (nγn ) > 2a, then the application of Lemma 2 gives V ar [Fn,X (x)] = V ar [Fn,X (x)] = Π2n n X k=1 which proves (10). 4 Π−2 k γk o h k  = o h4n , 15  5.2 Proof of Theorem 1 Proof. Let us at first assume that, if a ≥ α/7 then   q σ4 D −1 3 fY (x) . γn hn (Fn,X (x) − E [Fn,X (x)]) → N 0, √ 4 π (2 − (α − 3a) ξ) (36) In the case when a > α/7, Part 1 of Theorem 1 follows from the combination of (8) and (36). In the case when a = α/7, Parts 1 and 2 of Theorem 1 follow from the combination of (7) and (36). In the case a < α/7, (10) implies that P h−2 n (Fn,X (x) − E (Fn,X (x))) → 0, and the application of (7) gives Part 2 of Theorem 1. We now prove (36).In view of (3), we have Fn,X (x) − E [Fn,X (x)] = (1 − γn ) (Fn−1,X (x) − E [Fn−1,X (x)]) + γn (Znε (x) − E [Zn (x)]) n X ε = Πn Π−1 k γk (Zk (x) − E [Zk (x)]) . k=1 Set ε Yk (x) = Π−1 k γk (Zk (x) − E (Zk (x))) . The application of Lemma 2 ensures that vn2 = = = n X k=1 n X k=1 n X V ar (Yk (x)) 2 ε Π−2 k γk V ar (Zk (x)) 2 Π−2 k γk k=1 =   σ 4 −3 √ hk fY (x) + o (1) 4 π  4  1 σ γn √ f (x) + o (1) . Y h3n Π2n 4 π (2 − (α − 3a) ξ) On the other hand, we have, for all p > 0, i h E |Zkε (x)|2+p = O (1) , and, since limn→∞ (nγn ) > α/2, there exists p > 0 such that limn→∞ (nγn ) > get n X k=1 h E |Yk (x)| 2+p i = = = n X O O O  k=1 n X Π−2−p γk2+p E k Π−2−p γk2+p k k=1  γn1+p , Π2+p n ! h |Zk (x)| 1+p 2+p α. 2+p ! i and we thus obtain 1 vn2+p n X k=1 i h = E |Yk (x)|2+p   3+ 3 p O γnp/2 hn 2 = o (1) . The convergence in (36) then follows from the application of Lyapounov’s Theorem. 16 Applying Lemma 2, we References Altman, N. & Leger, C. (1995). Bandwidth selection for kernel distribution function estimation. J. Statist. Plann. Inference. 46, 195–214. Bojanic, R. & Seneta, E. (1973). A unified theory of regularly varying sequences. Math. Z. 134, 91–106. Galambos, J. & Seneta, E. (1973). Regularly varying sequences. Amer. Math. Soc. 41, 110–116. Carroll, R.J., Ruppert, D. & Stefanski, L. (1995). Measurement Error in Nonlinear Models. Chapman & Hall, London. Delaigle, A. & Gijbels, I. (2004). Practical Bandwidth Selection in Deconvolution Kernel Density Estimation. Comput. Statist. Data Anal. 45, 249–267. Fan, J. (1991) On the optimal rates of convergence for nonparametric deconvolution problems. Ann. Statist 19, 1257–1272. Hall, P. & Maron, J. S. (1987). Estimation of integrated squared density derivatives. Statist. Probab. Lett. 6, 109–115. Mokkadem, A. & Pelletier, M. (2007). A companion for the Kiefer-Wolfowitz-Blum stochastic approximation algorithm. Ann. Statist. 35, 1749–1772. Mokkadem, A. Pelletier, M. & Slaoui, Y. (2009a). The stochastic approximation method for the estimation of a multivariate probability density. J. Statist. Plann. Inference. 139, 2459–2478. Mokkadem, A. Pelletier, M. and Slaoui, Y. (2009b). Revisiting Révész’s stochastic approximation method for the estimation of a regression function. ALEA. Latin American Journal of Probability and Mathematical Statistics, 6, 63–114. Nadaraya, E. A. (1964). Some New Estimates for Distribution Functions. Theory Probab. Appl. 9, 497–500. Révész, P. (1973). Robbins-Monro procedure in a Hilbert space and its application in the theory of learning processes I. Studia Sci. Math. Hung. 8, 391–398. Révész, P. (1977). How to apply the method of stochastic approximation in the non-parametric estimation of a regression function. Math. Operationsforsch. Statist., Ser. Statistics. 8, 119–126. Silverman, B. W. (1986). Density estimation for statistics and data analysis. Chapman & Hall, London. Simonoff, J. S. (1996). Smoothing Methods in Statistics. New York, Spinger-Verlag. Slaoui, Y. (2013). Large and moderate deviation principles for recursive kernel density estimators defined by stochastic approximation method. Serdica Math. J. 39, 53–82. Slaoui, Y. (2014a). Bandwidth selection for recursive kernel density estimators defined by stochastic approximation method. J. Probab. Stat 2014, ID 739640, doi:10.1155/2014/739640. Slaoui, Y. (2014b). The stochastic approximation method for the estimation of a distribution function. Math. Methods Statist. 23, 306–325. Slaoui, Y. (2014c). Large and moderate deviation principles for kernel distribution estimator. Int. Math Forum. 18, 871–890. Slaoui, Y. (2015a). Plug-In Bandwidth selector for recursive kernel regression estimators defined by stochastic approximation method. Stat. Neerl. 69, 483–509. Slaoui, Y. (2015b). Large and moderate deviation principles for averaged stochastic approximation method for the estimation of a regression function. Serdica Math. J. 41, 307–328. 17 Slaoui, Y. (2015c). Moderate deviation principles for recursive regression estimators defined by stochastic approximation method. Int. J. Math. Stat. 16, 51–60. Slaoui, Y. (2016). Optimal bandwidth selection for semi-recursive kernel regression estimators. Stat. Interface 9, 375–388. Stefanski, L. A. & Carroll, R. J. (1990). Deconvoluting kernel density estimators. Statistics. 2, 169–184. Tsybakov, A. B. (1990). Recurrent estimation of the mode of a multidimensional distribution. Probl. Inf. Transm. 8, 119–126. 18 n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU Nadaraya estimator 1 estimator 3 estimator 4 0.1148 0.993 7 estimator 2 NSR = 5% 0.1089 0.993 7 0.1109 0.993 13 0.1085 0.993 7 0.1094 0.993 7 0.0764 0.996 41 0.0791 0.996 23 0.0756 0.996 24 0.0759 0.996 23 0.0766 0.996 22 0.0395 0.999 395 0.0422 0.999 216 0.0395 0.999 213 0.0399 0.999 215 0.1170 0.993 11 0.1209 0.993 6 0.0394 0.999 212 NSR = 10% 0.1151 0.993 6 0.1150 0.993 6 0.1163 0.993 6 0.0801 0.996 41 0.0835 0.996 24 0.0792 0.996 23 0.0794 0.996 24 0.0803 0.996 23 0.0413 0.999 394 0.0430 0.999 222 0.0414 0.999 221 0.0417 0.999 218 0.1225 0.992 9 0.1269 0.992 5 0.0411 0.999 224 NSR = 20% 0.1207 0.992 5 0.1203 0.992 5 0.1215 0.993 5 0.0838 0.996 39 0.0873 0.996 21 0.0835 0.996 21 0.0836 0.996 22 0.0842 0.996 23 0.0421 0.998 388 0.0452 0.998 209 0.0422 0.998 207 0.0426 0.998 205 0.0431 0.998 209 Table 1: Quantitative comparison between the deconvolution Nadaraya’s estimator (4) and four proposed estimators; estimator 1 correspond to the estimator (2) with the choice of (γn ) = [2/3] n−1 , estimator 2 −1 correspond to the estimator (2) with the , estimator 3 correspond to the estimator (2)  choice of (γn ) = n −1 with the choice of (γn ) = [4/3] n and estimator 4 correspond to the estimator (2) with the choice of (γn ) = [5/3] n−1 . Here we consider the normal distribution X ∼ N (0, 1/2) with NSR = 5% in the first block, NSR = 10% in the second block and NSR = 20% in the last block, we consider three sample sizes n = 25, n = 50 and n = 150, the number of simulations is 500, and we compute the robust mean relative error (RM RE), the linear correlation (Cor) and the CPU time in seconds. 19 n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU Nadaraya estimator 1 estimator 3 estimator 4 0.1024 0.993 4 estimator 2 NSR = 5% 0.0934 0.993 4 0.0975 0.993 7 0.0942 0.993 4 0.0968 0.993 4 0.0779 0.997 38 0.0811 0.997 20 0.0745 0.997 21 0.0745 0.997 20 0.0755 0.997 21 0.0357 0.999 374 0.0379 0.999 194 0.0345 0.999 193 0.0346 0.999 196 0.1150 0.993 8 0.1180 0.993 4 0.0349 0.999 195 NSR = 10% 0.1133 0.993 4 0.1130 0.993 4 0.1139 0.993 4 0.0797 0.997 35 0.0805 0.997 18 0.0772 0.997 17 0.0773 0.997 16 0.0778 0.997 20 0.0374 0.999 369 0.0394 0.999 189 0.0366 0.999 186 0.0370 0.999 191 0.1137 0.993 8 0.1176 0.993 4 0.0363 0.999 187 NSR = 20% 0.1127 0.993 4 0.1139 0.993 4 0.1158 0.993 4 0.0834 0.996 37 0.0864 0.996 19 0.0832 0.996 18 0.0842 0.996 20 0.0851 0.996 21 0.0397 0.999 379 0.0419 0.999 203 0.0393 0.999 202 0.0395 0.999 203 0.0397 0.999 205 Table 2: Quantitative comparison between the deconvolution Nadaraya’s estimator  (4) and four estimators; −1 estimator 1 correspond to the estimator (2) with the choice of (γ ) = [2/3] n , estimator 2 correspond to n  −1 the estimator (2) with the choice of (γ ) = n , estimator 3 correspond to the estimator (2) with the choice n   of (γn ) = [4/3] n−1 and estimator 4 correspond to the estimator (2) with the choice of (γn ) = [5/3] n−1 . Here we consider the standard normal distribution X ∼ N (0, 1) with NSR = 5% in the first block, NSR = 10% in the second block and NSR = 20% in the last block, we consider three sample sizes n = 25, n = 50 and n = 150, the number of simulations is 500, and we compute the robust mean relative error (RM RE), the linear correlation (Cor) and the CPU time in seconds. 20 n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU Nadaraya estimator 1 estimator 3 estimator 4 0.0982 0.995 5 estimator 2 NSR = 5% 0.0903 0.995 5 0.0948 0.995 10 0.0915 0.995 5 0.0940 0.995 5 0.0768 0.997 43 0.0789 0.997 25 0.0751 0.997 24 0.0753 0.997 23 0.0760 0.997 24 0.0357 0.998 403 0.0373 0.998 215 0.0340 0.998 212 0.0341 0.998 216 0.0946 0.994 11 0.1030 0.994 6 0.0344 0.998 213 NSR = 10% 0.0927 0.994 6 0.0916 0.994 6 0.0931 0.994 6 0.0803 0.997 42 0.0808 0.997 23 0.0749 0.997 23 0.0748 0.997 24 0.0755 0.997 25 0.0497 0.998 401 0.0490 0.998 206 0.0469 0.998 208 0.0469 0.998 205 0.0993 0.993 10 0.1049 0.993 5 0.0467 0.998 205 NSR = 20% 0.0940 0.993 5 0.0921 0.993 5 0.0932 0.993 5 0.0812 0.997 43 0.0837 0.996 25 0.0805 0.996 24 0.0805 0.996 23 0.0809 0.996 23 0.0762 0.998 394 0.0709 0.998 202 0.0685 0.998 204 0.0675 0.998 203 0.0666 0.998 201 Table 3: Quantitative comparison between the deconvolution Nadaraya’s estimator  (4) and four estimators; −1 estimator 1 correspond to the estimator (2) with the choice of (γ ) = [2/3] n , estimator 2 correspond to n  −1 the estimator (2) with the choice of (γ ) = n , estimator 3 correspond to the estimator (2) with the choice n   of (γn ) = [4/3] n−1 and estimator 4 correspond to the estimator (2) with the choice of (γn ) = [5/3] n−1 . Here we consider the normal distribution X ∼ N (0, 2) with NSR = 5% in the first block, NSR = 10% in the second block and NSR = 20% in the last block, we consider three sample sizes n = 25, n = 50 and n = 150, the number of simulations is 500, and we compute the robust mean relative error (RM RE) and the linear correlation (Cor), and the CPU time in seconds. 21 n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU Nadaraya estimator 1 estimator 3 estimator 4 0.0888 0.994 7 estimator 2 NSR = 5% 0.0790 0.994 7 0.0831 0.994 13 0.0795 0.994 7 0.0817 0.994 7 0.0494 0.996 45 0.0522 0.996 25 0.0486 0.996 24 0.0489 0.996 23 0.0497 0.996 24 0.0163 0.999 423 0.0180 0.999 228 0.0143 0.999 225 0.0141 0.999 226 0.0841 0.992 12 0.0895 0.992 7 0.0149 0.999 224 NSR = 10% 0.0807 0.992 7 0.0818 0.992 7 0.0844 0.992 7 0.0547 0.994 44 0.0579 0.994 24 0.0540 0.994 23 0.0539 0.994 23 0.0544 0.994 24 0.0213 0.997 425 0.0246 0.997 226 0.0218 0.997 225 0.0225 0.997 229 0.0846 0.991 13 0.0907 0.991 7 0.0211 0.997 225 NSR = 20% 0.0808 0.991 7 0.0806 0.991 7 0.0828 0.991 7 0.0582 0.993 45 0.0616 0.993 23 0.0580 0.993 24 0.0581 0.993 24 0.0587 0.993 23 0.0219 0.995 435 0.0249 0.995 232 0.0213 0.995 228 0.0222 0.995 229 0.0228 0.995 230 Table 4: Quantitative comparison between the deconvolution Nadaraya’s estimator  (4) and four estimators; −1 estimator 1 correspond to the estimator (2) with the choice of (γ ) = [2/3] n , estimator 2 correspond to n  −1 the estimator (2) with the choice of (γ ) = n , estimator 3 correspond to the estimator (2) with the choice n   of (γn ) = [4/3] n−1 and estimator 4 correspond to the estimator (2) with the choice of (γn ) = [5/3] n−1 . Here we consider the normal mixture distribution X ∼ 1/2N (1/2, 1) + 1/2N (−1/2, 1) with NSR = 5% in the first block, NSR = 10% in the second block and NSR = 20% in the last block, we consider three sample sizes n = 25, n = 50 and n = 150, the number of simulations is 500, and we compute the robust mean relative error (RM RE), the linear correlation (Cor) and the CPU time in seconds. 22 n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU n = 25 RM RE Cor CPU n = 50 RM RE Cor CPU n = 150 RM RE Cor CPU Nadaraya estimator 1 estimator 3 estimator 4 0.1336 0.954 5 estimator 2 NSR = 5% 0.1239 0.953 5 0.1298 0.955 9 0.1242 0.952 5 0.1265 0.952 5 0.1263 0.965 38 0.1274 0.964 20 0.1217 0.964 21 0.1217 0.963 20 0.1224 0.962 21 0.0808 0.984 384 0.0790 0.984 198 0.0751 0.983 197 0.0748 0.982 198 0.1350 0.939 9 0.1403 0.938 5 0.0759 0.985 199 NSR = 10% 0.1300 0.938 5 0.1297 0.939 5 0.1317 0.939 5 0.1284 0.950 39 0.1311 0.949 20 0.1250 0.949 19 0.1249 0.948 20 0.1257 0.948 21 0.1190 0.942 392 0.1092 0.944 204 0.1064 0.954 202 0.1054 0.953 204 0.1669 0.934 9 0.1525 0.934 5 0.1073 0.954 203 NSR = 20% 0.1509 0.944 5 0.1494 0.943 5 0.1479 0.943 5 0.1363 0.944 37 0.1382 0.944 19 0.1289 0.948 21 0.1289 0.949 21 0.1305 0.949 20 0.1258 0.933 378 0.1213 0.938 195 0.1160 0.937 197 0.1151 0.937 194 0.11508 0.938 194 Table 5: Quantitative comparison between the deconvolution Nadaraya’s estimator  (4) and four estimators; −1 estimator 1 correspond to the estimator (2) with the choice of (γ ) = [2/3] n , estimator 2 correspond to n  −1 the estimator (2) with the choice of (γ ) = n , estimator 3 correspond to the estimator (2) with the choice n   of (γn ) = [4/3] n−1 and estimator 4 correspond to the estimator (2) with the choice of (γn ) = [5/3] n−1 . Here we consider the exponetial distribution X ∼ E (1/2) with NSR = 5% in the first block, NSR = 10% in the second block and NSR = 20% in the last block, we consider three sample sizes n = 25, n = 50 and n = 150, the number of simulations is 500, and we compute the robust mean relative error (RM RE), the linear correlation (Cor) and the CPU time in seconds. 23 I1 Nadaraya Proposed estimator 1.14e−01 1.15e−01 Nadaraya Proposed estimator 1.11e−01 1.12e−01 Nadaraya Proposed estimator 1.07e−01 1.08e−01 Nadaraya Proposed estimator 1.03e−01 1.05e−01 I2 NSR = 5% 5.47e−04 1.24e−02 NSR = 10% 4.84e−04 4.05e−04 NSR = 20% 4.31e−04 3.67e−04 NSR = 30% 4.16e−04 3.83e−04 hn AM ISE ∗ 0.661 0.368 6.09e−04 2.49e−04 0.825 0.819 5.66e−04 1.52e−04 1.025 1.020 5.17e−04 3.13e−04 1.167 1.150 4.95e−04 4.86e−04 Table 6: The comparison between the AM ISE ∗ of the deconvolution Nadaraya’s distribution estimator (4) and the AM ISE ∗ of the proposed distribution estimator (2) with the choice of the stepsize (γn ) = n−1 via the Salvister data of the package kerdiest and through a plug-in method, with NSR equal to 5% in the first block, 10% in the second block, 20% in the third block and 30% in the last block the number of simulations is 500. 24
10math.ST
arXiv:1703.08774v2 [cs.LG] 4 Jan 2018 Who Said What: Modeling Individual Labelers Improves Classification Melody Y. Guan∗ Varun Gulshan, Andrew M. Dai, Geoffrey E. Hinton Stanford University 450 Serra Mall Stanford, California 94305 [email protected] Google Brain 1600 Amphitheatre Pwky Mountain View, California 94043 {varungulshan, adai, geoffhinton}@google.com Abstract Data are often labeled by many different experts with each expert only labeling a small fraction of the data and each data point being labeled by several experts. This reduces the workload on individual experts and also gives a better estimate of the unobserved ground truth. When experts disagree, the standard approaches are to treat the majority opinion as the correct label and to model the correct label as a distribution. These approaches, however, do not make any use of potentially valuable information about which expert produced which label. To make use of this extra information, we propose modeling the experts individually and then learning averaging weights for combining them, possibly in samplespecific ways. This allows us to give more weight to more reliable experts and take advantage of the unique strengths of individual experts at classifying certain types of data. Here we show that our approach leads to improvements in computeraided diagnosis of diabetic retinopathy. We also show that our method performs better than competing algorithms by Welinder and Perona (2010); Mnih and Hinton (2012). Our work offers an innovative approach for dealing with the myriad real-world settings that use expert opinions to define labels for training. Introduction Over the last few years, deep convolutional neural networks have led to rapid improvements in the ability of computers to classify objects in images and they are now comparable with human performance in several domains. As computers get faster and researchers develop even better techniques, neural networks will continue to improve, especially for tasks where it is possible to get a very large number of accurately labeled training examples. In the near future, we can expect neural networks to start serving as alternatives to human experts. We would, in fact, like the neural networks to perform much better than the human experts used to provide the training labels because these training labels are often unreliable as indicated by the poor agreement between different experts (55.4% for the datasets we consider) or even between an expert and the same expert looking at the same im∗ Work done as a member of the Google Brain Residency program (g.co/brainresidency). Copyright c 2018, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. Figure 1: Overview of proposed procedure to learn classification from multiple noisy annotators. age some time later (70.7%).1 Intuitively, we would expect the quality of the training labels to provide an upper bound on the performance of the trained net. In the following section we show that this intuition is incorrect. Our paper’s main contribution is to show that there are significantly better ways to use the opinions of multiple experts than simply treating the consensus of the experts as the correct label or using the experts to define a probability distribution over labels. Figure 1 summarizes our optimal procedure. Beating the Teacher To demonstrate that a trained neural net can perform far better than its teacher we use the well-known MNIST handwritten digit benchmark for which the true labels are known and we create unreliable training labels by corrupting the true labels. This corruption is performed just once per experiment, before training starts, so the noise introduced by the corruption cannot be averaged away by training on the 1 Inter-grader variability is a well-known issue in many settings in which human interpretation is used as a proxy for ground truth, such as radiology and pathology (Elmore et al. 1994; 2015). Figure 2: Performance of a deep neural net when trained with noisy labels. same example several times. MNIST has 60k training images and 10k test images and the task is to classify each 28×28-pixel image into one of the ten classes. For the purposes of this demonstration, we use a very simple neural net: two convolutional layers with 5×5 filters, rectified linear unit (ReLU) activation functions, and 16 and 25 output channels respectively, each followed by a max pooling layer with 2x2 filters; a fully connected hidden layer of 32 ReLUs; and a 10-way softmax layer. We train the net on 50k examples using stochastic gradient descent on mini-batches of size 200 with the Adam optimizer (Kingma and Ba 2015) and we use the remaining 10k training cases as a validation set for tuning the learning rate and the magnitude of the initial random weights. The best-performing net has a test error rate of 1.01% when the training labels were all correct. If the labels are corrupted by changing each label to one of the other nine classes with a probability of 0.5, the test error rate only rises to 2.29%. Even if each training label is changed to an incorrect label with probability 0.8 so that the teacher is wrong 80% of the time, the trained net only gets 8.23% test error. If the teacher is even less reliable there comes a point at which the neural net fails to “get the point” and its error rate rises catastrophically, but this does not happen until the teacher is extremely unreliable as shown in Figure 2. This demonstrates that the performance of a neural net is not limited by the accuracy of its teacher, provided the teacher’s errors are random. One obvious question is how many noisily labeled training examples are worth a correctly labeled training example. In Appendix A we show that this question can be answered, at least approximately, by computing the mutual information between label and truth. Making Better Use of Noisy Labels for Diabetic Retinopathy Classification We are interested in noisy datasets of medical images where many different doctors have provided labels but each image has only been labeled by a few doctors and most of the doctors have only labeled a fairly small fraction of the images. This paper focuses on datasets of images used for screen- (a) Healthy (b) Mild NPDR (c) Moderate NPDR (d) Severe NPDR (e) Proliferative DR Figure 3: Sample fundus images from each DR class. ing diabetic retinopathy because neural networks have recently achieved human-level performance on such images (Gulshan et al. 2016) and if we can produce even a relatively small improvement in the state-of-the-art system it will be of great value. Diabetic retinopathy (DR) is the fastest growing cause of blindness worldwide, with nearly 415 million diabetics at risk (International Diabetes Foundation 2015). Early detection and treatment of DR can reduce the risk of blindness by 95% (National Eye Institute 2015). One of the most common ways to detect diabetic eye disease is to have a specialist examine pictures of the back of the eye called fundus images and rate them on the International Clinical Diabetic Retinopathy scale (American Academy of Ophthalmology 2002), defined based on the type and extent of lesions (e.g. microaneurysms, hemorrhages, hard exudates) present in the image. The image is classified into one of 5 categories consisting of (1) No DR, (2) Mild NPDR (non-proliferative DR), (3) Moderate NPDR, (4) Severe NPDR, and (5) Profilerative DR (Figure 3). Another important clinical diagnosis that can be made from the fundus image is the presence of diabetic macular edema (DME). While this work focuses only on the 5 point grading of DR, the findings should be applicable to DME diagnosis as well. Most of the prior work on DR classification focuses on obtaining a single ground truth diagnosis for each image, and then using that for training and evaluation. Deep learning has recently been used within this setting by Gulshan et Pereira, and Ribeiro (2014) learn from multiple annotators how to do active learning, i.e. which samples to select and which annotators to query, the latter using Gaussian processes to explicitly handle uncertainty. Karger, Oh, and Shah (2011); (Liu, Peng, and Ihler 2012) propose message passing algorithms for crowdsourcing. An extension in weak supervision is generalizing from noisy sources to programmatically generate labeled training sets (Ratner et al. 2016). An extension in the crowdsourcing domain is budget allocation during label sourcing (Chen, Lin, and Zhou 2013) . Previous work in biostatistics and epidemiology that estimate ground truth from multiple annotators in the absence of ground truth data are Rutjes et al. (2007); Hui and Walter (1980); Albarqouni et al. (2016) but none of these model individual labelers as we do. Figure 4: Histogram of doctor reliabilities. These are calculated from the expectation-maximization algorithm in Welinder and Perona (2010) on our training data. al. (2016) who show a high sensitivity (97.5%) and specificity (93.4%) in the detection of referable DR (moderate or more severe DR). In this work we explore whether, in the context of data in which every example is labeled by multiple experts, a better model can be trained by predicting the opinions of the individual experts as opposed to collapsing the many opinions into a single one. This allows us to keep the information contained in the assignment of experts to opinions, which should be valuable because experts labelling data differ from each other in skill and area of expertise (as is the case with our ophthalmologists, see Figure 4). Note that we still need a single opinion on the test set to be able to evaluate the models. To that end, we use a rigorous adjudicated reference standard for evaluation, where a committee of three retinal specialists resolved disagreements by discussion until a single consensus is achieved. Related Works Our work on learning from multiple noisy annotators relates to literature on noisy labels, crowd-sourcing, weak supervision, semi-supervised learning, item response theory, and multi-view learning. Since the foundational work of Dawid and Skene (1979), who model annotator accuracies with expectationmaximization (EM), and Smyth et al. (1995), who integrate the opinions of many experts to infer ground truth, there has a large body of work using EM approaches to estimate accurate labels for datasets annotated by multiple experts (Whitehill et al. 2009; Raykar et al. 2009; Raykar and Yu 2012; Welinder and Perona 2010). Works that use Bayesian probabilistic models for the image generation and/or annotation process include Welinder et al. (2010); Raykar et al. (2010); (Wauthier and Jordan 2011); Moreno et al. (2015). Yan et al. (2011); Rodrigues, Methods Motivation for Model Design First we describe the rationale behind our proposed models. There is more information in the particular labels produced by particular doctors than is captured by simply taking the average of all the doctors who have labeled a particular image and treating this distribution as the correct answer. The amount of constraint that a training case imposes on the weights of a neural network depends on the amount of information required to specify the desired output. So if we force the network to predict what each particular doctor would say for each particular training case we should be able to get better generalization to test data, provided this does not introduce too many extra parameters. For a K-way classification task, we can replace the single softmax (Goodfellow, Bengio, and Courville 2016) that is normally used by as many different K-way softmaxes as we have doctors. Of course, there will be many doctors who have not labeled a particular training image, but this is easily handled by simply not backpropagating any error from the softmaxes that are used to model those doctors. At test time we can compute the predictions of all of the modeled doctors and average them. Our belief is that forcing a neural network to model the individual doctors and then averaging at test time should give better generalization than simply training a neural network to model the average of the doctors. We expect some doctors to be more reliable than others and we would like to give more weight to their opinions. We should this be able to do better than just averaging the opinions of the modeled doctors. After we have finished learning how to model all of the individual doctors we can learn how much to weight each modeled doctor’s opinion in the averaging. This allows us to downweight the unreliable doctor models. We also expect that the doctors will have received different training and may have experienced different distributions of images so that the relative reliability of two doctors may depend on both the class of the image and on properties of the image such as the type of camera used. Our weights for averaging doctor models should therefore possibly be image-dependent. Figure 5: Description of nets used in paper. The baseline net has five-class classification error rate of 23.83% on the test dataset. The numbers above arrows refer to absolute changes in test error while the numbers below arrows refer to relative changes (negative values represent improvements). WDN (highlighted) was the optimal net. Model Architecture With these intuitions in mind, we consider a sequence of models of increasing complexity for training the diabetic retinopathy classifier (Figure 7). The neural network base used in this work is the Inception-v3 architecture (Szegedy et al. 2016) (Figure 6). • Baseline Net (BN): Inception-v3 trained on average opinions of doctors; a TensorFlow reimplementation of the model used in Gulshan et al. (2016). • Doctor Net (DN): BN extended to model the opinions of each of the 31 doctors. • Weighted Doctor Net (WDN): Fixed DN with averaging weights for combining the predictions of the doctor models learned on top, one weight per doctor model. • Image-specific WDN (IWDN): WDN with averaging weights that are learned as a function of the image. • Bottlenecked IWDN (BIWDN): IWDN with a small bottleneck layer for learning the averaging weights. For BN, the outputs of the last hidden layer of Inception are used to compute the logits used in the five-way softmax output layer. For DN, the opinions of each doctor are modeled using a separate softmax for each doctor, while Inception weights were shared. For evaluation, the predictions from the softmax “doctor models” are arithmetically averaged to give a single five-class prediction. For subsequent nets, the parameters and predictions of the DN model are frozen and only the averaging weights for the doctor models are learned. For WDN, one averaging weight per doctor is trained, shared across all images. For IWDN, these averaging weights are made image-dependent by letting them be a function of the last hidden layer of Inception. For BIWDN, a linear bottleneck layer of size three is added between the last hidden layer of Inception (of dimension 2048) and the 31way softmax of IWDN as a precautionary measure against model overfitting. A bottleneck layer of this size reduces the number of trainable parameters ten-fold. Rather than directly learning the averaging weight for each doctor model (B)(I)WDN, we learn averaging logits for each model that we could then pass through a softmax to produce averaging weights that are guaranteed to be positive. To train the averaging logits, we use the opinions of the doctors who actually labeled a training image to define the target output distribution for that image (Appendix B.2 discusses an alternative target). We then combine the predictions of the models of all the other doctors using the weights Table 1: Prediction inputs to cross entropy loss for each model during training. The notation is given in the text. Note P 1 that the target is always |I| i∈I li . Model Training Evaluation BN p∅ p∅ DN pi , ∀i ∈ I 1 31 (B)(I)WDN P i∈I / pi ·wi P i∈I / wi P31 P31 i=1 i=1 pi pi · wi defined by their current averaging logits. Finally we update our parameters by backpropagating with the cross entropy loss between the target distribution and the weighted average prediction. This way all of the training cases that a doctor did not label can be used to learn the averaging logit for that doctor, and no extra data are needed beyond those used to learn the weights of DN. Moreover, if a doctor model has similar performance to other doctor models but makes very different errors it will tend to be upweighted because it will be more useful in the averaging. This upweighting of diverse doctor models would not occur if we had computed the reliabilities of the doctors separately. For a single image, let I be the set of indices of the doctors who actually graded that image. Let the label of doctor i ∈ I be li . For every doctor j ∈ {1, 2, . . ., 31}, denote the prediction of its model pj . Let p∅ be the prediction of the model of the average doctor in BN. For WDN, IWDN, and BIWDN, let wP j be the averaging weight for the jth modeled doctor, where j wj = 1. Note that pj is a five-dimensional vector and wj is a scalar. The explicit inputs of the cross entropy loss being minimized during training of each model are shown in Table 1 and post-Inception computations are shown schematically in Figure 7. In the case of DN, the cross entropy losses of the individual doctor models are added together to get the total loss for each training example. Summary of Procedure Here we summarize the entire procedure for using Weighted Doctor Net (WDN), which turns out to be the best performing model. The process is illustrated for generic labelers in Figure 1. WDN has two phases of training: • Phase 1: We learn a doctor model for each doctor. Each doctor model consists of the Inception-v3 base followed by a softmax output layer. The Inception-v3 is shared by all the doctor models while the output layers are unique to each doctor model. • Phase 2: We fix the doctor models that we learned in Phase 1 (Note this implies that the predictions made by the doctor models for any given image are also fixed.) Now we learn how to combine the predictions of the doctor models in a weighted manner. We do this by training averaging logits according to Table 1 and then taking a softmax of these averaging logits to get averaging weights. During evaluation of WDN, the prediction made for our model is a linear combination of the doctor models predictions where the coefficients are the averaging weights learned in Phase 2 of training. Next we describe two benchmarks to compare our models against. Estimating Doctor Reliability with EM Welinder and Perona (2010) use a representative online EM algorithm to estimate abilities of multiple noisy annotators and to determine the most likely value of labels. We calculate updated labels by executing the method in Welinder and Perona (2010) on our human doctors and we use these updated labels to train BN, as a competing algorithm for our DN method. Welinder and Perona (2010) also actively select which images to label and how many labels to request based on the uncertainty of their estimated ground truth values and the desired level of confidence, and they select and prioritize which annotators to use when requesting labels. We do not use these other aspects of their algorithm because labels for all images in our dataset have already been collected. Modeling Label Noise Mnih and Hinton (2012) describe a deep neural network that learns to label road pixels in aerial images. The target labels are derived from road maps that represent roads using vectors. These vectors are converted to road pixels by using knowledge of the approximate width of the roads so the target labels are unreliable. To handle this label noise, Mnih and Hinton (2012) propose a robust loss function that models asymmetric omission noise. They assume that a true, unobserved label m is first generated from a wm × wm image patch s according to some distribution p(m|s), and the corrupted, observed label m̃ is then generated from m according to a noise distribution p(m̃|m). The authors assume an asymmetric binary noise distribution p(m̃i |mi ) that is the same for all pixels i. They assume that conditioned on m, all components of m̃ are independent and that each m̃i is independent of all mj6=i . The observed label distribution is then modeled as: 2 p(m̃|s) = wm Y X p(m̃i |mi )p(mi |s). i=1 mi For another baseline, we use a multi-class extension of their method on DN, modeling the noise distribution prior for all doctors d with the parameters: θll0 = p(m̃d = l0 |md = l) where l, l0 ∈ {1, 2, 3, 4, 5}. We estimate θll0 using the 5×5 confusion matrix between individual and average doctor opinions on training images. Treating the average doctor opinion as the true label, we convert each doctor’s individual count matrix into proportions which we averaged across all doctors. We train this model by minimizing the negative log posterior, − log(p(m̃|s)). This variant of the method by Mnih and Hinton (2012) is an alternative way to improve upon DN to our proposal of learning averaging weights (WDN). Experimental Setup Neural Network Training We train the network weights using distributed stochastic gradient descent (Abadi et al. 2016) with the Adam optimizer on mini-batches of size 8. We train using TensorFlow with 32 replicas and 17 parameter servers, with one GPU per replica. To speed up the training, we use batch normalization (Ioffe and Szegedy 2015), pre-initialization of our Inception network using weights from the network trained to classify objects in the ImageNet dataset (Russakovsky et al. 2015), and the following trick: we set the learning rate on the weight matrix producing prediction logits to one-tenth of the learning rate for the other weights. We prevent overfitting using a combination of L1 and L2 penalties, dropout, and a confidence penalty (Pereyra et al. 2017), which penalizes output distributions with low entropy. At the end of training, we use an exponentially decaying average of the recent parameters in the final model. We tune hyperparameters and pick model checkpoints for early stopping on the validation dataset, using five-class classification error rate as the evaluation metric. The optimal values for these hyperparameters are displayed in Appendix C. Note that we tune the baseline as well to ensure that our improvements are not the result of more hyperparameter optimization. When evaluating on the test set we average the predictions for the horizontally and vertically flipped versions (four in total) of every image. We also train a version of BN where the output prediction is binary instead of multi-class, as is done in Gulshan et al. (2016). The binary output is obtained by thresholding the five-class output at the Moderate NPDR or above level, a commonly used threshold in clinics to define a referable eye condition. For this BN-binary network, the area under the ROC curve is used as the validation evaluation metric. To deal with differences in class distribution between the datasets (Table 2), we use log prior correction during evaluation. This entails adding to the prediction logits, for each class, the log of the ratio of the proportion of labels in that class in the evaluation dataset to the proportion of labels in that class in the training set. Our assumed test class distribution for computing the log prior correction is the mean distribution of all known images (those of the training and validation sets). So for each image under evaluation we up- date the prediction logit for class c by adding:   qvalid (c) log for the validation dataset, and qtrain (c)   qvalid∪train (c) log for the test dataset, qtrain (c) where q(c) is the proportion of labels in that class. Applying log prior correction improves accuracy and all our reported results use it. Datasets The training dataset consists of 126, 522 images sourced from patients presenting for diabetic retinopathy screening at sites managed by 4 different clinical partners: EyePACS, Aravind Eye Care, Sankara Nethralaya, and Narayana Nethralaya. The validation dataset consists of 7,804 images obtained from EyePACS clinics. Our test dataset consists of 3,547 images from the EyePACS-1 and Messidor-2 datasets. More details on image sourcing are in Appendix D. Each of the images in the training and validation datasets was graded by at least one of 54 US-licensed ophthalmologist or ophthalmology trainee in their last year of residency (postgraduate year 4). For training the doctor models, we use the 30 ophthalmologists who graded at least 1,000 images were used, and we lump the remaining doctors as a single composite doctor to avoid introducing doctor-specific parameters that are constrained by less than 1,000 training cases. Meanwhile, the labels for the test set were obtained through an adjudication process: three retina specialists graded all images in the test dataset, and discussed any disagreements as a committee until consensus was reached. We scale-normalize our images by detecting the circular fundus disk and removing the black borders around them. We use images at a resolution of 587×587 pixels and we augment our training data with random perturbations to image brightness, saturation, hue, and contrast. Our Baseline vs Published Baseline This section describes the multiple ways in which our baseline differs from that of Gulshan et al. (2016). For these reasons, results from this paper’s own BN should be used for model comparisons with DN, WN, IWDN, and BIWDN rather than numbers from Gulshan et al. (2016). • Unlike in Gulshan et al. (2016), we remove grades of doctors who grade test set images from both training and validation sets to reduce the chance that the model is overfitting on certain experts. This handicaps our performance vis-à-vis their paper, especially because we exclude the most expert doctors (the retinal specialists) during model development, but ensures generalizability of our results. • We use different datasets, and in particular our adjudicated test set has gold standard “ground truth” labels. • We train with five-class loss instead of binary loss. • If a doctor grades a single image multiple times, as often occurs, Gulshan et al. (2016) treats these as independent diagnoses while we collapse these multiple diagnoses into a distribution over classes. Table 2: Class distributions of datasets (as %). Grade Training Validation 1 2 3 4 5 51.03 24.75 16.81 4.17 3.23 72.69 17.62 7.27 1.20 1.21 Table 3: Test metrics from training with Multi-class vs Binary loss for BN. Test Metric (%) Binary loss Five-class loss Binary AUC Binary Error Spec@97%Sens 95.58 11.27 63.12 97.11 9.92 79.60 • We employ higher resolution images (587×587 pixels versus 299×299) and image preprocessing and theoretical techniques unused in Gulshan et al. (2016). Summary of Results We run 10 replicates of each model and average the resulting metrics, which are reported in Table 4. For full comparability of models we use the same 10 replicates reported for DN to serve as the fixed part of the model for training the WDN, IWDN, and BIWDN replicates. Training with Five-Class Loss Beats Training with Binary Loss Even on Binary Metrics We find that training BN with a five-class loss improves test binary AUC compared to training with a binary loss, as is done by Gulshan et al. (2016), even when validating the former on five-class training error instead of binary AUC (Table 3). Test binary AUC is raised by a substantial 1.53% (97.11% vs 95.58%) from using five-class loss. Intuitively this fits with our thesis that generalization is improved by increasing the amount of information in the desired outputs. All results reported in Table 4 and subsequent sections, including for BN, are obtained from training with five-class loss. Averaging Modeled Doctors Beats Modeling the Average Doctor We see a reduction in five-class classification test error of 1.97% (from 23.83% to 21.86%) from averaging modeled doctors (DN) instead of modeling the averaged doctor (BN). In comparison, using labels from the algorithm in Welinder and Perona (2010) to train BN only reduces five-class test classification error by 0.09%. Over BN, DN also increases binary AUC by 0.17% (97.11% to 97.28%), decreases binary classification error 0.17% (9.92% to 9.75%), and increases specificity at 97% sensitivity (spec@97%sens) by 2.21% (79.60% to 81.81%). Meanwhile, using labels from Welinder and Perona (2010) on BN merely increases Figure 6: Schematic diagram of Inception-v3 (Shlens 2016). Figure 7: Schematic diagram of nets. These schematics show how the parameters, network outputs, and averaging weights for doctor models are connected. Table 1 lists how the outputs are used in a loss function for training. In WDN (not shown in figure), the averaging logits are not connected to the last hidden layer of Inception and are just initialized from a constant vector. Table 4: Summary of Test Results. All models in this table are trained with five-class loss except DN Mnih, whose loss was the negative log posterior. Metric (%) ∅ BN Welinder ∅ DN Mnih five-class Error Binary AUC Binary Error Spec@97%Sens 23.83 97.11 9.92 79.60 23.74 97.00 10.12 79.97 21.86 97.28 9.75 81.81 22.76 97.42 10.24 83.61 WDN IWDN BIWDN 20.58 97.45 9.07 82.69 20.63 97.43 9.12 82.46 20.83 97.41 9.23 82.46 spec@97%sens by 0.37% relative to vanilla BN and actually leads to slightly worse performance on binary AUC (-0.11%) and binary error (+0.20%). Note that the binary AUC, binary error, and spec@97%sens metrics would be improved for all models if we were to do hyperparameter tuning and early stopping for them specifically, but we decided to do all our model selection on one metric (five-class error) both for simplicity and to simulate the decision metric required in real-life automated diagnosis systems. We see that DN is significantly better on all test metrics compared to BN trained using the labels obtained from the algorithm in Welinder and Perona (2010). Learning Averaging Weights Helps We see a further 1.28% decrease in five-class test error from using WDN as opposed to DN. Binary AUC increases an additional 0.17%, binary classification error decreases another 0.68%, and spec@97%sens increases an extra 0.88%, all on test data. Results from IWDN and BIWDN are slightly worse than those from WDN. We would expect a bigger improvement from WDN and potentially further improvements from training averaging logits in an image-specific way if we had doctors with more varied abilities and greater environmental differences, but on our dataset image-specific averaging logits does not help. Our extension of the competing algorithm by Mnih and Hinton (2012) actually causes DN to perform worse by 0.90% on five-class classification test error, and is more computationally costly than (B)(I)WDN. A different noise model we considered does not help either (Appendix B.3). Conclusion We introduce a method to make more effective use of noisy labels when every example is labeled by a subset of a larger pool of experts. Our method learns from the identity of multiple noisy annotators by modeling them individually with a shared neural net that has separate sets of outputs for each expert, and then learning averaging weights for combining their modeled predictions. We evaluate our method on the diagnosis of diabetic retinopathy severity on the five-point scale from images of the retina. Compared to our baseline model of training on the average doctor opinion, a strategy that yielded state-of-the-art results on automated diagnosis of DR, our method can lower five-class classification test error from 23.83% to 20.58%. We also find that, on binary metrics, training with a five-class loss significantly beats training with a binary loss, as is done in the published baseline. We compare our method to competing algorithms by Welinder and Perona (2010); Mnih and Hinton (2012) and we show that corresponding parts of our method give superior performance to both. Our methodology is generally applicable to supervised training systems using datasets with labels from multiple annotators. Acknowledgments We thank Dale Webster, Lily Peng, Jonathan Krause, Arunachalam Narayanaswamy, Quoc Le, Alexey Kurakin, Anelia Angelova, Brian Cheung, David Ha, Matt Hoffman, and Justin Gilmer for helpful discussions and feedback. A. Mutual Information for Noisy Labels Here we compute the mutual information between a noisy MNIST label and the truth, assuming random noise, in order to estimate the number of noisily labeled training cases equivalent to one case that is known to be correctly labeled. Empirically, N perfectly labeled training cases give about the same test error as N Iperfect /Inoisy training cases with noisy labels, where Inoisy is the mutual information per case between a noisy label and the truth and Iperfect is the corresponding mutual information for perfect labels. For ten classes, the mutual information (in nats) is Iperfect = 2.3 = − log(0.1), but when a noisy label is 20% correct on average, the mutual information is: Inoisy = 0.044   0.1 = − log(0.1) − 10 × 0.02 × log 0.02   0.8 0.1 − 90 × 0.1 × log . 9 0.1 × 0.8/9 So if the learning is making good use of the mutual information in the noisy labels we can predict that 60,000 noisy labels are worth 60, 000 × 0.044/2.3 ≈ 1, 148 clean labels. In reality we needed about 1,000 clean labels to get similar results. B. Other Ideas Tested B.1 Mean Class Balancing In addition to log prior correction of class distributions, we also attempted mean class balancing wherein samples from less frequent classes were upweighted and more frequent classes are downweighted in the cross entropy loss, in inverse proportion to their prevalence relative to the uniform distribution across classes. Explicitly, we weight each sample of class c by: q̄ 1 αc = = . q(c) |c|q(c) Eigen and Fergus. (2015) employ a similar method for computer vision tasks although they use medians instead of means. In our case, using mean class balancing lowers performance, possibly because it makes too many assumptions on the unknown test distribution, and was not employed. B.2. Alternative Target Distribution for Training Averaging Logits To train the averaging logits, we take each training case and use the opinions of the doctors who actually labeled that case to define the target output distribution. Alternatively, the target distribution can be defined as the equally weighted average of the predictions of the doctor models corresponding to the doctors who labeled P that case. In the notation used in 1 Table 1, this would be |I| i∈I pi . We experimented with using this alternative target distribution in calculating cross entropy loss but saw inferior results. Table 5: Optimal Hyperparameters from Grid Search. Note that the learning rate for doctor models is one-tenth the learning rate for the rest of the network listed here. WD=weight decay, wel=welinder Hyperparameter Learning rate Dropout for Inception Dropout for output heads Entropy weight L2 WD for Inception L1 WD for doctor models L2 WD for doctor models L1 WD for averaging logits L2 WD for averaging logits Bottleneck size BN binary 0.0001 0.75 0.8 0.0125 0.01 0.001 0.01 - BN BN wel 0.0003 0.95 0.85 0.025 0.01 0.00004 0.004 - B.3. An Alternative Noise Model Because our multi-class extension of Mnih and Hinton (2012) shows poor results, which we postulated may have been because it is sensitive to differences in class distributions between datasets, we considered a different noise model that makes less assumptions on the class distribution of the data. This model assumes a symmetric noise distribution that is determined by a single prior parameter. This assumes that if a label is wrong, it has equal probability of belonging to any of the other classes. However we allow this parameter to vary by doctor and we estimate it for each doctor d as θd = p(m̃d = l|md = l), where the real doctor reliability score is calculated from the Welinder and Perona (2010) algorithm. Unfortunately this method performs slightly worse than the 5-class variant of Mnih and Hinton (2012). Note that a number of other noise models of varying complexity can be considered as well. C. Hyperparameter Search Table 5 displays the optimal hyperparameters used in DR classification. We tuned using grid search on the following hyperparameter spaces: dropout for Inception backbone ∈ {0.5, 0.55, 0.6, . . ., 1.0}, dropout for doctor models ∈ {0.5, 0.55, 0.6, . . ., 1.0}, learning rate ∈ {1×10−7 , 3×10−7 , 1×10−6 , . . ., 0.03}, entropy weight ∈ {0.0, 0.0025, 0.005, . . ., 0.03} ∪ {0.1}, weight decay for Inception ∈ {0.000004, 0.00001, 0.00004, . . ., 0.1}, L1 weight decay for doctor models ∈ {0.000004, 0.00001, 0.00004, . . ., 0.04}, L2 weight decay for doctor models ∈ {0.00001, 0.00004, . . ., 0.04}, L1 weight decay for averaging logits ∈ {0.001, 0.01, 0.02, 0.03, . . ., 0.1, 0.2, 0.3, . . ., 1, 2, 3, . . ., 10, 100, 1000}, L2 weight decay for averaging logits ∈ {0.001, 0.01, 0.1, 0.2, 0.3, . . .,1, 5, 10, 15, 20, 30, . . ., 150, 200, 300, 400, 500, 1000}, and bottleneck size (for BIWDN) ∈ {2, 3, 4, 5, 6, 7}. We used a learning rate decay factor of 0.99 optimized for BN. The magnitudes of the image preprocessing perturbations were also optimized for BN. 0.0003 0.95 0.85 0.015 0.01 0.0001 0.001 - DN 0.001 0.85 0.9 0.0175 0.001 0.001 0.01 - DN mnih 0.0003 0.95 0.9 0.02 0.004 0.01 0.04 - WDN 0.03 0.0225 0.4 15 - IWDN −6 1×10 0.005 0.02 0.4 - BIWDN 3×10−7 0.0125 4 110 3 D. Dataset Details Our training set consists of 119,589 of the 128,175 images used in the training set of Gulshan et al. (2016) and 6,933 new labeled images acquired since the creation of their training dataset. The images in the training set of Gulshan et al. (2016) that we do not use were excluded for the following reasons. (i) 4,204 images of their dataset were removed to create a separate validation dataset for experiments within the research group, (ii) 4,265 were excluded because they were deemed ungradable by every ophthalmologist that graded them. Unlike Gulshan et al. (2016), we do not predict image gradeability in this work and hence excluded those images. (iii) 117 of their images were excluded because they fail our image scale normalization preprocessing step. Our validation dataset consists of 7,963 images obtained from EyePACS clinics. These images are a random subset of the 9,963 images of the EyePACS-1 test set used in Gulshan et al. (2016). The remaining 2,000 images were used as part of our test set. In practice, only 7,805 of the 7,963 validation images have at least one label, since the remaining 158 images were of poor quality and considered ungradable by all ophthalmologists that labeled them. The test set consists of 1,748 images of the Messidor-2 dataset (Decencière et al. 2014) and 2,000 images of the EyePACS-1 test dataset used in Gulshan et al. (2016), as we just mentioned. 1,744 of the 1,748 images of Messidor-2 and 1,803 of the 2,000 images from EyePACS-1 were considered gradable after adjudication and were assigned labels. References Abadi, M.; Barham, P.; Chen, J.; Chen, Z.; Davis, A.; Dean, J.; Devin, M.; Ghemawat, S.; Irving, G.; Isard, M.; Kudlur, M.; Levenberg, J.; Monga, R.; Moore, S.; Murray, D. G.; Steiner, B.; Tucker, P.; Vasudevan, V.; Warden, P.; Wicke, M.; Yu, Y.; and Zheng, X. 2016. Tensorflow: A system for large-scale machine learning. OSDI. Albarqouni, S.; Baur, C.; Achilles, F.; Belagiannis, V.; Demirci, S.; and Navab, N. 2016. Aggnet: deep learning from crowds for mitosis detection in breast cancer histology images. IEEE transactions on medical imaging 35(5):1313– 1321. American Academy of Ophthalmology. 2002. International clinical diabetic retinopathy disease severity scale. Detailed table. icoph.org/dynamic/attachments/resources/diabeticretinopathy-detail.pdf. Chen, X.; Lin, Q.; and Zhou, D. 2013. Optimistic knowledge gradient policy for optimal budget allocation in crowdsourcing. In ICML, 64–72. Dawid, A. P., and Skene, A. M. 1979. Maximum likelihood estimation of observer error-rates using the em algorithm. Applied Statistics 28(1):20–28. Decencière, E.; Xiwei, Z.; Cazuguel, G.; Lay, B.; Cochener, B.; Trone, C.; Gain, P.; nez Varela, J.-R. O.; Massin, P.; Erginay, A.; Charton, B.; and Kleain, J.-C. 2014. Feedback on a publicly distributed image database: The messidor database. Image Anal Stereol 33(3):231–234. Eigen, D., and Fergus., R. 2015. Predicting depth, surface normals and semantic labels with a common multi-scale convolutional architecture. ICCV 11(18):2650–2658. Elmore, J. G.; Wells, C. K.; Lee, C. H.; Howard, D. H.; and Feinstein, A. R. 1994. Variability in radiologists interpretations of mammograms. NEJM 331(22):1493–1499. Elmore, J. G.; Longton, G. M.; Carney, P. A.; Geller, B. M.; Onega, T.; Tosteson, A. N. A.; Nelson, H. D.; Pepe, M. S.; Allison, K. H.; Schnitt, S. J.; O’Malley, F. P.; and Weaver, D. L. 2015. Diagnostic concordance among pathologists interpreting breast biopsy specimens. JAMA 313(11):1122– 1132. Goodfellow, I.; Bengio, Y.; and Courville, A. 2016. Deep Learning. Cambridge, Massachusetts: MIT Press. Gulshan, V.; Peng, L.; Coram, M.; Stumpe, M. C.; D. Wu, A. N.; Venugopalan, S.; Widner, K.; T; Madams; Cuadros, J.; Kim, R.; Raman, R.; Nelson, P. C.; Mega, J. L.; and Webster, D. R. 2016. Development and validation of a deep learning algorithm for detection of diabetic retinopathy in retinal fundus photographs. JAMA 316(22):2402–2410. Hui, S. L., and Walter, S. D. 1980. Estimating the error rates of diagnostic tests. Biometrics 167–171. International Diabetes Foundation. 2015. Idf diabetes atlas, 7th ediction. diabetesatlas.org. Ioffe, S., and Szegedy, C. 2015. Batch normalization: Accelerating deep network training by reducing internal covariate shift. ICML 37:448–45. Karger, D. R.; Oh, S.; and Shah, D. 2011. Iterative learning for reliable crowdsourcing systems. NIPS 24:1953–1961. Kingma, D. P., and Ba, J. L. 2015. Adam: A method for stochastic optimization. ICLR. Liu, Q.; Peng, J.; and Ihler, A. T. 2012. Variational inference for crowdsourcing. NIPS 25:692–700. Mnih, V., and Hinton, G. E. 2012. Learning to label aerial images from noisy data. ICML 567–574. Moreno, P. G.; Artés-Rodrı́guez, A.; Teh, Y. W.; and PerezCruz, F. 2015. Bayesian nonparametric crowdsourcing. JMLR. National Eye Institute. 2015. Facts about diabetic eye disease. nei.nih.gov/health/diabetic/retinopathy. Pereyra, G.; Tucker, G.; Kaiser, L.; and Hinton, G. E. 2017. Regularizing neural networks by penalizing confident output distributions. arXiv. Ratner, A. J.; De Sa, C. M.; Wu, S.; Selsam, D.; and Ré, C. 2016. Data programming: Creating large training sets, quickly. In NIPS, 3567–3575. Raykar, V. C., and Yu, S. 2012. Eliminating spammers and ranking annotators for crowdsourced labeling tasks. JMLR 13:491–518. Raykar, V.; Yu, S.; Zhao, L.; Jerebko, A.; Florin, C.; Valadez, G.; Bogoni, L.; and Moy, L. 2009. Supervised learning from multiple experts: Whom to trust when everyone lies a bit. ICML 26:889–896. Raykar, V. C.; Yu, S.; Zhao, L. H.; Valadez, G. H.; Florin, C.; Bogoni, L.; and Moy, L. 2010. Learning from crowds. JMLR 11:1297–1322. Rodrigues, F.; Pereira, F.; and Ribeiro, B. 2014. Gaussian process classification and active learning with multiple annotators. In ICML, 433–441. Russakovsky, O.; Deng, J.; Su, H.; Krause, J.; Satheesh, S.; Ma, S.; Huang, Z.; Karpathy, A.; Khosla, A.; Bernstein, M.; Berg, A. C.; and Fei-Fei, L. 2015. Imagenet large scale visual recognition challenge. JMLR 115(3):211–252. Rutjes, A.; Reitsma, J.; Coomarasamy, A.; Khan, K.; and Bossuyt, P. 2007. Evaluation of diagnostic tests when there is no gold standard. a review of methods. Health Technology Assessment 11. Shlens, J. 2016. Train your own image classifier with inception in tensorflow. research.googleblog.com/2016/03/trainyour-own-image-classifier-with.html. Smyth, P.; Fayyad, U.; Burl, M.; Perona, P.; and Baldi, P. 1995. Inferring ground truth from subjective labelling of venus images. NIPS 7:1085–92. Szegedy, C.; Vanhoucke, V.; Ioffe, S.; Shlens, J.; and Wojna, Z. 2016. Re-thinking the inception architecture for computer vision. CVPR 2818–2826. Wauthier, F. L., and Jordan, M. I. 2011. Bayesian bias mitigation for crowdsourcing. NIPS 24:1800–1808. Welinder, P., and Perona, P. 2010. Online crowdsourcing: rating annotators and obtaining cost-effective labels. CVPR Workshop 25–32. Welinder, P.; Branson, S.; Perona, P.; and Belongie, S. J. 2010. The multidimensional wisdom of crowds. In NIPS, 2424–2432. Whitehill, J.; Ruvolo, P.; Wu, T.; Bergsma, J.; and Movellan, J. 2009. Whose vote should count more: Optimal integration of labels from labelers of unknown expertise. NIPS 22:2035–2043. Yan, Y.; Fung, G. M.; Rosales, R.; and Dy, J. G. 2011. Active learning from crowds. In ICML, 1161–1168.
1cs.CV
PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V . arXiv:1609.07058v1 [math.GR] 22 Sep 2016 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS Abstract. We consider generalisations of Thompson’s group V , denoted by Vr (Σ), which also include the groups of Higman, Stein and Brin. It was shown in [20] that under some mild conditions these groups and centralisers of their finite subgroups are of type F∞ . Under more general conditions we show that the groups Vr (Σ) are finitely generated and, under the mild conditions mentioned above, we see that they are finitely presented and give a recipe to find explicit presentations. For the centralisers of finite subgroups we find a suitable infinite presentation and then apply a general procedure to shorten this presentation. In the appendix, we give a proof of this general shortening procedure. 1. Introduction The original Thompson groups F ≤ T ≤ V are groups of homeomorphism of the unit interval, the circle and the Cantor-set respectively. In this note we consider generalisations of these groups, which are described as groups of automorphisms of certain Cantor algebras. These groups include Higman’s [18], Stein’s [23] and Brin’s [6] generalisations of V. The groups F , T and V have attracted the attention of group theorists for several reasons, one of them is that there are nice presentations and ways to represent elements available, making it possible to prove interesting results about metrics, geodesics and decision problems. However, the situation changes when one moves to some of their generalisations. There are presentations available for Higman’s groups Vn,r [18], Stein’s generalisations [5, 23] and Brin’s higher dimensional Thompson groups sV [17], but not for more complicated generalisations such as the groups Vr (Σ) we are considering here. These were defined by the first and third authors together with Kochloukova [19, 21] and were denoted Gr (Σ). It is worth pointing out that elements in Vr (Σ) admit a tree-pair representation similar to that of the original groups F, T and V . The authors show in [20] that, under some mild hypotheses, being valid and bounded, Vr (Σ) is the full automorphism group of a Cantor algebra. In the same paper it is shown that under some further minor restrictions, being complete, these groups are of type F∞ and that this also implies that centralisers of finite subgroups are of type F∞ . We introduce all necessary background in Section 2. The structure of centralisers in Vr (Σ) is studied in detail in [20, 21]. One of the objectives of the present paper is to introduce a common framework to get explicit finite generating sets for the groups Vr (Σ) in the case when the underlying Cantor-algebra Ur (Σ) is valid and bounded, and explicit presentations under the additional assumption that Ur (Σ) is complete. To do that, we construct a model for E G for G = Vr (Σ) and use this model to obtain explicit presentations of these groups. Date: January 3, 2018. 2000 Mathematics Subject Classification. 20J05. This work was partially funded by an LMS Scheme 4 grant 41209. The first named author was supported by Gobierno de Aragón, European Regional Development Funds and MTM2015-67781-P (MINECO/FEDER). The second author gratefully acknowledges the Fondation Mathématique Jacques Hadamard (ANR-10-CAMP0151-02 - FMJH - Investissement d’Avenir) and the Fundação para a Ciência e a Tecnologia (FCT-PEstOE/MAT/UI0143/2014) for the support received during the development of this work. 1 2 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS In Section 7 we also give an explicit finite presentation for centralisers of finite subgroups for those Vr (Σ) that are finitely presented. To do so we use the so called Burnside procedure as used by Guralnick, Kantor, Kassabov and Lubotzky [15]. In the Appendix we shall give an outline and proof of the Burnside-procedure as used in [15]. This procedure is well known, but we are also not aware of any proofs elsewhere. The idea to use the procedure is to look for an easy presentation for G, which is somehow symmetric and elementary, but may have even infinitely many generators and relations. The Burnside procedure offers a way to cut these down to a more manageable, and sometimes finite presentation. Acknowledgments. We would like to thank Collin Bleak for helpful discussions related to [3] and Martin Kassabov for introducing to us the Burnside procedure used in [15]. 2. Background on generalised Thompson groups In this section we introduce those properties of valid bounded Cantor-algebras used in this paper. For detailed definitions and notation the reader is referred to [21, Section 2], and for proofs of statements cited here, see [19, 20, 21]. Let S = {1, . . . , s} be a finite set of colours and associate to each i ∈ S an integer ni > 1, called arity of the colour i. For every i ∈ S consider the following right operations on a set U : (i) One ni -ary operation λi : U ni → U, and (ii) ni 1-ary operations α1i , . . . , αni i ; αji : U → U. We also consider, for each i ∈ S and v ∈ U, the map αi : U → U ni given by vαi := (vα1i , vα2i , . . . , vαni i ). The maps αi are called descending operations, or expansions, and the maps λi are called ascending operations, or contractions. Fix a finite set Xr of cardinality |Xr | = r. One can define the free objects on the set Xr with respect to the previous operations. To define our generalisations of Thompson’s group V , we will be interested in the free object constructed under the extra requirement that a certain set of laws Σ described below must be satisfied. This last free object is what we denote Ur (Σ) and call the (free) Cantor-algebra on Xr satisfying Σ. Definition 2.1. [21, Section 2] Fix a finite set Xr of cardinality |Xr | = r and consider the operations i) and ii) above defined on a set U . Then Σ = Σ1 ∪ Σ2 with Σ1 and Σ2 the following set of laws: i) Σ1 is given by uαi λi = u, (u1 , . . . , uni )λi αi = (u1 , . . . , uni ), for every u ∈ U , i ∈ S, and ni -tuple: (u1 , . . . , uni ) ∈ U ni . ii) Σ2 is given by [ ′ Σ2 = Σi,i 2 1≤i<i′ ≤s ′ is either empty or consists of the following laws: consider first i and where each Σi,i 2 fix a map f : {1, . . . , ni } → {1, . . . , s}. For each 1 ≤ j ≤ ni , we see αji αf (j) as a set of i αji αf (j) . Do the same for length 2 sequences of descending operations and let Λi = ∪nj=1 i′ (with a corresponding map f ′ ) to get Λi′ . We need to assume that f, f ′ are chosen ′ is so that |Λi | = |Λi′ | and fix a bijection φ : Λi → Λi′ . Then Σi,i 2 uν = uφ(ν) ν ∈ Λi , u ∈ U. PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 3 From now on we work with the free object Ur (Σ) only. Let B ⊂ Ur (Σ), b ∈ B and i a colour of arity ni . The set (B r {b}) ∪ {bα1i , . . . , bαni i } is called a simple expansion of B. Analogously, if b1 , . . . , bni ⊆ B are pairwise distinct, (B r {b1 , . . . , bni }) ∪ {(b1 , . . . , bni )λi } is a simple contraction of B. A finite chain of simple expansions (contractions) is an expansion (contraction). A subset A ⊆ Ur (Σ) is called admissible if it can be obtained from the set Xr by finitely many expansions or contractions. If a subset A1 is obtained from a subset A by an expansion (simple or not), then we write A ≤ A1 . Remark 2.2. Recall that Ur (Σ) is said to be bounded (see [21, Definition 2.7]) if for all admissible subsets Y and Z such that there is some admissible A ≤ Y, Z, there is a unique least upper bound of Y and Z. By a unique least upper bound we mean an admissible subset T such that Y ≤ T and Z ≤ T , and whenever there is an admissible set S also satisfying Y ≤ S and Z ≤ S, then T ≤ S. By [19, Lemma 2.5], any admissible set is a basis of Ur (Σ). Conversely, by [20, Theorem 2.5], if Σ is valid and bounded, any basis of Ur (Σ) is also an admissible set. Furthermore, for every admissible subset of cardinality m, we have that m ≡ r mod d for d := gcd{ni − 1 | i = 1, . . . , s}. In particular, any basis with m elements can be transformed into one of r elements. Hence Ur (Σ) = Um (Σ) and we may assume that r ≤ d. Definition 2.3. [21, Definition 2.12] Let Ur (Σ) be a valid Cantor algebra. We denote the group of all Cantor algebra automorphisms of Ur (Σ) by Vr (Σ). In particular, these automorphisms are induced by a map V → W , where V and W are admissible subsets of Ur (Σ) of the same cardinality. We denote the action of an automorphism on the left. For example, when Σ2 = ∅ and s = 1,we retrieve the original Higman-Thompson groups Gr,n [18]. For s = 2 and r = 1, the Brin-Thompson groups are now given by the set Σ2 that can be visualised as follows: x 1 23 x 4 1 32 4 Here dotted and black lines represent expansions of different colours. For more examples the reader is referred to [20, 21]. Remark 2.4. If Ur (Σ) is valid and bounded every element of Vr (Σ) can be given by a bijection V → W , where V and W are descendants of the fixed basis Xr . For r = 1, this means that we can visualise elements of V1 (Σ) by tree-pair diagrams of rooted trees, where the root represents the basis X1 = {x}. So, for example, when s = 1 and n = 2, V1 (Σ) = V , the original Thompson group, and the well-known generator x0 ∈ F ⊂ V is described as follows: 4 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS x0 −→ 1 3 2 3 1 2 Definition 2.5. [20, Definition 3.2] Let B ≤ A be admissible subsets of Ur (Σ). We say that the expansion B ≤ A is elementary if there are no repeated colours in the paths from elements in B to their descendants in A. We denote an elementary expansion by B  A. We say that the expansion is very elementary if all paths have length at most 1. Denote by Pr the poset of admissible subsets in Ur (Σ), and by |Pr | its geometric realisation. We now describe the Stein complex Sr (Σ) [23], which is a subcomplex of |Pr |. The vertices in Sr (Σ) are given by the admissible subsets of Ur (Σ). The k-simplices are given by chains of expansions Y0 ≤ . . . ≤ Yk , where Y0  Yk is an elementary expansion. From now on we we will denote Vr (Σ) by G. It was shown in [21] that |Pr | is a model for EG, the classifying space for proper actions. In the next section we will use Sr (Σ) to construct a model for E G. 3. A model for EG In this section we construct a model for the space E G when G is the automorphism group of a valid and bounded Cantor-algebra Ur (Σ) as before. We shall use this model to get, initially infinite, presentations for our groups, which we will the reduce to obtain a finite generating set, and later a finite presentation under some extra hypothesis on Ur (Σ). 3.1. Some technical observations. To begin with we collect a few technical observations that we will use later on. As seen before, the elements g in our group G can be expressed via a bijection between a pair of admissible subsets (or bases) (B, B ′ ) both of the same cardinality. But observe that the pair above is not enough to determine g and that we have to specify the explicit bijection. A way to overcome this problem is to work with ordered bases, in the sense that instead of a basis B viewed as a set, we will be considering an ordered tuple A with underlying set B. We say u(A) = B (u for underlying). A pair of ordered tuples (A, A′ ), both A and A′ of the same cardinality, uniquely determines the element of G mapping the elements of A to the elements of A′ in the prescribed order and conversely, any group element is expressible in this way. Of course, just as for the representation of the pair of bases, there is not a unique pair (A, A′ ) determining a given g ∈ G: we may apply descending or ascending operations to A and A′ in a consistent way to get a new pair of ordered tuples representing the same group element. Moreover, we may also permute the elements of both tuples in a consistent way and still get the same g. This motivates the following definition: given tuples A1 , A2 with bases as underlying sets we put A1 - A2 ⇐⇒ u(A1 ) ≤ u(A2 ) is an elementary expansion. Equivalently, A1 - A2 if u(A1 ) ≤ u(A2 ) in the Stein poset. Abusing slightly the terminology, we will say in this case that A2 is obtained from A1 by descending operations. Essentially this means that we are considering the permutation of the elements of a tuple as a new type of descending operation. Of course this could equally be viewed as an “ascending” operation, but it turns out to be convenient to view it as descending. If we want to record the precise operations that yield A2 when applied to A1 we will write ε A1 - A2 PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 5 and will also set A2 = A1 ε. Observe that ε can be seen as a precise recipe to get A2 , and in ε it is encoded exactly which elements are modified, permuted and so on. 3.2. The model for EG. Let Z be the complex constructed as follows: The points of Z are the ordered tuples A with underlying set a basis u(A) in the Stein complex Sr (Σ). For each chain A0 - . . . - Ak we attach an (oriented) k-simplex at the vertices A0 , . . . , Ak . Observe that there might be repeated vertices, so this is not a simplicial complex but rather has the structure of a ∆-complex, see [16, Section 2.1]. The group G acts on the set of bases, and using that action one can define a G-action on Z in the obvious way. Note that this action is free. In particular this implies that two different 1-simplices starting in A0 , say A0 - A1 and A0 - A′1 cannot be in the same G-orbit. ε Hence they yield different 1-simplices in the quotient complex Z/G. Conversely, if A0 → A1 is an edge in Z/G, then once we have fixed a lift A0 of A0 to Z, ε lifts to a unique 1-simplex of Z. Therefore there is some well defined set of descending operations yielding a tuple A′1 which ε is uniquely determined so that A0 - A′1 is the lift of ε. Moreover, the tuple A′1 is uniquely determined. Note that we have the extra restriction coming from the Stein poset: we can only apply descending operations of the same colour once to any element of A0 . Applying the same argument implies that this also holds for any lift of a path in Z/G to Z. We now show that Z is contractible by using the contractibility of Sr (Σ). There is a G-map u : Z → Sr (Σ) associating the underlying basis to an ordered tuple. Fix a basis B ∈ Sr (Σ) of cardinality k. Then u−1 (B) is the full subcomplex of Z with 0simplices given by the tuples with underlying set B, i.e. given by all possible permutations of the elements in B. Let H the stabiliser of B in G. Then H is isomorphic to the symmetric group of degree k and acts freely on the 0-simplices of u−1 (B). In fact we may choose a bijection between the 0-simplices of u−1 (B) and the elements of H and the definition of the complex structure of Z means that any (k + 1)-elements subset of 0-simplices spans a k-simplex. For example if H = S2 is the symmetric group on two letters with elements 1 and x, then the 1-simplices are {1, 1}, {1, x}, {x, 1} and {x, x}, and the 2-simplices are {1, 1, 1}, {1, 1, x} etc. In other words, u−1 (B) is easily seen to be the usual complex associated to the bar resolution of the finite group H, see for example [16, Example 1B.7]. In particular this shows that that u−1 (B) is contractible. Using Quillen’s Theorem A [22], we can now show that u is a homotopy equivalence. To see this, let JZ be the category with objects the simplices of Z and morphisms given by the face relations. Note that since Z is not a simplicial complex, this is not a poset. Let JS be the poset of simplices in Sr (Σ). The map u induces a functor Ju : J Z → J S , and the geometric realisations of nerves of the categories JZ and JS are the barycentric subdivisions of Z and Sr (Σ) respectively. Once we show that for any σ : B0 < B1 < . . . < Bt in JS , Ju /σ := {τ ∈ JZ | Ju (τ ) is a subsimplex of σ} is a contractible subcategory of JZ , we can use Quillen’s Theorem A to deduce that Ju is a homotopy equivalence. The category Ju /σ is just the category with objects the simplices in the join u−1 (B0 ) ⋆ . . . ⋆ u−1 (Bt ) 6 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS and morphisms given by face relations. As u−1 (B0 ) ⋆ . . . ⋆ u−1 (Bt ) is contractible, this category is also contractible. Hence Ju is a homotopy equivalence and thus u is, too. Since Sr (Σ) is contractible we deduce that Z is contractible as required. 4. An infinite presentation In this section we use the model for E G just constructed to obtain a presentation for our group. As the model is of infinite type, our presentation will initially be infinite, but we will see in the next section how it is possible in the case when the Cantor-algebra is valid and bounded to reduce the generating system to a finite one. We obtain our presentation using the following well known result that we recall here for the reader’s convenience. Theorem 4.1. ([14, Theorem 3.1.16 and Corollary 3.1.17]) Let G be a group and Z a simply connected CW-complex with a free G-action such that Z/G is oriented and path connected. Let T be a maximal tree in Z/G. Let • W be the set of (oriented) 1-cells of Z/G, • R be the set of words in the alphabet W ∪ W −1 obtained as follows: for each (oriented) 2-cell e2γ in Z/G, let τ (e2γ ) be a word representing the boundary δe2γ and set R = {τ (e2γ ) | e2γ oriented 2-cell of Z/G}. • S ⊂ W be the set of (oriented) 1-cells of T (seen as one letter words in W ). Then hW | R ∪ Si ∼ is a presentation of the group G = π1 (Z/G). If moreover Z/G has finite 2-skeleton, then this is a finite presentation. 4.1. The isomorphism G ∼ = π1 (Z/G). We now give an explicit isomorphism between G and the fundamental group of Z/G, where we are coming back to our previous notation so G = Vr (Σ) and Z is the complex of Subsection 3.2. The standard way to do that is to fix some point x0 ∈ Z and map the element g ∈ G to the loop in Z/G obtained by taking the quotient of a path from x0 to gx0 in Z. We shall take as x0 a tuple with underlying set our preferred basis of r elements Xr . To ease notation, we denote this tuple by Xr as well. As the G-action on Z preserves the cardinality of each tuple, the 0-simplices of Z/G correspond to the possible cardinalities of tuples (or of bases). By Remark 2.2, we recall that the possible cardinalities of the bases are exactly the integers congruent to r modulo d where n1 , . . . , ns are the arities and d = gcd(n1 − 1, . . . , ns − 1). So the 0-simplices of Z/G can be labelled as {X i | i ≡ r mod d} where the subindex is the cardinality of the associated bases. Now, choose a maximal tree T in Z/G. The vertices of T are all the 0-simplices above and there is a unique path in T from X r to each other X i . This path determines uniquely a precise tuple Xi that is a lift of X i (observe that Xi depends on the choice of T ). ε Let X i → X j be an edge (thus i ≤ j). By the comments above there is a uniquely determined ε lift Xi → Xj′ of ε, here Xj′ is a new tuple which is in the same orbit as Xj . Therefore there is a uniquely determined g ∈ G such that Xj′ = gXj , and this is precisely the element in G corresponding to the generator ε ∈ π1 (Z/G). We have g = (Xj , Xj′ ) and Xj′ = Xi ε. PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 7 Example 4.2. Let G be the original Thompson group V . In particular, r = 1, s = 1, n = 2. We can represent bases of U1 (Σ) by finite rooted binary trees, and hence can choose X1 to be a single point, and X2 and X3 to be the bases represented as follows: 1 2 1 X2 2 X3 3 Suppose we take ε to be the expansion of X2 on the left-hand leaf. This gives us X3′ as follows: 3 1 2 and the corresponding element of V is x0 as described after Example 2.4. 4.2. The maximal tree T . To be able to write down an explicit presentation, the choice for T becomes important. This relies heavily on the choice of representative for Xi above. This amounts to choosing a particular set of bases Xi in Ur (Σ), where i ≡ r mod d. Example 4.3. For G = sV we have r = 1 and for each k ∈ N there is a basis Xk . Again, these can be represented by finite rooted binary trees. Now fix a colour i ∈ S and choose the Xk as follows: we begin with X1 our fixed one-element basis represented by a single point. Now X2 is the basis obtained by applying the descending operation of colour i to X1 . We successively chose Xk as obtained from Xk−1 by applying the descending operation of colour i to the last element of Xk−1 and labeling the elements in successive order. The representation for Xk by a binary tree then looks as follows: 1 2 3 k−1 k Notice that for V1 (Σ) we can always choose the Xk to be represented by a rightmost tree as above, provided that all colours have the same arity. Now the construction shows that the maximal tree T in Z/G is a rooted infinite line. 8 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS For example, the baker’s map b ∈ 2V can be easily described using the bases chosen above. Let X1 be a single point and X2 be as in Example 4.2; note that we expanded with colour 1. Now we consider X2′ the basis obtained from X1 by expanding once with colour 2 (represented by a dashed line). Hence this gives rise to the element b ∈ 2V. b −→ 1 2 1 2 X2′ X2 For the general case with mixed arities we will not be able to find such a straightforward set of representatives Xi as before. We will show that we can, however, find a maximal tree T in Z/G, whose vertices are all but a finite number obtained by a step-by step process beginning with our fixed basis Xr and then expanding the last element of a basis previously constructed. Example 4.4. Let Vr (Σ) be the group given by r = 1, s = 2, n1 = 5 and n2 = 7. Then d = 2 and our chosen set of bases is of the form {Xi | i ≡ 1 mod 2}. By simply expanding X1 by the colours 1 and 2 respectively, we obtain X5 and X7 . To obtain a X3 we could contract the last 5 elements of X7 by colour 1, but there is no way to obtain X3 from X1 by simply expanding. Remark 4.5. We now describe the construction of our preferred maximal tree T in Z/G, where G = Vr (Σ) is the automorphism group of a valid and bounded Cantor algebra. We begin by showing that we can obtain all but finitely many of the bases {Xi | i ≡ r mod d} from Xr applying descending operations only. In other words s X ki (ni − 1) | 0 ≤ k1 , . . . , ks } ∪ P = {r + kd | 0 ≤ k}, {r + i=1 where P is a finite set of integers. To see this, observe first that the problem can be reduced to the case when r = 0 and d = 1. Now choose integers k1 , . . . , ks such that s X ki (ni − 1) 1= i=1 and use them to produce integers m1 , ..., ms with 0 ≤ m2 , . . . , ms such that s X mi (ni − 1). 1= i=1 Hence 1≡ s X mi (ni − 1) mod m1 . i=2 Multiplying this expression by the integers 2, . . . , m1 we get positive numbers a1 , . . . , am1 which are a complete set of representatives of the residues modulo m1 and such that they all belong to P s i=1 N(ni − 1). Now, let m be any integer with m ≥ max{ai | 1 ≤ i ≤ m1 }. Then for some such i, we have m ≡ P ai modulo m1 thus m − ai = lm1 for some l ≥ 0. From this we deduce that m s also belongs to i=1 N(ni − 1). PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 9 It is now easy to find a (non maximal) directed tree in P Z/G having X r as root and such that s the cardinalities of the vertices are precisely the set r + i=1 N(ni − 1). Moreover, we can do it in such a way that the descending operations are always applied to the last element of each tuple. There are only finitely many points of our space Z/G not in this tree. Choose one of them and consider a path from that point to some point of the tree Adding this path we get a new tree which is no longer rooted. If there are still points left then repeat the process. Eventually, we get a tree with the desired properties and having only finitely many roots. 4.3. The presentation. Now we apply Theorem 4.1 to produce an explicit presentation. We do get an abstract group presentation but we can also write it down as a presentation in terms of elements given by pairs of ordered bases using the explicit isomorphism in Subsection 4.1, which allows one to recognise the group elements in a much more familiar way. Recall that we have fixed a set of tuples {Xi | i ≡ r mod d} which are lifts of the nodes of our tree T . Moreover there is a tree in Z that is a lift of T . By [14, Theorem 3.1.16], π1 (Z/G) is generated by the edges in Z/G, i.e. by the 1-simplices ε X i → X j in Z/G. As we have seen before, these correspond to elements g ∈ G which are given by pairs (Xj , Xi ε) where ε is a set of descending operations. There are two sets of relators: (i) Relators of the form ε = 1 whenever ε is an edge in the tree T . This means that there are tuples Xi and Xj in T such that Xj is obtained from Xi performing the operations ε. The group element that corresponds to ε is (Xj , Xj ). (ii) Relators obtained from the boundaries of the 2-cells in Z/G. The 2-cells of Z/G come from 2-cells in Z and these are of the form A0 - A1 - A2 . Let ε1 be the set of operations needed to obtain A1 from A0 , ε2 the set of operations needed to obtain A2 from A1 and ε the composition of ε1 and ε2 . Passing down to the quotient Z/G we get a 2-cell with boundary labelled ε1 , ε2 and ε. So we have the relator ε = ε1 ε2 . All this means that this second set of relators consists of the “composition of paths”. We want to write down this in terms of pairs of ordered bases. Let i be the cardinality of A0 and j1 the cardinality of A1 . The edge ε1 represents the element g1 = (Xj1 , Xi ε1 ) ∈ G. We may apply the descending operations ε2 to this pair and then we observe that also g1 = (Xj1 ε2 , Xi ε1 ε2 ). Note here that this follows from the definition of tree pair representation, and we do not need anything about the presentation that we are building. Let j2 be the cardinality of A2 , then ε2 represents the element g2 = (Xj2 , Xj1 ε2 ) and ε represents g = (Xj2 , Xi ε). So we get the relator g = g1 g2 . In the particular case when Xj1 ε2 belongs to the lift of our tree T , or equivalently when ε2 belongs to T , there is also a relator g2 = 1 and we deduce g = g1 . This can also be seen using tree pairs: as Xj2 belongs to the prefixed set of nodes and has the same cardinality as Xj1 ε2 , we must have Xj1 ε2 = Xj2 . We may summarise as follows: G = hW | Ri where W = {(Xj , Xi ε) | ε is a sequence of descending operations and Xi 6= Xj } and R = {g = g2 g1 | g = (Xj2 , Xj1 ε2 ), g1 = (Xj1 , Xi ε1 ), g2 = (Xj2 , Xj1 ε2 ), and ε = ε1 ε2 }. 10 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS Alternatively, we may delete the pairs (Xj , Xi ε) such that ε lies in the tree T from our list of generators. 4.4. Reducing the generating set. A quick look to the generating set we have just obtained shows that it is far too big. Reducing it can be a complicated task but there is a reduction that seems natural: our generators come from edges in Z/G and these edges come from descending operations, so one expects that edges coming from “very elementary operations” should be enough. This is in fact the case but to make it more precise we need now some additional technicalities. Let us fix what should be called “very elementary” in our context. An edge ε A1 - A2 in Z is very elementary if it consists of a single operation, i.e., if it is either a permutation or it is a single descending operation (in this case u(A1 ) < u(A2 ) is very elementary) but we do not allow composition of both. The case when u(A1 ) < u(A2 ) will be termed strict and for these type of operations we will assume that if the original tuple is (x1 , . . . , xi ) and we apply the descending operation α at the k-th element then the resulting tuple is (x1 , . . . , xk−1 , xk α1 , . . . , xk αnα , xk+1 , . . . , xi ). Any ε can be written as a composition of very elementary operations. Of course it may happen that different sequences of operations give the same result when applied to the same tuple. The following happens in the situations below, which we shall refer to as moves: i) Disjoint type: we may apply two very elementary strict descending operations acting on distinct elements of a tuple and we get the same regardless of the order of application of these two operations. ii) Σ type: we have different chains of elementary strict descending operations such that, up to a permutation, give the same result when applied to any element of any tuple and which come from the defining relations for the algebra encoded in Σ. iii) Permutation-descending: we may first permute the elements of a tuple and then apply a very elementary strict descending operation or do it the other way around in a consistent manner and get the same result. iv) Permutation: the composition of two permutations is still a permutation. Lemma 4.6. Let A1 , A2 be tuples. If two different chains of very elementary descending operations yield A2 when applied to A1 , then one can be obtained from the other by repeated application of moves of the four types above. Proof. By doing moves of types iii) and iv) only we may assume that our two chains are of the form ε1 ε2 . . . εt σ, ε′1 ε′2 . . . ε′t′ σ ′ , where all εi , ε′i are very elementary and strict and σ, σ ′ are permutations. Consider first what happens when we look at the underlying sets u(A1 ) and u(A2 ). The fact that both series of operations give the same set when applied to u(A1 ), implies that, for each particular element, we are either performing the same operation or the same operation up to applying some of the relators encoded in Σ. This means that ε1 ε2 . . . εt can be transformed to ε′1 ε′2 . . . ε′t′ by doing moves of types i) or ii) without taking the order of the elements into account. The fact that the relations in Σ involve certain permutations implies that what we really get is that via some extra moves of types iii) and iv), ε1 ε2 . . . εt is transformed to ε′1 ε′2 . . . ε′t′ τ for a certain permutation τ . So at this point our two sequences are ε′1 ε′2 . . . ε′t′ τ σ, ε′1 ε′2 . . . ε′t′ σ ′ . PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 11 The fact that both sequences yield A2 when applied to A1 implies that Bτ σ = Bσ ′ for B = A1 ε′1 ε′2 . . . ε′t′ , which is a move of type iv).  We next use Tietze transformations next to change the presentation above. Essentially, what we need to do is the following: whenever there is a relator g = g1 g2 we delete g from our set of generators. The effect of this transformation on the generating set is that we no longer have elements g coming from edges which are not very elementary. Moreover we will have only two kinds of generators: strict generators coming from strict very elementary edges, and finite order generators coming from permutations. We denote these sets by Ws = {(Xj , Xi ε) | ε a very elementary strict expansion, j = |Xi ε|} and call these very elementary strict generators. We also consider the elements of the set Wp = {(Xi , Xi σ) | σ a permutation}, and call them permutations. From now on we will use the term strict generators for elements in Ws instead of the more precise very elementary strict generator. The effect of this transformation on the set of relators is as follows: we no longer have to consider relators coming from edges in the tree. Whenever there are two sequences of very elementary operations that give the same A2 when applied to some A1 , we have a new relator. Lemma 4.6 implies that these relators can be obtained from relators of the following types i) RD contains relators of the form g1 g2 = g2′ g1′ with g1 , g2 , g1′ , g2′ strict generators coming from moves of disjoint type. ii) RΣ contains relators between strict generators possibly followed by a permutation coming from moves of Σ type. iii) RP D contains relators of the form gσ = σg with g a strict generator and σ a permutation coming from moves of type iii). iv) RP contains relators of the form σ = σ1 σ2 with σ, σ1 and σ2 permutations coming from moves of type iv). Thus G admits the following (infinite) presentation (1) hWs ∪ Wp | RD ∪ RΣ ∪ RP D ∪ RP i. 4.5. Being more explicit. Let us consider an arbitrary strict generator (Xj , Xi ε) associated to the strict edge ε. It is completely determined by a triple (i, k, t) meaning that ε is obtained by applying the descending operation of colour t to the k-th element of an orbit representative of the set of tuples of order i. We will use the triple to denote the generator. Now we are going to write down explicitly how relators of disjoint type look like with this new notation. Recall that these relators come from very elementary strict descending and disjoint operations ε1 , ε2 on one hand, and ε′2 , ε′1 on the other. They are such that ε1 ε2 = ε′2 ε′1 where ε1 and ε′1 are operations of the same colour, say t, whereas ε2 and ε′2 are of colour s. Moreover ε1 acts at the k1 -th and ε′2 acts at the k2 -th elements of Xi . We may assume that k1 < k2 . Observe that this means that if we apply a descending operation to the k2 -th element first then the k1 -th element remains the same, but if we do it the other way around, i.e., apply a descending operation of colour t to the k1 -th element first, then the former k2 -th element becomes 12 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS the (k2 + nt − 1)-th. Therefore the triples associated to each of ε1 , ε2 , ε′2 , ε′1 are ε1 : (i, k1 , t) = (Xi+nt −1 , Xi ε1 ), ε2 : (i + nt − 1, k2 + nt − 1, s) = (Xi+nt −1+ns −1 , Xi+nt −1 ε2 ), ε′2 : (i, k2 , s) = (Xi+ns −1 , Xi ε′2 ), ε′1 : (i + ns − 1, k1 , t) = (Xi+ns −1+nt −1 , Xi+ns −1 ε1 ), and our relator is (2) (i, k1 , t)(i + nt − 1, k2 + nt − 1, s) = (i, k2 , s)(i + ns − 1, k1 , t) Analogously, it is possible to represent a generator (Xi , σ(Xi )) of “permutation type” using the pair (i, σ). Now, relators of type RP D come from the fact that applying first a permutation and then a very elementary strict operation to a tuple, yields the same as doing it the other way around for a suitable permutation. More explicitly, assume that we start with the tuple Xi . Let ε be the operation associated to the triple, say, (i, k, t) and consider a permutation σ represented by the pair (i, σ). Slightly abusing notation view σ as a permutation of the numbers {1, . . . , i}. Starting with Xi and performing first the permutation σ and then applying the strict descending operation associated to ε′ = (i, σ(k), t), yields the tuple Xi σε′ whose underlying set is the same as that of the tuple Xi ε. Therefore there is some permutation σ ′ such that the tuples Xi σε′ and Xi εσ ′ coincide. And this implies that we have a relator σ · ε′ = ε · σ ′ or (i, σ)(i, σ(k), t) = (i, k, t)(i + nt − 1, σ ′ ). (3) 5. A finite generating set In this section, we show that the generating system Ws ∪ Wp can be reduced to a finite one. We begin with Ws . We will use the following two particular cases of relators of disjoint type: Case 1 : Let (i, k, t) be a triple such that i − k > nl − 1 for any colour l where we include the case l = t. Assume moreover that the terminal point of the associated edge in Z/G, i.e. X i+nt −1 , is not a root of the tree T . Recall that this edge consists of applying a descending operation of colour t, which increases the cardinality in nt − 1. Then there is some edge of T ending in X i+nt −1 . Let s be the colour of this last edge which is represented as a triple by (i + nt − ns , i + nt − ns , s) (recall that we constructed the tree T in such a way that the last element of each tuple is always being expanded). Now, as i − k > ns − 1 we deduce k < i − ns + 1. Thus there is a relator of disjoint type as (2) but with i − ns + 1 instead of i, k instead of k1 and i − ns + 1 instead of k2 . This relator is (i − ns + 1, k, t)(i + nt − ns , i + nt − ns , s) = (i − ns + 1, i − ns + 1, s)(i, k, t). Since there is also a relator (i + nt − ns , i + nt − ns , s) = 1, because it belongs to T , we deduce (i, k, t) = (i − ns + 1, i − ns + 1, s)−1 (i − ns + 1, k, t). (4) This means that (i, k, t) can be expressed in terms of triples with a smaller value of i. Case 2 : Let (i, k, t) be a triple such that i ≥ k ≥ nt + 1. Then k − nt + 1 > 1 and i − nt + 1 ≥ 2. This means that there is a relator of disjoint type as in (2) but with i − nt + 1 instead of i, 1 instead of k1 and k − nt + 1 instead of k2 . This relator is (i − nt + 1, 1, t)(i, k, t) = (i − nt + 1, k − nt + 1, t)(i, 1, t). From this we deduce (5) (i, k, t) = (i − nt + 1, 1, t)−1 (i − nt + 1, k − nt + 1, t)(i, 1, t), PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 13 meaning that (i, k, t) can be expressed in terms of triples with either a smaller value of i or with k = 1. Observe now that arguing by induction on i + k, equations (4) and (5) imply that any element in Ws lies in the finite subgroup generated by the finite subset {g ∈ Ws | the associated triple fails to fulfill both the conditions in case 1 and in case 2}. Example 5.1. Let us consider the group V , i.e. here we have one colour t and nt = 2. For now let us only concentrate on the strict generators Ws . Note that an element (i, i, t) is the identity. Looking at the representation by tree-pair diagrams, and the choice of Xi in Example 4.3, it implies that we expand the rightmost leaf of the rightmost tree Xi , hence we obtain Xi+1 and the group element is represented by (Xi+1 , Xi+1 ), which is the identity. Now consider elements (i, k, t), where k < i − 1. Again, using the rightmost-tree, we see that after deleting unnecessary carets on the right, we get (i, k, t) = (k + 1, k, t), which is exactly the relator (4). For example, consider (3, 1, t). Then the corresponding tree-pair diagram looks as follows: x0 −→ X4 X4′ = X3 ε In particular, after deleting the rightmost caret in each tree, this is exactly the element x0 , see the picture after Remark 2.4. Writing xi−2 = (i, i − 1, t), we recover the well known infinite generating set {xk | k ≥ 0} for F < V. Furthermore, this enables us to simplify the relator (2) above. We have (i, k1 , t)(i + 1, k2 + 1, t) = (i, k2 , t)(i + 1, k1 , t). Using that (i, k, t) = (k + 1, k, t) for k < i − 1, we get the well known relator x−1 k xl xk = xl+1 for any k and l. Moreover, observe that strict generators and disjoint relators give us the well known infinite presentation of Thompson’s group F (see [10]). Now we want to reduce Wp in a similar way. The most natural way to do that is using relators of type RP D , i.e. those mixing permutations and strict generators. To be able to argue by induction as before, we need to show that if i is big enough, any element of the form (Xi , σ(Xi )), where σ is a permutation, can be expressed in terms of permutations with a smaller i and possibly strict generators. As the group of permutations of the tuple Xi is generated by transpositions, we may assume that σ itself is a transposition. Now, assume that i ≥ 3nt for t a colour with smallest possible arity nt . As σ only moves 2 elements, we may find nt consecutive elements in Xi which are untouched by σ. Let k be such that the k-th element in Xi is the first one of those nt consecutive elements, and consider the strict generator associated to the triple 14 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS (i − nt + 1, k, t). Let σ ′ be the transposition of Xi−nt +1 that moves precisely the elements that are also moved by σ. Then the associated relator (3) with i − nt + 1 instead of i, and σ, σ ′ interchanged is (i − nt + 1, σ ′ )(i − nt + 1, k, t) = (i − nt + 1, k, t)(i, σ). Thus (6) (i, σ) = (i − nt + 1, k, t)−1 (i − nt + 1, σ ′ )(i − nt + 1, k, t) as we wanted to show. This discussion can be summarised as follows: Theorem 5.2. Assume that Ur (Σ) is valid and bounded. Then Vr (Σ) is generated by the finite set consisting of elements of the following three types: 1) Strict generators associated to triples (i, k, t) with i ≤ nt + 1 and i − k ≤ ns for any colour s. 2) Strict generators associated to triples (i, k, t) such that X i+nt −1 is a root of the tree T . 3) Permutations associated to pairs (i, σ) such that i < 3nt for some colour t. Example 5.3. Consider G = V. In Example 5.1, we have already recovered the infinite presentation for F < V. In the tree of Example 4.3, the triples have a single root X1 so we do no have to consider generators as in item 2) of Theorem 5.2. As before, let i ≥ 2 and denote by xi−2 the group element associated to triple (i, i − 1, t). Then from Theorem 5.2 one deduces the well known fact that the elements xi , i ≥ 1 together with the permutations generate the group and that x0 and x1 plus permutations are enough. Remark 5.4. Similar generating systems can be obtained without using the space Z by proceeding as Burillo and Cleary did for the Brin-Thompson groups sV [9, Theorem 2.1]. Instead of our first step (Subsection 4.1), fix a set of tuples, one for each possible cardinality, which are to be the “source tree” of our tree pairs, and as “target tree” we allow anything that is obtained from one of these tuples by descending operations and permutations only. If g ∈ G is an arbitrary element, it follows from the fact that any two bases have a common descendant that g = (Y1 , Y2 ) where Y1 and Y2 are obtained in that way. Then, choose Xi in our previously fixed set of tuples (what used to be the set of nodes in T ) of the same cardinality as Y1 and Y2 , and observe that g = g2 g1−1 with g1 = (Xi , Y1 ) and g2 = (Xi , Y2 ). These are precisely the type of elements we wanted to verify to be generators of the group. The choice of that fixed set of tuples can be the same as in Subsection 4.2, but now we no longer need to construct the actual tree T , we only need the nodes. For example, we can proceed as follows: as done before, fix a tuple Xr with r elements and choose integers m1 , . . . , ms with s X d= mt (nt − 1). t=1 There is a sequence of operations (first descending, then ascending) that we can perform on the last element of Xr to get a new tuple with exactly r + d elements that we denote Xr τ . We may repeat the process to get a new tuple Xr τ 2 and so on. We set Xr τ 0 := Xr , let Xi+rd := Xr τ i for i ≥ 0 and take the obtained family as our prefixed set of “sources”. As seen above, our first set of generators is then {(Xj , Xi ε) | ε sequence of descending operations}. Using Subsection 4.4 this can be further reduced to {(Xj , Xi ε) | ε single strict descending operation or permutation}. PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 15 Again, there is no serious need of the space Z to see that this reduction is possible. One can just check that composition of these elements corresponds to composition of the associated descending operations, in a way similar to that of [9]. The same happens with the reduction performed in Subsection 4.5: basically, we used Z only to have some identities available that allowed us to eliminate some elements from our generating system, but all those identities can be easily checked by hand and one gets the same finite set in the end. 6. Finite presentations In this section, we still assume that Ur (Σ) is valid and bounded and we add the extra hypothesis that it is also complete to exhibit a procedure that gives a finite presentation. To do that, we just replace Z by a truncated version Z n and we use the results of Section 4 to obtain an explicit finite presentation. Definition 6.1. Using the notation of Definition 2.1, suppose that for all i 6= i′ , i, i′ ∈ S we ′ 6= ∅ and that f (j) = i′ for all j = 1, ..., ni and f ′ (j ′ ) = i for all j ′ = 1, ..., ni′ . have that Σi,i 2 Then we say that Ur (Σ) is complete. Considering the Morse function t(A) = |A| in Sr (Σ) we can filter the complex with respect to t, and define the truncated Stein complex Sr (Σ)n := full subcomplex supported on {A ∈ Sr (Σ) | t(A) ≤ n}. In particular this is just the simplicial complex Sr (Σ)n obtained by considering bases of cardinality bounded by n only. Note that this complex was used in [20, Theorem 3.1] to show that under the conditions above, Vr (Σ) is of type F∞ . The purpose of this section is to give a recipe for constructing explicit presentations. Obviously, we can do the same with the complex Z and consider its truncated version Z n where the tuples have at most n elements. The map u restricts to these truncated versions and the same argument as in Subsection 3.2 shows that there is a homotopy equivalence u : Z n → |Sr (Σ)n |. By [13, Corollary 3.9] for the special case of sV and [20, Section 3] for the general case, assuming that Ur (Σ) is valid, bounded and complete, there is some positive integer n0 depending on Σ, such that for any n ≥ n0 and any basis B ∈ Sr (Σ) with cardinality |B| = n + 1 the link of B in the Stein complex Sr (Σ) is simply connected. Using Morse Theory ([2, Corollary 2.6]) we deduce that for n ≥ n0 the inclusion Sr (Σ)n ⊆ Sr (Σ)n+1 induces an isomorphism in π1 and π0 . As the space Sr (Σ) is contractible we have 1 = π1 (Sr (Σ)) = lim π1 (Sr (Σ)n ), 1 = π0 (Sr (Σ)) = lim π0 (Sr (Σ)n ). and 1 = π1 (Sr (Σ)n ) = π0 (Sr (Σ)n ) for n ≥ n0 . From this we deduce that Sr (Σ)n is path connected and simply connected for n ≥ n0 . This, together with the fact that u is a homotopy equivalence, implies that the same holds true for Z n . Finally, observe that Z n being path connected implies that the same is true for Z n /G. Therefore we can use Z n instead of Z in Theorem 4.1 and as Z n /G is finite we get a finite presentation. Hence we have Theorem that Z n is generators generators 6.2. Let Ur (Σ) be a valid, bounded and complete Cantor algebra, and let n ≥ 1 such simply connected. Then there is a finite presentation of Vr (Σ) involving only strict (i, k, t) with i + nt − 1 ≤ n, permutations (i, σ) with i ≤ n and relators involving these only and which is obtained by truncating the presentation hWs ∪ Wp | RD ∪ RΣ ∪ RP D ∪ RP i 16 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS given in (1). The main difference with the reduction process of Section 5 is that we are now also reducing the set of relators. Moreover, the “truncated” set of generators in the finite presentation obtained this way can be further reduced using the same arguments as in Section 5. Example 6.3. For G = V , in [13, Corollary 3.9] there is a explicit condition on n that implies that Z n is simply connected: we need n−1 ⌋−1 1≤⌊ 3 thus we can take n = 7. This means that the set of strict generators in Example 5.1 can be reduced to x0 , . . . , x4 and the relators of disjoint type can be reduced to x−1 k xl xk = xl+1 where (k, l, l + 1) is one of the following tuples: (0, 1, 2), (0, 2, 3), (0, 3, 4), (1, 2, 3), (1, 3, 4), (2, 3, 4). At this point it is not difficult to write down a finite presentation of V . Note also that in Example 5.3 we had already reduced to two strict generators x0 and x1 . Recently Bleak and Quick found a short finite presentation for V with 2 generators and 9 relations using different methods [4]. Using our methods we get a finite presentation of Thompson’s group F, and by using Tietze moves this presentation can be transformed to the well-known −1 −2 −2 −1 −1 3 2 2 hx0 , x1 | x−3 0 x1 x0 = x1 x0 x1 x0 x1 , x0 x1 x0 = x1 x0 x1 x0 x1 i Example 6.4. For G = sV we can also use [13, Corollary 3.9] to compute the value of n making Z n simply connected: we need n−1 1≤⌊ s ⌋−1 2 thus we can take n = 1 + 2s+1 . Recall that when choosing the maximal tree in Z/G we chose expansion by one colour only (see Subsection 4.3). Let that colour be denoted by 1. For the same reason as in Example 5.1 we now have that elements of the form (i, i, 1) are the identity, and that for any colour t and any k < i − 1, we have that (i, k, t) = (k + 1, k, t). This now gives an infinite Ws , which for G = 2V can be listed as follows: (i + 1, i, 1), (i + 1, i, 2), and (k, k, 2), which corresponds to the infinite order generators Ai−1 , Bi−1 and Ci of Brin’s infinite generating set of 2V , see [6] or [9]. Now by condition 1) of Theorem 5.2 this can be reduced to a finite generating set with 7 strict generators, those where i ≤ 2 and k ≤ 3, as well as a finite number of permutation generators. Using Theorem 6.2 without any further reductions, we get a finite presentation where i ≤ 7 and k ≤ 8. 7. Finite presentation for centralisers of finite subgroups The proof of [20, Theorem 4.9] can be used to show that whenever the group Vk (Σ) is finitely presented for any k, then so is CVr (Σ) (Q) for any finite Q ≤ Vr (Σ), but the proof there does not yield an explicit finite presentation. In this section we are going to construct a finite presentation of CVr (Σ) (Q). To do that, we proceed as follows. The first thing to observe is that, according to [20, Theorem 4.2] , the group CVr (Σ) (Q) is a direct product of groups of the form lim(Ur′ (Σ), L) ⋊ Vr′ (Σ). −→ We now summarise the notation developed in [20]. The semidirect product above is associated to a fixed transitive permutation representation ϕ : Q → Sm of the finite group Q, where Sm is the symmetric group of degree m, the orbit length. Then L is the centraliser of the image PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 17 ϕ(Q) in Sm and thus is a finite group. The number r′ depends on ϕ, see [20, Theorem 4.2], but in order to simplify notation we will just set r′ = r. The set of bases in Ur (Σ) together with the expansion maps can be viewed as a directed graph and we let (Ur (Σ), L) be the following diagram of groups associated to this graph: To each basis A we associate Maps(A, L), the group with elements the maps from A to L where the group operation is induced by multiplication in L. Each simple expansion A ≤ B corresponds to the diagonal map δ : Maps(A, L) → Maps(B, L) with δ(f )(aαji ) = f (a), where a ∈ A is the expanded element. Then we consider the direct limit lim(Ur (Σ), L) whose elements are determined by some basis A and a map A → L. Observe that −→ we may always assume that the basis A satisfies Xr ≤ A. We begin by studying presentations for lim(Ur (Σ), L). We will obtain an infinite presentation −→ (see Lemma 7.1 below) and then we will use the semidirect product action of Vr (Σ) on this presentation together with the so called Burnside procedure described in the Appendix to get a (finite) presentation of the group lim(Ur (Σ), L) ⋊ Vr (Σ). −→ We begin by constructing a generating system for the group lim(Ur (Σ), L). Take x ∈ L and −→ A a basis with Xr ≤ A. Take some subset A1 ⊆ A and let χA1 ,x ∈ lim(Ur (Σ), L) be the element −→ that maps every a ∈ A1 to x and every a ∈ A r A1 to the identity 1 ∈ L. It is easy to see that the set of all the elements of this form generates our group, but observe that there might be a uniqueness issue because if we had another basis C with A ≤ C and C1 is the subset of those elements in C coming from elements in A1 , then χA1 ,x = χC1 ,x . To avoid this problem we set ω(A1 ) := {b descendant of elements in Xr | aw = bw′ for some a ∈ A1 and descending words w, w′ } (this was denoted A1 (L) in [20]) and Ω := {ω(A1 ) | A1 subset of some basis A ≥ Xr }. At first sight, this set Ω seems different from the set Ω defined in [20], which was defined for arbitrary finite subsets of the set of all descendants of elements in Xr . But [20, Lemma 4.5 i)] shows that since we are assuming that our Cantor algebra is valid and bounded they are in fact equal. We set χω,x := χA1 ,x , where ω = ω(A1 ). Observe that the proof of [20, Lemma 4.5 i)] also implies that ω(A1 ) = ω(C1 ), provided that A ≤ C and C1 is the subset of those elements in C coming from elements in A1 (or, in other words, C1 = C ∩ ω(A1 )). As a consequence one easily sees that for any B1 subset of a basis B with Xr ≤ B χA1 ,x = χB1 ,x ⇐⇒ ω(A1 ) = ω(B1 ) implying that χω,x is well defined. We will need a bit more of the notation from [20]. Let ω ∈ Ω and A1 ⊆ A ≥ Xr with ω = ω(A1 ). We set ( t if |A1 | ≡ t mod d with 0 < t ≤ d kωk = 0 if ω = ∅. This does not depend on A1 , see [20, Lemma 4.5 v)]. Now, let ω1 , ω2 ∈ Ω and A1 , A2 ⊆ A ≥ Xr with ωi = ω(Ai ) for i = 1, 2. Observe that the fact that our Cantor algebra is bounded means that we can always find such A1 and A2 . If A1 ∩ A2 = ∅, we write ω1 ∧ ω2 = ∅. Again, this is well defined by [20, Lemma 4.5 vi)]. Lemma 7.1. The following is a presentation of lim(Ur (Σ), L): −→ h(χω,x )ω∈Ωr∅,x∈L | R1 , R2 , R3 i where R1 = {χ−1 ω,xy χω,x χω,y | ω ∈ Ω, x, y ∈ L}, 18 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS R2 = {[χω,x , χω′ ,y ] | ω, ω ′ ∈ Ω, ω ∧ ω ′ = ∅} and −1 R3 = {χω,x χω1 ,x χω2 ,x | ω, ω1 , ω2 ∈ Ω, ω = ω1 ∪˙ ω2 }, where ω1 ∪˙ ω2 denotes the disjoint union. Moreover Vr (Σ) acts by permutations with finitely many orbits on this presentation. Proof. As observed above, any χ ∈ lim(Ur (Σ), L) is a product of elements of the form χω,x for −→ a suitable ω ∈ Ω and x ∈ L. Let F denote the free group on the set {χ eω,x | ω ∈ Ω r ∅, x ∈ L}. There is an epimorphism τ F ։ lim(Ur (Σ), L) −→ with τ (e χω,x ) = χω,x . Let G be the abstract group defined in the statement of the result for the generators χ eω,x . It is immediate to verify that the epimorphism τ defined above induces an epimorphism from G to lim(Ur (Σ), L) which we still call τ . This follows since all relations −→ inside G are easily verified to hold for the images τ (e χω,x ). Assume that we have a word w e= eωk ,xk ), for some ω1 , . . . , ωk ∈ Ω and x1 , . . . , xk ∈ L. Assume further that w(e χω1 ,x1 , . . . , χ χωk ,xk )). eωk ,xk )) = w(τ (e χω1 ,x1 ), . . . , τ (e 1 = τ (w) e = τ (w(e χω1 ,x1 , . . . , χ Let Xr ≤ A be a basis with subsets Ai ⊆ A such that ωi = Ai (L) for i = 1, . . . , k. We now refine the set {A1 , ..., Ak } to a set {A′1 , ..., A′k′ } of subsets of A such that for all i, j ≤ k ′ either A′i ∩ A′j = ∅ or A′i = A′j . By suitably applying the relations in R3 to both the original eωk ,xk ) and its image w := τ (w) e = w(χω1 ,x1 , . . . , χωk ,xk ), we may rewrite word w(e χω1 ,x1 , . . . , χ χωj′ ,yj ) and χωj′ ,yj for eωi ,xi in terms of suitable new elements τ (e each occurrence of χωi ,xi and χ ′ ′ ′ ′ ′ 1 ≤ j ≤ k , so that either ωj ∧ ωi = ∅ or ωj = ωi . Reordering them so that ω1 , . . . , ωu for 1 ≤ u ≤ k ′ are pairwise distinct and applying the relations in R2 and R1 to group together the suitable products of the yj ’s we obtain new words w e∼w e′ = χ eω1′ ,z1 . . . χ eωu′ ,zu , w ∼ w′ = χω1′ ,z1 . . . χωu′ ,zu , where the ωi′ ’s are pairwise disjoint. If w′ ∼ 1, we must have zi = 1 for any 1 ≤ i ≤ u, by applying the word w′ to an a ∈ Ai such eω,1 = 1 for any ω ∈ Ω so we also have that Ai (L) = ωi′ . From R1 it is immediate to see that χ w e∼w e′ ∼ 1 and G gives a presentation of lim(Ur (Σ), L). −→ By [20, Lemma 4.7], the group Vr (Σ) acts by permutations on Ω. Moreover, for any g ∈ Vr (Σ), if ω, ω ′ ∈ Ω are such that ω ∧ ω ′ = ∅, then gω ∧ gω ′ = ∅ and if ω = ω1 ∪ ω2 for ω1 , ω2 ∈ Ω, then gω = gω1 ∪ gω2 . Therefore Vr (Σ) acts by permutations on this presentation. To prove the last statement, it suffices to check the following: Claim 1 : The set of generators is Vr (Σ)-finite. Claim 2 : Each of the sets of relations R1 , R2 , R3 is Vr (Σ)-finite. As the group L is finite, both claims follow from slight variations of the proof of [20, Lemma 4.7]. For example, for Claim 2 for R2 , it suffices to check that whenever we have ω, ω ′ , ω b, ω b′ ∈ Ω with ω ∧ ω ′ = ∅, ω b∧ω b ′ = ∅, kωk = kb ω k and kω ′ k = kb ω ′ k, then there is some g ∈ Vr (Σ) such b that for any x ∈ L, χωb ,x = χgω,x and χωb ′ ,x = χgω′ ,x . To get a suitable g, choose bases Xr ≤ A, A b B b ′ ⊆ A, b we have ω = ω(B), ω ′ = ω(B ′ ), ω b ω b ′ ), so that for B, B ′ ⊆ A and B, b = ω(B), b ′ = ω(B ′ ′ ′ ′ b b b b b |A| = |A|, |B| = |B| and |B | = |B |. The assumptions imply that B ∩ B = ∅ = B ∩ B . So we b gB = B b and gB ′ = B b′. may choose a g ∈ Vr (Σ) with gA = A, In a completely analogous way one proves that for ω, ω1 , ω2 , ω b, ω b1 , ω b2 ∈ Ω with ω = ω1 ∪ ω2 , ω b=ω b1 ∪ ω b2 , kωk = kb ωk, kω1 k = kb ω1 k and kω2 k = kb ω2 k there is some g ∈ Vr (Σ) such that for any x ∈ L, χωb ,x = χgω,x , χωb1 ,x = χgω1 ,x and χωb2 ,x = χgω2 ,x .  PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 19 Proposition 7.2. Assume that the group Vr (Σ) is finitely presented. Let Q ≤ Vr (Σ) be a finite subgroup. Given a finite presentation of Vr (Σ), Lemma 7.1 together with Theorem A.3 yield an explicit finite presentation of CVr (Σ) (Q). Proof. By [20, Theorem 4.2], it suffices to construct an explicit finite presentation of a group of the form H = lim(Ur (Σ), L) ⋊ Vr (Σ) when L is an arbitrary finite group. Let Vr (Σ) = hZ | T i be −→ a finite presentation of Vr (Σ) and let lim(Ur (Σ), L) = hY | Ri be the presentation constructed in −→ Lemma 7.1. We need to verify the hypotheses of Theorem A.3. In Lemma 7.1 we have already checked that the group Vr (Σ) acts by permutations in this presentation and that there are only finitely many orbits under that action. We may therefore choose Y0 ⊆ Y and R0 ⊆ R finite sets of representatives of these orbits. The argument in Section A.2 thus implies that the group G has the following presentation: b0 , T, [StabV (Σ) (y), y], y ∈ Y0 i. hY0 , Z | R r We can give explicit descriptions of possible choices for the sets Y0 , R0 . Set Xr = {x1 , . . . , xr } and let ωi = ω({x1 , . . . , xi }) for i = 1, . . . , r. Then: Y0 = {χωi ,z | 1 ≤ i ≤ r, z ∈ L}. To describe R0 , we are going to split it into three pairwise disjoint subsets R0 = R01 ∪ R02 ∪ R03 , according to the three subsets of relations R1 , R2 and R3 of Lemma 7.1. The simplest one is R01 : R01 = {χ−1 ωi ,zy χωi ,z χωi ,y | 1 ≤ i ≤ r, z ∈ L}. For R02 , R03 it is more convenient to fix a basis Xr ≤ A with |A| ≥ 2r. Then we may choose R02 = {[χω,z , χω′ ,z ] | z ∈ L, ω = ω(A1 ), ω ′ = ω(A′1 ), A1 , A′1 ⊆ A, A1 ∩ A′1 = ∅}, ˙ R03 = {χ−1 ω,z χω1 ,z χω2 ,z ] | z ∈ L, ω1 = ω(A1 ), ω2 = ω(A2 ), ω = ω1 ∪ ω2 , A1 , A2 ⊆ A}. Observe that these choices of R02 and R03 yield redundant presentations. The previous presentation may not be finite because of all the relations needed to form [StabVr (Σ) (y), y] where y ∈ Y0 . Notice that g ∈ StabVr (Σ) (y) if and only if g(ω) = ω where y = χω,z for some z ∈ L. By [20, Lemma 4.7] and the assumption on Vr (Σ) we deduce that StabVr (Σ) (y) is finitely generated by some generators µ1 , . . . , µm . Consider now the following m relations, which are a subset of the stabiliser relations [StabVr (Σ) (y), y]: (7) µi χω,z µ−1 = χω,z , i i = 1, . . . , m. If g ∈ StabVr (Σ) (y), then g = w(µ1 , . . . , µm ) and the stabiliser relation gχω,z g −1 = χω,z is thus obtained by starting from relation (7) for some i and then suitably conjugating this relation to build the word w. Therefore, by Lemmas A.1 and A.2, the group H has the following finite presentation: b0 , T, [µi , y], i = 1, . . . , m, y ∈ Y0 i, hY0 , Z | R where the elements µ1 , . . . , µm are expressed as words in the generators Z.  Appendix A. The Burnside procedure We shall now give an outline of the Burnside procedure used in the proof of Proposition 7.2. As mentioned in the Introduction, we do not claim any originality for this. For example, this procedure has been used, without proof, in [15]. We are not aware of any place where a proof is presented. Hence we include it here for completeness. 20 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS The goal is to find a small finite presentation of a group, in the cases where the following procedure can be applied. The idea is to look for a possibly infinite, but well behaved, presentation of a group G and a group Q such that the action of Q on the generators and relators of G cuts them down to a very small number. At a later stage, the group Q will be assumed to be a subgroup of G and its action will return a new smaller presentation. A.1. Preliminary lemmas. The beginning of this procedure is general and we only require each of the groups G and Q to have a presentation, without any assumption on them. Let G = hY | Ri and Q = hZ | T i be groups. Let Q act on Y by permutations. Notice that R ≤ F (Y ), the free group generated by Y , and observe that Q also acts on F (Y ). We assume that Q(R) = R. Let Y0 be a set of representatives for the Q-orbits in Y and R0 be a set of representatives for the Q-orbits in R. We observe that R0 ≤ h t(a0 ) | a0 ∈ Y0 , t ∈ Q i that is, we may express the elements of R0 as products of the results of Q acting on elements of Y0 . In the special case that Q is a subgroup of G, we will be able to express elements in R0 as products of conjugates of elements in Y0 by elements in Q. Hence each element of R0 , seen as an element in G, can be written in more than one way and we fix an expression of the type b0 ⊂ hta0 t−1 | a0 ∈ Y0 , t ∈ Qi to be t1 (a1 ) . . . tk (ak ) for such element. We then define the set R the set of fixed expressions for the elements of R0 , where we have replaced the action of Q on Y0 by the conjugation of elements. That is, if t1 (a1 ) . . . tk (ak ) is a fixed expression in R0 , the b0 is t1 a1 t−1 . . . tk ak t−1 . The set R b0 is thus a set of formal expressions corresponding element in R 1 k which will be used later to express relations in the groups. Lemma A.1. Following the notation previously defined, we have b0 , T, [StabQ (y), y], y ∈ Y0 i, G⋊Q∼ = hY0 , Z | R where the semi-direct product is given by the action of Q on G as follows: for all g1 , g2 ∈ G and t1 , t2 ∈ Q, multiplication is given by (g1 , t1 )(g2 , t2 ) = (g1 · t1 (g2 ), t1 t2 ). b0 , T, [StabQ (y), y], y ∈ Y0 i. Define the group Proof. Let H be the group presented by hY0 , Z | R homomorphism ϕ : F (Y0 ∪ Z) → G ⋊ Q by sending a0 ∈ Y0 to (a0 , 1) ∈ G ⋊ Q and c ∈ Z to (1, c) ∈ G ⋊ Q. By construction we see that ϕ(t)ϕ(a0 )ϕ(t)−1 = (t(a0 ), 1) (∗) for any word t ∈ Q. Claim 1. The map ϕ induces a homomorphism H → G ⋊ Q, which we still call ϕ. Proof of Claim 1. If d ∈ T is a relation in H, then d = c1 . . . ck , for some ci ∈ Z, and b0 be a relation in H, then bb0 = t1 a1 t−1 . . . tk ak t−1 ϕ(c1 ) . . . ϕ(ck ) = (1, 1). Let now bb0 ∈ R 1 k for some ai ∈ Y0 and ti ∈ Q. Moreover, by applying (∗) above, we get k Y ϕ(ti )ϕ(ai )ϕ(ti )−1 = ( i=1 k Y ti (ai ), 1) = (1, 1). i=1 Finally let a0 ∈ Y0 , t ∈ StabQ (a0 ). Thus we have, using (∗) again: ϕ(t)ϕ(a0 )ϕ(t)−1 ϕ(a0 )−1 Now we just apply Von Dyck’s theorem. Claim 2. The map ϕ is surjective. = (t(a0 ), 1)(a−1 0 , 1) = (1, 1).  PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 21 Proof of Claim 2. Any element (1, t) ∈ {1} × Q := {(1, s) | s ∈ Q} can be written as (1, c1 . . . ck ) for suitable ci ∈ Z and so ϕ(H) contains {1} × Q. We observe that any element of G × {1} := {(h, 1) | h ∈ G} can be written as (t1 (a1 ) . . . tk (ak ), 1) for suitable ai ∈ Y0 and ti ∈ Q. By arguing Q as in Claim 1 we have (g, 1) = ϕ( ki=1 ti ai t−1 i ). Thus, ϕ(H) ≥ hG × {1}, {1} × Qi = G ⋊ Q.  Claim 3. The map ϕ is injective. Proof of Claim 3. Any element of Y can be written as t(a0 ), for some a0 ∈ Y0 and t ∈ Q. Define ∗ Y = {ta0 t−1 | a0 ∈ Y0 , t ∈ Q} to be the set of symbols of Y where we have replaced the action of Q with the conjugation of elements. We notice that, if t(a0 ) = s(a0 ), then t−1 s ∈ StabQ (a0 ) ∗ and we thus define an equivalence relation on Y by writing ta0 t−1 ∼ sa0 s−1 if and only if ∗ −1 t s ∈ StabQ (a0 ). We define Y := Y / ∼ the collection of equivalence classes. If a ∈ Y and a = t(a0 ), for some a0 ∈ Y0 and t ∈ Q, we define an element a of Y by setting a = {sa0 s−1 | t−1 s ∈ StabQ (a0 )}. With this notation, we observe that Q acts on Y through (s, a) → s · a := sta0 t−1 s−1 , for some a0 ∈ Y0 , t ∈ Q such that a = ta0 t−1 . Also, notice that the map ψ : Y → Y sending a 7→ a is a Q-equivariant bijection, that is ψ(sa) = sψ(a) = s · a for all s ∈ Q. Hence the action of Q on Y is equivalent to the action of Q on Y . For each element a ∈ Y we can fix a representative ta0 t−1 ∈ F (Y0 ∪Z) and we call the set of representatives Yb . By construction, every b0 can be uniquely written as bb0 = t1 a1 t−1 . . . tk ak t−1 , so we define R0 ⊆ F (Y ) element bb0 ∈ R 1 k −1 t a t . We then let R ⊆ F (Y ) to be the set of all elements . . . be the set of elements t1 a1 t−1 k k 1 k −1 −1 −1 −1 tt1 a1 t1 t . . . ttk ak tk t , for any t ∈ Q. With these definitions, it makes sense to say that the normal closure F (R)F (Y ) inside F (Y ) ∗ ∗ is isomorphic to F (R)F (Y ) inside F (Y ). Also notice that F (Y ) ∼ = F (Y / ∼) = hY | R∼ i, where −1 −1 −1 R∼ is the set of all relations of the type ta0 t ∼ sa0 s if and only if t s ∈ StabQ (a0 ). Let w ∈ H, such that ϕ(w) = (1, 1). Let w = c1 a1 c2 a2 . . . ak ck+1 for ai ∈ Y0 and ci ∈ hZi and we rewrite w as −1 −1 w = (c1 a1 c1−1 )(c1 c2 a2 c2−1 c−1 1 ) . . . (c1 c2 . . . ck ak ck . . . c1 )c1 c2 . . . ck ck+1 Define ti = c1 . . . ci . Then, up to replacing ti with another suitable t′i ∈ Q, we can assume that  −1 tk+1 and, applying ϕ to the rewriting ti ai t−1 ∈ Yb . Hence we can write w = t1 a1 t−1 1 . . . t k a k tk i of w we get (1, 1) = (t1 (a1 ) . . . tk (ak ), tk+1 ). Since tk+1 = 1 inside Q, we can use the relations of Q to rewrite tk+1 = 1 inside H. Similarly, since t1 (a1 ) . . . tk (ak ) = 1 inside G and since the normal closure F (R)F (Y ) inside F (Y ) is isomor−1 phic to F (R)F (Y ) inside F (Y ), we can use the relations of G to rewrite t1 a1 t−1 1 . . . t k a k tk = 1 inside H. Therefore w = 1 in H and so ϕ is injective.  The map ϕ is thus a group isomorphism and we are done.  The following result does not depend on the presentations of the relevant groups and relies only on the definition of semidirect product. Lemma A.2. Let G be a group and Q ≤ G. Let G ⋊ Q be the semidirect product constructed using the action of Q on G by conjugation inside G. Then G⋊Q∼ = G × Q. 22 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS Proof. Let H := G ⋊ Q with product given by (a, x)(b, y) = (axbx−1 , xy). It is clear that e = {(t−1 , t) | t ∈ Q} is a subgroup of H and Q e∼ Q = Q. Since (a, x) = (ax, 1)(x−1 , x), then H e is generated by G × {1} and Q. It is straightforward to verify that Q is normal and so, since e∼ G × {1} too, we get G ⋊ Q ∼  = (G × {1}) × Q = G × Q. A.2. The Burnside procedure. We are now ready to explain the Burnside procedure. We make two additional assumptions with respect to those in Subsection A.1. We assume that: (i) (ii) (iii) (iv) the presentation Q = hZ | T i is finite, the number of Q-orbits in Y is finite (and possibly very small, in practical applications), the number of Q-orbits in R is finite (and also possibly very small), the stabilisers StabQ (y) are finitely generated, for y ∈ Y0 . Let G and Q be as defined in Lemma A.1, Q ≤ G and let Q act by conjugation on G, then Lemmas A.1 and A.2 imply that D E b0 , T, [StabQ (y), y] for y ∈ Y0 . G×Q∼ = Y0 , Z | R We rewrite Z in terms of Y0 and then mod out Q. We also use the finite generation of StabQ (y) to rewrite the stabiliser relations as conjugations. Therefore we obtain: Theorem A.3 (Burnside procedure). Let G, Q be the groups defined in Lemma A.1. Assume that (i) (ii) (iii) (iv) (v) Q ≤ G and Q acts by conjugation on G, Q = hZ | T i is finitely presented, the number of Q-orbits in Y is finite, the number of Q-orbits in R is finite, the stabilisers StabQ (y) are finitely generated, for y ∈ Y0 . Then there exists a finite presentation of G of the type: G= * R0 , T, Y0 , Z cyc−1 = y, for y ∈ Y0 , c generator of StabQ (y), finitely many extra relations + , where the extra relations are obtained in the following way: there is a relation for every element c ∈ Z and it has the form c = word in conjugates of elements of Y0 by elements of Z. A.3. An application. The following example is taken from [15]. Recall the following presentation for the alternating group Alt(n + 2) = x1 , . . . , xp | (xi )3 , (xi xj )2 , i 6= j where xi can be realised as the 3-cycle (i n+1 n + 2). Hence Alt(7) = x1 , x2 , x3 , x4 , x5 | (xi )3 , (xi xj )2 , i 6= j := G. On the other hand, it can be shown that Alt(5) = a, b | a5 , b2 , (ab)3 := Q, PRESENTATIONS OF GENERALISATIONS OF THOMPSON’S GROUP V 23 where a can be realised as (1 2 3 4 5) and b = (2 3)(4 5). Let z := x1 = (1 6 7) and observe that i−1 xi = z a , for i = 1, . . . , 5. Now we check that Y = {x1 , . . . , x5 }, Y0 = {z}, R = {(xi )3 , (xi xj )2 , i 6= j}, 2 R0 = {z 3 , (zz a ) }, Z = {a, b}, T = {a5 , b2 , (ab)3 }, satisfies the conditions of Corollary A.3. Noting that {[StabQ (y), y] for y ∈ Y0 } = {[z, b] , [z, (ba)a ]}, we have that D E 2 G × Q = a, b, z | a5 , b2 , (ab)3 , z 3 , (zz a) , [z, b] , [z, (ba)a ] We can write a = w1 (x1 , . . . , x5 ) and b = w2 (x1 , . . . , x5 ), for suitable words w1 , w2 ∈ F (x1 , . . . , x5 ) and then Corollary A.3 yields the following finite presentation for Alt(7): D E 4 4 Alt(7) = a, b, z | R0 , T, [z, b] , [z, (ba)a ] , a−1 w1 (z, z a, . . . , z a ), b−1 w2 (z, z a , . . . , z a ) . References [1] D. J. Benson. Representations and cohomology. II, volume 31 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, second edition, 1998. Cohomology of groups and modules. [2] M. Bestvina and N. Brady. Morse theory and finiteness properties of groups. Invent. Math. 129(3):445–470, 1997. [3] C. Bleak, H. Bowman, A. Gordon, G. Graham, J. Hughes, F. Matucci, and E. Sapir. Centralizers in R. Thompson’s group Vn . Groups Geom. Dyn. 7, 721–865, 2013. [4] C. Bleak, M. Quick, The infinite simple group V of Richard J. Thompson: presentations by permutations, preprint, http://arxiv.org/abs/1511.02123. [5] M. G. Brin, C. C. Squier. Presentations, conjugacy, roots, and centralizers in groups of piecewise linear homeomorphisms of the real line. Comm. Algebra 29 (2001), no. 10, 4557–4596. [6] M. G. Brin. Higher dimensional Thompson groups. Geom. Dedicata, 108, 163–192, 2004. [7] K. S. Brown. Cohomology of Groups Springer-Verlag, New York, 1982. [8] K. S. Brown. Finiteness properties of groups. Journal of Pure and Applied Algebra, 44, 45–75, 1987. [9] J. Burillo and S. Cleary. Metric properties of higher-dimensional Thompson’s groups. Pacific J. Math., 248(1):49–62, 2010. [10] J. W. Cannon, W. J. Floyd, and W. R. Parry. Introductory notes on Richard Thompson’s groups. Enseign. Math. (2), 42(3-4):215–256, 1996. [11] P. M. Cohn. Universal algebra, volume 6 of Mathematics and its Applications. D. Reidel Publishing Co., Dordrecht, second edition, 1981. [12] W. Dicks and C. Martı́nez-Pérez. Isomorphisms of Brin-Higman-Thompson groups. Israel J. of Math. 199 (2014) 189–218. [13] M. Fluch, M. Schwandt, S. Witzel, and M. C. B. Zaremsky. The Brin-Thompson groups sV are of type F∞ . Pacific J. Math. 266 (2013), no. 2, 283–295. [14] R. Geoghegan. Topological methods in group theory. Springer 2008. J. Eur. Math. Soc. (JEMS), 13(2), 391–458, 2011. [15] R. M. Guralnick, W. M. Kantor, M. Kassabov, and A. Lubotzky. Presentations of finite simple groups: a computational approach. J. Eur. Math. Soc. (JEMS), 13(2), 391–458, 2011. [16] A. Hatcher Algebraic Topology. Cambridge University Press, 2002. [17] J. Hennig and F. Matucci. Presentations for the higher-dimensional Thompson groups nV . Pacific J. Math., 257(1), 53–74, 2012. [18] G. Higman. Finitely presented infinite simple groups. Department of Pure Mathematics, Department of Mathematics, I.A.S. Australian National University, Canberra, 1974. Notes on Pure Mathematics, No. 8 (1974). [19] D. Kochloukova, C. Martı́nez-Pérez and B. E. A. Nucinkis. Cohomological finiteness properties of the BrinThompson-Higman groups 2V and 3V, Proceedings of the Edinburgh Mathematical Society (2) 56 no. 3, 777-804 (2013). 24 C. MARTÍNEZ-PÉREZ, F. MATUCCI, AND B. NUCINKIS [20] C. Martı́nez-Pérez, F. Matucci and B. E. A. Nucinkis. Cohomological finiteness conditions and centralisers in generalisations of Thompson’s group V , to appear in Forum Mathematicum, http://arxiv.org/abs/1309.7858 [21] C. Martı́nez-Pérez, and B. E. A. Nucinkis. Bredon cohomological finiteness conditions for generalisations of Thompson’s groups, Groups Geom. Dyn. 7 (2013), 931–959, [22] D. Quillen. Higher algebraic K-theory, I: Higher K-theories. Lecture Notes in Math. 341 (1973), 85–147. [23] M. Stein. Groups of piecewise linear homeomorphisms. Trans. Amer. Math. Soc., 332(2):477–514, 1992. [24] H. J. Zassenhaus. The theory of groups. Dover Publications Inc., Mineola, NY, 1999. Reprint of the second (1958) edition. Conchita Martı́nez-Pérez, Departamento de Matemáticas, Universidad de Zaragoza, 50009 Zaragoza, Spain E-mail address: [email protected] Francesco Matucci, Instituto de Matemática, Estatı́stica e Computação Cientı́fica, Universidade Estadual de Campinas, 13083-859, Campinas, Brazil E-mail address: [email protected] Brita Nucinkis, Department of Mathematics, Royal Holloway, University of London, Egham, TW20 0EX, UK. E-mail address: [email protected]
4math.GR
APPLE Picker: Automatic Particle Picking, a Low-Effort Cryo-EM Framework Ayelet Heimowitza , Joakim Andénb , Amit Singera,c a The Program in Applied and Computational Mathematics, Princeton University, Princeton, NJ b Center for Computational Biology, Flatiron Institute, New York, NY c Department of Mathematics, Princeton University, Princeton, NJ arXiv:1802.00469v1 [cs.CV] 1 Feb 2018 Abstract Particle picking is a crucial first step in the computational pipeline of single-particle cryo-electron microscopy (cryo-EM). Selecting particles from the micrographs is difficult especially for small particles with low contrast. As high-resolution reconstruction typically requires hundreds of thousands of particles, manually picking that many particles is often too time-consuming. While semi-automated particle picking is currently a popular approach, it may suffer from introducing manual bias into the selection process. In addition, semi-automated particle picking is still somewhat time-consuming. This paper presents the APPLE (Automatic Particle Picking with Low user Effort) picker, a simple and novel approach for fast, accurate, and fully automatic particle picking. While our approach was inspired by template matching, it is completely template-free. This approach is evaluated on publicly available datasets containing micrographs of β-galactosidase and keyhole limpet hemocyanin projections. Keywords: cryo-electron microscopy, single-particle reconstruction, particle picking, template-free, cross-correlation, micrographs, support vector machines. 1. Introduction Single-particle cryo-electron microscopy (cryo-EM) aims to determine the structure of 3D specimens (macromolecules) from multiple 2D projections. In order to acquire these 2D projections, a solution containing the macromolecules is frozen in vitreous ice on carbon film, thus creating a sample grid. An electron beam then passes through the ice and the macromolecules frozen within, creating 2D projections. Unfortunately, due to radiation damage only a small number of imaging electrons can be used in the creation of the micrograph. As a result, micrographs have a low signal-tonoise ratio (SNR). An elaboration on the noise model can be found in (Sigworth, 2004). Since micrographs typically have low SNR, each micrograph consists of regions of noise and regions of noisy 2D projections of the macromolecule. In addition to these, micrographs also contain regions of non-significant information stemming from contaminants such as carbon film. Different types of regions have different typical intensity values. The intensity values of the micrograph are determined by the number of electrons that have passed through the sam- ple grid unscattered. Electrons pass through ice more easily than through macromolecules or contaminants. Thus, the regions of the micrograph that contain only noise will typically have higher intensity values than other regions. In addition, regions containing a particle typically have higher variance than regions containing noise alone (Nicholson & Glaeser, 2001; van Heel, 1982). Due to this, two cues that can be used for projection image identification are the mean and variance of the image. In order to determine the 3D structure at high resolution, many projection images are needed, often in the hundreds of thousands. Thus, the first step towards 3D reconstruction of macromolecules consists of determining regions of the micrograph that contain a particle as opposed to regions that contain noise or contaminants. This is the particle picking step. A fully manual selection of hundreds of thousands of 2D projections is tedious and time-consuming. For this reason, semi-automatic and automatic particle picking is a much researched problem for which numerous frameworks have been suggested. Solutions to the particle picking problem include edge detection (Harauz & Fong-Lochovsky, 1989), deep learning (Ogura & Sato, 2004; Wang et al., 2016; Zhu et al., Email addresses: [email protected] (Ayelet Heimowitz), [email protected] (Joakim Andén), [email protected] (Amit Singer) Preprint submitted to Journal of Structural Biology February 5, 2018 Figure 1: Result of our suggested framework. The left column contains micrographs. The middle column contains the output of the classifier. The right column contains the picked particles. Top row contains a β-Galactosidase micrograph. Bottom row contains a KLH micrograph. 2016), support vector machine classifiers (Aebeláez et al., 2011), and template matching (Frank & Wagenknecht, 1983). One example of a template-based framework is provided in RELION (Scheres, 2015). In this framework, the user manually selects approximately one thousand particles from a small number of micrographs. These particle images are then 2D classified to generate a smaller number of template images that are used to automatically select particles from all micrographs. These particle images are then classified in order to identify non-particles. Additional examples of template-based frameworks include SIGNATURE (Chen & Grigorieff, 2007) which employs a post-processing step that ensures the locations of any two picked particles cannot overlap, and gEMpicker (Hoang et al., 2013) which employs several strategies to speed up template matching. Template matching is a popular approach to particle picking. The input to template matching schemes consists of a micrograph and images containing 2D templates to match. These templates can be, for example, manually selected particle projections. The aim is to output the regions in the micrograph that contain the sought-after templates. The basic idea behind this approach (Chen & Grigorieff, 2007; Frank & Wagenknecht, 1983; Langlois et al., 2014; Ludtke et al., 1999; Scheres, 2015) is that the crosscorrelation1 between a template image and a micrograph is larger in the presence of the template. An issue with this method is the high rate of false detection. This issue stems from the fact that given enough random data, meaningless noise can be perceived as a pattern. This problem was exemplified in (Henderson, 2013; Shatsky et al., 2009) , where an image of Einstein was used as the template and matched to random noise. Even though the image was not present in the noise images, a reconstruction from the best-matched images yielded the original Einstein image. Template matching can also be performed without the input of template images. For example, see (Langlois et al., 2014) where a disk of appropriate size (with regard to the particle size) is used as template. As the template does not necessarily bear a similarity to the actual particle, this procedure may increase the rate of false positives (Glaeser, 2004). Another example of this school of thought is the DoG Picker (Voss et al., 2009) which is based on difference of Gaussians and is 1 Cross-correlation is not the only possible function to use for template matching methods. 2 For a review of other possibilities see (Nicholson & Glaeser, 2001). particle size (which we assume is known).3 This method necessitates the use of a reference set {fm ∈ Rn×n }B m=1 selected from the micrograph in the automatic manner detailed in Section 2.2. We generalize our method to particle picking from the full micrograph in Section 2.3. Section 2.4 improves localization through the use of a fast classification step. The complete method, known as the APPLE picker, is described in Section 2.5. suitable for identifying blobs of a certain size in the micrograph. Another template-free particle picking framework is gautomatch (Zhang, 2017). In this paper we propose a particle picking framework that is fully automatic and data-adaptive in the sense that no manual selection is used and no templates are involved. Instead of templates we use a set of automatically selected reference windows. This set includes both particle and noise windows. We show that it is possible to determine the presence of a particle in any query image (i.e., region of the micrograph) through cross-correlation with each window of the reference set. Specifically, in the case where the query image contains noise alone, since there is no template to match, the crosscorrelation coefficients should not indicate the presence of a template regardless of the actual content of each reference window. On the other hand, in the case where the query image contains a particle, the coefficients will depend on the content of each reference window. Once their content is determined, the query images most likely to contain a particle and those most likely to contain noise can be used to train a classifier. The output of this classifier is used for particle picking. We test our framework on a publicly available βgalactosidase dataset (Chen et al., 2013; Scheres, 2015; Scheres & Chen, 2012) and a keyhole limpet hemocyanin dataset (Zhu et al., 2003, 2004). An example of our results is supplied in Fig 1. Code for our framework is publicly available.2 We note that our formulation ignores the contrast transfer function (CTF), because our particle selection procedure performs on the individual micrograph level by comparing windows taken from the same micrograph. Windows from different micrographs are not compared. Since the CTF is roughly the same throughout the micrograph, its effect can be ignored at this level. Of course, the CTF should not be ignored at later stages of the reconstruction pipeline. This paper is organized as follows. In Section 2 we introduce our APPLE picker. We present experimental results for the APPLE picker in Section 3. 2.1. Determining the Content of a Query Image The idea behind traditional template matching methods is that the cross-correlation score of two similar images is high. Specifically, a template image known to contain a particle can be used in order to identify similar patterns in the micrograph using cross-correlation. In this section we show that the same idea can be used to determine the content of regions of the micrograph even when no templates are available. To this end we use the cross-correlation between a query image g and a set of reference images {fm }B m=1 . The cross-correlation function is (Nicholson & Glaeser, 2001) XX fm (x0 , y 0 ) g (x + x0 , y + y 0 ) . (1) cfm ,g (x, y) = x0 y0 This function can be thought of as a score associated with fm , g and an offset (x, y). The cross-correlation score at a certain offset does not in itself have much meaning without the context of the score in nearby offsets. For this reason we define the following normalization on the cross-correlation function 1 XX cfm ,g (x0 , y 0 ) . (2) ĉfm ,g (x, y) = cfm ,g (x, y) − 2 n 0 0 x We call this a normalization since it shifts all crosscorrelations to a common baseline. Consider the case where query image g contains a particle. The score cfm ,g (x, y) is expected to be maximized when fm contains a particle with a similar view. In this case there will be some offset (x, y) such that the images fm and g match best, and cfm ,g (x, y) > cfm ,g (x0 , y 0 ) for all other offsets (x0 , y 0 ). Thus, 2. Material and Methods cfm ,g (x, y) > In Section 2.1 we detail our method for determining the content of a single query image g ∈ Rn×n , where the query image is a window extracted from the micrograph and n is chosen such that the window size is slightly smaller than the 1 XX cf ,g (x0 , y 0 ) . n2 0 0 m x (3) y In other words, ĉfm ,g (x, y) is expected to be large and positive. In this case, we say g has a strong response to fm . 2 https://www.github.com/PrincetonUniversity/APPLEpicker 3 The y notation g ∈ Rn×n simply means that the size of a query image is n × n and its content is real-valued. 3 Next, consider the case where query image g contains no particle. In this case there should not exist any offset (x, y) that greatly increases the match for any fm . Thus typically ĉfm ,g (x, y) is comparatively small in magnitude. In other words, g has a weak response to fm . We define a response signal sg such that sg (m) = max ĉfm ,g (x, y) , x,y m = 1, . . . , B. that contains no particle may have a strong response to some reference image. However, there will not be many such reference images. As a result of this, the response signal will still be relatively uniform, as expected. 2.2. Reference Set Selection The set of reference images {fm }B m=1 could contain all possible windows in the micrograph. However, this would lead to unnecessarily long runtimes. Thus, we suggest to choose a subset of B windows from the micrograph, where each of these windows is either likely to contain a particle or likely to contain noise alone. In order to automatically select this subset, we first divide the micrograph into B/4 non-overlapping containers. A container is some rectangular portion of the micrograph. Each container holds many n × n windows. Figure 3(a) is an example of the division of a micrograph into containers. As mentioned in Section 1, regions containing noisy projections of particles typically have lower intensity values and higher variance than regions containing noise alone. Thus we find that the window with the lowest mean intensity in each container likely contains a particle and the window with the highest mean intensity likely does not. We extract these windows from each container and include them in the reference set. We do this also for the windows that have the highest and lowest variance in each container. This procedure provides a set of B reference windows. Figure 3(b) presents the reference windows extracted from a single container. We suggest setting B to approximately 300. (4) This signal is associated with a single query image g. Each entry sg (m) contains the maximal normalized cross-correlation with a single reference image fm . Thus, the response signal captures the strength of the response of the query image to each of the reference images. We suggest that sg can be used to determine the content of g. If the query image contains a particle, sg will show a high response to reference images containing a particle with similar view and a comparatively low response to other images. As a consequence, sg will have several high peaks. On the other hand, if the query image contains noise alone, sg will have relatively uniform content. This idea is shown in Figure 2. ×10 8 50 40 15 sg 30 10 20 5 10 0 0 0 100 0 200 5 10 15 ×10 8 m ×10 8 50 40 15 sg 30 10 20 5 10 0 0 0 100 200 m 0 5 10 15 ×10 8 Figure 2: Response signal of a particle image (top) and a noise image (bottom). The left column contains the response signals. The right column contains histograms of the response signals. (a) (b) Figure 3: (a) Containers of a micrograph of the β-galactosidase dataset. (b) Single container with four windows of interest. The above is true despite the high rate of false positives in cross-correlation-based methods. Indeed, it is possible that query image g1 containing a particle will have a strong response to a reference window that does not contain a particle with similar view. However, for the majority of reference windows this will not be the case, and thus sg will remain nonuniform. Furthermore, it is possible that some query image g2 The set of reference windows must contain both windows with noise and windows with particles. It may seem counterintuitive to include noise windows in a reference set. However, for roughly symmetric particles (i.e., particles with similar projections from each angle), any query image will have 4 (a) (b) (c) Figure 4: Result of our cross-correlation scheme. (a) Micrograph of β-galactosidase. (b) The 1000 regions contained in boxes have high k (sg ) and thus should contain a particle. (c) There are 9000 regions contained in boxes. These regions have high or intermediate k (sg ) and thus may contain a particle. Consequently, the regions not contained in boxes have low k (sg ) and thus are likely to be pure noise. as was done in Section 2.1, we use the response signals of the entire set to determine a threshold above which we consider a response to be strong. For visualization of our suggested framework, we turn to a micrograph of β-galactosidase (Scheres, 2015; Chen et al., 2013; Scheres & Chen, 2012). We select B = 324 reference images in the manner detailed in Section 2.2, and aim to classify 21904 query images. The query images are selected from locations throughout the micrograph in a way that ensures some overlap between images. We present in Figure 4 query windows that are believed to contain particles (associated with high-valued k (sg )) and regions that are believed to contain noise (associated with low-valued k (sg )). We note that for the sake of reducing the computational complexity of our suggested framework, we do not compute the cross-correlation score in space but instead compute it in frequency using fast Fourier transforms. This is a wellestablished method of reducing complexity. See (Nicholson & Glaeser, 2001). a similar response to every reference image which contains a particle. Thus, if noise images were not included in the reference set, the response signal sg would be uniform regardless of the content of g. 2.3. Generalization to Micrographs We extract a set of M query images from the micrograph. These images should have some overlap. In addition, their union should cover the entire micrograph. An example of this set is windows on a grid with step size n/2. In order to determine the content of each query image g, we examine the number of entries that are over a certain threshold, i.e., k (sg ) = |{i such that sg (i) > t}|, (5) where the threshold t is determined according to the set of response signals and is experimentally set to max t= g,i sg (i) − min sg (j) g,j 20 + min g,j sg (j) . (6) 2.4. APPLE Classification A particle picking framework should produce a single window containing each picked particle. It is possible to use the output of the cross-correlation scheme introduced in Sections 2.1–2.3 as the basis of a particle picker. This is done by defining the query set to be the set of all possible n × n windows contained in the micrograph. The content of each query window is determined according to its score. Specifically, if the score is above a threshold we determine that it contains a particle. This determination can be applied to the location of the central pixel in that window to provide a classification of each Any query image g that possesses high k (sg ) is known to have had a relatively strong response to a large amount of reference windows and is thus expected to contain a particle. On the other hand, a query image g that possesses low k (sg ) is expected to contain noise. In this manner we may consider k (sg ) as a score for g. The higher this score, the more confident we can be that g contains a particle. The strength of the response, and thus the score of a query image, is determined by the threshold t. Instead of checking the uniformity of the response signal for a single query image 5 pixel in the micrograph (except for boundary pixels that are not in the center of any possible n × n window). Unfortunately, the cost of such an endeavor, both in runtime and in memory consumption, is prohibitive. In order to improve performance, the APPLE picker does not define the set of query images as all possible n × n windows in the micrograph. Instead, the set of query images {hm }C m=1 is defined as the set of all n × n windows extracted from the micrograph at n/2 intervals. However, applying a determination to the center pixel of each query window will no longer allow for successful particle picking. Indeed, where two overlapping query windows are determined to contain a particle, it is unknown whether they both contain the same particle or whether each contains a distinct particle. It is possible that the interval of n/2 between the query windows caused us to skip over windows that would have been classified as noise. In other words, in order to get a good localization of the particle, the content of each possible window of the micrograph should be determined. To achieve this, the APPLE picker determines the content of all possible windows in the micrograph via a support vector machine (SVM) classifier. This classifier is based on a few simple and easily calculated features that are known to differ between particle regions and noise regions. In this manner we achieve fast and localized particle picking. The classifier is trained on the images whose classification (as particle or as noise) is given with high confidence by our cross-correlation scheme. To train the classifier, we need a training set. This is composed of a set of examples for the particle images, S1 , and a set of examples for the noise images, S2 . The complete training set is S1 ∪S2 . The choice of S1 and S2 depends on two parameters, τ1 and τ2 . These parameters contain the percentage of training images that we believe do contain a particle (τ1 ) and the percentage of training images that we believe may contain a particle (τ2 ). The selection of τ1 and τ2 is made according to the concentration of the macromolecule in the solution. When the concentration is low, there are less particle projections in the micrograph. As a result, there are less query images we can be reasonably certain contain a particle. On the other hand, if the concentration is high, there will be more particle projections in the micrograph. As a result, there will be more query images we can be reasonably certain contain a particle. To demonstrate the selection of τ1 and τ2 , we consider a micrograph with M = 20000 query images. If it is known that there are many projected particles, we can safely assume that, e.g., 1000 images with highest k (shm ) contain a particle. Thus we set τ1 = 5%. In addition, when the micrograph is known to contain many projected particles, it is possible that out of 20000 query images 15000 may contain some portion of a particle. We can safely assume that the regions of the micrograph that are not contained in any of the τ2 = 75% images with highest k (shm ) will be regions of noise. We note that when the concentration of macromolecules is not high, the value of τ2 is less important than that of τ1 . Once τ1 is selected, the set S1 is determined. Due to the overlapping nature of query images, there is no need to use all τ1 percent of images with highest k (shm ) for training. Instead, we note that these images form several connected regions in the micrograph (see Figure 4). The set S1 is made of all non-overlapping windows extracted from these regions. The τ2 percent of query images with highest k (shm ) form the regions in the micrograph that may contain particles. An example of these regions can be seen in Figure 4(c). The set S2 is made of non-overlapping windows extracted from the complement of these regions. The reason for the difference between the determination of S1 and S2 is that the query images overlap, and we do not want to train the noise model from any section of the τ2 percent of query images with moderate to high k (sg ). The training set for the classifier will consist of vectors x1 , . . . , x|S1 ∪S2 | ∈ R2+ and labels y1 , . . . , y|S1 ∪S2 | ∈ {0, 1}. Each vector xi in the training set consists of the mean and standard deviation of a window hi ∈ S1 ∪ S2 , and is associated with a label yi , where ( 1, if hi ∈ S1 . yi = 0, if hi ∈ S2 . We note that while training the classifier on mean and variance works sufficiently well, they are not necessarily optimal and other features can be added. This is the subject of future work. The training set is used in order to train a support vector machine classifier (Schölkopf & Smola, 2001; Cortes & Vapnik, 1995). We propose using a Gaussian radial basis function SVM. Once the classifier is trained, a prediction can be obtained for each query window. This classification is attributed to the central pixel of the window, and provides us with a segmentation of the micrograph to particle and noise pixels. Figure 5(b) presents such a segmentation for the micrograph depicted in 5(a). For convenience, we summarize our framework in Figure 6. 2.5. APPLE Picking The output of the classifier is a binary image where each pixel is labeled as either particle or as noise. Each connected region (cluster) of particle pixels may contain a particle. On 6 (a) (b) (c) Figure 5: (a) Micrograph of β-galactosidase (b) Pixel content identified by the classifier as particle. (c) Picked particles. This image contains windows chosen to demarcate the segmentation results. Windows that contained more than a single segmented particle were disregarded. Figure 6: Overview of APPLE picker. 7 The experiments are run on a 2.6 GHz Intel Core i7 CPU with quad core and 16 GB of memory. Our method has also been implemented on a GPU. It is evaluated using an Nvidia Tesla P100 GPU. the other hand it may contain some artifact. Thus, we disregard clusters that are too small or too big. This is done through examining the total number of pixels in each cluster, and discarding any that are above or below a reasonable number of pixels. This number is selected based on the true particle size. Alternatively, this can be done through use of morphological operations. An erosion (Efford, 2000) is a morphological operation preformed on a binary image wherein pixels from each cluster are removed. The pixels to be removed are determined by proximity to the cluster boundary. In this way, the erosion operation shrinks the clusters of a binary image. This shrinkage can be used to determine the clusters that contain artifacts. Large artifacts will remain when shrinking by a factor larger than the particle size. Small artifacts will disappear when shrinking by a factor smaller than the particle size. We use this method of artifact removal in Section 3.2. Beyond these artifacts, it is possible that two particles are frozen very close together. This will distort the true particle projection and should be disregarded. For this reason it is good practice to disregard pairs of clusters of pixels that were classified as particle if they are too close. We do this by disregarding clusters whose centers are closer than some distance, for example the particle diameter. We then output a box around the center of each remaining cluster of pixels that were classified as particle. The size of the box is determined according to the known particle size. The pixel content of each box is a particle picked by our framework. See Figure 5(c). After all particles are picked, it is possible to create templates out of them and use a template matching scheme to pick additional particles. 3.1. β-Galactosidase We run the suggested framework on a β-Galactosidase dataset (Scheres, 2015). Each picked particle is represented by the coordinate of a single pixel within the particle. For the purpose of evaluating our framework, we create a ground truth for every possible window of size n × n in the micrographs. Windows are classified as containing a particle in the ground truth if their center is within a radius of 21 pixels from any of the manually provided locations. Otherwise, they are classified as not containing a particle in the ground truth. Figure 7(a) depicts an example of the resulting ground truth. Any window whose center pixel resides in the colored regions is a particle window in our ground truth. Each micrograph of the β-Galactosidase dataset contains 4096 × 4096 pixels. The outermost pixels in each micrograph do not contain important information. Thus, when running the APPLE picker on these micrographs, we discard the 100 outermost pixels. In addition, for runtime reduction, each dimension of the micrograph is reduced to half its original size, bringing the micrograph in total to a quarter of its original size. This is done by averaging adjacent pixels, also known as binning. Each query and reference image extracted from the reduced micrograph is of size 26 × 26 and each container is of size 225 × 225. For classifier training we suggest to use τ1 = 3% and τ2 = 65% to determine the training set. We set the bandwidth of the kernel function for the SVM classifier and its slack parameter both to 1. Examples of results for the APPLE picker are presented in Figure 8. All windows classified as particles are surrounded by a box. We validate our suggested framework by presenting the ROC (receiver operating characteristic) curve of the SVM classifier. The ROC curve shows the rate of false positives versus the rate of true positives for a detector. The false positive rate is computed as P84 |Ni ∩ P di | , (7) FPR = i=1 P84 i=1 |Ni | 3. Experimental Results We present experimental results for the framework presented in this paper. We apply our framework to a dataset of β-galactosidase particles and a dataset of keyhole limpet hemocyanin (KLH) particles. The β-galactosidase dataset we use is publicly available from EMPIAR (the Electron Microscopy Public Image Archive) (Iudin et al., 2016) as EMPIAR-100174 consists of 84 micrographs of β-galactosidase and a total of 40863 manually selected particles. Each particle selection is given as a single point in the micrograph. The KLH dataset we use contains 82 micrographs of KLH. These micrographs contain approximately 2000 particles (Zhu et al., 2004, 2003). where Ni is the set of input images extracted from micrograph i that contain a non-particle (negatives) and Pdi is the set of 4 This dataset was obtained by the FALCON II direct detector. Another β-galactosidase dataset is EMPIAR-10061 (Bartesaghi et al., 2015), which was obtained using the K2 direct detector. We note the APPLE picker is effective for this dataset as well. For a comparison between FALCON II and K2 direct detectors see (McMullan et al., 2014). 8 1 true positive rate 0.8 0.6 0.4 0.2 0 0 0.2 0.4 0.6 0.8 1 false positive rate Figure 7: (a) Ground truth used for evaluation of the APPLE picker. (b) ROC (receiver operating characteristic) curve of our suggested framework. rial.5 We present a qualitative comparison of the results of our APPLE picker framework and the RELION and Gautomatch pickers in Figure 9. input images extracted from micrograph i that were classified as containing a particle. The true positive rate is computed as P84 TPR = |Pi ∩ P di | . P84 i=1 |Pi | i=1 (8) 3.2. KLH The micrographs in the KLH dataset (Zhu et al., 2004, 2003) are of size 2048 × 2048. To lower runtime we reduce the size of the micrograph as detailed in Section 3.1. Following the reduction, we use query and reference images of size 30 × 30 and containers of size 115 × 115. We use the same configuration for the SVM as in Section 3.1. The training set is determined using the thresholds τ1 = 16% and τ2 = 70%. While the KLH dataset provides a manual picking of KLH particles, this picking contains only side views, and thus we do not use the manually selected coordinates. Instead, we present in Figures 10-11 some results for the APPLE picker on the KLH dataset. We note these figures show two types of isoforms of KLH. These isoforms are identified in (Roseman, 2004) as KLH1 (short particles) and KLH2 (long particles). We aim to find the KLH1 particles. As detailed in Section 2.4, we use only mean and variance for classifier training. An issue with this practice is exemplified by the hollow KLH particles. A window containing some regions of the particle and some regions of noise that are internal to the hollow particle is indistinguishable from a window containing some regions of the particle and some regions of noise that are external to the particle. This leads the classifier to identify a ring of pixels around the particle as belonging to the particle. Depending on the concentration of macromolecules in the solution, particles may merge together in the output of the classifier. where Pi is the set of input images extracted from micrograph i containing a particle (positives). For each micrograph and each value of τ1 , the classifier achieves some false positive rate and some true positive rate. When τ1 = 0%, the true positive and false positive rates would be 0. When τ1 = 100%, the true positives and false positive rates would be 1. Thus we increase the value of τ1 by small increments (0.95%) to create the ROC curve. We use τ2 = 55%. We present in Figure 7(b) the ROC curve for all possible windows extracted from all the micrographs. We use the ground truth to compute these rates. We note that the rates are computed at the output of the SVM classifier. Runtime for a single micrograph is approximately two minutes when running on the CPU. Thus, the entire dataset can be processed in under 3 hours. The GPU implementation, on the other hand, takes approximately 8 seconds. In other words, the APPLE picker processes all 84 micrograph in under 15 minutes. This is significantly faster than manual picking. We compare our results to the RELION particle picking framework (Scheres, 2015). We note that as the RELION particle picking framework includes a stage of manual picking of 1000 particles as well as a stage of template selection by the user, this framework has some user bias. The results presented for the RELION framework were achieved following the tuto5 ftp://ftp.mrc-lmb.cam.ac.il/pub/scheres/relion21 tutorial.pdf 9 Figure 8: Picked particles of two β-Galactosidase micrographs 4. Conclusion We use morphological erosion to address this problem. This process, detailed in Section 2.5, will discard all connected components with maximum diameter smaller than 132 pixels and larger than 184 pixels (where the diameter of the KLH particles are approximately 160 pixels). In addition, it will separate adjacent particles connected by a narrow band of pixels. This practice is useful in cases where particle projections are close enough that the rings of pixels around each particle will merge, but distant enough that the merging is restricted to a narrow region between the particles. In this paper we have presented the APPLE picker, a simple and novel framework, inspired by template matching, for fully automated particle picking. The APPLE picker has two main classification steps. The first step determined the content of query images according to their response to a set of automatically chosen references. These results are used to train a simple classifier. We present experimental results on two datasets, presenting the type of particles for which this framework is well suited and the reason our classifier may encounter difficulty. We leave it to future work to solve these issues. Figure 10 contains micrographs where the particles are either completely isolated or distant enough that the morphological erosion can separate the pixels that were identified as belonging to each of the particles. This is the case in which the APPLE picker is successful despite the hollow particles. Figure 11 contains micrographs where the particles are clustered closely together, causing the APPLE picker to treat many particles as a single region and thus discard them. It is clear that the APPLE picker is not suited to pick hollow particles that appear with a high concentration. We leave it to future work to solve this issue through addition of more discriminative features to the SVM classifier. Acknowledgments The authors were partially supported by Award Number R01GM090200 from the NIGMS, BSF Grant No. 2014401, FA9550-12-1-0317 from AFOSR, Simons Investigator Award and Simons Collaboration on Algorithms and Geometry from Simons Foundation, and the Moore Foundation Data-Driven Discovery Investigator Award. The authors would like to thank Fred Sigworth for his invaluable conversations and insight into the particle picking problem and for his review of the manuscripts and subsequent and helpful suggestions. The authors are also indebted to Philip R. Baldwin for sharing his expertise on the particle picking problem as well as his review of the APPLE picker code. This research was carried out, in part, while the first author was a visiting student research collaborator and the second author was a postdoctoral research associate at the Program for Applied and Computational Mathematics at Princeton University. Another issue with the KLH dataset is that different micrographs have vastly different concentrations of particles. This makes it difficult to select a single value of τ1 that works well on all the micrographs. An example of this is shown in the last row of Figure 11. When using τ1 = 5% the APPLE picker performs well on this micrograph. Our suggested framework processes all 82 micrographs in under 30 minutes on the CPU and in 4 minutes on the GPU. 10 11 Figure 9: Comparison of our APPLE picker with the RELION and Gautomatch particle pickers. The left column contains the results of our APPLE picker. The middle column contains results of the RELION picker. The right column contains results of the Gautomatch picker. Figure 10: Result on KLH dataset. The left column contains micrographs. The middle column contains the windows classified as particle by our classifier. The right column contains the picked particles. 12 Figure 11: Result on KLH dataset. The left column contains micrographs. The middle column contains the windows classified as particle by our classifier. The right column contains the picked particles. 13 References Iudin, A., Korir, P., Salavert-Torres, J., Kleywegt, G., & Patwardhan, A. (2016). EMPIAR: A public archive for raw electron microscopy image data. Nature Methods, 13. Aebeláez, P., Han, B.-G., Typke, D., Lim, J., Glaeser, R. M., & Malik, J. (2011). Experimental evaluation of support vector machine-based and correlation-based approaches to automatic particle selection. Journal of Structural Biology, 175, 319–328. Langlois, R., Pallesen, J., Ash, J. T., Ho, D. N., Rubinstein, J. L., & Frank, J. (2014). Automated particle picking for low-contrast macromolecules in cryo-electron microscopy. Journal of Structural Biology, 186, 1–7. Bartesaghi, A., Merk, A., Banerjee, S., Matthies, D., Wu, X., Milne, J. L. S., & Subramanian, S. (2015). 2.2 Å resolution cryo-EM structure of β-galactosidase in complex with a cell-permeant inhinitor. Science, 348, 1147–1151. Ludtke, S. J., Baldwin, P. R., & Chiu, W. (1999). Eman: Semiautomated software for high-resolution single-particle reconstructions. Journal of Structural Biology, 128, 82 – 97. Chen, J. Z., & Grigorieff, N. (2007). SIGNATURE: A single-particle selection system for molecular electron microscopy. Journal of Structural Biology, 157, 168–173. McMullan, G., Faruqi, A. R., Clare, D., & Henderson, R. (2014). Comparison of optimal performance at 300 keV of three direct electron detectors for use in low dose electron microscopy. Ultramicroscopy, 147. Chen, S., McMullan, G., Faruqi, A. R., Murshudov, G. N., Short, J. M., Scheres, S. H., & Henderson, R. (2013). Highresolution noise substitution to measure overfitting and validate resolution in 3D structure determination by single particle electron cryomicroscopy. Ultramicroscopy, 135, 24 – 35. Nicholson, W. V., & Glaeser, R. M. (2001). Review: Automatic particle detection in electron microscopy. Journal of Structural Biology, 133, 90 – 101. Ogura, T., & Sato, C. (2004). Automatic particle pickup method using a neural network has high accuracy by applying an initial weight derived from eigenimages: a new reference free method for single-particle analysis. Journal of Structural Biology, 145, 63–75. Cortes, C., & Vapnik, V. (1995). Support-vector networks. Machine Learning, 20, 273–297. Efford, N. (2000). Digital Image Processing: A Practical Introduction Using Java. (1st ed.). Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc. Roseman, A. (2004). FindEM – a fast, efficient program for automatic selection of particles from electron micrographs. Journal of Structural Biology, 145, 91–99. Frank, J., & Wagenknecht, T. (1983). Automatic selection of molecular images from electron micrographs. Ultramicroscopy, 12, 169–175. Scheres, S. H. (2015). Semi-automated selection of cryo-EM particles in RELION-1.3. Journal of Structural Biology, 189, 114–122. Glaeser, R. M. (2004). Historical background: why is it important to improve automated particle selection methods? Journal of Structural Biology, 145, 15–18. Scheres, S. H., & Chen, S. (2012). Prevention of overfitting in cryo-EM structure determination. Nature Methods, 9, 853–854. Harauz, G., & Fong-Lochovsky, A. (1989). Automatic selection of macromolecules from electron micrographs by component labelling and symbolic processing. Ultramicroscopy, 31, 333–344. Schölkopf, B., & Smola, A. J. (2001). Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond. Cambridge, MA, USA: MIT Press. Henderson, R. (2013). Avoiding the pitfalls of single particle cryo-electron microscopy: Einstein from noise. Proceedings of the National Academy of Sciences of the United States of America, 110, 18037 – 18041. Shatsky, M., Hall, R. J., Brenner, S. E., & Glaeser, R. M. (2009). A method for the alignment of heterogeneous macromolecules from electron microscopy. Journal of Structural Biology, 166, 67–78. Hoang, T. V., Cavin, X., Schultz, P., & Ritchie, D. W. (2013). gEMpicker: a highly parallel GPU-accelerated particle picking tool for cryo-electron microscopy. BMC Structural Biology, 13, 25. Sigworth, F. J. (2004). Classical detection theory and the cryoEM particle selection problem. Journal of Structural Biology, 145, 111–122. 14 van Heel, M. (1982). Detection of objects in quantum-noiselimited images. Ultramicroscopy, 7, 331 – 341. Zhu, Y., Carragher, B., Glaeser, R. M., Fellmann, D., Bajaj, C., Bern, M., Mouche, F., de Haas, F., Hall, R. J., Kriegman, D. J., Ludtke, S. J., Mallick, S. P., Penczek, P. A., Roseman, A. M., Sigworth, F. J., Volkmann, N., & Potter, C. S. (2004). Automatic particle selection: results of a comparative study. Journal of Structural Biology, 145, 3–14. Voss, N. R., Yoshioka, C., Radermacher, M., Potter, C. S., & Carragher, B. (2009). DoG picker and TiltPicker: Software tools to facilitate particle selection in single particle electron microscopy. Journal of Structural Biology, 166, 205–213. Zhu, Y., Carragher, B., Mouche, F., & Potter, C. S. (2003). Automatic particle detection through efficient hough transforms. IEEE Transactions on Medical Imaging, 22, 1053– 1062. Wang, F., Gong, H., Liu, G., Li, M., Yan, C., Xia, T., Li, X., & Zeng, J. (2016). DeepPicker: A deep learning approach for fully automated particle picking in cryo-EM. Journal of Structural Biology, 195, 325–336. Zhu, Y., Ouyang, Q., & Mao, Y. (2016). A deep learning approach to single-particle recognition in cryo-electron microscopy. CoRR, abs/1605.05543. Zhang, K. (2017). http://www.mrc-lmb.cam.ac.uk/kzhang/. 15
1cs.CV
Hilbert series of Segre transform, and Castelnuovo-Mumford regularity arXiv:1403.5692v1 [math.AC] 22 Mar 2014 Marcel Morales Université de Grenoble I, Institut Fourier, UMR 5582, B.P.74, 38402 Saint-Martin D’Hères Cedex, and IUFM de Lyon, 5 rue Anselme, 69317 Lyon Cedex (FRANCE) Nguyen Thi Dung Thai Nguyen University of Agriculture and Forestry, Thai Nguyen, Vietnam, Abstract1 In a recent preprint, Ilse Fischer and Martina Kubitzke, proved the bilinearity of the Segre transform under some restricted hypothesis, motivated by their results we show in this paper the bilinearity of the Segre transform in general. We apply these results to compute the postulation number of a series. Our second application is motivated by the paper of David A. Cox, and Evgeny Materov (2009), where is computed the CastelnuovoMumford regularity of the Segre Veronese embedding, we can extend partially their result and compute the Castelnuovo-Mumford regularity of the Segre product of Cohen-Macaulay modules. Key words and phrases: Segre-Veronese, Castelnuovo-Mumford regularity, Cohen-Macaulay, postulation number. MSC 2000: Primary: 13D40, Secondary 14M25, 13C14, 14M05. 1 Introduction In this paper, we deal only with formal Laurent series X al tl , σa ∈ Z, al ∈ C a= l>σa such that (∗) a = h(a)(t) , for some da > 0, h(a)(t) ∈ C[t, t−1 ]. d a (1 − t) Given two formal Laurent series a, b satisfying (*), the Segre transform a⊗b is defined by X al bl tl , a⊗b = l>σ 1 Partially supported by VIASM, Hanoi, Vietnam. 1 where σ = max{σa , σb }. In a recent preprint [F-K], the authors proved the bilinearity of the Segre transform under some restricted hypothesis, motivated by this results we show in this paper the bilinearity of the Segre transform in general. We apply these results to compute the postulation number of a Segre product of series satisfying (*). Property (*) is equivalent to the existence of a polynomial Φa (t) ∈ C[t], such that an = Φa (n) for n large enough. The postulation number is the smallest integer βa such that an = Φ(n) for n > βa . It is well known that βa = deg h(a)(t) − da . Our second application is motivated by the paper [C-M], where is computed the CastelnuovoMumford regularity of the Segre Veronese embedding, we can extend partially their result. Our main result is: Theorem. Let S1 , . . . , Ss be graded polynomial rings on disjoints of set of variables. For all i = 1, . . . , s, let Mi be a graded finitely generated Si -Cohen-Macaulay module. We assume that Mi = ⊕l>0 Mi,l as Si -module. Let di = dim Mi , bi = di − 1 ≥ 0, αi = di − reg(Mi ), where reg(Mi ) is the Castelnuovo-Mumford regularity of Mi . If reg(Mi ) < di , for all i = 1, . . . , s then (1) M1 ⊗ . . . ⊗Ms is a Cohen-Macaulay S1 ⊗ . . . ⊗Ss -module. (2) reg(M1 ⊗ . . . ⊗Ms ) = (b1 + . . . + bs + 1) − max{α1 , . . . αs }. (3) For ni ∈ N, let Mi<ni > be the ni -Veronese transform of Mi , then reg(M1<n1 > ⊗ . . . ⊗Ms<ns > ) = (b1 + . . . + bs + 1) − max{⌈ αs α1 ⌉, . . . , ⌈ ⌉}. n1 ns Note that this result can be proved easily by using local cohomology, but our purpose is to give a very elementary proof. Segre transform of Laurent series In this paper, we deal only with formal Laurent series X al tl , σa ∈ Z, al ∈ C a= l>σa such that (∗) a = We will set h(a)(t) = P h(a)(t) , for some da > 0, h(a)(t) ∈ C[t, t−1 ]. (1 − t)da n>σa hn (a)tn . Definition 1.1. Let a, b be two formal Laurent series satisfying (*). the Segre transform a⊗b is defined by X a⊗b = al bl tl , l>σ where σ = max{σa , σb }. In all this paper we assume that a⊗b 6= 0. 2 Lemma 1.2. a⊗b satisfies (∗). Proof. By [M1], property (*) is equivalent to the existence of a polynomial Φa (l) such that Φa (l) = al for l large enough. Moreover, ( da = deg Φa + 1 if Φa is a non zero polynomial da = 0 if Φa = 0. We have also a polynomial Φb (l) such that Φb (l) = bl for l large enough. Hence al bl = Φa (l)Φb (l) is a polynomial for l large enough, and again by [M1], there exist a Laurent polynomial h(a⊗b)(t) such that h(a⊗b)(t) , a⊗b = (1 − t)da⊗b where da⊗b ( 0 if either da = 0 or db = 0 = da + db − 1 if da , db > 1. Remark 1.3. We recall that binomial coefficients can be defined in a more general setting than natural numbers, indeed for k ∈ N, binomial coefficients are polynomial functions in the variable n. More precisely:  (1) If k = 0 then let n0 = 1, for all n ∈ C.  , for all n ∈ C. (2) If k > 0 then let nk = n(n−1)...(n−k+1) k!    n Note that for all n ∈ C, nk = (−1)k k−n−1 and if n ∈ N, n < k, then = 0. k k 2 Segre transform is bilinear Let recall the following Lemma 1 from [M1]. Lemma 2.1. Let a= X al tl = l>σa σa ra h(a)(t) , (1 − t)da with h(a)(t) = hσa t + . . . + hra t , da > 0 and σa ≤ ra ∈ Z. We will set ba = da − 1. Then for all n = σa , . . . , ra we have     n X da da n−k ak . (−1) an−k = (−1) hn (a) = n−k k k=σ k=0 n−σ Xa k a 3 (1) On the other hand we have for all k > σa ak = k−σ Xa i=0    X  k ba + k − i ba + i (2) hi (a) = hk−i (a) k−i i i=σ a The first claim follows from the equality: X al tl )((1 − t)da ) = h(a)(t). ( l>σa The second claim since: X l>σa X ba + i h(a)(t) al t = ti ) = (h(a)(t))( i (1 − t)da i>0 l The following two theorems extend [F-K, Theorem 1]. Theorem 2.2. Let a, b be two formal power series satisfying property (*). If da = 0 , then for all n ∈ Z   n X bb + n − j hn (a⊗b) = an bn = hn (a) . hj (b) n − j j=σ b Moreover, deg h(a⊗b)(t) 6 deg a. If db > 0 and hj (b) > 0, for all j then deg h(a⊗b)(t) = deg(a). Proof. Since da = 0, a is a Laurent polynomial, we have that hn (a) = an , for all n ∈ Z and an = 0 for n > deg(a), which implies that X an bn tn . a⊗b = n6deg(a) hence deg h(a⊗b)(t) ≤ deg(a). Now suppose that db > 0 and hj (b) > 0 for all j, by using equation (2) we have,   n X bb + n − j . hj (b) hn (a⊗b) = hn (a) n − j j=σ b  +n−σb Note that hσb > 0, bbn−σ > 0, for n ≥ σb . The assumption (a⊗b) 6= 0 implies σb 6 deg a, b  Pdeg a bb +deg a−j so j=σb hj (b) deg a−j > 0. Hence hdeg a (a⊗b) > 0 and the claim is over. Remark 2.3. Let a, b be two formal power Laurent series satisfying property (*), the product hi (a)hj (b) is null for any i < σ, j < σ, where σ is any of the numbers σa , σb , σ(a⊗b) = max(σa , σb ), min(σa , σb ). 4 Theorem 2.4. Let a, b be any formal power Laurent series satisfying property (*). Let ba = da −1 > 0, bb = db −1 > 0 and σ be any of the numbers σa , σb , σ(a⊗b) = max(σa , σb ), min(σa , σb ). Then for any n ∈ Z    ∞ ∞ X X ba + j − i bb + i − j . hi (a)hj (b) hn (a⊗b) = n − j n − i i=σ j=σ The proof will follow immediately from the Lemma 2.1 and the proof of [F-K, Theorem 1]: 3 Postulation number, Castelnuovo-Mummford regularity Lemma 3.1. Let i, j ∈ Z, b1 := d1 − 1 > 0, b2 := d2 − 1 > 0 and Tdi1 := Then Tdi1 ⊗Tdj2 where : ri,j = ti tj j ; T := (1 − t)d1 d2 (1 − t)d2 Pri,j b1 +j−i b2 +i−j n−i n−j b +b +1 1 2 − t)  n=max(i,j) (1  tn , (3) ( min(b1 + j, b2 + i) if b2 + i − j > 0 and b1 + j − i > 0 = max(b1 + j, b2 + i) if b2 + i − j < 0 or b1 + j − i < 0. Proof. The equality (3) follows from theorem 2.4. We need to check that  for n > ri,j , we b1 +j−i b2 +i−j b1 +j−i b2 +i−j have n−i = 0, and that for n = ri,j , we have n−i 6= 0. We have two n−j n−j cases: 1. If b1 + j − i ≥ 0 and b2 + i − j ≥ 0, then ri,j = min(b1 + j, b2 + i). b1 +j−i n−i  = 0 if and only if b1 + j < n. Hence 2. Either b1 + j − i < 0 or b2 + i − j < 0. Suppose for example that b1 + j − i < 0 then b1 +j−i +i−j 6= 0, and b2n−j = 0 if and only if b2 + i < n, but b1 + j < i ≤ b2 + i < n. n−i Hence ri,j = max(b1 + j, b2 + i). Example 3.2. Let α, β ∈ Z, we study Tdα ⊗T1β . We consider two cases: (1) If max(α, β) = α then Tdα ⊗T1β = 5 tα . (1 − t)d (2) If max(α, β) = β > α then Tdα ⊗T1β Note that deg(tα − tα ( Pβ−α−1 l=0 = tα − tα ( d−1+l l Proposition 3.3. Let a= Pβ−α−1 l=0 (1  d−1+l l − t)d  tl )(1 − t)d . tl )(1 − t)d ) = d − 1 + β. h(a)(t) h(b)(t) , where h(a)(t), h(b)(t) ∈ C[t, t−1 ]. ;b = d a (1 − t) (1 − t)db For any non null Laurent series satisfying property (*), we denote σa = minn hn (a) 6= 0, ra = deg h(a)(t). Then (1) ra⊗b 6 max(ba + rb , bb + ra ). (2) If for all σa 6 i 6 ra , σb 6 j 6 rb such that hi (a) 6= 0, hj (b) 6= 0 we have bb + i − j > 0 and ba + j − i > 0 then ra⊗b 6 min(ba + rb , bb + ra ). Moreover, if for all i, j, hi (a) > 0, hj (b) > 0 then ra⊗b = min(ba + rb , bb + ra ). (3) If 0 6 σa 6 ra 6 ba and 0 6 σb 6 rb 6 bb , then ra⊗b 6 min(ba + rb , bb + ra ). Moreover, if for all i, j, hi (a) > 0, hj (b) > 0 then ra⊗b = min(ba + rb , bb + ra ). Proof. (1) Let n > max(ba + rb , bb + ra ), for all i 6 ra , j 6 rb . By the Lemma 3.1, this implies that Ai,j,n = 0, for all i 6 ra , j 6 rb . Hence hn (a⊗b) = 0, which implies that σ( a⊗b) 6 max(ba + j, bb + i). (2) Since for all σa 6 i 6 ra , σb 6 j 6 rb , we have that bb + i − j > 0 and ba + j − i > 0, by the Lemma 3.1, we have that ri,j = min(ba + j, bb + i). This implies for all i, j that Ai,j,ri,j 6= 0 and Ai,j,n = 0 for n > ri,j . On the other hand min(ba + rb , bb + ra ) > min(ba + rb , bb + i) > min(ba + j, bb + i), for all σa 6 i 6 ra , σb 6 j 6 rb . Hence Ai,j,n = 0 for n > min(ba + rb , bb + ra ). Note that the conditions ba + j − i > 0, bb + i − j > 0 implies that Ai,j,n > 0 for all n. Hence if for all i, j, hi (a) > 0, hj (b) > 0 then hn (a⊗b) > 0 for all n, and for m := min(ba + rb , bb + ra ) we have: X hi (a)hj (b)Ai,j,m > 0. hm (a⊗b) = i,j|Ai,j,m 6=0 (3) If 0 6 σa 6 ra 6 ba and 0 6 σb 6 rb 6 bb then ba + j > ba > i and bb + i > bb > j. Therefore ba + j − i > 0 and bb + i − j > 0. Hence, the claim follows from the claim 2. 6 Remark 3.4. The bounds obtained are sharp. Lemma 3.5. The following statements are equivalent: (1) For all σa 6 i 6 ra and σb 6 j 6 rb , we have bb + i − j > 0 and ba + j − i > 0. (2) bb + σa − rb > 0 and ba + σb − ra > 0. (∗∗) Proof. (2) ⇒ (1). Take i = σa , j = rb in the first inequality and j = σb , i = ra in the second. (1) ⇒ (2). Let σa 6 i 6 ra , σb 6 j 6 rb , then i + bb − j > i + bb − rb > σa + bb − rb > 0 and j + ba − i > i + ba − ra > σb + ba − ra > 0. Remark 3.6. Suppose that Ma , Mb are Cohen-Macaulay modules of dimensions da = ba +1 ≥ 2, db = bb + 1 ≥ 2, with Hilbert-Poincaré series a, b. Then the conditions bb + σa − rb > 0 and ba + σb − ra > 0 are equivalent to say that Ma ⊗Mb is a Cohen-Macaulay module by [G-W][Proposition (4.2.5)]. Proposition 3.7. Let consider a1 , . . . , as Laurent formal series satisfying (*) ai = h(ai )(t) , h(ai )(t) ∈ C[t, t−1 ]. (1 − t)di We set ri = deg h(ai )(t), αi = di − ri , bi = di − 1 > 0 and a1 ⊗ . . . ⊗as = h(a1 ⊗ . . . ⊗as )(t) . (1 − t)b1 +...+bs +1 Then (1) deg(h(a1 ⊗ . . . ⊗as )) 6 (b1 + . . . + bs + 1) − min(α1 , . . . , αs ). (2) If the condition (**) of Lemma 3.5 is fulfilled for {a1 , a2 }, {a1 ⊗a2 , a3 }, . . . , {a1 ⊗ . . . ⊗as−1 , as } and hk (ai ) > 0 for all i and k, then deg(h(a1 ⊗ . . . ⊗as )) = (b1 + . . . + bs + 1) − max(α1 , . . . , αs ). (3) If for all i = 1, ..., s, 0 ≤ σi ri < di , then the condition (**) of Lemma 3.5 is fulfilled for {a1 , a2 }, {a1⊗a2 , a3 }, . . . , {a1 ⊗ . . . ⊗as−1 , as }. 7 Proof. (1) Note that max(b1 + r2 , b2 + r1 ) = max(b1 + b2 + 1 − α2 , b1 + b2 + 1 − α1 ) = b1 + b2 + 1 − min(α1 , α2 ). Now suppose s > 3, we prove the claim by induction. Assume that (1) is true for the case s−1: deg(h(a1 ⊗ . . . ⊗as−1 )) 6 (b1 + . . . + bs−1 + 1) − min(α1 , . . . , αs−1 ). Then, by the Proposition 3.3 deg(h(a1 ⊗ . . . ⊗as−1 )⊗as )) 6 max(b1 + . . . + bs−1 + rs , bs + deg(a1 ⊗ . . . ⊗as−1 ) 6 max(b1 + . . . + bs−1 + bs + 1 − αs , b1 + . . . + bs + 1 − min(α1 , . . . , αs−1) = b1 + . . . + bs + 1 + max(−αs , − min(α1 , . . . , αs−1)) = b1 + . . . + bs + 1 − min(αs , min(α1 , . . . , αs−1)) = b1 + . . . + bs + 1 − min(αs , min(α1 , . . . , αs )) (2) Since condition (**) is fulfilled, we can apply Proposition 3.3 and we get: deg(a1 ⊗a2 ) 6 min(b1 + r2 , b2 + r1 ) = min(b1 + b2 + 1 − α2 , b2 + b1 + 1 − α1 ) = b1 + b2 + 1 + min(−α1 , −α2 ) = b1 + b2 + 1 − max(α1 , α2 ) and we have equality if hk (ai ) > 0, for all i, k. By induction hypothesis we assume that deg(a1 ⊗ . . . ⊗as−1) 6 (b1 + . . . + bs−1 + 1 − max(α1 , . . . , αs−1) (4) and we have equality if hk (ai ) > 0, for all i, k. Moreover by Proposition 3.3,the coefficients hk (a1 ⊗ . . . ⊗as−1 ) are > 0. On the other hand, condition (**) is fulfilled, so we can apply Proposition 3.3, we have: deg(a1 ⊗ . . . ⊗as−1)⊗as )) 6 min(b1 + . . . + bs−1 + rs , bs + deg(a1 ⊗ . . . ⊗as−1 ) (5), where we have the equality if hk (as ) > 0 and hk (a1 ⊗ . . . ⊗as−1 ) > 0, which is true since by hypothesis hk (ai ) > 0 for all i, k. Using (4) in (5) we get deg(h(a1 ⊗ . . . ⊗as )) 6 min(b1 + . . . + bs−1 + 1 − αs , bs + b1 + . . . + bs−1 + 1 − max(α1 , αs−1)) = b1 + . . . + bs + 1 + min(−αs , − max(α1 , . . . , αs−1)) = b1 + . . . + bs + 1 − max(αs , max(α1 , . . . , αs−1)) = b1 + . . . + bs + 1 − max(αs , min(α1 , . . . , αs )) and we have the equality if hk (ai ) > 0 for all i, k. (3) The proof is immediate from Proposition 3.3. 8 4 h− vector of the Segre product of s power series The proof of the following theorem is direct from 2.4 by using induction. Theorem 4.1. With the notations of Proposition 3.7. For σs ≤ is ≤ b1 + ... + bs − min{α1 , ..., αs } we have X his (a1 ⊗...⊗as ) = hi1 (a1 )hl2 (a2 )...hls (as )Ai1 ,l2 ,i2 ...Ais−1 ,ls ,is (i1 ,i2 ,...,is−1 ,l2 ,...,ls)∈∆ where ∀k = 2, ..., s; Aik−1 ,lk ,ik    bk + ik−1 − lk b1 + ... + bk−1 + lk − ik−1 , = ik − lk ik − ik−1 and ∆ is defined by : for any τ = 2, ..., s, στ ≤ lτ ≤ bτ + 1 − ατ , στ −1 ≤ iτ −1 ≤ min{b1 + ... + bτ −1 − min{α1 , ..., ατ −1 }, iτ }. There is an important corollary that will be used in [M1] to prove the conjecture by Simon Newcomb: Theorem 4.2. For j = 1, ..., n, let Sj be a polynomial ring over a field K in bj + 1 variables, 1 then: aj the Hilbert-Poincare series of Sj , that is aj = (1 − t)bj +1 For k = 0, ..., b1 + ... + bn − max{b1 , ..., bn }, we have X A([b], k) = Ai2 Ai2 ,i3 Ai3 ,i4 ...Ain−1 ,in , (i2 ,...,in−1 )∈∆ where       bs+1 + is b1 + ... + bs − is b2 b1 ≥0 ; ∀s = 2, ..., n − 1, Ais ,is+1 = in := k; Ai2 = is+1 is+1 − is i2 i2 and ∆ is defined by : for any τ = 2, ..., n − 1 0 ≤ iτ ≤ min{b1 + ... + bτ − max{b1 , ..., bτ }, iτ +1 } Applying Proposition 3.7 to modules we get the following Theorem (note that this theorem can be proved easily by using [G-W], but our purpose is to prove it by using only elementary tools): Theorem 4.3. Let S1 , . . . , Ss be graded polynomial rings on disjoints sets of variables. For all i = 1, . . . , s, let Mi be a graded finitely generated Si -Cohen-Macaulay module. We assume that Mi = ⊕l>0 Mi,l as Si -module. Let di = dim Mi , bi = di − 1 ≥ 0, αi = di − reg(Mi ), where 9 reg(Mi ) is the Castelnuovo-Mumford regularity of Mi . If reg(Mi ) < di , for all i = 1, . . . , s then (1) M1 ⊗ . . . ⊗Ms is a Cohen-Macaulay S1 ⊗ . . . ⊗Ss -module. (2) reg(M1 ⊗ . . . ⊗Ms ) = (b1 + . . . + bs + 1) − max{α1 , . . . αs }. (3) For ni ∈ N, let Mi<ni > be the ni -Veronese transform of Mi , then reg(M1<n1 > ⊗ . . . ⊗Ms<ns > ) = (b1 + . . . + bs + 1) − max{⌈ α1 αs ⌉, . . . , ⌈ ⌉}. n1 ns Proof. We have that for all i = 1, ..., s, 0 ≤ σ(Mi ), reg(Mi ) < di , then statement (3) of Proposition 3.7 implies that is a Cohen-Macaulay module by the Remark 3.6 and [G-W][Proposition (4.2.5)]. The second claim follows immediately from Proposition 3.7. The third claim follows from the second and the fact that for all i = 1, ..., s, reg(Mi<ni > ) = di − ⌈ αnii ⌉, proved in[MD][Theorem 4.7]. If one of the modules has dimension 0, then we get the following Corollary of Theorem 2.2. Theorem 4.4. Let S1 , . . . , Ss be graded polynomial rings on disjoints of set of variables. For all i = 1, . . . , s, let Mi be a graded finitely generated Si -Cohen-Macaulay module of dimension di = dim Mi . We assume that Mi = ⊕l∈Z Mi,l as Si -module, and there is an index k such that dk = dim Mk = 0. Then M1 ⊗ . . . ⊗Ms is a 0-dimensional Cohen-Macaulay S1 ⊗ . . . ⊗Ss -module and reg(M1 ⊗ . . . ⊗Ms ) = min reg(Mk ). k|dim Mk =0 To end this section we exhibit two large classes of ideals that satisfy the hypothesis of Theorem 4.3. (I) Let NA be a finite generated normal semigroup homogeneous, then by [St][13.14], we have that reg(K[NA]) < dim(K[NA]). Hence the toric ring K[NA] satisfy the hypothesis of Theorem 4.3. (II) Let ∆ be a simplicial complex, and K[∆] be the Stanley-Reisner ring associated to ∆. If K[∆] is a Cohen-Macaulay ring, then by the main theorem of Reisner reg(K[∆]) < dim(K[∆]) if and only if ∆ is acyclic. References [B-S] Brodmann, M.P.; Sharp, R.Y., Local cohomology. An algebraic introduction with geometric applications. Cambridge Studies in Advanced Mathematics. 60. Cambridge: Cambridge University Press. xv, 416 p. (1998). 10 [B-H] Bruns, Winfried; Herzog, Jürgen, Cohen-Macaulay rings. Rev. ed. Cambridge Studies in Advanced Mathematics. 39. Cambridge: Cambridge University Press. xiv, 453 p. (1998). [C-M] Cox, David A.; Materov, Evgeny, Regularity and Segre-Veronese embeddings. Proc. Am. Math. Soc. 137, No. 6, 1883-1890 (2009). [E] Eisenbud, David, The geometry of syzygies. A second course in commutative algebra and algebraic geometry. Graduate Texts in Mathematics 229. New York, NY: Springer. xvi, 243 p. (2005). [F-K] Ilse Fischer, Martina Kubitzke, Spectra and eigenvectors of the Segre transformation. arXiv:1303.5358. [G-W] Goto, Shiro and Watanabe, Keiichi, On graded rings, I. J. Math. Soc. Japan Volume 30, Number 2 (1978), 179-213. [M] Morales Marcel, Fonctions de Hilbert, genre géométrique d’une singularité quasihomogène Cohen-Macaulay. CRAS Paris, t.301, série A no 14 (1985). [M1] Morales Marcel, Segre embeddings, Preprint(2013) arXiv:1306.6910. Hilbert series and Newcomb’s problem. [MD] Morales Marcel, Nguyen Thi Dung, Castelnuovo-Mumford regularity of classical rings and Veronese transform. Preprint(2013). [St] Sturmfels, Bernd, Grobner bases and convex polytopes. University Lecture Series. 8. Providence, RI: American Mathematical Society (AMS). xi, 162 p. (1996). 11
0math.AC
A Continuation Semantics of Interrogatives That Accounts for Baker’s Ambiguity arXiv:cs/0207070v2 [cs.CL] 25 Jul 2003 Chung-chieh Shan Harvard University Wh-phrases in English can appear both raised and in-situ. However, only in-situ wh-phrases can take semantic scope beyond the immediately enclosing clause. I present a denotational semantics of interrogatives that naturally accounts for these two properties. It neither invokes movement or economy, nor posits lexical ambiguity between raised and in-situ occurrences of the same wh-phrase. My analysis is based on the concept of . It uses a novel type system for higher-order continuations to handle wide-scope wh-phrases while remaining strictly compositional. This treatment sheds light on the combinatorics of interrogatives as well as other kinds of so-called Ā-movement. 1. Introduction Baker (1968) discusses multiple-wh questions such as those in (1). (1) a. Who remembers where we bought what? b. Who do you think remembers what we bought for whom? Each question in (1) contains three wh-phrases and is ambiguous between two readings with different notions of what constitutes an appropriate answer. (2) Who remembers where we bought what? a. Alice remembers where we bought the vase. b. Alice remembers where we bought what. (3) Who do you think remembers what we bought for whom? a. I think Alice remembers what we bought for Bob. b. I think Alice remembers what we bought for whom. Intuitively, both cases of ambiguity are because the final wh-phrase—what in (1a) and whom in (1b)—can take either wide scope (2a, 3a) or narrow scope (2b, 3b).1 In this paper, I focus on two properties of interrogatives. • Wh-phrases appear both raised and in-situ. For example, in (1b), who and what appear raised while whom appears in-situ. • Raised wh-phrases must take semantic scope exactly over the clause they are raised to overtly. For example, in (1b), who must take wide scope, and what must take narrow scope. Only whom has ambiguous scope; accordingly, the question has only 2 readings, not 4 or 8.2 I present a strictly compositional semantics of interrogatives in English that accounts for these properties. Specifically, in my analysis, • there is no covert movement or wh-raising between surface syntax and denotational semantics (contra Epstein’s (1992) economy account), yet a single denotation suffices for both raised and in-situ appearances of each wh-phrase. Moreover, • as a natural consequence of the denotation of wh-phrases and the rules of the grammar, only in-situ wh-phrases can take scope ambiguously. I describe my system below as one where, roughly speaking, interrogative clauses denote functions from answers to propositions (an old idea). However, such denotations are not crucial for my purposes—the essential ideas in my analysis carry over easily to a system where interrogative clauses denote say sets of propositions instead. Hence this paper bears not so much on what interrogatives denote, but how. My analysis builds upon Barker’s (2000a, 2000b) use of  to characterize quantification in natural language. In Section 2, I introduce continuation semantics as a two-step generalization of Montague’s (1974) treatment of quantification. The system I present generalizes Barker’s semantics in several aspects, which I point out below as we encounter. In Section 3, I specify denotations for interrogative elements and account for the properties above. In doing so, I am not concerned with the semantics of verbs such as know that take interrogative complements, but rather with how to derive denotations for interrogative clauses themselves. Finally, in Section 4, I conclude with some speculations on further applications of my treatment, for example to explain superiority effects. This paper loosely follows the framework of Combinatory Categorial Grammar (Steedman, 1987, 1996). However, I expect the central insights to be easy to adapt to other frameworks of compositional semantics. 2. From PTQ to Continuations in Two Steps Continuations are a well-known and widely applied idea in computer science. Many analogies have been drawn to explain the concept; for example, in programming language semantics, it is often said that “the continuation represents an entire (default) future for the computation” (Kelsey, Clinger, Rees et al., 1998). From the perspective of natural language semantics, a continuation can be thought of as “a semantic value with a hole”. To illustrate, consider the sentence (4) Alice loves Bob. In Montague grammar, the meaning of (4) is computed compositionally from denotations assigned to Alice, loves, and Bob. Starting with the values (5)  : e,  : e → e → t,  : e, where e is the base type of individuals and t is the base type of propositions, we recursively combine semantic values by function application (Figure 1) to obtain f (x) : β f :α→β x:α F 1. Function application3 ()() : t  : e () : e → t  : e → e → t  : e F 2. Alice loves Bob the top-level denotation ()(), of type t (Figure 2).3 Borrowing computer science terminology, I say that the   of the constituent Bob in the sentence (4) is the “sentence with a hole” (6) Alice loves . Semantically, this evaluation context is essentially a map (7) c = λx. (x)() from individuals to propositions—in particular, the map c sends the individual  to the proposition ()(). The map c is called the  of Bob in (4). I assign it the type (8) e ⇀ t, where ⇀ is a binary type constructor. The   of a continuation is its domain, and the   of a continuation is its codomain. For example, the continuation c has value type e and answer type t.4 I distinguish between the continuation type e ⇀ t and the function type e → t, even though they may be interpreted the same way model-theoretically (standardly, as sets of functions). In fact, I use the same notation to construct and apply functions (namely λ and parentheses) as for continuations. The purpose of distinguishing between continuations and functions is to maintain mental hygiene and rule out undesirable semantic combination (see Section 3.2 below). With the continuation c in (7) in hand, we can apply it to  to recover the proposition that Alice loves Bob, or apply it to  to generate the proposition that Alice loves Carol. We can play “what-if” with the hole in (6), plugging in different individuals to see what proposition the top-level answer would come out to be. In particular, we can compute (9) ∀x. c(x) to generate the proposition that Alice loves every individual. This intuition is why Montague’s (1974) “Proper Treatment of Quantification” (PTQ) assigns essentially the denotation (10) JeveryoneK = λc. ∀x. c(x) : (e ⇀ t) → t to the quantificational NP everyone.5 Note that the type in (10) is (e⇀t)→t rather than the more familiar (e→t)→t. This type documents our intuition that the denotation of everyone is a function that maps each proposition with an e-hole (type e ⇀ t) to a proposition with no hole (type t). In general, a semantic value whose type is of the form α ⇀ γ can be thought of as “an γ with a α-hole”, in other words a continuation that—given a hole-filler of type α—promises to produce an answer of type γ. To redeem this promise is to feed the continuation to a function of type (α ⇀ γ) → γ′ in return for a final answer of type γ′ . (In the case of everyone in (10), the two answer types γ and γ′ are both t, and the value type α is e.) As one might expect from this types of the form (α ⇀ γ) → γ′  γ′discussion, recur throughout this paper. I write α γ as shorthand for such a type. For example, the denotation of everyone given in (10) can be alternatively written (11)  JeveryoneK = λc. ∀x. c(x) : e tt . I call α the  , γ the   , and γ′ the   . Continuation semantics can be understood as a generalization of PTQ, in two steps:  • Lift not just the semantic type of NPs from e to e tt , but also the semantic type of other phrases from say α to α tt .  ′  • Lift each type α to not just the type α tt , but any type of the form α γγ , where γ and γ′ are types. I detail these steps below.   2.1. First Generalization: From e tt to α tt  In PTQ, the semantic type of NPs is not e but e tt . For example, the NPs Alice and Bob denote not the individuals  : e and  : e, but rather the lifted values (12a) (12b)  JAliceK = λc. c() : e tt ,  JBobK = λc. c() : e tt .   In general, any value x : e can be lifted to the value λc. c(x) : e tt . The lifted type e tt is borne by all NPs, from proper names like Alice and Bob to quantificational NPs such as everyone and someone. (13a) (13b)  JeveryoneK = λc. ∀x. c(x) : e tt ,  JsomeoneK = λc. ∃x. c(x) : e tt .  λc. c(x) : α tt x:α F 3. Lifting semantic values  Jlove BobK = λc. c(()) : (e → t) tt ?   JloveK = λc. c() : (e → e → t) tt JBobK = λc. c() : e tt F 4. The desired output of a lifted semantic rule Although proper names and quantificational NPs share the same lifted type, the denotations of the latter do not result from lifting any value. PTQ is appealing in part because it assigns the same lifted type to all NPs, quantificational or not. We can generalize this uniformity beyond NPs. For exam t ple, let us lift intransitive verbs from the type e → t to (e → t) t , and transitive verbs from the type e → e → t to (e → e → t) tt . (14a) (14b)  JsmokeK = λc. c() : (e → t) tt ,  JloveK = λc. c() : (e → e → t) tt . In general,   any semantic value x, say of type α, can be lifted to the value λc. c(x), of type α tt . This lifting rule is shown in Figure 3. To maintain the uniformity of types   across the grammar, we want every VP to take the same semantic type (e → t) tt . Furthermore, just as the new denotation of smoke in (14a) is its old denotation  lifted, the new denotation of love Bob should also be its old denotation, (), lifted. What we now need is a semantic rule that will combine a lifted function with a lifted argument to form a lifted result. For example, the rule should combine JloveK = λc. c() with JBobK = λc. c() to form λc. c(()), the denotation we desire for love Bob. This situation is depicted in Figure 4. Consider now the following calculation. (15)   λc. c(()) = λc. λc′ . c′ () λ f. c( f ())  = λc. JloveK λ f. c( f ())   = λc. JloveK λ f. λc′ . c′ () λx. c( f (x))  = λc. JloveK λ f. JBobK λx. c( f (x)) . In the first two lines, the atom  is replaced with a variable f , which gets its value from the lifted denotation of love. In the last two lines, the atom  is similarly replaced with x, which gets its value from the lifted denotation of Bob. The end result is a way to write down the lifted result of a function application in terms of the lifted function and the lifted argument, without mentioning any unlifted atoms. This    λc. f¯ λ f. x̄ λx. c( f (x)) : β tt  f¯ : (α → β) tt  x̄ : α tt F 5. Lifted function application (evaluating function then argument)    λc. x̄ λx. f¯ λ f. c( f (x)) : β tt  f¯ : (α → β) tt  x̄ : α tt F 6. Lifted function application (evaluating argument then function) technique generalizes to a new semantic rule,   , shown in Figure 5. It satisfies the requirement in Figure 4, as is easily checked. As it turns out, there is another way to satisfy the requirement. The calculation in (15) above replaces the atom  first and the atom  second. If instead we replace  first and  second, we arrive at a different result. (16)   λc. c(()) = λc. λc′ . c′ () λx. c((x))  = λc. JBobK λx. c((x))   = λc. JBobK λx. λc′ . c′ () λ f. c( f (x))  = λc. JBobK λx. JloveK λ f. c( f (x)) . This alternative calculation in turn gives rise to a different lifted function application rule, that in Figure 6. The two rules in Figures 5 and 6 differ in  . Roughly speaking, the evaluation order of a programming language is the order in which “computational side effects” like input and output occur as expressions are evaluated (in other words as code is executed). Continuations are often used in programming language semantics to model evaluation order, for instance in Plotkin’s (1975) seminal work. Adopting this terminology, I say that our first rule evaluates the function before the argument, and our second rule evaluates the argument before the function. 2.2. Quantification With the semantic rules and lexical denotations introduced so far, we can derive the sentence Alice loves everyone. Figure 7 shows one analysis, essentially that of Barker’s (2000a). I indicate semantic rules used in derivations with the following notation. • A unary branch decorated with ∧ invokes the lifting rule (Figure 3). • A binary branch decorated with > invokes the one of the two lifted function application rules that evaluates the left daughter first, in other words either the function-then-argument rule (Figure 5) or the mirror image of the argument-then-function rule (Figure 6). • A binary branch decorated with < invokes the other of the two lifted function application rules, which evaluates the right daughter first. λc. ∀x. c((x)()) : t t t >   λc. c() : e tt λc. ∀x. c((x)) : (e → t) tt ∧ >  : e   λc. c() : (e → e → t) tt λc. ∀x. c(x) : e tt ∧  : e → e → t F 7. Alice loves everyone x̄(λx. x) : t ∨  x̄ : t tt F 8. Lowering lifted propositions In this derivation, all evaluation orders give the same result, so both binary branches in Figure 7 could have been decorated with < instead of >. Evaluation order does not matter for this sentence because it only contains one quantificational NP. For other sentences, such as someone loves everyone, different orders of evaluation give differently scoped results (Barker, 2000a). 2.3. Lowering  The top-level denotation derived in Figure 7 has type t tt , in other words (t ⇀ t) → t. This type is not t, the type that clauses usually receive in Montague grammar. This discrepancy   is expected, since every type α, say α = t, has been lifted to the type  α tt = t tt . We can recover the usual, type-t denotation of the sentence by applying the lifted denotation—as a function—to the identity continuation. That is, compute (17)   λc. ∀x. c((x)()) λx. x = ∀x. (x)() : t to recover the propositional meaning of Alice loves everyone. Here the identity continuation λx. x : t⇀t corresponds to the trivial evaluation context “ ”: a sentence with a sentence hole, and nothing else.  In general, from any value x̄ whose type is t tt we can recover the propositional value x̄(λx. x), of type t. This gives us the  rule in Figure 8. Where this rule is used in derivations below, I decorate the unary branch with ∨.  ′  2.4. Second Generalization: From α tt to α γγ The type t plays a special role in PTQ: It is the only answer type. Because PTQ is after all a treatment of quantification, it is natural there for the answer type to be fixed at t by lexical denotations like those of everyone and someone in (13). However, in the treatment of extraction and interrogation that I present below, not  λc. c(x) : α γγ ∧ x:α F 9. Lifting semantic values, revised    λc. f¯ λ f. x̄ λx. c( f (x)) : β γγ02 >   x̄ : α γγ12   f¯ : (α → β) γγ01 F 10. Lifted function application (evaluating function then argument), revised    λc. x̄ λx. f¯ λ f. c( f (x)) : β γγ02 <   f¯ : (α → β) γγ12   x̄ : α γγ01 F 11. Lifted function application (evaluating argument then function), revised x̄(λx. x) : γ ∨  x̄ : α αγ F 12. Lowering lifted values, revised all clauses have the same type. Gapped and interrogative clauses do not denote propositions; they have types other than t. So our semantic rules must deal with lifted values whose answer types are not t. The semantic rules introduced so far (Figures 3, 5, 6, and 8) do not mention any logical operator. Thus the type t plays no essential role in these rules, and can be replaced with a type variable γ. Start with the lifting rule (Figure 3): Any semantic γ value x, say of type α, can be lifted to the value λc. c(x), of (polymorphic) type α γ . This revised lifting rule is shown in Figure 9. The other semantic rules can be similarly revised, by substituting γ for t throughout. However, further generalization is possible. We can not only support answer types other than t, but also allow multiple answer types to occur in the same derivation. In technical terms, consider the λ-terms in our semantic rules: How polymorphic can their types be without risking a mismatch? The most general types that can be assigned are shown in Figures 10–12. (Note that the two versions of lifted function application now differ in their types.) Let me summarize the semantics we have arrived at. Alongside of function application, we have added to Montague grammar four semantic rules: lifting, two versions of lifted function application, and lowering. These four rules, shown in Figures 9–12, suffice below to analyze extraction and interrogation, except wh-phrases taking wide scope call for higher-order continuations (Section 3.4). λx. (x)() : e ⇀ t ∨   λc. λx. c((x)()) : t e⇀t t >   e⇀t λc. λx. c((x)) : (e → t) e⇀t λc. c() : e e⇀t t ∧ >  : e e⇀t λc. c : (e ⇀ t) → (e ⇀ t) λc. c() : (e → e → t) e⇀t ∧  : e → e → t F 13. We bought 3. Manipulating Answer Types In this section, I present my analysis of interrogatives using continuations. I first analyze extraction and raised wh-phrases, then turn to in-situ wh-phrases and multiplewh interrogatives. 3.1. Extraction In order to analyze interrogatives with raised wh-phrases, I first need a theory of extraction. Fortunately, continuation semantics provides for a natural and compositional analysis of extraction. One possible implementation is to posit a phonologically null NP, notated “ ”, whose denotation is6 (18) J K = λc. c : (e ⇀ γ) → (e ⇀ γ), that is, the identity function over individual-taking continuations.7 Figure 13 shows how to derive we bought . The final denotation has type e ⇀ t, a continuation type. This is typical of a clause with an unsaturated gap, and is intuitive considering that continuations are supposed to model evaluation contexts, in other words expressions with holes. Figure 13 reflects one important difference between the continuation semantics here and Barker’s system. Barker takes the answer type to be t everywhere; he does not generalize PTQ to arbitrary answer types (as I do in Section 2.4 above). My present purposes require that we not fix a single answer type, for two reasons. First, not all clauses have the same type. Although basic declarative sentences such as Alice loves Bob have type t, I want sentences with gaps and interrogatives to have other semantic types. Second, my semantics not only calls for a mixture of different answer types, but in fact contains denotations that modify what can be thought of as the “current answer type”. Manipulation of answer types is exemplified by the denotation of in (18) and the derivation of we bought in Figure 13. Examining the denotation of , we see that it takes as input an e-taking continuation whose answer type is γ, but returns a final answer of type e ⇀ γ instead. Informally speaking, J K acts like an e locally, but in addition prepends “e ⇀” to the current answer type; hence we bought receives the semantic type e ⇀ t rather than t. In general, a value of type (α ⇀ γ) → γ′ (19) acts like the value type α locally, but in addition transforms the incoming answer type γ to the outgoing answer type γ′ . The denotation J K is a special case where α = e and γ′ = e⇀γ. Another special case is denotations lifted using the lifting rule, for which γ = γ′ and manipulation of answer types degenerates into propagation.8 The intuition that values like J K “change the current answer type” is reflected my shorthand notation for continuation types, e⇀γ introduced above in Section 2. The type of J K can be written alternatively as e γ , so as to emphasize that it acts locally like an e, but prepends “e ⇀” to the answer type. Note also, in Figures 10 and 11, how lifted function application concatenates two changes to the answer type—first from γ2 to γ1 , and then from γ1 to γ0 —into a change from γ2 to γ0 . 3.2. Raised Wh-phrases As alluded to in Section 1, my interrogative denotations are roughly functions mapping answers to propositions. To make this idea precise, I introduce yet another binary type constructor {, so as to form   such as e { t. As before, I distinguish between the question type e { t, the continuation type e ⇀ t, and the function type e → t, even though they may have the same models and I overload the same notation to construct and apply all three kinds of abstractions. I now analyze the sentences (20) a. Alice remembers what [we bought ]. b. What did we buy ? I ignore the subject-auxiliary inversion triggered by direct (top-level) interrogatives. In Section 3.1 is derived a denotation of type e ⇀ t for the embedded clause we bought . Let us assume, as is commonly done, that remembrance relates persons (type e) and questions (type e{t for now). Then remember has type (e{t)→e→t. Having assigned meanings to every other word in (20a), I need to specify what what means. Note that we bought is of type e ⇀ t, but remember requires the distinct type e { t for its input. Therefore, the denotation of what should convert we bought from e ⇀ t to e { t. I make the simplest assumption to that effect—that what has the semantic type (e⇀t)→(e{t). The semantic content of what should be essentially the identity function, but express the requirement that the input to e { t be somehow inanimate. I am not concerned with the nature of this requirement here, so I simply notate it as a bracketed formula [¬(x)], as in (21a) (21b) JwhatK = λc. λx. [¬(x)] c(x) : (e ⇀ t) → (e { t), JwhoK = λc. λx. [(x)] c(x) : (e ⇀ t) → (e { t).    λx. [¬(x)] (x)()  : t  : e e → t  : (e { t) → e → t e { t JwhatK : (e ⇀ t) → (e { t) λx. (x)() : e ⇀ t we bought (Figure 13) F 14. Alice remembers what [we bought ] The formula [¬(x)] c(x) can be thought of as “if ¬(x) then c(x), otherwise undefined”. The definitions in (21) makes no concrete use of the base type t. Indeed, we can generalize them to (22a) (22b) JwhatK = λc. λx. [¬(x)] c(x) : (e ⇀ γ) → (e { γ), JwhoK = λc. λx. [(x)] c(x) : (e ⇀ γ) → (e { γ). I use this generalization to analyze multiple-wh clauses in Section 3.3 below. Regardless, we can derive (20a). One derivation is shown in Figure 14. Once the meaning of we bought is derived, the rest of the derivation consists entirely of (unlifted) function application. Why distinguish between function types (→), continuation types (⇀), and question types ({)? The distinction prevents the grammar from overgenerating sentences like *I remember Alice bought or *I remember what what Alice bought. The types enforce a one-to-one correspondence between gaps and wh-phrases— more precisely, interrogatives gaps and raised wh-phrases. 3.3. In-situ Wh-phrases The analyses above of extraction and raised wh-phrases are both natural in the spirit of continuation semantics. The primary payoff from these analyses is that little more needs to be said to treat interrogatives with in-situ wh-phrases and to account for the two properties I listed in Section 1. The first property is that wh-phrases appear both raised and in-situ. For instance, the clauses in (23) contain what raised and whom in-situ. (23) a. What did we buy for whom? b. what we bought for whom λx. [¬(x)] λy. [(y)] (y)((x))() : e { e { t JwhatK : (e ⇀ e { t) λx. λy. [(y)] → (e { e { t) (y)((x))() : e ⇀ e { t ∨ λc. λx. λy. [(y)]   c((y)((x))()) : t e⇀e{t t > e⇀e{t   e e⇀e{t (e → t) e⇀e{t t ∧ >  : e   λc. λx. c((x)) : (e → t) e⇀e{t e{t >   (e → t) → (e → t) e{t t > e⇀e{t   λc.c (e → e → t) e⇀e{t e → (e → t)  JwhoK : e e{t t  e{t : e e⇀e{t ∧ → (e → t) e{t e{t  : e → e → t ∧  : e → (e → t) → (e → t) F 15. What we bought for whom, with the narrow-scope reading for whom Ignoring the subject-auxiliary inversion in (23a), these two clauses are identical. To derive them, all we need is an uncontroversial meaning for for: (24) JforK =  : e → (e → t) → (e → t). Given that it was with raised usage in mind that we assigned to whom its meaning in (22b), it may come as a surprise that the same meaning works equally well for in-situ usage. But it does all work out: The derivation, which culminates in the top-level type e { e { t, is shown in Figure 15. (If we assume furthermore that remember can take semantic type (e { e { t) → e → t, then it is straightforward to produce the narrow-scope reading (3b) of the example (1b) from Section 1.) To see how this derivation works, it is useful to examine (22), where what and who were assigned the (polymorphic) type (e ⇀ γ) → (e { γ). In Section 3.2, this type was justified because what needed to convert (→) an e-taking continuation (⇀)  an e-wondering question ({). However, the same type can also be written as  to e e{γ γ . A value of this type takes as input an e-taking continuation whose answer is γ, but returns a final answer of type e{γ instead. Informally speaking, interrogative NPs act like es locally, but in addition prepends “e {” to the current answer type. Hence, as one might expect, the double-wh constructions in (23) receive the semantic type e { e { t. The first “e {” in the type is contributed by the raised wh-phrase what, or rather, contributed as “e ⇀” by the extraction gap and subsequently converted to “e {” by what. The second “e {” in the type is contributed directly by the in-situ wh-phrase whom. Figure 16 illustrates this process. whom for we bought what e { e { t ←−− e ⇀ e { t ←−− e ⇀ e { t ←−− e { t ←−− e { t ←−− t .. .. .. . . . Convert “e ⇀” to “e {” Prepend “e ⇀” Prepend “e {” F 16. Building the semantic type e { e { t for what we bought for whom, with the narrow-scope reading for whom. Whereas the in-situ elements and whom manipulate the answer type, the raised element what manipulates the value type. It may be initially perplexing that the types in Figure 16 are manipulated right-to-left. This pattern is explained if we postulate that evaluation in natural language tends to proceed left-to-right. That is, when a function occurs linearly before its argument, the function-then-argument version of lifted function application is preferred, and vice versa. Left-to-right evaluation results in right-to-left answer type manipulation, because constituents to the left decide what the answer type looks like at outer levels. For example, J K wants the answer type to be a continuation at the outermost level it gets to affect. When building the answer type bottom-up from t to e { e { t, the outermost decisions are executed last, not first. Critical to the ability of the type (e ⇀ γ) → (e { γ) to serve two roles at once is the lowering rule. In-situ wh-phrases (and gaps) combine with other constituents and manipulate the answer type through lifted function application. By contrast, raised wh-phrases combine with other constituents through ordinary (unlifted) function application, and perform the conversion from “e ⇀” to “e {” not on the answer type but on the value type. Before a raised wh-phrase can act on a gapped clause, then, the clause needs a meaning whose value type—not answer type—is of the form e ⇀ · · · . The lowering rule fills this need: It extracts an answer out of a lifted value by feeding it the identity continuation. 3.4. Higher-Order Continuations We have seen above that, in my analysis of interrogatives, a single denotation for each wh-phrase suffices for both raised and in-situ appearances, as long as the wh-phrase takes narrow scope. To fulfill the promises I made in Section 1, I have to turn to wide scope and account for two additional facts about interrogatives: First, I have to show in my system that in-situ wh-phrases can take semantic scope wider than the immediately enclosing clause, as they do in my initial examples (2a) and (3a). Second, I have to show that raised wh-phrases cannot take wide scope; in other words, they must take semantic scope exactly where they are overtly located. I claim that -  account for wide scope interroga9 tives. Our analyses in previous sections are lifted only to the first order. In PTQ terms, this means that our values are sets of sets; more generally, our types are of γ′  the form α γ . Wide scope calls for lifting to the second order. In PTQ terms, this means that our values need to be sets ofsets of sets of sets; more generally, we ′ ′ need to deal with types of the form α γγ δδ . Recall that values lifted to the first order are manipulated using four additional semantic rules: lifting, lowering, and lifted function application (two versions). I explain below how to introduce further semantic rules into the grammar that manipulate values lifted to higher orders. As described in Section 2.1, lifted function application is obtained by “lifting” ordinary function application. Since ordinary function application is a binary rule, it can be lifted in two ways (evaluation orders), giving two rules for lifted function application. In general, any n-ary semantic rule, schematically y:β (25) x1 : α1 x2 : α2 xn : αn , ··· can be lifted in n! ways, giving rise to n! lifted rules: For each permutation σ of the numbers 1, 2, . . . , n, we can lift (25) to a new rule     . c(y) · · · : β γγ0n λxσ−1 λc. x̄σ−1 λxσ−1 . x̄σ−1 λxσ−1 . · · · x̄σ−1 n n 1 1 2 2 (26) x̄1 : α1 γσ1 −1  γσ1 x̄2 : α2 γσ2 −1  γσ2 ··· x̄n : αn γσn −1  γσn . For example, ordinary function application (Figure 1) can be lifted with σ1 = 1, σ2 = 2 (Figure 10) or with σ1 = 2, σ2 = 1 (Figure 11). Let G be a Montague grammar, each of whose semantic rules are of the form in (25). We can  G to a new grammar G′ , with the following semantic rules: • the value lifting rule (Figure 9); • the value lowering rule (Figure 12); and • every rule in G, along with the n! ways to lift it, where n is the arity. Let G0 be “pure” Montague grammar, where the only semantic rule is function application. Lifting G0 gives a new grammar G′0 ; call it G1 . Lifting G1 gives another grammar G′1 = G′′0 ; call it G2 . These grammars and their rules are illustrated in Figure 1. The grammar G2 contains the semantic rules we need to manipulate values lifted to the second order: lifted lifting, lifted lowering, and twice-lifted function application (four versions). The process may continue indefinitely.  ′ In a once-lifted grammar, many types are of the form α γγ . As explained in Section 3.1, such a type can be understood to mean “acts locally like an α while ′ changing the answer γ′ δ′  type from γ to γ ”. In a twice-lifted grammar, many types are of the form α γ δ . One way to understand such types is to think of a derivation in a twice-lifted grammar as maintaining two answer types—an inner answer type corresponding to the first time the grammar is lifted, and an outer one corresponding γ′  ′ δ to the second time. A type of the form α γ δ means “acts locally like an α while changing the inner answer type from γ to γ′ and the outer answer type from δ to δ′ ”. To strengthen this understanding, let us examine how answer types are manipulated in the four binary composition rules that result from lifting function application twice. In Figure 17, I expand out the rules, in particular the types. In the rules >> and >< , evaluation proceeds from function to argument at the first contin- T 1. Lifting Montague grammar. Starting from function application (G0 ), lifting once gives a grammar (G1 ) with 2 unary rules and 3 binary rules. Lifting again gives a grammar (G2 ) with 4 unary rules and 7 binary rules. In the table, “ f > x” means “evaluating function first”; “x > f ” means “evaluating argument first”. Unary rule Value lifting Value lifting, lifted Value lowering Value lowering, lifted Binary rule Function application, lifted f > Function application, lifted f > Function application, lifted f > Function application Function application, lifted x > Function application, lifted x > Function application, lifted x > G0 G0 x, lifted f > x x x, lifted x > f • f , lifted f > x f f , lifted x > f G1 G2 • = • • • = • • G1 G2 • • = • • = • = • • • = • •  γ0 δ0  : β γ2 δ2 λd. f¯ λ f¯. x̄¯ λ x̄. d λc. f¯ λ f. x̄ λx. c( f (x)) >> γ δ     f¯ : (α → β) γγ01 δδ01 x̄¯ : α γ12 δ12  γ0 δ0  λd. x̄¯ λ x̄. f¯ λ f¯. d λc. f¯ λ f. x̄ λx. c( f (x)) : β γ2 δ2 >< γ δ     f¯ : (α → β) γγ01 δδ12 x̄¯ : α γ12 δ01  γ0 δ0  λd. f¯ λ f¯. x̄¯ λ x̄. d λc. x̄ λx. f¯ λ f. c( f (x)) : β γ2 δ2 <> γ δ     f¯ : (α → β) γγ12 δδ01 x̄¯ : α γ01 δ12  γ0 δ0  λd. x̄¯ λ x̄. f¯ λ f¯. d λc. x̄ λx. f¯ λ f. c( f (x)) : β γ2 δ2 << γ δ     f¯ : (α → β) γγ12 δδ12 x̄¯ : α γ01 δ01 F 17. Twice-lifted function application (four versions) uation level. Accordingly, the subscripts on γ show that the inner answer type is threaded first through the argument x̄¯ and then through the function f¯. In the rules <> and << the reverse happens: Evaluation proceeds from argument to function, and the inner answer type is threaded through first f¯ and then x̄¯. Similarly for the second continuation level: In the rules >> and <> , evaluation proceeds from function to argument, and the subscripts on δ show that the outer answer type is threaded first through x̄¯ and then through f¯. In the rules >< and << , evaluation proceeds from argument to function, and the outer answer type is threaded through first f¯ and then x̄¯. λd. λy. [(y)] d λx. [¬(x)]   (y)((x))() : (e { t) e{δ δ >   (e ⇀ t) → (e { t) e{δ λd. λy. [(y)] d λx. e{δ   ∧ (y)((x))() : (e ⇀ t) e{δ δ JwhatK : (e ⇀ t) ∨∗ → (e { t) λd. λy. [(y)] d λc. λx.   e{δ c((y)((x))()) : t e⇀t t δ >> e⇀te{δ e e⇀t λd. λy. [(y)] d λc. e{δ  λx. e⇀te{δ ∧ c((y)((x))) : (e → t) t δ e⇀t e e⇀t >> ∧  : e    (e → t) → (e → t) tt e{δ δ  λd. d λc. λx. c((x)) e⇀te{δ : (e → t) t e{δ >> >>  e{δ e e⇀t t e{δ ∧ e⇀t e{δ e⇀t λc. c : e ∧  t e⇀t  (e → e → t) e⇀t (e →e → t) e⇀t e{δ ∧ e → (e →  t)   →(e → t) tt e{δ e{δ ∧ e → (e →  t)  →(e → t) tt    e tt e{δ δ ∧∗ JwhoK   : e e{δ δ ∧  : e → e → t  : e → (e → t) → (e → t) F 18. What we bought for whom, with the wide-scope reading for whom 3.5. Wide Scope and Baker’s Ambiguity With second-order continuations, we can compute the wide-scope reading (3a) for the sentence (1b) from Section 1, repeated here with gaps represented explicitly. (1b′ ) Who do you think remembers [what we bought for whom]? I extend the grammar only by lifting it again as discussed above, and add no new denotations to the lexicon other than the obvious missing entries (27)  : e,  : t → e → t. The wide-scope reading of the example (1b) is a double-wh question. Thus, we expect the matrix clause to have the semantic type e { e { t. What about the embedded clause? It acts locally like a single-wh question (what), but in addition should prepend “e {” to the answer  e{tembedded e{δ type (whom). We thus expect the clause to have the type (e { t) δ , a special case of which is (e { t) t . Figure 18 shows a derivation for what we bought for whom that culminates in precisely the expected type. The interesting part of the derivation is how the three continuation-manipulating elements what, , and whom enter it. The narrow-scope elements what and need to manipulate the inner answer type while remaining oblivious to the second continuation level, so we lift them. The wide-scope element whom, on the other hand, needs to manipulate the outer answer type while leaving the first continuation level alone; to achieve this effect, we lift it “from the inside” using the lifted lifting rule (depicted as ∧∗ ). Near the top of the derivation, we use the lifted lowering rule (depicted as ∨∗ ) to lower the embedded clause’s denotation “from the inside”, that is, on the first rather than second continuation level. Given a meaning for what we bought for whom of the expected type above, the semantics of the matrix question follows easily from the techniques already demonstrated in previous sections. Second-order continuations are no longer involved. The embedded clause is just a constituent that contains an in-situ wh-phrase whom; like any other such constituent, it combines with the rest of the sentence, including the raised wh-phrase who, to give a final denotation of type e { e { t, typical of a double-wh interrogative. Figure 19 shows the derivation. We have seen that higher-order continuations allow in-situ wh-phrases to take wide scope. I now explain why raised wh-phrases cannot take wide scope, no matter how many times we lift the grammar. What does it mean for a raised wh-phrase to take wide scope? Based on the analyses so far, I make the following definitional characterization: A raised wh-phrase takes narrow scope when it contributes its “e {” to the clause’s value type, and wide scope when it contributes its “e {” to the clause’s outgoing answer type (or rather, one of the clause’s outgoing answer types, in the presence of higher-order continuations). More precisely, consider a clause with a raised wh-phrase in front and a corresponding gap inside. (28) [ a [ b wh] [ c . . . [ d t] . . . ]] For the wh-phrase btotake narrow scope is for the clause a to have semantic type γ1′ γn′  of the form e { α  γ1 · · · γn , and the clause-sans-wh-phrase c the corresponding ′ ′ form e ⇀ α γγ11 · · · γγnn , such that the “e {” was contributed as “e ⇀” by the gap d and subsequently converted to “e {” by the wh-phrase b. This is demonstrated in Section 3.2. By contrast, forthe wh-phrase b to take wide scope is for a to have semantic γn′  γn′  γ1′ e⇀αγ1′  · · · , and c the corresponding form β type of the form β e{α α α γn γ1 · · · γn , γ1 such that the “e {” was contributed as “e ⇀” by d and subsequently converted to “e {” by b. This is impossible because it requires replacing “e ⇀” with “e {” in an answer type, a feat performed by neither any element in the lexicon nor any rule in the grammar: A survey of the lexical items and grammar rules in this paper reveals that the they and their descendants-by-lifting only manipulate answer types by adding to them. Nothing ever takes apart any answer type until the answer has been lowered to value level. The formalism I use here does not stipulate this— in fact, one can easily introduce into the lexicon raised wh-phrases that take wide scope, but English does not appear to contain these denotations: (29a) (29b)     JwhatK , λp. λc. λx. [¬(x)] p(c)(x) : α e⇀γ → α e{γ γ γ , e⇀γ e{γ  JwhoK , λp. λc. λx. [(x)] p(c)(x) : α γ → α γ . λz. [(z)] λy. [(y)]   λx. [¬(x)]   (y)((x))() (z) () : e { e { t JwhoK λz. λy. [(y)] : (e ⇀ e { t)   λx. [¬(x)]   → (e { e { t) (y)((x))() (z) () : e ⇀ e { t ∨ λd. λz. λy. [(y)] d   λx. [¬(x)]     (y)((x))() (z) () : t e⇀e{t t > e⇀e{t λd. λz. λy. [(y)] e e⇀e{t d   λx. [¬(x)] ∧     : e (y)((x))() (z) : (e → t) e⇀e{t t > e⇀e{t λd. λz. λy. [(y)] (t → e ⇀ t) e⇀e{t d  λx. [¬(x)] ∧      : t → e ⇀ t (y)((x))() (z) : t e⇀e{t t   e⇀e{t > λc. c : e e{t (e → t) e{t t > (e { t) → e → t e{t e{t ∧   (e { t) e{t t  : (e { t) → e → t what we bought for whom (Figure 18) F 19. Who you thinks remembers what we bought for whom, with the widescope reading for whom 4. Discussion This paper presents a grammar fragment that captures two properties of English interrogatives: First, wh-phrases can appear both raised and in-situ. Second, insitu wh-phrases can take scope beyond the immediately enclosing clause, but raised wh-phrases must take scope exactly where they are pronounced. My fragment is inspired by Barker’s continuation semantics for natural language (2000a; 2000b) and work on continuations and typed contexts in programming languages (Danvy and Filinski, 1989, 1990; Murthy, 1992; Wadler, 1994). As a semantics of interrogatives, this paper leaves many concerns unaddressed: languages other than English; pair-list questions; relative clauses; interactions with intensionality and quantification; and so on. Regardless, the two properties of interrogatives that I do explore fall out surprisingly naturally: The same wh-denotation works both raised and in-situ, but in raised position it is forced to take overt scope by a theorem of the type system. The basic ideas probably carry over to other kinds of so-called Ā-movement, such as topicalization. Continuations also suggest new ways to understand phenomena such as superiority and pied-piping, but for lack of space I leave these investigations for elsewhere. Endnotes ∗ Thanks to Stuart Shieber, Chris Barker, Danny Fox, Pauline Jacobson, Norman Ramsey, Dylan Thurston, MIT 24.979 Spring 2001 (Kai von Fintel and Irene Heim), the Harvard AI Research Group, the Center for the Study of Language and Information at Stanford University, and the referees at SALT 12. This work is supported by National Science Foundation Grant IRI-9712068. 1 I disregard here the distinction between questions that allow or expect - answers (Alice remembers where we bought the vase, and Bob remembers where we bought the table) and questions that require or expect non-pair-list answers. 2 To be clear, a raised wh-phrase can often take scope beyond the clause immediately enclosing its corresponding gap. The generalization I state here is that a raised wh-phrase cannot take scope beyond the clause in front of which it is pronounced. 3 Throughout this paper, I use the Greek letters α, β, γ, and δ to represent type variables, in other words variables that can be instantiated with any type. Thus what this paper calls types are known as - in the Hindley-Milner type system (Hindley and Seldin, 1986). Also, by convention, all binary type constructors associate to the right: The type e → e → t, unparenthesized, means e → (e → t). 4 The concept of answer types in continuation semantics is separate from the concept of appropriate answerhood in interrogatives. 5 So do Hendriks’s (1993) and Barker’s (2000a) later proposals. For simplicity and because they are irrelevant, I omit restrictions on quantification (“(x)⇒· · · ”) in (10) and below. 6 That I posit a phonologically null element is a matter of presentation and not critical to the approach to extraction sketched here. It would work equally well for my purposes to introduce type-shift operations that effectively roll J K into binary rules. 7 The idea that a variable or gap is in some sense an identity function over continuations appeared in the work of Danvy and Filinski (1989, §3.4), and also has been mentioned to me by Barker. The more general idea that a variable or gap is an identity function of some sort has an even longer history in computer science (Hindley and Seldin, 1986) and linguistics (Jacobson, 1999). 8 This pseudo-operational description is merely an intuitive sketch. The denotations in my semantics are computed purely in-situ according to local composition rules. 9 In the same spirit, Barker (2000b) used higher-order continuations to treat widescope specific indefinites and interactions between coordination and antecedentcontained deletion. References Baker, Carl Leroy. 1968. Indirect questions in English. Ph.D. thesis, University of Illinois. Barker, Chris. 2000a. Continuations and the nature of quantification. Manuscript, University of California, San Diego; http://www.semanticsarchive. net/Archive/902ad5f7/. ———. 2000b. Notes on higher-order continuations. Manuscript, University of California, San Diego. Danvy, Olivier, and Andrzej Filinski. 1989. A functional abstraction of typed contexts. Tech. Rep. 89/12, DIKU, University of Copenhagen, Denmark. http://www.daimi.au.dk/˜danvy/Papers/fatc.ps.gz. ———. 1990. Abstracting control. In Proceedings of the 1990 ACM conference on Lisp and functional programming, 151–160. New York: ACM Press. Epstein, Samuel David. 1992. Derivational constraints on Ā-chain formation. Linguistic Inquiry 23(2):235–259. Hendriks, Herman. 1993. Studied flexibility: Categories and types in syntax and semantics. Ph.D. thesis, Institute for Logic, Language and Computation, Universiteit van Amsterdam. Hindley, J. Roger, and Jonathan P. Seldin. 1986. Introduction to combinators and λ-calculus. Cambridge: Cambridge University Press. Jacobson, Pauline. 1999. Towards a variable-free semantics. Linguistics and Philosophy 22(2):117–184. Kelsey, Richard, William Clinger, Jonathan Rees, et al. 1998. Revised5 report on the algorithmic language Scheme. Higher-Order and Symbolic Computation 11(1):7–105. Also as ACM SIGPLAN Notices 33(9):26–76. Montague, Richard. 1974. The proper treatment of quantification in ordinary English. In Formal philosophy: Selected papers of Richard Montague, ed. Richmond Thomason, 247–270. New Haven: Yale University Press. Murthy, Chetan R. 1992. Control operators, hierarchies, and pseudo-classical type systems. In CW’92: Proceedings of the ACM SIGPLAN workshop on continuations, ed. Olivier Danvy and Carolyn Talcott, 49–71. Tech. Rep. STAN-CS-92-1426, Department of Computer Science, Stanford University. ftp://cstr.stanford.edu/pub/cstr/reports/cs/tr/92/1426. Plotkin, Gordon D. 1975. Call-by-name, call-by-value and the λ-calculus. Theoretical Computer Science 1(2):125–159. Steedman, Mark. 1987. Combinatory grammars and parasitic gaps. Natural Language and Linguistic Theory 5:403–439. ———. 1996. Surface structure and interpretation. Cambridge: MIT Press. Wadler, Philip. 1994. Monads and composable continuations. Lisp and Symbolic Computation 7(1):39–56.
2cs.AI
Partial Field Coverage Based on Two Path Planning Patterns arXiv:1707.07649v2 [cs.SY] 27 Mar 2018 Mogens Graf Plessena,∗ a IMT School for Advanced Studies Lucca, Piazza S. Francesco, 19-55100 Lucca, Italy Abstract This paper presents a path planning method for partial field coverage. Therefore, a specific path planning pattern is proposed. The notion is that lighter machinery with smaller storage tanks can alleviate soil compaction because of a reduced weight, but does not enable full field coverage in a single run because of the smaller storage capacity. This is relevant for spraying applications and related in-field work. Consequently, multiple returns to a mobile or stationary depot located outside of the field are required for storage tank refilling. Therefore, a suitable path planning method is suggested that accounts for the limited turning radii of agricultural vehicles, satisfies compacted area minimisation constraints, and aims at overall path length minimisation. The benefits of the proposed method are illustrated by means of a comparison to a planning method based on the more common AB pattern. It is illustrated how the proposed path planning pattern can also be employed efficiently for single-run field coverage. Keywords: Partial Field Coverage; Path Planning; Shortest Paths; Patterns; Decision Support System. ∗ Corresponding author. Email address: [email protected] (Mogens Graf Plessen) Preprint submitted to Biosystems Engineering March 28, 2018 NOMENCLATURE Symbols D(ρ) Total in-field path length for ρ ≥ 1 field runs (m) ∆D Path length difference (m) ei,j Edge connecting nodes i and j (m) f (t) Storage tank fill-level (%) γ(t) Vehicle state (resume, coverage, return) H0 Nominal lane path length in a rectangular field (m) N Number of interior lanes (-) ql , p Auxiliary variables in the example of Section 4.1 (-) ρ Number of field runs required for field coverage (-) R Vehicle turning radius (m) W0 Nominal machine operating width (m) Z Position Z = (ξ, η) (m) (x, y) Position in the global coordinate system (m) (ξ, η) Position in the normalised coordinate system (m) Z0 Start position Z0 = (ξ0 , η0 ) (m) (l) Z0 Two sets of start positions with l = 1, 2 (m) Zi Position of node i (m) Z(t) Position of agricultural vehicle at time t (m) Z(τ last ) Position for resuming field coverage (m) Abbreviations ABp Path Planning Method 1 (AB pattern) CIRC Path Planning Method 2 (circular pattern) CIRC? Path Planning Method 3 (circular pattern) 2 1. Introduction According to Ahumada & Villalobos (2009) and Bochtis (2010), the agrifood supply chain can be decomposed into four main functional areas: production, harvesting, storage and distribution. For improved supply chain efficiency, logistical optimisation and route planning play an important role in all of the four functional areas. Regarding production, for example, by means of minimisation of the non-working distance travelled by machines operating in the headland field according to Bochtis & Vougioukas (2008), optimal route planning based on B-patterns according to Bochtis et al. (2013), or route planning for the coordination of fleets of autonomous vehicles as discussed in Conesa-Muñoz et al. (2016a) and Seyyedhasani & Dvorak (2017). See also Day (2011) for an overview of means for efficiency improvements, Bochtis (2013) for the importance of satellite-based navigation systems in modern agriculture, and Sørensen & Bochtis (2010) for a distinction between infield, inter-field, inter-sector and inter-regional logistics. The path planning method for partial field coverage presented in this paper relates to the first functional area of the agri-food supply chain. The last decades have witnessed a trend towards the employment of larger and more powerful machines in agriculture. This trend is expected to further continue in the near future, see Kutzbach (2000) and Dain-Owens et al. (2013). Among the main benefits are higher work rates. The drawbacks include increased soil compaction due to machinery weights, see Raper (2005) and Hamza & Anderson (2005). See also Antille et al. (2013) for the influence of tyre sizes on soil compaction. Concurrently to this ongoing trend, there are alternative considerations about the replacement of heavy machinery by 3 teams of smaller and lighter autonomous robots to mitigate soil compaction, see Blackmore et al. (2008), Bochtis & Sørensen (2010), Bochtis et al. (2012), Bochtis (2013), Gonzalez-de Santos et al. (2016) and Seyyedhasani & Dvorak (2017). See also Vougioukas (2012) for a method for motion coordination of teams of autonomous agricultural vehicles. This paper is motivated by the concept of smaller in-field operating machines collaborating with out-field support units (mobile depots). Therefore, a pattern-based path planning method for partial field coverage is presented, which is characterised by i) minimisation of traveled non-working path length, and ii) compliance with compacted area minimisation constraints. The latter implies driving along unique and established transitions between headland path and interior lanes, thereby avoiding the creation of any additional tyre traces that result from vehicle traffic passing over crops and compacting soil. Under the assumption of specific field shapes two different path planning patterns are compared. In contrast to route planning methods such as in Conesa-Muñoz et al. (2016b) for the in-field operation of a fleet of vehicles, the presented method focuses on the in-field operation of a single vehicle that is repeatedly returning to the field entrance for refilling. This is primarily motivated by the targeted crops (wheat, rapeseed and barley) and the costs of corresponding agricultural vehicles. A support unit, acting as a mobile depot, is assumed to be waiting at the field entrance for refilling. Two comments are made. First, unlike during harvest, mobile units for refilling of spraying tanks cannot come to any arbitrary position along the headland. Second, a single field entrance is in line with the objective of compacted area minimisation. For 4 Fig. 1. Visualisation of real-world transitions between headland path and interior lanes. In the satellite image, the effects of a limited turning radius of the employed agricultural vehicle is visible. The compacted areas are indicated by the bright tyre traces. Note also the compacted area due to the connection between field entrance and headland path. headland path C D lane vehicle Q P Fig. 2. Visualisation of the compacted area minimisation constraint. aforementioned targeted crops, any new field entrance would result in a new compacted area for the connection of in-field headland path and out-field road network, see Fig. 1. This paper is organised as follows. The problem is formulated in Section 2. The main contribution is given in Section 3. Examples and a discussion are presented in Sections 4 and 5, before concluding with Section 6. 5 Fig. 3. Illustration of two types of field shapes with uninterrupted (left) and interruped (right) lanes when aligned in a rotated coordinate frame. Note that field areas do not necessarily have to be convex. For the present paper, the focus is on the left field type. 2. Problem Formulation and Notation 2.1. Problem Formulation This paper addresses pattern-based path planning for partial field coverage. The fundamental objective is non-working path length minimisation. Therefore, the following is additionally addressed. First, path planning must account for compacted area minimisation constraints. These constraints impose unique transitions between headland and interior lanes and account for limited turning radii. For illustration see Fig. 2. Any agricultural vehicle that is traveling along lanes and the headland path must respect tractor traces established upon first field coverage. Thus, transitions P-Q and P-D are admissible. In contrast, transition P-C is not admissible. Such a transition would deviate from established tyre traces when accounting for the limited turning radius of the vehicle, and would therefore repress and destroy precious crop. See also Graf Plessen & Bemporad (2016) for general shortest path in-field navigation accounting for these constraints. 6 ZN +1 Z0 Z2N Z2N +1 Z2N +2 η ξ Fig. 4. Z1 Z2 ZN Illustration of notation. The headland path is denoted by the solid line. Interior lanes are here indicated by the dashed lines. The arrow indicates the headland traversal direction. Headland and lanes are expressed in the (ξ, η)-coordinate system such that lanes are aligned to the η-axis. The field entrance (start position) is denoted by Z0 . Second, path planning must ideally minimise non-working path length for both single-run and partial field coverage. Third, path planning must optimally account for the following tasks during online operation: i) path following according to a field coverage plan, ii) navigation from a position along the path network to the field entrance for refilling of storage tanks, and iii) navigation from the field entrance after refilling back to the position along the field coverage path for the resumption of work. 2.2. Assumptions on Field Shapes and Notation The focus of this paper is on field shapes that permit optimal path planning based on patterns, see Fig. 3. As will be shown, for these field shapes the preferred pattern-based path planning method can yield minimal path length solutions for both full and partial field coverage. Relevant components 7 for planning include a headland path and multiple interior lanes, see Fig. 4. In combination, they enable field coverage. The headland path is generated from an erosion (mathematical operation) of the field contour to the field interior. All position coordinates are initially expressed in the global (x, y)coordinate system. Then, all coordinates can be transformed by a rotation of angle θ to a rotated (xθ , yθ )-coordinate system such that interior lanes are aligned with the vertical yθ -axis. Thus, (xθ , yθ ) = R(θ)(x, y), where R(θ) denotes a standard rotation matrix with rotation angle θ. In addition, at most two coordinate reflections (Householder transformation in two dimensions) are employed in order to normalise the path planning problem with respect to the field entrance position. Thus, the normalised coordinate system in which paths are ultimately planned is described by coordinates (ξ, η). Mathematical details about the coordinate reflections follow in Section 3.1. All three transformation steps (rotation and at most two reflections) are linear. Ultimately, paths planned in the (ξ, η)-system are recovered in the (x, y)plane by inversion of the linear transformations. In the following, a position within the normalised coordinate system is abbreviated by Z = (ξ, η). (1) Field contours are assumed such that any rotated interior lane is uninterrupted. Thus, it can be represented by one continuous lane segment for a given ξ-coordinate. This assumption is made to enable optimal path planning based on patterns. In general, aforementioned interruptions may arise from deep field indents, bays or tree islands. Note that the previous discussion can be generalised to interior lanes that are curvilinear to a particular part of the field contour. 8 The following additional assumptions are made. First, the orientation θ of the interior lanes within the global coordinate system are assumed to be given. However, the transitions between headland path and interior lanes (left or right turns) are initially not specified. They result from the presented methods. Second, besides the headland path and interior lanes, a field entry located along the headland path is assumed. It is additionally assumed that a designated field exit exists, which may be identical to the field entrance. See Fig. 4 for illustration of notation and the labeling of transition points between headland path and interior lanes. Not displayed are i) the field exit, which is labeled by Z2N +3 and interchangedly abbreviated by Ze for brevity, and which may be identical to Z0 , and ii) the agricultural vehicle position at time t which is labeled by Z2N +4 or interchangedly by Z(t), and which may be located anywhere along the headland path or along any interior lane. Note that the precise transitions between headland and interior lanes that account for limited turning radii are initially not specified. Locations Zi , ∀i = 0, . . . , 2N + 4, denote nodes. Their path connections define edges ei,j , ∀i, j = 0, . . . , 2N + 4, whereby any edge weight is specified by its path length. Combining edges and nodes, a transition graph can be generated. Nodes indexed by i = 2N + 1 and i = 2N + 2 are introduced to ensure unique edge connections between any two nodes. Based on the transition graph, shortest paths can be determined (Bertsekas et al. (1995)). 3. Path Planning for Partial Field Coverage This section discusses three pattern-based path planning methods for partial field coverage: ABp, CIRC and CIRC? . 9 3.1. Path Planning based on the AB pattern – ABp In current working practice, the overwhelming majority of field coverage paths is planned based on sequential concatenation of geometrically translated AB lines such that a meandering path is generated, see Palmer et al. (2003) and Fig. 5. In the following, this method of field coverage is referred to as ABp, which is abbreviated for AB pattern (terminology from Bochtis et al. (2013)). The fact that it is so widespread can be observed from satellite images and their display of tyre traces. Field coverage can be decomposed into, first, the traveling along the headland path, and, second, the subsequent following of the meandering path until completion of field coverage. Under the assumptions of i) a continuous and thorough initial headland path traversal before interior lane coverage, ii) field shapes according to the description of Section 2, and iii) field coverage in one single traversal without requiring an intermediate return to a stationary or mobile depot for refilling (or a similar task), the path planning method based on the AB pattern is the optimal strategy, even under compacted area minimisation constraints. This is since the non-working distance is minimised. It is constrained to the headland path segments that were already covered during the initial headland path traversal. However, as will be shown, this method is not optimal for partial field coverage. Because of its widespread usage it will serve as the baseline. In the remainder of this section, its optimal demployment is discussed and its intrinsic disadvantages for partial field coverage are exposed. Four cases of combinations of the number of interior lanes N and the set (1) of start positions Z0 are distinguished. They are: (odd N , Z0 ), (even N , (1) (2) (2) Z0 ), (odd N , Z0 ) and (even N , Z0 ). These four entail path planning 10 (1) Z0 towards Ze (1) (a) Odd N and Z0 . towards Ze (2) Z0 (2) (b) Odd N and Z0 . (1) Z0 towards Ze (1) (c) Even N and Z0 . (2) Z0 towards Ze (2) (d) Even N and Z0 . Fig. 5. ABp. Distinction between four combinations of odd and even N and, in red, two (1) possible sets of start (and simultaneously end) positions, Z0 lines indicate the ξ1 +ξN 2 (2) and Z0 . The blue dotted -coordinate, respectively. Note that only for better visualisation of the route planning logic, the meandering path is not displayed as coinciding with the headland path. 11 (a) The path planning pattern for ABp. (b) Concatenation of two path planning patterns for ABp. Fig. 6. ABp. (Top plot) Illustration of the path planning pattern. The red bar indicates the area that cannot be reached by neither traversal of the path planning pattern nor traversal of the headland segments in the directions as indicated by the arrows. (Bottom plot) Concatenation of two pattern elements. The traversal along the “upper” and “lower” headland path is emphasised in blue. Importantly, the area indicated by the red bar can still not be reached, see Proposition 1. 12 as displayed in Fig. 5 for 7 lanes (unven N ) and 8 lanes (odd N ). The (1) (2) mathematical description of Z0 and Z0 is derived as follows. Based on the definitions in Fig. 4, H = {(ξ, η) : (ξ, η) ∈ headland path} is defined, i.e., as the set of (ξ, η)-coordinates along the headland path. The auxiliary location ZM = (ξM , ηM ) with ξM = (ξ1 + ξN )/2 and ηM = max {η : (ξ, η) ∈ H, ξ = ξM } are further defined. Then, the path length coordinate s is initialised along the headland path at ZM with sM = 0. This permits to define two sets (1) of path coordinates for field entrance positions, i.e., S0 = {s : 0 ≤ s ≤ sN +1 } (2) and S0 = {s : sN +1 ≤ s ≤ s1 }, whereby sN +1 and s1 denot the path length coordinates at location ZN +1 and Z1 , respectively. Consequently, the two sets of possible start positions expressed within the normalised coordinate (l) (l) framework can be defined as Z0 = {Z(s) : s ∈ S0 } for l = 1, 2, and where Z(s) denotes a location at path length coordinate s along the headland path. Let us elaborate on the employed coordinate system transformations. The rotation step transforms coordinates from the global (x, y)-description to the (xθ , yθ )-coordinate system such that interior lanes are aligned to the yθ -axis. Then, at most two additional coordinate reflections are applied. Therefore, first xθ,M = (maxxθ ∈Xθ xθ − minxθ ∈Xθ xθ )/2 is defined with Xθ denoting the set of all xθ -coordinates defining the headland path, before applying the first coordinate reflection by the linear mapping: xxθ = xθ,M − (xθ − xθ,M ), (2) yθx = yθ . (3) If the transformed coordinates are not yet sufficiently normalised such that the starting position falls into above framework and according to Fig. 13 5, then the following second coordinate reflection is applied: x xxy θ = xθ , (4) x x yθxy = yθ,M − (yθx − yθ,M ), (5) x with yθ,M = (maxyθx ∈Yθx yθx − minyθx ∈Yθx yθx )/2, and where Yθx describes the set of yθx -coordinates defining the headland path. At the latest after this second transformation, coordinates are normalised such that the starting position falls into above framework, see Fig. 5. Thus, (ξ, η) represents the xy (xθ , yθ )-, (xxθ , yθx )-, or (xxy θ , yθ )-coordinate system. After path planning in the normalised coordinate system, all linear mappings required for normalisation must be inverted to obtain the result within the (x, y)-plane. The path planning method for ABp is summarised in the following Algorithm. It describes the offline fitting of a traversable path to a given field. Algorithm 1: ABp (offline) 1. Normalisation of the coordinate system description: - one rotation, and at most two reflection steps. - description in the (ξ, η)-plane. 2. Distinction between four cases: (1) (2) - four combinations of even/odd N and Z0 /Z0 . 3. Path planning according to the method of Fig. 5. 4. Retransformation of coordinates to the (x, y)-plane. 14 Characteristics of the method are discussed. The pattern on which ABp is founded is displayed in Fig. 6. “Lower” and “upper” headland segments are defined as the set of edges {ei,j : i, j = 1, . . . , N, 2N +1} and {ei,j : i, j = N + 1, . . . , 2N, 0, 2N + 2}, respectively. It is distinguished between two possible methods for the transition from lane N towards the headland path; see the labeling “towards Ze ” in Fig. 5. For all four cases, (a)–(d), the direction pointing towards Z0 , which is also the method implicitly assumed for the remainder of Section 3.1, is more favourable than its alternative with regard of path length minimisation from any given position back towards Z0 . This is easy to see from the fact that a transition from interior lane to headland path is created, which must be respected as a compacted area minimisation constraint. Even if Ze is located such that ξe > ξN , for overall path length minimisation, the method with a final transition pointing towards smaller ξ0 may typically still be preferable. This holds especially when frequent returns to a mobile depot are required. Importantly, it also guarantees that after traversal of the N th lane, a move along the “upper” headland path heading towards Z0 is then possible. Proposition 1. Assume a normalised coordinate system description with Z0 = (ξ0 , η0 ) according to Fig. 5, in which it is accounted for compacted area minimisation constraints, and in which it is aimed at finding the shortest path from position Z(t) = (ξ(t), η(t)) at time t to Z0 . Then, if ξ(t) ≥ ξ0 , a corresponding agricultural vehicle has to always traverse the ultimate lane N as part of the path to reach Z0 , unless it already has covered all interior lanes and is heading back towards Z0 along the “upper” headland path, or unless it is heading towards Z0 along the “upper” headland path as part of the initial 15 headland path traversal. Proof. The proof is by construction and follows directly from the meandering path motif in Fig. 6, and the assumption of complying with compacted area minimisation constraints. See Fig. 5 for visualisation. Proposition 1 is particularly relevant for fields with many lanes N (“fat” fields). For ξ(t) < ξ0 , no such generalizing statement can be made without (l) making further differentiations between even/odd N and Z0 for l = 1, 2. However, Proposition 1 can be generalised to alternative locations different from Z0 . See Fig. 6 for visualisation of areas that cannot be reached without reaching the final lane after the concatenation of multiple pattern elements. Remark 1. While Proposition 1 guarantees that the last lane N must be reached, no generalizing statement can be made with respect to the shortest path for reaching it. The ξ-coordinate must be monotonically increasing throughout the process of reaching it. However, it does not necessarily have to be strictly monotonically increasing. For example, depending on the field contour and orientation of interior lanes, the shortest path may involve transitions along interior lanes from “upper” to “lower” headland segments, vice versa, and even multiple times during the process of reaching lane N . After traversal of the N th lane, the shortest path to Z0 is sought. Here, the same concepts apply. Strictly monotonous movement towards Z0 is not required. Potential transitions between “upper” and “lower” headland path segments may be path length optimal. In practice, a shortest path algorithm, see Bertsekas et al. (1995), can be employed for both i) the reaching of the N th lane starting from location Z(t) at time t, and ii) the reaching of Z0 after the 16 traversal of the N th lane. Remark 2. For the resumption of work at location Z(τ last ) = (ξ(τ last ), η(τ last )), the shortest possible path from Z0 to that location can be selected if ξ(τ last ) > ξ0 and Z(τ last ) is not located along the “upper” headland. This can be seen from Fig. 6; there is no transition from headland to interior lane or vice versa that is prohibiting such shortest path. In contrast, for alternative locations of Z(τ last ), the heading direction along the field coverage path plays an important role. To resume a specific heading orientation, a path may have to be taken that is deviating from the shortest path connecting Z0 and Z(τ last ). At any time t, the agricultural vehicle can be in any of three states γ(t) ∈ {0, 1, 2}. The case γ(t) = 0 corresponds to a mode in which the vehicle is on its way back to the resuming location Z(τ last ) at which the field coverage was terminated last at time τ last . The case γ(t) = 1 corresponds to a mode in which the vehicle is following the field coverage path plan according to Fig. 5. Finally, γ(t) = 2 indicates the mode in which the vehicle is in the process of returning to Z0 for refilling. During operation the vehicle alternates between any of these three states dependent on its storage tank fill-level. The predicted fill-level at time t+∆t is denoted by fˆ(t+∆t), and bounded between 0 and the maximum fill capacity, and ∆t the time discretisation. During online operation and dependent on the location of Z0 , it often is favourable to trigger a return command on the last lane with heading in negative η-direction before the fill-level is about to reach zero. This is since the resulting path to Z0 typically involves the following steps: i) completion of the current interior lane, ii) traveling along the “lower” headland path, iii) a transition to the “upper” headland path via interior lane N , and iv) 17 traveling along the “upper” headland path until Z0 . The examples of Section 4 will further illustrate this consideration. In general, the decision upon when to trigger the return command must trade-off current fill-level f (t) ≥ 0, the shortest path length P (Z(t), Z0 ) from the current location Z(t) to the depot Z0 , and the path length P (Ẑfˆ=0 , Z0 ) from the predicted location Ẑfˆ=0 at which the fill-level is expected to reach zero to the depot Z0 . A return command may be triggered if f (t) is smaller than a small threshold fill-level (above which a return to Z0 is undesired) and P (Z(t), Z0 ) < P (Ẑfˆ=0 , Z0 ). Alternatively, it must be triggered if f (t) = 0. For the prediction of fˆ(t) and Ẑfˆ=0 , experience from past spraying maps may be used. Alternatively, a linear parameter varying model, f (t + ∆t) = f (t) − af (t)∆t can be assumed, where af (t) denotes the time-varying emptying rate parameter (for variable rate spray applications). Then, at every t, a discrete Extended Kalman Filter (Anderson & Moore (1979)) can be employed to provide estimates fˆ(t) and âf (t), based on which Ẑfˆ=0 can be predicted through model forward simulation. Note that this approach enables sensor fusion of possibly multiple measurements (e.g., fill level and nozzles). 3.2. Path Planning based on the Circular Pattern – CIRC The path planning method for partial field coverage labeled CIRC is visualised in Fig. 7. It is referred to as CIRC because of its circular path planning pattern, see Fig. 8. The method is summarised in the following Algorithm: 18 Algorithm 3: CIRC (offline) 1. Normalisation of the coordinate system description: - one rotation, at most two reflection steps. - description in the (ξ, η)-plane. 2. Distinction between four cases: (1) (2) - four combinations of even/odd N and Z0 /Z0 . 3. Path planning according to the method of Fig. 7. 4. Retransformation of coordinates to the (x, y)-plane. Note that, while not in the partial field coverage context, the same pattern is also employed in Bochtis et al. (2013). There, it is referred to as “Skip and Fill”-pattern. Here, the label “CIRC” is preferred to avoid confusion with the fill-level of storage tanks. Proposition 2. Assume a normalised coordinate system description with Z0 = (ξ0 , η0 ) according to Fig. 7, in which it is accounted for compacted area minimisation constraints, and in which the goal is to find the shortest path from position Z(t) = (ξ(t), η(t)) at time t to Z0 . Then, for ξ1 ≤ ξ(t) < ξN −1 , an agricultural vehicle can always traverse at the latest the second next interior lane such that afterwards it can travel along the “upper” headland path in direction of Z0 . For ξ1 ≤ ξ(t) < ξN −1 , either lane n or n + 1 permit such traversal, whereby n is such that ξn−1 ≤ ξ(t) < ξn . For ξ(t) < ξ1 , in general, either lane n = 2 or n = 3 permit such traversal, see Fig. 7. For ξ(t) ≥ ξN −1 , lane n = N or a path through edges eN,2N +2 and e2N +2,2N permits the traversal. 19 (1) Z0 towards Ze (1) (a) Odd N and Z0 . towards Ze (2) Z0 (2) (b) Odd N and Z0 . (1) Z0 towards Ze (1) (c) Even N and Z0 . (2) Z0 towards Ze (2) (d) Even N and Z0 . Fig. 7. CIRC. Distinction between four cases of combinations of odd and even N , and in (1) red, two possible sets of start positions, Z0 ξ1 +ξN 2 (2) and Z0 . The blue dotted lines indicate the -coordinate, respectively. 20 (a) Path planning pattern for CIRC and CIRC? . (b) Concatenation of two path planning patterns. Fig. 8. CIRC and CIRC? . (Top plot) Illustration of a path planning pattern element. The red bar indicates the area that cannot be reached by neither traversal of the path planning pattern element nor traversal of the headland segments in the directions of the arrows. (Bottom plot) Concatenation of two patterns. Importantly, the area indicated by the red bar in the top plot can now be reached. See the green paths for emphasis of the traversal along the “lower” headland path, and a transition via an interior lane to the “upper” headland path. 21 Proof. The proof is by construction and follows directly from the circular path motif in Fig. 8, and the assumption of complying with compacted area minimisation constraints. See also Fig. 7 for visualisation. Remark 3. An implication of CIRC is that once the “upper” headland path is reached (assuming a normalised coordinate system description), the vehicle is constrained to travel along it until reaching Z0 . This is because of the compacted area minimisation constraint and the characteristic pattern according to Fig. 8. This is also in contrast to the ABp-method and implies that no additional invoking of a shortest path algorithm is required. While for ABp the shortest path to Z0 after reaching of the N th lane may, in general, involve traversals of interior lanes and thus switching between “upper” and “lower” headland paths, this is not the case for CIRC. This distinction is the reason that no guarantee can be given about a shorter path length for CIRC. Consider an extremely large bulb-like headland segment located between two interior lanes. While ABp can avoid this by a traversal to the “lower” headland path, the method according to CIRC is enforced to traverse it. Note that such (theoretical) scenarios are seldom in practice. In Section 4, a quantitative comparison for a rectangular field is given as a function of N , the length of interior lanes and the machine operating width. The importance of a normalised coordinate system is stressed in which a start position Z0 is located as shown in Fig. 7. In fact, the path planning method CIRC is tailored to such coordinate system representation. Fig. 9 illustrates two possible scenarios for resuming work after refilling at the depot. In these two scenarios, Z(τ last ) is situated either along a lane with heading direction towards positive or negative η. As indicated, the first 22 Z0 Z(τ last ) (a) First scenario. Z0 Z(τ last ) (b) Second scenario. Fig. 9. CIRC. (Top plot) Resuming work at a position Z(τ last ) located along a lane with heading direction towards positive η. (Bottom plot) Resuming work at a position Z(τ last ) located along a lane with heading direction towards negative η. The path length is much shorter for the first scenario. 23 method is preferable. This is because it avoids the traversal of an entire interior lane without performing actual application work. (1) Remark 4. If the field entrance is located such that Z0 ∈ Z0 with ξ1 < ξ0 ≤ ξ2 , and Z(τ last ) for the resumption of work is located such the ξ(τ last ) > ξ0 , then lane k̃ = 1 must be traversed in order to reach the “lower” headland path, before proceeding to Z(τ last ). Instead, if ξk̃ < ξ0 ≤ ξk̃+1 for k̃ ∈ {2, . . . , b N2 c}, then either lane k̃ or k̃ − 1 must be traversed. All these scenarios imply an initial movement towards negative ξ-direction despite ξ(τ last ) > ξ0 . However, since lane k̃ or k̃ − 1 are the immediate next and the second next lane to Z0 , the corresponding detour with respect to a movement monotonically (2) increasing from ξ0 towards ξ(τ last ) is always very small. For Z0 ∈ Z0 , such a detour does also not occur. 3.3. Path Planning based on the Circular Pattern – CIRC? CIRC? is a variation of CIRC when modifying the method for headland path coverage. As will be shown, CIRC? is the preferred method for both single-run and partial field coverage. First, a remark is made about path planning for single-run field coverage based on the methods according to ABp and CIRC, see also Fig. 5 and 7. Under the assumption of an initial uninterrupted headland path traversal, ABp is preferred over CIRC with respect to path length minimisation. Some headland edges are traversed less frequently. Specifically, for CIRC every second “lower” headland edge is traversed three times: once along the headland path traversal, and two times according to the path planning pattern of Fig. 8. Similarly, also every second “upper” headland edge is traversed three times: once along 24 the headland path, once according to the pattern of Fig. 8, and once after traversal of the N th lane when returning to Z0 . This frequent traversal of the same edges is suboptimal. However, when dropping the assumption of an initial uninterrupted headland path traversal, an optimal field coverage path can be constructed based on the pattern of Fig. 8. Specifically, the headland path is covered as a byproduct of concatenations of the proposed circular pattern. Traversing theses concatenations, every second “upper” headland edge is not yet covered. However, after traversal of the final lane, all these edges can be covered when returning to Z0 along the “upper” headland path. This method is referred to as CIRC? and represents the optimal field coverage method since every edge is covered at most twice. For an even N , the set of edges that are traversed twice is confined to headland segments. For an odd N , the two edges eN,2N +2 and e2N +2,2N are additionally traversed twice. See also Fig. 10 for illustration. Proposition 3. For field shapes with uninterrupted lanes when aligned in a rotated coordinate frame as displayed in Fig. 3, CIRC? provides the singlerun field coverage path plan of minimal total path length. Proof. For field coverage, all edges of the transition graph must be covered at least once. Therefore, for our setting with odd vertices, a transition graph extension is required by duplicating some edges until an Eulerian graph, see Bondy et al. (1976), is generated. This augmentation can be conducted in a minimal path length manner by finding corresponding odd-degree nodepairings. Then, an Eulerian tour on this graph guarantees traversal of all edges. CIRC? provides such Eulerian tour. 25 This discussion is likewise relevant for partial field coverage, since its overall path length is just composed of the field coverage path length plus the summed distances from returning to the depot and when resuming work in the field. The concepts for returning to the depot and resuming work in the field are identical for CIRC and CIRC? . Both are based on the same path planning pattern displayed in Fig. 8. However, they differ in their method of headland path coverage. This implies different on/off switching sequences for the nozzles of an automatic section control (ASC) system, see Batte & Ehsani (2006) and Luck et al. (2010). Algorithms 3 and 4 similarly apply for CIRC? . To summarise, for overall path length minimisation and adoption of the modified method for headland traversal, it is proposed to i) use the method according to CIRC? for generation of the field coverage path plan, and ii) conduct the returns to the depot for refilling as discussed. For the field shapes under consideration, this method is optimal for both single-run field coverage and partial field coverage. 4. Illustrative Examples 4.1. Parametric Example For illustration, a rectangular field shape with an odd number of lanes N (1) and a field entrance according to the Z0 -type is considered. Z0 is located between the first and second interior lane. See Fig. 11, which illustrates one specific scenario discussed further below. The path length differences between ABp and CIRC, which both assume an initial headland path traversal, are reported in Table 1 by ∆DABp,CIRC . All locations along the entire path network for both the returning to Z0 and the resumption of work at 26 Z0 towards Z0 (a) Odd N . Z0 towards Z0 (b) Even N . Fig. 10. CIRC? . There is only a distinction between two cases: odd and even N . For (1) CIRC? , the path planning is identical for Z0 (2) and Z0 as defined in Fig. 7. Thus, for ? CIRC the set of admissible field entrances within the normalised coordinate system is (1) (2) Z0 = Z0 ∪ Z0 . An exemplatory Z0 ∈ Z0 is shown. The field coverage path is displayed as not closed in order to visualise the manner in which the headland path is traversed. The blue dotted lines indicate the ξ1 +ξN 2 -coordinate, respectively. 27 Z0 Z(t) (a) ABp. Z0 Z(t) (b) CIRC. Fig. 11. Visualisation of a scenario for the example of Section 4.1. The planned paths for a return from Z(t) to Z0 according to ABp and CIRC are compared. Location Z(t) is identical for both plots (a) and (b). However, because of the planned paths according ABp and CIRC, the initial heading direction along the initial interior lane is different. 28 Z0 Z(t) (a) ABp. Z0 Z(t) (b) CIRC. Fig. 12. Visualisation of a scenario for the example of Section 4.1. The planned paths for a return from Z(t) to Z0 according to ABp and CIRC are compared. Location Z(t) is identical for both plots (a) and (b). However, because of the planned paths according ABp and CIRC, the initial heading direction along the initial interior lane is different. Z(τ last ) are considered. All locations can be considered since parametric results coincide for locations along the same edges. The nominal distance between “upper” and “lower” headland path and inter-lane spacing (the machine operating width) are denoted H0 and W0 , respectively. Accounting for the turning radius R, H = H0 − 2R + 2C with quarter circle path length C= Rπ , 2 and W = W0 − 2R are defined. The fraction along an interior lane is indicated by p ∈ [0, 1]. For example, in Fig. 11 and 12, p = 0.25. The lane immediately neighboring Z0 is indicated by jl with ξjl ≤ ξ0 < ξjl +1 . Accordingly, lane jp indicates ξjp = ξjl +1 . Furthermore, ql = ξ0 − ξjl and qp = ξjp − ξ0 are defined such that ql + qp = W0 . Several observations can be made from Table 1. First, assuming p < 0.5 29 and 2(1 − p)H − 2R > 0, the largest spread ∆DABp,CIRC is observed for the case of returning from lane j = 2 to Z0 . It results in ∆DABp,CIRC = 2(1 − p)H + 2(N − 3)W0 − 2R, which grows linearly with the number of lanes N . Second, assuming p < 0.5, the smallest spread is achieved along even lanes with j >= 4 when resuming work. It results in ∆DABp,CIRC = −2(1 − p)H − 2W0 − 2ql , which is negative and therefore indicates a shorter path for ABp. The equivalent setting for the resumption of work along an odd lane j ≥ 3 is ∆DABp,CIRC = −2pH − 2ql . Third, this motivates guidelines for optimal operation of CIRC with respect to ABp for path length minimisation. Ideally, ql → 0 which indicates that Z0 is to be located very close to the first interior lane. Here, the limit-operator is denoted by ’→’. Ideally, a returncommand is triggered along a lane with heading towards positive η according to the path plan for CIRC and p → 0. Ideally, the agricultural vehicle permits a small turning radius R and an operating width W0 > R. Then, the only setting for which the path length for CIRC is worse than for ABp is along lane N (the ultimate lane), which results in ∆DABp,CIRC → −2R. This is a very small shortcoming since turning radii of agricultural vehicles typically are small (e.g., R ≈ 6m). In all other settings, i.e., along the remaining entire path network and under the assumptions above, CIRC yields shorter paths for the return to Z0 and the resumption of work in the field. In two different scenarios, Fig. 11 and 12 visualise the planned paths for ABp and CIRC for a return from Z(t) to Z0 . The two scenarios differ in that Z(t) is located along an odd and even lane, respectively. The assumed vehicle locations upon triggering the return command are identical for ABp and CIRC. However, because of the characteristic path planning for both 30 methods, the vehicle is heading towards different directions along the lanes, respectively. The two scenarios are meant to illustrate the following. First, for ABp the disadvantage of always having to travel until the N th lane is made apparent. Second, comparing Fig. 11 and 12, the benefit of triggering the return command for CIRC on a lane with heading direction towards positive η can be observed. The non-working distance, which represents the entire path from Z(t) to Z0 , is much shorter for the former scenario. See also Fig. 9 for the corresponding resumption of application work. Table 2 indicates the path length differences between the methods ABp, CIRC and CIRC? for single-run field coverage. CIRC? differs from CIRC in its method to handle the headland coverage. ABp and CIRC proceed sequentially. Before covering any interior lane, they first cover the headland path entirely. In contrast, CIRC? combines lane and headland coverage simultaneously as outlined in Section 3.3. As Table 2 illustrates, ABp is preferable over CIRC with respect to single-run field coverage path length. On the other hand, CIRC is preferable with respect to path length minimisation for returning to Z0 and resuming of work within the field. Thus, dependent on the frequency of such return and resume states, the overall path length for ABp may still be shorter than for CIRC. This, however, changes drastically when employing the method according to CIRC? . Not only does CIRC? enjoy the benefits of the path planning pattern in Fig. 8 for partial field coverage, it also significantly lowers (linear scaling in N ) the single-run path length, see Table 2. Note that even if the compacted area minimisation constraints are neglected, CIRC? yields consistently shorter path lengths than ABp. 31 Fig. 13. Real-world field from Northern Germany (53◦ 340 30.1300 N, 10◦ 270 38.1400 E). The current working practice, ABp, is emphasised in white. The working width, turning radius and field size are 36m, 7m, and 32.2ha, respectively. Total field coverage path length according to Algorithm 1 is 12092m. 4.2. Real-world Example To also provide a quantitative example, the real-world field displayed in Fig. 13 is considered. For each of ABp, CIRC and CIRC? four experiments are conducted. In the first experiment, path lengths for single-run field coverage are analysed. In the remaining three experiments it is assumed that after every 5000m, 2500m or 1750m of working distance, a return to Z0 is required for refilling before the resumption of work, respectively. The number of field runs and the corresponding total accumulated path length is denoted by ρ ≥ 1 and D(ρ) , respectively. The results are in Fig. 14. Several observations can be made. First, CIRC? performs best throughout all scenarios with respect to total path length minimisation. For single-run field coverage the overall path 32 ABp CIRC CIRC? D(ρ) − D(1) 15,000 10,000 5,000 0 D(ρ) 25,000 20,000 15,000 1 2 3 4 5 6 7 8 ρ Fig. 14. Results for the real-world field displayed in Fig. 13. For each of ABp, CIRC, and CIRC? , four experiments were conducted, respectively. See Section 4.2 for discussion. 33 length is 7.1% shorter than the common ABp-solution. For experiment 4, which requires field coverage in 7 parts, CIRC? even yields a reduction of 27.6% in comparison to ABp. Second, for single-run field coverage, CIRC is 12.7% longer than the ABpbaseline. However, for field coverage in three parts it already outperforms ABp, and for the fourth experiment, a reduction of 10.1% results. Third, the total path length for CIRC? is shorter than the CIRC-equivalent in all scenarios. However, for the third experiment, the excess path length w.r.t. the single-run path length, D(5) −D(1) , is longer for CIRC? , see Fig. 14. This indicates that, for this specific experiment, the points where a return to Z0 is triggered are here located more favourably for CIRC. Fourth, for the last experiment, CIRC requires to divide the field coverage into 8 parts. In contrast, CIRC? and ABp only require 7 field runs. Note that the total path length for CIRC is still 10.1% shorter than then ABpbaseline. Nevertheless, the disadvantage of the initial full headland coverage characteristic for CIRC is exposed. Because of this characteristic, CIRC has the longest total path length for single-run field coverage. As a consequence, for the given experimental setup, CIRC also requires the most field runs. 5. Discussion In contrast to route planning methods that do not follow any predetermined pattern motif and instead freely optimise the field coverage path, the proposed method is pattern-based. The focus on pattern-based path planning was motivated as follows. Freely optimised route plans for non-rectangularly shaped field contours typically result in unintuitive path plans and irreg34 ular sequences of lane traversals. While this does not matter for a fully autonomous robot, it is relevant for the case of vehicles driven by human operators. Namely, a navigation guidance application is required. Some practioners prefer to drive according to well-defined and repeatable patterns, even if some additional (limitedly small) detours may be incurred, rather than following a complex route planning. Furthermore, the acquisition of a routing system may also be costly to a farmer and requires access to his or her field data. In contrast, the proposed pattern-based approach can be applied immediately. Naturally, this does not preclude the possibility of also using the resulting paths as references in a two-layered auto-steering framework with reference tracking as the second layer (Backman et al. (2012), Graf Plessen & Bemporad (2017)). For partial field coverage, the coordination of a mobile depot and an infield operating vehicle becomes relevant. Two options are envisioned. The first option includes model-based a priori planning, where field coverage is preplanned by dividing it into partial field coverages. This method is required for the scheduling of the mobile depot. However, it requires a spray prescription map or a similar measure to predict the partial field coverage. An alternative second option is less model-dependent and therefore more practical. It does not preplan how to partition the entire field coverage. Thus, the mobile depot is called according to need, i.e., once the emptying of the storage tank is foreseeable. This method is particularly useful if support units can be summoned quickly, for example, because of a short traveling distance between a stationary depot and the field entrance. The agricultural vehicle is preferably summoned to Z0 for refilling when it is currently 35 traveling along a lane with heading direction towards positive η, see Fig. 9. Finally, note that for the field shapes considered in this paper, i.e., with uninterrupted lanes when aligned in a rotated coordinate frame, the application of CIRC? results in path length optimal single-run field coverage path plans. This is stressed to underline that the circular path planning pattern element of Fig. 8 is useful not only for partial but also for single-run field coverage. Hence and to summarize, for the considered field shapes CIRC? is the preferred path planning method for both single-run field coverage and field coverage in parts. This was further validated in the parametric as well as the real-world example from Sections 4.1 and 4.2, where CIRC? outperformed the ABp-baseline and CIRC with respect to total path length minimisation in all scenarios. 6. Conclusion Three path planning methods for partial field coverage were discussed: ABp, CIRC and CIRC? . Compacted area minimisation constraints and field contours that permit path planning based on concatenations of patterns were assumed. A normalised coordinate system description was discussed, which was derived from at most three linear transformations, a rotation and at most two coordinate reflections. It was illustrated how the overall field coverage path length can be reduced significantly when covering the headland path as a byproduct of concatenations of the proposed pattern in Fig. 8. It was stressed how this is relevant for both partial and single-run field coverage. Thus, it was emphasised how CIRC? outperforms ABp for single-run field coverage due to its efficient way 36 of covering the headland, thereby minimising non-working distance. At the same time, CIRC? enjoys the favourable properties of the proposed circular pattern for partial field coverage. Thus, for the assumed field shapes, CIRC? is the optimal path planning method for both single-run and partial field coverage and therefore the preferred method. These findings suggest to replace the currently widespread practice of in-field path planning based on the AB pattern by the method according to CIRC? . Subject of future work may include the filling of storage tanks for weight minimisation and avoidance of soil compaction subject to partial field coverage routes. Furthermore, it may be analysed to what extent free-form optimised field coverage routes for arbitrarily shaped fields improve upon the CIRC? method. Finally, the real-time prediction of processes in general, and of the storage tank fill-level dynamics in particular, is an exciting and very challening topic. It is prerequisite for fully cooperative field logistics based on time-scheduling. Acknowledgement The author would like to thank the two anonymous reviewers and the Associate Editor for the constructive comments, which greatly helped to improve this manuscript. References Ahumada, O., & Villalobos, J. R. (2009). Application of planning models in the agri-food supply chain: A review. European Journal of Operational Research, 196 , 1–20. 37 Anderson, B. D., & Moore, J. B. (1979). Optimal filtering. Englewood Cliffs, USA: Prentice Hall , 21 , 22–95. Antille, D. L., Ansorge, D., Dresser, M. L., & Godwin, R. J. (2013). Soil displacement and soil bulk density changes as affected by tire size. Transactions of the ASABE , 56 , 1683–1693. Antille, D. L., Bennett, J. M., & Jensen, T. A. (2016). Soil compaction and controlled traffic considerations in australian cotton-farming systems. Crop and Pasture Science, 67 , 1–28. Backman, J., Oksanen, T., & Visala, A. (2012). Navigation system for agricultural machines: Nonlinear model predictive path tracking. Computers and Electronics in Agriculture, 82 , 32–43. Batte, M. T., & Ehsani, M. R. (2006). The economics of precision guidance with auto-boom control for farmer-owned agricultural sprayers. Computers and Electronics in Agriculture, 53 , 28–44. Bertsekas, D. P., Bertsekas, D. P., Bertsekas, D. P., & Bertsekas, D. P. (1995). Dynamic programming and optimal control volume 1. Athena Scientific Belmont, MA. Blackmore, B., Fountas, S., Gemtos, T., & Griepentrog, H. (2008). A specification for an autonomous crop production mechanization system. In International Symposium on Application of Precision Agriculture for Fruits and Vegetables (pp. 201–216). USA: Orlando. Bochtis, D. (2013). Satellite based technologies as key enablers for sustainable ICT-based agricultural production systems. Procedia Technology, 8 , 4–8. 38 Bochtis, D., Sørensen, C., Green, O., Moshou, D., & Olesen, J. (2010). Effect of controlled traffic on field efficiency. Biosystems Engineering, 106 , 14–25. Bochtis, D., & Sørensen, C. G. (2010). The vehicle routing problem in field logistics: Part ii. Biosystems Engineering, 105 , 180–188. Bochtis, D., & Vougioukas, S. (2008). Minimising the non-working distance travelled by machines operating in a headland field pattern. Biosystems Engineering, 101 , 1–12. Bochtis, D. D. (2010). Machinery management in bio-production systems: planning and scheduling aspects. Agricultural Engineering International: CIGR Journal , 12 , 55–63. Bochtis, D. D., Sørensen, C. G., Busato, P., & Berruto, R. (2013). Benefits from optimal route planning based on B-patterns. Biosystems Engineering, 115 , 389–395. Bochtis, D. D., Sørensen, C. G., & Green, O. (2012). A DSS for planning of soil-sensitive field operations. Decision Support Systems, 53 , 66–75. Bondy, J. A., Murty, U. S. R. et al. (1976). Graph theory with applications volume 290. Citeseer. Conesa-Muñoz, J., Bengochea-Guevara, J. M., Andujar, D., & Ribeiro, A. (2016a). Route planning for agricultural tasks: A general approach for fleets of autonomous vehicles in site-specific herbicide applications. Computers and Electronics in Agriculture, 127 , 204–220. 39 Conesa-Muñoz, J., Pajares, G., & Ribeiro, A. (2016b). Mix-opt: A new route operator for optimal coverage path planning for a fleet in an agricultural environment. Expert Systems with Applications, 54 , 364–378. Dain-Owens, A., Kibblewhite, M., Hann, M., & Godwin, R. (2013). The risk of harm to archaeological artefacts in soil from dynamic subsurface pressures generated by agricultural operations: Experimental studies. Archaeometry, 55 , 1175–1186. Day, W. (2011). Engineering advances for input reduction and systems management to meet the challenges of global food and farming futures. The Journal of Agricultural Science, 149 , 55–61. Graf Plessen, M., & Bemporad, A. (2016). Shortest path computations under trajectory constraints for ground vehicles within agricultural fields. In Proc. IEEE Conference on Intelligent Transportation Systems (ITSC) (pp. 1733–1738). Brazil: Rio de Janeiro. Graf Plessen, M., & Bemporad, A. (2017). Reference trajectory planning under constraints and path tracking using linear time-varying model predictive control for agricultural machines. Biosystems Engineering, 153 , 28–41. Hamza, M., & Anderson, W. (2005). Soil compaction in cropping systems: a review of the nature, causes and possible solutions. Soil and Tillage Research, 82 , 121–145. Havlin, J., Kissel, D., Maddux, L., Claassen, M., & Long, J. (1990). Crop 40 rotation and tillage effects on soil organic carbon and nitrogen. Soil Science Society of America Journal , 54 , 448–452. Jensen, M. A. F., Bochtis, D., Sørensen, C. G., Blas, M. R., & Lykkegaard, K. L. (2012). In-field and inter-field path planning for agricultural transport units. Computers & Industrial Engineering, 63 , 1054–1061. Jensen, M. F., Bochtis, D., & Sørensen, C. G. (2015). Coverage planning for capacitated field operations, part ii: Optimisation. Biosystems Engineering, 139 , 149–164. Jørgensen, M. H. (2012). Agricultural field machinery for the future–from an engineering perspective. Agronomy Research, 10 , 109–113. Kutzbach, H. D. (2000). Trends in power and machinery. Journal of Agricultural Engineering Research, 76 , 237–247. Luck, J., Pitla, S., Shearer, S., Mueller, T., Dillon, C., Fulton, J., & Higgins, S. (2010). Potential for pesticide and nutrient savings via map-based automatic boom section control of spray nozzles. Computers and Electronics in Agriculture, 70 , 19–26. Palmer, R., Wild, D., & Runtz, K. (2003). Improving the efficiency of field operations. Biosystems Engineering, 84 , 283–288. Raper, R. (2005). Agricultural traffic impacts on soil. Journal of Terramechanics, 42 , 259–280. Gonzalez-de Santos, P., Ribeiro, A., Fernandez-Quintanilla, C., LopezGranados, F., Brandstoetter, M., Tomic, S., Pedrazzi, S., Peruzzi, A., Pa41 jares, G., Kaplanis, G. et al. (2016). Fleets of robots for environmentallysafe pest control in agriculture. Precision Agriculture, (pp. 1–41). Seyyedhasani, H., & Dvorak, J. S. (2017). Using the vehicle routing problem to reduce field completion times with multiple machines. Computers and Electronics in Agriculture, 134 , 142–150. Sørensen, C. G., & Bochtis, D. D. (2010). Conceptual model of fleet management in agriculture. Biosystems Engineering, 105 , 41–50. Vougioukas, S. G. (2012). A distributed control framework for motion coordination of teams of autonomous agricultural vehicles. Biosystems engineering, 113 , 284–297. Zhou, K., Jensen, A. L., Bochtis, D. D., & Sørensen, C. G. (2015). Quantifying the benefits of alternative fieldwork patterns in a potato cultivation system. Computers and Electronics in Agriculture, 119 , 228–240. 42 Headland path from Z(t) ∈ ej,k to Z0 ∆DABp,CIRC j ∈ {0, 1, N + 1, 2N + 1} 2(N − 3)W0 1 < j < N and j even 2(N − j − 1)W0 1 < j < N and j odd 2(N − j − 2)W0 otherwise 0 from Z0 to Z(τ last ) ∈ ej,k ∆DABp,CIRC 3 ≤ j ≤ N, j = 2N + 2 −2ql j = 2N + 1 0 j ≥ N + 2 and j even −2ql + (4N − 2j)W0 − 2R j ≥ N + 2 and j odd −2ql + (4N − 2j − 2)W0 − 2R otherwise 0 Interior lane Tab. 1. from Z(t) ∈ ej,N +j to Z0 ∆DABp,CIRC lane j = 1 2(N − 3)W0 even lane j ≥ 2 2(1 − p)H + 2(N − j − 1)W0 − 2R odd lane j ≥ 3 2pH + 2(N − j)W0 − 2R from Z0 to Z(τ last ) ∈ ej,N +j ∆DABp,CIRC lane j = 1 0 lane j = 2 −2(1 − p)H − 2W0 + 2R even lane j ≥ 4 −2(1 − p)H − 2W0 − 2ql odd lane j ≥ 3 −2pH − 2ql Path length differences for the example of Section 4.1 with odd N and a field entrance Z0 located between the first and second interior lane. For illustration, see also Fig. 11. It is distinguished between edges along the headland path and edges representing interior lanes. For the former case, index k is determined by the headland path and notation of Fig. 4. For the latter case, the heading direction of a vehicle along an edge ej,N +j varies for ABp and CIRC according to their field coverage path plans, see Fig. 5 43 and 7. The results for all edges of the entire path network are reported. Tab. 2. Method m ∆DABp,m CIRC −(N − 1)W0 CIRC? (N − 3)W0 Single-run field coverage path lengths for the illustrative example in Section 4.1 with odd N . The method according to CIRC has a path length that is proportional to the total number of lanes N longer than ABp. In contrast, the method according to CIRC? is similarly shorter and also scaling linearly with N . CIRC? and CIRC are both based on the same path planning pattern. However, their method of covering the headland path differs. 44
3cs.SY
Multi-way sparsest cut problem on trees with a control on the number of parts and outliers arXiv:1702.05570v1 [cs.DS] 18 Feb 2017 Ramin Javadi∗† Saleh Ashkboos‡ Abstract Given a graph, the sparsest cut problem asks for a subset of vertices whose edge expansion (the normalized cut given by the subset) is minimized. In this paper, we study a generalization of this problem seeking for k disjoint subsets of vertices (clusters) whose all edge expansions are small and furthermore, the number of vertices remained in the exterior of the subsets (outliers) is also small. We prove that although this problem is N P −hard for trees, it can be solved in polynomial time for all weighted trees, provided that we restrict the search space to subsets which induce connected subgraphs. The proposed algorithm is based on dynamic programming and runs in the worst case in O(k 2 n3 ), when n is the number of vertices and k is the number of clusters. It also runs in linear time when the number of clusters and the number of outliers is bounded by a constant. Key words: sparsest cut problem, isoperimetric number, Cheeger constant, normalized cut, graph partitioning, computational complexity, weighted trees. Subject classification: 05C85, 68Q25, 68R10. 1 Introduction Data clustering is definitely among the main topics of modern computer science with an indispensable role in data mining, image and signal processing, network and data analysis, and data summarization (e.g. see [13] and references therein). Considering the current status of data science, one may name some fundamental challenges in this field, among many others, as follows: • Clustering huge and usually high-dimensional data. • Clustering in presence of outliers and anomalies. • Clustering non-geometric (usually non-Euclidean) data. • Clustering with no prior information about the number of clusters or other features of data (as model of the source etc.). ∗ Corresponding author, Department of Mathematical Sciences, Isfahan University of Technology, P.O. Box: 84156-83111, Isfahan, Iran. School of Mathematics, Institute for Research in Fundamental Sciences (IPM), P.O. Box: 19395-5746, Tehran, Iran. Email Address: [email protected]. † This research was in part supported by a grant from IPM (No. ...). ‡ Department of Computer Engineering, Isfahan University of Technology, P.O. Box: 84156-83111, Isfahan, Iran. Email Address: [email protected]. 1 Needless to say, in each case, efficiency and time-complexity of the proposed algorithms are global parameters with a decisive role in applicability. The subject of this article falls into the setup of clustering in an unsupervised and static graphbased data presentation. It is instructive to note that the graph-based approach essentially provides data presentation in a very general (not necessarily Euclidean) setting in terms of similarity kernels. In this respect, one of the main well-studied criteria is the “sparsest cut problem” which apart from tremendous real-world applications in the context of spectral clustering (see e.g. [19, 21]), has played a crucial role in the development of many subjects in theoretical computer science (see e.g. [7, 22]). Our main objective in this article is to improve this approach, which is essentially based on solving a suitable subpartitioning problem on a corresponding minimum spanning tree, by providing an algorithm that not only gives rise to a fast clustering procedure, but also provides good control on determining the number of clusters and outliers. The procedure is based on a dynamic programming which runs in the worst case in O(k2 n3 ), where n is the data size and k is the number of clusters. Also, the algorithm runs in linear time in terms of the data size when the number of clusters k and the upper bound on the number of outliers are both constant (which is the case in the most prevalent applications). To the best of our knowledge, the partitioning problem solved by the proposed algorithm (Algorithm 3) is among the most challenging problems in this literature which is efficiently solvable, while we will also dwell on some important consequences in what follows. 1.1 A formal setup and the main result Partitioning problems are essentially as old as graph theory itself, with wide applications in science and technology. In particular, one may refer to the unnormalized partitioning problems that usually are considered as different versions of minimum cut problems as well as the normalized versions which are more plausible in real applications, however, are much harder to resolve. One of the main problems in the category of normalized cut criteria is the sparsest cut problem which is defined as follows. Given a graph G, the sparsest cut problem asks for a cut (a subset of vertices) which has the minimum edge expansion, i.e.   |∂S| |∂S| , , (1) φ(G) := min max |S| |S| S(V (G),S6=∅ where S := V (G) \ S and ∂S is the set of all edges with exactly one end in S. The sparsest cut problem is known to be an N P −hard problem on general graphs [18, 21]. Efforts to find an efficient algorithm for a good approximation of this problem have triggered off the development of many subfields of computer science and have had a significant influence on algorithm design and complexity theory. It is amazing to see that recent advances in computer science have given rise to a culmination of ideas not only from the classical graph theoretic point of view but also from the more geometric point of view discussed in the theory of Riemannian manifolds and stochastic processes [23]. Up to now, the best known approximation√result for the sparsest cut problem is due to Arora, Rao, and Vazirani [3] which gives an O( log n) approximation algorithm. It is also worth noting that the invariant defined in (1) has an intimate connection with the second eigenvalue of the associated Laplacian operator. In fact, relaxation of the minimization problem in (1) to the Euclidean norm for real functions (i.e. changing the edge expansion to the Euclidean 2-norm of the gradient of real functions which is the energy representable by the Laplacian operator) gives rise to an eigenvalue problem which is efficiently solvable, while estimating the approximation ratio of this relaxation has led to some fundamental contributions 2 (e.g. see [1,2]). These relations, known as Cheeger’s inequalities, also exert considerable influence over constructing the expander graphs as well as the study of the mixing time of Markov chains (see e.g. [14, 15]). In general, although the motivating problems in these fields of study are usually different, the synergistic effect of methods and techniques have flourished into one of the most active and productive topics in mathematics and computer science. Recently, some generalizations of the sparsest cut problem have been studied in the literature. Here, we study a generalization which extends two-way partitioning into k−way connected subpartitioning and allows some vertices to lie outside the parts. To formulate the problem precisely, let us first fix our notation and terminology. We assume that the data is given as a simple and finite weighted graph G = (V, E, ω, c) in which ω : V → Q+ and c : E → Q+ are the vertex and edge weight functions, respectively. Note that in the literature close to applications the function c is sometimes referred to as the kernel or the similarity, while from a geometric point of view the graph can also be considered as a discrete metric-measure space, where the distance function is usually chosen to be proportional to some inverse function of c. In this setting, by an unweighted graph we mean a graph in which all the vertex and edge weights are equal to 1. Given a graph G = (V, E, ω, c) and a subset of vertices S ⊆ V , the edge exapnsion or the conductance of S, is defined as c(∂S) , φG (S) := ω(S) where, ω(S) := X ω(u), c(∂S) := u∈S X c(e). e∈E(S,S) From a geometric point of view, the conductance can be interpreted as a normalized norm of a gradient function or a normalized energy (e.g. see [5,6] for more on the geometric interpretations). The set Dk (V ) is defined to be the set of all k-subpartitions {A1 , . . . , Ak } := {Ai }k1 of V , in which Ai ’s are nonempty disjoint subsets of V . The residue of a subpartition {A1 , . . . , Ak } is defined to be the set R := V − ∪ki=1 Ai . The set of all k-partitions of V , which is denoted by Pk (V ), is the subclass of Dk (V ) containing all k-subpartitions {Ai }k1 for which ∪ki=1 Ai = V (i.e. R = ∅). A subpartition (or a partition in particular) is said to be connected if the subgraph induced on each of its parts is a connected subgraph of G. A generalization of the sparsest cut problem can be formulated as follows. Definition 1. Given a weighted graph G = (V, E, ω, c) and a positive integer k, 1 ≤ k ≤ |V |, the kth isoperimetric number is defined as, ιk (G) := min max φG (Ai ). {Ai }k1 ∈Dk (V ) 1≤i≤k Furthermore, considering the partitions, the kth minimum normalized cut number is defined as, ι̃k (G) := min max φG (Ai ). {Ai }k1 ∈Pk (V ) 1≤i≤k A vertex v ∈ V is called a k-outlier, if there exists a minimizing subpartition achieving ιk (G), while v lies in its residue. It is well-known that ι2 = ι̃2 (see [8]) and the common value is usually called the Cheeger constant or edge expansion in the literature. N In this regard, Louis et al. in [17] provide a polynomial time approximation algorithm which outputs √ a (1 − ǫ)k-partition of the vertex set such that each piece has expansion at most Oǫ ( log n log k) times ι̃k (G) (for every positive number ǫ). Also, in [16], higher-order Cheeger’s 3 inequalities have been proved which relate the above parameters to the eigenvalues of the associated Laplacian Matrix (see also [8, 10]). Prior to formulating our problem, let us discuss some facts. First, one may note that as an imprecise rule of thumb, changing the cost function of a partitioning problem, from the normalized form to the unnormalized form, from partitions to subpartitions, or from the mean (i.e. 1-norm) to the max (i.e. ∞-norm) generally makes the problem more tractable in the sense that finding more efficient algorithms to solve the problem become more probable. One of our major observations in this article is the fact that the restriction of the search space to “connected” subpartitions reduces the complexity of the problem too. In particular, this distinction is much comprehensible when the graph is a tree where the restriction on subpartitions to be connected reduces the complexity of the problem from N P −hard to polynomial time. Also, note that this restriction is to the best of our advantage in the sense that a cluster is more expected to be represented by a connected subgraph than a disconnected one (based on intra-similarity of the objects within a cluster). Hence, as far as clustering is concerned, this can be considered as an acceptable assumption. As a matter of fact, in what follows, we show that such a change to the better will give rise to an efficient algorithm for clustering with a control on the number of parts and outliers. We denote the main problem, i.e. the multi-way sparsest cut problem with a control on the residue number, by the acronym “MSC problem” which is defined as follows. MSC Problem. INSTANCE: A weighted graph G = (V, E, ω, c), nonnegative integers κ ∈ Z+ and λ ∈ Z+ and a positive rational number ξ ∈ Q+ . QUERY: Does there exist a κ-subpartition of V such as {Ai }κ1 ∈ Dκ (V ) such that max {φG (Ai )} ≤ ξ and its residue number is at most λ, i.e. |V \ 1≤i≤κ ∪κi=1 Ai | ≤ λ? The MSC problem is known to be a hard problem even when the graph is of its simplest form, i.e. a tree. When the graph G is a tree, it is proved in [9] that MSC problem is N P −complete even when the tree is unweighted and λ is constant (e.g. λ = 0). Nonetheless, it is shown there that the problem is solvable in linear time for weighted trees when we drop the restriction on the residue number (i.e. λ = |V |). An improvement of this result has effectively been applied to real clustering problems for large data-sets [11]. The main contribution of this article (Algorithm 3) is to show that although MSC problem is N P −complete for trees, it becomes tractable when the search space is restricted to connected subpartitions. In other words, the following problem abbreviated by CMSC can be solved in polynomial time for weighted trees. CMSC Problem. INSTANCE: A weighted graph G = (V, E, ω, c), nonnegative integers κ ∈ Z+ and λ ∈ Z+ and a positive rational number ξ ∈ Q+ . QUERY: Does there exist a connected κ-subpartition of V such as {Ai }κ1 ∈ Dκ (V ) such that max {φG (Ai )} ≤ ξ and its residue number is at most λ, i.e. 1≤i≤κ |V \ ∪κi=1 Ai | ≤ λ? This result along with the fact that the minimum spanning tree of a geometric metric-measure space inherits a large part of the geometry of the space, can lead to a good approximation for MSC problem for general graphs. This can justify the importance of the problem on weighted trees when applications are concerned. Let us consider some consequences of this result. Firstly, note that given a weighted tree T and integers κ and λ, finding the minimum number ξ for which there exists a connected κ−subpartition with the residue number at most λ 4 and max1≤i≤κ {φG (Ai )} ≤ ξ (as well as finding the minimizing subpartition) can be done in polynomial time by applying our algorithm iteratively along with a simple binary search. Secondly, given a weighted tree T and numbers ξ, λ (the worst edge expansion of the clusters), we can obtain a number kmax (T, ξ), denoting the maximum number of parts for which the answer to CMSC problem is positive. This by itself is an important piece of information when one considers the large existing literature discussing how to determine the number of clusters for a clustering algorithm (e.g. see [20] for k-means). Thirdly, from another point of view, CMSC problem can be considered as a problem of outlierrobust clustering where a solution will provide information on the number of outliers. It is well-known that detection of outliers and anomalies in data-sets are among the most challenging problems in the field, not just because of the hardness of the problem itself, but since the concepts themselves are quite fuzzy and depend on many different parameters as scaling or distribution of the source (e.g. see [4,12] for the background). These facts, and in particular, lack of a universal sound and precise definition, is among the first obstacles when one is dealing with these kinds of problems. In [11] some evidence has been discussed that how the data remained in the exterior of the clusters in MSC problem can be justified to be actual outliers in some sense. Finally, our method can be extended to handle some more general semi-supervised settings where a number of training samples are given by the user which are forced or forbidden to lie in outliers (see Section 4). The organization of forthcoming sections is as follows. In Section 2, we give required definitions and notations as well as the lemmas which justify our algorithm. In Section 3, we present the main algorithm and explain how it can find the optimal subpartition. We also compute the time complexity of our algorithm. Finally, in Section 4, we discuss some extensions which handle more realistic models. 2 Preliminaries Let T be a rooted tree with root r. There is a natural partial order induced through the root on the vertices and edges of T defined as u ≤ v for two vertices u and v whenever there is a path P (r, v, u) in T starting from r and ending at u which contains v. Similarly, e ≤ e′ for two edges e and e′ whenever there is a path P (r, e′ , e) in T starting from r and containing e and e′ such that e′ is closer than e to r on P . In this setting, note that for any u 6= r there exists a unique minimal vertex v, with v ≥ u and an edge eu := uv, where v and eu are called the parent vertex and the parent edge of u, respectively (and also u is called the child of v). Also, for a given edge e = uv with u ≤ v we may refer to e− = u and e+ = v, intermittently. For some technical reasons, we add one new vertex r ′ to T and connect it to r and define the parent edge of r, er , as the edge rr ′ . Also, we set ω(r ′ ) = c(er ) = 0. If F is a subset of edges of T , then M (F ) is the set of maximal elements of F with respect to the natural partial order of T . Given a vertex u with the parent edge eu , the subtree Tu = Teu refers to the subtree induced on the set {v ∈ V (T ) : v ≤ u}. Therefore, Tr = Ter = T . Let T = (V, E, ω, c) be a weighted tree and ξ be a fixed positive number. For every integer 0 ≤ k ≤ |V |, define Ck (T ) to be the class of all k-subpartitions A = {Ai }k1 such that for each 1 ≤ i ≤ k, Ai ⊆ V (T ) and the induced subgraph of T on Ai is connected (i.e. Ai is a subtree of T ). Also, given a subpartition A = {Ai }k1 ∈ Ck (T ), its residue set is defined as R(A, T ) := V (T ) \ ∪ki=1 Ai . We also define, φT (Ai ) := c(∂Ai ) , φT (A) := max φT (Ai ) and ιC k (T ) := min φT (A). 1≤i≤k ω(Ai ) A∈Ck (T ) In the following we describe the idea that our algorithm is based on and also prove the correctness 5 of the algorithm. First, note that since we are looking for subsets with small edge expansion, when we cut an edge e, the subset containing e+ sustains a loss in its edge expansion. The cause of this deficiency is that the numerator of the edge expansion is added by c(e) and the denominator is subtracted by ω(Te ). With this intuition, for every edge e ∈ E, define εξ (e) := ξ ω(Te ) + c(e). (2) Now, let κ and λ be two nonnegative integers and for every integers 1 ≤ k ≤ κ, 0 ≤ l ≤ λ and vertex u ∈ V (T ), define Cξ (u, k, l) to be the set of all k-subpartitions A = {Ai }k1 in Ck (Tu ) such that u ∈ A1 and |R(A, Tu )| ≤ l and for each 2 ≤ i ≤ k, we have φT (Ai ) ≤ ξ. For each such subpartition A, let FA := ∂A1 \ {eu }. Note that any pair of edges in FA are incomparable and define, X γξ (A) := εξ (e). e∈FA We will shortly see that minimizing the edge expansion φT (A1 ), in some sense, is equivalent to minimizing γξ (A) (see (6)). Thus, define, Γξ (u, k, l) := min A∈Cξ (u,k,l) γξ (A). (3) On the other hand, for every integers 0 ≤ k ≤ κ and 0 ≤ l ≤ λ and vertex u ∈ V (T ), define µξ (u, k, l) to be equal to 1 if there exists a connected k-subpartition A = {Ai }k1 ∈ Ck (Tu ) such that φT (A) ≤ ξ and |R(A, Tu )| ≤ l and it is equal to 0, otherwise. Note that, although Ai ’s are subsets of V (Tu ), φT (Ai ) is computed in the whole tree T . Also, note that for every vertex u ∈ V (T ) and integer l, we have ( 1 if |V (Tu )| ≤ l, µξ (u, 0, l) = 0 o.w. In fact, our main goal is to compute the parameter µξ (r, κ, λ), since evidently the answer to CMSC problem is yes if and only if µξ (r, κ, λ) = 1. In the sequel, we are going to show that the parameters Γξ (u, k, l) and µξ (u, k, l) can be computed recursively in a breath-first scanning of vertices towards the root. First, in the following, we explain how one can compute µξ (u, k, l) recursively in terms of the values Γξ (u, k, l), 1 ≤ k ≤ κ, 0 ≤ l ≤ λ. For this, let ξ, κ, λ be fixed and given a vertex u, let (u1 , . . . , ud ) be an ordering of all of its children. Now, for every integers 0 ≤ k ≤ κ, 0 ≤ l ≤ λ, define U (1, k, l) := µξ (u1 , k, l), (4) and for every 2 ≤ i ≤ d, define  ′ ′ 1 if there exist 0 ≤ k ≤ k and 0 ≤ l ≤ l − 1 such that U (i − 1, k′ , l′ ) = µξ (ui , k − k′ , l − 1 − l′ ) = 1, U (i, k, l) :=  0 o.w. (5) In the following lemma, we show how one can use the recursion in (5) to compute the function µξ . Lemma 2. Let u be a vertex in a rooted tree T , ξ ≥ 0 be a number and λ ≥ 0, κ ≥ 1 be two integers. Also, let u1 , . . . , ud be the children of u in T . For every integers 0 ≤ k ≤ κ, 0 ≤ l ≤ λ, µξ (u, k, l) = 1 if and only if either Γξ (u, k, l) ≤ ξ ω(Tu ) − c(eu ), or U (d, k, l) = 1. 6 Proof . Suppose that µξ (u, k, l) = 1 and let A = {Ai }k1 ∈ Ck (Tu ) be a connected subpartition where R(A, Tu ) ≤ l and φT (A) ≤ ξ. First, assume that u ∈ R(A, Tu ). Thus, A itself can be partitioned into d connected subpartitions A1 , . . . , Ad such that Ai ∈ Cki (Tui ), for some integers ki , where k1 + · · · + kd = k. Also, let li = |R(Ai , Tui )|. Therefore, by definition µξ (ui , ki , li ) = 1 and l1 + · · · + ld = |R(A, Tu ) \ {u}| ≤ l − 1. Thus, again by definition U (d, k, l) = 1. Next, suppose that u 6∈ R(A, Tu ) and so, without loss of generality, assume that u ∈ A1 . Then,   X X φT (A1 ) ≤ ξ ⇔ c(∂A1 ) ≤ ξ ω(A1 ) ⇔ c(eu ) + c(e) ≤ ξ ω(Tu ) − ω(Te ) (6) e∈F e∈F A A ⇔ γξ (A) ≤ ξ ω(Tu ) − c(eu ). Therefore, Γξ (u, k, l) ≤ ξ ω(Tu ) − c(eu ). This implies that if µξ (u, k, l) = 1, then either Γξ (u, k, l) ≤ ξ ω(Tu ) − c(eu ), or U (d, k, l) = 1. Now, Pd suppose that PdU (d, k, l) = 1. Then, there exist integers l1 , . . . , ld and k1 , . . . , kd such that i=1 li = l − 1, i=1 ki = k and µξ (ui , ki , li ) = 1, for all 1 ≤ i ≤ d. Thus, for each 1 ≤ i ≤ d, there exists Ai ∈ Cki (Tui ) such that R(Ai , Tui ) ≤ li and φT (Ai ) ≤ ξ. Define A = ∪di=1 Ai . Thus, A ∈ Ck (Tu ) and |R(A, Tu )| ≤ l. Hence, µξ (u, k, l) = 1. Finally, suppose that Γξ (u, k, l) ≤ ξ ω(Tu ) − c(eu ). Also, let A ∈ Cξ (u, k, l) be a minimizer with γξ (A) = Γξ (u, k, l). Then, by definition, for every 2 ≤ i ≤ k, φT (Ai ) ≤ ξ and |R(A, Tu )| ≤ l and  by (6), φT (A1 ) ≤ ξ. Hence, µξ (u, k, l) = 1. This completes the proof. As we see in Lemma 2, in order to obtain the value of µξ (u, k, l), we require to have the value of Γξ (u, k, l). In the next step, we show that given ξ, κ and λ, how one may compute Γξ (u, k, l) efficiently for all vertices u and integers 1 ≤ k ≤ κ, 0 ≤ l ≤ λ. For this, let ξ, κ, λ be fixed and given a vertex u, let (u1 , . . . , ud ) be an ordering of all of its children. Now, for every integers 1 ≤ k ≤ κ, 0 ≤ l ≤ λ and 1 ≤ i ≤ d, define ( min{εξ (uui ), Γξ (ui , k, l)} if µξ (ui , k − 1, l) = 1, Xξ (i, k, l) := (7) Γξ (ui , k, l) o.w. Also, define Yξ (1, k, l) := Xξ (1, k, l), (8) Yξ (i, k, l) := min{Yξ (i − 1, k ′ , l′ ) + Xξ (i, k + 1 − k′ , l − l′ ) : 1 ≤ k′ ≤ k, 0 ≤ l′ ≤ l}. (9) and for every 2 ≤ i ≤ d, define The following lemma shows how to compute the function Γξ using recursion (9). Lemma 3. Let T be a rooted tree, ξ ≥ 0 be a number and λ ≥ 0, κ ≥ 1 be two integers. Then, for every vertex u ∈ V (T ) with d children (u1 , . . . , ud ) and every integers 1 ≤ k ≤ κ and 0 ≤ l ≤ λ, we have Γξ (u, k, l) = Yξ (d, k, l). (10) Proof . We prove the lemma by induction on the number d. Let A = {Ai }k1 ∈ Cξ (u, k, l) be a k-subpartition. First, suppose that d = 1. If uu1 ∈ FA , then γξ (A) = εξ (uu1 ) and A2 , . . . , Ak ⊆ V (Tu1 ), so µξ (u1 , k − 1, l) = 1. Also, if uu1 6∈ FA , then u1 ∈ A1 and γξ (A) ≥ Γξ (u1 , k, l). Therefore, Γξ (u, k, l) = Xξ (1, k, l) = Yξ (1, k, l) as in (7) and (8). ′ Now, suppose that d ≥ 2. Let T ′ := T \ Tud and T ′′ := T \ (∪d−1 i=1 Tui ) and Γ(k, l), Γ (k, l) ′′ ′ ′′ and Γ (k, l) be the values of Γξ (u, k, l) for the trees T , T and T , respectively. Also, let l′ = |R(A, T ) ∩ V (T ′ )|, l′′ = l − l′ and let k′ (resp. k′′ ) be the number of sets Ai which intersect 7 V (T ′ ) (resp. V (T ′′ )). Then, evidently we have k′ + k′′ = k + 1 (note that A1 intersects both V (T ′ ) and V (T ′′ )) and γξ (A) ≥ Γ′ (k′ , l′ ) + Γ′′ (k′′ , l′′ ). Therefore, Γ(k, l) = min{Γ′ (k′ , l′ ) + Γ′′ (k′′ , l′′ ) : k′ + k′′ = k + 1, l′ + l′′ = l}. On the other hand, by the induction hypothesis, we have Γ′ (k′ , l′ ) = Yξ (d − 1, k′ , l′ ) and  Γ′′ (k′′ , l′′ ) = Xξ (d, k′′ , l′′ ). Hence, by (9), we have Γ(k, l) = Yξ (d, k, l) and we are done. 3 The algorithm In this section, using Lemmas 2 and 3, we provide an algorithm to solve the CMSC problem for all weighted trees. The cores of the algorithm are two dynamic programmings. The final solution to the problem is given in Algorithm 3 which scans the vertices in a BFS order towards the root r and computes recursively the values of Γξ (u, k, l) and µξ (u, k, l), for 1 ≤ k ≤ κ and 0 ≤ l ≤ λ. The structure of Algorithm 3 which deploys Algorithms 1 and 2 as two subroutines, is as follows. First, for all leaves u (vertices with no children), it computes the values of Γξ (u, k, l) and µξ (u, k, l) (Lines 8-13 in Algorithm 3). Next, for a vertex u, with children (u1 , . . . , ud ), according to Lemma 3, it applies a dynamic programming (Algorithm 1) based on the recursion given in Equations (8) and (9), to obtain the value of Γξ (u, k, l), assuming the values of µξ (ui , k, l) and Γξ (ui , k, l) are given. Finally, according to Lemma 2, it applies another dynamic programming (Algorithm 2) based on the recursion given in (5) to obtain the value of µξ (u, k, l), assuming the values of Γξ (u, k, l) and µξ (ui , k, l) are given. The backtracking ends up outputting the value of µξ (r, κ, λ) which is equal to 1 if and only if there exists a connected κ-subpartition A with φT (A) ≤ ξ and |R(A, T )| ≤ λ. This completes the solution. 3.1 Time complexity The time complexity of the provided algorithms can be computed as follows. In Algorithm 1, Lines 2-12 can be done in O(d(λ + 1)κ). Also, Lines 14-25 can be performed in O(d(λ + 1)2 κ2 ). In Algorithm 2, Lines 2-9 run in O((λ + 1)κ) and Lines 11-26 run in O(d(λ + 1)2 κ2 ). Hence, the runtime of Algorithm 3 is in O((λ + 1)2 κ2 n). Since in real applications, the values of κ and λ are mostly much smaller than n, we can assume that the algorithm runs in linear time with respect to the number of nodes. 3.2 Constructing the optimal subpartition Now, we show that during the execution of Algorithm 3, how one can construct a subpartition A ∈ Cκ (T ) with φT (A) ≤ ξ and |R(A, T )| ≤ λ (if there exists). Let ξ, κ and λ be fixed and for every vertex u ∈ V (T ) and 1 ≤ k ≤ κ and 0 ≤ l ≤ λ, if µξ (u, k, l) = 1, then let Aµ = Aµ (u, k, l) be a k−subpartition in Ck (Tu ) such that φT (Aµ ) ≤ ξ and |R(Aµ , Tu )| ≤ l. Also, if µξ (u, k, l) = 0, let Aµ = Aµ (u, k, l) := ∅. Then, the subpartition Aµ (r, κ, λ) is what we are looking for. Also, let AΓ = AΓ (u, k, l) be a subpartition in Cξ (u, k, l) which minimizes (3). Now, let u be a vertex with children (u1 , . . . , ud ). First, according to Algorithm 2 and assuming that we have all the subpartitions AΓ (u, k, l) and Aµ (ui , k, l), we explain how to obtain Aµ (u, k, l). For this, throughout the execution of Algorithm 2, in Line 5, if Γξ (u, k, l) ≤ ξω(Tu ) − c(eu ), then set Aµ (u, k, l) := AΓ (u, k, l), otherwise set Aµ (u, k, l) := ∅. Also, in Line 10, if µξ (u1 , k, l) = 1, then set U (k, l) := Aµ (u1 , k, l) and in Line 18, if U (i − 1, k′ , l′ ) = µξ (ui , k − k′ , l − 1 − l′ ) = 1, then set U (k, l) := U (k′ , l′ ) ∪ Aµ (ui , k − k′ , l − 1 − l′ ). Finally, in Line 27, if U (d, k, l) = 1, then set Aµ (u, k, l) := U (k, l). 8 Algorithm 1 Input: A weighted tree (T, ω, c), a rational number ξ and integers κ ≥ 1 and λ ≥ 0. A vertex u ∈ V (T ) with children (u1 , . . . , ud ). The numbers µξ (ui , k, l) and Γξ (ui , k, l), for all 1 ≤ i ≤ d, 1 ≤ k ≤ κ and 0 ≤ l ≤ λ. Output: The numbers Γξ (u, k, l) for all 1 ≤ k ≤ κ and 0 ≤ l ≤ λ. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: Set εi := ξω(Tui ) + c(uui ), ∀ 1 ≤ i ≤ d; for i = 1 : d do for l = 0 : λ do for k = 1 : κ do if µξ (ui , k − 1, l) = 1 and εi ≤ Γξ (ui , k, l) then X(i, k, l) := εi ; else X(i, k, l) := Γξ (ui , k, l); end if end for end for end for Set Y (1, k, l) := X(1, k, l), ∀ 1 ≤ k ≤ κ, 0 ≤ l ≤ λ; for i = 2 : d do for l = 0 : λ do for k = 1 : κ do Y (i, k, l) := +∞; for l′ = 0 : l do for k′ = 1 : k do Y (i, k, l) := min{Y (i, k, l), Y (i − 1, k ′ , l′ ) + X(i, k + 1 − k′ , l − l′ )}; end for end for end for end for end for Set Γξ (u, k, l) := Y (d, k, l), ∀ 1 ≤ k ≤ κ, 0 ≤ l ≤ λ; return Γξ (u, k, l), for all 1 ≤ k ≤ κ and 0 ≤ l ≤ λ; Next, according to Algorithm 1 and assuming that we have all the subpartitions Aµ (ui , k, l) and AΓ (ui , k, l), we explain how to obtain AΓ (u, k, l). First, throughout the execution of Algorithm 1, in Line 5, if µξ (ui , k − 1, l) = 1 and εi ≤ Γξ (ui , k, l), then set X (i, k, l) := Aµ (ui , k − 1, l) ∪ {{u}}, otherwise let X (i, k, l) be the subpartition obtained from AΓ (ui , k, l) by adding the vertex u to the set containing u1 . Also, in Line 13, set Y(k, l) := X (1, k, l). Next, in Line 20, if Y (i − 1, k′ , l′ ) + X(i, k + 1 − k′ , l − l′ ) ≤ Y (i, k, l), then let Y(k, l) be obtained from the disjoint union of Y(k′ , l′ ) and X (i, k + 1 − k′ , l − l′ ) by merging two sets containing the vertex u. Finally, in Line 26, set AΓ (u, k, l) := Y(k, l). 4 Towards more extensions In this section, we show that our presented scheme can be generalized to solve the following more realizable problems efficiently: 1. Solving CMSC problem on trees with potentials. 9 Algorithm 2 Input: A weighted tree (T, ω, c), a rational number ξ and integers κ ≥ 1 and λ ≥ 0. A vertex u ∈ V (T ) with children (u1 , . . . , ud ). The numbers Γξ (u, k, l), for all 1 ≤ k ≤ κ and 0 ≤ l ≤ λ. The numbers µξ (ui , k, l) for all 1 ≤ i ≤ d, 1 ≤ k ≤ κ and 0 ≤ l ≤ λ. Output: The numbers µξ (u, k, l) for all 1 ≤ k ≤ κ and 0 ≤ l ≤ λ. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: Let eu be the parent edge of u and u1 , . . . , ud be the children of u. for l = 0 : λ do for k = 1 : κ do µξ (u, k, l) := 0; if Γξ (u, k, l) ≤ ξω(Tu ) − c(eu ) then µξ (u, k, l) := 1; end if end for end for Define U (1, k, l) := µξ (u1 , k, l), for every 0 ≤ k ≤ κ, 0 ≤ l ≤ λ; for i = 2 : d do for l = 0 : λ do for k = 0 : κ do if µξ (u, k, l) = 0 then U (i, k, l) := 0; for l′ = 0 : l − 1 do for k′ = 0 : k do if U (i − 1, k ′ , l′ ) = µξ (ui , k − k′ , l − 1 − l′ ) = 1 then U (i, k, l) := 1 and go to Line 22; end if end for end for end if end for end for end for For every 0 ≤ k ≤ κ and 0 ≤ l ≤ λ, if U (d, k, l) = 1, then set µξ (u, k, l) := 1. return µξ (u, k, l), for all 0 ≤ l ≤ λ; 2. Solving CMSC problem on forests. 3. Solving the following semi-supervised problem: Given a weighted graph G = (V, E, ω, c) (not necessarily a forest), two disjoint subsets S1 , S2 ⊆ V , rational number ξ and integers κ, λ, such that the induced subgraph of G on V (G) \ S1 is a forest. Does there exist a connected subpartition A ∈ Dκ (V ) such that φG (A) ≤ ξ, |R(A, G)| ≤ λ, S1 ⊆ R(A, G) and S2 ∩ R(A, G) = ∅? In the following, we elaborate on the modifications that should be made to tackle the above settings. 1. In the setting of trees with potentials, each vertex v ∈ V (T ) is endowed with a potential weight, say p(v), which is a nonnegative number and the goal is to determine whether there exists a connected k-subpartition A = {Ai }k1 ∈ Dk (V ) such that   c(∂Ai ) + p(Ai ) ≤ξ φT (A) = max φT (Ai ) = 1≤i≤k ω(Ai ) 10 Algorithm 3 Input: A weighted tree (T, ω, c), a rational number ξ and integers κ ≥ 1 and λ ≥ 0. Output: Decide if there exists A ∈ Ck (T ) where φT (A) ≤ ξ and |R(A, T )| ≤ λ? 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: Root T with an arbitrary node r; Order all nodes in BFS order with respect to r, as v1 , ..., vn = r; Set i := 1; while i ≤ n do Let u := vi and eu be the parent edge of u and u1 , . . . , ud be the children of u. Initialize µξ (u, k, l) := 0, ∀ 0 ≤ k ≤ κ, 0 ≤ l ≤ λ; Initialize Γξ (u, k, l) := +∞, ∀ 1 ≤ k ≤ κ, 0 ≤ l ≤ λ; if d = 0 then Set µξ (u, 0, l) := 1, ∀ 1 ≤ l ≤ λ. if c(eu ) ≤ ξω(u) then Set µξ (u, 1, l) := 1, ∀ 0 ≤ l ≤ λ. end if Set Γξ (u, 1, l) := 0, ∀ 0 ≤ l ≤ λ; else Using Algorithm 1, find the value of Γξ (u, k, l), for all 0 ≤ l ≤ λ and 1 ≤ k ≤ κ; Using Algorithm 2, find the value of µξ (u, k, l), for all 0 ≤ l ≤ λ and 0 ≤ k ≤ κ; end if i ← i + 1; end while If µξ (u, κ, λ) = 1, then return Yes. Otherwise, return No. and |R(A, T )| ≤ λ. We can extend our method to solve this problem using Algorithm 3. First, for each edge e ∈ E(T ), amend the definition of εξ (e) in (2) as follows εξ (e) := ξ ω(Te ) + c(e) − p(Te ). Also, define the functions µξ and Γξ analogously. Next, with a similar argument as in Lemma 2, one may prove that µξ (u, k, l) = 1 if and only if either Γξ (u, k, l) ≤ ξ ω(Tu ) − c(eu )−p(Tu ), or U (d, k, l) = 1. Moreover, Lemma 3 is still valid. So, we should just change Line 1 in Algorithm 1 and Line 5 in Algorithm 2, accordingly and then Algorithm 3 works for the new setting. 2. Suppose that the forest F consists of c disjoint trees T1 , . . . , Tc rooted at r1 , . . . , rc respectively. Also, let ξ, κ, λ be fixed. First, using Algorithm 3, compute the value of µξ (ri , k, l), for every integers 0 ≤ l ≤ λ, 0 ≤ k ≤ κ and 1 ≤ i ≤ c. Also, define Zξ (1, k, l) = µξ (r1 , k, l). The following recursion helps us to solve the problem on F . For every 2 ≤ i ≤ c, define  ′ ′  1 if there exists 0 ≤ k ≤ k and 0 ≤ l ≤ l, s.t. Z(i, k, l) := Z(i − 1, k ′ , l′ ) = µξ (ri , k − k′ , l − l′ ) = 1,   0 o.w. Then, the solution to CMSC problem is yes if and only if Zξ (c, κ, λ) = 1. Furhermore, One may easily extend this recursion to solve the corresponding problem on forests with potentials. 11 3. In this setting some vertices should be or should not be in the residue set. The problem can be solved in the following steps: - First, for each vertex v ∈ V (G), define a potential as follows X p(v) := c(e). e∈E({v},S1 ) - Now, let F be a forest obtained from G by deleting all vertices in S1 . Also, let λ′ := λ − |S1 |. - If S2 is empty, then the solution can be obtained by performing the method given in 2 on the forest F with the potential weight p and the numbers ξ, κ, λ′ . If S2 is non-empty, we have to make the following additional modifications to handle the problem. Suppose that T is a tree and S ⊆ V (T ) is a subset of vertices. Also, numbers ξ, κ, λ are given. We are looking for a connected subpartition A ∈ Dκ (V ) such that φT (A) ≤ ξ, |R(A, T )| ≤ λ and S ∩ R(A, T ) = ∅. Note that Lemma 3 is still valid in this setting. However, in the computation of µξ (u, k, l), for each u ∈ V (T ), in Lemma 2, if u ∈ S, then u is not allowed to be in the residue set. So, the value of µξ (u, k, l) is equal to 1 if and only if Γξ (u, k, l) ≤ ξ ω(Tu ) − c(eu ). Thus, with a similar proof as in Lemma 2, we can prove that   1 if u ∈ S and Γξ (u, k, l) ≤ ξ ω(Tu ) − c(eu ), µξ (u, k, l) = 1 if u 6∈ S and either Γξ (u, k, l) ≤ ξω(Tu ) − c(eu ) or U (d, k, l) = 1,   0 o.w. Then, Algorithm 2 can be modified accordingly to compute the value of µξ (u, k, l). 5 Concluding remarks and future work In this paper, a multi-way sparsest cut problem has been investigated for weighted trees and it was shown that although the problem is N P −complete for trees, it becomes tractable when the search space is confined to connected subdomains. One of the strengths of the method is that it has a control on the number of outliers and can manage semi-supervised settings when some data points are forced or forbidden to be outlier. Besides the theoretical importance of the sparsest cut problem, when our method is applied to the minimum spanning tree, it can steer several applications in both unsupervised and semi-supervised clustering. One may also consider an analogous problem when we are seeking for a subpartition minimizing “the average” (instead of the maximum) of the edge expansions of the parts (e.g. as in [21]). This objective function is more sensitive and exquisite and are more likely to produce high-quality clustering results. Nevertheless, the problem unfortunately turns out to be N P −complete on trees even when the search space is restricted to connected subpartitions (or partitions) [9]. Finding a good approximation algorithm for this problem is an interesting and challenging task that can be the purpose of future work in this line of research. Acknowledgment. We would like to express our sincere thanks to Amir Daneshgar whose valuable comments were crucial in preparing and improving the present article. 12 References [1] N. Alon, Eigenvalues and expanders, Combinatorica 6 (1986), no. 2, 83–96, Theory of computing (Singer Island, Fla., 1984). MR 875835 [2] N. Alon and V. D. Milman, λ1 , isoperimetric inequalities for graphs, and superconcentrators, J. Combin. Theory Ser. B 38 (1985), no. 1, 73–88. MR 782626 [3] Sanjeev Arora, Satish Rao, and Umesh Vazirani, Expander flows, geometric embeddings and graph partitioning, J. ACM 56 (2009), no. 2, Art. 5, 37. MR 2535878 [4] James C. Bezdek, Pattern recognition with fuzzy objective function algorithms, Plenum Press, New York-London, 1981, With a foreword by L. A. Zadeh, Advanced Applications in Pattern Recognition. MR 631231 [5] Peter Buser, Geometry and spectra of compact Riemann surfaces, Progress in Mathematics, vol. 106, Birkhäuser Boston, Inc., Boston, MA, 1992. MR 1183224 [6] Isaac Chavel, Eigenvalues in Riemannian geometry, Pure and Applied Mathematics, vol. 115, Academic Press, Inc., Orlando, FL, 1984, Including a chapter by Burton Randol, With an appendix by Jozef Dodziuk. MR 768584 [7] Fan R. K. Chung, Spectral graph theory, CBMS Regional Conference Series in Mathematics, vol. 92, Published for the Conference Board of the Mathematical Sciences, Washington, DC; by the American Mathematical Society, Providence, RI, 1997. MR 1421568 [8] Amir Daneshgar, Hossein Hajiabolhassan, and Ramin Javadi, On the isoperimetric spectrum of graphs and its approximations, J. Combin. Theory Ser. B 100 (2010), no. 4, 390–412. MR 2644242 [9] Amir Daneshgar and Ramin Javadi, On the complexity of isoperimetric problems on trees, Discrete Applied Mathematics 160 (2012), no. 1, 116–131. [10] Amir Daneshgar, Ramin Javadi, and Laurent Miclo, On nodal domains and higher-order Cheeger inequalities of finite reversible Markov processes, Stochastic Process. Appl. 122 (2012), no. 4, 1748–1776. MR 2914771 [11] Amir Daneshgar, Ramin Javadi, and SB Shariat Razavi, Clustering and outlier detection using isoperimetric number of trees, Pattern Recognition 46 (2013), no. 12, 3371–3382. [12] Rajesh N Davé and Raghuram Krishnapuram, Robust clustering methods: a unified view, IEEE Transactions on fuzzy systems 5 (1997), no. 2, 270–293. [13] Guojun Gan, Chaoqun Ma, and Jianhong Wu, Data clustering, ASA-SIAM Series on Statistics and Applied Probability, vol. 20, Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA; American Statistical Association, Alexandria, VA, 2007, Theory, algorithms, and applications. MR 2331172 [14] Shlomo Hoory, Nathan Linial, and Avi Wigderson, Expander graphs and their applications, Bull. Amer. Math. Soc. (N.S.) 43 (2006), no. 4, 439–561. MR 2247919 [15] Mark Jerrum and Alistair Sinclair, The markov chain monte carlo method: an approach to approximate counting and integration, Approximation algorithms for NP-hard problems (1996), 482–520. 13 [16] James R Lee, Shayan Oveis Gharan, and Luca Trevisan, Multiway spectral partitioning and higher-order cheeger inequalities, Journal of the ACM (JACM) 61 (2014), no. 6, 37. [17] Anand Louis and Konstantin Makarychev, Approximation algorithm for sparsest kpartitioning, Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, ACM, New York, 2014, pp. 1244–1255. MR 3376452 [18] Bojan Mohar, Isoperimetric numbers of graphs, J. Combin. Theory Ser. B 47 (1989), no. 3, 274–291. MR 1026065 [19] Andrew Y Ng, Michael I Jordan, Yair Weiss, et al., On spectral clustering: Analysis and an algorithm, Advances in neural information processing systems 2 (2002), 849–856. [20] Dan Pelleg, Andrew W Moore, et al., X-means: Extending k-means with efficient estimation of the number of clusters., ICML, vol. 1, 2000, pp. 727–734. [21] Jianbo Shi and Jitendra Malik, Normalized cuts and image segmentation, IEEE Transactions on pattern analysis and machine intelligence 22 (2000), no. 8, 888–905. [22] Vijay V. Vazirani, Approximation algorithms, Springer-Verlag, Berlin, 2001. MR 1851303 [23] Shing Tung Yau, Isoperimetric constants and the first eigenvalue of a compact Riemannian manifold, Ann. Sci. École Norm. Sup. (4) 8 (1975), no. 4, 487–507. MR 0397619 14
8cs.DS
Prediction and Mitigation of Crush Conditions in Emergency Evacuations Peter J. Harding1 , Martyn Amos1,2 , and Steve Gwynne3 1 arXiv:0805.0360v1 [cs.CE] 3 May 2008 2 3 Manchester Metropolitan University Manchester, UK E-mail: [email protected] Hughes Associates, Inc Boulder, Colorado, USA E-mail: [email protected] Summary. Several simulation environments exist for the simulation of large-scale evacuations of buildings, ships, or other enclosed spaces. These offer sophisticated tools for the study of human behaviour, the recreation of environmental factors such as fire or smoke, and the inclusion of architectural or structural features, such as elevators, pillars and exits. Although such simulation environments can provide insights into crowd behaviour, they lack the ability to examine potentially dangerous forces building up within a crowd. These are commonly referred to as crush conditions, and are a common cause of death in emergency evacuations. In this paper, we describe a methodology for the prediction and mitigation of crush conditions. The paper is organised as follows. We first establish the need for such a model, defining the main factors that lead to crush conditions, and describing several exemplar case studies. We then examine current methods for studying crush, and describe their limitations. From this, we develop a three-stage hybrid approach, using a combination of techniques. We conclude with a brief discussion of the potential benefits of our approach. 1 Introduction The events of 9/11 were widely seen and examined in the safety community and beyond. The catastrophic outcome and the minutiae of the evacuation have been examined by numerous official agencies, research organizations, media outlets, as well as Hollywood. Given this, the events of the day are incredibly well known; possibly more so than any other recent event. Tall buildings are designed based on the assumption that an evacuation is managed, i.e. that the evacuation will take place in stages, if required, with only certain sections of the population evacuating at any one time. The evacuation will usually take place from those floors closest to the incident, then occur from more distant floors. This assumption is key to the successful evacuation of these tall structures; the stair capacity is calculated based on the assumption that the majority of the population follow the evacuation procedure. This means that the stair capacity within the structure will not be sufficient for the simultaneous evacuation of the entire population. 2 P. J. Harding, M. Amos, and S. Gwynne After 9/11 the assumption that tall buildings can be evacuated in a phased and controlled manner is being questioned. Instead, it is often suggested that evacuees will be reluctant to remain behind in a structure, fearful of a failure in structural integrity similar to that experienced in the twin towers. Given the nature of the incident on 9/11 and the possible consequences of remaining within the building (either by choice or through compulsion), it is now suggested that residents may choose to ignore the instructions of a staged procedure and instead move to the stairwells. This may then overload the available staircase capacity. Given this is the case, the consequences of failure should be examined. If there is a failure in the acceptance of procedure then either the failure should be made as graceful as possible, or measures should be taken to resolve the issue; in either case, an understanding of the consequences of failure is vital. It should be noted that during these scenarios it is not assumed that the conditions are dependent upon the existence of panic, which is difficult to predict and rarely the dominant evacuee behaviour[1]. In reality, it has been found that panic and irrational behaviour are a direct effect of the deteriorating conditions, rather than the cause of the deterioration itself. Here we are assuming that crush conditions may develop simply because of the overloading of a route and may therefore be influenced by architectural, procedural, or behavioural factors. One of the consequences of a full evacuation from a tall structure, that was originally designed for phased evacuation, is the overloading of an escape route in a relatively short period of time. One of the most dangerous consequences of such an incident is that the exits, such as those at the base of stairways, would become overloaded, leading to many evacuees arriving at a bottleneck; i.e. the exit component is used above and beyond its design capacity. This may then lead to conditions similar to those observed at the Rhode Island[2] and Gothenburg[3] incidents, where crush incidents and falls were evident and lead to blocked egress routes and injuries. It is therefore critical for the safety of tall structures to develop an understanding of: (1) Exactly when these conditions may develop? (2) What factors need to be present in order for crush conditions to occur? (3) When do these conditions become critical? (4) How can we establish the possible consequences of this type of incident and design against them? Here, we outline a program of work that will enable the assessment of architectural and procedural designs in order to establish whether they are prone to crush conditions developing in certain scenarios, what the consequences of this might be, and how we might best mitigate against this event. The development of a similar tool is mentioned in the recommendations within the 9/11 report[4]: NIST recommends that tall buildings be designed to accommodate timely full building evacuation of occupants when required in building-specific or large-scale emergencies such as widespread power Prediction and Mitigation of Crush Conditions in Emergency Evacuations 3 outages, major earthquakes, tornadoes, hurricanes without sufficient advanced warning, fires, explosions, and terrorist attacks. Building size, population, function, and iconic status should be taken into account in designing the egress system. Stairwell capacity and stair discharge door width should be adequate to accommodate counter-flow due to emergency access by responders. Improved egress analysis models, design methodologies, and supporting data should be developed to achieve target evacuation performance for the building population by considering the building and egress system designs and human factors such as occupant size, mobility status, stairwell tenability conditions, visibility, and congestion. Although numerous egress models exist that are able to simulate general movement, none are able to simulate all of the conditions highlighted in NIST recommendations, along with a comprehensive crush model. Developing such a model, that is publicly available and that can be embedded into existing egress tools, meets an identified need and will allow for a broad and vital examination of these situations. 2 Definition of Crush Conditions There are many factors that play a part in the initial formation of crush conditions during an evacuation, these can be classified under the broad headings of spatial, temporal, perceptual, procedural, and cognitive components. 2.1 Spatial The spatial components of crush conditions are the simplest to quantify. They relate to the ratio of space available for egress to the number of persons that are expected to use the escape routes. Fruin defined this metric as the “level of service”[5], and highlighted the level at which the population density has the potential to facilitate the formation of crush as “Level of Service F”, which is the density at which a single individual would have, on average, less than 0.46m2 of space available to them. It should also be noted that the International Maritime Organisation (IMO) considers an evacuation to be unsafe if, for 10% of the overall evacuation time, the density of the evacuees reaches 4 persons per square metre[6]. This is due to the fact that, even at relatively low levels of force, prolonged exposure to “light” crush conditions may still cause serious injury or death. 2.2 Temporal Temporal factors of egress vary, and depend heavily upon the rate at which conditions change. The RSET (Required Safe Egress Time), defined as the 4 P. J. Harding, M. Amos, and S. Gwynne elapsed time between the initialisation of an evacuation and the final evacuee reaching safety[7], i.e. the time required for a complete evacuation under ideal circumstances. The ASET (Available Safe Egress Time), defined as the total time available for evacuation[7], is a far more specific metric, as it will vary depending on the catalyst for evacuation (i.e. the nature of the emergency). Traditionally, the RSET and ASET metrics have been used to determine whether or not the occupants of a building could evacuate under specific conditions. Generally, a structure could be considered safe if the ASET value exceeds that of the RSET, i.e. there is more time available for an evacuation than would be required. The rate at which conditions change can compound time constraints, as the ASET calculation will change dynamically with the changing conditions. The Rhode Island nightclub fire (see Section 3.1), is a good example of this, and shows how the rapidity with which an incident escalates can place severe time constraints on the evacuating population. 2.3 Perceptual and Cognitive Factors Perceptual and cognitive factors that lead to the formation of crush conditions are intrinsically linked, as an individual must rely on their perception of events in order to decide upon a course of action. The individuals’ perceived level of threat plays a large part in this, as it has the most direct effect on the decision making process. Whilst the perception of threat plays a great part in the decision making process, the relationship between these two factors is highly complex, and can result in individuals displaying a wide range of behaviour, from the altruistic at one end of the scale, right through to highly competitive egress behaviour, e.g. running, pushing, etc. The perception of information also plays a key part in the formation of crush. During emergency situations, it is often found that information relating to the current conditions is slow to propagate throughout a crowd of people, e.g. the evacuees that are placed further back in a crowd may not be aware of the conditions further ahead. This has been found in many situations, such as the Hillsborough disaster (see Section 3.4), where the people attempting to enter a structure were unaware of the already dangerously overcrowded conditions that existed inside. In these cases the persons at the rear of a crowd can compound the situation by producing additional force that will propagate forward through the crowd, and also by limiting the extent to which the pressure could be alleviated by inadvertently blocking the most immediate exit routes. 2.4 Procedural The procedural components of crush were already alluded to (see Section 1), and centre around the inability, or unwillingness, of evacuees to follow strict evacuation plans in emergency situations. This type of problem is extremely Prediction and Mitigation of Crush Conditions in Emergency Evacuations 5 common in public buildings, where a great number of the occupants will be unfamiliar with the structure and have little, or no, knowledge of the evacuation plans, e.g. hospitals, town halls, museums, stadiums, etc. When an evacuation takes place under these circumstances the crowd will often attempt to leave by the most familiar route, generally the route by which they entered, even though there may be exits in closer proximity. An example of this type of behaviour can be found in the Rhode Island nightclub incident (see Section 3.1), where the majority of the crowd converged at just one point of escape, even though there were numerous other exits available. 2.5 Summary The formation of crush conditions within crowds is a highly complex, emergent phenomena, and the causes of this cannot be explained by simply attributing it to the presence of panic within the crowd, which is widely regarded as being somewhat of a fallacy. We suggest that crush conditions can only be reliably defined as a combination of all the factors mentioned above, which culminate in the individuals’ inability to fully control their direction and speed of movement, thus leading to an increase in the physical forces that they are subject to. 3 Case Studies Here we present case studies representing situations where the formation of crush conditions have led to both serious injuries and fatalities. Each case study also represents some failure within a system (e.g. failure to limit the capacity of a structure to safe levels, failure to adhere to official guidelines or fire laws, failure to follow crowd control policies, etc). These types of failure are often observed in cases where the evacuation of a building leads to the death or injury of many people. Failures of this kind are common, and we believe that they should be expected, and be considered during the design of buildings, the creation of evacuation plans, and especially in simulated evacuation exercises. 3.1 Rhode Island Nightclub The Station Nightclub, Rhode Island, was the scene of a tragedy when, on February 20th 2003, a fire during a rock concert caused 100 fatalities and significant injuries[2]. The fire started when the band’s pyrotechnics ignited the flammable soundproofing foam that surrounded the stage, and quickly filled the club with dense, choking smoke. The fire spread from the stage, igniting a large portion of the ceiling, and within five minutes of the initial ignition those outside the club observed flames breaking through a portion of the roof. 6 P. J. Harding, M. Amos, and S. Gwynne Despite the existence of four possible exits, the majority of the crowd headed for the most familiar exit; the entrance to the club. This exit point was soon overwhelmed, and people began to trip or fall during their escape. The official time-line of the fire (compiled by NIST[2]) states that just 1 minute and 42 seconds after the start of the fire, there existed a “pile” of people, blocking the main exit and making further egress through that route impossible. 3.2 Gothenburg Dancehall When fire broke out in a dancehall in Gothenburg, Sweden, on October 28th 1998, it claimed the lives of 63 people and injured over 180 others. The first floor venue in question was packed to over double its 150 capacity, with officials estimating that there may have been over 400 people in attendance. Eye-witness accounts of the incident state that population density prior to the start of the fire was already at dangerously high levels, with a number of the occupants observing that there were so many people present that they were unable to dance[3]. Shortly before midnight, a fire was discovered in one of the two stairways leading out of the first floor dancehall, and those near to the affected area began to evacuate. No announcement was made to the remaining occupants, and some survivors who had been at the far end of the hall when the fire was initially discovered stated that they smelled smoke but had initially believed it to be cigarette smoke and felt no need to evacuate. As the full evacuation began, the one remaining exit to the building quickly became overwhelmed, and the mass of evacuees began to trip or fall over others, further diminishing the capacity of the exit. 3.3 E2 Nightclub Incident In Chicago’s E2 nightclub on Feb 17th 2003, the security guards’ use of pepper spray, to intervene during an altercation, became the catalyst for an evacuation that claimed the lives of 21 patrons[8]. When the security guards released the pepper spray in an enclosed space, the effects of the chemical compound on the surrounding crowd were significant. Those close to the attack began to rush toward the exit in an attempt to escape the pepper spray, which by this point was already spreading around the club. As the initial wave of evacuees made their way through the club, those who had not witnessed the incident began to fear for their safety, especially as it became obvious that some form of chemical agent was present. Within seconds the entire crowd, consisting of over 1500 people, rushed towards the main exit. The door to the street opened inwards, whilst the door leading to the dance floor opened outwards. As people rushed from the club, the upper door flew outwards, pushing those on the upper landing down the steep flight of stairs. As more people attempted to exit, they were forced Prediction and Mitigation of Crush Conditions in Emergency Evacuations 7 on top of the fallen evacuees, and the bodies began to “stack up” and block the exit. It was the tremendous pressure placed upon the fallen evacuees that caused the 21 deaths during this incident. The most common cause of death was asphyxiation. 3.4 Hillsborough The Hillsborough disaster[9] (Sheffield, UK), claimed the lives of 96 people and caused the hospitalisation of a further 300. Due to the heightened public interest in the incident (the match had been transmitted live on English television), and also because of the multiple perceived failures on the part of the authorities, the Hillsborough disaster has become one of the most thoroughly investigated crowd disasters in living memory. The tragedy at Hillsborough stadium occurred when police stewarding the match made the decision to open an extra set of gates, intended as an exit, in order to relieve the extreme levels of congestion that were forming as the crowds tried to enter the stadium through the turnstiles at the Lepping’s Lane end of the ground. These gates did not have turnstiles, and the result was an influx of up to 5,000 fans through the narrow corridor that lead into the standing terrace. The sudden arrival of so many additional fans pushed the capacity of the central pens far above their legal maximum, and soon a dangerous crush formed at the front of the stands. Those fans still entering the stadium were unaware of this, and continued to attempt to enter the stand as the people inside were slowly crushed against the crowd barriers and fences at the front of the stands. The conditions at the front of the terrace became so bad that most of the 96 victims died from asphyxiation, or other crush related injuries, within five minutes of the game starting. 4 Previous Work in the Field In general, each crush detection method that has been used to date can be classified into one of two generic groups; explicit methods and implicit methods. These two generic methodologies are outlined below, along with a brief discussion of their relative strengths and weaknesses. 4.1 Implicit The implicit methodology is the original crush detection approach, and is still highly popular, being used in a large number of simulation models[10]. This methodology relies on the expert analysis of factors such as population density (see Section 2.1), behavioural analysis, and environmental considerations. The analysis of conditions within these models, therefore, is left to the engineer, who interprets the output of the simulation to determine whether crush conditions have occurred. 8 P. J. Harding, M. Amos, and S. Gwynne Implicit modelling does not take into account the possibility that evacuees may exhibit any competitive egress behaviours (e.g. pushing), as there is no accurate method for simulating these behaviours without the inclusion of force calculations. This makes it ideally suited for general evacuation simulations; i.e. timely evacuations under “ideal” conditions. As the exact force being exerted upon individuals is never calculated, the precise physical danger that may exist in the evacuation can never be quantified. The only assertion that can be made, based on an implicit analysis, is that crush conditions may form during the evacuation in question. The benefit of this approach is that, as the physical force calculation are not performed, it requires far less processing power than other methods. There are too many implementations of the implicit methodology to list here but a popular, well documented example is Simulex[11], from Crowd Dynamics Ltd. 4.2 Explicit The explicit modelling of crush conditions incorporates an assessment of crush into the model itself, and therefore requires less user analysis than the implicit approach. Often based on the calculation of Newtonian force values, and generally operating in 2-dimensional space, explicit methodologies may be used to detect the presence of crush conditions much more precisely than would be possible with implicit modelling techniques. By simulating the exact forces being exerted by each individual, and enabling the propagation of forces throughout a crowd, the explicit methodology can be used to measure the exact amount of force that any individual is subject to. This, therefore, offers the possibility of quantifying the dangers that individuals may face, which is not possible using the implicit modelling techniques. Whilst the explicit methodologies offer an accurate measure of the forces acting within a crowd, the calculations needed to measure force require much more processing power than an implicit implementation, so there exists a definite trade-off between the two techniques. The most well-known implementation of this methodology is the Social Forces Model[12], which combines the force equations mentioned above with the modelling of the social forces acting within crowds. Although the original Social Forces Model was created as a learning tool, rather than an fullfeatured simulation environment, the model has recently been incorporated into the FDS+Evac Simulation environment[13]. 5 Our Proposed Approach We propose a three stage approach to this problem, consisting of separate processes for the identification, qualification, and quantification of crush Prediction and Mitigation of Crush Conditions in Emergency Evacuations 9 conditions. By employing different methods for all three stages of the analysis, we believe that the entire process may be completed at relatively low computational expense. We hope to implement these techniques as part of a suite of applications, that would offer existing egress simulations the possibility of including either full or partial crush analyses, depending on the level of accuracy required. Two of the three techniques that we propose are still relatively novel and untested, so will require validation before they would be suitable for integration into existing environments. Each methodology will be fully tested as stand-alone applications, but a full validation will be required before the concepts are proven. At present, the team intends to attempt to integrate the applications into the open source simulation environment FDS+Evac, to enable full validation of the models, including historical data validation and peer validation[14]. 5.1 Identification In order to first identify crush conditions, we propose treating their formation as a simple phase transition, similar to those found in many social and biological systems[15]. In many of these systems a point is reached at which a change (often an abrupt change) can be observed, this change is characterised as a movement away from one general rule of system behaviour to another, different set of observable behaviours that dictate the state of the system as a whole. In egress situations, a crowd will usually head towards the most familiar exit, often forming groups either before or during this action. The evacuees that make up these groups will have similar trajectories to their closest neighbours and will be travelling at a similar speed (i.e the flow, within each group, can be considered laminar). This would form the general rule for the ordered state of this system (see Fig 1 - A). If the evacuees are impeded in any way during their exit (e.g. they come across an obstacle in their path, or reach a congested area), they will reduce their speed and be forced to change their directions of movement, or forced to remain stationary (i.e. the flow becomes non-laminar, or turbulent). This would form the general rule for the disordered state of this system (see Fig 1 - B). Buckingham’s Π Theorem[16] is a key theorem in dimensional analysis, and can be used to create a set of dimensionless variables that allow the analysis of an unfamiliar system, i.e. a system for which the equations governing its behaviour are either partially or wholly unknown. We will apply this theorem to the agent data within an egress model, to reduce the system to a number of dimensionless quantities, which can then be analysed to ascertain the state of the system at any one time. The advantage of this approach is that both the agent’s physical variables (e.g. speed, direction, mass) and their decision making variables (e.g. perceived level of threat, tendency to- 10 P. J. Harding, M. Amos, and S. Gwynne A B Fig. 1. Slide A shows an example of the movement vectors of evacuees during the ordered state of the system, with all vectors showing a good deal of similarity. Slide B shows example vectors during the disordered state, with the vectors varying a great deal more in both direction and magnitude ward competition) are considered, which will provide a more comprehensive analysis of crush than could be achieved by movement variables alone. Further analysis is achieved by the use of Mutual Information (MI)[17], a technique that has been used to quantify the similarity of two signals. This methodology was first used by Wicks et al [18] to detect phase transitions within a well-known flocking model[19], and was found to accurately identify the point of phase transition even when only a subset of the agents’ data were analysed. We will employ a similar methodology to detect the formation of crush conditions within localised groups of agents, using the MI method to quantify the extent to which our “idealised” (ordered) agent-state (see fig 1), differs to that of the current state. We will dynamically restructure agents into groups, based on their current locale, and treat each group as a system within its own right, tracking a subset of each “sub-system” to identify the earliest stages of crush formation without the need to track every agent throughout the entire evacuation. 5.2 Qualification To qualify the presence of crush conditions within the crowd, we intend to use a time-series, neural network classifier[20] to analyse the agent variables and movement patterns. This will give an indication of the amount of pressure that is likely being exerted on the individual in the crowd. The classifier acts as a statistical data analysis tool, and is configured to recognise the conditional similarities shared by individuals affected by the onset of crush conditions. The neural network approach has been selected for two main reasons. Firstly, after the initial training program, the neural network approach requires far less computational power to make its classification than other statistical analysis techniques, reducing the classification during normal running Prediction and Mitigation of Crush Conditions in Emergency Evacuations 11 conditions to little more than matrix arithmetic. The reduction in computation, in relation to other techniques, will free up system resources for utilisation by other tasks. Secondly, the method of classification used in a neural network is highly robust, as it does not rely on any “system specific” variables, which makes the deployment of this technique possible across a wide range of existing egress simulations, without the need for extensive configuration. By employing a time-series, neural network[21] (i.e. a neural network that accepts input in the form of sequential data representing changes over time), we also hope to identify the qualitative similarities of individuals exhibiting competitive egress behaviour. It will enable us to analyse growing behavioural trends, rather than just classify an agent’s behaviour at one precise moment in time. To train the network, we will collect time-series agent data from a “fullforce” simulation, i.e. a simulation in which a physical force model is running, which should enable the network to recognise the qualitative similarities that individuals affected by crush share. We hope that training the network using this type of data will allow the network to associate the existence of a variety of conditions to the presence of crush, therefore negating the need to engage a physics engine for all subsequent simulation runs. 5.3 Quantification To fully quantify the effects of force propagating through a crowd, a physical force model is employed, based on the explicit crush detection method mentioned previously(see Section 4.2). We currently plan to implement this physical force model as a rigid body dynamics engine[22], with representations of such variables as mass, velocity, friction, and force propagation, modelled according to the laws of Newtonian mechanics. The engine will solve simplified physical equations in two dimensional space, resulting in good approximations[23] of force calculations that can be completed in as little time as possible. The possibility of modelling this phenomena as a soft body dynamical system will be investigated, as recent research has highlighted the need to incorporate calculations for the compression forces acting within crowds[24], but our initial research into the feasibility of this approach leads us to believe that the calculations involved would be prohibitively computationally expensive at this time. 5.4 Hybrid Approach The methodologies outlined above may each be employed individually, to add differing degrees of crush analysis to a simulation, but we also propose a conceptual framework, within which all three methodologies could be combined to create an analytical tool that applies crush calculations intelligently. 12 P. J. Harding, M. Amos, and S. Gwynne This approach will allow us to retain the accuracy of force calculations whilst reducing the computational expense associated with it. The proposed approach requires the analysis of conditions based on locale, i.e. analysing conditions in different locations as if they were separate systems, and the escalation of analytical accuracy upon confirmation of crush. Figure 2 shows the flow of control across the three applications. Identification Model Input MI Analysis No Crush present Yes Qualification ANN Classifier No Crush present Yes Quantification Physics Engine Physics Engine Output Fig. 2. Process flow diagram depicting the interactions between the three application, according to the suggested framework. By applying the more accurate analyses only once crush has been confirmed by the previous method, the most computationally expensive techniques will only be applied to affected areas, rather than across the entire behaviour space. This leaves us with the possibility of having different analyses being applied simultaneously, within the same simulation, but in different geographical locales, e.g. the identification method is running on a corridor where the flow of pedestrians is laminar, whilst at the exit of a stairwell, where a crowd has formed, the analysis would be carried out by the quantification method. The advantage of engaging each application in this way is that it will ensure that the most serious effects of crush, the build up of forces within a crowd, are measured precisely, without calculating force for all agents within the simulation. 6 Benefits of our Approach This approach to crush analysis will provide a new tool, suitable for integration into existing simulation environments, that will allow engineers the ability to incorporate different levels of analysis for each specific simulation. The inclusion of such analytical methods will add a further dimension to traditional models, and further the realism of current simulation tools. Prediction and Mitigation of Crush Conditions in Emergency Evacuations 13 The addition of crush analysis techniques into models will allow engineers to better test the robustness of evacuation procedures, carry out more realistic recreations of historical incidents, and more comprehensively investigate the safety of architectural designs. It is the aim of this project to supply further tools to the evacuation sciences community that will allow this to happen, and act as a further weapon in the armoury of the engineers, technicians, and analysts that operate in this field. 7 Conclusion The need for further crush analysis techniques has been clearly stated, and the phenomena that we wish to simulate precisely defined. We have presented three methodologies for the detection, confirmation, and measurement of crush conditions within a simulation environment, and a theoretical framework within which they could operate in unison, reducing computational expense without a reduction in accuracy. The short-term goal of this research is simply to prove the suitability of these concepts for use in the analysis of crush, by the creation of a prototype implementation that may be used for experimentation. In the long-term we are looking to integrate this prototype into a larger simulation environment, to prove its feasibility as an “off the shelf” component to an evacuation model. Acknowledgements This work is partially supported by the Dalton Research Institute, Manchester Metropolitan University. References 1. J Sime. Escape behaviour in fires and evacuations. Design Against Fire, 1994. 2. W Grosshandler, N Bryner, D Madrzykowski, and K Kuntz. Report of the technical investigation of the station nightclub fire. Technical report, NIST, 2005. 3. E Comeau and R F Duval. Dance hall fire gothenburg, sweden, october 28, 1998. Technical report, National Fire Protection Association, 2000. 4. Final report on the collapse of the world trade center towers. Technical report, NIST, 2005. 5. J Fruin. Pedestrian Planning and Design. Metropolitan Association of Urban Designers and Environmental Planners, 1971. 6. IMO. Interim guidelines for evacuation analyses for new and existing passenger ships. Technical report, International Maritime Organisation, 2002. 7. J Sime. An occupant responses escape time (oret) model. In Proceeding of the First International Symposium, 1998. 14 P. J. Harding, M. Amos, and S. Gwynne 8. J Wilgoren. 21 die in stampede of 1,500 at chicago nightclub. New York Times, 18.02.2003. 9. The hillsborough stadium disaster: final report. Technical report, U.K. Home Office, 1989. 10. E Kuligowski. Review of 28 egress models. In Workshop on Building Occupant Movement During Fire Emergencies, 2004. 11. P A Thompson and E W Marchant. A computer model for the evacuation of large building populations. Fire Safety Journal, 24:131–148, 1995. 12. Dirk Helbing, Illes Farkas, and Tamas Vicsek. Simulating dynamical features of escape panic. Nature, 407:487–490, 2000. 13. Juha-Matti Kuusinen. Group behavior in FDS+evac evacuation simulations. Published online, August 2007. 14. J Kleijnen and R Sargent. A methodology for fitting and validating metamodels in simulation. European Journal of Operational Research, 120:14–29, 2000. 15. 2001 — vol. 98 — no. 17 — 9703-9706 PNAS — August 14. M beekman and d j t sumpter and f l w ratnieks. PNAS, 98(17):9703–9706, 2001. 16. Malcolm Longair. . Theoretical Concepts in Physics: An alternative view of theoretical reasoning in physics. Cambridge Univ. Press, 2 edition, 2003. 17. A Kraskov, H Stogbauer, and P Grassberger. Estimating mutual information. Phys. Rev. E, 69, 2004. 18. R Wicks, S Chapman, and R Dendy. Mutual information as a tool for identifying phase transitions in dynamical complex systems with limited data. Physical Review E, 75(5), 2007. 19. T Vicsek, E Ben-Jacob A Czirok, I Cohen, and O Shochet. Novel type of phase transition in a system of self-driven particles. Phys. Rev. Lett., 75:1226, 1995. 20. Mohamad H. Hassoun. Fundementals of Artificial Neural Networks. MIT Press, 1995. 21. A Kehagias and V Petridis. Predictive modular neural networks for time series classification. Neural Networks, 10(1):31–49, 1997. 22. J Wittenburg. Dynamics of Multibody Systems: Dynamics of Systems of Rigid Bodies. Springer-Verlag, 2007. 23. R van Zon and J Scho?eld. Numerical implementation of the exact dynamics of free rigid bodies. J. Comput. Phys, 225:145?–164, 2007. 24. L U Chunxia. Analysis of compressed force in crowds. J Transpn Sys Eng & IT, 7(2):98–103, 2007.
5cs.CE
Slicing Event Traces of Large Software Systems Raymond Smith Lucent Technologies Naperville, Illinois, USA [email protected] Bogdan Korel Computer Science Department Illinois Institute of Technology Chicago, Illinois USA [email protected] Abstract Debugging of large software systems consisting of many processes accessing shared resources is a very difficult task. Many commercial systems record essential events during system execution for post-mortem analysis. However, the event traces of large and long-running systems can be quite voluminous. Analysis of such event traces to identify sources of incorrect behavior can be very tedious, error-prone, and inefficient. In this paper, we propose a novel technique of slicing event traces as a means of reducing the number of events for analysis. This technique identifies events that may have influenced observed incorrect system behavior. In order to recognize influencing events several types of dependencies between events are identified. These dependencies are determined automatically from an event trace. In order to improve the precision of slicing we propose to use additional dependencies, referred to as cause-effect dependencies, which can further reduce the size of sliced event traces. Our initial experience has shown that this slicing technique can significantly reduce the size of event traces for analysis. 1 Introduction Large, long-running computer systems used for such applications as real-time operations, process control, or online transaction processing may consist of millions of lines of code in many separate processes. Many different system components may be accessed and used by any number of these independent processes and the coordination and analysis of the interactions of these components is often necessary for debugging and other maintenance activities. Such large software systems record events as they occur during execution resulting in a dynamic record of system behavior that can be used for debugging and problem analysis. An event trace is a record of events associated with operations that are performed upon various entities of interest such as physical devices (e.g., networks, circuit packs, peripheral units) or software resources (e.g., buffers in memory, individual processes, sets of processes). Event traces are used for analysis in many systems [And98, Buk95, Coo98]. Often, the event trace may be the only artifact available for post-mortem analysis and debugging of the system, but the event traces for large, complex, long-running systems can be quite voluminous, particularly if there are a large number of independent processes and shared resources. Manual analysis involves sorting through a long list of disparate events to find those that are related to the problem under study. The experience of one of the authors of this paper confirms that manual analysis can be time consuming, error prone and tedious. While several tools exist for detecting anomalies and constraint violations in the event trace, [Bal96, Len00], these tools do not reduce the size of the event trace for analysis. Frequently such tools do not identify any constraint violations even though an incorrect behavior was observed. Since during a debugging session, developers have to analyze long event traces, they are very much interested in reducing the number of events to be analyzed. One well-known reduction technique is program slicing. A program slice consists of all statements in a program that may affect the value of a variable at some point. There are two types of program slices: static slices and dynamic slices. A static slice [Wei82] preserves the program’s behavior with respect to a selected variable for all program inputs, and it is used to identify these parts of the program that potentially contribute to the computation of the selected variable. On the other hand, a dynamic slice [Kor88] preserves the program’s behavior with respect to a variable for particular program input, and it is used to identify these parts of the program that contribute to the computation of the selected variable for a given program execution (program input). Dynamic slices are frequently much smaller than static slices. Several methods of computation of static slices have been proposed in the literature [Gal91, Hor90, Wei82]. Similarly, several algorithms to compute dynamic slices have been proposed [Agr90, Kor88, Kor97a]. Originally, program slicing has been proposed to guide programmers during program debugging [Agr93, Lyl86], but program slicing can also be used in the process of understanding of programs during software maintenance and testing [Gal91, Kor97, Whi92]. Traditional static and dynamic slicing techniques are used to reduce the program (source code) size. Dynamic slicing can be also used to reduce the size of an execution trace. However, the existing slicing techniques cannot be used to reduce event traces. In this paper, we propose a novel slicing technique on event traces as a means of reducing the number of events for analysis. This technique identifies events that may have influenced observed incorrect system behavior, constructing a sliced event trace consisting of such influencing events. In order to recognize influencing events several different types of dependencies between events are identified. These dependencies can be determined fully automatically from an event trace. In order to improve the precision of slicing we propose to provide additional cause-effect dependencies that can further reduce the size of a sliced event trace. Event trace reduction may make debugging significantly easier due to the smaller size of event traces required for analysis. Our initial experience has shown that this slicing technique can significantly reduce the size of event traces for analysis. In Section 2, a system model and a structure of an event trace is provided. In Section 3 dependencies between events are defined, and in Section 4 the slicing algorithm that uses these dependencies is described. Section 5 introduces cause-effect dependencies and their application for slicing of event traces. 2 System Model and Event Traces A typical system consists of a set of active resources RA and passive resources RP. An active resource is a system component such as a process that can perform some action or operation on another resource or on itself. A passive resource is a system component that is acted upon such as a file or a peripheral unit, but that does not initiate any action or operation itself. Each resource is characterized by a set of states and a set of operations that can be performed on it which may cause the state of that resource to change. As a result, each resource is modeled by a state transition diagram that captures state changes in the resource based on performed operations. State transition diagrams may be obtained from requirements or design documentation and be constructed for individual resources or for a class of similar resources, e.g., all files, all processes. Figure 4a and 4b show state transition diagrams for a process resource and for a file resource, respectively. Formally, a resource is modeled as R = <S, O, T>, where S = {s1, s2, ..., sm} is a set of states that the resource can take on, O = {o1, o2, …, on} is a set of operations that can be performed on the resource, and T = {(o1, s1, d1,), (o2, s2, d2), ..., (ol, sl, dl)} is a set of transitions (triples) where si,di ∈ S, oi ∈ O, and (oi, si, di) indicates that operation oi causes the state of the resource to change from si to di. A system model consists of a set of resources and relationships between them that model interactions between resources. A relationship between resources indicates that one resource may interact with another and this interaction may cause the second resource to change its state. For example, a process can issue a Print operation on a printer to cause its state to change from Idle to Printing, or a process initiates some interaction with another process such as sending an abort signal that may cause a state change in this process from Running to Unavailable. Attempts have been made to standardize event traces [Cou92, Ree91], particularly in the area of performance analysis and parallel system design, but no real standard has been established. In this paper, we assume that an event trace has the following format that, probably, represents a typical format used in many commercial systems. By an event trace T we mean an ordered sequence of events, T = <E1, E2, E3,...,Em> where Ei is an event. For purposes of our analysis, we assume that for each event Ei the following information is recorded: Ei=<P, O, R, SO, SN> where, P is an identifier of the process executing an operation O, O is the operation identifier, R is the passive or active resource identifier, SO is the old state of resource R before the operation was performed, and SN is the new state of the resource R after the operation was performed. An event Ei is considered to have occurred whenever a process P executes an operation O on resource R causing the state of R to change from SO to SN after completion of operation O. For example, the following event may be recorded: <P2, Open, FileE, Closed, Open>, which shows process P2 performed an Open operation on the resource FileE, which resulted in a change of state for the resource FileE from Closed to Open. The following notation is used in the paper to refer to individual components of an event Ei: P(Ei), O(Ei), R(Ei), SO(Ei), and SN(Ei) denote a process identifier, operation identifier, resource identifier, old state, and new state identifier of event Ei, respectively. Figure 1 shows an event trace for a particular execution run. Notice that some operations do not cause a state change to occur and so the old and new state are the same. 3 Dependencies Between Events Dynamic slicing [Kor88] is a reduction technique that uses dependencies between source code statements as a way of determining whether to include or exclude these statements from an execution trace. Statements that belong to a sliced execution trace are a part of a dynamic slice. To use this technique on event traces, it is necessary to identify different dependencies between events. These dependencies may be then used to determine whether or not to include events as part of a sliced event trace. This approach may narrow the size of the event trace and assist in determining what caused the event with an incorrect behavior. Three types of dependencies are identified that are easily discernible from the given trace. 3.1 Change-Of-State dependency A Change-Of-State (COS) dependency captures a situation when in one event a certain resource state is observed and we would like to identify the last event where the change of the observed resource state took place. Assume there are two events Ei and Ej, i < j, in an event trace. A COS dependency exists between Ei and Ej when: 1) R(Ei) = R(Ej) and Sn(Ei) = So(Ej), 2) So(Ei) ≠ Sn(Ei), and 3) For all k, i<k<j, if (R(Ei) = R(Ek)) then (So(Ek) = Sn(Ei ) = Sn(Ek)). Condition 1 ensures that the same resource state appears in both events. Condition 2 ensures that a change of the resource state took place in Ei, and condition 3 ensures that the resource state has not changed between these events. In the event trace of Figure 1, a COS dependency exists between E5 and E32, and E1 and E33. 3.2 Last-Resource-Use dependency A change of state occurred in a process (active resource). We want to identify recently used resources by the process. This can be captured by the Last-Resource-Use (LRU) dependency. Assume there are two events Ei and Ej, i < j, in an event trace. A LRU dependency exists between events Ei and Ej when: 1) R(Ej) is an active resource, and SO(Ej) ≠ SN(Ej), 2) P(Ei) = R(Ej), and 3) For any k, i<k<j, if P(Ek) = R(Ej) then R(Ei) ≠ R(Ek). Condition 1 ensures the resource in Ej is an active resource and a state change has occurred in Ej. Condition 2 requires that the active resource in Ej is the process performing an operation in Ei. Condition 3 ensures that no other event exists between Ei and Ej where the active resource in Ei uses the passive resource R(Ei). For example, in the event trace of Figure 1, an LRU dependency exists between E28 and E33. 3.3 Last-Shared-Resource-Use dependency A change of state occurred in a process (active resource) that has used a resource recently. We want to identify whether this resource is shared with another process and identify the last use of this resource by another process. This can be captured by the Last-Shared-Resource-Use (LSRU) dependency. Assume there are two events Ei and Ej, i < j, in an event trace. A LSRU dependency exists between events Ei and Ej when: 1) There exists event Em, m<j, such that a LRU dependency exists between Em and Ej, 2) P(Em) ≠ P(Ei), and R(Em) = R(Ei), 3) a) if i<m: for all k (except k=m), i<k<j, R(Ei) ≠ R(Ek), or b) if i>m: for all k, i<k<j, R(Ei) ≠ R(Ek). Condition 1 ensures that for a LSRU dependency to exist between Ei and Ej, a LRU dependency must exist between Ej and another event Em. Conditions 2 ensures that the processes in Em and Ei are different but they use the same shared resource R(Ei). Condition 3a addresses a situation when Ei occurs before Em and ensures that no other process between Ei and Ej uses the shared resource except for Em. Condition 3b addresses a situation when Ei occurs after Em and ensures that no other process between Ei and Ej uses the shared resource. For example, in Figure 1, a Last-Shared-Resource-Use dependency exists between E24 and E33. 4 Slicing Event Traces A typical debugging session requiring analysis of an event trace takes place when an incorrect behavior is observed and an event(s) that may have caused this behavior needs to be identified. All three dependencies described in the previous section are used by a slicing algorithm to identify events influencing an observed behavior. The slicing algorithm starts with an initial event Es in which an incorrect behavior is observed. All events in the event trace are set as unmarked and not visited. In the first step, events that have a COS, LRU or LSRU dependency on the initial event Es are identified and marked. In the next step, a marked but not visited event is selected. Events that have influenced the selected event by COS, LRU, or LSRU dependencies are identified and marked (if not marked before). The selected event is set as visited. In the next step a marked but not visited event is selected and new events with dependencies on the selected event are identified and marked. This process of identifying and marking events is repeated until all marked events are visited. All events that are unmarked do not affect the starting event and are removed from the event trace. The resulting event sub-trace consists of events that may have potentially influenced the initial event Es. Suppose that in the event trace of Figure 1 the event E37, indicating that P1 has changed state from Blocked to Running, requires investigation. It is necessary to determine as to what caused this change of state by determining which events in the trace may have caused P1 to be Blocked. Figure 2 shows the sliced sub-trace of the event trace of Figure 1 after applying the slicing algorithm. Figure 3 shows the dependencies that were identified and used by the slicing algorithm, resulting is a size reduction of the event trace from 37 events to 15. No. Proc. Oper. Rsrc. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Start Start Mount Mount Open Open Open Open Open Read Read Read Lock Read Lock Write Unlock Lock Lock P1 P2 FSys1 FSys2 FileA FileB FileC FileD FileE FileA FileC FileB FileC FileA FileB FileB FileB FileE FileD P3 P2 P2 P2 P1 P1 P2 P2 P2 P1 P2 P1 P2 P1 P1 P1 P1 P2 P2 Old State Unav. Unav. Unav. Unav. Closed Closed Closed Closed Closed Open Open Open Open Open Open Locked Locked Open Open New State Running Running Mounted Mounted Open Open Open Open Open Open Open Open Locked Open Locked Locked Open Locked Locked No. Proc. Oper. Rsrc. 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 Write Write Read Read Write Read Unlock Write Lock Read Lock Write Read Wait Write Write Unlock Signal FileE FileC FileA FileB FileC FileA FileE FileC FileC FileB FileB FileB FileA P1 FileD FileC FileC P1 P2 P2 P1 P1 P2 P1 P2 P1 P1 P1 P1 P1 P1 P1 P2 P2 P2 P1 Old State Locked Locked Open Open Locked Open Locked Locked Locked Open Open Locked Open Running Locked Locked Locked Blocked New State Locked Locked Open Open Locked Open Open Locked Locked Open Locked Locked Open Blocked Locked Locked Open Running Figure 1 Event Trace. 5 Cause-Effect Dependencies Two types of dependencies LRU and LSRU are used to identify recently used resources because their usage may be a cause of incorrect behavior. However, a large number of events may be identified by these dependencies, many of which are not responsible for the incorrect behavior. This may lead to inclusion of too many events in a sliced event trace. There is a need to distinguish suspicious behavior from normal behavior. Frequently, only a certain usage of a resource may lead to an incorrect behavior of a process, e.g., locking a file may block a process, however reading a file may not block the process. We propose to incorporate additional information, referred to as cause-effect dependencies, that can be used to identify suspicious resource usage, and as a result, reduce the size of the event trace. In general, a cause-effect dependency between resources indicates that a certain usage of one resource may be responsible for a certain behavior of the other. We distinguish two types of cause-effect dependencies: static and dynamic. Static cause-effect dependencies are defined between elements of state transition diagrams whereas dynamic dependencies are defined between events in the event trace. 5.1 Static cause-effect dependencies A cause-effect dependency may only exist between resources for which a may interact relationship exists. Identifying static cause-effect dependencies between elements of the state transition diagrams of two resources may be treated as a refinement of the may interact relationship between these resources. Static cause-effect dependencies have to be identified by developers. Four types of cause-effect dependencies can be identified between elements of state transition diagrams: state-to-state, state-to-transition, transition-to-state and transitionto-transition cause-effect dependencies. In this paper, we present only the transition-to-transition cause-effect dependency, but remaining dependencies can be similarly defined. A transition-to-transition cause-effect dependency between resources indicates that a usage of one resource resulting in a specific transition may be responsible for a specific change of state of another resource. Assume (oi, si, di) is a transition in the state transition diagram of resource R. Additionally, assume (ok, sk, dk) is a transition in the state transition diagram of process P. A transition-to-transition cause-effect dependency between (oi, si, di) and (ok, sk, dk) indicates that a usage of resource R resulting in a transition (oi, si, di) may be the reason transition (ok, sk, dk) occurred in process P. For example, in the state diagram of Figure 4c, a Lock operation on a file resulting in a transition from Locked to Locked may cause a transition from Running to Blocked to occur in a process. Therefore, a cause-effect dependency may be introduced between these transitions. Two of these transition-to-transition cause-effect dependencies are shown graphically in Figure 4c as dotted arrows. Similarly, state-to-state, state-to-transition and transition-to-state cause-effect dependencies may be introduced. No. Proc. 1 5 6 7 13 15 17 24 28 30 31 32 33 36 37 Oper. P2 P1 P1 P2 P2 P1 P1 P2 P1 P1 P1 P1 P1 P2 P1 Start Open Open Open Lock Lock Unlock Write Lock Lock Write Read Wait Unlock Signal Rsrc. P1 FileA FileB FileC FileC FileB FileB FileC FileC FileB FileB FileA P1 FileC P1 Old State Unav. Closed Closed Closed Open Open Locked Locked Locked Open Locked Open Running Locked Blocked New State Running Open Open Open Locked Locked Open Locked Locked Locked Locked Open Blocked Open Running Figure 2 Sliced event trace Dependencies used Dependent events Change-Of-State (33,37), (30,31), (17,30), (15,17), (13,36), (7,13), (6,15), (5,32), (1,33) (32,37), (31,37), (28,37) (36,37), (24,33) Last-Resource-Use Last-Shared-Resource-Use Note: Each dependent event pair (Ei, Ej) indicates that Ej depends upon Ei. Figure 3 Dependencies used to compute the sliced event trace of Figure 2. 5.2 Dynamic cause-effect dependencies The static cause-effect dependencies between elements of state transition diagrams of resources may be used to automatically identify dynamic cause-effect dependencies between events and achieve further reduction of the sliced event trace. A dynamic cause-effect dependency between events indicates that a certain usage of a resource may likely be responsible for a certain behavior of an active resource because a static cause-effect dependency exists between state transition diagram elements of these resources. Dynamic cause-effect dependencies represent a subset of LRU and LSRU dependencies that most likely are responsible for incorrect system behavior. Formally, a dynamic cause-effect dependency is defined as follows: assume there are two events Ei and Ej, i<j. A dynamic cause-effect dependency exists between Ei and Ej i < j, if, (1) there exists an LRU or LSRU dependency between Ei and Ej, and (2) there exists a static cause-effect dependency between elements of Ei and Ej. Consider event E37 in the event trace of Figure 1. For this event there exists the following LRU and LSRU dependencies: (E28, E37), (E31, E37), (E32, E37), and (E36, E37). When the static, transition-to-transition causeeffect dependencies of Figure 4c are used, only one dynamic cause-effect dependency is identified: (E36, E37). This is included because a static cause-effect dependency exists between the transitions in E36 and E37. No such dependency exists between any of the other events with an LRU or LSRU dependency on E37. The use of dynamic cause-effect dependencies can result in significant reduction of the sliced event trace. Using the transition-to-transition cause-effect dependencies of Figure 4c on event E37 results in an event sub-trace containing only 6 events, substantially less than the 15 events for the same starting point as shown in Figure 5. Figure 6 lists all dynamic cause-effect dependencies that were used to determine the sliced event trace shown in Figure 5. start Unavailable exit/abort start Unavailable Running exit/abort wait signal Running Blocked Blocked a) Process wait signal lock read/write lock read/write Closed open b) File Locked close read Open unlock lock Closed open Locked close c) Process/File read Open unlock lock Transition-to-Transition Figure 4 State transition diagrams for resources with Cause-Effect dependencies. No. Proc. Oper. Rsrc. 1 7 13 33 36 37 P2 P2 P2 P1 P2 P1 Start Open Lock Wait Unlock Signal P1 FileC FileC P1 FileC P1 Old State Unav. Closed Open Running Locked Blocked New State Running Open Locked Blocked Open Running Figure 5 Sliced event trace using cause-effect dependencies of Figure 4c. 6 Dependencies used Cause-effect (transition-to-transition) Change-Of-State Dependent events (36,37) (33,37), (13,36), (7,13), (1,33) Figure 6 Dependencies used to compute the sliced event trace of Figure 5. Conclusions In this paper we presented a novel slicing technique to reduce the size of event traces for debugging of large software systems. Several types of dependencies between events have been identified that are used by a slicing algorithm. Additional cause-effect dependencies were introduced that can further reduce the size of the sliced event trace. Cause-effect dependencies are provided by developers, but in many cases identification of such dependencies may not require major effort and may be derived from the existing system documentation. Causeeffect dependencies may frequently be introduced only for a class of resources, not for individual resources. Identifying cause-effect dependencies among resources may be approached as an incremental process with successive debugging sessions identifying more dependencies to add to a growing base of information. This effort can pay off in smaller event traces for analysis that may significantly reduce debugging effort. We are in the process of developing a tool that will automatically perform slicing of event traces. We plan to perform experiments to determine the effectiveness of this slicing technique in the reduction of event traces of commercial systems. Our approach is currently limited to slicing of single event traces. One of the extensions is to develop slicing techniques for multiple event traces created by multiprocessing systems. We also plan to investigate the trade-offs between the amount of information recorded and the precision of slicing. References [Agr90] [Agr93] H. Agrawal, J. Horgan, "Dynamic program slicing" SIGPLAN Notices, No. 6, 1990, pp. 246-256. H. Agrawal, R. DeMillo, E. Spafford, "Debugging with dynamic slicing and backtracking," Software Practice & Exp., vol. 23, No. 6, 1993, pp. 589-616. [And98] J. H. Andrews, “Testing using log file analysis: tools, methods, and issues”, Proc. 13th IEEE International Conference on Automated Software Engineering, Oct. 1998, pp. 157-166. [Bal96] Balzer, R., “Enforcing architecture constraints,” Proc. 2nd Int’l Software Arch. Wksp, Oct. 1996, pp. 80-82. [Buc95] Buckley, M.F., Siewiorek, D.P. “VAX/VMS event monitoring and analysis”, Twenty-fifth International Symposium on Fault Tolerant Computing, June 1995, pp. 414-423. [Coo98] J. E. Cook, A. L. Wolf, “Event-based detection of concurrency”, Proceedings of the ACM SIGSOFT Sixth Int’l Symposium on Foundations of Software Engineering, Nov. 1998, pp. 35-45. [Cou92] A.L. Couch, D.W. Krumme, “Portable execution traces for parallel program debugging and performance visualization”, Proc. Scalable High Performance Computing Conf., 1992 SHPCC-92, April 1992, pp. 441-446. [Gal91] K. Gallagher, J. Lyle, "Using program slicing in software maintenance," IEEE Trans. on Software Engineering, vol. 17, No. 8, 1991, pp. 751-761. [Hor90] S. Horwitz, T. Reps, D. Binkley, "Interprocedural slicing using dependence graphs," Trans. on Progr. Lang. and Systems, vol. 12, No. 1, pp. 26-60, 1990. [Kor88] B. Korel, J. Laski, "Dynamic program slicing," Inf. Proc. Letters, vol. 29, No.3, 1988, pp. 155-163. [Kor97] B. Korel, J. Rilling, "Dynamic Program Slicing in Understanding of Program Execution", The 5th Int’l. Workshop on Program Comprehension., 1997, pp. 80-90. [Kor97a] B. Korel, "Computation of dynamic program slices for unstructured programs," IEEE Trans. on Software Eng., vol. 23, . No. 1, 1997, pp17-34. [Len00] R. Lencevivius, A. Ran, R. Yairi, “Third Eye – Specification-based analysis of software execution traces”, 1st Int’l Workshop on Automated Program Analysis, Testing and Verification, ICSE 2000, June 2000. [Lyl86] J. Lyle, M. Weiser, "Experiments on slicing-based debugging tools," Proc. of the 1st Conf. on Empirical Studies of Programming, 1986, pp. 187-197. [Ree91] D. A. Reed, R. D. Olsen, R. A. Aydt, T. M. Madhyastha, T. Birkett, D. W. Jensen, , B. A. A. Nazzief, B. K.Totty, “Scaleable performance environment for parallel systems”, Proc. Sixth Distributed Memory Computing Conference, IEEE Computer Society Press, 1991, pp. 562-569. [Wei82] M. Weiser, "Program slicing," IEEE Trans. on Software Eng., SE-10, No. 4, 1982, pp. 352-357. [Whi92] L. White, H. Leung, "Regression testability," IEEE Micro, April 1992, pp. 81-85.
6cs.PL
The Price of Information in Combinatorial Optimization∗ arXiv:1711.00405v1 [cs.DS] 1 Nov 2017 Sahil Singla † November 2, 2017 Abstract Consider a network design application where we wish to lay down a minimum-cost spanning tree in a given graph; however, we only have stochastic information about the edge costs. To learn the precise cost of any edge, we have to conduct a study that incurs a price. Our goal is to find a spanning tree while minimizing the disutility, which is the sum of the tree cost and the total price that we spend on the studies. In a different application, each edge gives a stochastic reward value. Our goal is to find a spanning tree while maximizing the utility, which is the tree reward minus the prices that we pay. Situations such as the above two often arise in practice where we wish to find a good solution to an optimization problem, but we start with only some partial knowledge about the parameters of the problem. The missing information can be found only after paying a probing price, which we call the price of information. What strategy should we adopt to optimize our expected utility/disutility? A classical example of the above setting is Weitzman’s “Pandora’s box” problem where we are given probability distributions on values of n independent random variables. The goal is to choose a single variable with a large value, but we can find the actual outcomes only after paying a price. Our work is a generalization of this model to other combinatorial optimization problems such as matching, set cover, facility location, and prize-collecting Steiner tree. We give a technique that reduces such problems to their non-price counterparts, and use it to design exact/approximation algorithms to optimize our utility/disutility. Our techniques extend to situations where there are additional constraints on what parameters can be probed or when we can simultaneously probe a subset of the parameters. ∗ Part of this work was done while the authors were visiting the Simons Institute for the Theory of Computing. We are grateful to Anupam Gupta and Viswanath Nagarajan for several discussions on this project. † Computer Science Department, Carnegie Mellon University, Pittsburgh, PA 15213, USA. Email: [email protected]. Research supported in part by a CMU Presidential Fellowship and NSF awards CCF-1319811, CCF-1536002, CCF-1540541, and CCF-1617790. 1 Introduction Suppose we want to purchase a house. We have some idea about the value of every available house in the market, say based on its location, size, and photographs. However, to find the exact value of a house we have to hire a house inspector and pay her a price. Our utility is the difference in the value of the best house that we find and the total inspection prices that we pay. We want to design a strategy to maximize our utility. The above problem can be modeled as Weitzman’s “Pandora’s box” problem [Wei79]. Given probability distributions of n independent random variables Xi and given their probing prices πi , the problem is to adaptively probe a subset Probed ⊆ [n] to maximize the expected utility: " # X E max {Xi } − πi . i∈Probed i∈Probed Weitzman gave an optimal adaptive strategy that maximizes the expected utility (naı̈ve greedy algorithms can behave arbitrarily bad: see Section A.1). However, suppose instead of probing values of elements, we probe weights of edges in a graph. Our utility is the maximum-weight matching that we find minus the total probing prices that we pay. What strategy should we adopt to maximize our expected utility? In a different scenario, consider a network design minimization problem. Suppose we wish to lay down a minimum-cost spanning tree in a given graph; however, we only have stochastic information about the edge costs. To find the precise cost Xi of any edge, we have to conduct a study that incurs a price πi . Our disutility is the sum of the tree cost and the total price that we spend on the studies. We want to design a strategy to minimize our expected disutility. An important difference between these two scenarios is that of maximizing utility vs minimizing disutility. Situations like the above often arise where we wish to find a “good” solution to an optimization problem; however, we start with only some partial knowledge about the parameters of the problem. The missing information can be found only after paying a probing price, which we call the price of information. What strategy should we adopt to optimize our expected utility/disutility? In this work we design optimal/approximation algorithms for several combinatorial optimization problems in an uncertain environment where we jointly optimize the value of the solution and the price of information. 1.1 Utility/Disutility Optimization To begin, the above maximum-weight matching problem can be formally modeled as follows. Max-Weight Matching Given a graph G with edges E, suppose each edge i ∈ E takes some random weight Xi independently from a known probability distribution. We can find the exact outcome Xi only after paying a probing price πi . The goal is to adaptively probe a set of edges Probed ⊆ E and select a matching I ⊆ Probed to maximize the expected utility, " # X X Xi − E πi , i∈I i∈Probed where the expectation is over random variables X = (X1 , . . . , Xn ) and any internal randomness of the algorithm. We observe that we can only select an edge if it has been probed and we might select only a subset of the probed edges. This matching problem can be used to model kidney exchanges where testing compatibility of donor-receiver pairs has an associated price. 1 To capture value functions of more general combinatorial problems in a single framework, we define the notion of semiadditive functions. |V | Definition 1.1 (Semiadditive function). We say a function f (I, X) : 2V × R≥0 → R≥0 is semiadditive if there exists a function h : 2V → R≥0 such that X f (I, X) = Xi + h(I). i∈I P For example, in the case of max-weight matching our value function f (I, X) = i∈I Xi is additive, i.e. h(I) = 0. We call these functions semiadditive because the second term h(I) is allowed to effect the function in a “non-additive” way; however, not depending on X. Here are some other examples. • Uncapacitated Facility Location: Given a graph G = (V, E) with metric (V, d), C LIENTS ⊆ V , and facility opening costs X : V → R≥0 , we wish to open facilities at some locations I ⊆ V . The function is the sum of facility opening costs and the connection costs to C LIENTS . Hence, X X f (I, X) = Xi + min d(j, i). (1) i∈I Here h(I) = P j∈C LIENTS mini∈I d(j, i) j∈C LIENTS i∈I only depends on I, and not on facility opening costs X. • Prize-Collecting Steiner Tree: Given a graph G = (V, E) with some edge costs c : E → R≥0 , a root node r ∈ V , and penalties X : V → R≥0 . The goal is to find a tree that connects a subset of nodes to r, while trying to minimize the cost of the tree and the sum of the penalties of nodes I not connected to r. Hence, X f (I, X) = Xi + Min-Steiner-Tree(V \ I), i∈I where Min-Steiner-Tree(V \ I) denotes the minimum cost tree connecting all nodes in V \ I to r. We can now describe an abstract utility-maximization model that captures problems such as Pandora’s box, max-weight matching, and max-spanning tree, in a single unifying framework, Utility-Maximization Suppose we are given a downward-closed (packing)1 constraint F ⊆ 2V and a semiadditive function val. Each element i ∈ V takes a value Xi independently from a known probability distribution. To find the outcome Xi we have to pay a known probing price πi . The goal is to adaptively probe a set of elements Probed ⊆ V and select I ⊆ Probed that is feasible (i.e., I ∈ F) to maximize the expected utility, # " X E val(I, X) − πi , i∈Probed where the expectation is over random variables X and any internal randomness of the algorithm. For example, in the max-weight matching problem val is an additive function and a subset of edges I is feasible if they form a matching. Similarly, when val is additive and F is a matroid, this framework captures max-weight matroid rank function, which contains Pandora’s box and max-spanning tree as special cases. The following is our main result for the utility-maximization problem: An independence family F ⊆ 2V is called downward-closed if A ∈ F implies B ∈ F for any B ⊆ A. A set-system is called upward-closed if its complement is downward-closed. 1 2 Theorem 1.2. For the utility-maximization problem for additive value functions and various packing constraints F, we obtain the following efficient algorithms. • k-system2 : For stochastic element values, we get a k-approximation. • Knapsack: For stochastic item values and known item sizes, we get a 2-approximation. Some important corollaries of Theorem 1.2 are an optimal algorithm for the max-weight matroid rank problem3 and a 2-approximation algorithm for the max-weight matching problem. Theorem 1.2 is particularly interesting because it gives approximation results for mixed-sign objectives, which are usually difficult to handle. We also show that if val is allowed to be any monotone submodular function then one cannot obtain good √ approximation results: there is an Ω̃( n) hardness even in a deterministic setting (see Section A.3 ). Next, we describe a disutility-minimization model that captures problems like the min-cost spanning tree. Disutility-Minimization Suppose we are given an upward-closed (covering) constraints F ′ ⊆ 2V and a semiadditive function cost. Each element i ∈ V takes a value Xi independently from a known probability distribution. To find the outcome Xi we have to pay a known probing price πi . The goal is to adaptively probe a set of elements Probed ⊆ V and select I ⊆ Probed that is feasible (i.e., I ∈ F ′ ) to minimize the expected disutility, " # X E cost(I, X) + πi , i∈Probed where the expectation is over random variables X and any internal randomness of the algorithm. For example, in the min-cost spanning tree problem, cost is an additive function and a subset of edges I are in F ′ if they contain a spanning tree. Similarly, when val is the semiadditive facility location function as defined in Eq. (1) and every non-empty subset of V is feasible in F ′ , this captures the min-cost facility location problem. Remark: The disutility-minimization problem can be also modeled as a utility-maximization problem by allowing item values to be negative and working with the infeasibility constraints (if A ∈ F ′ then V \ A ∈ F), but such a transformation is not approximation factor preserving. We now mention our results in this model. (See Section 4 for formal descriptions of these problems). Theorem 1.3. For the disutility-minimization problem for various covering constraints F ′ , we obtain the following efficient algorithms. • Matroid Basis: For stochastic element costs, we get the optimal adaptive algorithm. • Set Cover: For stochastic costs of the sets, we get a min{O(log |V |), f }-approximation, where V is the universe and f is the maximum number of sets in which an element can occur. • Uncapacitated Facility Location: For stochastic facility opening costs in a given metric, we get a 1.861-approximation. max (|A|) An independence family F ⊆ 2V is a k-system if for any Y ⊆ V we have min A∈B(Y )(|A|) ≤ k, where B(Y ) denotes the A∈B(Y ) set of maximal independent sets of F included in Y [CCPV11]. These are more general than intersection of k matroids: e.g., a 2-system captures matching in general graphs and a k-system captures matching in a hypergraph with edges of size at most k. 3 For weighted matroid rank functions, Kleinberg et al. [KWW16] independently obtain a similar result. 2 3 • Prize-Collecting Steiner Tree: For stochastic penalties in a given graph with given edge costs, we get a 3-approximation. • Feedback Vertex Set: For stochastic vertex costs in a given graph we get an O(log n)-approximation. 1.2 Constrained Utility-Maximization Our techniques can extend to settings where we impose restrictions on the set of elements that we can probe. In particular, we are given a downward-closed set system J and the constraints allow us to only probe a subset of elements Probed ∈ J . This is different from the model discussed in Section 1.1 as earlier we could probe any set of elements but could get value for only a subset elements that belong to F. As an example, consider a generalization of the Pandora’s box problem where besides paying probing prices, we can only probe at most k elements. We now formally define our problem. Constrained Utility-Maximization Suppose we are given downward-closed probing constraints J ⊆ 2V and probability distributions of independent non-negative variables Xi for i ∈ V . To find Xi we have to pay a probing price πi . The goal is to probe a set of elements Probed ∈ J to maximize the expected utility, " # X E max {Xi } − πi . i∈Probed i∈Probed Remark: One can define an even more general version of this problem where we simultaneously have both downward-closed set systems F and J , and the goal is to maximize a semiadditive function val corresponding to F, while probing a set feasible in J . For ease of exposition, we do not discuss it here and consider our value function to be the max function, as in the original Pandora’s box problem. Depending on the family of constraints J , we design efficient approximation algorithms for some settings of the above problem. The following is our main result for this problem (proof in Section 5.1). Theorem 1.4. If the constraints J form an ℓ-system then the constrained utility-maximization problem has a 3(ℓ + 1)-approximation algorithm. Since the cardinality (or any matroid) constraint forms a 1-system, an application of Theorem 1.4 gives a 6-approximation algorithm for the Pandora’s box problem under a cardinality probing constraint. The above constrained utility-maximization problem is powerful and can be used as a framework to study variants of Pandora’s box. For example, consider the Pandora’s box problem where we also allow to select an unprobed box i and get value E[Xi ], without even paying its probing price πi . This can be modeled using a partition matroid constraint where each box has two copies and the constraints allow us to probe at most one of them. The first copy has a deterministic value E[Xi ] with zero probing price and the second copy has a random value Xi with price πi . Using Theorem 1.4, we get a 6-approximation for this variant. As a non-trivial application of this constrained utility-maximization framework, in Section 5.3 we discuss a set-probing utility-maximization problem where the costs are on subsets of random variables, instead of individual variables. Thus for a subset S ⊆ V , we pay price πS to simultaneously probe all the random variables Xi for i ∈ S. This complicates the problem because to find Xi , we can probe a “small” or a “large” set containing i, but at different prices. Formally, we define the problem as follows. Set-Probing Utility-Maximization Given probability distributions of independent non-negative variables Xi for i ∈ V and given set family S = {S1 , S2 , . . . , Sm }, where Sj ⊆ V for j ∈ [m] has a probing price 4 πj ≥ 0. The problem is to probe some of the sets in S with indices in Probed ⊆ [m] to maximize   X E max {Xi } − πj  . ∃j∈Probed s.t. Sj ∋i j∈Probed Note that when we probe multiple sets containing an element i, we find the same value Xi and not a fresh sample from the distribution. Remark: If the sets Sj are pairwise disjoint then one can solve the above problem optimally: replacing each set Sj with a new random variable Xj′ = maxi∈Sj {Xi } having probing price πj reduces it to Pandora’s box. We use the constrained utility-maximization problem framework to show the following result. Theorem 1.5. The set-probing utility-maximization problem has a 3(ℓ + 1)-approximation efficient algorithm, where ℓ is the size of the largest set in S. Moreover, no efficient algorithm can be o(ℓ/ log ℓ)approximation, unless P = N P . 1.3 Our Techniques How do we bound the utility/disutility of the optimal adaptive strategy? The usual techniques in approximation algorithms for stochastic problems (see related work in Section 1.4) either use a linear program (LP) to bound the optimal strategy, or directly argue about the adaptivity gap of the optimal decision tree. Neither of these techniques is helpful because the natural LPs fail to capture a mixed-sign objective—they wildly overestimate the value of the optimal strategy. On the other hand, the adaptivity gap of our problems is large even for the special case of the Pandora’s box problem—see an example in Section A.2. We need two crucial ideas for both our utility-maximization and disutility-minimization results. Our first idea is to show that for semiadditive functions, one can bound the utility/disutility of the optimal strategy in the price-of-information world (hereafter, the PoI world) using a related instance in a world where there is no price to finding the parameters, i.e., πi = 0 (hereafter, the Free-Info world). This new instance still has independent random variables, however, the distributions are modified based on the original probing price πi (see Defn 2.2). This proof crucially relies on the semiadditive nature of our value/cost function. Our second idea is to show that any algorithm with “nice” properties in the Free-Info world can be used to get an algorithm with a similar expected utility/disutility in the PoI world. We call such a nice algorithm F RUGAL (and define it formally in Section 3.1). For intuition, imagine a F RUGAL algorithm to be a greedy algorithm, or an algorithm that is not “wasteful”—it picks elements irrevocably. This also includes simple primal-dual algorithms that do not have the reverse-deletion step. Theorem 1.6. If there exists a F RUGAL α-approximation Algorithm A to maximize (minimize) a semiadditive function over some packing constraints F (covering constraints F ′ ) in the Free-Info world then there exists an α-approximation algorithm for the corresponding utility-maximization (disutility-minimization) problem in the PoI world. Finally, to prove our results from Section 1.1, in Section 4 we show why many classical algorithms, or their suitable modifications, are F RUGAL. We remark that although Theorem 1.6 gives good guarantees for several combinatorial problems in the PoI world, there are some natural problems where there are no good F RUGAL algorithms. One such important problem is to find the shortest s − t path in a given graph with stochastic edge lengths. It’s an interesting 5 open question to find some approximation guarantee for this problem. Another interesting open question is to show that finding the optimal policy for the max-weight matching in the PoI world is hard. Our techniques for the constrained utility-maximization problem in Section 5 again use the idea of bounding this problem in the PoI world with a similar problem in the Free-Info world. This latter problem turns out to be the same as the stochastic probing problem studied in [GN13, ASW16, GNS16, GNS17]. By proving an extension of the adaptivity gap result of Gupta et al. [GNS17], we show that one can further simplify these Free-Info problems to non-adaptive utility-maximization problems (by losing a constant factor). This we can now (approximately) solve using our techniques for the utility-maximization problem. 1.4 Related Work An influential work of Dean et al. [DGV04] considered the stochastic knapsack problem where we have stochastic knowledge about the sizes of the items. Chen et al. [CIK+ 09] studied stochastic matchings where we find about an edge’s existence only after probing, and Asadpour et al. [ANS08] studied stochastic submodular maximization where the items may or may not be present. Several followup papers have appeared, e.g. for knapsack [BGK11, Ma14], packing integer programs [DGV05, CIK+ 09, BGL+12], budgeted multiarmed bandits [GM12, GM07, GKMR11, LY13, Ma14], orienteering [GM09, GKNR12, BN14], matching [Ada11, BGL+ 12, BCN+ 15, AGM15], and submodular objectives [GN13, ASW16]. Most of these results proceed by showing that the stochastic problem has a small adaptivity gap and then focus on the nonadaptive problem. In fact, Gupta et al. [GNS17, GNS16] show that adaptivity gap for submodular functions over any packing constraints is O(1). Most of the above works do not capture mixed-sign objective of maximizing the value minus the prices. Some of them instead model this as a knapsack constraint on the prices. Moreover, most of them are for maximization problems as for the minimization setting even the non-adaptive problem of probing k elements to minimize the expected minimum value has no polynomial approximation [GGM10]. This is also the reason we do not consider constrained (covering) disutility-minimization in Section 1.2. There is also a large body of work in related models where information has a price. We refer the readers to the following papers and the references therein [GK01, CFG+ 02, KK03, GMS07, CJK+ 15, AH15, CHKK15]. The Pandora’s box solution can be written as a special case of the Gittins index theorem [Git74]. Dumitriu et al. [DTW03] consider a minimization variant of the Gittins index theorem when there is no discounting. Another very relevant paper is that of Kleinberg et al. [KWW16], while their results are to design auctions. Their proof of the Pandora’s box problem inspired this work. Organization In Section 2 we show how to bound the optimal strategy in the PoI world using a corresponding problem in the Free-Info world. In Section 3 we introduce the idea of using a F RUGAL algorithm to design a strategy with a good expected utility/disutility in the PoI world. In Section 4 we show why many classical algorithms, or their suitable modifications, are F RUGAL. Finally, in Section 5 we discuss the settings where we have probing constraints, and its application to the set-probing problem. 2 Bounding the Optimal Strategy for Utility/Disutility Optimization In this section we bound the expected utility/disutility of the optimal adaptive strategy for a combinatorial optimization in the PoI world in terms of a surrogate problem in the Free-Info world. We first define the 6 grade τ and surrogate Y of non-negative random variables. Definition 2.1 (Grade τ ). For any non-negative random variable Xi , let τimax be the solution to equation E[(Xi − τimax )+ ] = πi and let τimin be the solution to equation E[(τimin − Xi )+ ] = πi . Definition 2.2 (Surrogate Y ). For any non-negative random variable Xi , let Yimax = min{Xi , τimax } and let Yimin = max{Xi , τimin }. Note that τimax could be negative in the above definition. The following lemmas bound the optimal strategy in the PoI world in terms of the optimal strategy of a surrogate problem in the Free-Info world. Lemma 2.3. The expected utility of the optimal strategy to maximize a semiadditive function val over packing constraints F in the PoI world is at most EX [max{val(I, Y max )}]. I∈F Lemma 2.4. The expected disutility of the optimal strategy to minimize a semiadditive function cost over covering constraints F ′ in the PoI world is at least EX [min′ {cost(I, Y min )}]. I∈F We only prove Lemma 2.3 as the proof of Lemma 2.4 is similar. The ideas in this proof are similar to that of Kleinberg et al. [KWW16, Lemma 1] to bound the optimal adaptive strategy for Pandora’s box. Proof of Lemma 2.3. Consider a fixed optimal adaptive strategy. Let Ai denote the indicator variable that element i is selected into I and let 1i denote the indicator variable that element i is probed by the optimal strategy. Note that these indicators are correlated and the set of elements with non-zero Ai is feasible in F. Now, the optimal strategy has expected utility # " X = E val(I, X) − πi i∈Probed =E " X i =E " X i # (Ai Xi − 1i πi ) + E[h(I)] #  Ai Xi − 1i EXi [(Xi − τimax )+ ] + E[h(I)], using the definition of πi . Since value of Xi is independent of whether it’s probed or not, we simplify to =E " X i #  Ai Xi − 1i (Xi − τimax )+ + E[h(I)]. 7 Moreover, since we can select an element into I only after probing, we have 1i ≥ Ai . This implies that the expected utility of the optimal strategy is # " X  max + + E[h(I)] Ai Xi − Ai (Xi − τi ) ≤E i =E " X i # Ai Yimax + E[h(I)] = E[val(I, Y max )]. Finally, since elements in I form a feasible set, this is at most E[maxI∈F {val(I, Y max )}]. 3 Designing an Adaptive Strategy for Utility/Disutility Optimization In this section we introduce the notion of a F RUGAL algorithm and prove Theorem 1.6. We need the following notation. Definition 3.1 ( YM ). For any vector Y with indices in V and any M ⊆ V , let YM denote a vector of length |V | with entries Yj for j ∈ M and a symbol ∗, otherwise. 3.1 A F RUGAL Algorithm The notion of a F RUGAL algorithm is similar to that of a greedy algorithm, or any other algorithm that is not “wasteful”—it selects elements one-by-one and irrevocably. Its definition captures “non-greedy” algorithms such as the primal-dual algorithm for set cover that does not have the reverse-deletion step. We define a F RUGAL algorithm in the packing setting. Consider a packing problem in the Free-Info V world (i.e., ∀i, πi = 0 ) where we want to find a feasible set I ∈ F and F ⊆ P2 are some downward-closed constraints, while trying to maximize a semiadditive function val(I, Y) = i∈I Yi + h(I). Definition 3.2 (F RUGAL Packing Algorithm). For a packing problem with constraints F and value function val, we say Algorithm A is F RUGAL if there exists a marginal-value function g(Y, i, y) : RV × V × R≥0 → R≥0 that is increasing in y, and for which the pseudocode is given by Algorithm 1. We note that this algorithm always returns a feasible solution if we assume ∅ ∈ F. Algorithm 1 F RUGAL Packing Algorithm A Start with M = ∅ and vi = 0 for each element i ∈ V . 2: For each element i 6∈ M , compute vi = g(YM , i, Yi ). Let j = argmaxi6∈M 3: If vj > 0 then add j into M and go to Step 2. Otherwise, return M . 1: & M ∪i∈F {vi }. A simple example of a F RUGAL packing algorithm is the greedy algorithm to find the maximum weight spanning tree (or to maximize any weighted matroid rank function), where g(YM , i, Yi ) = Yi . We similarly define a F RUGAL algorithm in the covering setting. Consider a covering problem in the ′ ⊆ 2V is some upward-closed Free-Info world where we want to find a feasible set I ∈ F ′ , where FP constraint, while trying to minimize a semiadditive function cost(I, Y) = i∈I Yi + h(I). 8 Definition 3.3 (F RUGAL Covering Algorithm). For a covering problem with constraints F ′ and cost function cost, we say Algorithm A is F RUGAL if there exists a marginal-value function g(Y, i, y) : RV≥0 × V × R≥0 → R≥0 that is increasing in y, and for which the pseudocode is given by Algorithm 2. Algorithm 2 F RUGAL Coverage Algorithm A Start with M = ∅ and vi = 0 for each element i ∈ V . For each element i 6∈ M , compute vi = g(YM , i, Yi ). Let j = argmaxi6∈M {vi }. 3: If vj > 0 then add j into M and go to Step 2. Otherwise, return M . 1: 2: We note that for a covering problem it is unclear whether Algorithm 2 returns a feasible solution as we do not appear to be looking at our covering constraints F ′ . To overcome this, we say the marginal-value function g encodes F ′ if whenever M is infeasible then there exists an element i 6∈ M with vi > 0. This means that the algorithm will return a feasible solution as long as V ∈ F ′ . A simple example algorithm is the greedy min-cost set cover algorithm, where  Sof a F RUGAL covering  S g(YM , i, Yi ) = | j∈M ∪i Sj | − | j∈M Sj | /Yi . Note that here g encodes our coverage constraints. Remark: Observe that a crucial difference between F RUGAL packing and covering algorithms is that a F RUGAL packing algorithm has to handle Y ∈ RV (i.e. some entries in Y could be negative) but a F RUGAL covering algorithm has to only handle Y ∈ RV≥0 . The intuition behind this difference is that unlike the disutility minimization problem, the utility maximization problem has a mixed-sign objective. 3.2 Using a F RUGAL Algorithm to Design an Adaptive Strategy After defining the notion of a F RUGAL algorithm, we can now prove Theorem 1.6 (restated below). Theorem 1.6. If there exists a F RUGAL α-approximation Algorithm A to maximize (minimize) a semiadditive function over some packing constraints F (covering constraints F ′ ) in the Free-Info world then there exists an α-approximation algorithm for the corresponding utility-maximization (disutility-minimization) problem in the PoI world. We prove Theorem 1.6 only for the utility-maximization setting as the other proof is similar. Lemma 2.3 already gives us an upper bound on the expected utility of the optimal strategy for the utility-maximization problem in terms of the expected value of a problem in the Free-Info world. This Free-Info problem can be solved using Algorithm A. The main idea in the proof of this theorem is to show that if Algorithm A is F RUGAL then we can also run a modified version of A in the PoI world and get the same expected utility. Proof of Theorem 1.6. Let Alg(Y max , A) denote the set I ∈ F returned by Algorithm A when it runs with element weights Y max . Since A is an α-approximation algorithm (where α ≥ 1), we know val(Alg(Y max , A), Y max ) ≥ 1 · max{val(I, Y max )}. α I∈F (2) The following crucial lemma shows that one can design an adaptive strategy in the PoI world with the same expected utility. 9 Lemma 3.4. If Algorithm A is F RUGAL then there exists an algorithm in the PoI world with expected utility EX [val(Alg(Y max , A), Y max )]. Before proving Lemma 3.4, we finish the proof of Theorem 1.6. Recollect that Lemma 2.3 shows that E[maxI∈F {val(I, Y max )] is an upper bound on the expected optimal utility in the PoI world. Combining this with Lemma 3.4 and Eq. (2) gives an α-approximation algorithm in the PoI world. We first give some intuition for the missing Lemma 3.4. The lemma is surprising because it says that there exists an algorithm in the PoI world that has the same expected utility as Algorithm A in the Free-Info world, where there are no prices. The fact that in the Free-Info world Algorithm A can only get the smaller surrogate values Yimax = min{Xi , τimax }, instead of the actual value Xi , comes to our rescue. We show that Y max is defined in a manner to balance this difference in the values with the probing prices. Proof of Lemma 3.4. Since A is F RUGAL, we would like to run Algorithm 1 in the PoI world. The difficulty is that we do not know Y max values of the unprobed elements. To overcome this hurdle, consider Algorithm 3 that uses the grade τ max as a proxy for Y max values of the unprobed elements. Claim 3.5. The set of elements returned by Algorithm 3 is the same as that by Algorithm 1 running with Y = Y max . Proof of Claim 3.5. We prove the claim by induction on the number of elements selected by Algorithm 3. Suppose the set of elements selected by both the algorithms into M are the same till now and Algorithm 3 decides to select element j in Step 3(a). This means that j is already probed before this step. The only concern is that Algorithm 3 selects j without probing some other element i based on its grade τimax . We max , i, Y max ) is an observe that this step is consistent with Algorithm 1 because Yimax ≤ τimax and g(YM i max increasing function in Yi , which implies max g(YM , i, Yimax ) ≤ max g(YM , i, τimax ) max g(YM , i, Yjmax ). ≤ An immediate corollary is that value of Algorithm 3 in the Free-Info world is EX [val(Alg(Y max , A), Y max )]. (3) In Claim 3.6 we argue that this expression also gives expected utility of Algorithm 3 in the PoI world, which completes the proof of Lemma 3.4. Claim 3.6. The expected utility of Algorithm 3 in PoI world is EX [val(Alg(Y max , A), Y max )]. Proof of Claim 3.6. We first expand the claimed expression,  X EX [val(Alg(Y max , A), Y max )] = E  i∈Alg(Ymax ,A)  Yimax  + E[h(Alg(Y max , A))]. (4) Observe that to prove the claim we can ignore the second term, E[h(Alg(Y max , A))], because it contributes the same in both the worlds (it is only a function of the returned feasible set). We now argue that in every 10 Algorithm 3 Utility-Maximization Start with M = ∅ and vi = 0 for all elements i. 2: For each element i 6∈ M : max , i, Y max ). (a) if i is probed let vi = g(YM i max , i, τ max ). (b) if i is unprobed let vi = g(YM i 3: Consider the element j = argmaxi6∈M & M ∪i∈F {vi } and vj > 0. (a) If j is already probed then select it into M and set vj = 0. (b) If j is not probed then probe it. If Xj ≥ τjmax then select j into M and set vj = 0. 4: If every element i 6∈ M has vi = 0 then return set M . Else, go to Step 2. 1: P max in the Free-Info world is the same as the expected step of Algorithm 3 the expected change in i∈M Yi P increase in i∈M Xi minus the probing prices in the PoI world. We first consider the case when the next highest element j in Step 3 of Algorithm 3 is already probed and has vj > 0. In this case, the algorithm selects element j. Since this element has been already probed before (but not selected then), it means Xj < τjmax and Xj = Yjmax . Hence the increase in the value of the algorithm in both the worlds is Xj . Next, consider the case that the next highest element j in Step 3 has not been probed before. Let µj denote the probability density function of random variable Xj . Now the expected increase in the value in the Free-Info world is Z ∞ max max max µj (t)dt. τj · Pr[Xj ≥ τj ] = τj · t=τjmax This is because the algorithm selects this element in this step only if its value is at least τjmax , in which case Yjmax = τjmax . On the other hand, the expected increase in the value in the PoI world is given by −πj + Z ∞ t=τjmax t · µj (t)dt. This is because we pay the probing cost πj and get a positive value Xj only when Xj ≥ τjmax . Now using the definition of τjmax , we can simplify the above equation to − Z ∞ t=τjmax (t − τjmax )µj (t)dt + Z ∞ t=τjmax t · µj (t)dt = τjmax · Z ∞ t=τjmax µj (t)dt. This shows that in every step of the algorithm the expected increase in the value in both the worlds is the same, thereby proving Claim 3.6. 4 Applications to Utility/Disutility Optimization In this section we show that for several combinatorial problems there exist F RUGAL algorithms. Hence we can use Theorem 1.6 to obtain optimal/approximation algorithms for the corresponding utility-maximization or disutility-minimization problem in PoI world. 11 4.1 Utility-Maximization To recollect, in the utility-maximization setting we are given a semiadditive value function val ≥ 0 and a packing constraint F. Our goal is to probe a set of elements Probed and select a feasible set I ⊆ Probed in F to maximize expected utility, # " X E val(I, X) − πi . i∈Probed We assume that ∅ ∈ F and hence there always exist a solution of utility zero. 4.1.1 k-System P Let val(I, X) = i∈I Xi be an additive function and let F denote a k-system constraint in this setting. To prove Theorem 1.2, we observe that the greedy algorithm that starts with an empty set and at every step selects the next feasible element maximum marginal-value is an α-approximation algorithm is a F RUGAL algorithm as defined in Defn 3.2. We know that this greedy algorithm is a k-approximation for additive functions over a k-system in Free-Info world [Jen76, KH78]. Hence, Theorem 1.6 combined with the greedy algorithm gives the k-system part of Theorem 1.2 as a corollary. 4.1.2 Knapsack Given a knapsack of size B, suppose each item i has a known size si (≤ B) but a stochastic value Xi . To find Xi , we have to P pay probing price πi . The goal is to probe a subset of items Probed and select a subset I ⊆ Probed, where i∈I si ≤ B, to maximize the expected utility # " X X Xi − πi . E i∈I i∈Probed We can model this problem in our utility-maximization framework by taking val(I, X) = contain every subset S of items that fit into the knapsack. P i∈I Xi and F to In the Free-Info world, consider a greedy algorithm that sorts items in decreasing order based on the ratio of their value and size, and then selects items greedily in this order until the knapsack is full. This greedy algorithm does not always give a constant approximation to the knapsack problem. Similarly, an algorithm that selects only the most valuable item is not always a constant approximation algorithm (recollect that we can pick every item i because si ≤ B). However, it’s known that for any knapsack instance if we randomly run one of the previous two algorithms, each w.p. half, then this is a 2-approximation algorithm. From Theorem 1.6, we can simulate the greedy algorithm in the PoI world. Also, using the solution to the Pandora’s box problem, we can simulate selecting the most valuable item in the PoI world. Hence, consider an algorithm that for any given knapsack problem in the PoI world, runs either the simulated greedy algorithm or the Pandora’s box solution, each with probability half. Such an algorithm is a 2-approximation to the knapsack problem in the PoI world. 12 4.2 Disutility-Minimization To recollect, in the disutility-minimization setting we are given a semiadditive cost function cost ≥ 0 and a covering constraint F ′ . Our goal is to probe a set of elements Probed and select a feasible set I ⊆ Probed in F ′ to minimize expected disutility, " # X E cost(I, X) + πi . i∈Probed We will assume that V ∈ F, and hence there always exists a feasible solution. 4.2.1 Matroid Basis P Given a matroid M of rank r on n elements, we consider the additive function cost(I, X) = i∈I Xi and let F ′ be subsets of elements that contain a basis of M. To ensure that a feasible set of finite value exists, we make the following assumption. Assumption 4.1. We can always extend a set I ∈ M to a basis by probing and selecting items with zero penalty but with large probing cost π0 . Thus it incurs an additional penalty of (r − |rank(I)|) · π0 . To use Theorem 1.6, we notice that the greedy algorithm that always selects the minimum cost independent element is F RUGAL. This is true because we choose marginal-value function g to be the reciprocal of the weight of an element in Defn 3.3. Now since the greedy algorithm is optimal for min-cost matroid basis, this proves the first part of Theorem 1.3. 4.2.2 Set Cover Consider a problem where we are given sets S1 , . . . , Sm ⊆ V that have some unknown stochastic costs Xi . The goal is to select a set cover with minimum disutility, which is the sum of the set cover solution costs and the probing model this problem in our framework by considering a the additive function Pprices. We can ′ cost(I, X) = i∈I Xi and F be set covers of V . To ensure that the solution is always bounded, we make the following assumption. Assumption 4.2. There exists S0 = [n] that covers all elements and has X0 = 0, but a finite large π0 . To prove the set cover part of Theorem 1.3, we first notice that the classical O(log |V |) greedy algorithm for the min-cost set cover . This  S problem is F RUGAL  is because the marginal-value function g(YM , i, Yi ) in S Defn 3.3 is equal to | j∈M ∪i Sj | − | j∈M Sj | /Yi . Next we give an f -approximation algorithm, where f is the maximum number of sets in which an element can appear. We observe that the primal-dual f -approximation algorithm (see pseudocode in Algorithm 4) for the min-cost set cover [BYE81, WS11] is also F RUGAL. This is because we can encode the information about the order σ and the dual variables yj for j ∈ M in the marginal-value function g(YM , i, Yi ) in Defn 3.3. 13 Algorithm 4 Primal-dual algorithm for min-cost set cover Fix an order σ on the ground elements. Start with M = ∅ and yj = 0 for every ground element j. S 2: Select the next element j 6∈ i∈M Si according to σ and raise its dual variable yj until some set i P becomes tight, i.e., j∈Si yj = Yi . 3: Select every tight set into M . S 4: If every ground element is covered in i∈M Si then return M , else go to Step 2. 1: 4.2.3 Uncapacitated Facility Location Consider an uncapacitated facility location problem where we are given a graph G = (V, E) with metric (V, d) and C LIENTS ⊆ V , however, facility opening costs Xi for i ∈ V are stochastic and can be found by paying a probing price πi . The goal is to probe a set of facility locations Probed ⊆ V and open a non-empty subset I ⊆ Probed to minimize expected disutility " # X X X d(u, I) + Xi + E πi , u∈C LIENTS i∈I i∈Probed where d(u, I) = mini∈I d(u, i). We model the above problem in our framework by defining exponential number of elements that are indexed by (i, S), for i ∈ V and S ⊆ C LIENTS , which denotes that facility i will serve clients S. Any subset of elements, say I = {(i1 , S1 ), (i2 , S2 ), . . .}, if the union  is feasible  of their clients covers C LIENTS . P P The semiadditive cost(I, X) is given by (i,S)∈I Xi + j∈S d(i, j) . We notice that the 1.861-approximation greedy algorithm of Jain et al. [JMM+ 03] for the uncapacitated facility location problem is F RUGAL. In each step, their algorithm selects the next best element with minimum cost per client, where already opened facilities now have zero opening costs. The reciprocal of this value gives the marginal-value function g. Hence, we can use Theorem 1.6 to obtain a 1.861-approximation strategy. 4.2.4 Prize-Collecting Steiner Tree Consider a Prize-Collecting Steiner tree problem (PCST) where we are given a graph G = (V, E) with some edge costs c : E → R≥0 , a root node r ∈ V , and probability distributions on the independent penalties Xi for i ∈ V . The stochastic penalties Xi can be found by paying a probing price πi . The goal is to probe a set of nodes Probed ⊆ V \ {r} and select a subset I ⊆ Probed to minimize expected disutility, " # X X Xi + Min-Steiner-Tree(V \ I) + E πi , i∈I i∈Probed where Min-Steiner-Tree(V \ I) denotes the minimum cost Steiner tree connecting all nodes in V \ I to r. As discussed in Section 1.1, we can P model the PCST in our disutility-minimization framework by noticing that the function cost(X, I) = i∈I Xi + Min-Steiner-Tree(V \ I) is semiadditive. We show that although the 2-approximation Goemans-Williamson [GW95] algorithm (hereafter, GW-algorithm) for PCST in the Free-Info world is not F RUGAL, it can be modified to obtain a 3-approximation F RUGAL algorithm for PCST. Combining this with Theorem 1.6 gives a 3-approximation algorithm for PCST in the PoI world. 14 We quickly recollect the 2-approximation primal-dual GW-algorithm. (We do not repeat their proof and refer to [WS11, Chapter 14] for details.) Their algorithm starts by making each node i ∈ V \ {r} active with initial charge p({i}) = Xi . At any time, the algorithm grows a moat around each active component C and discharges C at the same rate. If a component C runs out of charge, we make it inactive and mark every unlabeled node in the component with label C. If an edge e becomes tight, we pick e, merge the two components C, C ′ connected by e, make both C, C ′ inactive, and make C ∪ C ′ active with an initial charge of p(C) + p(C ′ ). Any component that hits the component containing r is made inactive. In the cleanup phase we remove all edges that do not disconnect an unmarked node from r, while ensuring that if a component with label C is connected to r then every node with label C ′ ⊇ C is also connected to r. We first observe that the GW-algorithm is not F RUGAL. This is because whenever a node i is labeled with a component C ∋ i, the algorithm looks at the penalty Xi ; however, the decision of whether to select i into I (i.e., not connecting i to r) is not made until the cleanup phase. The reason is that some other active component C ′ might later come and merge with C, and eventually connect i to r. To fix this, we modify this algorithm to make it F RUGAL. The idea is to immediately include the labeled vertices into I. Consider an algorithm that creates the same tree as the GW-algorithm; however, any node that ever gets labeled during the run of the algorithm is imagined to be included into I. This means that although our final tree might connect a labeled node i to r, our algorithm still pays its penalty Xi . We argue that these additional penalties are at most the optimal PCST solution in the Free-Info world, which gives us a 3-approximation F RUGAL algorithm. Finally, to argue that the additional penalties are not large, consider the state of the GW-algorithm before the cleanup phase. Let C denote the set of maximal inactive components. Clearly, each node i that was every labeled belongsP to some P P penalties Pmaximal tight component C ∈ C. Hence, the sum of the additional X . Since each component C ∈ C is tight, we know is upper bounded by i C∈C i∈C Xi = C∈C i∈C P P y , where y are the dual variables corresponding to the moats. Since the dual solutions form S C∈C S⊆C S a feasible dual-solution, they are a lower bound on the optimal solution for the problem. This proves that the additional penalty paid by our F RUGAL algorithm in comparison to GW-algorithm is at most the optimal solution. 4.2.5 Feedback Vertex Set Given an undirected graph G = (V, E), suppose each node i ∈ V has a stochastic weight Xi , which we can find by probing and paying price πi . The problem is to probe a set Probed ⊆ V and select a subset I ⊆ Probed s.t. the induced graph G[V \ I] contains no cycle, while minimizing the expected disutility # " X X Xi + πi . E i∈I i∈Probed can be modeled in our framework by considering the additive function cost(I, X) = P The above problem ′ contains a set of nodes S if G[V \ S] has no cycle. Becker and Geiger [BG96] showed that X and F i i∈I the greedy Algorithm 5 is an O(log n)-approximation algorithm for the feedback vertex set problem in the Free-Info world. Since this algorithm is F RUGAL, using Theorem 1.6 we get an O(log n)-approximation algorithm for minimizing disutility for the feedback vertex set problem in the PoI world. Remark: The O(log n)-approximation primal-dual algorithm in [BYGNR98] (or in Chapter 7.2 of [WS11]) can be also shown to be F RUGAL. This gives another O(log n)-approximation algorithm for minimizing 15 Algorithm 5 Greedy Algorithm for Feedback Vertex Set 1: 2: 3: 4: 5: Start with R = M = ∅ and vi = 0 for each element i ∈ V . While ∃i ∈ V \ (R ∪ M ) s.t. degree of i in G[V \ (R ∪ M )] is 0 or 1, add i to R. For each element i 6∈ R ∪ M , compute vi = degree(i, G[V \ (R ∪ M )])/w(i), where degree(i, G) is the degree of vertex i in G and w(i) is the weight of vertex i. Let j = argmaxi6∈R∪M {vi }. Add j to M . If R ∪ M 6= V , go to Step 2. Otherwise, return M . disutility for feedback vertex set problem. 5 Constrained Utility-Maximization In this section we consider a generalization of the Pandora’s box problem where we have an additional constraint that allows us to only probe a subset of elements Probed ⊆ V that belongs to a downward-closed constraint J (e.g., a cardinality constraint allowing us to probe at most k elements). We restate our main result for the constrained utility-maximization problem (see problem definition in Section 1.2). Theorem 1.4. If the constraints J form an ℓ-system then the constrained utility-maximization problem has a 3(ℓ + 1)-approximation algorithm. Similar to Section 2, our strategy to prove Theorem 1.4 is to bound the constrained utility-maximization problem in the PoI world (a mixed-sign objective function) with a surrogate constrained utility-maximization problem in the Free-Info world (i.e., where πi = 0 for all i ∈ V ). This latter problem turns out to be the same as the stochastic probing problem, which we define below in the form that is relevant to this paper. Stochastic Probing Given downward-closed probing constraints J ⊆ 2V and probability distributions of independent non-negative variables Yi for i ∈ V , the stochastic probing problem is to adaptively probe a subset Probed ∈ J to maximize the expected value E[maxi∈Probed {Yi }]. Here, adaptively means that the decision to probe which element next can depend on the outcomes of the already probed elements. 5.1 Reducing Constrained Utility-Maximization to Non-adaptive Stochastic Probing The following lemma bounds the expected utility of the constrained utility-maximization problem in the PoI world by the expected value of a stochastic probing problem in the Free-Info world. Lemma 5.1. The expected utility of the optimal strategy for the constrained utility-maximization problem is at most the expected value of the optimal adaptive strategy for a stochastic probing problem with the same constraints J and where the random variables Yi for i ∈ V have probability distributions Yimax (recollect, Defn 2.2). Proof of Lemma 5.1. We start by noticing that the optimal strategy for our problem is given by a decision tree T with leaves l. For any root leaf path Pl , the value of the optimal strategy is maxi∈Pl {Xi } − π(Pl ). Thus the expected value of the optimal strategy is   El max{Xi } − π(Pl ) . (5) i∈Pl 16 Now we design an adaptive strategy for the stochastic probing problem on random variables Yimax with expected value at least as given by Eq. (5). Consider the adaptive strategy that follows the same decision tree T (note, it pays no probing price). The expected value of such an adaptive strategy is given by   max El max{Yi } . (6) i∈Pl The following claim finishes the proof of this lemma. Claim 5.2. Eq. (5) ≤ Eq. (6). Proof. Let Al (i) and 1i∈Pl denote indicator variables that element i is selected and probed on a root-leaf path Pl of the optimal strategy, respectively. Note that these indicator variables are correlated. The expected utility of the optimal strategy equals # "   X (Al (i)Xi − 1i∈Pl πi ) El max{Xi } − π(Pl ) = El i∈Pl i = El " = El " X Al (i)Xi − 1i∈Pl Ei [(Xi − i τimax )+ ] #  Al (i)Xi − 1i∈Pl (Xi − τimax )+ X i  # since Xi is independent of 1i∈Pl . Now using Al (i) ≤ 1i∈Pl , # " X  max + Al (i)Xi − Al (i)(Xi − τi ) ≤ El i where the last inequality uses P = El " ≤ El  i∈Pl X Al (i)Yimax i  max{Yimax } i∈Pl # , Al (i) ≤ 1. The following Lemma 5.3 shows that we can further simplify the stochastic probing problem in the FreeInfo world by focusing only on finding the best non-adaptive strategy for this problem, i.e. the problem of finding argmaxProbed∈J {maxi∈Probed {Yi }}. This is because the adaptivity gap—ratio of the expected values of the optimal adaptive and optimal non-adaptive strategies—for the stochastic probing problem is small. Lemma 5.3. The adaptivity gap for the stochastic probing problem is at most 3. We prove Lemma 5.3 in Section 5.2. It tells us about the existence of a feasible set S ∈ J such that E[maxi∈S {Yimax }] is at least 1/3 times the optimal adaptive strategy for the stochastic probing problem. Suppose we have an oracle to (approximately) find this feasible set S for probing constraints J . 17 Assumption 5.4. Suppose there exists an oracle that finds S ∈ J that β approximately maximizes the non-adaptive stochastic probing solution. The above assumption is justifiable as it is a constrained submodular maximization problem that we know how to approximately solve for some many constraint families J , e.g., an ℓ-system. Lemma 5.5 (Greedy Algorithm [FNW78, CCPV11]). The greedy algorithm has an (ℓ + 1)-approximation for monotone submodular maximization over an ℓ-system. Finally, we need to show that given S there exists an efficient adaptive strategy in the PoI world with expected utility E[maxi∈S {Yimax }]. But this is exactly the Pandora’s box problem for which we know that Weitzman’s index-based policy is optimal with expected utility E[maxi∈S {Yimax }]. The above discussion can be summarized in the following theorem. Theorem 5.6. Given a β-approximation oracle for monotone submodular maximization over downwardclosed constraints J , there exists a 3β-approximation algorithm for constrained utility-maximization. Combining Lemma 5.5 and Theorem 5.6, we get Theorem 1.4 as a corollary. 5.2 Bounding the Adaptivity Gap In this section we prove Lemma 5.3 by generalizing a similar result for Bernoulli variables of Gupta et al. [GNS17] to functions that are given by weighted matroid rank function. We do this by reducing the problem for discrete random variables to a Bernoulli setting. Lemma 5.7. The adaptivity gap for the stochastic probing problem for discretely distributed non-negative random variables is bounded by that for Bernoulli distributed non-negative random variables. Proof. Let us assume that each P random variable Yi takes value in a discrete set {v1 , v2 , . . . , vm }, where it takes value vj w.p. pj and j pj = 1. (Note that pj is a function of i but we don’t write index i for ease of exposition.) Consider the optimal adaptive strategy decision tree T for the stochastic probing problem; here each node has at most m children. We modify T to obtain a binary decision tree T ′ , which shows one can transform the instance to an instance with Bernoulli random variables and the same adaptivity gap. The idea is to replace every node i in T with m binary decision variables in T ′ , where variable j is active w.p. Ppj 1− pk . If active, variable j leads to the subtree corresponding to the case when Yi take value vj in T . k<j The two trees are equivalent because the probability that variable Yi takes value vj in T ′ is exactly ! ! P Y Y 1 − k≤j ′ pk pj ′ pj p P P P Pj 1− · · = = 1 − k<j ′ pk 1 − k<j pk 1 − k<j ′ pk 1 − k<j pk ′ ′ j <j pj . j <j To finish the proof of Lemma 5.3, we combine Lemma 5.7 with the following result of Gupta et al. Lemma 5.8 ([GNS17]). The adaptivity gap for the stochastic probing problem for Bernoulli random variables over any given downward-closed constraints is at most 3. 18 5.3 An Application to the Set-Probing Utility-Maximization Problem In this section we see an application of the constrained utility-maximization framework to the set-probing utility-maximization problem defined in Section 1.2. This problem is a generalization of Pandora’s box where we pay a price to simultaneously find values of a set of random variables. We restate Theorem 1.5 for convenience. Theorem 1.5. The set-probing utility-maximization problem has a 3(ℓ + 1)-approximation efficient algorithm, where ℓ is the size of the largest set in S. Moreover, no efficient algorithm can be o(ℓ/ log ℓ)approximation, unless P = N P . The remaining section discusses the approximation algorithm. See the hardness proof in Section A.4. We first observe that WLOG one can assume that the given sets S = {S1 , . . . , Sm } are downwardclosed, i.e., if S ∈ S then any subset T ⊆ S is also in S. This is because a simple way to ensure downwardclosedness is by adding every subset of Sj for the same price πj into S. Intuitively, this is equivalent to paying for the original set but choosing not to see the outcome of some of the random variables in it. To construct our algorithm, we imagine solving a constrained utility-maximization problem. The random variables of this problem are indexed by sets S ∈ S: variable XS has value maxi∈S {Xi } and has price πS . The problem is to adaptively probe some elements such that the sets corresponding to them are pairwise disjoint (a downward-closed constraint J ), while the goal is to maximize the utility that is given by max element value minus the total probing prices. Intuitively, the reason we need disjointness is to ensure independence between sets in our analysis as disjoint sets of random variables take values independently. We make the following simple observation. Observation 5.9. The optimal adaptive policy for this constrained utility-maximization problem with disjointness constraints is the same as the unconstrained set-probing utility-maximization problem. Given the above observation and noting that disjointness constraints are downward-closed, we want to use Theorem 5.6 to reduce our problem into a non-adaptive optimization problem. Although it appears that this is not possible because Theorem 5.6 is only for independent variables, and variables corresponding to non-disjoint sets are not independent. Fortunately, the proof of Theorem 5.6 only uses independence of random variables along any root-leaf path of the decision tree. Since our probing constraints ensure that the probed sets are disjoint, we get variables XS along any root-leaf path to be independent, thereby allowing us to use Theorem 5.6. The final part in the proof of Theorem 1.5 is an approximation algorithm for this non-adaptive constrained utility-maximization problem. Lemma 5.10. There exists an efficient (ℓ + 1)-approximation algorithm for the non-adaptive problem of finding a family S ′ ⊆ S of disjoint sets to maximize E[maxS∈S ′ {YSmax }]. Proof. Observe that the function g(S ′ ) = E[maxS∈S ′ {YSmax }] is submodular. Also, the disjointness constraints can be viewed as an ℓ-system constraints since each set S has size at most ℓ. Thus we can view the non-adaptive problem as maximizing a submodular function over an ℓ-system, where we know by Lemma 5.5 that the greedy algorithm has an (ℓ + 1)-approximation. Moreover, to implement the greedy algorithm efficiently, we note that although S may contain an exponential number of elements, the initial set system S was polynomial sized (before we made S downwardclosed). For sets A, B available at the same price, where A ⊆ B, it is obvious that the greedy algorithm will 19 always choose B before A. Hence, at every step our greedy algorithm only needs to consider the original sets, which are only polynomial in number, and select the set with the best marginal value. Since, this can be done in polynomial time, this completes the proof of Theorem 1.5. Acknowledgments We thank Anupam Gupta, Guru Prashanth, Bobby Kleinberg, and Akanksha Bansal for helpful comments on improving the presentation of this paper. References [Ada11] Marek Adamczyk. Improved analysis of the greedy algorithm for stochastic matching. Inf. Process. Lett., 111(15):731–737, 2011. [AGM15] Marek Adamczyk, Fabrizio Grandoni, and Joydeep Mukherjee. Improved approximation algorithms for stochastic matching. In Algorithms-ESA 2015, pages 1–12. Springer, 2015. [AH15] Ali E Abbas and Ronald A Howard. Foundations of decision analysis. Pearson Higher Ed, 2015. [ANS08] Arash Asadpour, Hamid Nazerzadeh, and Amin Saberi. Stochastic submodular maximization. In International Workshop on Internet and Network Economics, pages 477–489. Springer, 2008. Full version appears as [?]. [ASW16] Marek Adamczyk, Maxim Sviridenko, and Justin Ward. Submodular stochastic probing on matroids. Mathematics of Operations Research, 41(3):1022–1038, 2016. [BCN+ 15] Alok Baveja, Amit Chavan, Andrei Nikiforov, Aravind Srinivasan, and Pan Xu. Improved bounds in stochastic matching and optimization. In APPROX, pages 124–134, 2015. [BG96] Ann Becker and Dan Geiger. Optimization of pearl’s method of conditioning and greedylike approximation algorithms for the vertex feedback set problem. Artificial Intelligence, 83(1):167–188, 1996. [BGK11] Anand Bhalgat, Ashish Goel, and Sanjeev Khanna. Improved approximation results for stochastic knapsack problems. In SODA, pages 1647–1665, 2011. [BGL+ 12] Nikhil Bansal, Anupam Gupta, Jian Li, Julián Mestre, Viswanath Nagarajan, and Atri Rudra. When LP Is the Cure for Your Matching Woes: Improved Bounds for Stochastic Matchings. Algorithmica, 63(4):733–762, 2012. [BN14] Nikhil Bansal and Viswanath Nagarajan. On the adaptivity gap of stochastic orienteering. In IPCO, pages 114–125, 2014. [BYE81] Reuven Bar-Yehuda and Shimon Even. A linear-time approximation algorithm for the weighted vertex cover problem. Journal of Algorithms, 2(2):198–203, 1981. [BYGNR98] Reuven Bar-Yehuda, Dan Geiger, Joseph Naor, and Ron M. Roth. Approximation algorithms for the feedback vertex set problem with applications to constraint satisfaction and bayesian inference. SIAM journal on computing, 27(4):942–959, 1998. 20 [CCPV11] Gruia Calinescu, Chandra Chekuri, Martin Pál, and Jan Vondrák. Maximizing a monotone submodular function subject to a matroid constraint. SIAM Journal on Computing, 40(6):1740–1766, 2011. [CFG+ 02] Moses Charikar, Ronald Fagin, Venkatesan Guruswami, Jon M. Kleinberg, Prabhakar Raghavan, and Amit Sahai. Query strategies for priced information. J. Comput. Syst. Sci., 64(4):785– 819, 2002. [CHKK15] Yuxin Chen, S Hamed Hassani, Amin Karbasi, and Andreas Krause. Sequential information maximization: When is greedy near-optimal? In Conference on Learning Theory, pages 338–363, 2015. [CIK+ 09] Ning Chen, Nicole Immorlica, Anna R. Karlin, Mohammad Mahdian, and Atri Rudra. Approximating Matches Made in Heaven. In ICALP (1), pages 266–278, 2009. [CJK+ 15] Yuxin Chen, Shervin Javdani, Amin Karbasi, J Andrew Bagnell, Siddhartha S Srinivasa, and Andreas Krause. Submodular surrogates for value of information. In AAAI, pages 3511–3518, 2015. [DGV04] Brian C. Dean, Michel X. Goemans, and Jan Vondrák. Approximating the stochastic knapsack problem: The benefit of adaptivity. In Foundations of Computer Science, 2004. Proceedings. 45th Annual IEEE Symposium on, pages 208–217. IEEE, 2004. [DGV05] Brian C. Dean, Michel X. Goemans, and Jan Vondrák. Adaptivity and approximation for stochastic packing problems. In SODA, pages 395–404, 2005. [DTW03] Ioana Dumitriu, Prasad Tetali, and Peter Winkler. On playing golf with two balls. SIAM Journal on Discrete Mathematics, 16(4):604–615, 2003. [FNW78] Marshall L. Fisher, George L. Nemhauser, and Laurence A. Wolsey. An analysis of approximations for maximizing submodular set functionsii. In Polyhedral combinatorics, pages 73–87. Springer, 1978. [GGM10] Ashish Goel, Sudipto Guha, and Kamesh Munagala. How to probe for an extreme value. ACM Transactions on Algorithms (TALG), 7(1):12, 2010. [Git74] John Gittins. A dynamic allocation index for the sequential design of experiments. Progress in statistics, pages 241–266, 1974. [GK01] Anupam Gupta and Amit Kumar. Sorting and selection with structured costs. In Foundations of Computer Science, 2001. Proceedings. 42nd IEEE Symposium on, pages 416–425. IEEE, 2001. [GKMR11] Anupam Gupta, Ravishankar Krishnaswamy, Marco Molinaro, and R. Ravi. Approximation algorithms for correlated knapsacks and non-martingale bandits. In FOCS, pages 827–836, 2011. [GKNR12] Anupam Gupta, Ravishankar Krishnaswamy, Viswanath Nagarajan, and R. Ravi. Approximation algorithms for stochastic orienteering. In SODA, 2012. 21 [GM07] Sudipto Guha and Kamesh Munagala. Approximation algorithms for budgeted learning problems. In STOC, pages 104–113. 2007. Full version as: Approximation Algorithms for Bayesian Multi-Armed Bandit Problems, http://arxiv.org/abs/1306.3525. [GM09] Sudipto Guha and Kamesh Munagala. Multi-armed bandits with metric switching costs. In ICALP, pages 496–507, 2009. [GM12] Sudipto Guha and Kamesh Munagala. Adaptive uncertainty resolution in bayesian combinatorial optimization problems. ACM Transactions on Algorithms (TALG), 8(1):1, 2012. [GMS07] Sudipto Guha, Kamesh Munagala, and Saswati Sarkar. Information acquisition and exploitation in multichannel wireless systems. In IEEE Transactions on Information Theory. Citeseer, 2007. [GN13] Anupam Gupta and Viswanath Nagarajan. A stochastic probing problem with applications. In IPCO, pages 205–216, 2013. [GNS16] Anupam Gupta, Viswanath Nagarajan, and Sahil Singla. Algorithms and adaptivity gaps for stochastic probing. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1731–1747. SIAM, 2016. [GNS17] Anupam Gupta, Viswanath Nagarajan, and Sahil Singla. Adaptivity Gaps for Stochastic Probing: Submodular and XOS Functions. In Proceedings of the Twenty-Eighth Annual ACMSIAM Symposium on Discrete Algorithms, pages 1688–1702. SIAM, 2017. [GW95] Michel X Goemans and David P Williamson. A general approximation technique for constrained forest problems. SIAM Journal on Computing, 24(2):296–317, 1995. [Has96] Johan Hastad. Clique is hard to approximate within n1−ǫ . In Foundations of Computer Science, 1996. Proceedings., 37th Annual Symposium on, pages 627–636. IEEE, 1996. [HKT00] Magnús M. Halldórsson, Jan Kratochvıl, and Jan Arne Telle. Independent sets with domination constraints. Discrete Applied Mathematics, 99(1):39–54, 2000. [HSS06] Elad Hazan, Shmuel Safra, and Oded Schwartz. On the complexity of approximating k-set packing. Computational Complexity, 15(1):20–39, 2006. [Jen76] Thomas A. Jenkyns. The efficacy of the greedy algorithm. In Proc. of 7th South Eastern Conference on Combinatorics, Graph Theory and Computing, pages 341–350, 1976. [JMM+ 03] Kamal Jain, Mohammad Mahdian, Evangelos Markakis, Amin Saberi, and Vijay V Vazirani. Greedy facility location algorithms analyzed using dual fitting with factor-revealing lp. Journal of the ACM (JACM), 50(6):795–824, 2003. [KH78] Bernhard Korte and Dirk Hausmann. An analysis of the greedy heuristic for independence systems. Annals of Discrete Mathematics, 2:65–74, 1978. [KK03] Sampath Kannan and Sanjeev Khanna. Selection with monotone comparison costs. In Proceedings of the fourteenth annual ACM-SIAM symposium on Discrete algorithms, pages 10– 17. Society for Industrial and Applied Mathematics, 2003. 22 [KWW16] Robert Kleinberg, Bo Waggoner, and Glen Weyl. Descending Price Optimally Coordinates Search. arXiv preprint arXiv:1603.07682, 2016. [LY13] Jian Li and Wen Yuan. Stochastic combinatorial optimization via poisson approximation. In Symposium on Theory of Computing Conference, STOC’13, Palo Alto, CA, USA, June 1-4, 2013, pages 971–980, 2013. [Ma14] Will Ma. Improvements and generalizations of stochastic knapsack and multi-armed bandit approximation algorithms: Extended abstract. In SODA, pages 1154–1163, 2014. [Wei79] Martin L. Weitzman. Optimal search for the best alternative. Econometrica: Journal of the Econometric Society, pages 641–654, 1979. [WS11] David P. Williamson and David B. Shmoys. The design of approximation algorithms. Cambridge university press, 2011. A Illustrative Examples A.1 Why the naı̈ve greedy algorithm fails for Pandora’s box Suppose curr denotes the maximum value in the currently opened set of boxes. The naı̈ve greedy algorithm selects in any step the unopened box j corresponding to the maximum marginal value, i.e. argmax{E[(Xj − curr)+ ] − πj }, and opens it if its marginal value is non-negative. The algorithm stops probing when every unopened box has a negative marginal value. We give an example where this algorithm can be made arbitrarily worse as compared to the optimal algorithm. Consider n − 1 iid boxes, each taking value 1/p2 w.p. p and 0 otherwise, where p < 1. The probing price of each of these boxes is 1. Also, there is a box which takes value 1/p2 w.p. 1 but has a probing price of 1/p2 − 1/p + 1. Note that in the beginning, the marginal value of every box is 1/p − 1. Now the optimal strategy is to probe the boxes with price 1, until we see a box with value 1/p2 . For large enough n, the expected utility of this strategy is ≈ 1/p2 − 1/p because in expectation the algorithm stops after roughly 1/p probes. However, the naı̈ve greedy algorithm will open the box with price 1/p2 − 1/p − 1 and then stop probing. Thus its expected utility will be 1/p − 1. By choosing small enough p, the ratio between 1/p2 − 1/p and 1/p − 1 can be made arbitrarily large. A.2 The Pandora’s box problem has no constant approximation non-adaptive solution Consider an example where each element independently takes value 1 w.p. p (≪ 1) and value 0, otherwise. Suppose the price of probing any element is 1 − ǫ, for some small ǫ > 0. The optimal adaptive strategy is to continue probing till we see an element with value 1. Assuming n to be large, it is easy to see that this strategy has expected value ≈ ǫ/p. On the other hand, a non-adaptive strategy has to decide in the beginning which all elements S to probe, and then probe them irrespective of the consequence. Since all items are identical, the only decision it has to make is how many items to probe. One can verify that no such non-adaptive strategy can get value more than O(ǫ). By choosing p to be small enough, we can make the gap arbitrarily large. 23 A.3 Hardness for general submodular functions To prove that one cannot obtain good approximation results for any monotone submodular functions f , we show that even when all variables are deterministic, the computational problem of selecting the best set √ I ⊆ V to maximize f (I) − π(I) is Ω̃( n) hard assuming P 6= N P , where n = |V |. The idea is to reduce from set packing. Let S = {S1 , S2 , . . . , Sm } denote the sets of a set packing instance. For S ⊆ S, let f (S) denote the covering function. Let price of probing Si be πi = |Si |−1. Clearly, it doesn’t make sense to probe sets that are not disjoint as the marginal utility will be non-positive. The optimal solution therefore equals the maximum number of disjoint sets. But no polynomial time algorithm can be O(n1/2−ǫ )-approximation, for any ǫ > 0, unless P = N P [Has96, HKT00]. A.4 Hardness for the set-probing problem To prove that no polynomial time algorithm for the set-probing problem can be o(ℓ/ log ℓ)-approximation, unless P = N P , we reduce ℓ-set packing problem into an instance of the set-probing problem. Given an ℓ-set packing instance with S sets S1 , S2 , . . . , Sm , each of size ℓ, we create the following set-probing problem. For every element i ∈ j Sj , w.p. n13 variable Xi takes value 1, and is 0, otherwise. Also, let each set Sj have price (ℓ−0.5) . n3 Since probability of two elements taking value 1 is really small O(1/n4 ), we see that it only makes sense to probe sets where none of the elements have been already probed: even if a single element is probed − (ℓ−0.5) = −0.5 < 0. Hence, E[Opt] = before, expected value from probing the set is at most (ℓ−1) n3 n3 n3 0.5 (Max # disjoint sets) · n3 . But this is exactly the ℓ-set packing problem and we know that unless P = N P , no poly time algorithm can be o(ℓ/ log ℓ)-approximation [HSS06]. 24
8cs.DS
Preprint LABEL-DRIVEN WEAKLY-SUPERVISED LEARNING FOR MULTIMODAL DEFORMABLE IMAGE REGISTRATION Yipeng Hu1,2, Marc Modat1, Eli Gibson1, Nooshin Ghavami1, Ester Bonmati1, Caroline M. Moore3, Mark Emberton3, J. Alison Noble2, Dean C. Barratt1,4, Tom Vercauteren1,4 1 Centre for Medical Image Computing, University College London, UK 2 Institute of Biomedical Engineering, University of Oxford, UK 3 Division of Surgery and Interventional Science, University College London, London, UK 4 Wellcome / EPSRC Centre for Interventional and Surgical Sciences, University College London, UK ABSTRACT Spatially aligning medical images from different modalities remains a challenging task, especially for intraoperative applications that require fast and robust algorithms. We propose a weakly-supervised, label-driven formulation for learning 3D voxel correspondence from higher-level label correspondence, thereby bypassing classical intensity-based image similarity measures. During training, a convolutional neural network is optimised by outputting a dense displacement field (DDF) that warps a set of available anatomical labels from the moving image to match their corresponding counterparts in the fixed image. These label pairs, including solid organs, ducts, vessels, point landmarks and other ad hoc structures, are only required at training time and can be spatially aligned by minimising a crossentropy function of the warped moving label and the fixed label. During inference, the trained network takes a new image pair to predict an optimal DDF, resulting in a fullyautomatic, label-free, real-time and deformable registration. For interventional applications where large global transformation prevails, we also propose a neural network architecture to jointly optimise the global- and local displacements. Experiment results are presented based on cross-validating registrations of 111 pairs of T2-weighted magnetic resonance images and 3D transrectal ultrasound images from prostate cancer patients with a total of over 4000 anatomical labels, yielding a median target registration error of 4.2 mm on landmark centroids and a median Dice of 0.88 on prostate glands. Index Terms— multimodal medical image registration, weakly-supervised learning, prostate cancer 1. INTRODUCTION Intraoperative transrectal ultrasound (TRUS) images are used to guide the majority of targeted biopsies and focal therapies for prostate cancer patients but generally displays poor contrast between the healthy- and cancerous regions. Multi-parametric magnetic resonance (MR) images have been shown clinically important in detecting and localising prostate cancers, but are usually acquired outside of interventions [1]. In general, multimodal image registration aims to fuse the preoperative planning information such as the tumour locations, obtained from diagnostically purposed imaging, with real-time but often low quality intraoperative imaging [2]. It thus may substantially improve patient care [3] and refine disease risk stratification [4]. However, like many other ultrasound-guided medical procedures, this application represents a typical example where no robust image similarity measure has been demonstrated. For instance, anatomically different structures, such as prostate inner-outer gland separation defined on TRUS [5] and central-peripheral zonal boundary visible on MR, possess strong statistical correlation between them. This leads to false alignment using most, if not all, of the established intensity-based similarity measures and the associated registration methodologies. On the other hand, feature-based image registration methods proposed for this application rely on relatively sparse features that must be identified consistently between two imaging modalities, such as prostate capsule surface. Obtaining such manual landmarks and/or segmentations from both images for each patient is time-consuming, user-dependent and often infeasible intraoperatively. Alternative methods using automated hand-engineered image features can be highly sensitive to data, initialisation and often needs strong application-specific prior regularisation, e.g. [6, 7]. Recent machine-learning-based methods, particularly using neural networks, have been proposed to replace and accelerate the registration algorithms based on iterative optimisation with acquired knowledge from population data, e.g. [8, 9], or to provide better constrained transformation models [10]. However, most still rely on the choice of image similarity measure or on non-trivial, and potentially nonrealistic, application-specific assumptions in procuring large number of ground-truth transformations for training, such as those from simulations [11, 12], existing registration methods [13] or manual rigid alignment [14]. In this work, considering applications with no known robust image similarity measure, we propose a novel neuralnetwork-based learning approach, inferring dense voxel correspondence from all types of identifiable labels representing correspondent anatomical structures. In the example application, we describe a specific network ©2018 IEEE. This work has been accepted for publication in 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018). Preprint architecture to effectively predict a composite of global- and local deformation encountered during the prostate cancer interventions, registering MR- and TRUS images. 2. METHOD 2.1. Label-Driven Correspondence Learning Fig.1. Illustration of the training process of the proposed labeldriven registration framework (described in Section 2.1), where the red-dotted lines represent data flows only required in training. Image registration requires establishing spatially corresponding voxels between a pair of moving- and fixed images. From a machine learning perspective, ground-truth voxel-level labels for correspondence learning are scarce and, in most scenarios, impossible to reliably obtain from medical image data. However, higher-level corresponding structures are much more feasible to annotate with anatomical knowledge, such as the same organ, lesion or other structures appearing in the two images. In this section, we introduce a generalisable framework to use these images and labels as training data, to enable an automatic, deformable image registration that only requires image data during inference. Given a pair of training images to align, a neural network computes a dense displacement field (DDF) to indicate the correspondence: a DDF-warped moving label voxel corresponds to the fixed label voxel at the same image coordinate, if they both are foreground (ones) or background (zeros). Each label pair in training is considered to serve as a weak label of voxel correspondence at the spatial location, which is measured by a two-class cross-entropy function. In medical image applications, different cases may have different types and numbers of corresponding structures. Therefore, we propose to feed different label pairs randomly into training, one corresponding pair at each iteration for each image pair, so that a minibatch optimisation scheme takes an equal number of image- and label pairs in each minibatch. Considering all the label pairs given an image pair being the conditionally independent data of the likelihood function representing voxel correspondence, the gradient computed from this minibatch is still an unbiased estimator of the gradient of the loss function using the entire training set, as in stochastic gradient descent [15]. Furthermore, large number of manual labels are in general prone to errors and can be difficult to verify thoroughly. To mitigate labelling uncertainty, we sample higher confidence labels more frequently (as described in Section 3). This weights the objective function towards the subset of labels having the highest quality through expensive expert labelling or multiple observer consensus. As shown in Figure 1, in training, the label correspondence in terms of cross-entropy is computed between the warped moving label and the fixed label, neither of which are used as input to the network. Therefore they are not required in inference, i.e. registration. The moving- and fixed images are used only as inputs to the neural network without directly contributing to the loss function. Therefore, no explicit image similarity measure needs to be enforced. Depending on the availability of label data, smoothness of the DDFs is added to the overall loss function, such as bending energy or L2-norm of the displacement gradients, in addition to the network architectural regularisation. The labels (and the images if required in inference) are warped with an image resampler, such as linear-, cubic- or spline interpolation. Fig.2. a: Example slices of the spatially smoothed label maps for different types of landmarks, a prostate gland, a cyst and a urethra, from left to right; b: illustration of the profile of a smoothed label maps with the shaded area indicating the normalised sum M of the map. Details are described in Section 2.1. Direct use of the binary masks may cause an over-fitted and under-regularised network [16], independent of the class balance issue. As illustrated in Figure 2b, we propose a onesided label smoothing mechanism to 1) provide a spatially smoothed probability map on the original background region while the original foreground region remains associated with one-hot probability vectors; and 2) without affecting the one-hot probabilities in the foreground region, normalise the sum of the map (i.e. the weight of the shaded area in Figure 2b) so that all labels in a given image are associated with the same weight. Such a smoothing is achieved by an element-wise nonlinear function with a parameter controlling the area under the curve to reach a subscribed sum M (here, M equals to the sum over all voxels of an inverse distance transform, measured in voxel units, of the label with largest volume, i.e. full gland segmentation). While the mapping function should be ideally designed based on the underlying correspondence distribution [16], a heuristically motivated function is used in this work: -1 pi  1  (1  d i1 ) x , where di is computed from inverse distance transform, measured in voxel units, at voxel i in the background region, and x is a re-weighting parameter, so ©2018 IEEE. This work has been accepted for publication in 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018). Preprint that p M ; i pi=1 for the foreground region. Figure 2a i provides examples of these label maps pi used as input probabilities to the cross-entropy loss. From the optimisation perspective, this provides a larger capture range and more balanced weighting between labels from the same image, as opposed to a simple Gaussian smoothing. 2.2. Learning Interventional Deformation In this section, we describe an instantiated implementation of the described framework, for registering the prostate MRto TRUS images described in Section 1. In intraoperative applications of this kind, considerable spatial difference in physical space is common between preoperative- and intraoperative images, caused by different imaging reference coordinate systems, imaging sampling parameters and patient movement. It is usually represented by a global rigid- or affine transformation [17], which could remain non-penalised under typical regularisation strategies, such as the bending energy. Therefore, a network directly predicting regularised DDFs should in theory be able to model both local- and global deformations. In practice, however, the regions under-supported by available labels may receive diminishing and/or perturbing gradients that are sensitive to the weighting between the cross-entropy loss and the regularisation. For example, most landmarks are defined within or near to the prostate gland in our application: in the initial experiments, directly predicting DDFs yielded implausible deformations and large target registration errors (TREs), when testing landmarks were outside the gland (see the results in Section 4). To combat this practical issue, we augment the network with a soft architectural constraint to encourage the learning of the global transformation, as illustrated in Figure 3. Fig.3. Illustration of the inference part of the proposed registration network (described in Section 2.2) for interventional applications. First, the moving image is linearly resized to the same size as the fixed image. After receiving the concatenated image pair, a sub-network global-net predicts a 12 degrees of freedom affine transformation matrix. The original moving image is warped onto the fixed image coordinates by the global affine transformation and the result is concatenated with the original fixed image. A second subnetwork local-net then takes the concatenation as input to generate a non-rigid local DDF regularised by a weighted bending energy [17]. The affine transformation and the local DDF are then composed to produce the final output DDF to warp the moving label to match the fixed label using a trilinear image resampler. It is not guaranteed that the learned local DDFs do not contain global transformation, but our approach is designed to improve the learning by preliminarily warping the moving image, also suggested in the previous work [18], and converges faster in practice. Fig.4. Illustration of the network architecture of the local-net (left), sk and nk (k=1, …, K), are the sizes and numbers of channels of feature maps, with K=4 and s0 being the fixed image size. The global-net (right) shares the same down-sampling architecture with a linear projection to an affine matrix. Initial n0 are 32 and 4 for local-net and global-net, respectively. See details in Section 2.2. Following our previous work in segmenting prostate gland from TRUS images [19] and the proposed method for learning optical flow [20], the local-net is designed as a 3D convolutional neural network with four down-sampling blocks, followed by four up-sampling blocks, with four summation operations shortcutting the network at different resolution levels. As illustrated in Figure 4, it begins with n0=32 initial channels of feature maps, successively doubles the number of channels and halves the feature map size with the down-sampling blocks, and vice versa with the upsampling blocks. Each of these blocks consists of a residual network (Resnet) unit shortcutting two convolutional- and batch normalisation layers with rectified linear units. Downsampling and up-sampling are achieved by convolution and transpose convolution, respectively, both with strides of two. Predicting spatial transformation is sensitive to network initialisation [21]. For initialising the output so that the resampled labels generate meaningful initial gradients, the output layer is an additional convolution (Conv) added to a bias term, without batch normalisation or nonlinear activation. It enables random initialisation with zero mean and a small variation on the final layer. The global-net shares the same architecture (using independently learnable parameters) as the four downsampling blocks of the local-net, with a smaller number of n0=4 initial channels. The last convolutional layer is linearly projected by a learnable fully-connected matrix to a vector containing 12 affine transformation parameters. Similarly, this allows a random initialisation centred at an identity matrix with zero translation. ©2018 IEEE. This work has been accepted for publication in 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018). Preprint 3. EXPERIMENT 4. RESULTS A total of 111 pairs of T2-weighted MR- and TRUS images from 76 patients were acquired during SmartTarget® clinical trials [22]. Each patient has up to three image data sets due to multiple procedures he entered, i.e. biopsy and therapy, or multiple ultrasound volumes being acquired at the beginning and the conclusion of a procedure according to the therapy trial protocol. A range of 35 - 112 parasagittal TRUS frames were acquired in each case by rotating a digital stepper with recorded relative angles covering the majority of the prostate gland, and then used to reconstruct a 3D volume in Cartesian coordinates. Both MR- and TRUS images were normalised to zero-mean with unit-variance intensities after being resampled to 1.0 mm3 isotropic voxels. From these patients, a total of 2351 pairs of corresponding anatomical landmarks were labelled by two medical imaging research fellows and a research student using an in-house voxel-painting tool on the original image data. Besides full gland segmentations for all cases, these landmarks include apex, base, urethra, visible lesions, junctions between the gland, vas deference and the seminal vesicles, and many other patient-specific point landmarks such as calcifications and fluid-filled cysts. Among these, 330 pairs double-checked and confirmed by a second observer were considered as ones with high confidence. Prostate gland segmentations were all considered of high confidence. The labels were resampled to the same sizes of their respective images before being smoothed by the normalised inverse distance transform (Section 2.1). The method was implemented in TensorFlow™ with the 3D resampler module and a 3D image augmentation layer adapted from the open-source code in NiftyNet [23]. Each network was trained on a 24GB NVIDIA® Quadro™ P6000 for 12 hours, using an Adam optimiser starting at a learning rate of 10-5 with a minibatch size of 10. The bending energy weight and weight-decay were set to 10-2 and 10-6, respectively. The global-net was trained first for 1000 iterations. The high confidence labels were sampled twice as more frequently as the others in training. For comparison, the global-net and the local-net were trained separately by minimising the same loss function. In the case of training the local-net alone, the originally affineresampled moving image (in Figure 3) was linearly resized to concatenate with the fixed image. All the applicable hyper-parameters were set to the same values. In each fold of the 10-fold patient-level cross-validation, test data from 7-8 patients were held out while the data from the remainder patients were used in training. Two measures are reported in this study, TREs on centroids of the landmarks with high confidence and Dice scores on the prostate glands. These two independently-calculated metrics on left-out test data directly relate to two of the clinical requirements in the registration-enabled guidance, avoiding surrounding structures and locating regions of interest. More than 4 3D registrations per second can be performed on the same GPU. Figure 5 shows example slices from the input MR-TRUS image pairs and the registered MR images. A median TRE (5th - 95th percentiles) of 4.2 (1.0 - 14.9) mm on landmark centroids and a median Dice of 0.88 (0.80 0.94) on prostate glands were achieved. The median TRE and Dice were 9.4 (3.0 - 20.4) mm and 0.73 (0.46 - 0.87) from the global-net and, 8.5 (1.5 - 22.7) mm and 0.86 (0.46 - 0.91) from the local-net, respectively. The TREs from the proposed network are significantly better than those from the alternative global-net or local-net alone (with both pvalues < 0.001 from paired t-tests), while the competitive Dice from the local-net may suggest an over-fitting to the data around prostate gland areas with the unaided local-net, also more susceptible to visually non-realistic deformations. Fig.5. Example image slices from two cases, 1 and 2. Rows a, b and c contain slices from the registered moving MR images, the fixed TRUS images and visually closest slices from original MR images for comparison, respectively 5. CONCLUSION We have introduced a flexible framework that can utilise different image resamplers, deformation regularisers and all types of anatomical labels, enabling a fully-automatic multimodal image registration algorithm using only input image pair. We have also described a network architecture, effectively learning global- and local interventional deformations. Registration results are reported from a rigorous validation on 111 pairs of labelled intraoperative prostate image data. Future research aims to investigate the generalisation of the proposed method to data from different centres and to a wider range of applications. ©2018 IEEE. This work has been accepted for publication in 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018). Preprint REFERENCE [1] Ahmed, H. U., Bosaily, A. E. S., Brown, L. C., Gabe, R., Kaplan, R., Parmar, M. K., ... & Kirkham, A. P.: Diagnostic accuracy of multi-parametric MRI and TRUS biopsy in prostate cancer (PROMIS): a paired validating confirmatory study. The Lancet, 389(10071), 815-822. 2017 [2] Valerio, M., Donaldson, I., Emberton, M., Ehdaie, B., Hadaschik, B. A., Marks, L. S., ... & Ahmed, H. U.: Detection of clinically significant prostate cancer using magnetic resonance imaging–ultrasound fusion targeted biopsy: a systematic review. European urology, 68(1), 8-19. 2015 [3] Pinto, P. A., Chung, P. H., Rastinehad, A. R., Baccala, A. A., Kruecker, J., Benjamin, C. J., ... & Locklin, J. K.: Magnetic resonance imaging/ultrasound fusion guided prostate biopsy improves cancer detection following transrectal ultrasound biopsy and correlates with multiparametric magnetic resonance imaging. The Journal of urology, 186(4), 1281-1285. 2011 (ISBI), 2016 IEEE 13th International Symposium on (pp. 14301434). IEEE. 2016 [12] Krebs, J., Mansi, T., Delingette, H., Zhang, L., Ghesu, F. C., Miao, S., ... & Kamen, A.: Robust non-rigid registration through agent-based action learning. In International Conference on Medical Image Computing and Computer-Assisted Intervention (pp. 344-352). Springer, 2017 [13] Rohé, M. M., Datar, M., Heimann, T., Sermesant, M., & Pennec, X.: SVF-Net: Learning Deformable Image Registration Using Shape Matching. In International Conference on Medical Image Computing and Computer-Assisted Intervention (pp. 266274). Springer, 2017 [14] Liao, R., Miao, S., de Tournemire, P., Grbic, S., Kamen, A., Mansi, T., & Comaniciu, D.: An Artificial Agent for Robust Image Registration. In AAAI (pp. 4168-4175). 2017 [15] Goodfellow, I., Bengio, Y., & Courville, A.: Optimisation for Training Deep Models. In Deep learning. MIT press. pp.281. 2016 [4] Siddiqui, M. M., Rais-Bahrami, S., Truong, H., Stamatakis, L., Vourganti, S., Nix, J., ... & Kruecker, J.: Magnetic resonance imaging/ultrasound–fusion biopsy significantly upgrades prostate cancer versus systematic 12-core transrectal ultrasound biopsy. European urology, 64(5), 713-719. 2013 [16] Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., & Wojna, Z.: Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 2818-2826). 2016 [5] Halpern, E.: The Prostate and Seminal Vesicles. in Urogenital Ultrasound - A Text Atlas, L.D. Cochlin et al., eds., Martin Dunitz Ltd., London, (pp. 155-182). 2006 [17] Rueckert, D., Sonoda, L. I., Hayes, C., Hill, D. L., Leach, M. O., & Hawkes, D. J.: Nonrigid registration using free-form deformations: application to breast MR images. IEEE transactions on medical imaging, 18(8), 712-721. 1999 [6] Hu, Y., Ahmed, H. U., Taylor, Z., Allen, C., Emberton, M., Hawkes, D., & Barratt, D.: MR to ultrasound registration for image-guided prostate interventions. Medical image analysis, 16(3), 687-703. 2012 [7] Wang, Y., Cheng, J. Z., Ni, D., Lin, M., Qin, J., Luo, X., ... & Heng, P. A.: Towards personalized statistical deformable model and hybrid point matching for robust mr-trus registration. IEEE transactions on medical imaging, 35(2), 589-604. 2016 [8] de Vos, B. D., Berendsen, F. F., Viergever, M. A., Staring, M., & Išgum, I.: End-to-End Unsupervised Deformable Image Registration with a Convolutional Neural Network. In Deep Learning in Medical Image Analysis and Multimodal Learning for Clinical Decision Support: Third International Workshop, DLMIA 2017, 10553, (pp. 204). Springer. 2017 [9] Yang, X., Kwitt, R., Styner, M., & Niethammer, M.: Quicksilver: Fast predictive image registration–A deep learning approach. NeuroImage, 158, 378-396. 2017 [10] Hu, Y., Gibson, E., Vercauteren, T., Ahmed, H. U., Emberton, M., Moore, C. M., ... & Barratt, D. C.: Intraoperative Organ Motion Models with an Ensemble of Conditional Generative Adversarial Networks. In International Conference on Medical Image Computing and Computer-Assisted Intervention (pp. 368376). Springer, 2017 [11] Miao, S., Wang, Z. J., Zheng, Y., & Liao, R.: Real-time 2D/3D registration via CNN regression. In Biomedical Imaging [18] Ilg, E., Mayer, N., Saikia, T., Keuper, M., Dosovitskiy, A., & Brox, T.: FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 2017 [19] Ghavami, N., Hu, Y., Binmati, E., Rodell, R., Gibson, E., Moore, C.M., Barratt, D.C.: Automatic slice segmentation of intraoperative transrectal ultrasound images using convolutional neural networks. in SPIE Medical Imaging. 2018 [20] Jason, J. Y., Harley, A. W., & Derpanis, K. G.: Back to basics: Unsupervised learning of optical flow via brightness constancy and motion smoothness. In Computer Vision–ECCV 2016 Workshops (pp. 3-10). Springer. 2016 [21] Jaderberg, M., Simonyan, K., & Zisserman, A.: Spatial transformer networks. In Advances in Neural Information Processing Systems (pp. 2017-2025). 2015 [22] Donaldson, I., Hamid, S., Barratt, D., Hu, Y., Rodell, R., Villarini, B., ... & Potyka, I.: MP33-20 the SmartTarget biopsy trial: a prospective paired blinded trial with randomisation to compare visual-estimation and image-fusion targeted prostate biopsies. The Journal of Urology, 197(4), e425. 2017 [23] Gibson, E., Li, W., Sudre, C., Fidon, L., Shakir, D., Wang, G., ... & Vercauteren, T.: NiftyNet: a deep-learning platform for medical imaging. arXiv preprint arXiv:1709.03485. 2017 ©2018 IEEE. This work has been accepted for publication in 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018).
1cs.CV
Testing Core Membership in Public Goods Economies Greg Bodwin MIT EECS arXiv:1705.01570v1 [cs.GT] 3 May 2017 Abstract This paper develops a recent line of economic theory seeking to understand public goods economies using methods of topological analysis. Our first main result is a very clean characterization of the economy’s core (the standard solution concept in public goods). Specifically, we prove that a point is in the core iff it is Pareto efficient, individually rational, and the set of points it dominates is path connected. While this structural theorem has a few interesting implications in economic theory, the main focus of the second part of this paper is on a particular algorithmic application that demonstrates its utility. Since the 1960s, economists have looked for an efficient computational process that decides whether or not a given point is in the core. All known algorithms so far run in exponential time (except in some artificially restricted settings). By heavily exploiting our new structure, we propose a new algorithm for testing core membership whose computational bottleneck is the solution of O(n) convex optimization problems on the utility function governing the economy. It is fairly natural to assume that convex optimization should be feasible, as it is needed even for very basic economic computational tasks such as testing Pareto efficiency. Nevertheless, even without this assumption, our work implies for the first time that core membership can be efficiently tested on (e.g.) utility functions that admit “nice” analytic expressions, or that appropriately defined ε-approximate versions of the problem are tractable (by using modern black-box ε-approximate convex optimization algorithms). 1998 ACM Subject Classification J.4 Social and Behavioral Sciences Keywords and phrases Algorithmic Game Theory, Economics, Algorithms, Public Goods, Coalitional Stability Digital Object Identifier 10.4230/LIPIcs... 1 1.1 Introduction Background on Public Goods Economics A basic question in economics is to understand the forces governing the production of public goods. A good is public if its use by one person does not reduce its availability to others, and if none are excluded from using the good. Examples include public parks, research information, a clean environment, national defense, radio broadcasts, and so on. Public goods economies were first explicitly abstracted in a classic paper by Samuelson in 1954 [28], and have since become central objects of study for economists. An important feature of public goods economies is that they are not well modeled by the individualistic “best-response dynamics” which govern familiar economic equilibrium concepts such as the Nash or Walrasian equilibrium. Rather, public goods typically arise as the result of a communal process – e.g. negotiations, treaties, or taxes – that allow the cost of production to be amortized over all agents that stand to benefit from the good. Accordingly, public goods economics inspired the development of cooperative game theory, which seeks to understand licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany XX:2 Testing Core Membership in Public Goods Economies these cooperative dynamics and when an agreement to produce public goods is “stable” or when it is doomed to fall apart. What, exactly, does “stability” mean in this context? The most standard notion is coalitional stability, which is given as follows: I Definition (Informal). Let a be an outcome in a public goods economy with agents N (i.e. a describes the amount of work each agent contributes to produce a public good). We say that a0 is a deviation on a for a nonempty coalition of agents C ⊆ N if no agents in N \ C perform work (i.e. a0i = 0 for all i ∈ / C) and all agents in C prefer a0 to a. If there is no deviation on a for any coalition, then we say a is coalitionally stable. The set of coalitionally stable outcomes is called the core of the economy. Since its inception in the late 1800’s [13],1 the core and cooperative game theory in general have played major roles in many successful economic research programs. More background can be found in most modern game theory textbooks, e.g. [26, 11]. 1.2 (Non-)Algorithmic Properties of Public Goods Economies An inherent conceptual drawback of coalitional stability is its exponential-size definition. In other words, for an outcome a to be coalitionally stable, every single one of the 2n − 1 possible coalitions of agents must not have a deviation. Hence, the naive algorithms for testing the coalitional stability of a must perform computations for all 2n − 1 coalitions, and so they suffer exponential runtime. Coalitional stability is not a very convincing solution concept if its implicit notion of “instability” assumes that agents can quickly make exponential time computations in order to find deviations whenever they exist. This problem has led economists studying public goods to seek more clever methods for solving computational problems related to the core of a public goods economy, which avoid this exponential behavior. Some of the initial work in this vein attacked the closely-related problem of simply outputting any core outcome. The first such solution appeared in the 1960s, when Scarf [29] proved that “balanced” games have nonempty cores, by means of an (exponential time) algorithm that outputs a core point and provably always terminates. Similar results were proved in the setting of public goods economies by Chander and Tulkens [8] and Elliot and Golub [15]. Meanwhile, followup work has suggested that the slow runtime of Scarf’s algorithm may be inherent to the problem: Kintali et al [23] showed that Scarf’s algorithm cannot be improved to polynomial runtime (unless P = PPAD), and Deng and Papadimitriou [12] showed that it is NP Complete just to detect whether or not the core is empty (let alone find a point in the core), even in the simple class of graphical games, and even when Scarf’s assumption of “balance” is dropped. Other notable hardness results in this vein have come from Conitzer and Sandholm [10] and Greco et al [21]. There has also been considerable prior work on the “membership testing” problem of determining whether a point taken on input is in the core (this is the question addressed in this paper). Deng and Papadimitriou’s work [12] also implies that membership testing is NP hard even in the restricted setting of graphical games, although there are straightforward efficient algorithms in the further restricted setting where the game is superadditive. Conitzer and Sandholm [9] showed that membership testing is co-NP complete in games where coalition values have a “multiple-issue” representation in polynomial space. Faigle et 1 Some of the early work on cooperative game theory used the name contract curve instead of core. The term core was coined in [18]. Greg Bodwin al [16] showed that the problem is NP complete in a variant of graphical games where payoffs are given by minimum spanning trees of subgraphs. Sung and Dimitrov [31] showed co-NP completeness for membership testing in “hedonic coalition formation games.” Goemans and Skutella showed NP completeness for both emptiness and membership testing in “facility location games,” and gave formulations of these problems as LP relaxations [19]. There has been work on games defined by marginal contribution nets (MC-nets) [22, 14], in which values attainable by coalitions are determined by succinct logical formulae. Li and Conitzer [25] studied emptiness testing and membership testing under various classes of formulae, and obtained various algorithms or NP hardness results depending on the complexity of the formulae allowed. 1.3 Our Results A recently popular trend in public goods research has been to model economies as networks, and then seek to analyze the economy by studying the topological properties of the underlying “benefits network,” describing the ability of agents to transfer utility to each other at any given point (see for example [3, 5, 1, 2, 15]). Much of the initial work focused on Nash equilibria [3, 5, 1, 2] of the economy. A major stride was recently taken by Elliot and Golub [15], who extended the theory to show that the Lindahl equilibria2 of an economy are precisely the points that are eigenvalues of their own benefits network. They further discuss connections between the Lindahl equilibria and the core – in particular, in any standard model (including theirs) all Lindahl equilibria are also core outcomes [17]. However, they raise an interesting open question to more precisely characterize the core [20] in a similar vein. Our first main result achieves this goal. We show that the core can be characterized as follows: I Theorem 1. Let a be an outcome in a public goods economy and let Da be the set of points that no agent prefers to a. Then a is in the core if and only if it is Pareto efficient, individually rational, and Da is path connected. (Here, the definition of path connectedness is the standard topological one: for any two points x, y ∈ Da , there is a continuous function f : [0, 1] → Rn≥0 satisfying f (0) = x, f (1) = y, and f (λ) ∈ Da for all 0 ≤ λ ≤ 1. The image of [0, 1] under f is called a path.) An interesting consequence of this theorem is a precise description of the relationship between Lindahl equilibria and core outcomes: I Theorem 2. Assuming that the utility function u is differentiable, the Lindahl equilibria of a public goods economy are precisely the core points whose core membership can be certified using only local information. The proof of this corollary is essentially immediate by combining Theorem 1 with a more technical phrasing of Elliot and Golub’s result. While we believe that these two structural theorems hold intrinsic interest, the second half of this paper is intended to demonstrate their power by an application to the algorithmic problem discussed earlier. We have previously suggested the intuition that the algorithmic 2 The Lindahl equilibria of an economy are the competitive equilibria that would be reached if market externalities were truthfully reported and then bought and sold on an open market. A formal definition is not necessary to read this paper, but can be found in e.g. [26, 11]. XX:3 XX:4 Testing Core Membership in Public Goods Economies core membership testing problem is hard because the naive algorithms must check an exponential number of coalitions for a potential deviation. However, Theorem 1 lets us avoid this brute-force behavior: after checking for Pareto efficiency and individual rationality (which is quite easy), we are left only with the task of checking whether or not Da is path-connected. The complexity of this task is non-obvious, but we show that it can be done fairly efficiently, yielding the following result: I Theorem 3. Given an outcome a in an n-agent public goods economy, there is an algorithm that decides whether or not a is in the core of a public goods economy. The computational bottleneck in this algorithm is the solution of O(n) convex programming problems on the utility function of the economy. Hence we essentially have the first polynomial-time tester for coalitional stability in an unrestricted public goods economy, up to the implementation of the necessary convex programming oracle. It is fairly natural in our economic metaphor to assume that convex programming should be tractable: it corresponds to the negotiation process of a group of agents trying to determine how well they can maximize a joint utility function as a group. If even this is impossible, then it is essentially hopeless to efficiently test core membership. One cannot even test the more basic property of Pareto efficiency, a necessary step towards testing core membership, without assuming some computational power along these lines. Even so, if one does not wish to introduce such assumptions, Theorem 3 implies that several broad special cases of membership testing have efficient algorithms. The most obvious of these is when the utility function and its derivative can be described by a “nice” analytic function on which the standard derivative-based method for exact convex optimization goes through. Less obviously, if convex optimization really is hard for the given utility function (or the utility function of the economy is unknown), one can employ modern ε-approximate convex optimization solvers, which treat the utility function as a black box that can be queried, to solve certain natural ε-approximate relaxations of the core membership testing problem. We discuss this point in the conclusion of the paper, since it is easier to be specific here once the economic model is familiar. We consider it somewhat surprising that these algorithmic results are possible, given a general dearth of positive results in the area. Moreover, the approach taken by the algorithm is fairly intuitive and seems to plausibly reflect practical behavior. Starting with the grand coalition, we show (via Theorem 1) that we can either determine that the current coalition has a deviation, or we can identify a “least-valuable player” who is formally the least likely agent to participate in a deviation. We then kill this agent and repeat the analysis on the survivors. After n rounds, we have either killed every agent (and thus determined that the given point is coalitionally stable), or we have explicitly found a surviving coalition with a deviation. It is quite reasonable to imagine that a practical search for a deviating coalition might employ a “greedy” method of iteratively killing the agent who seems to be least pulling their weight at the current agreement; an insight of Theorem 3 is that this search heuristic is in fact thorough and will provably produce the right answer. 1.4 Comparison with Prior Work. Elliot and Golub [15] recently studied the Lindahl equilibria in public goods economies, with a focus on characterizing the set of solutions rather than algorithmically computing/testing them. More specifically, they frame the typical model of public goods economies in the language of networks, and use this to equate the eigenvectors of the “benefits network” Greg Bodwin XX:5 with the Lindahl equilibria of the economy. A less general version of this networks interpretation was implicitly used in several other papers concerning Nash equilibria of public goods economies, for example [3, 5, 1, 2]. In this paper, we will adopt the more general networks-based phrasing of public goods economies used by Elliot and Golub, and we will rely on this insight in a critical way to prove our main results. Per the discussion above, there has been lots of prior work on the algorithmic properties of the core, largely intended to confirm/refute the bounded rationality argument in some economic model. Three questions are commonly studied: The membership testing problem (discussed above): is a given outcome in the core of the game? The emptiness testing problem: is the core empty? The member finding problem: output any solution in the core of the game (if nonempty). We remark that the latter two problems are already closed in public goods economies: Elliot and Golub [15] show that the core is never empty except in certain degenerate cases, and it can be seen from the model below that the member finding problem is essentially identical to the general problem of convex optimization (which is well beyond the scope of this economically-minded research program). Hence, this work is entirely focused on the membership testing problem. In order to frame these three questions as proper computational problems, past work has commonly defined a “compressed” cooperative game that allows the payoffs achievable by all 2n possible coalitions to be expressed on only poly(n) input bits. For example, in a seminal paper by Deng and Papadimitriou introducing this line of research [12], the authors studied graphical games in which weighted edges are placed between agents and the value attainable by a coalition is equal to the total weight contained in its induced subgraph. Upper and lower bounds are often obtained for these problems by exploiting particular features of the compression scheme. By contrast, our goal is to assume as little structure for the problem as possible (since our main results are upper bounds, this is the more general approach). Thus, we allow the economy to be governed by an arbitrarily complex utility function, which does not need to have a succinct representation, or even any algorithmic representation at all. Instead, we allow ourselves black-box constant-time query access to the utility function, which acts as an oracle and thus may have arbitrary complexity. The goal in this substantial generalization is to ensure that our results reveal structure of the core itself, rather than the nature of an assumed compression. 2 The Model and Basic Definitions 2.1 Notation Conventions Given vectors a, a0 ∈ Rn , we will a ≥ a0 means that ai ≥ a0i for all a > a0 means that ai > a0i for all a a0 means that ai ≥ a0i for all use the following (partial) ordering operations: 1 ≤ i ≤ n, i ≤ i ≤ n, and 1 ≤ i ≤ n, and aj > a0j for some 1 ≤ j ≤ n. Given a subset C ⊆ {1, . . . , n} and a vector v ∈ Rn , we write vC to denote the restriction of v to the indices in C; that is, vC is the |C| length vector built by deleting the entry vi from v for each i ∈ / C. We use 0, 1 as shorthands for the vectors h0, . . . , 0i, h1, . . . , 1i respectively. XX:6 Testing Core Membership in Public Goods Economies 2.2 Economic Model We adopt the terminology of Elliot and Golub [15] when possible. The salient pieces of our economy are defined as follows: The set of agents in the economy is given by N = [n] = {1, . . . , n}. A nonempty subset of agents in the economy C ⊆ N is called a coalition. The coalition C = N is called the grand coalition. Each agent i chooses an action ai , which can be any real number in the interval [0, 1]. An outcome or point is a vector a ∈ Rn built by concatenating the actions of all agents. There is a continuous utility function u : [0, 1]n → [0, 1]n , which maps outcomes to a level of “utility” for each agent. In particular, agent i prefers outcome a to outcome a0 iff ui (a) > ui (a0 ). The utility function has the following two properties: Positive Externalities: whenever a a0 with ai = a0i , we have ui (a) > ui (a0 ). This assumption is what places us in the setting of public goods economies; intuitively, it states that an agent gains utility when other agents increase their production of public goods. Convex Preferences: we assume that u is concave.3 That is, for any outcomes a, a0 and any λ ∈ [0, 1], we have u(λa + (1 − λ)a0 ) ≥ λu(a) + (1 − λ)u(a0 ). This standard assumption corresponds to the economic principle of diminishing marginal returns. 2.3 Game Theory Definitions We recap some well-known definitions from the game theory literature. I Definition 4 (Pareto Efficiency). An outcome a is a Pareto Improvement on another outcome a0 if u(a) u(a0 ). An outcome a is Pareto Efficient if there is no Pareto improvement on a. The set of Pareto efficient outcomes is called the Pareto Frontier. The main solution concept that will be discussed in this paper is the core: I Definition 5 (Deviation). Given an outcome a, an outcome a0 is a deviation from a for a 0 0 coalition C if aN \C = 0 and uC (a ) > uC (a). I Definition 6 (The Core). An outcome a is in the core of the economy if no coalition has a deviation from a (equivalently, a is coalitionally stable). The next definition that will be useful in our proofs is the projected economy: I Definition 7. Given an economy described by agents N and a utility function u, the projected economy for a coalition C is the economy described by agents N and utility function uC (aC ), where uC (aC ) := uC (aC · 0N \C ). In other words, the new |C|-dimensional utility function uC is obtained by fixing the actions of N \ C at 0, allowing any action for C, and then using the old utility function u to determine the utilities for C in the natural way. We suppress the superscript uC when clear from context. 3 Confusingly, when u is mathematically concave, one says that preferences are “economically convex” – hence, convex preferences. Greg Bodwin XX:7 I Definition 8. The dominated set of a, denoted Da , is defined as: Da := {a0 | u(a) ≥ u(a0 )} In other words, Da is the set of points that no agent prefers to a. Note that this is an unusually weak definition of dominance, in the sense that (for example) Da contains a itself. 3 A Topological Characterization of the Core Our goal in this section is to prove the following structural theorem: I Theorem 9. Let a be an outcome in a public goods economy. Then a is in the core if and only if it is Pareto efficient, individually rational, and Da is path connected. The vast majority of the technical depth of this theorem is tied up in the implication a is in the core −→ Da is path connected. The remainder of this forwards implication (a is in the core → neither the grand coalition nor any singleton coalition has a deviation from a) is extremely straightforward: a is individually rational iff each agent i prefers it to the outcome they can guarantee acting alone, which coincides with the notion that the singleton coalition {i} has no deviation from a. In our model, Pareto efficiency coincides with the notion that the grand coalition N has no deviation from a: I Claim 1. Let a be an outcome. If there is an outcome a0 satisfying a a0 (a a0 ) and u(a) u(a0 ), then there is an outcome a00 satisfying a > a00 (a < a0 ) and u(a) > u(a00 ). Proof. We will prove the claim for the case a a0 ; the case a a0 follows from a symmetric argument. Choose an agent i for whom ui (a) > ui (a0 ), and then slightly increase ai . Since u is continuous, if we increase ai by a sufficiently small amount then we still have ui (a) > ui (a0 ). Additionally, by positive externalities we then have u(a) > u(a0 ). We can then slightly increase the actions of all agents, such that a > a0 , but with sufficiently small increases we do not destroy the property that u(a) > u(a0 ). J In this section, we will first give a complete proof of the (easier) backwards implication of Theorem 9, and then we sketch the proof of the forwards implication. Due to space constraints, a full proof of the forwards implication can be found in Appendix A. 3.1 Backwards Implication of Theorem 9 First: I Lemma 10. If a is Pareto efficient, then every deviation a0 from a satisfies a0 a. Proof. Let I be the set of agents i for which a0i > ai , and suppose towards a contradiction that I is nonempty. 00 00 0 Consider the point a00 defined such that aN \I := aN \I and aI := aI . We then have 00 uN \I (a ) > uN \I (a) by positive externalities, since these points differ only in that the (nonempty) coalition I has increased their actions. We also have uI (a00 ) ≥ uI (a0 ) > uI (a), where the first inequality follows from positive externalities (since these points differ only in XX:8 Testing Core Membership in Public Goods Economies that the coalition N \ I has weakly increased their action), and the second follows from the fact that a0 is a deviation from a for a coalition C with I ⊆ C (since aI > aI ). We thus have u(a00 ) > u(a), which contradicts the fact that a is Pareto efficient. Thus I is empty and the lemma follows. J Second: I Lemma 11. Suppose there is a path P ⊂ Rn≥0 with endpoints x, y such that for any p ∈ P we have u(p) ≤ u(a). If a0 is a deviation from a for some coalition C satisfying a0 x, 0 0 then a also must satisfy a y. Proof. We walk along P from x towards y until we find the first point p with pi = a0i 6= 0 for some i. If we reach y before we find any such point p, it follows that a0i = 0 or a0i < xi for all i, and so a0 x, as claimed. Otherwise, we find such a point p, and we argue towards a contradiction. We have p 6= a0 , since uC (a0 ) uC (a) but uC (p) ≤ uC (a). By construction we then have p a0 . Since pi = a0i , by positive externalities we then have ui (p) > ui (a0 ). Since a0i 6= 0 we have i ∈ C, and since a0 is a deviation for C, this implies ui (a0 ) > ui (a). We then have ui (p) > ui (a), which contradicts the assumption that u(p) ≤ u(a). Therefore no such point p may be found. J We can now show: Proof of Theorem 9, Backwards Implication. Assume that a is robust to deviations by the grand coalition or any singleton coalition, and that Da is path connected. Our goal is now to show that a is in the core. By Claim 1, the property that the grand coalition has no deviation from a implies that a is Pareto efficient. Thus, by Lemma 10 any deviation a0 from a satisfies a0 a. Since no singleton coalition has a deviation from a we have 0 ∈ Da , and since Da is path connected there is a path contained in Da with endpoints a, a. Thus, by Lemma 11, we further have that a deviation a0 must satisfy a0 0. Since no such point exists, it follows that no deviations from a exist, and so a is a core outcome. J 3.2 Sketch of Forwards Implication of Theorem 9 We will denote by dv u(a) the one-sided directional derivative of u at a in the direction v. In other words: u(a + λv) − u(a) . dv u(a) := lim+ λ→0 λ A nontrivial but standard fact from analysis is that, since u is concave and well-defined everywhere, this limit is well-defined for all a, except when excluded by a boundary condition (e.g. if vi < 0 but ai = 0 for some agent i) – see [24]. Our key lemma is: I Lemma 12. At any outcome 0 < a < 1, exactly one of the following three conditions holds: 1. There exist directions vup > 0, vdown < 0 such that dvup u(a) > 0 and dvdown u(a) < 0, 2. There exist directions vup > 0, vdown < 0 such that dvup u(a) ≤ 0 and dvdown u(a) ≤ 0, or 3. There exist directions vup > 0, vdown < 0 such that dvup u(a) < 0 and dvdown u(a) > 0. Greg Bodwin The three categories of Lemma 12 carry a useful geometric intuition. Specifically: I Lemma 13. The points in the second category of Lemma 12 are precisely the Pareto Frontier. The proofs of these two lemmas are quite technical, and can be found in Appendix A. With these in mind, we define I Definition 14. We will say that a point in the first category of Lemma 12 is below the Pareto Frontier, and a point in the third category of Lemma 12 is above the Pareto Frontier (and by Lemma 13, the second category of points in Lemma 12 are on the Pareto Frontier). The geometric intuition behind this definition is that, starting from a point x in the first category, one can continuously follow the gradient vup to eventually obtain a Pareto efficient Pareto improvement x0 > x (we do not prove this fact formally; it is perhaps useful intuition but not essential to our main results). Similarly, starting from x in the third category, we can continuously follow the gradient vdown to obtain a Pareto efficient Pareto improvement x0 < x. We then show: Proof Sketch of Theorem 9, Forwards Implication (Full proof in Appendix A). Suppose a is a core outcome, and our goal is to show path connectedness of Da . First, we note that 0 ∈ Da , since otherwise a singleton coalition can deviate from a (and a is in the core, so no such deviation is possible). To show path connectedness of Da , we consider an arbitrary point x ∈ Da and construct a path in Da from x to 0, thus implying that any two such points x, x0 ∈ Da have a connecting path in Da via 0. We show the existence of the x 0 path with a careful repeated application of Lemma 12. Informally speaking, we progressively slide x > 0 a little bit closer to 0 while maintaining the property x ∈ Da . If we ever hit xi = 0 for some agent i, then we restrict our attention to the projected economy discluding agent i and continue. If we eventually exclude all agents in this manner, then we have x = 0 and the process is complete. Otherwise, suppose towards a contradiction that at some x, we cannot slide x any closer to 0 while maintaining x ∈ Da . We make two observations here: (1) x must be above the Pareto frontier (else we could slide x in the appropriate direction vdown ) and so it belongs to the third; and (2) for all agents i still being considered, we have ui (x) = ui (a) (else, by the positive externalities assumption, we can unilaterally decrease the action of agent i without destroying x ∈ Da ). Hence, by moving x slightly in the direction vdown (which improves the utility of all agents being considered), we have ui (x) > ui (a) for all agents being considered, and so the new x is a deviation from a. Since we have assumed that a is a core outcome, this is a contradiction, and so the process of sliding x towards 0 can never get stuck in this way. J 3.3 Connection to Lindahl Equilibria Before proceeding towards our algorithm, we take a brief detour in this subsection to observe an interesting implication of Theorem 9 that helps illustrate its broader appeal. Elliot and Golub [15] show the following result: I Theorem 15 ([15]). The Lindahl equilibria of a public goods economy with a differentiable utility function are precisely the outcomes a for which da u(a) = 0. They phrase this theorem in different language related to the “benefits network” of the economy, but this formulation will suit our purposes better. We refer the reader to their paper for a more in-depth discussion of the economic role of the Lindahl equilibria. XX:9 XX:10 Testing Core Membership in Public Goods Economies Combining Theorem 15 with our machinery for Theorem 9, we obtain: I Theorem 16. In a public goods economy with a differentiable utility function, the Lindahl equilibria are precisely the core outcomes a whose membership can be certified by examining only local information at a. The proof of this theorem will use Theorem 15 as a black box, and so we will not actually need to appeal to the formal definition of the Lindahl equilibria in its proof. Proof. If a is a Lindahl equilibrium, then by Theorem 15 we have da u(a) = d−a u(a) = 0 (the first equality comes from the assumption that u is differentiable). We claim that any a satisfying da u(a) = d−a u(a) = 0 is in the core, and thus its core membership can be verified by examining only these local derivatives. First, note that a is Pareto efficient by Lemma 13. Therefore, by Lemma 10, any possible deviation a0 from a satisfies a0 a. Now let P be the line segment from 0 to a. By the assumption of concavity and the fact that d−a u(a) = 0, we have u(p) ≤ u(a) for all p ∈ P . Thus, by Lemma 11, we have a0 0 and so a0 cannot exist and a is a core outcome. Now suppose that a is not a Lindahl equilibrium, and so d−a u(a) 6= 0. If we have d−a u(a) 0, then we have da u(a) 0 (by differentiability) which implies that a is not Pareto efficient, and hence is not a core outcome. On the other hand, suppose we have d−a u(a) 0. In this case, it is impossible to distinguish u from the utility function u0 that is affine-linear everywhere and agrees with u at a using solely local information. Note that a is not in the core of the economy defined by u0 , since we have ui (0) > ui (a) for whichever agent i satisfies d−a ui (a) > 0. Thus, if a is in fact in the core of the economy defined by u, we will need to inspect non-local information about the economy to differentiate u from u0 . J We note that it is possible to prove Theorem 16 as a corollary directly from Theorem 9, but this proof using the underlying machinery is simpler. 4 Algorithm for Testing Core Membership Our main algorithmic result is: I Theorem 17. Given an outcome a in a public goods economy, there is an algorithm (in the real-RAM model) that decides whether or not a is in the core by solving O(n) convex optimization problems and using O(n) additional computation time. The algorithm is fairly straightforward. We maintain an “active coalition” CA throughout, as well as a proof that any agent i ∈ / CA must play action a0i = 0 in any deviation a0 from a. It is thus safe to assume that any deviating coalition C satisfies C ⊆ CA . Initially CA ← N , so this invariant is trivially satisfied. After each round, we either find a deviation for CA from a, or we remove one new agent from CA . Thus, if we make it n rounds without finding a deviation, then we have CA = ∅ and so no deviation from a is possible. 4.1 Preprocessing: Confirm Pareto Efficiency of a Before starting the main algorithm, we run the following two programs, with the purpose of testing whether or not a is Pareto efficient. I Program 1. Choose v to maximize min dv ui (a) i P Subj. to v ≥ 0, vi = 1 i Greg Bodwin XX:11 I Program 2. Choose v to maximize min dv ui (a) i P Subj. to v ≤ 0, vi = 1 i Note that the concavity of the optimized function f (v) := mini dv ui (a) is immediate from the concavity of u. By Lemma 12, we may immediately conclude that a is not Pareto efficient (and thus not in the core) iff either of these programs optimizes at a point v∗ satisfying f (v ∗ ) > 0. Otherwise, we proceed with the knowledge that a is Pareto efficient. A key advantage of this is that, by Lemma 10, we may now restrict our search for a deviation a0 to the bounded box 0 ≤ a0 ≤ a. This opens up the ability to use convex programming algorithms, which typically require bounded domains, in the remainder of the algorithm.4 4.2 Main Loop: Shrinking CA Each of the n rounds of the algorithm consists of three steps. First, we restrict our attention to the projected economy for the coalition CA . Second, we run the following program: I Program 3. Choose x to maximize min ui (x) − ui (a) i Subj. to 0 ≤ x ≤ aCA Let x∗ be a maximizing point of Program 3. We have: I Lemma 18. Either uCA (x∗ ) > uCA (a) or uCA (x∗ ) ≤ uCA (a), and x∗ is Pareto efficient.5 Proof. First we argue Pareto efficiency. If x0 is a Pareto improvement on x∗ , then by Claim 1 there is another point x00 with u(x00 ) > u(x∗ ). This x00 would be a superior maximizing point for Program 3, so there can be no Pareto improvement on x∗ . Next, let i := arg maxi ui (x∗ )−ui (a) and j := arg minj uj (x∗ )−uj (a). If ui (x∗ )−ui (a) > uj (x∗ ) − uj (a), then (by the same argument used in Claim 1) we can again obtain a superior maximizing point x∗∗ by slightly increasing the action of agent i from x∗ . Thus we have ui (x∗ )−ui (a) = uj (x∗ )−uj (a), and it follows that either u(x∗ ) > u(a) or u(x∗ ) ≤ u(a). J In the former case where u(x∗ ) > u(a), it follows that x∗ is a deviation from a for the coalition CA , so we may halt the algorithm. Otherwise, we have u(x∗ ) ≤ u(a). We then observe: I Lemma 19. If uCA (x∗ ) ≤ uCA (a), then in the full (non-projected) economy, any deviation 0 a0 from a for a coalition C ⊆ CA satisfies aC x∗ . A 0 0 ∗ Proof. The deviation a0 satisfies aN \C = 0 and uC (a ) > uC (a) ≥ uC (x ). It follows that 0 ∗ aC is also a deviation for C from x in the projected economy for CA . The claim is then immediate from Lemma 10. J One step remains. We run: I Program 4. Choose v to maximize min dv ui (x∗ ) i P Subj. to v ≤ 0, vi = 1 i 4 5 This detail is precisely why we use Programs 1 and 2 to check the Pareto efficiency of a, rather than the ostensibly simpler method of searching for x∗ that maximizes mini ui (x∗ ) − ui (a): the latter method requires a search for x∗ over an unbounded search space, which rules out many popular methods of convex optimization that we wish to keep available. Note that these statements hold specifically in the projected economy for CA . XX:12 Testing Core Membership in Public Goods Economies Let v∗ be a point that maximizes Program 4. We have I Lemma 20. dv∗ u(x∗ ) ≤ 0 The proof is very similar to the proof of Lemma 18, so we omit it for now. We then finally have: I Lemma 21. Let i := arg mini x∗i /vi∗ . Then any deviation a0 from a has a0i = 0. 0 Proof. By Lemma 19, we have aC x∗ . Let P be the line segment starting at x∗ , A ∗ extending in the direction v until a point p∗ is reached where p∗i = 0 for some agent i; note that this will specifically be i = arg mini x∗i /vi∗ . By concavity, all p ∈ P satisfies 0 u(p) ≤ u(x∗ ) ≤ u(a). Noting once again that aC is a deviation for C from x∗ in the A 0 J projected economy for CA , it follows from Lemma 11 that aC p∗ , and so a0i = 0. A With this in mind, the final step in the loop is to delete i from CA and repeat. After n repetitions, we have CA = ∅, so we may halt the algorithm and report that a is in the core. 4.3 Algorithm Pseudocode To recap the algorithm, which has been interspersed with proofs of correctness above, we give full pseudocode here. Algorithm 1: Testing Core Membership of a 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4.4 Let v1∗ ← output of Program 1; Let v2∗ ← output of Program 2; if dv∗1 u(a) > 0 or dv∗1 u(a) > 0 then return “a is not in the core”; end CA ← N ; while CA 6= ∅ do x∗ ← output of Program 3; if uCA (x∗ ) > uCA (a) then return “a is not in the core”; end v∗ ← output of Program 4; CA ← CA \ {arg mini∈CA x∗i /vi∗ }; end return “a is in the core”; Conclusion: Adapting the Algorithm for Approximate Optimization Our algorithm implies that core membership testing is efficient under any utility function that admits quick solving of convex programs as described above. However, it may still be desirable to test core membership as best as possible when the underlying utility function is either unknown or badly behaved and so exact convex optimization is impossible. Our algorithm can indeed be adapted to this effect, with a few significant points of caution, by substituting in modern approximate optimization algorithms. Due to space constraints, we include a discussion of this adaptation in Appendix B. Greg Bodwin 5 Acknowledgements I am very grateful to Ben Golub, who introduced me to this area of game theory and many of the problems addressed in this paper, and who helped advise an early version of this research project. I am also grateful to Ben Hescott for mentorship and writing advice during the early stages of this project. Finally, I thank an anonymous reviewer for useful criticism and corrections on an earlier draft of this paper. References 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 N. Allouch. The cost of segregation in social networks. Queen Mary Working Paper, 2013. N. Allouch. On the private provision of public goods on networks. Journal of Economic Theory, pages 527–552, 2015. C. Ballester, A. Calvó-Armengol, and Y. Zenou. Who’s who in networks. wanted: The key player. Econometrica, 74:1403–1417, 2006. Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, 2004. Y. Bramoulle and R. Kranton. Public goods in networks. Journal of Economic Theory, 135:478–494, 2007. S. Bubeck. Convex optimization: Algorithms and complexity. Foundations and Trends in Machine Learning, 8(3-4):231–358, 2015. Peter Cameron. Combinatorics: Topics, Techniques, Algorithms. Cambridge University Press, 1994. Parkash Chander and Henry Tulkens. The core of an economy with multilateral environmental externalities. International Journal of Game Theory, 26:379–401, 1997. V. Conitzer and T. Sandholm. Computing shapley values, manipulating value division schemes, and checking core membership in multi-issue domains. In Proc. National Conference on Artificial Intelligence (AAAI), pages 219–225, 2004. V. Conitzer and T. Sandholm. Complexity of constructing solutions in the core based on synergies among coalitions. Artificial Intelligence, pages 607––619, 2006. Imma Curriel. Cooperative Game Theory and Applications. Springer US, 1 edition, 1997. X. Deng and C. Papadimitriou. On the complexity of cooperative solution concepts. Mathematics of Operations Research, 19:257, 1994. F. Y. Edgeworth. Mathematical psychics: An essay on the mathematics to the moral sciences. Reprinted in Diamond, M.A., 1881. E. Elkind, L. A. Goldberg, P. W. Goldberg, and M. Wooldridge. A tractable and expressive class of marginal contribution nets and its applications. Math. Log. Q., 2009. Matthew Elliot and Benjamin Golub. A network approach to public goods. In Proc. 14th Electronic Commerce (EC), pages 377–378, 2013. U. Faigle, S. Fekete, W. Hochstattler, and W. Kern. On the complexity of testing membership in the core of min-cost spanning trees. Internat. J. Game Theory, 26:361––366, 1997. D. K. Foley. Lindahl’s solution and the core of an economy with public goods. Econometrica, 38:66–72, 1970. D. B. Gillies. Solutions to general non-zero-sum games. Contributions to the Theory of Games IV, pages 47–85, 1959. M. Goemans and M. Skutella. Cooperative facility location games. In Symposium on Discrete Algorithms (SODA), pages 76–85, 2000. Benjamin Golub. Personal correspondence, 2012. XX:13 XX:14 Testing Core Membership in Public Goods Economies 21 22 23 24 25 26 27 28 29 30 31 A A.1 G. Greco, E. Malizia, L. Palopoli, and F. Scarcello. On the complexity of the core over coalition structures. In International Joint Conference on Artificial Intelligence (IJCAI), 2011. S. Ieong and Y. Shoham. Marginal contribution nets: A compact representation scheme for coalitional games. In Electronic Commerce (EC), pages 193–202, 2005. S. Kintali, L. Poplawski, R. Rajaraman, R. Sundaram, and S. Teng. Reducibility among fractional stability problems. In Proc. 50th FOCS, pages 283–292, 2009. Jonathan Lewin. An interactive introduction to mathematical analysis. Cambridge University Press, 2003. Y. Li and V. Conitzer. Complexity of stability-based solution concepts in multi-issue and mc-net cooperative games. In Proc. 2014 international conference on Autonomous agents and multi-agent systems (AAMAS). International Foundation for Autonomous Agents and Multiagent Systems, 2014. Bezalel Peleg and Peter Sudhölter. Introduction to the Theory of Cooperative Games. Springer, 2 edition, 10 2007. V. Protasov. Algorithms for approximate calculation of the minimum of a convex function from its values. Mathematical Notes, 1:69–74, 1996. Paul Samuelson. The pure theory of public expenditure. Review of Economics and Statistics, 37(4):350–356, 1954. H. Scarf. The core of an n person game. Econometrica, 1967. L.S. Shapley and M. Shubik. Quasi-cores in a monetary economy with non-convex preferences. Econometrica, 34:805–827, 1966. S. Sung and D. Dimitrov. On core membership testing for hedonic coalition formation games. Operations Research Letters, 35:155–158, 2007. Remaining Proof of Theorem 9 Proof of Lemmas 12 and 13 We begin with some useful well-known technical claims. Proofs can be found in most textbooks on analysis and/or combinatorics, see e.g. [24, 7]. I Claim 2. For any fixed a > 0, the function f (v) := dv u(a) takes values in Rn for all v (i.e. the limit is well-defined and not infinite on all indices) and f is concave (which follows from the assumption that u is concave). I Claim 3. Any concave function f : Rn → R with domain restricted to a bounded subset of Rn is Lipschitz continuous. That is, for any bounded domain D ⊂ Rn , there is a constant KD such that for any v1 , v2 ∈ Rn we have kf (v1 ) − f (v2 )k ≤ KD · kv1 − v2 k. I Lemma 22 (Sperner’s Lemma). Let S be an (n − 1)-simplex.6 Let T be a partition of S into smaller (n − 1)-simplices (a “simplicization” of S), and color each point in S that is a vertex of some sub-simplex T ∈ T by one of n colors. If there is no vertex on the face of S opposite its ith vertex that is given color i, then there exists a “rainbow” simplex T ∈ T for which the n vertices of T have all n possible colors. I Lemma 23 (Cantor’s Intersection Theorem). Let {Xi } be an infinite sequence of nonempty T sets that are closed and bounded, with Xi ⊇ Xi+1 for all i. Then Xi 6= ∅. i 6 An (n − 1)-simplex is an n − 1 dimensional analogue of a triangle defined by n vertices; e.g. a 2-simplex is a triangle, a 3-simplex is a tetrahedron, etc. Greg Bodwin XX:15 We now proceed with some original observations: I Claim 4. For any outcome a > 0, if there exists a direction v > 0 (v < 0) for which dv u(a) 0, then there is no direction v0 > 0 (v0 < 0) for which dv0 u(a) ≤ 0. Proof. We will prove the claim for v, v0 > 0; the case where v, v0 < 0 follows from an identical argument. Let v > 0 such that dv u(a) 0, and let v0 > 0 be an arbitrary direction that is not a scalar multiple of v. We can then find a vector x > 0 for which v + x = λv0 for some scalar λ > 0, such that xi = 0 for some i. We have that (dv u(a))i > 0 (by hypothesis) and (dx u(a))i > 0 (by the positive externalities assumption). Thus, by concavity of u, we have (dv+x u(a))i > 0, and so (dλv0 u(a))i > 0. Therefore we cannot have dv0 u(a) ≤ 0. J Now we are ready to show: I Lemma 24 (Lemma 12 in the body of the paper). At any outcome a > 0, exactly one of the following three conditions holds: 1. There exist directions vup > 0, vdown < 0 such that dvup u(a) > 0 and dvdown u(a) < 0, 2. There exist directions vup > 0, vdown < 0 such that dvup u(a) ≤ 0 and dvdown u(a) ≤ 0, or 3. There exist directions vup > 0, vdown < 0 such that dvup u(a) < 0 and dvdown u(a) > 0. Proof. First, we observe that Claim 4 implies that no a can satisfy two of these conditions simultaneously: if a satisfies the first condition then there is no vup satisfying the latter two conditions; if a satisfies the last condition then there is no vdown satisfying either of the former two conditions. Thus, it suffices to show that each point a satisfies at least one of these three conditions, and we immediately have that it satisfies exactly one of these three conditions. Second, by Claim 1, it suffices to show the existence of vup 0, vdown 0 satisfying these conditions. Now we begin the main proof. Let S be the (n − 1)-simplex in Rn with vertex set equal to the n basis vectors {ei } (where ei ∈ Rn is the vector with a 1 in the ith place and a 0 elsewhere). If mini (ds u(a))i > 0 for any s ∈ S, then we have ds u(a) > 0. By convex preferences we also have that vdown := −vup satisfies dvdown u(a) < 0, and so we may place a into the first category of Lemma 12. Otherwise, assume that mini (ds u(a))i ≤ 0 for all s ∈ S. In this case, our goal is to show that there is vup with dvup u(a) ≤ 0. Assign each agent a color, and color each point s ∈ S by the agent arg mini (ds u(a))i , breaking ties arbitrarily. Let Fi be the face of S opposite ei ; that is, Fi is the set of s ∈ S for which si = 0. Let f be any point in Fi . Note that, by the assumption of positive externalities, we have (df u(a))i > 0; since we have assumed that mini (df u(a))i ≤ 0, this implies that f is not colored by agent i. Let T be a simplicization of S such that each simplex T ∈ T fits in a ball of radius ε, for some ε > 0 that we will pick later. Since the face Fi does not include any points with color i, we may apply Sperner’s Lemma (Lemma 22) to conclude that there is a simplex T ∈ T whose n vertices {t1 , . . . , tn } are rainbow (we assume without loss of generality that vertex ti has color i). Let x be a point within distance ε of each vertex ti . Since (dti u(a))i ≤ 0, and since f (d) = dv u(a) is Lipschitz continuous on S (from Claims 2 and 3), it follows that there is a constant KS independent of ε such that (dx u(a))i ≤ εKS for all i. In other words, we have that u(x) ≤ εKS 1, and so the set Zλ := {s ∈ S | ds u(a) ≤ λ1} XX:16 Testing Core Membership in Public Goods Economies is nonempty for all λ > 0, since it contains x when we choose ε ≤ KλS . Since the function f (s) = ds u(a) is continuous, Zλ for any λ > 0 is closed, bounded, and nonempty. Thus, if we express the set Z0 := {s ∈ S | ds u(a) ≤ 0} as Z0 = \ Zλ λ>0 then we see that Z0 is the intersection of a descending sequence of sets that are closed, bounded, and nonempty. By Cantor’s Intersection Theorem (Lemma 23), Z0 is nonempty. Note that any v ∈ Z0 satisfies v > 0, since if vi = 0 then by the positive externalities assumption we have (dv u(a))i ≤ 0. We may thus take vup to be any element of Z0 , and we have vup > 0 and dvup u(a) ≤ 0. We have now shown that there is a vector vup > 0 that satisfies either dvup u(a) > 0 or dvup u(a) ≤ 0. By an exactly symmetric argument, we have that there is a vector vdown < 0 that satisfies either dvdown u(a) > 0 or dvdown u(a) ≤ 0. Thus, if dvup u(a) > 0 then we may place a into the first category, if dvdown u(a) > 0 then we may place a into the last category, and if neither of these are true then we simultaneously have dvup u(a) ≤ 0 and dvdown u(a) ≤ 0 and so we may place a into the second category. J I Claim 5. If there is a Pareto improvement a0 on an outcome a satisfying a0 6 there is a Pareto improvement a00 on a satisfying a00 > a. a, then 0 > a. If C is empty then we have Proof. Let C be the largest set of agents for which aC 0 a a and we are done. Otherwise, suppose C is nonempty. Define the point amax such that amax := max{a0i , ai } for all j. By positive externalities, we have uC (amax ) ≥ uC (a0 ) ≥ uC (a) j (where the latter inequality follows from the fact that a0 is a Pareto improvement on a). Also by positive externalities, we have uN \C (amax ) > uN \C (a0 ). Thus, amax is a Pareto improvement on a which satisfies amax a. By Claim 1, we may further assume that amax > a. J I Lemma 25 (Lemma 13 in the body of the paper). The points in the second category of Lemma 12 are precisely the Pareto Frontier. Proof. It is clear that no outcome a in the first or third category of Lemma 12 is Pareto efficient, since these points have a direction v for which dv u(a) > 0. Therefore the second category in Lemma 12 contains the Pareto frontier. Let a be an outcome in the second category, and suppose towards a contradiction that a0 is a Pareto improvement on a. By Claim 5, we may assume that a0 a or a0 a; by Claim 1 we may assume more 0 0 strongly that a > a or a < a . By concavity of u, we have that da0 −a u(a) > 0. There also exist directions vup , vdown for which dvup u(a) ≤ 0 and dvdown u(a) ≤ 0. Since a0 − a > 0 or a0 − a < 0, we have a contradiction to Claim 4. Thus, there can be no Pareto improvement a0 on a. J A.2 Proof of Theorem 9 We assume that a is a core outcome. By definition this implies that the grand coalition and singleton coalitions have no deviation from a. Thus, it only remains to show that Da is path connected. Greg Bodwin I Claim 6. Let x be a point on the lower envelope of a path connected component of Da (i.e. there is no point x0 x in this component).7 Then for some (possibly empty) set of agents C ⊆ N , we have uC (x) = uC (a) and xN \C = 0N \C . Proof. Define C to be the set of largest agents for which xC > 0C . By definition we have xN \C = 0N \C , so we only need to prove that uC (x) = uC (a). Suppose towards a contradiction that there is an agent i for whom xi > 0 and ui (x) < ui (a). We can then modify x to a new point x0 by slightly decreasing the action of agent i. Since u is continuous, if we make this decrease small enough then we still have ui (x0 ) < ui (a). By positive externalities, we then have u(x0 ) < u(a). Since x0 x, this contradicts the fact that x is on the lower envelope of its connected component. J I Lemma 26. If a is a core outcome, then Da is path connected. Proof. We prove the contrapositive. Suppose Da is not path connected, and let D̄a be a path connected component of Da that does not include 0, and let x be a point on the lower envelope of D̄a . Let C be the smallest coalition such that uC (x) = uC (a) and xN \C = 0N \C (the existence of such a coalition is given by Claim 6); note that x 6= 0 and so C is nonempty. Now consider the projected economy for C. We have xC > 0C , so Lemma 12 applies to the outcome xC in this economy. Our next step is to figure out which of the three categories in Lemma 12 contains xC in the projected economy. We observe that xC cannot fall into the first or second category of Lemma 12. This holds because we would have vdown < 0 with dvdown u(a) ≤ 0, which means that we can slightly decrease the actions of the coalition C in the original economy along the direction vdown , giving a new point x0 x. By concavity of u, we still have u(x0 ) ≤ u(a) and so x0 belongs to the same connected component of D̄a ; this contradicts the assumption that x is on the lower envelope of D̄a . Thus xC is in the third category of Lemma 12 in the projected economy, so there is a direction vdown < 0 with dvdown u(a) > 0. If we 0 0 ) > uC (aC ). with uC (xC move xC slightly in this direction vdown , we obtain an outcome xC 0 0 0 By setting xN \C = 0, we then concatenate xC and xN \C to obtain a point x0 , which is a deviation in the original economy for the coalition C. J B Adapting the Algorithm for Approximate Optimization We conclude by discussing the feasibility of the algorithm on utility functions that are either unknown or badly behaved, where exact convex optimization might not be easily solvable. Here, one can use modern approximate convex optimization algorithms in the place of the exact solutions assumed in the above algorithm. These algorithms query the utility function and its derivatives at various points in the domain, ultimately finding a point that comes within an additive ε of the optimal value. Their theoretical runtime is typically a large polynomial in the dimensionality of the search space (n) but quite good in the accuracy e 5 log(ε−1 )) time parameter (ε); for example, randomized center-of-gravity methods use O(n 6 −1 e [6], leading to a runtime of O(n log(ε )) for our algorithm. Further improvements are possible via more specialized optimization algorithms if one wishes to assume nice properties for the utility function. If one does not wish to assume that the utility function derivatives can be easily measured, these algorithms can be adapted to avoid this necessity, although 7 The existence of x follows straightforwardly from the fact that the path connected components of Da are topologically closed (since u is continuous). XX:17 XX:18 Testing Core Membership in Public Goods Economies at the cost of an additional factor of n [27]. For a general reference on convex optimization, see [4]. Let us consider a natural relaxation in which the goal is to distinguish between core outcomes and outcomes that are ε-far from being in the core (i.e. there is an “ε-deviation” a0 from a satisfying uC (a0 ) > uC (a) + ε1 for the deviating coalition C). Two tweaks to the algorithm/model will be needed to solve this relaxed problem with an approximate convex optimization algorithm. B.1 First Change: A Bounded Action Space First, caution is needed in the preprocessing stage where the Pareto efficiency of a is tested. It is no longer feasible to use the derivative-testing technique employed here in Programs 1 and 2: the unbounded domain means that even a slightly positive entry in the directional derivatives can translate to an indefinitely large Pareto improvement by following this gradient out far enough. In other words, approximately negative directional derivatives do not translate to approximately Pareto efficient points. Perhaps the most natural workaround here is to simply enforce a bounded domain, i.e. assume that actions lie in the interval [0, 1] rather than [0, ∞). It seems fairly economically natural to assume a maximum amount of possible work for each agent. With this assumption in hand, we can actually skip the entire preprocessing phase and move straight to the main loop where we iteratively shrink CA . The only purpose of the processing phase in the original algorithm is to bound the deviation search space via Lemma 10; if we assume a bounded action space in the first place, it is no longer needed. B.2 Second Change: Dependence on the Condition Number The second change needed in the algorithm is that we must incurr an additional dependence in runtime on the condition number of the economy κ := max dv ui (x). v,x,i This dependence comes from the interplay between Programs 3 and 4. To demonstrate c∗ . We can the issue, suppose we run Program 3 up to accuracy ε, returning a point x c∗ to distinguish the cases in which the current active coalition CA has an easily examine x ε-deviation versus no deviation at all. It is also quite straightforward to extend Lemmas 10 and 11. The trouble is that Lemma 20 breaks horribly; in particular, the vector v∗ ≤ 0 c∗ ) ≤ 0. returned by Program 4 might not even approximately satisfy dv∗ u(x We propose the following solution. First, we improve the accuracy of Program 3 from c∗ be its output. Thus if x c∗ is not a deviation, then there is no ε to ε/(2κ), and again let x ε/(2κ)-deviation from a for CA . Second, we begin an iterative process where we repeatedly c∗ ) ≤ ui (a) + ε/2, and we modify x c∗ by decreasing the action select an agent i where ui (x c∗ ) ≤ ui (a) + 2ε/3, and of agent i by ε/(2κ). Note that we now (quite generously) have ui (x we may repeat the process on a new agent. In the worst case, we may need to repeat this process O(nκ/ε) times before an agent’s action reaches 0. However, we can halt the process c∗ to a point below the Pareto frontier, at which point we may simply as soon as we slide x compute the appropriate downwards derivative by Program 4. We were unable to determine if there actually exist utility functions in which the additional dependence of O(nκ/ε) will actually be realized in most iterations of the algorithm.
8cs.DS
International Journal of Database Management Systems ( IJDMS ) Vol.5, No.5, October 2013 THE OPTIMIZATION OF RUNNING QUERIES IN RELATIONAL DATABASES USING ANT-COLONY ALGORITHM Adel Alinezhad Kolaei and Marzieh Ahmadzadeh Department of Computer Engineering & IT Shiraz University of Technology ABSTRACT The issue of optimizing queries is a cost-sensitive process and with respect to the number of associated tables in a query, its number of permutations grows exponentially. On one hand, in comparison with other operators in relational database, join operator is the most difficult and complicated one in terms of optimization for reducing its runtime. Accordingly, various algorithms have so far been proposed to solve this problem. On the other hand, the success of any database management system (DBMS) means exploiting the query model. In the current paper, the heuristic ant algorithm has been proposed to solve this problem and improve the runtime of join operation. Experiments and observed results reveal the efficiency of this algorithm compared to its similar algorithms. KEYWORDS Database, Join Operation Optimization , Traveling Salesperson, Ants Algorithm. 1. INTRODUCTION Optimization of database queries such as relational database queries is one of the most important research issues. If queries are in interactional mode, they will contain a few relations such that optimization of these queries can be done using a comprehensive search. However, if the number of relations is more than 5 or 6, techniques for comprehensive search will be costly in terms of computer memory and time. Optimization of queries is an activity in which an efficient strategy for performing the query is produced hence it is a fundamental step in query processing. In this stage, DBMS selects the best strategy among some given executive strategies so that running the given query using this strategy by user has minimum cost. The input in this system is a query such as q to DBMS by user. Suppose that S is the set of all possible strategies to answer query q. Each element of the set S such as s has cost C(s) (in terms of CPU usage, input and output, memory consumption, etc.). The purpose of an optimization algorithm to find an element s0 in S such that [1,2]: C(s0) = min C(si) si ε S DOI : 10.5121/ijdms.2013.5501 1 International Journal of Database Management Systems ( IJDMS ) Vol.5, No.5, October 2013 In order to respond to query q, a strategy applies a sequence of algebraic operators on database relations so that it ultimately finds the answer of q. The overall cost of a strategy is the sum of processing cost of each operator. In comparison to existing relational operators, processing and optimizing join operator which is denoted by ∞ is one of the most complicated tasks. Basically, the join operator uses two relations as input and combines tuples of each relation correspondingly and returns a new relation as the output. Since join operator has commutative and associative properties, the number of existing running strategies to answer a query grows exponentially as the number of joins between relations increases; however, all of the existing running strategies to answer to a specified query have not the same output (such as R3=R1 ∞ (R2 ∞ R3) ∞ (R1 ∞ R2)), the resultant running strategy has a different cost, since the cardinality of alternative relations are not the same. So, selecting an appropriate ordering for running join operator is influential to the overall cost. Since, optimization of a query which consists of join operator is more timeconsuming than other relational operators such as selection or projection operator, all of the query optimization techniques are applied to queries involved in join operator. Some algorithms which can be used to solve this problem are as follow: Iterative Improvement, Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Hybrid Evolutionary Algorithm, etc. It can be understood that hyper-heuristic algorithms have been resulted in appropriate solutions to this problem. Accordingly, in the present paper, we have used hyper-heuristic ant algorithm to solve this problem. The contents of this paper have been organized as follows: In sections 2 and 3, Traveling sales person problem and a brief history of ant Algorithm is respectively mentioned. In section 4, the proposed Algorithm is illustrated. In sections 5 and 6, implementation environment and results of experiments are explained, respectively. In section 7, the paper is concluded. 2. TRAVELING SALES PERSON PROBLEM Traveling Sales Person problem is a classic and famous problem in the field of operation research. Many problems in science can be formulated in the form of this problem and then solved. This problem consists of n cities where there will be a path between each two cities. Every such path between two cities has a cost function which equals to the distance between these cities. Traveling sales person wants to start his travel from one of the cities and then visits all of the cities just once and finally returns to the first city where he started his travel. The solution for this problem is a sequence of cities where the sales person has visited once and the main constrain is that the total cost (distance) be minimized [7]. 3. ANT ALGORITHM In 1991, Dorigo and Clarini used hybrid-heuristic ant Algorithms to solve separable problems [8]. This Algorithm has such properties as simple adaptability for applying in many problems. Ant Algorithms are multi-agent systems whose behavior is derived from real ants and each agent is an artificial ant. These Algorithms are successful samples of swarm intelligence systems and are applicable to a range of problems from Traveling Sales Person problem to routing in remote communication networks. In addition, they can be used in hybrid optimization problems such as quadratic allocation and scheduling task problems in a set of given tasks. 2 International Journal of Database Management Systems ( IJDMS ) Vol.5, No.5, October 2013 Figure 1. The way of moving ants to find food resources and shedding pheromone Figure (1) shows the way that ants adopt to find food resources. When ants move they remain a chemical substance called pheromone. As it is shown in figure (1), at time t=0 the number of ants in two different paths are the same but at time t=1 their numbers in these paths are different and in shorter path the number of ants is more. This is the case because during their movement, ants release pheromone and as time passes, it is evaporated. Therefore, the shorter the length of the path, the less the pheromone is evaporated and the more the remaining pheromone will be, so ants will select this shorter path through next stages. The experiment on ants shows that despite the existence of two paths with different length from nest to food, after a while (about a few minutes), most of ants select shorter path and this ratio increases as the difference between paths increases. In order to find food, ants release pheromone while moving from nest to other place and vice versa. When they reach a point which is the intersection point of shorter and longer path, they adopt a probabilistic selection based on the amount of pheromone smelled. Such behavior has an autocatalytic effect because when a path is selected, it is more probable that in future the same path will be selected too. Therefore, by repeating this procedure, the released pheromone in the shorter path will be saved in higher rate so that the shorter path is more and more selected. This simple idea is applicable to find appropriate solutions in complicated optimization problems [8, 9, 10, 11]. In Traveling Sales Person problem, there are a set of n cities in which we should find the shortest closed path consisting of these cities. If dij denotes the length of path between cities i and j in symmetric Traveling Sales Person problem, to find the shortest path among these cities we will use some artificial ants (agents) which have the following properties: Ants will randomly be placed on nodes. Each ant selects the next city in a probabilistic approach. The probability of selecting next city is a function of distance to other cities the associated value in the sequence of cities on the related nodes. 3 International Journal of Database Management Systems ( IJDMS ) Vol.5, No.5, October 2013 Each ant has to move to allowable paths i.e. it should move to cities that was not visited in the past. This condition is controlled using prohibited list. When a path is formed, pheromone is placed on its nodes and the ant releases some pheromone while crossing the cities. Ant in the time interval (t, t+1) performs one move, so, in each iteration of Algorithm, m move will occur. In the time interval (t, t+1), some pheromone evaporates. When each ant has created its own path, pheromone will again be specified to them [8, 9, 10, 11]. In 1996, Dorigo and Jembardla, made some modifications to ant Algorithm [9] and proposed AntColony Algorithm. This proposed Algorithm was different from previous Algorithm in terms of following characteristics: • • • The changing position rule which directly controls the effect of new nodes and old ones on the Algorithm. The overall updating rule that updating had been used only on nodes which belonged to ants’ paths. When the ants form a solution, the local updating rule will be applied. 4. OUR PROPOSED APPROACH Considering the proposed illustrations, it can be stated that if we can formulate optimization problems in well-known problems for which some Algorithms have been proposed, we can solve them through the above-mentioned methods. Therefore, the main task is how to convert these problems in to famous solved problems. As it was mentioned above, one of the famous problems is Traveling Sales Person problem for which different Algorithms have been proposed to solve it. Such Algorithms are Genetic Algorithm, Particle Swarm Optimization, Ant Algorithm, hybrid Algorithm, etc. We decide to solve optimizing join operation problem in relational database firstly by converting it to TSP problem and then solve it using Hyper-Heuristic Ant Algorithm. It should be mentioned that the main problem in this paper is not the same to original TSP problem because in the original TSP problem, sales person returns to first city, however, in the proposed problem, this is not the case. So, firstly formulas and the way that this problem should be solved using ant Algorithm has been stated and then important parameters and how converting this problem will be stated. Ant-Colony Algorithm which we considered in this paper is exactly the one proposed by Dorigo [9]. In this Algorithm, in the first phase, initially m ants with memory are created. These ants will randomly be placed on n nodes. On each node, there is some initial pheromone. In the second phase, to obtain initial solutions, the following steps are run in parallel. To select city s in its next move, the ant which is placed on node r, uses relation (1) known as position changing rule in Ant-Colony Algorithm. In relation (1), q is a random number in [0, 1] interval and the value of q0 is between 0 and 1. 4 International Journal of Database Management Systems ( IJDMS ) Vol.5, No.5, October 2013  β . η (r , u )]  arg max u∈J k ( r ) [τ ( r , u )][ s= S  { } if q ≤ q 0 otherwise (1) Where τ(r, s) represents the amount of pheromone on arc (r,s), η(r, s) is the reciprocal distance δ(r,s), JK(r) is the remaining set of cities for k-th ant placed on city r,β is the importance determining parameter in the relation between pheromone and distance. However, in relation (1), s is a random variable that follows from the probability distribution mentioned as relation (2). β  [τ (r , s )][ . η (r , s)]  [τ (r , u)][. η (r , u )]β  s =  u∈∑ J k (r )  0 if s ∈ J k (r ) otherwise (2) Where Pk(r,s) is the probability that k-th ant after selecting city r will select city s. After that ants create their own paths, they return to their first city. In this step, local updating will be done and the amount of pheromone changes by relation (3). τ ( r , s ) ← (1 − ρ ).τ ( r , s ) + ρ .∆τ ( r , s ) (3) Where ρ is pheromone evaporating parameter and ∆τ(r,s) is obtained using relation (4):  −1 ( L gb ) ∆τ ( r , s ) =  0  if ( r , s ) ∈ global _ best _ tour otherwise (4) where Lgb is the length of the best path which has already been found in the current iteration [9]. To solve the join problem of tables using Ant-Colony Algorithm, it suffices that we consider every table as a city (n cities) and that sales person doesn’t return to first city and also we should consider η(r, u) equal to reciprocal of the cost of two tables r and u and Lgb as minimum cost of the join of all tables in each iteration of Algorithm (parameter β can also be considered as an important parameter in distributed database). Therefore, in beginning of Algorithm, each ant is randomly placed on a city, then for move, join of this city with other cities (tables) should be verified if joining of these cities is possible as mentioned in the definition of problem-that is there exists a path between them- and after these steps, the table with minimum cost (least time for join operation) will be considered as a next city (table). To achieve this purpose, in each step, the cost of joining two tables as a cost of path between these two cities is added up with the cost of previous joins (equals total cost up to current step). In each run of Algorithm, with respect to local updating, the amount of pheromone changes until the best path is specified, so this path can be used in the next step and finally the best path (the join with minimum cost) can be selected. 5 International Journal of Database Management Systems ( IJDMS ) Vol.5, No.5, October 2013 5. IMPLEMENTATION ENVIRONMENT We have used databases with the number of tables equal to 8, 12, 16, 20, 24, 28 and 32 in which the number of records in each table has been produced as a random number with uniform distribution. The parameters and system specification and implementation environment are as follows: We have used a system with Intel Core 2duo and 2.26GHZ cpu, 3GB RAM memory XP operating system. The language that program has been written with is C# and also we have used SQL SERVER database. In addition, we ran the program 20 times and in each run we have used 30 iterations, in other words, Iteration Number=30 and Run Number=20. The mean number of records which are used from each table in experiments is given in table1: Table1 : The mean number of records in each table in experiments Number of tables 8 12 16 20 24 28 32 Average number of records per table 383 418 362 397 403 354 429 6. EXPERIMENTAL RESULTS For our proposed approach, the number of ants is considered as the number of vertices and then the program has been executed. The number of iteration s for each experiment was 20 and the mean number of times through which iterations have been done is given in figure2. Figure 2. Execution time tests 6 International Journal of Database Management Systems ( IJDMS ) Vol.5, No.5, October 2013 As it can be seen from figure 2, the proposed approach has resulted in a good performance in comparison to other approaches. This is the case because other approaches verify almost all existing ways of running a query while in the proposed approach , in each experiment if ants find a better solution (to join tables), they will inform the existence of this solution with respect to the updating strategy to other ants in order that they use this solution to find optimal solutions. Therefore, all existed solutions for running a query (join of multiple tables) will have not been verified and cpu time is saved. In other words, in our approach, ants operate in parallel. It should be noted that in the proposed approach, we have set the number of ants equal to the number of tables w and in the next time, we set it as half the number of tables and finally we have shown that for the second case, cpu time has decreased. On the other hand, the more the number of ants is, the less the decrease in the probability of the precision of the obtained result (as the experiment shows). Therefore, if we use more powerful processors, the runtime of Algorithm will decrease. In other words, if we use multi-processor system, runtime will decrease to an acceptable level and this is the case because ants Algorithm operates parallel and also the ants work in parallel with each other and updating is performed when each step is finished. 7. CONCLUSION In this paper, we stated a new approach for optimizing execution of queries in relational databases using Ant Colony algorithm. For this, we initially maped the connection between tables into a TSP model ,in which each table was considered as a city and each table link as a relation between two cities. Then the problem was solved by Ant Colony algorithm. Several such experiment was conducted for a number of different tables for which the numbers of records in each table were chosen randomly with uniform distribution. Experiments and given results proved the better performance of this approach rather than others that were given in the literature. The main reason for the efficiency of this method is its parallel property. This happened since our approach did not investigate all the existing ineffective and useless solutions for query execution, while, in the majority of other approaches the most existing solutions need to be evaluated. . As a consequence, we achieved a better execution time. REFERENCES [1] [2] [3] [4] [5] [6] F. Mahmoudi, M. Zahedi Anaraki, A.H. Zahedi Anaraki, Optimization of executing queries in relational databases with particle swarm algorithm, 16th National CSI Computer Conference, 2011.[Paper published in Persian] S. Parsa, H. Izadkhah, A. Hossein zadeh, Combination of hill climbing algorithm in parallel machine for optimization of large queries in question graph, 3rd IKT Conference, 2007. [Paper published in Persian] J. L. Sushil and Z. Yongmian . An Empirical Comparison of Randomized Algorithms for Large Join Query Optimization. Proceedings of the Eleventh International Florida Artificial Intelligence Research Society Conference, pp. 95-100, 1998. K. Bennet, M. C. Ferris and Y. E. Ioannidis. A Genetic Algorithm for Database Query Optimization. In Proc. of the Fourth Intl. Conf. on Genetic Algorithms, pp. 400-407, San Diego, USA, 1991. Y. E. Ioannidis and E. Wong. Query Optimization by Simulated Annealing. In Proc. of the ACMSIGMOD Conf. on Management of Data, pp. 9-22 San Francisco, USA, May 1987. K. Asghari, A. Safari Mamaghani, F. Mahmoudi, M. Meibodi, Optimization of executing queries in relational databases with hybrid evolutionary algorithm. Computer and Robotics magazine. p.25-37. 2008. [Paper published in Persian] 7 International Journal of Database Management Systems ( IJDMS ) Vol.5, No.5, October 2013 [7] [8] [9] [10] [11] M. Jünger, G. Reinelt and G. Rinaldi. The Traveling Salemsan Problem, in Handbooks in Operations Research and Manageme nt Science, Vol. 7, pp. 225-330, 1995. M. Dorigo and L. M. Gambardella. Ant Colony System: A Cooperative Learning Approach to the Travelling Salesman Problem. IEEE Trans. Evol. Comp. 1, pp. 53-66, 1991. M. Dorigo and L. M. Gambardella. A Study of Some Properties of Ant-Q. In Proceedings of PPSNIV, Fourth International Conference on Parallel Problem Solving From Nature, pp. 656-665, Berlin: Springer-Verlag, 1996. M.dorigo and G.Dicaro. AntAlgorithm for Discrete Optimization. universite Libre de Bruxelles vol,5,No.3,pp.137-172,Dec.1999. Z. C. S. S. Hlaing and M. A. Khine. Solving Traveling Salesman Problem by Using Improved Ant Colony Optimization Algorithm. International Journal of Information and Education Technology, Vol. 1, No. 5, December 2011. AUTHORS Adel Alinezhad Kolaei is a MS student of Computer Science at Shiraz University of Technology. He received his BSc in Software Engineering from Iran University of Science and Technology. His major research interests are high performance algorithms and database management. Marzieh Ahmadzadeh is an Assistant Professor of Computer Science at Shiraz University of Technology. She received her PhD in Computer Science and MSc in Information Technology from the University of Nottingham, UK and her BSc in Software Engineering from Isfahan University, Iran. She teaches a variety of graduate and undergraduate courses and her research interest includes Computer Science Education in general and Computer Supported Learning, specifically Data Mining and Human Computer Interaction. 8
9cs.NE
arXiv:1701.07235v1 [math.GR] 25 Jan 2017 Recognizing the real line A. M. W. Glass and John S. Wilson January 26, 2017 Abstract Let (Ω, 6) be a totally ordered set. We prove that if Aut(Ω, 6) is transitive and satisfies the same first-order sentences as Aut(R, 6) (in the language of groups) then Ω and R are isomorphic ordered sets. This improvement of a theorem of Gurevich and Holland is obtained as a consequence of a study of centralizers associated with certain transitive subgroups of Aut(Ω, 6). 1 Introduction In 1981, Gurevich and Holland [4] proved the following result. Theorem 1.1. Suppose that (Ω, 6) is a totally ordered set such that Aut(Ω, 6) acts transitively on pairs (α, β) with α < β. If Aut(Ω, 6) and Aut(R, 6) satisfy the same first-order sentences, then Ω is isomorphic to R as an ordered set. Other results of a similar kind were obtained in [2]. Theorem 1.1 required first-order sentences in the language of ℓ-groups, which is richer than the language of groups, but a slight extension shows that in fact only sentences in the language of groups are needed (see [1, Theorem 2B*]): Corollary 1.1. Suppose that (Ω, 6) is a totally ordered set such that Aut(Ω, 6) acts transitively on pairs (α, β) with α < β. If Aut(Ω, 6) and Aut(R, 6) satisfy the same first-order sentences in the language of groups, then Ω is isomorphic to R as an ordered set. 2010 AMS Classification: 20B07, 06F15, 03C60, 05C05. Keywords: Transitive group, o-primitive, convex congruence, o-block, covering convex congruence. 1 Here we establish the following improvement to Theorem 1.1. Theorem A. Suppose that (Ω, 6) is a totally ordered set on which Aut(Ω, 6) acts transitively, and that Aut(Ω, 6) and Aut(R, 6) satisfy the same first-order sentences in the language of groups. Then Ω is isomorphic to R as an ordered set. Transitivity is necessary in the above result. Let Λ be any rigid totally ordered set with at least two elements (for example a finite totally ordered set with at least two elements), and let Ω = Λ × R, with the order defined by (λ1 , r1 ) < (λ2 , r2 ) if r1 < r2 or if both r1 = r2 and λ1 < λ2 . It is easy to see that Aut(Λ × R, 6) is isomorphic to Aut(R, 6). Similar arguments allow us to strengthen other known results. Theorem B. Suppose that (Ω, 6) is a totally ordered set on which Aut(Ω, 6) acts transitively. If Aut(Ω, 6) and Aut(Q, 6) satisfy the same first-order sentences in the language of groups then Ω is isomorphic as an ordered set to Q or R \ Q. The corresponding result with the stronger hypothesis that Aut(Ω, 6) acts o-2 transitively on Ω, i.e., transitively on pairs (α, β) with α < β, is a slight extension of a result of Gurevich and Holland [4] (cf. [1, Theorem 2C*]). The breakthrough in this work comes from employing a technique in [6]: we use double centralizers of certain subsets of groups of order-preserving automorphisms of totally ordered sets Ω to give first-order expressibility of certain convex subsets of Ω. The ideas have implications for a large family of subgroups of the groups Aut(Ω, 6) (see [3]). 2 Preliminaries and a reduction We write X ⊂ Y for X ⊆ Y and X 6= Y . Our notation for conjugates and commutators is in accordance with our use of right actions: we write gf for f −1 gf and [f, g] for f −1 g−1 f g. Automorphism groups Aut(Ω, 6) of totally ordered sets (Ω, 6) are closed under taking the pointwise maximum f ∨ g and pointwise minimum f ∧ g of elements f, g defined, respectively, by α(f ∨ g) = max{αf, αg} and α(f ∧ g) = min{αf, αg} for all α ∈ Ω. An ℓ-permutation group (G, Ω) is a subgroup of Aut(Ω, 6) closed under the binary operations ∨ and ∧. Transitive ℓ-permutation groups are of particular interest, and all groups studied in this paper will be assumed to be transitive. Let (G, Ω) be a transitive ℓ-permutation group. A G-congruence on the set Ω is an equivalence relation C on Ω such that (αg) C (βg) whenever α C β and g ∈ G 2 (α, β ∈ Ω). A convex G-congruence C on Ω is a G-congruence with all C-classes convex; these classes are called o-blocks. We suppress the mention of G if it is clear from context. By transitivity, each o-block ∆ is a class of a unique convex congruence; its set of classes is {∆g | g ∈ G}. We denote this convex congruence by κ(∆). Proposition 2.1. ([1, Theorem 3.A]) The set of convex congruences of a transitive ℓ-permutation group is totally ordered by inclusion. If C and D are convex congruences with C ⊂ D and there is no convex congruence strictly between C and D, then we say that D covers C and C is covered by D. Let α, β ∈ Ω be distinct. Then both the union U (α, β) of all convex congruences C for which α, β lie in distinct o-blocks and the intersection V (α, β) of all convex congruences C for which α, β lie in the same o-block are convex congruences. Clearly, U (α, β) is covered by V (α, β). Let K = {V (α, β) | α, β ∈ Ω, α 6= β}. Thus K is totally ordered by inclusion. It is called the spine of (G, Ω). For all α, β ∈ Ω we have β = αg for some g ∈ G by transitivity. Therefore K can also be described as follows: K = {V (α, αg) | α ∈ Ω, g ∈ G, αg 6= α}. Write T for the set of o-blocks of elements of K. If ∆ ∈ T , then κ(∆) ∈ K and so κ restricts to a surjective map from T to K. For each C ∈ K, write π(C) for both the convex congruence covered by C and its set of o-blocks; the latter inherits a total order from Ω. If ∆ is a C-class, let π(∆) be the set of all π(C)-classes contained in ∆. We define the stabilizer st(∆) and rigid stabilizer rst(∆) of an o-block ∆ as follows: st(∆) := {g ∈ G | ∆g = ∆} rst(∆) := {g ∈ G | supp(g) ⊆ ∆}, and where supp(g) := {α ∈ Ω | αg 6= α}. So st(∆) and rst(∆) are convex sublattice subgroups of G and rst(∆) ⊆ st(∆). Each g ∈ st(∆) induces an automorphism g∆ of the ordered set π(∆) given by Γg∆ = Γg for all Γ ∈ π(∆). Let G(∆) := {g∆ | g ∈ st(∆)}. 3 Note that (G(∆), π(∆)) is transitive and o-primitive. Furthermore, if K ∈ K and ∆, ∆′ are both K-classes, then (G(∆), π(∆)) and (G(∆′ ), π(∆′ )) are isomorphic, an isomorphism being induced by conjugation by any f ∈ G with ∆f = ∆′ since (Γf )(f −1 gf ) = (Γg)f for all g ∈ rst(∆), Γ ∈ π(∆). It is customary to write (GK , ΩK ) for any of these ℓ-permutation groups; they are independent of the o-block ∆ of K to within ℓ-permutation isomorphism. For each g ∈ G and each subset Λ of Ω that is a union of convex g-invariant subsets of Ω, write dep(g, Λ) for the element of Aut(Ω, 6) that agrees with g on Λ and with the identity elsewhere. We say that (G, Ω) is fully depressible if dep(g, Λ) ∈ G for all g ∈ G and all such Λ ⊆ Ω. In particular, if (G, Ω) is fully depressible, ∆ ∈ T and g ∈ st(∆), then dep(g, Λ) ∈ rst(∆) ⊆ G. Moreover, the action of {g∆ | g ∈ rst(∆)} on π(∆) is equal to (G(∆), π(∆)) in this case for every ∆ ∈ T . Clearly Aut(Ω, 6) itself is fully depressible. If G is transitive on all n-tuples (α1 , . . . , αn ) ∈ Ωn with α1 < · · · < αn , we say that (G, Ω) is o-n transitive. We shall need the following result (see [1, Lemma 1.10.1]): Lemma 2.2. Every o-2 transitive ℓ-permutation group (G, Ω) is o-n transitive for all integers n > 2. We also need an immediate consequence of McCleary’s Trichotomy [5]: Proposition 2.3. Let (G, Ω) be a transitive fully depressible ℓ-permutation group. Then (G, Ω) is o-primitive if and only if either (I) (Ω, 6) is order-isomorphic to a subgroup of the reals and the action of G on Ω is the right regular representation; or (II) (G, Ω) is o-2 transitive. Transitive o-primitive ℓ-permutation groups of type (II) are non-abelian. For each h ∈ G, let [ Xh := {[h−1 , hg ] | g ∈ G} and Wh = {Xhg | g ∈ G, [Xh , Xhg ] 6= 1}. The sets Xh , Wh are evidently definable in the first-order language of group theory. For any subset S of G, we write C2G (S) as shorthand for CG (CG (S)), the double centralizer of S in G. If S is definable in G in the first-order language of group theory then so is C2G (S). Proposition 2.4. Let (G, Ω) be a transitive fully depressible ℓ-permutation group. Then (G, Ω) is o-primitive if and only if C2G (Wg ) = G for all g ∈ G \ {1}. 4 This result has the following immediate consequence. Corollary 2.5. If (G1 , Ω1 ), (G2 , Ω2 ) are transitive fully depressible l-groups that satisfy the same first-order sentences in the language of group theory, and one of these groups is o-primitive, then so is the other. We can now deduce Theorems A and B. Let Λ = R or Λ = Q. Then Aut(Λ, 6) acts o-2-transitively on Λ and so it is o-primitive and non-abelian. Thus if (G, Ω) is a transitive fully depressible ℓ-permutation group satisfying the same first-order sentences (in the language of groups) as Aut(Λ, 6), then (G, Ω) is non-abelian and G acts o-primitively on Ω by Proposition 2.4. Hence G acts o-2-transitively by Proposition 2.3. Theorems A and B now follow directly from Corollary 1.1 and the result [1, Theorem 2C*] cited in the Introduction. It remains now to prove Proposition 2.4. This will be an easy consequence of results in Sections 4 and 5. 3 A technical lemma Lemma 3.1. Let (G, Ω) be o-2 transitive and g, h ∈ G with supp(h)∩supp(hg ) = ∅ and h 6= 1. Then there are elements f, k ∈ G such that [h−1 , hf ][h−g , hgk ] 6= [h−g , hgk ][h−1 , hf ]. Proof. Since supp(h) ∩ supp(hg ) = ∅, after interchanging h and hg if necessary, we may assume that there are supporting intervals ∆1 , ∆2 := ∆1 g of h and hg , respectively, such that δ1 < δ2 for all δi ∈ ∆i (i = 1, 2). Without loss of generality, δ1 h > δ1 for all δ1 ∈ ∆1 (and so δ2 hg > δ2 for all δ2 ∈ ∆2 ). Let γ, δ, λ, µ ∈ ∆2 with γ < γhg < µh−g < δ < λ < µ < δhg < λhg . The six elements γ, γhg , µh−g , δ, µ, λhg (1) constitute a strictly increasing sequence in ∆1 . Choose ξ−1 , ξ0 ∈ ∆1 with ξ−1 < ξ0 , and elements ξ1 , ξ2 ∈ ∆2 with ξ0 < ξ1 < ξ1 hg < ξ2 < ξ2 hg . Then the six elements ξ−1 , ξ0 , ξ1 , ξ1 hg , ξ2 , ξ2 hg (2) constitute a strictly increasing sequence in Ω. Using o-6-transitivity we can find an element k of G that maps the nth element of sequence (2) to the nth element 5 of sequence (1) for each n. Since supp(h) ∩ supp(hg ) = ∅ and ξ−1 ∈ ∆1 ⊆ supp(h) we have γhgk = γk−1 hg k = ξ−1 hg k = ξ−1 k = γ. This and other similar easy calculations show that γhgk = γ, (γhg )hgk = γhg , (µh−g )hgk = δ, µhgk = λhg . Now choose α ∈ ∆1 ⊆ supp(h) and β ∈ (αh−1 , α), and choose ζ1 , . . . , ζ4 ∈ supp(h) such that the eight elements ζ4 , ζ3 , ζ2 , ζ1 , ζ4 h, ζ3 h, ζ2 h, ζ1 h form a strictly increasing sequence. Since supp(h) < supp(hg ), the eight elements βh−3 , αh−3 , βh−2 , αh−2 , γh−g , γ, δ, λ also form a strictly increasing sequence, and we can find an element f ∈ G that maps the nth term of the former of these two sequences to the nth term of the latter for each n. A routine calculation now shows that αh−2 hf = λ, βh−2 hf = δ, αh−3 hf = γ, and βh−3 hf = γh−g . Let w1 := [h−1 , hf ], and w2 := [h−g , hgk ]. Further simple calculations show that λw1 = γ and λw2 = δ. Moreover, γw2 = γ and δw1 = βh−3 hf = γh−g . Hence λw1 w2 = γ 6= γh−g = δw1 = λw2 w1 . 4 Centralizers: the non-minimal case Throughout this section and the next, we assume that (G, Ω) is a fully depressible transitive ℓ-permutation group, and write T , K for its root system and spine. For each h ∈ G, define Xh , Wh as in Section 2. For each ∆ ∈ T , let Q∆ = {h ∈ rst(∆) | (∃α ∈ Ω)(V (αh, α) = κ(∆)}. As (G, Ω) is transitive and fully depressible, we have Q∆ 6= ∅. Since (rst(∆))g = rst(∆g) commutes with rst(∆) for g ∈ / st(∆), we also have Xh ⊆ rst(∆) and Wh ⊆ rst(∆) We will use the following observation. 6 for all ∆ ∈ T and h ∈ Q∆ . Remark 4.1. Let (Λ, 6) be a totally ordered set and S be a finite set of pairwise disjoint convex subsets of Λ. If f ∈ Aut(Λ, 6) and Sf = S, then Sf = S for all S ∈ S. For the rest of this section we assume that K has no minimal element. Lemma 4.2. Let ∆ ∈ T and h ∈ Q∆ . (a) Let ∆′ ∈ T with ∆′ ⊂ ∆ and ∆′ h 6= ∆′ , and let g ∈ rst(∆′ ) with g 6= 1. (i) Then [h−1 , hg ] 6= 1. In particular, Xh 6= 1. (ii) If f ∈ G and [[h−1 , hg ], f ] = 1, then ∆′ f = ∆′ . In particular, if f ∈ CG (Xh ) then ∆′ f = ∆′ . (b) If β ∈ supp(h) and f ∈ G, then either βf = β or [[h−1 , hg ], f ] 6= 1 for some g ∈ rst(∆). −1 Proof. (a) The elements gh , g, gh have disjoint supports contained in ∆′ h−1 , ∆′ −1 and ∆′ h respectively, and so the restrictions of [h−1 , hg ] = g −h gg −h g to these three sets are conjugates of g−1 and g2 and are non-trivial. Assertion (i) follows. An arbitrary conjugate [h−1 , hg ]f has non-trivial restrictions to the distinct o-blocks ∆′ h−1 f, ∆′ f and ∆′ hf , and so if the hypothesis of (ii) holds then {∆′ h−1 , ∆′ , ∆′ h}f = {∆′ h−1 , ∆′ , ∆′ h}. Thus f must map each of ∆′ h−1 , ∆′ , ∆′ h to itself, by Remark 4.1. (b) Suppose that βf 6= β. By Proposition 2.1, one of the convex congruences V (β, βh), V (β, βf ) contains the other. Let ∆′ ∈ T be a non-singleton o-block that is strictly contained in the o-block containing β for each of these congruences. Then ∆′ ⊂ ∆ and ∆′ f 6= ∆′ . Let g ∈ Q∆′ ; then g ∈ rst(∆′ ) and from (a)(ii) we have [[h−1 , hg ], f ] 6= 1. Lemma 4.3. Let ∆ ∈ T and h ∈ Q∆ . (a) CG (Xh ) contains the pointwise stabilizer of ∆ and is contained in the pointwise stabilizer of supp(h). (b) Wh = [ {Xhg | g ∈ st(∆)}. (c) CG (Wh ) is the pointwise stabilizer of ∆. Proof. (a) The first inequality holds since Xh moves only points in ∆. Let f ∈ CG (Xh ). Since Xh ⊆ rst(∆) we have Xh = Xhf ⊆ rst(∆)∩rst(∆f ), and since {∆g | g ∈ G} partitions Ω and Xh 6= 1 we have ∆f = ∆. Thus f ∈ st(∆). Let β ∈ supp(h). Then βf = β by Lemma 4.2(b) since f ∈ CG (Xh ). 7 (b) Let g ∈ G. If ∆g 6= ∆, then rst(∆) ∩ rst(∆g) = 1 and the elements of Xh and Xhg have disjoint support. Thus [Xh , Xhg ] = 1. Hence [ Wh = {Xhg | g ∈ st(∆), [Xh , Xhg ] 6= 1}. Now let g ∈ st(∆) and k = hg . So k ∈ Q∆ . First suppose that there is some Γ ∈ π(∆) with Γh 6= Γ and Γk 6= Γ. Choose β ∈ Γ and ∆′ ∈ T with β ∈ ∆′ ⊂ Γ. We claim that there is an element y ∈ Q∆′ with βy 6= β. Choose β ′ ∈ ∆′ such that β, β ′ belong to different π(∆′ )-classes. By transitivity there is an element y ′ ∈ G with βy ′ = β ′ . Evidently ∆′ y ′ = ∆′ , and the element y := dep(y ′ , ∆′ ) has the required properties. Choose ∆′′ ∈ T with β ∈ ∆′′ ⊂ ∆′ and ∆′′ 6= ∆′′ y. Arguing as above we can −1 find x ∈ Q∆′′ with β ∈ supp(x). Write a := [k−1 , kx ] = x−k xx−k x. Thus supp(a) ⊂ (∆′′ )k−1 ∪ ∆′′ ∪ ∆′′ k ⊂ (∆′ )k−1 ∪ ∆′ ∪ ∆′ k, and the unions above are disjoint unions since ∆′ ⊂ Γ and Γk 6= Γ. On the classes −1 ∆′′ k−1 , ∆′′ , ∆′′ k the element a agrees with x−k , x2 , x−k respectively, none of which is the identity since x 6= 1. Therefore δ ′ a = δ ′ x2 for all δ′ ∈ ∆′ . −1 Since [h−1 , hy ] = y −h yy −h y we also have and δ′ [h−1 , hy ] = δ′ y 2 supp([h−1 , hy ]) ⊂ ∆′ h−1 ∪ ∆′ ∪ ∆′ h, for all δ′ ∈ ∆′ . Since supp(x) ⊆ ∆′′ which is disjoint from ∆′′ y 2 , for any δ′′ ∈ supp(x) we have δ′′ [h−1 , hy ]a = δ′′ y 2 x2 = δ′′ y 2 6= δ′′ x2 y 2 = δ′′ a[h−1 , hy ]. But [h−1 , hy ] ∈ Xh and a ∈ Xk . Hence [Xh , Xk ] 6= 1 and Xk ⊆ Wh . Now suppose instead that Γk = Γ or Γh = Γ for all Γ ∈ π(∆). Then (G(∆), π(∆)) cannot be abelian and so is of type (II) in Lemma 2.3. Lemma 3.1 gives elements of Xh and Xk whose images in (G∆ , π(∆)) fail to commute, and again we conclude that Xk ⊆ Wh . (c) The pointwise stabilizer of ∆ lies in CG (Wh ) since Wh ⊆ rst(∆). Let δ ∈ ∆ and α ∈ supp(h). Choose g ∈ rst(∆) with αg = δ. So δ ∈ supp(hg ). By (a), CG (Xhg ) fixes each point of supp(hg ) and so fixes δ. Since CG (Wh ) ⊆ CG (Xhg ) by (b), we conclude that CG (Wh ) fixes δ. The assertion follows. Proposition 4.4. Let ∆ ∈ T . Then C2G (Wh ) = rst(∆) for each h ∈ Q∆ . In particular, C2G (Wh ) is independent of the choice of h ∈ Q∆ : C2G (Wh ) = C2G (Wh′ ) 8 for all h, h′ ∈ Q∆ . Proof. By Lemma 4.3(c) the subgroups rst(∆) and CG (Wh ) commute and so rst(∆) ⊆ C2G (Wh ). We must prove that C2G (Wh ) ⊆ rst(∆). Suppose that z ∈ G with ∆z 6= ∆. So ∆z ∩ ∆ = ∅. Since (G, Ω) is fully depressible, rst(∆) contains an element x 6= 1; then xz ∈ rst(∆z) and so [x, z] 6= 1. Thus z 6∈ C2G (Wh ) by Lemma 4.3(c). It follows that C2G (Wh ) ⊆ st(∆). Hence if g ∈ C2G (Wh ), then the element g0 := dep(g, ∆) of rst(∆) is defined. From above, rst(∆) ⊆ C2G (Wh ) and so f := gg0−1 ∈ C2G (Wh ). Suppose that f 6= 1. Let α ∈ supp(f ) and ∆′ ∈ T be the o-block of V (α, αf ) with α ∈ ∆′ . Let ∆′′ ⊂ ∆′ with α ∈ ∆′′ and ∆′′ f 6= ∆′′ , and let y ∈ Q∆′′ . Since supp(y) ⊆ ∆′′ but supp(y f ) ⊆ ∆′′ f we have [y, f ] 6= 1. However y ∈ CG (Wh ) and f ∈ C2G (Wh ), and we have a contradiction. Hence f = 1 and g = g0 ∈ rst(∆). 5 Centralizers: the minimal case Again let (G, Ω) be a fully depressible transitive ℓ-permutation group with spine K. For the case when the spine K of (G, Ω) has a minimal element we need an extra condition. We say that a transitive ℓ-permutation group (G, Ω) is locally abelian if its spine K has a minimal element K0 and the o-primitive ℓ-permutation group (G(∆), π(∆)) is abelian for each o-block ∆ of K0 . For the rest of this section we assume that the spine K of G has a minimal element and that (G, Ω) is not locally abelian. The results in the previous section can all be recovered under the above hypotheses on (G, Ω). This follows from the following observation, in which we write f 6 g for f ∨ g = g and H+ for {g ∈ G | g > 1}: Remark 5.1. Let (H, Λ) be an o-2 transitive ℓ-permutation group, and µ1 , µ2 ∈ Λ with µ1 < µ2 . Let γ1 , γ2 ∈ Λ with µ1 < γ1 < γ2 < µ2 . By o-3 transitivity, there is f ∈ H with γ1 f = γ2 and µi f = µi for i = 1, 2. So µ1 = µ1 f n < γ1 f n < µ2 f n = µ2 for all n ∈ Z. Let Ξ be the smallest convex subset of Λ containing {γ1 f n | n ∈ Z}. Then Ξf = Ξ. Let g := dep(f, Ξ). Then g ∈ Aut(Λ, 6)+ with supp(g) ⊆ (µ1 , µ2 ) and γ1 g = γ2 . The next three results extend the corresponding results (Lemmata 4.2 and 4.3 and Proposition 4.4) of Section 4. Lemma 5.2. Let ∆ ∈ T and h ∈ Q∆ . Let g ∈ rst(∆)+ and suppose that there is α ∈ supp(h) such that supp(g) ⊆ (α, αh) if α < αh or supp(g) ⊆ (αh, α) if αh < α. (a) (i) [h−1 , hg ] 6= 1; in particular Xh 6= 1. 9 i i (ii) If f ∈ G and [[h−1 , hg ], f ] = 1, then supp(g h )f = supp(gh ) for i = 0, ±1. (b) If f ∈ G, then either βf = β for all β ∈ supp(h) or [[h−1 , hg ], f ] 6= 1 for some g ∈ rst(∆)+ . Proof. (a) We assume that α < αh, the proof when αh < α being similar. i −1 Write c := [h−1 , hg ] = g −h gg−h g. For i = 0, ±1 we have supp(g h ) ⊆ (αhi , αhi+1 ). These intervals are pairwise disjoint and supp(c) lies in their union. Since supp(c) may not be convex and the intervals may not be mapped to themselves by f , we cannot apply Remark 4.1. This is where we use that g > 1. The restriction of c to (α, αh) is g 2 > 1 and c is strictly positive only on supp(g). Moreover, if [c, f ] = 1, then (c ∨ 1)f = cf ∨ 1f = c ∨ 1, so f must conjugate g2 = c ∨ 1 ∈ G to itself, and c−1 ∨ 1 to itself. Since f is order-preserving −1 and supp(gh ) < supp(g) < supp(g h ) and supp(g2 ) = supp(g), we must have i i supp(gh )f = supp(gh ) for i = ±1. (b) Suppose that βf 6= β for some β ∈ supp(h) and that [h−1 , hg ] and f commute for all g ∈ rst(∆)+ . Let K0 be the minimal element of K and Λ be the K0 o-block with β ∈ Λ ⊆ ∆. Then (G(Λ), π(Λ)) is o-primitive and o-2 transitive since (G, Ω) is not locally abelian. Now βf and βh are distinct from β and so there is an interval (β1 , β2 ) containing β and disjoint from (β1 f, β2 f ) and (β1 h, β2 h) ∪ (β1 h−1 , β2 h−1 ). By Remark 5.1 with µ1 = β1 and µ2 = β2 , there is g ∈ G+ i with β ∈ supp(g) ⊆ (β1 , β2 ). Thus the sets supp(gh ) for i ∈ {0, ±1} are pairwise −1 disjoint and since [h−1 , hg ] = g−h gg−h g we obtain that β[h−1 , hg ]f = βg 2 f > βf . Since [h−1 , hg ], f commute, it follows that βf [h−1 , hg ] > βf. −1 Thus βf ∈ supp([h−1 , hg ]) ⊆ supp(g) ∪ supp(gh ) ∪ supp(gh ). Since supp(g) ⊆ (β1 , β2 ) and βf ∈ (β1 f, β2 f ) we have βf ∈ / supp(g), whereas if βf ∈ supp(g h ) −1 −1 g −h then βf [h , h ] = βf g < βf , and if βf ∈ supp(g h ), then βf [h−1 , hg ] = −1 βf g−(h ) < βf . A contradiction ensues and the lemma is proved. Lemma 5.3. Let ∆ ∈ T and h ∈ Q∆ . (a) CG (Xh ) contains the pointwise stabilizer of ∆ and is contained in the pointwise stabilizer of supp(h). (b) Wh = [ {Xhg | g ∈ st(∆)}. (c) CG (Wh ) is the pointwise stabilizer of ∆. 10 Proof. The proofs of (a) and (c) are identical to those of Lemma 4.3. The same is true for (b) in the case when there are ∆′′ , ∆′ ∈ T with ∆′′ ⊂ ∆′ ⊂ ∆. It remains to consider the cases when ∆ is minimal in T or covers a minimal element of T . First assume that ∆ is minimal in T . Let g ∈ G. If ∆g 6= ∆, then rst(∆) ∩ rst(∆g) = 1 and the elements of Xh and Xhg have disjoint support. Thus [Xh , Xhg ] = 1. Hence [ Wh = {Xhg | g ∈ st(∆), [Xh , Xhg ] 6= 1}. Now let g ∈ st(∆) and k = hg . So k ∈ Q∆ . First suppose that there is some δ ∈ ∆ with δ ∈ supp(h) ∩ supp(k). Assume that δh > δ and δk > δ, the other three cases being similar. Choose λ1 < δ < min{λ1 h, λ1 k} and λ2 ∈ (δ, min{λ1 h, λ1 k}). So (λ1 , λ2 )h = (λ1 h, λ2 h) ⊆ (λ2 , λ2 h) since λ2 < λ1 h; and (λ1 , λ2 )h−1 = (λ1 h−1 , λ2 h−1 ) ⊆ (λ1 h−1 , λ1 ) since λ2 h−1 < λ1 hh−1 = λ1 . Similarly (λ1 , λ2 )k ⊆ (λ2 , λ2 k) and (λ1 , λ2 )k−1 ⊆ (λ1 k−1 , λ1 ). Since (G, Ω) is fully depressible, by Remark 5.1 applied for µ1 = λ1 and µ2 = λ2 there is y ∈ rst(∆)+ with δ ∈ supp(y) and supp(y) ⊆ (λ1 , λ2 ). Define b := i −1 [h−1 , hy ] = y −h yy −h y. By the previous paragraph, supp(y h ) ∩ (λ1 , λ2 ) = ∅ for i ∈ {−1, 1} and so λb−1 = λy −2 for all λ ∈ (λ1 , λ2 ). By Remark 5.1 (this time applied for µ1 = δ and µ2 = δy), we can find x ∈ G+ −1 and β ∈ supp(y) with β ∈ supp(x) ⊆ (δ, δy). Define a := [k−1 , kx ] = x−k xx−k x. i From above, the sets supp(xk ) ⊆ (δ, δy)ki ⊆ (λ1 , λ2 )ki for i ∈ {0, ±1} are disjoint and so (λ1 , λ2 ) ∩ supp(a) = (λ1 , λ2 ) ∩ supp(x). Moreover λa = λx2 ∈ (λ1 , λ2 ) for all λ ∈ (λ1 , λ2 ) and βa = βx2 6= β. Since β ∈ (δ, δy) we have βy −2 ∈ (δy −2 , δy −1 ) ⊆ (λ1 , λ2 ). But (δy −2 , δy −1 )∩ supp(a) = (δy −2 , δy −1 )∩supp(x) = ∅; therefore a fixes βy −2 = βb−1 and ab fixes β. Thus βab 6= βa and so ab 6= a. However, a ∈ Xk and b ∈ Xh . Hence [Xh , Xk ] 6= 1 and Xk ⊆ Wh . Now suppose that each element of ∆ is fixed by h or k. Since the minimal o-primitive component is of type (II), Lemma 3.1 applies and provides elements of Xh and Xk whose images in the minimal o-primitive component fail to commute. This completes the proof of (b) in the case when ∆ is minimal in T . An easy adaptation gives the proof in the case when ∆ covers a minimal element of T . Proposition 5.4. For every ∆ ∈ T and h ∈ Q∆ , C2G (Wh ) = rst(∆). Thus if β ∈ ∆ and h′ ∈ rst(∆) with V (β, βh′ ) = κ(∆), then C2G (Wh ) = C2G (Wh′ ). In particular, C2G (Wh ) = C2G (Wh′ ) 11 for all h, h′ ∈ Q∆ . Proof. By Lemma 5.3(c) we have rst(∆) ⊆ C2G (Wh ), and the argument at the corresponding point in the proof of Lemma 4.4 shows that C2G (Wh ) ⊆ st(∆). 2 (W ). Thus f := gg −1 ∈ Let g ∈ C2G (Wh ) and g0 := dep(g, ∆) ∈ rst(∆) ⊆ CG h 0 2 CG (Wh ) and supp(f ) ∩ ∆ = ∅. If f 6= 1, let α ∈ supp(f ) and ∆′ be the minimal o-block in T with α ∈ ∆′ . We assume that αf > α, the other case being similar. Since (G(∆′ ), π(∆′ )) is o-primitive (and so o-2 transitive) and since (G, Ω) is fully depressible, Remark 5.1 (with β1 = α, β2 = αf ) yields a non-trivial element y ∈ rst(∆′ ) with supp(y) ⊆ (α, αf ) ⊆ supp(f ). Since supp(f ) ∩ ∆ = ∅, we have δy = δ for all δ ∈ ∆ and thus y ∈ CG (Wh ) by Lemma 5.3(c). But y f 6= y since supp(y f ) ⊆ (αf, αf 2 ). This contradicts that y ∈ CG (Wh ) and f ∈ C2G (Wh ). Hence f = 1 and every element of C2G (Wh ) lies in rst(∆). 6 Proof of Proposition 2.4 Proof. Let (G, Ω) be a transitive fully depressible ℓ-permutation group. If (G, Ω) is o-primitive then T = {Ω}; if (G, Ω) is also abelian, then Xg = {1} for all g ∈ G \ {1} and so C2G (Wg ) = CG (G) = G, whereas if (G, Ω) is non-abelian and g ∈ G \ {1}, then g ∈ QΩ and C2G (Wg ) = G by Proposition 5.4. Now suppose that (G, Ω) is not o-primitive and choose ∆ ∈ T with ∆ 6= Ω. By full depressibility there is an element g ∈ Q∆ , and by transitivity ∆f ∩ ∆ = ∅ for some f ∈ G. Since g f ∈ Q∆f we have [g, f ] 6= 1, and G is not abelian. If (G, Ω) is not locally abelian, then C2G (Wg ) = rst(∆) is disjoint from rst(∆f ) = C2G (Wf −1 gf ) by Propositions 4.4 and 5.4; so C2G (Wg ) 6= G. If instead (G, Ω) is locally abelian, let ∆ ∈ T be minimal and g ∈ Q∆ . Then supp(g) = ∆ and for any f ∈ G either ∆f ∩ ∆ = ∅ or supp(gf ) = ∆. In each case, [g−1 , gf ] = 1. Thus Wg = ∅ and C2G (Wg ) = CG (G) 6= G, and the proposition is established. The proof of Proposition 2.4 completes the proof of Theorems A and B. Acknowledgment. This research was begun when the second author was the Leibniz Professor at the University of Leipzig. The authors are most grateful to the Research Academy, Leipzig and the Leibniz Program of the University of Leipzig for funding a visit by the first author that made this research possible. References [1] A. M. W. Glass, Ordered Permutation Groups, London Math. Soc. Lecture Notes Series 55, Cambridge University Press, Cambridge, 1981. 12 [2] A. M. W. Glass, Y. Gurevich, W. C. Holland, M. Jambu-Giraudet, Elementary theory of automorphisms of doubly homogeneous chains, in Logic Year 1979-80, University of Connecticut, (ed. M. Lerman, J. H. Schmerl, R. I. Soare), Springer Lecture Notes 859, Heidelberg, 1981, pp. 67–82. [3] A. M. W. Glass, J. S. Wilson, The first-order theory of ℓ-permutation groups, arxiv 1606.00312 (2016). [4] Y. Gurevich, W. C. Holland, Recognizing the real line, Trans. American Math. Soc. 265 (1981) 527–534. [5] S. H. McCleary, o-primitive ordered permutation groups I, Pacific J. Math. 40 (1972), 349–372; o-primitive ordered permutation groups II, ibid 49 (1973), 431–443. [6] J. S. Wilson, The first-order theory of branch groups, J. Austral. Math. Soc., to appear. A. M. W. Glass, QUEENS’ COLLEGE, CAMBRIDGE CB3 9ET, U.K. E-mail: [email protected] John S. Wilson, MATHEMATICAL INSTITUTE, ANDREW WILES BUILDING, WOODSTOCK ROAD, OXFORD OX2 6GG, U.K. E-mail: [email protected] 13
4math.GR
Noname manuscript No. (will be inserted by the editor) Sustained sensorimotor control as intermittent decisions about prediction errors Computational framework and application to ground vehicle steering arXiv:1703.03030v1 [q-bio.NC] 8 Mar 2017 Gustav Markkula · Erwin Boer · Richard Romano · Natasha Merat the date of receipt and acceptance should be inserted later Abstract A conceptual and computational framework is proposed for modelling of human sensorimotor control, and is exemplified for the sensorimotor task of steering a car. The framework emphasises control intermittency, and extends on existing models by suggesting that the nervous system implements intermittent control using a combination of (1) motor primitives, (2) prediction of sensory outcomes of motor actions, and (3) evidence accumulation of prediction errors. It is shown that approximate but useful sensory predictions in the intermittent control context can be constructed without detailed forward models, as a superposition of simple prediction primitives, resembling neurobiologically observed corollary discharges. The proposed mathematical framework allows straightforward extension to intermittent behaviour from existing one-dimensional continuous models in the linear control and ecological psychology traditions. Empirical observations from a driving simulator provide support for some of the framework assumptions: It is shown that human steering control, in routine lane-keeping and in a demanding nearlimit task, is better described as a sequence of discrete stepwise steering adjustments, than as continuous control. Furthermore, the amplitudes of individual steering adjustments are well predicted by a compound visual cue signalling steering error, and even better so if also adjusting for predictions of how the same cue is affected by previous control. Finally, evidence accumulation is shown to explain observed covariability between inter-adjustment durations and adjustment amplitudes, seemingly better so than the type of threshold mechanisms that are typically assumed in existing models of intermittent control. Keywords Sensorimotor control · Motor primitive · Evidence accumulation · Sensory prediction · Corollary discharge · Steering List of recurring symbols A(t) Evidence accumulator activity level A+ ; A− Positive and negative decision thresholds for accumulator C(t) Control generated by the human F (s) Laplace domain transfer function from controlled system state to the perceptual quantity P G(t) Kinematic motor primitive 0 gi , K (ti ) Expected (noise-free) amplitude of ith control adjustment This work was supported by Jaguar Land Rover and the UKEPSRC grant EP/K014145/1 as part of the jointly funded Programme for Simulation Innovation (PSi), as well as UKEPSRC grant EP/J002933/1 (FORWARN). g̃i , K 0 ˜i Actual amplitude of ith control adjustment H(t) Prediction primitive G. Markkula Institute for Transport Studies, University of Leeds Tel.: +44 (0)113 34 39832 E-mail: [email protected] k Evidence accumulation input gain K Gain in a generalised continuous control E. Boer, R. Romano, and N. Merat Institute for Transport Studies, University of Leeds K 0 , K∆T Gain in a generalised intermittent control 2 Gustav Markkula et al. mi Motor noise affecting the ith control adjustment 1 Introduction ti Onset time of the ith control adjustment Tn ; Tf Preview time to near and far sight points (steering model) knI ; knP ; kf Control gains for near point angle, near point rate, and far point rate (steering model) P (t) Perceptual quantity describing the need for control (a negative control error) Pr (t) , P (t − τp ) Received P (t), after perceptual delays Pp (t) Predicted value of Pr (t) Y (s) Laplace-domain transfer function of the controlled system δ(t) Steering wheel angle applied by human (steering model) ∆T Control adjustment duration ∆ti , ti − ti−1 Time between two consecutive control adjustments (t) , Pr (t) − Pp (t) Control need prediction error (negative control error prediction error) ˜i , (1 + mi )(ti ) Prediction error at onset of ith control adjustment, after scaling with signal-dependent motor noise θn (t); θf (t) Angles to near and far sight points in the vehicle’s reference frame (steering model) ν(t) Evidence accumulation noise τp Perception delay time τm Motor delay time τc Control decision delay time in a generalised continuous model τd , τp + τc + τm Total control delay in a generalised continuous model σa Accumulator noise standard deviation σm Motor noise standard deviation σR Road/vehicle noise standard deviation (steering simulations) Many human sensorimotor activities that are sustained over time can be understood, on a high level, as the human attempting to control the body or the environment towards certain fixed or time-varying target states. Examples of such behaviours include postural control, tracking of external objects with eyes, hands or tools, and locomotion towards a target or along a path, either by foot or using some form of vehicle. In these types of behaviours, human behaviour has been likened to that of a servomechanism or controller (Wiener 1948), and since the 1940s many mathematical models of human sensorimotor control behaviour have been proposed based on the continuous, linear feedback mechanisms of classical engineering control theory (e.g., Tustin 1947; McRuer et al 1965; Nashner 1972; Robinson et al 1986; Krauzlis and Lisberger 1994; Peterka 2000). These basic ideas and models have been developed further in various directions. One line of investigation, building on notions from ecological psychology (Gibson 1986) or perceptual control theory (Powers 1978), has investigated the nature of the exact information extracted by humans from their sensory input for purposes of control (e.g., Lee 1976; McBeath et al 1995; Salvucci and Gray 2004; Warren 2006; Zago et al 2009; Marken 2014). An important goal in this field has been the identification of perceptual invariants, which provide direct sensory access to task-relevant information (e.g., the ratio between retinal size and expansion of an object is a good approximation of time to collision/interception; Lee 1976) and therefore lend themselves to simple but effective control heuristics, typically formulated as one-dimensional linear control laws. Another important development has been the uptake of more modern control theoretic constructs, most notably optimal control theory (Kleinman et al 1970; McRuer 1980). Optimal control models of sensorimotor behaviour suggest that humans act so as to minimise some cost function, typically weighing together control error and control effort, and theoretical predictions from these models have been confirmed experimentally (Todorov and Jordan 2002; Liu and Todorov 2007). Typical engineering-inspired realisations of optimal control models include inverse and forward models of the controlled system (Shadmehr and Krakauer 2008; Franklin and Wolpert 2011), but it remains contentious whether the nervous system has any such internal models, or whether it achieves its apparent optimality by means of other mechanisms (Friston 2011; Pickering and Clark 2014). Another direction of research, which this paper aims to extend upon in particular, has emphasised the inter- Sustained sensorimotor control as intermittent decisions about prediction errors Reproduced figure not included in preprint; see Fig. 3 in (Tustin 1947). Fig. 1: An early observation of intermittent-looking control by Tustin (1947). The plot is of the operator handle position in a gun turret aiming task. Note how a large fraction of the control signal plateaus with zero rate of change. mittency of human control. Already early researchers noted that humans are not always continuously active in their sensorimotor control, but often instead seem to make use of intermittent, ballistic control adjustments (Tustin 1947; Craik 1948); Fig. 1 provides an example. This mode of sensorimotor behaviour is well known from saccadic eye movements (e.g., Girard and Berthoz 2005), but has also been studied and evidenced in visuo-manual tracking (Meyer et al 1988; Miall et al 1993; Hanneton et al 1997; Pasalar et al 2005; van de Kamp et al 2013), inverted pendulum balancing (Loram and Lakie 2002; Gawthrop et al 2013) and postural control (Collins and De Luca 1993; Loram et al 2005; Asai et al 2009). A recurring suggestion in this work has been that control intermittency arises due to a minimum refractory time period that has to pass between consecutive bursts of control activity, and/or minimum control error thresholds that have to be surpassed before control is applied. Based on such assumptions, task-specific computational models of intermittent control have been proposed (e.g., Meyer et al 1988; Collins and De Luca 1993; Miall et al 1993; Burdet and Milner 1998; Gordon and Magnuski 2006; Asai et al 2009; Martı́nez-Garcı́a et al 2016). However, the only complete, task-general, computational framework of intermittent control that we are aware of is that of Gawthrop and colleagues (Gawthrop et al 2011, 2013, 2015). Their framework is an extension of the continuous optimal control theoretic models by Kleinman et al (1970), features forward and inverse models, and includes provisions allowing for both a minimum refractory period and error deadzones. This paper introduces an alternative computational framework for intermittent control, which was originally developed in the context of longitudinal and lateral control of ground vehicles. In that specific task context, the basic concepts have been described before (Markkula 2014, 2015). Here, the framework will be presented in a more general context, in the hope that it might prove useful also in other sensorimotor task domains. The framework ideas will also be developed for the first time in full mathematical detail, here, for the special case of one-dimensional control using stepwise control adjustments (further generalisation will be one 3 topic in the Discussion). The main example will be an application of the computational framework to specify a model of car steering, and human steering data will be used for testing some of the framework’s assumptions. The two main theoretical aims of this paper are: (1) To propose a framework for sustained, intermittent control that starts out from a classical control theory standpoint, without incorporating the extra assumptions typical of optimal control theory. This allows direct generalisation to intermittent control from existing psychological models based on perceptual invariants and control heuristics, and it also has some interest in light of the abovementioned debate about the neurobiological plausibility of optimal control theoretic models. (2) To propose a framework that actively connects with three concepts that are well established in contemporary neuroscience: motor primitives, neuronal evidence accumulation, and prediction of sensory consequences of motor actions; these will all be introduced in further detail in the next section. The use of any one of these three concepts in mathematical modelling of sensorimotor control is not novel in itself. However, to the best of our knowledge, the three have not previously been incorporated into one common framework. Such integration of modelling concepts from different research fields (perceptual psychology, control theory, perceptual decision-making, motor control, etc.) necessarily involves some degree of simplification. Specialists in the fields we borrow from here will hopefully forgive component-level imperfections, in the interest of working towards a meaningful bigger picture. Sec. 2 below will explain the three main concepts mentioned above, and briefly review to what extent they have been adopted in existing models of sensorimotor control, before Sec. 3 introduces the proposed framework on a conceptual, qualitative level. Then, Sec. 4 will present a computational realisation of the framework, for the special case of one-dimensional stepwise control, and briefly describe how it can be applied to a minimal example task, as well as to ground vehicle steering. Next, in Sec. 5, a simple signal reconstruction method will be described. This method, the proposed computational formulations, and two datasets of human steering of cars, will then be put to use in Sec. 6, providing some first empirical support for the framework. Sec. 7 will provide a discussion of the empirical and theoretical results, the relationship between the proposed framework and existing theories and models, as well as outline some possible future developments, before the conclusion in Sec. 8. 4 Gustav Markkula et al. 2 Background 2.1 Motor primitives There is much emerging evidence for the idea that animal and human body movement is constructed from a fixed or only slowly changing repertoire of stereotyped pulses or synergies of muscle activation, which can be scaled in amplitude to the needs of the situation, and combined with each other, for example by linear superposition, to create complex body movement (Flash and Henis 1991; Flash and Hochner 2005; Bizzi et al 2008; Hart and Giszter 2010; Giszter 2015). Taskspecific models have been proposed, where for example manual reaching (Meyer et al 1988; Burdet and Milner 1998) and car steering (Benderius 2014; Martı́nezGarcı́a et al 2016) has been modelled as a sequence of superpositioned, ballistic motor primitives, for example bell-shaped pulses of movement speed. Furthermore, some authors have suggested task-general accounts describing motor control as constructed from such sequences of primitives (Hogan and Sternad 2012; Karniel 2013). Here, we integrate this idea into a task-general, fully specified computational account. It should be noted that the term “motor primitive” has been used for a range of related but different concepts in the motor control literature; what we intend here could be further specified as kinematic motor primitives, described by Giszter (2015) as “patterns of motion without regard to force or mass, e.g., strokes [...] or cycles [...]” (p. 156). Response time distributions Evidence accumulation More salient stimulus Less salient stimulus Fig. 2: A schematic illustration of how neuronal evidence accumulation mechanisms explain action onset timing distributions in perceptual decision-making tasks. After the onset of a stimulus (t = 0), noisy neuronal activity builds up over time. The reaching of a threshold activity level predicts overt action onset in individual trials, and stimulus saliency affects the rate of activity build-up. perceptual decision-making (Bogacz et al 2006; Bitzer et al 2014). A novel contribution of the present framework is the suggestion, conceptually and computationally, that (1) sustained sensorimotor control can be regarded as a sequence of such perceptual-motor decisions, and (2) the magnitude of control errors (among other things) might affect the rate of evidence accumulation. These suggestions are in contrast with existing models of intermittent control, which, as mentioned above, assume that 2.2 Evidence accumulation control adjustment timing is determined by thresholds on control errors and/or inter-adjustment time duraFrom laboratory paradigms on perceptual decision-making, tions. where humans or animals have to interpret sensory input to decide on a single correct motor action, there is strong behavioural and neuroimaging evidence suggest2.3 Prediction of sensory outcomes of motor actions ing that the initiation of the motor action occurs when neuronal firing activity in task-specific neurons has acIt has been shown in both primates and other animals cumulated to reach a threshold, with noise in the acthat whenever a movement command is issued in the cumulation process explaining action timing variability nervous system, it tends to be accompanied by a so(Ratcliff 1978; Usher and McClelland 2001; Cook and called corollary discharge (possibly mediated by an efMaunsell 2002; Gold and Shadlen 2007; Purcell et al ference copy of the movement command), biasing sen2010); see Fig. 2 for an illustration. Importantly, the sory brain areas whose inputs will be affected by the more unambiguous and salient the stimulus being remotor action in question. There is much evidence to sponded to, the quicker the rate of increase of neuronal support the idea that these biases are predictions of activity (e.g., Ditterich 2006; Purcell et al 2010, 2012). sensory consequences of the motor action, which might It has been shown that by properly adapting the paallow the nervous system to infer whether incoming senrameters of such an evidence accumulation to the task sory stimulation is due to the organism’s own actions at hand, including sensory noise levels, the brain could or to external events (Sperry 1950; von Holst and Mituse this type of mechanism to achieve Bayes-optimal telstaedt 1950; Poulet and Hedwig 2007; Crapse and Sustained sensorimotor control as intermittent decisions about prediction errors Sommer 2008; Azim and Alstermark 2015). For example, the image of the outside world translating over the retina could mean either that the outside world is rotating, or that that the eyes are. In sensorimotor control, a specific use of such a discriminating function could be to deal with time delays in the control loop, in a manner similar to the Smith Predictor in engineering control theory (Smith 1957; Miall et al 1993): After initiating a control action to address a control error, the correct prediction for a time-delayed system is that the error will not disappear immediately, and as long as the control error responds as predicted over time, there is no need to infer that the situation in the external world has changed to warrant further control action than what has already been applied. Such a mechanism would seem to be particularly beneficial for intermittent control, but so far seems to have received less modelling attention in this type of context (Burdet and Milner 1998) than in continuous control (e.g., Kettner et al 1997; Shadmehr and Krakauer 2008; Friston et al 2010; Grossberg et al 2012). Here, besides integrating the familiar Smith Predictor mechanism in the computational framework, it will also be shown how a prediction signal that is useful in the intermittent control context can be generated similarly to the intermittent control itself, as a superposition of simple primitives. Neuronal recordings from animals show time histories of corollary discharge biases that follow a general pattern of rapid initial increase followed by slower decay (Poulet and Hedwig 2007; Chagnaud and Bass 2013; Requarth and Sawtell 2014); interestingly the near-optimal “prediction primitives” proposed here for intermittent sensorimotor control take a similar form. 3 A conceptual framework for intermittent control On a conceptual level, what is being proposed here is that sustained sensorimotor control can be understood and modelled as a combination of the three mechanisms described above, as follows: Perceptual cues (e.g., invariants) that indicate a need for control–i.e., which indicate control error–are considered in a decision-making process that can be modelled as noisy accumulation towards a threshold. At this threshold, a new control action is initiated, in the form of a ballistic motor primitive that is superpositioned, linearly or otherwise, onto any other ongoing motor primitives. The exact motor primitive that is initiated is the one that the nervous system has reason to believe will be most appropriate, based on the available perceptual data and previous 5 experiences. An important part of selecting an appropriate motor primitive might be a heuristic scaling of the primitive’s amplitude with the magnitude of the perceived control error. At motor primitive initiation, a prediction is also made, for example in the form of a corollary discharge, of how the control error will be reduced over time thanks to the new control action. This new prediction is superpositioned onto any previously triggered predictions. The resulting overall prediction signal inhibits (is subtracted from) the control error input, such that what the intermittent control is reacting to (what is being accumulated; what the control actions are scaled by) is actually “control error prediction error” rather than control error per se. The next section develops this conceptual account into a computational one, for the special case of onedimensional control using stepwise adjustments of a stereotyped shape, and also shows how it relates to more conventional, continuous linear control models. 4 Computational framework for stepwise one-dimensional control 4.1 Task-general formulation A very general formulation of continuous one-dimensional sensorimotor control is sketched in Fig. 3(a). The human is assumed to process sensory inputs S(t) and control targets T(t) over time t, to yield a one-dimensional quantity P (t), that when delayed and multiplied by a gain K, yields the rate of change Ċ(t) of the control to be applied: Ċ(t) = K · P (t − τd ), (1) where τd , τp +τc +τm is a sum of delays at perceptual, control decision, and motor stages, and where a positive Ċ changes the control in a direction that tends to change P in a negative direction, and vice versa. The control thus strives to reduce P to zero, such that P can be construed as a perceptual invariant quantifying a negative control error, or, differently put, quantifying the need for a change in control. Typically, this quantification will be non-exact and heuristic. Note that the control gain K can just as well be absorbed into the P function by fixing K = 1 above, which gives P an even more specific interpretation as the needed rate of control change in the given situation, in units of Ċ. Among these various interpretations of P we will mainly refer to it as a “perceptual control error”, for ease of reading, and to emphasise the connection to classical control theory. Note also that control laws that are mathematically equivalent to Eq. (1) can be obtained by differentiation 6 Gustav Markkula et al. or integration with respect to time, to instead model control in terms of for example C or C̈. As suggested in Fig. 3(b), the computational framework being proposed here can be understood as replacing the “control decision and motor output” component of this type of continuous model with the mechanisms that were outlined in Sec. 2, to generate control that is intermittent, but which in many circumstances will be rather similar in appearance to the continuous control (cf. Gawthrop et al 2011). Below, the different parts of the framework will be defined in detail. Note that in this expression, the rate of control change that will be applied, after the total neuromuscular delay τd , depends also on the control value, and more precisely on what the control value will be just before the new control rate comes into effect. Another example of this type of rewriting of continuous controllers to the form of Eq. (1) is the PIDcontroller type model of upright postural control (quiet standing) proposed by Peterka (Peterka 2000; Maurer and Peterka 2005):   P (t) = − KI θ(t) + KP θ̇(t) + KD θ̈(t) , (6) 4.1.1 Perceptual control error quantity with Ċ now the rate of change of a balancing torque around the ankle joint, and where θ is the body sway angle. Yet another example is the ecological psychologybased vehicle steering model by Salvucci and Gray (2004): What is being proposed here is independent of what specific quantity P might appropriately quantify the human’s perceived need for control in the task at hand. In contrast, in many continuous models of human control, the main modelling challenge has in practice been to define a P such that Eq. (1) reproduces observed human behaviour as closely as possible. Below, some examples of continuous models from the literature will be provided, all of which can be written on the form of Eq. (1), thus making them all candidates for generalisation from continuous to intermittent control as proposed here. For example, for a task of manually tracking a onedimensionally moving target with a mouse cursor, Powers (2008) showed that the rate of mouse cursor movement could be well described as proportional to the distance D(t) = C(t) − CT (t) between actual and target cursor position: Ċ(t) = −K · D(t − τd ), (2) i.e. in this case we get simply P (t) = −D(t). A more general example can be had from McRuer and colleagues (McRuer et al 1965; McRuer and Jex 1967), who, based on their work on the so-called crossover model, suggested the following generalised Laplace domain expression for a human controller responding to a control error e: C(s) = −K TL s + 1 −∆T s e e(s). TI s + 1 (3) where TL and TI are lead and lag time constants. Rewriting to time domain: TI Ċ(t) + C(t) = −K [TL ė(t − τd ) + e(t − τd )] , (4) we see that in this case we can write: P (t) = −K [TL ė(t) + e(t)] − C(t + τd ) . KTI (5) P (t) = knI θn (t) + knP θ̇n (t) + kf θ̇f (t), (7) with Ċ being rate of steering wheel angle change, and where θn and θf are visual angles to two reference points on the road, one “near” and one “far”. Note that in both of these latter two models, there are control gain parameters (the K• and k• ) for all of the terms in P (t), so one can fix K = 1 in Eq. (1), as mentioned above. 4.1.2 Evidence accumulation When to perform a control adjustment is modelled here as a process of two-sided evidence accumulation (or drift diffusion; Ratcliff 1978; Ratcliff and McKoon 2008). In this type of model, the accumulation of strictly positive neural firing rates, as schematically illustrated in Fig. 2, is replaced by accumulation of a quantity that can be either positive or negative, with one threshold on either side of zero, A+ and A− , representing two different alternative decisions (this is mathematically equivalent to for example having two mutually inhibitory onesided accumulators; Bogacz et al 2006). In the present context of one-dimensional control, these two thresholds represent decisions to make a control adjustment in either of the two possible directions of control. Such an accumulator can be defined in many different ways. One rather general possible formulation, based on (Bogacz et al 2006) and (Purcell et al 2010), would be: dA(t) = γ [η ((t))] − λA(t) + ν(t), dt (8) where A(t) is the activation of the accumulator, −λA(t) is a leakage term, and ν(t) is noise, for example Gaussian white noise with zero mean and variance σa2 ∆t Sustained sensorimotor control as intermittent decisions about prediction errors 7 a Perceptual processing Control targets 𝑻 𝐹 Sensory input 𝑺 Control decision and motor output 𝑃 𝑒 −𝜏p𝑠 𝑒 −𝜏c 𝑠 𝐾 Perceptual quantity Perceptual describing delay control need Control gain Control delay Observed control 𝐶 𝑒 −𝜏m𝑠 Rate of control change Motor delay 1 𝑠 𝐶 Control 𝑌 Controlled system b 𝑃p Prediction of sensory consequences of control actions Evidence accumulation decision on need for control adjustment 𝑃 𝑒 −𝜏p𝑠 𝑃r – + Prediction error 𝜖 reset 𝑘 + Superposition of prediction primitives ∫ 𝑑𝑡 trig + 𝐻 𝜈 𝜖𝐻 ∑ Accumulator noise Superposition of motor primitives 𝜖 Motor noise trig 𝐾′ 𝑔 𝐺 𝑔𝐺 ∑ 𝐶 1+𝑚 Fig. 3: An illustration of how a continuous, linear control law (panel a) can be generalised to intermittent control using the computational framework proposed here (panel b). across a simulation time step of duration ∆t. Furthermore,  is the error in predicted control error: (t) , Pr (t) − Pp (t), (9) dA(t) = k(t) + ν(t), dt (11) where Pp (t) is the brain’s prediction, to be defined in detail in Sec. 4.1.4, of the perception-delayed control error quantity Pr (t) , P (t − τp ). Finally, η() in Eq. (8) is an activation function, for example sigmoidal, and γ is a gating function, zero for small input values, for example defined as: which is also what is illustrated in Fig. 3. As for the thresholds of the accumulator, it will in most control tasks probably make sense to select these to be of equal magnitude (|A+ | = |A− |), and if so then these can both be set to unity magnitude without loss of generality (A+ = 1; A− = −1), since the accumulator activation is specified in arbitrary units. γ(η) = sgn(η) · max(0, |η| − η0 ) 4.1.3 Control adjustments (10) In the example implementations of the framework proposed further below, the accumulators are simplified special cases of Eq. (8) with η0 = λ = 0, i.e. without gating or leakage, and with η() = k, where k is a gain parameter, thus reducing the accumulation equation to Upon reaching one of the accumulator thresholds, the accumulator is assumed to be reset to zero, and a new control adjustment primitive is generated (the “reset” and “trig” connections in Fig. 3(b)). In the framework formulation being proposed here, all control adjustments 8 Gustav Markkula et al. have the same general shape G, which could be any function which starts out at zero and, after an initial motor delay τm , rises to unity over the adjustment duration of ∆T , i.e. any function which fulfils: ( 0 for t ≤ τm G(t) = (12) 1 for t ≥ τm + ∆T with mi drawn from a normal distribution of zero mean 2 and variance σm . Each new control adjustment is linearly superpositioned onto any adjustments that might be ongoing since previously (see e.g. Flash and Henis 1991; Hogan and Sternad 2012; Karniel 2013; Giszter 2015), yielding an output rate of control: Consequently, the rate of change of control during a control adjustment is given by a function Ġ that fulfils: Ċ(t) = n X g̃i Ġ(t − ti ), (19) i=1 and therefore: ( Ġ(t) = 0 for t ≤ τm and t ≥ τm + ∆T R τm +∆T Ġ(t)dt = 1 τm (13) C(t) = C0 + n X g̃i G(t − ti ), (20) i=1 For example, as hinted at in Fig. 3(b), Ġ(t) could be a bell-shaped pulse beginning after a motor delay (τm ). The expected value of the amplitude for the ith adjustment, beginning at the time ti at which the accumulator threshold was exceeded for the ith time, is obtained as: gi , K∆T (ti ) , K 0 (ti ) = K 0 (Pr (ti ) − Pp (ti )) . (14) where n is the total number of adjustments generated so far, and C0 is an initial value of the control signal. 4.1.4 Prediction of control error The prediction Pp (t) of the perceptual control error quantity P (t) is generated by a similar superposition: Pp (t) = The relationship introduced above, n X ˜i H(t − ti ) (21) i=1 K , K 0 /∆T, (15) between the gains of the continuous and intermittent controls, is not a crucial part of the model as such, but ensures that the two controls will typically be close approximations of each other. To see this, consider that for Pp ≈ 0,  ≈ Pr ≈ P , such that the intermittent control will respond to a control error P by adjusting the control by approximately K 0 P in a time duration ∆T , i.e., with an average rate of change of control of K 0 P/∆T = KP, (16) which is also the control rate being applied by the continuous model around the same point in time. In relation to the earlier discussion about the meaning of P when absorbing all control gains into it, note that fixing K 0 = 1 in Eq. (14) makes P a quantification of needed control adjustment amplitude, in units of C. Adding to Eq. (14) also motor noise, for example of a signal-dependent nature, whereby larger control movements will be more likely to have large inaccuracies (Franklin and Wolpert 2011), one can write the actual control adjustment amplitude: g̃i , K 0 ˜i , where Tp is the typical time from the triggering of a control adjustment until the controller receives evidence that the control error in question might have become completely corrected. The t > 0 part of the H function should describe how the perceptual control error quantity is expected to respond over time to the control adjustment. Mathematically, this part of H should thus be something like the following: H(s) = 1 − G(s)Y (s)F (s)e−τp s , (18) (23) It is however not necessary to assume that the brain calculates something like Eq. (23) in detail. In practice, 1 (17) where: ˜i , (1 + mi )(ti ), where H(t) is a function describing how, in the human’s experience, control errors typically become corrected over time by a control adjustment, in the task at hand1 . By analogy with Eq. (20), H could be termed a prediction primitive, and it is proposed here that this function should satisfy:   H(t) = 0 for t ≤ 0 (22) H(t) → 1 for t → 0+   H(t) = 0 for t ≥ Tp , One might also consider using the non-noisy i in Eq. (21). We have chosen to use ˜i mainly because we have no other direct representation in the framework of sensory noise affecting control amplitudes and predictions. In this sense Eq. (18) and mi model both sensory and motor noise; improved frameworks should tease these things apart. Sustained sensorimotor control as intermittent decisions about prediction errors it might suffice to have a rather approximate H, for example describing a sigmoidal fall to zero, such as hinted at in Fig. 3(b). There are two further specific assumptions motivating the exact formulations of Eqs. (21) and (22). First, immediately after the nth control adjustment has been initiated at time tn , in absence of motor noise it is assumed that the predicted control error should be equal to the actual current control error, i.e.: lim Pp (tn + ∆t) = P (tn ), ∆t→0+ (24) i.e. after a new adjustment, the prediction should “acknowledge”, and start from, the currently observed control error. Second, over time, predicted control error should fall to zero. That the latter holds true with the proposed formulations is easy to see; it is a trivial consequence of requiring H(t > Tp ) = 0. To see that the former assumption is realised, one can write: lim Pp (tn + ∆t) = {Eq. (21)} ∆t→0+ = lim + ∆t→0 = lim ∆t→0+ n X ˜i H(tn + ∆t − ti ) (25) ˜i H(tn + ∆t − ti ) + ˜n H(∆t) (26) i=1 n−1 X i=1 = {Eqs. (21) and (22)} = Pp (tn ) + ˜n (27) = {Eqs. (9) and (18)} = Pp (tn ) + (1 + mi ) [P (tn ) − Pp (tn )] (28) = P (tn ), for mi = 0 (29) It should be noted that, if the prediction H is exact, the linear superpositions in Eqs. (19) through (21) should provide (near-)exact overall predictions for controlled systems that are (near-)linear (i.e. for which a superposition of several individual control adjustments yields a system response which is exactly or approximately a superposition of how the system would have responded to each control adjustment separately). In the next two subsections, the computational framework introduced above will be further explained and illustrated by means of two task-specific implementations. 4.2 A minimal example Consider the simple continuous control model by Powers (2008) in Eq. (2), of a human tracking a target on a screen with a mouse cursor. The panels of Fig. 4 show, in light blue, the response of this model, with K 0 = 1, ∆T = 0.4 s (making K = K 0 /∆T = 2.5), and τd = 0.2 9 s, to a step input (panel a) and a more complex “sumof-sines” input (panel b). Also shown in Fig. 4, in black, is the behaviour of the same model when generalised to intermittent control, using the computational framework described above. Here, perceptual and motor delays were set to τp = 0.05 s and τm = 0.1 s, based on (Lamarre et al 1981; Cook and Maunsell 2002; Morrow and Miller 2003; Purcell et al 2010)2 , the accumulator gain was k = 20, the accumulator thresholds were at positive and negative unity, and all the other parameters of the accumulator were set to zero (i.e. no gating, leakage, or noise). As shown in Fig. 5, Ġ was, after the initial τm delay, ±2 standard deviations of a Gaussian, making G reminiscent of (although not identical to) a minimum-jerk movement (Hogan 1984). As for H, since in this task the control signal C is also the quantity being controlled (with appropriate units for mouse and cursor position, and disregarding any delays between them), Y (s)F (s) = 1, and Eq. (23) suggests the following error prediction function: ( 0, t≤0 H(t) = (30) 1 − G(t − τp ), t > 0. As can be seen in the third panel of Fig. 4(a), H here thus specifies that after a control adjustment has been applied, Pp is first just set to Pr , acknowledging the control error, then stays at this level for a period τm , before the control adjustment begins, and then an additional τp , while the effects of the adjustment feed through the perceptual system. Thereafter, Pp simply follows the shape of G down to a zero predicted error. It may be noted that this shape of H bears some resemblance to typical time courses of corollary discharge inhibition, as discussed in Sec. 2.3. In Fig. 4(a), note that the onset of control is equally delayed for the continuous and intermittent controllers, due to the parameter values for k and A+ being such that a unity control error accumulates to threshold in a time τa = 1/k = 0.05 s, i.e. τp + τa + τm = 0.2 s, the same as the τd for the continuous model. In Fig. 4(b), 2 In more detail: The results by both Cook and Maunsell (2002) and Purcell et al (2010) suggest that decision-making neuronal activity accumulation begins about 50-100 ms after a visual stimulus onset. Lamarre et al (1981) observed an average lag between earliest primary motor cortex activity onset (which might precede accumulator threshold-reaching somewhat; Selen et al 2012) and elbow movement onset of 122 ms, and Morrow and Miller (2003) observed an average lag of 50 ms between primary motor cortex activity and arm EMG signals (thus not taking into account any delays between threshold-reaching and movement-generating primary motor cortex activity, and between EMG and limb movement). In practice, the sum τp +τm matters for model control behaviour, but not the individual terms. -1 0 0.5 1 1.5 2 2.5 3 6 4 2 0 -1 -0.5 0 0.5 1 1.5 2 2.5 3 Predicted (P p ) 1 Received (P r) 0.5 0 -1 -0.5 0 0.5 1 1.5 2 2.5 1 0.5 0 -1 -0.5 0 0.5 1 1.5 Time (s) 2 2.5 3 (a) Step target 2 0 -2 -1 5 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 Time (s) 3 4 5 0 -5 -1 2 0 -2 -1 3 A (a.u.) A (a.u.) -0.5 dC/dt (d.u./s) 0 P (d.u.) 0.5 dC/dt (d.u./s) P (d.u.) Target Continuous Intermittent 1 C (d.u.) Gustav Markkula et al. C (d.u.) 10 1 0 -1 -1 (b) Sum-of-sines target 4.3 Application to ground vehicle steering 1 4 G (-) dG/dt (1/s) Fig. 4: Simulations of a continuous model by Powers (2008), of tracking an on-screen cursor with a mouse, as well as a generalisation of the same model to intermittent control, using the computational framework proposed here. In these examples, the intermittent control model is simulated completely without noise. In panel (a), the grey vertical line shows the time (t = 0.1 s) at which the evidence accumulator (bottom panel) reaches threshold. 2 0.5 0 0 0 0.2 0.4 Time (s) 0.6 0 0.2 0.4 0.6 Time (s) Fig. 5: The bell-shaped control adjustment profile used for both the minimal cursor-tracking example in Sec. 4.2 and for the ground vehicle steering model. note that control adjustments often partially overlap, in linear superposition, to yield a less obviously stepwise resulting signal. Furthermore, note that the rate of control Ċ for the continuous model indeed looks much like an average-filtered version of the Ċ for the intermittent model (as discussed in Sec. 4.1.3). Therefore, if a human would behave as the intermittent controller, the continuous model would still fit the observed behaviour very well. In the terms of Gawthrop et al (2011), the intermittent control “masquerades” well as the continuous control. As discussed by Benderius (2014), such an underlying control intermittency might potentially be able to account for much of the nonlinear “remnant” that is left unexplained by the continuous model. For the specific sensorimotor task of steering a car, research and control model development have followed the same general directions outlined in the Introduction, with examples of both classical control theoretic models (McRuer et al 1977; Donges 1978; Jürgensohn 2007), ecological psychology models (Fajen and Warren 2003; Wann and Wilkie 2004; Wilkie et al 2008), optimal control models (MacAdam 1981; Sharp et al 2000; Plöchl and Edelmann 2007), and more recently also intermittent control models (Gordon and Magnuski 2006; Roy et al 2009; Benderius 2014; Markkula 2014; Gordon and Srinivasan 2014; Gordon and Zhang 2015; Johns and Cole 2015; Boer et al 2016; Martı́nez-Garcı́a et al 2016). To provide a further illustration of the proposed intermittent control framework, and a platform for testing its major assumptions, a model of ground vehicle steering will be described here. The full details will be developed over several sections below, but for illustration purposes some examples of the final model’s time series behaviour are provided already in Fig. 6. Compared to the minimal example in Fig. 4, note the effect, in panels (b) and (c), of introducing noise: Accumulator noise makes the adjustment timing less predictable, and motor noise causes a more inexact-looking steer- Sustained sensorimotor control as intermittent decisions about prediction errors ing profile, where Pp is generally not equal to Pr just after the adjustment onset (cf. Eq. (28)). The simulation in Fig. 6(c) also includes noise emulating random disturbances in the vehicle’s contact with the road, in the form of a Gaussian disturbance to the vehicle’s yaw rate, of standard deviation σR and band limited to 0.5 Hz with a third-order Butterworth filter (Boer et al 2016). The steering model illustrated in Fig. 6 uses the computational framework proposed here, with the perceptual control error quantity P from Eq. (7), i.e. the model is a generalisation to intermittent control of the steering model proposed by Salvucci and Gray (2004). The adopted control adjustment functions Ġ and G were the same as above; see Fig. 5. This choice was based on the results by Benderius and Markkula (2014), who showed that, across a wide range of real-traffic and driving simulator data sets, steering adjustments almost always followed a Gaussian-like rate profile, with average durations of about 0.4 s, encompassing about ±2 standard deviations of the Gaussian. As for H, note that again a sigmoidally decreasing function was used to generate the control error prediction Pp . The plant model S was on the general form of a linear so-called “bicycle” model of lateral vehicle dynamics (Jazar 2008): " v̇y (t) ω̇(t) # " = A2×2 vy (t) ω(t) 11 5 A simple method for interpreting sustained control as intermittent Methods exist for decomposing shorter movement observations into a sequence of stepwise primitives, for example based on optimisation (Rohrer and Hogan 2003; Polyakov et al 2009) or high-order derivatives of the position signal (Fishbach et al 2005). Here, given our sustained control data with thousands of control adjustments, we adopt a considerably simpler method which is less exact, but also less computationally expensive and requiring only first-order derivatives. For a given digitally recorded control signal with N samples C(j) taken at times t(j), if one can estimate the times ti of control adjustment onset, one can use a discretized version of Eq. (20), C(j) = C0 + n X g̃i G(t(j) − ti ), (32) i=1 to approximately reconstruct C(j) as n stepwise control adjustments with amplitudes g̃i . By rewriting Eq. (32) as the overdetermined matrix equation C = Gg, (33) where C = [C(1) . . . C(N )]T , (34) # + b2×1 δ(t), (31) where vy is lateral speed in the vehicle’s reference frame, ω is the rate of yaw rotation of the vehicle in a global reference frame, and δ is the steering wheel angle, i.e. C = δ. Here, the A and b matrices were obtained by fitting to observed vehicle response in two experiments with human drivers. These data sets of human steering, and how they have been analysed to (i) test framework assumptions and (ii) parameterise the model simulations shown in Fig. 6, will be described in Sec. 6. There, it will be shown that human vehicle steering in the studied data sets could be well described as a sequence of stepwise control adjustments, that the amplitude of individual adjustments could be explained using perceptual control error quantities at the time of adjustment onset, that the adjustment amplitudes could be even better explained if assuming that the humans responded to control error prediction errors rather than control errors per se, and finally that an accumulator model explained distributions of adjustment amplitude and timing better than did a threshold-based model. First, however, Sec. 5 will introduce an analysis method that will be needed in the following.   1 G (t(1) − t1 ) · · · G (t(1) − tn ) .  .. ..  .. G= . .   1 G (t(N ) − t1 ) · · · G (t(N ) − tn ) (35) (i.e., a matrix with N rows and n + 1 columns), and g = [C0 g̃1 . . . g̃n ]T , (36) one can obtain a standard least-squares approximation of g using: ĝ = (GT G)−1 GT C, (37) or more efficient numerical techniques. In order to estimate the times ti of adjustment onset, one can make use of the fact that if a signal is composed of intermittent discrete adjustments with sufficient spacing between them, then each adjustment will show up as an upward or downward peak in the rate of change of the signal (cf. Figs. 4 and 6). Therefore, a simple approach to estimating the ti is to look for peaks in the control rate signal, after some appropriate amount of noise filtering, and define the steering adjustment onsets as occurring a time Tpeak before these peaks, where Ġ(Tpeak ) is the control rate maximum; i.e. here Tpeak = τm + ∆T /2. Gustav Markkula et al. y (m) 12 1 0.5 0 P (o ) 2 0 -2 A (a.u.) 1 0 -1 δ (o ) 0 2 0 -2 4 6 8 Pp 2 4 6 8 0.4 0.2 0 0 10 Pr 0 2 4 6 8 10 2 0 -2 0 10 2 4 6 8 2 4 6 8 10 2 4 6 8 10 2 0 -2 0 2 4 6 8 2 4 6 8 10 10 0 -10 0 2 4 6 Time (s) 8 10 4 6 8 10 0 2 4 6 8 10 0 2 4 6 8 10 0 2 4 6 8 10 0 2 4 6 Time (s) 8 10 2 0 -2 0 10 10 0 -10 2 1 0 -1 0 10 0 2 0 -2 1 0 -1 0 dδ/dt ( o /s) 2 1 0.5 0 10 0 -10 0 2 4 6 Time (s) 8 10 (a) Response of noise-free model to a 1◦ (b) As in (a), but also including accumu- (c) A 10 s excerpt of a longer lane-keeping initial heading error. lator and motor noise. simulation, with accumulator, motor, and road/vehicle noise. Fig. 6: Example simulations of the lane-keeping steering model driving on a straight road, with model parameters as in Table 1. 6 Testing framework assumptions using human steering data 6.1 Data sets To test the framework assumptions introduced here, two data sets of passenger car driving in a high-fidelity driving simulator were used: (1) One set of 15 drivers recruited from the general public, performing routine lane-keeping on a simulated rural road, in an experiment previously reported on as Experiment 1 in (Kountouriotis and Merat 2016). Here, only a subset of these data were used, by extracting the conditions with a straight road, no secondary task distraction and no lead vehicle. In total there were four segments of such driving per participant, each 30 s long. The average observed speed was 97 km/h. (2) One set of eight professional test drivers performing a near-limit, low-friction handling task on a circular track (50 m inner radius) on packed snow. The task was to keep a constant turning radius, at the maximum speed at which the driver could maintain stable control of the vehicle. Each driver performed the task four times, and here 15 s were extracted from each such repetition, beginning at the start of the second circular lap, at which point drivers had generally reached a fairly constant speed (observed average 43 km/h). The motivation for including these data here was to study a more extreme form of lane-keeping, where driver steering is arguably operating in an optimizing rather than a satisficing mode (Summala 2007). Three recordings where the driver lost control (identified as heading angle relative to circle tangent > 10◦ ) were excluded. In both experiments, the University of Leeds Driving Simulator was used. In this simulator, drivers sit in a Jaguar S-type vehicle cockpit with original controls, inside a spherical dome onto which visual input of 310◦ coverage (250◦ forward, 60◦ backward via rear view mirror) is projected. Motion feedback is provided by an eight degree of freedom motion system; a hexapod mounted on a lateral-longitudinal pair of 10 m rails. In both experiments, the steering wheel angle was recorded at a 60 Hz sample rate, with 0.1◦ resolution. 6.2 Interpreting steering as intermittent control The computational framework developed in Sec. 4.1 describes control as a sequence of stereotyped stepwise adjustments, with zero control change in between. Is it possible to understand the human steering in our data sets in this way? As a simple first indication, the fraction of time steps with zero change in steering wheel angle was indeed found to be rather large for both tasks: 45.8 % for the circle task, and 91.1 % for the lanekeeping; cf. the plateaus in Fig. 1. 30 30 0.4 6 20 20 4 0.3 10 10 2 0.05 0.1 σ I (s) (a) Lane-keeping 0 0.15 0.05 0.1 σ I (s) Potential over-fits (%) 99th percentile error (deg) Sustained sensorimotor control as intermittent decisions about prediction errors 0 0.15 (b) Circle task Fig. 7: The effect of low-pass filtering on the reconstruction of human steering as intermittent stepwise adjustments. Less filtering (lower σI ) produces more exact reconstructions, but with a larger fraction of potentially over-fitted steering adjustments (see the text for details). To get a more complete answer, the method introduced in Sec. 5 was applied, using the bell-shaped control adjustment G described in Sec. 4.3. The noise filtering of the steering wheel signal, here achieved using a Gaussian-kernel averaging filter, does affect the outcome of this method, since a more heavily filtered signal will present fewer control rate peaks. Therefore, as illustrated in Fig. 7, lower values of the filter kernel standard deviation σI produced fits with larger numbers of steering adjustments and lower reconstruction error, here quantified in terms of 99th percentile of the absolute difference between recorded and reconstructed steering wheel angle. However, reconstructing with frequent adjustments also means that more of these are partially overlapping. It was found that this could produce unwanted effects, such as one fitted adjustment of large positive amplitude being followed by one large negative adjustment, producing a near-zero reconstructed steering angle. Such over-fitting tendencies were identified by comparing the peak steering wheel rate of the individual fitted adjustments to the observed steering wheel rate at the same points in time. These need not be identical, but when the fitted peak amplitude was more than 1.25 times larger than the observed steering rate peak, the adjustment was deemed a possible over-fit. The fraction of such adjustments are graphed against the right y axis in Fig. 7. Based on these results, σI was fixed at 0.1 s and 0.06 s for the lane-keeping and circle tasks, respectively. With these values for σI , the estimated adjustment frequencies, across the entire data sets, were 1.1 Hz and 2.0 Hz for the two tasks, a 98.2 % and 96.6 % compression compared to the original 60 Hz signals. As can 13 be seen in Fig. 7, 99th percentile reconstruction errors were 0.33◦ and 5.0◦ in the two tasks. These values were seemingly inflated somewhat by certain recordings with atypically large reconstruction errors. At the level of individual recordings, median reconstruction errors were 0.23◦ and 3.0◦ . Fig. 8 shows examples of reconstructions that are typical in terms of estimated adjustment frequencies and reconstruction errors, as well as one example lane-keeping recording with a higher estimated frequency of control adjustment, and a larger reconstruction error. Overall, these rather exact reconstructions using a small number of adjustments can be taken to suggest that something like intermittent stepwise control was indeed what drivers were making use of in these steering tasks. Such an interpretation seems qualitatively reasonable also from simply looking at the lane-keeping steering data, which, as mentioned, for the most part looked like Fig. 8(a). Also the circle task steering, such as exemplified in Fig. 8(c), had a decidedly staircaselike aspect. With examples such as the one shown in Fig. 8(b), it is less qualitatively clear from the recorded steering signal itself that intermittent control might have been the case, but if one studies this plot closer (e.g. supported by the vertical stripes in the figure), one can see why a reconstruction as a limited number of stepwise changes works also here: Basically, the control signal tends to always be either roughly constant (at 0 s, 1.3 s, 3.5 s, 4.8 s) or is changing upward or downward in a manner which can be understood as a single adjustment of about 0.4 s duration or shorter. Crucially, if control changes in the same direction for more than 0.4 s, it tends to do so with several identifiable peaks of steering rate (at 3-3.5 s and 3.6-4.2 s). A main cause of less exact reconstruction seems to be cases where two such peaks come close enough together to merge into one peak in the low-pass filtering (around 4.5 s in Fig. 8(b) and around 0.6 s, 1.2 s, and 4 s in Fig. 8(c)). 6.3 Amplitude of individual steering adjustments The proposed framework also suggests that it should be possible to predict the control adjustment amplitudes from the control situation at adjustment onset, and more so than what it is possible to predict continuous rates of control change from the continuously developing control situation. To see whether this is the case here, we first consider a simplified, prediction-free version of Eq. (14), where the expected value of control 14 Gustav Markkula et al. 99th percentile error: 0.6 deg Adj. frequency: 2.6 Hz 3 99th percentile error: 0.2 deg Adj. frequency: 1.2 Hz 1.5 2 1 99th percentile error: 3.7 deg Adj. frequency: 2.4 Hz -60 δ (deg) 1 0.5 -80 0 0 -1 -0.5 -2 -100 -120 0 1 2 3 10 0 5 Data Filtered Reconstructed 20 dδ/dt (deg/s) 4 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 Time (s) 4 5 20 100 10 0 0 -10 -10 0 -100 -20 -20 0 1 2 3 Time (s) 4 (a) Typical lane-keeping example. 5 0 1 2 3 Time (s) 4 (b) More frequent adjustments. 5 (c) Typical circle task example. Fig. 8: Example reconstructions of the observed human steering as intermittent, stepwise control. adjustment amplitude is gi = K 0 Pr (ti ) = {K 0 = 1} = Pr (ti ) = knI θn (ti − τp ) + knP θ̇n (ti − τp ) + kf θ̇f (ti − τp ). (38) In Fig. 3(b), this corresponds to the lower part of the model (“Superposition of motor primitives”) being fed Pr directly instead of . Note the similarity with the original, continuous Salvucci and Gray (2004) control law in Eq. (7), which, with K = 1 and with the continuous model delay included, is: point were fixed across drivers, again based on initial exploration, at 0.25 s and 2 s. Fig. 9 shows, for both driving tasks, the entirety of observed and model-predicted control for the bestfitting gain parameterisations, for both the continuous model (panels (a) and (d)) and the intermittent model (panels (b) and (e)). For the continuous model, note that the previously mentioned large fraction of time steps with zero change in the human steering is visible as vertical stripes in the middle of plots. The fitted gain parameters for this model are a compromise between not predicting too δ̇(t) = knI θn (t − τd ) + knP θ̇n (t − τd ) + kf θ̇f (t − τd ). (39) large steering rates for these stretches of zero control change, while nevertheless predicting non-zero steering This corresponds directly to the model in Fig. 3(a). rates of correct sign when the human actually is adHere, both the intermittent model in Eq. (38) and justing the steering; this is what is causing the data the continuous model in Eq. (39) were fitted to the obpoints in Fig. 9(a) and (d) to scatter at a flatter slope served gi and δ̇, respectively, by means of a grid search, per driver, across all combinations of knI ∈ {0, 0.01, ..., 0.20},than the y = x line that signifies perfect model fit. This compromise can be seen in more detail for the three exknP ∈ {0, 0.1, ..., 2}, and kf ∈ {0, 0.4, ..., 12} for the conample recordings in the top row of panels of Fig. 10. As tinuous model, and the same search ranges for Eq. (38), discussed in Sec. 4.2, note that the continuous model but scaled by ∆T = 0.4 s (cf. Eq. (15)). The delay in behaviour looks like an average-filtered version of the Eq. (39) was fixed at τd = 0.2 s, after initial explosteering rates, especially in panels (b) and (c) where ration suggested that values close to this one worked there are many control adjustments. well across all drivers. For the intermittent model, the gi should correlate with the externally observed P at a point τp + τm + ∆T /2 before the peak of the observed adjustment; in this respect we here assumed τp + τm + ∆T /2 = 0.2 s and did not vary these delays further. Also the preview times to near point and far For the intermittent model, the vertical stripes of data naturally disappear, as well as most of the flatness of the scatter. These results suggest that even though the model by Salvucci and Gray (2004) was originally devised to explain continuous rates of steering change, Sustained sensorimotor control as intermittent decisions about prediction errors (g i ) model (deg) (d//dt)model (deg/s) 10 0 5 R2 = 0.40 (g i ) model (deg) 5 R2 = 0.14 15 0 0 -10 -5 -5 -5 -10 0 10 (d//dt)observed (deg/s) 0 5 -5 (b) Lane-keeping, IM R2 = 0.25 R2 = 0.36 R2 = 0.43 -100 50 (g i ) model (deg) (g i ) model (deg) 100 0 -50 -100 0 100 (d//dt)observed (deg/s) (d) Circle task, CM 5 (c) Lane-keeping, PIM 50 0 0 (g i ) observed (deg) (g i ) observed (deg) (a) Lane-keeping, CM (d//dt)model (deg/s) R2 = 0.58 0 -50 -50 0 (g i ) observed (deg) 50 (e) Circle task, IM -50 0 (g i ) observed (deg) 50 (f) Circle task, PIM Fig. 9: Steering amplitude model fits; one continuous model responding to perceptual control error (CM; panels (a) and (d)), one intermittent model responding to perceptual control error (IM; panels (b) and (e)), and one intermittent model responding to errors in prediction of perceptual control error (PIM; panels (c) and (f)). The continuous and intermittent models predicted control rates (δ̇) and control adjustment amplitudes (gi ), respectively. it is actually better suited for explaining amplitudes of intermittent control adjustments; nicely aligning with the framework assumption being tested here. The bottom row of panels in Fig. 10 illustrates how the observed human control adjustment amplitudes gi relate to the variations over time of the parameterfitted Pr quantity in Eq. (38). As one would expect given the residual flatness of the scatter in Fig. 9, some of the above-mentioned model-fitting compromise remains; rather than hitting the observed gi directly, the fitted Pr tends to pass below (in absolute terms) the larger gi , and above the smaller ones. 6.4 Prediction of control errors Now, consider the full form of amplitude adjustment model proposed here, feeding  rather than Pr to the motor control (the bottom part of Fig. 3(b)): gi = K 0 (ti ) = K 0 (Pr (ti ) − Pp (ti )) 0 = {K = 1} = Pr (ti ) − Pp (ti ) (40) (41) = knI θn (ti − τp ) + knP θ̇n (ti − τp ) + kf θ̇f (ti − τp ) − Pp (ti ). (42) If the framework proposed here is correct, Eq. (42) should explain adjustment amplitudes better than the prediction-free version in Eq. (38). To test whether this is the case, one needs to define suitable H functions from which to build Pp (i.e., one needs to determine the “superposition of prediction primitives” component in Fig. 3(b)). Just as in Sec. 4.2, besides the general requirements on H set out in Eq. (22), we again make use of Eq. (23), suggesting that H should describe how control errors decay when the controlled plant system responds to a control adjustment. In the case of ground vehicle steering, the plant Y is the lateral dynamics of the vehicle, and as mentioned above these dynamics were here approx- 16 Gustav Markkula et al. dδ/dt (deg/s) 10 20 Data CM 5 R 2 = 0.09 0 1 2 3 4 5 1 P (deg) 0 0 0 -5 0 Pp P (IM) -1 1 2 3 0 1 2 3 4 0 5 40 2 20 0 0 -2 -20 -1 0 1 2 3 Time (s) 4 1 2 3 4 5 4 40 2 20 0 0 1 2 3 4 5 0 1 2 3 4 5 -20 R 2 = 0.44 R 2 = 0.53 -4 5 0 -40 0 -2 R 2 = 0.53 R 2 = 0.57 R 2 = 0.17 -100 4 4P (PIM)5 r ǫ (PIM) gi 1 R 2 = 0.27 -20 -4 r 0 P; ǫ; g i (deg) 100 0 1 .pdf (a) 2 3 Time (s) 4 5 R 2 = 0.36 R 2 = 0.65 -40 0 1 (b) 2 3 Time (s) 4 (c) where S(vx ) is the vehicle’s steady state yaw rate response at longitudinal speed vx , i.e. for increasing t ωG (t) → S(vx ). This prediction function is shown in the bottom panel of Fig. 11. In words, Eq. (43) says that after applying a control adjustment G to address a perceptual control error Pr , this control error will over H (-) imated using the linear model in Eq. (31). The A and b matrices of that equation were least-squares fitted to the two task data sets; Fig. 11 shows the yaw rate response ωG (t) of the linear models thus obtained, when subjected to a steering input of the shape G used here (as depicted in Fig. 5). Calculating exactly how an arbitrary Pr responds to a stepwise control adjustment G is non-trivial, but it was found here that the following approximation of Eq. (23) worked rather well in practice: ( 0, t≤0 H(t) = (43) 1 − ωG (t − τp )/S(vx ), t > 0. ω G (1/s) Fig. 10: Example illustrations of observed steering and fitted models of control amplitude, for the same three recordings as shown in Fig. 8. The topmost panels show the continuous model (CM) fitted to observed steering rates. The middle plots show the Pr for both the intermittent and predictive inttermittent models (IM and PIM), and the Pp signal computed from the reconstructed adjustments. The bottom panels show the amplitude-predicting quantities of the two intermittent models, as fitted to the reconstructed adjustment amplitudes shown as vertical stems at the reconstructed times of adjustment onset (i.e. not at the adjustment rate peaks); a perfect intermittent model would pass exactly through all circles. 0.6 0.4 0.2 0 0 0.5 1 Lane keeping Circle task 1.5 0 0.5 1 1.5 1 0.5 0 Time (s) Fig. 11: Top: Yaw rate responses to the sigmoidal steering adjustment profile G, of a linear vehicle model fitted to the two data sets of human steering. The vertical line indicates τm . Bottom: Prediction functions H for the two tasks, obtained using the yaw rate response profiles. The vertical line indicates τm + τp . 5 Sustained sensorimotor control as intermittent decisions about prediction errors time fall towards zero with a profile that is the same as the profile of the vehicle’s yaw rate response to G. This is only exactly correct if the actual control error is a pure yaw rate error (without heading or lane position errors). However, note in Fig. 6(a) that this H nevertheless provides rather good prediction following most of the steering adjustments. For example, during the first rightward steering response to the leftward heading error, the prediction is exact while the adjustment is being carried out, and the far and near point rotations respond to the changing vehicle yaw rate. However, since the original error was not a yaw rate error, P continues increasing above zero (which in turn prompts a sequence of stabilising steering adjustments to the right). Eq. (43) thus serves as an example of what was speculated Sec. 4.1.4; that also approximate predictions might in many control tasks be enough to allow successful control. Note that again H takes the form of a sigmoid-like fall from one to zero. Now, since we have fixed K 0 = 1, ˜i = g̃i , such that a Pp signal can be constructed using Eq. (21) directly from the reconstructed g̃i . Example prediction signals are shown in the middle row of panels in Fig. 10. As shown in Fig. 9, using this Pp to fit the control gains in Eq. (42), across the same parameter ranges as for Eq. (38), yields improved fits, thus providing support for the framework assumption being tested here. It should be noted that these increases in model fit are not a result of introducing additional free parameters, but rather just of modifying the type of model function being used for fitting. The bottom row of panels in Fig. 10 provides some further insight into the difference between models: When two adjustments follow each other with a short duration in between, the  of the prediction-based model is often better than the prediction-free Pr at capturing the amplitude of the second adjustment, which tends to have a much smaller magnitude than Pr , or even the opposite sign. The framework proposed here suggests that these small secondary adjustments occur because the preceding adjustments did not have quite the predicted effect. Especially for the lane-keeping task, this seemed to be happening more for some drivers than for others, and as one might expect it was to some degree related to frequency of steering adjustment. The three lane-keeping drivers for which the shift from Eq. (38) to Eq. (42) improved model fit the most, also had the three largest adjustment frequencies in the group. Fig. 12 shows the best-fitting gains obtained for the 15 drivers performing the lane-keeping task. Based on this figure, the gains knI = 0.02, knP = 0.2, and kf = 1.6 were adopted for the example simulations in Fig. 6, and also for the further model fittings in the next section. 17 0.32 0.28 0.24 0.2 0.16 0.12 0.08 0.04 0 0.8 knP knI 0.96 1.12 1.28 1.44 1.6 k f (-) 1.76 1.92 2.08 Fig. 12: Best-fitting gain parameters for the predictionextended Salvucci and Gray (2004) model (Eq. (42)), when used to explain adjustment amplitudes in the lane-keeping data set. Each vertical line shows the fit for one driver. Slight random variation in kf has been added for legibility; the actual fitted values are the ones indicated on the x axis. 6.5 Time between steering adjustments A final theoretical prediction to be tested here is that the timing of observed adjustments should be better explained as generated by a process of evidence accumulation, such as set out in Eqs. (8) or (11), than by control error thresholds or minimal refractory periods, such as adopted in existing frameworks and models of intermittent control (e.g. Miall et al 1993; Gawthrop et al 2011; Benderius 2014; Johns and Cole 2015; Martı́nez-Garcı́a et al 2016). Figs. 13(a) and 14(a) show the distributions of not only adjustment amplitudes g̃i in the two data sets of human steering, across all drivers, but also the interadjustment interval ∆ti , ti − ti−1 . In other words, these figures illustrate how the distribution of amplitudes varied with how much time had passed since the previous adjustment. Note that the distributions of ∆ti (visible in collapsed form along the top of the panels) are roughly log-normal in character, skewed towards larger values, something which is typical of timings obtained from accumulator-based models (e.g., Bogacz et al 2006). Here, an approximate model-fitting of the lane-keeping data was carried out, using the “typical” gain parameters obtained in Sec. 6.4 above, to see if fitting a single model to the data from all drivers would allow reproducing the general patterns seen in Fig. 13(a). The remaining parameters of the steering model were grid searched, testing all combinations of the accumulator gain k ∈ {150, 200, ..., 400}, the accumulator noise σa ∈ {0.4, 0.5, ..., 1.2}, the motor noise σm ∈ {0.2, 0.4, ...1}, and the road/vehicle noise σR ∈ {0.02, 0.03, 0.04, 0.05} 18 Gustav Markkula et al. 2 2 2 1 g i (º) 3 g i (º) 3 g i (º) 3 1 0 1 0 0 1 2 3 " t i (s) (a) Human drivers. 0 0 1 2 3 " t i (s) 0 1 2 3 " t i (s) (b) Best-fitting threshold model. (c) Best-fitting accumulator model. Fig. 13: Relationship between time ∆ti since previous steering adjustment, and adjustment amplitude g̃i , in the lane-keeping task. Each dot is one control adjustment, the curves show one-dimensional distributions, and the blue horizontal lines show median g̃i in bins of ∆ti . Panel (a) shows human steering data; panels (b) and (c) show computer simulations of best-fitting threshold-based and accumulator-based models, respectively. rad/s. For each model evaluation, lane-keeping was simulated for the same amount of time as the human lanekeeping, i.e. 30 minutes of simulated driving. The model’s steering adjustments were counted in bins with edges ∆ti at {0, 0.2, 0.4, ...6, ∞} s, and for g̃i at {0, 0.25, 0.5, ..., 3, ∞} degrees, and the grid search identified the model parameterisation with minimum χ2 = q X (Oj − Ej )2 Ej + 1 j=1 (44) where Oj and Ej are numbers of adjustment by humans and model in bin j, and q is number of bins. This is standard chi-square minimisation distribution fitting, apart from the addition of one in the nominator, an approximate method to handle bins with Ej = 0. Also an alternative model was tested, intended to emulate typical assumptions of previous intermittent control models, as mentioned above. These previous models have been deterministic, and as such they are clearly unable to explain the data observed here. Therefore, an extended stochastic formulation was used: Instead of accumulating prediction error , this model triggered new adjustments when time since previous adjustment exceeded ∆min and  + νt ≥ 0 , where νt is Gaussian noise with zero mean and standard deviation σt , and 0 a threshold parameter. This model was grid searched across all combinations of σt ∈ {0.06, 0.12, ..., 0.52} degrees3 , 0 ∈ {0.2, 0.4, ..., 1.2} degrees, ∆min ∈ {0, 0.1, 0.2} s, and σm and σR across the same ranges as for the accumulator model. For both models, the best solutions from the grid searches were optimised further using an interior point algorithm (Mathworks MATLAB function fmincon). 3 From 0.001 to 0.009 radians. The best fits obtained are shown in Fig. 13(b) and (c), with a lower χ2 = 451 (i.e., a better fit) for the accumulator model than for the threshold model, χ2 = 593, despite the threshold model having one more free parameter. The main shortcomings of the threshold model seemed to be (i) a tendency to produce a majority of control adjustments just after the ∆min duration, thus not generating a very lognormal-looking distribution of ∆ti , and (ii) a failure to account for those observed data points which had simultaneously large ∆ti and g̃i . The fitted values for the accumulator model were used when generating the example simulations in Fig. 6. The full list of all parameter values used in those simulations are provided in Table 1. Panels (b) through (h) of Fig. 14 provide a closer look at how the accumulator-based model’s behaviour varies when the different noise magnitudes are varied. In panel (b), note how, in the the absence of any accumulator or motor noise, adjustments become infrequent. This is because they are triggered solely by noise-free accumulation of control errors, which tend to be small due to the noise-free control (with gains fitted to the human steering) being rather well-attuned to the vehicle (cf. Fig. 6(a)). A pattern of decreasing g̃i with increasing ∆ti , observable for human steering in both tasks with ∆ti > 0.5 s, is clear already in this simplified form of the model. This is a somewhat counterintuitive consequence of accumulation-based control (Markkula 2014); integration of a small quantity over a long time is the same as integration of a large quantity over a short time4 . 4 Also the noise-extended threshold model can give this qualitative behaviour, however in this case by the logic that with a small control error it takes a longer time, on average, Sustained sensorimotor control as intermittent decisions about prediction errors 3 20 2 g i (º) g i (º) 30 19 10 1 0 0 0 0.5 1 " t i (s) 1.5 0 1 2 (a) Human drivers, circle task. (b) Lane-keeping model; road noise only. 2 2 2 1 g i (º) 3 g i (º) 3 g i (º) 3 1 0 1 0 0 1 2 3 0 0 1 2 3 0 1 2 " t i (s) " t i (s) " t i (s) (c) σa = 0.4 (d) σa = 0.8 (e) σa = 1.2 2 2 2 1 1 0 1 0 1 2 3 3 g i (º) 3 g i (º) 3 g i (º) 3 0 3 " t i (s) 0 0 1 2 3 0 1 2 " t i (s) " t i (s) " t i (s) (f) σm = 0.4 (g) σm = 0.8 (h) σm = 1.2 3 Fig. 14: Further results on timing and amplitudes of steering; as in Fig. 13. Panel (a) shows the human steering in the circle task, and panels (b-h) show the effects of varying noise levels in the best-fitting accumulator-based lane-keeping model shown in Fig. 13(c). All simulations included road noise, at its fitted value σR = 0.02 rad/s. In panel (b) accumulator and motor noises (σa and σm ) were set to zero, in panels (c-e) motor noise was zero and accumulator noise was varied around its fitted value (middle panel), and vice versa in panels (f-h). When adding and increasing accumulator noise (panels (c) through (e)), adjustments become more frequent, and smaller ∆ti start occurring. At these lower ∆ti , there is now the opposite pattern of increasing g̃i with increasing ∆ti . This happens in the model because the before the noise happens to be large enough for thresholdpassing. earlier the noise happens to push the accumulator above threshold, the smaller the control error to respond to will be, on average. Interestingly, this sort of pattern can be seen clearly in the human steering in the circle task (panel (a)). If, instead of accumulator noise, we add and increase motor noise (panels (f) through (h)), we see that this is another way of producing small 20 Gustav Markkula et al. Table 1: Parameter values used for the lane-keeping steering model simulations in Figs. 6, 13, and 14 (except where otherwise indicated in those figures). Parameter Value Obtained from τp 0.05 s Literature; see Sec. 4.2. τm 0.1 s -”- Tn 0.25 s Exploratory fitting of steering amplitude models; see Sec. 6.3. Tf 2s -”- knI 0.02 Fitting of Eq. (42) to observed steering amplitudes; see Sec. 6.4 knP 0.2 s -”- kf 1.6 s -”- k 200 Fitting of accumulator model (Eq. (11)) and noise magnitudes, to observed timing and amplitudes of steering; see Sec. 6.5. σa 0.8 a.u. -”- σm 0.8 -”- σR 0.02 rad/s -”- ∆ti , in this case because ill-attuned adjustments soon trigger additional, corrective adjustments. Here, since large motor mistakes will be detected more quickly, the smaller ∆ti are here instead associated with larger g̃i , thus counteracting the above-mentioned effect of accumulator noise. 7 Discussion Below, some relevant existing accounts of sensorimotor control will first be enumerated and briefly contrasted with what has been proposed here. Then, a series of subsections will engage in more detail with some specific topics for discussion. 7.1 Related models and frameworks As mentioned in the Introduction, Gawthrop and colleagues have also presented a task-general framework for intermittent control (Gawthrop et al 2011, 2015). What has been proposed here aligns well with their emphasis on possible underlying control intermittency even in cases where the overt behaviour is seemingly continuous in nature. However, at the level of actual model mechanisms, the two frameworks are rather different, with Gawthrop et al starting out from an optimal control engineering perspective whereas we have put more focus on adopting concepts from psychology and neurobiology: zero-order or system-matched holds versus motor primitives; explicit inverse and forward system models versus perceptual heuristics and corollary discharge-type prediction primitives; error deadzones and minimum refractory periods versus evidence accumulation. Another task-general framework has been derived from the free-energy principle, which suggests that minimisation of free energy, or roughly equivalently minimisation of prediction error, is the fundamental governing principle of the brain (Friston 2005, 2010). From this mathematical framework, Friston and colleagues have derived models of sensorimotor control as active inference (Friston et al 2010, 2012a; Perrinet et al 2014), but these have focused on continuous rather than intermittent control. The active inference framework, like ours, describes motor action as being generated to minimise sensory prediction errors, and sensorimotor control as near-optimal without being directly based on engineering optimal control mechanisms. However, these active inference models have not explicitly included notions of superpositioned ballistic motor primitives, or evidence accumulation to decide on triggering such primitives. In our understanding, such mechanisms should be obtainable as special cases of the more generally formulated active inference theory; our argument here is that these might be useful special cases to consider. In contrast, as mentioned in Sec. 2, some researchers focusing specifically on motor control have proposed superposition of sequences of motor primitives as a main feature of their conceptual frameworks (Hogan and Sternad 2012; Karniel 2013), but so far without developing these into full computational accounts. Others have focused on how the primitives themselves might be constructed using underlying dynamical systems formulations (Ijspeert et al 2003; Schaal et al 2007); a description one level below the one we have adopted here. There is also a related, vast literature on neuronal-level models of how individual saccadic eye movements are generated (e.g., Girard and Berthoz 2005; Rahafrooz et al 2008; Daye et al 2014). Overall, these motor-level accounts suggest that the kinematic motor primitives considered in the present framework are not truly ballistic, in the sense that there is a closed control loop to support their successful motor completion. However, from a higher-level perspective it might still be correct to consider them ballistic, in the sense that once they are initiated, they are not further affected by how the perceptual situation which triggered them continues to evolve. There are also task-specific models of sensorimotor control sharing some of the present framework’s as- Sustained sensorimotor control as intermittent decisions about prediction errors 21 sumptions. The task of reaching towards a target has for example been modelled as a superposition of two non-overlapping bell-shaped speed pulses by Meyer et al (1988), or as an arbitrary number of pulses with possible pairwise overlap by Burdet and Milner (1998). Both of these models allow variable-duration primitives, and the latter model also includes provisions for uncertain estimation of predicted final amplitude of an ongoing primitive, in a manner that is related but not identical to the prediction error-based control used here. A more direct analogue exists in models of smooth pursuit of moving targets with the eyes, where the Smith Predictor type approach has long been used (Robinson et al 1986; Kettner et al 1997; Grossberg et al 2012, and the same is actually true also for the above-mentioned models of individual saccades), but these models are instead continuous in nature. Among the models of car steering as intermittent control, the ones by Roy et al (2009) and (Johns and Cole 2015) are more similar to the Gawthrop et al (2011) framework than to ours, whereas the models by Gordon and colleagues (Gordon and Srinivasan 2014; Gordon and Zhang 2015; Martı́nez-Garcı́a et al 2016) do make use of steering adjustment primitives, but in a hybrid intermittentcontinuous control scheme. The model by Benderius (2014) uses motor primitives and perceptual heuristics, but not sensory prediction or evidence accumulation. The only other car steering model that hasn’t used error deadzones is the one by Boer et al (2016), who used a just noticeable difference mechanism. The overall impression is that the level of description we have adopted places our framework somewhere in the middle with respect to these existing models. We are arguably one step closer to the neurobiology than the Gawthrop et al (2011) framework and the existing car steering models, and one step further away from the neurobiology and from detailed behavioural-level knowledge than some of the models of manual reaching or eye movements. One topic of discussion in the sections to follow below will be how these higher-level and lower-level accounts might possibly benefit from adopting some of the ideas proposed here. tasks. What has been proposed here is that sustained sensorimotor control can be regarded as a sequence of such decisions. More specifically, we have proposed that the rate of accumulation towards the decision threshold might scale with control error prediction error. This provides an interesting possible answer to the long-standing open question whether control intermittency is caused by minimal refractory periods or to error deadzones, or both. For example, Miall et al (1993) found that their data supported neither hypothesis completely, and van de Kamp et al (2013) reported evidence for a refractory period that varied with the order of the control task. In effect, accumulation of prediction error (or even of just control error, without predictions) will result in both (i) mandatory refractory pauses between control actions and (ii) control error magnitudes at which control actions will most typically be issued, but both of these will vary with the specifics of the control situation leading up to the adjustment, and quite naturally also with the task itself (as between the lane-keeping and circle steering tasks studied here). Furthermore, with noise included in the accumulation process, this type of model also provides a natural means of capturing the inherent stochasticity in control action timing. Given the above argument, it is interesting to note that our approximate model-fitting analyses tentatively favoured the accumulator-based account over the more conventional, threshold-based model (even when extended to a stochastic formulation). These findings should be complemented with more detailed analyses and targeted experiments. Such investigations could benefit from considering not only behavioural but also neuroimaging data, to possibly look for direct traces of any ongoing evidence accumulation (see, e.g., Werkle-Bergner et al 2014). One specific assumption in the present framework that would merit testing with both behavioural and neuroimaging approaches is the currently assumed resetting of the accumulation to zero immediately after each control adjustment. 7.2 Evidence accumulation in sensorimotor control The motor primitives we have considered here have been of a rather sinmple nature: stepwise changes of position, all of the same basic shape and duration regardless of amplitude. In car steering specifically, this approach aligns with a previous report of amplitudeindependence in steering adjustments (Benderius and Markkula 2014), and it was also sufficient, here, for making the point that the car steering data could be much better understood as a sequence of such steps than as continuous control. However, if one wanted to To the best of our knowledge, no prior models have adopted the idea that evidence accumulation is involved in sustained sensorimotor control, to decide on when to change the current control by for example triggering a new open-loop control adjustment. This hypothesis seems a very natural one to explore given the large amount of empirical support for accumulation-type models in the context of single decision perceptual-motor 7.3 Different types of open-loop primitives 22 apply the computational framework proposed here to other tasks (including car steering in a more general sense than lane-keeping or circle-tracking), one would most probably want to consider a wider variety of motor primitives. Already at the level of simple stepwise position changes, it is clear that humans can adapt the duration of their limb movements to the requirements of the task at hand (Plamondon 1995). Even within the same visuo-manual joystick tracking task ,Hanneton et al (1997) observed stepwise adjustment behaviour where smaller amplitude adjustments were performed faster. Visual inspection suggests that this latter phenomenon might actually be occurring also in the present car steering data sets (see, e.g., the small adjustment at 4 s in Fig. 8(a)), but if so possibly at amplitudes which would require higher-resolution steering angle measurements to properly characterise. Also wider classes of kinematic motor primitives have been proposed. Hogan and Sternad (2012) suggested that in addition to stepwise kinematic submovements, a task-general account of motor control should also include primitives for kinematic oscillations as well as impedances. The car steering models by Gordon and colleagues propose that a higher-level set open-loop primitives is constructed from the simple stepwise adjustments; e.g. one, two or three opposing steps in sequence to achieve a desired adjustment of either vehicle yaw rate, yaw angle, or lateral position, respectively (Gordon and Srinivasan 2014; Martı́nez-Garcı́a et al 2016)5 . It has indeed been proposed that learning to construct finely task-attuned higher-level kinematic primitives in this type of manner might be an important role of the motor system (Giszter 2015). A possible special case that would seem useful in many tasks, but that we have not seen mention of in the literature, would be a constant-rate primitive, e.g. constructed from a rapid sequence of partially overlapping position changes. Interestingly, at least one early eye movement researcher described smooth pursuit eye movements as intermittent adjustments of movement rate (Westheimer 1954). On the motor control side of our framework, expanding to a larger number of kinematic primitives is straightforward; one would simply need to create a set of functions G defining these primitives, and an associated set of prediction functions H. What would require some more thought is the decision-making mechanism, which would then no longer just have to decide if there is a need for a control adjustment, but also what type 5 They also propose an interesting method for automated identification of this dictionary of steering primitives, allowing a more powerful, but also more complex, signal reconstruction than the method we have used here. Gustav Markkula et al. of adjustment (and, in the just speculated case of a constant-rate primitive, whether to stop generating it, or switch to another rate). Such decisions could be modelled as competitions between accumulators (cf. e.g., Usher and McClelland 2001; Purcell et al 2012) representing the different adjustment types, or in the active inference framework (Friston et al 2012b) as competing predictions of what type of control will be carried out next. Indeed, even the present single-primitive formulation of our framework could be extended in this direction, by casting the individual amplitudes of stepwise position change as competing decisions (cf. e.g., Erlhagen and Schöner 2002; Cisek 2007)6 . 7.4 Open-loop versus closed-loop, intermittent versus continuous As has been mentioned above, it remains contentious whether, and if so to what extent and in what types of tasks, the nervous system engages in intermittent control, and Gawthrop et al (2011) have argued that part of the empirical difficulty might lie in the capability of intermittent controls to “masquerade” as continuous control. Another, related theme in the literature has been that the nervous system might be capable of combinations of open-loop and closed-loop control, and/or of continuous and intermittent control. Such hybrid control can be achieved for example by intermittently turning a continuous controller on and off (Collins and De Luca 1993; Asai et al 2009), by following up an open-loop primitive with a period of continuous closed-loop control (Martı́nez-Garcı́a et al 2016), or by applying system-matched holds which are open-loop but continuous and highly flexible to be optimal with respect to the controlled system and situation (Gawthrop et al 2011). In making these types of distinctions, to not exaggerate the theoretical disagreement it seems important to be careful about what is meant by the terms being used, and at what level of analysis. As has already been discussed above, an action which is openloop and ballistic at one level of a control hierarchy (e.g., a control adjustment of amplitude g̃ triggered in response to a prediction error , but unaffected by later changes in ) might be implemented in closedloop control at a lower level (e.g., ensuring that the performed amplitude is actually g̃; which again might rely on open-loop bursts of movement at an even lower, spinal level). Furthermore, higher up in the hierarchy 6 One specific benefit of such an approach would be that it would allow sensory noise to affect both timing and amplitude of adjustments, whereas the present framework decouples sensory and motor noise completely. Sustained sensorimotor control as intermittent decisions about prediction errors the open-loop action might be part of a more sustained behaviour which is closed-loop in nature (e.g., a sequence of open-loop adjustments with amplitudes g̃i , each in well-tuned response to the  at time of adjustment onset). Something similar holds for the distinction between continuous and intermittent control; movement within an individual kinematic primitive is certainly continuous, and sequences of superpositioned intermittent kinematic primitives can generate continuous movement of arbitrary nature. Even with the above clarification, there can of course still be disagreement about whether, at a given level of analysis, sensorimotor control is best described as closed-loop or open-loop, continuous or intermittent. These discussions are probably best held at a taskspecific level, with support from task-specific evidence. Hopefully the task-general framework proposed in this article can provide some useful inputs to such work. However, one task-general counter-question that could be asked in response to the hybrid control schemes mentioned above, is whether the hypothesised episodes of continuous and (by some accounts) closed-loop behaviour could not again be instances of intermittent control masquerading as continuous? As suggested in the section just above, such a masquerade could come not only in the form of a succession of motor primitives triggered in closed loop, but also possibly as a learned, open-loop sequence of simpler primitives, superpositioned to construct a more complex motor action (e.g., to implement a system-matched hold). To clarify these matters, one would first need to locate candidates for the hypothesised episodes of hybrid control, and then subject them to detailed investigation. 7.5 Sensory prediction from corollary discharge primitives As already touched upon, the idea of prediction (or more specifically predictive coding or predictive processing) is much emphasised in many contemporary accounts of perception, cognition, and action (Rao and Ballard 1999; Friston 2005, 2010; Clark 2013, 2016; Hohwy 2013; Engström et al 2017). As discussed above at several places in this article, many previous authors have also highlighted the specific importance for sensorimotor control of Smith Predictor-like mechanisms, but to our knowledge this has so far always been in the context of continuous control. Here, we have integrated such a mechanism into an intermittent control framework, where it arguably is even more useful7 . 7 Another type of prediction, which has been used in previous intermittent control models, addresses specifically motor 23 The other, and possibly more important, theoretical contribution of this paper with respect to prediction, is the insight that a useful prediction signal can be constructed by superposition of simple “prediction primitives”, triggered in parallel with each new control adjustment. As mentioned above, when these prediction primitives are mathematically derived to be (near) optimal for the tasks studied here (manual tracking and car steering), they obtain a shape that is similar in nature to corollary discharge biases that have been recorded in for example crickets and electric fish (Poulet and Hedwig 2007; Chagnaud and Bass 2013; Requarth and Sawtell 2014). These recorded corollary discharges have also been shown to change in shape with the motor action that triggers them (Chagnaud and Bass 2013; Requarth and Sawtell 2014), just as H has been suggested to depend on G here, and repeated corollary discharges are summed on top of each other in a fashion that is reminiscent of linear superposition (Chagnaud and Bass 2013). In other words, the present computational formulation of sensory prediction could possibly map very directly onto actual neural mechanisms and signals. If so, this suggests a heuristic strategy for the construction of forward model transfer functions, where an isolated corollary discharge or prediction primitive is somewhat analogous to the step response of the system (or the response to whichever motor primitive in question), at the level of the expressed controlled perceptual quantity. It should be pointed out, however, that this might typically be a rather approximate forward model, due to the prediction primitive itself only being an approximate step response, such as proposed here for the car steering task, and/or due to the controlled system not reacting to superpositioned motor inputs in exactly the same ways as the corollary discharges get summed together. Furthermore, there is also a difference from a typical forward model in control theory, in how the prediction primitive here first “resets” the prediction error signal to the currently observed prediction error, then falls from there. Given the above theoretical arguments, it is encouraging that our behavioural observations here aligned with the idea that prediction error determines control adjustment amplitudes; car steering adjustment amplidelays by basing the control not on the current control error (or control error prediction error), but instead on what the error will have become by the time the motor action gets effectuated (e.g., Gawthrop et al 2009, 2011; Gordon and Srinivasan 2014). In our understanding this type of prediction differs from the corollary discharge, “sensory consequence of motor actions” type of prediction for which there is ample neuroscientific support, as reviewed in Sec. 2.3. However, it should be possible to incorporate also this type of prediction in the present framework, as part of the definition of the quantity P . 24 tudes were better explained as a linear scaling of the prediction error  = Pr − Pp than as a linear scaling of Pr directly. A possible alternative interpretation of this finding, without involving sensory prediction, would be that the secondary, corrective adjustments which were better explained by  than by Pr , were actually not triggered in response to either of these, but instead as part of a longer-duration, multi-step open-loop primitive, e.g. to change yaw angle rather than yaw rate (as discussed in Sec. 7.3). Visual inspection tentatively speaks against that hypothesis, at least in its simplest form; for example, the pair of stepwise adjustments starting at 0.4 s and 0.8 s in Figs. 8(c) and 10(c) affects both yaw angle and yaw rate. In any case, these findings and alternative hypotheses deserve to be followed up in more detail in targeted experiments, e.g. with better control of the errors being responded to at control adjustment onset. Such experiments could also look closer at the mentioned difference between drivers, with the predictionbased amplitude model providing a slightly worse fit than the prediction-free version for some drivers. It should be investigated whether these are random fluctuations in the data, or perhaps an indication of differences in control strategy between individuals. 7.6 Near-optimal control of percepts versus optimal control of a system As was mentioned in the Introduction, several accounts have described sensorimotor control as an optimal control of the body and its environment (e.g., Kleinman et al 1970; Todorov and Jordan 2002; Shadmehr and Krakauer 2008; Franklin and Wolpert 2011; Gawthrop et al 2011), whereas others have suggested that it might be misleading to make too strong analogies between the nervous system and optimal controllers such as designed by engineers (Friston 2011; Pickering and Clark 2014). The framework proposed here aligns with the latter view, and also provides a concrete suggestion for how the nervous system might achieve near-optimal sensorimotor control by a careful combination of mechanisms which are all in themselves ad hoc and approximate in nature: perceptual heuristics, noisy evidence accumulation, a limited set of predefined motor primitives, and approximate but sufficiently effective sensory predictions. It should be emphasised that there is a sense in which these two accounts are very compatible; if regarded as another case of models operating at different levels of description. A non-strict interpretation of the optimal control type of account–which for example Todorov and Jordan (2002) seem to support–is that it Gustav Markkula et al. is at its most useful at a purely behavioural level, for well-practised tasks where the nervous system has been able to learn how to achieve something close to optimal control. At this level of description, engineering-type optimal control has proven powerful as a tool for predicting what behaviour might look like under a wide variety of tasks. In contrast, the type of framework proposed here will typically need more meticulous, task-specific attention, for example to identify and parameterise the relevant perceptual heuristics, before good predictions about behaviour can be made. On the other hand, if the present framework does indeed provide a more accurate description of the actual mechanisms involved, it should lend itself better to various forms of generalisation. For example, once properly established, the type of model proposed here might provide more accurate predictions of how sensorimotor behaviour generalises to novel situations (important not least in a driving context; Markkula 2014, 2015). Furthermore, models that are based on appropriate component mechanisms should in principle also be more suitable as starting points for accounts of how various factors influence sensorimotor control. Here, extra leverage can be had from the large neuroscientific literatures about the various component mechanisms; there is for example existing knowledge about how evidence accumulation processes might accomodate multisensory integration (Noppeney et al 2010; Raposo et al 2012), and how they are affected by variations in arousal (Jepma et al 2009; Ratcliff and Van Dongen 2011) or time pressure (Bogacz et al 2010). 7.7 Applying the framework to other sensorimotor tasks If one should wish to apply the present framework to other sensorimotor tasks beyond what has been studied here, the most obvious candidates would be tasks that are similar in nature to car steering; visuo-manual control tasks involving some external plant with dynamics of its own. Such tasks include laboratory-type joystick tracking tasks, robotic teleoperation in medicine or space, and longitudinal, lateral, and vertical control of other types of vehicles than cars; on land, in air, or on sea. In these tasks, novel and useful modelling could possibly be done with minimal or no modification to the computational framework presented here. As already hinted above, such immediate applicability seems less likely for sensorimotor tasks which have been deeply investigated in the laboratory, such as ocular tracking, manual reaching, and postural control. In these contexts, it might nevertheless be useful to consider the adoption, into existing task-specific models, Sustained sensorimotor control as intermittent decisions about prediction errors of some of the component mechanisms suggested here. For example, might evidence accumulation mechanisms help explain better the timing of catch-up saccades during smooth pursuit eye movements (De Brouwer et al 2002; Grossberg et al 2012), of leg muscle activation in quiet standing, or of corrective submovements in reaching? Could it be beneficial to model the apparent intermittency of postural balance control as stereotyped motor primitives rather than episodes of continuous control (Asai et al 2009) or system-based holds (Gawthrop et al 2011), and what about introducing a Smith Predictor control scheme in models of these tasks? And is it completely clear that Westheimer (1954) was wrong in suggesting that smooth pursuit eye movements are constructed from something like the control rate primitives speculated in Sec. 7.3? In some of the tasks mentioned above, it might be desirable to consider the types of mechanisms discussed here in an expanded hierarchy with several levels, as briefly discussed in Sec. 7.4. 8 Conclusion It has been proposed, here, that intermittent sensorimotor control is achieved by the nervous system as ballistic motor primitives triggered after accumulation to threshold of errors in prediction of perceptual quantities indicating the need for control (control error prediction errors). These ideas have been realised in a computational framework for the special case of one-dimensional stepwise control, and it has been shown how existing models based on one-dimensional continuous control laws can be generalised to intermittent control using this framework. Such generalisation has been demonstrated by formulation of one simple example model of a manual tracking task, and a more complete example of car steering control. With the assumptions of the framework as a starting point, and supported by a simple method for interpreting a control signal as intermittent control, two data sets of human car steering have been analysed. The results show that the observed steering lends itself well to being understood as a sequence of sigmoidal step adjustments, the amplitudes of which can be explained using an existing, originally continuous, model. The fit of this amplitude model is further improved if assuming that what the drivers respond to is not the errordescribing perceptual quantity itself, but rather errors in prediction of this quantity. Furthermore, distributions of control adjustment timing, and how these covary with adjustment amplitude, were seemingly better explained by a model assuming evidence accumulation instead of mechanisms typical of existing intermittent 25 control models (error deadzones and minimum refractory periods). More targeted empirical work, in both driving and other sensorimotor tasks, is warranted to verify the findings presented here, especially those relating to the possible roles of evidence accumulation and sensory prediction in intermittent sensorimotor control. A novel theoretical insight, here, has been that not only the motor output but also the sensory prediction can be usefully constructed from a superposition of discrete primitives, to yield a prediction signal that might not be exact but accurate enough for successful behaviour. Interestingly, the nature of this type of prediction signal, as suggested for the tasks studied here, is reminiscent of corollary discharge biases as observed in animals. This could provide another piece of the puzzle in the debate regarding to what extent and how the nervous system might act as an optimal controller. The present account aligns with the general idea, and suggests a concrete computational realisation of it, that a number of mechanisms that are all approximate and ad hoc in nature (ballistic motor primitives, perceptual heuristics, noisy evidence accumulation, corollary discharge prediction primitives) are used in concert by the nervous system to achieve behaviour that is nearoptimal under a wide range of circumstances. In sum, the presently proposed framework provides an intermediate-level, behavioural account of sensorimotor control, by integrating, conceptually and computationally, a set of neurobiologically plausible mechanisms that have been present in isolation in previous models. The closer connection to neurobiology could be preferable to the optimal control level of description in some contexts, and the task-general ideas outlined here could provide interesting directions for future development of more detailed task-specific models. Data statement Upon publication of this paper, the research data supporting it will be made publicly available. References Asai Y, Tasaka Y, Nomura K, Nomura T, Casadio M, Morasso P (2009) A model of postural control in quiet standing: Robust compensation of delay-induced instability using intermittent activation of feedback control. PLoS ONE 4(7):e6169 Azim E, Alstermark B (2015) Skilled forelimb movements and internal copy motor circuits. Current Opinion in Neurobiology 33:16–24 Benderius O (2014) Modelling driver steering and neuromuscular behaviour. PhD thesis, Chalmers University of Technology 26 Benderius O, Markkula G (2014) Evidence for a fundamental property of steering. In: Proceedings of the Human Factors and Ergonomics Society Annual Meeting, vol 58, pp 884–888 Bitzer S, Park H, Blankenburg F, Kiebel SJ (2014) Perceptual decision making: drift-diffusion model is equivalent to a bayesian model. Frontiers in Human Neuroscience 8:102 Bizzi E, Cheung VCK, d’Avella A, Saltiel P, Tresch M (2008) Combining modules for movement. Brain Research Reviews 57:125–133 Boer ER, Spyridakos PD, Markkula G, Merat N (2016) Cognitive driver distraction improves straight lane keeping: A cybernetic control theoretic explanation. to be presented at the 13th IFAC Symposium on Analysis, Design, and Evaluation of Human-Machine Systems Bogacz R, Brown E, Moehlis J, Holmes P, Cohen JD (2006) The physics of optimal decision making: A formal analysis of models of performance in two-alternative forced-choice tasks. Psychological Review 113(4):700–765 Bogacz R, Wagenmakers EJ, Forstmann BU, Nieuwenhuis S (2010) The neural basis of the speed–accuracy tradeoff. Trends in Neurosciences 33(1):10–16 Burdet E, Milner TE (1998) Quantization of human motions and learning of accurate movements. Biological Cybernetics Chagnaud BP, Bass AH (2013) Vocal corollary discharge communicates call duration to vertebrate auditory system. The Journal of Neuroscience 33(48):18,775–18,780 Cisek P (2007) Cortical mechanisms of action selection: the affordance competition hypothesis. Philosophical Transactions of the Royal Society B: Biological Sciences 362:1585–1599 Clark A (2013) Whatever next? predictive brains, situated agents, and the future of cognitive science. Behavioral and Brain Sciences 36(3):181–204 Clark A (2016) Surfing uncertainty: Prediction, action, and the embodied mind. Oxford University Press, New York, NY Collins JJ, De Luca CJ (1993) Open-loop and closed-loop control of posture: A random-walk analysis of centerof-pressure trajectories. Experimental Brain Research 95:308–318 Cook EP, Maunsell HR (2002) Dynamics of neuronal responses in macaque mt and vip during motion detection. Nature Neuroscience 5(10):985–994 Craik KJW (1948) Theory of the human operator in control systems. British Journal of Psychology 38:56–61 Crapse TB, Sommer MA (2008) Corollary discharge across the animal kingdom. Nature Reviews Neuroscience 9:587– 600 Daye PM, Optican LM, Blohm G, Lefevre P (2014) Hierarchical control of two-dimensional gaze saccades. Journal of Computational Neuroscience 36:355–382 De Brouwer S, Yuksel D, Blohm G, Missal M, Lefèvre P (2002) What triggers catch-up saccades during visual tracking? Journal of Neurophysiology 87:1646–1650 Ditterich J (2006) Stochastic models of decisions about motion direction: Behavior and physiology. 19 19:981–1012 Donges E (1978) A two-level model of driver steering behavior. Human Factors: The Journal of the Human Factors and Ergonomics Society 20(6):691–707 Engström J, Bärgman J, Nilsson D, Seppelt B, Markkula G, Bianchi Piccinini G, Victor T (2017) Great expectations: A predictive processing account of automobile driving. Manuscript submitted for publication Gustav Markkula et al. Erlhagen W, Schöner G (2002) Dynamic field theory of movement preparation. Psychological Review 109(3):545–572 Fajen BR, Warren WH (2003) Behavioral dynamics of steering, obstacle avoidance, and route selection. Journal of Experimental Psychology: Human Perception and Performance 29(2):343–362 Fishbach A, Roy SA, Bastianen C, Miller LE, Houk JC (2005) Kinematic properties of on-line error corrections in the monkey. Experimental Brain Research 164(4):442–457 Flash T, Henis E (1991) Arm trajectory modifications during reaching towards visual targets. Journal of Cognitive Neuroscience 3(3):220–230 Flash T, Hochner B (2005) Motor primitives in vertebrates and invertebrates. Current Opinion in Neurobiology 15:660–666 Franklin D, Wolpert D (2011) Computational mechanisms of sensorimotor control. Neuron 72:425–442 Friston K (2005) A theory of cortical responses. Philosophical Transactions of the Royal Society of London B: Biological Sciences 360(1456):815–836 Friston K (2010) The free-energy principle: a unified brain theory? Nature Reviews Neuroscience 11(2):127–138 Friston K (2011) What is optimal about motor control? Neuron 72:488–498 Friston K, Samothrakis S, Montague R (2012a) Active inference and agency: optimal control without cost functions. Biological Cybernetics 106:523–541 Friston KJ, Daunizeau J, Kilner J, Kiebel SJ (2010) Action and behavior: a free-energy formulation. Biological Cybernetics 102:227–260 Friston KJ, Shiner T, FitzGerald T, Galea JM, Adams R, Brown H, Dolan RJ, Moran R, Stephan KE, Bestmann S (2012b) Dopamine, affordance and active inference. PLoS Computational Biology 8(1):e1002,327 Gawthrop P, Loram I, Lakie M (2009) Predictive feedback in human simulated pendulum balancing. Biological Cybernetics 101:131–146 Gawthrop P, Loram I, Lakie M, Gollee H (2011) Intermittent control: a computational theory of human control. Biological Cybernetics 104:31–51 Gawthrop P, Lee KY, Halaki M, O’Dwyer N (2013) Human stick balancing: an intermittent control explanation. Biological Cybernetics 107:637–652 Gawthrop P, Gollee H, Loram I (2015) Intermittent control in man and machine. In: Miskowicz M (ed) Event-Based Control and Signal Processing, CRC Press, chap 14, pp 281–350 Gibson JJ (1986) The Ecological Approach to Visual Perception. Psychology Press Girard B, Berthoz A (2005) From brainstem to cortex: Computational models of saccade generation circuitry. Progress in Neurobiology 77:215–251 Giszter SF (2015) Motor primitives new data and future questions. Current Opinion in Neurobiology 33:156–165 Gold JI, Shadlen MN (2007) The neural basis of decision making. Annual Review of Neuroscience 30:535–574 Gordon T, Magnuski N (2006) Modeling normal driving as a collision avoidance process. In: Proceedings of the 8th International Symposium on Advanced Vehicle Control Gordon T, Srinivasan K (2014) Modeling human lane keeping control in highway driving with validation by naturalistic data. In: Proceedings of the 2014 IEEE International Conference on Systems, Man, and Cybernetics, pp 2507– 2512 Gordon T, Zhang Y (2015) Steering pulse model for vehicle lane keeping. In: Proceedings of 2015 IEEE Interna- Sustained sensorimotor control as intermittent decisions about prediction errors tional Conference on Computational Intelligence and Virtual Environments for Measurement Systems and Applications (CIVEMSA) Grossberg S, Srihasam K, Bullock D (2012) Neural dynamics of saccadic and smooth pursuit eye movement coordination during visual tracking of unpredictably moving targets. Neural Networks 27:1–20 Hanneton S, Berthoz A, Droulez J, Slotine JJE (1997) Does the brain use sliding variables for the control of movements? Biological Cybernetics 77:381–393 Hart CB, Giszter SF (2010) A neural basis for motor primitives in the spinal cord. The Journal of Neuroscience 30(4):1322–1336 Hogan N (1984) An organizing principle for a class of voluntaroy movements. The Journal of Neuroscience 4(11):2745–2754 Hogan N, Sternad D (2012) Dynamic primitives of motor behavior. Biological Cybernetics 106:727–739 Hohwy J (2013) The Predictive Mind. Oxford University Press, New York, NY von Holst E, Mittelstaedt H (1950) The principle of reafference: Interactions between the central nervous system and the peripheral organs. Die Naturwissenschaften 37:464– 476 Ijspeert AJ, Nakanishi J, Schaal S (2003) Learning attractor landscapes for learning motor primitives. In: Advances in Neural Information Processing Systems, MIT Press, pp 1523–1530 Jazar RN (2008) Vehicle Dynamics: Theory and Applications. Springer Jepma M, Wagenmakers EJ, Band GP, Nieuwenhuis S (2009) The effects of accessory stimuli on information processing: evidence from electrophysiology and a diffusion model analysis. Journal of Cognitive Neuroscience 21(5):847–864 Johns TA, Cole DJ (2015) Measurement and mathematical model of a driver’s intermittent compensatory steering control. Vehicle System Dynamics 53(12):1811–1829 Jürgensohn T (2007) Control theory models of the driver. In: Cacciabue P (ed) Modelling Driver Behaviour in Automotive Environments, Springer, pp 277–292 van de Kamp C, Gawthrop P, Gollee H, Loram ID (2013) Refractoriness in sustained visuo-manual control: Is the refractory duration intrinsic or does it depend on external system properties? PLoS Computational Biology 9(1):e1002,843 Karniel A (2013) The minimum transition hypothesis for intermittent hierarchical motor control. Frontiers in Computational Neuroscience 7(12):1–8 Kettner RE, Mahamud S, Leung HC, Sitkoff N, Houk JC, Peterson BW (1997) Prediction of complex two-dimensional trajectories by a cerebellar model of smooth pursuit eye movement. Journal of Neurophysiology 77:2115–2130 Kleinman DL, Baron S, Levison WH (1970) An optimal control model of human response part i: Theory and validation. Automatica 6(3):357–369 Kountouriotis GK, Merat N (2016) Leading to distraction: Driver distraction, lead car, and road environment. Accident Analysis & Prevention 89:22–30 Krauzlis RJ, Lisberger SG (1994) A model of visually-guided smooth pursuit eye movements based on behavioral observations. Journal of Computational Neuroscience 1:265– 283 Lamarre Y, Spidalieri G, Lund JP (1981) Patterns of muscular and motor cortical activity during a simple arm movement in the monkey. Canadian Journal of Physiology and Pharmacology 59:748–756 27 Lee D (1976) A theory of visual control of braking based on information about time-to-collision. Perception 5(4):437– 459 Liu D, Todorov E (2007) Evidence for the flexible sensorimotor strategies predicted by optimal feedback control. The Journal of Neuroscience 27(35):9354–9368 Loram ID, Lakie M (2002) Human balancing of an inverted pendulum: position control by small, ballistic-like, throw and catch movements. Journal of Physiology 540(3):1111– 1124 Loram ID, N MC, Lakie M (2005) Open-loop and closed-loop control of posture: A random-walk analysis of center-ofpressure trajectories. Journal of Physiology 564(1):295– 311 MacAdam C (1981) Application of an optimal preview control for simulation of closed-loop automobile driving. IEEE Transactions on Systems, Man, and Cybernetics 11(6):393–399 Marken RS (2014) Testing for controlled variables: a modelbased approach to determining the perceptual basis of behavior. Attention, Perception, & Psychophysics 76:255– 263 Markkula G (2014) Modeling driver control behavior in both routine and near-accident driving. In: Proceedings of the Human Factors and Ergonomics Society Annual Meeting, vol 58, pp 879–883 Markkula G (2015) Driver behavior models for evaluating automotive active safety: From neural dynamics to vehicle dynamics. PhD thesis, Chalmers University of Technology Martı́nez-Garcı́a M, Zhang Y, Gordon T (2016) Modelling lane keeping by a hybrid open-closed-loop pulse control scheme. IEEE Transactions on Industrial Informatics 12(6):2256–2265 Maurer C, Peterka RJ (2005) A new interpretation of spontaneous sway measures based on a simple model of human postural control. Journal of Neurophysiology 93:189–200 McBeath MK, Shaffer DM, Kaiser MK (1995) How baseball outfielders determine where to run to catch fly balls. Science 268(5210):569–573 McRuer D (1980) Human dynamics in man-machine systems. Automatica 16(3):237–253 McRuer D, Graham D, Krendel E, Reisener W Jr (1965) Human pilot dynamics in compensatory systems: Theory, models, and experiments with controlled element and forcing function variations. Tech. Rep. AFFDL-TR-65-15, AF Flight Dynamics Laboratory McRuer D, Allen R, Weir D, Klein R (1977) New results in driver steering control models. Human Factors: The Journal of the Human Factors and Ergonomics Society 19(4):381–397 McRuer DT, Jex HR (1967) A review of quasi-linear pilot models. IEEE Transactions on Human Factors in Electronics 8(3):231–249 Meyer DE, Abrams RA, Kornblum S, Wright CE, Smith JEK (1988) Optimality in human motor performance: Ideal control of rapid aimed movements. Psychological Review 95(3):340–370 Miall RC, Weir DJ, Stein JF (1993) Intermittency in human manual tracking tasks. Journal of Motor Behavior 25(1):53–63 Morrow MM, Miller LE (2003) Prediction of muscle activity by populations of sequentially recorded primary motor cortex neurons. Journal of Neurophysiology 89:2279–2288 Nashner LM (1972) Vestibular postural control model. Kybernetik 10:106–110 28 Noppeney U, Ostwald D, Werner S (2010) Perceptual decisions formed by accumulation of audiovisual evidence in prefrontal cortex. Journal of Neuroscience 30(21):7434– 7446 Pasalar S, Roitman AV, Ebner TJ (2005) Effects of speeds and force fields on submovements during circular manual tracking in humans. Experimental Brain Research 163:214–225 Perrinet LU, Adams RA, Friston KJ (2014) Active inference, eye movements and oculomotor delays. Biological Cybernetics 108(6):777–801 Peterka RJ (2000) Postural control model interpretation of stabilogram diffusion analysis. Biological Cybernetics 82:335–343 Pickering MJ, Clark A (2014) Getting ahead: forward models and their place in cognitive architecture. Trends in Cognitive Sciences 18(9):451–456 Plamondon R (1995) A kinematic theory of rapid human movements. Biological Cybernetics 72:295–307 Plöchl M, Edelmann J (2007) Driver models in automobile dynamics application. Vehicle System Dynamics 45(78):699–741 Polyakov F, Stark E, Drori R, Abeles M, Flash T (2009) Parabolic movement primitives and cortical states: merging optimality with geometric invariance. Biological Cybernetics 100(2):159–184 Poulet JFA, Hedwig B (2007) New insights into corollary discharges mediated by identified neural pathways. Trends in Neurosciences 30(1):14–21 Powers WT (1978) Quantitative analysis of purposive systems: Some spadework at the foundations of scientific psychology. Psychological Review 85(5):417–435 Powers WT (2008) Living Control Systems III: The Fact of Control. Benchmark Publications, Bloomfield, New Jersey Purcell BA, Heitz RP, Cohen JY, Schall JD, Logan GD, Palmeri TJ (2010) Neurally constrained modeling of perceptual decision making. Psychological Review 117(4):1113–1143 Purcell BA, Schall JD, Logan GD, Palmeri TJ (2012) From salience to saccades: Multiple-alternative gated stochastic accumulator model of visual search. The Journal of Neuroscience 32(10):3433–3446 Rahafrooz A, Fallah A, Jafari AH, Bakouie F, Zendehrouh S, Gharibzadeh S (2008) Saccadic and smooth pursuit eye movements: computational modeling of a common inhibitory mechanism in brainstem. Neuroscience Letters 448:84–89 Rao RP, Ballard DH (1999) Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects. Nature Neuroscience 2:79–87 Raposo D, Sheppard JP, Schrater PR, Churchland AK (2012) Multisensory decision-making in rats and humans. Journal of neuroscience 32(11):3726–3735 Ratcliff R (1978) A theory of memory retrieval. Psychological Review 85(2):59–108 Ratcliff R, McKoon G (2008) The diffusion decision model: Theory and data for two-choice decision tasks. Neural Computation 20(4):873–922 Ratcliff R, Van Dongen HPA (2011) Diffusion model for onechoice reaction-time tasks and the cognitive effects of sleep deprivation. Proceedings of the National Academy of Sciences 108(27):11,285–11,290 Requarth T, Sawtell NB (2014) Plastic corollary discharge predicts sensory consequences of movements in a cerebellum-like circuit. Neuron 82:896–907 Gustav Markkula et al. Robinson DA, Gordon JL, Gordon SE (1986) A model of the smooth pursuit eye movement system. Biological Cybernetics Rohrer B, Hogan N (2003) Avoiding spurious submovement decompositions: a globally optimal algorithm. Biological Cybernetics 89(3):190–199 Roy R, Micheau P, Bourassa P (2009) Intermittent predictive steering control as an automobile driver model. Journal of Dynamic Systems, Measurement, and Control 131(1):014,501 Salvucci DD, Gray R (2004) A two-point visual control model of steering. Perception 33:1233–1248 Schaal S, Mohajerian P, Ijspeert A (2007) Dynamics systems vs. optimal controla unifying view. In: Cisek P, Drew T, Kalaska JF (eds) Progress in Brain Research, vol 165, Elsevier, chap 27, pp 425–445 Selen LPJ, Shadlen MN, Wolpert DM (2012) Deliberation in the motor system: Reflex gains track evolving evidence leading to a decision. The Journal of Neuroscience 32(7):2276–2286 Shadmehr R, Krakauer JW (2008) A computational neuroanatomy for motor control. Experimental Brain Research 185:359–381 Sharp R, Casanova D, Symonds P (2000) A mathematical model for driver steering control, with design, tuning and performance results. Vehicle System Dynamics 33(5):289– 326 Smith OJ (1957) Closer control of loops with dead time. Chemistry Engineering Process 53(5):217–219 Sperry RW (1950) Neural basis of the spontaneous optokinetic response produced by visual inversion. Journal of Comparative and Physiological Psychology 43(6):482–489 Summala H (2007) Towards understanding motivational and emotional factors in driver behaviour: Comfort through satisficing. In: Cacciabue P (ed) Modelling Driver Behaviour in Automotive Environments, Springer, pp 189– 207 Todorov E, Jordan M (2002) Optimal feedback control as a theory of motor coordination. Nature Neuroscience 5(11):1226–1235 Tustin A (1947) The nature of the operator’s response in manual control, and its implications for controller design. Journal of the Institution of Electrical Engineers Part IIA: Automatic Regulators and Servo Mechanisms 94(2):190–206 Usher M, McClelland JL (2001) The time course of perceptual choice: The leaky, competing accumulator model. Psychological Review 108(3):550–592 Wann JP, Wilkie RM (2004) How do we control high speed steering? In: Vaina LM, Beardsley SA, Rushton SK (eds) Optic Flow and Beyond, Dordrecht: Kluwer Academic Publishers, pp 371–389 Warren WH (2006) The dynamics of perception and action. Psychological Review 113(2):358–389 Werkle-Bergner M, Grandy TH, Chicherio C, Schmiedek F, Lövdén M, Lindenberger U (2014) Coordinated withintrial dynamics of low-frequency neural rhythms controls evidence accumulation. Journal of Neuroscience 34(25):8519–8528 Westheimer G (1954) Eye movement responses to a horizontally moving visual stimulus. AMA Archives of Ophthalmology 52(6):932–941 Wiener N (1948) Cybernetics: or control and communication in the animal and the machine. The M.I.T. Press Wilkie RM, Wann JP, Allison RS (2008) Active gaze, visual look-ahead, and locomotor control. Journal of Exper- Sustained sensorimotor control as intermittent decisions about prediction errors imental Psychology: Human Perception and Performance 34(5):1150–1164 Zago M, McIntyre J, Senot P, Lacquaniti F (2009) Visuomotor coordination and internal models for object interception. Experimental Brain Research 192:571–604 29
5cs.CE
A self-organizing neural network architecture for learning human-object interactions Luiza Mici∗, German I. Parisi, Stefan Wermter Knowledge Technology, Department of Informatics, University of Hamburg, Germany arXiv:1710.01916v2 [cs.NE] 2 Mar 2018 Abstract The visual recognition of transitive actions comprising human-object interactions is a key component for artificial systems operating in natural environments. This challenging task requires jointly the recognition of articulated body actions as well as the extraction of semantic elements from the scene such as the identity of the manipulated objects. In this paper, we present a self-organizing neural network for the recognition of human-object interactions from RGB-D videos. Our model consists of a hierarchy of GrowWhen-Required (GWR) networks that learn prototypical representations of body motion patterns and objects, accounting for the development of action-object mappings in an unsupervised fashion. We report experimental results on a dataset of daily activities collected for the purpose of this study as well as on a publicly available benchmark dataset. In line with neurophysiological studies, our self-organizing architecture exhibits higher neural activation for congruent action-object pairs learned during training sessions with respect to synthetically created incongruent ones. We show that our unsupervised model shows competitive classification results on the benchmark dataset with respect to strictly supervised approaches. Keywords: self-organization, hierarchical learning, action recognition, object recognition, human-object interaction. 1. Introduction The recognition of transitive actions, i.e., actions that involve the interaction with an object, represents a key function of the human visual system for goal inference and social communication. The study of transitive actions such as grasping and holding has often been the focus of research in neuroscience and psychology [1, 2]. Nevertheless, this task has remained an open challenge for computational models of action recognition. The ability of computational approaches to reliably recognize human-object interactions can establish an effective cooperation between assistive systems and people in real-world scenarios, promoting learning from demonstration in robotic systems [3, 4]. Given the outstanding capability of humans to infer the goal of actions from the interaction with objects, the biological visual system represents a source of inspiration for developing computational models. From the computational perspective, an important question arises regarding the potential links between the representations of body postures and manipulated objects and, in particular, how these two representations interact and can be integrated. In the visual system, the information about body pose and objects are processed separately and reside in distinct subcortical areas [5, 6, 7]. Neuroscientists have widely studied object and action perception, with a focus on where and how the visual cortex constructs invariant object representations [8] and ∗ Corresponding author Email addresses: [email protected] (Luiza Mici), [email protected] (German I. Parisi), [email protected] (Stefan Wermter) Preprint submitted to Elsevier how neurons in the superior temporal sulcus (STS) area encode actions in terms of patterns of body posture and motion [9, 10]. It has been shown that the identity of the objects plays a crucial role for the complete understanding of human-object interactions [11] and modulates the response of specific actionselective neurons [12, 13, 14]. Yet, little is known about the exact neural mechanisms underlying the integration of actions and objects. In this paper, we present a self-organizing neural architecture that learns to recognize human-object interactions from RGB-D videos. The design of the proposed architecture relies on the following assumptions: (i) the visual features of body pose and man-made objects are represented in two distinct areas of the brain [6, 7, 5], (ii) input-driven self-organization defines the topological structure of specific visual areas in brain [15], (iii) the representation of objects and concepts is based on prototypical examples [16], and (iv) the identity of the objects is crucial for the understanding of actions performed by other individuals [11, 12]. We develop a hierarchical architecture with the use of growing self-organizing networks, namely the Grow-When-Required (GWR) network [17], to learn prototypical representations of actions and objects and the resulting action-object mappings in an unsupervised fashion. Growing self-organizing networks have been an effective model for clustering human motion patterns in terms of multi-dimensional flow vectors [18, 19] as well as for learning object representations without supervision [20]. The generative properties of this topology of networks make them particularly suitable for our task when considering a possible generalization of unseen action-object pairs. March 5, 2018 The proposed architecture consists of two network streams processing separately feature representations of body postures and manipulated objects. A second layer, where the two streams are integrated, combines the information for the development of action–object mappings in a self-organized manner. On the basis of previously reported results in Mici et al. [21], this work contributes to improve the architecture design and provides a more in-depth analysis for an extended number of experiments. Unlike our previous work, we use the GWR network for all layers including the object recognition module for which we employed a self-organizing map (SOM) [22]. The reason for this is the considerable impact on using a predefined topological structure [23], especially when having as input high-dimensional complex data distributions like perceptual representations of objects. In our previous model, an additional network was used to learn prototypes of temporal activation trajectories of body poses before the integration phase. However, the impact on the overall classification accuracy of the network was marginal, while it introduces more computational complexity. We evaluate our architecture with a dataset of RGB-D videos containing daily actions acquired for the purpose of this study as well as with a publicly available action benchmark dataset CAD-120 [24]. We present and discuss our results on both datasets. In particular, we look into the role of the objects’ identity as a contextual information for unambiguously distinguishing between different activities, the classification performance of our architecture in terms of recognition of human-object interaction activities, and the response of the network when fed with congruent and incongruent action-object pairs. recognition of transitive hand-actions such as grasping, placing, and holding. Nevertheless, this model works with visual data acquired in a constrained environment, i.e., videos showing a hand grasping balls of different sizes with a uniform background, with the role of the identity of the object in transitive action recognition being unclear. Similar models have been tested in robotics, accomplishing the recognition of grip apertures, affordances, or hand action classification [3, 4]. There is a number of techniques applied to the recognition of human-object interactions. The most typical approaches are those that do not explicitly model the interplay between object recognition and body pose estimation [28, 29, 30]. Typically, first, objects are recognized and activities involving them are subsequently recognized, by analyzing the objects’ motion trajectories [31]. Yang et al. [32] proposed a method for learning actions comprising object manipulation from demonstrating videos. Their model is able to distinguish among different power and precision grasps as well as recognize objects by using a deep neural network architecture. Nevertheless, the human action is simply inferred as the action with the maximum log-likelihood ratio computed over all possible trigrams <Object1, Action, Object2> extracted from the sentences in the English Gigaword corpus. Pieropan et al. [33] proposed including action-related audio cues in addition to the spatial relation among objects in order to learn object manipulations for the purpose of robot learning by imitation. However, important descriptive visual features like body motion or fine-grained cues like the hand pose during manipulation were not considered. Probabilistic approaches have been extensively used for reasoning upon relationships and dependencies among objects, motion, and human activities. Gupta et al. [34, 35] proposed a Bayesian network model for integrating the appearance of manipulated objects, human motion, and reactions of objects. They estimate reach and manipulation motion by using hand trajectories as well as hidden Markov models (HMMs). The Bayesian network integrates all of this information and makes a final decision to recognize objects and human activities. Following a similar probabilistic integration approach, Ryoo and Aggarwal [36] proposed a framework for the recognition of high-level activities. They introduced an additional semantic layer providing feedback to the modules for object identification and motion estimation leading to an improvement of object recognition rates and better motion estimation. Nevertheless, the subjects’ articulated body pose was not considered as input data, leading to applications in a restricted task-specific domain such as airport video surveillance. Other research studies have modeled the mutual context between objects and human pose through graphical models such as Conditional Random Fields (CRF) [37, 24, 38]. These types of models suffer from high computational complexity and require a fine-grained segmentation of the action sequences. Motivated by the fact that the visual recognition of complex human poses and the identification of objects in realistic scenes are extremely hard tasks, additional methods rely on extracting novel low-level visual features. Yao and Fei-Fei [39] proposed a set of sophisticated visual features called Grouplet which captures spatial organization of image patches encoded through 2. Related work One important goal of human activity recognition in machine learning and computer vision is to automatically detect and analyze human activities from the information acquired from visual sensing devices such as RGB cameras and range sensors. The literature suggests a conceptual categorization of human activities into four different levels depending on the complexity: gestures, actions, interactions, and group activities [25, 26, 27]. Gestures are elementary movements of a person’s body part and are the atomic components describing the meaningful motion of a person, e.g. stretching an arm or raising a leg. Actions are single-person activities that may be composed of multiple gestures such as walking and waving. Interactions are human activities that involve a person and one (or more) objects. For instance, a a person making a phone call is a human-object interaction. Finally, group activities are the activities performed by groups composed of multiple persons or objects, e.g. a group having a meeting. Understanding human-object interactions requires the integration of complex relationships between features of human body action and object identity. From a computational perspective, it is not clear how to link architectures specialized in object recognition and motion recognition, e.g., how to bind different types of objects and hand/arm movements. Recently, Fleischer et al. [1] proposed a physiologically inspired model for the 2 SIFT descriptors [40]. Their method is able to distinguish between interactions or just co-occurrences of humans and objects in an image, but no applications on video data have been reported. Aksoy et al. [41] proposed the semantic event chains (SEC): a matrix whose entries represent the spatial relation between extracted image segments for every video frame. Action classification is obtained in an unsupervised way through maximal similarity. While this method is suitable for teaching object manipulation commands to robots, the representation of the visual stimuli does not allow for reasoning upon semantic aspects such as the congruence of the action being performed on a certain object. Early attempts to apply neural networks for the problem of understanding human-object interactions from visual perception yielded promising results. Shimozaki and Kuniyoshi [42] proposed a SOM-based hierarchical architecture capable of integrating object categories, spatial relations, and movement and it was shown to perform well on simple 2D scenes of ball handling actions. However, the literature suggests that compared to the static image domain, there is limited work on understanding human-object relationships from video data sequences with neural network architectures [43, 44]. Systems for the estimation of articulated human body pose from 2D image sequences struggle through a great number of challenges such as changes in ambient illumination, occlusion of body parts and the enduring problem of segmentation. The combination of RGB with depth information, provided by lowcost depth sensing devices such as Microsoft Kinect and Asus Xtion cameras, has shown computational efficiency in sensory data processing and has boosted a number of vision-based applications [45]. This sensor technology provides depth measurements which are used to obtain reliable estimations of 3D human body pose and tracking of body limbs in cluttered environments. Applications of this type of technology have led to the successful classification of full-body actions and recognition of hand gestures [27]. However, a limitation of skeletal features is the lack of information about surrounding objects. Wang et al. [46] proposed a new 3D appearance feature called local occupancy pattern (LOP) describing the depth appearance in the neighborhood of a 3D joint, and thus capturing the relations between the human body parts, e.g. hands, and the environmental objects that the person is interacting with. Although their method produces state-of-the-art results, the identity of the objects is completely ignored, and the discriminative power of such features is unclear when the objects being manipulated are small or partially occluded. The body pose cue is processed under the assumption that action-selective neurons are sensitive to the temporal order of prototypical patterns. Therefore, the output of the body pose processing stream is computed by concatenating consecutively activated neurons of GWRb , with a sliding time window technique. The object appearance cue is processed in order to have topological arrangements in GWRo where different 2D views of 3D objects as well as different instances of the same object category are mapped to proximal neurons in the prototypes domain. The advantage of having such a topological arrangement consists in mapping any unseen view of a known object into the corresponding views learned during the training. This capability resembles, to some extent, biological mechanisms for learning the three-dimensional objects in the human brain [47, 48, 7]. Moreover, prototype-based learning approaches are supported by psychological studies claiming that semantic categories in the brain are represented by a set of most typical examples of these categories [16]. For evaluating the architecture in terms of classification of human-object interaction activities, semantic labels are assigned to prototype neurons in GWRa by extending the GWR algorithm with a labeling strategy. 3.1. Learning with the GWR algorithm Input-driven self-organization is an unsupervised mechanism that learns the input probability distribution through a finite set of prototype vectors. Unlike traditional vector quantization (VQ) methods, self-organizing neural networks such as the SOM [22], the neural gas (NG) [49] as well as their growing extensions such as the growing neural gas (GNG) [50] and the GWR algorithm [17], associate these prototype vectors with neurons that adaptively form topology preserving maps of the input space in an unsupervised fashion, i.e., similar inputs are mapped to neurons that are near to each other on the map. This process of topology preservation is motivated by similar neural mechanisms found in multiple cortical areas of the brainx [15]. Growing self-organizing networks learn incrementally and can add (or remove) neurons according to different criteria. Unlike the GNG algorithm, the neural growth of the GWR algorithm is not constant but rather depends on the overall network activation with respect to the input. This leads to a faster convergence and makes the GWR algorithm more suitable for learning representations of non-stationary datasets while being less susceptible to noise. The GWR network is composed of a set of neurons associated with a weight vector and a set of edges that link the neurons forming neighborhood relationships. The network starts with a set of two neurons randomly initialized and, during the learning iterations, both neurons and edges can be created, updated, or removed. Given an input data sample x(t), the index b of the best-matching unit (BMU) is given by: 3. Methodology The proposed architecture consists of two main network streams processing separately visual representations of the body postures and of the manipulated objects. The information from the two streams is then combined for developing action-object mappings. The building block of our architecture is the GWR network [17], which is a growing extension of the self-organizing networks with competitive learning. An overview of the architecture is depicted in Fig. 1. b = arg min ||x(t) − w j ||, j∈W (1) where w j is the weight vector of the neuron j and W is the set of all neurons. The activity of the network a is computed as a function of the Euclidean distance between the BMU, wb , and 3 Figure 1: Overview of the proposed architecture. (A) Processing of the body postures. A set of local features that encode the posture of upper body limbs is extracted and fed to the GWRb networks. (B) The input for the object recognition module is the RGB image of the manipulated object. The region of interest is automatically extracted through a point-cloud-based table-top segmentation. The object is represented as a compact feature vector and is fed to the GWRo network which classifies the object. (C) The last network, GWRa , learns the combinations of body postures and the object(s) involved in an action. (D) Action labels are associated with each neuron in the GWRa network in order to evaluate the architecture’s action classification performance. the input data sample x(t) at time step t: a = exp(−||x(t) − wb ||). Action Labels (2) New neurons are added when the activity of the BMU is lower than an insertion threshold aT . This parameter modulates the amount of generalization, i.e., the largest discrepancy between an incoming stimulus and its BMU. Edges are created between two neurons with the smallest distance from the input data sample, namely the first and the second BMUs. Rarely activated edges (after amax iterations) and neurons without edges are removed. Moreover, a firing rate mechanism that measures how often each neuron has been activated by the input leads to a sufficient training before new neurons are created. The firing rate is initially set to zero and than decreases every time a neuron and its neighbors are activated in the following way: ∆hi = τi · κ · (1 − hi ) − τi , GWRa GWRb w w w w w w x(t) x(t-1) x(t-2) x(t-3) GWRo y Figure 2: Schematic description of the hierarchical learning and of the association of action labels (not all neurons and connections are shown). At each time step t, the input data sample x(t) is represented by the weight w of the winner neuron which is then concatenated with the previous winner neuron weights (two previous neurons in this example) and the category label of the object loi in order to compute the winner neuron in GWRa . Each GWRa neuron is associated with a histogram of action categories, and the most frequently matched class will be the recognized action. (3) where τi , and κ are the constants controlling the behaviour of the decreasing function curve of the firing counter. Typically, the τ constant is set higher for the BMU (τb ) than for its topological neighbors (τi ). Given an input data sample x(t), if no new neurons are added, the weights of the winner neuron and its neighbors are updated as follows: ∆wi = i · hi · (x(t) − wi ), w training is carried out layer-wise and in an offline manner with batch learning. We first extract body pose, A, and object features, O, from the training image sequences, T (see Section 3.4). The obtained data is processed by training the first layer of the proposed architecture, i.e., GWRb is trained with body pose data and GWRo with objects (Fig. 1). After training is completed, the GWRb network will have created a set of neurons tuned to prototype body pose configurations, and the GWRo network will have learned to classify objects appearing in each action sequence. The next step is to generate a new dataset T ∗ for the GWRa network that integrates information coming from both streams (Fig. 2). In order to encode spatiotemporal dependencies within the body pose prototypes space, we compute trajectories of the GWRb best-matching units when having as input training action (4) where i and hi are the constant learning rate and the firing counter variable. The learning of the GWR algorithm stops when a given criterion is met, e.g., a maximum network size or a maximum number of learning epochs. 3.2. Hierarchical learning We adopt hierarchical GWR learning [18] for the data processing and subsequent action-object integration. Hierarchical 4 sequences. For all body pose frames xi ∈ A, the best-matching units are calculated as in Eq. 1 and the corresponding neuron weights are concatenated following a temporal sliding window technique, as follows: ψ(xi ) = b(xi ) ⊕ b(xi−1 ) ⊕ ... ⊕ b(xi−q+1 ), i ∈ [q, m], the category of the data points it has matched during the training phase. Thus, each neuron is associated with a histogram hist(c, ni ) counting all cases of seeing a sequence with an assigned specific label c. Additionally, the histograms are normalized by scaling the bins with the corresponding inverse class frequency fc and with the inverse neuron activation frequency fa,ni . In this way, class labels that appear less during training are not penalized, and the vote of the neurons is weighed equally regardless of how often they have fired. When the training phase is complete, each neuron that has fired during training, i.e., BMUs, will be associated with a histogram: (5) where ⊕ denotes the concatenation operation, m is the total number of training frames, and q is the width of the time window. We will refer to the computed ψ(xi ) by the name action segment. The object data y ∈ O extracted from each action sequence is provided as input to the GWRo network and the best-matching units b(y) are calculated as in Eq. 1. Objects are extracted only at the beginning of an action sequence. Therefore, the object representations to be learned contain no temporal information and the computation of neural activation trajectories, reported in Eq. 5, is not performed. The label of the GWRo best-matching unit is represented in the form of one-hot encoding, i.e., a vectorial representation in which all elements are zero except the ones with the index corresponding to the recognized objects’ category. When more than one object appears in one action sequence, the object data processing and classification with GWRo is repeated as many times as the number of additional objects. The resulting one-hot-encoded labels are merged into one fixed dimension vector for the following integration step. Finally, the new dataset T ∗ is computed by concatenating each action segment ψ(xi ) with the label of the corresponding object lo (y) as follows: Hi = 1 · hist(c, ni ). fc · fa,ni (7) At recognition time, given a test action sequence with length k, the best-matching units are computed for each frame and the action label l is given by:  k  X  (8) Hbi  . l = arg max  c i=1 The classification of non-temporal data, e.g. object classification with the GWRo network, is performed by applying majority vote only on the histogram associated to one best-matching unit Hbmu . This is a special case of Eq. 8, considering that k = 1 for non-temporal data. In our case, action sequences are composed of smaller actionobject segments as described in Section 3.2. Thus, the majority vote labeling technique described so far is applied as follows. Let us assume we have a set of activity labels La along with our training data, for instance, drinking and eating. Therefore, each action-object segment φ ∈ T ∗ will be assigned with one of these labels and one action sequence will have the following form: T ∗ = {φu (xi ) ≡ ψ(xi ) ⊕ lo (y); xi ∈ A, y ∈ O, u ∈ [q, m − q]}. (6) Each pair φu , which we will refer to as an action-object segment, encodes both temporally-ordered body pose sequences and the identity of the object being manipulated during the action sequence. The GWRa network is then trained with the newly computed dataset T ∗ , thereby learning the provided actionobject pairs. The resulting representative vectors of body pose can have a very high dimension which further increases when concatenating them through the temporal window technique. Methods based on the Euclidean distance metric, as in our case, are shown to have a performance degradation when data lies in high-dimensional space [51]. Therefore, we apply the principal component analysis (PCA) dimensionality reduction technique to the neural weights of GWRb . The number of principal components is chosen as a trade-off between accounting for the greatest variance in the set of weights and having a smaller dimensional discrepancy with the object’s label. The new basis is then used to project weights of activated neurons in GWRb before the concatenation of the activation trajectories and the subsequent integration step. Φ = {(φ1 , laj ), ..., (φk , laj ), laj ∈ La }, (9) where laj is the activity label and k is the number of actionobject segments included in the sequence. During training of the GWRa network on the action sequence Φ, the label laj will be added to the histogram of the neurons activated for each of its composing segment φ. After the training is complete, the action sequence Φ will be classified according to the majority vote strategy (see Fig. 2). It should be noted that the association of neurons with symbolic labels does not affect the formation of topological arrangements in the network. Therefore, our approach for the classification of objects and actions remains unsupervised. 3.4. Feature extraction 3.4.1. Body pose features Visual identification and segmentation of body pose from RGB videos are challenging due to the spatial transformations compromising the appearances, such as translations, the difference in the point of view, changes in ambient illumination, and occlusions. For this reason, we use depth sensor technologies, such as the Asus Xtion camera, which provide us with 3.3. Classification We extend the GWR algorithm with a labeling strategy for classification tasks while keeping the learning process unsupervised. We use a simple method based on the majority vote strategy as in [52]. For each neuron ni , we store information about 5 reliable estimations of three-dimensional articulated body pose and motion even in real-world environments. Moreover, threedimensional skeletal representations are the most straightforward way of achieving invariance to the subjects’ appearance and body size. We consider only the position of the upper body joints (shoulders, elbows, hands, center of torso, neck and head), given that they carry more significant information (than for instance the feet and knee joints) about the human-object interactions we focus on in this paper. However, neither the number of considered joints nor the dimensionality of the input data limits the application of our architecture for the recognition of human-object interactions. We extract the skeletal quad features [53], which are invariant with respect to location, viewpoint as well as bodyorientation. These features are built upon the concept of geometric hashing and have shown promising results for the recognition of actions and hand gestures. Given a quadruple of body joints {J1 , J2 , J3 , J4 } where Ji ∈ R3 , a local coordinate system is built by making J1 the origin and mapping J2 onto the vector [1, 1, 1]T . The position of the other two joints J3 and J4 are calculated with respect to the local coordinate system and are concatenated in a 6-dimensional vector [ ĵ3,1 , ĵ3,2 , ĵ3,3 , ĵ4,1 , ĵ4,2 , ĵ4,3 ]. The latter becomes the compact representation of the four body joints’ position. We empirically select two quadruples of joints: [center torso, neck, left hand, left elbow] and [center torso, neck, right hand, right elbow]. This means that the positions of the hands and elbows are encoded with respect to the torso center and neck. We choose the neck instead of the head position due to the noisy tracking of the head caused by occlusions during actions such as eating and drinking. Composing such holistic body pose vectors, i.e., concatenations of joint positions, is quite convenient when employing a GWR network for the learning. In the case of missing joints in a data frame, due to, for example, noise or body occlusion, the best-matching unit for that input vector can be computed omitting the missing parts of the body pose vector. Self organizing networks, such as SOMs and the GWR networks as their growing extension, are able to operate robustly in the case of missing values [54]. Image Visual words VLAD SIFT Vocabulary Image vector y Figure 3: Illustration of the steps for encoding object images with the VLAD encoding method. between images. The orientation of each of these descriptors is fixed and this relaxes the descriptors’ invariance with respect to the object’s rotation. With this kind of representation, we can train the GWRo network and obtain neurons tuned to different object views, yet invariant to translation and scale. We perform quantization followed by an image encoding step in order to have a fixed-dimensional vectorial representation of each object image. This is necessary since, during training of the GWRo network, the objects are compared to each other through a vectorial metric, namely the Euclidean distance. We apply the Vector of Locally Aggregated Descriptors (VLAD) [57] encoding method (Fig. 3) which has shown higher discriminative power than the extensively used Bag of Visual Features (BoF) [58, 59]. The BoF method simply computes a histogram of the local descriptors by hard assignment to a dictionary of visual words, whereas the VLAD method computes and traces the differences of all local descriptors assigned to each visual word. 3.5. Training In Table 1, we report the parameters used for training the proposed neural architecture throughout the experiments presented in Section 4. The selection of the range of parameters is made empirically while also considering the GWR algorithm learning factors. The parameters that we fix across all layers are the constants controlling the decrease function of the firing rate variable (τb , τi and κ), the learning rates for the weights’ update function (b and i ) and the threshold for the maximum age of the edges (amax ). We set a higher insertion threshold parameter for the data processing layers, i.e., GWRb and GWRo , than for the integration layer GWRa . The higher value chosen for the GWRb and GWRo networks leads to a greater number of neurons created and a better representation of the input data as a result, whereas the slightly lower value for the GWRa seeks to generate a set of neurons that tolerate more discrepancy in the input and generalize relatively more. The insertion threshold parameters are very close to each other and very close to 1, but their impact is not imperceptible given that the input data are normalized, i.e., take values within the interval [0, 1]. We train each network for 300 epochs over the whole dataset in order to ensure convergence, during which the response of the networks to the input shows little to no significant modifications. 3.4.2. Object features The natural variations in RGB images such as variations in size, rotation, and lighting conditions, are usually so wide that objects cannot be compared to each other simply based on the images’ pixel intensities. For this reason, we extract visual features from the object images in the following way. We extract dense SIFT features, which are not more than SIFT descriptors [40] computed at crossing points of fixed grids superimposed on each object image1 . SIFT features have been successfully applied to the problem of unsupervised object classification [55] and for learning approaches based on self-organization [56]. Moreover, SIFT descriptors are known to be, to some extent, robust to changes in illumination and image distortion. Multiple descriptors with four different window sizes are computed on every image in order to account for scale invariance 1 Dense Dense keypoints SIFT from VLFeat library: http://www.vlfeat.org/ 6 Table 1: Training parameters of the GWRb , GWRo and GWRa networks of our architecture for the classification of human-object interactions. Parameter Insertion Threshold Firing Threshold Learning rates Firing rate behavior Maximum edge age Training epochs Value aT = {0.98, 0.98, 0.9} fT = 0.1 b = 0.1, i = 0.01 τb = 0.3, τi = 0.1, κ = 1.05 amax = 100 300 In addition to the aforementioned parameters, the sliding window mechanism applied to processed body pose data also has an impact on the growth of the GWRa network. Wider windows lead to the creation of more neurons, albeit the slightly lower number of data samples. This is an understandable consequence of the fact that the more temporal frames included in each time window, the higher the variance of the resulting data and the more prototype neurons created as a consequence. However, this parameter has to be set empirically according to the experimental training data distribution. We report the time window width parameter we set in each of our experiments in the following sections. Drinking Talking on the phone Eating Figure 4: Examples of sequences of skeleton joints and objects taken from the transitive actions dataset. The object category labels are: can, mug, biscuit box and phone. actions performed with either the right or the left hand. Action labels were then manually annotated. The manipulated objects were segmented from each video using a point-cloud-based table-top segmentation algorithm3 , which extracts possible clusters on top of a plane surface, e.g., on the table. False positives obtained through the automatic segmentation were then manually deleted. Finally, the obtained images were used as training data for the object recognition module of our architecture. 4. Experimental results We evaluated the proposed neural architecture both on the transitive actions dataset (Fig. 4) that we have acquired for the purpose of this study and on a publicly available action benchmark dataset provided by the Cornell University, CAD120 [24]. In this section, we provide details on both datasets, the classification performances obtained on these datasets, a quantitative evaluation of the integration module in the case of incongruent action-object pairs and a comparative evaluation on CAD-120. 4.1.2. Classification results We now assess the performance of the proposed neural architecture for the classification of the actions described in Section 4.1.1. In particular, we want to evaluate the importance of the identity of the manipulated object(s) in disambiguating the activity that a subject performs. For this purpose, we conducted two separate experiments, whereby we process body pose cues alone and in combination with recognized objects. Moreover, to further exclude any possible bias towards a particular subject, we followed a leave-one-subject-out strategy. Therefore, six different trials were designed by using video sequences of the first five subjects for training and using the remaining subject for the testing phase. This type of cross-validation is quite challenging since different subjects perform the same action in a different manner and with a different velocity. We trained each GWR network with the learning parameters reported in Section 3.5. Since this dataset is composed of short temporal sequences, a time window of five frames was chosen for the concatenation of the processed body cues. This led to action-object segments of 0.5 seconds, considering 10 4.1. Experiments with the transitive actions dataset 4.1.1. Data collection We collected a dataset of the following daily activities: picking up (an object), drinking (from a container like a mug or a can), eating (an object like a cookie) and talking on the phone (Fig. 4). The actions were performed by 6 participants that were given no explicit indication of the purpose of the study nor instructions on how to perform the actions. The dataset was collected with an Asus Xtion depth sensor that provides synchronized RGB and depth frames at a frame rate of 30 fps. The distance of each participant from the sensor was not fixed but maintained within the maximum range for the proper functioning of the depth sensor. The tracking of the skeleton joints was provided by the OpenNI framework2 . To attenuate noise, we computed the median value for each body joint every 3 frames resulting in 10 joint position vectors per second. We added a mirrored version of all action samples to obtain invariance to 2 OpenNI/NITE: Picking Up http://www.openni.org/software 3 Point 7 Cloud Library: http://www.pointclouds.org/ can mug phone PC2 biscuit box Figure 6: Classification results on the transitive actions dataset. Illustrated are precision, recall, and F1-score, averaged over 6 trials of cross-validation when using only the body pose information. When using the manipulated object identity, given by the object recognition module GWRo , we obtained a value of 100% for the reported classification performance measures. PC1 Figure 5: Neural weights of the GWRo network after having been trained with the objects from the transitive actions dataset. The first two principal components have been chosen for the visualization in two dimensions. consider incongruent pairs to be unusual or functionally irrelevant combinations of actions with objects, e.g. drinking with a telephone or eating with a can. Interestingly, fMRI studies on human brain have found several regions affected by objectaction congruence [14]. The neural response in these areas is greater for actions performed on appropriate objects as opposed to unusual actions performed on the same objects. For this experiment, we artificially created a test dataset, for which we replaced the image of the object being manipulated in each video sequence with the image of an incongruent object extracted from a different action video. We analyzed the activation values of the GWRa BMUs (Eq. 2) on both the original action sequence and the manipulated one. A few examples of the obtained neural activations are illustrated in Fig. 7. We observed that the activations were typically relatively low for the incongruent samples. This can be explained by the fact that the GWRa prototypes represent the joint distribution of action segments and congruent objects taken from the congruent set. The activation of the network is expected to be lower when the input has been taken from a different data distribution than the one the model has learned to fit. The incongruent samples yield a higher discrepancy with respect to the prototype neurons, thereby leading to a lower network activation. However, we also noticed some exceptions, e.g., the incongruent pair <talking on the phone, can> depicted in Fig. 7.c. In this case, we can observe that the network activation becomes higher for the incongruent input at a certain point of the sequence, i.e., at a certain action-object segment. Nevertheless, a decreased network activation on the congruent input indicates that the network has a high quantization error for that particular action-object segment. It should be noted that a small quantization error of the GWR network is not a requirement for a good performance in the action classification task. As described in Section 3.3, the classification of an action sequence is performed by considering the label histograms associated with the activated neurons. We can also notice some cases where the network activation on the incongruent input is not significantly low at the beginning of the sequence, but even slightly higher in the case of <eating, phone> (Fig. 7.b). A reason for this is the similar motion of the hand holding the object towards the head which may precede both eating and talking on the phone activities. Therefore, ex- frames per second. When the training of the whole architecture was complete, the number of neurons reached for an input containing ≈ 6500 video frames was: 170 neurons for the GWRb network, 182 for GWRo and for the GWRa network the number varied from 90 to 120 across different trials. A plot showing the neural weights of the GWRo network is depicted in Fig. 5. Given that the neural weights have a high dimensionality, i.e., the dimensionality of the VLAD descriptors, for illustration purposes we performed principal component analysis (PCA) and show the first two principal components. As it can be seen from the plot, the neurons are topologically organized into clusters composed of different 2D views of the objects as well as different instances of the same object category. This is quite advantageous for our architecture since it allows for generalization towards unseen object views and, to some extent, towards unseen object instances. The overlap between the can and mug clusters suggests that the visual appearance of these object categories is more similar than compared to the others and, as a consequence, can be confused. However, this does not affect the action classification performance, since both of the objects are involved in the same activity, namely drinking. We report precision, recall, and F1-score [60] for each class of activity, averaged over all six trials in Fig. 6. We obtained values equal to 100% when using the objects’ identity information and lower percentage values when using only body pose. As expected, the increase of the classification performance is more significant for those cases where the body pose introduces ambiguity, e.g., drinking, eating, talking on the phone. For the picking up activity, on the other hand, the difference in the classification performance is marginal due to the fact that this action can be performed on all of the objects and the identity of a specific object does not play a decisive role. 4.1.3. Experiments with incongruent action-object pairs In addition to the classification experiments, we carried out a qualitative evaluation of the integration module when given in input test data sequences of incongruent action-object pairs. We 8 Figure 7: Comparison of the GWRa network activations when having as input an action sequence combined with an incongruent object (in red) and one combined with the congruent one (in blue). The y axis represents the activation values, with 1 being the highest, and the x axis represents the number of frames of the illustrated data sequences. The number of frames can vary among different actions, e.g. the action eating is typically shorter than talking on the phone and drinking. Figure 8: Examples of high-level activities from CAD-120 dataset [24], ordered in each row: microwaving food, taking food, stacking objects, unstacking objects, arranging objects, picking objects, cleaning objects, taking medicine. changing the object biscuit box with phone for the initial action segments has from little to no impact on the network’s response. In Fig. 9, we show the confusion matrix for the 10 highlevel activities of this dataset. We inspected that the activities interchanged by our model were the ones including the same category of objects and similar body motions, e.g., stacking objects and unstacking objects, microwaving food and taking food. Also, the activity of picking objects was often confused with arranging objects, due to the fact that body pose segments of the first are similar to the ones preceding the activity of arranging objects. In Table 2, we show a comparison of our results with the state of the art on the CAD-120 dataset with accuracy, precision, and recall as evaluation metrics. We obtained 79% of accuracy, 80.5% of precision, and 78.5% of recall. We reported only the approaches that do not use groundtruth temporal segmentation of the activities into smaller atomic actions or sub-activities [61, 62]. Our results are comparable with Rybok et al. [63]. Similar to our work, their method considers objects’ appearance as contextual information which is then concatenated with body motion features represented as a bag of words. The best results were obtained by Koppula et al. [64], reporting 83.1% of accuracy, 87% of precision and 82.7% of recall. In their work, spatiotemporal dependencies between actions and objects are modelled by a Conditional Random Field (CRF) which combines and learns the relationship between a number of different features such as the coordinates of the object’s centroid, the total displacement and the total distance moved by the object’s centroid in each temporal segment, the difference in (x, y, z) coordinates of the object and skeleton joint locations and their distances. After the generation of the 4.2. Experiments with CAD-120 We evaluated the classification performance of our architecture on the publicly available benchmark dataset CAD-120 (Fig. 8). This dataset consists of 120 RGB-D videos of 10 long daily activities: arranging objects, cleaning objects, having meal, making cereal, microwaving food, picking objects, stacking objects, taking food, taking medicine and unstacking objects. These activities are performed by four different subjects (two males, two females and, of these four, one left-handed) repeating each action three to four times. Each video is annotated with the human skeleton tracks and the position of the manipulated objects across frames. We computed skeletal quad features (described in Section. 3.2) for the encoding of the pose of the upper body, based on the three-dimensional position of skeletal joints provided in the dataset. Additionally, we extracted RGB images of manipulated objects from each frame and encoded them through VLAD encoding technique as described in Section. 3.2. For the concatenation of the processed body pose cues, a time window of nine frames was chosen. Since we down-sample the activity video frames to a rate of 10 fps, this leads to an action-object segment having a temporal duration of 0.9 seconds. After training the whole architecture with an input data of ≈ 18.000 frames, the number of neurons reached in each GWR network was 460 for GWRb , 410 for GWRo , while for GWRa the number varied from ≈ 3200 to ≈ 3700 across different trials of the cross-validation. 9 samples. For the purpose of classification, we extended the GWR with a labeling technique based on majority vote. The evaluation of our approach has shown good results on a dataset of human-object interactions collected specifically for the study of the importance of the identity of objects. The analysis of the neural response of the integration layer showed an overall lower network activation when given incongruent action-object pairs compared to the congruent pairs. Furthermore, the classification accuracy of our unsupervised architecture on a publicly available action benchmark dataset is competitive with respect to the supervised state-of-the-art approaches. 5.2. Self-organizing neural learning and analogies with neuroscience Generative approaches based on self-organization learn input probability distribution through a finite set of reference vectors associated with neurons. Moreover, they resemble the topological relationships of the input space through the neurons’ organization. Growing self-organizing approaches such as the GNG [50] and the GWR networks [17] are characterized by a dynamic topological structure able to adapt toward the input data space through the mechanism of the competitive Hebbian learning [66]. Unlike the GNG, where the network grows at a constant rate, the GWR algorithm is equipped with a learning mechanism that creates new neurons whenever the current input is not well represented by the prototype neurons. We extended the GWR algorithm, which processes input data vectors in the spatial domain, to the processing of temporal data by the mechanism of the temporal sliding window [19]. The temporally ordered neural activations obtained through this technique resemble the motion pattern encodings through the snapshot neurons found in the STS area of the brain [10]. From the computational perspective, the sliding window technique allows for the extrapolation of spatiotemporal dependencies in the data sequences. The use of prototype-based representations for objects is motivated by psychological studies on the nature of human categorization [16]. According to the exemplar-based theory, categories of objects and concepts are typically learned as a set of prototypical examples and the similarity, or the socalled family resemblance, is used for class association. Finally, the use of the GWR for integrating information about action and objects produced a behavior resembling the action-selective neural circuits which show sensitivity to the congruence of the action being performed on an object [14]. Figure 9: Confusion matrix for the 10 high-level activities of CAD-120 dataset. Algorithm Koppula et al.[64], (CRF, SVM) Koppula et al.[24], (CRF, SVM) Our approach, (GWR) Rybok et al.[63], (SVM) Tayyub et al.[65], (SVM) U O. Rec. O. Tr. Acc. Prec. Rec. - - X 83.1 87.0 82.7 - - X 80.6 81.8 80.0 X X - 79.0 80.5 78.5 - X - 78.2 - - - - X 75.8 77.9 75.4 Table 2: Results on the CAD-120 dataset for the recognition of 10 high-level activities. Reported are accuracy, precision and recall (in percentage) averaged over 4-fold cross-validation experiments. For comparison, we have included which of the reported methods is unsupervised (U), performs object recognition for the classification of the activities (O.Rec.) or relies on object tracking (O.Tr.). graph which models spatiotemporal relations, they use a Support Vector Machine (SVM) for classifying action sequences. Unlike our work, they do not perform object classification but rely on manually annotated labels. We assume that the tracking of the objects’ position in the scene as well as the objects’ distance from the subject’s hand provides additional information that might improve our classification results and is considered part of our future work. 5.3. Future Work 5. Discussion In this work, we focused on a two-pathway hierarchy for learning human-object interactions represented as a combination of upper body pose configurations and objects’ category labels. However, in order to reduce the computational complexity of the architecture, we have excluded an important component: the motion information. Results from other approaches on recognition of human-object interactions and on the learning of object affordances [38, 24] have shown that tracking the object’s position and spatial relationship with respect to the body can help for a better interpretation of this type of interaction. 5.1. Summary In this paper, we presented a self-organizing neural network architecture that learns to recognize actions comprising human-object interaction from RGB-D videos. Our architecture consists of two pathways of GWR networks processing respectively body pose and object appearance and identity, with a subsequent integration layer learning action-object mappings. The prototype-based learning mechanism of the GWR allows to attenuate input noise and to generalize towards unseen data 10 There is evidence from neuroscience that the observation of using a tool activates areas of the lateral temporal cortex in the human brain which is engaged in perceiving and storing information about motion [5]. Neural mechanisms for the processing of human body motion are also believed to contribute to action discrimination in general [10]. Therefore, a possible next step is to extend our model by including motion information. An additional future work direction is the introduction of recurrent connections in the GWR networks for the purpose of temporal sequence processing. Recurrence in self-organizing networks has been extensively investigated and applied to temporal data classification [52, 67]. In the current implementation, temporal dependencies are encoded and learned by hard assignments to time windows. However, the concatenation of perceptual feature vectors may lead to very high-dimensional spaces, whereby methods based on a Euclidean distance metric are known to perform worse [51]. In our current work, we used depth information for the efficient extraction of a three-dimensional skeleton model. However, when dealing with more complex activities such as humanobject interactions, this type of depth representation may be subject to a number of issues such as a highly noisy skeleton due to body self-occlusions when manipulating an object. Therefore, future work will address the limitations of this handcrafted feature extraction with a neural architecture able to extract visual features from raw images, e.g., with the use of deep neural network self-organization [67]. Finally, the results reported in this paper motivate future work towards the integration of our learning system into a robotic platform and its evaluation in real-world scenarios such as learning by imitation tasks or human-robot assistance in natural environments. Acknowledgments The authors gratefully acknowledge partial support by the EU- and City of Hamburg-funded program Pro-Exzellenzia 4.0, the German Research Foundation DFG under project CML (TRR 169), and the Hamburg Landesforschungsförderungsprojekt. References References [1] F. Fleischer, V. Caggiano, P. Thier, M. A. Giese, Physiologically inspired model for the visual recognition of transitive hand actions, The Journal of Neuroscience 33 (15) (2013) 6563–6580. doi:10.1523/JNEUROSCI. 4129-12.2013. [2] K. Nelissen, W. Vanduffel, G. A. Orban, Charting the lower superior temporal region, a new motion-sensitive region in monkey superior temporal sulcus, The Journal of Neuroscience 26 (22) (2006) 5929–5947. doi:10.1523/JNEUROSCI.0824-06.2006. [3] R. Prevete, G. Tessitore, M. Santoro, E. Catanzariti, A connectionist architecture for view-independent grip-aperture computation, Brain Research 1225 (2008) 133–145. doi:10.1016/j.brainres.2008.04. 076. [4] G. Tessitore, R. Prevete, E. Catanzariti, G. Tamburrini, From motor to sensory processing in mirror neuron computational modelling, Biological Cybernetics 103 (6) (2010) 471–485. doi:10.1007/ s00422-010-0415-5. 11 [5] M. S. Beauchamp, K. E. Lee, J. V. Haxby, A. Martin, Parallel visual motion processing streams for manipulable objects and human movements, Neuron 34 (1) (2002) 149–159. doi:10.1016/S0896-6273(02) 00642-6. [6] P. E. Downing, M. V. Peelen, The role of occipitotemporal body-selective regions in person perception, Cognitive Neuroscience 2 (3-4) (2011) 186– 203. doi:10.1080/17588928.2011.582945. [7] K. Grill-Spector, Representation of objects, The Oxford Handbook of Cognitive Neuroscience, Volume 2: The Cutting Edges 2. [8] D. H. Hubel, T. Wiesel, Receptive fields, binocular interaction and functional architecture in the cat’s visual cortex, The Journal of Physiology 160 (1) (1962) 106–154. [9] E. D. Grossman, R. Blake, Brain areas active during visual perception of biological motion, Neuron 35 (6) (2002) 1167–1175. doi:10.1016/ S0896-6273(02)00897-8. [10] M. A. Giese, T. Poggio, Neural mechanisms for the recognition of biological movements, Nature Reviews Neuroscience 4 (3) (2003) 179–192. doi:10.1038/nrn1057. [11] R. Saxe, S. Carey, N. Kanwisher, Understanding other minds: linking developmental psychology and functional neuroimaging, Annual Review of Psychology 55 (2004) 87–124. doi:10.1146/annurev.psych.55. 090902.142044. [12] V. Gallese, L. Fadiga, L. Fogassi, G. Rizzolatti, Action recognition in the premotor cortex, Brain 119 (2) (1996) 593–609. doi:10.1093/brain/ 119.2.593. [13] K. Nelissen, G. Luppino, W. Vanduffel, G. Rizzolatti, G. A. Orban, Observing others: multiple action representation in the frontal lobe, Science 310 (5746) (2005) 332–336. doi:10.1126/science.1115593. [14] E. Y. Yoon, G. W. Humphreys, S. Kumar, P. Rotshtein, The neural selection and integration of actions and objects: an fMRI study, Journal of Cognitive Neuroscience 24 (11) (2012) 2268–2279. doi:10.1162/ jocn_a_00256. [15] R. Miikkulainen, J. A. Bednar, Y. Choe, J. Sirosh, Computational maps in the visual cortex, Springer Science & Business Media, 2006. [16] E. Rosch, C. B. Mervis, Family resemblances: Studies in the internal structure of categories, Cognitive Psychology 7 (4) (1975) 573–605. doi: 10.1016/0010-0285(75)90024-9. [17] S. Marsland, J. Shapiro, U. Nehmzow, A self-organising network that grows when required, Neural Networks 15 (8) (2002) 1041–1058. doi: 10.1016/S0893-6080(02)00078-3. [18] G. I. Parisi, C. Weber, S. Wermter, Self-organizing neural integration of pose-motion features for human action recognition, Frontiers in Neurorobotics 9. doi:10.3389/fnbot.2015.00003. [19] G. I. Parisi, C. Weber, S. Wermter, Human action recognition with hierarchical growing neural gas learning, in: International Conference on Artificial Neural Networks (ICANN), Springer, 2014, pp. 89–96. doi: 10.1007/978-3-319-11179-7_12. [20] G. S. Donatti, O. Lomp, R. P. Würtz, Evolutionary optimization of growing neural gas parameters for object categorization and recognition, in: International Joint Conference on Neural Networks (IJCNN), IEEE, 2010, pp. 1–8. doi:10.1109/IJCNN.2010.5596682. [21] L. Mici, G. I. Parisi, S. Wermter, Recognition of transitive actions with hierarchical neural network learning, in: Artificial Neural Networks and Machine Learning (ICANN), Springer International Publishing, 2016, pp. 472–479. doi:10.1007/978-3-319-44781-0_56. [22] T. Kohonen, Essentials of the self-organizing map, Neural Networks 37 (2013) 52–65. doi:10.1016/j.neunet.2012.09.018. [23] B. Fritzke, Kohonen feature maps and growing cell structures-a performance comparison, in: Advances in Neural Information Processing Systems 5 (NIPS), Morgan Kaufmann, 1993, pp. 123–130. [24] H. S. Koppula, R. Gupta, A. Saxena, Learning human activities and object affordances from RGB-D videos, The International Journal of Robotics Research 32 (8) (2013) 951–970. doi:10.1177/0278364913478446. [25] J. K. Aggarwal, M. S. Ryoo, Human activity analysis: A review, ACM Computing Surveys (CSUR) 43 (3). doi:10.1145/1922649.1922653. [26] M. Ziaeefard, R. Bergevin, Semantic human activity recognition: A literature review, Pattern Recognition 48 (8) (2015) 2329–2345. doi: 10.1016/j.patcog.2015.03.006. [27] J. K. Aggarwal, L. Xia, Human activity recognition from 3D data: A review, Pattern Recognition Letters 48 (2014) 70–80. doi:10.1016/j. patrec.2014.04.011. [28] E. Cippitelli, S. Gasparrini, E. Gambi, S. Spinsante, A human activity recognition system using skeleton data from RGBD sensors, Computational Intelligence and Neuroscience 2016. doi:10.1155/2016/ 4351435. [29] X. Yang, Y. Tian, Effective 3d action recognition using eigenjoints, Journal of Visual Communication and Image Representation 25 (1) (2014) 2–11. doi:10.1016/j.jvcir.2013.03.001. [30] J. Sung, C. Ponce, B. Selman, A. Saxena, Unstructured human activity detection from RGBD images, in: International Conference on Robotics and Automation (ICRA), IEEE, 2012, pp. 842–849. doi:10.1109/ICRA. 2012.6224591. [31] J. Wu, A. Osuntogun, T. Choudhury, M. Philipose, J. M. Rehg, A scalable approach to activity recognition based on object use, in: International Conference on Computer Vision (ICCV), IEEE, 2007, pp. 1–8. [32] Y. Yang, Y. Li, C. Fermüller, Y. Aloimonos, Robot learning manipulation action plans by “watching” unconstrained videos from the world wide web, in: Association for the Advancement of Artificial Intelligence (AAAI), 2015, pp. 3686–3693. [33] A. Pieropan, G. Salvi, K. Pauwels, H. Kjellström, Audio-visual classification and detection of human manipulation actions, in: IEEE International Conference On Intelligent Robots and Systems (IROS), IEEE, 2014, pp. 3045–3052. [34] A. Gupta, L. S. Davis, Objects in action: An approach for combining action understanding and object perception, in: Computer Vision and Pattern Recognition (CVPR), IEEE, 2007, pp. 1–8. doi:10.1109/CVPR. 2007.383331. [35] A. Gupta, A. Kembhavi, L. S. Davis, Observing human-object interactions: Using spatial and functional compatibility for recognition, IEEE Transactions on Pattern Analysis and Machine Intelligence 31 (10) (2009) 1775–1789. doi:10.1109/TPAMI.2009.83. [36] M. S. Ryoo, J. Aggarwal, Hierarchical recognition of human activities interacting with objects, in: Computer Vision and Pattern Recognition (CVPR), IEEE, 2007, pp. 1–8. doi:10.1109/CVPR.2007.383487. [37] B. Yao, L. Fei-Fei, Recognizing human-object interactions in still images by modeling the mutual context of objects and human poses, IEEE Transactions on Pattern Analysis and Machine Intelligence 34 (9) (2012) 1691–1703. doi:10.1109/TPAMI.2012.67. [38] H. Kjellström, J. Romero, D. Kragić, Visual object-action recognition: Inferring object affordances from human demonstration, Computer Vision and Image Understanding 115 (1) (2011) 81–90. doi:10.1016/j. cviu.2010.08.002. [39] B. Yao, L. Fei-Fei, Grouplet: A structured image representation for recognizing human and object interactions, in: Computer Vision and Pattern Recognition (CVPR), IEEE, 2010, pp. 9–16. doi:10.1109/CVPR. 2010.5540234. [40] D. G. Lowe, Distinctive image features from scale-invariant keypoints, International Journal of Computer Vision 60 (2) (2004) 91–110. doi: 10.1023/B:VISI.0000029664.99615.94. [41] E. E. Aksoy, A. Abramov, J. Dörr, K. Ning, B. Dellen, F. Wörgötter, Learning the semantics of object–action relations by observation, The International Journal of Robotics Research (2011) 1229–1249doi:10. 1177/0278364911410459. [42] M. Shimozaki, Y. Kuniyoshi, Integration of spatial and temporal contexts for action recognition by self organizing neural networks, in: IEEE International Conference On Intelligent Robots and Systems (IROS), Vol. 3, IEEE, 2003, pp. 2385–2391. [43] C. Lea, A. Reiter, R. Vidal, G. D. Hager, Segmental spatiotemporal cnns for fine-grained action segmentation, in: European Conference on Computer Vision (ECCV), Springer, 2016, pp. 36–52. [44] C.-Y. Ma, A. Kadav, I. Melvin, Z. Kira, G. AlRegib, H. P. Graf, Attend and Interact: Higher-Order Object Interactions for Video Understanding, ArXiv preprint arXiv:1711.06330arXiv:1711.06330. [45] J. Han, L. Shao, D. Xu, J. Shotton, Enhanced computer vision with microsoft kinect sensor: A review, IEEE Transactions on Cybernetics 43 (5) (2013) 1318–1334. doi:10.1109/TCYB.2013.2265378. [46] J. Wang, Z. Liu, Y. Wu, Learning actionlet ensemble for 3D human action recognition, in: Human Action Recognition with Depth Cameras, Springer International Publishing, 2014, pp. 11–40. doi:10.1109/ TPAMI.2013.198. [47] T. Poggio, S. Edelman, A network that learns to recognize threedimensional objects, Nature 343 (6255) (1990) 263–266. doi:10.1038/ 343263a0. [48] D. Perrett, View-dependent coding in the ventral stream and its consequences for recognition, Vision and Movement Mechanisms in the Cerebral Cortex (1996) 142–51. [49] T. Martinetz, K. Schulten, A “neural-gas” network learns topologies, in: Artificial Neural Networks, Elsevier Science Publisher B.V., 1991, pp. 397–402. [50] B. Fritzke, A growing neural gas network learns topologies, Advances in Neural Information Processing Systems 7 (1995) 625–632. [51] C. C. Aggarwal, A. Hinneburg, D. A. Keim, On the surprising behavior of distance metrics in high dimensional space, in: International Conference on Database Theory (ICDT), Springer, 2001, pp. 420–434. doi:10.1007/3-540-44503-X_27. [52] M. Strickert, B. Hammer, Merge som for temporal data, Neurocomputing 64 (2005) 39–71. doi:10.1016/j.neucom.2004.11.014. [53] G. Evangelidis, G. Singh, R. Horaud, Skeletal quads: Human action recognition using joint quadruples, in: International Conference on Pattern Recognition (ICPR), 2014, pp. 4513–4518. doi:10.1109/ICPR. 2014.772. [54] T. Vatanen, M. Osmala, T. Raiko, K. Lagus, M. Sysi-Aho, M. Orešič, T. Honkela, H. Lähdesmäki, Self-organization and missing values in som and gtm, Neurocomputing 147 (2015) 60–70. [55] T. Tuytelaars, C. H. Lampert, M. B. Blaschko, W. Buntine, Unsupervised object discovery: A comparison, International Journal of Computer Vision 88 (2) (2010) 284–302. doi:10.1007/s11263-009-0271-8. [56] T. Kinnunen, J.-K. Kamarainen, L. Lensu, H. Kälviäinen, Unsupervised object discovery via self-organisation, Pattern Recognition Letters 33 (16) (2012) 2102–2112. doi:10.1016/j.patrec.2012.07.013. [57] H. Jegou, F. Perronnin, M. Douze, J. Sánchez, P. Perez, C. Schmid, Aggregating local image descriptors into compact codes, IEEE Transactions on Pattern Analysis and Machine Intelligence 34 (9) (2012) 1704–1716. doi:10.1109/TPAMI.2011.235. [58] M. Everingham, L. Van Gool, C. K. Williams, J. Winn, A. Zisserman, The pascal visual object classes (VOC) challenge, International Journal of Computer Vision 88 (2) (2010) 303–338. doi:10.1007/ s11263-009-0275-4. [59] R. Szeliski, Computer vision: Algorithms and applications, Springer Science & Business Media, 2010. [60] M. Sokolova, G. Lapalme, A systematic analysis of performance measures for classification tasks, Information Processing & Management 45 (4) (2009) 427–437. doi:10.1016/j.ipm.2009.03.002. [61] N. Hu, G. Englebienne, Z. Lou, B. Kröse, Learning latent structure for activity recognition, in: Robotics and Automation (ICRA), 2014 IEEE International Conference on, IEEE, 2014, pp. 1048–1053. [62] A. Taha, H. H. Zayed, M. Khalifa, E.-S. M. El-Horbaty, Skeleton-based human activity recognition for video surveillance, International Journal of Scientific & Engineering Research 6 (1) (2015) 993–1004. [63] L. Rybok, B. Schauerte, Z. Al-Halah, R. Stiefelhagen, “Important stuff, everywhere!” Activity recognition with salient proto-objects as context, in: Winter Conference on Applications of Computer Vision (WACV), IEEE, 2014, pp. 646–651. doi:10.1109/WACV.2014.6836041. [64] H. S. Koppula, A. Saxena, Learning spatio-temporal structure from RGBD videos for human activity detection and anticipation., in: International Conference on Machine Learning (ICML), 2013, pp. 792–800. [65] A. Tayyub, JawadTavanai, Y. Gatsoulis, A. G. Cohn, D. C. Hogg, Qualitative and quantitative spatio-temporal relations in daily living activity recognition, in: Computer Vision – ACCV 2014, Springer International Publishing, Cham, 2015, pp. 115–130. [66] T. Martinetz, Competitive hebbian learning rule forms perfectly topology preserving maps, in: International Conference on Artificial Nerual networks (ICANN), Springer, 1993, pp. 427–434. doi:10.1007/ 978-1-4471-2063-6_104. [67] G. I. Parisi, J. Tani, C. Weber, S. Wermter, Lifelong learning of human actions with deep neural network self-organization, Neural Networks 96 (2017) 137–149. 12
9cs.NE
arXiv:1803.09369v1 [cs.SY] 20 Mar 2018 Towards a Cybernetic Foundation for Natural Resource Governance A Thesis Presented to the Academic Faculty by Talha Manzoor In Partial Fullfilment of the Requirements for the Degree of Doctor of Philosophy in Electrical Engineering Supervisor: Abubakr Muhammad (LUMS) Co-supervisor: Elena Rovenskaya (IIASA) Syed Babar Ali School of Science and Engineering Lahore University of Management Sciences December 2017 © 2017 by Talha Manzoor To Marwa and her never-ending quest for adventure. Abstract This study explores the potential of the cybernetic method of inquiry for the problem of natural resource governance. The systems way of thinking has already enabled scientists to gain considerable headway in framing global environmental challenges. On the other hand, technical solutions to environmental problems have begun to show significant promise, driven by the advent of technology and its increased proliferation in coupled human and natural systems. Such settings lie on the interface of engineering, social and environmental sciences, and as such, require a common language in order for natural resources to be studied, managed and ultimately sustained. In this dissertation, we argue that the systems theoretic tradition of cybernetics may provide the necessary common ground for examining such systems. After discussing the relevance of the cybernetic approach to natural resource governance, we present a mathematical model of resource consumption, grounded in social psychological research on consumer behavior. We also provide interpretations of the model at various levels of abstraction in the social network of the consuming population. We demonstrate the potential of the model by examining it in various theoretic frameworks which include dynamical systems, optimal control theory, game theory and the theory of learning in games. Each framework yields different policy guidelines to avoid Tragedy of the Commons like scenarios in the natural resource system. Mainly, we find that a high importance attached to social information (rather than ecological information) on part of the consumers helps overcome free-riding behavior and achieves affluence in both the resource stock and consumption levels. Moreover, we observe that discounting future utility beyond a specific threshold results in unsustainable consumption patterns according to a pre-defined notion of sustainability. We study the optimal control law for both sustainable and unsustainable cases, and give a rigorous criterion for sustainable growth. Later we examine the long-term effects of rational behavior on the part of the consumers and compare it with the collectively optimal outcome via a non-cooperative game and see how different societal attributes effect the “tragicness” of the game. We show that the adoption of a basic fictitious play learning scheme by the consumers results in the equilibrium solution in a way that avoids free-riding behavior. All aspects of the analysis are conducted with one single question in mind – what are the favorable conditions for sustainability? Preface My first exposure to environmental problems began in the summer of 2013 when I participated in the Young Scientists Summer Program at the International Institute for Applied Systems Analysis (IIASA) in Laxenburg, Austria. I had just been admitted in the PhD program of Electrical Engineering at the Lahore University of Management Sciences (LUMS), which was set to begin in the fall of 2013. As a typical graduate student just beginning a PhD, I was still going back and forth over ideas for my doctorate and the work I started at IIASA four years ago resulted in this dissertation. The systems way of thinking made me realize how the proper level of abstraction can reveal similarities between problems originating from completely different disciplines. How scientific methods and tools developed by scientists of a particular field could be used by those working in completely different areas. It is exactly the reason how a mechatronics engineer with a strict background in robotics ended up writing a thesis in natural resource governance, something that many of my colleagues have found to be peculiar to say the least. To them, I say that when viewed through the lens of systems theory, robotics (and all engineering disciplines for that matter) and resource governance do not turn out to be as disparate as they may appear at first. I must admit here that my initial comprehension of systems analysis was little more than just a buzzword that is always fascinating and politically correct. Writing this dissertation has given me an opportunity to understand better what systems thinking really is, and made me appreciate the role of a unified articulation for systems independent of their discipline of origin. Such a thing is necessary for the engineers as they have begun to encounter more and more human-centric applications of their technologies. The perspective with which they are accustomed to study their machines has deep philosophical roots which cover not only man-made but also naturally occurring systems and even living organisms. Such is the v language of cybernetics, a distinct tradition of systems theory that has sadly disappeared from the forefront of the engineering community, hidden behind its descendants of control and communication. Even while we are introduced to the basic concepts of feedback and control, our vision is so narrow that we do not realize that the underlying philosophy of the field is so rich. For me this was mind boggling. In contrast however, to quote my advisor Abubakr Muhammad – It doesn’t surprise me one bit that a mechatronics engineer finally discovers his machinistic origins of thinking in a different topic. In this dissertation I argue that the cybernetic way of thinking may provide the common language that the engineering community requires to study the intricate couplings between society, technology and the environment. Indeed, as I explain, small factions within the engineering community are already doing this without explicitly referring to the term cybernetics in its original form. It is my hope that this dissertation may serve as a spring board to further propagate this view and to guide future work in this area. List of Contributions Below is a list of the salient contributions of this thesis. Where applicable, the contributions are linked in parenthesis to the publications list of the following section. • A unique discourse on the relevance of cybernetics to natural resources. • A psychologically justified mathematical model of human behavior in resource consumption (Paper 2). • An aggregation mechanism to lump communities in the social network to ease tractability of the model (Paper 4). • A mathematical criterion of sustainability (Papers 3 & 6). • The application of Pontryagin’s Maximum Principle to an optimal control problem with unbounded control and non-concave Hamiltonian (Papers 3, 5 & 6). • A notion of “tragedy” in a non-cooperative game describing the Commons dilemma in our resource consumption model (Paper 2). • Some results illustrating the dependence of “tragicness” on various societal parameters and guidelines on how to reduce it (Paper 2). vi • A demonstration of the relevance of the rational outcome for the commons game via application of the theory of learning in games (Paper 1). • Various results describing the emergence of free-riding behavior and the role of different societal attributes in discouraging such behavior (Papers 1 & 2). • A Lyapunov function based proof for the asymptotic global stability of the model, which may also help in determining stability for a class of related systems (Paper 1). Publications Below is a list of publications that have resulted directly from the research described in this thesis. The chapters from the dissertation that include the material from each publication have also been given in the parenthesis. Journal articles Paper 1 (Chapters 6 & 9) Talha Manzoor, Elena Rovenskaya, Alexey Davydov, Abubakr Muhammad, “Learning through Fictitious Play in a Game-theoretic Model of Natural Resource Consumption”, IEEE Control Systems Letters, vol. 2, pp. 163-168, Jan 2018. Paper 2 (Chapters 4, 6 & 8) Talha Manzoor, Elena Rovenskaya, Abubakr Muhammad, “Game-theoretic insights into the role of environmentalism and social-ecological relevance: A cognitive model of resource consumption”, Ecological Modelling, vol. 340, pp. 74-85, Nov 2016. Book chapters Paper 3 (Chapters 7 & 9) Sergey Aseev, Talha Manzoor, “Optimal Exploitation of Renewable Resources: Lessons in Sustainability from an Optimal Growth Model of Natural Resource Consumption”, Lecture Notes in Economics and Mathematical Systems, Springer (in press). vii Conference proceedings Paper 4 (Chapter 5) Talha Manzoor, Elena Rovenskaya, Abubakr Muhammad, “Structural Effects and Aggregation in a Social-Network Model of Natural Resource Consumption”, 20th World Congress of the International Federation of Automatic Control (IFAC), Toulouse, France, Jul 2017. Paper 5 (Chapter 7) Talha Manzoor, Sergey Aseev, Elena Rovenskaya, Abubakr Muhammad, “Optimal Control for Sustainable Consumption of Natural Resources”, 19th World Congress of the International Federation of Automatic Control (IFAC), Cape Town, South Africa, Aug 2014. Working papers Paper 6 (Chapters 7 & 9) Sergey Aseev, Talha Manzoor, “Optimal Growth, Renewable Resources and Sustainability”, IIASA Working Paper WP-16-017, IIASA, Laxenburg, Austria, Dec 2016. viii Acknowledgments During the course of my academic career, I have been blessed with many great teachers. The work presented herein, is a result of their guidance, perseverance and patience towards me, and my many flaws as a student. Foremost on this long list is my advisor Abubakr Muhammad who took me under his wing when I was a young graduate and provided the environment that was necessary for me to conduct my research. I am thankful to him for allowing me flexibility in my work, and insulating me from many, many hindrances (both financial and logistical) that could otherwise have proven detrimental to my focus as a graduate student. I view this dissertation purely as the outcome of his own intellectual capability and his capacity as an outstanding advisor. Next I wish to thank my co-advisor Elena Rovenskaya whose supervision has been instrumental especially during the foundational stage of my doctoral research. I stumbled into the 2013 YSSP program under her supervision at IIASA with only a minute idea of what I wanted to do in my PhD. She contributed in establishing a direction for the research and also helped me in navigating across a multitude of academic disciplines that were well beyond my comfort zone. I am also grateful to Sergey Aseev who led the research on optimal growth that eventually formed a vital part of this dissertation. This would not have been possible without his extensive technical expertise and also his patience with my lack of experience in the area. I also want to thank Alexey Davydov for providing the proof on stability of our model that we had struggled with unsuccessfully for months on our own. I am thankful to Momin Uppal and Naveed Ul Hassan for their guidance as part of my PhD committee and informal advice at numerous occasions. Also to Tariq Samad, Magnus Egerstedt and Andries Richter for sparing time from their busy schedules to review an initial draft of the dissertation and also for providing their constructive feedback and criticism. ix The Electrical Engineering Department at LUMS provided the infrastructure and support that was necessary to facilitate me in my work. I am thankful to Ijaz Naqvi, the Chair of the Graduate Program Committee who supported me in all the logistics and paperwork especially during my final phase as a graduate student; to Tariq Jadoon who provided all necessary support (both within and beyond his job description) as Chair of the Department; to Soban Hameed and his tedious hours of administrative assistance. I also want to give a special mention to the LUMS library and its staff that has helped me greatly during my studies and still continues to surprise me with the diversity and range of its excellent collection. During my stay at LUMS, I have enjoyed the company of many great colleagues and strong friends. I wish to thank all members of the CYPHYNETS lab for making this time memorable: Syed Muhammad Abbas, Mudassir Khan, Zahoor Ahmad, Atif Adnan, Hasan Arshad, Bilal Talat, Zeeshan Shareef, Faiz Alam, Adnan Munawar, Zubair Ahmed, Sajjad Haider, Ansir Ilyas, Waqas Riaz, Bilal Haider, Hamza Jan, Ali Ahmed, Saad Hassan, Muhammad Abdullah and Allah Bakhsh (for those whose name I have failed to mention, please accept my humble apology). As my advisor says, a PhD is a joint effort on part of the student and his family. In my case, I would say that the role of my family far exceeds that of my own. I first want to reach out to my father, Manzoor Hussain, who not only allowed me to pursue a career of my own choosing, but also supported me through all hardships and difficulties that I faced. I am rarely able to express how thankful I am to him for providing me a life full of comfort and void of any liabilities. His support has enabled me to maintain focus on my work and to enjoy my personal life to the fullest, a luxury seldom available to a doctoral candidate supporting a wife and child along with his research. I wish to mention my late grandfather, Chaudhry Rehmat Ali who I am sure would have been extremely proud at this moment. Also my grandmother, Ramzan Bibi whose constant prayers and relentless concern have motivated me greatly throughout my studies. I want to thank my sister, Bazla Manzoor, for supplying a lifetime of joy and memories as a wonderful sibling. Even as I am here in Lahore, she takes care of our mother to the best of her ability as a married woman with a promising professional career. This has been a source of great content and consolation for me during the recent years of my studies. For my mother, Naheed Manzoor, no measure of text would be sufficient to contain the x ocean of praise that she deserves from me. Even so, I am at a total loss of words to express my gratitude towards her, for nurturing a young soul into the grown man typing in these words right now. To her I can only say Thank you mother, for everything. In the end I wish to acknowledge my wife, Mehwish Pervaiz for providing me the comfort of a clean house, ironed clothes, warm meals, and most importantly, a loving family. Our daughter was born while my PhD was undergoing an extremely critical phase. I could not be more thankful to Mehwish for taking care of her all through the tedious household responsibilities and for her moral and emotional support during the difficult times of my studies. To happily endure the long hours I had to work in the lab, weekends I could not spend at home and the uncertainty of my finances. I am truly grateful to her, and hope I can make it worth her while, as we move ahead to the next chapter of our lives together. Talha Manzoor, LUMS, 2017. xi Contents Abstract iv Preface v Acknowledgments Part I ix Foundations and Background 1 1 Lessons in Natural Resource Governance 2 1.1 Respecting the Limits of our Habitat . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Inability to Act: The Tragedy of the Commons . . . . . . . . . . . . . . . . 6 1.2.1 Other Models of Inevitable Doom . . . . . . . . . . . . . . . . . . . . 8 1.2.2 Open-access: The Nature of “Tragic” Resources . . . . . . . . . . . . 10 1.2.3 Privatization and State Regulation: The Only Solutions? . . . . . . 12 Cooperative Solutions to the Commons Dilemma . . . . . . . . . . . . . . . 12 1.3 2 Eyeing CPRs through the Systems Lens 16 2.1 The Concept of a System . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.2 Analysis and Synthesis: The Fundamental Ingredients of Scientific Inquiry . 17 2.3 Systems Analysis: Tackling Complex Systems with an Integrative Perspective 20 2.4 Systems Analysis and Coupled Human Natural Systems . . . . . . . . . . . 3 From Control of Machines to Cybernetics of Resources 21 27 3.1 Technical Advancement and the Environment . . . . . . . . . . . . . . . . . 28 3.2 Cybernetics and Concepts Defining Feedback Control . . . . . . . . . . . . 30 3.3 Human-in-the-loop Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.3.1 34 Cyber-Physical Systems and the Internet of Things . . . . . . . . . . xii 3.3.2 Cyber Physical Social Systems: Addressing the social component in CPSs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 The Imperative to Understand Human Behavior . . . . . . . . . . . 36 The Cybernetics of Natural Resource Systems . . . . . . . . . . . . . . . . . 37 3.4.1 Imagineering the Cybernetic Picture . . . . . . . . . . . . . . . . . . 38 Cybernetics and Society: A Word of Caution . . . . . . . . . . . . . . . . . 42 3.3.3 3.4 3.5 Part II Modeling the Dynamics of Resource Based Systems 44 4 A Psychologically Relevant Mathematical Model of Consumer Behavior 45 4.1 Modeling Paradigms in Socio-ecological Systems . . . . . . . . . . . . . . . 45 4.2 The Mathematical Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.2.1 The Ecological Sub-model . . . . . . . . . . . . . . . . . . . . . . . . 49 4.2.2 The Social Sub-model . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.2.3 The Coupled Socio-ecological System . . . . . . . . . . . . . . . . . . 53 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 4.3 5 Exploiting Community Structure to Create Block-models of Resource Consumption 55 5.1 Obtaining Simplified Models of Aggregate Consumption . . . . . . . . . . . 56 5.1.1 Influence and Leadership in the Consumer Network . . . . . . . . . 58 5.1.2 The Canonical Networks . . . . . . . . . . . . . . . . . . . . . . . . . 59 5.1.3 Bonding and Bridging in the Symmetric Semi- 5.2 5.3 homogeneous Network . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Aggregation Mechanisms for Non-Canonical Consumer Networks . . . . . . 67 5.2.1 An Aggregation Mechanism for Self-directed Networks . . . . . . . . 67 5.2.2 Aggregation for Self-directed Populations with Unknown Characteristics . . . . . . . . . . . . . . . . . . . . . . . . 68 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Part III Cybernetic Insights, Applications and Extensions 6 Understanding Open-loop System Behavior xiii 71 72 6.1 6.2 6.3 The Single-Agent/Homogeneous Network . . . . . . . . . . . . . . . . . . . 72 6.1.1 Fixed-point Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 6.1.2 Local Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 6.1.3 Global Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 The Dual-Agent/Semi-Homogeneous Network . . . . . . . . . . . . . . . . . 77 6.2.1 Fixed-point Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 6.2.2 Local Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 6.2.3 Global Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 7 Optimal Consumption for a Homogeneous Society 90 7.1 Considerations for Studying Optimal Behavior . . . . . . . . . . . . . . . . 90 7.2 Formulating the Consumption Problem in an Optimal Control Setting . . . 92 7.2.1 The Optimal Control Problem . . . . . . . . . . . . . . . . . . . . . 93 7.2.2 Establishing the Notion of Optimality . . . . . . . . . . . . . . . . . 94 7.3 Reduction to a Problem with Linear Dynamics . . . . . . . . . . . . . . . . 97 7.4 Existence of an Optimal Control and the Maximum Principle . . . . . . . . 99 7.4.1 Proving the Existence of an Optimal Pair . . . . . . . . . . . . . . . 99 7.4.2 Application of the Maximum Principle . . . . . . . . . . . . . . . . . 104 7.4.3 The Hamiltonian System . . . . . . . . . . . . . . . . . . . . . . . . 105 Analysis of the Hamiltonian system . . . . . . . . . . . . . . . . . . . . . . . 106 7.5.1 The Sustainable Case . . . . . . . . . . . . . . . . . . . . . . . . . . 107 7.5.2 The Unsustainable Case . . . . . . . . . . . . . . . . . . . . . . . . . 110 Discussion: A Generalized Notion of Sustainability . . . . . . . . . . . . . . 114 7.5 7.6 8 Strategic Interactions in the Game-theoretic Framework 8.1 8.2 117 The Continuous Consumption Game . . . . . . . . . . . . . . . . . . . . . . 118 8.1.1 Deriving the Nash Equilibrium . . . . . . . . . . . . . . . . . . . . . 118 8.1.2 Collective Optimality and the Notion of Tragicness . . . . . . . . . . 120 8.1.3 The Consumption Game and Social-Ecological Relevance . . . . . . 122 The Discrete Consumption Game . . . . . . . . . . . . . . . . . . . . . . . . 125 8.2.1 Tragic and non-tragic games . . . . . . . . . . . . . . . . . . . . . . 126 8.2.2 The Influence of Social Attributes on the Game Nature . . . . . . . 126 xiv 8.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Closing the Feedback Loop 130 132 9.1 The Optimal Feedback Law . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 9.2 Learning and Adaptation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 9.2.1 Best-response Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . 138 9.2.2 Convergence to the Nash Equilibrium . . . . . . . . . . . . . . . . . 140 9.2.3 Overcoming Free-riding Behavior . . . . . . . . . . . . . . . . . . . . 141 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 9.3 10 Moving Towards Generically Structured Networks 144 10.1 Static Characteristics for Structured Networks . . . . . . . . . . . . . . . . 144 10.1.1 Well-mixed population . . . . . . . . . . . . . . . . . . . . . . . . . . 144 10.1.2 Star population . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 10.2 System Dynamics and the Role of the Laplacian . . . . . . . . . . . . . . . 155 11 Epilogue 158 11.1 Revisiting the Cybernetic Picture . . . . . . . . . . . . . . . . . . . . . . . . 158 11.2 Summary of Main Findings . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 11.3 Open Problems and Future Avenues . . . . . . . . . . . . . . . . . . . . . . 163 11.3.1 A Rigorous Definition of Sustainability . . . . . . . . . . . . . . . . . 163 11.3.2 Formulating Social Variables in the Context of Feedback Control . . 164 11.3.3 The Issues of Controllability and Observability . . . . . . . . . . . . 165 11.4 Final Remark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 Bibliography 180 A Game Theory Primer 181 A.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 A.2 Dominant Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 A.3 Best Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 A.4 Nash Equilibrium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 A.5 Games with Continuous Strategies: The Cournot Game . . . . . . . . . . . 183 xv B Basic Concepts in Economic Growth Theory 185 B.1 Early Developments in Growth Theory . . . . . . . . . . . . . . . . . . . . . 185 B.2 A Compilation of Fundamental Notions . . . . . . . . . . . . . . . . . . . . 186 B.2.1 The production function and returns to scale . . . . . . . . . . . . . 186 B.2.2 The production function and technological progress . . . . . . . . . . 186 B.2.3 A Note on Cobb-Douglass production functions . . . . . . . . . . . . 186 B.2.4 Continuity, differentiability, positive and diminishing marginal products, and constant returns to scale . . . . . . . . . . . . . . . . . . . 187 B.2.5 The Inada conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 B.2.6 Some formal examples of social welfare functions . . . . . . . . . . . 187 B.2.7 The Brundtland Commission and sustainability . . . . . . . . . . . . 188 C Network topology and spectrum of the Laplacian matrix 189 Vita 191 xvi List of Figures 1-1 The prisoner’s dilemma game . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1-2 A typology of natural resources. . . . . . . . . . . . . . . . . . . . . . . . . . 11 3-1 A classification of behavior (reproduced from [167]). . . . . . . . . . . . . . 31 3-2 The feedback control loop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3-3 The cybernetic perspective of NRM. The boldly outlined blocks represent the basic components of the feedback control loop. The other blocks list the relevant factors and possible realizations for the different components as discussed in the text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 5-1 The consumption of i is influenced by j through ωij . The overall effect is given by bi νi ωij where νi is the weight that i gives to social factors in the decision making process. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5-2 Graphical depiction of net-influence. . . . . . . . . . . . . . . . . . . . . . . 58 5-3 Conditions on cross-influence between groups in the semi-homogeneous network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 5-4 Trajectories of original and approximated aggregated systems when P̃ = x̄, for two different initial conditions. Here n = 100, bi = 1 ∀ i, ωij = 1/n ∀ i 6= j, αi ∼ U(0, 1) and ρi ∼ U(0, 1). . . . . . . . . . . . . . . . . . . . . . . . . . 69 6-1 The nature of the fixed point (x̄, ȳ), as the system parameters are varied. . 74 6-2 Regions in the parameter space depecting the nature of the equilibrium for system (6.1). The darkly shaded area represents the oscillatory region whereas the lightly shaded area represents the nodal region. . . . . . . . . . xvii 75 6-3 Change in steady state stock and consumption efforts in the two-community model, as the population characteristics are varied. The nominal values selected for this simulation are b1 = b2 = 1, ν1 = 0.75, ν2 = 0.25, ρ1 = 0.75, ρ2 = 0.25 and x(0) = 0.5 and y1 (0) = y2 (0) = 0. . . . . . . . . . . . . . . . . 80 6-4 Positivity of the equilibrium (6.5) in the ν1 , ν2 plane for different values of ρ1 and ρ2 . The plots are symmetric in ρ1 and ρ2 and so the missing plots are simply a reflection of the existing plots about the symmetric axis. The free-riding equilibrium corresponds to ȳ1 < 0 < ȳ2 . . . . . . . . . . . . . . . 81 6-5 Evaluation of the roots of q(·). . . . . . . . . . . . . . . . . . . . . . . . . . 83 6-6 Here we evaluate the local stability of (6.4), through inequality (6.7), as the parameters are varied. The nominal values for the parameters are b1 = 0.2, b2 = 0.1, and ρ1 = ρ2 = 0.1. The plots obtained by interchanging the indices of the groups are symmetric to the ones displayed above and thus are not shown here. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 6-7 The limit cycle of system (6.4). Here b1 = 0.2, b2 = 0.1, ν1 = 0.01, ν2 = 0.9, ρ1 = 0.001 and, ρ2 = 0.1. The red marked points indicate the fixed point and the initial point for the respective simulations. . . . . . . . . . . . . . . 88 7-1 Phase portrait of (7.42) around (ẑ, λ̂), where δ = 0.01 . . . . . . . . . . . . 108 7-2 Phase portrait of (7.42) in the case δ = 10 ≥ 1. . . . . . . . . . . . . . . . . 111 8-1 An example of the payoff function of one player, given the other player’s strategy. The yellow curve represents the best response. Here ρ2 = 0.7 and ν2 = 0.9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 8-2 An example of the social welfare function for ν1 = 0.3 and ν2 = 0.9. The green curve represents the collective optimal whereas the yellow point represents the Nash equilibrium. . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 8-3 An illustration of the definition of the game tragicness. . . . . . . . . . . . . 121 xviii 8-4 Plots for different characteristics of the consumption game at Nash equilibrium, shown as the difference and average level of the social relevances ν1 , ν2 are varied. For completeness the ν1 and ν2 axes have also been shown in each plot. The gray areas mark regions for which stability is not guaranteed. The plots for both groups are symmetric to each other, and so the conclusions drawn here for group 1 also apply to group 2. . . . . . . . . . . . . . . . . . 123 8-5 The three tragic realizations of the consumption game along with the labels commonly associated with them. Nash equilibria are shaded in gray. The values of the payoffs are hypothetical and have been chosen to illustrate the relative magnitudes of the payoffs for each outcome. . . . . . . . . . . . . . 126 8-6 Non-tragic realizations of the consumption game. . . . . . . . . . . . . . . . 127 8-7 Plot depicting the type of game that each realization of the consumption game belongs to as the parameters are varied. . . . . . . . . . . . . . . . . . 127 8-8 Tragic and non-tragic regions for the consumption game. . . . . . . . . . . . 128 8-9 Resource quantity at the Nash equilibrium for the discrete consumption game.129 9-1 The saddle point (ˆ(z), λ̂) and regions of the stable manifold λ− (z) & λ+ (z). Here δ = 0.01 < 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 9-2 The optimal feedback law and a representative solution for the case δ = 0.01 < 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 9-3 Optimal solution for (7.42) in the case δ = 10 ≥ 1. The optimal pair (z∗ (·), y∗ (·)) corresponds to curve γ4 in the phase space. . . . . . . . . . . . 135 9-4 Block diagram for (9.6a) coupled with the learning dynamics of (9.6b). The learning process is part of the social component of the model and is highlighted by the shaded area. . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 9-5 left: The region of stability for (9.6b). The cross-hairs correspond to points selected for the subsequent simulations. center: The learning process for identical νi ’s. right: The learning process for different νi ’s. In both simulations b1 = b2 = 1, x(0) = 0.5, y1 (0) = y2 (0) = 0, ρ1 (0) = 0.8 and ρ2 (0) = 0.2. Note that since b1 = b2 , (9.9a) holds true for all ν1 .ν2 . . . . . . . . . . . . . 10-1 Block diagram showing the coupled resource and consumption dynamics. xix . 142 156 11-1 The cybernetic picture revisited. This figure has first appeared in Chapter 3 and has been reproduced here for the sake of readability. . . . . . . . . . . . 160 A-1 The prisoner’s dilemma game . . . . . . . . . . . . . . . . . . . . . . . . . . 182 A-2 Illustration of the Cournot Game. . . . . . . . . . . . . . . . . . . . . . . . . 184 C-1 Different possible networks of varying connectivity along with the eigenvalues of the respective L matrix. All dashed links carry weight 1 (weak links), whereas continuously drawn links carry weight 100 (strong links). It can be seen that as network connectivity increases, so does the magnitude of the second smallest eigenvalue. . . . . . . . . . . . . . . . . . . . . . . . . . . . xx 190 List of Tables 1.1 public and private goods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Design principles illustrated by long-enduring CPR institutions (as identified 11 by Ostrom [148]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.1 Integrative frameworks for analyzing coupled human natural systems [32] . 24 6.1 Comparative statics results for system (6.4) . . . . . . . . . . . . . . . . . . 79 8.1 Structure of the discrete consumption game. x̄, ȳ1 and ȳ2 are given by Equation 6.5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi 126 Glossary LTG Limits To Growth: An influential text authored by Donella Meadows et. al. in 1972. LTG models investigate the effects of exponential growth on the finite resources of the Earth TOC Tragedy of the Commons CPR Common Pool Resource NRM SA CPS CPSS SES HITL Natural Resource Management Systems Analysis Cyber Physical Systems Cyber Physical Social Systems Social Ecological System Human In The Loop IoT Internet of Things IoE Internet of Everything NSF National Science Foundation: A United States Government Agency that supports Research and Education in the NonMedical Sciences and Engineering CHANS Coupled Human And Natural System SER Social-Ecological Relevance OCP Optimal Control Problem BR Best Response NE Nash Equilibrium xxii xxiii Part I Foundations and Background 1 Chapter 1 Lessons in Natural Resource Governance This chapter marks the beginning of the first part of this dissertation. The three chapters included in this part are qualitative in nature and are intended to provide context to the technical work presented afterwards. The first chapter, Chapter 1, highlights the resource governance problem in general. The second chapter, Chapter 2, discusses the difficulties associated with the analysis and control of resource based systems and showcases the relevant theoretical tools developed, and research conducted by scientists working in the area. The third chapter, Chapter 3 focuses on the role of technology in resource based systems and how engineers may employ cybernetic methods to analyze these systems in an effective and integrative manner. 1.1 Respecting the Limits of our Habitat In his thought-provoking book “A Green History of the World” [158], Clive Ponting presents a narrative on how the uncontrolled exploitation and eventual depletion of natural resources has played a pivotal role in the collapse of many leading civilizations of the world. It is not so difficult to comprehend the immense importance of preserving the habitat on which the human population is increasingly reliant. The finiteness of the planet’s resources dictates that in order for the human race to satisfy the demands of its increasing population, it must devise a way of life that does not eradicate the resource base which is so essential for its survival. As Ponting most aptly recounts, there exist numerous lessons for us throughout 2 our history in the form of societies that collapsed as a result of their direct or indirect abuse of the environment. Perhaps the most appropriate example to discuss here is that of the Polynesian society of Easter Island. Easter Island is located in one of the most remote regions on Earth. It is situated in the south Pacific Ocean over 3,500 km off the west coast of Chile in South America. Populated by a few dozen Polynesians in the 5th century A.D., the society gradually flourished untill the population peaked to a few thousand in the 16th century. Their diet consisted mainly of chicken and sweet potatoes, ensuring the provision of which, did not consume much of their time. This left a majority of the islanders’ time open for social customs and rituals, avidly directed by the individual chiefs of the numerous clans that had taken shape over time. The center of all rituals and worship were the ahu, stone platforms on which large statues (the Moai ) were placed as a symbol of authority and power. These Moai were extremely large in size and required an enormous amount of labour and also substance in the form of trees in order to transport them from the quarry to the ahu. As the island population grew in magnitude, the clans started competing for the felling of trees to transport the ever-growing Moais which led to the eventual depletion of the forests and degradation of their ecosystem. By the time that the European explorers first visited the island in the 18th century, the Easter Islanders had been reduced to a meager population engaged in perpetual warfare over the dwindling resources that remained, reduced to a mere shadow of the culturally complex and prosperous society they once used to be. Ponting compares the case of the Polynesians on Eater Island to that of all mankind on planet Earth and points out striking similarities albeit on different scales. Like Easter Island, the Earth is also isolated with nowhere the humans can escape to in the event that the environment is degraded to the point of inhabitability. The question quite rightly put is: have humans “been any more successful than the islanders in finding a way of life that does not fatally deplete the resources that are available to them and irreversibly damage their life support system?” As human beings, it is easy for us to realize the absolute importance of maintaining a balanced relationship with the surrounding environment in small isolated territories. For instance, Easter Island comprises a small area (roughly 160 sq. km.) which can be traversed in a single day. Moreover, due to the depleting timber and the state of their technology, the inhabitants were effectively isolated from other lands and so had nowhere to go in the event 3 of a crisis. The causality between the deteriorating resource base and the devastating events that transpired must have been painstakingly apparent to the existing population. However, the same cannot be said when we think of our planet as a whole. In his famous essay [39], Kenneth Boulding discusses the need for a change in how we perceive our biosphere. The primitive society viewed itself as living in a limitless world i.e. a world with unbounded resources spread out over an infinite plane. Whenever primordial humans were faced with deterioration of the natural habitat or their social structure, they always had the luxury of migrating to areas with better prospects. Thus, there always existed a “frontier”, which separated the known limits of human domain from the promising territory which was yet to be explored. However as mankind would eventually discover, the Earth is not a limitless plane, but in fact a closed sphere with limited resources whose boundaries we have now begun to increasingly stress. Hence there is a need to abandon the “cowboy” view of the economy which symbolizes the limitless plains and the sense of adventure and exploration that always comes with the existence of a frontier. The inability of mankind to incorporate the finiteness of nature’s resources in its economic activities, and the inexorable requirement to satisfy the needs of a growing world population has led to an extraordinary strain being put on the Earth’s ecosystem. Boulding notes that abandoning the image of a limitless Earth in our economic principles is not an easy task as this image has been inscribed in our minds for centuries. Nevertheless we must now adopt the idea of a “spaceship” economy, whereby realizing that the earth is like a spaceship, limited in its resources and isolated from its surroundings. There is no other planet we can escape to 1 and this is becoming increasingly clear as we are finally beginning to bear the brunt of our inconsiderate economic activities in the form of phenomena such as environmental pollution and global warming. As opposed to the cowboy economy, the magnitude of consumption and production can no longer be held as a metric for success, but in fact, it is “the nature, extent, quality, and complexity of the total capital stock ” that really matters. In light of the debate on the potentially lethal relationship between mankind’s economic activities and the Earth’s environment, one wonders what would happen if human beings 1 One solution that immediately comes to mind is undertaking space and sea explorations to expand the frontiers of the available resources. But even if we extend to the immediate solar system or find new resources under the sea, it pushes these frontiers only for a finite period of time. It is important to realize that our unbounded desire to growth may eventually overtake even apparently unbounded resources. So the basic dilemma is physical and always holds. 4 continue the pursuit of economic growth in the current fashion. Jay Forrester was perhaps the first to address this issue in a mathematically rigorous framework. His book “World Dynamics” [80] presents a dynamical model of certain global variables that represent the state of the world economy. These include world population, pollution, quantity of nonrenewable resources, world capital investment and fraction of investment in the agriculture sector. His model known as World2 marks the beginning of the field of global modeling. Perhaps the most influential work that resulted as a direct consequence of his efforts is the book “Limits To Growth” (LTG) [135] with Donella Meadows as the lead author. Using Forrester’s system dynamics technique and building on his work, the authors of LTG construct a detailed computer model of the world economy called World3. The purpose of the model is to demonstrate the effect of limitless exponential growth in a world whose resources are finite. The relationship between the variables are assumed to be highly nonlinear with parameters regressed from statistical yearbooks. The model also includes various feedback effects, for example, population growth is positively related to food production. However population growth is positively related to industrial output, which is positively related to pollution, which in turn, is negatively related to food production and hence population growth. Meadows et. al. ran the model under 12 different scenarios and found that at the time (in 1972) the world economy was operating inside the planetary boundaries still with room to grow and an opportunity for mankind to contemplate long-term corrective measures. However the study predicted a sudden collapse of the world population, a massive die-out somewhere in the 21st century, if the world economy continued to grow at a positive rate. Thus the author’s proposed an operating point of zero growth as the only way to avoid the massive die-out. The original book received a few updates with the latest one [134] arguing that humanity has already passed the planetary boundaries bringing it in a state of serious overshoot and much must be changed in order to minimize the impact of the overshoot. Various studies also observe that the historical data of events after 1972 support the key features of the predictions made by LTG [192, 193]. Although there has been much criticism on the methods of the LTG models and interpretation of the results (for instance, see [24, Chapter 7]), one thing is painstakingly clear: there is a dire need for change if we hope to live in harmony with the Earth’s natural system which is at the foundation of the economical system and already showing signs of fragility. 5 1.2 Inability to Act: The Tragedy of the Commons After going through the history of Easter Island, one very intriguing thought strikes the mind. As mentioned earlier, effects of the rapid deforestation and the impending doom it would bring, would have been clearly visible to the people of the island at that time. One might ask what stopped the individual clans from abstaining from deforestation and altering their lifestyle so as to maintain the intricate balance between mother nature and human society. After all, if the environmental deterioration stopped it would provide a chance for the Islanders to rebuild and prosper once more, a situation that would unquestionably be beneficial for all clans. Yet as we know this did not happen. The history of human civilization is filled with accounts of societies that collapsed due to direct or indirect environmental abuse. For instance, the collapse of the Sumerians in Mesopotamia, the fall of the Mohenjo Daro and Harappa civilizations of the Indus, Baghdad and the Mediterranean, deforestation in China and medieval Ethiopia, and the decline of the Mayans in Mesoamerica were all linked to uncontrolled exploitation of the environment in one form or the other. It is not unreasonable to assume that the effects of human activity on its surroundings and the eventual backlash would have been apparent to the individuals of each society in question at the time that the activities were taking place. Yet somehow, the detrimental activities continued till the ultimate disintegration of the societies. What prevented those communities from acting collectively in their own mutual interest? The answer lies in a concept that has gained the attention of social scientists for the past many decades. Garrett Hardin introduced the phrase “Tragedy of the Commons” for the first time in his famous article [97] in 1968. The concept is presented by envisioning a pasture or grazing commons, filled with grass. The local herdsman bring their cattle to the commons to graze upon each day. The commons is open to everyone and so their is no restriction as to how many cattle one can bring to graze upon there. The addition of a single cow on the commons will present a benefit to the particular herdsman that cow belongs to. However this addition also holds a cost in the form of additional overgrazing as a result of the increase in animals. While the benefit of an additional cow is for a single herdsman to enjoy all by himself, the cost is shared by all herdsmen which means that the cost of an additional animal (for the individual herdsman) is only a fraction of the benefit. Thus the only rational action for the herdsman is to expand his herd. This course of action is 6 followed by all herdsmen and eventually the number of cattle exceeds the capacity of the commons thus ruining it for everyone. Rational action on behalf of the herdsmen results in collective destruction and herein lies the tragedy. What aggravates the tragedy even more is the fact that the herdsmen continue to act this way even with full knowledge of the consequence of their actions (hence a tragedy and not a shock or disaster). The commons dilemma is a specific instance of a social dilemma where individual rationality is in contrast to the collective benefit of all. While the concept of the Tragedy of the Commons (TOC) has been defined using the story of the commons, it has many diverse manifestations in real life and is certainly not restricted to the grazing pastures only. One example that Hardin discusses in his article as well is that of overpopulation. An individual couple may embrace parenthood due to the psychological satisfaction and other benefits that come with offspring, however each additional human being on the planet increases the strain being put on its resources. If the increase in population is not stopped soon enough, it may grow beyond what the Earth is able to support. Here again, the benefits of offspring are enjoyed by the parents only, while the cost (however small) is incurred by the remaining world population. Another example is traffic congestion. Here the common resource is public roads. An individual may quite understandably prefer to commute via public roads in order to save time. However, if everyone follows this reasoning it would result in congestion of traffic on the public roads, eventually causing everyone to be late. Another illustration of the Tragedy occurs in developing communities with shortage of electric supply. In such settings, households often install an Uninterruptible Power Supply (UPS) system which stores backup electricity for use during the power outages. While this may ensure that the household gets electricity even during the outage, it puts additional strain on the supply grid due to its inefficiency (the power returned by a UPS during an outage is less than the power consumed in order to charge it). This means that if every household installs a UPS, it would result in even more outages than before, thus the tragedy. Other real life examples of the commons dilemma include, but are not limited to, pollution, overfishing (the bluefin tuna is perhaps the most eyeopening manifestation of the TOC), deforestation, depleting groundwater aquifers (a prevalent problem in Pakistan and the South-Asian region [180]), animal poaching and sending spam emails. The commons serves as a symbol for all resources that are openly accessible to the general 7 consumer (more on this in Section 1.2.2) and Hardin argues that in the absence of external regulation, rational consumers will eventually and most certainly lead to destruction of the resource. The Tragedy of the commons is one of three metaphorical models which have until recently been most influential for policy prescription in resource governance problems. We discuss the others in the following section. 1.2.1 Other Models of Inevitable Doom The tragedy of the commons has been popularly formalized as a Prisoner’s dilemma game [65]. The motivation behind this game is the following story. Consider two robbers who are known to have robbed a bank together. However the police does not have enough evidence to convict any of the robbers without a confession from at least one of them. Upon capturing the robbers the police offers each of them the following two choices (in isolation), either they confess to the crime (the defect strategy) or not (the cooperate strategy). If that prisoner confesses to the crime and the other does not, then he is freed while the other receives 10 years in jail. If both prisoners confess then both of them receive 5 years in jail. If neither of them confesses then each will receive a single year in jail on minor charges. The game is presented in matrix form in Figure 1-1 with the Nash equilibrium shaded in gray (see Appendix A for a basic introduction to games). C D C -1,-1 -10,0 D 0,-10 -5,-5 Figure 1-1: The prisoner’s dilemma game From the structure of the game, we see that each player has a dominating strategy of defecting. However if each player plays this strategy then the resulting outcome will be pareto sub-optimal i.e. there exists some other strategy (in this case: both cooperating) in which at least one player is better-off without the other being worse-off. The definition of the more general N-person dilemma which exhibits the same structure can be found in [66]. It is easy to see how this game also serves as an illustration of the Tragedy of the 8 Commons. Assume that the players are now two herdsmen deciding on how many cattle to keep in their respective herds. If the critical level of total cattle (after which the commons is destroyed) is L then let the cooperate strategy for each herdsman be to restrict his herd to under L/2, and the defect strategy be to add as many cattle to his herd as he pleases. The resulting game also has the same structure as shown in Figure 1-1. The prisoner’s dilemma is fascinating because it contradicts the inherent belief of humans that actions that are individually rational also lead to collectively rational outcomes. In his popular book “The Logic of Collective Action” [145], Mancur Olson challenges the (up till then widely accepted) basic premise of group theory, that individuals who aim to fulfill their personal benefits will rationally strive to fulfill the collective benefit of the group as well. Olson asserts that without any external coercion, large groups of individuals will not voluntarily act in the common interest of the group. In order for them to collectively achieve the group’s most beneficial outcome, they would have to exhibit at least some altruistic tendency which is more of an exception than the norm, especially when there are economic principles involved. Groups and organizations tend to exist solely to serve the common goals or benefits of the group itself. If they existed to serve the interests of the individuals, it would be pointless, since independent, unorganized action on behalf of the individuals themselves would be most effective in achieving that interest. For instance, the Labor Union exists to the serve the common interest of higher wages for the workers, but each worker also has the individual interest in her own personal income which not only depends on the wages but also on the number of hours she works everyday. So what circumstances lead to a group of rational individuals directing their actions towards achieving their collective interest? Olson argues that economic incentives alone are not enough, there must be some social incentive as well. For instance, individuals might serve the group in order to win “prestige” within it. Such social dynamics are more significant in groups of smaller sizes. This implies that one of the most important factors in determining whether or not individual action will result in the fulfillment of the group’s mutual benefit is the size of the group. Thus smaller groups are more efficient and viable than larger ones, which is one of the major conclusions of Olson’s work. 9 1.2.2 Open-access: The Nature of “Tragic” Resources Here we take some time to discuss the nature of the resources prone to the Commons Dilemma. As we shall soon see, natural resources that are vulnerable to tragedy-like situations have particular characteristics that are not exhibited by every resource. For example, their is no TOC in the direct consumption of solar energy which will be available in the same quantity tomorrow, irrespective of how much it is consumed today. We elaborate more formally as follows. Natural resources can be classified as either renewable or non-renewable/exhaustive resources. While renewable resources have the capacity to regenerate over time, non-renewable resources either do not possess a regenerative capacity or if so, the timescale of the regeneration is of geological magnitude (e.g. fossil fuels). While non-renewable resources are bound to be exhausted at some future point in time (unless of course consumption is stopped altogether), renewable resources can be consumed indefinitely while maintaining a positive stock quantity, provided the consumption is below a certain critical level. This possibility is what makes the study of renewable resources so much more interesting especially in the context of sustainability. Natural resources are also fundamentally classified as either public or private. This classification [155] is based on the categorization of goods as rivalrous/non-rivalrous and excludable/non-excludable. An excludable good is one in which individuals who do not pay for the good can be prevented from consuming it. All private goods such as cellphones, personal vehicles and clothing, etc, are excludable. Other resources such as public parks, cinemas and zoos are also excludable. Goods such as fish in the open sea, solar energy, national television and radio are goods that are non-excludable. It is not possible to prevent someone from consuming a non-excludable resource, it is open for consumption to anyone who can do so. A rivalrous good is one in which consumption of the good by one individual affects the amount available to other individuals. The earlier example of fish in the open sea is a rivalrous resource. Solar energy is not. The described classification is tabularized in Table 1.1. The category of major interest here is open-access or common-pool resources (CPR). Examples of such resources include fisheries, forests, bio-fuels, geo-thermal energy, minerals, oil pools and many more. Common pool resources may also be either renewable or non-renewable (see Figure 1-2). It is the open-access, rivalrous nature of these resources 10 Excludable Non-excludable Rivalrous Purely private good cellphones Common pool resource (CPR) Fisheries Non-rivalrous Congestible resource public parks Purely public good national television Table 1.1: public and private goods that make them amenable to phenomena such as the Tragedy of the Commons. Let us revisit the example of the grazing commons. As the commons is not owned privately, any new herdsman may approach the commons so that his cattle may graze upon it. There is also no possibility of removing any existing cattle already on the commons. These are all characteristics of a non-excludable resource. Furthermore, despite the grass being a renewable entity, the total amount at any given instant is finite and so, the grass consumed by some cattle is not available for consumption to the others, i.e., the resource is rivalrous. Thus according to Table 1.1, the grazing commons is an open-access or a common pool resource. It is this attribute of the commons that makes the tragedy possible. Another classification of interest is shown in Figure 1-2, where renewable resources are classified as either renewable flow resources or renewable stock resources. Renewable stock resources are resources for which the amount consumed in the present, affects the amount available for consumption in the future. Examples include fisheries, water resources, forests, arable and grazing land, etc. Renewable flow resources on the other hand are ones for which the amount available for consumption in the future is not affected by the amount Figure 1-2: A typology of natural resources. 11 consumed in the present. Examples include solar, wind and geo-thermal energy (although the sun itself, and the Earth that harbors the winds and geo-thermal reservoirs are physically depleting albeit over extremely large stellar and geological timescales). It should be noted that for all practical purposes flow resources (in contrast to stock resources) are non-depletable. Thus the issues that arise in governing stock resources are not encountered in flow resources. The concept of a common-pool resource covers only stock resources (here a non-renewable resource is also considered a stock resource) and thus renewable flow resources are not generally categorized as CPRs. 1.2.3 Privatization and State Regulation: The Only Solutions? The implication of Hardin’s Tragedy of the Commons and the other metaphorical models of doom (the prisoner’s dilemma and Olson’s logic of collective action) imply that in the absence of external coercion by some central authority, consumers of a CPR are trapped in a downward spiral of resource depletion and ultimate ruin. In his original article, Hardin posited that the commons dilemma belonged to a class of “no technical solution problems”, where a technical solution is understood to mean “one that requires a change only in the techniques of the natural sciences, demanding little or nothing in the way of change in human values or ideas of morality”. Up until recently, it was commonly conceived that the only way to ensure sustainable consumption of a commons was either privatization or state regulation, thus fundamentally altering the very open-access nature of the resource. Indeed these are the very solutions that Hardin advocated for the TOC. No communitybased solution was thought to be feasible. However, as we shall soon see, Elinor Ostrom was yet to compile several real-world examples of communities, which had collectively devised their own institutions to use the commons in a renewable and sustainable manner. Not only this, but she would also enumerate several common characteristics of the institutions as guidelines for policy prescription, a work which would eventually win her the Nobel prize in economics. 1.3 Cooperative Solutions to the Commons Dilemma In her book “Governing the Commons” [148], Elinor Ostrom presents her work on communitybased governance of natural resources in open-access settings. She begins by accepting that 12 the three models namely, The Tragedy of the Commons, The Prisoner’s Dilemma and The Logic of Collective Action all serve very nicely as illustrations of situations in which societies are not able to fulfill their mutual interests. The underlying aspect of such situations that these models highlight is the so called tendency of free-riding. Such a phenomenon occurs when individuals of a group cannot be excluded from enjoying the group’s mutual benefit, regardless of how much effort he or she exerted towards fulfilling that benefit. Thus fishers are tempted to individually harvest large stocks of fish while the others abstain to maintain the stock at a renewable level and factories spill their waste in untreated form leaving it to others to worry about spending money on waste disposal systems. And so these models are able to explain (at least up to some convincing extent) why individually rational actions may lead to collectively irrational outcomes. Ostrom continues by asserting that while the aforementioned models of inevitable doom are extremely interesting and powerful they are also extremely dangerous. What makes them dangerous is the manner in which they are used in policy prescription. Instead of being used as a guiding tool for the policy-makers the conclusions of the models are taken as a starting point, a dogma to say the least, and it is accepted without question that the community itself is unable to sustain its resources without interference of the governing body. It is not taken into account that the hard constraints that are in place in the assumed setting of the models are not in fact hard constraints in empirical settings. For instance, the prisoners in the prisoners dilemma might be able to negotiate beforehand, reaching a binding agreement to always play the cooperate strategy. The metaphorical use of these models in Ostrom’s point of view eventually leads to prescribing solutions that are not appropriate in practice. Consider for instance the commonly prescribed solutions to the CPR problem: privatization and state regulation. While hectares of land are possible to privatize, how would one effectively do this in the case of fisheries? Ostrom posits that for effective governance, the resources must belong to institutions that are collectively owned by the consumers themselves. Such institutions are more likely to succeed in governance as compared to institutions that are owned by the state or private enterprises. This is because the users (as stakeholders) themselves have more incentives to make the arrangement successful. Furthermore they are less likely to make informational errors e.g. under or over-estimating the carrying capacity of the resource and the wrong identification of cooperators and defaulters, which may cause the institution to fail in its 13 objective. An example of such policy making is the nationalization of forests in Third World countries, which has been advocated on the grounds that the local villagers are unable to manage their forests effectively. In order to regulate the forests, the governments usually deploy officials with salaries that are low enough to propel them to accept bribes (this is Design Principles Examples Clearly Defined Boundaries The individuals who have the right to harvest the CPR and the boundaries of the CPR itself are well defined Fishing licenses, Demarcation of grazing pastures Proportional Equivalence Between Benefits and Costs Individuals who benefit more from the CPR must incur more of the operational cost Large benefactors providing more labor for communal activities, Imposition of taxes proportional to consumption Collective-choice arrangements Individuals effected by operational rules also have influence in changing those rules Local elections, Referendums, Rotational rosters for irrigation Monitoring Monitors/auditors are accountable to the users Auditors elected from within the community itself, Technological solutions such as smart meters Graduated sanctions Violation of rules receive penalties proportional to the degree of violation Extra labor in the case of violating a maintenance contribution, Predefined fines or seasonal bans on resource use stealing Conflict-resolution mechanisms Users have access to low cost local arenas to resolve conflicts Communal judicial systems such as Community Courts in the Western countries and the Panchayati Raj in South Asia Minimal recognition of rights to organize Institutions devised by locals to regulate the CPR are recognized by external government authorities Authoritative powers entrusted to the municipalities, Promotion of autonomous tribal area systems for resource governance Nested enterprises Multiple tiers of nested organization Defining layers of organization, e.g., in irrigation systems, for users in the same canal branch, same headworks, same river basin, and so on Table 1.2: Design principles illustrated by long-enduring CPR institutions (as identified by Ostrom [148]) 14 of course not intentional but an implication of the state of the national economies). This has in many cases resulted in the forests being effectively transformed to an open-access resource which had previously been limited-access. The highlight of Ostrom’s work is the enumeration of several communities from diverse geographical and demographical regions of the world that have devised solutions to sustain their commons which neither fall in to the category of state-ownership nor privatization. In all the studied cases, the local communities were able to avoid tragedies without any external coercion by coming up with regulating institutions of their own. She then presents the common characteristics of these institutions as guidelines for governance of CPRs. These characteristics have been reproduced in Table 1.2. An adaptation of the design principles to irrigation systems is given by Ostrom in [149] and have been upheld by successful irrigation systems in multiple parts of the world [115, 171]. The principles have also been studied in the context of other resources such as forests [88], fisheries [174] and rangelands [143] among various others. Ostrom’s work contains an important lesson: successful management of open-access resources is possible through local institutions without the coercion of a central authority. Knowing that feasible solutions to a problem exist serves as a stimulus for the quest of those solutions. The case studies of real-world communities living in harmony with their respective resources provide exactly the inspiration needed as we contemplate a scientific enquiry of the NRM problem in the subsequent chapters of this dissertation. 15 Chapter 2 Eyeing CPRs through the Systems Lens Common pool resources, like all natural resources, are vital components of the complex ecosystem that sustains the development of human society. Resources are used in the provision of food & drink, housing & infrastructure, mobility and so many other necessities for our survival. As we saw in Chapter 1 they can be a cause to initiate war and even spur the collapse of civilizations. Resources effect the way we live, move and even think. On the other hand, humans effect the resource through consumption and conservation acts. Hence common pool resources, like all natural resources, are intricately tied to the human society. Neither can be studied in isolation without considering the effects of the other. CPRs and society thus constitute what is known in scientific terms as a system. In this chapter, after defining the construct of a system, we study the method of inquiry commonly employed to examine complex systems. This method of inquiry is known as Systems Analysis (or SA for short). 2.1 The Concept of a System With the expansion of science and human knowledge, we are being confronted with systems that are increasingly complex to understand and eventually manage and control. Methods for scientific inquiry have evolved over the years with the goal of understanding such systems. Since we will henceforth be employing the concept of a system extensively, it is beneficial to reflect on what we actually mean by the term. 16 A system can be thought of as a whole that consists of more than one component (these components may also be systems in their own right). According to Ackoff [107], each component of a system must have the following characteristics 1. Each component is capable of influencing the behavior of the whole system. 2. The way each component influences the overall system is dependent on the state of the other components. In other words, the components are all interconnected. 3. Any set of components also has the characteristics (as mentioned in the above two points) of the individual components. The definition above serves to underpin a very critical property of a system. Namely, the system holds properties that none of the individual components have. In other words, a system is more than just a sum of its individual parts. We now move on to analysis and synthesis, the two modes of inquiry for understanding a system, both of which form the foundation for Systems Analysis. 2.2 Analysis and Synthesis: The Fundamental Ingredients of Scientific Inquiry Analysis stems from the Greek analusis which means “ to loosen up”. As a method of inquiry it dictates that in order to understand any system, we must decompose it into its parts and gain an understanding of the individual parts in isolation. For instance, in order to comprehend the working of a computer we decompose it into parts until we get a CPU, hard drives, CD ROM, external ports, data and memory buses etc. In order to understand the computer an understanding of all these parts in isolation is necessary. Thus in order to understand life, we must understand a cell, the fundamental unit of all living organisms; and to understand the working of the universe, we must first understand an atom, the fundamental unit of all matter. Analysis is hence a process by which a system is taken apart, and the understanding of the individual parts is then aggregated to gain an understanding of the whole. Consider the example of the computer again. We already discussed that in order to understand the computer, we must gain an understanding of the CPU, hard drives, CD ROM, external 17 ports etc. However, if we take all these things individually and simply put them together in one place in front of us, we will surely not get a working computer. The ultimate purpose of the computer is to perform calculations (admittedly a very crude delineation of the computer’s purpose, but nonetheless sufficient for the point of this discussion). But if we take the memory unit and pull it out from the computer, it will cease to serve its purpose. Analysis prompts us to take the system apart in order to understand it. But as we have just seen, taking apart the system (in this case a computer) takes away its essential properties. For it is not only the individual components that make the system, but it is also the interconnections between them that are equally (if not more) important in its formation. Synthesis enables us to understand the system with respect to these interconnections. Synthesis comes from the Greek sunthesis which means “to place together” and as the literal meaning indicates, it is the opposite of analysis. Let us look at synthesis more closely by comparing it with analysis. In analysis, we first disintegrate the system into its components, understand each component in isolation and then combine the isolated understanding to form an understanding of the whole. In synthesis, we first view the system as a part of the larger system which contains it, understand that system and then disintegrate the understanding of the larger system into that of the system under investigation by identifying its role in the larger system. Let us return to the example of the computer. We already discussed that in order to understand the computer via analysis, we must gain an understanding of its various parts which include the data, memory and control buses. If we look at each bus in isolation, we would find them to be identical. However if we understand the larger system i.e. the system bus, of which all these are a part of, and see how it connects with the CPU, memory unit and input/output we will be able to identify and understand the individual buses through these interconnections. Here it is the role each individual bus plays as part of the larger system (the system bus) that truly defines its purpose. It is important to note that synthesis is not “better” than analysis for any common notion of the word. In fact analysis and synthesis are not even comparable, they are complementary to each other. Let us consider the example of a research institute. If we insist on employing analysis to understand the working of the institute we disintegrate it into its constituent programs. But in order to understand the programs we must use analysis again and so we break them into their constituent clusters. Each cluster then consists of individual 18 staff members and to understand each staff member we would again have to disintegrate perhaps along the lines of that member’s professional profile. Each profile would indicate association with a particular field of study and so on and so forth in a never-ending process of continuous disintegration. On the other hand, if we try to understand the institute on the basis of synthesis, we look at the larger system that institute belongs to. Perhaps it is part of a university. But the university is again a part of a larger system which is the educational system, which is in turn part of the governing body and we continue in this manner ad infinitum. Analysis or synthesis alone cannot furnish a complete understanding of a system. We shall now return our focus to natural resource systems. In this dissertation, a resource system is understood to be composed of two components: human society (or the fraction of society consuming the resource) and the resource itself. Thus if we intend to dissect CPR systems for the purpose of analysis, we would obtain at the first step the resource and the society. The resource itself is a complex system. For example, forests consist of trees, wildlife and other vegetation. Trees in turn are composed of leaves, branches, roots, etc. We could delve even deeper till we reach the biological cell and even then, the process does not end here. The same holds for the consuming society, which is divided into small communities. The communities consist of households which in turn consist of individual human beings. Now the human being itself is such a complex entity that one cannot hope to even begin to understand it fully until the disintegrating process is stopped somewhere and the context of the study is brought into play to simplify matters. On the other side, to understand CPR systems by synthesis we search for the containing system. Conceivably, the CPR system is part of a larger economy belonging to a particular geographical location. That economy is a part of the global economy which in turn is a part of our planet’s ecosystem, which is again part of a larger system, and so on. CPRs as systems comprise of human society and a natural resource which are both extremely complex systems in their own right. This is what makes the understanding of CPRs so challenging. So how does one then actually understand a system? The answer, as we shall see next, is a blend of analysis and synthesis. 19 2.3 Systems Analysis: Tackling Complex Systems with an Integrative Perspective When we apply analysis to any system, what we obtain is a set of the individual components. As Ackoff [107] would say, it yields an understanding of the system’s structure. When we apply synthesis to a system we understand the role it plays in the larger system of which it is a part. It thus yields an understanding of the system’s behavior. Ritchey [165] distinguishes between two levels of abstraction of a system. One level views the system as a primary functioning unit, a “black box” and what this presents is information on the system’s behavior (thus the level synthesis is concerned with). Another level views the system as a set of components working together to achieve some common purpose, yielding the overall construction or structure of the system (thus the level analysis is concerned with). As we saw in the case of the research institute, it is only possible to understand the system at one of these levels. So then the question really is: what type of understanding do we want to gain about the system? Perhaps one of the first applications of this intricate relationship between analysis and synthesis is included in Riemann’s study “The Mechanism of the Ear” [84]. The study is concerned with how the sound sensation of the human ear works and is one of the assignments Riemann was engaged in just prior to his death. The departing point for the study is the late 19th century work of Hermann Helmholtz [200] who used the analytical method of scientific inquiry to develop a theory of the human ear, and subsequently applied it to the theory of musical composition. While Helmholtz’s work contains many significant contributions and has gained the status of a classic in human physiology, it also contained many flaws. Going into specific details is beyond the scope of this dissertation however it is sufficient to mention that one of the biggest flaws concerned the role of the middle ear. Riemann begins his study from a synthetic point of view i.e. the purpose of the ear. He does not conduct his study with perspective of the anatomy of the human ear but with the perspective of what the ear actually accomplishes. Indeed this is the same Georg Friedrich Bernhard Riemann who is primarily known for his significant contributions in mathematical analysis, differential geometry and number theory. Despite the incomplete form of Riemann’s manuscript, it includes important conclusions for the principles of human anatomy. While Riemann did not actually use the term “system” he had unknowingly 20 employed what would later come to be known as systems analysis. Without the knowledge of the ear’s anatomy that Helmholtz’s work contained, Riemann would not have been able to complete his study. For in his words, “every synthesis rests upon the results of a preceding analysis, and every analysis requires a subsequent synthesis”. It is exactly this thought that is at the very core of the Systems approach to scientific inquiry. Barton and Haslett [26] describe the scientific method as a dialect between analysis and synthesis. The purpose of Systems Theory is to frame this dialect. Thus, as Ackoff posits [107], Systems Theory is a fusion of both analysis and synthesis. How much reduction to apply to the system via analysis before performing the final synthesis is a question of what we wish to gain from our understanding of the system and must be inferred from context of the inquiry. The early proponents of the systems approach asserted that every system has certain characteristics that are independent of the discipline that particular system is associated with and sought to develop a theory of those characteristics. Ludwig Von Bertalanffy in his famous paper [198] laid the foundations for General Systems Theory which later on came to be known as Systems Science. Even with the diversity of systems that scientists encounter, ranging from living organisms to social systems to man made machines, there exist several universal properties that all systems possess. Via his General Systems Theory, Bertalanffy gave mathematical descriptions of some of these properties such as wholeness, growth, mechanization, centralization, sum and finality to name just a few. The term Systems Theory has grown to encompass several related terms such as Systems Thinking, Systems Science, Systems Analysis, Systems Dynamics, Systems Engineering and so on (Skyttner [183] gives an excellent review on the subject). We next give an overview of how the Systems perspective has been utilized by those engaged in natural resource systems. 2.4 Systems Analysis and Coupled Human Natural Systems The immense significance of TOCs in the future of human development has been the primary focus of Chapter 1. At this point, we hope the reader has begun to appreciate that the nature of TOC problems are approachable only through an integrative, multidisciplinary approach (which is exactly what Systems Analysis has to offer). The problem of the Commons is one of the major global challenges that scientists working in the environmental and 21 related sciences have confronted through systems analysis. These include issues such as climate change, population growth, environmental pollution and resource management in general [131, 90, 103, 202]. Simon Levin [118] considers TOCs as one the three grand challenges of systems theory. The complete list is enumerated as follows: 1): robustness and resilience to critical transitions, 2): scaling from the microscopic to the macroscopic, and 3): dealing with problems of the Commons. We now give a brief overview of the application of Systems Analysis to TOC problems as part of the more general problem of natural resource management. Natural resource systems, as coupled systems between resources and society, represent a larger class of systems, namely, Coupled Human Natural Systems (or CHANS). CHANS are characterized by settings in which people interact with natural components. These components may be natural resources or other elements of the environment which include wildlife, vegetation, the atmosphere, landscapes, climate, etc. CHANS are characterized by complex feedbacks between social and ecological components, high non-linearities and significant time-lags. As such, understanding the system is of critical importance before any kind of intervention is undertaken. The law of unintended consequences often comes into play in such systems. For instance, in a bid to increase crop productivity, the “FourPests” campaign of China [181] sought to eradicate the Eurasian Tree Sparrow (along with mosquitoes, flies and rats) which ate grain, seed and fruit. It was later realized that besides grain, the sparrows also ate many insects harmful to rice, and as a result, the rice yield actually decreased. Another example is the policy to eradicate wildfires in American forests [50]. The policy did lead to fewer fires, but, also led to growth conditions such that when fires did occur, they were much larger and more damaging. As a result the total acreage of forests affected by fires increased. The lesson of the Four-Pest campaign and the American wildfire policy dictates a full understanding of the system before any intervention is done. For such systems, traditional ecological research often excludes human impacts while traditional sociological research often neglects ecological effects. However, as Liu et. al. [120] assert, any effective study on CHANS must incorporate not only variables related to the social and ecological components, but also those related to their connections (such as resource consumption and provision of ecosystem services). The systems perspective is thus a natural way to approach CHANS and an increasing number of studies are now integrating the ecological and social sciences 22 in order to study these systems. Due to the applicability and effectiveness of systems thinking for analyzing CHANS problems, numerous interdisciplinary frameworks have emerged to study such systems with an integrative perspective. Binder et. al. [32] provide a comprehensive comparison of the different frameworks used to analyze coupled human-natural systems 1 . The authors classify ten different frameworks according to three criteria 1): whether the framework conceptualizes the interactions between the social and ecological components as uni- or bidirectional, 2): whether the ecological system is defined according to its utility to humans (anthropocentric) or its internal functioning, and 3): whether the framework is intended to provide a common language for formulating and approaching research problems (analysisoriented), or with the goal of acting upon or intervening in the system (action-oriented). Table 2.1 enumerates the list of frameworks and their categorization as given by Binder et. al. [32]. Three of these frameworks conceptualize the interactions between the ecological and social sub-systems in both directions: the Human Environment Systems (HES) Framework [178], the Management and Transition Framework (MTF) [153] and the SocialEcological Systems Framework (SESF) [150]. The three are similar as far as the conceptualization of the ecological subsystem and the orientation of the frameworks’ goal are concerned. All three are analysis-oriented with the ecological subsystem defined according to its utility to humans (anthropocentric). However among the frameworks, there exist subtle differences in the disciplines they evolved from, their theoretical origins, fundamental research questions and the settings to which they have been applied to. The Management and Transition Framework (MTF) was developed for the application to water governance problems with a focus on studying the transitional behavior under regime change. Binder et. al. state that MTF has no specific disciplinary origin but it may be attributed to complex systems science. The theoretical foundations of MTF are related to CPR theory, institutional analysis & development and social psychology. As can be seen in Table 2.1, the MTF conceptualizes the resource in an anthropocentric manner which means that only those aspects are considered which impact humans significantly. The MTF goes one step further than the other anthropocentric frameworks and explicitly considers environmental hazards which pose a significant threat to human well-being. While 1 In the cited publication, the authors refer to CHANS as social-ecological systems. Such interchangeable terminology is common in the literature. 23 Conceptualization Framework Interactions DPSIR Driver, Pressure, State, Impact, Resource [53] Social → Ecological Anthropocentric Action Oriented Social→Ecological Ecocentric Analysis Oriented ES Ecosystems Services [68] Social→Ecological Ecocentric Analysis Oriented HES Human Environment Systems Framework [178] SocialEcological Anthropocentric Analysis Oriented MEFA Material and Energy Flow Analysis [95] Social→Ecological Ecocentric Analysis Oriented MTF Management and Transition Framework [153] SocialEcological Anthropocentric Analysis Oriented SESF Social-Ecological Framework [150] Systems SocialEcological Anthropocentric Analysis Oriented SLA Sustainable Livelihood Approach [19] Social←Ecological Anthropocentric Action Oriented TNS The Natural Step [48] Social→Ecological Ecocentric Action Oriented TVUL Turner’s Vulnerability Framework [191] Social←Ecological Anthropocentric Action Oriented ESA Earth [173] Systems Analysis Orientation Table 2.1: Integrative frameworks for analyzing coupled human natural systems [32] 24 MTF was originally intended for water governance systems, it has also been applied to risk governance and integrated landscape management. In the authors’ opinion, the framework may be tailored for application to other domains as well. The Human Environment Systems (HES) framework, as its description in Table 2.1 suggests, was developed as a tool to structure CHANS research. The framework is heuristic in nature and provides operative concepts to study human-centric environmental problems (which may include resource governance). The HES framework considers the details of the ecological system only with reference to the social system. The standard procedure for analysis is to select a state-of-the-art model for the ecological system and then set its scale according to the corresponding social system. The framework has emerged from the environmental decision making and psychology community and is theoretically based on systems science, decision theory, game theory and sustainability science. It is applicable to any system where the interactions between humans and the environment play a significant role e.g., energy, water, waste, etc. The Social Ecological Systems Framework SESF specifies a set of multi-hierarchical variables relevant to CHANS. The framework has been proposed by Ostrom [150], who selects the variables on the basis that they proved to be pivotal in her studies of successful CPR governance schemes. She places a significant emphasis on hierarchies (note principle no. 8: nested enterprises, in Table 1.2 of features of successful CPR governance schemes), with multiple tiers of the variables corresponding to multiple levels of organization. This aspect of the SESF enables it to support analysis on multiple scales. The SESF also stands out from the frameworks of Table 2.1 with respect to the degree to which the social and ecological systems are teated in equal depth. As Binder et.al. [32] note, while the ecocentric frameworks incorporate the ecological system in more detail and the anthropocentric frameworks incorporate the society in more detail, SESF incorporates both systems in equal detail. The framework has emerged from political sciences and at its foundation, includes theories such as collective choice, CPR and natural resource management. The framework has been developed for resources that are common-pool in nature and has been applied mainly to forests, pastures, fisheries and water. The three frameworks HES, MTF and SESF described above have either been developed specifically for natural resource governance, or can potentially be applied to resource governance problems. The rest of the frameworks in Table 2.1 also address environmental 25 problems (in which humans play a significant role) of immense importance. The interested reader is referred to the cited references of each framework for specific details. Each framework includes explicit consideration of the non-linear nature of resource and social dynamics, uncertainties for key variables, imperfect knowledge of human actors, effects of social linkages, and so on. As applications of the Systems approach to critical environmental problems, they touch on many disparate disciplines each of which contribute different aspects to the study of the coupled human natural system. Perhaps one of the most fundamental proposition of the systems approach is an abandonment of cause and effect as the only possible relationship between two entities, whether viewed independently or as components of a larger system. This of course is a reference to the feedback loop, a concept at the foundation of what is known as cybernetics. Cybernetics is a manifestation of systems theory that was conceived almost parallel to Systems Science. While the concept has somewhat faded away from the forefront of the scientific community, the engineering community, motivated by recent advances in technology, is now bringing it back into focus. The development of cybernetics and its potential application to NRM is what shall capture our attention for the next chapter. 26 Chapter 3 From Control of Machines to Cybernetics of Resources The engineering community has achieved great technological advancement by application of the concepts of control and communication to machines and technical systems. The philosophy of control and communication is however quite general and is manifested not only in technical systems but can also be observed in living organisms, society and the object of interest for this dissertation: natural resource systems. Natural resource systems consist of an intricate coupling between natural and social systems and as such, have immense potential to benefit from different lines of research in the ecological, social and engineering communities. The conception of smart cities and the Internet of Things (IOT) have greatly stimulated the interest of engineers towards coupled systems of humans and technology. The growing pervasiveness of such systems has resulted in the emergence of what has come to be known as Human In The Loop (HITL) control. In this chapter, after discussing the convoluted relationship between technology and the environment, we introduce the fundamental concepts of cybernetics that have spawned the disciplines of communication and control. We then give an account of how recent progress in technology has led to more and more human-centric realizations of control, including resource related applications. We then consider a cybernetic perspective for NRM, thus framing the research presented in the remaining part of this dissertation. 27 3.1 Technical Advancement and the Environment The Industrial Revolution of the 19th century saw great technological advancement and led to an (at that time) unfathomable improvement in the quality of the common individuals’ life. However the subsequent gains in economic prosperity have come at a heavy price which the natural environment has had to pay in the form of increased global emissions, melting glaciers, depleting ozone, deforestation and so on. The complete list of these effects is quite long, well-known and depressing. The 20th century thus saw a growing awareness of the negative impact of technology on the environment and ultimately our collective living condition. Publications such as Forrester’s “World Dynamics” [80] and Meadows and colleagues’ “Limits to Growth” [135] also enhanced the view of technology (and the economic growth it enabled) as the factor responsible for our deteriorating habitat. Thus the contemporary environmental movement saw technology as a major source of environmental degradation and a continuous cause for unintended and unwanted side effects. Interestingly, one of the major objections to the LTG world models is the conceptualization of technology. As Foray and Grübler [79] assert, more technology in the future does not necessarily imply more of today’s technology or simply more technological “hardware”. Moreover, the temporal scale over which we consume our resources is not determined by their geological abundance, but is determined through technological, social and economical factors which are all subject to a process of continuous change. Technology enables us to positively influence the environment by 1): increasing efficiency in production, 2): augmenting our natural resources by unearthing new reservoirs, and 3): enabling new trends in material and resource use. For example, through technology we have been able to reduce vehicle emissions by manufacturing more efficient automobiles. Greenhouse gas emissions have been reduced by adopting new technologies such as fuel cells & single-gas turbines and by shifting from coal and petroleum to renewable energy sources. Geographical Information Systems (GIS) technology has enabled the remote detection of sources for environmental deterioration. Genetically engineered micro-organisms are now used to treat toxic chemicals in waste material. Precision agriculture and the revolution in information technology has greatly enhanced the farmer’s capability to effectively monitor, treat and make better decisions about crop production. It has eventually been realized now that feasible solutions to our environmental problems call for more proficiency in technology and not less [20]. 28 Ironically, technology has demonstrated a capacity to both inflict and remedy damage to the environment [91] and as such can be perceived as a “double edged sword”. The potential of technology in redeeming the environment is not limited to the three roles mentioned above. An increased emphasis is now being placed on the fact that systemic changes in the economical system are required. For example, the “circular economy” [175] promotes a regenerative economy in which consumer goods are designed to be of such nature that after the end of their useful life cycle, certain components could be restored and made to re-enter the biosphere instead of being wasted. This is in contrast to the current make-dispose-waste linear model of the economy. Such a thing is now possible due to the availability of new materials and sophisticated manufacturing techniques. Although the effectiveness of technological solutions to environmental problems may seem promising at first, the practical world is full of examples of unintended consequences and, as such, caution must be practiced at all times. As Moriarty and Honnery assert [140], technical advances are sometimes responsible in reinforcing the same effects that they were brought about to mitigate. For example, increasing forested area in an attempt to reduce global warming, risks reducing the Earth’s capacity to reflect part of the incident solar energy back into space [110]. Thus the Earth would absorb more solar energy, partly offsetting the intended reduction in global warming. An apparent technical solution to one problem may also produce unwanted effects in another domain. For instance, the increased production of biofuels is forecasted to compete with existing agricultural goods which can result in a rise in food prices. Indeed the use of corn to produce ethanol has occasionally caused the global price of corn to spike in the past [140]. The unintended consequences of forestation and bioenergy are similar to those of the Four-Pest campaign and the American wildfire policy we saw in Section 2.4. This reinforces the notion that any intervention, including those technological in nature, in coupled human and natural systems must not be made without fully understanding the system in context of the issue at hand. Such an understanding requires a systems perspective. Due to the potential impact of technology in environmental problems, the engineering community is now showing an increased interest in CHANS. It is thus natural to extend their traditional way of approaching systems (which, up until recently, have been mostly technical in nature) to such settings. Here we are referring to Cybernetics, an old paradigm of Systems Theory that has shaped the foundations of communication & control. 29 3.2 Cybernetics and Concepts Defining Feedback Control Rosenblueth, Wiener and Bigelow [167] present a classification of system behavior in an essay published in 1943. Behavior is defined as “any change of an entity with respect to its surroundings”. Interestingly, the authors use the term behavioristic study to describe the method of study which is akin to the synthetic method. The behavioristic approach is contrasted with functional analysis, which as the term suggests is akin to what we have dubbed simply analysis. Behavior can be classified as active or passive. Active behavior is one where the system is the source of output energy generated as a consequence of its operation. In passive behavior either no output energy is produced to begin with, or energy flows from the system input(s) directly to its output(s). Active behavior is further divided into purposeful and non-purposeful behavior, where purpose denotes the existence of a specific objective or goal for the system. Purposeful behavior is categorized as either feedback (teleological) or non-feedback (non-teleological) with feedback including both negative and positive feedback. Rosenblueth et. al. state that all purposeful behavior can be considered as requiring negative feedback. Feedback may be extrapolative (or predictive) so that when a falcon dives towards a rabbit, its aim is not towards where the rabbit is at the time the dive is executed but where the rabbit is conjectured to be when the falcon will reach it. Feedback may also be non-extrapolative (or non-predictive) just as the amoeba is able to move towards light but is not able to track a moving source. Thus purposeful feedback behavior can be further divided into predictive and non-predictive behavior. The order of predictive behavior denotes the complexity of prediction, for instance, the falcon needed only to predict the path of the rabbit (hence first order prediction), whereas an archer hunting the same rabbit would have to predict both the paths of the rabbit and the arrow (thus second order prediction). The classification of behavior just described above is depicted in Figure 3-1. The postulate that all purposeful behavior requires feedback lays the foundation of Norbert Wiener’s Cybernetics. Weiner introduced the term in his acclaimed book [206] in 1948, a couple of years before Bertalanffy published his paper on General Systems Theory [198]. The cybernetics movement has roots that are quite distinct from those of systems theory. While Bertalanffy’s ideas stemmed from biology, cybernetics took inspiration from technology, using the feedback circuit as its basic model. However there exists a significant overlap 30 Figure 3-1: A classification of behavior (reproduced from [167]). in the interests of both movements. Both challenge the purely analytical methodology of the pre-systems era and stress the importance of viewing systems from a holistic angle. Although both were developed in parallel, cybernetics became a part of systems science shortly after its inception. On a related note, systems thinking has given rise to a number of traditions each of which are now established theories in their own right. Early examples include Operations Research, Systems Dynamics, Organizational Learning and Cybernetics (refer to [194] for further details). More recent developments include (but are not limited to) Control and Communication Theory, Signals and Systems, Multi-agent systems and Network Science. All the above can be thought of as different traditions of systems theory, each having its own (often overlapping) language, methodology and outlook on the systems perspective. Cybernetics stems from the Greek kubeman which means “to steer”. Indeed one of the earliest examples of control technology is the steering mechanism of a ship’s rudder. In his published works [206, 205] Wiener formalized the concept of cybernetics by abstracting the principles of feedback, control and communication from machines to systems in general. These systems include living organisms, society, organizations and of course machines. Through his discourse, Weiner was able to show that the concepts of feedback control and communication were applicable to all the above mentioned systems. Thus cybernetics was able to unify seemingly disparate disciplines such as psychology, anthropology, sociology and engineering, all of which were (and continue to be) subject to an increasing amount of specialization. 31 Figure 3-2: The feedback control loop. Cybernetics is concerned with the study of all systems which exhibit purposeful (or teleological) behavior. The purpose of the system is specified through some objective or goal that must be reached. This objective is usually translated to a certain state of the system output(s) with the desired state being called the reference. The output of the system is then compared with the reference in order to apply a corrective action depending on how far the system is in reaching its goal. Thus the basic ingredients of a purposeful system are 1. The goal-setter which determines the system objective and translates it into a desired state for the system output. This corresponds to the “goals” block of the feedback loop in Figure 3-2. 2. The receptor which receives information on the output of the system and forwards it for comparison with the desired output. This corresponds to the “sense” block in Figure 3-2. 3. The comparator which compares the desired output specified by the goal-setter with the output as received from the receptor and formulates a difference or error. This corresponds to the “compare” block in Figure 3-2. 4. The control unit which decides a corrective action to be taken in order to reduce the error. This corresponds to “decide” block in Figure 3-2. 5. The effector which implements the action determined by the control unit. This corresponds to the “actuate” block of Figure 3-2. 32 In graphical representations of the feedback loop, the “compare” and “goals” blocks are sometimes omitted (like Figure 3-3). However their presence is always understood. This type of corrective behavior can be seen, as Wiener posits, in every purposeful system. A person driving a car will continuously read the deviation of the car from the center of the road and apply the necessary corrective action through the steering wheel in order to keep the car in the center. Two people engaged in conversation also exhibit the same behavior. The conversation has a purpose and if one of the individuals deviates from that purpose, someone applies a corrective action by steering the conversation in the required direction. Living organisms exhibit this behavior in the process of homeostasis, which maintains the parameters of the body within a nominal range of values. Needless to say, the principles of cybernetics are at play all around us. The concepts of cybernetics, as a paradigm of Systems Analysis, has had a profound influence in the development of both control and communication [86]. Over the passage of time, although the term cybernetics has gone out of fashion, it continues to live on in the sense that the discourse in many diverse fields are still being broken down into systems, information, feedback and networks. As Asaro [7] puts it, “... cybernetics is alive and well. Of course, nobody calls it cybernetics anymore, they simply call it control theory or information theory.” However, as Asaro himself also notes, the original ideology of cybernetics is much broad and is limited not just to machines. As technology has advanced, the proliferation of humans in control applications continues to grow. In what follows we look at how control theorists have incorporated humans, society and the environment in their cybernetic formalism of systems. The umbrella term for such settings is called Human In The Loop (HITL) control. The discourse is presented to build towards how CPR systems may be perceived from the cybernetic approach. 3.3 Human-in-the-loop Control The involvement of human beings in control systems can be broadly categorized into the following levels [156] 1. Human machine symbiosis: Symbiosis is a state of two different organisms living together in a close interactive manner. Examples of such systems include prosthetics, exoskeletons, neurostimulators, etc. 33 2. Human as operators or decision makers: These systems include those in which regular intervention of a human operator may be expected e.g., self-driving vehicles, remote control applications, auto-pilot systems. They also include systems in which humans are involved in the high level decision making or goal setting such as town municipalities, supply chains and resource management. 3. Humans as agents in multi-agent systems: Such systems include automated transportation and pedestrian management, semi autonomous manufacturing, human vs machine games and so on. 4. Humans as the objects of control: These systems include home comfort systems, networks of opinion formation and social media to name just a few. Resource management systems are special in the sense that they involve human beings at two levels of involvement. Firstly, the humans are the objects of control as it is their consumption which must be regulated. Secondly, humans are involved in the decision making process of any control that may be subsequently applied. This may include setting discount rates, devising effective means to implement the control, engaging in philosophical exercises of formulating social welfare and so on. While economists, ecologists and sociologists have all been working on coupled human natural systems for a significant time now, the engineering community (in particular the control faction) have recently gained interest in these systems through the increasing integration of technology in society and the opportunities that it offers. A small outline of the journey is given below. 3.3.1 Cyber-Physical Systems and the Internet of Things Cyber Physical Systems (or CPSs for short) pertain to the application of computing systems to the control of physical processes. The overall behavior of the system is then determined by both the computing element and the physical element. Early applications of engineered systems for the control of intricate physical processes may be traced back to the steam engine governor and the industrial revolution initiated by it. In recent decades the advancement in computing and communication technologies have given rise to the Information Technology (IT) revolution. This has resulted in a proliferation of computing elements and the world 34 wide web at the core of control design for complex physical processes. The term CyberPhysical Systems, coined by Helen Gill [21] in 2006 at the National Science Foundation, thus lies at the interface between control, communication and computing technology. Kim and Kumar [113] identify multiple pathways leading to this area of interest via multiple scientific communities which has also led to the birth of closely related terms such as Ubiquitous Computing, Wireless Sensor Networks and the Internet of Things. The root of the term CPS is, widely and befittingly, considered to be Wiener’s Cybernetics [117]. The Internet of Things (or IoT for short) relates to the extension of the internet and its integration in the physical realm [137]. The notion of IoT was conceived by the computer science community and envisions a world of “smarts” i.e., smart transport, smart phones, smart infrastructure1 and smart cities [169]. The IoT concept shares many similarities with CPS and both terms are often used as synonyms [36]. Both envision a strong coupling of computation, intelligence and the environment in the form of a large scale distributed computing system of systems. However both have evolved from different communities, and as such, there exist subtle differences between the philosophy of both. The IoT focuses more on virtual problems such as architecture, security, protocols, openness and privacy [187]. CPS however places more focus on control, automation and the underlying physical process, often formulated as a closed loop control system. While IoT consists of the internet at its core technology, CPS consists of intelligent embedded systems in general. Thus IoT may be viewed as an enabling technology for CPS. The IoT has also be portrayed as a CPS connected to the internet [106]. The application of CPS based technologies are numerous, ranging from robotics, factory automation and smart grids, to medical systems, citizen actuation and environmental control. Such diverse and convoluted applications pose many challenges for research in theories for analysis and design, integration of cross-disciplinary works, developing technologies for control actuation and sensing, meeting real-time computing requirements and abstracting the complexities of physical systems to name just a few [21, 113, 117, 162]. 1 see Elsevier’s special issue on smart infrastructures [161] 35 3.3.2 Cyber Physical Social Systems: Addressing the social component in CPSs Cyber-Physical Social Systems (or CPSS) brings together the cyber, physical and social components of a controlled process. The social dimension of CPSSs is rather broad and encompasses not only human societies per se, but also mental capabilities and human knowledge. Thus one realizes that all CPSs include a social dimension in one form or another. Robots do not operate in their own world, but in the physical world where interaction with humans is no longer a possibility but a necessity. Auto pilot systems and self-driving vehicles rely on high level inputs from a human operator. Even highly automated control systems which may seem to operate without any human intervention are frequently effected by human behavior, either in the form of disturbances, or high level decision making and goal setting. The goal of CPSSs is to effectively add and address this human component in CPSs [201]. The fundamental difference then between a CPS and a CPSS is that in the latter humans are modeled as fundamental units of the system and not objects that exist outside the system boundaries. While CPS and IoT make connections across the physical space and the cyber space, CPSSs connect the physical and cyber spaces with the social space. This space not only includes humans in their physical form, but also includes their cognitive behavior, social interactions and collective institutions 2 . It has been argued that since acknowledging human behavior is a key component of CPS design, a CPS should infact be more accurately referred to as a CPSS [55]. 3.3.3 The Imperative to Understand Human Behavior As social applications of control and automation increase with the advancement of technology, we are faced with many new challenges and research opportunities. Stankovic et. al. [187, 142] identify the following CPS challenges for human in the loop control of CPSs 1. Challenge 1: Gaining an understanding of the complete spectrum of human-in- the-loop control systems. 2. Challenge 2: Extending system identification techniques to adequately capture human behavior. 2 A parallel concept is the extension of IoT to the Internet of Everything (IoE) which goes beyond just “things” to incorporate humans and society in what is envisioned to be a global sensing and actuating utility connected to the internet [208]. 36 3. Challenge 3: Incorporating human behavior models into the formal methodology of feedback control. The common aspect in all three challenges listed above is a focus on understanding human behavior in the formalism of control. Once it is understood that a system of concern is HITL, the first challenge is to model the involvement of human beings. As stated previously, it is absolutely essential that the social elements are modeled not as external disturbances or noise but as primary components of the system. Using the formalisms that exist separately in the social, technical and computational domains is not sufficient to deal with these systems as each model highlights only certain aspects relevant to that domain and ignores others. Such an approach to CPS design may prove to be fatal for verifying the overall correctness and safety of design at the system level [21]. Thus an integrative approach is required which combines the research from social sciences to engineering in a formalism that is coherent with the language of feedback control. 3.4 The Cybernetics of Natural Resource Systems In Chapter 2, we discussed the development of systems analysis and its application to the field of natural resource management. Despite the aforementioned advancements however, NRM has yet to benefit from the full potential of the cybernetic perspective. Accordingly there have been attempts to draw attention to the application of the cybernetics philosophy to environmental problems [101, 31], but they have largely gone unnoticed. Cybernetics focuses on the key question of how systems regulate themselves, how they evolve and adapt to disturbances and the underlying structure and mechanisms that govern their dynamics. Moreover, the framework is mathematically intensive and, as such, permits rigorous deductions and confirmation (or refusal) of theory. The focus of the cybernetic approach on regulating system outputs and states to desired values uncovers profound insights on the required system structure and behavior in order to yield the desired results. Needless to say, NRM can benefit greatly from the cybernetics perspective especially due to a growing interest in the field shown by the control and automation community. The second aspect of the relevance of cybernetics to natural resource management lies with the controls community itself. The involvement of human beings in control and automation systems is growing rapidly with new applications being realized everyday. Such 37 applications have been made possible through the advancement of technology. New and improved sensors, actuators and the evolution of design techniques has transformed the concept of smart cities and IoE from mere aspirations to a reality within reach. Many researchers have pointed out that the missing link in the way forward is the seamless integration of human behavior with the technical aspects of system design [116]. One of the most important factors responsible for the existent gap between the social sciences and control and automation is the dearth of mathematical models describing social dynamics [160]. While significant progress is being made in control of opinion formation and related problems [83], much ground has yet to be covered in control and automation for natural resource management. Caragliu et. al. [51] define a smart city as one where “investments in human and social capital and traditional (transport) and modern (ICT) communication infrastructure fuel sustainable economic growth and a high quality of life, with a wise management of natural resources, through participatory governance”. Thus a smart city cannot be realized without effective management of its natural resource base. Natural resources are coupled human-natural systems and in order to integrate them effectively in the formalism of feedback control, we must first translate their dynamics in a form that is amenable to to the cybernetic way of thinking. 3.4.1 Imagineering the Cybernetic Picture Cybernetics concerns itself with systems as regulators that actively compensating for any disturbances that might occur. As such, while applying cybernetics to any system, we must address the following questions: What is the goal or objective of the system in context of the analysis? What factors and decisions influence these goals? What information is required by the analyst (or observer) and decision makers? What technologies are needed to implement the system? In the following, we address the above and similar questions in the context of NRM. A synopsis is given by Figure 3-3. Defining System Goals The research enclosed in this dissertation strives towards uncovering favorable conditions for sustainable development. This relates to the setting of goals for the system and although the “goals” block is not shown explicitly in Figure 3-3, it is a crucial part in the overall control implementation. Here we adopt the following definition of sustainability, contained 38 in the well known report of the Brundtland Commission titled “Our Common Future” [47] “Sustainable development is development that meets the needs of the present without compromising the ability of future generations to meet their own needs” The above definition requires further specification of two elements. First we must specify what is meant by needs. In the context of NRM we interpret needs as consumption from the natural resource stock. Second we interpret the ability to meet ones needs as the availability of the resource stock for consumption. In the mathematical language which we employ to frame the system model, this implies a steady-state with finite resource stock and consumption level (see [195, 30] for similar examples). Factors and Decisions Influencing Achievement of the Goals The sustainability of natural resources is threatened by the overexploitation of its stocks through phenomena similar to the TOC. Since sustainability of the stock implies an exploitation that is at most equal to the resource regeneration, it is effected both by resource and consumption dynamics. Resource dynamics for renewable resources are specified by environmental parameters such as carrying capacity and growth rate [155]. Dynamics of human consumption are specified by the cognitive decision-making process of resource use [141]. It is important to realize that there exist a plethora of variables and parameters that effect consumption patterns in the real world. However it is not possible to represent all influencing factors and keep the analysis tractable at the same time. Therefore one must select only those factors which are most relevant to the underlying study. This pertains to understanding of the physical process in context of the problem at hand (and therefore the social and environmental factors are depicted alongside the social-ecological system in Figure 3-3). Moreover, as discussed previously in Section 2.4 for CHANS, it is important to not only consider the ecological and social components separately, but also to consider the various interactions between them. Mathematical Models of Human Behavior As stated previously perhaps the factor most responsible for the gap between research in social sciences and engineering is the lack of mathematical models of human behavior. Depending on the type of analysis, human behavior may be incorporated in objective functions 39 Figure 3-3: The cybernetic perspective of NRM. The boldly outlined blocks represent the basic components of the feedback control loop. The other blocks list the relevant factors and possible realizations for the different components as discussed in the text. in optimal control problems [1] or in the system dynamics themselves [2]. Depending on the scale of the problem, the model may be a block model (representing tightly knit communities as a single entity) [82] or an agent-based model where the dynamics of each individual consumer are represented explicitly [166]. Note that obtaining mathematical models of human behaviors is not easy, in fact, this is exactly one of the challenges for HITL control of CPSs we saw in Section 3.3.3. Nonetheless, a mathematical model (whether conceptual or data driven) is essential for the rigorous framework of control. It is important to note here, a common misconception about modeling i.e., the goal of modeling is always prediction. This is a tendency that is commonly found in both technical and social disciplines; if a model has been made, then it is eventually going to be used to make projections, or at least be “calibrated” or “validated” using some data. Epstein treats these enduring misconceptions in his acclaimed lecture [73] quite judiciously. Aside from prediction, he lists 16 different uses to build a model. Any model can in principle be 40 used for prediction, but it is important to recognize the limitations of the model and the resulting influence it has on the validity of the predictions. We do not advocate the use of our model (see Chapter 4) to predict resource consumption patterns in actual scenarios, as this is not the intent with which the model is created. Indeed there exist many models that have been created for this exact purpose (for instance, see the discussion in [38, 46]). We hope to demonstrate in the material that follows, the use of our model as a potential tool to illuminate core dynamics of the system, highlight trade-offs in decision making, and most importantly, take a step towards incorporating CHANS dynamics effectively in control processes. The findings of the model might be also be used to guide the collection of data and even discipline policy dialog for natural resource management. Identifying the Mechanisms of Control There exist many forms of control for NRM. While some are relatively straight-forward to identify, others may not be so due to the complex nature of social dynamics and its intricate coupling with the environment. Examples include devising social institutions of collective behavior [148], manipulating dissemination of information to alter consumption patterns [188], government interventions in local markets [78], and influencing the social network so that consumers are connected in some desirable way [34]. There also exists long-term measures such as educating the masses to nurture a certain type of mindset [6] and more coercive methods such as enforcing quotas, steering prices or imposing taxes [97]. The main challenge of course is to incorporate these controls in models of human behavior. Control mechanisms fall in the “actuate” block of Figure 3-3 which also lists the aforementioned mechanisms of control. Measurements and System Identification In order to evaluate performance, we must have some representation of the current state of the system. This is achieved by the observation of relevant outputs of the process being controlled. Thus the “decide” block (Figure 3-3) is preceded by a “sense” block in the overall feedback loop of the control system. Measurement and sensing technologies for physical quantities such as resource stocks and individual consumption have matured well beyond their infancy. So much so that we are now living in a world of “smarts” [35]. Portable handheld devices such as smart phones contain dozens of sensors which include the capability to 41 log and keep track of behavioral patterns of each individual. Smart meters record and send data of resource stock and flows from extremely remote locations with time resolutions that far exceed the time scales of environmental processes [184]. The bottleneck in sensing and system identification for NRM then lies in the parameters concerning human psychology such as environmental awareness and social orientations [142]. While sociologists are able to estimate such psychological data in controlled experiments [168], we are still much behind in devising system identification techniques for such parameters in real world CPSSs. Evaluating System Performance Evaluating system performance is critical for regulation and control. While obtaining benchmarks for machines is relatively straight forward, it is not the case for NRM. Evaluating how well a society is doing requires intense philosophical and moral dialogue, for example, in establishing notions of social welfare and selecting discount rates for future generations [179]. Such issues are heavily debated in the economics literature [28, 155] and must be addressed before any type of social control is envisioned. In the overall control system this step may be seen as part of the decide process as shown in Figure 3-3, which implicitly includes the “compare” block from Figure 3-2. 3.5 Cybernetics and Society: A Word of Caution In his original text [206], Norbert Weiner advises caution in the use of the cybernetics philosophy for social systems. His major concern is the non-isolation of the observer from the system. While in machines, the observer is external and is able to investigate the system without disturbing it, it is not so in the case of social systems where the observer is part of the system she analyzes (for instance, any attempt to investigate the stock exchange has the potential to upset the stock exchange itself). Thus the principles governing the control and communication of machines (subsequently called first-order cybernetics) are different from those of society (subsequently called second-order cybernetics). Weiner further goes on to state that this approach of investigations in the social sciences can never furnish us with a quantity of verifiable, significant information which can even be compared with what we have learned to expect in the natural sciences. Although philosophical advancements in second-order cybernetics have gained signifi- 42 cant ground [199], the cybernetics of social systems (also called socio-cybernetics[125]) is far from yielding the rigorous theory of control and communication that has spawned from its first order antecedent. Heylighen and Joslyn [100] go as far to state that “the emphasis on the irreducible complexity of the various system-observer interactions and on the subjectivity of modeling has led many to abandon formal approaches and mathematical modeling altogether, limiting themselves to philosophical or literary discourses”. In the material of the following chapters, a model for natural resource consumption is derived from psychological roots and formulated as a dynamical system. Keeping in mind Wiener’s cautionary remark, the formulation of the model and the analysis that follows has been done by placing a focus on qualitative results. Accordingly, an emphasis has been placed on the relationship between variables and uncovering sustainable trends in the system. The association of numerics with social and psychological parameters has been kept to a minimum, and where possible, avoided altogether. We hope that the research enclosed in this dissertation will serve as a small step and an inspiration towards a fully mathematical framework for NRM in the cybernetic context. 43 Part II Modeling the Dynamics of Resource Based Systems 44 Chapter 4 A Psychologically Relevant Mathematical Model of Consumer Behavior In Chapter 3, we discussed the relevance of cybernetics to natural resource systems and how it may provide a common ground for engineers to analyze and study the various societal and environmental applications of their technologies. Conant and Ashby [62] argue that a mathematical model of any system is essential in order to achieve any purposeful behavior on its part. Whether the model is conceptual or data-driven (see [176] for an advanced application of empirical models), it is always understood to exist at the core of any regulating mechanism. In this chapter, we introduce a mathematical model of resource consumption, derived conceptually from social psychological research on consumer behavior. After discussing the first principles used to derive the model, we present the model in mathematical form, followed by a reduction in dimensionality for the sake of ease in analysis and interpretations carried out in the subsequent chapters of this dissertation. 4.1 Modeling Paradigms in Socio-ecological Systems Understanding and taking into account consumer behavior in socio-ecological systems is of prime importance for designing an effective solution to phenomena, which are usually referred to as The Tragedy of the Commons [97]. Social psychologists have carried out 45 a wealth of research to identify factors driving the decision processes of individuals. For instance, Festinger [75] hypothesizes, that human beings are continuously driven to evaluate their decisions, and, in the absence of any objective non-social means, they do so by comparison with decisions of other individuals. Thus, if a consumer is uncertain about the state of a resource, she may make her decision based on the information gathered from other consumers. Simon postulates [182], that individuals seldom optimize their outcomes over different available alternatives, mainly due to their limited cognitive resources, and instead act according to automated habitual behavior. This implies, that although a consumer might be aware of the consequences of over-utilization of a natural resource, she may still do so according to habit, as long as the outcome is satisfying to her for the time-being (assuming that there is enough of the resource to permit her over-utilization). These theoretical propositions have been supplemented by various laboratory and field experiments of common-pool resource settings. Samuelson et al. [170] conduct an experiment to observe how consumers respond to information on the overall consumption of the resource. They find that individual consumptions tend to increase over time, however there is little or no increase in consumption when the resource is being overused. Rutte et al. [168] demonstrate, through an experiment, that consumer behavior is determined by whether the society or the environment is held responsible for the scarcity or abundance of resource. They conclude that when the environment is held responsible, consumers give ecological information more preference than social information, for evaluation of their consumption levels. Conversely, when the society is held responsible, social information is given more preference than ecological information. Brucks and Mosler [45] conduct an experiment to find what type of information is important to consumers while making decisions on consumption. They observe, among other findings, that when the resource availability is low, the importance of the information regarding the situation of the resource increases, while the importance of the information regarding consumption of other individuals decreases. Building on the aforementioned psychological research, scientists have proposed various computational models that simulate consumer behavior during resource crises. Much of these models have been developed under the umbrella of multi-agent simulations, or agentbased modeling (these terms are often used interchangeably), in which several heterogeneous individuals (agents) are programmed according to some psychological rules. Such a framework can be used to identify key behavioral elements that shape large-scale societal 46 transitions. Deadman [69] presents one of the first agent-based models of the tragedy of the commons. Since then, various computational agent-based models of resource dilemmas have been developed see, for instance, [104, 76, 105]. These models differ in the principles used to simulate the behavior of individual agents, as each group of authors, depending upon the posed research question, attempts to incorporate different psychological findings into the behavior rules of agents. Bosquet and Le Page [40] give an extensive review of the development of this field and early applications to ecosystem management. Despite the power of computational agent-based models to reveal collective phenomena from individual interactions, they lack rigor, generality and elegance that is provided by mathematical models. Notable achievements on the latter front include, for example, Anderson [3] who describes the coupled dynamics of a regenerating commons and the physical capital, as a system of a few ordinary differential equations, and uses calculus to show that the model exhibits Hardins conclusions (Hardin 1968) explicitly. Anderies [2] applies bifurcation analysis to two separate models of resource exploitation: (1) the slash-and-burn agricultural system of the Tsembaga tribesmen of New Guinea, and (2) the exploitation of palm forests on Easter Island by the Polynesians. The analysis is used to study the long-term behavior of both systems under different management/ behavioral regimes. The study suggests that successful institutional designs are highly site-specific and that a careful understanding of the geometry of the system is necessary for successful resource governance. Roopnarine [166] suggests simple differential equation models which separately illuminate three different aspects of the tragedy of the commons: (1) the compulsion of individual users to act based on the action of other users, (2) the opportunities and limitations imposed by the networked nature of consumers, and (3) mutualisms as solutions to tragedies. Thus, these mathematical models are able to demonstrate and explain a certain phenomenon in a clear and tractable fashion, where a major focus is usually placed on the dynamics of consumption. Although no objective function or decision variables are explicitly included in their formulation, they typically assume some notion of rationality prevalent in the consumers. However, the theoretical findings provided by social psychologists are seldom incorporated in these models. The commons dilemma has also been studied extensively in the framework of game theory. In her seminal work, Ostrom states that all institutional arrangements that can be used to avert the commons dilemma are expressible as games in extensive form, and 47 presents several such examples [148, 152]. While she expresses institutionalization for resource governance as a non-cooperative game, a large number of analysts have also used cooperative game theory to study environmental resource issues (see, for example, [154]). Ostroms research has stimulated a vast amount of work, concerning use of the game theoretic framework for modelling strategic interactions between consumers of a natural resource (see for instance [124, 61, 70]). Similar to system dynamic models, game-theoretic models also assume a notion of rationality, which is made explicit by including objective functions and decision variables in the problem formulation. However, most game-theoretic models, either seek an optimal strategy of resource extraction, or seek to design models that yield strategies similar to those observed in real-world scenarios, rather than focusing on strategies that accurately depict the cognitive process of the consumers decision making. We argue, that in order to increase the relevance of such models to real-world scenarios, it is necessary to incorporate the cognitive principles that govern consumer behaviour, as revealed by the psychological research. In this chapter, we present a dynamic model of natural resource consumption, taking into account the psychology of consumer behavior in an open-access setting. We depart from the computational model by Mosler and Brucks [141] and put forward a stylized version that is based on the same psychological principles employed in the original model. Essential psychological variables have been maintained in our model, which include the scarcity thresholds as perceived by consumers, the extent to which the consumers hold nature (or society) responsible for the state of the resource, and the social value of the consumers. While the original model assumes unlimited growth of the resource, we assume standard logistic growth, which is more realistic. The logistic growth model and its variants are commonly used to model many renewable resources that saturate at a certain carrying capacity. Thus the resources which lie in the scope of our study include (but are not limited to) fisheries [89], forests [74], vegetation [33], foliage [203], saffron [190], and so on. We do not, in this study, incorporate the effects of uncertainty in our model. Thus we assume, that perfect information is available to each consumer, regarding the resource quantity and the consumption of other individuals present in the system. While this is a strong and restrictive assumption, incorporating uncertainty is beyond the scope of this paper, as it would considerably increase the complexity of the model, and must be dealt with separately. 48 4.2 The Mathematical Model Our starting point is the computational consumer behavior model of Mosler and Brucks [141], which we stylize by formalizing it into a mathematical form. The resource is supposed to regenerate according to the classical logistic growth model [155]. To begin with, we consider a society of n individual consumers, each of whom have open-access to the resource which they consume by exerting some effort. The dynamics of the consumers’ effort are modeled based on our understanding of the cognitive process depending on certain psychological characteristics each consumer. These characteristics depict: (1) the environmentalism of the consumer (the perceived benchmark quantity that the consumer uses to evaluate whether the resource is in abundance or in scarcity), (2) the social values of the consumer (how cooperative is the consumer), and (3) causal attributions of the consumer (to what extent does the consumer attribute the current condition of the resource to natureinduced reasons, as compared to society-induced reasons). The model is specified through the dynamics of the resource (the ecological sub-model) and those of the individual consumption efforts for each consumer (the social sub-model). We describe each sub-model in turn as follows. 4.2.1 The Ecological Sub-model Consider a society with n consumers, each having open-access to a single renewable resource. We assume that the resource quantity R(τ ), available for consumption by the society at time τ , has an associated growth function, which is logistic in nature. We further assume, that in the absence of consumption, R(τ ) increases over time at an intrinsic (positive, constant) growth rate r and saturates at the given carrying capacity Rmax . The individual consumers, each identified by their respective index i ∈ {1, . . . , n}, exert effort ei (τ ) 1 to consume the resource. The resource growth is, therefore, given by   X n dR(τ ) R(τ ) = r R(τ ) 1 − − ei (τ ) R(τ ), dτ Rmax (4.1) i=1 where each individual’s harvest of the resource equals ei (τ )R(τ ). Note that Equation (4.1) is equivalent to the standard Gordon-Schaefer model [89], with the catch coefficient set to unity. 1 see [155] for interpretations of the word “effort” in this context 49 Following [155], we use a general notion of “efforts”: “all the different dimensions of harvesting activity can be aggregated into one magnitude called effort”. For example, in fisheries, factors which define efforts may include “the number of boats deployed and their efficiency, the number of days when fishing is undertaken and so on”. While positive efforts refer to the extraction of a resource, negative efforts can be, for instance, growing trees or breeding fish, and also beyond these namely, any effort exerted for the sustenance of the resource. In fisheries, the latter can be related to the restriction of fishing gear, closed area management, awareness programs and so on [207]; in forest management it can be related to the restoration of soil fertility, preservation of remnant vegetation, and promoting community forest enterprises [58, 42]. One can imagine similar realizations for other renewable resources. An important implication of the aggregate consumption effort being negative, is that the resource may grow over the natural carrying capacity, i.e., R(τ ) may take on values greater than Rmax , which in the context of the model means that the resource grows beyond the carrying capacity. However even then there is still a limit to how much beyond the natural carrying capacity the resource quantity can be stretched. In the case of forests, for example, using fertilizers and planting trees can act as negative extraction efforts leading to the forest biomass growing over the natural carrying capacity. However, the limited amount of light coming onto the Earth, competition for light between trees and simply the space constraint will not allow the biomass to grow unboundedly and thus there will be some limit to it; similar examples can be envisioned for other resources as well. 4.2.2 The Social Sub-model Here we define the dynamics of the effort ei (τ ) over time. We assume that the change in consumption of each individual, is based on their weighing of two different factors, one pertaining to information about the resource quantity (the ecological factor), and second pertaining to information about the use of others (the social factor) [45]. Which factor gains precedence over the other in the cognitive process of harvesting decisions depends on the individual characteristics of each consumer, depicted here through multiple psychological variables. The final change in consumption is the sum of the ecological and social impacts, where we define the impact as the product of the corresponding factor and its weight. Thus 50 the change in effort is given by dei (τ ) = ecological weighti × ecological factori + social weighti × social factori . dτ In what follows, we specify the ecological & social factors, and the psychological variables that determine the relative weighing of these factors to determine the change in effort ei (τ ). The final equation is given by (4.2). Rutte et al. conclude from their study [168] that consumers harvest more from the resource in abundance than in scarcity. They further observe that harvests for each individual tend to increase over time, except when the resource is scarce, in which case it decreases. We implement this effect in our model by comparing the current resource stock with a perceived-by-the-consumer “scarcity threshold”, denoted as Ri ∈ R. Thus we define the ecological factor for i as the difference R(τ ) − Ri . A positive ecological factor represents an abundant state of the resource, whereas a negative factor represents a scarce state. A scarce resource in the perception of individual i results in a decrease in consumption, whereas an abundant resource results in an increase. Note that that abundance or scarcity represent only the beliefs of the consumers and may or may not depict the objective state of the resource, making it possible for Ri to lie outside the interval [0, Rmax ]. A negative value of Ri simply implies that i considers the resource to always be in abundance no matter how low the actual stock is. Increasingly negative values amplify this effect via the factor R(τ ) − Ri (a similar argument holds for Ri > Rmax ). While Mosler and Brucks [141] assume the scarcity threshold to be constant for the entire population, we generalize by allowing it to be different for each consumer (thereby ascribing more influence of the heterogeneity of consumers). Indeed, consumers with different characteristics (age, sex, social class, political orientation, etc.) also tend to have different levels of environmental concern [119]. In the same study, Rutte et al. [168] show that consumer behavior differs, depending on the extent, to which they attribute scarcity of the resource to nature-induced reasons relative to society-induced reasons. For example in the case of a forest, nature-induced reasons may include less rainfall, volcanic eruption, and so on. Society-induced reasons may include extensive overuse by the consumers, pollution, and other practices that are harmful to the forest. We represent this attribution of i as ai ≥ 0; where ai = 0 represents a consumer, who associates the scarcity of the resource entirely with society, with increasing values 51 of ai representing increasing association of the resource scarcity to nature. As suggested by the aforementioned study, the consumers that attribute the condition of the resource more to nature, tend to give ecological information more importance. Thus we define the ecological weight to be equal to the attribution ai . The ecological impact is therefore given by ai (R(τ )−Ri ), which means that a consumer, who attributes the condition of the resource more to nature (thus having a high value of ai ) will manifest a higher ecological impact, than a consumer, who attributes the condition of the resource to society (having a low value of ai ). In his theory of social comparison processes, Festinger [75] postulates that people are less attracted to situations, where others are very divergent from them, than to situations, where others are close to them regarding both abilities and opinions. Therefore, we define P the social factor by the term nj=1 ωij (ej − ei ) which represents the difference in i’s con- sumption w.r.t all the other connected agents2 . Here ωij > 0 is the directed tie-strength between i and j; it represents the influence that j has on i’s consumption. Furthermore P ωii = 0 and j ωij = 1 ∀ i.. Thus the social factor is a measure of equality, with a low magnitude representing a society with equal consumption (dictating a lesser change in consumption) and a high magnitude representing unequal consumption (dictating a greater change in consumption). Furthermore, a negative social factor represents a higher consumption of the target individual relative to the other consumers (dictating a decrease in the target individual’s consumption) and a positive social factor represents a relatively lower consumption of the target individual (dictating an increase in consumption). The social value of consumer i is represented by si ≥ 0. Here si = 0 represents an extremely non-cooperative individual, with increasing values of si representing an increasingly cooperative individual. A consumer with higher social value will weigh equality more heavily than a consumer with lower social value. The influence of the social value of consumer i, represented by si ≥ 0, is based on the assumption that cooperative individuals are more concerned with maximizing equality and respond with anger to violations in equality regardless of the effect on their own outcomes [196]. Thus the social impact is given by the P  n product si j=1 ωij (ej − ei ) . Thus in our assumed society of n consumers, the following equation gives the change in effort of i as a function of her individual characteristics, the current stock level and the 2 Henceforth, the terms individuals, consumers and agents are used interchangeably. 52 effort of the other consumers. n X dei (τ ) = ai (R(τ ) − Ri ) + si ωij (ej (τ ) − ei (τ )) , dτ (4.2) j=1 where i ∈ {1, . . . , n}. The first term on the right hand side of (4.2) represents the weighted ecological factor, where (R(τ ) − Ri ) is the difference between the perceived optimum and actual level of the stock, which is weighed by the attribution ai . The second term on the P right hand side of (4.2) represents the weighted social factor, where nj=1 ωij (ej − ei ) is the difference in effort between the consumers, which is weighed by the social value si . 4.2.3 The Coupled Socio-ecological System Together (4.1) and (4.2) describe the overall dynamics of the considered socio-ecological system of the consuming population harvesting an open-access resource. In what follows, we undertake some additional transformations, after which the model is able to capture the first principles more accurately, and the new variables have clearer interpretations in terms of the underlying theory. The transformations also reduce the overall dimensionality of the parameter space. Let x(τ ) be the quantity of the resource relative to the carrying capacity Rmax of the R(τ ) environment and yi (τ ) be i’s effort relative to the intrinsic growth rate r: x(τ ) = and Rmax ei (τ ) Ri yi (τ ) = . Define ρi = as i’s scarcity threshold level relative to Rmax . Next define r Rmax t = rτ as the new, non-dimensional time scale. We can now express the system as follows ẋ = (1 − x)x − x  n X yi , i=1 ẏi = bi αi (x − ρi ) − νi n X j=1  (4.3) ωij (yi − yj ) , (ai Rmax + rsi ) ai Rmax rsi , αi = , νi = and the over-dot 2 r (ai Rmax + rsi ) (ai Rmax + rsi ) represents the derivative with respect to time t. Although the original weights ai and si where bi = have different dimensions and thus are incomparable, the new weights αi and νi become dimensionless and can be compared. Furthermore, αi + νi = 1, which means that αi and νi are complements of each other. This reflects the bipolarity in social and physical dimensions as described by the theory underlying the original model [141]. Thus αi can be interpreted 53 as the relevance that i assigns to ecological information and νi can be interpreted as the relevance that i assigns to social information. The state variables x, yi and parameters ρi , bi also become dimensionless. Henceforth, we call αi and νi the ecological and social relevance of i respectively, and ρi the environmentalism of i, where ρi ≤ 0 represents an extremely non-environmental individual and increasing values of ρi correspond to increasing levels of environmental concern. Here bi can be interpreted as the overall susceptibility [82] of i to change in her consumption. All subsequent analysis in this dissertation will be carried out on model (4.3). 4.3 Discussion Leon Festinger’s theory on Social Comparison Processes [75] provides the rationale for Social-Ecological Relevance (SER), which is the core theoretical concept of the model in [141]. SER is one-dimensional and so the preference given to social factors is the complement of that given to ecological factors, which represents the bipolarity between social and physical dimensions. The model that we put forward here also captures this concept as αi and νi can be interpreted as the relative preferences given to the ecological and social factors respectively and as they are the complements of each other they depict the bipolarity inherent in the underlying social comparison process. It is important to note that there also exist some limitations in the model as presented here. First, the psychological parameters of the system have been assumed to be constant over time. Although in some cases a society may exhibit unvarying characteristics [82] for short enough time span, it is understood that in general, societies in the real-world are in a constant state of change. In Chapter 9, we study the dynamics of the environmentalism under the theory of learning in games. Furthermore, the assumption of perfect access of each consumer group, to information on the consumption of the other groups, is obviously restrictive of a true representation of reality. Future work can be directed towards relaxing this assumption, and observing the implications it may have, on the conclusions drawn from the model we put forward here. In the subsequent chapters, we explore the potential applications of the model via different mathematical frameworks in the context of NRM. 54 Chapter 5 Exploiting Community Structure to Create Block-models of Resource Consumption Previously in Chapter 4, we introduced a mathematical model of human decision making in a coupled resource-consumer setting. Here we present a mechanism whereby groups of similar consumers can be aggregated into a single unit provided that certain conditions of homogeneity hold withing the network. Such block models are studied comprehensively for similar processes in sociology [37], as they not only simplify the analysis but also utilize the community structure of the network to present a concise description of the society. After outlining the conditions on the structure of the population that allows us to make these simplifications, we consider societies where those conditions may not be fulfilled. For such cases, we explore an approximate block model that exibits deviations from the true model in the transient, but converges to the exact behavor in the steady state. 55 5.1 Obtaining Simplified Models of Aggregate Consumption The coupled dynamics of the resource and individual consumptions is given by Equation (4.3) which has been reproduced below. ẋ = (1 − x)x − x  n X yi , i=1 ẏi = bi αi (x − ρi ) − νi n X j=1 (5.1)  ωij (yi − yj ) , where i ∈ {1, . . . , n} with n being the total number of consumers. Recall from Chapter 4 that αi ∈ (0, 1) and νi = 1 − αi are the weights that i gives to the ecological and social factors respectively. Furthermore ωij ≥ 0 is the social influence that node j exerts on node P i (see Figure 5-1), with the constraint that nj=1 ωij = 1 and ωii = 0. The n equations for Figure 5-1: The consumption of i is influenced by j through ωij . The overall effect is given by bi νi ωij where νi is the weight that i gives to social factors in the decision making process. the individual consumption rates are given as follows  ẏ1 = b1 α1 (x − ρ1 ) − ν1  ẏ2 = b2 α2 (x − ρ2 ) − ν2  .. . n X j=1 n X ẏn = bn αn (x − ρn ) − νn j=1  ω1j (y1 − yj )  ω2j (y2 − yj ) n X j=1  ωnj (yn − yj ) 56 (5.2) The summation term can be expanded as  ẏ1 = b1 α1 (x − ρ1 ) −  ẏ2 = b2 α2 (x − ρ2 ) − .. .  ẏn = bn αn (x − ρn ) −  n X ω1j ν1 y1 + ω11 ν1 y1 + ω12 ν1 y2 + · · · + ω1n ν1 yn  j=1  n X ω2j ν2 y2 + ω21 ν2 y1 + ω22 ν2 y2 + · · · + ω2n ν2 yn  j=1 n X j=1 (5.3)  ωnj νn yn + ωn1 νn y1 + ωn2 ν2 yn + · · · + ωnn νn yn  Summing up all equations we get n X ẏi = i=1 n X i=1 bi αi (x − ρi )− + n X j=1 n X ω1j b1 ν1 y1 − ωj1 bj νj y1 + j=1 n X j=1 n X j=1 ω2j b2 ν2 y2 − · · · − ωj2 bj νj y2 + · · · + n X j=1 n X ωnj bn νn yn (5.4) ωjn bj νj yn j=1 the summations containing the same consumption rate term can be collected as n X ẏi = i=1 − n X i=1 n X j=1 bi αi (x − ρi ) − n X j=1  ω1j b1 ν1 − ωj1 bj νj y1  ω2j b2 ν2 − ωj2 bj νj y2 − · · · − · · · n X j=1  (5.5) ωnj bn νn − ωjn bj νj yn and can be written in a more compact manner by summing the terms on the R.H.S over a second index as n X i=1 ẏi = n X i=1 bi αi (x − ρi ) + n X n X i=1 j=1 ωji bj νj − ωij bi νi In order to transform this equation into one for true n X j=1  ωji bj νj − ωij bi νi = c; ∀i P  yi (5.6) yi , the following condition must hold (5.7) 57 5.1.1 Influence and Leadership in the Consumer Network In order to understand the condition in (5.7) better, let us analyze the individual terms in the L.H.S of the condition n X j=1 ωji bj νj − n X ωij bi νi (5.8) j=1 To develop some intuition about the individual terms, recall from Figure 5-1 that the effective weight of the edge directed from i to j in the consumption network is ωji bj νj . If this is so then the first term in (5.8) can be viewed as the aggregate social influence that i has on all other members of the network. Let us call this the out-influence of i. Similarly, the second term in (5.8) can be viewed as the aggregate influence on i from all other members of the network. Let us call this the in − inf luence of i. The net-influence of i is then simply her out-influence minus her in-influence and can be viewed as representing i’s role in the network as either a leader (positive net-influence), a follower (negative net-influence) or neutral (zero net-influence). Thus (5.7) states that for all nodes present in the network, their respective net-influence is constant. We now show that condition (5.7) can hold only Figure 5-2: Graphical depiction of net-influence. for c = 0. Lemma 1. The following condition n X j=1  ωij bi νi −ωji bj νj = c, ∀ i ∈ {1, . . . , n}, can hold only for c = 0. 58 Proof. Assuming that the condition holds true, we can expand the expression as follows n X j=1 ωij bi νi − n X ωji bj νj = c. j=1 Summing over all i n X n X i=1 j=1 ωij bi νi − n X n X ωji bj νj = nc. i=1 j=1 Switching the index variables for the second term on the L.H.S n X n X i=1 j=1 n X n X i=1 j=1 ωij bi νi − n X n X ωij bi νi = nc, j=1 i=1  ωij − ωij bi νi = nc ⇒ c = 0, which concludes the proof. Thus in order for condition (5.7) to hold i.e., for a network with constant net-influence, there can exist no leaders or followers in the networks. We call such networks as self-directed networks. With this stipulation in hand, we are now able to define our first canonical network. 5.1.2 The Canonical Networks Previously, the network of the consuming population has been seen at an individual level. Now, we explore the structural effects of the network at two additional levels of abstraction. The homogeneous consumer network allows the abstraction of individual consumptions by viewing the society as a whole. Needless to say, this abstraction comes with a loss of information (in the form of individual consumptions) and additional constraints (explored in the following) that the network must satisfy. The semi-homogeneous and symmetric semihomogeneous consumer networks abstract the individual consumptions at the group level, where it is assumed that the society consists of homogeneous communities with certain regularities prevailing in the influences across groups. In what follows, we define the homogeneous, semi-homogeneous and symmetric semi-homogeneous consumer networks and examine the regularities enforced by each on the structure of the consuming population. 59 Together, we call these three constructs collectively as the canonical consumer networks. The Homogeneous Consumer Network We understand a homogeneous network as one in which (5.7) holds, along with some other requirements stated below. Note that due to Lemma 1, condition (5.7) can hold only for c = 0 (i.e., a self-directed network). The homogeneous network is then given by the following definition. Definition 1. Homogeneous consumer network: A consuming population is said to comprise a homogeneous consumer network if the following conditions hold 1. All agents have uniform attribution ai and social value orientation si i.e., there exist B, A and V such that, ai Rmax = B A ∀ i ∈ {1, . . . , n}, and r2 si bi νi = = B V ∀ i ∈ {1, . . . , n}. r bi αi = 2. All agents have uniform environmentalism i.e., there exists P such that, ρi = P ∀ i ∈ {1, . . . , n}. 3. There are no leaders or followers in the network i.e., n X j=1  ωji bj νj − ωij bi νi = 0 ∀ i ∈ {1, . . . , n}. Moving forward from (5.6) and using Definition 1, the consumption dynamics of the homogeneous network can simply be represented as ẋ = (1 − x)x − xY, (5.9) Ẏ = nB A (x − P), where Y = Pn i=1 yi represents the aggregate consumption of the network. Thus the system is now represented by a two-dimensional system which gives a macro-level view of the 60 society as one single unit. It is important to realize here that due to this aggregation, we lose information on the individual consumptions. The Semi-homogeneous Consumer Network We now assume that the network has m non-overlapping consumer groups with populations Pm given by nk , k ∈ {1 . . . m} respectively, and n = k=1 nk . The groups are classified on basis of their social and ecological relevances, and their environmentalisms. For clarity of notation, let us define the set Nk = {k1 , k2 , . . . , knk } to contain the indices of all consumers belonging to group k. Further more let N = {1, . . . , n} be the set containing the indices of the whole network such that N1 ∪ N2 ∪ · · · ∪ Nm = N. Now consider the nk equations representing the consumption of Group k.  X ẏk1 = bk1 αk1 (x − ρk1 ) − νk1 j∈N ẏk2 = bk2 αk2 (x − ρk2 ) − νk2 j∈N   .. . X  ωk1 j yk1 − yj  ωk2 j yk2 ẏkn = bkn αkn (x − ρkn ) − νkn k k k k  k X   − yj   ωknk j yknk j∈N (5.10)   − yj  Note that we have not yet asserted the homogeneity of the group and have maintained the parameters in their original form for now. The summation term of each equation can now be expanded as ẏk1 = bk1 αk1 (x − ρk1 ) − X ωk1 j νk1 yk1 + ωk1 1 νk1 y1 j∈N + ωk1 2 νk1 y2 + · · · + ωk1 n νk1 yn ẏk2 = bk2 αk2 (x − ρk2 ) − X ! ωk2 j νk2 yk2 + ωk2 1 νk2 y1 j∈N + ωk2 2 νk2 y2 + · · · + ωk2 n νk2 yn ! (5.11) .. . ẏkn = bkn k k αknk (x − ρknk ) − X ωknk j νknk yknk + ωknk 1 νknk y1 j∈N + ωkn k 61 2 νknk y2 + · · · + ωkn k n νknk yn ! summing up all equations we get X ẏi = X i∈Nk i∈Nk − + X j∈N bi αi (x − ρi ) ωk1 j bk1 νk1 yk1 − X j∈N X ωj1 bj νj y1 + j∈Nk X j∈Nk ωk2 j bk2 νk2 yk2 − · · · − ωj2 bj νj y2 + · · · + X X ωknk j bknk νknk yknk j∈N ωjn bj νj yn j∈Nk (5.12) the summations containing the same consumption rate term can be collected as X ẏi = i∈Nk X i∈Nk − − bi αi (x − ρi ) X j∈Nk X j∈Nk  ωk1 j bk1 νk1 − ωjk1 bj νj +  ωk2 j bk2 νk2 − ωjk2 bj νj + X ! ωk1 j bk1 νk1 yk1 j∈N\Nk X ! ωk2 j bk2 νk2 yk2 j∈N\Nk (5.13) .. . − + X j∈Nk X i∈N\Nk  ωknk j bknk νknk − ωjknk bj νj + X ! X ! ωknk j bknk νknk yknk j∈N\Nk ωji bj νj yi j∈Nk combining the terms containing the consumption rates of Group k over a second index we get X ẏi = i∈Nk X i∈Nk − + bi αi (x − ρi ) X i∈Nk X i∈N\Nk X j∈Nk  ωij bi νi − ωji bj νj + X j∈Nk ! ωji bj νj yi 62 X j∈N\Nk ! ωij bi νi yi (5.14) Repeating the procedure for all the groups, we get X X ẏi = i∈N1 bi αi (x − ρi ) i∈N1 X X − X + ! X ! ωij bi νi yi j∈N\N1 ωji bj νj yi j∈N1 i∈N\N1 X ωij bi νi − ωji bj νj + j∈N1 i∈N1  .. . (5.15) .. . X X ẏi = i∈Nm bi αi (x − ρi ) i∈Nm X X − X X + ! ! ωij bi νi yi j∈N\Nm ωji bj νj yi j∈Nm i∈N\Nm X ωij bi νi − ωji bj νj + j∈Nm i∈Nm  Expanding the last summation in each equation with respect to each group, we get the following system Ẏ1 = X bi αi (x − ρi ) i∈N1 − + X X i∈N1 j∈N1 X X i∈N2  X ωij bi νi − ωji bj νj + ! ωji bj νj yi + · · · + j∈N1 ωij bi νi yi j∈N\N1 X X i∈Nm .. . ! ! ωji bj νj yi j∈N1 (5.16) .. . Ẏm = X bi αi (x − ρi ) i∈Nm − + X X ωij bi νi − ωji bj νj + i∈Nm j∈Nm X X i∈N1 where Yk = j∈Nm P i∈Nk  ! ωji bj νj yi + · · · + X ωij bi νi yi j∈N\Nm X i∈Nm−1 ! X j∈Nm ! ωji bj νj yi yi is the aggregate consumption of Group k where k ∈ {1, . . . , m}. Note that the above system, though simplified, is still not expressed purely in-terms of the Yk ’s. It is also easy to see that applying the condition (5.7) alone is not sufficient to achieve this. 63 In the following definition, we describe the additional requirements to do so. The resulting network is called the semi-homogeneous consumer network. Definition 2. Semi-homogeneous consumer network: A consuming population is said to comprise a semi-homogeneous consumer network if the following conditions hold 1. There exist m groups in the network, each of which individually fulfill the conditions for the homogeneous consumer network according to Definition 1. 2. The total in-influence of one group on another group should be uniformly distributed across all nodes of the influenced group i.e., for all i ∈ Ns , there exists d− sr such that X bi νi ωij = Bs Vs j∈Nr X ωij = Bs Vs d− sr , (5.17) j∈Nr where Bs and Vs represent the common sensitivity and social relevance of Group s respectively. 3. The total out-influence of one group from another group should be uniformly distributed across all nodes of the influencing group i.e., for all j ∈ Nr , there exists d+ sr such that, X i∈Ns bi νi ωij = Bs Vs X ωij = Bs Vs d+ sr . (5.18) i∈Ns Moving forward from Equation (5.16) and using Definition 2, the consumption dynamics of the semi-homogeneous network are expressible as Ẏ1 = .. . Ẏm =   − n1 B1 A1 (x − P1 ) − B1 V1 n2 d− 12 + · · · + nm d1m Y1 + + n1 B1 V1 d+ 12 Y2 + · · · + n1 B1 V1 d1m Ym , .. .   − nm Bm Am (x − Pm ) − Bm Vm n1 d− + · · · + n d m−1 m(m−1) Ym m1 + + nm Bm Vm d+ m1 Y1 + · · · + nm Bm Vm dm(m−1) Ym−1 , where Bk , Ak , Vk and Pk represent the psychological characteristics of Group k. Note that although the system dynamics are expressed completely in-terms of the Yk ’s, they still 64 (a) Pictorial representation of (5.17) for a general network. (b) Pictorial representation of (5.18) for a general network. Figure 5-3: Conditions on cross-influence between groups in the semi-homogeneous network do not appear as a scaled version of (5.1). The next canonical network includes a further simplification that enables this. The Symmetric Semi-Homogeneous Network Definition 3. Symmetric semi-homogeneous consumer network: A consuming population is said to comprise a symmetric semihomogeneous consumer network if the following conditions hold 1. There exist m homogeneous groups in the network. Together the m sub-groups fulfill the conditions for the semi-homogeneous consumer network as specified by Definition 2. 2. The size of all connected subgroups are equal, the resulting implication being that the aggregated out-influences and in-influences as defined by (5.17) and (5.18) are equal for each pair of sub-groups, i.e., + d− sr = dsr = Wsr for all s, r ∈ {1, . . . , m}. 65 (5.19) The coupled dynamics for the resource and consumption can now be expressed for the symmetric semi-homogeneous network as follows ẋ = (1 − x)x − x m X Yi , i=1 Ẏi = ni Bi Ai (x − Pi ) − Bi Vi m X j=1 (5.20) Wij (Yi − Yj ), where i ∈ {1, . . . , m}. Note that the homogeneous consumer network given by (5.9) is a special case of the symmetric semi-homogeneous network with m = 1. The utility of the block model (5.20) is that it presents a picture of the society at a community level which can aid in informed decision making at the macro-level. The block model includes the effects of community sizes and the linkages between them, similar to a regular network except that the nodes are not individual consumers but groups of consumers with similar characteristics. Obtaining (5.20) in the same form as the original model (5.9) shows that the block model and aggregation scheme are scalable, and also carries forward the interpretation of system variables and parameters. 5.1.3 Bonding and Bridging in the Symmetric Semihomogeneous Network Here we discuss interpretations of the lumped social ties Wij in the symmetric semihomogeneous consumer network defined by (5.20). From the definition of Wij we have P that j Wij = 1, for all i ∈ {1, . . . , m}, however Wii ≥ 0 ∀ i, as opposed to ωii which is zero by definition. Wii is defined by Wii = 1 − m X Wij = j=1 j6=i X s∈Ni ωrs , for any r ∈ Ni . Thus Wij gives the tie-strength between members of group i, which represents the bonding capital of the group. Conversely Wij , i 6= j represents the bridging capital between the groups. Both these quantities are complementary i.e., a group that has strong bonding will have weak bridging and vice versa which also agrees with observations of real-world communities (see [72]). It is also interesting to note that the aggregated model (5.20) allows the possibility 66 of isolated nodes in the network, which did not exist in the original model. Such a node represents a group that has no bridging capital and maximum bonding capital. 5.2 Aggregation Mechanisms for Non-Canonical Consumer Networks Here we look at aggregation mechanisms for populations that do not satisfy the requirements for the canonical networks presented in Section 5.1.2. We first consider communities that have no leaders or followers as given by condition (iii) of Definition 1. We call the underlying network for such populations a self-directed network. We show for such networks, that one can construct a block-model without any inaccuracies by intelligently selecting the values for the lumped parameters. We then consider aggregation when accurate information about the consumer characteristics may not be available in a self-directed network. 5.2.1 An Aggregation Mechanism for Self-directed Networks Assume a self-directed network, i.e., a population of n consumers in which there are no leaders or followers. Thus the following condition holds n X j=1  ωji bj νj − ωij bi νi = 0 ∀ i ∈ {1, . . . , n}. (5.21) Note that no assumptions have been made yet on the ecological weights αi and the environmentalisms ρi . In what follows, we show that the aggregate consumption dynamics for such a network can be described similar to (5.9) if the choices for the aggregate environmentalism and ecological weight are made appropriately. If (5.21) holds, then the aggregate consumption evolves as Ẏ = n X i=1 =n bi αi (x − ρi ) = n 1X bi αi n i=1  ! = n B̂ x − P̂ , n X i=1 x− bi αi x − n X i=1 n X bi αi ρi , i=1 bi αi Pn j=1 bj αj 67 ρi ! , where the lumped parameters B̂,  and P̂ have been chosen such that n B̂ = 1X bi αi ; n P̂ = i=1 n X i=1 bi αi ρi . Pn b α j j j=1 (5.22) Thus B̂ and  are chosen such that the lumped product B̂ is the average of the individual products bi αi and the lumped environmentalism P̂ is chosen as a convex combination of the individual environmentalisms ρi . It is easy to see that this combination is equal to the equilibrium value of the resource and so P̂ = x̄, where x̄ = limt→∞ x(t) (if the limit exists). Given this aggregation mechanism, the coupled resource and aggregate consumption dynamics are expressible as ẋ = (1 − x)x − xY, Ẏ = n B̂  (x − P̂), (5.23) where B̂,  and P̂ are chosen in accordance to (5.22). 5.2.2 Aggregation for Self-directed Populations with Unknown Characteristics Consider a self-directed consumer network whose dynamics are given by (5.23). If information of the population characteristics are not available, one may aggregate the system as x̃˙ = (1 − x̃)x̃ − x̃Ỹ , Ỹ˙ = n B̃ à (x − P̃), (5.24) where B̃, à and P̃ are chosen at the aggregator’s discretion. One can then define an error vector e = [ex eY ]T such that ex = x − x̃ and eY = Y − Ỹ . From (5.24) and (5.23), the steady state error is expressible as follows ēx = x̄ − P̃, ēY = (1 − x̄) − (1 − P̃), which shows that if P̃ is chosen to be equal to x̄, then the steady state error is zero regardless of the choice of B̃ and Ã. Figure 5-4 shows the behavior of this approximation scheme when the initial conditions are known perfectly. It can be seen that the error exists only during the transient. 68 Figure 5-4: Trajectories of original and approximated aggregated systems when P̃ = x̄, for two different initial conditions. Here n = 100, bi = 1 ∀ i, ωij = 1/n ∀ i 6= j, αi ∼ U(0, 1) and ρi ∼ U(0, 1). This suggests that for systems at steady state for which information on the resource is readily available, one may aggregate such that P̃ = x̄ and choose any estimate for parameters B̃ and Ã. In the event of any disturbances, it is then guaranteed that the error in aggregation will exist only during the transient. 5.3 Discussion In this chapter we have studied the structural effects of the resource consumption model under an aggregation mechanism via homogeneous communities present in the population. The aggregation yields a concise representation of extremely complex networks, which not only makes the analysis tractable, but can also aid in informed decision making at the macro-level. While such block models are frequently employed in practice, in most cases the condition of homogeneity within groups is more of an approximation than ground reality. We have also studied an approximate aggregation scheme for such cases. Building on such techniques, it may be possible to quantify the error of such approximations so that an appropriate level of confidence may be attached to the resulting decisions. The analysis of this chapter has also revealed that the lumped parameter model is simply a scaled version of the original model. This allows us to view the agents in the network generically as groups 69 of consumers since a single individual is simply a group with one member. The question on how different individual actions can be aggregated to obtain social dynamics at the societal level is still an open one, particularly in the context of natural resource governance. The problem however, has attracted the attention of the economics community for quite a while now. One of the first mathematical treatments on the subject is widely attributed to Henri Theil, who published his book “Linear Aggregation of Economic Relations” in 1954 [189]. There he considers the relationship between macro and micro variables, where the micro variables are expressed via certain “observation” variables through a linear relationship. Theil then goes on to determine the implied linear relationship between the macro variables i.e., the sums of the observations and the micro variables. He also considers the errors that may result from aggregation (also see some related publications [94, 138]). A detailed account of the aggregation problem in economics which includes recent developments is given by Green in [92], where a distinction is made between aggregation in the context of production functions, economic relations and welfare maximization. A widely acclaimed result in the latter is given by Arrow’s Impossibility Theorem [132] where Arrow shows that it is impossible to convert individual utilities into a single objective function that simultaneously “satisfies” all individuals. In this chapter, we have studied the aggregation problem for our model of natural resource consumption with a special focus on the underlying social network, an aspect that has not received much attention in the work mentioned above. The work can thus be viewed as a small step towards bridging mathematical network models [34] (that typically use only a small number of nodes) and agent based models [2](that lack tractability) in the domain of natural resource governance. With this, we conclude the modeling exercise of Part II of this dissertation. Part III explores the potential of the model through the application of various mathematical frameworks. As we will see, the exercise yields stimulating insights regarding the system with interesting implications and guidelines for policy making in NRM problems. 70 Part III Cybernetic Insights, Applications and Extensions 71 Chapter 6 Understanding Open-loop System Behavior The preceding chapters have led to a mathematical model of our assumed social-ecological system. Once such a model is obtained, there exist various methods to analyze system performance [81, 109]. In designing an effective control for the system, it is important to have a basic understanding of the process before the application of any feedback mechanism. This not only gives an indication of the required complexity of the control, but also provides a common basis for performance comparison of various control mechanisms. In this chapter, we undertake a time-domain analysis of the system at two different levels of abstraction: the single agent network and the dual agent network (the n-agent network is the focus of Chapter 10). Where applicable, we discuss various social and environmental implications of the results that the undertaken analysis yields. 6.1 The Single-Agent/Homogeneous Network Here we consider the single agent consumer network. The single agent may be thought of as a society with a single consumer, or a homogeneous society (see Chapter 5) lumped into a single node. We reproduce the coupled resource and consumption dynamics as follows ẋ = (1 − x)x − xy, (6.1) ẏ = b α (x − ρ). 72 Here we have dropped the indexed notation for y1 and have simply used y instead since there is only one equation for the social sub-system. 6.1.1 Fixed-point Analysis Natural resources have been essential inputs to economic development, which is considered necessary to overcome world poverty. It has been argued for decades now that “development” cannot imply infinite economic growth, as it has obvious restrictions due to the finite limits of the environment, which houses our economic system [155, 135]. Many influential economists have championed the concept of a steady-state economy, where the question is not that of how to achieve maximum growth, but of how to realize the most attractive equilibrium. In the past, there has been extensive debate on the viability and usefulness for the practice of the concept of the steady-state economy. Some recent studies suggest to interpret the economy’s steady-state as an “unattainable-goal” [111] and to view its analysis as an efficient tool, which is useful to guide the design of the long-term policy for real-world economies. This gives special importance to examining the steady states of mathematical models of economic growth and resource consumption, for providing long-term strategies especially in the context of sustainability. In this spirit, we analyze the equilibrium of (6.1), which is found out to be unique and given as x̄ = ρ, (6.2) ȳ = 1 − ρ. Note that according to the definition of the model in Chapter 4, ρ ∈ R. However, from the form of the resource dynamics (see Equation 6.1), it can be easily seen that for a positive initial resource stock, the stock remains non-negative for all time i.e., if x(0) ≥ 0, then x(t) ≥ 0 ∀ t. Thus, the equilibrium (x̄, ȳ) exists only if ρ ≥ 0, otherwise no equilibrium exists. In the analysis that follows we assume that this condition holds. From Equation 6.2 we further note that the resource stock at equilibrium simply equals the environmentalism ρ. Thus, the higher the environmentalism, the higher the equilibrium stock level. However from 6.2, we also see that higher environmentalism reduces ȳ to the point that if ρ > 1 then ȳ < 0. This means that if the environmentalism is beyond the natural carrying capacity, the stock level will settle at that value, however it will be at the 73 y 1 y 1 0 0 1 1 x x (a) A stable node. Here b = 0.1, ρ = 0.5 and α = 0.5. (b) A stable spiral. Here b = 1, ρ = 0.5 and α = 0.5. y 1 0 1 x (c) A stable degenerate node. Here b = 0.5, ρ = 0.5 and α = 0.25. Figure 6-1: The nature of the fixed point (x̄, ȳ), as the system parameters are varied. cost of a negative aggregate consumption effort for the society. In order for the society to harvest a positive resource stock at steady state, it is then necessary that ρ ∈ (0, 1). 6.1.2 Local Behavior The linearized system around (x̄, ȳ) is given by the matrix   −ρ −ρ bα 0  , 74 whose eigenvalues are given by λ1,2 ρ =− ± 2 p ρ2 − 4bαρ . 2 As ρ > 0, the eigenvalues have negative real part which implies that (x̄, ȳ) is locally stable. The discriminant of the characteristic equation determines how the system approaches the steady state. This categorizes the behavior of the system into three cases (see [41, Chapter 9]) • Case 1): The eigenvalues are real and distinct. In this case ρ > 4bα and the equilibrium is a stable node. • Case 2): The eigenvalues are complex conjugates. In this case ρ < 4bα and the equilibrium is a stable spiral. • Case 3): The eigenvalues are real and repeated. In this case ρ = 4bα and the linearized system has a single independent eigenvector [−2 1]T . In this case, the equilibrium is a stable degenerate node. This suggests that oscillatory system behavior emerges in the case of low environmental concern and high levels of sensitivity & preference to ecological information. The same may be observed from Figure 6-2. ρ < 4bα ρ > 4bα ρ ρ ρ ρ 1 1 1 1 0 1 b= 1 8 α 0 1 b= α 0 1 4 1 b= 1 2 α 0 1 b = 16 Figure 6-2: Regions in the parameter space depecting the nature of the equilibrium for system (6.1). The darkly shaded area represents the oscillatory region whereas the lightly shaded area represents the nodal region. 75 α 6.1.3 Global Behavior Above, we studied the local stability of the equilibrium which implies that there exists at least some region of the phase space, such that if the system is initiated from any point in this region the dynamics asymptotically approach the equilibrium. This region exists as a non-empty neighborhood of the equilibrium. Since there is only a single fixed point of system (6.1), it is possible for this region to cover the entire two-dimensional space. However, since the system is non-linear, there exists the possibility of limit cycles [41, Chapter 9], which can be determined through a global stability analysis. Introduce new variable z = ln x. System (6.1) is then transformed as follows ż = 1 − ez − y, ẏ = bα(ez − ρ). This system has a unique equilibrium which is given by z̄ = ln ρ, ȳ = 1 − ρ. Introducing further new variables p = z − z̄ and q = y − ȳ to bring the equilibrium point to the origin, we obtain the following system ṗ = ρ(1 − ep ) − q, (6.3) q̇ = −bαρ(1 − ep ). Theorem 1. The system (6.3) is globally stable with all solutions tending to zero. Proof. In order to prove the theorem we construct a Lyapunov function of the following form V = (ez − z − 1) + Pq 2 , which is positive for positive P everywhere except the origin. Thus if V̇ is shown to be negative outside the origin for some positive P,, it would imply global stability of (6.3). Differentiating V along the vector field of system (6.3) we get V̇ = ez ż − ż + 2Pq q̇. 76 1 . Note that as ρ has been restricted to be positive, P > 0 so it does not 2bαρ violate the status of V as a Lyapunov function candidate. Substituting this and (6.3) in Choose P = the above equation gives us V̇ = −ρ(ez − 1)2 . Now note that the derivative V̇ < 0 outside the q-axis, and on this axis the vector field of (6.3) has value (−q, 0), which is not tangent to the axis. This implies that the system is globally stable, which completes the proof. 6.2 The Dual-Agent/Semi-Homogeneous Network We now consider consumer network with two agents. The agents may represent individual consumers or groups of consumers with homogeneous characteristics as described in Chapter 5. The consumption dynamics for the two-agent society are given by ẋ = (1 − x)x − (y1 + y2 )x,   ẏ1 = b1 (1 − ν1 )(x − ρ1 ) − ν1 (y1 − y2 ) ,   ẏ2 = b2 (1 − ν2 )(x − ρ2 ) − ν2 (y2 − y1 ) , (6.4) where bi and νi have been redefined during the non-dimensionalization process to include rsi ωij (ni ai Rmax + rsi ωij ) and νi = . ωij . Thus bi = 2 r (ni ai Rmax + rsi ωij ) 6.2.1 Fixed-point Analysis By solving the system given by ẋ = ẏ1 = ẏ2 = 0 (Equation 6.4) we find that the system has a unique equilibrium which is given by x̄ = α1 ν2 ρ1 + α2 ν1 ρ2 , α2 ν1 + α1 ν2 ȳ1 = (1 − ρ1 )α1 ν2 + (1 − ρ2 )α2 ν1 − (ρ1 − ρ2 )α1 α2 , 2 (α2 ν1 + α1 ν2 ) ȳ2 = (1 − ρ1 )α1 ν2 + (1 − ρ2 )α2 ν1 − (ρ2 − ρ1 )α1 α2 . 2 (α2 ν1 + α1 ν2 ) 77 (6.5) Note here that x̄ is a convex combination of the ρi ’s. If the point representing this combination has a negative value, then due to (6.4), x̄ is not reachable if x(0) > 0, and so, no equilibrium exists. Thus, similar to our argument for the single-agent case in the previous section, we will restrict our attention to the case ρ1 , ρ2 ∈ (0, 1). This results in x̄ turning out to lie between 0 and 1 for all admissible parameter values, which ensures a non-negative resource stock that does not exceed the natural carrying capacity at steady state. The efforts ȳi can be either both positive, or have different signs, the interpretation of which has been discussed in Chapter 4. If equilibrium (6.5) is stable, the society converges to a stable resource stock and stable consumption rate regardless of the initial state of the system. Before proceeding with the analysis, let us point out that there are two degenerate cases of the equilibrium (6.5). First, if both groups have extremely low social value, i.e., if ν1 = ν2 = 0, then an infinite number of equilibria exist if the groups are equally environmental (ρ1 = ρ2 ), otherwise no equilibrium exists. Second, if both groups have extremely high social value, i.e., if ν1 = ν2 = 1, then infinite equilibria exist for all values of ρ1 and ρ2 . We ignore these pathological cases in the subsequent analyses. Comparative Statics While the dependence of the equilibrium on the various system parameters was relatively straightforward for the single-agent network, such is not the case for the two-agent network. Here we inspect for system (6.4), how the magnitudes of the steady-state resource quantity x̄ and the steady-state consumption efforts ȳ1 and ȳ2 change in response to changes in the parameters ρ1 , ρ2 , ν1 , and ν2 . We do this by conducting a comparative statics analysis [155], which is undertaken by obtaining the first-order partial derivatives of each of the three equations in (6.5), and determining whether or not an unambiguous sign can be attached to each partial derivative. Table 6.1 shows the results for the analysis. A plus sign means that the derivative is positive, a minus sign means that the derivative is negative, “0” means that the derivative is zero and a “?” means that no sign can be assigned unambiguously to the derivative. From Table 6.1, we see that an increase (decrease) in the levels of environmentalism ρ1 and ρ2 , always increases (decreases) the steady-state resource stock x̄. Thus higher environmentalism results in a larger resource stock at steady-state. In contrast, an increase in the environmentalism ρi of individual i, decreases the steady-state consumption ȳi of 78 Table 6.1: Comparative statics results for system (6.4) x̄ ȳ1 ȳ2 ν1 0 0 0 ν2 0 0 0 ρ1 + ? ρ2 + ? - ρ1 = ρ2 x̄ ȳ1 ȳ2 ν1 + ? ν2 + ? - ρ1 + ? ρ2 + ? - ρ1 > ρ2 x̄ ȳ1 ȳ2 ν1 + ? ν2 ? + ρ1 + ? ρ2 + ? - ρ1 < ρ2 i, which means that environmental individuals consume less at steady-state (the same can be seen in Figure 6-3a). It can also be noted that the effect of ρi on ȳj , where i 6= j, is ambiguous and not much can be said by simply observing the first-order partial derivatives. The effect of the social relevances ν1 and ν2 on the steady state varies according to the relative magnitudes of the environmentalisms ρ1 and ρ2 . When both groups are equally environmental ρ1 = ρ2 then the social values do not affect the steady-state. When this is not the case, the social value of the relatively environmental (non-environmental) group has a negative (positive) effect on the steady-state resource stock. Furthermore, the social value of the relatively environmental (non-environmental) group has a positive (negative) effect on the group’s own steady-state consumption effort (the same can be observed in Figure 6-3b). We see that the effects of the parameters on the relationship between the steadystate consumption efforts are not entirely revealed by this exercise, and require additional analysis to uncover, which is done in the next section. The Free-riding Phenomenon Ostrom’s work [148] reports several real-world examples of free-riding in open-access resource settings, which is a major cause of concern for the successful governance of such resources. The free-riding phenomenon refers to situations where certain individuals (the self-reliants) sacrifice their consumption for the sustenance of the resource, while simultaneously, other individuals (the free-riders) continue to enjoy the benefits of consumption, which would not have been possible without the sacrifice of the self-reliants in the first place. Thus the free-riders enjoy a “free lunch” that is being served in-directly by the self-reliants. System (6.4) captures this through two possible types of equilibrium. We label these two 79 (a) Change in the stock and consumption as the environmentalisms ρ1 and ρ2 are varied. It can be seen that due to group 2’s higher ecological relevance, the resource follows ρ2 more closely. It can also be seen that the relatively environmental group 1 consumes less than the non-environmental group 2. (b) Change in stock and consumption as the social relevances ν1 and ν2 are varied. It can be seen that when the social relevances are identical, the resource converges at the average of the set-points with the nonenvironmental group enjoying a higher consumption. However when one of the group’s social-relevance is relatively lower, the resource converges at the environmentalism of that group. Figure 6-3: Change in steady state stock and consumption efforts in the twocommunity model, as the population characteristics are varied. The nominal values selected for this simulation are b1 = b2 = 1, ν1 = 0.75, ν2 = 0.25, ρ1 = 0.75, ρ2 = 0.25 and x(0) = 0.5 and y1 (0) = y2 (0) = 0. types as the “self-reliant” equilibrium and the “free-riding” equilibrium. The self-reliant equilibrium represents both consumer groups harvesting at a positive rate (both ȳ1 and ȳ2 of (6.5) are positive). The free-riding equilibrium represents one of the groups harvesting at a positive rate and the other harvesting at a negative rate (one of ȳ1 and ȳ2 is positive, while the other negative). Thus one of the groups exerts effort into increasing the resource quantity, while the other free-rides and enjoys a positive consumption. An exhaustive simulation of the equilibrium consumption values in the parameter space is shown in Figure 6-4. We see that free-riding is excluded only when both groups have the same environmentalism level ρi . When groups are different in what concerns their environmentalism, the equilibrium is self-reliant if the group corresponding to the higher level of environmentalism has a social relevance beyond a certain level. This level can be interpreted as the reluctance of the relatively environmental group to subsidize the consumption of the relatively nonenvironmental group. The reluctance increases with increasing levels of social relevance, and indirectly with the level of cooperativeness of the environmental group. Thus the more 80 self-reliant (stable) 1 unstable free-riding (stable) 1 ρ2 ν1 +ν2 2 ν2 ν1 0 -1 1 1 ν1 +ν2 2 ν1 +ν2 2 ν2 ν1 0 ν2 0 ν1−ν2 1 -1 1 1 1 ν1 +ν2 2 ν1 +ν2 2 ν1 +ν2 2 ν2 ν1 0 ν2 ν1 0 -1 0 ν1−ν2 1 1 ν1 0 -1 0 0 ν1−ν2 0 ν1−ν2 ν2 1 ν1 0 -1 0 ν1−ν2 1 -1 0 ν1−ν2 1 ρ1 0 1 Figure 6-4: Positivity of the equilibrium (6.5) in the ν1 , ν2 plane for different values of ρ1 and ρ2 . The plots are symmetric in ρ1 and ρ2 and so the missing plots are simply a reflection of the existing plots about the symmetric axis. The free-riding equilibrium corresponds to ȳ1 < 0 < ȳ2 . cooperative a group becomes (consequently possessing a higher social relevance) the more reluctant it is to subsidize the non-environmental group. This is consistent with the postulate that cooperative individuals promote equality, and favor outcomes which maximize joint benefits (contrasted with altruistic individuals, who willingly sacrifice their own benefit in order to maximize the benefit of others). Interestingly, it has been observed that cooperative individuals are also likely to have high levels of environmentalism and vice-versa [67, 87], which in the context of our model implies that it is really the social relevance of 81 the groups that determines whether they end up in a self-reliant or free-riding equilibrium. 6.2.2 Local Behavior The local stability of the equilibrium point of system (6.4) can be found by examining the eigenvalues of the linearized system about that point. The Jacobian matrix is given by      1 − 2x − y1 − y2 −x −x b1 α1 −b1 ν1 b1 ν1 b2 α2 b2 ν2 −b2 ν2    .  Evaluation at the equilibrium (x̄, ȳ1 , ȳ2 ) results in      +α2 ν1 ρ2 − α1αν22νρ11 +α 1 ν2 +α2 ν1 ρ2 − α1αν22νρ11 +α 1 ν2 2 ν1 ρ2 − α1αν22νρ11 +α +α1 ν2 b1 α1 −b1 ν1 b1 ν1 b2 α2 b2 ν2 −b2 ν2    ,  whose eigenvalues are given by the roots of the following characteristic polynomial   1 (b1 ν1 + b2 ν2 )(α2 ν1 + α1 ν2 ) + α2 ν1 ρ2 + α1 ν2 ρ1 λ2 α2 ν1 + α1 ν2 (6.6)  α2 ν1 ρ2 + α1 ν2 ρ1  + b1 + b2 λ + 2b1 b2 (α2 ν1 ρ2 + α1 ν2 ρ1 ). α2 ν1 + α1 ν2 p(λ) =λ3 + the final expressions for the roots of this polynomial are not simple enough to work with analytically. It can be noted however that all the coefficients of p(λ) are positive, which is a necessary (but not sufficient) condition for all roots to be negative and hence the linearized system to be stable. Whether or not the equilibrium is indeed stable can be checked by Routh’s Stability Criterion [81], which for cubic polynomials of the form ax3 + bx2 + cx + d is given by bc > ad. For p(λ), this inequality is given as   α2 ν1 ρ2 + α1 ν2 ρ1 (b + b ) (b ν + b ν )(α ν + α ν ) + α ν ρ + α ν ρ 1 2 1 1 2 2 2 1 1 2 2 1 2 1 2 1 (α2 ν1 + α1 ν2 )2 > 2b1 b2 (α2 ν1 ρ2 + α1 ν2 ρ1 ), 82 complex conjugate real and positive 1 ν2 0 ν1 1 Figure 6-5: Evaluation of the roots of q(·). which is simplified to   b1 + b2 (b ν + b ν )(α ν + α ν ) + α ν ρ + α ν ρ − 2b1 b2 > 0. 1 1 2 2 2 1 1 2 2 1 2 1 2 1 (α2 ν1 + α1 ν2 )2 (6.7) It can be checked that (6.7) does not hold for all b1 , b2 , ρ1 , ρ2 , ν1 , ν2 . An example of one such point in the parameter space is b1 = 0.2, b2 = 0.1, ρ1 = 0.001, ρ2 = 0.1, ν1 = 0.01, ν2 = 0.9. On the other hand, the following inequality (b1 + b2 )(b1 ν1 + b2 ν2 ) > 2b1 b2 , (α2 ν1 + α1 ν2 ) (6.8) clearly offers a sufficient condition for (6.7) to hold. It can be simplified to  q(b) = ν1 b2 + ν1 (2ν2 − 1) + ν2 (2ν1 − 1) b + ν2 > 0, (6.9) where b = b1 /b2 . Note that the right hand side of (6.9) is a quadratic polynomial in b > 0. As νi > 0, the graph of q(·) points upwards and the roots are either complex conjugates or both real and positive. In what follows we examine the implications of each case in detail. 1. Case 1: q(·) has complex conjugate roots i.e., the discriminant is negative. 2 ν1 (2ν2 − 1) + ν2 (2ν1 − 1) − 4ν1 ν2 < 0. 83 (6.10) In this case (6.9) will always hold as the graph of the quadratic polynomial will lie above the horizontal axis. 2. Case 2: q(·) has both roots real and positive. This happens if 2 ν1 (2ν2 − 1) + ν2 (2ν1 − 1) − 4ν1 ν2 ≥ 0, (6.11) and −ν1 (2ν2 − 1) − ν2 (2ν1 − 1) > 0 (6.12) In this case (6.9) does not hold for those b which lie between the roots of q(·). Thus (6.10) is a sufficient condition for local stability. However if (6.10) does not hold, then the system is stable if (6.11) and (6.12) hold true and b does not lie between the roots of q(·). The region in the parameter space where these inequalities hold true are shown in stable ρ1 = 0.001 1 ν2 1 ν2 0 ρ1 = 0.01 ν1 1 0 b1 = 0.1 0 ν1 1 ρ1 = 0.05 1 ν2 ν1 1 0 b1 = 1 1 ν2 1 ν2 0 unstable 0 b1 = 2 1 ν2 ν1 1 0 1 ν2 1 ν2 ν1 1 ν1 1 0 0 ν1 1 ρ1 b1 = 10 b1 = 5 1 ν2 1 ν2 ν1 1 ρ1 = 0.5 ρ1 = 0.1 ν1 1 0 ν1 1 b1 Figure 6-6: Here we evaluate the local stability of (6.4), through inequality (6.7), as the parameters are varied. The nominal values for the parameters are b1 = 0.2, b2 = 0.1, and ρ1 = ρ2 = 0.1. The plots obtained by interchanging the indices of the groups are symmetric to the ones displayed above and thus are not shown here. 84 Figure 6-5. Figure 6-6 shows a numerical simulation in the space ν1 , ν2 ∈ (0, 1) to determine when condition (6.7) holds. We see that stability is guaranteed in a major portion of the (ν1 , ν2 ) space regardless of the values of the rest of the parameters. Also note that for small values of ρ1 , ρ2 , (6.7) may be approximated by (6.8). 6.2.3 Global Behavior Here we consider the global stability properties of the fixed point (6.5) for system (6.4). We do this by transforming the system to an appropriate form and prove the validity of a Lyapunov function candidate. We proceed as follows. Introduce new variables z̃ = ln x, ũ = y1 + y2 and w̃ = y1 − y2 . System (6.4) is then transformed as follows z̃˙ = 1 − ez̃ − ũ, ũ˙ = A(ez̃ − 1) + D + bw̃, w̃˙ = a(ez̃ − 1) − d − Bw̃, where A = b1 (1−ν1)+b2 (1−ν2), a = b1 (1−ν1)−b2 (1−ν2), B = b1 ν1 +b2 ν2 , b = −b1 ν1 +b2 ν2 , D = b1 (1−ν1)(1 − ρ1 ) + b2 (1−ν2)(1 − ρ2 ) and d = −b1 (1−ν1)(1 − ρ1 ) + b2 (1−ν2)(1 − ρ2 ). It is easy to verify the following relations between the parameters which we will make use of later on |a| < A, |b| < B, and |d| < D. (6.13) Now, introduce the new variable û = ũ + Bb w̃. The system is then expressible as b z̃˙ = 1 − ez̃ − û + w̃,   B   ba db z̃ ˙û = A + (e − 1) + D − , B B w̃˙ = a(ez̃ − 1) − d − Bw̃. 85 This system has a unique equilibrium which is given by     1 DB − bd DB − bd , w̄ = −a −d , z̄ = ln 1 − AB + ba B AB + ba DB − bd b ū = + w̄. AB + ba B Introducing further new variables z = z̃ − z̄, u = û − ū and w = w̃ − w̄ to bring the equilibrium point to the origin, we obtain the following system b ż = ez̄ (1−ez )−u+ w, B   ba z̄ z e (e −1), u̇ = A+ B (6.14) ẇ = aez̄ (ez − 1) − Bw. Theorem 2. The system (6.14) is globally stable with all solutions tending to zero if the following condition holds true B2 > ab. Proof. In order to prove the theorem we construct a Lyapunov function of the following form V = (ez − z − 1) + Pu2 + Qw2 , which is positive for positive P, Q everywhere except the origin. Thus if V̇ is shown to be negative outside the origin for some positive P, Q, it would imply global stability of (6.14). Differentiating V along the vector field of system (6.14) we get V̇ = ez ż − ż + 2Puu̇ + 2Qwẇ. Choose P = e−z̄ /(2 (A + ba/B)). Due to (6.13), P > 0 so it does not violate the status of V as a Lyapunov function candidate. Substituting this and (6.14) in the above equation gives us z̄ z 2 z V̇ = −e (e − 1) +w(e − 1)   b z̄ + 2Qae −2QBw2 . B 86 Completing squares, we get  !2 we−z̄/2 b z̄ e (e − 1) − + 2Qae 2 B  2 ! e−z̄ b z̄ 2QB − w2 . + 2Qae 4 B z̄/2 V̇ = − − z  2 e−z̄ b z̄ Now the condition 2QB − > 0 gives the derivative V̇ < 0 outside the + 2Qae 4 B u-axis, and on this axis the vector field of (6.14) has value (−u, 0, 0), which is not tangent to the axis. Hence we get the desired global stability if this condition takes place, i.e., the above inequality is true for some positive Q, B. This condition can be expressed as    2  b2 ab 2 z̄ p e Q := 4a e Q + −8B+4 ez̄ Q + 2 < 0. B B z̄ Now, if a = 0, the inequality holds for any B > 0 by choosing Q to be sufficiently large. However if a 6= 0 then due to 4a2 > 0 and b2 /B2 ≥ 0, the inequality holds true for some positive Q, B only if the vertex of the respective parabola belongs to the fourth quadrant, i.e., 1 − 2 8a  ab −8B + 4 B  > 0, and − ∆ < 0, 16a2 where ∆ is the discriminant of p (ez̄ Q). This translates to the following two conditions: 1) −2B2 + ab < 0, and 2) B2 − ab > 0, or simply B2 > ab, (6.15) which completes the proof. Substituting the values of a, b and B in condition (6.15) gives us the following  (b1 ν1 +b2 ν2 )2 > b1 (1−ν1 )−b2 (1−ν2 ) (−b1 ν1 +b2 ν2 ). After some simplification and realization that b1 , b2 , ν1 and ν2 are all positive numbers, a 87 0.65 1.2 0.8 y2 1 0.55 y2 0.6 0.5 0.45 0.6 0.4 0.4 0.7 0.2 1.5 0.04 0.6 y1 0.15 1 0.03 0.1 0.02 0.5 0.01 0.4 0 0 −0.01 0.05 0.5 y1 x (a) Starting from inside the limit cycle. Here x(0) = 0.001, y1 (0) = 0.5 and y2 (0) = 0.5. 0 −0.05 x (b) Starting from outside the limit cycle. Here x(0) = 0.1, y1 (0) = 1 and y2 (0) = 0.3. Figure 6-7: The limit cycle of system (6.4). Here b1 = 0.2, b2 = 0.1, ν1 = 0.01, ν2 = 0.9, ρ1 = 0.001 and, ρ2 = 0.1. The red marked points indicate the fixed point and the initial point for the respective simulations. sufficient condition for the above condition to hold is (b1 − b2 )(b1 ν1 − b2 ν2 ) + 4b1 ν1 b2 ν2 > 0. (6.16) Figure 6-7 depicts an instance in the parameter space where the system (6.4) is unstable. Indeed, we see the existence of a stable limit cycle in this case. 6.3 Discussion This chapter presented a time-domain analysis of the social ecological system introduced in Chapters 4 and 5. We studied first, the single-agent network as an instance of the homogeneous consumer network. We saw how the level of environmentalism determined a trade-off between the levels of resource stock and consumption at steady state and the role of various parameters influenced the manner in which the system approached the steady state. In Chapter 7 we will continue with the same model by examining the optimal consumption paths under a defined notion of optimality. We then, in this chapter, studied the two agent network, as an instance of the symmetric semi-homogeneous network with two consumer groups. We saw that the analysis was mathematically more involved than the single agent 88 case. The addition of another agent in the single agent network brought about the phenomenon of free-riding, something which was not possible in the single agent case. We saw how free-riding could be discouraged and also examined the local and global behavior of the system. We return to this network in Chapter 8 where we analyze strategic interactions between the two agents in a game-theoretic context. As indicated by the analysis in this chapter, the analysis for the n-agent network is mathematically more involved, and has been deferred to Chapter 10 as a possible extension. 89 Chapter 7 Optimal Consumption for a Homogeneous Society In this chapter we return to the most basic block model, namely the homogeneous consumer network of Chapter 5 with the consuming society aggregated as one single agent. The timedomain behavior of the open-loop system has already been studied in Chapter 6. We now turn our attention to the “best” consumption pattern on behalf of the consumers. We do this by framing the system as an optimal growth model for a single resource based economy. More precisely, the system is formulated as an infinite-horizon optimal control problem with unbounded set of control constraints and non-concave Hamiltonian. We then characterize the optimal paths for all possible parameter values and initial states by applying the appropriate version of the Pontryagin maximum principle. Our main finding is that only two qualitatively different types of behavior of sustainable optimal paths are possible depending on whether the social discount rate is greater than a specific threshold or not. An analysis of these behaviors yields a general criterion for sustainable and strongly sustainable optimal growth (w.r.t. the corresponding notions of sustainability defined herein). 7.1 Considerations for Studying Optimal Behavior Following the first analysis conducted by Ramsey [163], the mathematical problem of intertemporal resource allocation1 has attracted a significant amount of attention over the past decades, and has driven the evolution of first exogenous, and then endogenous growth the1 The problem of distributing the resource fairly among the present and all future generations 90 ory (see [1, 25]). Employed growth models are typically identified by the production of economic output, the dynamics of the inputs of production, and the comparative mechanism of alternate consumption paths. Our framework considers a renewable resource, whose reproduction is logistic in nature, as the only input to production. The relationship of the resource with the output of the economy is explained through a Cobb-Douglas type production function with an exogenously driven knowledge stock. Alternate consumption paths are compared via a discounted utilitarian approach. The question that we concern ourselves with for our chosen framework, is the following: what are the conditions of sustainability for optimal development? In the context of sustainability, the discounted utilitarian approach may propose undesirable solutions in certain scenarios. For instance, discounted utilitarianism has been reported to force consumption asymptotically to zero even when sustainable paths with non-decreasing consumption are feasible [18]. The Brundtland Commission defines sustainable development as development that meets the needs of the present, without compromising the ability of future generations to meet their own needs [47]. In this spirit, we employ the notion of sustainable development, as a consumption path ensuring a non decreasing welfare for all future generations. This notion of sustainability is natural, and has also been used by various authors in their work. For instance, Valente [195] evaluates this notion of sustainability for an exponentially growing natural resource, and derives a condition necessary for sustainable consumption. We extend this model by allowing the resource to grow at a declining rate (the logistic growth model). We build on the work presented previously in [127] which proves the existence of an optimal path only in the case when the resource growth rate is higher than the social discount rate and admissible controls are uniformly bounded. Our model is formulated as an infinite-horizon optimal control problem with logarithmic instantaneous utility. The problem involves unbounded controls and the non-concave Hamiltonian. These preclude direct application of the standard existence results and Arrow’s sufficient conditions for optimality. We transform the original problem to an equivalent one with simplified dynamics and prove the general existence result. Then we apply a recently developed version of the maximum principle [12, 17, 13] to our problem and describe the optimal paths for all possible parameter values and initial states in the problem. Our analysis of the Hamiltonian phase space reveals that there are only two qualitatively differ91 ent types of behavior of the sustainable optimal paths in the model. In the first case the instantaneous utility is a non-decreasing function in the long run along the optimal path (we call such paths sustainable). The second case corresponds to the situation when the optimal path is sustainable and in addition the resource stock is asymptotically nonvanishing (we call such paths strongly sustainable). We show that a strongly sustainable equilibrium is attainable only when the resource growth rate is higher than the social discount rate. When this condition is violated, we see that the optimal resource exploitation rate asymptotically follows the Hotelling rule of optimal depletion of an exhaustible resource [102]. In this case optimal consumption is sustainable only if the the depletion of the resource is compensated by appropriate growth of the knowledge stock and/or decrease of the output elasticity of the resource. 7.2 Formulating the Consumption Problem in an Optimal Control Setting Here we depart from the lumped parameter model of Section 5.1.2 where the aggregate consumption effort of the society is contained in the single variable y(t). Thus there exists only a single agent where the agent may represent a single consumer, or a homogeneous community in the sense defined in Chapter 5. In this chapter we will frequently refer to this agent as “society” with the understanding that the case of the single consumer is also captured by this term (a single consumer is simply a society with one member). Maintaining the previous notation, the normalized (w.r.t the carrying capacity) level of the resource stock at time t is given by x(t) > 0 and is governed by the standard model of logistic growth. The society consumes the resource by exerting some effort, the normalized (w.r.t the resource growth rate) level of which is represented by y(t) > 02 . The dynamics of the resource stock are then given by the following equation: ẋ(t) = x(t) (1 − x(t)) − y(t)x(t), y(t) ∈ (0, ∞). (7.1) The initial stock of the resource is x(0) = x0 > 0. 2 Note that while in the original model given by (4.3) the efforts yi (t) may take on negative values, here we restrict y(t) to be non-negative. This is because in the context of sustainable growth, we are only interested in cases where society collectively consumes positive quantities of the resource (although individual consumers may consume negative quantities). 92 We assume that the economy is a single resource economy whose output is represented by P (t) > 0 at instant t ≥ 0. The output is related to the resource by a Cobb-Douglas type production function (see Appendix B) as follows β P (t) = S(t) y(t)x(t) , β ∈ (0, 1]. (7.2) Here S(t) > 0 represents an exogenously driven knowledge stock at time t ≥ 0. We assume Ṡ(t) ≤ µS(t), where µ ≥ 0 is a constant, and S(0) = S0 > 0. Furthermore, it is assumed that the whole output P (t) produced at each instant t ≥ 0 is consumed. The total discounted value of the growth of the production function P (.) along (x(.), y(.)) is given by ˜ J(x(.), y(.)) = Z ∞ e−δt 0 Ṗ (t) dt = − ln P (0) + δ P (t) Z ∞ e−δt ln P (t) dt, 0 where δ > 0 is the subjective discount rate. Thus maximizing the total discounted value of the growth of output P (t) is equivalent to maximizing the following objective function 0 J (x(.), y(.)) = Z ∞ 0 = Z e−δt ln P (t) dt, ∞ −δt e 0 J(x(·), y(·)) = Z ∞ ∞ e−δt [ln x(t) + ln y(t)] dt, 0 Neglecting constant term thus set up as ln S(t) dt + β Z R∞ 0 e−δt ln S(t) dt and scalar multiplier β, our final objective is e−δt [ln x(t) + ln y(t)] . 0 7.2.1 The Optimal Control Problem The above exposition leads to the following optimal control problem (P 1): J(x(·), y(·)) = Z 0 ∞ e−δt [ln x(t) + ln y(t)] dt → max, ẋ(t) = x(t) (1 − x(t)) − y(t)x(t), y(t) ∈ (0, ∞), x(0) = x0 , (7.3) (7.4) (7.5) 93 Now, by an admissible control in problem (P 1) we mean a Lebesgue measurable locally bounded function y : [0, ∞) 7→ R1 which satisfies the control constraint (7.5) for all t ≥ 0. By definition, the corresponding to y(·) admissible trajectory is a (locally) absolutely continuous function x(·) : [0, ∞) 7→ R1 which is a Caratheodory solution (see [77]) to the Cauchy problem (7.4) on the whole infinite time interval [0, ∞). Due to the local boundedness of the admissible control y(·) such admissible trajectory x(·) always exists and is unique (see [77, Section 7]). A pair (x(·), y(·)) where y(·) is an admissible control and x(·) is the corresponding admissible trajectory is called an admissible pair in problem (P 1). 7.2.2 Establishing the Notion of Optimality Due to (7.4) for any admissible trajectory x(·) the following property holds: x(t) ≤ xmax = max{x0 , 1}, t ≥ 0. (7.6) The integral in (7.3) is understood in improper sense, i.e. J(x(·), y(·)) = lim Z T →∞ 0 T e−δt [ln x(t) + ln y(t)] dt (7.7) if the limit exists. Now, in order to establish a notion of optimality, we must first prove that the limit in the above expression exists. For this, we will require the following intermediate result. Lemma 2. There is a decreasing function ω : [0, ∞) 7→ (0, ∞) such that ω(t) → +0 as t → ∞ and for any admissible pair (x(·), y(·)) the following inequality holds: Z T0 e−δt [ln x(t) + ln y(t)] dt < ω(T ), 0 ≤ T < T 0. T Proof. Indeed, due to inequality ln x < x, x > 0, for arbitrary 0 ≤ T < T 0 we have Z T0 e−δt [ln x(t) + ln y(t)] dt < T Z T0 e−δt y(t)x(t) dt. T Hence, substituting expression of x(t)y(t) from (7.4) in the inequality above we get Z T0 T −δt e [ln x(t)) + ln y(t)] dt < Z T0 T e−δt [x(t) (1 − x(t)) − ẋ(t)] dt. 94 (7.8) This implies Z T0 e−δt [ln x(t) + ln y(t)] dt < T ≤ xmax Z T0 T e−δt dt − Z Z T0 T T0 e−δt [x(t) − ẋ(t)] dt, e−δt ẋ(t) dt, T Z T0 T0 xmax −δT −δT −δt = e −e − e x(t) − δ e−δt x(t) dt, δ T T (1 + δ)x xmax −δT max −δT e + e−δT xmax = e = ω(T ), < δ δ   0 which completes the proof. Now, let us show that for any admissible pair (x(·), y(·)) the limit in (7.7) exists. Lemma 3. For any admissible pair (x(·), y(·)) the limit in (7.7) exists and is either finite or equals −∞. Proof. Let (x(·), y(·)) be an arbitrary admissible pair. For any T > 0 define JT (x(·), y(·)) as follows: JT (x(·), y(·)) = Z T e−δt [ln x(t) + ln y(t))] dt. 0 Let {ζi }∞ i=1 be a sequence of positive numbers such that ζi → ∞ as i → ∞ and lim Jζi (x(·), y(·)) = lim sup i→∞ T →∞ Z T e−δt [ln x(t) + ln y(t)] dt. 0 Due to Lemma 2 we have the following estimate lim Jζi (x(·), y(·)) ≤ ω(0). (7.9) i→∞ Analogously, let {τi }∞ i=1 be a sequence of positive numbers such that τi → ∞ as i → ∞ and lim Jτi (x(·), y(·)) = lim inf i→∞ T →∞ Z T e−δt [ln x(t) + ln y(t)] dt. 0 Without loss of generality one can assume that τi < ζi , i = 1, 2, . . . . Then we have Jζi (x(·), y(·)) = Jτi (x(·), y(·)) + Z ζi e−δt [ln x(t) + ln y(t)] dt, τi 95 i = 1, 2, . . . . Due to Lemma 2 this implies Jζi (x(·), y(·)) < Jτi (x(·), y(·)) + ω(τi ), i = 1, 2, . . . . Since ω(τi ) → 0 as i → ∞ taking the limit in the last inequality as i → ∞ we get lim sup T →∞ Z T −δt e 0 [ln x(t) + ln y(t))] dt ≤ lim inf T →∞ Z T e−δt [ln x(t) + ln y(t))] dt. 0 As far as the opposite inequality lim inf T →∞ Z T e 0 −δt [ln x(t) + ln y(t))] dt ≤ lim sup T →∞ Z T e−δt [ln x(t) + ln y(t))] dt 0 is always true, the limit (7.7) exists, and due to (7.9) this limit is either finite or −∞. Due to (7.9) for any admissible pair (x(·), y(·)) the value sup(x(·),y(·)) J(x(·), y(·)) is finite. This allows us to understand the optimality of an admissible pair (x∗ (·), y∗ (·)) in the strong sense [52]. By definition, an admissible pair (x∗ (·), y∗ (·)) is strongly optimal (or, for brevity, simply optimal ) in the problem (P 1) if the functional (7.3) takes the maximal possible value on this pair , i.e. J(x∗ (·), y∗ (·)) = sup (x(·),y(·)) J(x(·), y(·)) < ∞. Notice, that the set of control constraints in problem (P 1) (see (7.5)) is nonclosed and unbounded. Due to this circumstance the standard existence theorems (see e.g. [22, 56]) are not applicable to problem (P 1) directly. Moreover, the situation is complicated here by the fact that the Hamiltonian of problem (P 1) is non-concave in the state variable x. These preclude the usage of Arrow’s sufficient conditions for optimality (see [52]). Our analysis below is based on application of the recently developed normal form version of the Pontryagin maximum principle [159] for infinite-horizon optimal control problems with adjoint variable specified explicitly via the Cauchy type formula (see [12, 17, 13]). However, such approach assumes that the optimal control exists. So, the proof of the existence of an optimal admissible pair (x∗ (·), y∗ (·)) in problem (P 1) and establishing of the corresponding version of the maximum principle will be our primary goal in the next section. 96 7.3 Reduction to a Problem with Linear Dynamics Let us transform problem (P 1) into a more appropriate equivalent form. Due to (7.4) along any admissible pair (x(·), y(·)) we have i d h −δt a.e. e ln x(t) = −δe−δt ln x(t) + e−δt − e−δt (x(t) + y(t)) , dt t > 0. Integrating this equality on arbitrary time interval [0, T ], T > 0, we obtain Z T e−δt ln x(t) dt = 0 ln x0 − e−δT ln x(T ) δ    Z T y(t) 1  −δt 1 −δT e − x(t) + dt. + 2 1−e δ δ δ 0 Hence, for any admissible pair (x(·), y(·)) and arbitrary T > 0 we have Z T  ln x0 − e−δT ln x(T ) 1  + 2 1 − e−δT δ δ   Z T Z T 1 y(t) −δt −δt − e x(t) dt + e ln y(t) − dt. (7.10) δ 0 δ 0 e−δt [ln x(t) + ln y(t)] dt = 0 Here due to estimate (7.9) limits of the both sides in (7.10) as T → ∞ exist and equal either a finite number or −∞ simultaneously, and due to (7.6) either (i) limT →∞ e−δT ln x(T ) = 0 or (ii) lim inf T →∞ e−δT ln x(T ) < 0. In the case (i) passing to the limit in (7.10) as T → ∞ we get Z ∞ 0 ln x0 1 + 2 e−δt [ln x(t) + ln y(t)] dt = δ δ   Z Z ∞ 1 ∞ −δt y(t) −δt − e x(t) dt + e ln y(t) − dt, (7.11) δ 0 δ 0 where both sides in (7.11) are equal to a finite number or −∞ simultaneously. In the case (ii) condition lim inf T →∞ e−δT ln x(T ) < 0 implies Z 0 ∞ e−δt [ln x(t) + ln y(t)] dt = lim Z T T →∞ 0 e−δt [ln x(t) + ln y(t)] dt = −∞ (see [10] for details). Hence, in the case (ii) (7.11) also holds as −∞ = −∞. Neglecting now the constant terms in the right-hand side of (7.11) we obtain the fol- 97 lowing optimal control problem (P̃ 1) which is equivalent to (P 1): ˜ J(x(·), y(·)) = Z ∞ 0   y(t) 1 e−δt ln y(t) − − x(t) dt → max, δ δ ẋ(t) = x(t) (1 − x(t)) − y(t)x(t), x(0) = x0 , y(t) ∈ (0, ∞). (7.12) (7.13) (7.14) Further, the function y 7→ ln y − y/δ is increasing on (0, δ] and it reaches the global maximum at point y∗ = δ. Hence, any optimal control y∗ (·) in (P̃ 1) (if such exists) must satisfy the inequality y∗ (t) ≥ δ for almost all t ≥ 0. Hence the control constraint (7.14) in (P̃ 1) (and also the control constraint (7.5) in (P 1)) can be replaced by the control constraint y(t) ∈ [δ, ∞). Thus we arrive to the following (equivalent) problem (P 2): J(x(·), y(·)) = Z ∞ 0 e−δt [ln y(t) + ln x(t)] dt → max, ẋ(t) = x(t) (1 − x(t)) − y(t)x(t), x(0) = x0 , y(t) ∈ [δ, ∞). (7.15) (7.16) (7.17) Here the class of admissible controls in problem (P 2) consists of all locally bounded functions y(·) satisfying the control constraint (7.17) for all t ≥ 0. To simplify dynamics in (P 2) let us introduce the new state variable z(·): z(t) = 1/x(t), t ≥ 0. As can be verified directly, in terms of the state variable z(·) problem (P 2) can be rewritten as the following (equivalent) problem (P 3): J(z(·), y(·)) = Z 0 ∞ e−δt [ln y(t) − ln z(t)] dt → max, ż(t) = [y(t) − 1] z(t) + 1, z(0) = z0 = y(t) ∈ [δ, ∞). 1 , x0 (7.18) (7.19) (7.20) The class of admissible controls y(·) in (P 3) consists of all measurable locally bounded functions y : [0, ∞) 7→ [δ, ∞). Notice, that due to linearity of (7.19) for arbitrary admissible control y(·) the corre- 98 sponding trajectory x(·) can be expressed via the Cauchy formula (see [99]): z(t) = z0 e Rt 0 y(ξ) dξ−t +e Rt 0 y(ξ) dξ−t Z t e− Rs 0 y(ξ) dξ+s ds, 0 t ≥ 0. (7.21) Since the problems (P 1), (P 2) and (P 3) are equivalent we will focus our analysis below on problem (P 3) with simplified dynamics (see (7.19)) and the closed set of control constraints (see (7.20)). 7.4 Existence of an Optimal Control and the Maximum Principle The constructed problem (P 3) is a particular case of the following autonomous infinitehorizon optimal control problem (P 4) with exponential discounting: J(z(·), y(·)) = Z 0 ∞ e−δt g(z(t), y(t)) dt → max, ż(t) = f (z(t), y(t)), z(0) = z0 , y(t) ∈ U. (7.22) (7.23) (7.24) Here U is a nonempty closed subset of Rm , z0 ∈ G is an initial state, G is an open convex subset of Rn , δ > 0 is the discount rate, and f : G × U 7→ Rn and g : G × U 7→ Rm are given functions. The class of admissible controls in (P 4) consists of all measurable locally bounded functions y : [0, ∞) 7→ U . The optimality of admissible pair (z∗ (·), y∗ (·)) is understood in the strong sense [52]. 7.4.1 Proving the Existence of an Optimal Pair Problems of type (P 4) were intensively studied in last decades (see [14, 15, 16, 8, 9, 11, 12, 17, 13]). Here we will employ the existence result and the variant of the Pontryagin maximum principle for problem (P 4) developed in [15, 16] and [12, 17, 13] respectively. We will need to verify validity of the following conditions (see [15, 16, 8, 12, 17, 13]). (A1) The functions f (·, ·) and g(·, ·) together with their partial derivatives fz (·, ·) and gz (·, ·) are continuous and locally bounded on G × U . 99 (A2) There exists a number c > 0 and a nonnegative integrable function λ : [0, ∞) 7→ R1 such that for every ζ ∈ G with kζ − z0 k < c equation (7.23) with y(·) = y∗ (·) and initial condition z(0) = ζ (instead of z(0) = z0 ) has a solution z(ζ; ·) on [0, ∞) in G, and a.e. max θ∈[z(ζ;t),z∗ (t)] e−δt hgz (θ, y∗ (t)), z(ζ; t) − z∗ (t)i ≤ kζ − z0 kλ(t). Here [z(ζ; t), z∗ (t)] denotes the line segment with vertices z(ζ; t) and z∗ (t). (A3) There is a positive function ω(·) decreasing on [0, ∞) such that ω(t) → +0 as t → ∞ and for any admissible pair (z(·), y(·)) the following estimate holds: Z T0 T e−δt g(z(t), y(t)) dt ≤ ω(T ), 0 ≤ T ≤ T 0. Obviously, condition (A1) is satisfied because f (z, y) = [y − 1] z + 1, g(z, y) = ln y − ln z, fz (z, y) = y − 1 and gz (z, y) = −1/z, z > 0, y ∈ [δ, ∞), in (P 3). Let us show that (A2) also holds for any admissible pair (z∗ (·), y∗ (·)) in (P 3). Set c = z0 /2 and define the nonnegative integrable function λ : [0, ∞) 7→ R1 as follows: λ(t) = 2e−δt /z0 , t ≥ 0. Then, as it can be seen directly, for any real ζ: |ζ − z0 | < c, the Cauchy problem (7.19) with y(·) = y∗ (·) and the initial condition z(0) = ζ (instead of z(0) = z0 ) has a solution z(ζ; ·) on [0, ∞) and max θ∈[z(ζ;t),z∗ (t)] e−δt gz (θ, y∗ (t)) (z(ζ; t) − z∗ (t)) a.e. ≤ |ζ − z0 |λ(t). Hence, for any admissible pair (z∗ (·), y∗ (·)) condition (A2) is also satisfied. Validity of (A3) for any admissible pair (z∗ (·), y∗ (·)) follows from (7.9) directly. For an admissible pair (z(·), y(·)) consider the following linear system: q̇(t) = − [fz (z(t), y(t))]∗ q(t) = [−y(t) + 1] q(t). (7.25) The normalized fundamental solution Q(·) to equation (7.25) is defined as follows: Q(t) = e− Rt 0 y(ξ) dξ+t , t ≥ 0. (7.26) 100 Due to (7.21) and (7.26) for any admissible pair (z(·), y(·)) we have e−δt Q−1 (t)gz (z(t), y(t)) Rt = e−δt e z0 e Rt 0 y(ξ) dξ−t +e Rt 0 0 y(ξ) dξ−t R y(ξ) dξ−t t 0 e− Rs 0 y(ξ) dξ+s ds ≤ e−δt , z0 t ≥ 0. Hence, for any T > 0 the function ψT : [0, T ] 7→ R1 defined as Z ψT (t) = Q(t) T e−δs Q−1 (s)gz (z(s), y(s)) ds t = −e− Rt 0 y(ξ) dξ+t Z T e Rs 0 y(ξ) dξ−s −δs e z(s) t t ∈ [0, T ], (7.27) ds, is absolutely continuous, and the function ψ : [0, ∞) 7→ R1 defined as ψ(t) = Q(t) Z ∞ e−δs Q−1 (s)gz (z(s), y(s)) ds t = −e− Rt 0 y(ξ) dξ+t Z ∞ t Rs e 0 y(ξ) dξ−s −δs e z(s) ds, t ≥ 0, (7.28) is locally absolutely continuous. Define the normal form Hamilton-Pontryagin function H : [0, ∞)×(0, ∞)×[δ, ∞)×R1 7→ R1 and the normal-form Hamiltonian H : [0, ∞) × (0, ∞) × R1 7→ R1 for problem (P 3) in the standard way: H(t, z, y, ψ) = ψf (z, y) + e−δt g(z, y) = ψ[(y − 1)z + 1] + e−δt [ln y − ln z], H(t, z, ψ) = sup H(t, z, y, ψ), y≥δ t ∈ [0, ∞), z ∈ (0, ∞), y ∈ [δ, ∞), ψ ∈ R1 . Theorem 3. There is an optimal admissible control y∗ (·) in problem (P 3). Moreover, for any optimal admissible pair (z∗ (·), y∗ (·)) we have  y∗ (t) ≤ 1 + a.e. 1 z∗ (t)  (1 + δ), t ≥ 0. (7.29) Proof. Let us show that there is a continuous function M : [0, ∞) 7→ R1 , M (t) ≥ 0, t ≥ 0, 101 and a function φ : [0, ∞) 7→ R1 , φ(t) > 0, t ≥ 0, limt→∞ (φ(t)/t) = 0, such that for any admissible pair (z(·), y(·)), satisfying on a set M ⊂ [0, ∞), meas M > 0, to inequality y(t) > M (t), for all t ∈ M we have inf T : T −φ(T )≥t ( ) H(t, z(t), y, ψT (t)) − H(t, z(t), y(t), ψT (t)) sup y∈[δ,M (t)] > 0, (7.30) where the function ψT (·) is defined on [0, T ], T > 0, by equality (7.27). Let (z(·), y(·)) be an arbitrary admissible pair in (P 3). Then due to (7.21) and (7.26), for any T > 0 and arbitrary t ∈ [0, T ] we get (see (7.27))  − z(t)ψT (t) = z0 + ≥ z0 Z Z t t e − Rs 0 y(ξ) dξ+s 0 T ds Z t T Rs e−δs − 0 e e−(1+δ)t z0 + Rτ 0 y(ξ) dξ+τ dτ ds i h e−δs z0 −(1+δ)(T −t) Rs ds ≥ . (7.31) 1 − e (z0 + 1)(1 + δ) z0 + 0 eτ dτ For a φ > 0 define the function Mφ : [0, ∞) 7→ R1 by equality Mφ (t) = (z0 + 1)(1 + δ) t 1  e + , φ z0 1 − e−(1+δ)φ t ≥ 0. (7.32) Then for any T : T − φ > t and arbitrary (z(·), y(·)) the function y 7→ H(t, z(t), y, ψT (t)) reaches its maximal value on [δ, ∞) at the point (see (7.31)) yT (t) = − e−δt (z0 + 1)(1 + δ) 1  et ≤ Mφ (t) − . ≤  −(1+δ)(T −t) z(t)ψT (t) φ z0 1 − e (7.33) Now, set φ(t) ≡ φ and M (t) ≡ Mφ (t), t ≥ 0. Let (z(·), y(·)) be an admissible pair such that inequality y(t) > Mφ (t) holds on a set M ⊂ [0, ∞), meas M > 0. For arbitrary t ∈ M define the function Φ : [t + φ, ∞) 7→ R1 as follows Φ(T ) = sup y∈[δ,M (t)] H(t, z(t), y, ψT (t)) − H(t, z(t), y(t), ψT (t)) h i = ψT (t)yT (t)z(t) + e−δt ln yT (t) − ψT (t)y(t)z(t) + e−δt ln y(t) , 102 T ≥ t + φ. Due to (7.33) we have Φ(T ) = −e−δt + e−δt [−δt − ln(−ψT (t)) − ln z(t)] h i − ψT (t)y(t)z(t) + e−δt ln y(t) , T ≥ t + φ. Hence, due to (7.27) and (7.33) for a.e. T ≥ t + φ we get d e−δt d d Φ(T ) = − [ψT (t)] − y(t)z(t) [ψT (t)] dT ψT (t) dT dT   d e−δt d = z(t) [ψT (t)] − y(t) = z(t) [ψT (t)] (yT (t) − y(t)) > 0. dT −ψT (t)z(t) dT Hence, inf T >0: t≤T −φ ( sup y∈[δ,M (t)] ) H(t, z(t), y, ψT (t)) − H(t, z(t), y(t), ψT (t)) = inf T >0: t≤T −φ Φ(T ) = Φ(t + φ) > 0. Thus, for any t ∈ M inequality (7.30) is proved. Since the instantaneous utility in (7.18) is concave in y, the system (7.19) is affine in y, the set U is closed (see (7.20)), conditions (A1) and (A3) are satisfied, and since (A2) also holds for any admissible pair (z∗ (·), y∗ (·)) in (P 3), all conditions of the existence result in [16] are fulfilled (see also [15, Theorem 1]). Hence, there is an optimal admissible control a.e. y∗ (·) in (P 3) and, moreover, y∗ (t) ≤ Mφ (t), t ≥ 0. Passing to a limit in this inequality as φ → ∞ we get (see (7.32))   1 y∗ (t) ≤ 1 + (1 + δ)et , z0 a.e. t ≥ 0. (7.34) Further, it is easy to see that for any τ > 0 the pair (z̃∗ (·), ỹ∗ (·)) defined as z̃∗ (t) = z∗ (t + τ ), ỹ∗ (t) = y∗ (t + τ ), t ≥ 0, is an optimal admissible pair in the problem (P 3) taken with initial condition z(0) = z∗ (τ ). Hence, using the same arguments as above we get the following inequality for (z̃∗ (·), ỹ∗ (·)) (see (7.34)):  ỹ∗ (t) ≤ 1 + a.e. 1 z̃∗ (0)  (1 + δ)et , t ≥ 0. 103 Hence, for arbitrary fixed τ > 0 we have a.e. y∗ (t) = ỹ∗ (t − τ ) ≤  1+ 1 z∗ (τ )  (1 + δ)et−τ , t ≥ τ. Due to arbitrariness of τ > 0 this implies (7.29). 7.4.2 Application of the Maximum Principle Theorem 4. Let (z∗ (·), y∗ (·)) be an optimal admissible pair in problem (P 3). Then the function ψ : [0, ∞) 7→ R1 defined for pair (z∗ (·), y∗ (·)) by formula (7.28) is (locally) absolutely continuous and satisfies the conditions of the normal form maximum principle, i.e. ψ(·) is a solution of the adjoint system ψ̇(t) = −Hz (z∗ (t), y∗ (t), ψ(t)) , (7.35) and the maximum condition holds: a.e. H(z∗ (t), y∗ (t), ψ(t)) = H(z∗ (t), ψ(t)). (7.36) Proof. As it already have been shown above condition (A1) is satisfied and (A2) holds for any admissible pair (z∗ (·), y∗ (·)) in (P 3). Hence, due to the variant of the maximum principle developed in [12, 17, 13] the function ψ : [0, ∞) 7→ R1 defined for pair (z∗ (·), y∗ (·)) by formula (7.28) satisfies the conditions (7.35) and (7.36). Notice, that the Cauchy type formula (7.28) implies (see (7.21) and (7.26)) − ψ(t) = −e Z Rτ ∞ e−δτ e 0 y∗ (ξ) dξ−τ 0 h i dτ Rτ Rτ Rθ t e 0 y∗ (ξ) dξ−τ z0 + 0 e− 0 y∗ (ξ) dξ+θ dθ Rt Z ∞ e− 0 y∗ (ξ) dξ+t e−δt >− e−δτ dτ = − , R t − R θ y (ξ) dξ+θ δz∗ (t) z0 + 0 e 0 ∗ dθ t Rt y∗ (ξ) dξ+t t ≥ 0. (7.37) Thus, due to (7.28)the following condition holds: 0 < −ψ(t)z∗ (t) < e−δt , δ t ≥ 0. (7.38) Note also, that due to [14, Corollary to Theorem 3] formula (7.28) implies the following 104 stationarity condition for the Hamiltonian (see [11, 136])): H(t, z∗ (t), ψ(t)) = δ Z ∞ e−δs g(z∗ (s), y∗ (s)) ds, t t ≥ 0. (7.39) It can be shown directly that if an admissible pair (not necessary optimal) (z(·), y(·)) together with an adjoint variable ψ(·) satisfies the core conditions (7.35) and (7.36) of the maximum principle and limt→∞ H(t, z(t), ψ(t)) = 0 then condition (7.39) holds for the triple (z(·), y(·), ψ(·)) as well (see [11, Section 3]). Further, due to the maximum condition (7.36) for a.e. t ≥ 0 we have h i y∗ (t) = arg maxy∈[δ,∞) ψ(t)z∗ (t)y + e−δt ln y . This implies (see (7.38)) a.e. y∗ (t) = − 7.4.3 e−δt > δ, ψ(t)z∗ (t) t ∈ [0, ∞). (7.40) The Hamiltonian System Substituting the formula (7.40) for y∗ (·) in (7.19) and in (7.35) due to Theorem 4 we get that any optimal trajectory z∗ (·) together with the corresponding adjoint variable ψ(·) must satisfy to the Hamiltonian system of the maximum principle: e−δt + 1, ψ(t) 2e−δt ψ̇(t) = ψ(t) + . z(t) ż(t) = −z(t) − (7.41) Moreover, estimate (7.38) and condition (7.39) must hold as well. In the terms of the current value adjoint variable λ(·), λ(t) = eδt ψ(t), t ≥ 0, one can rewrite system (7.41) as follows: 1 + 1, λ(t) 2 λ̇(t) = (δ + 1)λ(t) + . z(t) ż(t) = −z(t) − (7.42) 105 In terms of variable λ(·) estimate (7.38) takes the following form: 1 0 < −λ(t)z∗ (t) < , δ t ≥ 0. (7.43) Accordingly, the optimal control y∗ (·) can be expressed as follows (see (7.40)): a.e. y∗ (t) = − 1 , λ(t)z∗ (t) t ≥ 0. (7.44) Define the normal form current value Hamiltonian M : (0, ∞) × R1 7→ R1 for problem (P 3) in the standard way (see [11, Section 3]): M (z, λ) = eδt H(t, z, ψ), z ∈ (0, ∞), λ ∈ R1 . (7.45) Then in the current value terms the stationarity condition (7.39) takes the form M (z∗ (t), λ(t)) = δe δt Z ∞ e−δs g(z∗ (s), y∗ (s)) ds, t t ≥ 0. (7.46) In the next section we will analyze the system (7.42) coupled with the estimate (7.43) and the stationarity condition (7.46). We will show that there are only two qualitatively different types of behavior of the optimal paths that are possible. If δ < 1 then the optimal path asymptotically approaches an optimal nonvanishing steady state while the corresponding optimal control tends to (1 + δ)/2 as t → ∞. If δ ≥ 1 then the optimal path z∗ (·) goes to infinity, while the corresponding optimal control y∗ (·) tends to δ as t → ∞, i.e. asymptotically it follows the Hotelling rule of optimal depletion of an exhaustible resource [102]. 7.5 Analysis of the Hamiltonian system Due to Theorem 4 it is sufficient to analyze the behavior of system (7.42) only in the open set Γ = { (z, λ) : z > 0, λ < 0} in the phase plane R2 . Let us introduce functions v1 : (1, ∞) 7→ (−∞, 0) and v2 : (0, ∞) 7→ (−∞, 0) as follows v1 (z) = 1 , 1−z z ∈ (1, ∞) , v2 (z) = − 106 2 , (δ + 1)z z ∈ (0, ∞). Due to (7.42) the curves γ1 = {(z, λ) : λ = v1 (z), z ∈ (1, ∞)} and γ2 = {(z, λ) : λ = v2 (z), z ∈ (0, ∞)} are the nullclines at which the derivatives of variables z(·) and λ(·) vanish respectively. Two qualitatively different cases are possible: (i) δ < 1 and (ii) δ ≥ 1. 7.5.1 The Sustainable Case Here we consider the case where δ < 1. In this case the nullclines γ1 and γ2 have a unique intersection point (ẑ, λ̂) which is a unique equilibrium of system (7.42) in Γ: ẑ = 2 , 1−δ λ̂ = δ−1 . δ+1 (7.47) The corresponding equilibrium control ŷ(·) is ŷ(t) ≡ ŷ = δ+1 , 2 t ≥ 0. (7.48) The eigenvalues of the system linearized around the equilibrium are given by σ1,2 = δ 1p 2 − δ2 , ± 2 2 which are real and distinct with opposite signs when δ < 1. Hence, by the GrobmanHartman theorem in a neighborhood Ω of the equilibrium state (ẑ, λ̂) the system (7.42) is of saddle type (see [99, Chapter 9]). The nullclines γ1 and γ2 divide the set Γ in four open regions: n Γ−,− = (z, λ) ∈ Γ : n Γ+,− = (z, λ) ∈ Γ : n Γ+,+ = (z, λ) ∈ Γ : n Γ−,+ = (z, λ) ∈ Γ : o[n o (z, λ) ∈ Γ : λ < v2 (z), ẑ < z < ∞ , o[n o λ < v2 (z), 0 < z ≤ 1 (z, λ) ∈ Γ : v1 (z) < λ < v2 (z), 1 < z < ẑ , o[n o v2 (z) < λ < 0, 0 < z ≤ ẑ (z, λ) ∈ Γ : v1 (z) < λ < 0, ẑ < z < ∞ , o v2 (z) < λ < v1 (z), z > ẑ . λ < v1 (z), 1 < z ≤ ẑ Any solution (z(·), λ(·)) of (7.42) in Γ has definite signs of derivatives of its (z, λ)-coordinates in the sets Γ−.− , Γ−.+ , Γ+,+ , and Γ−,+ . These signs are indicated by the corresponding subscripts. The behavior of the flows is shown in Figure 7-1 through the phase portrait. 107 0 2 1 3 4 5 z γ1 Γ−,+ Γ+,+ -1 Γ−,− -2 Γ+,− -3 γ2 λ Figure 7-1: Phase portrait of (7.42) around (ẑ, λ̂), where δ = 0.01 For any initial state (ξ, β) ∈ Γ there is a unique solution (zξ,β (·), λξ,β (·)) of the system (7.42) satisfying initial conditions z(0) = ξ, λ(0) = β, and due to the standard extension result this solution is defined on some maximal time interval [0, Tξ,β ) in Γ where 0 < Tξ,β ≤ ∞ (see [99, Chapter 2]). Let us consider behaviors of solutions (zξ,β (·), λξ,β (·)) of system (7.42) in Γ for all possible initial states (ξ, β) ∈ Γ as t → Tξ,β . The standard analysis of system (7.42) shows that only three types of behavior of solutions (zξ,β (·), λξ,β (·)) of (7.42) in Γ as t → Tξ,β are possible: 1) (zξ,β (t), λξ,β (t)) ∈ Γ−,− or (zξ,β (t), λξ,β (t)) ∈ Γ+,− for all sufficiently large times t. In this case Tξ,β = ∞ and limt→∞ λξ,β (t) = −∞ while limt→∞ zξ,β (t) = 1. Due to Theorem 4 such asymptotic behavior does not correspond to an optimal path because it contradicts the necessary condition (7.43). 2) (zξ,β (t), λξ,β (t)) ∈ Γ+,+ for all sufficiently large times t. In this case limt→Tξ,β zξ,β (t) = ∞ and limt→Tξ,β λξ,β (t) = 0. If (zξ,β (·), λξ,β (·)) corresponds to an optimal pair (z∗ (·), y∗ (·)) in (P 3) then due to Theorem 4 z∗ (·) ≡ zξ,β (·), Tξ,β = ∞, limt→∞ z∗ (t) = ∞, and limt→∞ λξ,β (t) = 0. Set λ∗ (·) ≡ λξ,β (·) in this case and define the function φ∗ (·) by equality φ∗ (t) = λ∗ (t)z∗ (t), t ∈ [0, ∞). 108 By direct differentiation for a.e. t ∈ [0, ∞) we get (see (7.42)) a.e. φ̇∗ (t) = (δ + 1)λ∗ (t)z∗ (t) + 2 − λ(t)z∗ (t) − 1 + λ∗ (t) = δφ∗ (t) + 1 + λ∗ (t). Hence,   Z t −δs e (1 + λ∗ (s)) ds , φ∗ (t) = e φ∗ (0) + δt t ∈ [0, ∞). 0 Since limt→∞ λ∗ (t) = 0 the improper integral R∞ 0 (7.49) e−δs (1 + λ∗ (s)) ds converges, and due to (7.43) we have 0 > φ∗ (t) = λ∗ (t)z∗ (t) > −1/δ for all t > 0. Due to (7.49) this implies φ∗ (0) = − Z ∞ 0 1 e−δs (1 + λ∗ (s)) ds = − − δ Z ∞ e−δs λ∗ (s) ds. 0 Substituting this expression for φ∗ (0) in (7.49) we get 1 φ∗ (t) = − − eδt δ Z ∞ e−δs λ∗ (s) ds, t t ∈ [0, ∞). Due to the L’Hospital rule we have δt lim e t→∞ Z ∞ e −δs λ∗ (s) ds = lim t t→∞ R∞ t e−δs λ∗ (s) ds λ∗ (t) = lim = 0. −δt t→∞ e δ Hence, lim y∗ (t) = lim t→∞ t→∞ −1 −1 = lim = δ. λ∗ (t)z∗ (t) t→∞ φ∗ (t) But due to the system (7.42) and the inequality δ < 1 this implies limt→∞ z∗ (t) ≤ 1 < ∞ that contradicts the equality limt→∞ z∗ (t) = ∞. So, all these trajectories of (7.42) are the blow up ones. Thus, there are not any trajectories of (7.42) that correspond to optimal admissible pairs due to Theorem 4 in the case 2). 3) limt→∞ (z(t), λ(t)) = (ẑ, λ̂) as t → ∞. In this case, since the equilibrium (ẑ, λ̂) is of saddle type, there are only two trajectories of (7.42) which tend to the equilibrium point (ẑ, λ̂) asymptotically as t → ∞ and lying on the stable manifold of (ẑ, λ̂). One such trajectory (z1 (·), λ1 (·)) approaches the point (ẑ, λ̂) from the left from the set Γ+,+ (we call this trajectory the left equilibrium trajectory), while the second trajectory (z2 (·), λ2 (·)) 109 approaches the point (ẑ, λ̂) from the right from the set Γ−,− (we call this trajectory the right equilibrium trajectory). It is easy to see that both these trajectories are fit to estimate (7.43) and stationarity condition (7.46). Hence, (z1 (·), λ1 (·)), (z2 (·), λ2 (·)) and the stationary trajectory (ẑ(·), λ̂(·)), ẑ(·) ≡ ẑ, λ̂(·) ≡ λ̂, t ≥ 0, are unique trajectories of (7.42) which can correspond to the optimal pairs in problem (P 3) due to Theorem 4. Due to Theorem 3 for any initial state z0 > 0 an optimal control y∗ (·) in problem (P 3) exists. Hence, for any initial state ξ ∈ (0, ẑ) there is a unique β < 0 such that the corresponding trajectory (zξ,β (·), λξ,β (·)) coincides (up to a shift in time) with the left equilibrium trajectory (z1 (·), λ1 (·)) on time interval [0, ∞). Analogously, for any initial state ξ > ẑ there is a unique β < 0 such that the corresponding trajectory (zξ,β (·), , λξ,β (·)) coincides (up to a shift in time) with the right equilibrium trajectory (z2 (·), λ2 (·)) on [0, ∞). The corresponding optimal control is defined uniquely by (7.44). Thus, for any initial state z0 > 0 the corresponding optimal pair (z∗ (·), y∗ (·)) in (P 3) is unique, and due to Theorem 4 the corresponding current value adjoint variable λ∗ (·) is also unique. 7.5.2 The Unsustainable Case Now, consider the case when δ ≥ 1. In this case v2 (z) > v1 (z) for all z > 1 and hence the nullclines γ1 and γ2 do not intersect in Γ. Accordingly, the system (7.42) does not have an equilibrium point in Γ. The nullclines γ1 and γ2 divide the set Γ in three open regions: n o Γ̂−,− = (z, λ) ∈ Γ : λ < v1 (z), z > 1 , n o[n o Γ̂+,− = (z, λ) ∈ Γ : λ < v2 (z), 0 < z ≤ 1 (z, λ) ∈ Γ : v1 (z) < λ < v2 (z), z > 1 , n o[n o Γ̂+,+ = (z, λ) ∈ Γ : v2 (z) < λ < 0, 0 < z ≤ ẑ (z, λ) ∈ Γ : v1 (z) < λ < 0, ẑ < z < ∞ . The behavior of the flows is shown in Figure 7-2 through the phase portrait. Any solution (z(·), λ(·)) of (7.42) in Γ has the definite signs of derivatives of its (z, λ) coordinates in each set Γ̂−.− , Γ̂+,+ , and Γ̂−,+ as indicated by the subscripts. The standard analysis of the behaviors of solutions (z(·), λ(·)) of system (7.42) in each of sets Γ̂−.− , Γ̂+.− and Γ+,+ shows that there are only two types of asymptotic behavior of solutions (z(·), λ(·)) of (7.42) that are possible: 1) limt→∞ z(t) = 1, limt→∞ λ(t) = −∞. In this case (z(t), λ(t)) ∈ Γ̂−,− for all suffi110 0 Γ̂+,+ γ4 1 2 z γ3 Γ̂+,− -1 γ2 Γ̂−,− γ1 λ Figure 7-2: Phase portrait of (7.42) in the case δ = 10 ≥ 1. ciently large times t ≥ 0. Due to Theorem 4 such asymptotic behavior does not correspond to an optimal admissible pair because in this case limt→∞ λ(t)x(t) = −∞ that contradicts condition (7.43). Thus this case can be eliminated from the consideration. 2) limt→∞ z(t) = ∞, limt→∞ λ(t) = 0. In this case (z(t), λ(t)) ∈ Γ̂+,+ for all t ≥ 0. Since the case 1) can be eliminated from the consideration, we conclude that the case 2) is the only one that can be realized for an optimal admissible pair (z∗ (·), y∗ (·)) (which exists) in (P 3) due to the maximum principle (Theorem (4)). Let us consider behavior of trajectory (z∗ (·), λ∗ (·)) of system (7.42) that corresponds to the optimal pair (z∗ (·), y∗ (·)) in the set Γ̂+,+ in more details. As in the subcase (b) of case (i) above, define the function φ∗ (·) as follows: t ∈ [0, ∞). φ∗ (t) = λ∗ (t)z∗ (t), Repeating the calculations presented in the subcase (b) of case (i) we get 1 φ∗ (t) = − − eδt δ Z t ∞ e−δs λ∗ (s) ds, t ∈ [0, ∞). 111 As in the subcase (b) of case (i) above, due to the L’Hospital rule this implies δt lim e t→∞ Z ∞ e −δs λ∗ (s) ds = lim t→∞ t R∞ t e−δs λ∗ (s) ds λ∗ (t) = lim = 0. t→∞ e−δt δ Hence, lim y∗ (t) = lim t→∞ t→∞ −1 −1 = lim = δ. t→∞ λ∗ (t)y∗ (t) φ∗ (t) Thus, asymptotically, any optimal admissible control y∗ (·) satisfies the Hotelling rule [102] of optimal depletion of an exhaustible resource in the case δ ≥ 1. Now let us show that the optimal control y∗ (·) is defined uniquely by Theorem 4 in the case δ ≥ 1. Define the function v3 : (0, ∞) 7→ R1 and the curve γ3 ⊂ Γ as follows: v3 (z) = − 1 , δz z ∈ (0, ∞), γ3 = {(z, λ) : λ = v3 (z), z ∈ (0, ∞)} . It is easy to see that v3 (z) ≥ v2 (z) for all z > 0 and v3 (z) > v1 (z) for all z > 1 in the case δ ≥ 1. Hence, the curve γ3 is located not below γ2 and strictly above γ1 in Γ̂+,+ (see Figure 7-2). Notice that if δ = 1 then γ3 coincides with γ2 while if δ > 1 then γ3 lies strictly above γ2 in Γ̂+,+ . It can be demonstrated directly that any trajectory (z(·), λ(·)) of system (7.42) can intersect curve γ3 only one time and only in the upward direction. Due to (7.43) a trajectory (z∗ (·), λ∗ (·)) of system (7.42) that corresponds to the optimal pair (z∗ (·), y∗ (·)) lies strictly above γ3 . Since the system (7.42) is autonomous by virtue of the theorem on uniqueness of a solution of first-order ordinary differential equation (see [99, Chapter 3]) trajectories of system (7.42) that lie above γ3 do not intersect the curve γ4 = {(z, λ) : z = z∗ (t), λ = λ∗ (t), t ≥ 0} which is the graph of the trajectory (z∗ (·), λ∗ (·)). Further, trajectory (z∗ (·), λ∗ (·)) is defined on infinite time interval [0, ∞). This implies that all trajectories (zz0 ,β (·), λz0 ,β (·)), β ∈ (−1/(δz0 ), λ∗ (0)), are also defined on the whole infinite time interval [0, ∞), i.e. Tz0 ,β = ∞ for all β ∈ (−1/(δz0 ), λ∗ (0)). Thus, we have proved that there is a nonempty set (a continuum) of trajectories {(zz0 ,β (·), λz0 ,β (·))}, β ∈ (−1/(δz0 ), λ∗ (0)), t ∈ [0, ∞), of system (7.42) lying strictly between the curves γ3 and γ4 . All these trajectories are defined on the whole infinite time interval [0, ∞) and, hence, all of them correspond to some admissible pairs {(zz0 ,β (·), yz0 ,β (·))}. Since these trajectories are 112 located above γ3 they satisfy also the estimate (7.43). Consider the current value Hamiltonian M (·, ·) for (z, λ) lying above γ3 in Γ̂+,+ (see (7.45)): M (z, λ) = sup {yλz + ln y} + (1 − z)λ − ln z y≥δ = −1 − ln(−λz) + (1 − z)λ − ln z, − 1 < λ < 0. (7.50) δz For any trajectory (zz0 ,β (·), λz0 ,β (·)) of system (7.42) lying above γ3 in Γ̂+,+ we have zz0 ,β (t) ≥ e(δ−1)t z0 , t ≥ 0. On the other hand for any trajectory (zz0 ,β (·), λz0 ,β (·)) of system (7.42) lying between γ3 and γ4 in Γ̂+,+ we have 1 1 < −λz0 ,β (t)zz0 ,β (t) < 2(1 + δ) δ if zz0 ,β (t) > 1. These imply that for any trajectory (zz0 ,β (·), λz0 ,β (·)) of system (7.42) lying between γ3 and γ4 in Γ̂+,+ and for corresponding adjoint variable ψz0 ,β (·), ψz0 ,β (t) = e−δt λz0 ,β (t), t ≥ 0, we have lim H(t, zz0 ,β (t), ψz0 ,β (t)) = lim t→∞ t→∞ n o e−δt M (zz0 ,β (t), λz0 ,β (t)) = 0. Hence, for any such trajectory (zz0 ,β (·), λz0 ,β (·)) of system (7.42) we have (see (7.46)) M (zz0 ,β (t), λz0 ,β (t)) = δe δt Z t ∞ e−δs g(zz0 ,β (t), λz0 ,β (t)) ds, t ≥ 0. Let yz0 ,β (·) be the control corresponding to zz0 ,β (·), i.e. yz0 ,β (t) = −1/(zz0 ,β (t)λz0 ,β (t)). Then taking in the last equality t = 0 we get J(zz0 ,β (·), yz0 ,β (·)) = Z 0 ∞ 1 e−δs g(zz0 ,β (t), λz0 ,β (t)) ds = M (zz0 ,β (0), λz0 ,β (0)). δ For any t ≥ 0 function M (z∗ (t), ·) (see (7.50)) increases on {λ : − 1/(δz∗ (t)) < λ < 0}. Hence, M (z∗ (t), ·) reaches its maximal value in λ on the set {λ : − 1/(δz) < λ ≤ λ∗ (t)} at the point λ∗ (t) that correspond to the optimal path z∗ (·). Thus, all trajectories 113 (zz0 ,β (·), λz0 ,β (·)) of system (7.42) lying between γ3 and γ4 in Γ̂+,+ do not correspond to optimal admissible pairs in (P 3). From this we can also conclude that all trajectories (z(·), λ(·)) of system (7.42) lying above γ4 also do not correspond to optimal admissible pars in (P 3). Indeed, if such trajectory (z(·), λ(·)) corresponds to an optimal pair (z(·), y(·)) in (P 3) then it must satisfy to condition (7.46). But in this case we have λ(0) > λ∗ (0) and 1 1 J(z(·), y(·)) = M (z0 , λ(0)) = M (z0 , λ∗ (0)) = J(z∗ (·), λ∗ (·)), δ δ that contradicts the fact that function M (z0 , ·) increases on {λ : − 1/(δz) < λ < 0}. Thus, for any initial state z0 there is a unique optimal pair (z∗ (·), y∗ (·)) in (P 3) in the case δ ≥ 1. In the next section we discuss the issue of sustainability of optimal paths for different values of the parameters in the model. 7.6 Discussion: A Generalized Notion of Sustainability Following Solow [185] we assume that the knowledge stock S(·) grows exponentially, i.e. S(t) = S0 eµt , t ≥ 0, where µ ≥ 0 and S0 > 0 are constants. Similar to Valente [195] we say that an admissible pair (x(·), y(·)) is sustainable in our model if the corresponding instantaneous utility function t 7→ ln P (t), t ≥ 0, non-decreases in the long run, i.e. lim inf T →∞ t≥T Ṗ (t) d ln P (t) = lim inf ≥ 0. T →∞ t≥T P (t) dt Substituting P (t) = S(t) (y(t)x(t))β , S(t) = S0 eµt , t ≥ 0, (see (7.2)) we get the following characterization of sustainability of an admissible pair (x(·), y(·)):   ẏ(t) ẋ(t) µ + lim inf + ≥ 0. β T →∞ t≥T y(t) x(t) (7.51) We call an admissible pair (x(·), y(·)) strongly sustainable if it is sustainable and, moreover, the resource stock x(·) is non-vanishing in the long run, i.e. lim inf x(t) = x∞ > 0. (7.52) T →∞ t≥T 114 Consider case (i) when δ < 1. In this case due to Theorem 5 (see Chapter 9) there is a unique optimal equilibrium pair in the problem (see (7.47) and (7.48)): û(t) ≡ ŷ = (1+δ)/2, x̂(t) ≡ x̂ = (1 − δ)/2 > 0, t ≥ 0, and for any initial state x0 the corresponding optimal path x∗ (·) approaches asymptotically to the optimal equilibrium state x̂ while the corresponding optimal exploitation rate y∗ (·) approaches asymptotically to the optimal equilibrium value ŷ. Hence, both conditions (7.51) and (7.52) are satisfied. Thus the optimal admissible pair (x∗ (·), y∗ (·)) is strongly sustainable in this case. Consider case (ii) when δ ≥ 1. In this case due to Theorem 5 (see Chapter 9) for any initial state x0 the corresponding optimal control y∗ (·) asymptotically satisfies the Hotelling rule of optimal depletion of an exhaustible resource [102], i.e. limt→∞ y∗ (t) = δ, and limt→∞ ẏ∗ (t)/y∗ (t) = 0. The corresponding optimal path x∗ (·) is asymptotically vanishing, and lim ẋ∗ (t)/x∗ (t) = lim (1 − y∗ (t) − x∗ (t)) = 1 − δ. t→∞ t→∞ Hence, in the case (ii) the sustainability condition (7.51) takes the following form: µ ≥ δ − 1. β (7.53) It is interesting to point our here that in the case β = 1 condition (7.53) coincides with Valente’s necessary condition for sustainability in his capital-resource model with a renewable resource growing exponentially [195]. This takes place if the resource dynamics are considered in their original form as given by (4.1) (see the concluding section of [10]) as opposed to the non-dimensionalized dynamics considered here. Since in the case (i) the inequality (7.53) holds automatically we conclude that (7.53) is a necessary and sufficient condition (a criterion) for sustainability of the optimal pair (x∗ (·), y∗ (·)) in our model while the stronger inequality δ<1 gives a criterion for its strong sustainability. The criterion (7.53) gives the following guidelines for sustainable optimal growth: 1) Increase ratio of growth rate of knowledge stock µ to output elasticity β; and 2) Decrease 115 social discount δ i.e., plan long term. The sustainability criterion (7.53) gives a relationship between the state of technology (depicted by β), accumulation of knowledge (depicted by µ) and foresight of the social planner (depicted by δ). According to the guideline 1) above, it is the ratio between µ and β that matters and not the individual quantities. In the next chapter, we return our focus to the two-agent symmetric semi-homogeneous society. Examining the dual-agent network in the context of optimal control would lead to the analytically more complex methods of multivariable optimal control [147]. More importantly, the framework would not allow us to study the interactions between the consumer groups. We instead examine the dual-agent network via game theory which permits a more accurate representation of decentralized control mechanisms, where every agent optimizes her own objective. Moreover, the theory allows us to explicitly study the strategic interactions between the agents, something that was not present in the single agent model considered in this chapter. 116 Chapter 8 Strategic Interactions in the Game-theoretic Framework The tragedy of the commons can be seen as one particular instance of the more general problem of eliciting cooperation between individuals, when there exists a temptation for individuals to defect. Hardin [97] was one of the first who proposed to employ centralized mechanisms to coerce a society in order to achieve collectively optimal outcomes in such situations. He further asserted that any decentralized mechanism, regulated from within the society, must necessarily fail in achieving those outcomes. As discussed in Chapter 1, this assertion was challenged by Ostrom [148], who reported several real-world examples of successful institutions, conceived and regulated by the communities themselves, and used a game theoretic framework to conceive a new theory of collective action. Typical game theoretic formalizations, which have been used to depict tragedies, include the prisoner’s dilemma, the assurance game and the snowdrift game. These games have been studied in both discrete and continuous action spaces [71]. In this chapter we return to the dual-agent network whose open-loop characteristics were studied in Section 6.2. We formulate the system as static-two player game with the pay-offs defined as the resource harvested at steady state and the strategies defined as the psychological attributes of the consumers. We then develop a notion of “tragedy” as representing the difference between the optimal and rational outcomes of the consumption game. The tragicness is studied for both continuous and discrete strategy spaces and its dependence on various system parameters is also explored. In the process we highlight various char- 117 acteristics of non-tragic societies and draw attention to trends that may overcome tragic situations. 8.1 The Continuous Consumption Game Here we formalize the socio-ecological system in (6.4) as a static, one-shot two-player game, in which two consumer groups (players) have access to a single common good (natural resource). Each player i ∈ {1, 2} chooses her level of environmentalism ρi and her social relevance νi (note that αi = 1 − νi and so αi is determined by the choice of νi ). Thus the strategy set for each individual i is given as S̃i = {ρi , νi }. The payoff π̃i that each individual receives is equal to the amount of resource x̄ȳi that individual harvests at steady state, where (x̄, ȳ1 , ȳ2 ) are given by (6.5). Note that bi does not affect the equilibrium and thus is not included in the strategy set S̃i . The game is then defined as a 3-tuple G̃ = hI, (S̃i ), (π̃i )i where I = {1, 2} denotes the set of players, S̃i = [0, 1] × [0, 1] ; i ∈ I is the strategy space for i and π̃i : S̃1 × S̃2 → R; i ∈ I is the payoff function for consumer i. 8.1.1 Deriving the Nash Equilibrium For the two-player game G̃ defined above, the pay-off functions are given as π̃1 (ρ1 , ν1 , ρ2 , ρ2 ) = x̄ȳ1 and π̃2 (ρ1 , ν1 , ρ2 , ρ2 ) = x̄ȳ2 , where (1 − ν1 )ν2 (1 − ν2 )ν1 ρ1 + ρ2 , ν1 +ν2 − 2ν1 ν2 ν1 + ν2 − 2ν1 ν2 1 − ν1 (1−ν2 ) (1−2ν1 ) 1 ρ1 + ρ2 , ȳ1 (ρ1 , ν1 , ρ2 , ρ2 ) = − 2 2 (ν1+ν2 −2ν1 ν2 ) 2 (ν1+ν2 −2ν1 ν2 ) 1 (1−ν1 ) (1−2ν2 ) 1 − ν2 ρ1 − ρ2 . ȳ2 (ρ1 , ν1 , ρ2 , ρ2 ) = + 2 2 (ν1+ν2 −2ν1 ν2 ) 2 (ν1+ν2 −2ν1 ν2 ) x̄(ρ1 , ν1 , ρ2 , ρ2 ) = where we have used the formula αi + νi = 1 to replace αi . The “best response” of player i is the strategy (ρ̃i ,ν̃i ) that maximizes π̃i for a fixed strategy of the other player j 6= i. The best response functions are thus given as (ρ̃i , ν̃i ) = argmax π̃i (ρi , νi , ρj , ρj ). (8.1) (ρi ,νi ) 118 π̃(ρ1, ν1, ρ2, ν2) (ρ˜1, ν̃1) 0.14 0.1 0.06 0.02 -0.02 1 1 ν1 ρ1 0 0 Figure 8-1: An example of the payoff function of one player, given the other player’s strategy. The yellow curve represents the best response. Here ρ2 = 0.7 and ν2 = 0.9. By calculating the partial derivatives and putting them to zero, we find that for a fixed pair (ρj , νj ), π̃i (·, ·, ρj , νj ) is maximized not at a single point but along the following curve ρ̃i =  (1 − νj )(ρj − νj (1 − ρj )) 2νj  ρj + νj (1 − ρj )(2νj − 1) 1 + ; ν̃i − 1 2νj i, j ∈ I; i 6= j # # # A realization of this curve is shown in Figure 8-1. The Nash equilibrium (ρ# 1 , ν1 , ρ2 , ν2 ), consists of all possible outcomes such that the strategy of each player is a best response to the other player’s strategy. Thus at the Nash equilibrium # # # # # # # (ρ# i , νi ) = argmax(ρi ,νi ) π̃i (ρi , νi , ρj , ρj ) and (ρj , νj ) = argmax(ρj ,νj ) π̃j (ρi , νi , ρj , ρj ). Solving this condition algebraically gives the following description of the Nash equilibria ρ# i = # # # # ν# i (3νj − νi − 2νi νj ) # # # # (1 − ν# i )(νi + νj + 2νi νj ) i, j = 1, 2, i 6= j. (8.2) which shows that there exist an infinite number of Nash equilibria in this formulation of the consumption game. For the purpose of the following analysis, we redefine the strategy set S̃ to include only the environmentalisms (ρ1 , ρ2 ) and treat (ν1 , ν2 ) as given parameters instead of decision variables.This is because excluding the νi ’s from the strategy set results 119 (ρ1∗, ρ2∗) (ρ1#, ρ2#) J(ρ1, ρ2) 0.3 0.2 0.1 0 -0.1 1 1 ν1 ρ1 0 0 Figure 8-2: An example of the social welfare function for ν1 = 0.3 and ν2 = 0.9. The green curve represents the collective optimal whereas the yellow point represents the Nash equilibrium. in exactly the same Nash equilibrium as given above; so treating the νi as exogenous parameters simplifies the further analysis and does not qualitatively affect the resulting findings. Hence we redefine the consumption game as the 3-tuple G = hI, Si , πi i, where I = {1, 2} denotes the set of players, Si , i ∈ I is the indexed strategy space for group i, and πi : S1 × S2 → R, i ∈ I is the indexed payoff function for i, defined on Si . Each group is free to choose its level of environmentalism ρi ∈ R. The strategy set for each group i is given as Si = {ρi }. The payoff πi (ρi , ρj ) that each group receives is equal to the amount of resource x̄ȳi (ρi , ρj ) the group i harvests at steady state. 8.1.2 Collective Optimality and the Notion of Tragicness A property inherent to any representation of the tragedy of the commons is that individually rational behavior leads to outcomes that are collectively suboptimal. We thus compare the environmentalism of each group at the Nash equilibrium with one that maximizes the utilitarian welfare function of total consumption J(ρ1 , ρ2 ) = π1 (ρ1 , ρ2 ) + π2 (ρ1 , ρ2 ). We 120 ρ2 ρ# 2 (ρ1 ) (ρ∗1 , ρ∗2 ) # (ρ# 1 , ρ2 ) Tr ag ic ne s s 1 ρ# 1 (ρ2 ) 0 1 ρ1 Figure 8-3: An illustration of the definition of the game tragicness. find that the latter optimum (ρ∗1 , ρ∗2 ) is not unique, and is given by the following curve 2ν2 (1 − ν1 )ρ∗1 + 2ν1 (1 − ν2 )ρ∗2 − ν1 (1 − ν2 ) − ν2 (1 − ν1 ) = 0, (8.3) A single realization of this curve is shown in Figure 8-2. with the Nash equilibrium situated at some distance from it (naturally determined by parameters ν1 and ν2 ). We call this distance the tragicness of the consumption game, which, more specifically, is defined here as the length of the shortest line joining the Nash equilibrium and a point on the optimal curve (see Figure 8-3). Thus in a non-tragic game, the Nash equilibrium would lie exactly on the welfare optimal curve (resulting in tragicness equal to zero). All other games in which the Nash equilibrium does not lie on this curve are classified as tragic games, where the magnitude of the distance between the Nash equilibrium and the Pareto-optimal solutions is quantified through their tragicness. The concept of tragicness, which we introduce here, resembles the “price of anarchy” [114], which is a ratio between the cost of the worst possible Nash equilibrium and the optimum of a social welfare function as measure of effectiveness of the system. Another similar concept is the “price of stability” [4], which is a ratio between the cost of the best possible Nash equilibrium and the optimal solution. Both concepts have been applied widely in computer network design. 121 8.1.3 The Consumption Game and Social-Ecological Relevance Here we present insights gained by observing how the characteristics of the consumption game depend on the model parameters and what it entails. The anti-tragic role of social relevance Cooperative behavior plays a key role in avoiding tragedies and increasing the steady state resource stock. In our model, this effect can be observed through Figure 8-4(a)-(c). Figure 8-4(a) shows that the tragicness of the consumption game decreases as we move away from the origin along any of the ν1 or ν2 axes. Furthermore, the tragicness declines with an increase in the average (over two groups) level of social relevance. Declining of the tragicness can indeed be seen as growing of coordination and cooperation (through increasing social relevance) between two groups. Games that are less tragic correspond to affluence in the steady state resource stock, which in-turn also allows for a higher resource consumption at steady state. Thus the same trends can be observed for the steady state resource stock and total consumption rate in Figure 8-4(b) and (c) respectively. This shows that high social relevance not only decreases the game’s tragicness, but also favors higher steady state resource stocks and consumption rates. In the limit case of ν1 = ν2 = 1, zero tragicness is achieved over the infinitely many equilibria, and it is interesting to note that in this most affluent case, the maximum resource stock x̄ = 0.5 and maximum consumption rate x̄(ȳ1 + ȳ2 ) = 0.25. A positive effect of incongruity in social relevance The effect of incongruity or asymmetry in the social relevances on the game tragicness can also be observed in Figure 8-4(a). Moving away from the line of zero asymmetry (the horizontal line corresponding to ν1 = ν2 ) horizontally in either direction results in a lower tragicness level. This effect of asymmetry on the tragicness is less pronounced for small deviations in asymmetry, which can be seen from the decreased slope of the level curves when they are near the line of zero asymmetry. When the asymmetry is large, this effect is more significant, which can be seen from the sudden slanting of the level curves when further away from zero asymmetry. Thus strong incongruity or heterogeneity in social relevance corresponds to less tragic games. 122 1 0.45 1 0.6 ν1 +ν2 2 ν1 +ν2 2 ν2 ν1 0 -1 ν2 0.1 0 0.05 1 ν1−ν2 ν1 -1 1 ν1−ν2 (b): Resource quantity x̄ (a): Game tragicness 0.23 1 1 ν1 +ν2 2 0.12 ν1 +ν2 2 ν2 ν1 ν2 0 ν1−ν2 0.02 0 0.03 -1 ν1 1 -1 ν1−ν2 1 (d): Individual Consumption x̄ȳ1 (c): Total Consumption x̄(ȳ1 + ȳ2 ) 0.05 1 ν1 +ν2 2 ν2 ν1 -0.05 0 -1 ν1−ν2 1 (e): Consumption Equity x̄(ȳ1 − ȳ2 ) Figure 8-4: Plots for different characteristics of the consumption game at Nash equilibrium, shown as the difference and average level of the social relevances ν1 , ν2 are varied. For completeness the ν1 and ν2 axes have also been shown in each plot. The gray areas mark regions for which stability is not guaranteed. The plots for both groups are symmetric to each other, and so the conclusions drawn here for group 1 also apply to group 2. 123 Incongruity has a similar effect on the resource stock and total consumption rates, which can be seen in Figure 8-4(b) and Figure 8-4(c) respectively. In general, an increase in incongruity increases both. Note that the discontinuity of the level curves, which was present in Figure 8-4(a) is also present here at exactly the same points in the parameter space. However the behavior of the curves is different in the center. They are now concave, which means that small deviations in asymmetry are detrimental to the resource stock and the consumed quantity. However, large deviations in asymmetry are beneficial. Higher social relevance increases individual consumption In general, higher social relevance increases individual group consumption. Figure 8-4(d) depicts how individual consumption of a group changes as the social relevances are varied. The level curves in Figure 8-4(d) show three different behaviors. Near the symmetric line where ν1 = ν2 , the consumption of the focal group increases with respect to the social relevance of both groups. However, this increase is more pronounced with respect to changes in its own social relevance, than that of the other group. Variation in the other group’s social relevance does not affect the group’s consumption, when the social relevance of the other group is low. Conversely, for low values of its own social relevance, the group’s consumption is affected only by changes in the social relevance of the other group. Also note that a group’s individual consumption increases monotonically with the other group’s social relevance only when its own social relevance is high. When this is not the case, a mode is encountered in the region where the other group’s social relevance is high enough (note the plateau in the upper right area of Figure 8-4(d)). Furthermore, a group with a higher social relevance consumes more, than a group with a lower social relevance. Figure 8-4(e) depicts the difference in consumption x̄(ȳ1 − ȳ2 ) which always stays positive to the right of the symmetric line (ν1 = ν2 ) and always negative to the left of this line. Difference in consumption is exactly zero when social relevance for both consumer groups are the same. Equity in social relevance induces equity in consumption Figure 8-4(e) shows the behavior of the equity measure x̄(ȳ1 − ȳ2 ) as a function of the average of the social relevances and their asymmetry. When the social relevances are close to equal (near the center of the plot), the isoclines are nearly vertical which shows that the 124 average quantity of the social relevances does not affect equity in consumption. However, the equity is affected significantly by the asymmetry in social relevances. This can be traced by starting in the middle of the plot and observing the difference in consumption as we move horizontally in either direction. The difference in consumption is increased as we increase asymmetry until a peak is reached after which it decreases slightly. This shows that equity in consumption is the highest, when the social relevances are close to each other in value. 8.2 The Discrete Consumption Game In Section 8.1, we formulated the interactions between two consumer groups as a continuous game. The utilities were assumed to be the amount of resource each group harvested at steady state. The variables νi and ρi appeared to be natural choices for the action variables available to each group. However, we found that the game had an infinite number of rational outcomes, expressed in terms of the action variables in Equation (8.2). Consequently, we redefined the strategy set to include only one of the variables (ρi ) and the other (νi ) to be retained as an exogenously specified parameter. This led to a single equilibrium specified in terms of the νi ’s (thus essentially infinite in number if νi ’s are allowed to vary as before) which resulted in a less tedious representation of the consumption game. Here we consider an alternative formulation of the assumed socio-ecological setting as a two player game with discrete actions spaces. As we will see, the formulation allows us to retain both psychological variables in the strategy set. After defining a parallel concept to tragicness in the continuous case, we then examine the dependence of the nature of the game on different variables. We assume that the strategy of player i, {ρi , νi } ∈ {{ρH , νH }, {ρL , νL }} where ρL < ρH and νL < νH . Hence, strategies are a set of two variables where the cooperate strategy is represented by {ρH , νH } and the defect strategy is represented by {ρL , νL }. For a two player game, the payoff matrix is as given in Table 8.1. Note that the nature of the game is dependent only on the four parameters ρH , ρL , νH , νL . By varying these parameters over their entire range along with the constraints ρL < ρH and νL < νH , we encounter a variety of games which we classify as either tragic or non-tragic. 125 C D C x̄ȳ1 (ρH , νH , ρH , νH ), x̄ȳ2 (ρH , νH , ρH , νH ) x̄ȳ1 (ρH , νH , ρL , νL ), x̄ȳ2 (ρH , νH , ρL , νL ) D x̄ȳ1 (ρL , νL , ρH , νH ), x̄ȳ2 (ρL , νL , ρH , νH ) x̄ȳ1 (ρL , νL , ρL , νL ), x̄ȳ2 (ρL , νL , ρL , νL ) Table 8.1: Structure of the discrete consumption game. x̄, ȳ1 and ȳ2 are given by Equation 6.5. 8.2.1 Tragic and non-tragic games We define a tragic game as one where at least one nash equilibrium is sub-pareto optimal (see [155] for the notion of pareto optimality). Three such games are encountered while varying the parameters and are shown in Figure 8-5. All of these games are commonly found in literature as models of cooperation [71]. Type 1 C D C 3,3 1,4 D 4,1 2,2 − prisoner’s dilemma Type 3 Type 2 C D C 4,4 1,3 D 3,1 2,2 − stag-hunt − trust dilemma − assurance dilemma C D C 3,3 2,4 D 4,2 1,1 − chicken − hawk-dove − snowdrift Figure 8-5: The three tragic realizations of the consumption game along with the labels commonly associated with them. Nash equilibria are shaded in gray. The values of the payoffs are hypothetical and have been chosen to illustrate the relative magnitudes of the payoffs for each outcome. We define non-tragic games as games that are not tragic. In these games all nash equilibria are also pareto optimal. All such games encountered in the consumption game are given in Figure 8-6. 8.2.2 The Influence of Social Attributes on the Game Nature Figure 8-7 shows the type of the consumption game that arises as the four parameters are varied. The plot covers only those regions where ρL < ρH , νL < νH and parameter values 126 Type 4 C D C 2,2 1,4 D 4,1 3,3 Type 5 C D C 1,1 2,4 D 4,2 3,3 Type 7 C D C 4,4 2,3 D 3,2 1,1 Type 6 C D C 2,2 3,4 D 4,3 1,1 Type 8 C D C 1,1 3,4 D 4,3 2,2 Type 9 C D C 1,1 2,3 D 3,2 4,4 Figure 8-6: Non-tragic realizations of the consumption game. for which stability of the equilibrium is guaranteed. Figure 8-7: Plot depicting the type of game that each realization of the consumption game belongs to as the parameters are varied. Figure 8-8 shows the nature of the consumption game evaluated for the four dimensional 127 parameter space and classified as either tragic (red) or non-tragic (green). Figure 8-8: Tragic and non-tragic regions for the consumption game. Another classification of the games exists depending on whether the rational outcome for both players to defect, both players to cooperate or one player to defect and one to cooperate. The distinction between these 3 classes of games is notable in Figure 8-9 which shows the quantity of the resource at the Nash equilibrium. By observing the trends in the simulations, the following interpretations can be drawn. Note that in what follows, we label consumers with high values of ρi as environmentalists and consumers with high values of νi as pro-socialists. High degrees of environmentalism can avoid tragedies From Figure 8-8 it can be seen that if the lower and upper levels of environmentalism (ρL and ρH respectively) are greater than the maximum quantity of the resource (ρL + ρH > 1) then tragedies are avoided irrespective of the level of socialism. From Figure 8-7 it can be seen that in this case the rational outcome consists of at least one player defecting. 128 Figure 8-9: Resource quantity at the Nash equilibrium for the discrete consumption game. High social ties compensate for low environmentalism in avoiding tragedies From Figure 8-8 we see that if the upper and lower thresholds of νi are high, then tragedies are avoided even in the case of low environmentalism. From Figure 8-7, this corresponds to the Type 7 game where the rational outcome is for both individuals to cooperate. Low environmentalism and strong social ties promote cooperation In all plots in Figure 8-7, it can be seen that tragedies are avoided in the lower left region of the axes where both the upper and lower thresholds of ρi are low (areas with low environmentalism). This region grows as νL and νH are increased (areas with high social weights). From Figure 8-7 we see that this corresponds to the Type 7 game which is the only game with the unique rational outcome of both players cooperating. Thus these conditions promote cooperation. 129 Small values of the lower environmental threshold promotes cooperation in the presence of strong asymmetry in the social threshold levels. This again refers to the Type 7 game which corresponds to bottom green region in the plots of Figure 8-8. We observe that if there is a strong asymmetry between νL and νH (bottom right plot) then the Type 7 game is realized if the lower threshold ρL is kept small enough. Note that even though this relates to a condition on ρL , the rational outcome corresponds to both players assuming the upper environmental threshold ρH . High environmentalism and strong social ties are beneficial to the resource This interpretation follows by an examination of Figure 8-9. Based on the trends of the contours in each plot, three distinct regions are observable. The lower left region corresponds to those games in which the rational outcome is for both players to cooperate (see Figure 87), or to choose the upper thresholds ρH and νH . Here the resource level remains unchanged by variation in ρL and νL as these values are not realized by any player in the outcome of the game. Thus in this region the resource increases by increasing ρH and νH . The upper right region corresponds to games in which the outcome is for both players to defect and so the resource quantity increases for higher levels of ρL and νL and remains invariant to changes in ρH and νH . The third intermediate region corresponds to games in which the Nash equilibrium corresponds to one player defecting and the other cooperating. In this region, the resource is increased by increase in both ρH , νH and ρL , νL . 8.3 Discussion Opinions on the effect of heterogeneity on successful resource management are highly variable [197, 23, 57] and range from negative to positive to no effect at all. Our model presents mixed results regarding heterogeneity in general, which suggests that heterogeneity is important in different ways across different factors. Note that heterogeneity may be manifested in either of the parameters ρi and νi , which are both different in nature. Hence, while our model does not provide a straight-forward verdict on the role of heterogeneity, it does contribute to the debate by indicating, that heterogeneity may need to be exposed to a classification, which is deeper than the conventional classification of economic, non-economic and socio-cultural heterogeneity to correctly establish its correlation with successful resource 130 management. An important limitation of the model already discussed in Chapter 4 is the static nature of the psychological attributes of the consumers. Individuals in the real world are in a constant state of change and the human psychology is seldom static. We study the effects of relaxing this assumption by allow the consumers from the consumption game to vary their characteristics via the theory of learning in games, an exercise undertaken in the material of the next chapter. 131 Chapter 9 Closing the Feedback Loop In this chapter we return to the single and dual-agent networks to study the effects of certain feedback schemes, selected in the context of the analysis conducted in previous chapters. In Section 9.1, we synthesize an optimal feedback law for the single agent homogeneous network on the basis of the analysis conducted in Chapter 7. We find that the optimal feedback law is given as the solution to a non-linear differential equation whose solution is difficult to obtain analytically. Instead we demonstrate how the control law can be obtained numerically and present simulations of the optimally controlled process that exhibit the expected behavior. Later in Section 9.2, we return to the two-player consumption game of Chapter 8. We allow the players to change their strategy in direction of the best response to the other player’s current strategy. Such a tactic known commonly as the best response learning scheme, is a basic variant of fictitious play learning. We find that under the selected learning scheme, the players not only converge to the Nash equilibrium but do so in a way that avoids free-riding behavior, a phenomenon that occurred in the open-loop system of Chapter 6. 9.1 The Optimal Feedback Law Recall the Hamiltonian system of the OCP (P3) in Chapter 7, reproduced below 1 + 1, λ(t) 2 λ̇(t) = (δ + 1)λ(t) + . z(t) ż(t) = −z(t) − (9.1) 132 In Chapter 7 we categorized the long-term behavior of the solutions of the above system into two cases: the sustainable case (δ < 1) and the unsustainable case (δ ≥ 1). Consider first, the sustainable case. Figure 9-1 shows the optimal region in the phase space of the Hamiltonian system in this scenario. Recall the trajectory (z1 (·), λ1 (·)) that approaches the 0 1 2 3 4 5 z γ1 Γ−,+ Γ+,+ λ+ (z) -1 λ− (z) (ẑ, λ̂) -2 Γ−,− Γ+,− -3 γ2 λ Figure 9-1: The saddle point (ˆ(z), λ̂) and regions of the stable manifold λ− (z) & λ+ (z). Here δ = 0.01 < 1 point (ẑ, λ̂) from the left from the set Γ+,+ . We called this trajectory the left equilibrium trajectory, while the second trajectory (z2 (·), λ2 (·)) which approaches the point (ẑ, λ̂) from the right from the set Γ−,− was called the the right equilibrium trajectory. These trajectories are represented as the curves λ− (z) and λ+ (z) respectively in the phase space. Note that to the left of the point (ẑ, λ̂) in the set Γ+,+ , the function z1 (·) increases. Therefore, while (z1 (·), λ1 (·)) lies in Γ+,+ , the time can be uniquely expressed in terms of the first coordinate of the trajectory (z1 (·), λ1 (·)) as a smooth function t = t1 (z), z ∈ (0, ẑ). Changing the time variable t = t1 (z) on interval (0, ẑ), we find that the function λ− (z) = λ1 (t1 (z)), z ∈ (0, ẑ), is a solution to the following differential equation on (0, ẑ): dλ(z) dλ(t1 (z)) dt1 (z) λ(z) ((δ + 1)λ(z)z + 2) = × = dz dt dz z (−λ(z)z − 1 + λ(z)) 133 (9.2) with the boundary condition lim λ(z) = λ̂. (9.3) z→ẑ−0 Obviously, the curve λ− = {(z, λ) : λ = λ− (z), z ∈ (0, ẑ)} corresponds to the region of the stable manifold of (ẑ, λ̂) where z < ẑ. Analogously, to the right of the point (ẑ, λ̂) in the set Γ−,− , while (z2 (·), λ2 (·)) lies in Γ−,− , the function z2 (·) decreases. Hence, the time can be uniquely expressed in terms of the first coordinate of the trajectory (z2 (·), λ2 (·)) as a smooth function t = t2 (z), z ∈ (ẑ, ∞). Changing the time variable t = t2 (z) on interval (ẑ, ∞), we find that the function λ+ (z) = λ2 (t2 (z)), z > ẑ, is a solution to the differential equation (9.2) on (ẑ, ∞)) with the boundary condition lim λ(z) = λ̂. (9.4) z→ẑ+0 As above, the curve λ+ = {(z, λ) : λ = λ+ (z), z ∈ (ẑ, ∞)} corresponds to the region of the stable manifold of (ẑ, λ̂) where z > ẑ. Using solutions λ− (·) and λ+ (·) of differential equation (9.2) along with (7.44) we can get an expression for the optimal feedback law as follows     − λ 1(z)z , if z < ẑ,    − δ+1 y∗ (z) = if z = ẑ, 2 ,       − λ+ 1(z)z , if z > ẑ. An analytical solution to nonlinear differential equation (9.2) is difficult to obtain. However, it is possible to solve numerically. A graphical depiction of the feedback law in the original variables obtained by numerically solving the above ODE can be seen in Figure 92a. A representative solution of (P 1) incorporating this feedback law is also shown in Figure 9-2b. The trajectories show convergence of the stock and consumption to a steady state equilibrium. Now consider the unsustainable case δ ≥ 1. We already saw in Chapter 7 that there exists a unique optimal pair (z∗ (·), y∗ (·)) for this case. Figure 9-3 shows the optimal trajectory 134 y? (x?(t)) 1 1 0.9 0.9 0.8 0.8 0.7 0.7 0.6 0.6 0.5 0.5 0.4 0.4 0.3 0.3 0.2 0.2 0.1 0.1 0 0 0.2 0.4 0.6 0.8 0 1 x?(t) y?(t) 0 1 2 3 ? 4 5 6 7 8 9 10 t x (t) (a) The optimal feedback law obtained by numerically solving (9.2). (b) Solution with the optimal feedback law. Here the initial stock x(0) = 0.1. Figure 9-2: The optimal feedback law and a representative solution for the case δ = 0.01 < 1. along with the nullclines and the respective partitions of the phase space. 0 Γ̂+,+ γ4 1 2 z γ3 Γ̂+,− -1 γ2 Γ̂−,− γ1 λ Figure 9-3: Optimal solution for (7.42) in the case δ = 10 ≥ 1. The optimal pair (z∗ (·), y∗ (·)) corresponds to curve γ4 in the phase space. Now, since (z∗ (·), y∗ (·)) is unique, as a consequence the corresponding current value adjoint variable λ∗ (·) is also defined uniquely as the maximal negative solution to equation 135 (see (7.42)) λ̇(t) = (δ + 1)λ(t) + 2 z∗ (t) (9.5) on the whole infinite time interval [0, ∞). Note that the function z∗ (·) increases on [0, ∞). Therefore, the time can be uniquely expressed as a smooth function t = t∗ (z), z ∈ (0, ∞). Changing the time variable t = t∗ (z), we find that the function λ0 (z) = λ∗ (t∗ (z)) is a solution to the differential equation (9.2) on the infinite interval (0, ∞), similar to the case where δ < 1. Using solution λ0 (·) of differential equation (9.2) along with (7.44) we can get an expression for the optimal feedback law as follows y∗ (z) = − 1 , λ0 (z)z z > 0. Thus, to find the optimal feedback, we must determine for an initial state z0 > 0 the corresponding initial state λ0 < 0 such that solution (z∗ (·), λ∗ (·)) of system (7.42) with initial conditions z(0) = z0 and λ(0) = λ0 exists on [0, ∞) and λ∗ (·) is the maximal negative function among all such solutions. Note that numerically finding this solution is highly unstable since any trajectory even infinitesimally below it is not optimal and any trajectory even infinitesimally above it is not defined on the whole time interval (and so cannot be optimal as well). We thus do not present a representative solution for this case, as we did for the sustainable case in Figure 9-2. Obtaining this solution would require an intricate numerical procedure which is beyond the scope of this dissertation. Complementing the analysis of this section with that of Chapter 7, let us summarize the main findings in the following theorem. Theorem 5. For any initial state z0 > 0 there is a unique optimal admissible pair (z∗ (·), y∗ (·)) in problem (P 3), and there is a unique adjoint variable ψ(·) that corresponds to (z∗ (·), y∗ (·)) due to the maximum principle (Theorem 4). If δ < 1 then there is a unique equilibrium (ẑ, λ̂) (see (7.47)) in the corresponding current 136 value Hamiltonian system (7.42) and the optimal synthesis is defined as follows    − λ− 1(z)z ,    1+δ y∗ (x) = 2 ,      − 1 , λ+ (z)z if z < ẑ, if z = ẑ, if z > ẑ, where λ− (·) and λ+ (·) are the unique solutions of (9.2) that satisfy the boundary conditions (9.3) and (9.4) respectively. In this case optimal path z∗ (·) is either decreasing, or increasing on [0, ∞), or z∗ (t) ≡ ẑ, t ≥ 0, depending on the initial state z0 . For any optimal admissible pair (z∗ (·), y∗ (·)) we have limt→∞ z∗ (t) = ẑ and limt→∞ y∗ (t) = ŷ (see (7.48)). If δ ≥ 1 then for any initial state z0 the corresponding optimal path z∗ (·) in problem (P 3) is an increasing function, limt→∞ z∗ (t) = ∞, and the corresponding optimal control y∗ (·) satisfies asymptotically to the Hotelling rule of optimal depletion of an exhaustible resource, i.e. limt→∞ y∗ (t) = δ. The corresponding current value adjoint variable λ∗ (·) is defined uniquely as the maximal negative solution to equation (9.5) on [0, ∞). The optimal synthesis is defined as y∗ (x) = − 1 , λ0 (z)z z > 0, where λ0 (z) = λ∗ (t∗ (z)) is the corresponding solution of (9.2). 9.2 Learning and Adaptation In Chapter 6, Section 6.2 we analyzed the open-loop characteristics of the two-agent society and observed the steady-state properties of the system. Issues such as stability of the system and the emergence of free-riding behavior were discussed. For the stable region of the parameter space, we where able to study the strategic interactions between the two groups as a two-player game, formulated at steady state. In Chapter 8, we studied both continuous and discrete time versions of the game. A focus was placed on the nature of the game, more specifically, the difference in the rational outcome of the game and the collectively optimal outcome. We captured this notion via the game tragicness, and elaborated the notion for both continuous and discrete versions of the game. However, during the analysis of the Nash equilibrium, the issue of how the agents actually reach the Nash equilibrium in the 137 consumption game was not discussed. We address this question here through the theory of learning in games [85] where the players change their strategies dynamically according to a particular learning scheme. A frequently studied family of learning dynamics involves players constructing a belief of each other’s future strategies, based on the past strategies played, and playing a best response to the predicted strategy. This form of learning dynamics is commonly known as fictitious play [44] and is perhaps one of the most extensively studied model of learning to date [43]. In this section we extend the game-theoretic construction to a continuous-time repeated game and give a simple demonstration of how the agents can approach the Nash equilibrium by employing basic best response dynamics (an elementary version of fictitious play). This is done by examining the stability of the basic system coupled with the learning adjustment process. Note that there exists no single result giving the learning strategy that always achieves the Nash equilibrium in general two-player games. Rather, rigorous proofs have been given only for specific combinations of games and learning schemes [130] (A summary of learning in games from a control-theoretic perspective is given in [129]). We find that the resulting equilibrium is sustainable in the sense that the consumers do not exhibit any free-riding behavior, with the notion of free-riding being adopted from Chapter 6. 9.2.1 Best-response Dynamics As stated above, after previously defining the consumption game and deriving the Nash equilibrium in Chapter 8 we consider here how the players are able to achieve that equilibrium. We do this by allowing the players to adjust their strategies under fictitious play learning. We employ fictitious play in its most basic form, commonly known as Bestresponse Dynamics, the Best-reply Process or Cournot Adjustment. Best-response learning is generally studied with caution as it is known to encounter several problems when applied as a model of learning in real-world scenarios [43]. Nonetheless it remains one of the oldest, most familiar and perhaps one of the most extensively studied models of dynamic learning [85]. We select it here due to its relative simplicity and its ability to reveal certain dynamic aspects of system behavior that may recur when more sophisticated models of learning are applied. As we will see in what follows, the dynamics of the two-community system under best138 Figure 9-4: Block diagram for (9.6a) coupled with the learning dynamics of (9.6b). The learning process is part of the social component of the model and is highlighted by the shaded area. response dynamics are such that it indeed results in the actions converging to the Nash equilibrium. This shows that the equilibrium is reachable by the agents in a distributed manner, however we must note that we consider only one particular learning scheme and that the Nash equilibrium may be reachable through schemes other than the one considered here. Under these dynamics, the system propagates as follows. ẋ = (1 − x)x − (y1 + y2 )x, ẏ1 = b1 (1 − ν1 )(x − ρ1 ) − b1 ν1 (y1 − y2 ), (9.6a) ẏ2 = b2 (1 − ν2 )(x − ρ2 ) − b2 ν2 (y2 − y1 ), ρ̇1 = BR1 (ρ2 ) − ρ1 , ρ̇2 = BR2 (ρ1 ) − ρ2 , (9.6b) where BRi = ρ̃i is given by (8.1) 1 . Figure 9-4 depicts the dynamics of the overall system 1 Such a formulation of resource-based games while ignoring the transient and focusing on the steady state is not new (see [151] for similar examples). One must bear in mind however, that the conclusions drawn under such assumptions are relevant only for large time-scales and thus caution must be practiced while interpreting the results. 139 coupled with the learning process. Under the dynamics given by (9.6b), the groups’ strategies ρi are updated in direction of the best-response to each other’s actions. Thus by definition, if an equilibrium (x̄, ȳ1 , ȳ2 , ρ̄1 , ρ̄2 ) of the above system exists it must be the Nash equilibrium, since at steady state ρ̄1 = BR1 (ρ̄2 ) and ρ̄2 = BR2 (ρ̄1 ). We find upon solving (9.6) for the equilibrium, that it is given by 2ν1 ν2 ν1 , ȳ1 = , ν1 +ν2 +2ν1 ν2 ν1 +ν2 +2ν1 ν2 ν2 ν1 (3ν2 −ν1 −2ν1 ν2 ) ȳ2 = , ρ̄1 = , ν1 +ν2 +2ν1 ν2 (1−ν1 )(ν1 +ν2 +2ν1 ν2 ) ν2 (3ν1 −ν2 −2ν2 ν1 ) , ρ̄2 = (1−ν2 )(ν2 +ν1 +2ν2 ν1 ) x̄ = (9.7) where ρ̄1 and ρ̄2 indeed constitute the Nash equilibrium as given in (8.2). Note that in (9.7) both consumptions are positive i.e., ȳ1 > 0, ȳ2 > 0 which constitutes a self-reliant equilibrium as per the notion defined in Chapter 6. This is in contrast to the equilibrium (6.5) of the open-loop system, which permits the qualitatively different steady state ȳi > 0, ȳj < 0 (the free-riding phenomenon). Thus in a society following best-response dynamics, the consuming groups do not exhibit free-riding behavior as opposed to the open-loop system (6.4) where the strategies are specified as exogenous parameters. 9.2.2 Convergence to the Nash Equilibrium In order to find whether the Nash equilibrium is reachable or not, we need to explore the stability properties of system (9.6). The global stability of (9.6a) has already been discussed in Chapter 6, Section 6.2 for constant ρi ’s. Since the subsystem (9.6b) does not depend on (9.6a), the stability of the overall system (9.6) can then be deduced by analyzing (9.6b) separately. More precisely, if ρ1 and ρ2 are guaranteed to reach a fixed point, then they may be treated as constants in (9.6a) which is known to be globally stable if inequality (6.16) holds. Thus, once (9.6b) reaches its steady-state, (9.6a) will also converge to its equilibrium (provided (6.16) holds) regardless of where the system was when the steadystate was achieved. Since (9.6b) is linear in ρ1 and ρ2 , the stability can be deduced by 140 analyzing the eigenvalues, which are given as λ1,2 = −1 ± s (ν1 − ν2 )2 + 4ν21 ν22 . 4ν1 ν2 (9.8) It is obvious from (9.8), that both λ1 and λ2 are real. However, λ1 may be positive which corresponds to unstable learning dynamics. It can be seen from Figure 9-5a that the learning dynamics are stable in a major area of the parameter space. Combining this information with the stability condition for (6.4), the overall criterion for stability of (9.6) constitutes the following two conditions (b1 − b2 )(b1 ν1 − b2 ν2 ) + 4b1 ν1 b2 ν2 > 0, (9.9a) (ν1 − ν2 )2 + 4ν21 ν22 − 4ν1 ν2 < 0. (9.9b) This shows that the Nash Equilibrium is reachable via best-response dynamics, if (9.9a) and (9.9b) hold collectively. 9.2.3 Overcoming Free-riding Behavior Figures 9-5b and 9-5c illustrate the learning process for two different points in the parameter space. Due to (9.7), when ν1 = ν2 (Figure 9-5b) then the resource at steady state x̄ equals ρ̄1 = ρ̄2 . However when ν1 6= ν2 (Figure 9-5c), the resource x follows the group with lower social relevance νi . The case depicted in Figure 9-5c is particularly interesting and merits additional interpretation. As seen from the long-term behavior of the graphs, and from the mathematical form of the equilibrium (9.7), higher social-relevance νi implies a lower level of environmentalism ρi and a higher steady state consumption ȳi . This is in contrast to what the steady-state of the open-loop system (6.4) predicts i.e., cooperative individuals are usually associated with higher levels of environmental concern, and also consume less than non-cooperative individuals on average. Indeed this is what has been observed through different social-psychological studies as well [128]. The closed-loop system (9.6) however predicts the behavior of the consumers if they act rationally according to the game defined by (9.6). This highlights the relevance of game theory to distributed control problems, 141 (a) The positivity of λ1 as given by (9.8). (b) Learning process for ν1 = ν2 = 0.5. (c) Learning process for ν1 = 0.75 and ν2 = 0.25. Figure 9-5: left: The region of stability for (9.6b). The cross-hairs correspond to points selected for the subsequent simulations. center: The learning process for identical νi ’s. right: The learning process for different νi ’s. In both simulations b1 = b2 = 1, x(0) = 0.5, y1 (0) = y2 (0) = 0, ρ1 (0) = 0.8 and ρ2 (0) = 0.2. Note that since b1 = b2 , (9.9a) holds true for all ν1 .ν2 . whereby the selected payoffs and learning scheme may be treated as design principles in the bigger problem of social control [130, 127] in order to obtain desired behavior. Indeed as we find here, the selected scheme eliminates the phenomenon of free-riding, which poses a significant challenge in the effective governance of natural resources [151]. 9.3 Discussion In this chapter we have studied the basic consumer networks under feedback mechanisms inspired from the analysis conducted in preceding chapters. Firstly, we devised the optimal feedback law for the single-group network for both sustainable and unsustainable cases. We also discussed how to obtain it numerically for both cases and demonstrated the results through a numerical simulation. Secondly, we applied the theory of learning in games to study the effects of the consumers adapting their characteristics in the two-agent network. The relevance of the Nash equilibrium has been demonstrated by observing the dynamics of agents employing best-response learning dynamics. We hope this serves to instigate inquiry into other complex learning schemes that may also converge to the Nash equilibrium. We also found that while the consumers may indulge in free-riding in the open-loop system, the adoption of best-response learning eliminates this phenomenon. These findings may potentially be used to inform policy making for natural resource management, especially 142 since the study is based on one of the few fully justified mathematical models (at least to our knowledge) of socio-ecological couplings. 143 Chapter 10 Moving Towards Generically Structured Networks The analysis of Chapters 6 – 9 has focused on the basic single and dual agent consumer networks. We now consider the full n-agent network as an open problem. Due to the large dimension and non-linear nature of the system, replicating the analysis of the previous chapters appears not to be straight forward. Here we present the fixed point calculations for two structured n-agent populations using an inductive rather than constructive approach. The exercise highlights the difficulties to be expected for analyzing the behavior of the generically structured network. In the end, we indicate how the network topology may influence the system dynamics via the “Laplacian” of the influence network. 10.1 Static Characteristics for Structured Networks 10.1.1 Well-mixed population Here we assume that the consuming population is well-mixed, i.e., all consumers are connected and exert a uniform influence on each other. Thus the network constitutes a complete graph and the dynamics are given by ẋ = (1 − x)x − n X yi x (10.1a) i=1  n X ν i yj − yi  ẏi = bi (1 − νi )(x − ρi ) + n−1  j=1 144 (10.1b) where i ∈ {1, . . . , n}. We represent any possible equilibria by (x̄, ȳ1 , . . . , ȳn ). First let us note the following assumptions that we will invoke at various points in the analysis that follows (A1) Maximally social society - All consumers carry the maximum possible social weight i.e., ν1 = ν2 = · · · = νn = 1 (A2) Minimally social society - All consumers carry the minimum possible social weight i.e., ν1 = ν2 = · · · = νn = 0 (A3) Maximally environmental society - All consumers manifest the maximum possible level of environmentalism i.e., ρ1 = ρ2 = · · · = ρn = 1 (A4) Minimally environmental society - All consumers manifest the minimum possible level of environmentalism i.e., ρ1 = ρ2 = · · · = ρn = 0 Before presenting the equilibrium for system (10.1), we require the following intermediate results Lemma 4. If (A1) holds, there exist an infinite number of equilibria for system (10.1). Proof. Substituting the assertion of (A1) in (10.1b) and solving for ẏi = 0 gives the following linear system (n − 1)ȳi − X yj = 0 j6=i In matrix notation, the row reduced echelon form for this system is given by            1 0 . . . 0 −1  ȳ1   0 1 . . . 0 −1   ȳ2  .. .. . . .. ..   ..  . . . . .   .   0 0 . . . 1 −1    ȳn−1 ȳn 0 0 ... 0 0             =         0          0   0 0 .. . From here, the solution for the consumption efforts is given by ȳ1 = ȳ2 = . . . ȳn = ȳ where 145 ȳ ∈ R. Substituting this result in (10.1a) we see that either x̄ = 0 or x̄ = 1 − ny. Note that due to (10.1a), x̄ = 1 − ny constitutes a valid equilibrium only if y ≤ 1/n. This completes the proof. Lemma 5. If (A2) holds, there exist an infinite number of equilibria for system (10.1) only when ρ1 = ρ2 = · · · = ρn = ρ (where ρ ∈ [0, 1]). Otherwise no equilibrium exists. Proof. Substituting the assertion of (A2) in (10.1) gives us the following system ẋ = (1 − x)x − n X yi x i=1 ẏi = bi (x − ρi ) It is easy to see that for the case x̄ = 0, the dynamics for yi are given by ẏi = −bi ρi . Thus an equilibrium can exist in this case only if ρi = 0 ∀ i. In fact, the equilibrium would P consist of the single state x̄ = ȳ1 = · · · = ȳn = 0. For the case x̄ = 1 − ni=1 ȳi , we obtain the following system for the steady state efforts n X i=1 ȳi = 1 − ρi This system is solvable only when ρi = ρ ∀ i. In this case the steady state effort is given P by x̄ = ρ and ni=1 ȳi = 1 − ρ. Otherwise no equilibrium exists. Pn Thus, if ρ1 = ρ2 = · · · = ρn = ρ, then the steady state constitutes all points where i=1 ȳi = 1 − ρ with x̄ = ρ. In the event that ρ = 0 there also exists an additional equilibrium consisting of the single state x̄ = ȳ1 = · · · = ȳn = 0. This completes the proof. Lemma 6. In the event that none of (A1), (A2) or (A4) hold true, there can exist no equilibrium for system (10.1) with x̄ = 0. Proof. Assuming x̄ = 0 and solving (10.1b) for ẏi = 0 leads to the following system of 146 equations         −(n − 1) 1 .. . 1 1 ... 1 −(n − 1) . . . .. .. . . 1 .. . 1 . . . −(n − 1)          ȳ1         = (n − 1)        ȳ2 .. . ȳn (1−ν1 )ρ1 ν1 (1−ν2 )ρ2 ν2 .. . (1−νn )ρn νn         It is easy to check that the rank of the coefficient matrix is equal to n − 1. Adding all rows to the last one, gives us the following equivalent form of the equation            −(n − 1) 1 .. . 1 ... 1 1 −(n − 1) . . . .. .. . . 1 .. . 1 .. . 1 1 . . . −(n − 1) 1 0 0 ... 0 0  ȳ1     ȳ2    ..  .     ȳn−1  ȳn             = (n − 1)           (1−ν1 )ρ1 ν1 (1−ν2 )ρ2 ν2 .. . (1−νn−1 )ρn−1 νn−1 Pn (1−νi )ρi i=1 νi            P i )ρi = 0. Since none of (A1),(A2) which means that a solution can exist only if ni=1 (1−ν νi Pn (1−νi )ρi (1−νi )ρi > 0 ∀ i and so, i=1 νi 6= 0. Thus no equilibrium exists in or (A4) are true, νi this scenario. Lemma 7. In the event that none of (A1), (A2), (A3) or (A4) hold true, there is a unique P equilibrium for system (10.1) with x̄ = 1 − ni=1 ȳi . This equilibrium will exist only if there are at least n − 1 consumers with positive social weight (νi > 0) Proof. We know from (10.1a) that ẋ = 0 if x + Pn i=1 yi = 1. Substituting this in (10.1b) and solving for ẏ = 0, gives us the following system of equations (n − 1)ȳi + (n − 1 − nνi ) X j6=i ȳj = (n − 1)(1 − νi )(1 − ρi ) In matrix form  (n − 1)    (n − 1 − nν2 )  ..   .  (n − 1 − nνn ) (n − 1 − nν1 ) ... (n − 1 − nν1 ) (n − 1) .. . ... .. . (n − 1 − nν2 ) .. . (n − 1 − nνn ) . . . (n − 1) 147         ȳ1   (1 − ν1 )(1 − ρ1 )       (1 − ν2 )(1 − ρ2 )  = (n − 1)  ..     .   ȳn (1 − νn )(1 − ρn ) ȳ2 .. .         Since neither of (A1) nor (A3) hold true, the vector on the RHS does not equate to zero. Thus for the purpose of this proof, it suffices to show that the coefficient matrix for the above equation is full rank. We do this by observing the determinant, which is given as (n − 1) (n − 1 − nν1 ) . . . (n − 1 − nν1 ) (n − 1 − nν2 ) .. . (n − 1) .. . . . . (n − 1 − nν2 ) .. .. . . (n − 1 − nνn ) (n − 1 − nνn ) . . . (n − 1)  = n n Y j νj − X j   Y k6=j  νk  It can be seen that in order for the determinant to be non-zero, there cannot be more than one consumer with social weight νi equal to zero. In this event, the coefficient matrix above will always be full rank, and thus a unique equilibrium will always exist for system (10.1). This concludes the proof. In light of the new condition obtained by Lemma 7, we define the following assumption (A5) Sufficiently social society - There exists no more than one consumer in the population who carries social weight νi equal to 0. Corollary 1. If (A5) does not hold true, then there exists no equilibrium for system (10.2) Proof. The corollary follows directly from Lemma 6 and Lemma 7 . Now that all the pathological cases have been delineated, we are ready to complete the specification of the equilibrium for system (10.1). Lemma 8. In the event that (A5) holds, and none of (A1)-(A4) hold true, the equilibrium for system (10.1) is given by x̄ = X i n  ρi (νi − 1) Y j ȳi = 1 + n νj − X j   Y j6=i Y k6=j   νj   νk  ρi (νi − 1) (1 − n) (10.2a) X j6=i   Y k6=i,j  νk  + n(n − 2)  n n Y Y j6=i νj − j 148 νj  − (1 − n + nνi ) X j    Y k6=j  νk  X j6=i  ρj (νj − 1) Y k6=i,j  νk  (10.2b) where i, j, k ∈ {1, . . . , n}. Proof. We begin by substituting the expression given by (10.2) in (10.1a). Since x̄ 6= 0, in P order for ẋ to be zero, it must be true that x̄ + ȳi = 1. Summing equations (10.2a) and (10.2b) over all i gives us x̄ + n X ȳi i=1 =n 1 n =1+ + n X n X n Y j6=i i=1 n Y   X Y Y X Y νj +(1−n)  νk +n(n−2) νj − (1−n+nνj ) νk j6=i νj +n(n−2) j6=i Y k6=i,j  n n νj −n j6=i j6=i  i=1 =1+ n X n(n−1) Y =1+ νj −n(n−1) j6=i =1+ n X i=1 =1 Y k6=i  (n(n−1)−n(n−1))  i=1 n n Y j6=i Y j6=i n n Y j   νj − X j   j  k6=i Y  Y k6=j Y νj − j X j νj − j X j X j k6=i,j Y k6=j     j6=i Y k6=j  k6=i,j Y k6=j  j6=i Y k6=j ρi (νi −1) νk  k6=i,j j6=i  k6=i,j  ρi (νi −1) νk   j6=i k6=i,j ρi (νi −1) νk    X Y νj +(1−n−(1−n))  νk νj − k6=i,j   X Y X Y νk  +(1−n)  νk − (1−n) νk Y j6=i n n j j6=i νj − j X j6=i      X Y X Y  νk +(1−n)  νk −(1−n) νk    Y X Y (0) νj +(0)  νk  Y n n i=1 n X X j6=i  k6=i,j ρi (νi −1) ν k   ρi (νi −1) νk  which shows that ẋ indeed vanishes at the point given by (10.2). Next we need to show P that ẏi also vanishes at (10.2). Since we have just shown that x̄ + ȳi = 1, we can use this 149 relation to simplify (10.1b), prior to substitution of (10.2). We write (10.1b) as follows  νi n−1 ẏi = bi (1 − νi )(x − ρi ) − νi yi +  X j6=i  yj   n X νi νi yi − νi yi + yj  n−1 n−1 j=1   n nνi νi X   = bi (1 − νi )(x − ρi ) − yi + yj n−1 n−1 = bi (1 − νi )(x − ρi ) − j=1 While evaluating at (10.2), since x̄ + this substitution, we get P ȳi = 1, we can substitute Pn = 1 − x̄. Making j=1 ȳi   νi nνi ȳi + (1 − x̄) ẏi |(x̄,ȳi ) = bi (1 − νi )(x̄ − ρi ) − n−1 n−1 rearranging the terms gives us ẏi |(x̄,ȳi ) = bi  nνi 1− n−1  nνi νi x̄ − ȳi − (1 − νi )ρi + n−1 n−1  now substituting x̄ and ȳi from (10.2) ẏi |(x̄,ȳi ) =  j n Y νj − j −    Y nνi X  1− ρj (νj − 1) νk  n−1  X j   k6=j Y k6=j ρi νi (νi − 1) n(n − 2)  (n − 1) n Y − (1 − νi )ρi + νj − j X j νi    νk  Y j6=i Y k6=j  νj   + νk  − nνi n−1 1 n    X Y  ρi νi (νi − 1)  νk  j6=i + n νi (1 − n + nνi )  (n − 1) n n−1 150 X j6=i Y j Y  νj − j X j ρj (νj − 1) νj − X j   Y k6=j   k6=i,j Y k6=j Y k6=i,j νk   νk   νk   simplifying ẏi |(x̄,ȳi ) =   j n Y X νj − j  k6=j Y k6=j j   νk  ρi (νi − 1) n(n − 2)  − (n − 1) n Y (n − 1 − nνi )  = (n − 1) n X νj − j j − (1 − νi )ρi +    j k6=j j6=i X νj − j j   Y k6=j j6=i Y νj − j X j   k6=j Y k6=j νk  ρi (νi − 1) (n − 1 − nνi )  (n − 1) n Y νj − j X j    = (n − 1) n k6=j  ρi (νi − 1) (n − 1) X j6=i   X j Y k6=j  (n − 1) n  (n − 1) n    X Y  (n − 1) n Y νj − j k6=j Y k6=j j6=i  νj − j6=i  Y k6=j ρj (νj − 1) νj − X νk X   j j νk  j X Y  ρj (νj − 1) j (1 − n + nνi ) X j Y   j    Y k6=j Y k6=j  νk   νk  Y k6=j  νk   νk  νj  Y k6=j  νk   − (1 − νi )ρi νk  X j  ρi (νi − 1) n(n − 2) − Y Y νj − j νk  νk  j6=i Y   + k6=i (n − 1 − nνi − (n − 1 + nνi )) + νk   νj − X (1 − n + nνi )  + k6=j Y j     X Y  ρi (νi − 1)  νk  n + n Y ρj (νj − 1) j6=i + νj  Y  X Y Y    X Y  ρi (νi − 1)  νk    Y nνi X  1− ρj (νj − 1) νk  n−1  ρj (νj − 1)   Y k6=j   Y k6=j νk  νk  − n(n − 2) (n − 1) n Y j νj − X j 151    νk  Y j Y k6=j − (1 − νi )ρi νj + (n − 1 − nνi )  νk  Y k6=i  νk  (0) X j6=i  = (n − 1) n +  ρj (νj − 1) Y j νj − X j  ρi (νi − 1) (n − 1) Y k6=j    νk  Y k6=j X j6=i    − (1 − νi )ρi νk  Y k6=j  νk  − n(n − 2)  (n − 1) n  = 0 − (1 − νi )ρi + Y ρi (νi − 1) (n − 1)  (n − 1) n  =(νi − 1)ρi − ρi (νi − 1)(n − 1) n  (n − 1) n Y j νj − j Y X j Y   j Y νj − j   j νj −  X  j   Y k6=j j = (νi − 1)ρi − (νi − 1)ρi = 0 Y k6=j  X X νj + (n − 1) j  νk  νk  − n(n − 1) k6=j j νj − X Y   Y k6=j Y k6=j  Y νk − n k6=i Y j Y j  νj   νj  ν k   νk   νk  Thus both ẋ and ẏi vanish at (10.2), which shows that it is indeed the equilibrium for system (10.1). This completes the proof. 10.1.2 Star population Now we assume that the population is structured so that there exists a consumer i∗ that is connected to every other consumer, and that no other connections exist. Thus the network constitutes a star graph and the dynamics are given by ẋ = (1 − x)x − n X yi x (10.3a) i=1  n X ν 1 yj − y1  ẏ1 = b1 (1 − ν1 )(x − ρ1 ) + n−1  (10.3b) j=1 ẏi = bi ((1 − νi )(x − ρi ) + νi (y1 − yi )) 152 i 6= 1 (10.3c) where i ∈ {1, . . . , n}, and the indices are ordered so that i∗ = 1. We represent any possible equilibria by (x̄, ȳ1 , . . . , ȳn ). Before presenting the equilibrium for system 10.3, we require the following intermediate results Lemma 9. If (A1) holds, there exist two equilibria for system (10.3). The first equilibrium (x̄, ȳ1 , . . . , ȳn ) is given by (1, 0, . . . , 0) and the second equilibrium is given by (0, 0, . . . , 0). Proof. Substituting the assertion of (A1) in (10.3b) and (10.3c), and solving for ẏi = 0 gives the following linear system (n − 1)ȳ1 − n X yj = 0 j=2 ȳi − ȳ1 = 0 i 6= 1 it is easy to see that ȳ1 = . . . ȳn = 0 is the only solution to the above equations. Substituting this in (10.3a) and solving for ẋ = 0 yields x̄ = 1 or x̄ = 0. Thus (1, 0, . . . , 0) and (0, 0, . . . , 0) are the two equilibria for this case. Lemma 10. If (A2) holds, there exist an infinite number of equilibria for system (10.3) only when ρ1 = ρ2 = · · · = ρn = ρ (where ρ ∈ [0, 1]). Otherwise no equilibrium exists. Proof. Substituting the assertion of (A2) in (10.3) gives us the following system ẋ = (1 − x)x − n X yi x i=1 ẏi = bi (x − ρi ) Following the same argument as that presented in proof of Lemma 5, we see that if P ρ1 = ρ2 = · · · = ρn = ρ, then the steady state constitutes all points where ni=1 ȳi = 1 − ρ with x̄ = ρ. In the event that ρ = 0 there also exists an additional equilibrium consisting of the single state x̄ = ȳ1 = · · · = ȳn = 0. This completes the proof. Lemma 11. In the event that none of (A1), (A2) or (A4) hold true, there can exist no equilibrium for system (10.3) with x̄ = 0. 153 Proof. Assuming x̄ = 0 and solving (10.3b) & (10.3c) for ẏi = 0 leads to the following system of equations            −(n − 1) 1 1 . . . 1    1 0 ... 0    0 1 ... 0   .. .. . . ..   . .  . .  0 0 ... 1 −1 −1 .. . −1  ȳ1  −(n−1)(1−ν1 )ρ1 ν1 (1−ν2 )ρ2 ν2 (1−ν3 )ρ3 ν3     ȳ2       ȳ3  =    ..    .    ȳn .. . (1−νn )ρn νn            It is easy to check that the rank of the coefficient matrix is equal to n − 1. Subtracting all subsequent rows from the first row, gives the following equivalent form of the equation            0 0 0 ... 0  ȳ1   −1 1 0 . . . 0     −1 0 1 . . . 0    .. .. .. . . ..   . .  . . .  −1 0 0 . . . 1       ȳ2       ȳ3  =    ..    .    ȳn P (1−ν )ρ −(n−1)(1−ν1 )ρ1 − nj=2 νjj j ν1 (1−ν2 )ρ2 ν2 (1−ν3 )ρ3 ν3 .. . (1−νn )ρn νn            P (1−ν )ρ (n−1)(1−ν1 )ρ1 + nj=2 νjj j = 0. Since ν1 P (1−ν )ρ 1 )ρ1 ∀ i and so, (n−1)(1−ν + nj=2 νjj j ν1 which means that a solution can exist only if (1−νi )ρi νi of (A1),(A2) or (A4) are true, >0 Thus no equilibrium exists in this scenario. none 6= 0. Lemma 12. If none of (A1),(A2) or (A4) hold true, the equilibrium for system (10.3) is given by (n − 1)ρ1 (ν1 − 1) νj + j6=1 x̄ = 2(n − 1) Y j ȳ1 = Y 1 + n νj − X j6=1    X k6=j (n−1)ρ1 (ν1 −1) −  Y ρi (νi − 1) j6=i νk  − (n − 1) k6=1 i Y  X j6=1     Y k6=1,j  Y νj  νk νk  +(n−2) n 2(n − 1) Y j νj − (10.4a) X j6=1 Y k6=1   154  νk  −(1−n+nν1 ) Y k6=j  νk  − (n − 1) X j6=1 Y k6=1  ρj (νj −1)  νk  Y k6=1,j  νk  (10.4b) 1 ȳi = − n   X  (n − 1)(−1 + ν1 )  j6=i  n 2(n − 1)  + − (−1 + νi ) −n  X j6=1   j6=i,j6=1  Y n 2(n − 1) νj − Y Y Y νk  − (n − 1) X  νj − X j6=1 Y   Y   Y k6=j X j6=1   Y Y k6=j k6=1  νk + 2n νk  − (n − 1) Y k6=1 Y k6=j Y k6=1  νk  ρ1 νk  Y k6=i  k6=1,j Y Y νk + 2n(n − 2) νk  − (n − 1)  j6=1 k6=i,1 Y Y νk + 2 k6=1,k6=i νk  − (n − 1) k6=j νk − (n − 1) k6=i,j νj −  νk  − (n − 1)2 j j  j6=1 j (−1 + νj ) −n  k6=1,k6=j k6=i,j n 2(n − 1) X Y   νk  ρi (10.4c) νk   νk  ρj  νk  where i ∈ {2, . . . , n} and j, k ∈ {1, . . . , n}. Proof. The proof follows by substituting the expressions of x̄, ȳ1 and ȳi , i ∈ {2, . . . , n} from (10.4) in (10.3). Following the same steps as in Lemma 8, it can be found that the derivatives ẋ, ẏ1 and ẏi i ∈ {2, . . . , n} indeed equate to zero. Since none of (A1),(A2) or (A4) are true, (10.4a) is the unique equilibrium for system (10.3). 10.2 System Dynamics and the Role of the Laplacian Consider the original system of the consumer network reproduced as follows from (4.3) ẋ = (1 − x)x − x  n X yi , i=1 ẏi = bi αi (x − ρi ) − νi n X j=1  (10.5) ωij (yi − yj ) . Recall from Chapter 5 that the influence that j has on i’s consumption is given by bi νi ωij . Let us represent this influence by γij = bi νi ωij . The system may now be written as ẋ = (1 − x)x − x n X yi , i=1 ẏi = bi αi (x − ρi ) − n X j=1 (10.6) γij (yi − yj ) , 155 x × Q ẋ R - × + T - 1 1 ~c - ~y˙ + P ~a P - R ~y L Figure 10-1: Block diagram showing the coupled resource and consumption dynamics. where the weights γij directly define the influence network which is different from the social network that the ωij ’s represent. The consumption dynamics can now be written in compact form as      d− 1 b α ẏ   −γ21  1  1 1   ..   ..   .  =  . x −  .  ..      bn αn ẏn −γn1 where d− i = Pn j=1 γij −γ12 d− 2 .. . −γn2 ... ... .. . ...      b1 α1 ρ1  y1     −γ2n    ..    .. −      . . ..      .  y b α ρ n n n n d− n −γ1n (10.7) is the in-degree of node i in the influence network. We may represent this system as ~y˙ = ~a x − L ~y − ~c (10.8) where the definitions of the matrices can be seen from (10.7). L is the Laplacian matrix [60]. The coupled resource and consumption dynamics can now be represented as follows   ẋ = f (x, ~y ) = 1 − x − 1T ~y x (10.9) ~y˙ = ~a x − L ~y − ~c 156 It is worth noting here that the matrix L contains all information about the network topology. This is a system in which the network topology (in the form of L) appears explicitly in the dynamical model. Thus if there exists a relation between the poles of (10.9) and the eigenvalues of L then it may be translated into a relation between the network topology and overall behavior of the system. Appendix C gives a short demonstration of how network structure effects the eigenvalues of the Laplacian. 157 Chapter 11 Epilogue This chapter is intended as a commentary on the work that has been presented in this thesis. More specifically, the material in this chapter reinforces the arguments of the first part of the dissertation, in hindsight of the more technical subject matter presented thereafter. After revisiting the cybernetic ideology and its potential with respect to the control of socioecological systems, we provide a summary of conclusions for the dissertation. We then explore future avenues to expand the work and also contemplate the prospects offered by a few systems-theoretic tools developed by the controls faction of the engineering community. 11.1 Revisiting the Cybernetic Picture Norbert Weiner, through his discourse [206, 205], intended for cybernetics to embrace universal principles, independent of system domain, that were applicable to both man-made and living systems [183]. He also succeeded in demonstrating that the cybernetic principles could be applied fruitfully, at least in theory, to all systems, independent of context. Unfortunately, Weiner’s time came and went, and slowly, the face of cybernetics was lost under its mainstream descendants of control and communication. Indeed in the present era, as Thomas Rid puts it [164], the prefix “cyber” is commonly slapped without comprehension, in front of other terms (as in “cyberspace” or “cyberwar” ) to make them sound more technologically intensive, more cutting edge, more compelling – and sometimes more ironic. The principles of cybernetics are now becoming increasingly relevant due to the evergrowing involvement of human beings in technological applications. While the population bomb is constantly testing the sustaining boundaries of our planet, mankind has come 158 to realize the intricate relationship between our economic system, the environment and technology. One cannot be changed independently of the others and so, an integrative approach is required to seize the holy grail of sustainable development. In this dissertation, we have argued that the principles of cybernetics may provide the necessary language for such an approach, at least for the effective governance of our natural resources, an absolute necessity for sustainability. Before framing the resource governance problem, it is important to comprehend the criticality of the issue and to realize that it is possible to address it in a distributed and scalable manner. This has been our focus in Chapter 1. In Chapters 2 and 3 we discussed the relevance of the cybernetic approach to natural resource governance from two different perspectives. Firstly, scientists already working on global issues in coupled human and natural systems have employed the systems theoretical approach in various forms with different levels of abstraction and in varying contexts. However there is much potential in employing the cybernetic tradition which is still largely untapped, especially due to the prospects that technological solutions now offer regarding various environmental challenges of global concern. Secondly, engineers have actively been applying the cybernetic principles in the form of feedback control and communication to a diverse range of applications which have recently begun to take on more human-centric implementations. The age of “smarts” is quickly being ushered in, with the dream of smart cities and the internet of everything seemingly within grasp. We argue that the cybernetic method offers an integrative language in which the engineers are able to view complex CHANS through the same lens that they are so accustomed to view their machines through, and thus account for human and environmental factors more effectively. The idea of viewing natural systems as machines is not new. Wescoat for instance, describes in [204] how the British engineers took inspiration from the steam engine while laying out the design of the irrigation system in colonial India. However, while the physical principles of matter and energy have largely guided this “mechanistic” world view [96] in prior times, the cybernetic world view includes information as a new fundamental pillar, the relevance of which has grown immensely in recent times. Although we have not talked explicitly about the role of information in cybernetic systems, its immense significance is undeniable [139, Part III] and has perhaps already been grasped by the reader. Consider the control loop depicted in Figure 11-1. Each arrow in the figure represents a flow of infor159 Figure 11-1: The cybernetic picture revisited. This figure has first appeared in Chapter 3 and has been reproduced here for the sake of readability. mation in one sense or another. The sensors send information about the state of the system to the “controller” or decision maker. Based on the information received from the sensors and the ultimate objective of the system, the decision maker then sends information about the correcting action to the actuator. The action of the actuator and the stimulus received by the sensor also have interpretations as information being conveyed to and received from the system respectively (see [206, Chapters III, VII] and [63]). It is also worth noting that the concepts of cybernetics are not new for the ecological and social sciences communities. In 1979 James Lovelock introduced the Gaia1 hypothesis as a new perspective of the ecosphere [123]. Gaia is envisioned as a complex entity that includes all of Earth’s biosphere, atmosphere, oceans and soil. The aggregate of these components constitutes a complex feedback system whose sole objective is to sustain an environment that is optimal for life. Although the Gaia hypothesis has been met with much controversy [177] it has served as a precursor to the more rigorous discipline of geo-cybernetics [172], that has much overlap with the Earth Systems Analysis framework referred to in Table 2.1, 1 The term Gaia is a reference to the Greek Earth Goddess. 160 and envisions control strategies at a planetary level. On the other hand, the cybernetics ideology has also seeped into the social sciences, giving birth to the discipline of socio-cybernetics [125] that is concerned with the application of cybernetic models to the social and human sciences. Anton [5] identifies over 15 research directions for socio cybernetics which include the cybernetics of education, social accountability, cyberspace and the internet, social networks, democratization, management of complex firms, trust and problem solving. In particular, the application of cybernetics to management and organization goes back more than half a century [29] and management cybernetics is, by now a well studied and established domain. Even though cybernetics has been applied separately to systems originating from both ecological and social sciences, natural resource systems pose a unique challenge for the application of cybernetic models as they span across both social and ecological disciplines. The addition of a third aspect in the form of technology and its recent accentuation in CHANS makes the challenge extremely relevant to the controls community in particular. As we have seen in the content of the dissertation, the application of cybernetics to NRM involves the study of human psychology, the exercise of ecological modeling and an understanding of social interactions, all of which are beyond the conventional domain of the control sciences. Although we have argued in support of the relevance of cybernetic methods to NRM for the social and ecological communities, the main focus of the dissertation is geared towards the engineering community. We have argued that the technical systems envisioned for social and environmental control cannot be successfully realized if the human aspect is not properly accounted for. We hope that through this dissertation we have been able to depict, at least to some extent, how this may be achieved. 11.2 Summary of Main Findings Here we present a summary of the main findings for the technical part of the dissertation. The language of cybernetics translates all processes into mathematical models. Whether the models are conceptual or data-driven, they are always understood to lie at the heart of the regulating mechanism [62]. In Chapter 4, we presented a mathematical model of consumer decision making, developed from social psychological research in consumer behavior. The model is agent-based with n equations with n consumers and one additional equation 161 for the resource dynamics. Understandably, the dimension of such a system makes it less tractable, especially due to the non-linearity of the resource dynamics, for large consuming populations. In Chapter 5 we addressed this problem by introducing block-models of resource consumption where the dynamics describe not the consumption of individuals, but the aggregate consumption of tightly knitted communities with uniform characteristics. We found under certain structural assumptions, that the lumped parameter model has the same form as the original model and thus in the subsequent analysis, we are able to understand a consuming agent as either comprising a single individual, or groups of individuals with homogeneous characteristics. Referring to the cybernetic picture of Figure 11-1, this pertains to understanding the process, how its dynamics are dependent on the various social and ecological factors and the conditions under which the selected model of is valid. Chapters 6 – 10 presented various applications and extensions of the developed model. Chapter 6 discussed the open-loop characteristics of the system at different levels of abstraction. We saw how a mathematically straight-forward exercise such as steady-state analysis was able to yield profound insights on phenomena such as free-riding behavior. We found that high preference to social information and homogeneity in the levels of environmental concern promoted self-reliant behavior. Where there was asymmetry in the environmentalism, the relatively environmental group showed a tendency to subsidize the consumption of the other group. This tendency decreased with increasing levels of preference to social behavior. We then studied the society as an aggregated single entity in Chapter 7 and studied favorable consumption patterns via the application of optimal control theory. This required us to define a mathematical notion of collective welfare and sustainable development, which may require considerable debate while interpreting the results for real-world settings (refer to the “decide” block in Figure 11-1). We found the optimal consumption path to be sustainable if the discounting of future consumption was below a certain level, which corresponds to a long-term planning policy in a real-world setting. We also devised the optimal feedback law in both the sustainable and unsustainable cases. In order to analyze the interactions between groups and how they might strategically be exploited by the consuming agents, we analyzed the most basic network (the diad) in a game-theoretic framework in Chapter 8. The positive role of environmental concern and preference to social information was explored along with the mixed role of heterogeneity in the consuming society, prompting for a deeper categorization of heterogeneity beyond conventional classi162 fications. We developed a notion of tragedy in the consumption game and saw that high preference to social information and high levels of environmentalism were able to reduce the game “tragicness”. In Chapter 9, we returned to the single and dual agent networks of Chapters 7 & 8 and discussed the effects of feedback, via the optimal feedback law for the single agent case, and via the theory of learning in games for the dual agent case where we saw how the selected learning scheme discouraged free-riding behavior in the long-run. We also saw in the formulated scenario that the agents were able to reach the Nash equilibrium via simple best response dynamics. Finally, Chapter 10 intended as a possible extension, included calculations for the equilibrium of the full n agent network for two different types of structured populations, namely the complete network and the star network. In the end it was discussed that the topology of the network may possibly play a significant role in determining the overall behavior of the system via the Laplacian. If such an exercise is undertaken, it may give an indication as to what type of network structures are “sustainable” in our model of natural resource consumption. 11.3 Open Problems and Future Avenues Here we describe a few possibilities for further research. Note that there exist some natural extensions to the work of this dissertation that have already been discussed in the preceding chapters. These mostly pertain to the relaxation of assumptions and the consideration of additional effects both from within and outside the system. However the discussion below is related to certain aspects not covered in the dissertation, that we feel must be covered in the envisioned cybernetic foundation for natural resource governance. 11.3.1 A Rigorous Definition of Sustainability Given the state of the current landscape in sustainability science, aspiring for a rigorous, agreed-upon definition of sustainability is perhaps too optimistic at this point. However consciously or unconsciously, it remains the underlying goal of any management scheme for natural resource systems. The definition of sustainable development given by the Brundtland Commission [47] is as follows : “sustainable development is development that meets the needs of the present without compromising the ability of future generations to meet their own needs”. While this definition of sustainability has been agreed upon and adopted by 163 many nations, a clear, rigorous definition is still not evident. The different perspectives on sustainability coming from various disciplines further aggravates the issue. For instance, in biology sustainability means avoiding extinction and learning to survive and reproduce. In economics sustainability means avoiding major disruptions and collapses, hedging against instabilities and discontinuities. In ecology sustainability describes the capacity of ecosystems to maintain their essential functions and processes, and retain their biodiversity in full measure over the long-term. Costanza and Patten [64] attempt to decipher the common aspects of these various definitions and argue that a sustainable system is essentially a system that persists. Unfortunately, the definition of a sustainable system as one that persists poses more questions than it answers. The foremost of them being: what characteristics of the system must persist, and for how long? It is easy for control engineers to confuse sustainability with stability. However, a stable system is not necessarily a sustainable one, at least on some scale. The evolution of systems dictates that in order for the system to survive as a whole, smaller, sub-optimal parts must adapt or vanquish. The cybernetic framework relies much heavily on mathematical models, and any notion of sustainability applied within the framework must be mathematically rigorous as well. There have already been some attempts in this regard (see for instance [59], [49], [195]), however they are mostly domain specific and have not qualified as definitions that are agreed upon across disciplines. Indeed we admit that the definition of sustainability provided in Chapter 7 of this dissertation also falls within this category. Nevertheless, the cybernetically inclined still yearn for a “sustainability function” similar to the Lyapunov functions that they rely most heavily on for characterizing long-term behavior of their systems. 11.3.2 Formulating Social Variables in the Context of Feedback Control During the discourse of the dissertation, we have largely overlooked the “sense” and “actuate” blocks of the control loop from Figure 11-1. However these blocks hold immense importance in any realization of feedback control. Before any mathematically intricate issues are brought up, let us consider the following: how do we sense? and how do we actuate? In Figure 11-1 we have listed several mechanisms by which control may be exerted on the consuming population of a natural resource. While it is certainly hard to disagree that mechanisms such as education, taxation and information dissemination can indeed in164 fluence consumer behavior, the more relevant issue to us right now is how to incorporate these strategies in a formal control law. For instance, what would education look like as a control variable in system (4.3)? What would be the mathematical nature of that variable, what would its units be and how would we be able to justifiably associate any numerics with it? Clearly we are nowhere near to furnishing an answer to these questions than we are to reaching a quantifiable notion of sustainable development. It seems befitting that Stankovic [187] lists the incorporation of social models into the formal methodology of feedback control as one of the major challenges for the control of CPS. Let us now consider the “sense” block of Figure 11-1. In all the mathematical models developed in the dissertation, it has conveniently been assumed that the state of the system is accessible for the decision maker (whether the decision making happens in a centralized or distributed manner). Sensing technologies have greatly evolved over time [184], with smart sensing technologies offering opportunities for control that were not thought to be possible a few decades ago. However, we are still not quite there yet when it comes to sensing cognitive variables and social influences at least for the particular control loop envisioned in Figure 11-1. Not only this, but formulation of the mathematical nature of the variables to be sensed would pose the same challenges that have been discussed above regarding the control variables. On the other hand, implementing the “decide” block associated with the decision maker requires intense debates of moral and ethical nature. The difficulty of framing the objective of sustainability has already been discussed in the previous section. Since these issues have been relevant long before the recent advent of control and sensing technology, they have at least been thoroughly discussed for a long time now by the political scientists and economists [155]. 11.3.3 The Issues of Controllability and Observability In the previous section, we have deliberated over the formulation of the various control mechanisms listed in Figure 11-1. Assuming that this has been done successfully, the next question that arises: is it possible to steer the system to the required state using the selected control scheme? For instance, is educating the population enough to ensure sustainability or is there a need for increased taxation? In order to control the consumption pattern of the entire network, is there a need to control every consumer individually or is there a possibility 165 of targeting only the most influential nodes? The set of states that are attainable using one control mechanism may be different than that of another, which can reveal the viability of one mechanism over the rest. This is the type of information that the controllability [81] of the system can reveal. Observability [81] on the other hand relates to issues in sensing. Consider the synthesis of the feedback control law in Section 9.1, which requires complete information about the state of the resource being available to the decision maker. Similarly, the the adjustment process from Section 9.2 assumes that each consumer has complete knowledge about the other consumer’s information preferences. Assuming that there existed a sensor to convey this information, an n-agent network would require knowledge of the characteristics of all n agents. Installing a sensor for each consumer in large populations would not only be an extremely tedious exercise, but would also be extremely expensive both economically and computationally. In such a scenario, the tool of observability can help identify exactly which of the nodes need to be sensed/observed in order for the control law to serve its purpose effectively. It can also be used to explore the feasibility across different types of sensing mechanisms. The concepts of controllability and observability are not new [108] and there exist elegant results for linear systems, non-linear systems [112] and even for complex networks [121, 122] which have the potential to yield important insights for our resource-consumer network. 11.4 Final Remark In this chapter we have presented a concluding note to the work conducted as part of this dissertation by summarizing the ideology and main findings of the research along with a few considerations for further work. As a final remark we wish to emphasize that the analysis presented in this dissertation, is in no way meant to give a complete account of the cybernetics of natural resources. Indeed such an exposition would require several dissertations to say the least. Rather, it is intended to portray the potential that the cybernetic perspective holds for the resource governance problem, and global environmental issues in general. One must also bear in mind that at the cybernetic foundation of every synthesized regulating mechanism, lies a mathematical model. However, no model (including the one presented herein) is perfect, thus implying that the models and their conclusions are only as good as 166 their underlying assumptions. It would appear from this dissertation (and almost all logical treatments of NRM for that matter) that sustainable management of our natural resources while simultaneously catering for the needs of a growing world population, is an extremely daunting task to say the least. Perhaps as science and human knowledge progress, mankind will be able to dig itself out of the current environmental crisis. For now, we must stay focused on doing our part and not lose faith in our planet. The frame of mind that should guide our environmental research is perhaps best summarized in the following note that Donella Meadows had taped on her office door [133] while she was still alive, “Even if I knew the world would end tomorrow, I would plant a tree today” - Anonymous. 167 Bibliography [1] Daron Acemoglu. Introduction to modern economic growth. Princeton University Press, 2008. [2] John M Anderies. On modeling human behavior and institutions in simple ecological economic systems. Ecological Economics, 35(3):393–412, 2000. [3] Jay M Anderson. A model for“the tragedy of the commons”. Systems, Man and Cybernetics, IEEE Transactions on, (1):103–105, 1974. [4] Elliot Anshelevich, Anirban Dasgupta, Jon Kleinberg, Eva Tardos, Tom Wexler, and Tim Roughgarden. The price of stability for network design with fair cost allocation. SIAM Journal on Computing, 38(4):1602–1623, 2008. [5] Mihail Anton. Sociocybernetics: Challenges and perspectives for the cyber security and cyber defence. In International Scientific Conference” Strategies XXI”, volume 3, page 73. ” Carol I” National Defence University, 2015. [6] Jack Arbuthnot. The roles of attitudinal and personality variables in the prediction of environmental behavior and knowledge. Environment and behavior, 9(2):217–232, 1977. [7] Peter M Asaro. What ever happened to cybernetics? Geist in der Maschine. Medien, Prozesse und Räume der Kybernetik. Austria: Verlag Turia & Kant, pages 39–49, 2010. [8] Sergei M Aseev, Konstantin O Besov, and Arkadii V Kryazhimskii. Infinite-horizon optimal control problems in economics. Russian Mathematical Surveys, 67(2):195, 2012. [9] Sergei M Aseev and Arkady V Kryazhimskiy. The pontryagin maximum principle and transversality conditions for a class of optimal control problems with infinite time horizons. SIAM Journal on Control and Optimization, 43(3):1094–1119, 2004. [10] Sergey Aseev and Talha Manzoor. Optimal growth, renewable resources and sustainability. WP-16-017:29pp, 2016. [11] Sergey M Aseev and AV Kryazhimskii. The pontryagin maximum principle and optimal economic growth problems. Proceedings of the Steklov institute of mathematics, 257(1):1–255, 2007. [12] Sergey M Aseev and Vladimir M Veliov. Maximum principle for infinite-horizon optimal control problems with dominating discount. Dynamics of continuous, discrete and impulsive systems, Ser. B: Applications & algorithms, 19:43–63, 2012. 168 [13] Sergey M Aseev and Vladimir M Veliov. Maximum principle for infinite-horizon optimal control problems under weak regularity assumptions. Proceedings of the Steklov Institute of Mathematics, 291, supplement 1:22–39, 2015. [14] Sergey Mironovich Aseev. Adjoint variables and intertemporal prices in infinitehorizon optimal control problems. Proceedings of the Steklov Institute of Mathematics, 290(1):223–237, 2015. [15] Sergey Mironovich Aseev. On the boundedness of optimal controls in infinite-horizon problems. Proceedings of the Steklov Institute of Mathematics, 291(1):38–48, 2015. [16] Sergey Mironovich Aseev. Existence of an optimal control in infinite-horizon problems with unbounded set of control constraints. Trudy Instituta Matematiki i Mekhaniki UrO RAN, 22(2):18–27, 2016. [17] SM Aseev and VM Veliov. Needle variations in infinite-horizon optimal control. Variational and optimal control problems on unbounded domains, 619:1–17, 2014. [18] Geir B Asheim and Tapan Mitra. Sustainability and discounted utilitarianism in models of economic growth. Mathematical Social Sciences, 59(2):148–169, 2010. [19] Caroline Ashley, Diana Carney, et al. Sustainable livelihoods: Lessons from early experience, volume 7. Department for International Development London, 1999. [20] Jesse H Ausubel, Hedy E Sladovich, et al. Technology and environment. National Academies Press, 1989. [21] Radhakisan Baheti and Helen Gill. Cyber-physical systems. The impact of control technology, 12:161–166, 2011. [22] EJ Balder. An existence result for optimal economic growth problems. Journal of mathematical analysis and applications, 95(1):195–213, 1983. [23] Pranab Bardhan and Jeff Dayton-Johnson. Unequal irrigators: heterogeneity and commons management in large-scale multivariate research. The drama of the commons, pages 87–112, 2002. [24] Ugo Bardi. The limits to growth revisited. Springer Science & Business Media, 2011. [25] Robert J Barro and Xavier Sala. Economic growth. New York: McGraw-Hill, 1995. [26] John Barton and Tim Haslett. Analysis, synthesis, systems thinking and the scientific method: rediscovering the importance of open systems. Systems Research and Behavioral Science, 24(2):143–155, 2007. [27] Tamer Başar and Geert Jan Olsder. Dynamic noncooperative game theory. SIAM, 1998. [28] Antoinette Baujard. Economic science vs. welfare economics. 2015. [29] Stafford Beer. Cybernetics and management. 1960. [30] Andrea Beltratti, Graciela Chichilnisky, and Geoffrey Heal. Sustainable growth and the green golden rule. Technical report, National Bureau of Economic Research, 1993. 169 [31] Michael Ben-Eli. The cybernetics of sustainability: definition and underlying principles. Enough for All forever: A Handbook for Learning about Sustainability, Murray J, Cawthorne G, Dey C and Andrew C (eds.). Champaign, IL, Common Ground Publishing: University of Illinois, 14, 2012. [32] Claudia Binder, Jochen Hinkel, Pieter Bots, and Claudia Pahl-Wostl. Comparison of frameworks for analyzing social-ecological systems. Ecology and Society, 18(4), 2013. [33] Colin PD Birch. A new generalized logistic sigmoid growth equation compared with the richards growth equation. Annals of Botany, 83(6):713–723, 1999. [34] Örjan Bodin and Christina Prell. Social networks and natural resource management: uncovering the social fabric of environmental governance. Cambridge University Press, 2011. [35] Jürgen Bohn, Vlad Coroamă, Marc Langheinrich, Friedemann Mattern, and Michael Rohs. Living in a world of smart everyday objectssocial, economic, and ethical implications. Human and Ecological Risk Assessment, 10(5):763–785, 2004. [36] Irena Bojanova, George Hurlburt, and Jeffrey Voas. Imagineering an internet of anything. Computer, 47(6):72–77, 2014. [37] Stephen P Borgatti, Ajay Mehra, Daniel J Brass, and Giuseppe Labianca. Network analysis in the social sciences. science, 323(5916):892–895, 2009. [38] Pieter WG Bots and C Els van Daalen. Participatory model construction and model use in natural resource management: a framework for reflection. Systemic Practice and Action Research, 21(6):389, 2008. [39] Kenneth E Boulding. The economics of the coming spaceship earth. Valuing the earth: economics, ecology, ethics, page 297, 1996. [40] François Bousquet and Christophe Le Page. Multi-agent simulations and ecosystem management: a review. Ecological modelling, 176(3):313–332, 2004. [41] William E Boyce, Richard C DiPrima, and Charles W Haines. Elementary differential equations and boundary value problems, volume 9. Wiley New York, 1969. [42] David Barton Bray, Leticia Merino-Pérez, Patricia Negreros-Castillo, Gerardo SeguraWarnholtz, Juan Manuel Torres-Rojo, and Henricus FM Vester. Mexico’s communitymanaged forests as a global model for sustainable landscapes. Conservation biology, 17(3):672–677, 2003. [43] Thomas Brenner. Agent learning representation: advice on modelling economic learning. Handbook of computational economics, 2:895–947, 2006. [44] George W Brown. Iterative solution of games by fictitious play. Activity analysis of production and allocation, 13(1):374–376, 1951. [45] Wernher M Brucks and Hans-Joachim Mosler. Information preferences and corresponding consumption behavior in common pool resource management. Social Psychology, 42(4):261, 2011. 170 [46] Marcela Brugnach and Claudia Pahl-Wostl. A broadened view on the role for models in natural resource management: implications for model development. In Adaptive and Integrated Water Management, pages 187–203. Springer, 2008. [47] Gro Harlem Brundtland. Report of the World Commission on environment and development:” our common future.”. United Nations, 1987. [48] Susan Burns. The natural step: a compass for environmental management systems. Corporate Environmental Strategy, 6(4):329–342, 1999. [49] Heriberto Cabezas and Brian D Fath. Towards a theory of sustainable systems. Fluid phase equilibria, 194:3–14, 2002. [50] David E Calkin, Matthew P Thompson, and Mark A Finney. Negative consequences of positive feedbacks in us wildfire management. Forest Ecosystems, 2(1):9, 2015. [51] Andrea Caragliu, Chiara Del Bo, and Peter Nijkamp. Smart cities in europe. Journal of urban technology, 18(2):65–82, 2011. [52] Dean A Carlson, Alain B Haurie, and Arie Leizarowitz. Infinite horizon optimal control: deterministic and stochastic systems. Springer Science & Business Media, 2012. [53] Edward R Carr, Philip M Wingard, Sara C Yorty, Mary C Thompson, Natalie K Jensen, and Justin Roberson. Applying dpsir to sustainable development. International Journal of Sustainable Development & World Ecology, 14(6):543–555, 2007. [54] David Cass. Optimum growth in an aggregative model of capital accumulation. The Review of economic studies, pages 233–240, 1965. [55] Christos G Cassandras. Smart cities as cyber-physical social systems. Engineering, 2(2):156–158, 2016. [56] Lamberto Cesari. Optimizationtheory and applications: problems with ordinary differential equations, volume 17. Springer Science & Business Media, 2012. [57] Narendra Chand, Geoffrey N Kerr, and Hugh Bigsby. Production efficiency of community forest management in nepal. Forest Policy and Economics, 50:172–179, 2015. [58] Robin L Chazdon. Tropical forest recovery: legacies of human impact and natural disturbances. Perspectives in Plant Ecology, evolution and systematics, 6(1):51–71, 2003. [59] Graciela Chichilnisky. An axiomatic approach to sustainable development. Social choice and welfare, 13(2):231–257, 1996. [60] Fan RK Chung. Spectral graph theory. Number 92. American Mathematical Soc., 1997. [61] Daniel H Cole and Peter Z Grossman. Institutions matter! why the herder problem is not a prisoners dilemma. Theory and Decision, 69(2):219–231, 2010. [62] Roger C Conant and W Ross Ashby. Every good regulator of a system must be a model of that system. International journal of systems science, 1(2):89–97, 1970. 171 [63] Peter A Corning. Control information theory: the missing linkin the science of cybernetics. Systems research and behavioral science, 24(3):297–311, 2007. [64] Robert Costanza and Bernard C Patten. Defining and predicting sustainability. Ecological economics, 15(3):193–196, 1995. [65] Robyn M Dawes. Formal models of dilemmas in social decision-making. Technical report, DTIC Document, 1974. [66] Robyn M Dawes. Social dilemmas. Annual review of psychology, 31(1):169–193, 1980. [67] Judith IM De Groot and Linda Steg. Relationships between value orientations, selfdetermined motivational types and pro-environmental behavioural intentions. Journal of Environmental Psychology, 30(4):368–378, 2010. [68] Rudolf S De Groot, Matthew A Wilson, and Roelof MJ Boumans. A typology for the classification, description and valuation of ecosystem functions, goods and services. Ecological economics, 41(3):393–408, 2002. [69] Peter J Deadman. Modelling individual behaviour and group performance in an intelligent agent-based simulation of the tragedy of the commons. Journal of Environmental Management, 56(3):159–172, 1999. [70] Florian K Diekert. The tragedy of the commons from a game-theoretic perspective. Sustainability, 4(8):1776–1786, 2012. [71] Michael Doebeli and Christoph Hauert. Models of cooperation based on the prisoner’s dilemma and the snowdrift game. Ecology Letters, 8(7):748–766, 2005. [72] David Easley and Jon Kleinberg. Networks, crowds, and markets: Reasoning about a highly connected world. Cambridge University Press, 2010. [73] Joshua M Epstein. Why model? Journal of Artificial Societies and Social Simulation, 11(4):12, 2008. [74] Desta Fekedulegn, Máirtı́n Pádraig Mac Siúrtáin, and Jim J Colbert. Parameter estimation of nonlinear models in forestry. 1999. [75] Leon Festinger. A theory of social comparison processes. Human relations, 7(2):117– 140, 1954. [76] Sarah Feuillette, François Bousquet, and Patrick Le Goulven. Sinuse: a multi-agent model to negotiate water demand management on a free access water table. Environmental Modelling & Software, 18(5):413–427, 2003. [77] Aleksei Fedorovich Filippov. Differential equations with discontinuous righthand sides: control systems, volume 18. Springer Science & Business Media, 2013. [78] Neil Fligstein. The architecture of markets: An economic sociology of twenty-firstcentury capitalist societies. Princeton University Press, 2002. [79] Dominique Foray and Arnulf Grübler. Technology and the environment: an overview. Technological forecasting and social change, 53(1):3–13, 1996. 172 [80] Jay W Forrester. World dynamics. Wright-Allen Press, 1971. [81] Gene F Franklin, J David Powell, and Abbas Emami-Naeini. Feedback control of dynamic systems, volume 3. Addison-Wesley Reading, 1994. [82] Noah E Friedkin. A structural theory of social influence, volume 13. Cambridge University Press, 2006. [83] Noah E Friedkin. The problem of social control and coordination of complex systems in sociology: A look at the community cleavage problem. IEEE Control Systems, 35(3):40–51, 2015. [84] Georg Friedrich Bernhard Riemann. The Mechanism of the Ear. [85] Drew Fudenberg and David K Levine. The theory of learning in games, volume 2. MIT press, 1998. [86] Zhiqiang Gao. Engineering cybernetics: 60 years in the making. Control Theory and Technology, 12(2):97–109, 2014. [87] Tommy Gärling, Satoshi Fujii, Anita Gärling, and Cecilia Jakobsson. Moderating effects of social value orientation on determinants of proenvironmental behavior intention. Journal of environmental psychology, 23(1):1–9, 2003. [88] Clark C Gibson, Margaret A McKean, and Elinor Ostrom. People and forests: Communities, institutions, and governance. Mit Press, 2000. [89] H Scott Gordon. The economic theory of a common-property resource: the fishery. Springer, 1954. [90] William E Grant, Ellen K Pedersen, and Sandra L Marı́n. Ecology and natural resource management: systems analysis and simulation. John Wiley & Sons, 1997. [91] Paul E Gray. The paradox of technological development. Technology and environment, 192:204, 1989. [92] HA John Green. Aggregation in economic analysis. Princeton University Press, 2015. [93] Jonathan L Gross and Jay Yellen. Handbook of graph theory. CRC press, 2004. [94] Yehuda Grunfeld and Zvi Griliches. Is aggregation necessarily bad? The Review of Economics and Statistics, pages 1–13, 1960. [95] Helmut Haberl, Marina Fischer-Kowalski, Fridolin Krausmann, Helga Weisz, and Verena Winiwarter. Progress towards sustainability? what the conceptual framework of material and energy flow accounting (mefa) can offer. Land Use Policy, 21(3):199–213, 2004. [96] Debora Hammond. Philosophical and ethical foundations of systems thinking. tripleC: Communication, Capitalism & Critique. Open Access Journal for a Global Sustainable Information Society, 3(2):20–27, 2005. [97] Garrett Hardin. The tragedy of the commons. science, 162(3859):1243–1248, 1968. 173 [98] Roy F Harrod. An essay in dynamic theory. The Economic Journal, pages 14–33, 1939. [99] Ph Hartman. Ordinary differential equations, new york, 1969. 1970. [100] Francis Heylighen and Cliff Joslyn. Cybernetics and second order cybernetics. Encyclopedia of physical science & technology, 4:155–170, 2001. [101] Robert Hoffman. A cybernetic approach to economics. Cybernetics & Human Knowing, 17(4):89–97, 2010. [102] Harold Hotelling. The economics of exhaustible resources. Journal of political Economy, 39(2):137–175, 1931. [103] RL Ison, PT Maiteny, and S Carr. Systems methodologies for sustainable natural resources research and development. Agricultural systems, 55(2):257–272, 1997. [104] Wander Jager, MA Janssen, HJM De Vries, J De Greef, and CAJ Vlek. Behaviour in commons dilemmas: Homo economicus and homo psychologicus in an ecologicaleconomic model. Ecological economics, 35(3):357–379, 2000. [105] Wander Jager and Hans Joachim Mosler. Simulating human behavior for understanding and managing environmental resource use. Journal of Social Issues, 63(1):97–116, 2007. [106] Nasser Jazdi. Cyber physical systems in the context of industry 4.0. In Automation, Quality and Testing, Robotics, 2014 IEEE International Conference on, pages 1–4. IEEE, 2014. [107] Lauren Johnson. From Mechanistic to Social Systemic Thinking: A Digest of a Talk by Russel L. Ackoff. Pegasus communications, 1997. [108] RE KALMAN. Contributions to the theory of optimal control. Boletin Sociedad Matematica Mexicana, 5:102–109, 1960. [109] Ogata Katsuhiko. Modern control engineering. Prentice-Hall, 1970. [110] David P Keller, Ellias Y Feng, and Andreas Oschlies. Potential climate engineering effectiveness and side effects during a high carbon dioxide-emission scenario. Nature communications, 5, 2014. [111] Christian Kerschner. Economic de-growth vs. steady-state economy. cleaner production, 18(6):544–551, 2010. Journal of [112] Hassan K Khalil. Noninear systems. Prentice-Hall, New Jersey, 2(5):5–1, 1996. [113] Kyoung-Dae Kim and Panganamala R Kumar. Cyber–physical systems: A perspective at the centennial. Proceedings of the IEEE, 100(Special Centennial Issue):1287– 1308, 2012. [114] Elias Koutsoupias and Christos Papadimitriou. Worst-case equilibria. Computer science review, 3(2):65–69, 2009. 174 [115] Wai Fung Lam and Elinor Ostrom. Analyzing the dynamic complexity of development interventions: lessons from an irrigation experiment in nepal. Policy Sciences, 43(1):1– 25, 2010. [116] Francoise Lamnabhi-Lagarrigue, Anuradha Annaswamy, Sebastian Engell, Alf Isaksson, Pramod Khargonekar, Richard M Murray, Henk Nijmeijer, Tariq Samad, Dawn Tilbury, and Paul Van den Hof. Systems & control for the future of humanity, research agenda: Current and future roles, impact and grand challenges. Annual Reviews in Control, 2017. [117] Edward A Lee. The past, present and future of cyber-physical systems: A focus on models. Sensors, 15(3):4837–4869, 2015. [118] Simon A Levin. Current revival of systems thinking and major challenges. Systems Analysis, 2015. [119] Kent D Van Liere and Riley E Dunlap. The social bases of environmental concern: A review of hypotheses, explanations and empirical evidence. Public opinion quarterly, 44(2):181–197, 1980. [120] Jianguo Liu, Thomas Dietz, Stephen R Carpenter, Marina Alberti, Carl Folke, Emilio Moran, Alice N Pell, Peter Deadman, Timothy Kratz, Jane Lubchenco, et al. Complexity of coupled human and natural systems. science, 317(5844):1513–1516, 2007. [121] Yang-Yu Liu, Jean-Jacques Slotine, and Albert-László Barabási. Controllability of complex networks. Nature, 473(7346):167–173, 2011. [122] Yang-Yu Liu, Jean-Jacques Slotine, and Albert-László Barabási. Observability of complex systems. Proceedings of the National Academy of Sciences, 110(7):2460–2465, 2013. [123] James Lovelock and A Gaia. A new look at life on earth. Oxford University Press, Oxford, 1979. [124] Kaveh Madani. Game theory and water resources. Journal of Hydrology, 381(3):225– 238, 2010. [125] Roberto Gustavo Mancilla. Introduction to sociocybernetics (part 1): third order cybernetics and a basic framework for society. Journal of Sociocybernetics, 9(1/2), 2013. [126] N Gregory Mankiw, David Romer, and David N Weil. A contribution to the empirics of economic growth. Technical report, National Bureau of Economic Research, 1990. [127] Talha Manzoor, Sergey Aseev, Elena Rovenskaya, and Abubakr Muhammad. Optimal control for sustainable consumption of natural resources. IFAC Proceedings Volumes, 47(3):10725–10730, 2014. [128] Talha Manzoor, Elena Rovenskaya, and Abubakr Muhammad. Game-theoretic insights into the role of environmentalism and social-ecological relevance: A cognitive model of resource consumption. Ecological Modelling, 340:74–85, 2016. 175 [129] Jason R Marden, Gürdal Arslan, and Jeff S Shamma. Cooperative control and potential games. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 39(6):1393–1407, 2009. [130] Jason R Marden, Jeff S Shamma, et al. Game theory and distributed control. Handbook of game theory, 4:861–900, 2012. [131] George Perkins Marsh. Man and nature. University of Washington Press, 1864. [132] Eric Maskin and Amartya Sen. The Arrow impossibility theorem. Columbia University Press, 2014. [133] Dennis Meadows. Reflection on dana. In Academy for Systems Change, 2001. [134] Donella Meadows, Jorgen Randers, and Dennis Meadows. A synopsis, limits to growth: the 30 year update. Estados Unidos: Chelsea Green Publishing Company, 2004. [135] Donella H Meadows, Dennis L Meadows, Jorgen Randers, and William W Behrens. The limits to growth. New York, 102:27, 1972. [136] Phillippe Michel. On the transversality condition in infinite horizon optimal problems. Econometrica: Journal of the Econometric Society, pages 975–985, 1982. [137] Daniele Miorandi, Sabrina Sicari, Francesco De Pellegrini, and Imrich Chlamtac. Internet of things: Vision, applications and research challenges. Ad Hoc Networks, 10(7):1497–1516, 2012. [138] PN Misra. A note on linear aggregation of economic relations. International Economic Review, 10(2):247–249, 1969. [139] George E Mobus, Michael C Kalton, et al. Principles of systems science. Springer, 2015. [140] Patrick Moriarty and Damon Honnery. Reliance on technical solutions to environmental problems: caution is needed, 2015. [141] Hans-Joachim Mosler and Wernher M Brucks. Integrating commons dilemma findings in a general dynamic model of cooperative behavior in resource crises. European Journal of Social Psychology, 33(1):119–133, 2003. [142] Sirajum Munir, John A Stankovic, Chieh-Jan Mike Liang, and Shan Lin. Cyber physical system challenges for human-in-the-loop control. In Feedback Computing, 2013. [143] Esther Mwangi and Elinor Ostrom. Top-down solutions: looking up from east africa’s rangelands. Environment: Science and Policy for Sustainable Development, 51(1):34– 45, 2009. [144] Roger B Myerson. Game theory. Harvard university press, 2013. [145] Mancur Olson. The logic of collective action, volume 124. Harvard University Press, 2009. 176 [146] Martin J Osborne and Ariel Rubinstein. A course in game theory. MIT press, 1994. [147] Eric Ostertag. Mono-and multivariable control and estimation: linear, quadratic and LMI methods, volume 2. Springer Science & Business Media, 2011. [148] Elinor Ostrom. Governing the commons: The evolution of institutions for collective action. Cambridge university press, 1990. [149] Elinor Ostrom. Design principles in long-enduring irrigation institutions. Water Resources Research, 29(7):1907–1912, 1993. [150] Elinor Ostrom. A general framework for analyzing sustainability of social-ecological systems. Science, 325(5939):419–422, 2009. [151] Elinor Ostrom. Governing the commons. Cambridge university press, 2015. [152] Elinor Ostrom, Roy Gardner, and James Walker. Rules, games, and common-pool resources. University of Michigan Press, 1994. [153] Claudia Pahl-Wostl. A conceptual framework for analysing adaptive capacity and multi-level learning processes in resource governance regimes. Global Environmental Change, 19(3):354–365, 2009. [154] Ariel Dinar Parrachino, Irene and Fioravante Patrone. Cooperative game theory and its application to natural, environmental and water resource issues, volume 4072. World Bank Publications, 2006. [155] Roger Perman. Natural resource and environmental economics. Pearson Education, 2003. [156] Wilfrid Perruquetti. Social impact of automation - scope and activities. Control Challenges for Social Systems, Panel Session in the 20th IFAC WC, 2017. [157] Edmund Phelps. The golden rule of accumulation: a fable for growthmen. The American Economic Review, pages 638–643, 1961. [158] Clive Ponting. A green history of the world. Sinclair-Stevenson London, 1991. [159] Lev Semenovich Pontryagin. Mathematical theory of optimal processes. CRC Press, 1987. [160] Anton V Proskurnikov and Roberto Tempo. A tutorial on modeling and analysis of dynamic social networks. part i. Annual Reviews in Control, 2017. [161] Elsevier Publishing. Special issue on smart infrastructure, construction and building internet of things. http://www.journals. elsevier.com/automation-in-construction/call-for-papers/ special-issue-on-smart-infrastructure-construction-and-build. Accessed: 2017-08-29. [162] Ragunathan Raj Rajkumar, Insup Lee, Lui Sha, and John Stankovic. Cyber-physical systems: the next computing revolution. In Proceedings of the 47th Design Automation Conference, pages 731–736. ACM, 2010. 177 [163] Frank Plumpton Ramsey. A mathematical theory of saving. The economic journal, 38(152):543–559, 1928. [164] Thomas Rid. Rise of the Machines: the lost history of cybernetics. Scribe Publications, 2016. [165] Tom Ritchey. Analysis and synthesis: on scientific method–based on a study by bernhard riemann. Systems Research and Behavioral Science, 8(4):21–41, 1991. [166] Peter Roopnarine. Ecology and the tragedy of the commons. Sustainability, 5(2):749– 773, 2013. [167] Arturo Rosenblueth, Norbert Wiener, and Julian Bigelow. Behavior, purpose and teleology. Philosophy of science, 10(1):18–24, 1943. [168] Christel G Rutte, Henk AM Wilke, and David M Messick. Scarcity or abundance caused by people or the environment as determinants of behavior in the resource dilemma. Journal of Experimental Social Psychology, 23(3):208–216, 1987. [169] Flora Salim and Usman Haque. Urban computing in the wild: A survey on large scale participation and citizen engagement with ubiquitous computing, cyber physical systems, and internet of things. International Journal of Human-Computer Studies, 81:31–48, 2015. [170] Charles D Samuelson, David M Messick, Christel Rutte, and Henk Wilke. Individual and structural solutions to resource dilemmas in two cultures. Journal of Personality and Social Psychology, 47(1):94, 1984. [171] Ashutosh Sarker and Tadao Itoh. Design principles in long-enduring institutions of japanese irrigation common-pool resources. Agricultural Water Management, 48(2):89–102, 2001. [172] H-J Schellnhuber and J Kropp. Geocybernetics: Controlling a complex dynamical system under uncertainty. Naturwissenschaften, 85(9):411–425, 1998. [173] Hans-Joachim Schellnhuber. earth systemanalysis. Nature, 402:C19–C23, 1999. [174] Edella Schlager and Elinor Ostrom. Property rights regimes and coastal fisheries: an empirical analysis. In Polycentric Governance and Development: Readings from the Workshop in Political Theory and Policy Analysis, volume 87, pages 99–104. Ann Arbor: University of Michigan Press, 1999. [175] Leo Schlesinger. Can technology save the environment? In World Economic Forum, 2014. [176] Jürgen Schmidhuber. Deep learning in neural networks: An overview. Neural networks, 61:85–117, 2015. [177] Stephen Henry Schneider. Scientists debate Gaia: the next century. MIT Press, 2004. [178] Roland W Scholz and Claudia R Binder. Principles of human-environment systems (hes) research. 2004. [179] Amartya Sen. Choice, welfare and measurement. Harvard University Press, 1997. 178 [180] Tushaar Shah, Aditi Deb Roy, Asad S Qureshi, and Jinxia Wang. Sustaining Asia’s groundwater boom: an overview of issues and evidence. In Natural Resources Forum, volume 27, pages 130–141. Wiley Online Library, 2003. [181] Judith Shapiro. Mao’s war against nature: Politics and the environment in revolutionary China. Cambridge University Press, 2001. [182] Herbert Alexander Simon and Chester Irving Barnard. Administrative Behavior: A Study of Decision-making Processes in Administrative Organizaton. Macmillan, 1959. [183] Lars Skyttner. General systems theory: problems, perspectives, practice. World scientific, 2005. [184] Sabrie Soloman. Sensors handbook. McGraw-Hill, Inc., 2009. [185] Robert M Solow. A contribution to the theory of economic growth. The quarterly journal of economics, pages 65–94, 1956. [186] Daniel A Spielman. Spectral graph theory and its applications. In Foundations of Computer Science, 2007. FOCS’07. 48th Annual IEEE Symposium on, pages 29–38. IEEE, 2007. [187] John A Stankovic. Research directions for the internet of things. IEEE Internet of Things Journal, 1(1):3–9, 2014. [188] Mark Stephan. Environmental information disclosure programs: They work, but why? Social Science Quarterly, 83(1):190–205, 2002. [189] Henri Theil. Linear aggregation of economic relations. North-Holland Publishing Company, 1954. [190] B Torabi, H Saadatkhah, and A Soltani. Evaluating mechanistic models in growth analysis of safflower. Agricult. Sci. Dev., 3(4):133–139, 2014. [191] Billie L Turner, Roger E Kasperson, Pamela A Matson, James J McCarthy, Robert W Corell, Lindsey Christensen, Noelle Eckley, Jeanne X Kasperson, Amy Luers, Marybeth L Martello, et al. A framework for vulnerability analysis in sustainability science. Proceedings of the national academy of sciences, 100(14):8074–8079, 2003. [192] Graham M Turner. A comparison of the limits to growth with 30 years of reality. Global environmental change, 18(3):397–411, 2008. [193] Graham M Turner. On the cusp of global collapse? updated comparison of the limits to growth with historical data. GAIA-Ecological Perspectives for Science and Society, 21(2):116–124, 2012. [194] Stuart A Umpleby and Eric B Dent. The origins and purposes of several traditions in systems theory and cybernetics. Cybernetics & Systems, 30(2):79–103, 1999. [195] Simone Valente. Sustainable development, renewable resources and technological progress. Environmental and Resource Economics, 30(1):115–125, 2005. 179 [196] Paul AM Van Lange, Jeff Joireman, Craig D Parks, and Eric Van Dijk. The psychology of social dilemmas: A review. Organizational Behavior and Human Decision Processes, 120(2):125–141, 2013. [197] George Varughese and Elinor Ostrom. The contested role of heterogeneity in collective action: some evidence from community forestry in nepal. World development, 29(5):747–765, 2001. [198] Ludwig Von Bertalanffy. An outline of general system theory. The British Journal for the Philosophy of science, 1(2):134, 1950. [199] Heinz Von Foerster. Cybernetics of cybernetics. Understanding understanding: Essays on cybernetics and cognition, pages 283–286, 2003. [200] Hermann Von Helmholtz. On the Sensations of Tone as a Physiological Basis for the Theory of Music. Kessinger Publishing, 2005. [201] Fei-Yue Wang. The emergence of intelligent enterprises: From cps to cpss. IEEE Intelligent Systems, 25(4):85–88, 2010. [202] Kenneth EF Watt. Systems analysis in ecology. Elsevier, 2013. [203] AR Werker and KW Jaggard. Modelling asymmetrical growth curves that rise and then fall: applications to foliage dynamics of sugar beet (beta vulgaris l.). Annals of Botany, 79(6):657–665, 1997. [204] JL Jr Wescoat. Reconstructing the duty of water: a study of emergent norms in socio-hydrology. Hydrology and Earth System Sciences, 17(12):4759, 2013. [205] Norbert Wiener. The human use of human beings: Cybernetics and society. Number 320. Perseus Books Group, 1954. [206] Norbert Wiener. Cybernetics or Control and Communication in the Animal and the Machine, volume 25. MIT press, 1961. [207] Boris Worm, Ray Hilborn, Julia K Baum, Trevor A Branch, Jeremy S Collie, Christopher Costello, Michael J Fogarty, Elizabeth A Fulton, Jeffrey A Hutchings, Simon Jennings, et al. Rebuilding global fisheries. science, 325(5940):578–585, 2009. [208] Laurence T Yang, Beniamino Di Martino, and Qingchen Zhang. Internet of everything. Mobile Information Systems, 2017. 180 Appendix A Game Theory Primer This appendix gives a very brief introduction to basic game theoretical concepts. It is in no way meant to serve as an introduction to game theory in general for which we refer the interested reader to some excellent texts on the subject [146, 144, 27]. The extent of the following material has been selected solely for the reader to be able to grasp the game theoretic terminology used in this dissertation. A.1 Definitions A game G is defined as a three-tuple G = hI, (Si ), (πi )i where • I := {1, . . . , n} is the set of players, where n is the total number of players. • Si is the strategy space for player i ∈ I. The elements of this set, also called the actions may either be discrete or continuous in nature. An element from the set S1 × · · · × Sn is called a strategy profile. • πi : S1 × · · · × Sn → R is the payoff function for player i. Games are commonly represented as a table. In Figure A-1 we reproduce the Prisoner’s dilemma game from Chapter 1. Here there are two players so n = 2. The rows of the table correspond to the strategy of Player 1, whereas the columns correspond to the strategies of Player 2. In some writings the players are also referred to as the row player and the column player. Each player has two possible strategies and so, according to Figure A-1, Si = {C, D}, where C and D represent the “cooperate” and “defect” strategy respectively1 . The entries in the table depict the payoffs of each player as an ordered pair where the first entry gives the payoff of the first player and the second entry gives the payoff of the second player respectively, if each player plays the strategy given by that row and column of the table. Thus from Figure A-1, if both the players cooperate, this corresponds to the upper left corner of the table, from which we see that in this case both the players receive payoff π1 (C, C) = π2 (C, C) = −1. The story of the prisoner’s dilemma game is usually narrated as follows – both the players are in separate rooms of a police station where they are being questioned about a crime they have committed together. Since the police do not have enough evidence to evict them, each prisoner is given the following proposition. If the prisoner confesses to the crime and rats his partner out (the “defect” strategy) but the 1 where the “cooperate” strategy corresponds to pleading innocent 181 C D C -1,-1 -10,0 D 0,-10 -5,-5 Figure A-1: The prisoner’s dilemma game other prisoner does not confess (the “cooperate” strategy), then he would be freed but his partner would get a sentence of 10 years. However if his partner also confesses to the crime then both would serve a 5 year sentence. If neither of them confesses, then both of them will be evicted for a lighter crime and serve a sentence of 1 year. The payoffs in Figure A-1 are based on the number of years the prisoners would have to serve for each possible outcome of the game. A.2 Dominant Strategies Given a game in normal form, it is reasonable to expect certain strategies to be played more often than the others. These strategies are usually the “dominant” strategies. A strategy is said to be dominant for player i if it is guaranteed to result in the highest possible payoff no matter what strategy the other players choose. More precisely, a strategy s0i ∈ Si is weakly dominant if π(s0i , s−i ) ≥ π(si , s−i ) for all si ∈ Si and s−i ∈ S−i . s0i is then strongly dominant (or simply dominant) π(s0i , s−i ) > π(si , s−i ) for all si ∈ Si and s−i ∈ S−i . In the prisoner’s dilemma, it is straight forward to see which strategy is the dominating one. If the column player plays C, then the row player gets the highest payoff by playing D. Now, if the column player plays D, the row player will still ensure the highest payoff for himself by playing D. In both cases, D gives the highest payoff and so, D is the dominant strategy for Player 1. Similar reasoning leads to the realization that D is also the dominant strategy for Player 2. A.3 Best Response A strategy s̃i ∈ Si is said to be the best response to a fixed strategy profile s−i ∈ S−i , on behalf of the remaining players if π(s̃i , s−i ) ≥ π(si , s−i ) for all si ∈ Si . If the best response is unique then it is also called a strict best response. Note that the best response is a slightly weaker concept than dominance. While a dominant strategy might not exist for a particular player, the best response of a player to a particular strategy of the other players always exists. A dominant strategy, if it exists, is then the common best response to all strategies of the opposing players. 182 A.4 Nash Equilibrium A strategy profile s# =∈ S1 , ×, Sn is called a Nash Equilibrium if s# i is a best response to # = (s# , . . . , s# ) constitutes a Nash Equilibrium if s# for every i ∈ I. More precisely, s n 1 −i # # −i) for all s ∈ S and all i ∈ I. While this definition appears to be π(s# , s ) ≥ π(s , s i i i i −i similar to that of dominance, it is important to note the subtlety that the Nash Equilibrium requires, for every i, that s# i be the best response to only those actions of the other players that are being played at the equilibrium, and not to the whole set of possible actions. The Nash Equilibrium also has associated with it a notion of stability. If all players play the Nash Equilibrium strategy, then no player can gain a higher payoff by unilaterally changing her strategy. The Nash Equilibrium for the Prisoner’s dilemma game is given by {D, D} and is highlighted in gray in Figure A-1. This highlights the “dilemma” of the game. While the players can clearly get the collectively best outcome if both cooperate, rational reasoning leads them both to defect, resulting in a worse outcome for both. The strategies considered here are pure strategies i.e., the player commits to playing a single strategy and plays it with certainty. There is also the possibility of a player assigning probabilities to each of the actions such that each strategy has a certain probability of being payed. For instance, in the prisoner’s dilemma game, one player may decide to toss a coin and play C if head comes up and play D otherwise, thus assigning a probability of 0.5 to each action. The act of assigning probabilities to the strategies is also considered a valid strategy and is usually referred to as a mixed strategy. It is known that the Nash equilibrium for finite games does not always exist in the form of pure strategies, however if mixed strategies are also considered, then the Nash Equilibrium always exists. A.5 Games with Continuous Strategies: The Cournot Game The concepts defined for games with discrete strategies carry forward to games with continuous strategies. We illustrate this through the Cournot game whose story is described as follows. Imagine two firms, each producing an identical good for the same market. The two firms 1 & 2 are the players and so I = {1, 2}. The strategy for each firm i is the quantity of good qi it decides to produce and so Si = {qi } constitutes a continuous strategy space. The payoffs for each firm are given by the profit each firm earns by selling the good. The cost to produce the good is given by c > 0. The good is sold at the market-clearing price which is given by the inverse demand curve p = a − b(q1 + q2 where p denotes the price and a, b > 0 are constant parameters. The payoff for each firm is then given by   πi (q1 , q2 ) = a − b(q1 + q2 ) qi − c qi i ∈ {1, 2}, The best response is given as q̃i = BRi (qj ) = max πi (q1 , q2 ) qi q̃1 = BR1 (q2 ) = a − c q2 − , 2b 2 q̃2 = BR2 (q1 ) = 183 i 6= j, whose solution gives us a − c q1 − . 2b 2 Figure A-2: Illustration of the Cournot Game. The Nash Equilibrium, (q # 1, q2# ) is the strategy profile such that q1# = BR1 (q2# ) and q2# = BR2 (q1# ). This is given by the solution to the following system q1# = a − c q2# − , 2b 2 q2# = a − c q1# − . 2b 2 Solving the above algebraically gives us the Nash Equilibrium q1# = q2# = a−c . 3b Figure A-2 gives a graphical depiction of the Equilibrium in the Cournot game. It is possible to show that in this equilibrium of the Cournot game, the firms produce too much quantity of the good than they would need at the point of joint profit maximization. As such, the Cournot game is also used as a model for scenarios where individually optimum behavior does not result in the collectively optimal outcome. The concept of the Nash Equilibrium is named after John Nash who gave the first existence proof for finite games. There also exist other equilibrium concepts that can be used to make descriptive or predictive reasoning about the outcome of the game. Moreover, there exist various classifications of games based on whether the strategies are played simultaneously or sequentially, whether the games are played just once or repeatedly, whether the players are allowed to form coalitions or not, whether or not the players have complete access to information on the parameters of the game, and so on. Regarding the totality of the game theoretic literature, the material discussed here is just a tiny tip of the proverbial iceberg, presented only with the intention of enabling the reader to grasp the contents of the dissertation more effectively. 184 Appendix B Basic Concepts in Economic Growth Theory In this appendix we provide a small compilation of a few basic concepts frequently referred to in the resource economics and growth theory literature. The material is intended to serve as a small supplement for the reader to better comprehend the exposition of Chapter 7. B.1 Early Developments in Growth Theory Economic growth theory is separated into exogenous and endogenous growth. The major ingredients of an exogenous growth problem consist of a production function relating factors of production to output whose level determines the current state of the economy. This is coupled with the dynamics of the production factors usually as differential equations of capital and labor. It is assumed that all parameters of the model are fixed from some mechanism outside our system, thus the term exogenous growth. Equilibrium conditions are found and policy prescriptions are made on the base of measures that have a positive influence on steady state growth. The first influential model of exogenous growth is the Harrod-Domar model [98] introduced in 1939. This model assumed a linear production function with capital as the only input to production. It concludes that the amount of reinvestment of the capital determines the long term growth. Solow and Swan introduced the Solow-Swan model[185] in 1956 as an extension to the Harrod-Domar model which relaxed the fixed capital to labor ratio assumption by taking labor as a separate input to production. Later on the Mankiw-Romer-Weil model [126] incorporated human capital as a third input to production thus distinguishing between physical capital and human capital. The starting point of endogenous growth theory is considered by most to be the seminal paper by Ramsey [163]. The potential of Ramsey’s work was not realized until 1965 when Cass and Koopmans adapted it to form the Ramsey-Cass-Koopmans (RCK) model [54]. In problems of endogenous growth, parameters assumed to be determined by outside forces are taken so as to maximize a certain criterion for social welfare represented by an objective function. The underlying machinery used in such problems is that of optimal control with Pontryagin’s Maximum Principle [11] used as the basic optimization apparatus. Earlier in 1961 Phelps introduced the golden savings rule [157] which was later found out to be a special case of the RCK model. Endogenous growth problems rely heavily on objective functions which specify aggre185 gate and intertemporal preferences on individual utility. The normative debate on which preference scheme is ethically correct is the foundation of the field of welfare economics [155]. Despite criticism, discounting the utility of future generations is the most practiced scheme by growth theorists as it allows for the intertemporal objective to converge in the limit. In this regard, Chichilnisky developed an axiomatic criterion for optimal growth [59] which later on was also used to develop the green golden rule [30] of resource consumption. B.2 A Compilation of Fundamental Notions B.2.1 The production function and returns to scale The term returns to scale arises in the context of a firm’s production function to describe what happens to the scale of production when all inputs to production are subject to a given change in scale. Formally, a production function F (K, L) is defined to have • constant returns to scale if F (a K, a L) = a F (K, L) • increasing returns to scale if F (a K, a L) > a F (K, L) • decreasing returns to scale if F (a K, a L) < a F (K, L) where K and L are factors of production, usually used to represent capital and labor respectively, and a > 0 is some constant. B.2.2 The production function and technological progress A production function in which technological progress enters as labour-augmenting is defined as Harrod-neutral  Y (t) = f K(t), A(t)L(t) where Y(t) is the economic output and A(t) represents the level of technology at time t. If technological progress is capital augmenting of the form  Y (t) = f A(t)K(t), L(t) it is defined as Solow-neutral. Finally, if technological progress simply multiplies the production function by an increasing scale factor as  Y (t) = A(t) f K(t), L(t) it is defined as Hicks-neutral B.2.3 A Note on Cobb-Douglass production functions The Cobb-Douglass production function is a particular form of production function which represents the technological relationship between a single good called the output, and different factors of productions called the inputs. It was developed and tested against statistical evidence by Charles Cobb and Paul Douglas during 1927-1947. In its most standard form, for production of a single good with two factors of production Y = A Lβ K α 186 where Y is the total output, L is the labor input, K is the capital input, A is the total factor productivity and α, β are the output elasticities of capital and labor respectively. α and β are constants which are determined by the current level of technology. Furthermore they control the returns to scale of the production as follows • If α + β = 1 then Y has constant returns to scale • If α + β > 1 then Y has increasing returns to scale • If α + β < 1 then Y has decreasing returns to scale B.2.4 Continuity, differentiability, positive and diminishing marginal products, and constant returns to scale The first common assumption on the production function in economic growth theory is as follows: the production function F : R2+ → R+ is twice differentiable in K and L, and satisfies ∂F (K, L) > 0, ∂K ∂ 2 F (K, L) < 0, ∂K 2 ∂F (K, L) >0 ∂L ∂ 2 F (K, L) <0 ∂L2 Moreover, F exhibits constant returns to scale in K and L. B.2.5 The Inada conditions The second common assumption on the production function in economic growth theory is a collection of conditions called the Inada conditions. They are given as follows: The production function F : R2+ → R+ satisfies ∂F (K, L) = ∞, ∂K ∂F (K, L) lim = ∞, L→0 ∂L lim K→0 B.2.6 ∂F (K, L) =0 ∂K ∂F (K, L) lim =0 L→∞ ∂L lim K→∞ ∀L>0 ∀K>0 Some formal examples of social welfare functions The Social Welfare Function (SWF) is a mechanism to aggregate the utilities of different individuals to determine which set of utilities are socially favorable. Assume that there are N individuals in a society and denote the utility of each individual as Ui where i ∈ {1, . . . , N }. Following this notation, some formal examples of SWFs are given below • Benthamite Utilitarianism W (U1 , . . . , UN ) = N X i=1 • Egalitarian W (U1 , . . . , UN ) = N X i=1 ai Ui where ai > 0 ∀i  N  X −λ Ui − min Ui i=1 187 i where 0 < λ < 1 • Rawlsian W (U1 , . . . , UN ) = min Ui i Kenneth Arrow argued that any “reasonable” social welfare function must satisfy 6 basic axioms and then demonstrated via his impossibility theorem [132] that no such function exists. B.2.7 The Brundtland Commission and sustainability The Brundtland Commission is formally known as World Commission on Environment and Development (WCED) and aims to unite countries in the pursuit of sustainable development. The commission’s report of 1987 titled “Our Common Future” [47] had a great impact at the Earth Summit of 1992 in Rio de Janeiro. According to the report sustainability is defined as “Sustainable development is development that meets the needs of the present without compromising the ability of future generations to meet their own needs” This definition of sustainability includes two major concepts. First is the concept of “needs”, in particular the essential needs of the world’s poor, to which overriding priority should be given. Second is the idea of limitations imposed by the state of technology and social organization on the environment’s ability to meet present and future needs. 188 Appendix C Network topology and spectrum of the Laplacian matrix In Chapter 10, we mentioned the influence of the network topology on the eigenvalues of the Laplacian matrix. There exist various formal results [60, 186, 93] on the interpretation of the spectrum of the Laplacian and its connection to the network structure. Here, without using any formal jargon, we give a brief illustration of how the two smallest eigenvalues of the Laplacian matrix change as the connectedness of a simple network is varied. Consider a weighted directed graph G on n vertices. Each edge (i, j) has associated with it a weight wij > 0. Define the in-degree of node i as d− i = n X wji , j=1 then the Laplacian matrix is defined as   d− −w21 . . . −wn1 1  −w12 . . . −wn2  d− 2   L= . .. .. .. ..   . . . . − −w1n −w2n . . . dn Now denote the eigenvalues of L as λ1 ≤ λ2 · · · ≤ λn . It is known that L will have only real eigenvalues and is positive semidefinite. The smallest eigenvalue λ1 is always 0 and the corresponding eigenvector is [1, 1, . . . , 1]T . The multiplicity of 0 as an eigenvalue is equal to the number of connected components of G. Of particular interest is the second smallest eigenvalue λ2 . As the multiplicity of 0 as an eigenvector is equal to the number of connected components, if G is connected then λ2 > 0. Thus λ2 is also called the algebraic connectivity of G. If λ2 is positive, then the magnitude of λ2 increases as graph connectedness is increased. This effect can be observed in Figure C-1 in which λ2 increases as edges are added to a weakly connected graph and continues to increase until a strongly connected regular graph is achieved at which point λ2 = λn . 189 Figure C-1: Different possible networks of varying connectivity along with the eigenvalues of the respective L matrix. All dashed links carry weight 1 (weak links), whereas continuously drawn links carry weight 100 (strong links). It can be seen that as network connectivity increases, so does the magnitude of the second smallest eigenvalue. 190 Vita Talha Manzoor was born on May 15, 1988 in Faisalabad, Pakistan. He completed his primary & middle education from The City School, Capital Campus in Islamabad and matriculation & intermediate education from Pakistan Air Force (PAF) Public School, Lower Topa, Murree. He graduated in 2010 with a BS in Mechatronics Engineering from National University of Science and Technology (NUST), Islamabad and subsequently joined Lahore University of Management Sciences (LUMS), Lahore for his graduate studies. He completed his MS in Computer Engineering from LUMS in 2013 and has since been pursuing his PhD in the Electrical Engineering Department at LUMS. During his PhD he has spent time as a visiting researcher at the Advanced Systems Analysis program of the International Institute for Applied Systems Analysis (IIASA), Austria and at the Robotics Research Lab of Technical University, Kaiserslautern, Germany. He is generally interested in the application of Systems Analysis techniques to real world problems. His research spans a diverse area, ranging from control and estimation problems in robotics to cybernetic applications in coupled human and natural systems. 191
3cs.SY
Adjoint Lattice Boltzmann for Topology Optimization on multi-GPU architecture Ł. Łaniewski-Wołłk, J. Rokicki Institute of Aeronautics and Applied Mechanics, Warsaw University of Technology, Nowowiejska 24, 00-665 Warszawa, Poland arXiv:1501.04741v1 [cs.CE] 20 Jan 2015 Abstract In this paper we present a topology optimization technique applicable to a broad range of flow design problems. We propose also a discrete adjoint formulation effective for a wide class of Lattice Boltzmann Methods (LBM). This adjoint formulation is used to calculate sensitivity of the LBM solution to several type of parameters, both global and local. The numerical scheme for solving the adjoint problem has many properties of the original system, including locality and explicit time-stepping. Thus it is possible to integrate it with the standard LBM solver, allowing for straightforward and efficient parallelization (overcoming limitations typical for discrete adjoint solvers). This approach is successfully used for the channel flow to design a free-topology mixer and a heat exchanger. Both resulting geometries being very complex maximize their objective functions, while keeping viscous losses at acceptable level. Keywords: Lattice Boltzmann Method; adjoint; optimization 1. Introduction The goal of the present work was to develop an optimization framework for a variety of multi-physics fluid flow problems. This framework is intended to provide consistent objective function improvement for any physical model implemented, while the numerical method is expected to allow for straightforward parallelization to achieve peak performance on clusters of modern nVidia CUDA capable GPUs. Optimal design in fluid flow problems has received considerable attention in recent years by both engineers and mathematicians. For a survey of CFD optimization methods we refer the reader to the book by Mohammadi and Pironneau [1]. In general, flow domain optimization problems are solved with two main approaches called shape and topology optimization. The first, more traditional approach, consists in parametrization of the geometry and subsequent finding the parameters corresponding to the best objective function [2]. This limits the range of available shapes as topology cannot change during the optimization process. Nevertheless the approach remains very efficient and accurate in assessing the influence of fine details of geometry. The second approach defines the unknown shape using a global scalar field indicating presence of fluid or solid at each point of the domain (different scalar fields are used for this purpose, nevertheless the artificial porosity seems to be most popular [3, 4]). This approach is very well established for solids and structures; for an extensive review we refer the reader to the book by Bendsøe and Sigmund [5]. Discretization of a fluid problem is typically obtained by finite volume, finite element, or discontinuous Galerkin methods. These methods use fine body-fitted meshes, which may be difficult to generate for complex 3D geometries. Moreover these approaches are quite difficult to apply for multiphase flows with variable complex interfaces. In contrast Lattice Boltzmann Methods (LBM) are based on the concept of solving discrete Boltzmann equation on Cartesian grids. This in principle allows to tackle geometries of Email addresses: [email protected] (Ł. Łaniewski-Wołłk), [email protected] (J. Rokicki) Preprint submitted to Elsevier January 21, 2015 extreme complexity (e.g., see application of LBM to the filtration problems [6, 7]). LBM is proven to converge to incompressible Navier-Stokes equations for the low Mach number limit and in recent years has gained broad recognition for calculation of micro-fluids, multi-phase problems, and flows through porous media [8, 6, 7]. For a comprehensive introduction to LBM we refer the reader to the book by Succi [9]. The geometry in LBM is described by switching specific nodes of the mesh on and off and applying a so-called Bounce Back boundary condition. This inherent immersed boundary approach is an ideal candidate for topology optimization technique, where very complex shapes are expected to appear. To achieve acceptable efficiency of the optimization algorithm for high-dimensional design spaces, the gradient of the objective function is needed. For this purpose we use a well established adjoint approach [3, 10, 4, 1]. In the literature, two main types of this approach can be found. The first is a continuous adjoint, which bases on equation dual to the original form of the problem (e.g., Navier-Stokes equations). The resulting dual equation is discretized, in most cases, by the same scheme as the original (primal) problem [3]. The second approach is a discrete adjoint, which formulates equations dual to the already discretized form of the original problem [11, 12]. In the present work we use the latter approach, as it can be easily automated, at the same time providing the accurate value of the computed gradient. Despite advantages, the discrete adjoint exhibits drawbacks related to parallelization. This is because many implementations use Automatic Differentiation (AD) techniques to the whole residual calculation procedure. In most cases AD tools are incapable of handling MPI directives1 , which makes the resulting code inherently serial. In contrast, in the present work we apply AD only to small local procedures, which allows the adjoint code to be both efficient and parallel. The optimization in the context of Lattice Boltzmann Methods was addressed previously by Pingen, Evgrafov et al. [10, 14, 15] also with the use of adjoint approach. The adjoint for Lattice Boltzmann Methods was also considered for parameter identification by Tekitek et al. [16], but not for geometry optimization. The problem of low-Reynolds number mixing was addressed earlier with both Finite Element Method by Andreasen et al. [4], and with LBM by Makhija et al. [15], however the results of the latter work are limited to the 2D channel flows and represent low topological complexity. In all of the above cases, the adjoint formulation is derived by hand for a specific model. In contrast the present work provides a fully parallel adjoint formulation for a wide class of Lattice Boltzmann schemes, and applies the method to 3D topological optimization in the context of the coupled flow and heat transfer problem. The optimization is taking advantage of a one-shot approach, which further lowers the numerical cost. The obtained 3D optimal heat exchanger has complex, almost fractal geometry. In Section 2 we describe a framework for a class of numerical LBM schemes and provide for them an adjoint formulation. In Section 3 we show details of the current LBM presenting: (i) the topology parametrization, (ii) the optimization algorithm and (iii) the implementation for the CUDA architecture. In Section 4 we formulate two distinct topology optimization problems and analyze the results obtained. We also investigate the parallel performance of the code, considering both weak and strong scaling. The two test cases concern: a low Raynolds number mixer and a free-topology heat exchanger. The final Section presents the conclusions of the presented work. 2. Local Lattice Boltzmann Scheme and adjoint formulation To address a wider class of Lattice Boltzmann Methods and to preserve important parallelization properties in the adjoint formulation, we define a subclass of Local Lattice Boltzmann Schemes (LLBS). The procedure of constructing an adjoint formulation presented in this paper can be applied to any Lattice Boltzmann Method that fits into the proposed subclass. The main features of LLBS are locality of the collision operator and reversibility of the streaming. These constraints still allow to have a different collision operator for each lattice node, provided that the operator does not use information from the surrounding nodes (apart from the streamed information). Most Lattice 1 More modern AD software can in principle cope with MPI directives [13], but the process is still not completely automated and may produce a very inefficient code. 2 Boltzmann schemes, including single and multiple relaxation time schemes, fit into this framework. Many other schemes, including those for multi-phase flows, can be suitably reformulated for this framework by adding additional densities. These properties of LLBS allow for a unified formulation of the adjoint problem, at the same time preserving high parallel efficiency for different physical models. 2.1. Local Lattice Boltzmann Scheme For the purpose of generalization we propose the following mathematical framework. Let us define lattice L as a finite set L = {0, . . . , Lx − 1} × {0, . . . , Ly − 1} × {0, . . . , Lz − 1}. For a fixed M we define density space RM , with its elements describing the physical state at each node. The complete state of our system is expressed by the states at all the lattice nodes f : L → RM . The linear space of all possible states will be called a state space H = {f : L → RM }. Let us also define a parameter space P ⊂ Rp describing the allowable range for the optimization variables α ∈ P. The Lattice Boltzmann Method is characterized by complete separation of communication between nodes (called streaming) and calculations at each node (called collision). This feature allows for very efficient massive parallelization and nearly linear scalability [17]. At each lattice node x ∈ L, the streaming is defined as: (Sf )j (x + ej ) = fj (x) for j = 1, · · · , M where ej denotes the shift of information related to the j-th density from the node x to the neighbouring node x + ej . The shift x + ej is assumed to be periodic in all directions (further on, the increment/decrement shift will always mean addition/subtraction modulo Lx , Ly and Lz ). This periodicity of the streaming operator is vital for simplicity of the adjoint formulation, yet by means limits the generality of the approach. The collision operator W x (f (x), α) is defined for each node x of the Lattice, its first argument denotes the set of densities, while the second the possible dependence on all optimization parameters α ∈ P. In general we may have a separate collision operator W x : RM → RM for each node of the lattice x ∈ L. A single step n of the Local Lattice Boltzmann iterative scheme is finally defined as a composition of streaming and collision operators: fjn+1 (x + ej ) = Wjx (f n (x), α) for j = 1, · · · , M (1) It has to be stressed again, that W x depends only on the densities at a given node, but not on the densities at the neighbouring nodes. The stationary solution fˆ, forms a fixed point of the iterative scheme (1): fˆj (x + ej ) = Wjx (fˆ(x), α) (2) It should be noted that this stationary solution fˆ implicitly depends on all parameters α. It will be assumed now, that the objective function, we want to optimize, has the following general form: X F (α) = F x (fˆ(x)) (3) x x where node dependent function F can be quite arbitrary. Other forms of (3) are possible, yet this formula seems sufficient to represent typical optimization problems in hydrodynamics. 2.2. Adjoint Lattice Boltzmann Scheme Before we go any further, we need to make a simple observation, based on periodicity of the shift operator S. P P Lemma 1. For any f ∈ H, we have x,i fi (x) = x,i fi (x + ei ). From which it follows that for any a, b ∈ H: X X X X ai (x)bi (x) = ai (x + ei )bi (x + ei ) and ai (x)bi (x + ei ) = ai (x − ei )bi (x) x,i x,i x,i 3 x,i P It can be noted that, for a scalar product ha, bi = x,i ai (x)bi (x) defined on H, this lemma states that the streaming operator S is unitary, and we have both ha, bi = hSa, Sbi and ha, Sbi = hS −1 a, bi. Now we can introduce the adjoint Lattice Boltzmann equation and prove the required properties. Theorem 1. If fˆ ∈ H is a fixed point solution of the Local Lattice Boltzmann equation (2), the objective function F is defined by (3) and v ∈ H is a solution of the equation: X ∂Wjx ∂F x ˆ (fˆ(x), α) + (f (x)) for k = 1, · · · , M (4) vk (x − ek ) = vj (x) ∂fk ∂fk j then the gradient of the objective function can be calculated as X ∂Wjx ∂F = vj (x) (fˆ(x), α) ∂α ∂α x,j (5) By (4) we have defined the fixed-point adjoint Lattice Boltzmann equation. It is important to notice, that v is of the same size as fˆ, while the number of equations in (4) is independent of the number of parameters α. Solved once, it can be used to calculate gradient of the objective function with respect to any number (and any type) of parameters by using the formula (5). Proof. Let us differentiate equation (2) with respect to α: X ∂Wjx ∂Wjx ∂ fˆk ∂ fˆj (x + ej ) = (fˆ(x), α) (x) + (fˆ(x), α) ∂α ∂fk ∂α ∂α (6) k ∂ fˆk ∂α (x) and sum it over all indices k: ! X X X ∂Wjx X ∂F x ˆk ∂ fˆk ∂ f ∂ fˆk vk (x − ek ) (x) = vj (x) (fˆ(x), α) (x) + (fˆ(x)) (x) ∂α ∂fk ∂α ∂fk ∂α j Now let us multipy equation (4) by k k k The bracket is now substituted by equation (6): X k X ∂ fˆk vk (x − ek ) (x) = vj (x) ∂α j ∂Wjx ∂ fˆj (x + ej ) − (fˆ(x), α) ∂α ∂α ! + X ∂F x ∂fk k (fˆ(x)) ∂ fˆk (x) ∂α and both sides are summed over all lattice nodes: X X X ∂F x X ∂Wjx ∂ fˆk ∂ fˆj ∂ fˆk (x) = vj (x) (x + ej ) − vj (x) (fˆ(x), α) + (x) vk (x − ek ) (fˆ(x)) ∂α ∂α ∂α ∂fk ∂α x,j x,j x,k x,k Finally, using Lemma 1, one obtains: X x,j vj (x) X ∂F x ∂Wjx ∂F ∂ fˆk (fˆ(x), α) = (x) = (fˆ(x)) ∂α ∂fk ∂α ∂α x,k which concludes the proof. Basing on equation (4) we propose a numerical scheme in which v(x) is obtained by explicit iterations: X ∂Wjx ∂F x ˆ vkn+1 (x − ek ) = vjn (x) (fˆ(x), α) + (f (x)) (7) ∂fk ∂fk j We will call this scheme the Adjoint Lattice Boltzmann Scheme (ALBS). It has clearly the same form as the LLBS iteration formula (1). However the streaming of v acts in the opposite direction, while the corresponding adjoint collision operator is defined as: X ∂Wjx ∂F x ckx (v, f, α) = W vj (f, α) + (f ) (8) ∂fk ∂fk j 4 3. Implementation of the Lattice Bolztmann Method In this study a set of 19 vectors e is used for 3D flow simulations [18]: e1 = [0, 0, 0] e2 = [1, 0, 0] e3 = [−1, 0, 0] e8 = [1, 1, 0] e9 = [−1, 1, 0] e14 = [1, 0, −1] e5 = [0, −1, 0] e6 = [0, 0, 1] e7 = [0, 0, −1] e10 = [1, −1, 0] e11 = [−1, −1, 0] e12 = [1, 0, 1] e13 = [−1, 0, 1] e4 = [0, 1, 0] e15 = [−1, 0, −1] e16 = [0, 1, 1] e17 = [0, −1, 1] e18 = [0, 1, −1] e19 = [0, −1, −1] For the heat transfer equation we use the first 7 of the above. For 2D cases the number of vectors is reduced to 9 for both the fluid flow and the heat transfer. In LLMS the local collision operator plays different role at different nodes of the lattice. It is both responsible for fluid dynamics at the interior nodes, as well as for enforcing the boundary conditions. Therefore three types of nodes can be distinguished: (i) interior nodes, (ii) inlet/outlet nodes, (iii) wall nodes. For inlet/outlet nodes we use simple boundary conditions by Zou and He [19], while for the wall nodes we use bounce back condition [9]. For the interior nodes we use a Forced Multiple Relaxation Time (FMRT) collision. 3.1. Forced Multiple Relaxation Time collision For a classic LB scheme, a simple (BGK) collision operator is used: W bgk (f ) = f + ω (feq − f ) (9) where feq are the equilibrium densities depending on the macroscopic quantities, while ω1 is called the over-relaxation time. This over-relaxation time is directly related to the modelled viscosity coefficient ω1 = 0.5 + 3ν (1 ≤ ω < 2). For stabilization of the scheme an additional transformation was introduced [18]. This approach applies a linear transformation of the density set f , projecting it to a moment space (corresponding to geometric moments of the velocity set). Different relaxation factors are used in each direction of the moment space. Let U denote the matrix of this transformation. For 3D flow simulation we use the matrix proposed in [18]. We define the moment projection as m = U f . The analogue for the BGK operator (9) in the moment space can be written as: W m (m) = m + T (meq − m) (10) where T is a diagonal matrix of relaxation factors. Multiplying both sides of (10) with U −1 we get MRT collision W mrt (f ) = f + U −1 T U (feq − f ) In most cases it is less computationally expensive to calculate meq than feq . This is why a intermediate form is further used:   W mrt (f ) = U −1 meq + (I − T ) (U f − meq ) For our applications it is important to change the global quantities during the iteration process in order to: • enforce certain values like velocity, temperature, etc. at specific points, • optionally add a forcing term like mass force or heat source. eq We introduce these changes by differentiating between pre-collision equilibrium (fpre ) and post-collision eq (fpost ). This defines the Forced Multi Relaxation Time (FMRT) collision:   pre W fmrt (f ) = U −1 mpost eq + (I − T ) U f − meq 5 (11) pre The pre-collision equilibrium feq is based on global variables (like u and ρ) of the density set f prior to post collision while feq is based on desired post-collision values. The FMRT can be seen as a natural extension of the Exact Difference Method [20] of discretization of body forces in LBM. Let us assume that f eq depends on the velocity u and the density ρ. We can apply a body force R and integrate the dynamics of u with a simple Euler step: upost = upre + Rdt. Applying this to the FMRT scheme we get: W fmrt (f ) = feq (upre + Rdt, ρ) + U −1 T U (f − feq (upre , ρ)) Let us now discard the suffix of u to obtain: h i W fmrt (f ) = feq (u + Rdt, ρ) − feq (u, ρ) + W mrt (f ) where the first bracket denotes the Exact Difference discretization of the force R. This approach can be used for any forcing terms, including: heat flux, solvent source as well as these which enforce prescribed velocity or temperature at selected points. 3.2. Topology parametrization In order to implement topology optimization with classic optimization algorithms, one has to parametrize the design space. For this purpose at each node of the lattice L we define a parameter w, which refers to interpolation between a fluid node (w = 1) and a solid node (w = 0). For material properties like heat diffusivity, we use linear interpolation β = wβfluid + (1 − w)βsolid . In order to represent different dynamics in the solid and in the fluid regions, the most common method is to add a fictitious Darcy body force R = −K(w)u [3, 4]. In practical implementation we use: upost = upre − dtK(w)upre = G(w)upre where switching function G assumes value G(1) = 1 (no additional Darcy force exists in the fluid part) and G(0) = 0 (corresponds to upost = 0 in the solid part). The particular selection of function G can significantly affect the convergence of the optimization process, nevertheless this issue is not discussed here being a subject of a separate study. The common choice is a power function: K(w) = K̂wθ with θ = 3 [4, 10]. The final, optimized geometry should consist of either purely solid (w = 0) or purely fluid (w = 1) nodes. In this way a particular form of G becomes unimportant for the evaluation of final result. To reduce the number of nodes with intermediate values of w (between 0 and 1) during the optimization, we introduce a quadratic penalty function P : X P = w(1 − w) (12) nodes This penalty is gradually added to the main objective function to force the optimizer to avoid non-physical values of w. To ensure that the final geometry has a physical meaning at a final stage of optimization, every w that is below a threshold η is set to 0, while everything above η is set to 1. Finally the threshold level η giving the best objective function value is selected from the interval [0, 1]. Example of the dependence of the objective function on the threshold level can be observed in Fig. 5. 3.3. Optimization For optimization two methods are used in the present paper. The first is the Method of Moving Asymptotes (MMA) proposed by Svanberg [21]. In this approach, at each iteration of the optimization algorithm: • the primal solution is iterated until convergence • the adjoint scheme is iterated by the same number of iterations • the objective function and the gradient are evaluated • the optimization parameters are updated by MMA 6 The second method is a simple descent algorithm. The optimization problem is solved simultaneously with the primal and adjoint problem using a one-shot framework [11, 22]. A single iteration consists of: • one iteration of the primal problem • one iteration of the adjoint problem • one update of the parameters: αin+1 = αin + ζ ∂ F ∂αi (13) ∂ where ∂α F denotes the present estimate of the gradient from the actual adjoint solution. The sufficiently i small parameter ζ is chosen to suppress possible oscillations (caused by the delayed response). 3.4. Programming and Parallel Implementation Both the primal and the adjoint Lattice Boltzmann Schemes are solved by the in-house solver CLB. This solver is highly parallel and tuned for nVidia CUDA architecture. It is also capable of running on multiple GPUs by using MPI directives. To achieve high performance and to allow for automatic adjoint formulation, we have used special code generation techniques. The code is generated for every model separately. The model is described by a set of tables defining: • Densities — Names of the densities and corresponding streaming vectors (e.g. fi and ei in (1)) • Settings — Names of global settings that influence the model (e.g., ν) • Globals — Names and properties of global integrals (e.g., Volume Flux, Heat Flux) • Quantities — Names of macroscopic quantities that are exported by the model (e.g., u, ρ, T ) All the source code is generated basing on this description and on the generic text templates. For this purpose an in-house R-Template (RT) tool is used, based on the R programing language [23]. The model collision operator W is defined as a function in a C source file, operating on the defined densities. As the code includes matrix multiplications and other repeatable operations, it is written partly using the symbolic algebra. These symbolic formulas are subsequently expanded by the R-Template tool. For adjoint formulation, the model information is augmented with adjoint densities. Then the model’s dynamics is differentiated using Automatic Differentiation (AD) tool TAPENADE [24] (for reverse differentiation of operator W). The produced code is subsequently used in implementation of equation (8). The complete code generation and compilation procedure is presented in Fig. 1. 4. Results To verify the performance of the proposed optimization approach, two test cases were considered. The first test case deals with maximizing of the low Reynolds number mixing. The second test case concerns coupled heat and mass transfer, in which the convected heat is maximized. In both cases the new shapes are created in the channel with square cross-section. The topology optimization algorithm generates these shapes in a selected volume of this channel (called a design region). The fluid flow is simulated using a standard 19-density 3D MRT [18], while for the heat transfer a 7density single relaxation time BGK is used. The temperature field is always a passive scalar and does not influence the fluid flow. The walls of the channel are adiabatic with a no-slip boundary condition for velocity. At the inlet and at the outlet the standard Pressure Inlet/Outlet boundary conditions by Zou and He [19] are imposed. The pressure at the outlet is set to the reference level of 0 (corresponding to the LB density 1), while the pressure at inlet is set equal to the desired pressure drop. The additional constraint was imposed on the inlet, limiting (out of stability reasons) the velocity to 0.05. During the optimization process in both cases the Reynolds number remains in the range of 100–250, being strongly dependent on the shape of the generated geometry. Summary of settings for both cases can be found in Table 1. 7 Model definition Streaming directions, Settings, integrals. ... Generic code Model dynamics with symbolic algebra Adjoint modifications R template tool Model dynamics Model-tuned code TAPENADE Adjoint model dynamics Platform independent CLB code development machine end-user machine ./configure nvcc + gcc Platform-tuned solver Figure 1: Scheme of code generation and compilation in the CLB code Case Lattice size No. of nodes DoF Span of the design region ∆p ν αfluid αsolid Mixing Heat exchanger 450 × 50 × 50 352 × 50 × 50 1.12×106 0.88×106 29.2×106 22.8×106 61–390 101–252 0.016666 0.03 0.02 0.01 0.003 0.003 0.003 1 Table 1: Summary of the setting in both test cases 4.1. Low Reynolds number mixing The mixing test case consists of a square channel of height D and length 9D. The design region of length ∼ 6.5D is located in the middle section of the channel. At the inlet discontinuous temperature distribution was prescribed (T = −1 for y < 25 and T = 1 for y ≥ 25 — see Fig. 2a). As the heat conduction mimics the diffusion, the evolution of temperature can be used to represent mass mixing process. To evaluate the quality of mixing we use a flux of an award function: Z Z Mixing = (u · n)(1 − T )(1 + T )dS = (u · n)(1 − T 2 )dS (14) outlet outlet This simple award function brings a balance between low variance of temperature and high volume of the flow. The pressure drop of ∆p = 0.016666 was set between the inlet and the outlet. The viscosity was taken as ν = 0.02, while both the solid and the fluid heat diffusivity coefficients were set to αsolid = αfluid = 0.003 (see Table 1). If there is no obstacle in the channel, the temperature profile is evolving by simple heat conduction. The resulting distribution of temperature at the outlet is illustrated in Fig. 2b. This particular distribution has a standard deviation of σ = 0.761 (see Table 2) while the value of the objective function (14) is around 50. The convergence of the one-shot optimization procedure can be observed in Fig. 3. The final value of the objective is around 110 (the standard deviation of the temperature distribution is σ = 0.162). The resulting geometry consists mostly of nodes with values of w > 0.9. As the diffusivity coefficients of the solid and the 8 −0.97 −0.97 −0.32 −0.49 −0.97 0.33 −0.2 −0.4 0.2 −0.8 −0.6 −1 0.6 0.2 −0.2 −0.6 −0.8 −0.4 −0.4 0 0.4 1 −0.2 0 0.2 0.4 0.6 0.8 −0.2 −0.2 0 0.2 0.054 4 0. 0 0.5 −0.46 −0.2 0.98 0.97 0.37 −0.4 0.97 (a) (b) (c) Figure 2: Temperature on (a) inlet of the channel (b) outlet of the channel without any obstacles and (c) outlet of the channel with the optimal geometry. fluid are the same and value of w = 0.9 seems sufficient to completely stop the flow, the sensitivity of the objective to parameter w becomes negligible. Application of the threshold, marginally reduces the objective. Dependence of the objective on the threshold level is shown in Fig. 5. In fact the standard deviation of the temperature is reduced now to σ = 0.151, but at the same time the flow rate is reduced (see Table 2). The distribution of temperature at the outlet for the optimized geometry is illustrated in Fig. 2c. The MMA optimization gives just slightly better results (see Table 2). On the other hand the MMA approach needs around 6 million of iterations, whereas one-shot method needs around 1 million. This difference occurs, because in MMA optimization we iterate the solution and the adjoint until converged in each optimization iteration. In the one-shot approach we use the the imprecise adjoint solution for the update, saving a lot of iterations at the early stage of the optimization. The final geometry and the temperature contour plots in the channel are presented in Fig. 4. 4.2. Heat exchanger The goal of this test case is to intensify the heat exchange between a heating plate and the cooling fluid in a low Reynolds number channel flow. The heat exchanger test case consists of a square channel of the height D and the length 7D (See Fig. 6). In the middle of the channel, a square D × D heating plate is placed at the bottom. The design region is the middle section of the pipe (3D). The heating plate has a fixed temperature of T = 1, while the fluid at inlet has T = 0. The goal is to increase the heat flux convected at the outlet. Z Heat flux ∼ (u · n)T dS (15) outlet The pressure drop of ∆p = 0.03 was set between the inlet and the outlet. The viscosity coefficient was assumed as ν = 0.01, while the solid and the fluid heat diffusivity coefficients were taken as αsolid = 1 and αfluid = 0.003 respectively (Prandtl number = 3.33). If there is no obstacle in the channel, the heat exchange is marginal giving value of the objective function (15) of around 2.4 and the mean temperature of 0.02. To make a fair comparison of the performance of the optimized geometry, a series of simple geometries were first investigated. Geometries consisting of one to seven evenly spaced parallel vertical fins of width of 3–10 lattice nodes were tested with the same flow settings. An additional constraint was adopted to preserve a gap of at least 3 lattice nodes between the fins. The results for all fin geometries can be seen in Fig. 7. 9 90 100 Descent speed = 0 80 70 60 50 Objective / Mixing 500 1000 tab$Iteration/it.div 0 Penalty function P Descent speed = 1e−06 0 0.2 0.4 0.6 0.8 1 Iterations [millions] Figure 3: Convergence of optimization of free-topology mixer. Descent speed denotes the speed ζ in the steepest descent algorithm (see 3.3). Figure 4: Optimal free-topology mixer, generated by the one-shot algorithm. Geometry of the mixer and contour plots of temperature in the square channel. 10 20 40 60 80 ● 0 Mixing ● ●● ●●● ● ●● ●● ● ●●●●●●●● ●●● ● ● ● ● ●●●● ●●●● ●●● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● 0.80 0.85 0.90 0.95 1.00 Threshold Figure 5: Influence on the cut-off level on objective in the mixing optimization test case. Duct Heater Design space 3D D 7D D Figure 6: Heat exchanger test case geometry The best heat transfer was achieved for 6 fins of width 4 (see Table 2). For such configuration the value of the objective is 25.2. In contrast the one-shot topology optimization algorithm gives a result of around 31. However after application of the threshold this value reduces to 28 (see Table 2). This behaviour is caused by a region of w > 0.9 acting as a porous obstacle on top of the resulting geometry. To further improve the quality of the result penalization of the parameter w is used. We add the function P (12) to the objective, and exponentially increase the weight of this function in the overall objective. The convergence of this process can be observed in Fig. 8. As can be clearly seen the penalization does not reduce the true objective function significantly. On the other hand function P is reduced efficiently, and the resulting geometry is more binary. Finally we loose less of the performance applying the threshold then we did in the case of optimization without penalization (compare Opt and Opt+T to Opt+P and Opt+P+T in Table 2). The optimized geometry is shown in Figure 10. The increase in the objective function is 17% and in the mean temperature 21%, compared to the best fin geometry. When compared to the empty channel, the objective is 12 times higher, and the mean temperature 22 times higher. Using the MMA optimization provides us with even better result of the objective function around 33, but is reduced to 27.8 after applying the threshold. As in the earlier case, the one-shot optimization outperforms the MMA approach. Convergence of MMA optimization is shown in Fig. 9. The number of iterations needed for a convergence of the solution (without the optimization) is around 40 thousand, for one-shot optimization 11 25 20 15 10 Objective / Heat flux 5 ● ● ● ● ● ● ● ● Number of Fins 0 ● 3 4 5 6 7 8 1 2 3 4 5 6 9 7 10 Width of fins 25 20 25000 Penalty = −0.004 Penalty = −0.002 10000 tab$Iteration/it.div 0 Penalty function P Penalty = −0.001 15 10 5 Penalty = 0 0 Objective / HeatFlux 30 Figure 7: Objective function for a heat exchanger consisting of an set of parallel fins. 0 0.1 0.2 0.3 Iterations [millions] Figure 8: Convergence of optimization of free-topology heat exchanger with the one-shot algorithm. Penalty denotes the weight of function P (see (12)) in the objective function. 12 30 25 20 15 10 10000 5 Objective / HeatFlux 4000 0 Penalty function P tab$Iteration/it.div 0 0.51h 1 2h 1.5 3h 2 4h 2.5 5h 3 Iterations [millions] / Wall−clock time Figure 9: Convergence of optimization of free-topology heat exchanger with MMA algorithm. In each iteration of MMA algorithm (separated by vertical lines) the solution of the primal and adjoint problem is iterated until converged (see 3.3). (with penalization) it is 0.4 million, and for MMA optimization it is around 3.5 million. Additionally there is no simple method of adding the penalty gradually in MMA, which could prevent the drop of the objective function caused by the application of the threshold on the geometry. 4.3. Parallel performance Parallel performance of the final code was investigated in a series of numerical experiments. The performance of any parallel code is strongly dependent on the size of the problem and the ratio between the calculations and communication. The latter however is directly related to the ratio of volume to surface of the part of the problem that each processor/GPU is calculating. We distinguish two type of scaling: weak and strong. Weak scaling measures speedup of the code, if the size of the subproblem assigned to each processor is the same and fixed. Strong scaling on the other hand measures the speedup with a fixed size of the overall problem — causing the problem to be divided to smaller parts for higher number of processors. In most cases, as the size of the subproblems decreases, the communication starts to dominate the calculations. Such system reaches a level at which adding new processors/GPUs, doesn’t improve the performance. Such level is sometimes called saturation. We selected three meshes: • ”3M” — 320 × 100 × 100 — 3.2×106 elements — 83×106 DoF • ”400K” — 160 × 50 × 50 — 400×103 elements — 10×106 DoF • ”12M” — 320 × 200 × 200 — 12.8×106 elements — 332×106 DoF A series of calculations were done on 1–6 nodes with 1–8 GPUs per node (1–48 GPUs in total). Calculations were carried out on nodes of ZEUS supercomputer at the Cyfronet computing center. Each computational node of the cluster is equipped with 2 Intel Xeon E5645 processors and 8 Nvidia Tesla M2090 GPU units. Weak scaling was investigated for ”3M” and ”400K” meshes, by running the CLB code for 13 (a) (b) Figure 10: Geometry of free-topology heat exchanger. (a) front and (b) back. Table 2: Summary of the results. SD — Standard deviation; Opt — Optimized with one-shot method; MMA — Optimized with MMA algorithm; T — threshold applied, resulting in a binary (w = 0 and w = 1) geometry; P — penalty P (see (12)) gradually added to the objective function; Fins — Optimal fin heat exchanger Velocity Mixer Empty MMA MMA+T Opt Opt+T Exchanger Case Empty Fins MMA MMA+T Opt Opt+T Opt+P Opt+P+T Objective Temperature Topology parameter w in design region [0.9, 0.99) [0.99, 1) — <1% 2% — 3% — 1% — — — — 6% — 6% — — 6% — 7% — 100% 87% 98% 87% 97% 0.04×106 6×106 — 1×106 — — 16% 10% 25% 25% 40% 31% 32% — — 14% — 15% — <1% — — — 7% — 3% — 2% — — — 4% — 9% — 9% — 100% 84% 65% 75% 48% 60% 57% 68% 0.03×106 0.03×106 3.5×106 — 0.4×106 — 0.4×106 — SD Mean SD 0 49.266 114.508 111.863 113.381 110.383 0.051 0.050 0.050 0.050 0.050 0.031 0.030 0.030 0.031 0.030 0.000 0.041 0.041 0.000 0.000 0.763 0.068 0.175 0.094 0.200 2.376 25.202 33.362 27.883 31.032 28.226 30.955 29.447 0.051 0.030 0.034 0.032 0.025 0.026 0.027 0.029 0.029 0.017 0.020 0.017 0.009 0.013 0.010 0.014 0.020 0.367 0.424 0.378 0.533 0.467 0.502 0.446 0.049 0.092 0.101 0.062 0.050 0.065 0.051 0.060 14 Iterations (0, 0.9) Mean 1 Parallel scaling Strong scaling 12M mesh Strong scaling 3M mesh Weak scaling 3M mesh Weak scaling 400K mesh ● ●● ● ● ●● ●● ●● ●● ●● ● ●●● ● ● ●● ● ● ● ●● ●● ●● 5 ● ● ●●● ● ● ●● ●● ●●● ●● ●● ●●● ●●●●●● ● ● ●●●●●● ● ● 0 ● ● ● ● ●● ● ● ●● ● ● ●● ● ●● ●● ● ●● ● ●●● ● ●●● ●● ● ● ● ●● ●● ●● ●● ●● ●● ● ● ● ● ● ● ●● ●● ● ● ●● ●● Primal ● 5 ● 4 3 ●● ● ●● ●● ● ● ●● ●● ●● 2 1 ●● ● ●● ● ●● ●●● ●● ● ●●●● ● ● ●● ●●● ●● ●● ● ●● 0 0 10 20 30 40 ● ● ●● ●● ● ●● ● ● ● 50 0 10 20 30 40 ● ●● ●● ●● ● ●● ● ●● ●● ● ●● ●● 50 0 10 20 ●● ● ●● ●● ● ●● ● ● ●● ● ● ●● ●● ●● ● ●● 30 40 50 0 10 20 ● ●● ●● ● 30 Adjoint Billions of elements per second (GLUps) ● ● 10 40 50 GPUs Figure 11: Weak and strong scaling of Primal and Adjoint calculations in CLB code. a mesh size proportional to the number of GPUs (in this case 3.2×106 and 400×103 elements per GPU). Strong scaling was checked for ”3M” and ”12M” meshes, by running the CLB code, for a fixed size mesh. The results are in Table 3 and in Fig. 11. All calculations were performed in a single precision. The size of ”12M” mesh is slightly above the upper limit for simulation of fluid with temperature and adjoint on a single Nvidia Tesla M2090 (6 GB GDDR5). The results clearly demonstrate that the code has nearly linear weak scaling for 3.2×106 elements per node. Strong scaling saturates at 15 GPUs for ”12M” mesh, and at 10 GPUs for ”3M” mesh. The interesting feature of good parallelism of the proposed adjoint formulation is that the adjoint calculations are closer to the linear scaling, than the primal calculations. This is caused by a average higher number of operations per node, while keeping the communication at exactly the same level. The speed ratio between adjoint and primal is consistently around 2.65, which is in good agreement with theoretical estimates of 2–3 (as derivative of one multiplication is two multiplications and one addition). 5. Conclusions In the present work we showed an efficient technique for addressing topology optimization in complex mesoscopic flow problems. This approach is based on solving the problem with Lattice Boltzmann Method, calculation of the sensitivity with Adjoint Lattice Boltzmann, and optimization with one-shot steepest descent method, or MMA. This approach was successfully used for optimization of free-topology mixer and heat exchanger (see Table 2). In the present work we showed an efficient technique for addressing topology optimization in complex mesoscopic flow problems. This approach is based on solving the problem using Lattice Boltzmann Method, while the sensitivities are evaluated by the Adjoint Lattice Boltzmann. The optimization process is carried out with one-shot steepest descent method, or the Method of Moving Asymptotes. This approach was 15 GPUs Table 3: Summary of performance tests. 1 2 3 4 5 6 7 8 9 10 12 14 15 16 18 20 21 24 25 28 30 32 35 36 40 42 48 Strong scaling 12M mesh Weak scaling 3M mesh 3M mesh 400K mesh Primal Adjoint Primal Adjoint Primal Adjoint Primal Adjoint — 604 (—) 871 (—) 1162 (—) 1471 (—) 1692 ( 3%) 1787 (12%) 2271 ( 2%) 2418 ( 7%) 2797 ( 4%) 3235 ( 7%) 2639 (35%) 3963 ( 9%) 4105 (12%) 4427 (15%) 4384 (25%) 2907 (52%) 4943 (29%) 4406 (39%) 4124 (49%) 4725 (46%) 3952 (57%) 4178 (59%) 4346 (58%) 4408 (62%) 4790 (61%) 4743 (66%) — 219 (—) 324 (<1%) 432 (—) 546 (—) 641 ( 1%) 733 ( 3%) 830 ( 4%) 926 ( 5%) 1063 ( 2%) 1215 ( 6%) 1415 ( 7%) 1541 ( 5%) 1614 ( 7%) 1748 (10%) 2034 ( 6%) 2020 (11%) 2309 (11%) 2458 ( 9%) 2718 (10%) 2865 (12%) 3088 (11%) 3362 (11%) 3306 (15%) 3858 (11%) 3820 (16%) 4388 (15%) 298 (—) 582 ( 2%) 837 ( 6%) 1089 ( 9%) 1184 (21%) 1557 (13%) 944 (55%) 1957 (18%) 1880 (30%) 2014 (33%) 2452 (32%) 1256 (70%) 2214 (51%) 2186 (54%) 2394 (55%) 2258 (62%) 1577 (75%) 2292 (68%) 2126 (71%) 1916 (77%) 2185 (76%) 1933 (80%) 2232 (79%) 2115 (80%) 1889 (84%) 2158 (83%) 2080 (85%) 109 (—) 211 ( 4%) 305 ( 7%) 411 ( 6%) 493 (10%) 588 (10%) 646 (16%) 804 ( 8%) 849 (14%) 910 (17%) 1140 (13%) 1148 (25%) 1252 (24%) 1468 (16%) 1544 (22%) 1605 (27%) 1489 (35%) 1887 (28%) 1849 (32%) 1800 (41%) 1931 (41%) 1838 (48%) 2022 (47%) 2009 (49%) 1869 (57%) 2048 (55%) 2038 (61%) 298 (—) 585 ( 2%) 874 ( 2%) 1161 ( 3%) 1455 ( 2%) 1735 ( 3%) 2018 ( 3%) 2307 ( 3%) 2577 ( 4%) 2874 ( 4%) 3442 ( 4%) 3952 ( 5%) 4293 ( 4%) 4561 ( 4%) 5148 ( 4%) 5716 ( 4%) 5902 ( 6%) 6855 ( 4%) 7123 ( 4%) 7910 ( 5%) 8527 ( 5%) 9051 ( 5%) 9866 ( 5%) 10169 ( 5%) 11296 ( 5%) 11850 ( 5%) 13385 ( 6%) 109 (—) 217 (< 1%) 325 (<1%) 432 ( 1%) 542 (<1%) 649 ( 1%) 750 ( 2%) 865 ( 1%) 971 ( 1%) 1078 ( 1%) 1297 ( 1%) 1420 ( 7%) 1620 ( 1%) 1724 ( 1%) 1941 ( 1%) 2157 ( 1%) 2203 ( 4%) 2585 ( 1%) 2696 ( 1%) 2905 ( 5%) 3235 ( 1%) 3136 (10%) 3782 ( 1%) 3889 ( 1%) 4322 ( 1%) 4528 ( 1%) 5169 ( 1%) 289 (—) 549 ( 5%) 819 ( 6%) 1079 ( 7%) 1364 ( 6%) 1601 ( 8%) 1860 ( 8%) 2110 ( 9%) 2365 ( 9%) 2649 ( 8%) 3181 ( 8%) 3081 (24%) 3869 (11%) 4123 (11%) 4657 (11%) 4976 (14%) 4559 (25%) 6087 (12%) 5390 (25%) 5127 (37%) 6454 (26%) 6088 (34%) 5828 (42%) 6380 (39%) 6433 (44%) 6685 (45%) 7876 (43%) 104 (—) 203 ( 2%) 304 ( 2%) 403 ( 3%) 506 ( 2%) 601 ( 3%) 701 ( 3%) 797 ( 4%) 897 ( 4%) 997 ( 4%) 1194 ( 4%) 1384 ( 5%) 1490 ( 4%) 1583 ( 5%) 1788 ( 4%) 1981 ( 4%) 2075 ( 5%) 2369 ( 5%) 2468 ( 5%) 2720 ( 6%) 2960 ( 5%) 3040 ( 8%) 3439 ( 5%) 3526 ( 6%) 3924 ( 5%) 4124 ( 5%) 4718 ( 5%) 16 successfully used for optimization of a free-topology mixer and a heat exchanger (see Table 2). The resulting optimal geometry has a very complex, almost fractal shape. It was also demonstrated that the code has nearly linear weak scaling, while the strong scaling saturates at 10-15 GPUs. This was made possible by application of various code generation and parallel programming techniques. Proposed adjoint problem formulation has even better parallel properties, keeping linear scalability even for smaller meshes. Overall, we found Adjoint Lattice Bolzmann to be a powerful technique for topology optimization in mesoscopic multi-physics flow problems. Using this technique for inverse design, optimal control and timedependent problems, needs further research. 6. Acknowledgements This work was supported by MNiSW grant Properties and design of structures with open porosity (Nr MNiSW: N N507 273636) and also supported by PL-Grid Infrastructure. Most of the calculations were performed on ZEUS cluster at Cyfronet computing center. References [1] B. Mohammadi, O. Pironneau, B. Mohammadi, O. Pironneau, Applied shape optimization for fluids, Vol. 28, Oxford University Press Oxford, 2001. [2] A. Jameson, Aerodynamic shape optimization using the adjoint method, Lectures at the Von Karman Institute, Brussels. [3] C. Othmer, A continuous adjoint formulation for the computation of topological and surface sensitivities of ducted flows, International Journal for Numerical Methods in Fluids 58 (8) (2008) 861–877. [4] C. S. Andreasen, A. R. Gersborg, O. Sigmund, Topology optimization of microfluidic mixers, International journal for numerical methods in fluids 61 (5) (2009) 498–513. [5] M. P. Bendsoe, Topology optimization: theory, methods and applications, Springer, 2003. [6] C. Pan, L.-S. Luo, C. T. Miller, An evaluation of lattice boltzmann schemes for porous medium flow simulation, Computers & fluids 35 (8) (2006) 898–909. [7] W. Regulski, Flows in media with open porosity-towards a better pressure drop estimate, in: 2nd ECCOMAS Young Investigators Conference (YIC 2013), 2013. [8] T. Lee, C.-L. Lin, A stable discretization of the lattice boltzmann equation for simulation of incompressible two-phase flows at high density ratio, Journal of Computational Physics 206 (1) (2005) 16–47. doi:10.1016/j.jcp.2004.12.001. URL http://www.sciencedirect.com/science/article/pii/S0021999104004929 [9] S. Succi, The lattice Boltzmann equation: for fluid dynamics and beyond, Oxford university press, 2001. [10] G. Pingen, A. Evgrafov, K. Maute, Topology optimization of flow domains using the lattice boltzmann method, Structural and Multidisciplinary Optimization 34 (6) (2007) 507–524. [11] A. Jaworski, J.-D. Müller, Toward modular multigrid design optimisation, in: Advances in Automatic Differentiation, Springer, 2008, p. 281–291. [12] J.-D. Müller, P. Cusdin, On the performance of discrete adjoint CFD codes using automatic differentiation, International Journal for Numerical Methods in Fluids 47 (8-9) (2005) 939–945. doi:10.1002/fld.885. URL http://dx.doi.org/10.1002/fld.885 [13] J. Utke, L. Hascoët, P. Heimbach, C. Hill, P. Hovland, U. Naumann, Toward adjoinable MPI, in: Proceedings of the 10th IEEE International Workshop on Parallel and Distributed Scientific and Engineering, PDSEC’09, Rome, Italy, 2009. [14] G. Pingen, A. Evgrafov, K. Maute, Adjoint parameter sensitivity analysis for the hydrodynamic lattice boltzmann method with applications to design optimization, Computers & Fluids 38 (4) (2009) 910–923. [15] D. Makhija, G. Pingen, R. Yang, K. Maute, Topology optimization of multi-component flows using a multi-relaxation time lattice boltzmann method, Computers & Fluids. [16] M. Tekitek, M. Bouzidi, F. Dubois, P. Lallemand, Adjoint lattice boltzmann equation for parameter identification, Computers & fluids 35 (8) (2006) 805–813. [17] T. Pohl, F. Deserno, N. Thurey, U. Rude, P. Lammers, G. Wellein, T. Zeiser, Performance evaluation of parallel large-scale lattice boltzmann applications on three supercomputing architectures, in: Proceedings of the 2004 ACM/IEEE conference on Supercomputing, 2004, p. 21. [18] D. d’Humières, Multiple–relaxation–time lattice boltzmann models in three dimensions, Philosophical Transactions of the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences 360 (1792) (2002) 437–451. [19] Q. Zou, X. He, On pressure and velocity boundary conditions for the lattice boltzmann BGK model, Physics of Fluids 9 (6) (1997) 1591–1598. doi:doi:10.1063/1.869307. URL http://pof.aip.org/resource/1/phfle6/v9/i6/p1591_s1 [20] A. L. Kupershtokh, D. A. Medvedev, D. I. Karpov, On equations of state in a lattice boltzmann method, Computers & Mathematics with Applications 58 (5) (2009) 965 – 974, mesoscopic Methods in Engineering and Science. doi:http: //dx.doi.org/10.1016/j.camwa.2009.02.024. URL http://www.sciencedirect.com/science/article/pii/S0898122109001011 17 [21] K. Svanberg, The method of moving asymptotes—a new method for structural optimization, International journal for numerical methods in engineering 24 (2) (1987) 359–373. [22] E. Özkaya, N. Gauger, Single-step one-shot aerodynamic shape optimization, in: K. Kunisch, J. Sprekels, G. Leugering, F. Tröltzsch (Eds.), Optimal Control of Coupled Systems of Partial Differential Equations, Vol. 158 of International Series of Numerical Mathematics, Birkhäuser Basel, 2009, pp. 191–204. URL http://dx.doi.org/10.1007/978-3-7643-8923-9_11 [23] R Core Team, R: A Language and Environment for Statistical Computing, Vienna, Austria, 2013. URL http://www.R-project.org/ [24] L. Hascoët, V. Pascual, The tapenade automatic differentiation tool: Principles, model, and specification, ACM Transactions On Mathematical Software 39 (3). URL http://dx.doi.org/10.1145/2450153.2450158 18
5cs.CE
THE VARIATIONAL DISCRETIZATON OF THE CONSTRAINED HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS arXiv:1801.00577v1 [math.DS] 2 Jan 2018 ANTHONY BLOCH, LEONARDO COLOMBO, AND FERNANDO JIMÉNEZ Abstract. In this paper we investigate a variational discretization for the class of mechanical systems in presence of symmetries described by the action of a Lie group which reduces the phase space to a (non-trivial) principal bundle. By introducing a discrete connection we are able to obtain the discrete constrained higherorder Lagrange-Poincaré equations. These equations describe the dynamics of a constrained Lagrangian system when the Lagrangian function and the constraints depend on higher-order derivatives such as the acceleration, jerk or jounces. The equations, under some mild regularity conditions, determine a well defined (local) flow which can be used to define a numerical scheme to integrate the constrained higher-order Lagrange-Poincaré equations. Optimal control problems for underactuated mechanical systems can be viewed as higher-order constrained variational problems. We study how a variational discretization can be used in the construction of variational integrators for optimal control of underactuated mechanical systems where control inputs act soley on the base manifold of a principal bundle (the shape space). Examples include the energy minimum control of an electron in a magnetic field and two coupled rigid bodies attached at a common center of mass. 1. Introduction Reduction theory is one of the fundamental tools in the study of mechanical systems with symmetries and it essentially concerns the removal of certain variables by using the symmetries of the system and the associated conservation laws. Such symmetries arise when one has a Lagrangian which is invariant under a Lie group action G, i.e. if the Lagrangian function is invariant under the tangent lift of the action of the Lie group on the configuration manifold Q. If we denote by Φg : Q → Q this (left-) action, for g ∈ G then the invariance condition under the tangent lift action is expressed by L ◦ T Φg = L. For a symmetric mechanical system, reduction by symmetries eliminates the directions along the group variables and thus provides a system with fewer degrees of freedom. If the (finite-dimensional) differentiable manifold Q has local coordinates (q i ), 1 ≤ i ≤ dim Q and we denote by T Q its tangent bundle with induced local coordinates (q i , q̇ i ), given a Lagrangian function L : T Q → R, its Euler–Lagrange equations are   d ∂L ∂L − i = 0, 1 ≤ i ≤ dim Q. (1) dt ∂ q̇ i ∂q As is well-known, when Q is the configuration manifold of a mechanical system, equations (1) determine its dynamics. A paradigmatic example of reduction is the derivation of the Euler-Poincaré equations from the Euler-Lagrange equations (1) when the configuration manifold is a Lie group, i.e. Q = G. Assuming that the Lagrangian L : T G → R is left invariant under the action of G it is possible to reduce the system by introducing the body fixed velocity ξ ∈ g and the reduced Lagrangian ℓ : T G/G ≃ g → R, provided by the invariance condition ℓ(ξ) = L(g −1 g, g −1 ġ) = L(e, ξ). The dynamics of the reduced Lagrangian is governed by 2010 Mathematics Subject Classification. 34C15; 37J15; 37N05; 65P10; 70F25. Key words and phrases. Variational integrators, discrete mechanical systems, Lagrange-Poincaré equations, geometric integration, discrete variational calculus, ordinary differential equations, control of mechanical systems, reduction by symmetries. A. Bloch was supported by NSF grant DMS-1613819 and AFOSR. L. Colombo was supported by MINECO (Spain) grant MTM2016-76072-P. F. Jiménez was supported by the EPSRC project: ‘’Fractional Variational Integration and Optimal Control”; ref: EP/P020402/1. 1 2 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ the Euler–Poincaré equations (see [2] and [8] for instance) and given by the system of first order ordinary differential equations     d ∂ℓ ∂ℓ = ad∗ξ . (2) dt ∂ξ ∂ξ This system, together with the reconstruction equation ξ(t) = g −1 (t)ġ(t), is equivalent to the Euler-Lagrange equations on G, which are given by  ġ = gξ,      d ∂L ∂L     = ⇒ ∂ℓ d ∂ℓ  dt ∂ ġ ∂g ∗  = adξ .  dt ∂ξ ∂ξ Reduction theory for mechanical systems with symmetries can be also developed by using a variational principle formulated on a principal bundle π : Q → Q/G, where the principal connection A is introduced on Q [17] (see Definition 2.1). The connection yields (1) g, the bundle isomorphism αA : (T Q)/G → T (Q/G) ⊕Q/G e (1) αA ([vq ]) := (T π (vq ) , [q, A(vq )]g ) , (see equation (6)) where the bracket is the standard Lie bracket on the Lie algebra g and e g := AdQ is the adjoint bundle AdQ := (Q × g)/G. A curve q(t) ∈ Q induces the two curves p(t) := π(q(t)) ∈ Q/G and σ(t) = [q(t), A(q̇(t))]g ∈ e g. Variational Lagrangian reduction [17] states that the Euler-Lagrange equations on Q with a G-invariant Lagrangian L are equivalent to the Lagrange-Poincaré equations on g → R. The g with reduced Lagrangian L : T (Q/G) ⊕Q/G e T Q/G ∼ = T (Q/G) ⊕Q/G e Lagrange-Poincaré equations read  D ∂L ∗ ∂L    Dt ∂σ − adσ ∂σ = 0,   (3)   ∂L − D ∂L = ∂L , iṗ B e ,  ∂p Dt ∂ ṗ ∂σ e is the reduced curvature form associated to the principal connection A and D/Dt where B denotes the covariant derivative in the associated bundle (see Definition 2.2). The derivation of variational integrators for (1) and (2) from the discretization of variational principles has received a lot attention from the Dynamical Systems Geometric Mechanics community in the recent years [37], [38], [40], [42], [43], [44] (and in particular for optimal control of mechanical systems [1], [6], [7], [11], [15], [16], [18], [23], [35], [34], [45]). The preservation of the symplectic form and momentum map are important properties which guarantee the competitive qualitative and quantitative behavior of the proposed methods and mimic the corresponding properties of the continuous problem. That is, these methods allow substantially more accurate simulations at lower cost for higher-order problems with constraints. Moreover, if the system is subject to constraints, then, under a regularity condition, it can be shown that the system also preserves a symplectic form or a Poisson structure in the reduced case ([22] and [23] for instance). The construction of variational integrators for mechanical systems where the configuration space is a principal bundle has been studied in the geometric framework of Lie groupoids [37] and as a motivation for the construction of a discrete time connection form [33], [24]. This line of research has been further developed in the last decade by T. Lee, M. Leok and H. McClamroch [32]. We focus on systems whose phase space is of higher-order, i.e. T (k) Q [3], [26], [27], and moreover is invariant under the action of symmetries. The Euler-Lagrange and Lagrange-Poincaré equations for these systems were introduced by F. Gay-Balmaz, D. Holm and T. Ratiu in [25]. In this work, we aim to develop their discrete analogue for non-trivial principal bundles and its extension to constrained systems (where the constraints will be as well of the higher-order type). With this in mind we employ the discrete Hamilton’s principle by introducing a discrete connection and using Lagrange multipliers in order to obtain discrete paths that approximately satisfy the dynamics and the constraints. As examples, we will illustrate our theory by applying the obtained discrete equations to the problem of energy minimum control of an electron in a magnetic field and two coupled rigid bodies attached at a common center of mass. DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 3 The structure of the work is as follows: Section 2 introduces preliminaries on geometric mechanics, Lagrange-Poincaré equations, higher-order tangent bundles and the derivation of the constrained higher-order Lagrange-Poincaré equations (Theorem 2.4). Section 3 starts by introducing discrete mechanics and the notion of discrete connection. Next, we study the variational discretization of the constrained higher-order Lagrange-Poincaré equations to obtain a discrete time flow that integrates the continuous time constrained higher-order Lagrange-Poincaré equations. Moreover we provide sufficient regularity conditions for the discrete flow to exist. We proceed by treating the second-order case (the discrete constrained Lagrange-Poincaré equations are given in Theorem 3.4 and the regularity conditions in Proposition 3.1) as an illustration of our approach. Then we carry out the full higher-order case (the equations are given in Theorem 3.6, while the regularity conditions are in Proposition 3.2). Finally, in Section 4, we apply the discrete equations to underactuated mechanical systems in two examples of optimal control, showing that they give rise to a meaningful discretization of the continuous systems. 2. Constrained higher-order Lagrange-Poincaré equations In this section we introduce some preliminaries about geometric mechanics on Lie groups, Lagrange-Poincaré reduction, higher order tangent bundles and we study the constrained variational principle for higher-order mechanical systems on principal bundles. 2.1. Geometry of principal bundles. In this subsection we recall the basic tools for analysis of the geometry of principal bundles that are useful in this paper (for more details see [17] and references therein). Definition 2.1. Let G be a Lie group and g its Lie algebra. Given a free and proper left Lie group action Φ : G × Q → Q, one can consider the principal bundle π : Q → Q/G. A connection A on the principal bundle π is a one-form on Q taking values on g, such that A(ξQ (q)) = ξ, for all ξ ∈ g, q ∈ Q and Φ∗g A = Adg A where ξQ is the infinitesimal generator associated with ξ defined as ξQ (q) := d dt t=0 q · exp(tξ). The associated bundle N with standard fiber M (a smooth manifold), is defined as N = Q ×G M = (Q × M )/G, (4) where the action of G on (Q × M ) is diagonal, i.e. given by g(q, m) = (gq, gm) for q ∈ Q and m ∈ M . The orbit of (q, m) is denoted [q, m]G or simply [q, m]. The projection πN : N → Q/G is given by πN ([q, m]G ) = π(q) and it is a surjective submersion. The adjoint bundle is the associated vector bundle with M = g under the adjoint action by the inverse element g −1 ∈ G, ξ 7→ Adg−1 ξ, and is denoted AdQ := Q ×G g. (5) We will usually employ the short-hand notation e g :=AdQ. The orbits in this case are denoted [q, η]g for q ∈ Q and η ∈ g . AdQ is a Lie algebra bundle, that is, each fibre is a Lie algebra with the Lie bracket defined by [[q, ξ]g , [q, η]g ] = [q, [ξ, η]]g . Reduction theory for mechanical systems with symmetries can be performed by a variational principle formulated on a principal bundle π : Q → Q/G, with fixed principal connection A on Q (see [17]). In other words, the reduced Lagrangian will be defined on the reduced space T Q/G, say L : T Q/G → R. The bundle isomorphism (1) g, provided by the connection, will facilitate the study of αA : T Q/G → T (Q/G) ×Q/G e the suitable variations. It is defined by (1) αA ([vq ]) := (T π (vq ) , [q, A(vq )]g ) , (6) where the bracket is the standard Lie bracket on the Lie algebra g, vq ∈ Tq Q and [vq ] ∈ (T[q]G Q)/G with [q]G ∈ Q/G. A curve q(t) ⊂ Q induces the two curves p(t) := π(q(t)) ⊂ Q/G and σ(t) := [q(t), A((q(t), q̇(t)))]g ⊂ e g, where we denote by (q(t), q̇(t)) the local coordinates of vq(t) ∈ Tq(t) Q at each t. 4 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ Definition 2.2. The connection A also allows to define the curvature form B, a 2-form on Q taking values on g, determined by B(vq , uq ) := dA(vq , uq ) − [A(vq ), A(uq )]g ∈ g, where uq , vq are arbitrary vectors in Tq Q such that Tq π(uq ) = up and Tq π(vq ) = vp , with e on Q/G defined by p = π(q). The curvature form B induces a e g-valued two-form B e p , vp ) = [q, Bq (uq , vq )] ∈ e B(u g, g up , vp ∈ Tp (Q/G), (7) e is called the reduced curvawhere uq , vq and up , vp are related as above. The two-form B ture form (for more details see [17] and references therein). 2.1.1. The covariant derivative. It is well know that the covariant derivative on a vector bundle induces an associated covariant derivative on its dual bundle. In this work, as in [17] and [25], we use this fact to define the covariant derivative in the dual of the adjoint bundle. If σ̃(t) is a curve on g̃∗ the covariant derivative of σ̃(t) is defined in such a way that for some curve σ(t) on g̃, both, σ̃(t) and σ(t) project onto the same curve p(t) on Q/G. Then D Dσ̃(t) E D d Dσ(t) E . hσ̃(t), σ(t)i = , σ(t) + σ̃(t), dt Dt Dt In the same way one can define the covariant derivative on T ∗ (Q/G) and therefore a covariant derivative on T ∗ (Q/G) ×Q/G g̃∗ (see [17] Section 3 for more details). 2.2. Lagrange-Poincaré reduction. Lagrangian reduction by stages ([17], Theorem 3.4.1) states that the Euler-Lagrange equations (1) with a G-invariant Lagrangian L : g T Q → R are equivalent to the Lagrange-Poincaré equations on T Q/G ∼ = T (Q/G) ×Q/G e g → R. The (under the isomorphism (6)) with reduced Lagrangian L : T (Q/G) ×Q/G e Lagrange-Poincaré equations read  D ∂L ∗ ∂L    Dt ∂σ − adσ ∂σ = 0,   (8)  ∂L D ∂L ∂L  e ,  − = , iṗ B ∂p Dt ∂ ṗ ∂σ e is the reduced curvature form defined in (7) and D/Dt denotes the covariant where B derivative in the associated bundle. Note that we are employing coordinates (p, ṗ, σ) e denotes the e g-valued 1-form on Q/G defined by g. Moreover, iṗ B for T (Q/G) ×Q/G e e = B( e ṗ, ·). iṗ B(·) Consider a local trivialization of the principal bundle π : Q → Q/G, i.e. a trivial principal bundle πU : U ×G → U where U is an open subset of Q/G with structure group G acting on the second factor by left multiplication. Denote by (ps ), s = 1, . . . , r = dim(Q)− dim(G) local coordinates on U and define maps eb : U → g satisfying that for each p ∈ U , {eb } is a basis of g, b = 1, . . . , dim(G). We choose the standard connection on U , that is, at a tangent vector (p, g, ṗ, ġ) ∈ T(p,g) (U ×G) we have A(p, g, ṗ, ġ) =Adg (Ae (p)ṗ+ξ) where ξ = g −1 ġ, e is the identity of G, and Ae : U → g is a 1-form given by Ae (p)ṗ = A(p, e, ṗ, 0). ∂L Denote by ēb a section of e g given by ēb (p) = [p, e, eb (p)]g , σ = σ a ēa , and p̄b = (ēb ). ∂σ With this notation the Lagrange-Poincaré equations (8) read (see [39] and [17] Section 4.2 for details) d a d a p̄b = p̄a (Cdb σ − Cdb Ads ṗs ), dt d ∂L ∂L ∂L a d b − = (B a ṗl + Cdb σ As ), ∂ps dt ∂ ṗs ∂σ a l s (9) a where Cbd are the structure constants of the Lie algebra of g, Blas are the coefficients of the curvature in the local trivialization and Aas (p) are the coefficients of Ae for given local coordinates ps in U determined by (Ae (p)ṗ)a ea = Aas (p)ṗs ea , Ae (p)ṗ = A(p, e, ṗ, 0). DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 5 2.3. Higher-order tangent bundles. It is possible to introduce an equivalence relation on the set C k (R, Q) of k-differentiable curves from R to Q (see [30] for more details): By definition, two given curves in Q, γ1 (t) and γ2 (t), where t ∈ I ⊂ R (0 ∈ I), have a contact of order k at q0 = γ1 (0) = γ2 (0), if there is a local chart (U, ϕ) of Q such that q0 ∈ U and ds (ϕ ◦ γ1 (t)) dts t=0 = ds (ϕ ◦ γ2 (t)) dts t=0 , for all s = 0, ..., k. This is a well defined equivalence relation on C k (R, Q) and the equiv(k) alence class of a curve γ will be denoted by [γ]q0 . The set of equivalence classes will be (k) denoted by T Q and it is not hard to show that it hasthe natural structure of a differ (k) k k entiable manifold. Moreover, τQ : T (k) Q → Q where τQ [γ]q0 = γ(0), is a fiber bundle called the tangent bundle of order k (or higher-order tangent bundle) of Q. In the sequel we will employ HO as short for higher-order. Given a differentiable function f : Q −→ R and l ∈ {0, ..., k}, its l-lift f (l,k) to T (k) Q, 0 ≤ l ≤ k, is the differentiable function defined as dl (f ◦ γ(t)) . dtl t=0 Of course, these definitions can be applied to functions defined on open sets of Q. From a local chart (q i ) on a neighborhood U of Q, it is possible to induce local coork −1 dinates (q (0)i , q (1)i , . . . , q (k)i ) on T (k) U = (τQ ) (U ), where q (s)i = (q i )(s,k) if 0 ≤ s ≤ k. Sometimes, we will use the standard conventions, q (0)i ≡ q i , q (1)i ≡ q̇ i , q (2)i ≡ q̈ i , etc. (k) f (l,k) ([γ]0 ) = (k) 2.3.1. HO quotient space: The action of a Lie group Φg is lifted to an action Φg T (k) Q → T (k) Q, given by : (k) (k) (k) Φ(k) Φg ([γ](k) g ([γ]q0 ) := T q0 ) = [Φg ◦ γ]Φg (q0 ) . If Φg is free and proper, we get a principal G-bundle T (k) Q → T (k) Q/G, which is a (k) (k) fiber bundle over Q/G. The class of an element [γ]q0 ∈ Tq0 Q in the quotient is denoted (k) [[γ]q0 ]G . From [17] (see Lemma 2.3.4) we know that the covariant derivative of a curve σ(t) = [q(t), ξ(t)]g ⊂ e g relative to a principal connection A is given by D σ(t) = [q(t), ξ̇(t) − [A(q(t), q̇(t)), ξ(t)]]g . Dt In the particular case when σ(t) = [q(t), A(q(t), q̇(t))]g we have 2 D ˙ g and D σ(t) = [q(t), ξ(t) ¨ − [ξ(t), ξ(t)]] ˙ σ(t) = [q(t), ξ(t)] g. Dt Dt2 ¨ − [ξ(t), ξ2 (t)], ..., ξk (t) = ξ̇k−1 (t) − If we denote by ξ1 (t) = ξ(t), ξ2 (t) = ξ̇(t), ξ3 (t) = ξ(t) [ξ(t), ξk−1 (t)], operating recursively one obtains Dk−1 σ(t) = [q(t), ξk (t)]g , Dtk−1 where ξk ∈ g (see [25] for example). (1) Taking all these elements into account, the bundle isomorphism that generalizes αA (k) (6) to the HO case is given by αA : T (k) Q/G → T (k) (Q/G) ×Q/G kg̃:   D Dk−1 D2 (k) (k) (k) αA ([[q](k) ] ) = T π([q] ), σ(0), σ(t), . . . , σ(t) . σ(t), q0 G q0 Dt t=0 Dt2 t=0 Dtk−1 t=0 (10) (k) (k) Note that with some abuse of notation we are denoting the class [[γ]q0 ]G by [[q]q0 ]G . In the (k) expression (10), σ(t) := [q(t), A(q(t), q̇(t))]g , q(t) is any curve representing [q]q0 ∈ T (k) Q with q(0) = q0 , and kg̃ := g̃ × g̃ × . . . × g̃ (see [17] and [33]). | {z } k−copies For further purposes, it will be useful to establish a local notation for the reduced variables. We follow [25] in this respect: (k) (k) αA ([[q](k) , σ, σ̇, σ̈, . . . , σ (k−1) ), q0 ]G ) = (p, ṗ, p̈, . . . , p (11) 6 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ where (p, ṗ, p̈, . . . , p(k) ) are local coordinates on T (k) (Q/G) and the dots denote the time derivatives in a local chart; σ, σ̇, σ̈, . . . , σ (k−1) are independent elements in g̃, where we Dl employ the notation σ (l) := Dt l σ(t) for the covariant derivative. We introduce the notation M (k) := T (k) (Q/G) ×Q/G ke g → R, M := M (1) , and (k−1) (k,k−1) (k) = s to denote the elements (p, ṗ, p̈, . . . , p , σ, σ̇, σ̈, . . . , σ (k−1) ) ∈ M (k) , sσ (k) (k) (k) (k−1) (σ, σ̇, σ̈, . . . , σ ) ∈ ke g and sp = (p, ṗ, p̈, . . . , p ) ∈ T (Q/G). 2.4. Constrained Hamilton’s principle. We derive the constrained HO LagrangePoincaré equations using the variational principles studied in [17] and [25] for first order systems and unconstrained HO systems respectively. Let L : T (k) Q → R, and φα : T (k) Q → R be a G–invariant HO Lagrangian and G– invariant HO (independent) constraints, respectively, α = 1, . . . , m. The G-invariance allows to induce the reduced Lagrangian L : T (k) Q/G → R and reduced constraints χα : T (k) Q/G → R. After fixing a connection A we can employ the isomorphism (10). Then it is possible to write the reduced Lagrangian and the reduced constraints L : M (k) → R and χα : M (k) → R, and employ the local coordinates s(k,k−1) as in (11). Remark 2.3. Note that if Q is the Lie group G, the adjoint bundle is identified with g via the isomorphism αkA : T (k) G/G → kg̃ ∼ = kg :   d dk−1 (k) −1 ] ) = g (0) ġ(0), αA ([[g](k) ξ(t) , ξ(t), . . . , G g0 dt t=0 dtk−1 t=0 (k) (k) where ξ(t) = g −1 (t)ġ(t). If we choose g0 = e, that is, [[g0 g]e ]G = [[g]g0 ]G , we can define the reduced Lagrangian and the reduced constraints given by L : kg → R and χα : kg → R (see [17]). ⋄ In order to establish the variational principle, we must derive the variations on T (k) (Q/G)⊕ d kg̃ induced by variations on Q, i.e. δq(t) = q(t, s) ∈ Tq(t) Q at each t. Consider an ds s=0 arbitrary deformation p(t, s) ⊕ σ(t, s) with p(t, 0) ⊕ σ(t, 0) = p(t) ⊕ σ(t), the corresponding covariant variation is ∂ D δp(t) ⊕ δσ(t) := p(t, s) ⊕ σ(t, s). ∂s s=0 Ds s=0 (k) (k) (k) Since sp = T (k) π([q]q0 ) := [π ◦ q]p , the variations δp of p(t) are arbitrary except at the extremes; that is, δp(l) (0) = δp(l) (T ) = 0 for l = 1, . . . , k − 1; t ∈ [0, T ]. Then, locally we have that δs(k) (12) := (δp, δ ṗ, . . . , δp(k) ). p On the other hand, the covariant variations of σ are given by, D δσ(t) = [q(t), A(q(t), δq(t))]g +[q(t), B(δq(t), q̇(t))]g +[q(t), [A(q(t), q̇(t)), A(q(t), δq(t))]]g . Dt e the reduced curvature (7), it follows that In general, (see [25]) for B δσ (j) (t) = i−1 X Dj e Di δσ(s, t) + [B(p)(ṗ(t), δp(t)), σ (i−1−j) (t)]. Dti Dtj j=0 (13) Note that in the expression above, [·, ·] denotes the usual Lie algebra bracket in e g. e : M (k) × Rm → R given by Consider the augmented Lagrangian L e (k,k−1) , λα ) = L(s(k,k−1) ) + λα χα (s(k,k−1) ) L(s where λα = (λ1 , . . . , λm ) ∈ Rm . A curve on γ(t) ∈ C ∞ (R, M (k) × Rm ) is locally represented by γ(t) = (s(k,k−1) (t), λα (t)). Constrained HO Lagrange-Poincaré equations are derived by considering the constrained variational principle for the action S : C ∞ (R, M (k) × Rm ) → R given by Z T e S(γ) = L(γ(t)) dt 0 DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS for variations δs(k,k−1) = (δp, δ ṗ, . . . , δp(k) , δσ, δ σ̇, . . . , δσ (k−1) ) such that (I) δp(j) (0) = δp(j) (T ) = 0, for j = 1, . . . , k − 1 (II) Variations δσ (j) are of the form (13), for j = 0, . . . , k − 1, D e ṗ, δp) where Ξ is an arbitrary curve in e (III) δσ = Dt Ξ+[σ, Ξ]+ B( g with at the endpoints, Dj Dtj 7 Ξ vanishing Theorem 2.4. Let L : T (k) Q → R be a G-invariant Lagrangian and χα : T (k) Q → R G-invariant constraints, α = 1, . . . , m. Consider the principal G-bundle π : Q → Q/G and let A be a principal connection on Q. Let L : M (k) → R and χα : M (k) → R be the reduced HO Lagrangian and the reduced HO constraints, respectively, associated with A. The curve γ(t) ∈ M (k) satisfies δS(γ) = 0 with respect to the variations δs(k,k−1) satisfying (I)-(III) if and only if γ(t) is a solution of the constrained HO Lagrange-Poincaré equations given by   D k−1   k (i) X X ∂L ∂L ∂χα ∂χα d(i) i D + λ − + λ 0= (−1)(i) (i) (−1) α α dt ∂p(i) ∂p(i) Dt(i) ∂σ (i) ∂σ (i) i=0 i=0 !   i−1 E X D(l) ∂L ∂χα e , (−1)l ad∗σ (i−1−l) (l) − + λ B ; i α ṗ Dt ∂σ (i) ∂σ (i) (14) l=0  k−1    α (i) X ∂L ∂χ D D − ad∗σ + λα (i) , (−1)(i) (i) 0= (i) Dt Dt ∂σ ∂σ i=0 0 = χα (γ(t)), e denotes the AdQ-valued 1-form on Q/G defined by iṗ B(·) e = B( e ṗ, ·), given in where iṗ B (7). Proof. The proof follows in a straightforward way by replacing the Lagrangian in the proof e of Theorem 4.1 of [25] by the extended Lagrangian L.  Remark 2.5. If Q is a Lie group G then the constrained HO Lagrange-Poincaré equations (14) become the constrained HO Euler-Poincaré equations, i.e:    k−1   l X  d ∂L ∂χα  l d ∗ 0= (−1) l − adσ + λα , (15) dt dt ∂σ ∂σ l=0   α 0 = χ (γ(t)), (k−1) where γ(t) = (sσ )(t), λα (t)) ∈ C ∞ (R, kg × Rm ) (see [21] and [26]). ⋄ Remark 2.6. In the examples, we will be interested in the case k = 2. In that case, the second-order Lagrange-Poincaré equations are locally written as: ! ! !  e e e e  a l e ∂L ∂L d ∂L ∂L d ∂L d2 a − − Bls ṗ + Cdb Abs σ d , + 2 = s s s a a ∂p dt ∂ ṗ dt ∂ p̈ dt ∂ σ̇ ∂σ ! ! ! 2 e e e e ∂L ∂L d ∂L d ∂L d a d a − − = (Cdb σ − Cdb Ads ṗs ), dt2 ∂ σ̇ b dt ∂σ b dt ∂ σ̇ a ∂σ a χα (s(2,1) ) = 0, e (2,1) , λα ) = L(s(2,1) ) + λα χα (s(2,1) ). where L(s Note that these equations are the second-order constrained version of the local expression of the Lagrange-Poincaré equations derived by Marsden and Scheurle in [39]. ⋄ 3. Discrete constrained higher-order Lagrange-Poincaré equations 3.1. Discrete mechanics and variational integrators. Variational integrators are a class of geometric integrators which are determined by a discretization of a variational principle. As a consequence, some of the main geometric properties of continuous system, such as symplecticity and momentum conservation, are present in these numerical methods (see [28],[40] and [44] and references therein). In the following we will summarize the main features of this type of geometric integrator. 8 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ A discrete Lagrangian is a map Ld : Q × Q → R, which may be considered as an approximation of the action integral defined by a continuous Lagrangian L : T Q → R, that is Z t0 +h Ld (q0 , q1 ) ≈ L(q(t), q̇(t)) dt, (16) t0 where q(t) is a solution of the Euler-Lagrange equations (1) joining q(t0 ) = q0 and q(t0 + h) = q1 for small enough h > 0, where h is viewed as the step size of the integrator. Define the action sum Sd : QN+1 → R corresponding to the Lagrangian Ld by Sd = N−1 X Ld (qn , qn+1 ), (17) n=0 where qn ∈ Q for 0 ≤ n ≤ N , N is the number of discretization steps. The discrete variational principle states that the solutions of the discrete system determined by Ld must extremize the action sum given fixed endpoints q0 and qN . By extremizing Sd over qn , 1 ≤ n ≤ N − 1, it is possible to derive the system of difference equations D1 Ld (qn , qn+1 ) + D2 Ld (qn−1 , qn ) = 0. (18) These equations are usually called the discrete Euler–Lagrange equations. If the matrix D12 Ld (qn , qn+1 ) is regular, it is possible to define from (18) a (local) discrete flow map FLd : Q × Q → Q × Q, by FLd (qn−1 , qn ) = (qn , qn+1 ). We will refer to the FLd flow, and also (with some abuse of notation) to the equations (18), as a variational integrator. 3.2. The discrete connection. The discretization of the reduced HO tangent bundle T (k) Q/G ∼ = M (k) is based on the decomposition of the space (Q × Q)/G by means of the so-called discrete connection [33] (see also [24]): Ad : Q × Q → G, (19) which is defined to account for a reasonable discretization of the properties of the continuous connection A and, moreover, is G-equivariant (see [24, 33, 37] for more details). Important properties that characterize the discrete connection are [33]: (1) Ad (q0 , g q0 ) = g, (2) Ad (g q0 , h q1 ) = hAd (q0 , q1 )g −1 , (3) Consider a local trivialization of the principal bundle π : Q → Q/G; namely, for any open neighborhood V ⊂ Q we have V ∼ = U × G, where U ⊂ Q/G. In other words, for any U ⊂ Q/G, π case, we have: (20) −1 (U ) ∼ = U × G. In such a Ad ((p0 , g0 ), (p1 , g1 )) = g1 Ad ((p0 , e), (p1 , e))g0−1 , (21) where locally π(q0 ) = π((p0 , g0 )) = p0 . This defines the local expression of Ad , say Ad ((p0 , e), (p1 , e)) = A(p0 , p1 ) ∈ G, which according to (21) leads to Ad ((p0 , g0 ), (p1 , g1 )) = g1 A(p0 , p1 ) g0−1 . (22) In particular, if Q = G, this leads to Ad ((e, e), (e, e)) = e and consequently Ad (g0 , g1 ) = g1 g0−1 . Remark 3.1. Sometimes (see [37]) the discrete connection is defined as the application Ad : Q × Q → G satisfying the properties (1) and (2) listed above. ⋄ In particular, given a discrete connection Ad the following isomorphism between bundles is well-defined (see [33] for the proof): e α(1) : (Q × Q)/G → ((Q/G) × (Q/G)) ⊕ G, A d [q0 , q1 ]G 7→ (π(q0 ), π(q1 )) ⊕ [q0 , Ad (q0 , q1 )]G , (23) e where we denote G e := (Q ×G)/G in analogy with the adjoint bundle [q0 , Ad (q0 , q1 )]G ∈ G, g̃. We note that (23) is the discrete counterpart of the isomorphism (6). DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 9 Remark 3.2. In the case Q = G, the isomorphism (23) is given by Ad (g0 , g1 ) = g0−1 g1 in view of property (3), which leads to the usual Euler-Poincaré discrete reduction as in [42]. ⋄ We consider the following extension of (23) in the case of HO tangent bundles, which is local for non-trivial bundles (see [24, 33] for more details): n o (k) e (k) , αAd : Q(k+1) /G −→ (Q/G)(k+1) ×Q/G G [q0 , ..., qk ]G 7−→ (π(q0 ), ..., π(qk )) ×Q/G k−1 M [q0 , Ad (qn , qn+1 )]G (24) n=0 (k+1) where Q denotes the Cartesian product of (k + 1)-copies of Q, (Q/G)(k+1) denotes e (k) denotes the sum of k-copies of the Cartesian product of (k + 1)-copies of (Q/G) and G (k+1,k) (k+1) e e (k) as the discretization of G. Consequently, we consider H := (Q/G) ×Q/G G (k) the space M , which is natural according to [1, 33, 40]. 3.3. Discrete constrained HO Lagrange-Poincaré equatons. In the following, we aim to derive the variational discrete flow obtained from a discretizacion of L and χα . Therefore, we shall work in local coordinates, particularly in the local trivialization of the principal bundle (20). The first task consists of obtaining the variational discretization of equations (14). For this, we must fix the discrete connection (19) and the discrete isomorphism (24). Next, (k) we can induce through Ad and αAd the discrete reduced HO Lagrangian and the discrete reduced HO constraints, (k+1,k) Ld : H (k+1,k) → R, and χα → R, d : H (25) for α = 1, ..., m. For a clear exposition, first we develop the first-order case, i.e. k = 1, in the next subsection, where the main objects employed in the HO case shall be introduced. 3.3.1. Discrete constrained Lagrange-Poincaré equations. We shall consider the discrete reduced Lagrangian and discrete reduced constraints: Ld : H (2,1) → R and (2,1) → R. χα d : H (26) e according to the notation introduced above. where H = ((Q/G) × (Q/G)) ×Q/G G e and Moreover, we will employ the trivialization (20) to fix a local representation of G, consequently of [q0 , q1 ]G ∈ (Q × Q)/G. Indeed, employing the discrete connection Ad and the isomorphism (23), we can make the following identification  π −1 (U ) × π −1 (U ) /G ∼ = ((U × G) × (U × G)) /G ∼ = U × U × G. (2,1) Moreover, one can prove that the map ((U × G) × (U × G)) /G −→ U × U × G, [(p0 , g0 ), (p1 , g1 )] 7−→ (p0 , p1 , Ad ((p0 , e), (p1 , g0−1 g1 ))) (27) = (p0 , p1 , g0−1 g1 A(p0 , p1 )), is a bijection (see [37]), where A:U ×U →G (28) is the local representation of the discrete connection as established in (22). Therefore, in this trivialization we can define the local coordinates an := [qn , qn+1 ]G = (pn , pn+1 , gn−1 gn+1 A(pn , pn+1 )), (29) where n is 0 or a positive integer. Lemma 3.3. The variations for an element an ∈ U ×U ×G defined in (29) are determined by δan := δ[qn , qn+1 ]G =(δpn , δpn+1 , −ηn Wn A(pn , pn+1 ) + Wn ηn+1 A(pn , pn+1 ) + Wn hD1 A(pn , pn+1 ), δpn i + Wn hD2 A(pn , pn+1 ), δpn+1 i), where Wn = gn−1 gn+1 ∈ G and δgn := gn ηn , with ηn ∈ g. (30) 10 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ Proof. We observe that δ[qn , qn+1 ]G = (δpn , δpn+1 , −gn−1 δgn gn−1 gn+1 A(pn , pn+1 ) + gn−1 δgn+1 A(pn , pn+1 ) + gn−1 gn+1 δA(pn , pn+1 )) (δpn , δpn+1 , −gn−1 δgn = + (31) gs−1 gn+1 A(pn , pn+1 ) gn−1 gn+1 hD1 A(pn , pn+1 ), δpn i + + gn−1 δgn+1 A(pn , pn+1 ) gn−1 gn+1 hD2 A(pn , pn+1 ), δpn+1 i) where, for i = 1, 2; Di A(pn , pn+1 ) is a one form on Tp∗j U taking values on TA(pn ,pn+1 ) G for j = n if i = 1 and j = n + 1 if i = 2, according to (28). Using Wn = gn−1 gn+1 ∈ G and δgn := gn ηn , with ηn ∈ g, then (31) can be rewritten as (30).  Given the grid {tn = nh | n = 0, . . . , N }, with N h = T , define the discrete path space Cd (U × U × G) := {γd : {tn }N n=0 → U × U × G}. This discrete path space is isomorphic to the smooth product manifold which consists of N + 1 copies of U × U × G (which is e locally isomorphic to N + 1 copies of ((Q/G × Q/G) ×Q/G ×G)). The discrete trajectory γd ∈ Cd (U × U × G) will be identified with its image, i.e. γd (tn ) = {an }N n=0 where an = (pn , pn+1 , gn−1 gn+1 A(pn , pn+1 )). Let us consider the reduced discrete Lagrangian Ld in (26). Define the discrete action sum, Sd : Cd (U × U × G) → R, by Sd (γd ) = N−1 X Ld ([qn , qn+1 ]G ) = N−1 X Ld (pn , pn+1 , gn−1 gn+1 A(pn , pn+1 )) (32) s=0 n=0 where the equality is established at a local level. From now on, we use the notation N−1 X An := A(pn , pn+1 ) and Sd (γd ) = Ld (an ). s=0 The discrete constrained variational problem associated with (26), consists of finding a discrete path γd ∈ Cd (U × U × G), given fixed boundary conditions, which extremizes the discrete action sum (32) subject to the discrete constraints χα d . This constrained optimization problem is equivalent to studying the (unconstrained) optimization problem e d : H (2,1) × Rm → R given by for the augmented Lagrangian L n α e d ([qn , qn+1 ]G , λn L α ) = Ld ([qn , qn+1 ]G ) + λα χd ([qn , qn+1 ]G ) (33) m n n are Lagrange multipliers. The associated action sum is where λn α = (λ1 , ..., λm ) ∈ R given by Sd (γ̃d ) = N−1 X n=0 e d ([qn , qn+1 ]G , λn L α) = N−1 X n=0 e d (pn , pn+1 , gn−1 gn+1 A(pn , pn+1 ), λn L α ), (34) where again the equality is given at a local level and γ̃d ∈ Cd (U × U × G × Rm ) := {γ̃d : m {tn }N n=0 → U ×U ×G×R } is the discrete augmented path space. We establish the result in the following theorem, where the discrete constrained Lagrange-Poincaré equations are obtained. N m Theorem 3.4. A discrete sequence {an , λn α }n=0 ∈ Cd (U × U × G × R ) is an extremum of the action sum (34), with respect to variations δ[qn , qn+1 ]G set in (30) and endpoint conditions δq0 = δqN = 0 where qj = (pj , gj ) (while the Lagrange multipliers are free), if it is a solution of the discrete constrained Lagrange-Poincaré equations (39). Proof. The poof will be divided into two parts. The first one consists on studying the variations of the action sum (32) associated with Ld . After that, our result follows by the e d instead of Ld incorporation of the constraints and Lagrange multipliers by considering L and (34) instead of (32). Taking variations on the discrete action sum (32) with q0 = (p0 , g0 ) and qN = (pN , gN ) fixed, which in terms of variations implies δp0 = δpN = 0 and δg0 = δgN = 0, the latter DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 11 leading to η0 = ηN = 0, and using the Lemma 3.3, we obtain δ N−1 X Ld (pn , pn+1 , Wn An ) = n=0 N−1 X hD1 Ld (an ) + D2 Ld (an−1 ) , δpn i n=1 + N−1 X n=1 − N−1 X ∗ ∗ RA−1 D3 Ld (an−1 )), ηn i hTW L −1 (TW n−1 An−1 n−1 W n−1 n−1 ∗ ∗ hTW RWn−1 (TW RA−1 D3 Ld (an )) , ηn i n n An n (35) n=1 + N−1 X ∗ hTW L −1 D3 Ld (an ), hD1 A(pn , pn+1 ), δpn ii n An Wn n=1 + N−1 X ∗ hTW L −1 D3 Ld (an−1 ), hD2 A(pn−1 , pn ), δpn ii, n−1 An−1 W n=1 n−1 where Di denotes the partial derivative with respect to the i-th variable, Rg , Lg : G → G ∗ are the left and right translations by the group variables, while Th∗ Rg : Th∗ G → Thg G, ∗ ∗ ∗ Th Lg : Th G → Tgh G are their cotangent action. Therefore, δSd = 0 for arbitrary variations implies D1 Ld (an ) + D2 Ld (an−1 ) + T ∗ L̂(W A1 ) (n)D3 Ld (an ) + T ∗ L̂(W A2 ) (n − 1)D3 Ld (an−1 ) = 0, (36a) ∗ TW L −1 n−1 W n−1 ∗ (TW RA−1 n−1 An−1 n−1 D3 Ld (an−1 )) − ∗ ∗ TW RWn−1 (TW D3 Ld (an )) RA−1 n n An n = 0, (36b) ∗ for n = 1, ..., N − 1, where we define locally the operator T L̂(W Ai ) by its action on T ∗ G. ∗ Namely, T ∗ L̂(W Ai ) (j) : TgA G → Tpj U for U ⊂ (Q/G) is defined by i ∗ hT ∗ L̂(g Ai ) (j)D3 Ld (a), δpj i := hTgA Lg−1 D3 Ld (a), hDi A, δpj ii, (37) where a ∈ U × U × G, a := (p0 , p1 , g A(p0 , p1 )), i = {1, 2} and j = i − 1 for each i. Let us ∗ ∗ RA−1 D3 Ld (an )) ∈ g∗ . It is easy to see that (36b) can be RWn−1 (TW define µn := TW n An n n rewritten in its dual version as µn = Ad∗Wn−1 µn−1 . (38) Next, we introduce constraints in our picture by considering the augmented Lagrangian (33) instead of Ld , which inserted into (35) leads to 0 =D1 Ld (an ) + D2 Ld (an−1 ) + T ∗ L̂(W A1 ) (n)D3 Ld (an ) n o α ∗ α + T ∗ L̂(W A2 ) (n − 1)D3 Ld (an−1 ) + λn α D1 χd (an ) + T L̂(W A1 ) (n)D3 χd (an ) n o ∗ α + λn−1 D2 χα α d (an−1 ) + T L̂(W A2 ) (n − 1)D3 χd (an−1 ) , (39) µn =Ad∗Wn−1 µn−1 0 =χα d (an ), − α λn α εn + λn−1 Ad∗Wn−1 εα n−1 , α α ∗ ∗ ∗ for n = 1, ..., N − 1, where we denote εα −1 (TW A R −1 D3 χd (an )) ∈ g . n := TWn RWn n n An  To obtain the discrete-time equations (39) we used the approach studied in [37]. That is, by using a discrete connection instead of deriving the local description of the curvature terms as in [24]. This approach automatically gives preservation of momentum and symplecticity since we employ a variational approach (see [37] for further details). Note that the first equation in (39) represents a discrete-time version of the second equation in (8) (or equivalently (9) in a local description) where the curvature terms are included in the terms that come from (37). The second equation represents the (constrained) Euler-Poincaré part (first equation in (39)) in (8), or (9) in the local representation. 12 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ ∗ α Next, define M(1,3) (an ) := D1 χα d (an ) + T L̂(W A1 ) (n)D3 χd (an ), where Di denotes the partial derivative with respect to the i-th component, while Dij = Di Dj = Dj Di . Equations (39) determine a numerical integrator giving rise to a unique (local) variational flow given an initial value on U × U × G × Rm under the following algebraic conditions: Proposition 3.1. Let Md be a regular submaniolfd of (U × U × G) given by Md = {an ∈ (U × U × G) χα d (an ) = 0}, where an is defined in (29). If the matrix    e d (an , λn ) D3 T ∗ L e d (an , λn ) b (W A ) (n)D3 L D12 L 1   D2 µn (an ) D3 µn (an ) T T (D2 χα (D3 χα d (an )) d (an )) M(1,3) (an )    ǫα n (an ) 0 is non singular for all an ∈ Md , there exists a neighborhood Uk ⊂ Md × Rm of (a∗n , λ0α∗ ) satisfying equations (39), and an unique (local) application ΥLd : Uk ⊂ Md × Rm → Md × Rm such that ΥLd (an , λ0α ) =(an+1 , λ1α ). Proof: It is a direct consequence of the implicit function theorem applied to equations (39).  Remark 3.5. In the case Q = G, (38) reduces to the usual discrete Euler-Poincaré equations [42]. In this case A = e, and therefore an = Wn . Thus, (36b) becomes ∗ ∗ TW L −1 L′d (Wn−1 ) − TW RWn−1 L′d (Wn ) = 0, n n−1 W n−1 ∗ RWn−1 L′d (Wn ), µn ∈ where denotes the derivative with respect to W . Setting µn := TW n ∗ ∗ g , we arrive at the discrete Lie-Poisson equations µn = AdWn−1 µn−1 . ⋄ ′ 3.3.2. Discrete constrained HO Lagrange-Poincaré equations: Next, we consider the HO case (25). According to (24) and (27), we can find local coordinates [q0 , q1 , ..., qk ]G in U (k+1) × Gk given by (p0 , ..., pk , ge0 , ge1 , ...., gek−1 ) , (40) −1 e where by gei := g gi+1 A(pi , pi+1 ) we denote the element of the i-th copy of G, for i = i 0, ..., k − 1 and U (k+1) denotes (k + 1)-copies of the neighborhood U ⊂ Q/G. The variation of the i-th copy of Q/G is given as before by δpi , for i = 0, ..., k; while the variation of e gi is given by δe gi = − ηi Wi Ai + Wi ηi+1 Ai + Wi hD1 Ai , δpi i + Wi hD2 Ai , δpi+1 i, gi−1 gi+1 (41) gi−1 δgi where we have set Wi = ∈ G, ηi = ∈ g and Ai := A(pi , pi+1 ). In the HO case, given the grid {tn = nh | n = 0, . . . , N }, with N h = T , the discrete path space is determined by   n o e k := γ̃d : {tn }N → U (k+1) × G ek . Cd U (k+1) × G n=0 The discrete space will be identified with its image, i.e. γ̃d (tn ) = {ãn }N n=0 , where we employ the notation ãn := (pn , pn+1 , ..., pn+k , g̃n , g̃n+1 , ..., g̃n+k−1 ). (42) We see that ãn is a (2k + 1)-tuple with 2k + 1 elements. This discrete path space is ek isomorphic to the smooth product manifold which consists of N + 1 copies of U (k+1) × G (which locally is isomorphic to N + 1 copies of (Q/G)(k+1) ×Q/G ×G̃k ). Let us define the discrete action sum associated with the HO Lagrangian Ld as Sd :  e k → R given by Cd U (k+1) × G Sd (γ̃d ) = N−k X Ld ([qn , qn+1 , ..., qn+k ]G ) = n=0 where the second equality is established at a local level. N−k X n=0 Ld (ãn ) (43) DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 13 The discrete constrained HO variational problem associated with (25), consists of finde k ), given fixed boundary conditions, which extreming a discrete path γ̃d ∈ Cd (U (k+1) × G izes the discrete action sum (43) subject to the discrete constraints χα d . This constrained optimization problem is equivalent to studying the (unconstrained) optimization problem e d : H (k+1,k) × Rm → R given by for the augmented Lagrangian L α e d ([qn , ..., qn+k ]G , λn ) := Ld ([qn , ..., qn+k ]G ) + λn L α χd ([qn , ..., qn+k ]G ), (44) n n m where λn are Lagrange multipliers, and its associated action sum is α = (λ1 , ..., λm ) ∈ R given by Sd (γ̂d ) = N−k X n=0 e d ([qn , ..., qn+k ]G , λn ) = L N−k X n=0 e d (ãn , λn L α ), (45) e k × Rm ) := where again the second equality is given at a local level and γ̂d ∈ Cd (U (k+1) × G N (k+1) k m e × R } is the discrete augmented path space. {γ̂d : {tn }n=0 → U ×G Regarding the endpoint conditions, we shall consider q(0,k−1) = (p(0,k−1) , g(0,k−1) ) and q(N−k+1,N) = (p(N−k+1,N) , g(N−k+1,N) ) fixed, where q(0,k−1) = {q0 , q1 , ..., qk−1 }, q(N−k+1,N) = {qN−k+1 , qN−k+2 , ..., qN }, and analogously for any sequence. In terms of variations this implies δp(0,k−1) = δp(N−k+1,N) = 0 and δg(0,k−1) = δg(N−k+1,N) = 0, the latter leading to η(0,k−1) = η(N−k+1,N) = 0. Furthermore, the Lagrange multipliers are set freely as in the first order case. We establish the result in the following theorem, where the discrete constrained HO Lagrange-Poincaré equations are obtained. As in the case of Theorem 3.4, our proof strategy consists in studying the unconstrained problem (43), and afterwards adding the constraints (44). N (k+1) e k × Rm ) is an extremum ×G Theorem 3.6. A discrete sequence {ãn , λn α }n=0 ∈ Cd (U of the action sum (45), with respect to variations δ[qn , ..., qn+k ]G defined in (41) and endpoint conditions expressed above, if it is a solution of the discrete constrained HO Lagrange-Poincaré equations (47). Proof. In the proof we will employ the index i for the k + 1 first elements, i.e. the p coordinates, and the index z for the last k, i.e. the e g coordinates. Taking variations in (43), according to the endpoint conditions detailed above and the variations (41) we obtain: δ N−k X Ld (ãn ) = N−k X n=0 n=0 = k+1 X hDi Ld (ãn ), δpi i + i=1 N−k X X k+1 2k+1 X hDz Ld (ãn ), δe gz i z=k+2 ! (46) hDi Ld (ãn ), δpi i n=0 i=1 + N−k X 2k+1 X n=0 z=k+2  ∗ ∗ hTW RWz−1 (TW RA−1 Dz Ld (ãn )), −ηz i z z Az z ∗ ∗ +hTW (TW L Dz Ld (ãn )), ηz+1 i RA−1 z Wz−1 z Az z ∗ +hTW L Dz Ld (ãn ), hD1 Az , δpz ii z Az Wz−1 ∗ +hTW LWz−1 Dz Ld (ãn ), hD2 Az , δpz+1 ii z Az  where we have employed (41). Next, we assume that the z-th component, for z = k + 2, ..., 2k + 1, is labeled by n + z − k − 2 and rearranging the sum above after taking into account the endpoint conditions we obtain: 14 δ A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ N−k X Ld (ãn ) = N−k X X k+1 h Di Ld (ãn−i+1 ), δpn i n=k i=1 n=0 + N−k X h− N−k X h 2k+1 X ∗ ∗ TW L −1 (TW RA−1 Dz Ld (ãn−z+k+1 )), ηn i n−1 W n−1 An−1 n−1 n=k z=k+2 + N−k X ∗ ∗ TW RWn−1 (TW RA−1 Dz Ld (ãn−z+k+2 )), ηn i n n An n z=k+2 n=k + 2k+1 X h 2k+1 X n=k z=k+2  n−1 T ∗ L̂W A1 (n)Dz Ld (ãn−z+k+2 )  +T ∗ L̂W A2 (n − 1)Dz Ld (ãn−z+k+1 ) , δpn i, where the operator T ∗ L̂W Ai (n) is defined in (37). Equating this variation to zero and considering that δpn and ηn are free for k ≤ n ≤ N − k, we arrive at the discrete equations of motion: 0= k+1 X Di Ld (ãn−i+1 ) i=1 + 2k+1 X z=k+2 0= 2k+1 X z=k+2    T ∗ L̂W A1 (n)Dz Ld (ãn−z+k+2 ) + T ∗ L̂W A2 (n − 1)Dz Ld (ãn−z+k+1 ) , ∗ ∗ TW RWn−1 (TW RA−1 Dz Ld (ãn−z+k+2 )) n n An n  ∗ ∗ −TW L −1 (TW RA−1 Dz Ld (ãn−z+k+1 )) , n−1 W n−1 An−1 n−1 n−1 for k ≤ n ≤ N − k. The second equation may be rewritten in a more compact way in its dual version by making the following identifications ∗ G for k + 2 ≤ z ≤ 2k + 1, - µ̃zn := Dz Ld (ãn−z+k+2 ) ∈ TW n An 2k+1 X z ∗ µ̃n ∈ TW G, - M̃n := n An z=k+2 ∗ ∗ M̃n ) ∈ g∗ , RA−1 RWn−1 (TW - Mn := TW n An n n which leads to the equation Mn = Ad∗Wn−1 Mn−1 , k ≤ n ≤ N − k. Next, introducing constraints into our picture by considering the augmented Lagrangian (44) we find the discrete constrained HO Lagrange-Poincaré equations DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 0= k+1 X Di Ld (ãn−i+1 ) + T ∗ L̂W A1 (n) i=1 2k+1 X 15 Dz Ld (ãn−z+k+2 ) z=k+2 + T ∗ L̂W A2 (n − 1) 2k+1 X Dz Ld (ãn−z+k+1 ) + 2k+1 X n−i+1 λα Di χα d (ãn−i+1 ) i=1 z=k+2 + T ∗ L̂W A1 (n) k+1 X n−z+k+2 λα Dz χα d (ãn−z+k+2 ) z=k+2 + T ∗ L̂W A2 (n − 1) 2k+1 X n−z+k+1 λα Dz χα d (ãn−z+k+1 ), z=k+2 Mn =Ad∗Wn−1 Mn−1 − 2k+1 X n−z+k+2 α λα ε(n,z) + Ad∗Wn−1 z=k+2 (47) 2k+1 X n−z+k+1 α λα ε(n−1,z) , z=k+2 0 =χα d (ãn ), for k ≤ n ≤ N − k, where we define ∗ ∗ α ∗ εα −1 (TWn An R −1 Dz χd (ãn−z+k+2 )) ∈ g . (n,z) := TWn RWn An  As in the first order case, a direct consequence of the implicit function theorem applied to (47) is the existence of the (local) variational flow for the numerical method. ∗ α Denoting M(1,k+2) (ãn ) := D1 χα d (ãn ) + T L̂(W A1 ) (n)Dk+2 χd (ãn ) we arrive at the following proposition. e d be a regular submanifold of U (k+1) × Gk given by Proposition 3.2. Let M e d = {ãn ∈ U (k+1) × Gk χα M d (ãn−j ) = 0 for all j = 0, . . . , k} where ãn is of the form (42). If the matrix    e d (ãn , λn ) D2k+1 T ∗ L e d (ãn , λn ) b (W A ) (n)Dk+2 L D(1,k+1) L 1   Dk+1 Mn (ãn ) D2k+1 Mn (ãn ) T T (Dk+1 χα (D2k+1 χα d (ãn )) d (ãn ))  M(1,k+2) (ãn )   εα (n,k+2) (ãn ) 0 e d , there exists a neighborhood Vk ⊂ M e d × kRm of γ ∗ = is non singular for all ãn ∈ M ∗ ∗ n−k n−1 (ãn−k , . . . , ãn−1 , λα∗ , . . . , λα∗ ) satisfying equations (47), and an unique (local) applicae d × kRm → M e d × kRm such that e L : Vk ⊂ M tion Υ d e L (ãn−k , . . . , ãn−1 , λn−k Υ , . . . , λn−1 ) =(ãn−k+1 , . . . , ãn , λn−k+1 , . . . , λn α α α α ). d Observe that when k = 1 equations (47) are the discrete constrained Lagrange-Poincaré equations (39) and the regularity condition given in Proposition 3.2 is the one obtained in Proposition 3.1. Remark 3.7. In [22] it has been shown that under a regularity condition equivalent to the one given in Proposition 3.2, the discrete constrained system preserves the symplectic 2form (see Remark 3.4 in [22]). Therefore the methods that we are deriving in this work are automatically symplectic methods. Moreover, under a group of symmetries preserving the discrete Lagrangian and the constraints, we additionally obtain momentum preservation. In the case when the principal bundle is a trivial bundle, and therefore the terms associated with the connection and curvature are zero, we obtain the same results as [18]. ⋄ 16 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ 4. Application to optimal control of underactuated systems Underactuated mechanical system are controlled mechanical systems where the number of the control inputs is strictly less than the dimension of the configuration space. In this section we consider dynamical optimal control problems for a class of underactuated mechanical systems determined by Lagrangian systems on principal bundles. We assume that we are only allowed to have control systems that are controllable, that is, for any two points q0 and qT in the configuration space, there exists an admissible control defined on some interval [0, T ] such that the system with initial condition q0 reaches the point qT in time T (see [2] for more details). Let L : T Q → R be a G-invariant Lagrangian inducing a reduced Lagrangian L : M → g and (p, ṗ, σ) are local coordinates on an open set Ω ⊂ M . R where M := T (Q/G) ×Q/G e Consider the control manifold U ⊆ Rr where r < dim Q and u ∈ U is the control input (control parameter) which in coordinates reads u = (u1 , . . . , ur ) ∈ Rr . We denote by Γ(M ∗ ) the space of sections of a smooth manifold, M ∗ := T (Q/G)∗ ×Q/G ∗ e g and consider a set of linearly independent sections B a = {(η a , ηea )} ∈ Γ(M ∗ ), such that ∗ η a ([q]G ) ∈ T[q] (Q/G); ηea ([q]G ) ∈ e g∗ for a = 1, . . . , r and [q]G ∈ τ (Ω) ⊂ Q/G, where G a a τ : M → Q/G. Therefore η ⊕ ηe ∈ Γ(M ∗ ). Definition 4.1. The reduced controlled Euler-Lagrange equations or controlled LagrangePoincaré equations are   E D ∂L ∂L D ∂L e = ua η a ([q]G ), (48a) − + , iṗ B Dt ∂ ṗ ∂p ∂σ   D ∂L − ad∗σ = ua ηea ([q]G ). (48b) Dt ∂σ A controlled Lagrange-Poincaré system is a controlled mechanical systems whose dynamics is given by the controlled Lagrange-Poincaré equations (48). We refer to a controlled decoupled Lagrange-Poincaré system when equations (48a)(48b) can be written as a system of equations of the form  E E D D E D D  ∂L  ∂L D ∂L ∂L e , ηa + − ; iṗ B − ad∗σ , ηea = ua , − (49a) Dt ∂ ṗ ∂p ∂σ Dt ∂σ     D D ∂L E D D E E ∂L ∂L D ∂L e , ηα + (49b) − ; iṗ B − ad∗σ , ηeα = 0, − Dt ∂ ṗ ∂p ∂σ Dt ∂σ that is, a controlled Lagrange-Poincaré system is written as a control system showing which configurations are actuated and which ones unactuated. The next Lemma shows that a controlled Lagrange-Poincaré system always permits a description for the controlled dynamics as a controlled decoupled Lagrange-Poincaré system. Lemma 4.2. A controlled Lagrange-Poincaré system defined by (48) is equivalent to the controlled decoupled Lagrange-Poincaré system described by (49). Proof. Given that B a = {(η a , ηea )}, are independent elements of Γ(M ∗ ) we complete B a to be a basis of Γ(M ∗ ), i.e. {B a , B α }, and take its dual basis {Ba , Bα } on Γ(M ). If we set Ba = {(ηa , ηea )} and Bα = {(ηa , ηeα )}, where ηa , ηα ∈ X(Q/G) and ηea , ηeα ∈ Γ(e g), we obtain the relationships hη a , ηb i = δba , hη a , η̃b i = hη a , ηβ i = hη a , η̃β i = 0, hη̃ a , η̃b i = δba , hη̃ a , ηβ i = hη̃ a , η̃β i = 0, hη α , ηβ i = δβα , hη̃ α , η̃β i = 0, hη̃ α , η̃β i = δβα . Coupling (48a) to ηa and (48b) to η̃a , and adding up the results we obtain (49a). Equivalently, if we couple (48a) to ηα and (48b) to η̃α , and add up the resultants we obtain (49b).  DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 17 Remark 4.3. Observe that (49a) provides an expression of the control inputs as a function on the second-order tangent bundle M (2) locally described by coordinates (p, ṗ, p̈, σ, σ̇), ua = Fa (p, ṗ, p̈, σ, σ̇) =  D D  ∂L  ∂L D ∂L E E D D E ∂L e , ηa + − − ; iṗ B − ad∗σ , ηea . Dt ∂ ṗ ∂p ∂σ Dt ∂σ (50) ⋄ Next we consider an optimal control problem. Definition 4.4 (Optimal control problem). Find a trajectory γ(t) = (p(t), σ(t), u(t)) of the state variables and control inputs satisfying (48), subject to boundary conditions (p(0), ṗ(0), σ(0)) and (p(T ), ṗ(T ), σ(T )), and minimizing the cost functional Z T J(s(2,1) , u) = C(s(2,1) (t), u(t)) dt 0 for a cost function C : M × U → R. Solving the optimal control problem is equivalent to solving a constrained second-order variational problem [5], with Lagrangian L̂ : M (2) → R locally described by   b (2,1) ) := C s(1,0) , Fa (s(2,1) ) , L(s (51) where C is the cost function and Fa is defined in (50); and subject to the constraints χα : M (2) → R given by  D d  ∂L  ∂L D ∂L E D D E E ∂L α (2,1) ∗ e χ (s )= (52) − ; iṗ B , ηα + − adσ , ηeα , − dt ∂ ṗ ∂p ∂σ Dt ∂σ equivalent to equation (49b). Then, given boundary conditions, normal extrema for the optimal control problem are determined by the solutions of the constrained second-order Lagrange-Poincaré equations for the Lagrangian (51) subject to (52). The resulting equations of motion are a set of combined third order and fourth order ordinary differential equations. Motivated by the examples that we study in the next section, we restrict ourself to a particular class of these control problems where we assume full controls in the base manifold Q/G, that is, using Lemma 4.2, we consider the controlled Lagrange-Poincaré equations, in a local trivialization πU : U × G → U of the principal bundle π : Q → Q/G, i.e. d ∂L ∂L δ − (C δ σ γ − Cγβ Aγǫ ṗǫ ) = 0, (53a) dt ∂σ β ∂σ β γβ d ∂L ∂L ∂L b c b − − (Bca ṗ + Cde σ d Aea ) = ua . (53b) ∂pa dt ∂ ṗa ∂σ b In this context, the optimal control problem consists of finding a solution of the state variables and control inputs for the previous equations (53) given boundary conditions and minimizing the cost functional  Z T  d ∂L ∂L (2,1) a a a ∂L b c b d e J(s )= C p , ṗ , σ , a − − (B ṗ + Cde σ Aa ) dt. ∂p dt ∂ ṗa ∂σ b ca 0 A normal extremal for the optimal control problem is characterized by the constrained second-order variational problem determined by the second-order Lagrangian   b c b d e b (2,1) ) = C pa , ṗa , σ a , ∂L − d ∂L − ∂L (Bca L(s ṗ + C σ A ) (54) de a ∂pa dt ∂ ṗa ∂σ b subject to the second-order constraints ∂L d ∂L δ δ − (Cγβ σ γ − Cγβ Aγǫ ṗǫ ) (55) χα (s(2,1) ) = dt ∂σ β ∂σ β whose solutions satisfy the constrained second-order Lagrange-Poincaré equations for e (2,1) , λα ) = L(s b (2,1) ) + λα χα (s(2,1) ) with λα ∈ Rm the Lagrange multipliers. L(s Those equations are in general given by a set of fourth order nonlinear ordinary differential equations which are very difficult to solve explicitly. Thus, constructing numerical methods is in order, a task for which the results in the previous sections must be implemented. 18 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ Given discretizations of (54) and (55), denoted Ld and χα d respectively, defined on 3U × 2 G, with local coordinates ãn = (pn−2 , pn−1 , pn , gen−2 , e gn−1 ), e gi := gi−1 gi+1 A(pi , pi+1 ), 2 ≤ n ≤ N − 2, the associated discrete optimal control problem consist of obtaining the sequences {pn }0:N , {g̃n }0:N and {λn }0:N from the second-order constrained discrete Lagrange-Poincaré equations, i.e. (47) for k = 2. By Theorem 3.6, the discrete constrained second-order Lagrange-Poincaré equations are given by 0 =D1 Ld (ãn ) + D2 Ld (ãn−1 ) + D3 Ld (ãn−2 ) + T ∗ L̂W A1 (n)(D4 Ld (ãn ) + D5 Ld (ãn−1 )) α n−1 D2 χα + T ∗ L̂W A2 (n − 1)(D4 Ld (ãn−1 ) + D5 Ld (ãn−2 )) + λn α D1 χd (ãn ) + λα d (ãn−1 ) n α n−1 ∗ D5 χα + λn−2 D3 χα d (ãn−1 )) α d (ãn−2 ) + T L̂W A1 (n)(λα D4 χd (ãn ) + λα n−2 D4 χα D5 χα + T ∗ L̂W A2 (n − 1)(λn−1 α d (ãn−1 ) + λα d (ãn−2 )), 0 =Mn − 0 Ad∗Wn−1 Mn−1 =χα d (ãn ), 0= + λn α εα (n,4) + λn−1 α (56) εα (n,5) n−2 α − Ad∗Wn−1 (λn−1 εα ε(n−1,5) ), α (n−1,4) + λα (57) χα d (ãn−1 ), (58) 0= χα d (ãn−2 ), for 2 ≤ n ≤ N − 2, and where ∗ ∗ Mn =TW RWn−1 (TW RA−1 (D4 Ld (ãn ) + D5 Ld (ãn−1 ))), n n An n εα (n,4) ∗ ∗ =TW RWn−1 (TW RA−1 D4 χα d (ãn )), n n An n ∗ ∗ α εα −1 (TWn An R −1 D5 χd (ãn−1 )), (n,5) =TWn RWn An ∗ ∗ α εα (n−1,4) =TWn−1 RW −1 (TWn−1 An−1 RA−1 D4 χd (ãn−1 )), n−1 n−1 α ∗ ∗ εα (n−1,5) =TWn−1 RW −1 (TWn−1 An−1 RA−1 D5 χd (ãn−2 )). n−1 n−1 By Proposition 3.2 the equations given above determine (locally) the flow map for the numerical method: they indicate how to obtain ãn and λn given ãn−1 , ãn−2 , λn−1 , λn−2 if the matrix     e d (ãn , λn ) D5 T ∗ L e d (ãn , λn ) b (W A ) (n)D4 L D13 L M(1,4) (ãn ) 1     D3 Mn (ãn ) D5 Mn (ãn ) εα (n,4) (ãn ) T T α α 0 (D5 χd (ãn )) (D3 χd (ãn )) ∗ α is non singular, where M(1,4) (ãn ) := D1 χα d (ãn ) + T L̂(W A1 ) (n)D4 χd (ãn ). 4.1. Examples. 4.1.1. Optimal control of an electron in a magnetic field. We study the optimal control problem for the linear momentum and charge of an electron of mass m in a given magnetic field (see [2] Section 3.9). One of the motivations for constructing structure preserving variational integrators for this example is that the charge is a conserved quantity and our method, since it is variational, preserves the momentum map associated with a Lie group of symmetries. Let M be a 3 dimensional Riemannian manifold and π : Q → M be a circle bundle (that is, S1 acts on Q on the left and then π : Q → M is a principal bundle where M = Q/S1 ) with respect to a left SO(2) action. We will use the isomorphism (as Lie group) of SO(2) and S1 to make our analysis consistent with the theory. Let A : T Q → so(2) be a principal connection on Q and consider the Lagrangian on T Q given by m e L(q, q̇) = ||T π(q, q̇)||2M + ||A(q, q̇)||2so(2) − φ(π(q)), 2 c where e is the charge of the electron, c is the speed of light, || · ||so(2) : so(2) → R the p norm on so(2), given by kξkso(2) = hhξ, ξii1/2 = tr(ξ T ξ), for any ξ ∈ so(2) where the inner product on so(2) is given by hhξ, ξii = tr(ξ T ξ). φ : M → R represents the potential energy and · denotes the left-action of S1 on Q. Note that in the absence of potential, L is a Kaluza-Klein Lagrangian type (see [17] for instance). The motivation for including a potential function in our analysis is twofold. Firstly, it is inspired by possible further applications including static obstacles in the workspace. DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 19 We use φ as a artificial potential function (for instance a Coloumb potential) to avoid the obstacle. Secondly, it is motivated by use of this example in the theory of controlled Lagrangians and potential shaping for systems with breaking symmetries. Note that here V is not invariant under the symmetry group (see [2] Section 4.7) for more details. Note also that π(θ · q) = π(q) for all q ∈ Q and θ ∈ S1 . Thus m e ||T π(θ · (q, q̇))||2M + ||A(θ · (q, q̇))||2so(2) − φ(π(θ · q)) 2 c e m = ||T π(q, q̇)||2M + ||Adθ · A(q, q̇)||2so(2) − φ(π(q)) 2 c m e = ||T π(q, q̇)||2M + ||A(q, q̇)||2so(2) − φ(π(q)) 2 c = L(q, q̇) L(θ · (q, q̇)) = where Adθ =Idso(2) because SO(2) is Abelian. That is, L is SO(2)-invariant and we may perform Lagrange-Poincaré reduction by symmetries to get the equations of motion on the principal bundle T Q/SO(2). Fixing the connection A on Q, we can use the principal connection A to get an isomore phism αA : T Q/SO(2) → T M ⊕ so(2) which permits us to define the reduced Lagrangian e m ||ẋ||2M + ||ξ||2so(2) − φ(x). 2 c For the reduced Lagrangian ℓ, the dynamics is determined by the Lagrange-Poincaré equations (8), in this particular case ℓ(x, ẋ, ξ) = m Dẋ♭ e ẋ(t), ·)i + dφ = hµ, B( Dt D µ=0 Dt ∂ℓ e : T M ∧ T M → so(2) is the reduced where µ = ∂ξ is the charge of the particle. Here, B curvature tensor associated with the connection form A, d is the exterior differential and ♭ : g → g∗ is the associated isomorphisms to the inner product defined by the metric (see [2] and [10] for instance). Note that this equation corresponds with Wong’s equations [17]. In the case where Q = R3 × S1 the Lagrangian is m 2 e ẋ + (A(x, ẋ) + θ̇)2 − φ(x). 2 c In this case, we have that T Q/SO(2) ≃ R3 × R where AdQ = R and the reduced Lagrangian is e m L(x, ẋ, ξ) = ẋ2 + ξ 2 − φ(x). 2 c The above equations reduce to the Lorentz force law describing the motion of a charged particle of mass m in a magnetic field under the influence of a potential function → − e mẍ + ∇φ(x) = (ẋ × B ), µ̇ = 0, c → − ∂ℓ = 2e ξ and B = (Bx , By , Bz ) ∈ X(R3 ). where µ = ∂ξ c Next, we introduce controls in our picture. Let U ⊂ R3 , where u = (u1 , u2 , u3 ) ∈ U are the control inputs. Then, given u(t) ∈ U , the controlled decoupled Lagrange-Poincaré system (49) is given by L(x, ẋ, θ, θ̇) = m Dẋ♭ e ẋ(t), ·)i = u(t), + dφ − hµ, B( Dt D µ = 0. Dt If Q = R3 ×S1 then the above system becomes the controlled decoupled Lagrange-Poincaré system describing the controlled dynamics of a charged particle of mass m in a magnetic field under the influence of a potential function: 20 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ → − e mẍ + ∇φ(x) − (ẋ × B ) = u(t) c µ̇ = 0. The optimal control problem consists of finding trajectories of the state variables and controls inputs, satisfying the previous equations subject to given initial and final conditions and minimizing the cost functional, min (x,ẋ,ξ,u) Z T C(x, ẋ, ξ, u)dt = 0 min (x,ẋ,ξ,u) 1 2 Z T ||u||2 dt 0 where the norm || · || represents the Euclidean norm on R3 . This optimal control problem is equivalent to solving the following constrained secondorder variational problem given by → − 1 e b L(x, ẋ, ẍ, ξ, ξ̇) = mẍ + ∇φ(x) − (ẋ × B ) 2 c (x,ẋ,ẍ,ξ,ξ̇) min 2 , (59) ξ̇. subject to the constraint χ(x, ẋ, ẍ, ξ, ξ̇) = 2e c For a simple exposition of the resulting equations describing necessary conditions for the existence of normal extrema in the optimal control problem, we restrict our analysis to the particular case when the magnetic field is aligned with the x3 -direction and orthogonal → − to the x1 − x2 plane, that is, B = (0, 0, Bz ) with Bz constant, and the potential field is quadratic φ = (x21 + x22 + x23 ). The constrained second-order Lagrange-Poincaré equations are (iv) x1 (iv) x2 (iv) x3   4 4ω 4x1 ... 2 = 2ω x 2 + ẍ1 ω − + ẋ2 − 2 , m m m   4 4 4ω ... = −2ω x 1 + ẍ2 ω 2 − ẋ1 − 2 x2 , − m m m 4ẍ3 4x3 =− − 2, m m (60a) (60b) (60c) z where ω = eB , λ(t) is constant and ξ(t) = 2e . ξ(t) comes from the integration of the mc c constraint and λ(t) is obtained from 2e λ̇ = 0, the Lagrange-Poincaré equation arising c from ξ(t) (note that we obtain the same result for the multiplier as in [2] Section 7.5.) In terms of the discretization of this system as presented in Section 3.2, we need to define the discrete connection (19), but given that the bundle is trivial, the connection vanishes. Denoting by (xn , ξn ) = (x1n , x2n , x3n , ξn , ξn+1 ), the discrete second order Lagrangian for the reduced optimal control problem corresponding to (59), is given by → b d (xn , xn+1 , xn+2 , ξn ) = h m xn+2 − 2xn+1 + xn + ∇φ(xn ) − e xn+1 − xn × − B (xn ) L 2 h2 c h 2e χd (xn , xn+1 , xn+2 , ξn ) = (ξn+1 − ξn ), hc 2 , → − where B (xn ) := (B1 (x1n ), B2 (x2n ), B3 (x3n )). By Theorem 3.6 the discrete second-order constrained Lagrange-Poincare equations giving rise to the integrator which approximates the necessary conditions for optimality DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 21 in the optimal control problem are given by x2 − 3x2n + 3x2n−1 − x2n−2 x1n+2 − 4x1n+1 + 6x1n − 4x1n−1 + x1n−2 = 2ω n+1 4 h h3   4 x1n+1 − 2x1n + x1n−1 + ω2 − m h2 (61a) 4ω x2n − x2n−1 4 − 2 x1n , m h m x1 − 3x1n + 3x1n−1 − x1n−2 = −2ω n+1 (61b) h3   2 2 2 4 xn+1 − 2xn + xn−1 + ω2 − m h2 + x2n+2 − 4x2n+1 + 6x2n − 4x2n−1 + x2n−2 h4 4ω x1n − x1n−1 4 − 2 x2n , m h m x3n+2 − 4x3n+1 + 6x3n − 4x3n−1 + x3n−2 4 x3n+2 − 2x3n + x3n−1 4 = − − 2 x3n , (61c) h4 m h2 m 2e 2e 2e together with hc (ξn+1 − ξn ) = 0, hc (ξn − ξn−1 ) = 0, hc (ξn−1 − ξn−2 ) = 0 and λn = λn−1 for n = 2, . . . , N − 2. We observe that (61a), (61b) and (61c) are a discretization in finite differences of (60a), (60b) and (60c), respectively.1 − 4.1.2. Energy minimum control of two coupled rigid bodies: We consider a discretization of the energy minimum control for the motion planning of an underactuated system composed by two planar rigid bodies attached at their center of mass and moving freely in the plane, also known in the literature as Elroy’s beanie (see [36], [46] for details) which is an example of a dynamical system with a non-Abelian Lie group of symmetries. The configuration space is Q = SE(2)×S1 with local coordinates denoted by (x, y, θ, ψ). The Lagrangian function L : T Q → R is given by 1 1 1 L(x, y, θ, ψ, ẋ, ẏ, θ̇, ψ̇) = m (ẋ2 + ẏ 2 ) + I1 θ̇2 + I2 (θ̇ + ψ̇)2 − V (ψ), (62) 2 2 2 where m denotes the mass of the system, I1 and I2 are the inertias of the first and the second body, respectively, and V is the potential energy. Note that the system is invariant under SE(2). After choosing a decomposition determined by the metric on Q which describes the kinetic energy of the Lagrangian (62) (see [36] and [46] for details) one can fix a connection A : T (SE(2) × S1 ) → se(2), with local expression   I2 1 0 y y I1 +I2   2 x , A = 0 1 −x − I1I+I (63) 2 I2 0 0 1 I1 +I2 and vanishing curvature. Consider the base of se(2) denoted by {ēa } with a = 1, 2, 3 and given by " 0 " 0 0 0 # " 0 0 1 # 1 0 # ē1 = 0 0 0 , ē2 = 0 0 1 , ē3 = −1 0 0 . 0 0 0 0 0 0 0 0 0 In terms of this basis, ξ ∈ se(2) can be written as ξ = ξ 1 ē1 + ξ 2 ē2 + ξ 3 ē3 with ξ 1 = 2 cos θẋ + sin θẏ, ξ 2 = sin θẋ + cos θẏ and ξ 3 = −θ̇ − I1I+I ψ̇. Moreover, since [ē1 , ē2 ] = 0, 2 1Considering the forward difference straightforward to check that xn+4 xn+1 −xn h as a first order discretization of the velocity ẋ, it is xn+2 − 2xn+1 + xn , h2 xn+3 − 3xn+2 + 3xn+1 − xn , h3 − 4xn+3 + 6xn+2 − 4xn+1 + xn , h4 ... are discretization of ẍ, x and x(iv) , respectively. The shift of the n index present in equations (61) comes from the particular expression of the discrete constrained HO Lagrange-Poincaré equations provided in Theorem 3.6. 22 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ [ē1 , ē3 ] = ē2 and [ē2 , ē3 ] = −ē1 , then the non-vanishing constant structures of the Lie 2 1 2 1 algebra se(2) are C13 = C32 = 1 and C31 = C23 = −1. 1 e The isomorphism (6), αA : T (SE(2) × S )/SE(2) → T S1 × se(2) is αA (ψ, ψ̇, ξ) = (ψ, ψ̇, ξ + Ae (ψ)ψ̇), with Ae (ψ) = (0, 0, I2 )T I1 +I2 (Ae : U ⊂ S1 → se(2) is a 1-form determined by Ae (ψ)ψ̇ = 2 . A(ψ, e, ψ̇, 0)). Ae is locally prescribed by the coefficients A11 = A21 = 0 and A31 = I1I+I 2 1 e The reduced Lagragian (see [36, 46] for details) L : T S ⊕ se(2) → R is given by L(ψ, ψ̇, Ω) = 1 1 1 I1 I2 ψ̇ 2 − V (ψ), m(Ω21 + Ω22 ) + (I1 + I2 ) Ω23 + 2 2 2 I1 + I2 (64) e where (ψ, ψ̇) are local coordinates for T S1 and Ω for se(2), such that Ω1 = ξ 1 , Ω2 = ξ 2 I2 3 3 and Ω = ξ + I1 +I2 ψ̇, for ξ ∈ se(2), and consequently we observe that Ω1 = cos θ ẋ + sin θ ẏ, (65a) 2 (65b) 3 (65c) Ω = − sin θ ẋ + cos θ ẏ, Ω = − θ̇. The local Lagrange-Poincaré equations (9) in the (ψ, ψ̇, Ω) coordinates read   I2 ψ̇ , Ω̇1 =Ω2 Ω3 − I1 + I2   I2 2 1 3 Ω̇ = − Ω Ω − ψ̇ , I1 + I2 (66a) (66b) Ω̇3 =0, (66c) I1 I2 ∂V ψ̈ = − . I1 + I2 ∂ψ (66d) Now, we introduce a control input in the equation corresponding to S1 , i.e. (66d), namely I1 I2 ψ̈ = −∂ψ V (ψ) + u. (67) I1 + I2 As discussed in the previous subsection, the optimal control problem consists of finding trajectories of the state variables and control inputs, satisfying the equations (66a), (66b), (66c) and (67), subject to boundary conditions and minimizing the cost functional RT C(ψ, ψ̇, Ω, u)dt. In particular we are interested in energy-minimum problems, where 0 the cost function is of the form 1 C(ψ, ψ̇, Ω, u) = u2 . (68) 2 This optimal control problem is equivalent to solving the constrained second-order varib : T (2) S1 ⊕ 2se(2) e ational problem defined by the Lagrangian L → R and the constraints α (2) 1 e χ : T S ⊕ 2se(2) → R, α = 1, 2, 3, defined by 2  I1 I2 1 b ψ̈ + ∂ψ V (ψ) L(ψ, ψ̇, ψ̈, Ω, Ω̇) = 2 I1 + I2 I2 1 χ (ψ, ψ̇, ψ̈, Ω, Ω̇) =Ω̇1 − Ω2 Ω3 + ψ̇ Ω2 , I1 + I2 I2 ψ̇ Ω1 , χ2 (ψ, ψ̇, ψ̈, Ω, Ω̇) =Ω̇2 + Ω1 Ω3 − I1 + I2 χ3 (ψ, ψ̇, ψ̈, Ω, Ω̇) =Ω̇3 , e where (ψ, ψ̇, ψ̈) are local coordinates for T (2) S1 and (Ω, Ω̇) for 2se(2). Next, define the e b augmented Lagrangian L(ψ, ψ̇, ψ̈, Ω, Ω̇) = L(ψ, ψ̇, ψ̈, Ω, Ω̇) + λα χα (ψ, ψ̇, ψ̈, Ω, Ω̇), that is,  2   1 I2 I1 I2 e L(ψ, ψ̇, ψ̈, Ω, Ω̇, λ1 , λ2 , λ3 ) = ψ̈ + ∂ψ V (ψ) + λ1 Ω̇1 − Ω2 Ω3 + ψ̇ Ω2 2 I1 + I2 I1 + I2   I2 ψ̇ Ω1 + λ3 Ω̇3 . (69) + λ2 Ω̇2 + Ω1 Ω3 − I1 + I2 DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 23 The constrained second-order Lagrange-Poincaré equations determining necessary conditions for the optimal control problem (given in Remark 2.6) are the following fourth-order nonlinear system of equations:     I2 I2 I1 I2 + λ2 Ω2 Ω3 − Ω̇1 − Ω2 ψ̇ (70a) ψ (iv) =λ1 Ω1 Ω3 + Ω̇2 − Ω1 ψ̇ I1 + I2 I1 + I2 I1 + I2     ∂V I1 I2 (I1 + I2 ) ∂ 2 V d2 ∂V ψ̈ + − , − 2 dt ∂ψ I2 ∂ψ 2 I1 + I2 ∂ψ     I2 ψ̈ λ1 I 2 ψ̇I2 λ̈1 =λ2 Ω̇3 − + 2ψ̇Ω3 − (Ω3 )2 − , (70b) I1 + I2 I1 + I2 I1 + I2     ψ̈I2 I2 λ̇1 ψ̇I2 (1 − λ2 ) λ̈2 =λ1 − Ω̇3 + − λ2 (Ω3 )2 − ψ̇ Ω̇3 (70c) I1 + I2 I1 + I2 I1 + I2   I2 ψ̇ λ22 ψ̇ Ω3 − , + I1 + I2 I1 + I2   I2 2 2 1 1 1 2 λ̈3 =Ω (λ̇2 − 2λ̇1 ) − λ1 Ω̇ + λ1 Ω̇ + λ̇2 Ω + (λ1 Ω + λ2 Ω ) Ω3 − ψ̇ I1 + I2 (70d) I2 ψ̇ Ω2 , I1 + I2 I2 Ω̇2 = − Ω1 Ω3 + ψ̇ Ω1 , I1 + I2 Ω̇3 = 0, Ω̇1 = Ω2 Ω3 − (70e) (70f) (70g) In terms of the discretization of this system as presented in Section 3.2, we need to define the discrete connection (19) Ad : (SE(2) × S1 ) × (SE(2) × S1 ) → SE(2), which should satisfy Ad ((gn , ψn ), (gn+1 , ψn+1 )) = gn+1 A(ψn , ψn+1 )gn−1 according to (21) for gn , gn+1 ∈ SE(2) and ψn , ψn+1 ∈ U ⊂ (SE(2) × S1 )/SE(2) ∼ = S1 . The local expression of the discrete connection is given by       2 2 ∆ψn ∆ψn − sin I1I+I 0 cos I1I+I 2 2        I2 2 A(ψn , ψn+1 ) =  (71) ∆ψn ∆ψn cos I1I+I 0 ,  sin I1 +I 2 2 0 0 1 with ∆ψn = ψn+1 − ψn . We denote An = A(ψn , ψn+1 ). The reduced discrete Lagrangian Ld : S1 × S1 × g SE(2) → R is locally defined by the coordinates (ψn , ψn+1 , gen ), where gn = Wn An , with Wn = gn−1 gn+1 . According to (71) e   cos ∆ϕn − sin ∆ϕn cos θn ∆xn + sin θn ∆yn cos ∆ϕn − sin θn ∆xn + cos θn ∆yn  , gn =  sin ∆ϕn e 0 0 1 2 where ∆ϕn = ∆θn + I1I+I ∆ψn , ∆θn = θn+1 −θn , ∆xn = xn+1 −xn and ∆yn = yn+1 −yn . 2 Establishing Ωn 1 = Ωn 2 Ωn 3 cos θn (∆xn /h) + sin θn (∆yn /h), = − sin θn (∆xn /h) + cos θn (∆yn /h), = − (∆θn /h) which represent a discretization of (65) where h is the time-step of the integrator, we obtain that       ∆ψn ∆ψn I2 I2 sin h(Ωn h Ωn cos h(Ωn 3 − I1 +I2 h ) 1 3 − I1 +I2 h )       ∆ψn I2 ∆ψn I2 n n , n (72) gen =  ) cos h(Ω − ) h Ω  − sin h(Ω3 − I1 +I 3 2 h I1 +I2 h 2 0 0 1 24 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ n n and it follows that e gn is completely determined by (Ωn 1 , Ω2 , Ω3 ) after fixing ∆ψn . There1 1 g fore, the discrete Lagrangian Ld : S × S × SE(2) → R is given by 1 1 1 I1 I2 (∆ψn )2 2 n 2 n 2 mh((Ωn − hV (ψn+1 ), (73) 1 ) + (Ω2 ) ) + (I1 + I2 )h (Ω3 ) + 2 2 2 I1 + I2 h n n n where an = (ψn , ψn+1 , Ω1 , Ω2 , Ω3 ). Rh Considering a discretization of the action integral 0 L dt determined by (64) with local truncation error of first order, the discrete equations of motion (36) read   I2 ∆ψn−1 n−1 n−1 n−1 , (74a) Ωn = Ω + hΩ Ω − 1 1 2 3 I1 + I2 h   I2 ∆ψn−1 n−1 , (74b) Ωn − hΩn−1 Ωn−1 − 2 = Ω2 1 3 I1 + I2 h Ld (an ) = n−1 Ωn , 3 = Ω3 (74c) I1 I2 ψn+1 − 2ψn + ψn−1 = −h ∂ψ V (ψn ), (74d) I1 + I2 h for the discrete Lagrangian (73), where we we have used the expressions for the local discrete connection (71), gen (72), and we neglected higher-order terms of the time step O(h2 ) (equations (74a),(74b) and (74c) follow from the second equation in (36), while (74d) follows from the first one). It is easy to check that (74) is a discretization in finite differences of (66), (see footnote 1 ). Remark 4.5. A different discretization of the potential V in (73), for instance   ψn+1 + ψn h h hV or V (ψn+1 ) + V (ψn ), 2 2 2 would lead to a second-order discretization of (74d) with respect to (66d). However, the local truncation error of (74) with respect to (66) does not change, since the order of the Ω equations remains the same. ⋄ g × R3 → R The discrete second-order augmented Lagrangian L̃d : S1 × S1 × S1 × 2SE(2) for the constrained higher-order variational problem is given by  2 h I1 I2 ψn+2 − 2ψn+1 + ψn + ∂ V (ψ ) L̃d (ãn , λn ) = n+1 ψ 2 I1 + I2 h2   I2 n n n n (75) ∆Ωn + λn ∆ψn Ωn 1 − hΩ2 Ω3 + 3 ∆Ω3 + λ1 2 I1 + I2   I2 n n ∆Ωn + λn , ∆ψn Ωn 2 + hΩ1 Ω3 − 2 1 I1 + I2 n n n n n n with ãn = (ψn , ψn+1 , ψn+2 , Ωn , Ωn+1 ), Ωn = (Ωn 1 , Ω2 , Ω3 ), λ = (λ1 , λ2 , λ3 ), and with n+1 n n e − Ωi . Here, to define Ld we used ∆Ωi = Ωi 2  I1 I2 ψn+2 − 2ψn+1 + ψn b d (ãn ) = h (76) + ∂ V (ψ ) L n+1 ψ 2 I1 + I2 h2 I2 n n χ1d (ãn ) =∆Ωn ∆ψn Ωn (77) 1 − hΩ2 Ω3 + 2 I1 + I2 I2 n n ∆ψn Ωn (78) χ2d (ãn ) =∆Ωn 1 2 + hΩ1 Ω3 − I1 + I2 χ3d (ãn ) =∆Ωn (79) 3 The discrete constrained second-order Lagrange-Poincare equations giving rise to the variational integrator to approximate the necessary conditions for optimality in the optimal control problem are given by equations (56), (57), (58) applied to the discrete e d (75) where the partial derivatives of L b d and χα second-order augmented Lagrangian L d, α = 1, 2, 3 follows easily from equations (76)-(79) and are understood as row vectors. The operators T ∗ L̂(W A1 ) and T ∗ L̂(W A2 ) can be computed using the tangent lift of left translaα α α tions as in equation (37), Mn = [0, 0, 0], and the quantities ǫα (n,4) , ǫ(n,5) , ǫ(n−1,4) , ǫ(n−1,5) are given as follow DISCRETIZATION OF THE HIGHER-ORDER LAGRANGE-POINCARÉ EQUATIONS 25 ǫ1(n,4) =[− cos(hϑn ) + hϑn sin(hϑn ), sin(hϑn ) + hϑn cos(hϑn ), hΩn 1 cos(hϑn ) n n n + hΩn 2 sin(hϑn ) − hϑn (hΩ1 sin(hϑn ) + hΩ2 cos(hϑn )) − hΩ2 ], ǫ2(n,4) =[− sin(hϑn ) + hϑn cos(hϑn ), − cos(hϑn ) − hϑn sin(hϑn ), hΩn 1 sin(hϑn ) n n n + hΩn 2 cos(hϑn ) + hϑn (hΩ2 sin(hϑn ) − hΩ1 cos(hϑn )) + hΩ1 ], ǫ3(n,4) =ǫ3(n−1,4) = [0, 0, 1], n ǫ1(n,5) =[cos(hϑn ), − sin(hϑn ), −hΩn 1 cos(hϑn ) + hΩ2 sin(hϑn )], n ǫ2(n,5) =[sin(hϑn ), cos(hϑn ), −hΩn 1 sin(hϑn ) − hΩ2 cos(hϑn )], ǫ1(n−1,4) =[cos(hϑn−1 ), − sin(hϑn−1 ), −hΩn−1 cos(hϑn−1 ) + hΩn−1 sin(hϑn−1 )], 1 2 ǫ2(n−1,4) =[sin(hϑn−1 ), cos(hϑn−1 ), −hΩn−1 sin(hϑn−1 ) − hΩn−1 cos(hϑn−1 )], 1 2 ǫα (n−1,5) =[0, 0, 0], α = 1, 2, 3. I2 ∆ψn where we have used that, ϑn = Ωn 3 − ( I1 +I2 ) h ,   R−hϑn −R−hϑn hvn −1 g̃n−1 = A−1 = , n Wn 0 1   cos(hϑn ) sin(hϑn ) n T . vn = [Ωn 1 , Ω2 ] and Rhϑn = − sin(hϑn ) cos(hϑn ) Equations (56)-(58) are used to update the current state (ãn−1 , ãn−2 , λn−1 , λn−2 ) to obtain the next state (ãn , ãn−1 , λn , λn−1 ). This is accomplished by solving the dynamics (56)-(58) with boundary conditions satisfying the constraints (58) using a root-finding algorithm such as Newton’s method in terms of the unknowns (ãn , λn ) to obtain the next configuration. Note that as in the example in Section 4.1.1, the discrete constrained second-order Lagrange-Poincaré equations (56)- (58) applied to (75) represent a discretization in finite differences of (70) (a)-(e). References [1] R. Benito, M. de León and D. Martı́n de Diego. Higher-order discrete lagrangian mechanics. Int. Journal of Geometric Methods in Modern Physics, 3, pp. 421–436, (2008). [2] A. M. Bloch. Nonholonomic Mechanics and Control. Vol. 24 of Interdisciplinary Appl. Math. Springer-Verlag, New York, (2003). [3] A. Bloch, L. Colombo and R. Gupta, Higher-Order Constrained Variational Problems on Principal Bundles with Applications to Optimal Control of Underactuated Systems. IFAC Conference Proceedings. 5th IFAC Workshop on Lagrangian and Hamiltonian Methods for non-Linear Control, pp. 87-92, (2015). [4] A. M. Bloch and P. E. Crouch. Reduction of Euler Lagrange problems for constrained variational problems and relation with optimal control problems. Proceedings of 33rd IEEE Conference on Decision and Control, pp. 2584-2590, (1994). [5] A. M. Bloch and P. E. Crouch. On the equivalence of higher order variational problems and optimal control problems. Proceedings of 35rd IEEE Conference on Decision and Control, pp. 1648-1653, (1996). [6] A. Bloch, P. Crouch, N. Nordkvist and A. Sanyal. Embedded geodesic problems and optimal control for matrix Lie groups. J. Geom. Mech. 3(2), pp. 197-223, (2011). [7] A.M. Bloch, I.I. Hussein, M. Leok and A.K. Sanyal. Geometric structure-preserving optimal control of a rigid body. Journal of Dynamical and Control Systems, 15(3), pp. 307–330, (2009). [8] A. M. Bloch, P. S. Krishnaprasad, J. E. Marsden, and T. S. Ratiu. The Euler–Poincaré equations and double bracket dissipation. Comm. Math. Phys., 175(1), pp. 1-42, (1996). [9] M. Bruveris, D. Ellis, F. Gay-Balmaz, D. D. Holm. Un-reduction, Journal of Geometric Mechanics, 3(4), pp. 363-387, (2011) . [10] F. Bullo and A. D. Lewis, Geometric Control of Mechanical Systems. Springer-Verlag, (2004). [11] C. Burnett, D. Holm and D. Meier. Geometric integrators for higher-order mechanics on Lie groups, Proc. R. Soc. A. 469:20130249, (2013). [12] Cadzow J. A. Discrete Calculus of Variations. Int. J. Control, 11(3), pp. 393-407, (1970). [13] M. Camarinha, F. Silva Leite, and P. E. Crouch. Splines of class C k on non-Euclidean spaces. IMA Journal of Mathematical Control & Information, 12, pp. 399-410, (1995). [14] M. Camarinha, F. Silva Leite, and P. Crouch. On the geometry of Riemannian cubic polynomials. Differential Geometry and its Applications, 15(2), pp. 107-135, (2001). [15] C.M. Campos, O. Junge, S. Ober-Blobaum. Higher order variational time discretization of optimal control problems. 20th International Symposium on Mathematical Theory of Networks and Systems, Melbourne, (2012). [16] C.M. Campos, S. Ober-Blobaum, E.Trelat. High order variational integrators in the optima lcontrol of mechanical systems. Discrete and Continuous Dynamical Systems - Series A, 359, pp. 4193 - 4223, (2015). 26 A. BLOCH, L. COLOMBO, AND F. JIMÉNEZ [17] H. Cendra, J. E. Marsden and T. S. Ratiu. Lagrangian reduction by stages. Memories of the American Mathematical Society, 152(722), pp. 1–108, (2001). [18] L. Colombo, F. Jiménez and D. Martı́n de Diego Variational integrators for mechanical control systems with symmetries. Journal of Computational Dynamics, 2(2), pp. 193-225, (2015). [19] L. Colombo, F. Jiménez and D. Martı́n de Diego. Discrete Second-Order Euler-Poincaré Equations. An application to optimal control. International Journal of Geometric Methods in Modern Physics, 9(4), 20 pp., (2012). [20] L. Colombo, D. Martı́n de Diego and M. Zuccalli. On variational integrators for optimal control of mechanical systems. RACSAM Rev. R. Acad. Cienc. Ser A. Mat, (2011). [21] L. Colombo and D. Martı́n de Diego. Higher-order variational problems on Lie groups and optimal control applications. J. Geom. Mech., 6(4), pp. 451–478, (2014). [22] L. Colombo L, D. Martı́n de Diego and M. Zuccalli. Higher-order variational problems with constraints. Journal of Mathematical Physics. 54, 093507, (2013). [23] L. Colombo, D. Martı́n de Diego, Second order variational problems on Lie groupoids and optimal control applications. Discrete and Continuous Dynamical Systems-Series A, 36(11), (2016). [24] J. Fernández, C. Tori and M. Zuccalli. Lagrangian reduction of nonholonomic discrete mechanical systems. Journal of Geometric Mechanics, 2(1), pp. 69–111, (2010). [25] F. Gay-Balmaz, D. Holm, T. Ratiu. Higher order Lagrange-Poincaré, and Hamilton-Poincaré, reductions. Bulletin of the Brazialian Mathematical Society 42, pp. 579-606, (2011). [26] F. Gay-Balmaz, D. D. Holm, D. M. Meier, T. S. Ratiu, F.-X. Vialard. Invariant higher-order variational problems, Communications in Mathematical Physics, 309, pp. 413-458, (2012). [27] F. Gay-Balmaz, D. D. Holm, D. M. Meier, T. S. Ratiu, F.-X. Vialard. Invariant higher-order variational problems II, J. Nonlin. Sci., 22(4), pp. 553-597, (2012). [28] E. Hairer, C. Lubich and G. Wanner. Geometric Numerical Integration, Structure-Preserving Algorithms for Ordinary Differential Equations. Springer Series in Computational Mathematics, 31, Springer-Verlag Berlin, (2002). [29] F. Jiménez, M. de León and D. Martı́n de Diego. Hamiltonian dynamics and constrained variational calculus: Continuous and discrete settings J. Phys A, 45, 205204, (2012). [30] M. de León and P. R. Rodrigues. Generalized Classical Mechanics and Field Theory, NorthHolland Mathematical Studies 112, North-Holland, Amsterdam, (1985). [31] T. Lee, M. Leok, H. McClamroch.Optimal Attitude Control of a Rigid Body using Geometrically Exact Computations on SO(3). Journal of Dynamical and Control Systems, 14(4), pp. 465-487, (2008). [32] T. Lee, M. Leok, H. McClamroch. Global Formulations of Lagrangian and Hamiltonian Dynamics on Manifolds: A Geometric Approach to Modeling and Analysis. Springer, Interaction of Mechanics and Mathematics, (2018). [33] M. Leok, J.E. Marsden and A. Weinstein. A discrete theory of connections on principal bundles. Preprint: arXiv:0508338, (2005). [34] M. Leok and T. Shingel, Prolongation-collocation variational integrators, IMA J. Numer. Anal., 32, pp. 1194-1216, (2012). [35] S. Leyendecker, S. Ober-Blobaum, J. Marsden, M. Ortiz. Discrete mechanics and optimal control for constrained systems. Optim. Control, Appl. Methods 316, pp. 505-528, (2010). [36] A. Lewis. Reduction of simple mechanical systems,Mechanics and symmetry seminars, University of Warwick, http://penelope.mast.queensu.ca/andrew/, (1997). [37] J.C. Marrero, D. Martı́n de Diego and E. Martı́nez. Discrete Lagrangian and Hamiltonian Mechanics on Lie groupoids. Nonlinearity, 19(6), pp. 1313–1348, (2006). [38] J.C. Marrero, D. Martı́n de Diego and A. Stern, Symplectic groupies and discrete constrained Lagrangian mechanics Discrete and Continuous Mechanical Systems, Serie A. 35(1), pp. 367-397, (2015). [39] J. E. Marsden and J. Scheurle. The Reduced Euler-Lagrange equations, Fields institute communications, 1, pp. 139-164, (1993). [40] J.E. Marsden and M. West. Discrete mechanics and variational integrators. Acta Numerica, 10, pp. 357–514, (2001). [41] J. Marsden, J. Wendlandt. Mechanical Integrators Derived from a Discrete Variational Principle. Physica D, 106, pp. 223-246, (1997). [42] J.E. Marsden, S. Pekarsky and S. Shkoller. Discrete Euler-Poincaré and Lie-Poisson equations. Nonlinearity, 12(6), pp. 1647–1662, (1999). [43] J.E. Marsden, S. Pekarsky and S. Shkoller. Symmetry reduction of discrete Lagrangian mechanics on Lie groups. Journal of Geometry and Physics, 36(1-2), pp. 140–151, (2000). [44] J. Moser and A.P. Veselov. Discrete versions of some classical integrable systems and factorization of matrix polynomials. Comm. Math. Phys. 139, pp. 217–243, (1991). [45] S. Ober-Blobaum, O. Junge and J. E. Marsden, Discrete mechanics and optimal control: an analysis. ESAIM Control Optim. Calc. Var., 17, pp. 322-352, (2011). [46] J.P. Ostrowski. Computing Reduced Equations for Robotic Systems with Constraints and Symmetries. IEEE Transactions on robotic and automation, 15(1), (1999). A. Bloch: Department of Mathematics, University of Michigan. 530 Church Street, Ann Arbor, MI, USA. E-mail address: [email protected] L. Colombo: ACCESS Linnaeus Center, School of Electrical Engineering, KTH Royal Institute of Technology, SE-100 44, Stockholm, Sweden. E-mail address: [email protected] F. Jiménez: Department of Engineering Science, University of Oxford, Parks Road, Oxford, OX1 3PJ, United Kindom. E-mail address: [email protected]
3cs.SY
arXiv:1609.08327v5 [math.AG] 11 Oct 2017 GEOMETRIC CHARACTERIZATION OF FLAT MODULES Carlos Sancho, Fernando Sancho and Pedro Sancho Abstract Let R be a commutative ring. Roughly speaking, we prove that an R-module M is flat iff it is a direct limit of R-module affine algebraic varieties, and M is a flat Mittag-Leffler module iff it is the union of its R-submodule affine algebraic varieties. Introduction Let R be a commutative (associative with unit) ring. All the functors considered in this paper are covariant functors from the category of commutative R-algebras to the category of sets (groups, rings, etc.). Let R be the functor of rings defined by R(R′ ) := R′ for any commutative R-algebra R′ . An R-module M is a functor of abelian groups endowed with a morphism of functors R×M→M satisfying the module axioms (in other words, the morphism R × M → M yields an R′ module structure on M(R′ ) for any commutative R-algebra R′ ). Morphisms of R-modules, direct and inverse limits and tensor products, etc., are defined in the obvious way. Each R-module M defines an R-module M in the following way: M(R′ ) := M ⊗R R′ . M is said to be a quasi-coherent R-module. The functors Category of R-modules → Category of quasi-coherent R-modules M 7→ M M(R) ←p M 2010 Mathematics Subject Classification. Primary 13C11; Secondary 18Axx. Flat modules, Mittag-Leffler, functor of modules. 1 2 Geometric characterization of flat modules stablish an equivalence of categories. Consider the dual functor M∗ := HomR (M, R) defined by M∗ (R′ ) := HomR′ (M ⊗R R′ , R′ ). In general, the canonical morphism M → M ∗∗ is not an isomorphism, but surprisingly M = M∗∗ (see 1.13), that is, M is a reflexive Rmodule. This result has many applications in Algebraic Geometry (see [11]), for example the Cartier duality of commutative affine groups and commutative formal groups. Each R-scheme X defines “the functor of points” X · as follows: X · (R′ ) := HomSpec R′ (Spec R′ , X ×Spec R Spec R′ ). It is well known that Homsch (X, Y ) = Homf unct (X · , Y · ), and X ≃ Y iff X · ≃ Y · . Let A1R := Spec R[x] be the affine line. An R-scheme X is said to be an R-module scheme if there exist morphisms X ×Spec R X → X, A1R ×Spec R X → X satisfying the module axioms. It is well known that X is an R-module scheme iff X · is an R-module (we shall say that X · is an R-module scheme). For example, M∗ is an Rmodule (affine) scheme because M∗ = (Spec S · M)· . We prove the following proposition. Proposition 0.1. (2.7) An R-module scheme X · is isomorphic to M∗ , for some R-module M, iff X · is a reflexive R-module affine scheme. An R-module M is a finitely generated projective R-module iff M is an R-module quasi-compact and quasi-separated scheme (see 2.4). The Govorov-Lazard Theorem states that an R-module M is flat iff M is isomorphic to a direct limit (of functors of points of) of affine n-spaces, AnR (with the natural structure of R-module). If R is a field and M is a reflexive R-module, then M is isomorphic to a direct limit lim Ni∗ (see [11]). In this paper we prove the following theorem. → i Theorem 0.2. Let M be an R-module. The following statements are equivalent 1. M is a flat R-module. 2. M is a direct limit of R-module schemes. 3. M = lim Ni∗ , that is, M is a direct limit of reflexive R-module affine schemes. → i Given an R-module M, consider the reflexive R-module affine scheme Msch := (Spec S · M∗ (R))· . Geometric characterization of flat modules 3 There exist a natural morphism M → Msch and a functorial equality HomR (Msch , N ∗ ) = HomR (M, N ∗ ), for any reflexive R-module affine scheme N ∗ . Let R be a Noetherian ring, M an R-module and {Mi }i∈I the set of the finitely generated submodules of M. We prove that M is flat iff M = lim Mi,sch . → i∈I In other words (see 3.8), M is flat iff M ⊗R N = lim HomR (Mi∗ , N), → i for any R-module N. In 3.9, we generalize this result to characterize flat quasi-coherent sheaves on Noetherian schemes. Let Mi′ := Im[M ∗ → Mi∗ ]. In a next paper we will prove that M is a strict flat Mittag-Leffler R-module iff M ⊗R N = lim HomR (Mi′ , N), → i for any R-module N. Finally, we characterize flat Mittag-Leffler modules. Mittag-Leffler conditions were first introduced by Grothendieck in [6], and deeply studied by some authors, for example, Raynaud and Gruson in [7]. M is said to be a flat Mittag-Leffler module if it is a direct limit of free finite R-modules {Li } such that the inverse system {L∗i } satisfies the usual Mittag-Leffler condition: for each i there exists j ≥ i such that for k ≥ j we have Im(L∗k → L∗i ) = Im(L∗j → L∗i ), (see [13]). Theorem 0.3. Let M be an R-module. The following statements are equivalent 1. M is a flat Mittag-Leffler module.. 2. M is equal to the direct limit of its R-submodule affine schemes. 3. M = lim Ni∗ , where the morphism Ni∗ → Nj∗ is a monomorphism for any i ≤ j, → i that is, M is equal to the direct limit of its reflexive R-submodule affine schemes. 4. The kernel of any morphism N ∗ → M is a reflexive R-module affine scheme. 5. The kernel of any morphism Rn → M is a reflexive R-module affine scheme. 6. Any morphism N ∗ → M factors through an R-submodule scheme W ∗ of M. 4 Geometric characterization of flat modules 7. Any morphism Rn → M factors through an R-submodule scheme W ∗ of M. 1.12 There exists a natural isomorphism N ⊗R M = HomR (N ∗ , M). Then, for example, 0.3.7. can be rewritten as follows: (7′ ) For any x ∈ Rn ⊗R M there exist a module W , a morphism φ : W → Rn and x′ ∈ W ⊗R M satisfying: (a) (φ ⊗ Id)(x′ ) = x (where φ ⊗ Id : W ⊗ M → Rn ⊗ M is the morphism defined by (φ ⊗ Id)(w ⊗ m) := φ(w) ⊗ m). (b) (φ′ ⊗ Id)(x′ ) 6= 0, for any non-zero morphism φ′ : W → W ′ . Taking W = Im φ in (7′ ), we can say that W is a submodule of Rn . If M is assumed to be flat, then (a) and (b) are equivalent to W being the smallest submodule of Rn that satisfies (a). Therefore, a flat module M is a flat Mittag-Leffler module iff for any x ∈ Rn ⊗R M there exists the smallest submodule W ⊂ Rn such that x ∈ W ⊗R M (this statement was proved in [7]). No knowledge on flat Mittag-Leffler modules is required in this paper. We show how several known properties of flat Mittag-Leffler modules can be proved as consequences of 0.3.3. (see 4.6, 4.8 and 4.10)). In a next paper (see [12]), we shall give some functorial characterizations of flat strict Mittag-Leffler modules (see [5] for a definition). Quasi-coherent modules, M, and reflexive R-module affine schemes, N ∗, are the two most widely used functors in this paper. We think that the main results of this paper involving only these functors are equally true when R is not commutative. 1 Preliminaries Notation 1.1. For simplicity, given a (covariant) functor X (from the category of commutative R-algebras to the category of sets), we shall sometimes use x ∈ X to denote x ∈ X(R′ ). Given x ∈ X(R′ ) and a morphism of commutative R-algebras R′ → R′′ , we shall still denote by x its image by the morphism X(R′ ) → X(R′′ ). Let M and M′ be two R-modules. A morphism of R-modules f : M → M′ is a morphism of functors such that the morphism fR′ : M(R′ ) → M′ (R′ ) defined by f is a morphism of R′ -modules, for any commutative R-algebra R′ . We shall denote by HomR (M, M′ ) the family of all the morphisms of R-modules from M to M′ . Remark 1.2. Direct limits, inverse limits of R-modules and kernels, cokernels, images, etc., of morphisms of R-modules are regarded in the category of R-modules. 5 Geometric characterization of flat modules One has (Ker f )(R′ ) = Ker fR′ , (Coker f )(R′ ) = Coker fR′ , (Im f )(R′ ) = Im fR′ , ( lim Mi )(R′ ) = lim (Mi (R′ )), ( lim Mj )(R′ ) = lim (Mj (R′ )), → i∈I → i∈I ← j∈J ← j∈J (where I is an upward directed set and J a downward directed set). M ⊗R M′ is defined by (M ⊗R M′ )(R′ ) := M(R′ ) ⊗R′ M′ (R′ ), for any commutative R-algebra R′ . Definition 1.3. Given an R-module M and a commutative R-algebra R′ , we shall denote by M|R′ the restriction of M to the category of commutative R′ -algebras, i.e., M|R′ (R′′ ) := M(R′′ ), for any commutative R′ -algebra R′′ . We shall denote by HomR (M, M′ ) the R-module defined by HomR (M, M′ )(R′ ) := HomR′ (M|R′ , M′|R′ ). Obviously, (HomR (M, M′ ))|R′ = HomR′ (M|R′ , M′|R′ ). Notation 1.4. Let M be an R-module. We shall denote M∗ = HomR (M, R). Proposition 1.5. Let M and N be two R-modules. Then, HomR (M, N∗ ) = HomR (N, M∗ ), f 7→ f˜, where f˜ is defined as follows: f˜(n)(m) := f (m)(n), for any m ∈ M and n ∈ N. Proof. HomR (M, N∗ ) = HomR (M ⊗R N, R) = HomR (N, M∗ ). Proposition 1.6. [1, 1.15] Let M be an R-module, R′ a commutative R-algebra and N an R′ -module. Then, HomR′ (M|R′ , N ) = HomR (M, N ). In particular, M∗ (R′ ) = HomR (M, R′ ). In this paper, we shall only consider well-defined functors HomR (M, M′ ), that is to say, functors such that HomR′ (M|R′ , M′ |R′ ) is a set, for any R′ . 6 Geometric characterization of flat modules 1.1 Quasi-coherent modules Definition 1.7. Let M (resp. N, V , etc.) be an R-module. We shall denote by M (resp. N , V, etc.) the R-module defined by M(R′ ) := M ⊗R R′ (resp. N (R′ ) := N ⊗R R′ , V(R′ ) := V ⊗R R′ , etc.). M will be called the quasi-coherent R-module associated with M. M|R′ is the quasi-coherent R′ -module associated with M ⊗R R′ . For any pair of R-modules M and N, the quasi-coherent module associated with M ⊗R N is M ⊗R N . Proposition 1.8. [1, 1.12] The functors Category of R-modules → Category of quasi-coherent R-modules M 7→ M M(R) ←p M stablish an equivalence of categories. In particular, HomR (M, M′ ) = HomR (M, M ′ ). Let fR : M → N be a morphism of R-modules and f : M → N the associated morphism of R-modules. Let C = Coker fR , then Coker f = C, which is a quasi-coherent module. Proposition 1.9. [1, 1.3] For every R-module M and every R-module M, it is satisfied that HomR (M, M) = HomR (M, M(R)), f 7→ fR . Notation 1.10. Let M be an R-module. We shall denote by Mqc the quasi-coherent module associated with the R-module M(R), that is, Mqc (R′ ) := M(R) ⊗R R′ . Proposition 1.11. For each R-module M one has the natural morphism Mqc → M, m ⊗ r ′ 7→ r ′ · m, for any m ⊗ r ′ ∈ Mqc (R′ ) = M(R) ⊗R R′ , and a functorial equality HomR (N , Mqc )) = HomR (N , M), for any quasi-coherent R-module N . 1.9 1.9 Proof. Observe that HomR (N , M) = HomR (N, M(R)) = HomR (N , Mqc ). 7 Geometric characterization of flat modules Obviously, an R-module M is a quasi-coherent module iff the natural morphism Mqc → M is an isomorphism. Theorem 1.12. [1, 1.8] Let M and M ′ be R-modules. Then, ˜ m′ , M ⊗R M′ = HomR (M∗ , M′ ), m ⊗ m′ 7→ m ⊗ ˜ m′ (w) := w(m) · m′ , for any w ∈ M∗ . where m ⊗ If we make M′ = R in the previous theorem, we obtain the following theorem. Theorem 1.13. [3, II,§1,2.5] [1, 1.10] Let M be an R-module. Then, M = M∗∗ . Definition 1.14. Let M be an R-module. We shall say that M∗ is a dual functor. We shall say that an R-module M is reflexive if M = M∗∗ . Example 1.15. Quasi-coherent modules are reflexive. 1.2 R-module schemes For each R-scheme X we shall denote by X · the functor of sets defined by X · (R′ ) := HomR−sch (Spec R′ , X), and it will be called functor of points of X. Example 1.16. Let us denote A1R = Spec R[x] the affine line over Spec R. Then, (A1R )· (R′ ) = R′ . In other words, (A1R )· = R. Definition 1.17. A module R-scheme is a commutative group R-scheme X endowed with a morphism of R-schemes A1R ×R X → X satisfying the module axioms. Morphisms of module R-schemes are defined in the obviuous way (homorphisms of group R-schemes which are compatible with the action of A1R ). Thus we obtain the category of module R-schemes. Remark 1.18. An R-scheme X is a R-module scheme iff X · is an R-module. Thus we have a functor Module R-schemes → R-modules X 7→ X · which is fully faithful. 8 Geometric characterization of flat modules Definition 1.19. We say that an R-module M is an R-module scheme if M ≃ X · for some R-module scheme X. Remark 1.20. Let M be an R-module and SR· M its symmetric algebra. Spec SR· M is an R-module scheme, since Then (Spec SR· M)· = M∗ . Definition 1.21. Let M be an R-module. M∗ will be called the R-module scheme associated with M. Definition 1.22. Let N be an R-module. We shall denote by Nsch the R-module scheme defined by Nsch := ((N∗ )qc )∗ . Proposition 1.23. Let N be an R-module. Then, 1. Nsch (R′ ) = HomR (N∗ (R), R′ ). 2. HomR (Nsch , M) = N∗ (R) ⊗R M, for any quasi-coherent module M. Proof. 1. Nsch (R′ ) = HomR ((N∗ )qc , R′ ) = HomR (N∗ (R), R′ ). 1.12 2. HomR (Nsch , M) = (N∗ )qc (R) ⊗R M = N∗ (R) ⊗R M. The natural morphism (N∗ )qc → N∗ corresponds by Proposition 1.5 with a morphism N → Nsch . Specifically, one has the natural morphism N(R′ ) → HomR (N∗ (R), R′ ) = Nsch (R′ ) n 7→ ñ, where ñ(w) := wR′ (n) Proposition 1.24. Let N be an R-module and M an R-module. Then, the natural morphism HomR (N, M∗ ) → HomR (Nsch , M∗ ), is an isomorphism. 1.5 1.11 1.5 Proof. HomR (N,M∗ ) = HomR (M,N∗ ) = HomR (M,(N∗ )qc )= HomR (Nsch, M∗ ). Geometric characterization of flat modules 1.3 9 From the category of algebras to the category of modules Definition 1.25. Given an R-module N, let R ⊕ N be the commutative R-algebra defined by (r, n) · (r ′ , n′ ) := (rr ′, rn′ + r ′ n), ∀ r, r ′ ∈ R, and ∀ n, n′ ∈ N. Consider the morphism of R-algebras π1 : R⊕N → R, π1 (r, n) := r, which has the obvious section of R-algebras R → R ⊕ N, r 7→ (r, 0). Given an R-module F, let F̄ be the functor from the category of R-modules to the category of R-modules defined by F̄(N) := Ker[F(π1 ) : F(R ⊕ N) → F(R)]. Observe that given a morphism of R-modules w : N → N ′ , we have the morphism of R-algebras w̃ : R ⊕ N → R ⊕ N ′ , (r, n) 7→ (r, w(n)), and then the morphism F̄(w) : F̄(N) → F̄(N ′ ), F̄(w)(f ) := F(w̃)(f ), for any f ∈ F̄(N) ⊂ F(R ⊕ N). We have a canonical isomorphism F(R ⊕ N) = F(R) ⊕ F̄(N). Given a morphism of functor of R-modules φ : F1 → F2 we have the morphism φ̄ : F̄1 → F̄2 , φ̄N (f ) := φR⊕N (f ), for any R-module N and f ∈ F̄1 (N) ⊂ F1 (R ⊕ N). Examples 1.26. M∗ (N) = HomR (M, N) and M̄(N) = M ⊗R N. Proposition 1.27. lim Fi = lim F̄i . → i 2 → i Reflexive module schemes Recall Definition 1.25. Proposition 2.1. Let X = Spec A be an R-module affine scheme. Then, X · (N) = DerR (A, N), for any R-module N. Proof. Consider the additive identity element e ∈ X · (R) = HomR−alg (A, R). Then any R-module, N, is an A-module through the morphism e. Let π1 : R ⊕ N → R be defined by π1 (r, n) := r. Then, X · (N) = {f ∈ X · (R ⊕ N) = HomR−alg (A, R ⊕ N) : π1 ◦ f = e} = DerR (A, N). 10 Geometric characterization of flat modules Proposition 2.2. Let X be an R-module scheme. Let N ֒→ N ′ be an injective morphism of R-modules. Then, the morphism X · (N) → X · (N ′ ) is injective. Let X be an R-module affine scheme and let {Ni }i∈I be a set of R-modules. The natural morphism Y Y X · ( Ni ) → X · (Ni ) i∈I i∈I is an isomorphism. Proof. Let f, f ′ : Spec(R ⊕ N) → X be two morphisms of R-schemes and assume the composite morphisms of R-schemes f Spec(R ⊕ N ′ ) / Spec(R ⊕ N) f′ / / X are equal. Then, f (x) = f ′ (x), for any x ∈ Spec(R ⊕ N ′ ) = Spec(R ⊕ N) = Spec R, and the induced composite morphisms between the rings of functions, on stalks at x, OX,f (x) / / (R ⊕ N)x  /  (R ⊕ N ′ )x are equal (given an R-module M, we denote Mx = (R\px )−1 · M, where px ⊂ R is the prime ideal associated with x). Then, f = f ′ and X · (N) → X · (N ′ ) is injective. Let X = Spec A be an R-module scheme. Then, X ·( Y i 2.1 Ni ) = DerR (A, Y i Ni ) = Y 2.1 DerR (A, Ni ) = i Y X · (Ni ). i Proposition 2.3. Let M be an R-module. The following statements are equivalent: 1. M is a finitely generated projective R-module. 2. M = Msch. 3. M∗ = M∗ qc . Proof. (1) ⇔ (2) By [2], M is a finitely generated projective R-module iff M = N ∗ for some R-module N. (2) ⇔ (3) (2) is the dual statement of (3) and vice versa. Corollary 2.4. Let M be an R-module. Then, M is an R-module quasi-compact and quasi-separated scheme iff M is a finitely generated projective R-module. 11 Geometric characterization of flat modules Proof. ⇐) M = Msch, by 2.3. ⇒) Let N → N ′ be an injective morphism of R-modules. The morphism M ⊗R N = M̄(N) → M̄(N ′ ) = M ⊗R N ′ is injective, by Proposition 2.2. Therefore M is flat. Let {Mi } be the set of the finitely generated submodules of M. The identity morphism M → M = lim Mi factors through → i some Mi , by Proposition 5.4. Hence, M = Mi and M is a finitely generated R-module. Let π : L := Rn → M be an epimorphism and N := Ker π. The sequence of morphisms 0→N →L→M→0 is exact because M is flat. N is an R-module quasi-compact and quasi-separated scheme (it is the functor of points of a closed subset of Spec S · L∗ ), then N is a finitely generated Rmodule and M is a finitely presented flat R-module. By [4, 6.6], M is a finitely generated projective R-module. Theorem 2.5. Let X be an R-module affine scheme. Let M := X · . Then, M∗ is a quasi-coherent R-module and Msch = M∗∗ . Proof. Let Hom(X · , R) be the functor (of functions of X) defined by ′ ′ 1 · Hom(X · , R)(R′ ) = Hom(X|R ′ , R ) = HomR′ −sch (X ×R R , AR′ ), If X = Spec A, then Hom(X · , R) = A is a quasicoherent R-module and the functor of functions of X ×R X is equal to A ⊗R A. 1. Gm := Spec R[x, 1/x] (in fact A1R ) acts on X. Then, G·m (in fact, R) acts on A and A = ⊕n∈N An , where λ ∗ an = λn · an , for any λ ∈ G·m and an ∈ An . 2. Let ∆ : A → A ⊗R A be the coproduct morphism (which is obtained from the addition morphism X × X → X). Then, ∆(An ) ⊆ ⊕i=n i=0 Ai ⊗ An−i , because Gm acts linearly on X. 3. A0 = R: Given a0 ∈ A0 , a0 (m) = a0 (α · m), for any m ∈ M and α ∈ R. Then, a0 (m) = a0 (0), for any m ∈ M. Let i > 0 and w ∈ Ai , then w(0) = 0: w(0) = w(α ∗ 0) = αi · w(0), for any α ∈ R, then w(0) = 0 · w(0) = 0. 4. ∆(w) = w ⊗ 1 + 1 ⊗ w, for any w ∈ A1 : ∆(w) = w ′ ⊗ 1 + 1 ⊗ w ′ for some w ′ ∈ A1 , because M is commutative (and A0 = R). Then, w(m) = w(m + 0) = w ′(m) + w ′ (0) = w ′ (m), Or let X be a quasi-compact and quasi-separated scheme and let R be a field. 12 Geometric characterization of flat modules for any m ∈ M, that is to say, w = w ′ . 5. A1 = M∗ (R) : M∗ ⊆ A and obviously M∗ (R) ⊆ A1 . By 4., A1 ⊆ M∗ (R). 6. By change of rings, R → R′ , we have that M∗ (R′ ) = (M|R′ )∗ (R′ ) = A1 ⊗R R′ . Hence, A1 = M∗ . Finally, Msch = ((M∗ )qc )∗ = M∗∗ . Example 2.6. Assume R = Z/2Z. Let X be the obvious R-module scheme Spec R[x], and Y = Spec R[x]/(x2 ) the obvious R-module subscheme of X. Let M = Y · . Then, M∗ = R and M∗∗ = X · . Assume R is a ring of characteristic 2. Let M be the obvious functor of Abelian groups R. Consider M as an R-module as follows: λ ∗ m := λ2 · m, ∀λ ∈ R and m ∈ M. M is an R-module scheme, but M is not the R-module scheme associated with an Rmodule because M∗ (R) = 0. Corollary 2.7. Let X be an R-module quasi-compact and quasi-separated scheme. Assume X is affine or R is a field. Then, X · is the R-module scheme associated with an R-module iff X · is a reflexive R-module. Proof. ⇐) Let M = X · be reflexive. Then, M = M∗∗ is the module scheme associated with M∗ (R), by Theorem 2.5. Proposition 2.8. Let M be an R-module affine scheme, and N a dual R-module. Then, HomR (M, N) = HomR (Msch , N). Let N′ be an R-module. A morphism f : N′ → N factors through a morphism from N′ to an R-module affine scheme iff f factors through the morphism N′ → N′ sch . Proof. Let us write N = P∗ . Then, 1.5 2.5 1.5 HomR (M, N) = HomR (P, M∗ ) = HomR (P, (M∗ )qc ) = HomR (Msch , N). Finally, if f factors through a morphism N′ → M, where M is an R-module affine scheme, then we have a commutative diagram N′  N′ sch and f factors through N′ → N′ sch . / / M /N ③= ③ ③③ ③③ ③  ③ Msch 13 Geometric characterization of flat modules 3 Characterization of flat modules Lemma 3.1. Let N and M be R-modules. Given a morphism f : N ∗ → M of Rmodules, there exist a finitely generated free module L and morphisms g : N ∗ → L and h : L → M, such that the diagram N ∗❉❉ f /M O ❉❉ ❉❉ h g ❉❉❉ " L is commutative. P 1.12 Proof. We have f = ri=1 ni ⊗ mi ∈ N ⊗ M = HomR (N ∗ , M). Let L := Rr , and let {ei } be the standard basis of L. Let h : L → M be defined by h(ei ) := mi . Then, P 1.12 g := ri=1 ni ⊗ ei ∈ N ⊗ L = HomR (N ∗ , L) verifies h ◦ g = f . Note 3.2. In particular, every morphism f : N ∗ → M factors through the quasicoherent R-module associated with a finitely generated submodule of M (for example, Im hR ). Lemma 3.3. Let N be a finitely presented R-module and let M be a flat R-module. Every morphism N → M uniquely factors through N → Nsch , that is, 1.23 HomR (Nsch , M) = N ∗ ⊗ M [10, 7.11] = HomR (N , M). Proof. Let us recall that N ∗ ⊗ M = HomR (N, M): If N = Rn then it is obvious. HomR (−, M) and (−)∗ ⊗R M are contravariant left exact functors. Finally, N is equal to the cokernel of a morphism between finitely generated free modules. Proposition 3.4. [4, 6.6] Let M be a flat R-module, N a finitely presented R-module and f : N → M a morphism of R-modules. Then, there exist a finitely generated free module L and morphisms g : N → L, h : L → M such that the diagram f /M O ❈❈ ❈❈ h g ❈❈❈ ! N❈ L is commutative. Proof. By Lemma 3.3 and Lemma 3.1, we have a commutative diagram f /M O✤ a ❊❊ ❊❊ ✤ ❊❊ ✤ ❊" N❊ Nsch / L 14 Geometric characterization of flat modules Any module is a direct limit of finitely presented modules. The Govorov-Lazard states that any flat module is a direct limit of finitely generated free modules (see [4, A6.6]). The proof of this theorem is based on Proposition 3.4. Theorem 3.5. Let M be an R-module. The following statements are equivalent 1. M is a flat R-module. 2. M is a direct limit of module schemes associated with R-modules, M = lim Ni∗ → i 3. M is a direct limit of R-module schemes. Proof. (1) ⇒ (2) M is a direct limit of a direct system of finitely presented modules, {Ni , fij }. Let fijsch : Ni,sch → Nj,sch be the morphism defined by fij . Let us prove that M = lim Ni,sch: Each morphism Ni → M factors through a unique morphism Ni,sch → → i M by 3.3. The morphism Ni,sch → M = lim Ni , factors through a morphism Ni,sch → Nj → i for some j, by 5.4. Since Ni is finitely generated, there exists k > j, such the composite morphism Ni → Ni,sch → Nj → Nk is equal to fik . Therefore, the composite morphism Ni,sch → Nj → Nk → Nk,sch is equal to fiksch . Then, lim Ni,sch = lim Ni = M. → i → i (2) ⇒ (3) It is obvious. (3) ⇒ (1) Write M = lim Ni , where every Ni is an R-module scheme. Let N ֒→ N ′ → i be an injective morphism of R-modules. Then, the composite morphism 2.2 1.27 1.27 M ⊗R N = M̄(N) = lim Ni (N) = lim N̄i (N) ֒→ lim N̄i (N ′ ) = lim Ni (N ′ ) → i → i → i → i = M̄(N ′ ) = M ⊗R N ′ is injective and M is a flat R-module. Theorem 3.6. Let R be a Noetherian ring. Let M be an R-module and {Mi } the set of the finitely generated submodules of M. M is a flat R-module iff M = lim Mi,sch . → i 1.12 1.12 Or because HomR (N ∗ , lim Ni ) = N ⊗R ( lim Ni ) = lim (N ⊗R Ni ) = lim HomR (N ∗ , Ni ). → i → i → i → i 15 Geometric characterization of flat modules Proof. ⇒) M = lim Mi . Proceed as in the proof of (1) ⇒ (2) in Proposition 3.5. → i ⇐) It is a consequence of Theorem 3.5. Lemma 3.7. If M = lim Ni∗ , then → i M ⊗R N = lim HomR (Ni , N), → i for any R-module N. Proof. Recall Definition 1.25.Then, M ⊗R N = M̄(N) = lim Ni∗ (N) = lim (Ni∗ (N)) = lim HomR (Ni , N) → i → i → i for any R-module N. Corollary 3.8. Let R be a Noetherian ring. Let M be an R-module and {Mi } the set of finitely generated submodules of M. M is a flat R-module iff M ⊗R N = lim HomR (Mi∗ , N), → i for every R-module N. Proof. ⇒) It is a consequence of 3.6 and 3.7. ⇐) M ⊗ − = lim HomR (Mi∗ , −) is a left exact functor. → i 3.1 From the category of affine R-schemes to the category of X-schemes The reader can omit this subsection, no other section of this paper depends upon it. For simplicity, we have worked within the framework of the affine R-schemes. Briefly, let us see that we can work within the framework of the X-schemes. Let (X, OX ) be a Noetherian scheme. Given a quasi-coherent sheaf, F , on X (in the standard sense, see [8, II 5.]) we shall denote by F the functor from the category of quasi-compact and quasi-separated schemes over X to the category of Abelian groups defined by F (Y ) := (f ∗ F )(Y ), for any quasi-compact and quasi-separated scheme Y over X, f : Y → X. Given a coherent sheaf G, we shall say that G ∗ := HomOX (G, OX ) is an OX -module variety. F and G ∗ are sheaves in the Zariski topos. 16 Geometric characterization of flat modules Theorem 3.9. Let (X, OX ) be a Noetherian scheme and F a quasi-coherent module on X. F is a flat OX -module iff F is a direct limit of OX -module varieties. Proof. ⇒) F is equal to the direct limit of its coherent subsheaves, F = lim Fi , → i and given an open set U ⊆ X and a coherent subsheaf G of F|U , there exists a coherent subsheaf H ⊆ F such that H|U = G (see [8, Ex. II 5.15]). Given a coherent sheaf I, let J := I ∗ . We shall denote Isch = J ∗ . If U = Spec R ⊆ X is an affine open set, M := I(U) and Y = Spec R′ is an affine scheme over U, then Isch (Y ) = HomR (M ∗ , R′ ) = Msch (R′ ). Consider the natural morphism Fi → Fi,sch , then the morphism HomOX (Fi,sch, F ) → HomOX (Fi , F ) is a bijection, by Lemma 3.3. Finally, the morphism lim Fi,sch → F → i is an isomorphism by Theorem 3.6. ⇐) Assume F = lim Gi ∗ . Let U = Spec R ⊆ X be an affine open subset. Let → i M := F (U) and Ni := Gi (U). Then, M = lim Ni∗ . By 3.5, M is a flat R-module. Then, F is flat. 4 → i Characterization of flat Mittag-Leffler modules Lemma 4.1. 1. Let f : N ∗ → M∗ be a morphism of R-modules and let f ∗ : M → N be the dual morphism. Then, Ker f = (Coker f ∗ )∗ . Hence, Ker f is the module scheme associated with Coker fR∗ , and f is a monomorphism iff f ∗ is an epimorphism. 2. HomR (M∗ , −) is a right exact funtor on the category of quasi-coherent modules. 3. Let f1 : N1∗ → N ∗ and f2 : N2∗ → N ∗ be two morphisms of R-modules. Then, N1∗ ×N ∗ N2∗ is an R-module scheme associated with an R-module and (N1∗ ×N ∗ N2∗)∗ = N1 ⊕N N2 . Proof. (1) It is obvious. (2) It is an immediate consequence of that M ⊗R − is a right exact functor on the category of R-modules. 17 Geometric characterization of flat modules (3) N1 ⊕N N2 is a quasi-coherent R-module because it is equal to the cokernel of the morphism N → N1 ⊕ N2 , n 7→ (f1∗ (n), −f2∗ (n)). Then, N1∗ ×N ∗ N2∗ = (N1 ⊕N N2 )∗ is a module scheme and N1 ⊕N N2 = (N1 ⊕N N2 )∗∗ = (N1∗ ×N ∗ N2∗ )∗ . Definition 4.2. [13, Chap. 2 Def. 3.] An R-module M is said to be a flat MittagLeffler module if M is the direct limit of free finite R-modules {Li } such that the inverse system {L∗i } satisfies the usual Mittag-Leffler condition (that is, for each i there exists j ≥ i such that for k ≥ j we have Im(L∗k → L∗i ) = Im(L∗j → L∗i )). Theorem 4.3. Let M be an R-module. The following statements are equivalent 1. M is a flat Mittag-Leffler module. 2. M is equal to a direct limit of R-submodule schemes associated with modules. 3. Any morphism N ∗ → M factors through an R-submodule scheme of M associated with an R-module. 4. Any morphism Rn → M factors through an R-submodule scheme of M associated with an R-module. 5. The kernel of any morphism N ∗ → M is a module scheme associated with an R-module. 6. The kernel of any morphism Rn → M is a module scheme associated with an Rmodule. Proof. (1) ⇒ (2) Write M = lim Li , where the inverse system {L∗i } satisfies the → i Mittag-Leffler condition. Obviously, M is a flat R-module and M∗ = lim L∗i . Let Ni := ← i Im(L∗k → L∗i ), for k >> i. Obviously, the morphisms Ni → Nj are epimorphisms. The morphism L∗k → Ni is an epimorphism for every k >> i, then the morphism Ni∗ → Lk is a monomorphism for every k >> i. Taking direct limits we have the morphisms M = lim Li → lim Ni∗ ֒→ M → i Then, M = lim Ni∗ . → i (2) ⇒ (3) It is a consequence of 5.4. → i 18 Geometric characterization of flat modules (3) ⇒ (1) Let V1∗ , V2∗ be two R-submodule schemes of M. The morphism V1∗ ⊕ V2∗ → M, (w1 , w2 ) 7→ w1 +w2 factors through an R-submodule scheme V ∗ of M. Then, V1∗ , V2∗ ⊆ V ∗ . Any morphism Rn → M factors through a submodule scheme of M asociated with an R-module. Then, M is the direct limit of its R-submodule schemes associated with modules. Hence, M is flat by 3.5. Write M = lim Li , where Li is a finite free module → i for any i. We have to prove that the inverse system {L∗i } satisfies the Mittag-Leffler condition. The morphism Li → M factors through a monomorphism W ∗ ֒→ M. By 5.4, there exists j > such that W ∗ → M factors through a morphism W ∗ → Lj , which is a monomorphism because W ∗ ֒→ M is a monomorphism. Likewise, the morphism W ∗ → Lk is a monomorphism for any k ≥ j. Dually we have the morphisms L∗k → W → L∗i . and L∗k → W is an epimorphism by 4.1. Then, Im[L∗k → L∗i ] = Im[W → L∗i ], for any k ≥ j. (3) ⇒ (5) Let f : N ∗ → M be a morphism of R-modules. Im f is isomorphic to an R-submodule of an R-module scheme V ∗ ⊆ M. Consider the obvious morphisms N ∗ → Im f ⊆ V ∗ ⊆ M. Then, Ker f = Ker[N ∗ → V ∗ ] is a module scheme associated with an R-module, by 4.1. (5) ⇒ (3) Let f : N ∗ → M a morphism of R-modules. Let V ∗ = Ker f . Consider the inclusion morphism i : V ∗ ֒→ N ∗. The dual morphism i∗ : N → V is an epimorphism, by 4.1. Let W := Ker i∗R . We have the exact sequence of morphisms 0 → W → N → V → 0. Then, 0 → V ∗ → N ∗ → W ∗ → 0 is an exact sequence in the category of module schemes associated with R-modules. The dual morphism f ∗ : N ∗ → M factors through a morphism g : W ∗ → M, because HomR (−, M) is a right exact functor on the category of module schemes associated with R-modules, by 4.1 (2). Let H∗ := Ker g. Observe that N ∗ ×W ∗ H∗ = N ∗ ×W ∗ Kerg = Ker f = V ∗ Dually, N ⊕W H = V, by 4.1, and 0 = (N ⊕W H)/V = W ⊕W H = H. Then, H = 0 and g is a monomorphism. (3) ⇒ (4) It is obvious. (4) ⇒ (3) It is a consequence of the fact that any morphism N ∗ → M factors through a morphism Rn → M, by 3.1. 19 Geometric characterization of flat modules (5) ⇒ (6) It is obvious. (6) ⇒ (5). Any morphism f : N ∗ → M factors through a morphism g : Rn → M, by 3.1. Ker f = Ker g ×Rn N ∗ , which is a module scheme by 4.1. Corollary 4.4. Let M be an R-module. The following statements are equivalent 1. M is a flat Mittag-Leffler module. 2. For any R-module N and any morphism f : N ∗ → M there exists the smallest R-submodule scheme W ∗ ⊆ M such that f factors through W ∗ . 3. For any morphism f : Rn → M there exists the smallest R-submodule scheme W ∗ ⊆ M such that f factors through W ∗ . i 4. For any free R-module Rn and any x ∈ Rn ⊗ M there exist a submodule W ⊆ Rn and x′ ∈ W ⊗R M satisfying: (a) For any non-zero morphism φ : W → V , (φ ⊗ Id)(x′) 6= 0 (where the morphism φ ⊗ Id : W ⊗ M → V ⊗ M is defined by (φ ⊗ Id)(w ⊗ m) := φ(w) ⊗ m). (b) (i ⊗ Id)(x′ ) = x. 5. For any R-module N and any morphism f : M∗ → N there exists the smallest pair (N ′ , f ′), where N ′ is a submodule of N and f ′ : M∗ → N ′ a morphism of f′ R-modules, such that f is the composite morphism M∗ → N ′ → N . 6. For any R-module N and any x ∈ M ⊗R N, there exists the smallest pair (N ′ , x′ ) , where N ′ is a submodule of N and x′ ∈ M ⊗R N ′ , such that x′ maps to x through the morphism M ⊗R N ′ → M ⊗R N. Proof. (1) ⇒ (2) Let g : M1 → M2 be a morphism of R-modules. There exists a biggest quotient module of M1 such that g factors through it: M/ Ker g. Dually, given a morphism h : M∗2 → M∗1 of R-modules, there exists the smallest R-submodule scheme of M∗1 such that h factors through it. Given two submodule schemes W1∗ , W2∗ ⊂ M, there exists a submodule scheme W ∗ ⊂ M that contains them: a submodule scheme W ∗ ⊂ M that contains Im[W1∗ ⊕ W2∗ → M]. By 4.3 (3), we easily finish the proof. (2) ⇒ (1) It is an immediate consequence of 4.3 (3). (2) ⇒ (3) It is obvious. (3) ⇒ (1) It is an immediate consequence of 4.3 (4). (1) ⇒ (5) Let f : M∗ → N be a morphism of R-modules. Consider the dual morphism f ∗ : N ∗ → M. Ker f ∗ is a module scheme, by 4.3 (5). Write Ker f ∗ = V ∗ and let 20 Geometric characterization of flat modules i : V ∗ ֒→ N ∗ be the inclusion morphism. V ∗ is the biggest submodule scheme of N ∗ such that f ∗ ◦ i = 0. Dually, V is the biggest quasi-coherent quotient module of N such that i∗ ◦ f = 0. Then, N ′ = Ker i∗R is the smallest submodule of N such that f factors through N ′. (5) ⇒ (1) Let f : N1 → N2 be a morphism of R-modules and assume that fR is injective. Let g : M∗ → N1 be a morphism of R-modules. If f ◦ g = 0, 0 is the smallest module such that f ◦g factors through it, then 0 is the smallest module such that g factors through it, that is, g = 0. By 4.1 (2), HomR (M∗ , −) is an exact functor on the category of quasi-coherent modules. Let N ′ ⊆ N be the smallest submodule such that f factors through a morphism f ′ : M∗ → N ′ . By 4.3 (3), it is sufficient to prove that f ′∗ : N ′∗ → M is a monomorphism. Let w ∈ Ker f ′∗ (S) ⊆ N ′∗ (S) = HomR (N ′ , S). Then, w ◦ f ′ = 0 and f ′ factors through the quasi-coherent module associated with Ker wR . Then, Ker wR = N ′ and w = 0. (5) ⇐⇒ (6) It is an immediate consequence of the equality HomR (M∗ , N ) = M ⊗R N. Proposition 4.5. Let M be a flat Mittag-Leffler module. Then, the canonical morphism N ∗ ⊗R M → HomR (N, M) is injective for every R-module N. Proof. Let {Nj∗} be the set of the reflexive R-submodule affine schemes of M. M = lim Nj∗. Then, → j 1.23 5.4 N ∗ ⊗R M = HomR (Nsch, M) = HomR (Nsch, lim Nj∗) = lim HomR (Nsch, Nj∗ ) → j → j 1.24 = lim HomR (N , Nj∗) ֒→ HomR (N , M) = HomR (N, M) → j Let us prove some well known results (4.6, 4.8 and 4.10) on Mittag-Leffler modules (see [13] and [7]). Corollary 4.6. Let M be a flat R-module. M is a Mittag-Leffler module iff the Q Q natural morphism M ⊗R i∈I Qi → i∈I (M ⊗R Qi ) is injective, for every set of R-modules {Qi }i∈I . Proof. ⇒) Let {Nj } be the set of the reflexive submodule affine schemes of M. Then, M = lim Ni and → i 21 Geometric characterization of flat modules M ⊗R Y 1.26 Qi = M( i ֒→ ∗ Y Y 1.27 Qi ) = lim (Nj ( → j i 1.27 lim (Nj (Qi )) = → j i Y 2.2 Qi )) = lim → j i Y (Nj (Qi )) i Y Y M(Qi ) = (M ⊗R Qi ) i i 1.26 (∗ Observe that the morphism N̄j → N̄j ′ is a monomorphism, for any j ′ > j). ⇐) Let f : M∗ → N be a morphism of R-modules. Let {Ni } be the set of the submodules Ni of N, such that the morphism f factors through Ni → N . Let N ′ := ∩i Ni and Ni′ := N/Ni . We have to prove that f factors through N ′ → N , by the equivalence of (1) and (3) in Corollary 4.4 . The obvious sequence of morphisms of modules Y 0 → N′ → N → Ni′ i is exact. Then, the sequence of morphisms of modules Y 0 → M ⊗R N ′ → M ⊗R N → M ⊗R Ni′ i is exact. The natural morphism M ⊗R sequence of morphisms of modules Q i∈I Ni′ → Q i∈I (M 0 → HomR (M∗ , N ′) → HomR (M∗ , N ) → ⊗R Ni′ ) is injective. Then, the Y HomR (M∗ , Ni′ ) i is exact, and f factors through N ′ → N . Theorem 4.7. An R-module M is a flat Mittag-Leffler module iff M is a direct limit of R-submodule affine schemes. Proof. ⇒) It is a consequence of Theorem 4.3. ⇐) Write M = lim Nj , where Nj ֒→ M is an R-submodule affine scheme, for any j. → j M is a flat R-module, by Theorem 3.5. Besides, M ⊗R Y 1.26 Qi = M( i ֒→ Y i Y i 1.27 Qi ) = lim (Nj ( → j 1.27 lim (Nj (Qi )) = → j Y 2.2 Qi )) = lim → j i Y (Nj (Qi )) i Y Y M(Qi ) = (M ⊗R Qi ) i i 1.26 Then, M is a flat Mittag-Leffler module by Corollary 4.6. An immediate consequence of Corollary 4.6 is the following corollary. 22 Geometric characterization of flat modules Corollary 4.8. Let f : M1 → M2 be a universally injective morphism of R-modules. If M2 is a flat Mittag-Leffler module then M1 is a flat Mittag-Leffler module. If M1 and Coker f are flat Mittag-Leffler modules then M is a flat Mittag-Leffler module. Examples 4.9. Free modules are flat Mittag-Leffler modules, then projective modules are flat Mittag-Leffler modules, because any projective module is a direct summand of a free module. Q is not a flat Mittag-Leffler Z-module: Consider the injective morphism Q Q Z → n>0 Z/nZ, m 7→ (m̄)n>0 . Q ⊗Z n>0 Z/nZ 6= 0 because Q is a flat Z-module and Q Q ⊗Z Z = Q 6= 0. n>0 (Z/nZ ⊗Z Q) = 0. Then the morphism Y Y (Z/nZ ⊗Z Q) ( Z/nZ) ⊗Z Q → n>0 n>0 is not injective and Q is not a flat Mittag-Leffler module. Theorem 4.10. Let M be a countably generated R-module. M is a flat Mittag-Leffler module iff M is a projective module. Proof. ⇒) Write M = hmn in∈N . M∗ is the union of its reflexive submodule affine schemes, because M is a flat Mittag-Leffler module. Define Nn∗ recursively as a submodule ∗ scheme of M such that mn ∈ N ∗ (R) and Nn−1 ⊆ Nn∗. Then, M = lim Nn∗. The obvious → n∈N morphisms πn : Nn → Nn−1 are epimorphisms, by Lemma 4.1. Let f : P → P ′ be an epimorphism of R-modules. The morphisms Nn ⊗R P → Nn ⊗R P ′ are epimorphisms and, then, it is easy to prove that the morphism lim (Nn ⊗R P ) → ← n∈N lim (Nn ⊗R P ′ ) is an epimorphism. Then, from the commutative diagram ← n∈N HomR (M, P ) / HomR (M, P ′ ) 1.9 1.9 HomR (M, P) HomR ( lim Nn∗ , P) / / → n∈N lim HomR (Nn∗, P) ← n∈N / HomR (M, P ′ ) HomR ( lim Nn∗, P ′ ) → n∈N lim HomR (Nn∗ , P ′ ) ← n∈N 1.12 lim (Nn ⊗R P ) ← n∈N 1.12 / lim (Nn ⊗R P ′ ) ← n∈N we have that HomR (M, P ) → HomR (M, P ′ ) is an epimorphism, hence M is a projective module. ⇐) Any projective module is a flat Mittag-Leffler module. 23 Geometric characterization of flat modules Any projective module is a direct sum of countably generated projective modules (see [9]), then any projective module is a direct sum of countably generated flat Mittag-Leffler modules. 5 Appendix: Sheaves Let {Ui }i∈I be an open covering of a scheme X. We shall say that the obvious morphism ` Y = i∈I Ui → X is an open covering. Lemma 5.3 is well known, but it is difficult to find a reference with exactly the same hypothesis. Definition 5.1. Let F be a functor of sets. F is said to be a sheaf in the Zariski topos if for any commutative R-algebra R′ and any open covering Spec R′ 1 → Spec R′ , the sequence of morphisms F(R′ ) / F(R′ 1 ) / / F(R′ 1 ⊗R′ R′ 1 ) is exact, that is to say by the Yoneda Lemma, the sequence of morphisms Hom((Spec R′ )· , F) / Hom((Spec R′ 1 )· , F) / / Hom((Spec R′ 1 × Spec R′ 1 )· , F) Spec R′ is exact. Examples 5.2. If M is an R-module, M is a sheaf in the Zariski topos. If X is an R-scheme, X · is a sheaf in the Zariski topos. If {Fi } a direct system of sheaves in the Zariski topos, lim Fi is a sheaf in the Zariski topos. → i Given a morphism h : X → Y of R-schemes, let h· : X · → Y · be the induced morphism. Lemma 5.3. Let X be a scheme and π : X1 → X an open covering. Let F be a sheaf in the Zariski topos. Then, the sequence of morphisms Hom(X · , F) / Hom(X1· , F) / / Hom(X1· ×X · X1· , F) is exact. Proof. Recall Hom((Spec R′ )· , F) = F(R′ ) by the Yoneda Lemma. / Let π1 , π2 : X1 ×X X1 / X1 be the obvious projections. Let f, f ′ ∈ Hom(X · , F) and x ∈ X · (R′ ) = HomSpec R (Spec R′ , X). Suppose fR′ (x) 6= fR′ ′ (x), that is to say, f ◦ x· 6= f ′ ◦ x· . There exist an open covering y : Spec R′ 1 → Spec R′ 24 Geometric characterization of flat modules and x1 ∈ X1· (R′ 1 ) = HomSpec R′ (Spec R′ 1 , X1 ) such that the diagram y Spec R′ 1 Spec R′ / x1 x  X1  X / π is commutative. Observe that f ◦ x· ◦ y · 6= f ′ ◦ x· ◦ y · because the morphism Hom((Spec R′ )· , F) = F(R′ ) → F(R′ 1 ) = Hom((Spec R′ 1 )· , F) is injective. Then, f ◦ π · ◦ x·1 6= f ′ ◦ π · ◦ x·1 and f ◦ π · 6= f ′ ◦ π · . Therefore, Hom(X · , F) → Hom(X1· , F) is injective. Let f1 ∈ Hom(X1· , F) be a morphism such that f1 ◦ π1· = f1 ◦ π2· . Given a morphism x ∈ X · (R′ ) = Hom(Spec R′ , X), there exist an open covering y : Spec R′ 1 → Spec R′ and x1 ∈ X1· (R′ 1 ) = Hom(Spec R1′ , X) such that the diagram y Spec R′ 1 Spec R′ / x1 x  X1  X / π is commutative. There exists a unique morphism g : (Spec R′ )· → F such that the diagram (Spec R′ 1 ×Spec R′ Spec R′ 1 )· x·1 ×x·1 / (Spec R′ 1 )· / x·1 π1·  X1· ×X · X1· / / x·  / (Spec R′ )· X1· ❯❯❯❯ ❯❯❯❯ π2· ❯❯❯❯ f1 ❯❯❯❯ ❯❯❯❯  * j F π· /  X· g is commutative, because F is a sheaf. Let f : X · → F be defined by fR′ (x) := g. This morphism is well defined, that is, g does not depend on the choice of y and x1 : Let y2 : Spec R2′ → Spec R be an open covering and a commmutative diagram Spec R′ 2 y2 / Spec R′ x2 x  X1 π /  X ` Consider the obvious open covering y3 : Spec(R1′ ) Spec(R2′ ) → Spec R and the obvi` ous morphism x3 : Spec(R1′ ) Spec(R2′ ) → X1 . It is easy to prove that the morphism 25 Geometric characterization of flat modules (Spec R′ )· → F defined by y and x1 is equal to the morphism defined by y3 and x3 , and that the morphism defined by y3 and x3 is equal to the morphism defined by y2 and x2 . Finally, f1 = f ◦ π · : Let x′ ∈ X1· (R′ ) = Hom(Spec R′ , X1 ) and let x := π ◦ x′ ∈ Hom(Spec R′ , X1 ). Let us follow previous notations. Then, R1′ = R′ , x1 = x′ and g = f1 ◦ x′ · . Therefore, (f ◦ π · )R′ (x′ ) = fR′ (x) = g = f1 ◦ x′ · = f1 R′ (x′ ). Observe that the morphism Hom(X · , F) → Hom(X1· , F) is injective, then for any open covering X2 → X1 ×X X1 , the sequence of morphisms Hom(X · , F) / / Hom(X1· , F) / Hom(X2· , F) is exact. Proposition 5.4. Let X be an R-module quasi-compact and quasi-separated scheme and {Fi } a direct system of R-modules. Assume Fi is a sheaf in the Zariski topos, for any i. Then, HomR (X · , lim Fi ) = lim HomR (X · , Fi ). → i → i Proof. If X = Spec A is an affine scheme, Hom(X · , lim Fi ) = ( lim Fi )(A) = lim Fi (A) = lim Hom(X · , Fi ) → i → i → i → i by the Yoneda Lemma. Let X1 = Spec A1 → X be an affine open covering and let X2 = Spec A2 → X1 ×X X1 be an affine open covering. Consider the commutative diagram / · / Hom(X · , lim Fi ) Hom(X · , lim Fi ) / Hom(X2 , lim Fi ) 1 → i → i lim Hom(X · , Fi ) / → i → i / lim Hom(X1· , Fi ) → i / lim Hom(X2· , Fi ) → i Then, Hom(X · , lim Fi ) = lim Hom(X · , Fi ). → i → i Let us prove that HomR (X · , lim Fi ) = lim HomR (X · , Fi ): Let f ∈ HomR (X · , lim Fi ). → i → i Consider the commutative diagram X· × X· → i + / X· f ×f  lim Fi × lim Fi → i → i f + /  lim Fi → i 26 Geometric characterization of flat modules Then, there exists a morphism fk : X · → Fk such that f is equal to the composite morfk phism X · → Fk → lim Fi and the diagram → i X· × X· + X· / fk ×fk  Fk × Fk fk + /  Fk is commutative, i.e., fk is linear. Likewise, we can prove that fk is R-linear. References [1] Álvarez, A., Sancho, C., Sancho, P., Algebra schemes and their representations, J. Algebra 296/1 (2006) 110-144. [2] Álvarez, A., Sancho, C., Sancho, P., Characterization of Quasi-Coherent Modules that are Module Schemes, Communications in Algebra (2009),37:5,1619 1621. [3] Demazure, M.; Gabriel, P., Introduction to Algebraic Geometry and Algebraic Groups, Mathematics Studies 39, North-Holland, 1980. [4] Eisenbud, D.,Commutative Algebra with a View Toward Algebraic Geometry, GTM 150, Springer-Verlag, 1995. [5] Garfinkel, G.S., Universally torsionless and trace modules, Trans. Amer. Math. Soc. 215 (1976) 119-144. [6] Grothendieck, A. EGA, III. Math. Inst. Hautes Etudes Scient. 11 (1961) [7] Gruson,L., Raynaud, M., Critères de platitude et de projectivité, Inventiones math. 13, 1-89 (1971). [8] Hartshorne, R., Algebraic Geometry, GTM 52, Springer-Verlag, 1997. [9] Kaplansky, I., Projective modules, Ann. of Math. (2), 68, 372-377 (1958). [10] Matsumura, H., Commutative ring theory, Cambridge University Press, 2000. [11] Navarro, J., Sancho C., Sancho, P., Affine functors and duality 2012 arXiv:0904.2158v4 Geometric characterization of flat modules 27 [12] Sancho, C., Sancho F., Sancho, P., Flat SML modules and reflexive functors 2017, arXiv:1610.03395 [math.AC] [13] Raynaud, M., Flat modules in algebraic geometry Compositio Mathematica 24 n1 1972.
0math.AC
BP-STDP: Approximating Backpropagation using Spike Timing Dependent Plasticity Amirhossein Tavanaei, Anthony Maida arXiv:1711.04214v2 [cs.NE] 9 Mar 2018 The Center for Advanced Computer Studies University of Louisiana at Lafayette Louisiana, Lafayette, LA 70504, USA {tavanaei,maida}@louisiana.edu Abstract The problem of training spiking neural networks (SNNs) is a necessary precondition to understanding computations within the brain, a field still in its infancy. Previous work has shown that supervised learning in multi-layer SNNs enables bio-inspired networks to recognize patterns of stimuli through hierarchical feature acquisition. Although gradient descent has shown impressive performance in multi-layer (and deep) SNNs, it is generally not considered biologically plausible and is also computationally expensive. This paper proposes a novel supervised learning approach based on an event-based spike-timing-dependent plasticity (STDP) rule embedded in a network of integrate-and-fire (IF) neurons. The proposed temporally local learning rule follows the backpropagation weight change updates applied at each time step. This approach enjoys benefits of both accurate gradient descent and temporally local, efficient STDP. Thus, this method is able to address some open questions regarding accurate and efficient computations that occur in the brain. The experimental results on the XOR problem, the Iris data, and the MNIST dataset demonstrate that the proposed SNN performs as successfully as the traditional NNs. Our approach also compares favorably with the state-of-the-art multi-layer SNNs. Keywords: Spiking neural networks, STDP, Supervised learning, Temporally local learning, Multi-layer SNN. 1. Introduction In the vein of neural network research, spiking neural networks (SNNs) have attracted recent and long-standing interest due to their biologically plausible realism, theoretical computation power, and power efficiency [1, 2, 3, 4, 5]. Neurons in SNNs (analogous to biological neurons in the brain) communicate via discrete spike events. An important question in implementing spiking frameworks is how these networks are trained under supervision while there is no differentiable activation function of continuous values? Multi-layer supervised learning Preprint submitted to March 12, 2018 is a crucial concept in SNNs to prove their ability to predict and classify the patterns of stimuli. The earliest supervised learning in SNNs, SpikeProp, was proposed by Bohte et al. (2002) [6] which develops a gradient descent based learning method similar to traditional backpropagation embedded in multi layer neural networks. SpikeProp minimizes the distance between single desired and output spikes by formulating the spike time as a function of the neuron’s membrane potential. Later, Quick-Prop and RProp [7] were introduced as faster versions of SpikeProp. Following the same approach, Booij et al. (2005) [8] and Ghosh et al. (2009) [9] proposed new SpikeProp algorithms minimizing the distance between multiple desired and output spikes to improve the model’s coding ability in response to temporal patterns. Gradient descent (GD), as a popular supervised learning approach, is still being employed to develop high performance supervised learning in spiking platforms either in offline [10] or online [11] manner. Chronotron [12] which utilizes the Victor & Purpura (VP) metric [13] for E-learning (offline) and the synaptic current simulation for I-learning (online) is another example of GD in SNNs. As implemented in Chronotron, the error function in GD can be defined by a difference measure between the post- and presynaptic current (or membrane potential) [14] (online) or a spike train distance metric (offline) such as von Rossum distance [15, 16] and inner product of spike trains [17]. The online gradient descent method has also attracted recent interest in deep SNNs [18, 19]. Although the online GD methods have been successful in developing supervised learning in multi-layer SNNs, using membrane potential and derivative based approaches are biologically implausible because SNNs only communicate via discrete spike events. Additionally, GD is computationally expensive for multi-layer SNNs. Recently, Xie et al. (2016) [20] developed a normalized spiking backpropagation calculating postsynaptic spike times (which still needs expensive computations) instead of membrane potential at each time step to improve the algorithm’s efficiency. Another vein of research utilizes modified versions of the Widrow-Hoff learning rule for SNNs. For instance, ReSuMe [21] introduced a single-layer supervised learning approach; and later, it was extended to the multi-layer framework using backpropagation by Sporea et al. (2013) [22]. SPAN [23, 24] also used Widrow-Hoff by transforming the discrete spikes to corresponding analog signals. The learning methods mentioned above are more efficient but less accurate than the GD-based approaches. Another efficient, supervised learning method belongs to the perceptron-based approaches such as Tempotron [25] where each spike event is treated as a binary tag for training the perceptron [26, 27]. These models present single layer supervised learning. However, the idea of spike/no-spike classification broadens a new supervised learning category incorporating efficient spike-timing-dependent plasticity (STDP) [28, 29, 30] and anti-STDP that are triggered according to the neuron’s label [31, 32]. STDP is a biologically plausible learning rule occurs in the brain in which the presynaptic spikes occur immediately before the current postsynaptic spike strengthen the interconnecting synapses (LTP); otherwise, the synapses are weakened (LTD). In this paper, we propose novel multi-layer, supervised learning rules to train SNNs of integrate-and-fire (IF) neurons. The proposed approach takes advantages of the both efficient, 2 bio-inspired STDP and high performance backpropagation (gradient descent) rules. First, we show that the IF neurons approximate the rectified linear units. Then, we develop a temporally local learning approach specified by an STDP/anti-STDP rule derived from the backpropagation weight change rules that can be applied at each time step. 2. Method Before proposing the spike-based, temporally local learning rules, we show how the biological IF neurons approximate the well-known artificial neurons equipped with the rectified linear unit activation function. This approximation takes the first step in converting ratebased learning to spatio-temporally local learning. 2.1. Rectified Linear Unit versus IF neuron A neuron with the rectified linear unit (ReLU) activation function, f (y), receiving input signals, xh , via corresponding synaptic weights, wh , is defined as follows X f (y) = max(0, y) , y = x h wh (1) h ∂f = ∂y ( 1, 0, y>0 y≤0 (2) Theorem: The IF neuron approximates the ReLU neuron. Specifically, the membrane potential of the IF neuron approximates the activation value of the ReLU neuron. Proof: A non-leaky IF neuron integrates the temporal membrane potentials caused by its input spike trains and fires when its membrane potential, U (t), reaches the neuron’s threshold, θ. A simplified formulation of the IF neuron is shown in Eq. 3. X U (t) = U (t − ∆t) + wh (t)sh (t) (3a) h if U (t) ≥ θ then r(t) = 1, U (t) = Urest (3b) Where, sh (t) and r(t) are pre- and postsynaptic spikes at time t (sh (t), r(t) ∈ {0, 1}), respectively. The neuron’s membrane potential is reset to resting potential, Urest , (assume Urest = 0) upon firing. By formulating the presynaptic spike train, Gh (t), as the sum of delta Dirac functions (Eq. 4), the input value, xh ∈ [0, 1], in Eq. 1, can be determined by integrating over the spiking time interval, T , as shown in Eq. 5. X Gh (t) = δ(t − tph ) (4) tph ∈{sh (t)=1} 1 xh = K T Z 0 3 Gh (t0 )dt0 (5) Figure 1: IF activation function (f (ŷ)) and its derivative. This function resembles a scaled version of the ReLU function that is shifted by θ. K is a constant denoting the maximum number of spikes in T ms interval. In a short time period (t − α, t] between consecutive postsynaptic spikes r(t − α) and r(t), the neuron’s membrane potential, following Eq. 3, is obtained by Z t X X  U (t) = wh δ(t0 − tph )dt0 (6) h t−α+ tph The membrane potential calculated above (U (t)) is greater than the threshold, θ (U (t) ≥ θ). Thus, as we assumed that the IF neuron is non-leaky and its membrane potential resets to zero upon firing, R postsynaptic spikes demand an accumulated membrane potential (Eq. 7). The accumulated membrane potential, U tot , is obtained by linear summation over the submembrane potentials computed in Eq. 6. By this definition, the postsynaptic spike count, R, represents the output value, ŷ, that is passed through a non-linear, threshold-based activation function. X U tot = ŷ = U (tf ) (7) tf ∈{r(t)=1} U tot specifies the IF neuron’s activity in T ms, which is proportionally related to the postsynaptic spike count, R. Therefore, the activation function of the IF neuron can be expressed as ( R = γ ŷ ŷ > θ f (ŷ) = (8) 0 otherwise where, γ ∝ T · θ−1 is a constant controlling the postsynaptic spike count. This activation function is similar to a linearly scaled ReLU function that is shifted to right by θ. Figure 1 shows the activation function and its derivative. This theorem opens a new door to develop new spike-based learning rules (applied to the spiking IF neurons) derived from the traditional learning rules (applied to the ReLU neurons). Specifically, in the next section, we use this theorem to propose an STDP-based backpropagation rule applied to the spiking IF neurons. 4 Figure 2: The 2-Layer, conventional (left) and spiking (right) network architectures. The SNN receives spike trains representing input feature values in T ms. The learning rules and the network status in the SNN are specified by an additional term as time (t). The formulas and parameters are discussed in Eqs. 9 through 21. 2.2. Backpropagation using STDP The proposed learning rules are inspired from the backpropagation update rules reported for neural networks that are equipped with ReLU activation function. Figure 2 shows the network architectures and parameters used to describe the conventional and spiking neural networks in this paper. The main difference between these two networks is their data communication where the neural network (left) receives and generates real numbers while the SNN (right) receives and generates spike trains in T ms time intervals. Non-spiking neural networks equipped with gradient descent (GD) solve an optimization problem in which the squared difference between the desired, d, and output, o, values is minimized [33, 34]. A common objective function computed for M output neurons receiving N training samples is shown in Eq. 9. E= N M 1 XX (dk,i − ok,i )2 N (9) k=1 i=1 The weight change formula (using GD with learning rate of µ) for a linear output neuron, say i, receiving H inputs, oh , (for a single training sample) is achieved by X 2 ∂E = −2(di − oi ) · oh (10) E = (di − oi )2 = di − oh wih → ∂wih h By reversing the sign on the derivative, we have ∆wih ∝ − ∂E → ∆wih = µ(di − oi )oh ∂wih (11) By assuming di , oi , and oh as the spike counts of spike trains Li , Gi , and Gh [35] (see Eqs. 4 and 12), respectively, the weight change, defined above, can be re-expressed such that it computes the synaptic weight update in an SNN. This assumption is valid upon approximating 5 the spiking IF neurons to the ReLU neurons (Theorem 1). Eq. 13 shows this update rule after T = 50 ms. X Gi (t) = δ(t − tpi ) (12a) tpi ∈{ri (t)=1} δ(t − tqi ) X Li (t) = (12b) tqi ∈{zi (t)=1} Z ∆wih = µ T 0 0  Li (t ) − Gi (t ) dt0 · 0 Z T Gh (t0 )dt0 (13) 0 However, the weight change rule in Eq. 13 is not local in time. To make the learning rule local in time, we break the time interval, T , into sub-intervals such that each sub-interval contains zero or one spike. Hence, the learning rule, in a short time period of Eq. 13, is specified by Eq. 14.  ∆wih (t) ∝ µ zi (t) − ri (t) sh (t) (14) To implement the formula above, a combination of event-based STDP and anti-STDP can be used. The proposed learning rule updates the synaptic weights using a teacher signal to switch between STDP and anti-STDP. That is, the target neuron undergoes STDP and the non-target ones undergo anti-STDP. The desired spike trains, z, are defined based on the input’s label. Therefore, the target neuron is represented by a spike train with maximum spike frequency (β) and the non-target neurons are silent. Additionally, the learning rule triggers at desired spike times, zi (t) (the desired spike times are the same for all the target neurons). Eq. 15 shows the weight change that is applied to the output layer of our supervised SNN. t X ∆wih (t) = µ · ξi (t) sh (t0 ) (15) t0 =t−   zi (t) = 1, ri 6= 1 in [t − , t] 1, ξi (t) = −1, zi (t) = 0, ri = 1 in [t − , t]   0, otherwise (16) Then, the synaptic weights of output layer are updated by wih (t) = wih (t) + ∆wih (t) (17) The target neuron is determined by zi (t) where zi (t) = 1 denotes the target neuron and zi (t) = 0 denotes the non-target neuron. The weight change scenario for the output layer starts with the desired spike times. At desired spike time t, the target neuron should fire in a short time interval [t − , t] known as the STDP window. Otherwise, the synaptic weights are increased proportionally by the presynaptic activity (mostly zero or one spike) in the 6 P same time interval. The presynaptic activity is denoted by tt0 =t− sh (t0 ) that counts the presynaptic spikes in [t − , t] interval. On the other hand, the non-target neurons upon firing undergo weight depression in the same way. This scenario is inspired from the traditional GD while supporting spatio-temporal, local learning in SNNs. The learning rule written above works for a single layer SNN trained by supervision. To train a multi-layer SNN, we use the same idea that is inspired from the traditional backpropagation rules. The backpropagation weight change rule applied to a hidden layer of ReLU neurons is shown in Eq. 18. X  ∆whj = µ · ξˆi wih · oj · [oh > 0] (18) i Where, ξˆi denotes the difference between the desired and output values (di − oi ). In our SNN, ξˆi is approximated by ξi (Eq. 16). The value [oh > 0] specifies the derivative of ReLU neurons in the hidden layer. Using the approximation of the IF neurons to the ReLU neurons (Eq. 8), similar to the output layer (Eq. 13), the weight change formula can be re-expressed in terms of spike counts in a multi-layer SNN as shown in Eq. 19. Z T X Z T X   ∆whj = µ ξi (t0 )wih (t0 ) dt0 · δ(t0 − tpj ) dt0 · (19) 0 i  Z  0 T 0 tpj X 0 δ(t −  tph )dt0  >0 tph After dividing T into short sub-intervals [t − , t], the temporally local rule for updating the hidden synaptic weights is formulated as follows. ( P P µ · i ξi (t)wih (t) · tt0 =t− sj (t0 ) , sh = 1 in [t − , t] ∆whj (t) = (20) 0 , otherwise Finally, the synaptic weights of hidden layer are updated by whj (t) = whj (t) + ∆whj (t) (21) The above learning rule can be non-zero when the hidden neuron h fires (postsynaptic spike occurrence). Thus, the weights are updated according to the presynaptic (sj (t)) and postsynaptic (sh (t)) spike times, analogous to the standard STDP rule. Additionally, the derivative of ReLU (oh > 0) is analogous to the spike generation in the IF neurons (see the condition in Eq. 20). Following this scenario for the spatio-temporally synaptic weight change rule, we can build a multi-layer SNN equipped with the STDP-based Backpropagation algorithm, named BP-STDP. Figure 3 demonstrates the BP-STDP algorithm applied to an SNN with one hidden layer. 7 1: for t = ∆t : T : ∆t do - - First Layer 2: U1 [:, t] = sj [:, t] ∗ wjh + U [:, t − ∆t] 3: for u in hidden neurons do 4: if U1 [u, t] > θh then 5: sh [u, t] = 1 6: U1 [u, t] = Urest - - Second Layer 7: U2 [:, t] = sh [:, t] ∗ whi + U2 [:, t − ∆t] 8: for o in output neurons do 9: if U2 [o, t] > θo then 10: ri [o, t] = 1 11: U2 [o, t] = Urest - - Weight Adaptation 12: if t ∈ z then - - z = {t|z(t) = 1} 13: if ri = 0 in [t − , t] for target neuron: 14: ξi [target]= 1 15: if ri = 1 in [t − , t] for non-target neurons: 16: ξi [non targets]= [-1]   17: derivativesh = sh (t) = 1 in [t − , t] 18: ξh = whi ∗ ξi · derivativesh 19: whi + = sum(sh (t − ...t)) ∗ ξi · µ 20: wjh + = sum(sj (t − ...t)) ∗ ξh · µ Figure 3: The BP-STDP algorithm applied to a multi-layer SNN consisting of input, output and one hidden layer. ‘*’ stands for matrix multiplication. ‘- -’ starts a comment. 8 Table 1: Model parameters. Parameter  β θh ∆t Value 4 ms 250 Hz 0.9 1 ms Parameter µ θo H U0 Value 0.0005 0.025 × H {10,...,1500} 0 3. Results We ran three different experiments to evaluate the proposed model (BP-STDP) on the XOR problem, the iris dataset [36], and the MNIST dataset [37]. The parameters used in the experimental setting are shown in Table 1. The synaptic weights for all the experiments are initialized by the Gaussian random numbers with zero mean and unit standard deviation. 3.1. XOR problem The BP-STDP algorithm is evaluated by the XOR problem to show its ability to solve linear inseparability. The dataset contains four data points {(0.2, 0.2), (0.2, 1), (1, 0.2), (1, 1)} and corresponding labels {0, 1, 1, 0}. We used 0.2 instead of 0 to activate the IF neurons (to release spikes). The network architecture consists of 2 input, 20 hidden, and 2 output IF neurons. The number of hidden neurons for this problem has little effect on the results. We will investigate the impact of the number of hidden neurons for the MNIST classification task. Each input neuron releases spike trains corresponding to the input values such that the value 1 is represented by a spike train with the maximum spike rate (250 Hz). Figure 4 shows the training process where each box represents the two output neurons’ activities with respect to the four input spike patterns determining {0, 1, 1, 0} classes. After around 150 training iterations, the output neurons become selective to the input categories. Figure 5 demonstrates the learning convergence progress using the energy function defined in Eq. 22. This figure shows that the proper learning rates, µ, fall in the range [0.01, 0.0005]. MSE = N T X 1 X 1 X k 2 ξ (t) , ξ k (t) = ξik (t) N T k=1 t=1 (22) i In Eq. 22, N and ξik (t) denote the training batch size and the error value of output neuron i in response to sample k. 3.2. Iris dataset The Iris dataset consists of three different types of flowers (Setosa, Versicolour, and Virginica) represented by the length and width of both petal and sepal (4 features). After normalizing the feature values in the range [0,1], input spike trains are generated. The network architecture in this experiment consists of 4 input, 30 hidden, and 3 output IF neurons. 9 Figure 4: Spike trains released from the output neurons in response to four pairs of spike trains representing {(0.2, 0.2), (0.2, 1), (1, 0.2), (1, 1)} values in 1 through 500 iterations. We used high spike rates for better visualization. Figure 5: MSE of the XOR learning process (left: through 500 iterations, right: after training). 10 Figure 6: Spike trains released from the output neurons in response to the spike trains representing Setosa, Versicolour, and Virginica. We found, in our preliminary experiments, that using more than 10 hidden neurons does not significantly improve accuracy. Similar to the results obtained for the XOR problem, Figure 6 illustrates that the SNN converges to be selective to the three flower patterns through training. Figure 7 shows the learning process of the SNN in terms of the MSE defined in Eq. 22. The final evaluation using 5-fold cross validation reported 96% accuracy while the traditional neural network equipped with standard Backpropagation showed 96.7% accuracy. This result shows the success of the proposed BP-STDP algorithm to train temporal SNNs. Furthermore, Table 2 compares our results with other spike-based and traditional supervised learning methods. Our model outperforms (or equally performs) the previous multi-spiking supervised learning algorithms except Lin et al.’s method [17] where develops a spatio-temporal, computationally expensive GD. 3.3. MNIST Dataset To assess the proposed algorithm in solving more complex problems, we evaluate the SNN on MNIST with 784 input, 100 through 1500 hidden, and 10 output IF neurons equipped with BP-STDP. The SNN was trained and tested on 60k training and 10k testing samples. 11 Figure 7: MSE of the learning process applied to the Iris dataset (left: through 500 iterations, right: after training). Table 2: Accuracy of Iris classification using our method (BP-STDP) in comparison with the other spiking supervised approaches and the classical ANN, SVM, and Naive Bayes methods. Model SpikeProp (Bohte et al. 2002) [6] MSGD; Xu et al. (2013) [10] Wang et al. (2014) [31] Yu et al. (2014) [26] SWAT; Wade et al. (2010) [38] multi-ReSuMe; Sporea et al. (2013) [22] Xie et al. (2016) [20] Lin et al. (2017) [17] SVM and Bayesian [31] ANN (30 hidden neurons) BP-STDP 12 Accuracy % 96.1 94.4 86.1 92.6 95.3 94.0 96.0 96.7 96.0 96.7 96.0 Figure 8: Temporal membrane potentials of output neurons in response to randomly selected ‘0’, ‘1’, and ‘8’ handwritten digits. The input spike trains are generated by random lags with the spike rates proportional to the normalized pixel values in the range [0, 1]. Figure 8 shows the output neurons’ membrane potentials (after training) in response to the spike trains generated from three randomly selected digits. The target neuron’s membrane potential grows fast and reaches the threshold while the other neurons’ activities are near zero. Furthermore, this fast response (< 9 ms) reduces the network’s response latency. Figure 9a shows the learning process for 1200 training epochs. Each epoch stands for 50 MNIST digits. The MSE track in this plot shows the fast convergence of BP-STDP for the learning rates of 0.001 and 0.0005. Figure 9b shows the MSE values and the accuracy rates for the SNN with 1000 hidden neurons over training. After 100 and 900 training epochs, the performances of 90% and 96% are achieved. To examine the impact of the number of hidden neurons on performance, we applied the BP-STDP rule to six SNNs with 100 through 1500 hidden IF neurons. Figure 10 shows the accuracy rates over training for these SNNs. The best accuracy rates belong to the networks with more than 500 hidden neurons. Finally, the BP-STDP algorithm was evaluated on 2-layer and 3-layer SNNs. The SNN architectures (the number of hidden neurons) are the same as the neural network architectures utilized in [39] to show a better comparison. Our model achieved 96.6 ± 0.1% and 97.2 ± 0.07% accuracy rates for the 2-layer and 3-layer SNNs, respectively. These results are comparable to the accuracy rates reported by traditional neural networks (trained by backprpagation) [39]. Table 3 compares the proposed supervised learning method (BP-STDP) with the traditional backpropagation algorithm (or GD), spiking backpropagation methods embedded in multi-layer (deep) SNNs, and recent STDP-based SNNs for MNIST classification. This comparison confirms the success of the bio-inspired BP-STDP rule applied to the temporal SNN architecture. Our model is the only high performance, end-to-end STDP based, supervised learning approach applied to multi layer SNNs. The SNNs introduced in [40, 41] develop multi-layer STDP learning for feature extraction. However, they use a 13 (a) (b) Figure 9: (a): MSE of the SNN over training with µ = 0.001, 0.0005, 0.0001. (b): MSE and accuracy of the SNN with µ = 0.0005. H = 1000 and each training epoch stands for 50 images. Figure 10: Performance of BP-STDP applied to the SNN with 100 through 1500 hidden IF neurons over 100 through 1200 training epochs. 14 support vector machine (SVM) classifier for the final supervised layer. Although the gradient descent approaches performed successfully [42, 43, 18], they do not offer bio-inspired, power-efficient STDP learning in SNNs. Specifically, the recently developed deep SNN using backpropagation [18] showed higher accuracy than the BP-STDP’s accuracy; however, it computes the derivatives of activation functions obtained by the neurons’ membrane potentials instead of using their spike events. 4. Discussion BP-STDP introduces a novel supervised learning for SNNs. It showed promising performances comparable to the state-of-the-art conventional gradient descent approaches. BPSTDP provides bio-inspired local learning rules which take spike times into consideration as well as spike rates in the subsequent layers of IF neurons. Bengio et al. [45] showed that the synaptic weight change is proportional to the presynaptic spike event and the postsynaptic temporal activity that is analogous to the STDP rule and confirms Hinton’s idea that says STDP can be associated with the postsynaptic temporal rate [46]. In this paper, we showed that the backpropagation update rules can be used to develop spatio-temporally local learning rules, which implement biologically plausible STDP in SNNs. The proposed algorithm is inspired from the backpropagation update rules used for the conventional networks of ReLU neurons. However, it develops biologically plausible, temporally local learning rules in an SNN. This matter was accomplished by an initial approximation of the IF neurons to the ReLU neurons to support the spike-based communication scheme in SNNs. The spiking supervised learning rules offer a combination of STDP and anti-STDP applied to spiking neural layers corresponding to the temporal presynaptic and postsynaptic neural activities. Therefore, we take advantages of both accurate gradient descent and efficient, temporally local STDP in spiking frameworks. The main question is that how does error propagation corresponds to the spiking behavior of IF neurons in multi-layer network architectures? P To answer this question, P let us assume the error value as a signal that either stimulates ( i ξi > 0) or suppresses ( i ξi < 0) the IF neuron to fire. Stimulating (suppressing) a neuron refers to increasing (decreasing) its membrane potential that is proportionally controlled by its input weights and presynaptic spike events. Thus, as the BP-STDP update rules change the synaptic weights temporally based on the error signal and the presynaptic spike times, it manipulates the neural activities (action potentials) of hidden layers at each time step. The experimental results showed the success of BP-STDP in implementing supervised learning embedded in multi-layer SNNs. The XOR problem proved the ability of BP-STDP to classify non-linearly separable samples represented by spike trains through T ms time intervals. The complex problems of IRIS and MNIST classification demonstrated comparable performances (96.0% and 97.2% respectively) to the conventional backpropagation algorithm and the recent SNNs while BP-STDP offers an end-to-end STDP-based supervised learning for spiking pattern classification. Using the bio-inspired and temporally local STDP rules 15 Table 3: MNIST classification performance of the proposed BP-STDP applied to SNNs in comparison with 1) traditional backpropagation applied to conventional neural networks, 2) spiking gradient descent, and 3) recent STDP-based SNNs. ‘*’ denotes a random distortion of training set (data augmentation for improving the performance). H1 and H2 show the number of neurons in the first and second hidden layers. Model Description Traditional Neural Networks Traditional backpropagation. Lecun et al. [39] 2-layer network; H1=300 Traditional backpropagation. Lecun et al. [39] 2-layer network; H1=1000 Traditional backpropagation. Lecun et al. [39] 3-layer network; H1=500; H2=150 Spiking Gradient Descent Deep SNN. O’Connor et al. [42] Stochastic gradient descent Deep SNN. O’Connor et al. [42] Fractional stochastic gradient descent Deep SNN. Backpropagation Lee et al. [18] Membrane potential as activation value STDP Based Models 2-Layer SNN. Diehl et al. [43] STDP; Example-based classifier Spiking CNN. Tavanaei et al. [40] Sparse coding and STDP; SVM classifier Spiking CNN. Kheradpisheh et al. [41] Layer-wise STDP; SVM classifier Spiking restricted Boltzmann machine. Neftci et al. [44] Contrastive divergence for IF neurons STDP-based backpropagation. BP-STDP (This paper) 2-layer SNN; H1=300 STDP-based backpropagation. BP-STDP (This paper) 2-layer SNN; H1=1000 STDP-based backpropagation. BP-STDP (This paper) 3-layer SNN; H1=500; H2=150 16 Acc. (%) 95.3 96.4* 95.5 96.2* 97.1 97.6* 96.40 97.93 98.88 95.00 98.36 98.40 91.90 95.70 96.60 97.20 guides us one step closer to the efficient computations that occur in the brain. To the best of our knowledge, this approach is the first high performance, STDP-based supervised learning while avoiding computationally expensive gradient descent. 5. Conclusion This paper showed that IF neurons approximate rectified linear units, if the neurons’ activities are mapped to the spike rates. Hence, a network of spiking IF neurons can undergo backpropagation learning applied to conventional NNs. We proposed a temporally local learning rule (derived from the traditional backpropagation updates) incorporating the STDP and anti-STDP rules embedded in a multi-layer SNN of IF neurons. This model (BP-STDP) takes advantages of the bio-inspired, efficient STDP rule in spiking platforms and the power of GD for training multi-layer networks. Also, converting the GD-based weight change rules to the spike-based STDP rules is much easier and computationally inexpensive than developing a spiking GD rule. The experiments on the XOR problem showed that the proposed SNN can classify non-linearly separable patterns. Furthermore, the final evaluations on the Iris and MNIST datasets demonstrated high classification accuracies comparable to the state-ofthe-art, multi-layer networks of traditional and spiking neurons. The promising results of the BP-STDP model warrants our future investigation to develop a deep SNN equipped with BP-STDP and regularization modules. The deep SNN can be utilized for larger pattern recognition tasks while preserving efficient, brain-like computations. References References [1] W. Maass, Networks of spiking neurons: the third generation of neural network models, Neural networks 10 (9) (1997) 1659–1671. [2] S. Ghosh-Dastidar, H. Adeli, Spiking neural networks, International journal of neural systems 19 (04) (2009) 295–308. [3] W. Maass, To spike or not to spike: that is the question, Proceedings of the IEEE 103 (12) (2015) 2219–2224. [4] D. Neil, M. Pfeiffer, S.-C. Liu, Learning to be efficient: Algorithms for training lowlatency, low-compute deep spiking neural networks, in: Proceedings of the 31st Annual ACM Symposium on Applied Computing, ACM, 2016, pp. 293–298. [5] N. Kasabov, K. Dhoble, N. Nuntalid, G. Indiveri, Dynamic evolving spiking neural networks for on-line spatio-and spectro-temporal pattern recognition, Neural Networks 41 (2013) 188–201. 17 [6] S. M. Bohte, J. N. Kok, H. La Poutre, Error-backpropagation in temporally encoded networks of spiking neurons, Neurocomputing 48 (1) (2002) 17–37. [7] S. McKennoch, D. Liu, L. G. Bushnell, Fast modifications of the spikeprop algorithm, in: Neural Networks, 2006. IJCNN’06. International Joint Conference on, IEEE, 2006, pp. 3970–3977. [8] O. Booij, H. tat Nguyen, A gradient descent rule for spiking neurons emitting multiple spikes, Information Processing Letters 95 (6) (2005) 552–558. [9] S. Ghosh-Dastidar, H. Adeli, A new supervised learning algorithm for multiple spiking neural networks with application in epilepsy and seizure detection, Neural networks 22 (10) (2009) 1419–1431. [10] Y. Xu, X. Zeng, L. Han, J. Yang, A supervised multi-spike learning algorithm based on gradient descent for spiking neural networks, Neural Networks 43 (2013) 99–113. [11] Y. Xu, J. Yang, S. Zhong, An online supervised learning method based on gradient descent for spiking neurons, Neural Networks 93 (2017) 7–20. [12] R. V. Florian, The chronotron: a neuron that learns to fire temporally precise spike patterns, PloS one 7 (8) (2012) e40233. [13] J. D. Victor, K. P. Purpura, Metric-space analysis of spike trains: theory, algorithms and application, Network: computation in neural systems 8 (2) (1997) 127–164. [14] D. Huh, T. J. Sejnowski, Gradient descent for spiking neural networks, arXiv preprint arXiv:1706.04698 (2017) 99. [15] M. C. van Rossum, A novel spike distance, Neural computation 13 (4) (2001) 751–763. [16] F. Zenke, S. Ganguli, SuperSpike: Supervised learning in multi-layer spiking neural networks, arXiv preprint arXiv:1705.11146 (2017) 99. [17] X. Lin, X. Wang, Z. Hao, Supervised learning in multilayer spiking neural networks with inner products of spike trains, Neurocomputing 237 (2017) 59–70. [18] J. H. Lee, T. Delbruck, M. Pfeiffer, Training deep spiking neural networks using backpropagation, Frontiers in neuroscience 10 (2016) 1–13. [19] Y. Wu, L. Deng, G. Li, J. Zhu, L. Shi, Spatio-temporal backpropagation for training high-performance spiking neural networks, arXiv preprint arXiv:1706.02609 (2017) 99. [20] X. Xie, H. Qu, G. Liu, M. Zhang, J. Kurths, An efficient supervised training algorithm for multilayer spiking neural networks, PloS one 11 (4) (2016) e0150329. 18 [21] F. Ponulak, A. Kasiński, Supervised learning in spiking neural networks with ReSuMe: sequence learning, classification, and spike shifting, Neural Computation 22 (2) (2010) 467–510. [22] I. Sporea, A. Grüning, Supervised learning in multilayer spiking neural networks, Neural computation 25 (2) (2013) 473–509. [23] A. Mohemmed, S. Schliebs, S. Matsuda, N. Kasabov, SPAN: Spike pattern association neuron for learning spatio-temporal spike patterns, International Journal of Neural Systems 22 (04) (2012) 1250012. [24] A. Mohemmed, S. Schliebs, S. Matsuda, N. Kasabov, Training spiking neural networks to associate spatio-temporal input–output spike patterns, Neurocomputing 107 (2013) 3–10. [25] R. Gütig, H. Sompolinsky, The tempotron: a neuron that learns spike timing-based decisions, Nature neuroscience 9 (3) (2006) 420. [26] Q. Yu, H. Tang, K. C. Tan, H. Yu, A brain-inspired spiking neural network model with temporal encoding and learning, Neurocomputing 138 (2014) 3–13. [27] Y. Xu, X. Zeng, S. Zhong, A new supervised learning algorithm for spiking neurons, Neural computation 25 (6) (2013) 1472–1511. [28] H. Markram, W. Gerstner, P. J. Sjöström, Spike-timing-dependent plasticity: a comprehensive overview, Frontiers in synaptic neuroscience 4 (2012) 1–3. [29] S. Song, K. D. Miller, L. F. Abbott, Competitive hebbian learning through spike-timingdependent synaptic plasticity, Nature neuroscience 3 (9) (2000) 919–926. [30] N. Caporale, Y. Dan, Spike timing–dependent plasticity: a hebbian learning rule, Annu. Rev. Neurosci. 31 (2008) 25–46. [31] J. Wang, A. Belatreche, L. Maguire, T. M. Mcginnity, An online supervised learning method for spiking neural networks with adaptive structure, Neurocomputing 144 (2014) 526–536. [32] A. Tavanaei, A. S. Maida, A spiking network that learns to extract spike signatures from speech signals, Neurocomputing 240 (2017) 191–199. [33] C. M. Bishop, Pattern recognition and machine learning, springer, 2006. [34] I. Goodfellow, Y. Bengio, A. Courville, Deep learning, MIT press, 2016. [35] A. Tavanaei, T. Masquelier, A. Maida, Representation learning using event-based STDP, arXiv preprint arXiv:1706.06699 (2017) 99. 19 [36] R. A. Fisher, The use of multiple measurements in taxonomic problems, Annals of human genetics 7 (2) (1936) 179–188. [37] Y. LeCun, The MNIST database of handwritten digits, com/exdb/mnist/. http://yann. lecun. [38] J. J. Wade, L. J. McDaid, J. A. Santos, H. M. Sayers, Swat: a spiking neural network training algorithm for classification problems, IEEE Transactions on Neural Networks 21 (11) (2010) 1817–1830. [39] Y. LeCun, L. Bottou, Y. Bengio, P. Haffner, Gradient-based learning applied to document recognition, Proceedings of the IEEE 86 (11) (1998) 2278–2324. [40] A. Tavanaei, A. S. Maida, Bio-inspired spiking convolutional neural network using layerwise sparse coding and STDP learning, arXiv preprint arXiv:1611.03000 (2016) 99. [41] S. R. Kheradpisheh, M. Ganjtabesh, S. J. Thorpe, T. Masquelier, STDP-based spiking deep convolutional neural networks for object recognition, Neural Networks (2017) 56– 67. [42] P. O’Connor, M. Welling, Deep spiking networks, arXiv preprint arXiv:1602.08323 (2016) 99. [43] P. U. Diehl, M. Cook, Unsupervised learning of digit recognition using spike-timingdependent plasticity, Frontiers in computational neuroscience 9 (2015) 99. [44] E. Neftci, S. Das, B. Pedroni, K. Kreutz-Delgado, G. Cauwenberghs, Event-driven contrastive divergence for spiking neuromorphic systems, Frontiers in neuroscience 7 (2014) 272. [45] Y. Bengio, T. Mesnard, A. Fischer, S. Zhang, Y. Wu, STDP-compatible approximation of backpropagation in an energy-based model, Neural computation (2017) 555–577. [46] G. Hinton, How to do backpropagation in a brain, in: Invited talk at the NIPS2007 Deep Learning Workshop, Vol. 656, 2007. 20
9cs.NE
Missing Data Prediction and Classification: The Use of Auto-Associative Neural Networks and Optimization Algorithms Collins Leke*, Bhekisipho Twala, and T. Marwala Abstract This paper presents methods which are aimed at finding approximations to missing data in a dataset by using optimization algorithms to optimize the network parameters after which prediction and classification tasks can be performed. The optimization methods that are considered are genetic algorithm (GA), simulated annealing (SA), particle swarm optimization (PSO), random forest (RF) and negative selection (NS) and these methods are individually used in combination with autoassociative neural networks (AANN) for missing data estimation and the results obtained are compared. The methods suggested use the optimization algorithms to minimize an error function derived from training the auto-associative neural network during which the interrelationships between the inputs and the outputs are obtained and stored in the weights connecting the different layers of the network. The error function is expressed as the square of the difference between the actual observations and predicted values from an auto-associative neural network. In the event of missing data, all the values of the actual observations are not known hence, the error function is decomposed to depend on the known and unknown variable values. Multi-layer perceptron (MLP) neural network is employed to train the neural networks using the scaled conjugate gradient (SCG) method. Prediction accuracy is determined by mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), and correlation coefficient (r) computations. Accuracy in classification is obtained by plotting ROC curves and calculating the areas under these. Analysis of results depicts that the approach using RF with AANN produces the most accurate predictions and classifications while on the other end of the scale is the approach which entails using NS with AANN. Keywords—Missing Data, Auto-Associative Neural Network, Multi-Layer Perceptron, Genetic Algorithm, Simulated Annealing, Particle Swarm Optimization, Random Forest, Negative Selection. Introduction Inferences and conclusions drawn from datasets with all required data entries are likely to be more reliable and useful than those which emerge from incomplete datasets. With this in mind, there are several ways in which the problem of missing data may occur in a dataset. Most significant ways entail data entry errors or failures at sensors which are meant to record the data. In this paper, the aim is to predict or classify a specific variable with all other variables present and complete. In the event of there being missing values in variables meant to be complete, missing data imputation techniques such as mean substitution or regression models are used to complete the data prior to the prediction or classification tasks. In a dataset with several input variables and a continuous prediction variable, the problem is how to determine the missing values for the prediction variable having some prior knowledge of the relationships between the input variables and the prediction variable. Are there any mechanisms to accurately predict the missing prediction variable values based on the observed relationships between variables? Furthermore, in a dataset with several input variables and one discrete output/prediction variable represented ideally numerically by 0 or 1 in a two class case for easy analysis, given that all other data entries are provided and the only missing data is that of the discrete prediction variable, is there a means of determining this value correctly, thereby assigning an unseen data record into the correct class (0 or 1)? Moreover, we investigate and evaluate the capabilities of these algorithms in solving these kinds of problems on the respective datasets. With these known from the experiments performed in this paper, a comparative statistical analysis of the results obtained by these algorithms on the same dataset is performed to identify which algorithm yields the best results on the given dataset. Background A. Network design 1. Auto-Associative Neural Network Neural Networks are information processing models that simulate the manner in which biological nervous systems process information [Mistry et al. 2008]. There are four main constituents of any neural network and they include the processing units, activation functions, weighted interconnections and the activation rules [Mistry et al. 2008]. Auto-associative neural networks (AANN) are network models in which the network is trained to recall the inputs as the outputs (Lu and Hsu, 2002), thus guaranteeing the networks are able to predict the inputs as outputs whenever new inputs are presented. These networks have been used in a variety of applications [Atalla and Inman, 1998; Froloy et al. 1995; Smauoi and Al-Yakoob, 2003; Hines et al. 1998; Marwala 2001; Marwala and Chakraverty, 2006; and Brian et al. 2006]. An auto-associative network encoder also referred to as an auto-encoder consists of an input and output layer with the number of inputs being equal to the number of outputs, hence the name auto-associative [Lu and Hsu, 2002]. In addition to these two layers, there also is a narrow hidden layer. It is necessary that the hidden layer uses a lower dimension, so as to enforce the encoding and decoding processes [Mistry et al. 2008]. This hidden layer attempts to reconstruct the inputs to match the outputs by minimizing the error between the inputs and outputs with the introduction of new inputs. The narrow hidden layer forces the network to reduce any redundancies that may occur in the data whilst allowing the network to detect non-redundant data [Baek and Cho, 2003]. Figure 1 depicts the framework of an AANN. For the purpose of this work, one hidden layer is used as it has been proven that a single hidden layer network is capable of approximating any continuous multivariate function to any suitable degree of accuracy [Tim et al., 2004]. The number of nodes in the hidden layer is determined by the ability of the network to approximate the error function. Fig. 1: Auto-Associative Neural Network Structure 2. Multi-Layer Perceptron These networks consist of multiple layers of computational units usually interconnected in a feedforward manner [Mistry et al. 2008]. These networks have been used in several papers due to their stability and ease of use [Brian et al., 2006; Abdella and Marwala, 2005; and Tim et al., 2004]. They require an expected target in order to be trained and are therefore referred to as supervised learning networks due to this trait [Paul and Mitra, 2002]. A fully connected two layered MLP architecture is used in this paper. A NETLAB toolbox (Nabney, 2003) that runs in MATLAB is used to implement the network architecture. Figure 1 depicts the architecture of the MLP which is the platform on which the AANN is designed and trained. MLP networks learn how to transform an input data point into a target data point hence they are widely used for pattern classification [Brian et al., 2006]. A variety of learning techniques are used in MLP networks, the most frequently applied being back-propagation. In back-propagation, the obtained output values at the output units are compared with the actual output values to calculate the value of a predefined error function. The error is then fed-back into the network and is used by the algorithm to adjust the weights of each connection accordingly, so as to minimize the value of the error function [Brian et al., 2006]. This process, referred to as training the network, is done iteratively as the error function value tends to converge to a number small enough that it no longer changes with changing iterations. The MLP network can be described as per equation (1) [Ming-Hau, 2010]: (2) (1) (1) (2) 𝑑 𝑦𝑘 = 𝑓𝑜𝑢𝑡𝑒𝑟 (∑𝑀 𝑗=1 𝑤𝑘𝑗 𝑓𝑖𝑛𝑛𝑒𝑟 (∑𝑖=1 𝑤𝑗𝑖 + 𝑤𝑗0 ) + 𝑤𝑘0 ) (1) Here yk represents the kth output, fouter represents the output layer transfer function, finner represents the input layer transfer function, w represents the weights and biases, with the superscripts 1 and 2 representing the first and second layers respectively. B. Algorithms 1. Genetic Algorithms Genetic Algorithms (GAs) form part of a subclass of computational evolutionary algorithms in which the elements of the solution space have binary string representations. They can be defined as algorithms tasked with finding approximate solutions to complex problems through the application of evolutionary biology principles [Abdella and Marwala, 2005]. They make use of techniques derived from biological processes like inheritance, mutation, natural selection, and recombination [Abdella and Marwala, 2005]. Genetic algorithms are inspired by Darwin's theory about evolution. Solution to a problem solved by genetic algorithms is evolved. GAs have been proven to be successful in optimization problems like wire routing, scheduling, adaptive control, cognitive modelling, travelling salesman problems, optimal control problems and database query optimization problems [Abdella and Marwala, 2005]. GA begins with a set of solutions (represented by chromosomes) called population. Solutions from one population are taken and used to form a new population. This is motivated by a wish, that the new population will be better than the old one. Solutions which are selected to form new solutions (offspring) are selected according to their fitness - the more suitable they are the more chances they have to reproduce. This procedure is repeated until some condition (for example number of populations or improvement of the best solution) is satisfied. Genetic Algorithm therefore does not only demarcate itself in terms of its approach from conventional optimization techniques, but also offers another technique for situations where conventional methods are inefficient and inadequate. There are four ways in which genetic algorithms are different from conventional optimization methods and these are [Goldberg, 1989; Michalewicz, 1996; and Forrest, 1996]:     GA encodes solutions using a binary string representation, and this is the encoding which the algorithm works with. All of the individuals in the population are an encoding of a possible solution to the optimization problem being analysed; GA works concurrently with a population of solutions and not just one candidate solution; GA uses only a fitness function to perform the evaluation of possible solutions within the population and not any other information; GA incorporates an element of randomness to the search procedure, not solely dependent on deterministic rules. The main steps involved in the genetic algorithm implementation for solving a particular problem are as follows [Goldberg, 1989; and Michalewicz, 1996]:       Generate an initial random population of potential candidate solutions with an adequate problem specific representation; Generate an evaluation function and calculate the fitness value for each of the elements of the population; Create offspring by using three genetic operators (reproduction, crossover and mutation) which are determined such that they alter the composition of each offspring; Determine various parameters that the genetic algorithm uses (population size, probabilities of applying genetic operators, crossover probability, and mutation probability and so on). Evaluate the new solution (offsprings) and calculate the fitness of each solution and; If optimum solution is achieved, stop and return, otherwise create new offspring as in step 3 and evaluate their fitness. A pseudo-code for the genetic algorithm which illustrates a detailed description of how the genetic algorithm works can be found in Michalewicz (1996). 2. Simulated Annealing Simulated annealing is a probabilistic algorithm tasked with finding the global minimum of a function that may have several local minima [Dimitris and John, 1993]. It is also referred to as a random search algorithm that makes use of an analogy similar to the manner in which a metal loses heat and produces a low energy crystalline structure from a high heat and energy state, the annealing schedule, and the manner in which a discrete optimization problem is minimized [Busetti, 2012]. The atoms of the metal initially have high temperatures and this allows them to move freely and restructure themselves at will. A decrease in the temperature results in a decrease in the energy levels of these atoms to a state in which a minimum energy level is attained. The algorithm starts with the system having a very high temperature in a similar manner whereby the input values are allowed to take on a great range of variation in the values. The temperature is allowed to fall as the algorithm progresses and this enforces a limit on the degree to which the variable values are allowed to be dissimilar. This aspect of the algorithm often leads to the finding of a better solution. As far as there is a guarantee that there is a reduction in the temperature, there will be changes created in the algorithm inputs, producing successively better solutions and giving rise to an optimal set of values when the temperature is at its lowest. If the cooling process is sufficiently slow, the final configuration of the metal being cooled is such that it results in a solid with such superior structural integrity that it is free of all crystalline defects [Busetti, 2012]. Simulated Annealing has an advantage over other optimization techniques in that it is able to avoid being stuck in a local minimum [Busetti, 2012]. Each iteration of the simulated annealing algorithm applied to a discrete optimization problem guarantees that the objective function or fitness function generates values for two solutions which are compared to each other. Better solutions are always accepted, while a fraction of the not so good solutions are accepted with a probability in order to prevent the possibility of the algorithm being stuck in local minima in the search of global minima. The main disadvantage of this algorithm as commonly observed with stochastic local search algorithms is that defining some of the key parameters such as the initial temperature and cooling rate are subjective and must be done from an empirical basis. The SA algorithm is a technique which is capable of [Ingber, 1993]:     Processing evaluation functions which possess arbitrary degrees of non-linearities, discontinuities and which are of a stochastic nature; Processing quite arbitrary boundary constraints which are mandatory for the evaluation functions; Being implemented with relative ease, and with minimal coding when compared with other non-linear optimization techniques like genetic algorithms and; Statistically guaranteeing the finding of a global optimal solution. For this algorithm to work efficiently and always guarantee the return of a global optimal solution and not a local optimal solution some key elements are required and they are [Busetti, 2012]:     An adequate representation of the candidate solutions; A means of generating changes to these candidate solutions, and they should be random; An evaluation mechanism for the solutions using a fitness function and; An annealing schedule which involves choosing an initial temperature and rules for lowering it as the search process progresses. In spite of the positive aspects this algorithm presents, there is a weakness of the algorithm in terms of the obvious trade-off between the quality solutions obtained and the time it takes to compute them. More of the weaknesses of the algorithm could be found in Busetti (2012). Attaining an optimal solution by use of the simulated annealing algorithm could take an infinite amount of time, and this could be attributed to the process of carefully controlling the rate at which the temperature cools down. To overcome this problem, Fast annealing (FA), very fast simulated re-annealing (VFSR) or adaptive simulated annealing (ASA) which are progressively faster could be used [Busetti, 2012]. 3. Particle Swarm Optimization Particle Swarm Optimization is a computational algorithm that optimizes a problem by iteratively making an attempt to improve a candidate solution taking into account a specific measure of the quality of the solution [Birge, 2003]. The particle swarm optimization algorithm is based on two fundamental principles being social science and computer science [Del Valle et al., 2008]. Furthermore, PSO makes use of the swarm intelligence principle which is the characteristic of an environment in which the overall behaviours of primitive individuals that interact locally with one another and with their environment create coherent general functional patterns of behaviour. The optimization is achieved by having an initial population of candidate solutions, moving these around in a solution-space according to a simple mathematical formula, in this case the error/fitness function to be minimized, taking into account the particle’s position and velocity [Poli et al., 2007]. This algorithm can be thought of as a meta-heuristic as it makes few or no assumptions at all about the problem being optimized and can search very large spaces of candidate solutions [Poli et al., 2007]. In PSO literature, the term particles refers to a member of the population of candidate solutions which have no mass and volume, and are influenced by their velocities and accelerations towards a better behaviour. The approach used by the particle swarm optimization algorithm in solving a problem emerges from the interactions of individual particles in a population as well as the particles themselves, in a population wide phenomenon. These populations of particles form some kind of interconnected topology which is often referred to as a social network. The interconnected structure is ideally made up of two-way lines linking immediately adjacent particles, in such a way that if j is in i’s neighbourhood, then i will also be in j’s neighbourhood. There is communication between each of the particles and it is affected by the best point found by any member of its topological neighbourhood. This is the vector 𝑝⃗𝑖 for that best neighbour, which will be denoted by⃗⃗⃗⃗ 𝑝𝑔 . There have been a wide variety of population structures being applied in the implementation of this algorithm with some of the most commonly used ones being the ring topology or the wheel topology. In the PSO algorithm process, the velocity of each particle is iteratively adjusted so that the particle stochastically oscillates around the locations of 𝑝⃗𝑖 and⃗⃗⃗⃗ 𝑝𝑔 . The process for implementing the PSO algorithm is presented below [Poli et al., 2007]:       Initialize a population of particles with random positions and velocities on D dimensions in the search space: Loop: For each particle, evaluate the desired optimization fitness function in D variables: Compare the different particle’s fitness evaluation with its 𝑝𝑏𝑒𝑠𝑡𝑖 : o If current value is better than 𝑝𝑏𝑒𝑠𝑡𝑖 , then set 𝑝𝑏𝑒𝑠𝑡𝑖 equal to the current value and 𝑝⃗𝑖 equal to the current location 𝑥⃗𝑖 in D-dimensional space: Identify the particle in the neighbourhood with the best success so far, and assign its index to the variable g: Change the velocity and position of the particle according to the following equation: {   ⃗⃗(0, 𝜙1 ) ⊗ (𝑝⃗𝑖 − 𝑥⃗𝑖 ) + 𝑈 ⃗⃗(0, 𝜙2 ) ⊗ (𝑝⃗𝑔 − 𝑥⃗𝑖 ), 𝑣⃗𝑖 ← 𝑣⃗𝑖 + 𝑈 𝑥⃗𝑖 ← 𝑥⃗𝑖 + 𝑣⃗𝑖 If a criterion is met, usually a sufficiently good fitness function value or a maximum number of iterations, exit loop: end loop 4. Random Forest Random Forest (RF) is a method for classification and regression which was introduced by Breiman and Cutler and it is referred to as a learning ensemble consisting of a bagging of unpruned decision trees with a randomized selection of features at each split [Palmer et al., 2007]. Furthermore, as per Liaw and Wiener (2002), it could be referred to as an ensemble classifier that consists of many decision trees and outputs a prediction of a continuous variable which is obtained as the average of the prediction of all trees. This algorithm is widely used due to a relatively high level of accuracy in its predictions [Pantanowitz and Marwala, 2008]. A decision tree is one of the most popular learning methods commonly used for data exploration. It is a tree with nodes which represent information corresponding to attributes in the input vectors [Pantanowitz and Marwala, 2008]. The trees used in this algorithm are referred to as Classification and Regression Trees (CART). The prediction of missing data values is achieved by the algorithm creating a model which comprises of a number of CART trees as set by the programmer, training this model using the training dataset, and then testing the models prediction and classification capabilities using the test set. The predictions and classifications are attained by finding the averages of all the predictions of the individual CART trees created which best minimize the error function. It has been observed in recent studies that the Random Forest algorithm presents characteristics which make it very appealing for different areas of application. These features include relatively high levels of accuracy in predictions, built-in feature selection capabilities, and a mechanism for evaluating the influence of each feature or variable to the algorithm [Palmer et al., 2007]. It also provides a paradigm to carry out data visualization for high dimensional data; clustering, anomaly, outlier, and error detection; and explicit missing data imputation. Classification and Regression Trees (CART) are known to be fast and possess excellent accuracy levels [Pantanowitz and Marwala, 2008]. Random Forest regression theoretical background could be seen in the papers of Svetnik et al. (2003), Biau (2012), Breiman (2001), and Breiman and Cutler (Breiman and Cutler, 2012). This technique is based on the creation of an ensemble of decision trees which are used to carry out predictions of continuous variables by averaging the predictions of all trees, and a classification is obtained by use of a weighted or unweighted majority voting mechanism. In order to grow this ensemble of decision trees, random vectors are often generated that govern the growth of each tree in the ensemble [Breiman, 2001]. An early example is bagging, a scenario in which to grow each tree, a random selection is made from the data samples in the training set of data without any replacement [Biau et al., 2008; Breiman, 1996]. Yet another example is the random split selection approach in which at every node, a split is chosen at random from among the K-best splits identified [Dietterich, 2000]. There is another approach which entails generating new training set samples by randomly selecting outputs from the initial training set of data. Breiman (2001) suggested the random forest algorithm which adds an extra layer of randomness to the bagging process. The random forest algorithm also changes the way in which the classification and regression trees are created in addition to using a separate bootstrap sample of the data to create the trees. The procedure with standard trees is such that all of the nodes are split by making use of the best possible split from the entire list of variables and this radically speeds up the tree growing process. In a random forest, the procedure however is such that every node makes use of the best possible split from a subset of predictors selected at random at the node to carry out the node splitting procedure. The best splitter from the eligible random subset used to split the node might either be the best overall, or just a fairly good splitter, or may not be of any help at all. If the splitter is not very helpful, the outcome from the split is two nodes which are essentially similar. In addition to the previously mentioned benefits of the random forest algorithm, it is very easy to implement based on there being only two important control variables being the number of variables in the random subset to use for splitting at the nodes and the number of trees in the forest, and it has been observed that the algorithm is not influenced to a great extent by the values of these [Liaw and Wiener, 2002]. 5. Negative Selection The negative selection algorithm is based on the self/non-self discrimination principle or, in other words, the ability of the body to tell what the difference is between a self and a non-self-substance [Delahunty and Callaghan, 2004]. As stated above, the screening procedure that occurs within the body in the thymus gland is the basis on which this algorithm is designed. T-cells which are produced in the bone marrow are moved to the thymus where they undergo a maturation process in which the cells that generate responses to harmless substances are expelled and only the cells that do not adhere to the harmless substances remain. This procedure guarantees that the T-cells that remain are capable of recognizing only foreign or non-self-cells. These mature cells are then released into the body and eliminate any substances they can adhere to. Any substance that adheres to these mature cells and gets deleted is referred to as a non-self-substance. The negative selection algorithm uses a process which is analogous to that mentioned above so as to generate its negative detectors. A set of detectors are initially generated at random. All of the detectors then go through the maturation phase in which if any of these are observed to be similar to any of the components of the set of self substances, they are eliminated and substituted by a different detector which is generated randomly. This guarantees that the size of the set of detectors is unchanged throughout the maturation process. These newly generated detectors which are meant to replace the eliminated ones are also checked against the set of self-substances. The result from this entire process is mature detectors which are those that detect potentially non-selfsubstances only. The procedure is done repeatedly until the result is a set of mature detectors that only detect non-self-substances. After the creation of these mature detectors, they are presented new set of data elements. All of the mature detectors are used to try find matches against each and every component of the test set of data. Every time a match is found, it is assumed that a non-self-substance has been identified. This attribute is just one of the many advantages of the negative selection algorithm as it ensures the identification of unknown substances to the system. Methodology A. Experimental Setup The NETLAB toolbox [Nabney 2003] is used to create the auto-associative neural network. This toolbox has a 2-layer MLP network, which according to literature review (Bishop 1995) is capable of modelling any complex relationship, such as the financial model. The network implemented consist of an input layer, representing different inputs and prediction variable, mapped to an output layer representing the same characteristics as the input layer via the hidden layer. The network is thus trained to recall itself. One of the input nodes in the input layer represents the prediction variable, which is ultimately represented by one of the output nodes as well. The neural network equation can be written mathematically as in equation (2). {𝑦} = 𝑓({𝑥}, {𝑤}) (2) Since the network is trained to recall the inputs, the output vector {y} (predicted inputs) obtained will be approximately equal to the input vector {x} (actual input values). The weight vector is represented by {w}. An error, however, exists between the input vector {x} and the output vector {y} due to the fact that they would not always be equal and this error can be expressed as the difference between the input and output vector. This error is formulated as: 𝑒 = {𝑥} − {𝑦} (3) Substituting for {y} from equation (2) into equation (3) we get: 𝑒 = {𝑥} − 𝑓({𝑥}, {𝑤}) (4) In this work, a minimum and non-negative error will be used. This can be obtained by squaring the error function in equation (4) to obtain: 2 𝑒 = ({𝑥} − 𝑓({𝑥}, {𝑤})) (5) In the case of missing data and in an attempt to predict this missing data, one of the inputs in the input vector {x} was assumed as an unknown input, while the other input properties were considered as the known inputs. When the input vector {𝑥} has unknown elements, the input vector set can be categorized into {𝑥} known represented by {𝑥𝑘 } and {𝑥} unknown represented by {𝑥𝑢 }. Rewriting (4) in terms of {𝑥𝑘 } and {𝑥𝑢 }, we obtain: 𝑥𝑢 𝑥𝑢 𝑒 = (𝑥 − 𝑓 (𝑥 , {𝑤})) 𝑘 𝑘 2 (6) Here {𝑥𝑢 } represents the unknown input parameter, {𝑥𝑘 } represents the known input parameters, {𝑤} represents the weight vector that maps the auto-encoder network input vector {𝑥} to the same input vector {𝑥}. An estimated value for the prediction variable will then be obtained by choosing the value which is closest to the actual test set value, and which best minimizes equation (6) using the five algorithms. GA, however, always finds the optimal maximum value. To cater for this so that it finds the optimal minimum value instead, the negative of equation (6) is used. SA, PSO, RF, and NS do find the minimum value and as such require no alteration to the minimization of the error function given in equation (6). The error function to be minimized by GA is thus: 2 𝑥𝑢 𝑥𝑢 𝑒 = − (𝑥 − 𝑓 (𝑥 , {𝑤})) (7) 𝑘 𝑘 The algorithms are used to solve two problems being prediction and classification problems. Prediction or forecast is a representation of the manner in which things can occur in the future, almost but not always dependent on past experiences and occurrences. Classification refers to categorization which is a process whereby ideas and objects are recognized, differentiated, understood, and grouped. Figure 2: Diagrammatic Representation of Experimental Setup B. Problem Statement Although humans provide an immediate means of performing prediction and classification tasks, there are sometimes doubts with regards to the quality and accuracy of the predictions and classifications they produce. This brings forth the need for a more efficient and accurate means of performing these tasks. The use of historical data to create models that yield accurate outputs, and which can then be used on more recent and current data to perform these tasks is a growing area of research. There are several papers which have made use of AANNs to do predictions and classifications and have reported high accuracy levels. In this study, we use AANNs with five optimization algorithms (GA, SA, PSO, RF, and NS) to extract the nonlinear patterns from the input data, and use them to predict and classify specific prediction or classification variables from four separate datasets. C. Data Pre-Processing Three distinct datasets which vary in the number of data points and attributes are used in this study to solve prediction and classification problems. The Heart Disease dataset has 14 variables, 13 of these being independent variables, and the fourteenth being dependent on these and represents the health status of an individual. This variable has two classes (categories) only. There are categorical variables in the classification datasets which are the German Credit and Heart Disease datasets. These datasets however also have nominal, binary, and numeric variables. The German Credit dataset has a total of 25 variables with one of these representing the credit status of an individual. The Forest Fire dataset has 13 variables in total with the thirteenth, the area, being the prediction variable dependent on the other 12 variables. There are no categorical variables in this dataset. There also is the presence of outliers in the datasets, which are handled by normalizing the data to being within a given range, in this case between 0 and 1. The data is normalized using equation (8): 𝑥𝑠𝑐𝑎𝑙𝑒𝑑 = 𝑥 − 𝑥𝑚𝑖𝑛 𝑥𝑚𝑎𝑥 − 𝑥𝑚𝑖𝑛 (8) Where x is the value of a specific variable being considered, xmin is the smallest value for a specific variable, and xmax is the biggest value for the same variable. This equation ensures that all the values are in the range [0; 1]. The usual procedure for division of the data into three parts is followed, to assess the generalization ability of the network model. The latest 25% of the data is reserved for testing in all four datasets, and the remaining portion is divided into a training and validation dataset. The full set is split as follows for all four datasets used: 50% for training, 25% for validation and 25% for testing. D. Experiment 1: German Credit Data German Credit data from the UCI data repository [UCI, 2012] is used to train the network, and test the classification capabilities of the methods. The variables differ in range and data types but normalization of the values results in uniformity of these. There are no variable names used in this dataset for confidentiality reasons and as such the variables are represented by A1 to A25, representing all 25 attributes. A Multi-layer perceptron with 25 inputs, 25 outputs and 12 hidden nodes in one hidden layer was trained on the data. The number of hidden nodes in the network is obtained through an iterative process which tests the network for a number of hidden nodes from 2 to n - 1, in this case 25 - 1 = 24. That which results in the lowest network error is chosen as the optimal number of hidden nodes, in this case 12, and it is problem specific. A total of 1000 data points for each of the 25 variables were provided with 500 of each of these, accounting for 50% of the dataset used to train the network. The classification variable, being the Credit Status (A25), was assumed to have all 250 (25%) of its test data entries missing at random and the aim was to accurately predict and classify these from having prior knowledge of how the other variables affect the outcome. To measure the level of accuracy with which these algorithms are able to predict the expected outputs and classify individuals correctly, Receiver Operating Characteristic curves are plot and the areas under these are calculated. E. Experiment 2: Forest Fire Data An MLP neural network with 13 input units, seven hidden units in one hidden layer, and 13 output units were trained on the training set of the Forest Fire dataset from the UCI data repository [UCI, 2012]. A total of 259 (50% of dataset) training input patterns were provided for the network architecture. The elements from the test set (129 in total) for the prediction variable, the Area affected by fire (A13) in this case were removed and assumed missing and these were to be approximated by the algorithms. To assess the effectiveness of the algorithms in approximating the missing values, the mean squared error, root mean squared error, and mean absolute error were calculated for each missing value. F. Experiment 3: Heart Disease Data Heart Disease data from the UCI data repository [UCI, 2012] is used to train the network, and test the classification capabilities of the algorithms. The variables differ in range and data types but normalization of the values results in uniformity of these. The variables are represented by A1 to A14, representing all 14 input variables. A Multi-layer perceptron with 14 inputs, 14 outputs and eight hidden nodes in one hidden layer was trained on the data. The number of hidden nodes in the network is obtained through an iterative process which tests the network for different numbers of hidden nodes from 2 to n - 1, in this case 14 - 1 = 13. That which results in the lowest network error is chosen as the optimal number of hidden nodes, in this case eight, and it is problem specific. A total of 270 data points for each of the 14 variables were provided with 136 of each of these used to train the network. The classification variable, being the Heart Disease status, was assumed to have all 67 (25%) of its test data entries missing at random and the aim was to accurately predict and classify these individuals from having prior knowledge of how the other variables affect the heart disease status. To measure the level of accuracy with which these algorithms are able to predict the expected outputs and classify individuals correctly, ROC curves are plot and the areas under these are calculated. Results and Discussion The estimates used to measure the modelling quality for the prediction problems are the Mean Square Error (MSE), Root Mean Square Error (RMSE), and Mean Absolute Error (MAE). MSE is a measure of the square of the differences between the estimated output values and actual output values for the variable being considered. It provides a means of quantifying these differences. The smaller the MSE value, the better the prediction accuracy and vice versa. For a given dataset, the Mean Square Error (MSE) can be computed as follows: 𝑁 1 𝑀𝑆𝐸 = ∑(𝑥𝑖 − 𝑥̂𝑖 )2 𝑛 𝑖=1 RMSE is simply the mean square error in the original predicted value units and is regarded as a quadratic scoring rule that measures the average magnitude of the error. It is obtained by calculating the square root of the variance, known as the standard deviation. It differs from the MSE by providing a reduction in the variance, hence its application in this work. The Root Mean Square Error (RMSE) can be obtained by using the formula: 𝑁 1 𝑅𝑀𝑆𝐸 = √ ∑(𝑥𝑖 − 𝑥̂𝑖 )2 𝑛 𝑖=1 MAE is a measure which takes care of possible overestimation due to the presence of outliers in the dataset, and provides a statistical measure of how far estimates or forecasts are from the actual values. It measures the average magnitude of the errors in a dataset without considering direction. The Mean Absolute Error (MAE) can be computed by using the following formula: 𝑁 1 𝑀𝐴𝐸 = ∑|𝑥𝑖 − 𝑥̂𝑖 |2 𝑛 𝑖=1 In the equations above, N is the number of values present in the vector, {xi} is the actual value being considered at that specific instance, and {𝑥̂𝑖 } is the corresponding approximated value. To measure the classification capabilities of the algorithms, the Receiver Operating Characteristic (ROC) curve is plot, and the area under this is calculated. An ROC curve is a plot which graphically illustrates the performance of a binary classifier system as there is a variation in its discrimination threshold. ROC curves are obtained by plotting the fraction of true positives out of the positives (TPR) and false positives out of the negatives (FPR) at various threshold settings. The area under the ROC curve (AUC) gives a measure of the accuracy and level of efficiency with which the algorithms are able to correctly classify unseen records. Experiment 1: German Credit Data Statistical analysis of the results obtained was performed using the t-test. The null hypothesis (H0) states that there is no significant difference in the means of the predictions obtained by the GA, SA, PSO, RF and NS algorithms, for a population from which the sample used for analysis was obtained. The alternative hypothesis (HA) on the other hand states that there is a significant difference in the means of the predictions obtained by these five algorithms. TABLE II. STATISTICAL ANALYSIS OF THE GERMAN CREDIT DATA RESULTS Pairs Compared P-Values (95% Confidence Level) GA-SA 0.19 GA-PSO 0.00 GA-RF 0.48 GA-NS 0.00 SA-PSO 0.00 SA-RF 0.45 SA-NS 0.01 PSO-RF 0.00 PSO-NS 0.13 RF-NS 0.00 It can be seen in the above table that there is no significant difference at a 95% confidence level in the means of the predictions between the GA and SA algorithms (p-value: 0.19), and the GA and RF algorithms (p-value: 0.48). Findings however suggest that there is a significant difference in the means of predictions between the GA algorithm and the PSO and NS algorithms (p-value: 0.00 between GA and PSO, and p-value: 0.00 between GA and NS). This therefore indicates that the null hypothesis (HO), which assumes that there is no difference in the means between the GA algorithm and the RF and NS algorithms, can be rejected in favour of the alternative hypothesis (HA) at a 95% confidence level. Furthermore, it can be observed that there is a significant difference in the means of the predictions between the SA algorithm and the PSO and NS algorithms: SA and PSO (p-value: 0.00), and SA and NS (p-value: 0.01). This therefore suggests that the null hypothesis (HO) can be rejected in favour of the alternative hypothesis (HA) at a 95% confidence level. However, findings indicate that there is no significant difference between the means obtained by the SA and RF algorithms in the population at a confidence level of 95% with a p-value of 0.45. Moreover, the table reveals that there is a significant difference in the means of the predictions between the PSO algorithm and the RF algorithm (p-value: 0.00). However, findings suggest that there is no significant difference between the means of the predictions obtained by the PSO and the NS algorithms with a p-value of 0.13, resulting in the null hypothesis being accepted at a 95% confidence level. Finally, it is observed in the table that there is a significant difference in the means of the predictions between the RF and NS algorithms (p-value: 0.00), therefore, the null hypothesis (HO) is rejected in favour of the alternative hypothesis (HA) at a 95% confidence level. Experiment 2: Forest Fire Data Statistical analysis of the results obtained was performed using the t-test. The null hypothesis (HO) states that there is no significant difference in the means of the predictions obtained by the GA, SA, PSO, RF and NS algorithms, for a population from which the sample used for analysis was obtained. The alternative hypothesis (HA) on the other hand states that there is a significant difference in the means of the predictions obtained by these five algorithms. TABLE III. STATISTICAL ANALYSIS OF THE FOREST FIRE DATA RESULTS Pairs Compared P-Values (95% Confidence Level) GA-SA 0.69 GA-PSO 0.35 GA-RF 0.00 GA-NS 0.00 SA-PSO 0.61 SA-RF 0.00 SA-NS 0.00 PSO-RF 0.00 PSO-NS 0.00 RF-NS 0.00 It can be seen from the above table that there is no significant difference at a 95% confidence level in the means of the predictions between the GA and SA algorithms (p-value: 0.69), and the GA and PSO algorithms (p-value: 0.35). However, findings suggest that there is a significant difference in the means of predictions between the GA algorithm and the RF and NS algorithms (p-value: 0.00 between GA and RF, and p-value: 0.00 between GA and NS). This therefore indicates that the null hypothesis (HO), which assumes that there is no difference in the means between the GA algorithm and the RF and NS algorithms, can be rejected in favour of the alternative hypothesis (HA) at a 95% confidence level. Furthermore, it can be observed in the above table that there is a significant difference in the means of the predictions between the SA algorithm and the RF and NS algorithms: SA and RF (p-value: 0.00), and SA and NS (p-value: 0.00). However, findings indicate that there is no significant difference between the means obtained by the SA and PSO algorithms at a confidence level of 95% with a pvalue of 0.61. Moreover, the table shows that there is a significant difference in the means of the predictions between the PSO algorithm and the RF and NS algorithms (p-value: 0.00 between PSO and RF, and p-value: 0.00 between PSO and NS). This therefore suggests that the null hypothesis (HO) which assumes that there is no difference in the means between the PSO algorithm and the RF and NS algorithms can be rejected in favour of the alternative hypothesis (HA) at a 95% confidence level. Finally, it can be seen in the above table that there is a significant difference in the means of the predictions between the RF and NS algorithms (p-value: 0.00), therefore, the null hypothesis (HO) is rejected in favour of the alternative hypothesis (HA) at a 95% confidence level. Experiment 3: Heart Disease Data Statistical analysis of the results obtained was performed using the t-test. The null hypothesis (HO) states that there is no significant difference in the means of the predictions obtained by the GA, SA, PSO, RF and NS algorithms, for a population from which the sample used for analysis was obtained. The alternative hypothesis (HA) on the other hand states that there is a significant difference in the means of the predictions obtained by these five algorithms. TABLE IV. STATISTICAL ANALYSIS OF THE FOREST FIRE DATA RESULTS Pairs Compared P-Values (95% Confidence Level) GA-SA 0.99 GA-PSO 0.23 GA-RF 0.05 GA-NS 0.87 SA-PSO 0.22 SA-RF 0.04 SA-NS 0.87 PSO-RF 0.61 PSO-NS 0.24 RF-NS 0.02 The above table reveals that there is no significant difference at a 95% confidence level in the means of the predictions between the GA and SA algorithms (p-value: 0.99), the GA and PSO algorithms (pvalue: 0.23), and the GA and NS algorithms (p-value: 0.87). However, findings suggest that there is a significant difference in the means of predictions between the GA and RF algorithms (p-value: 0.05). This therefore indicates that the null hypothesis (HO), which assumes that there is no difference in the means between the GA algorithm and RF algorithm, can be rejected in favour of the alternative hypothesis (HA) at a 95% confidence level. Furthermore, the table shows that there is no significant difference at a 95% confidence level in the means of the predictions between the SA and PSO algorithms (p-value: 0.22), and the SA and NS algorithms (p-value: 0.87). Findings however suggest that there is a significant difference in the means of predictions between the SA and RF algorithms (p-value: 0.04). This therefore indicates that the null hypothesis (HO), which assumes that there is no difference in the means between the SA algorithm and RF algorithm, can be rejected in favour of the alternative hypothesis (HA) at a 95% confidence level. Moreover, it can be seen that there is no significant difference at a 95% confidence level in the means of the predictions between the PSO and RF algorithms (p-value: 0.61), and the PSO and NS algorithms (p-value: 0.24). Finally, the table reveals that there is a significant difference in the means of the predictions between the RF and NS algorithms (p-value: 0.02), therefore, the null hypothesis (HO) is rejected in favour of the alternative hypothesis (HA) at a 95% confidence level. Conclusion This research evaluates the effectiveness of using autoassociative neural networks and the Genetic Algorithm, Simulated Annealing, Particle Swarm Optimization, Random Forest, and Negative Selection algorithms in carrying out predictions and classifications of missing data entries from datasets. The approach used in solving the prediction problems involved the approximation of the values of a continuous variable. For the classification problems, the values to be approximated and determined all emerged from categorical/discrete variables. To evaluate the effectiveness of these methods, three distinct datasets were used all with the aim of solving two main problems being; prediction and classification problems. For the prediction problem, the Forest Fire dataset was used to predict the missing values from a continuous variable being the Area affected by a fire. The other two datasets being the German Credit and Heart Disease datasets were used to test the performances of the algorithms as classifiers. For the German Credit dataset, the aim was to classify new records into the right credit status of which there were only two (two classes or categories). The Heart Disease dataset had as output the health status of an individual with two categories depicting whether or not the person with the record had a heart disease. Auto-associative neural network with five optimization algorithms being; Genetic Algorithm, Simulated Annealing, Particle Swarm Optimization, Random Forest, and Negative Selection are suggested to carry out predictions and classifications of the missing values in datasets. An auto-associative neural network is a network which is trained to predict its inputs at the output layer. An MLP neural network is used to train the auto-associative neural network using the scaled conjugate gradient method. An error function is obtained when the network is trained by calculating the square of the difference between the predicted output values from the network, and the actual output values. Since one of the components of the input vector is assumed missing, the error function is broken down so as to depend on both the known and the unknown input vector components. The optimization algorithms are then applied at this stage to find approximations of the missing data entries in the input vector with the aim of minimizing the error function. Overall analyses of the results obtained from the experiments reveal that the Random Forest algorithm performed better than the Genetic Algorithm, Simulated Annealing algorithm, Particle Swarm Optimization algorithm, and Negative Selection algorithm. More precisely, analyses carried out on the results obtained for the prediction problem using the MSE, RMSE, and MAE values from the Forest Fire dataset revealed that the GA, SA, and PSO algorithms were observed to perform better than the RF algorithm although not statistically significant. However, when the performances of these four algorithms were compared against those of the NS algorithm for this dataset, the differences in these were significantly different as seen in Appendices A and B. For the classification problem using the two related datasets mentioned in the previous subsection, it was observed that the RF algorithm performed better than the GA, SA, PSO, and NS algorithms. The most significant differences in performance were observed when the AUC values for the RF algorithm were compared to those obtained by using the NS algorithm which produced the lowest AUC values on both datasets. The reason for the Random Forest algorithm doing very well compared to the other algorithms could be attributed to the fact that it is an ensemble approach or method. Ensemble methods use multiple models to obtain better predictive performance than could be obtained from any of the constituent models or from using just one method. An ensemble is a supervised learning algorithm due to the fact that it can be trained and then used to make predictions. Another advantage of the Random Forest algorithm over the other algorithms is the fact that during training, it is not sensitive to outliers in the training data, and there is no guarantee of such robustness to outliers from the GA, SA, PSO, and NS algorithms. Furthermore, with the Random Forest algorithm, there is no risk of over-fitting the data and setting the parameters is easy considering that there are very few parameters, one exactly in this research being the number of trees, which has no effect, regardless of what the value is on its predictive and classification capability. GA, SA, PSO, and NS all have several parameters which if not properly set, could lead to poor solutions being obtained, thus setting these parameters is quite vital. The most noticeable advantage of the Random Forest algorithm over the other algorithms is the fact that it is very fast in converging to a guaranteed optimal global solution. In this paper, we used neural networks as a learning method to train the datasets. Though the choice for neural network was as a result of its merits compared to other machine learning techniques and the fact that it has produced good solutions, it is worthwhile trying to investigate and construct the models using other machine learning techniques. One of these which could be used to solve the same problem could be to train the model using Decision Trees or Support Vector Machines instead of neural networks. Other optimization algorithms could be investigated such as ant colony optimization, Bees algorithm or Coocoo search. References [1] Aarts, E. and Korst, J. and Michiels, W., Simulated Annealing, Chapter 7., Philips Research Laboratories and Eindhoven University of Technology, Eindhoven, Netherlands, pg 187 - 210. [2] Abdella, M. and Marwala, T., The Use of Genetic Algorithms and Neural Networks to Approximate Missing Data in Database, International Conference on Computational Cybernatics, School of Electrical and information Engineering, University of the Witwatersrand, Johannesburg, South Africa, 13-16 April, 2005, pg 207 - 212. [3] Atalla, M. J. and Inman, D. J., On model updating using neural networks, Mech. Syst. Signal Proc., Vol 12, 1998, pg 135 - 161. [4] Baek, K. and Cho, S., Bankruptcy Prediction for Credit Risk using an Auto-Associative Neural Network in Korean firms, IEEE Conference on Computational Intelligence for Financial Engineering, Proceedings 2003, Department of Industrial Engineering, Seoul National University, March 20, 2003, pg 25 - 29. [5] Bertsimas, D. and Tsitsiklis, J., Simulated Annealing., Statistical Science, Vol 08, No.01, 1993, pg 10 - 15. [6] Biau G., Devroye L., and Lugosi G., Consistency of random forests and other averaging classifiers, Journal of Machine Learning Research, Vol. 9, pp. 2015-2033, 2008. [7] Biau G., Analysis of a Random Forests Model, Journal of Machine Learning Research, Vol. 13, pp. 1063-1095, 2012, LSTA and LPMA Universite Pierre et Marie Curie Paris VI Bote 158, Tour 1525, 2eme etage 4 place Jussieu, 75252 Paris Cedex 05, France. [8] Birge, B., PSOt a Particle Swarm Optimization Toolbox for use with Matlab, Swarm Intelligence Symposium, 2003. SIS ’03. Proceedings of the 2003 IEEE In Swarm Intelligence Symposium, doi:10.1109/sis.2003.1202265 Key: citeulike:2348281, pp. 182-186, NCSU, MAE Department, 726 N, West St. [9] Bishop, C. M., Neural Networks for Pattern Recognition., 1995, Oxford University Press, Oxford. [10] Breiman, L., Bagging predictors, Machine Learning, Vol. 24, No. 2, pp. 123140, 1996. [11] Breiman, L., Random forests, Machine Learning, Vol. 45, No. 1, pp. 5-32, 2001. [12] Breiman, L., Random Forest website, http://www.stat.berkeley.edu/breiman/RandomForests/cchome.html, last accessed: April 22, 2012. [13] Busetti, F., Simulated Annealing Overview., http://163.18.62.64/wisdom/Simulated annealing overview.pdf, lastchecked: 3 December, 2012, pg 1 - 10. [14] Dasgupta, D. and Krishnakumar, K. and Wong, D. and Berry, M., Selection Algorithm for Aircraft Fault Detection, In Artificial Immune Systems: Proceedings of ICARIS 2004, Division of Computer Science, University of Memphis, Memphis, TN, Computational Sciences Division, NASA Research Center, 2004, pg 1-14. [15] Dasgupta, D. and Forrest, S., An anomaly detection algorithm inspired by the immune system. In: Dasgupta D (eds) Artificial Immune Systems and Their Applications., Springer-Verlag, 1999, pg 262 - 277. [16] Delahunty, A. and Callaghan, O. D., Artificial Immune Systems for the Prediction of Corporate Failure and Classification of Corporate Bond Ratings Masters Thesis, University College Dublin, August, 2004. [17] Del Valle Y., Venayagamoorthy G. K., Mohagheghi S., Jean-Carlos H., Ronald G. H., Particle Swarm Optimization: Basic Concepts, Variants and Applications in Power Systems, IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, Vol. 12, No. 2, April 2008 . [18] Dietterich, T. G., An experimental comparison of three methods for constructing ensembles of decision trees: Bagging, boosting, and randomization, Machine Learning, Vol. 40, pp. 139-157, 2000. [19] Dimitris B., and John T., Simulated Annealing, Statistical Science, Vol. 8, No. 1, pg 10-15, 1993. [20] Forrest, S. and Perelson, S. and Allen, L. and Cherukuri, R., Selfnonself discrimination in a computer., IEEE Symposium on Research in Security and Privacy, 1994, pg 202 - 212. [21] Forrest S., Genetic algorithms, ACM Comput. Surv., Vol. 28, No. 1, pg. 77 - 80, 1996. [22] Forrest, S. and Hofmeyr, S. and Somayaji, A., Computer immunology., Communications of the ACM, Vol 40, No.10, 1997, pg 88 - 96. [23] Froloy, A. and Kartashov, A. and Goltsev, A. and Folk, R., Quality and efficiency of retrieval for Willshaw-like autoassociative networks., Recognition. Network: Computat. Neural Syst., Vol 2, No.6, 1995, pg 535 - 549. [24] Goldberg D., Genetic Algorithms in Search, Optimization, and Machine Learning, AddisonWesley, Reading, MA, 1989. [25] He, H. and Garcia, E. A., Learning from Imbalanced Data., IEEE Transactions on Knowledge and Data Engineering., Vol 21, No.09, September 2009, pg 1263 - 1284. [26] Hines, J. W. and Robert, E. U. and Wrest D. J., Use of autoassociative neural networks for signal validation., J. Intell. Rob. Syst., Vol 21, 1998, pg 143 - 154. [27] Hurwitz, E. and Marwala, T., Common Mistakes when ApplyingComputational Intelligence and Machine Learning to Stock Marketmodelling, University of Johannesburg, Johannesburg, South Africa,arXiv:1208.4429 [stat.AP], August 2012. [28] Ingber L., Simulated Annealing: Practice versus Theory, Mathl. Comput. Modelling, Vol. 18, No. 11, pg. 29 57, Pergamon Press Ltd, 1993. [29] Leke, B. and Marwala, T. and Tettey, T., Autoencoder Networks for HIV Classification., Current Science Journal., Vol 91, No.11, 2006, pg 1467 - 1473. [30] Liaw, A. and Wiener, M., Classification and Regression by randomForest., Vol 2-3, issue: ISSN 1609-3631, December 2002, pg 18 - 22. [31] Lu, P. J. and Hsu, T. C., Application of autoassociative neural network on gas-path sensor data validation., J. Propul. Power, Vol 18, 2002, pg 879 - 888. [32] Marwala, T., Probabilistic Fault identification using a committee of neural networks and vibration data., J. Aircraft., Vol 38, 2001, pg 138 - 146. [33] Marwala, T. and Chakraverty, S., Fault classification in structures with incomplete measured data using autoassociative neural networks and genetic algorithm., Curr. Sci., Vol 90, 2006, pg 542 - 549. [34] Michalewicz Z., Genetic Algorithms + Data Structures = Evolution Programs, Springer-Verlag, Berling Heidelberg, New York, third edition, 1996. [35] Ming-Hau, C., Pattern Recognition of Business Failure by Autoassociative Neural Networks in Considering the Missing Values, 2010 International Computer Symposium (ICS), Department of Information Management, Ling-Tung University, Dec 16 - 18, 2010, pg 711 - 715. [36] Mistry, J. and Nelwamondo, F. and Marwala, T., Estimating Missing Data and Determining the Confidence of the Estimate Data., Seventh international Conference on Machine Learning and Applications., 2008, pg 752 - 755. [37] Nabney, I. T., NETLAB: Algorithms for Pattern Recognition, SpringerVerlag., Vol 91, 2003, London, pg 325 - 365. [38] Pal, S. K. and Mitra, S., Multilayer Perceptron, Fuzzy Sets, and Classification, IEEE Transactions on Neural Networks, Vol 3, No.09, September 1992, pg 683 - 697. [39] Palmer, D. S. and O’Boyle, N. M. and Glen, R. C. and Mitchell, J. B. O., Random Forest Models To Predict Aqueous Solubility., Unilever Centre for Molecular Science Informatics., Vol 47, 2007, Department of Chemistry, University of Cambridge, Lensfield Road, Cambridge CB2 1EW, United kingdom., pg 150 - 158. [40] Pant, R., An Introduction to Simulated Annealing., http://www.aero.iitb.ac.in/ rkpant/webpages/DefaultWebApp/salect.pdf, lastchecked: 3 December, 2012, Aerospace Engineering Department, IIT Bombay. [41] Pantanowitz, A. and Marwala, T., Evaluating the Impact of Missing Data Imputation through the use of the Random Forest Algorithm, http://arxiv.org/ftp/arxiv/papers/0812/0812.2412.pdf, 2008, School of Electrical and Information Engineering, University of the Witwatersrand, Private Bag x3, Wits, 2050, Republic of South Africa. [42] Poli, R. and Kennedy, J. and Blackwell, T., Particle Swarm Optimization, An overview, Swarm Intell., Vol 01, 2007, pg 33 - 57. [43] Smauoi, N. and Al-Yakoob, S., Analyzing the dynamics of cellular flames using KarhunenLoeve decomposition and autoassociative neural networks., Soc. Ind. Appl. Math., Vol 24, 2003, pg 1790 1808. [44] Ssali, G. and Marwala, T., Estimation of Missing Data Using Computational Intelligence and Decision Trees, arXiv:0709.1640v1 [stat.AP], School of Electrical and Information Engineering, University of the Witwatersrand, Wits 2050, South Africa, Sept 11, 2007. [45] V. Svetnik, A. Liaw, C. Tong, J. Culberson, R. Sheridan, and B. Feuston, Random forest: A classification and regression tool for compound classification and QSAR modeling, Journal of Chemical Information and Computer Sciences, Vol. 43, pp. 1947-1958, 2003. [46] Tim, T. and Mutajogire, M. and Marwala, T., Stock market prediction using evolutionary neural networks, Fifteenth Annual Symposium of the Pattern Recognition, PRASA, School of Electrical and Information Engineering, University of the Witwatersrand, Wits 2050, South Africa, Nov 26, 2004. [47] Center for Machine Learning and Intelligent Systems, UCI Machine Learning Repository: Data Sets, 2012, http://archive.ics.uci.edu/ml/datasets.html, lastchecked:15 November, 2012.
9cs.NE
1 A Resistance Distance-Based Approach for Optimal Leader Selection in Noisy Consensus Networks arXiv:1708.06873v1 [math.OC] 23 Aug 2017 Stacy Patterson, Member, IEEE, Yuhao Yi, and Zhongzhi Zhang Abstract—We study the performance of leader-follower noisy consensus networks, and in particular, the relationship between this performance and the locations of the leader nodes. Two types of dynamics are considered (1) noise-free leaders, in which leaders dictate the trajectory exactly and followers are subject to external disturbances, and (2) noise-corrupted leaders, in which both leaders and followers are subject to external perturbations. We measure the performance of a network by its coherence, an H2 norm that quantifies how closely the followers track the leaders’ trajectory. For both dynamics, we show a relationship between the coherence and resistance distances in an a electrical network. Using this relationship, we derive closed-form expressions for coherence as a function of the locations of the leaders. Further, we give analytical solutions to the optimal leader selection problem for several special classes of graphs. I. I NTRODUCTION Consensus problems are an important class of problems in networked and multi-agent systems. The consensus model has been used to study a wide range of applications, including opinion dynamics in social networks [1], information fusion in sensor networks [2], formation control [3], and load balancing in distributed computing systems [4]. Over the past decades, much research effort has been devoted to analysis of the convergence behavior and robustness of consensus networks and to the derivation of relationships between system performance and graph theoretic properties. A type of consensus problem that has received attention in recent years is leader-follower consensus [5], [6], [7], [8], [9], [10], [11]. In leader-follower systems, a subset of nodes are leaders that track an external signal. The leaders, in essence, dictate the desired trajectory of the network. The remaining nodes are followers that update their states based on relative information exchanges with neighbors. Leaderfollower dynamics can be used to model formation control where, due to bandwidth limitations, only a small subset of agents can be controlled by a system operator [12]. In addition, leader-follower systems can also be used to model agreement dynamics in social networks in which some subset of participants exhibit degrees of stubbornness [13]. Leaderfollower dynamics have also been applied to the problem of distributed sensor localization [14]. In leader-follower systems, S. Patterson∗ is with the Department of Computer Science, Rensselaer Polytechnic Institute, Troy, NY 12180. Email: [email protected], Phone: 518276-2054 (∗ corresponding author) Y. Yi and Z. Zhang are with the Shanghai Key Laboratory of Intelligent Information Processing, School of Computer Science, Fudan University, Shanghai 200433, China. Email: [email protected], [email protected]. the system performance depends on the network topology and the locations of the leaders. This dependence naturally leads to the question of how to select the leaders so as to optimize performance for a given topology. We study the the performance of leader-follower networks where nodes are governed by consensus dynamics and are also subject to stochastic external disturbances. We consider two types of dynamics. In the first, referred to as noise-free leaders, leaders are not subject to disturbances and thus track the external signal exactly. In the second dynamics, called noisecorrupted leaders, all nodes are subject to the external perturbations. As in many works on noisy consensus networks [5], [15], [11], [10], we quantify the system performance by an H2 norm that captures the steady-state variance of the node states. We call this the coherence of the network. Coherence is related to the spectrum of the Laplacian matrix of the network; however, it is not always straightforward to relate this spectrum to the network topology and locations of leaders. In this work, we develop relationships between the steady-state variance for a given leader set and resistance distances in a corresponding electrical network. A similar approach was used to study the performance of a single noise-free leader [12]; we generalize this notion to an arbitrary number of noise-free leaders. Further, we develop a novel resistance-distance based approach to study coherence in networks with an arbitrary number of noise-corrupted leaders. We use this resistance distance-based approach to analyze the coherence for different network topologies based on resistance distances. In special classes of graphs, we can relate the resistance distance to graph distance, which gives us the optimal leader locations in terms of the graph distances between leaders. We also e derive closed form-expressions for the optimal single noise-free and noisecorrupted leaders in weighted graphs, the optimal k noise-free leaders in cycles and paths, the optimal two noise-free leaders in trees, and the optimal twof noise-corrupted leaders in cycles. The leader selection problem for noise-free leaders was first posed in [5]. This problem can be solved by an exhaustive search over all subsets of nodes of size k, but this proves computationally intractable for large graphs and large k. Several works have proposed polynomial-time approximation algorithms for the k-leader selection problem in noise-free leader-follower systems [14], [7], [15], [8]. In particular, we note that the solution presented in [15] yields a leader set whose performance is within a provable bound of optimal. With respect to analysis for the noise-free leader selection problem, the recent work by Lin [9] gives asymptotic scalings 2 of the steady-state variance in directed lattice graphs for a single noise-free leader, based on the graph distance from the leader. Our recent work [11] gives polynomial-time algorithms for optimal k-leader selection in weighted, undirected cycles and path graphs. The leader-selection problem for noisecorrupted leaders was first posed by Lin et al. [7], who also gave heuristic-based bounds and algorithms for its solution. In addition, other performance measures have been considered for the leader selection problem including controllability [16], [17] and convergence rate [6], [11]. The recent works by Fitch and Leonard [10], [17] study the optimal leader selection problem for noise-free and noisecorrupted leaders. These works also relate the steady-state variance to a graph theoretic concept, in this case, graph centrality. The authors define centrality measures that capture the performance of a given leader set. They then use this analysis to identify the optimal leader sets for various classes of graphs. We note that this work identifies the optimal single leader for noise-free and noise-corrupted graphs under slightly stronger assumptions than we make in our approach. In addition, [10] identifies the optimal k-noise free leaders in cycles, under the restriction that the number of nodes in the cycle is a multiple of k. We address cycles with an arbitrary number of nodes and provide a closed-form expression for the resulting steady-state variance for any leader set based on the graph distance between leaders. We view our proposed approach as complementary that in [10]; for some classes of networks, analysis is more straightforward under the resistance distance interpretation. Thus, our work expands the classes of networks that have known analytical solutions. A preliminary version of our work appeared in [18]. This earlier work gave analysis for noise-free leader selection in cycle and path graphs only, using the related concept of commute times of random walks rather than resistance distance. Our resistance-distance based approach greatly simplifies the analysis and presentation. The remainder of this paper is organized as follows. Section II describes the system model and dynamics, and it formalizes the leader selection problems. Section III describes the relationship between the system performance and resistance distance for both noise-free and noise corrupted leaders. This section also presents analysis of resistance distance for “building blocks”, i.e., components of graphs, that will be used to analyze specific graph topologies. Section IV gives closed-form solutions for the leader selection problem for various classes of graphs. In Section V, we compare the asymptotic behavior of coherence in leader-free and leaderfollower consensus networks, and in Section VI, we give an algorithm and a numerical example for increasing the size of a binary tree while maintaining the optimality of the two noise free leaders. Finally, we conclude in Section VII. II. S YSTEM M ODEL AND P ROBLEM F ORMULATION We consider a network of n agents, modeled by an undirected, connected graph G = (V, E, W ), where V is the set of agents, also called nodes, and E is the set of edges. The weight of edge (i, j), denoted by wij , corresponds to the (i, j)th component of the symmetric weighted adjacency matrix W . We let D denote the diagonal matrix P of weighted node degrees, with diagonal entries dii = j∈V wij . The matrix L = D − W is thus the weighted Laplacian matrix of the graph G. Each node i ∈ V has a scalar-valued state xi . The objective is for all node states to track an external signal x ∈ R. Some subset of nodes F ⊂ V are followers that update their states using noisy consensus dynamics, i.e., X ẋi = − wij (xi − xj ) + di , (1) j∈N (i) where Ni denotes the neighbor set of node i, and di is a zero-mean, unit variance, white stochastic noise process. The remaining set of nodes S = V \ F are leaders; leader nodes have access x. T We write the state of the system as xT = [xT l xf ], where xl are the leader states and xf are the follower states. We can then decompose the Laplacian of G as:   Lll Llf L= . Lf l Lf f A. Noise-Free Leader Dynamics We consider two types of leader dynamics. In the first, called noise-free leaders, leader states are dictated solely by x. Without loss of generality, we assume x = 0 [5], so leader nodes update their states as: ẋi = −κi (xi − x) = −κi xi , where κi ∈ R+ is the weight node i gives to the external signal, sometimes referred to as the degree of stubbornness of node i. The dynamics of the follower nodes can then be written as: ẋf = −Lf f x + df , (2) where Lf f is the principle submatrix of the Laplacian corresponding to the follower nodes, and df is the vector of noise processes for the followers. We quantify the performance of the system for a given leader set S by its coherence, i.e., the total steady-state variance of the follower nodes. This value is related to Lf f as follows [5], RN F (S) = lim t→∞ X i∈(V \S)  1  E xi (t)2 = tr (Lf f )−1 . (3) 2 Note that Lf f is positive definite for any S 6= 0 [5], and thus, RN F (S) is well defined. The total variance depends on the choice of leader nodes. The nose-free leader selection problem is to identify the leader set S of size at most k, such that RN F (S) is as small as possible, i.e., minimize RN F (S) (4) subject to |S| ≤ k. 3 B. Noise-Corrupted Leader Dynamics 3 … i We also consider dynamics with noise-corrupted leaders. In this case, the leader nodes update their states using both consensus dynamics and the external signal, and the leader states are also subject to external disturbances. We again assume, without loss of generality, that x is 0. The dynamics for leader node i are then: X ẋi = − wij (xi − xj ) − κi xi + di , 2 1 s n n-1 … Fig. 1. Augmented cycle graph with noise-corrupted leaders nodes 1 and i. j∈N (i) where κi is the degree of stubbornness of node i, i.e., the weight that it gives to its own state. The dynamics of the entire system can be written as: ẋ = −(L + Dκ DS )x + d, (5) where d is a vector of zero-mean white noise processes that affect all nodes, Dκ is the diagonal matrix of degrees of stubbornness, and DS is a diagonal (0,1) matrix with its (i, i)th entry equal to 1 if node i is a leader and 0 otherwise. We note that if S 6= ∅, then L + Dκ DS is positive semi-definite [19]. As with noise-free leaders, we define the performance of the system for a given set of leaders S in terms of the total steadystate variance, which is given by [7],  1 (6) RN C (S) = tr (L + Dκ DS )−1 . 2 The noise-corrupted leader selection problem is to identify the set of at most k leaders that minimizes this variance, i.e., minimize RN C (S) subject to |S| ≤ k. (7) This relationship can be generalized to multiple noise-free leaders. In this case, the resistance distance r(i, S) is the potential difference between follower node i and the leader set S with unit current. Proposition 1. The resistance distance r(i, S) from a node i ∈ V \ S to a leader set S 6= ∅ is related to Lf f as: r(u, S) = L−1 f f (i, i). Proof: Let B ∈ R|E|×|V | be the incidence matrix of G. For each edge e = (i, j) ∈ E, a direction is assigned arbitrarily. B(e, i) = 1 if node i is the tail of edge e, B(e, i) = −1 if node i is the head of edge e, and B(e, i) = 0 otherwise. A resistance r is assigned to each edge e = (i, j) such that r(e) = w1ij . Let K ∈ R|E|×|E| be a diagonal matrix with K(e, e) = r(e). It is easy to verify that B > K −1 B = L. Let i ∈ R|E| represent the current across all edges, and let v ∈ R|V | represent the voltages at all vertices. By Kirchoff’s law, B > i = c, where c ∈ R|V | denotes the external currents injected at all vertices, and by Ohm’s law, Ki = Bv. It follows that, Lv = c. III. R ELATIONSHIP TO R ESISTANCE D ISTANCE For a graph G = (V, E, W ), consider an electrical network with V the set of nodes and E the set of edges, where each edge (i, j) has resistance w1ij . The resistance distance between two nodes i and j, denoted r(i, j), is the potential difference between i and j when a unit current is applied between them. Let Lj denote the Laplacian matrix of G where the row and column of node j has been removed. It has been shown that [20], r(i, j) = L−1 (8) j (i, i), i.e., r(i, j) is given by the (i, i)th component of L−1 j . We now show how the performance measures RN F (S) and RN C (S) can be expressed in terms of resistance distances. A. Noise-Free Leaders For a single noise-free leader v, it follows directly from (8) that the total steady-state variance is determined by the resistance distances from all follower nodes to leader node v, RN F ({v}) = 1 2 X i∈V \{v} r(i, v). (9) Let vj = 0 for all leaders j ∈ S, and thus vT = [0 vfT ], where vf denotes the voltages for the follower nodes. Let ci = 1 for follower i and ck = 0 for followers k 6= i. Expanding (9), we obtain,      Lf f Llf 0 cl = , Lf l Lf f vf ei where ei is the canonical basis vector. Therefore, Lf f vf = ei , Since Lf f is positive definite, and thus, invertible, we have r(i, S) = vi = L−1 f f (i, i). The coherence for a set of noise-free leaders is given in the following theorem, which follows directly from Proposition 1 and (3). Theorem 2. Let G be a network with noise-free leader dynamics, and let S be the set of leaders. The coherence of G is: 1 X r(i, S). RN F (S) = 2 i∈V \S B. Noise-Corrupted Leaders For the case of noise-corrupted leaders, we obtain our expression for the coherence by constructing an augmented network. 4 Let G = (V, E, W ) be undirected weighted graph, and let S ⊆ V be a set of noise-corrupted leaders. We form the augmented graph G from G by adding a single node s to G and creating an edge from each node i ∈ S to s, with edge weight κi . An example is shown in Fig. 1 for an n-node cycle. The noise-corrupted leaders are nodes 1 and i. We let r(u, v) denote the resistance distance between nodes u and v in G The relationship between resistance distances in G and the coherence with a set S of noise-corrupted leaders is given in the following theorem. Theorem 3. Let G = (V, E, W ) be a network with noisecorrupted leader dynamics, and let S be the set of leaders. Let G = (V , E, W ) be the corresponding augmented graph. Then, the coherence of G is: 1X r(i, s). RN C (S) = 2 vertices i, j on the path, let dij denote their graph distance. Then, d2uy d2 . (10) r(u, {x, y}) = dux − ux = duy − dxy dxy Proof: We start by assigning 0 voltage to x and y. Then, we impose unit external current to u, which flows out from {x, y}. By definition, r(u, {x, y}) = vu , as defined in the proof of Proposition 1. It follows that, r(u, {x, y}) = 1 r(u,x) = dux − 1 + 1 r(u,y) = 1 dux 1 + 1 duy d2uy d2ux = duy − , dxy dxy (11) (12) where the second equality follows from Lemma 5, and (12) is obtained from (11) by applying the equality dux + duy = dxy . i∈V Proof: Let L be the weighted Laplacian of G, and let L be the weighted Laplacian of G. We denote by Ls the matrix formed from L by removing the row and column corresponding to node s. We first note that, by the construction of G, Ls = L + DS Dκ . By (8), for any node i ∈ V , −1 r(i, s) = (L + DS Dκ ) (i, i), from which we obtain: X  r(i, s) = tr (L + DS Dκ )−1 = 2RN C (S), i∈V where the last equality follows from (6). C. Useful Results on Resistance Distance We conclude this section by stating some useful results on resistance distance. Proposition 4. Let S ⊆ V , and for a node i ⊆ V , let Ui ⊆ S be the set of nodes in S for which there is path from i to some j ∈ U that does not traverse any other element in S. Then r(i, S) = r(i, Ui ). This proposition follows directly from the definition of resistance distance. Lemma 5 ([20] Thm. D). Consider an undirected connected graph G = (V, E, W ), and let duv denote the graph distance between u, v ∈ V , i.e., the sum of the edge weights along the shortest path between u and v. Then, r(u, v) ≤ duv , with equality if and only if there is single path between u and v. Lemma 6. Consider a weighted, undirected graph G = (V, E, W ), partitioned into two components A = (VA , EA , WA ) and B = (VB , EB , WB ) that share only a single vertex {x}. Let S ⊆ VB . Then for any u ∈ VA , Theorem 8 ([21], Thm. 2.1). Let G0 = (V, E 0 , W 0 ) be the graph formed by adding edge (i, j) to the connected, undirected graph G = (V, E, W ), with edge weight wij . For p, q ∈ V , let r(p, q) denote their resistance distance in G, and let r0 (p, q) denote their resistance distance in G0 . Then, 2 r0 (p, q) = r(p, q) − wij [r(p, i) + r(q, j) − r(p, j) − r(q, i)] . 4 (1 + wij r(i, j)) IV. L EADER S ELECTION A NALYSIS In this section, we use the resistance distance based formulations for coherence to provide closed-form solutions to the leader selection problems for several classes of networks. We first consider the case of a single leader v. For the noisefree case, 1 X RN F ({v}) = r(u, v). (13) 2 u∈V \{v} The expression (13) shows that the optimal single noise-free leader is the node with minimal total resistance distance to all other nodes. As shown in [17], this corresponds to the node with maximal information centrality. In the noise-corrupted case, 1X RN F ({v}) = r(u, s) 2 u∈V    X 1 =  r(u, v) + |V |κv  . 2 (14) u∈V \{v} r(u, S) = r(u, x) + r(x, S) where the last equality follows from Lemma 6. If all nodes exhibit the same degree of stubbornness, then the optimal noisefree leader and the optimal noise-corrupted leader coincide. However, if nodes exhibit different degrees of stubbornness, the single best leader may differ for the two dynamics. Lemma 6 is a generalization of Lemma E from [20]. Lemma 7. Consider a weighted, undirected path graph, with end vertices x and y. Let u be a vertex on the path. For any We next explore the leader selections problems for k > 1 leaders. For the remainder of this section, we restrict our study to networks where all edge weights and all degrees of stubbornness, κi , are equal to 1. 5 A. k Noise-Free Leaders in a Cycle B. k Noise-Free Leaders in a Path Consider a cycle n nodes, identified by 1, 2, . . . , n in a clockwise direction. We use the notation x ≺ y to mean that node x precedes node y on the ring, clockwise and dxy denotes the graph distance between nodes x and y where x ≺ y. For example, for n = 5, where x = 4 and y = 2, x ≺ y and dxy = 3. Theorem 9. Let G be an n-node cycle with k noise-free leaders, with n written n = k` + q, where ` and q are integers with 0 ≤ q < k. Let S = {s1 , . . . , sk } be the leaders and let c be a k-vector of graph distances between adjacent leaders, i.e., ci is the distance between leader si and leader si+1 , for i = 1 . . . k − 1, and ck is the distance between leader sk and leader s1 . Then: Consider a path graph with n nodes, identified by 1, 2, . . . , n. Let duv denote the graph distance between nodes u and v. Theorem 10. Let G be a path graph with n nodes, and let S = {s1 , . . . sk } be a set of k noise-free leaders. Let c be a (k + 1)-vector, where c1 = (s1 − 1) and ck+1 = n − sk . Let ci = si+1 − si , for i = 2, . . . , k. Then, 1) The coherence of G is RN F (S) = 1 T 12 (c c − k). 2) S is an optimal solution to the k-leader selection problem if and only if c ∈ C, where ) ( k X di = n . C = d | di ∈ {`, ` + 1}, i = 1 . . . k, i=1 Proof: We first find the total resistance distance to S for all nodes j such that with si ≺ j ≺ si+1 , X X r(j, S) = r(j, {si , si+1 }) (15) si ≺j≺si+1 si ≺j≺si+1 = cX i −1  = `− `=1 1 2 6 ci `2 ci   −1 , 1) The coherence of G is: k  1 X 2 1 2 c1 + c2k+1 + c1 + ck + (c − 1). 4 12 i=2 i (21) RN F (S) = 2) Let n be such that, for the optimal leader configuration, it holds that c1 + ck+1 = a, where 2 divides a and b = (n − 1) − a, where (k − 1) divides b. Then, the optimal solution to the k-leader selection problem is:   2(n − 1) − 3(k − 1) (22) c1 = ck+1 = round 6(k − 1) + 4 1 ci = ((n − 1) − 2c1 ) , i = 2 . . . k. (23) k−1 Proof: We first find the total resistance distance to S for all nodes u with 1 ≤ u < s1 : sX 1 −1 r(u, S) = u=1 u=1 n X (17) v=sk+1 r(v, S) = ck+1 (ck+1 + 1) . 2 si+1 −1 k T subject to 1 c = n X ci ∈ {1, . . . , n − 1}. r(u, S) = u=si +1 (19) (20) If k divides n, then it is straightforward to verify that c? = is a solution to the above problem. In this case, ` = nk . n k1 For n = kl + q, with q > 0, assume that c is a solution to (4) but c ∈ / C. Then there exists some component ci such that ci = ` + 1 + x for some integer x > 0 and some component cj such that cj = ` − y for some integer y > 0. Let c0 be such that c0i = ci − 1 and c0j = cj + 1 and c0` = c` for all 1 1 ` 6= i, ` 6= j. Clearly, 12 cT c − k > 12 (c0 )T c0 − k , which contradicts our assumption that c is a solution to (4). ci (ci + 1) , 2 (24) (25) The total resistance distances to S for all nodes u between si and si+1 can be obtained in a similar fashion to (15) - (17), 1X1 2 1 T RN F (S) = (ci − 1) = (c c − k). 2 i=1 6 12 With this, we can express problem (4) as an integer quadratic program:  1 minimize 12 cT c − k (18) u= where the first equality follows from Proposition 4 and Lemma 5. Similarly, the total resistance distance to S for all nodes v > sk is: (16) where (15) follows from (16) by Proposition 4 and Lemma 7. Applying Proposition 1, we obtain, ci X 1 2 (c − 1). 6 i+1 (26) Combining (24), (25), and (26) with Proposition 1, we obtain, RN F (S) = 1 X r(u, S) 2 u∈V \S = k 1 2 1 X 2 (c1 + c2K+1 + c1 + ck+1 ) + (ci − 1). 4 12 i=2 To find the optimal leader locations, we must solve the optimization problem, minimize subject to cT P c + rT d − k−1 12 1T c = n − 1 ci ∈ {1, . . . , n − 1}, (27) where P is the (k +1)×(k +1) diagonal matrix with diagonal 1 1 1 components [ 41 12 . . . 12 4 ], and r is a (k + 1)-vector with 1 r1 = rk+1 = 4 , and all other entries equal to 0. Let c? be a 6 solution to (27). Using a similar argument to that in the proof of Theorem 9, we can conclude c?1 = c?k+1 = a/2 for some even integer a, i.e., that leaders s1 and sk should each be the same distance from their respective ends of the path. Similarly, c?i = b/(k − 1) for i = 2 . . . k, i.e., the leaders s2 , . . . , sk−1 should be equidistant. T rooted at x, excluding those nodes in Ty , denoted by Tx = (Vx , Ex ), and (3) the induced subgraph of T consisting of nodes V − (Vx ∪ Vy ) ∪ {x, y}, which is denoted by Gxy = (Vxy , Exy ). Note that by Proposition 4, for u ∈ Vx , it holds that r(u, S) = r(u, x). Similarly, for u ∈ Vy , we have r(u, S) = r(u, y). We can therefore decompose RN F (S) as, Let q = a/2, so that the optimal leader placement has c?1 = 1 c?k+1 = q and c?i = k−1 ((n − 1) − 2q), for i = 2 . . . k. Then, we can reframe (27) as minimizeq∈{1,...,n} C(q), where, !  2 (n − 1) − 2q 1 2 (k − 1) −1 . C(q) = (q + q) + 2 12 k−1 RN F ({x, y}) =   X X X 1 r(u, x) + r(u, y) + r(u, {x, y}) 2 Relaxing the integer constraint, the value of q that minimizes C(q) is, 2(n − 1) − 3(k − 1) q? = . 6(k − 1) + 4 = Since C(q) is quadratic, the optimal integer value for q is round(q). The values for ci , i = 1 . . . k + 1, in (22) - (23) follow from the definition of q above. While the restriction that c1 = ck+1 and ci = ci+1 , i = 2 . . . k does not hold for all network sizes, it can be shown experimentally to hold for many. An example is a path graph with n = 40 and k = 3, where c1 = c4 = 3 and c1 = c2 = c3 = 11. u∈Vx u∈Vy u∈Vxy (28)   X X 1X r(u, {x, y}) , (29) duy + dux + 2 u∈Vx u∈Vy u∈Vxy where (29) follows from (28) by Lemma 5. With this decomposition, we can apply the building blocks described in Section III-C to identify the optimal 2 noise-free leaders in M -ary trees for various values of M . We begin with M = 2. Theorem 12. For the noise-free 2-leader selection problem in a perfect binary tree with height h ≥ 4, the optimal leaders are such that dxy = 4 and dxr = 2, and the resulting coherence is:   (n + 1) 25 7 RN F (S) = log2 (n + 1) − + . (30) 2 8 2 C. Two Noise-Free Leaders in Trees We next consider the 2-leader selection problem in rooted, undirected M -ary trees. An M -ary tree is a rooted tree where each node has at most M children. A perfect M -ary tree is an M -ary tree in which all non-leaf nodes have exactly M children and all leaves are in the same level. Let r denote the root node of the tree, and let h denote its height. We number the levels of the tree starting with the root, as 0, 1, 2, . . . , h. The root of the tree is at level 0, and the leaves of a perfect M -ary tree of height h are at level h. We use lev(x) to denote the level of a node. We begin with the following lemma, which gives general guidance for the optimal location of two leader nodes. Lemma 11. Consider a perfect M -ary tree T = (V, E). Let x, y ∈ V, x 6= y be such that their lowest common ancestor is a node of level ` > 0. Then, there exists y, z ∈ V, y 6= z, with lowest common ancestor r such that RN F ({x, y}) > RN F ({y, z}). The proof of this lemma is given in Appendix 11. Lemma 11 tells us that the optimal 2-leader set will not have two nodes in the same subtree of a child of r. We denote these two leaders by x and y, and assume there lowest common ancestor is r. Without loss of generality, we assume lev(x) ≤ lev(y). We denote the graph distances between x and y, x and r, and y and r by dxy , dxr and dyr , respectively. To study the coherence of this system, we decompose the tree into three subgraphs, (1) the subtree of T rooted at y, denoted Ty = (Vy , Ey ), (2) the subtree of The proof of Theorem 12 is given in Appendix B. It is interesting to note that the optimal leader locations are independent of the height of the tree. This independence of the height also holds for M > 2, as shown in the following theorems. Proofs are given in Appendix B. Theorem 13. For the noise-free 2-leader selection problem in a perfect ternary tree T (3) with height h ≥ 4, the optimal leaders are such that dxy = 2 and dxr = 1, and the resulting coherence is: RN F (S) = 2n + 1 (log3 (2n + 1) − 2) + 1 . 4 (31) Theorem 14. For the noise-free 2-leader selection problem a perfect M -ary tree T , with M ≥ 4 and h ≥ 4, the optimal leaders are such that dxy = 1 and dxr = 0, and the resulting coherence is:   1 1 n+ logM (nM − n + 1) 2 M −1 n(M 2 + M − 1) 1 − + . 2M (M − 1) 2M RN F (S) = (32) D. Two Noise-Corrupted Leaders in a Cycle Graphs Consider an n-node cycle with nodes labeled {1, 2, . . . , n}. We use Theorem 8 to determine the coherence of the graph as a function of the graph distance between nodes 1 and i. Theorem 15. In an n-node cycle with two noise-corrupted leaders, where n is even, the coherence is minimized with the 7 leaders are at distance n/2 apart, and the resulting coherence is: n3 + 16n2 + 44n − 16 RN C (S) = . (33) 24(n + 8) Proof: Without loss of generality, we assume node 1 and node i are noise-corrupted leaders. Let the graph G be the augmented graph shown in Fig. 1, omitting edge (i, s). By Lemma 7, for arbitrary nodes u, v ∈ {1, 2, ..., n}, their resistance distance in G is: |u − v|(n − |u − v|) r(u, v) = , n and the resistance distance from a node u ∈ {1, 2, . . . , n} is: r(u, s) = r(u, 1) + 1 = (u − 1)(n − (u − 1)) + 1. n Let G0 be the graph formed from G by the addition of edge (i, s). Then, for a node u ∈ {1, 2, ..., n}, the resistance distance from u to s in G0 is: 2 [r(u, i) + r(s, s) − r(u, s) − r(i, s)] 4 (1 + r(i, s)) (u − 1)(n − (u − 1) + 1− = n h i2 |u−i|(n−|u−i|) − (u−1)(n−(u−1)) − ((i−1)(n−(i−1)) −2 n n n    . 4 1 + (i−1)(n−(i−1)) + 1 n r0 (u, s) = r(u, s) − By Theorem 3, summing over all nodes u, we obtain: n 1X 0 1 2 RN C (S) = r (u, s) = (n + 6n − 1) 2 u=1 12 h 1   2i4 − 4i3 (n + 2) − 12n 2 + (i−1)(n−(i−1)) n i + i3 (2n2 + 6n + 11) + i(2n2 + n − 6) + 2n2 − 3n + 1 . (34) We note that this function is continuous over the interval [1, n]. We then take the derivative with respect to i: ∂ RN C (S) = ∂i h 1 2i5 − 5i4 (n + 2)) (6(−i2 + i(n + 2) + n − 1)2 ) + 4i3 (n2 + 3n + 5) − i2 (n3 + 6n + 20) i − 2i(n3 + 3n2 + n − 5) + n2 + n − 2 . The derivative has five roots. Of these, only i = (n + 2)/2 lies in the interval [1, n]. Further, it is a minima of ∂/∂iRN C (S). For even n, we substitute this value of i into (34) to obtain (33). Algorithm 1 Algorithm to add nodes to a perfect binary tree of height h, while maintaining optimality of the 2 leaders. Input: Th , with optimal 2 leaders x and y while there is a new node u to add do if last level of left or right subtree of x is not filled then Add node u to level h+1 of subtree of x with fewer leaves, breaking ties arbitrarily. else if last level of left or right subtree of y is not filled then Add node u to level h+1 of subtree of y with fewer leaves, breaking ties arbitrarily. else Add node u as leaf on level h + 1, in any remaining location. end if if level h + 1 is filled then h←h+1 end if end while V. C OMPARISON TO C OHERENCE IN L EADER -F REE N ETWORKS Network coherence has also been studied in graphs without leaders. In this setting, every node behaves as a follower, using the dynamics in (1). Coherence is measured as the total steadystate variance of the deviation from the average of all node states, 2  n n X X 1 E xi (t) − xj (t) . V = lim t→∞ n i=1 j=1 It has been shown that, for a network with a single noise-free leader, i.e.,|S| = 1 [5], RN F (S) ≥ V. In some sense, this means that adding a single leader increases the disorder of the network. In a leader-free cycle graph, it has been shown that the coherence V scales as O(n2 ) [3]. In a cycle with k noise-free leaders, where the leaders are located optimally, by Theorem 9,   1  n 2 T n2 k RN F (S) = 1 1−k = − . 12 k 12k 12 Thus for a fixed leader set size k, The coherence RN F (S) also scales as O(n2 ). Similarly, for the optimal two noisecorrupted leaders in a cycle, RN C (S) scales as O(n2 ). This shows that, in the limit of large n, in cycle networks, the disorder of the network is similar for leader-free and leaderfollower consensus networks. VI. N UMERICAL E XAMPLE Theorem 12 applies to the noise-free leader selection problem in a perfect binary tree. We now present an algorithm that can be used to grow the tree by adding nodes in a way that does not change the location of the optimal two noise-free leaders. Pseudocode for this tree-growing process is given in Algorithm 1. The algorithm is initialized with a perfect binary 8 r 9 ... log2(RNF) 8.5 A P (x, y ′ ) 8 B C P (x, y) 7.5 D E F G 7 y′ y x 6.5 60 70 80 90 100 110 120 130 n Fig. 2. Coherence for two-noise free leaders, as a perfect binary tree of height 5 is grown into a perfect binary tree of height 6 using Algorithm 1. tree of height h ≥ 4, with the optimal leader set {x̂, ŷ}, with dx̂r = 2 and dŷr = 2. In each iteration, a node is added in a location dictated by the algorithm. The analysis of this algorithm remains an open question. However, example executions, the algorithm is able to grow a tree from height h to height h + 1 without impacting the optimality of the leader nodes x and y. In Fig. 2, we show such and execution. The algorithm is initialized with a perfect binary tree of of height h = 5, with 63 nodes. Nodes are added according to the algorithm, until the tree is a perfect binary tree of height h = 6, with 127 nodes. The figure shows the coherence for every pair of leader nodes such that dxr ≤ 3 and dyr ≤ 3, in log scale. The coherence for the leader set {x̂, ŷ} is shown in red, while the coherence for each other leader set is shown in blue. As the figure shows, the coherence for {x̂, ŷ} is the smallest throughout the execution of the algorithm. VII. C ONCLUSION We have investigated the performance of leader-follower consensus networks under two types of leader dynamics, noisefree leaders and noise-corrupted leaders. For both leader dynamics, we have developed a characterization of the system performance in terms of resistance distances in electrical networks. With this characterization, we have derived closedform expressions for network coherence in terms of the leader locations. We have also identified the optimal leader locations in several special classes of networks. In future work, we plan to extend our analysis to study coherence in general leader-follower networks. We also plan to develop a similar mathematical framework to study coherence in second-order systems. A PPENDIX A P ROOF OF L EMMA 11 Proof: Let x and y be the optimal two noise-free leaders in a perfect binary tree T . Without loss of generality, let SD SB SE ... ... ... ... ... SA SF SC SG Fig. 3. Arrangement of nodes in perfect binary tree with two possible leader sets {x, y} and {x, y 0 }. lev(x) ≤ lev(y). Assume, for contradiction, that the lowest common ancestor of x and y is a node B that is a descendant of the root t. Let A be the parent of B, and let D and E be children of B. Let x be a member of the node set consisting of node B and the nodes in the subtree rooted at D. We denote this node set by SD . Let y be a node in the subtree rooted at E. We denote this node set by SE . Let SB denote the node set in the subtree rooted at B, excluding B and the nodes in SD and SE . This arrangement is shown in Fig. 3. Let C be another child of A, as shown in the figure, and let F and G be children of C, with the node sets of the the trees rooted at F and G denoted by SF and SG , respectively. Let SC denote the node set of the subtree rooted at C, excluding C and the nodes in SF and SG . We will prove that, for a node y 0 in the subtree rooted at G that is in the same location with respect to G that y is with respect to to E, RN F {x, y} > RN F {x, y 0 }. Let P (x, y) denote the vertices along the path between x and y, and let P (x, y 0 ) denote the vertices along the path between x and y 0 . Consider a pair of vertices u ∈ SD and k ∈ SF , where k is at the same location relative to F (in the subtree rooted at F ) that u is relative to D (in the subtree rooted at D). Denote the vertex on P (x, y) that is the nearest to u by p. We find the sum of the resistance distances of u and k to the respective leader sets {x, y} and {x, y 0 }. By Lemmas 5 and 7, Ru,k 0 Ru,k = r(u, {x, y}) + r(k, {x, y}) = dup + r(p, {x, y}) + dkB + r(B, {x, y}) , = r(u, {x, y 0 }) + r(k, {x, y 0 }) = dup + r(p, {x, y 0 }) + dkC + r(C, {x, y 0 }) . Noting that dBy = dCy0 and dxy0 = dxy + 2, and applying 9 Since dCy0 = dBy , Lemma 7, we have: 0 Ru,k − Ru,k =(dup − dup ) + (dkB − dkC ) 0 Ri,j − Ri,j =(diB − diB ) + (djB − djC ) 0 + (r(p, {x, y} − r(p, {x, y })) + r(B, {x, y}) − r(B, {x, y 0 }) + (r(B, {x, y}) − r(C, {x, y 0 })) =0 + 2 + + dpx − dBy − d2By dxy d2px d2px − (dpx − ) dxy dxy0 ! d2Cy0 − (dCy0 − ) dxy0 + r(B, {x, y}) − r(C, {x, y 0 })   d2 d2 =0 + 2 + dBx − Bx − (dBx − Bx ) dxy dxy0 ! 2 2 dBy dCy0 + dBy − − (dCy0 − ) dxy dxy0 ! 2(d2xp + d2By ) . =2− dxy (dxy + 2) Further, since dxp ≤ dxB and dxB + dBy = dxy , we obtain: 0 Ru,k − Ru,k ≥ 4(dxB dBy + dxy ) > 0. dxy (dxy + 2) Next, consider a pair of vertices v ∈ SE and ` ∈ SG , where ` is at the same location relative to G that v is relative to E. Denote the vertex on P (x, y) that is the nearest to v by q, and denote the vertex on P (x, y 0 ) that is nearest to ` by m The sum of the resistance distances from v and ` to the respective leader sets are (again, by Lemmas 5 and 7), Rv,` 0 Rv,` = r(v, {x, y}) + r(`, {x, y}) = dvq + r(q, {x, y}) + d`B + r(B, {x, y}) 0 0 = r(v, {x, y }) + r(`, {x, y }) = dvB + r(B, {x, y 0 }) + d`m + r(m, {x, y 0 }) . We note that dvq = d`m , dqy = dmy0 and dxy0 = dxy + 2. Then, 0 Rv,` − Rv,` =(dvq − dlm ) + (dlB − dvB ) + r(q, {x, y}) − r(m, {x, y 0 }) + r(B, {x, y}) − r(B, {x, y 0 }) ! d2my0 d2qy − (dmy0 − ) =0 + 2 + dqy − dxy dxy0   d2xB d2xB + dxB − − (dxB − ) dxy dxy0 2(d2xB + d2qy ) =2 − . dxy (dxy + 2) 0 Since dqy ≤ dBy and dxB +dBy = dxy , similar to Ru,k −Ru,k , 0 we obtain Rv,` − Rv,` > 0. For a pair of vertices i ∈ SB ∪ {B} and j ∈ SC ∪ {C}, where ` is at the same location relative to G that v is relative to E, define Ri,j = r(i, {x, y}) + r(j, {x, y}) = diB + r(B, {x, y}) + djB + r(B, {x, y}) 0 Ri,j = r(i, {x, y 0 }) + r(j, {x, y 0 }) = diB + r(B, {x, y 0 }) + djC + r(C, {x, y 0 }). =2 − 2(d2xB + d2By ) . dxy (dxy + 2) Since dxB + dBy = dxy , it follows that 0 Ri,j − Ri,j = 4(dxB dBy + dxy ) > 0. dxy (dxy + 2) Finally, we consider a vertex t that is not in the subtree rooted at B nor the subtree rooted at C. In this case, Rt = r(t, {x, y}) = dtB + r(B, {x, y}) Rt0 = r(t, {x, y 0 }) = dtA + r(A, {x, y 0 }). It follows that Rt − Rt0 = 2 − (dxB + 1)2 d2xB . + dxy dxy + 2 Recall that dxy = dxB + dBy . Thus, Rt − Rt0 > 0. Since |SD | = |SE | = |SF | = |SG | and |SB ∪ {B}| = |SC ∪ {C}|, by grouping vertices into pairs, we have shown that, n n 1X 1X r(i, {x, y}) > r(i, {x, y 0 }). 2 i=1 2 i=1 This contradicts our assumption that {x, y} is the optimal leader set. A PPENDIX B P ROOF OF T HEOREMS 12, 13, AND 14 We first define a quantity Ω(S) as: Ω(S) = X r(i, S) = 2RN F (S) . i∈V \S and note that a set S that is a minimizer of Ω(·) is also a minimizer of RN F (·). We next present a lemma that gives Ω(·) of a perfect M -ary tree with two noise free leaders . 10 Lemma 16. Let T be a perfect M -ary tree with height h. Let x and y be its two noise-free leaders, and assume that the lowest common ancestor of x and y is the root of T . Then,   M h+1 + 1 d2 Ω({x, y}) = dxr − xr M −1 dxy   2 M +1 h+1 +M + (M dxr −dxy + M −dxr ) (M − 1)2 (M − 1)3 dy   2(M + 1) 3 h − − + M h+1 M −1 (M − 1)2 (M − 1)3 dxy dxy M + + . (35) M −1 (M − 1)2 Proof: Recall that in (29), we decomposed the coherence into three terms: the coherence in the subtree rooted at x, the coherence in the subtree rooted at y, and the coherence at the remaining nodes. We can also devide Ω into three part as X X X Ω({x, y}) = dux + duy + r(u, {x, y}). u∈Vx u∈Vy u∈Vxy To simplify the first sum in (36), we first consider the subtrees rooted at nodes on the path from x to r, denoted by P (x, r) (excluding r): X R(Tj ) = j∈P (x,r) j6=x,r ((M − 1)h − M − 1) · M h dxr − 1 + M −1 (M − 1)2 + ((M − 1)dxr − (M − 1)h + 2) · M h−dxr +1 . (M − 1)2 (37) A similar expression can be obtained for the subtrees rooted at nodes on the path from r to y, substituting dxr with dyr . To simplify the second sum in (36), we also first consider the subtrees rooted on nodes on the path P (x, r), which is: X |Tj |rj ({x, y}) = M h+1 j∈P (x,r) j6=x,y  M +1 1 + (M − 1)2 (M − 1)3 dxy ((M − 1)dxr − M )((M − 1)(dxy − dxr ) + M ) (M − 1)3 dxy h+1 M . − (M − 1)3 dxy  + Mh We let Ty denote the subtree rooted at y, Tx denote the subtree rooted at x, excluding those nodes in Ty . The remaining subgraph is denoted by Gxy . We consider two cases: (1) x is not the root of T , and (2) x is the root of T . By Lemma 5, the resistance distance of a node i in Tx (or Ty ) to the leader set depends P only on the resistance distance to x (or y). Let R(Tx ) = i∈Tx r(i, x). The height of the subtree rooted at x is hx = h − dxr , where dxr is the graph distance between x and r. At each level i in Tx there are M i nodes, each at distance i from x. Thus,  Phx hx R(Tx ) = i=1 M i · i = (MM +1 . −1)2 (M hx − hx − 1)M A similar expression can be obtained for R(Ty ). We next consider Gxy . We can think of this subgraph as a path graph connecting nodes x and y, denoted by P (x, y), with each node in the path the root of its own subtree. For any node j on the path between x and y, r(j, {x, y}) is given by Lemma 7. For any node v in the subtree Tj , its resistance distance to {x, y} is r(v, {x, y}) = dvj + r(j, {x, y}). (38) As before, a similar expression can be obtained for the subtrees rooted at nodes on the path from r to y, substituting dxr with dyr . The above sums (37) and (38), and their corresponding sums for P (r, y) account for the subtrees rooted at two children of r, one containing leader x and one containing leader y. For each of the remaining M − 2 children of r, the total resistance distance to x and y from the subtree rooted at child v is R(Tv ) = ((h − 1)M − h)M h + M M h − 1 + (M − 1)2 M −1  dxr −  d2xr +1 . dxy Combining all of these sums and including r(r, {x, y}), we obtain R(Gxy ). Substituting the expressions for R(Tx ), R(Ty ), R(Gxy ), and the equality dyr = dxy − dxr into (29) leads to (35). Case 2: x is the root. In this case, R(Ty ) is the same as in Case 1, but R(Tx ) is now R(Tx ) = h X M h (M h − h − 1) + 1 (M − 1)M i−1 · i = . (39) M −1 i=1 From this, we obtain, R(Gxy ) = 16 (dxy 2 − 1) + P j∈P (x,y) j6=x,y (R(Tj ) + (|Tj | − 1)r(j, {x, y})) . The first term is the total resistance distance for nodes on the path from x to y. For the summation terms, first we compute the total resistance distance from nodes in the subtree rooted at j to j. Then, for each node in the subtree, excluding j, we add the resistance distance from j to {x, y}. An equivalent expression is: R(Gxy ) = X (R(Tj ) + |Tj |r(j, {x, y})) X j∈P (x,y) j6=x,y R(Tj ) + X j∈P (x,y) j6=x,y |Tj |r(j, {x, y}). dxy M Ω({r, y}) = + M −1 (M − 1)2   2 M +1 + M h+1 + (M −dxy + 1) (M − 1)2 (M − 1)3 dy   2(M + 1) 3 h + M h+1 − − , M −1 (M − 1)2 (M − 1)3 dxy (40) which is equal to (35) given dxr = 0. j∈P (x,y) j6=x,y = For R(Gxy ), we only need to consider the path from root to y by using (38). Combining (39) and (38), we obtain (36) Thus, we conclude that in a perfect M -ary tree, (35) holds for any leader set {x, y} where their lowest common ancestor is the root. 11 A. Proof of Theorem 12 B. Proof of Theorem 13 Proof: We first simplify (35) in Lemma 16 for M = 2, 6 Ω({x, y}) = 2 + 2h (2h − 6) + dxy − 2h+1 · dxy     d2 + 2h+1 + 1 dxr − xr dxy    3 h+1 −dxr −(dxy −dxr ) +2 2 +2 +2 . dxy Proof: Based on Lemma 16, we derive Ω({x, y}) for a perfect ternary with height h, where x and y have the root as their lowest common ancestor, (41) For a given dxy and h, we treat Ω as a continuous function with argument dxr . We derive expressions for its first and second derivative:    ∂Ω 2dxr = 2h+1 + 1 1− ∂dxr dxy    3 + 2h+1 2dxr −dxy − 2−dxr + 2 · ln 2 , (42) dxy     ∂2Ω 2 = 2h+1 + 1 − 2 ∂ dxr dxy    3 + 2h+1 2−dxr + 2dxr −dxy + 2 · (ln 2)2 dxy (43)     2  dxy 3 ≥ 2h+1 + 1 − + 2h+2− 2 + 2 (ln 2)2 . dxy dxy (44) From (42), we observe that Ω has an extremum at dxr = dxy /2. For dxy ≤ 5 and h ≥ 4, (44) is strictly positive, thus Ω is convex with respect to dxr . This means that dxr = dxy /2 is a minimizer for the given dxy . For h ≥ 4, and dxy ≤ 5, we examine the potential integer minimizers dxy = 5, dxr = 2; dxy = 4, dxr = 2; dxy = 3, dxr = 1; dxy = 2, dxr = 1; and dxy = 1, dxr = 1. By comparing them in Ω({x, y}) in (41), we find the minimum is always attained at dxy = 4, dxy = 2. 2 ∂Ω For dxy ≥ 6 and h ≥ 4, by checking ∂d and ∂∂2 dΩxr , we xr observe that Ω has two minima. Because of the symmetry of the function, these two minima must have the same value, and so we only need to study the solution where dxr ≤ dxy /2. Since dxy ≥ 6 and h ≥ 4, we have: ∂Ω ∂dxr dxr =0   = 2h+1 + 1  3    + 2h+1 + 2 ln 2 2−dxy − 1 < 0 , dxy and ∂Ω ∂dxr dxr =2    4 = 2h+1 + 1 1− dxy     3 1 + 2h+1 + 2 ln 2 22−dxy − > 0. dxy 4 Therefore, an integer minimizer of Ω is attained in the set dxr ∈ {0, 1, 2}. It is readily verified that for h ≥ 4 and dxy ≥ 6, Ω|dxy ≥6,dxr =k ≥ Ω|dxy =4,dxr =2 , for k ∈ {0, 1, 2}. This implies that dxy = 4, dxr = 2 is the integer solution that minimizes Ω for all h ≥ 4. We obtain the expression for RN F in (30) by substituting dxy = 4, dxr = 2 and n = 2h+1 − 1 into (41) and applying Ω = 2RN F .   d2 3h+1 + 1 dxr − xr 2 dxy   3h+1 1 (3dxr −dxy + 3−dxr ) + 1+ 2 dxy   3h+1 dxy 3 2 3 + + h− − + . 2 2 dxy 2 4 Ω({x, y}) = (45) For a given dxy , we find its first and second derivative,   ∂Ω 3h+1 + 1 2dxr = 1− ∂dxr 2 dxy   1 h+1  3 + · 3dxr −dxy − 3−dxr (46) + 1 · ln 3 2 dxy   ∂2Ω 1 = (3h+1 + 1) − ∂ 2 dxr dxy   1 3h+1  dxr +dxy + 3−dxr 3 + + 1 · (ln 3)2 2 dxy     dxy 1 1 + 3h+1− 2 + 1 · (ln 3)2 . (47) ≥ (3h+1 + 1) − dxy dxy Similar to the proof of Theorem 12, we obtain that dxy = 2, dxr = 1 is the optimal integer solution for any h ≥ 4 and dxy ≤ 2. By enumerating all dxy , dxr , given dxy ≤ 4, we can verify that dxy = 2, dxr=1 is the optimal solution for any h ≥ 4 and dxy ≤ 4. 2 ∂Ω As shown by ∂d and ∂∂2 dΩxr , for a given dxy , Ω has two xr minima. Because of the symmetry of (45), we only need to study the minimum that satisfies dxr ≤ dxy . For any given dxy ≥ 5, h ≥ 4, ∂Ω = ∂dxr dxr =0   1 3h+1 + 1 3h+1  −dxy + 3 −1 + 1 (ln 3) < 0 2 2 dxy ∂Ω = ∂dxr dxr =2   h+1 3 +1 4 3h+1  2−dxy 1 1 1− + 3 − ( + 1)(ln 3) > 0. 2 dxy 2 9 dxy Thus, the optimal real-valued dxr lies in (0, 2). By evaluating (45) for k ∈ {0, 1, 2}, it can be verified that, Ω|dxy ≥5,dxr =k ≥ Ω|dxy =2,dxr =1 . Thus, we have shown that dxy = 2, dxr = 1 is the global integer minimizer for all h ≥ 4 in perfect ternary trees. We obtain (31) by substituting dxr = 1, dxy = 2 into (41) and applying n = (3h+1 − 1)/2 and Ω = 2RN F . 12 R EFERENCES C. Proof of Theorem 14 Proof: We start by calculating ∂Ω ∂dxr and ∂2Ω ∂ 2 dxr .,    ∂Ω M h+1 + 1 2dxr + (ln M )M h+1 = 1− ∂dxr M −1 dxy (M M +1  dxr −dxy −dxr (M −M ) + (M − 1)3 dy    ∂2Ω M h+1 + 1 2 = + (ln M )2 M h+1 1− 2 ∂ dxr M −1 dxy (M M +1  dxr −dxy −dxr (M +M ). + (M − 1)3 dy [1] M. H. DeGroot, “Reaching a consensus,” J. Amer. Statist. Assoc., vol. 69, no. 345, pp. 118–121, 1974. 2 − 1)2 (48) 2 − 1)2 (49) From (48) and (49), we observe that Ω has a minimum that d dxy satisfies dxr ≤ xy 2 . Since Ω is symmetric about dxr = 2 , d we only consider potential integer minimizers with dxr ≤ xy 2 . Further, ∂Ω ∂dxr   Mh 1 2 M + )(M − 1)2 (1 − ) (M − 1)3 Mh dxy dxr =1    M +1 + 2(M − 1) + (50) )(M 2−dxy − 1 ln(M ) , dxy = ∂Ω and observe that ∂d |dxy =2,dxr =1 = 0. For dxy ≥ 3, we can xr lower bound (50) by ∂Ω ∂dxr  Mh 2 > M (M − 1)2 (1 − ) (M − 1)3 dxy dxr =1  M +1 ) ln(M ) . − (2(M − 1) + dxy (51) For dxy ≥ 3, the bound (51) is positive for M = 4 and h ≥ 4, and it is increasing in M , dxy and h. Thus, for all dxy ≥ 2, the integer minimizer of dxr will be either 0 or 1. Further, for dxy = 1, the only potential solution that satisfies dxr ≤ dxy /2 is dxr = 0. We propose that the optimal integer solution is dxy = 1, dxr = 0, and we validate its optimality by comparing with dxy ≥ 2 and dxr ∈ {0, 1}. For dxy ≥ 2, Ω|dxr =0 − Ω|dxy =1,dxr =0 =  1 (M − 1)2 dxy (dxy − 1) (M − 1)3 dxy h+1−dxy ((2dxy + 1)M − 2dxy + 1)  + M (dxy (M − 1)2 − M (M + 1)) , +M h which is positive for M ≥ 4. In addtion, Ω|dxr =1 − Ω|dxy =1,dxr =0 =  1 (M − 1)2 (d2xy − 1) 3 (M − 1) dxy + M h+2−dxy ((2dxy + 1)M − 2dxy + 1)  + M h (dxy (M − 1)3 − M (M 2 + 2)) , is also positive for dxy ≥ 2 and M ≥ 4. Therefore, the optimal leader set {x, y} is such that dxy = 1, dxr = 0 when M ≥ 4 and h ≥ 4. Then, (32) is obtained by substituting dxr = 0, dxy = 1, n = (M h+1 − 1)/(M − 1) into (35) and using the fact that Ω = 2RN F . [2] L. Xiao, S. Boyd, and S. Lall, “A scheme for robust distributed sensor fusion based on average consensus,” in Proc. 4th Int. Sym. Information processing in sensor networks, 2005, p. 9. [3] B. Bamieh, M. Jovanovic, P. Mitra, and S. Patterson, “Coherence in large-scale networks: Dimension-dependent limitations of local feedback,” IEEE Trans. Autom. Control, vol. 57, no. 9, pp. 2235–2249, Sep 2012. [4] G. Cybenko, “Dynamic load balancing for distributed memory multiprocessors,” J. Parallel Distrib. Comput., vol. 7, no. 2, pp. 279–301, Oct. 1989. [5] S. Patterson and B. Bamieh, “Leader selection for optimal network coherence,” in Proc. 49th IEEE Conf. Decision and Control, 2010, pp. 2692–2697. [6] A. Clark, B. Alomair, L. Bushnell, and R. Poovendran, “Minimizing convergence error in multi-agent systems via leader selection: A supermodular optimization approach,” IEEE Trans. Autom. Control, vol. 59, no. 6, pp. 1480–1494, Jun 2014. [7] F. Lin, M. Fardad, and M. Jovanovic, “Algorithms for leader selection in stochastically forced consensus networks,” IEEE Trans. Autom. Control, vol. 59, no. 7, pp. 1789–1802, Jul 2014. [8] S. Patterson, “In-network leader selection for acyclic graphs,” in Proc. American Control Conference, 2015, pp. 329–334. [9] F. Lin, “Performance of leader-follower multi-agent systems in directed networks,” arXiv:1606.02269, 2016. [Online]. Available: https://arxiv.org/abs/1606.02269 [10] K. Fitch and N. Leonard, “Joint centrality distinguishes optimal leaders in noisy networks,” IEEE Trans. Control Netw. Syst., vol. 3, no. 4, pp. 366–378, 2016. [11] S. Patterson, N. McGlohon, and K. Dyagilev, “Optimal k-leader selection for coherence and convergence rate in one-dimensional networks,” IEEE Trans. Control Netw. Syst., vol. PP, no. 99, pp. 1–1, 2016. [12] P. Barooah and J. Hespanha, “Graph effective resistance and distributed control: Spectral properties and applications,” in Proc. 45th IEEE Conf. Decision and Control, Dec 2006, pp. 3479–3485. [13] L. Vassio, F. Fagnani, P. Frasca, and A. Ozdaglar, “Message passing optimization of harmonic influence centrality,” IEEE Trans. Control Netw. Syst., vol. 1, no. 1, pp. 109–120, March 2014. [14] P. Barooah and J. Hespanha, “Error scaling laws for linear optimal estimation from relative measurements,” IEEE Trans. Inf. Theory, vol. 55, no. 12, pp. 5661–5673, Dec 2009. [15] A. Clark, L. Bushnell, and R. Poovendran, “A supermodular optimization framework for leader selection under link noise in linear multi-agent systems,” IEEE Trans. Autom. Control, vol. 59, no. 2, pp. 283–296, Feb 2014. [16] A. Olshevsky, “Minimum input selection for structural controllability,” in Proc. American Control Conference, 2015, pp. 2218–2223. [17] K. Fitch and N. Leonard, “Optimal leader selection for controllability and robustness in multi-agent networks,” in Proc. European Control Conference, 2016. [18] S. Patterson, “Optimizing coherence in 1-d noisy consensus networks with noise-free leaders,” in Proc. American Control Conference, 2017. [19] A. Rahmani, M. Ji, M. Mesbahi, and M. Egerstedt, “Controllability of multi-agent systems from a graph-theoretic perspective,” SIAM J. Control Optim., vol. 48, no. 1, pp. 162–186, 2009. [20] D. Klein and M. Randic, “Resistance distance,” J. Math. Chem., no. 1, pp. 81–95, 1993. [21] Y. Yang and D. J. Klein, “A recursion formula for resistance distances and its applications,” Discrete Appl. Math., vol. 161, no. 16-17, pp. 2702–2715, Nov. 2013.
3cs.SY
Smile detection in the wild based on transfer learning Xin Guo1 and Luisa F. Polanı́a2 and Kenneth E. Barner1 arXiv:1802.02185v1 [cs.CV] 17 Jan 2018 1 Department of Electrical and Computer Engineering, University of Delaware, Newark, DE 19716, USA 2 American Family Mutual Insurance Company, Madison, WI 53783, USA Abstract— Smile detection from unconstrained facial images is a specialized and challenging problem. As one of the most informative expressions, smiles convey basic underlying emotions, such as happiness and satisfaction, which lead to multiple applications, e.g., human behavior analysis and interactive controlling. Compared to the size of databases for face recognition, far less labeled data is available for training smile detection systems. To leverage the large amount of labeled data from face recognition datasets and to alleviate overfitting on smile detection, an efficient transfer learningbased smile detection approach is proposed in this paper. Unlike previous works which use either hand-engineered features or train deep convolutional networks from scratch, a well-trained deep face recognition model is explored and fine-tuned for smile detection in the wild. Three different models are built as a result of fine-tuning the face recognition model with different inputs, including aligned, unaligned and grayscale images generated from the GENKI-4K dataset. Experiments show that the proposed approach achieves improved state-ofthe-art performance. Robustness of the model to noise and blur artifacts is also evaluated in this paper. I. INTRODUCTION A smile is considered the most common human facial expression to convey emotions of joy, happiness, and satisfaction ([1]). Smile detection has multiple applications in different domains, such as human behavior analysis ([2]), photo selection ([3]), product rating ([4]), and patient monitoring ([5]). Recent longitudinal studies have used smile information from images to predict future social and health outcomes ([6], [7], [8]). For example, [8] showed that the smile intensity in Facebook profile pictures is correlated with satisfying social relationships and is a predictor of selfreported life satisfaction after 3.5 years. Another application is related to the smile shutter function of modern consumer cameras. In 2007, Sony released its first camera Cybershot DSC T200 equipped with a smile shutter function that perceives three human faces in the scene and takes a photograph if a smile is perceived. Similarly, in 2011, Samsung released its first smart phone with a smile shutter functionality, the Samsung Galaxy mini S5570. It is reported that the smile shutter in both the Sony and the Samsung devices is only capable of detecting big smiles but unable to detect slight smiles ([5]). All these applications motivate the development of robust and automatic smile detection algorithms. During the last two decades, the image processing and computer vision communities have developed many smile detection algorithms ([9]). For example, in [10], local binary This material is based upon work supported by the National Science Foundation under Grant No. 1319598. patterns (LBP) were used as main image descriptors for smile detection. The authors reported a classification accuracy of 90% using support vector machines (SVM) and a small dataset of 5781 images. A smile detector based on the ViolaJones cascade classifier was proposed in [11]. The detector achieved a classification accuracy of 96.1% on a small testing dataset of 4928 images. Although the classification accuracy was high, the employed images were mainly frontal and were captured under tightly controlled conditions. An important contribution to the field of automatic smile detection was introduced by [9]. They collected the GENKI4K database, which contains 4000 real-life face images, downloaded from publicly available Internet repositories, which have been labeled as either smiling or non-smiling by human coders. The relevance of this dataset is that it contains a large number of images that span a wide range of imaging conditions and camera models, as well as variability in ethnicity, gender, age, and background. Prior to the GENKI4K dataset, the employed datasets for smile detection were overly constrained and led to non-generalizable results. The GENKI-4K database has become the standard dataset for evaluating smile recognition algorithms in the wild. For example, [12] proposed a smile detection approach that uses intensity differences between pixels in the grayscale representation of the GENKI-4K face images as features. They used AdaBoost to choose and combine weak classifiers and reported a classification accuracy of 88%. Among the latest algorithms for smile detection are the convolutional neural networks (CNN)-based algorithms, which learn hierarchical feature representations with higher level features formed by the composition of lower level features ([13]). The high classification accuracy achieved by CNNs has led them to become the state-of-the-art in smile detection in the wild. For example, in [14], a CNN architecture of 4 convolutional layers and 1 fully-connected layer was trained from scratch for smile detection. The authors achieved a classification accuracy of 94.6%, which is greater than any accuracy attained by previous methods on the GENKI-4K dataset. Similarly, [15] proposed to use a CNN for smile detection. They used model selection for choosing the CNN parameters and used both the face and mouth regions as inputs. They used the DISFA database ([16]), whose images were captured under laboratory-controlled conditions. A CNN architecture, referred to as Smile-CNN, was recently proposed by [17] to perform smile detection. The architecture consists of 3 convolutional layers and 1 fully-connected layer, and was trained from scratch on images from the GENKI-4K dataset. The authors attained an Fig. 1. Example of a CNN architecture. average classification accuracy of 92.4% and 91.8% using an SVM and an AdaBoost classifier, respectively. In this paper, we introduce a CNN-based approach that uses transfer learning to achieve a classification accuracy of 95.38% on the GENKI-4K dataset, which is greater than that obtained by previous CNN-based smile recognition methods. Specifically, our contributions include the finetuning of the VGG-face model ([18]) with images from the GENKI-4K dataset, incorporation of face alignment to enhance the performance of the CNN model, and evaluation of the model robustness to image artifacts, such as noise and blur. The motivation for fine-tuning a pre-trained model is that available datasets for smile recognition are small to train a deep neural network from scratch. Even the GENKI4K dataset has a limited size of 4000 images, which differs from the large-scale datasets typically used to train CNNs from scratch, which are in the order of millions of images ([18], [19]). orientation invariance, CNNs combine local receptive fields, shared weights, and downsampling. Local receptive fields mean that a layer receives inputs from a set of units located in a small neighborhood in the previous layer, which allow neurons to extract primitive visual features, such as oriented edges and corners. Since units in a layer are organized in planes, weight sharing means that units within a plane share the same set of weights and perform the same operation on different parts of the image. Such planes and set of weights are usually referred to as feature maps and filter banks, respectively. The filtering operation performed by a feature map is equivalent to discrete convolution, which earned the CNN its name. Apart from enforcing shift-invariance, weight sharing is essential for reducing the number of trainable parameters, which otherwise may grow very rapidly for high-dimensional inputs and lead to intractable networks. Downsampling refers to the introduction of layers to reduce the resolution of the feature maps, which in turn reduces the sensitivity to small translations and distortions. A typical downsampling technique is known as max-pooling and consists of computing the maximum of a local patch of units in one feature map. A standard CNN architecture contains four types of layers: convolutional, fully-connected, activation, and pooling. II. BACKGROUND Remarkable progress has been made in image recognition in recent years, mainly due to the availability of large-scale labeled datasets, modern graphics processors, the revival of deep CNNs, and the capability of CNNs to enable transfer learning. This section briefly describes CNNs and transfer learning. B. Transfer learning Two difficulties of training CNNs are the high number of needed training samples and annotations and the long time required to fully train the networks ([21]). There are many applications that suffer from deficit of training samples, and therefore, fully training a CNN becomes impractical for those cases. For example, medical imaging applications. The concept of transfer learning, as applied to visual recognition tasks, refers to transferring image representations learned with CNNs on large datasets to other visual recognition tasks with limited training data ([22]). The intuition behind this idea is that convolutional layers provide generic mid-level image representations that can be transferred to new tasks. The natural hierarchical feature representation of CNNs, going from low-level features to more complex features, allows features to be shared between unrelated tasks. Features learned from large-scale datasets, e.g., ImageNet, can replace hand-crafted features in other tasks. Specifically, the process starts by removing the last fully-connected layer and then, use the rest of the CNN as a fixed feature extractor A. Convolutional Neural Networks In the context of visual recognition, a CNN is a type of feed-forward neural network that learns image features from pixels through convolutions, matrix multiplications, and nonlinear transformations, constructing a non-linear mapping between the input and the output. The lower convolutional layers extract and combine local features from the input image, and the top convolutional layers are able to learn more complicated structures by combining features from previous layers. Fully-connected layers convert the features of the top convolutional layers into a 1-dimensional vector that is categorized by a trainable classifier. CNNs are trained using backpropagation ([20]). Fig. 1 illustrates, as an example, a CNN architecture of 4 convolutional layers and 1 fullyconnected layer. Feature learning for images is not a trivial problem because there are scale, orientation, and position variations for individual images. To mitigate for the high variability in the data and ensure some degree of scale, translation, and 2 Fig. 2. System diagram. Original facial images are first detected and aligned, then fed to the CNN model for classification into two categories: smile and non-smile. for the new dataset. Alternatively, the features learned from large-scale datasets can serve as a better weight initialization for networks being trained with limited data. This process is known as fine-tuning and can be performed in two different ways. That is, either all the layers of the CNN can be finetuned or the high-level portion of the CNN can be fine-tuned while some of the earlier layers can be kept fixed to prevent overfitting. The motivation for fine-tuning is that the lowlevel features of a CNN contain more generic features, e.g., edge detectors, while higher-level features become more specific to the given task. smaller convolution filters to keep the number of parameters tractable. The 16-layer VGG architecture is as follows. The input to VGG is a fixed-size RBG image of 224 × 224 pixels. All the convolutional layers have a fixed small receptive field which is 3 × 3. The convolution stride and the spatial padding are both fixed to 1 pixel. Each convolutional layer is followed by a Rectified Linear Unit (ReLU) layer as in [19]. Spatial downsampling is performed through max-pooling over a 2 × 2 pixel window, with stride 2, after 2 or 3 convolutional layers. A stack of 13 convolutional layers are followed by three fully-connected layers, where the first two have 4096 channels each, and the third has a number of channels that depends on the classification task. The last layer is the softmax layer. The activation function for each fully-connected layer is a rectified linear unit as well. In [18], the VGG-face model was presented as the result of training the 16-layer VGG architecture on a very large-scale dataset for face recognition. The dataset contained 2.6M images of 2.6K celebrities and public figures. The VGGface model became the state-of-the-art for face recognition on the YouTube Faces dataset. III. M ETHODS This section describes the face detection and alignment methods used in our experiments to preprocess the raw facial images, and the details for fine-tuning the VGG-face model. The pipeline of the method is shown in Fig. 2. A. Preprocessing Faces are first detected using the method described in [23]. The motivation for using this method is that it provides facial landmarks which can be used for face alignment via a 2D affine transformation where the left and right eye corners of all the images are aligned to the same positions. The next step is to crop and rescale the face regions to 256 × 256 pixels. Samples of cropped and aligned face patches are shown in Fig. 2. Smile detection requires the modeling of subtle and localized variations between images. By eliminating some of the other type of variability in the data that is not relevant for smile detection, e.g., head pose variations, face alignment is expected to help the network better learn the optimal features for smile detection. C. Fine-tuning The architecture of the VGG-face model is modified by changing the number of neurons in the last fully-connected layer to 2, indicating a binary classification having as targets smile and non-smile facial expressions. With the exception of the last fully-connected layer, the modified architecture is initialized with the VGG-face model ([18]), which is expected to be better than random Gaussian weights initialization since it was trained on 2.6M facial images. The last fullyconnected layer is initialized with weights sampled from a Gaussian distribution of zero mean and variance 1 × 10−4 . Because the features learned from CNN layers typically correspond to generic features, such as contours and edges, the weights of all the convolutional layers are kept the same as in the VGG-face model, while the weights of the first two fully-connected layers are fine-tuned and the last fullyconnected layer is trained from scratch. B. VGG Net The 16-layer VGG architecture was presented in [21] as a new architecture that bids the performance of AlexNet ([19]) in the ImageNet Large-Scale Visual Recognition Challenge (ILSVRC). To this end, the authors increased the depth of AlexNet by adding more convolutional layers and used 3 TABLE I GENKI-4K PARTITION FOR CROSS - VALIDATION Subset Number of smile faces Number of non-smile faces 1 540 460 2 541 459 3 540 460 4 541 459 Fig. 3. Examples of smiling (top two rows) and non-smiling (bottom two rows) faces in the wild. Images are from the GENKI-4K database. The goal is to train the model that minimizes the average error of the final soft-max layer. The learning parameters of the model, such as learning rate and weight decay of the network, are set the same as in the VGG-face model, then gradually adjusted based on grid search. As a result, all the model learning parameters are the same as in the VGG-face model except the initial learning rate, which is scaled by a factor of 10. More precisely, the learning rate is initially set to 1 × 10−3 and then decreased by a factor of 10 when the accuracy on the validation set stops increasing. The weight decay coefficient is set to 5 × 10−4 . Stochastic gradient descent is used to optimize the network with minibatches of 64 samples and momentum coefficient of 0.9. The training images are rescaled to 256 × 256 and randomly cropped to 224 × 224 patches to generate the input to the network. The training data is further augmented by flipping the images horizontally with 50% probability. Fig. 4. Random feature maps learned from CNN layers of a sample aligned face (refer to ([18]) for a description of the VGG layers). First row: 2 feature maps learned from conv1 2, each feature map of size 224 × 224. Second row: 4 feature maps learned from conv2 2, each feature map of size 112 × 112. Third Row: 8 feature maps learned from conv3 3, each feature map of size 56 × 56. Fourth row: 16 feature maps learned from conv4 3, each feature map of size 28 × 28. Fifth row: 32 feature maps learned from conv5 3, each feature map of size 14 × 14. parameters of the head of most of the images is within ±20◦ from frontal position), background, age, gender, ethnicity, facial hair, hat, and glasses. All the images are manually labeled. GENKI-4K contains 2162 and 1838 smiling and non-smiling facial images, respectively. Sample images are shown in Fig. 3. IV. E XPERIMENTAL R ESULTS B. Comparison with state-of-the-art methods This section describes the experiments that validate the performance of the fine-tuned VGG-face model for smile detection using three different inputs, including aligned, unaligned and grayscale images generated from the GENKI4K dataset. Evaluation of the models is performed in terms of classification accuracy and robustness to noise and blur artifacts. All the experiments were carried on 2 NVIDIA K40C GPUs, each with 12GB GDDR5. To perform a fair comparison with state-of-the-art methods, the GENKI-4K dataset is first randomly divided into four subsets, having 1000 samples each, and then, those subsets are used for four-fold cross-validation. The number of smiling faces and non-smiling faces for each fold are shown in Table. I. Each time, one subset is used for testing and the other three are used for training. The average detection rate and the standard deviation of the four-fold are reported as the final performance. All the images are preprocessed as described in Section III-A. As discussed in Section III-C, the weights of all the convolutional layers are set the same as the VGG-face model weights because features extracted from CNN layers are generic features and because the VGG-face model was A. Database The VGG-face model is fine-tuned and tested on the GENKI-4K ([9]) database. The images were taken by ordinary people for their own purpose, thus resulting in a wide range of imaging conditions, both outdoors and indoors, as well as variability in illumination, pose (yaw, pitch and roll 4 C. Impact of face alignment and color channels 20 In a real-world scenario, facial landmarks may be hard to detect due to occlusion and illumination, resulting in misaligned faces. Similarly, color images may not always be available, and we have to content ourselves with grayscale images. In this section, the impact of face alignment and color information in the performance of fine-tuned VGGface models is evaluated. Our approach to evaluate the impact of face alignment requires training and testing the model with the original unaligned GENKI-4K images using only face detection and cropping as preprocessing. On the other hand, to evaluate the impact of color information, the GENKI-4K images are first preprocessed as described in Section III-A, then converted to grayscale and fed to the fine-tuned VGG model for training and testing. Note that since the input of the VGG-face model requires the three color channels, the same grayscale image is fed to the red, green, and blue channels to convert a singlechannel image to a 3-channel one. The same cross-validation partitioning described in Table I is employed for this experiment and the results are compared with the classification accuracy attained using the original GENKI-4K images after cropping and face alignment. As expected, experimental results (Table III) show that the models trained with the aligned RGB images perform better that the models trained with the unaligned and grayscale images. However, the decrease is small, less than 1%, which means that the fine-tuned VGG-face model can achieve high classification accuracies even when the data exhibits high variability of head poses (within ±20◦ from frontal position) and loss of color information. 10 0 0 1000 2000 3000 4000 0 1000 2000 3000 4000 0 1000 2000 3000 4000 0 1000 2000 3000 4000 20 10 0 20 10 0 20 10 0 Fig. 5. Features of fc7 layer for 2 smiling faces and 2 non-smiling faces. Left column: the aligned faces; right column: the values of features extracted after the fc7 layer, the horizontal and vertical axes correspond to the feature index and the feature values, respectively. trained on 2.6M facial images. Sample feature maps from CNN layers of a smile image are shown in Fig. 4. It can be seen that low-level convolutional layers generally learn edges and outlines while the features become more abstract and sparse for upper layers. The first two and the last fullyconnected layers are fine-tuned and trained from scratch on the GENKI-4K dataset, respectively. The features of the last fully-connected layer, fc7 (4096 features), are extracted and compared for 2 smiling and 2 non-smiling faces in Fig. 5. As shown in the figure, features within the same class have similar feature values and trends, despite variations in gender, illumination and head pose. D. Evaluation under image quality distortion Image distortions, such as image noise and blur, have demonstrated their power to fool a well-trained deep learning network ([28], [29]). In this section, the fine-tuned VGGface model is evaluated on distorted images to evaluate its robustness. Noise in the images may result from using low-quality camera senors in the real world. Noise is modeled as Gaussian noise added to each color channel of each pixel separately. The standard deviation of the noise is varied from 1 to 10 in steps of 1. Blur may occur either because a camera is not focused properly on the target of interest or because the target is moving. A Gaussian kernel with varying standard deviation from 1 to 10 in steps of 1 is used to blur the images. The size of the filter window is set to 4 times the standard deviation. Sample images of noisy and blurred images under different Gaussian variations are shown in Fig. 6. The results in Fig. 7 indicate that the fine-tuned VGGface model is robust to noise and blur to some degree, given that the classification accuracy remains high (above 80%) regardless of the image artifacts. It is worth noting that the accuracy of blurred images almost stays the same before the standard deviation of the Gaussian kernel reaches 6. The number of weight and bias parameters of the original VGG-face model is around 138M. However, the number of trainable parameters of the fine-tuned VGG-face model is 120M since the parameters of all the convolutional layers are kept fixed during training. Despite having a reduction of only 13% in the number of parameters, training takes only 30 minutes to converge at 1000 iterations. The performance of the fine-tuned VGG-face model is compared with state-of-the-art methods in Table II. These methods are related to either the extraction of handcrafted features, such as histogram of oriented gradients (HOG) and local binary patterns (LBP), or to CNN models trained from scratch. The proposed fine-tuned VGG-face model outpeforms all the methods in Table II in terms of classification accuracy and also exhibits a small variance. It is worth noting that most of the other methods use classifiers that are more sophisticated than the softmax classifier, such as SVM and extreme learning machine (ELM). However, the representational power of the features learned by CNN models reduces the need for using sophisticated classifiers. 5 TABLE II C OMPARISON WITH THE STATE - OF - THE - ART METHODS ON THE GENKI-4K DATABASE . Method [24] [12] [25] [17] [26] [14] [27] The proposed method Features LBP HOG LBP Pixel comparison HOG (labeled) HOG (labelled + unlabelled) Raw pixels Raw pixels Learned features Learned features Guassian CNN-Basic CNN-2Loss HOG31 + GSS + Raw pixel HOG31 + GSS + Raw pixel HOG31 + GSS + Raw pixel HOG31 + GSS + Raw pixel HOG31 + GSS + Raw pixel Fine-tuned VGG-face model Classifier ELM ELM SVM AdaBoost SVM SVM SVM AdaBoost SVM AdaBoost SVM Softmax Softmax AdaBoost Linear SVM Linear ELM Adaboost + Linear SVM Adaboost + Linear ELM Softmax Accuracy(%) 85.2 88.2 87.1±0.76 89.7±0.45 91.8±0.97 92.3±0.81 84.0±0.91 80.0±0.76 92.4±0.59 91.8±0.95 93.2±0.92 93.6±0.47 94.6±0.29 92.51±0.40 94.28±0.60 94.21±0.35 94.56±0.62 94.61±0.53 95.38±0.52 Fig. 6. Sample images of noisy and blurred images. Top row: noisy images with the standard deviation of Gaussian noise varying from 1 to 10 in steps of 1. Bottom row: blurred images with the standard deviation of a Gaussian kernel varying from 1 to 10 in steps of 1. TABLE III C LASSIFICATION ACCURACY (%) ON UNALIGNED FACIAL IMAGES AND 1 ALIGNED GRAYSCALE FACIAL IMAGES Fold1 Fold2 Fold3 Fold4 Avg 95.0 94.8 94.4 95.5 95.2 95.1 95.7 95.1 94.9 95.3 94.1 95.0 95.4 94.8 94.9 Accuracy RGB & aligned RGB & unaligned Grayscale & aligned 0.8 0.6 Blur Noise 0.4 0.2 0 0 V. C ONCLUSIONS AND DISCUSSION 2 4 6 8 10 Gaussian variance A smile detection method based on transfer learning was presented in this paper. Unlike previous research works which either perform feature extraction and classification separately or train a CNN from scratch, we leveraged the large labeled datasets and well-trained deep learning models in the face recognition field to generate a CNN model that achieves improved state-of-the-art on smile detection. The motivation behind this approach is that the labeled data on real-world smile detection datasets is scarce compared to the labeled data on real-world face recognition datasets. For example, the GENKI-4K dataset has 4K images while the VGG-face recognition database has 2M images. It was shown via experiments that the proposed method outperforms state-of-the-art methods for smile detection in Fig. 7. Performance evaluation of the fine-tuned VGG-face model in the presence of noise and blur artifacts. terms of classification accuracy. However, transfer learning is not only important for increasing the classification accuracy, but it also reduces training time and leads to more robust systems because it exploits the high variability of large-scale datasets. For example, it was also shown that models also achieve high classification accuracy for smile recognition when fine-tuned and tested on artifact-corrupted images. 6 R EFERENCES [26] Varun Jain and James L. Crowley, “Smile detection using multi-scale gaussian derivatives,” in In 12th WSEAS International Conference on Signal Processing, Robotics and Automation. 2014. [27] Yuan Gao, Hong Liu, Pingping Wu, and Can Wang, “A new descriptor of gradients self-similarity for smile detection in unconstrained scenarios,” Neurocomputing, vol. 174, pp. 1077–1086, 2016. [28] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio, “Generative adversarial nets,” in Advances in Neural Information Processing Systems 27, Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, Eds., pp. 2672–2680. Curran Associates, Inc., 2014. [29] Samuel Dodge and Lina Karam, “Understanding How Image Quality Affects Deep Neural Networks,” arXiv:1604.04004, 2016. [1] P. Ekman, “Self-deception and detection of misinformation,” Selfdeception: An adaptive mechanism, pp. 229–257, 1988. [2] M. Pantic, A. Pentland, A. Nijholt, and T.S. Huang, “Human computing and machine understanding of human behavior: A survey,” in Artifical Intelligence for Human Computing, pp. 47–71. Springer, 2007. [3] E. Potapova, M. Egorova, and I. Safonov, “Automatic photo selection for media and entertainment applications,” GRAPHICON-2009, pp. 117–124, 2009. [4] C. Tavares and T. Odaka, “System and method for capturing and using biometrics to review a product, service, creative work or thing,” June 24 2004, US Patent App. 10/876,848. [5] H. Yadappanavar and S. Shylaja, “Machine learning approach for smile detection in real time images,” International Journal of Image Processing and Vision Sciences, vol. 1, no. 1, 2012. [6] E.L. Abel and M.L. Kruger, “Smile intensity in photographs predicts longevity,” Psychological Science, vol. 21, no. 4, pp. 542–544, 2010. [7] L. Harker and D. Keltner, “Expressions of positive emotion in women’s college yearbook pictures and their relationship to personality and life outcomes across adulthood.,” Journal of personality and social psychology, vol. 80, no. 1, pp. 112, 2001. [8] J.P. Seder and S. Oishi, “Intensity of smiling in Facebook photos predicts future life satisfaction,” Social Psychological and Personality Science, vol. 3, no. 4, pp. 407–413, 2012. [9] J. Whitehill, G. Littlewort, I. Fasel, M. Bartlett, and J. Movellan, “Toward practical smile detection,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 31, no. 11, pp. 2106–2111, 2009. [10] D. Freire-Obregón, M. Castrillón-Santana, and O. Déniz-Suárez, “Smile detection using local binary patterns and support vector machines,” Proceedings of Computer Vision Theory and Applications (VISAPP09), 2009. [11] O. Déniz, M. Castrillon, J. Lorenzo, L. Anton, and G. Bueno, “Smile detection for user interfaces,” in International Symposium on Visual Computing, pp. 602–611. 2008. [12] C. Shan, “Smile detection by boosting pixel differences,” IEEE Transactions on Image Processing, vol. 21, no. 1, pp. 431–436, 2012. [13] Y. LeCun, Y. Bengio, et al., “Convolutional networks for images, speech, and time series,” The handbook of brain theory and neural networks, vol. 3361, no. 10, pp. 1995, 1995. [14] K. Zhang, Y. Huang, H. Wu, and L. Wang, “Facial smile detection based on deep learning features,” in 3rd IAPR Asian Conference on Pattern Recognition, pp. 534–538. 2015. [15] P.O. Glauner, “Deep convolutional neural networks for smile recognition,” arXiv preprint arXiv:1508.06535, 2015. [16] S.M. Mavadati, M.H. Mahoor, K. Bartlett, P. Trinh, and J.F. Cohn, “DISFA: A spontaneous facial action intensity database,” IEEE Transactions on Affective Computing, vol. 4, no. 2, pp. 151–160, 2013. [17] J. Chen, Q. Ou, Z. Chi, and H. Fu, “Smile detection in the wild with deep convolutional neural networks,” Machine Vision and Applications, pp. 1–11, 2016. [18] O.M. Parkhi, A. Vedaldi, and A. Zisserman, “Deep face recognition,” in British Machine Vision Conference, vol. 1, p. 6. 2015. [19] A. Krizhevsky, I. Sutskever, and G.E. Hinton, “Imagenet classification with deep convolutional neural networks,” in Advances in Neural Information Processing Systems, pp. 1097–1105. 2012. [20] Y. LeCun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521, no. 7553, pp. 436–444, 2015. [21] K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” arXiv preprint arXiv:1409.1556, 2014. [22] M. Oquab, L. Bottou, I. Laptev, and J. Sivic, “Learning and transferring mid-level image representations using convolutional neural networks,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1717–1724. 2014. [23] Vahid Kazemi and Josephine Sullivan, “One millisecond face alignment with an ensemble of regression trees,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2014. [24] L. An, S. Yang, and B. Bhanu, “Efficient smile detection by extreme learning machine,” Neurocomputing, vol. 149, pp. 354–363, 2015. [25] Li S. Shan S. Chen X. Liu, M., “Enhancing expression recognition in the wild with unlabeled reference data,” Asian Conference on Computer Vision, pp. 577–588, 2012. 7
1cs.CV
Linear model predictive safety certification for learning-based control arXiv:1803.08552v1 [cs.SY] 22 Mar 2018 Kim P. Wabersich and Melanie N. Zeilinger Abstract— While it has been repeatedly shown that learningbased controllers can provide superior performance, they often lack of safety guarantees. This paper aims at addressing this problem by introducing a model predictive safety certification (MPSC) scheme for polytopic linear systems with additive disturbances. The scheme verifies safety of a proposed learningbased input and modifies it as little as necessary in order to keep the system within a given set of constraints. Safety is thereby related to the existence of a model predictive controller (MPC) providing a feasible trajectory towards a safe target set. A robust MPC formulation accounts for the fact that the model is generally uncertain in the context of learning, which allows proving constraint satisfaction at all times under the proposed MPSC strategy. The MPSC scheme can be used in order to expand any potentially conservative set of safe states for learning and we prove an iterative technique for enlarging the safe set. Finally, a practical data-based design procedure for MPSC is proposed using scenario optimization. I. I NTRODUCTION Learning-based control introduces new ways for controller synthesis, based on large-scale databases which represent cumulated system knowledge. This allows for previously intense tasks, such as system modeling and controller tuning, to eventually be fully automated. For example, deep reinforcement learning provides prominent results, with applications including control of humanoid robots in complex environments [1] and playing Atari Arcade video-games [2]. Despite the advances in research-driven applications, the results can often not be transferred to many industrial systems that are safety-critical, i.e. that must be guaranteed to operate in the range of physical and safety constraints. This is due to the often complex functioning of learning-based methods rendering their systematic analysis difficult. By introducing a model predictive safety certification (MPSC) mechanism for any learning-based controller, we aim at bridging this gap for linear polytopic systems with additive uncertainties that can, e.g., result from a belief representation of an unknown non-linear system. The proposed MPSC scheme estimates safety of a proposed learningbased input in real-time by searching for a safe back-up trajectory for the next time step in the form of generating a feasible trajectory towards a known safe set. Allowing the MPSC scheme to modify the potentially unsafe learningbased input, if necessary, provides safety for all future times. The result can be seen as a ‘safety filter’, since it only filters proposed inputs that drive the system out of what we call the safe set. The resulting online optimization problem can be Kim Wabersich ([email protected]) and Melanie N. Zeilinger ([email protected]) are with the Institute for Dynamic Systems and Control, ETH Zurich, Switzerland. This work was supported by the Swiss National Science Foundation under grant no. PP00P2 157601/1. efficiently solved in real-time using established MPC solvers. Partially unknown larger scale systems can therefore be efficiently enhanced with safety certificates during learning. Contributions: We consider linear difference inclusions with additive disturbances, described in Section II, that encode the current, possibly data-driven, belief about a safety-critical system to which a potentially unsafe learningbased controller should be applied. A model predictive safety certification scheme is proposed in Section III, which allows for enhancing any learning-based controller with safety guarantees1 . The concept of the proposed scheme is comparable to the safety frameworks presented in [3], [4] by providing an implicit safe set together with a safe backup controller that can be applied if the system would leave the safe set using the proposed learning input. A distinctive advantage compared to existing methods is that the MPSC scheme can build on any system behavior that is known to be safe, i.e. a known set of safe system states can be easily incorporated in our scheme such that it will only analyze safety outside of the provided safe set. The approach relies on scalable offline computations and online optimization of a robust MPC problem at every sampling time, which can be performed using available real-time capable solvers that can deal with large-scale systems (see e.g. [5], [6]). While we relate the required assumptions and design steps to tube-based MPC in Section IV, we present an automated, parametrization free, and data-driven design procedure, that is tailored to the context of learning the system dynamics. Using a linear Gaussian model, the design procedure and MPSC scheme are illustrated in Section V using numerical examples. Related work: Making the relevant class of safety critical systems accessible to learning-based control methods has gained significant attention in recent years. In addition to the individual construction of safety certificates for specific learning-based control methods subject to different notions of safety, see e.g. the survey [7], a discussion of advances in safe learning-based control subject to state and input constraints can be found in [8]. A promising direction that emerged from recent research focuses on what is called a ‘safety framework’ [3], [8], [4], [9], which consists of a safe set in the state space and a safety controller. While the system state is contained in the safe set, any feasible input (including learning-based controllers) can be applied to the system. However, if such an input would cause the system to leave the safe set, the safety controller interferes. 1 Even human inputs can be enhanced by the safety certification scheme, which relates e.g. to the concept of electronic stabilization control from automotive engineering. Since this strategy is compatible with any learning-based control algorithm, it serves as a universal safety certification concept. The techniques proposed in [3], [8] are based on a differential game formulation that results in solving a min-max optimal control problem, which can provide the largest possible safe set, but offers very limited scalability. The approach described in [4] uses convex approximation techniques that scale well to larger-scale systems at the cost of a potentially conservative safe set. While these results explicitly consider non-linear systems, we focus on linear model approximations allowing for various improvements. Compared to previous research, we make use of a generalized version of the safe set and focus on linear difference inclusions with additive disturbances. We introduce a new mechanism for generating the safe set and controller based on ideas related to tube-based model predictive control, which enables scalability with respect to the state dimension, while being less conservative than e.g. [4]. Notation: The set of symmetric matrices of dimension n n ) is S n , the set of positive (semi-) definite matrices is (S+ n S++ , the set of integers in the interval [a, b] ⊂ R is I[a,b] , and the set of integers in the interval [a, ∞) ⊂ R is I≥a . The Minkowski sum of two sets A1 , A2 ⊂ R is denoted by A1 ⊕ A2 and the Pontryagin set difference by A1 A2 . The convex hull of a set A is denoted by co(A). The i-th row and i-th column of a matrix A ∈ Rn×m is denoted by rowi (A) and coli (A). II. P ROBLEM DESCRIPTION We consider dynamical systems, which can be described by linear difference inclusions of the form x(k + 1) ∈ D(x(k), u(k), A, B, W) (1) with initial condition x(0) = x0 and D(x, u, A, B, W) := {Ax + Bu + w|A ∈ co(A), B ∈ co(B), w ∈ W}, (2)  where W is a compact set, A := Ai ∈ Rn×n ∀i ∈ I[1,p] , and B := Bj ∈ Rn×m ∀j ∈ I[1,q] . The system is subject to polytopic state constraints x(k) ∈ X := {x ∈ Rn |Ax x ≤ bx }, Ax ∈ Rnx ×n , bx ∈ Rnx and polytopic input constraints u(k) ∈ U := {u ∈ Rm |Au u ≤ bu }, Au ∈ Rnu ×m , bu ∈ Rnu . We assume that the origin is contained in X, (Ai , Bj ) is stabilizable for all i ∈ I[1,p] , j ∈ I[1,q] , and the system state is fully observable. Note that system class (1) allows for modeling unknown linear time-varying systems x(k + 1) = Areal (k)x(k) + Breal (k)u(k), k ∈ I≥0 (3) if Areal (k) ∈ Rn×n and Breal (k) ∈ Rn×m can be represented by q B (Areal (k), Breal (k)) = (Σpi=1 λA i (k)Ai , Σj=1 λj (k)Bj ) p q B A B with λA i (k), λj (k) > 0, Σi=1 λi (k) = 1, and Σj=1 λj (k) = 1. Unknown non-linear systems of the form x(k + 1) = f (x(k), u(k)) (4) State constraints X ⊂ R2 z4∗ ⊕ Ω z1∗ x(k + 1) x(k) Safe terminal set Sf Safe set S Fig. 1: Model predictive safe set (blue) based on available data points (red): Belief-based safe optimal trajectory that supports uL (k), starting nearby x(t) and resulting in the safe terminal set with uncertainty tubes around it, that will contain the real system state. can be similarly considered if f (x, u) ∈ D(x, u, A, B, W) for all (x, u) ∈ (X, U). We aim at providing a safety certificate for arbitrary control signals in terms of a safe set and a safe control law. Given the system description (1) and a potentially unsafe learning-based controller uL , we search for a set of states S for which we know a feasible backup control strategy uB such that input and state constraints will be fulfilled for all future times. Therefore, uL can be applied as long as it does not cause the system to leave S or violate input constraints. Otherwise, a safety controller uS is allowed to modify the learning input based on the backup controller in order to keep the system safe. Formally this is captured by the following definition of a safe set and controller. Definition II.1. A set S ⊆ X is called a safe set for system (1) if there exists a safe backup control law uB : Rn × Rm × I≥0 → U such that for an arbitrary (learning-based) policy uL : I≥0 → Rm , the application of the safety control law ( uL (k), if uL ∈ U ∧ D(x, uL , A, B, W) ⊆ S uS (k) := uB (x(k), uL (k), k), otherwise guarantees that the system state x(k) is contained in X for all k ≥ k̄ if x(k̄) ∈ S. While this framework is conceptually similar to those in [3], [8], [4], [9], we do not require the safe set S to be robust controlled invariant as in [4, Definition II.4], [8, Definition 2], [9, Section 2.2] or [3, Section II.A]. The presented approach is thereby capable of enlarging any given safe set, and can be combined with any of the previously proposed methods. III. M ODEL PREDICTIVE SAFETY CERTIFICATION The starting point for the derivation of the proposed safety concept is Definition II.1. The essential requirement is that we always need to know a feasible backup controller uB , that ensures constraint satisfaction in the face of uncertainty for all future times. The idea for constructing such a controller is based on model predictive control [10]. Given the current system state we calculate a safe, finite horizon backup controller towards some conservative target set Sf , which is known to be a safe set and therefore provides ‘infinite safety’ after applying the finite-time controller. The concept is illustrated in Figure 1. Consider a current system state x(k), together with a proposed learning input uL (k). In order to analyze safety of uL (k), we test if uL (k) will lead us to a state x(k + 1), from which we can construct a safe backup controller uB in the form of a feasible input sequence that drives the system to the safe terminal set Sf in a given finite number of steps. If the test is successful, x(k +1) is a safe state and uL (k) can be applied. At the next time step k + 1, we repeat the calculations for x(k + 1) and uL (k +1). If it is successful, we can again apply the learning input uL (k + 1), otherwise we simply use the previously calculated from time k. This strategy yields a safe set that is defined by the feasible set of the corresponding optimization problem for planning a trajectory towards the target set. As the true system dynamics model is often unknown in the context of learning-based control, we employ mechanisms from tube-based model predictive control to design a safe backup controller for uncertain system dynamics of the form (1). A. Model predictive safety certification scheme A nominal backup trajectory is computed such that a stabilizing auxiliary controller is able to track it for the real system within a ‘tube’ towards the safe terminal set, which is related to the concept of tube-based MPC, as described e.g. in [11]. We first define the main components and assumptions, in order to then introduce the MPSC problem together with the proposed safety controller. Define with z(k) ∈ Rn and v(k) ∈ Rm the nominal system states and inputs, as well as the nominal dynamics z(k + 1) = Az(k) + Bv(k), k ∈ I≥0 (5) with initial condition z(0) = z0 and (A, B) ∈ (co(A), co(B))2 . Denote e(k) := x(k) − z(k) as the error (deviation) between the system state (1) and the nominal system state (5). The controller is then defined by augmenting the nominal input with an auxiliary feedback on the error, i.e. u(k) = v(k) + KΩ (x(k) − z(k)), (6) which keeps the real system state x(k) close to the nominal system state z(k) if KΩ ∈ Rm×n is chosen such that it robustly stabilizes the error dynamics given as follows. Proposition III.1. The dynamics of the error e(k) := x(k)− z(k) are described by the difference inclusion e(k + 1) ∈ D(e(k), 0, Ae , 0, W) with Ae = {Ai + Bj KΩ ∈ R n×n (7) ∀i ∈ I[1,p] , j ∈ I[1,q] }. Proof. The proof can be found in the appendix. 2 In the context of learning time-invariant linear systems, one might choose (A, B) e.g. as the maximum likelihood estimate of the true system dynamics. Assumption III.2. There exists a linear state feedback matrix KΩ ∈ Rm×n that yields a stable error system (7). Stability of the autonomous error dynamics (7) implies the existence of a corresponding robust positively invariant set according to the following definition. Definition III.3. A set Ω ⊆ Rn is called a robust positively invariant (RPI) set for the error dynamics (7) if e(k0 ) ∈ Ω ⇒ e(k) ∈ Ω for all k ∈ I≥k0 . In order to guarantee that (x, u) ∈ X×U under application of (6), we tighten the state and input constraints X and U of (5), as described e.g. in [11], to X̄ = X Ω and Ū = U Ω. There exist various methods in the literature which can be used in order to calculate a controller and the corresponding RPI set according to Definition III.3, see e.g. [12], [13]. Different from standard tube-based model predictive control, the model predictive safety certification (MPSC) uses this concept with a terminal set that is only required to be itself a safe set according to Definition II.1. This allows not only for enlarging any potentially conservative initial safe set, but also for recursively improving the safe set, as will be shown in Section IV-B. Assumption III.4. There exists a safe set Sf ⊆ X and a safe control law uSf according to Definition III.3 such that Ω ⊆ Sf . Remark III.5. Note that every terminal set in classical linear tube-based MPC as, e.g. described in [11], also satisfies Assumption III.4. A trivial choice is therefore Sf = Ω and uSf (k) = KΩ x(k). Since the dynamics (1) are uncertain, we only know at time k that x(k + 1) (compare with Figure 1) will be contained in the set D(x(k), uL (k), A, B, W) if the learning input uL (k) is applied. Because the set Ω around the nominal trajectory is robustly invariant, we can account for that uncertainty by requiring D(x(k), uL (k), A, B, W) ⊆ z(k +1)⊕Ω, which in turn requires the following assumption on Ω. Assumption III.6. The set Ω according to Definition III.3 satisfies D(x, u, A, B, W) ⊆ {Ax + Bu} ⊕ Ω for all (x, u) ∈ X × U. Remark III.7. For the case of Lyapunov-based, ellipsoidal n RPI sets Ω = {x> P x ≤ 1}, with P ∈ S++ , Assumption III.6 can be satisfied by using a scaling αΩ with α > 1. In Section IV we present a principled way of calculating Ω in the context of learning such that Assumption III.6 holds. Remark III.8. If p = q = 1, then Assumption III.2 directly implies Assumption III.6, because the error dynamics are in this case given by e(k + 1) = (A1 + KΩ B1 )e(k) + w(k), w(k) ∈ W. Based on these components, the proposed safe backup controller is implicitly defined through the following MPSC problem for a given measured state x and proposed learning Algorithm 1 Model predictive safety certification scheme input uL : min v1 ,..,vN −1 , z1 ,..,zN ,ũ kuL − ũk (8a) s.t. zi+1 = Azi + Bvi , ∀i ∈ I[1,N −1] (8b) (zi , vi ) ∈ X̄ × Ū, ∀i ∈ I[1,N −1] (8c) zN ∈ Sf (8d) Ω D(x, ũ, A, B, W) ⊆ z1 ⊕ Ω (8e) ũ ∈ U (8f) where we denote the planning horizon by N ∈ I≥1 and the predicted nominal system states and inputs by zi and vi . Let the feasible set of (8) be denoted by XN := {x ∈ Rn |(8b) − (8f)} ⊆ X. (9) Problem (8) introduces the auxiliary variable ũ, which is required to satisfy the input constraints (8f) as well as (8e), ensuring safety of the control input ũ, as we will show in the proof of Theorem III.11. The cost (8a) is chosen such that if possible, ũ is equal to uL , in which case safety of uL is certified. The controller resulting from (8) in a receding horizon fashion is given by κ(x) = ũ∗ (x) (10) ∗ ∗ ∗ ∗ where v1∗ (x), .., vN −1 (x), z1 (x), .., zN (x), and ũ (x) is the optimal solution of (8) at state x. Remark III.9. In case p = q = 1, (8e) can be written as Ax + B ũ − z1 ∈ Ω W allowing for the set computation to be performed offline. In general, the constraints (8e) can be difficult to implement and therefore be conservatively treated as follows. Proposition III.10. Consider De = {e|e ∈ D(x, u, A, B, W) {Ax + Bu} for all x ∈ X, u ∈ U}, then Ax + B ũ − z1 ∈ Ω De ⇒ (8e). 1: kinf ← N − 1 2: for k=0,1,2,... do 3: if (8) feasible then 4: Apply u(k) ← κ(x(k)) to (3) 5: kinf ← 0 6: else 7: kinf ← kinf + 1 8: if kinf ≤ N − 1 then 9: Apply u(k) ← vk∗inf + KΩ (x(k) − zk∗inf ) to (3) 10: else 11: Apply u(k) ← uSf (k) to (3) 12: end if 13: end if 14: end for (11) Proof. From (11) we have Ax + B ũ ⊕ De ⊆ z1 ⊕ Ω and by the definition of De , (8e) follows. Therefore, if De ⊆ Ω such that Ω De 6= ∅, then Proposition III.10 allows to replace the potentially difficult constraint (8e) conservatively by (11), which can be precomputed exactly or further approximated for large-scale systems as shown for example in Section IV-A. It is important to note that (8) may not be recursively feasible for general safe sets Sf . This is due to the fact that the terminal safe set Sf is itself not necessarily invariant or a subset of the feasible set, i.e. one can in general not use the terminal safe control law according to Assumption III.4 in order to construct a feasible candidate solution with respect to (8). To this end, we propose Algorithm 1, called model predictive safety certification (MPSC) scheme, which implements a safety controller based on (8). If x(k) ∈ XN we can always directly apply ũ (Algorithm 1, line 4). If at a subsequent time x(k + 1) ∈ / XN , then we know via (8) a finite-time safe backup controller towards Sf using (6) (Algorithm 1, line 9), compare also with Figure 1. By Assumption III.4 we can extend this finite-time backup controller after N -steps with uSf (Algorithm 1, line 11) in order to obtain a safe backup controller for x(k + i), i ≥ 0, which will satisfy constraints at all times in the future. In the case that Sf \ XN 6= ∅, (8) can be initially infeasible for x = x(0) ∈ Sf . This case can be easily treated by directly applying uSf (Algorithm 1, line 1 and line 11) which ensures safety for all future times. Formalization of the above yields our main result. Theorem III.11. If Assumptions III.2, III.4, and III.6 hold, then the control law resulting from Algorithm 1 is a safety controller and XN ∪Sf the corresponding safe set according to Definition II.1. Proof. If x(0) ∈ Sf \ XN , the terminal safety controller uSf is applied since kinf is initialized to N − 1 in (Algorithm 1, line 1), which keeps the system safe for all times. We show that XN is a safe set by first investigating the case that (8) is feasible for all k ∈ I≥0 and extend the analysis to cases in which (8) is infeasible for arbitrarily many time steps. Let x(0) ∈ XN and let (8) be feasible for all k ∈ I≥0 (Algorithm 1, line 4), i.e. x(k) ∈ XN . Condition (8e) implies that D(x(k), ũ, A, B, W) ⊆ z1 ⊕ Ω which implies by the tightened constraints on the nominal state (8c) and (8f) that x(k + 1) ∈ X. Therefore XN is a safe set under the safe backup controller κ(x) in this case. Now, consider an arbitrary time k̄ for which (8) was feasible for the last time, i.e. x(k) ∈ / XN for all k = k̄ + kinf with kinf ∈ I[1,N −1] . Because of (8e) we have that e(k̄+1) ∈ Ω and therefore Assumption III.4 together with (8d) allows for explicitly stating a safe backup control law based on x = x(k̄) ∈ XN that keeps the system in the constraints for all future times: uB (x(i), x, i) = ( ∗ ∗ vi− k̄ (x) + KΩ (x(i − k̄) − zi−k̄ (x))), i ∈ I[k̄+1,k̄+N −1] uSf (i), i ∈ I≥k̄+N . Since (8) was feasible for x(k̄), the corresponding ∗ ∗ ∗ v1∗ , .., vN / XN , −1 , z1 , .., zN exist. Therefore in case of x(k) ∈ Algorithm 1, line 9 and kinf ∈ I[1,N −1] , it follows from e(k̄ + 1) ∈ Ω by Assumption III.2 that x(k̄ + kinf ) ∈ zk∗inf ⊕ Ω for all kinf ∈ I[1,N −1] . The last remaining case kinf ≥ N is justified by the observation, that x(k̄ + N ) ∈ Sf by (8d) for which we know the safe control law uSf for all future times by Assumption III.4. Once a feasible solution is found again, the counter kinf is set to zero. Consequently we investigated all possible cases in Algorithm 1 and proved that it will always provide a safe control input if x(0) ∈ XN ∪ Sf , showing the result. B. A recursively feasible MPSC scheme By modifying Assumption III.4 in order to be compatible with standard assumptions on the terminal set made in tube-based model predictive control, we obtain recursive feasibility of (8) and can thus directly apply the timeinvariant control law (10) to system (3) without the need of Algorithm 1. In other words, (10) directly becomes the safety controller according to Definition II.1. Furthermore, this property allows for showing that the planning horizon is inherently coupled to the degree of conservatism of the resulting safe set. Assumption III.12. There exists a set Xf ⊆ X̄ and corresponding control law σf : Xf → Ū such that for all z ∈ Xf , ⇒ Az + Bσf (z) ∈ Xf . Theorem III.13. Let Sf = Xf ⊕ Ω. If Assumptions III.2, III.6, and III.12 hold, then (10) is a safety control law and XN the corresponding safe set according to Definition II.1. In addition, XN is a robust positively invariant set. Proof. We begin with showing recursive feasibility under (10). Let (8) be feasible at time k. It follows that x(k + 1) ∈ z1∗ ⊕ Ω because of (8e). From here, recursive feasibility follows as in standard tube-based MPC by induction, see e.g. [11]. Along the lines of the proof of Theorem III.11, recursive feasibility implies that XN is a safe set. Another property which follows from Theorem III.13 is that the degree of conservatism can be scaled with respect to the planning horizon N , and therefore based on the available computational resources. Corollary III.14. If Assumptions III.2, III.6, and III.12 hold, then it follows that XN ⊆ XN +i , with i ∈ I≥0 . Proof. The proof follows directly from recursive feasibility for any N ∈ I≥0 by Theorem III.13, i.e. if (8) is feasible for x ∈ XN we can extend the corresponding nominal feasible trajectory with the terminal control law σf from Assumption III.12 for arbitrarily many time steps which proves that XN ⊆ XN +i for i ∈ I≥1 . Therefore, a longer planning horizon will lead to a larger or equally sized safe set. IV. D ESIGN OF Sf AND Ω FROM DATA The proposed MPSC scheme is based on two main design components, the robust positively invariant set Ω, which determines the tube, and the terminal safe set Sf . While Sf can be chosen more generally according to Assumption III.4, we note from Theorem III.13 that we can in principle also use the same design methods proposed for linear tube-based model predictive control with a proper scaling of Ω subject to Assumption III.6. The computation of the robust invariant set Ω and the nominal terminal set Xf have been widely studied in the literature, see e.g. [12], [14], [11], [15] and references therein. This section presents a different option for the approximation of a tube and safe terminal set that is tailored to the learning context and aims at a minimal amount of tuning ‘by hand’. We propose to infer a robust control invariant set Ω either directly from data or from a probabilistic model via scenario-based optimization. Secondly, starting from any terminal safe set, e.g. the trivial choice {0}⊕Ω, we show how to enlarge this terminal set iteratively by utilizing feasible solutions of (8) over time. A. Scenario based calculation of Ω from data s Let {Ãi , B̃i , w̃i }N i=1 be a set of so-called ‘scenarios’, either sampled from a probabilistic belief about the system dynamics (1) or collected from measurements. We restrict ourselves to ellipsoidal robust positively invariant sets Ω = n , in order to enable scalability {x|x> P x ≤ 1} with P ∈ S++ of the resulting design optimization problems to larger scale systems. The corresponding robust scenario-based design problem for computation of the set Ω is given by min n ,τ >0 P ∈S++ − log det(P ) (12a) s.t. ∀i ∈ I[1,Ns ] :   > Ã> Ãcl,i P Ãcl,i − τ P cl,i P w̃i 0 (12b) w̃i> P Ãcl,i w̃i> P w̃i + τ − 1 −2  In P  Ãi − A x̄ + B̃i − B ū + kw̃i k2 2 2 (12c) where Ãcl,i := Ãi + B̃i KΩ , x̄ = maxx∈X kxk2 , and ū = maxu∈U kuk2 . The objective (12a) is chosen such that a possibly small RPI set is obtained, which increases by definition of X̄ and Ū the size of the feasible region of (8), and therefore the size of the safe set. The constraint (12b) is obtained from the standard robust positively invariance condition by applying the S-procedure, see e.g. [15], and (12c) implies De ⊆ Ω and allows to replace (8e) with (11) according to Proposition (III.10). Proposition IV.1. Consider system (7) and let ns := n2 + nm + n. If (12) attains a solution, then with probability at least  nX s −1  Ns i  (1 − )Ns −i i i=0 the set Ω satisfies Assumption III.2 and De ⊆ Ω with violation probability . Proof. The set Ω is robust positively invariant for the error system (7) if (12b) holds (see e.g. [16]) for all (Āi , B̄i , w̄i ) ∈ (A, B, W) and therefore fulfillment of Assumption III.2 in probability follows directly from [17, Theorem 1] similar to the application demonstrated in [18]. Furthermore, condition (12c) implies De ⊆ Ω, compare also with Proposition III.10, which completes the proof. Remark IV.2. The quantity ns = n2 + nm + n defines the number of unknowns in case that the dynamics matrices or the distributions of Ã, B̃ and w̃ are completely unknown. If, e.g. only the dynamic matrix contains nA unknown entries it follows ns = nA . A discussion of the sample complexity with varying numbers ns and  is provided in [17]. Remark IV.3. Computing the tube set Ω based on scenarios comes at the cost of obtaining only guarantees in probability, which is often acceptable in applications and provides favorable scalability properties. In order to provide strict guarantees, Ω has to be calculated using robust methods which can lead to more conservative results. B. Iterative enlargement of the terminal safe set Sf In order to provide a similar result with respect ∗ to Theorem III.13 consider the set zM(k) = ∗ ∗ {z1 (x(i)), .., zN (x(i)), i ∈ M(k)} with M(k) as defined above. Corollary IV.6. If Assumptions III.2, III.6, and III.12 are satisfied, Sf = Xf ⊕ Ω, and (8) is convex, then the set M(k) Xf ∗ := co(zM(k) ) ∪ Xf (15) M(k) satisfies Assumption III.12 and Xf ⊕ Ω is a safe set according to Definition II.1 with safety controller (10). Proof. Follows similarly to the proof of Theorem IV.4. Using Theorem III.13, we obtain a practical procedure similar to Remark IV.5 by initializing Xf = {0} and M(k) choosing Xf ⊕ Ω as iterative terminal safe set. Remark IV.7. While the computation of the convex hull for constructing an iterative terminal safe set can be expensive (see, e.g., [19] for an efficient algorithm), it can be done off-line or in the background of Algorithm 1. In this section we show how to enlarge the terminal safe set Sf based on previously calculated solutions of (8). Note, that a larger terminal set Sf according to Assumption III.4 or Assumption III.12 typically also leads to a larger feasible set XN , and therefore to a larger overall safe set S according to Theorems III.11 and III.13. The main idea is to define a safe set based on successfully solved instances of (8) for measured system states Remark IV.8. Theorem IV.4 also provides an explicit approximation of the safe set given by (14), which is generally not explicitly available. Such a representation can be used to ‘inform’ the learning-based controller about the safety boundary, e.g. in the form of a feature using a barrier function, in order to avoid chattering behavior, as proposed in [3]. x∗M(k) := {x(i), i ∈ M(k)} V. A PPLICATION TO NUMERICAL EXAMPLES (13) where M(k) := {i ∈ I[0,k] |x(i) ∈ XN } is an index set representing time instances for which the system state x(i) was feasible in terms of (8) during application of Algorithm 1 up to time k. We consider the problem of safely acquiring information about the system dynamics for a linear, time-invariant system Theorem IV.4. If Assumptions III.2, III.4, and III.6 are satisfied, and (8) is convex, then the set with A unknown, subject to polytopic state and input constraints X and U. To this end we use an ensemble of sinusoidal signals as described in [20] to excite the system, which could be replaced by any desired learning-based controller, e.g. the one described in [21]. For ease of presentation we only consider an unknown dynamic matrix, i.e. p > 1 and a known input matrix B, i.e. q = 1. We model our prior belief about (16) by linear Gaussian dynamics M(k) Sf := co(x∗M(k) ) ∪ Sf (14) is again a safe set according to Definition II.1 with a safety controller given by Algorithm 1. Proof. If (8) is convex, then the feasible set is a convex set, see e.g. [16] and therefore co(x∗M(k) ) ⊆ XN . As a consequence, we can solve (8) for all x ∈ co(x∗M(k) ) which in turn provides the result by the proof of Theorem III.11 (by replacing XN with co(x∗M(k) )) and the fact that the union of two safe sets is again a safe set. If Sf ⊆ co(x∗M(k) ), convexity of the new terminal set (14) is ensured and we can, iteratively enlarge the initial terminal set Sf . Remark IV.5. A practical design procedure in order to determine Ω and Sf is as follows. Compute Ω based on measurements as described in Section IV-A and initialize Sf = {Ω}. Then, during closed-loop operation of Algorithm 1 enlarge Sf according to (14). x(k + 1) = Ax(k) + Bu(k) x(k + 1) = Ãx(k) + Bu(k) (16) (17) with rowi (Ã) ∼ N(0, Σpi ) for all i ∈ I[0,n] and noisy measurements yk = Ãx(k) + ˜ with ˜ ∼ N(0, σs2 In ). This allows us to calculate the posterior distribution, based on d collected data D := {(xi , yi )}N i=1 of rowj (Ã) to be (see e.g. [22]) p(rowj (Ã)> |D) = N(σs−2 Cj−1 Xcolj (y), Cj−1 ) (18) Nd ×n with X ∈ RNd ×n , rowi (X) = x> , rowi (y) = i , y ∈ R p−1 −1 > −2 > (Ãxi ) , and Ci = σs XX + Σi . We are now in the position to directly use the results from Section IV in order to calculate Ω without deriving a suitable representation (1) first. For illustration, consider the discretized mass-spring-damper system     1 0.1 0 x(k + 1) = x(k) + u(k) (19) −0.3 0.8 0.1 with |u(k)| ≤ 2.5, |x1 (k)| ≤ 1, and x2 (k) ∈ [−0.4, 1] as the ‘true’ system (16). Note, that asymmetric state or input constraints render the application of ellipsoidal safe sets conservative, e.g. [4]. We generate 15 uniformly sampled measurements yk with small sensor noise σs = 0.02 and P 100 0 10 select ΣP 1 = ( 0 10 ), Σ2 = ( 0 1 ). Using Ns = 600 samples from the posterior distribution (18) we generate the robust scenario design problem (12) and obtain Ω = 85.70 28.33 ). For the MPSC {x|x> P x ≤ 1} with P = ( 28.33 43.80 scheme, we use a planning horizon N = 10 and the terminal safe set Sf = Ω as described in Remark IV.5. The learning controller is given by the input signal uL (k) = 2 sin(0.01πk) + 0.5 sin(0.12πk) with the goal of generating informative measurements according to [20], which can be used to iteratively improve the posterior estimate (18). A closed-loop simulation with initial condition x(0) = (−0.7, 1)> under application of Algorithm 1 is illustrated in Figure 2 with the corresponding safe set. As desired, the safety controller modifies the proposed input signal uL only as the system state approaches a neighborhood of the safe set boundary where the next state would leave the safe set (indicated in red color). The distance to the neighborhood depends on uL and the discretization of the mass-spring-damper system (19). The pure learning-based trajectory (dotted line, in Figure 2), in contrast, would have violated state constraints already in the first time steps. Using the same configuration, we now iteratively enlarge the safe set based on previously calculated nominal state trajectories at each time step by following Corollary IV.6. To this end, we use the same input signal and Ω as above. Samples of the terminal set at different time steps are shown in Figure 3. After k = 120 time steps, a significant portion of the state space is already covered by the safe terminal set, which results in an overall safe set S that is already less conservative after 120 steps than the safe set shown in Figure 2, which results from a planning horizon N = 10 but with a static terminal set Sf = Ω. VI. C ONCLUSION The paper has approached the problem of safe learningbased control by means of a model predictive safety certification scheme. The proposed scheme allows for enhancing any potentially unsafe learning-based control strategy with safety guarantees and can be combined with any known safe set. By relying on robust model predictive control methods, the presented concept is amenable for application to large-scale systems with similar offline computational complexity as e.g. ellipsoidal safe set approximations. Using a parameter-free scenario based design procedure, it was illustrated how the design steps can be performed purely based on available data and how to reduce conservatism of the MPSC scheme over time by making use of generated closed-loop data. Fig. 2: Left: Closed loop simulation under Algorithm 1, starting from x(0) = [−0.7, 1]. Red color indicates states, for which kũ − uL k > 0. Dotted line shows the first 20 time steps of the closed-loop trajectory, resulting from application of uL without the MPSC scheme. Right: Learningbased control input sequence and applied safety controller sequence. Fig. 3: Iterative enlargement of the nominal terminal set (15), which is shown at times k = 10, 40, 120 with corresponding ∗ (x(k)) and planned nominal state trajectories z1∗ (x(k)), .., zN M(120) the resulting safe terminal set Sf = Xf ⊕ Ω. The thin grey line shows the state trajectory. A PPENDIX Proof of Proposition III.1. For ease of notation we omit the time dependence and use (e+ , x+ , z + ) := (e(k + 1), x(k + 1), z(k + 1)). By definition, e+ = x+ − z + , which implies by noting that Az + Bv ∈ D(z, v, A, B, {0}), e+ ∈ {x+ − z + |x+ ∈ D(x, u, A, B, W), z + ∈ D(z, v, A, B, {0})} and therefore e+ ∈ D(x, u, A, B, W) ⊕ D(−z, −v, A, B, {0}). We can further rewrite the difference inclusions (1) directly in terms of convex hulls with Ax = {Ai x ∀i ∈ I[1,p] } as D(x, u, A, B, W) = {co(Ax) ⊕ co(Bu) ⊕ W}, D(−z, −v, A, B, {0})} = {co(−Az) ⊕ co(−Bv)}. i=p,j=q ) for Since co({di }pi=1 )⊕co({sj }qj=1 ) = co({di +sj }i=1,j=1 n any di , sj ∈ R , we have with u = v + KΩ (x − z) e+ ∈ co(A(x − z)) ⊕ co(BKΩ (x − z)) ⊕ W = co(Ae) ⊕ co(BKΩ e) ⊕ W = D(e, 0, Ae , 0, W) which proves the result. R EFERENCES [1] J. Merel, Y. Tassa, S. Srinivasan, J. Lemmon, Z. Wang, G. Wayne, and N. Heess, “Learning human behaviors from motion capture by adversarial imitation,” arXiv preprint arXiv:1707.02201, 2017. [2] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski et al., “Human-level control through deep reinforcement learning,” Nature, vol. 518, no. 7540, p. 529, 2015. [3] A. K. Akametalu, J. F. Fisac, J. H. Gillula, S. Kaynama, M. N. Zeilinger, and C. J. Tomlin, “Reachability-based safe learning with gaussian processes,” in 53rd IEEE Conference on Decision and Control, Dec 2014, pp. 1424–1431. [4] K. P. Wabersich and M. N. Zeilinger, “Scalable synthesis of safety certificates from data with application to learning-based control,” arXiv preprint arXiv:1711.11417, 2017. [5] Y. Wang and S. Boyd, “Fast model predictive control using online optimization,” IEEE Transactions on Control Systems Technology, vol. 18, no. 2, pp. 267–278, March 2010. [6] A. Domahidi, A. U. Zgraggen, M. N. Zeilinger, M. Morari, and C. N. Jones, “Efficient interior point methods for multistage problems arising in receding horizon control,” in 51st IEEE Conference on Decision and Control (CDC), Dec 2012, pp. 668–674. [7] J. Garcı́a and F. Fernández, “A comprehensive survey on safe reinforcement learning,” Journal of Machine Learning Research, vol. 16, pp. 1437–1480, 2015. [8] J. F. Fisac, A. K. Akametalu, M. N. Zeilinger, S. Kaynama, J. Gillula, and C. J. Tomlin, “A general safety framework for learning-based control in uncertain robotic systems,” arXiv preprint arXiv:1705.01292, 2017. [9] R. B. Larsen, A. Carron, and M. N. Zeilinger, “Safe learning for distributed systems with bounded uncertainties,” 20th IFAC World Congress, vol. 50, no. 1, pp. 2536 – 2542, 2017. [10] H. Chen and F. Allgöwer, “A quasi-infinite horizon nonlinear model predictive control scheme with guaranteed stability,” Automatica, vol. 34, no. 10, pp. 1205 – 1217, 1998. [11] J. B. Rawlings and D. Q. Mayne, Model predictive control: Theory and design. Nob Hill Pub., 2009. [12] K. I. Kouramas, S. V. Rakovic, E. C. Kerrigan, J. C. Allwright, and D. Q. Mayne, “On the minimal robust positively invariant set for linear difference inclusions,” in 44th IEEE Conference on Decision and Control, Dec 2005, pp. 2296–2301. [13] J. Fleming, B. Kouvaritakis, and M. Cannon, “Robust tube mpc for linear systems with multiplicative uncertainty,” IEEE Transactions on Automatic Control, vol. 60, no. 4, pp. 1087–1092, April 2015. [14] M. de Oliveira, J. Bernussou, and J. Geromel, “A new discrete-time robust stability condition,” Systems and Control Letters, vol. 37, no. 4, pp. 261 – 265, 1999. [15] F. Blanchini, “Set invariance in control,” Automatica, vol. 35, no. 11, pp. 1747 – 1767, 1999. [16] S. Boyd and L. Vandenberghe, Convex optimization. Cambridge university press, 2004. [17] M. C. Campi and S. Garatti, “The exact feasibility of randomized solutions of uncertain convex programs,” SIAM Journal on Optimization, vol. 19, no. 3, pp. 1211–1230, 2008. [18] G. C. Calafiore and M. C. Campi, “The scenario approach to robust control design,” IEEE Transactions on Automatic Control, vol. 51, no. 5, pp. 742–753, 2006. [19] D. Bremner, K. Fukuda, and A. Marzetta, “Primal-dual methods for vertex and facet enumeration,” Discrete & Computational Geometry, vol. 20, no. 3, pp. 333–357, 1998. [20] L. Ljung, “System identification,” in Signal analysis and prediction. Springer, 1998, pp. 163–173. [21] J. Z. Kolter and A. Y. Ng, “Policy search via the signed derivative.” in Robotics: science and systems, 2009, p. 34. [22] C. Rasmussen and C. Williams, Gaussian Processes for Machine Learning, ser. Adaptive Computation and Machine Learning. MIT Press, 2006.
3cs.SY
Pilot-Assisted Short-Packet Transmission over Multiantenna Fading Channels: A 5G Case Study Guido Carlo Ferrante1 , Johan Östman1 , Giuseppe Durisi1 , and Kittipong Kittichokechai2 arXiv:1801.10552v2 [cs.IT] 1 Feb 2018 1 Chalmers University of Technology, Gothenburg, Sweden 2 Ericsson Research, Ericsson AB, Sweden Abstract—Leveraging recent results in finite-blocklength information theory, we investigate the problem of designing a control channel in a 5G system. The setup involves the transmission, under stringent latency and reliability constraints, of a short data packet containing a small information payload, over a propagation channel that offers limited frequency diversity and no time diversity. We present an achievability bound, built upon the random-coding union bound with parameter s (Martinez & Guillén i Fàbregas, 2011), which relies on quadrature phase-shift keying modulation, pilot-assisted transmission to estimate the fading channel, and scaled nearest-neighbor decoding at the receiver. Using our achievability bound, we determine how many pilot symbols should be transmitted to optimally trade between channel-estimation errors and rate loss due to pilot overhead. Our analysis also reveals the importance of using multiple antennas at the transmitter and/or the receiver to provide the spatial diversity needed to meet the stringent reliability constraint. I. I NTRODUCTION Ultra-reliable low-latency communication (URLLC) is one of the new use cases that will be supported in 5G [1]. It involves the transmission of short packets, under latency and reliability constraints that are much more stringent than the ones satisfied by traditional mobile broadband applications. Possible applications include factory automation and traffic safety. Classical information-theoretic metrics, such as the ergodic and the outage capacity, are not suitable to design URLLC links, because they rely on the assumption of large blocklength, which is typically not compatible with the latency requirements in URLLC links [2]. Instead, the problem of optimally designing such systems can be tackled in a fundamental fashion using the finite-blocklength information-theoretic tools developed by Polyanskiy et al. [3]. These tools have recently enabled the characterization of the maximum coding rate achievable, for a given blocklength and a given error probability, over quasi-static fading channels [4], and over multiple-input multiple-output (MIMO) Rayleigh block-fading channels [5]. They have also been used to determine optimum power-control strategies in the presence of channel-state information (CSI) at the transmitter [6], and to bound the rates achievable with pilot-assisted transmission (PAT) followed by scaled nearest-neighbor (SNN) decoding at This work was partly supported by the Swedish Research Council under grants 2014-6066 and 2016-03293. The simulations were performed in part on resources provided by the Swedish National Infrastructure for Computing (SNIC) at C3SE. the receiver for the single-input single-output (SISO) Rician block-fading channel [7]. In [7], the design of actual channel coding schemes approaching the bounds is also discussed. Contributions: In this paper, we generalize the analysis in [7] to the case of multiple-antenna transmissions. Specifically, we present an upper bound on the packet error probability attainable at a given blocklength using a channel code of a fixed rate, when communicating over a MIMO block-fading channel. As in [7], we assume PAT and SNN decoding at the receiver. However, differently from [7], where the analysis relies on the transmission of spherical codes, we focus in this paper on the rates achievable using quadrature phase-shift keying (QPSK) modulation, which is more practically relevant, and also a natural choice given the low levels of spectral efficiency at which 5G URLLC links are expected to operate. We also consider the use of an Alamouti inner code [8] at the transmitter, which constrains the transmit antennas to provide only spatial diversity, which may be crucial to achieve high reliability levels. Our bound is not in closed form; its evaluation require Monte Carlo simulations, which may be time consuming if the target error probability is low. To partially overcome this issue, we present an accurate saddlepoint approximation [9], [10] of our bound, which, although not in closed form either, can be computed more efficiently that the bound, because its complexity does not increase with the number of diversity branches available in the channel. Finally, we use our bound to shed lights on the optimal design of a control channel in a 5G system, where the payload is assumed to be 30 bits, the target packet error probability is 10−5 and the data packet consists of multiple resource blocks (RBs) in frequency, so as to minimize latency. Furthermore, the spacing between the RBs is chosen so as to optimally exploit the frequency diversity offered by the channel. The coherence time and the coherence bandwidth of the block-fading model are chosen so as to match the ones prescribed by the extended pedestrian type A (EPA) 5 Hz [11] and the tapped delay line type-C (TDL-C) 300 ns–3 km/h [12] channel models. Furthermore, the number and the distribution of the RBs in frequency as well as the number of pilot symbols are optimized. We analyze how the performance of a single-input multiple-output (SIMO) system depends on the number of available receive antennas. We also illustrate that the sensitivity of the Alamouti scheme to imperfect channel estimation makes this scheme unsuitable for transmission over channels exhibiting a large amount of frequency selectivity. Notation: We shall denote vectors and matrices by bold lower and uppercase letters, such as x and X, respectively. The identity matrix of size a × a is written as Ia . The distribution of a circularly-symmetric complex Gaussian  random variable with ∗ variance σ 2 is denoted by CN 0, σ 2 . The superscripts (·) , T H (·) , and (·) denote conjugation, transposition, and Hermitian transposition, respectively. We write log(·) and log2 (·) to denote the natural logarithm and the logarithm to the base 2, + respectively. Finally, [a] stands for max{0, a}, Q(·) denotes the Gaussian Q-function, k·k the `2 -norm, k·kF the Frobenius norm, and E[·] the expectation operator. II. S YSTEM M ODEL A. Input-Output Relation We consider a discrete-time MIMO block-fading channel with Mt transmit and Mr receive antennas. Let nc be the size of each coherence block, i.e., the number of channel uses over which the channel stays constant. We assume that each codeword of length n spans L coherence blocks, i.e., n = Lnc . We shall refer to L as the number of diversity branches. The signal received during block ` is Y` = H` X` + W` , (1) where Y` ∈ CMr ×nc is the channel output, H` ∈ CMr ×Mt is the matrix containing the fading coefficients in the `th coherence block, X` ∈ CMt ×nc is the channel input, and W` ∈ CMr ×nc is the AWGN matrix. The noise matrices {W` } have independent and identically distributed (i.i.d.) entries drawn from CN (0, 1) and are independent across `. The fading matrices {H` } are also i.i.d. over `; their distribution is, however, arbitrary. Furthermore, we assume that {H` } and {W` } are independent, and that they do not depend on {X` }. We next define the notion of a channel code. Definition 1: An (n, M, )-code consists of: • • An encoder f : {1, . . . , M } → CMt ×n that maps the message J, which is uniformly distributed on the set {1, . . . , M } to a codeword Cm = f (J) ∈ CMt ×n in the codebook set {C1 , . . . , CM }. Each codeword satisfies the power constraint kCm k2F 6 nc ρ, m = 1, . . . , M . A decoder g : CMr ×n → {1, . . . , M } that maps the channel output Y = [Y1 , . . . YL ] to a message estimate Jb = g(Y ). The decoder satisfies the average packet error probability constraint Pr{Jb 6= J} 6 . (2) The maximum coding rate R∗ (n, ) for a given blocklength n and a given error probability  is the largest rate achievable using (n, M, )-codes:   log2 M ∗ : ∃(n, M, )-code . (3) R (n, ) = sup n Similarly, we define the minimum error probability ∗ (n, R) achievable using codes of blocklength n and rate R = n−1 log2 (M ) as  ∗ (n, R) = inf  : ∃(n, d2nR e, )-code . (4) This quantity is often studied as a function of the energy per bit normalized by the noise spectral density, Eb /N0 = ρ/R. B. PAT and SNN Decoding We assume that each input matrix X` is of the form X` = (p) (d) (p) (p) [X` X` ] where X` ∈ CMt ×np . Here, X` , with Mt 6 np < nc , is a deterministic matrix containing orthogonal pilot sequences in each row. Specifically, we assume that (p) (p) H (d) X` X` = (ρnp /Mt )IMt . The matrix X` ∈ CMt ×nd , where nd = nc − np , contains the data symbols. (p) (d) Let Y` and Y` be the matrices containing the received samples that correspond to the pilot and the data symbols within (p) (d) the `th coherence block, respectively. Given Y` and Y` , the c` receiver computes the maximum likelihood (ML) estimate H of the fading matrix H` as  c` = Mt Y (p) X (p) H . H ` ` ρnp (5) Then, the decoder produces as output the message Jb = arg max q (L) (Cm , Y ) (6) 16m6M where q (L) (X, Y ) = L Y (7) q(X` , Y` ) `=1 with X = [X1 , . . . , XL ] and q(X` , Y` ) = nd Y (d) c` x(d) k2 exp −ky`,k − H `,k  (8) k=1 (d) (d) is the SNN decoding metric. Here, y`,k and x`,k denote the kth (d) (d) column of the matrices Y` and X` , respectively. c` = H` , i.e., Some remarks on (8) are in order. When H when perfect CSI is available at the receiver, the SNN decoding metric q(X` , Y` ) in (8) is equivalent to the ML metric, which is optimal in the sense that it minimizes the error probability Pr{Jb 6= J}. However, using this rule for the case of inaccurate CSI considered in this paper yields a mismatch. The transceiver architecture just described, which relies on PAT, on ML channel estimation, and on SNN decoding, and which we shall refer to as PAT-ML-SNN coding scheme, is ubiquitous in current wireless systems, although suboptimal. Treating the channel estimate as perfect enables the use of the “coherent” decoding rule (6)–(8), whose performance can be approached in practice using good channel codes for the AWGN channel. III. B OUNDS ON THE E RROR P ROBABILITY The performance of the PAT-ML-SNN coding scheme just introduced can be analyzed using the mismatch-decoding framework [13]. Specifically, our analysis is based on the RCUs achievability bound [14, Thm. 1], a relaxation of the RCU bound [3, Thm. 16] that recovers the generalized random-coding error exponent for mismatch detection introduced in [15]. Our main result is given in the following theorem. Theorem 1: Fix an integer 1 6 nd < nc , a real number s > 0, and a probability distribution PX (d) on CMt ×nd for which kX (d) k2F 6 ρnd w.p.1 when X (d) ∼ PX (d) . Let the generalized information density ıs (X` , Y` ) be defined as ıs (X` , Y` ) = log (p) (d) q(X` , Y` )s EX̄` [q(X̄` , Y` )s ] (9)    RCUs (n, R) ≈ exp −L E0 (τ̂ , s) − τ̂ E00 (τ̂ , s) n  q  L 00 2 · Q τ̂ −LE000 (τ̂ , s) e− 2 E0 (τ̂ ,s)τ̂ q   L 00 o 2 + Q (1 − τ̂ ) −LE000 (τ̂ , s) e− 2 E0 (τ̂ ,s)(1−τ̂ ) (12) where the Gallager’s generalized E0 function is i h E0 (τ, s) = − log E e−τ ıs (X1 ,Y1 ) , (13) and E00 and E000 denote the first and the second partial derivatives of E0 with respect to τ , respectively, The parameter τ̂ in (12) is (p) where X̄` = [X̄` , X̄` ] with X̄` an arbitrary pilot matrix (d) satisfying the properties listed in Section II-B, and X̄` ∼ PX (d) . The average error probability (n, R) achievable with the PAT-ML-SSN coding scheme described in Section II-B is upper-bounded by (n, R) 6 RCUs (n, R) "  + #  X L nR ıs (X` , Y` ) − log(2 − 1) = E exp − `=1 Sec. V], where the error in the approximation is analyzed). The resulting saddlepoint approximation of RCUs (n, R) is (10) where X` is distributed as X̄` and Y` is the induced channel output according to (1). Proof: We consider all codebooks whose codewords have data symbols that are generated independently according to the product distribution built upon PX (d) , and have the pilot (p) symbols X` in each coherence interval. It follows from [14, Thm. 1] that the error probability, averaged over all codebooks, achievable with the decoding rule (6) is upper-bounded by RCUs (n, R) given in (10). A. Saddlepoint Approximation When PX (d) is taken as product distribution, i.e., Qnd (d) (d) PX (d) (X (d) ) = stands for k=1 Px (xk ), where xk the kth column of X (d) —a choice we will focus on in the numerical results reported in Section IV—the generalized information density takes the following form: nd  X (d) c` x(d) k2 ıs (X` , Y` ) = −sky`,k − H `,k k=1 h  i (d) c` x(d) k2 . (11) − log E exp −sky`,k − H `,k Even in this case, though, RCUs (n, R), does not admit in general a closed-form expression. This makes its computation challenging for low error probabilities. To partly overcome this issue, we present next a saddlepoint approximation of RCUs (n, R), which we will show in Section IV to be remarkably accurate over a large range of channel and system parameters. We obtain this approximation by proceeding as in [14, Sec. IV.B] (see also [10, ( ) log 2nR − 1 τ̂ = arg max E0 (τ, s) − τ . L τ ∈(0,1) (14) A closed form expression for (13) and its partial derivatives is in general not available. Hence, we shall turn to Monte Carlo methods to evaluate (12). Note, that, due to the blockmemoryless assumption, the numerical complexity of the approximation in (12) is independent of the number of diversity branches L. In contrast, the complexity of the numerical evaluation of RCUs (n, R) in (10) increases with L. B. The SIMO Case In the SIMO case, the SNN decoding metric (8) reduces to q(x` , Y` ) = nd Y   (d) b ` x(d) k2 . exp −ky`,k − h `,k (15) k=1 To simplify the computation of (10), it is convenient to left(d) b ` x`,k by a unitary matrix whose first multiply the vector y`,k − h b H /kh b ` k. This corresponds to performing maximumrow is h ` b`. ratio combining at the receiver, based on the estimated CSI h Since all the entries of the rotated vectors but the first one do not depend on x`,k they can be dropped when solving (6). This is equivalent to applying the RCUs bound in Theorem 1 to the following setup: i) the channel (1) is replaced by the blockfading SISO channel y`T = b H h` h ` xT` + w`T b kh` k (16) where the vectors y` , x` , and w` have nd entries; furthermore, the vector h` contains the Mr channel coefficients in the `th b ` is its ML estimate. ii) The decoding coherence block and h metric q(·, ·) in (8) is replaced by q(x` , y` ) = nd Y k=1 b ` kx`,k exp − y`,k − kh 2 . (17) C. Spatial Diversity through Alamouti We next focus on the 2 × 2 MIMO setup, and discuss the scenario in which an Alamouti inner code is used to obtain spatial diversity from the two available transmit antennas. Let x` ∈ Cnd , with kx` k2 6 nd ρ/2, be the vector of data symbols to be transmitted over the coherence block `. Through this section, (d) we shall assume that nd is even. The data matrix X` ∈ C2×nd is constructed as  T  x` (d) X` = . (18) e(x` )T f B BRB Coherence block L (19) [b]2k = [e(a)]2k = −[a]∗2k−1 (20) for k = 1, . . . , nd /2. Exploiting the structure of the data matrix, one can show that, for the case of perfect CSIR, the performance of this scheme is equal to that of a 1 × 4 SIMO system where the power of the data symbols is halved. This is, however, no longer the case when the CSI is acquired through pilot symbols, and hence, inaccurate. In this case, the performance of this coding scheme can be analyzed by applying the RCUs bound in Theorem 1 to an equivalent channel and decoding metric we shall specify next. Let x̃`,k be a 2dimensional vector obtained from x` by taking the symbol in position 2k − 1 and the complex conjugate of the symbols in position 2k, k = 1, . . . nd /2. We apply the RCUs bound to the equivalent channel  1 bH H V`,1 V`,1 + Vb`,2 V`,2 x̃`,k + w`,k y`,k = (21) c` kF kH where V`,j  h = `,1,j h∗`,2,j h`,2,j −h∗`,1,j  (22) with h`,i,j = [H` ]i,j , i ∈ {1, 2}, j ∈ {1, 2}. The matrix Vb`,j is defined as in (22), with the entries of H` replaced by the entries c` . of its ML estimate H Furthermore, we use the symbol-wise mismatch decoding metric nd Y  c` kF x̃`,k 2 . q(x̃` , y` ) = exp − y`,k − kH (23) k=1 IV. N UMERICAL R ESULTS We consider a target packet error probability of  = 10−5 , in line with the specifications for URLLC [16], a payload of k = 30 bits, which models the so-called compact downlink control information (DCI) [17], and a blocklength n = 288 symbols. This results in a rate of R = k/n = 0.104 bit/channel use. Our goal is to identify the system parameters (number of antennas, number of pilot symbols, and distributions of the symbols in the time-frequency plane) that allow us to meet the above requirements. To do so, we use the RCUs bound in Theorem 1.1 1 Throughout this section, we set s = 1 in (10) for simplicity. An optimization over s > 0 is left for future works. Bc TRB Tc Here, the function e : Cnd → Cnd maps an input vector a into an output vector b according to the Alamouti rule [8] [b]2k−1 = [e(a)]2k−1 = [a]∗2k LTE RB d Bc Coherence block 1 r Tc t Fig. 1. Channel and signal properties in the time-frequency plane. TABLE I C HANNEL ( UPPER HALF ) AND SIGNAL ( BOTTOM HALF ) PARAMETERS . Symbol Parameter EPA 5 Hz TDL-C 300 ns–3 km/h Bc Tc Lmax 50% coh. bandwidth 50% coh. time Max no. div. branches 4.4 MHz 85 ms 4 0.66 MHz 85 ms 30 L nc n No. div. branches Coh. block size Blocklength 4 72 288 12 24 288 For the sake of concreteness, we take as input distribution independent QPSK signaling and assume that the pilot and the data symbols are transmitted at the same power level. Also we focus on 1×Mr SIMO, with Mr ∈ {1, 2, 4} and on 2×2 MIMO with Alamouti. We assume the use of orthogonal frequency-division multiplexing (OFDM) with an LTE numerology. This means that each codeword is assigned a number of RBs, each one consisting of d OFDM symbols spanning 12 subcarriers. For a typical downlink control channel transmission in LTE, d is between 1 and 3. As shown in Fig. 1, we allow the RBs to be separated in frequency, but not in time, to benefit from frequency diversity and to limit the transmission delay. We consider two channel models, which yield a different number of available diversity branches: the EPA 5 Hz [11] and the TDL-C 300 ns–3 km/h [12]. To map these channel models into the block-memoryless fading model (1), we compute their coherence bandwidth Bc and their coherence time Tc . These values are given in Table I. Note that the system bandwidth in LTE is B = 20 MHz and that an RB lasts 0.5 ms and occupies BRB = 180 kHz. This means that the two channels offer no time diversity and a maximum number of diversity branches Lmax = bB/Bc c, which is 4 for the EPA 5 Hz and 30 for the TDL-C 300 ns–3 km/h. Throughout this section, we focus on Rayleigh fading, i.e., H` in (1) has i.i.d. CN (0, 1) entries. Since 0 10 np = 6 fp 0 10 −2 0.75 1 4 10−2  ρ (dB) np = 12 6 Eb /N0 (dB) np = 6 np = 48 −6 0.5 10−1 np = 4 np = 28 −4 0.25 8 np = 12 np = 48 0 10−3 np = 28 −8 RCUs-SIMO, Mr = 4 RCUs-Ala, Mr = 2 1 2 3 4 RCUs-SISO, Mr = 1 RCUs-SIMO, Mr = 2 RCUs-SIMO, Mr = 4 RCUs-Ala, Mr = 2 −5 10 6 L 8 12 16 24 0 32 Fig. 2. Minimum SNR to achieve  = 10−3 as a function of the number of frequency diversity branches used: each curve corresponds to a different number of pilot symbols. The optimal number of pilots is reported near some of the points of the envelope. the noise variance is also 1, we can interpret ρ as the SNR at each receive antenna. In order to obtain an equivalent block-fading model, we limit the number of RBs per coherence bandwidth to r 6 Bc /BRB . The size of the coherence interval nc in (1) is thus nc = 12dr. Choosing L = 4 for the EPA 5 Hz results for example in nc = 72, which can be obtained by setting d = 2 and r = 3. Similarly, choosing L = 12 for the TDL-C 300 ns–3 km/h results in nc = 24, which corresponds to d = 2 and r = 1. To illustrate how performance is affected by the choice of the number of diversity branches, we depict in Fig. 2 the minimum SNR needed to achieve 10−3 as a function of the number of available diversity branches for the SIMO 1×4 and the Alamouti 2 × 2. Each shaded curve in the plot corresponds to a different number of pilot symbols, and the envelope corresponds to the optimal number of pilots. We observe that L = 4 yields the lowest SNR value for both systems. However, the curves are rather flat around their minimum. For example, ρ lies within 0.5 dB from its minimum value for all L between 2 and 9. We next focus on the EPA 5 Hz channel and plot in Figs. 3 and 4 the packet error probability as a function of the number of pilot symbols and the SNR, respectively. Motivated by our findings in Fig. 2, we consider the case L = 4, which is the maximum amount of frequency diversity offered by this channel (see Table I). In Fig. 3, we report the error probability as a function of the number of pilot symbols for SIMO and Alamouti. Here, ρ = −4 dB. We observe that the error probability is extremely sensitive to changes in the number of pilot symbols. For example, in the SIMO 1 × 4 case, reducing the number of pilot symbols from its optimal value of 28 to 22, which corresponds to a reduction in the fraction fp = np /nc of pilot symbols of 8.3%, doubles the error probability. In Fig. 4, we plot the error probability for the optimal fraction of pilot symbols found in Fig. 3. Each curve is computed for 10−6 0 18 36 np 54 72 Fig. 3. Error probability vs. number of pilots (bottom axis) or fraction of pilots (top axis) for ρ = −4 dB (equivalent to Eb /N0 = 6 dB) for the EPA 5 Hz block-equivalent model. Eb /N0 (dB) 0 100 2 4 6 8 −6 ρ (dB) −4 −2 10−1 10−2  −10 10−4 2 10−3 10−4 −5 10 10−6 −10 RCUs-SISO, Mr = 1 RCUs-SIMO, Mr = 2 RCUs-SIMO, Mr = 4 RCUs-Ala, Mr = 2 −8 Fig. 4. Error probability vs. SNR (bottom axis) or Eb /N0 (top axis) for the EPA 5 Hz block-equivalent model. Solid lines: RCUs bound (10); dashed lines: saddlepoint approximation (12). the optimal fraction of pilots of the corresponding scheme. We also depict the corresponding saddlepoint approximations (12), which turn out to be extremely accurate. As expected, the SIMO 1×4 and the Alamouti 2×2 curves have the same slope because these two setups provide the same amount of space-frequency diversity. The gap is around 3 dB—the expected gap for the case of perfect CSIR. This implies that the channel estimate is sufficiently accurate. We conclude from Figs. 3 and 4 that the only system able to meet the target packet error probability of 10−5 within the range of SNR values considered in the figures is the SIMO 1 × 4. We now move to the TDL-C 300 ns–3 km/h, which offers a fp 0 10 0 0.25 0.5 0.75 1 10−1  10−2 RCUs-SISO, Mr = 1 RCUs-SIMO, Mr = 2 RCUs-SIMO, Mr = 4 RCUs-Ala, Mr = 2 10−3 10−4 10−5 10−6 0 6 12 np 18 24 Fig. 5. Error probability vs. number of pilots (bottom axis) or fraction of pilots (top axis) for ρ = −4 dB (equivalent to Eb /N0 = 6 dB for the TDL-C 300 ns– 3 km/h block-equivalent model. Eb /N0 (dB) 0 100 2 4 6 8 −6 ρ (dB) −4 −2 10−1  10−2 10−3 10−4 −5 10 10−6 −10 RCUs-SISO, Mr = 1 RCUs-SIMO, Mr = 2 RCUs-SIMO, Mr = 4 RCUs-Ala, Mr = 2 −8 Fig. 6. Error probability vs. SNR (bottom axis) or Eb /N0 (top axis) for the TDL-C 300 ns–3 km/h block-equivalent model. Solid lines: RCUs bound (10); dashed lines: saddlepoint approximation (12). larger maximum number of diversity branches in frequency. We assume that the system is designed so that L = 12 (see Table I for a complete list of system parameters). Although the analysis reported in Fig. 2 points out that L = 4 should be chosen to minimize the SNR (at least at a target packet error probability of 10−3 ), investigating the case L = 12 allow us to assess the impact of frequency selectivity on the performance of the SIMO and the Alamouti schemes. Figs. 5 and 6 parallel Figs. 3 and 4, respectively, with L = 12 instead of L = 4. Comparing Figs. 3 and 5, we see that, although the optimal number of pilot symbol is smaller when L = 12, because the coherence block is smaller, the fraction of pilot symbols fp is actually larger. We also observe that when the number of pilot symbols is chosen optimally, the minimum error probability achievable in the SIMO case when L = 12 is similar to when L = 4. On the contrary, the error probability of the Alamouti 2×2 scheme increases by an order of magnitude when moving from L = 4 to L = 12. This is because the Alamouti scheme is more sensitive to imperfect channel estimation, due to the processing needed to extract diversity from the two transmit H antennas, i.e., the left-multiplication by the matrices Vb`,1 and H b V`,2 in (21). This effected is also illustrated in Fig. 6, where we see that the gap between Alamouti and SIMO 1 × 4 is now 3.5 dB, instead of the 3 dB loss we observed in Fig. 4. Indeed, for this scenario better performance can be achieved within the range of SNR values depicted in the figure using a SIMO 1 × 2, i.e., switching off one of the two transmit antennas. R EFERENCES [1] ITU-R, “Report ITU-R M.2412-0: Guidelines for evaluation of radio interface technologies for IMT-2020,” International Telecommunication Union, Tech. Rep., Oct. 2017. [2] G. Durisi, T. Koch, and P. Popovski, “Towards massive, ultra-reliable, and low-latency wireless communication with short packets,” Proc. IEEE, vol. 104, no. 9, pp. 1711–1726, Sep. 2016. [3] Y. Polyanskiy, H. V. Poor, and S. Verdú, “Channel coding rate in the finite blocklength regime,” IEEE Trans. Inf. Theory, vol. 56, no. 5, pp. 2307– 2359, May 2010. [4] W. Yang, G. Durisi, T. Koch, and Y. Polyanskiy, “Quasi-static multipleantenna fading channels at finite blocklength,” IEEE Trans. Inf. Theory, vol. 60, no. 7, pp. 4232–4265, Jul. 2014. [5] G. Durisi, T. Koch, J. Östman, Y. Polyanskiy, and W. Yang, “Short-packet communications over multiple-antenna Rayleigh-fading channels,” IEEE Trans. Commun., vol. 64, no. 2, pp. 618–629, Feb. 2016. [6] W. Yang, G. Caire, G. Durisi, and Y. Polyanskiy, “Optimum power control at finite blocklength,” IEEE Trans. Inf. Theory, vol. 61, no. 9, pp. 4598– 4615, Sep. 2015. [7] J. Östman, G. Durisi, E. G. Ström, M. C. Coşkun, and G. Liva, “Short packets over block-memoryless fading channels: Pilot-assisted or noncoherent transmission?” Dec. 2017. [Online]. Available: https: //arxiv.org/abs/1712.06387 [8] S. Alamouti, “A simple transmit diversity technique for wireless communications,” IEEE J. Sel. Areas Commun., vol. 16, no. 8, pp. 1451–1458, Oct. 1998. [9] J. L. Jensen, Saddlepoint Approximations. Oxford, U.K.: Oxford Univ. Press, 1995. [10] J. Scarlett, A. Martinez, and A. Guillén i Fàbregas, “Mismatched decoding: Error exponents, second-order rates and saddlepoint approximations,” IEEE Trans. Inf. Theory, vol. 60, no. 5, pp. 2647–2666, May 2014. [11] 3GPP, “TS 36.104: Technical specification group radio access network,” 3GPP, Tech. Rep., 2012. [12] ——, “TR 38.901: Study on channel model for frequencies from 0.5 to 100 GHz,” 3GPP, Tech. Rep., 2017. [13] N. Merhav, G. Kaplan, A. Lapidoth, and S. Shamai (Shitz), “On information rates for mismatched decoders,” IEEE Trans. Inf. Theory, vol. 40, no. 6, pp. 1953–1967, Nov. 1994. [14] A. Martinez and A. Guillén i Fàbregas, “Saddlepoint approximation of random–coding bounds,” in Proc. Inf. Theory Applicat. Workshop (ITA), San Diego, CA, U.S.A., Feb. 2011. [15] G. Kaplan and S. Shamai (Shitz), “Information rates and error exponents of compound channels with application to antipodal signaling in fading environment,” Int. J. Electron. Commun. (AEÜ), vol. 47, no. 4, pp. 228– 239, Jul. 1993. [16] 3GPP, “TR 38.913: Study on scenarios and requirements for next generation access technologies,” 3GPP, Tech. Rep., 2017. [17] Ericsson, “R1-1720997: On PDCCH for ultra-reliable transmission,” 3GPP, Tech. Rep., 2017.
7cs.IT
1 A Kullback–Leibler Divergence-based Distributionally Robust Optimization Model for Heat Pump Day-ahead Operational Schedule in Distribution Networks Zihao Li, Wenchuan Wu, Senior Member, IEEE, Boming Zhang, Fellow, IEEE Abstract—For its high coefficient of performance and zero local emissions, the heat pump (HP) has recently become popular in North Europe and China. However, the integration of HPs may aggravate the daily peak-valley gap in distribution networks significantly. In this paper, we describe a distributionally robust optimization (DRO)-based heat pump day-ahead operational schedule model (HP-DOSM) to shave the peak and reduce residents’ costs under time-of-use. The ambiguity set of the DRO is constructed using Kullback–Leibler divergence with a nominal distribution. This model can well capture the uncertainties of weather, photovoltaic, and load prediction errors. Moreover, this DRO based HP-DOSM can be transformed into a tractable deterministic model. Compared with robust optimization (RO) models, our model is less conservative since more statistical information of the uncertainties is utilized. Numerical tests were conducted to demonstrate its performance, compared with the RO model via Monte Carlo simulations. Ck Rw, k Cw, k xk ,t xk PHP , k  COP , k  w2h,k Z PLoad , k ,t PPV , k ,t Z Ptrans ,t  P ,t T , t Pt t P0t 1Index Terms—Distribution network, distributionally robust optimization, day-ahead operational schedule, Kullback–Leibler divergence Qt NOMENCLATURE t Qt Q0t N H Tk ,t Tw, k ,t Tout ,t Tk Tw, k Tout Tk Tk Rk Total number of houses equipped with heat pump and water tank Time horizon in 1 day Indoor air temperature of the kth house at time t Tank water temperature of the kth house at time t Outdoor temperature at time t Vector Tk ,0 Tk ,1 T T Vector  w, k ,0 w, k ,1 Tout ,0 Tout ,1 Vector Tk , H  T Tw, k , H  Tout , H  T T Upper temperature boundary of the kth house Lower temperature boundary of the kth house Thermal resistance of the kth house Manuscript received XXX, 2017. This work was supported in part by the National Science Foundation of China (51477083), in part by Key Science and Technology Project of State Grid Corporation of China (Grant. 5202011600U4). The authors are with the State Key Laboratory of Power Systems, Department of Electrical Engineering, Tsinghua University, Beijing 100084, China (e-mail: [email protected]). t Thermal capacitor of the kth house Thermal resistance of the kth water tank Thermal capacitor of the kth water tank ON/OFF (1/0) state of the kth heat pump x x Vector  k ,0 k ,1 xk , H  T Rated power of the kth heat pump Coefficient of performance of the kth HP Water tank to house heating efficiency of the kth house Zone of local transformer and feeder lines Load of the kth house except heat pump at time t Photovoltaic power of the kth house at time t Transformer power of zone Z at time t Forecast errors of power at time t Forecast errors of outdoor temperature at time t Distribution of power forecast error at time t P Ambiguity set of t  Center/nominal distribution of t Distribution of outdoor temperature forecast error at time t Q Ambiguity set of t Q Center/nominal distribution of t Farthest KL divergence in the ambiguity set of power forecast error at time t Farthest KL divergence in the ambiguity set of outdoor temperature forecast error at time t I. INTRODUCTION (HPs) have seen a revival in recent years, in Heatwhichpumps their potential role with renewable energy sources is being investigated. HP technologies have experienced great improvements in operating stability and have subzero coefficient of performance [1], providing confidence for consumers in their reliability. Unsurprisingly, more than 750,000 units were sold in the EU-20, reducing greenhouse gas emissions by 6.8 Mt in 2010 [2]. However, HPs have placed a considerable load on power systems, although recognized as a promising resource for demand-side management in using renewable energy [3]. In recent years, a policy named ‘Coal to Electricity’ has been promulgated in Beijing, to replace coal stoves in the nearby countryside with HPs for heating, which may be beneficial in reducing the gray smog sky over Beijing [4]. By the end of November 2016, 2 227,000 houses in 663 counties in Beijing had had electrical heaters installed [5]. However, the local distribution networks take the risk of having insufficient capacity in transformers and branches, where more investment in infrastructure is needed. An optimal day-ahead operational schedule strategy for HPs may provide the benefit of peak-shaving [6] and make better use of renewable energy [7]. For a local distribution network, integrated with renewable energy generators and HPs, its day-ahead operational schedule suffers uncertainties, from, for example, weather predictions, load predictions, and renewable energy predictions. Conventionally, stochastic optimization (SO) and robust optimization (RO) techniques have been used to capture uncertainties. Recently, distributionally robust optimization (DRO) has been considered a more practical paradigm for decision making under uncertainty, where the uncertain variable is governed by a probability distribution type that is itself subject to uncertainty [8]. DRO provides more robustness with ambiguous distribution sets and is less conservative than classical RO; moreover, it does not require explicit distribution of uncertain variables, like SO, and demonstrates application potential in many areas [9-12]. The ambiguity set of a DRO problem is a family of distributions, characterized through certain known properties of the real distribution [13] and must be rich enough to include the real distribution while small enough to exclude pathological distributions [14]. How the ambiguity set is constructed is key to DRO, and there are two main ways: moments-based and distance-based methods. The momentsbased method usually defines an ambiguity set by restricting the mean and covariance matrix of the distributions to some given values; thus, the DRO model can be further transformed into a deterministic Semidefinite Programming(SDP) or Second Order Programming(SOCP) problem under several linear assumptions and approximations [12, 15, 16]; however, odd distributions and mixed integer problems may introduce additional complexity. Distance-based methods define the ambiguity set as a ball in the measured space of probability distributions, using a probability distance function, such as the Prokhorov metric [17], Kullback–Leibler divergence (KL divergence) [15, 18], or the Wasserstein metric [14]. Distance-based ambiguity sets limits on the shape of distributions that explicitly use data distribution information and may decrease the conservatism and the robustness that could be controlled with explicit meanings. Due to the ON/OFF nature of HPs, the day-ahead HP operational schedule is a mixed-integer linear program (MILP) with uncertain variables. For moments-based DRO models, methods such as Benders decomposition [19], linear approximation [11], and conic programming methods [20], are used to solve them. However, if these models incorporate mixed-integer variables, they may become intractable. In this paper, a KL distance-based MILP DRO model is described for a HP day-ahead operational schedule. It can be transformed to a tractable deterministic MILP model. Moreover, the distance-based DRO can better use historical data [14, 15, 21]. In [15], it was suggested that adopting distance-based ambiguity sets is less conservative. This paper is based on the works [15, 18], and the major contributions include the following: (1) A heat pump day-ahead operational schedule model (HP-DOSM) is proposed to shave the peak and reduce residents’ cost, which is formulated as a MILP DRO. A KL divergence-based ambiguity set is used to capture uncertainties in the prediction errors in outdoor temperature, residential load, and photovoltaic power. (2) The proposed MILP DRO model is transformed to a tractable deterministic MILP problem under two nominal distributions: a Gaussian distribution and a kernel density estimator (KDE). (3) Numerical tests show that the proposed approach has potential to provide effective peak shaving and outperforms the conventional RO model. The remainder of the paper is organized as follows. Section II presents the deterministic day-ahead HP operational schedule model. Section III discusses the formulation of MILP DRO model and use of historical data. Numerical tests are described in Section IV. The paper ends with conclusions and future work in Section V. II. DETERMINISTIC HEAT PUMP DAY-AHEAD OPERATIONAL SCHEDULE MODEL Figure 1 shows a local distribution network integrated with photovoltaic panels and consumers with air-source HPs. For comfort considerations, the HP first heats the water in a tank to supply heat for the house. The tank is installed indoors and links to a finned tube with constant water flux. Distribution network Figure 1. Local distribution network We apply a one-order equivalent thermal RC model to simulate the house and the water tank. The RC model is Tk  Tw, k formulated as follows, xk  COP , k PHP , k  Rw, k  Cw, k Tw, k T  Tk Tout  Tk   w 2 h , k w, k  CkTk Rk Rw, k where Rk , Ck and Rw, k , Cw, k (1) (2) are the 1st-order thermal parameters of the house and water tank, respectively, of the k th house, and they can be identified from historical T T T measurements for real application. k , w, k , and out are the indoor air, water tank, and outdoor air temperatures, P   x respectively. HP , k , COP , k , w 2 h , k , and k are the rated power, constant HP to water coefficient of performance (COP), constant water-to-house efficiency, and the ON-OFF 3 kw 2 h , khouse’s Rk (Tw, k ,t HP. Tk ,t ) The difference schemes of (1) state of Tk ,tthe  Tout ,t 1  R and (2) are w, k th  {Tk ,t  [Tout ,t   w 2 h , k Rk (Tw, k ,t  Tk ,t ) Rw, k  ]}e t Rk Ck (3) Tw, k ,t 1  Rw, k  COP , k PHP , k xk ,t  Tk ,t  (Tw, k ,t  ( Rw, k  COP , k PHP , k xk ,t  Tk ,t ))e  t Rw , k Cw ,k (4) where t is the time interval. The HP operates in two alternative modes: OFF and ON. Thus, the power consumed by a HP is a function of its operational state: 1, for statek ,t  ON PHP , k ,t  xk ,t PHP , k,where xk ,t   0, for statek ,t  OFF (5) The objective function of the HP day-ahead operational schedule we propose includes shaving the peak load at the Z local transformer and minimizing electricity   Pmax the t xk ,t PHPcost:  ,k Z Trans k Z t minimize (6) PZ where max represents one-day’s maximum power load on the transformer Z ,  is a penalty weight for peak shaving,  called the peak cost factor [22], and t represents the time of use (TOU) electricity price. A DC power flow model is used for the distribution network and the power balance constraint for the transformer Z of zone Z is: PTrans , t   xk , t PHP , k , t   PLoad , k ,t   PPV , k ,t k Z k Z k Z (7) where PLoad , k ,t and PPV , k ,t are the residential loads (except the HPs) and the PV output. The capacity constraints of the transformer are Z Z Pmax  PTrans ,t , t =1,2,..., H Z Z Pmax  Ptrans _ capacity where Z trans _ capacity P With the given prediction data, this MILP model can solved efficiently. However, the schedule decision based on bias prediction may lead to infeasibility in real operation. Accordingly, we introduce a KL divergence-based DRO in the next section, considering the uncertainties of forecast errors in outdoor temperature, load prediction, and PV prediction. III. (9) The initial temperature settings are In this section, we first present the KL divergence-based DRO (KL-DRO) formulation to minimize total cost given the expectation constraints. Then, this KL-DRO model is transformed to a deterministic MILP. Finally, we discuss how to use historical data to build an ambiguity set for the KL-DRO model as well as the risk meaning of the radius distance of the ambiguity set. There are several statistical distance functions, such as the Prokhorov metric, the KL divergence, and the Wasserstein metric, which show common properties and can co-transfer in some situations [17]. Here, the KL divergence is adopted and p( ) is defined as DKL ( p( ) || q( ))   p( )ln d  q( ) (15) A. KL-DRO model To capture the uncertainties in prediction errors, we reform the deterministic constraints, (8), (10), and (13), as expected constraints under the worst distribution in the ambiguity sets: Z i.e., constraints (7) are max EP [  xk ,tand PHP , k (8)  P sum Pmax ]  0, t as  1, 2, , H , t reformed P k Z (16) P sum,t   P Load , k ,t   P PV , k ,t Z Here, (12) Z P sum,t  Psum ,t   P ,t tank water, and Z Psum ,t (14) prediction error. P The distribution function t are the initial temperatures of the indoor air and the Tk , Tk is the summation of load demand and PV output in zone Z. P sum ,t is further expressed as Z where T where index t represents the schedule time, k ,t  0, set and Tw, k ,t  0, set k Z (13) and the HP ON-OFF switching time-delay limitations are 2  2 xk ,t  xk ,t 1  xk ,t 1  2 k Z Z (11) The daily water temperature hold is Tw, k ,t  H  Tw, k ,t 0 KL DIVERGENCE-BASED DRO MODEL FOR HP DAY-AHEAD OPERATIONAL SCHEDULE (8) is the rated capacity of the local Tw, k ,t  0  Tw, k ,t  0, set Model 1: Deterministic heat pump day-ahead operational schedule model min (6) s.t. (3)(4),(7)-(14) xk ,t {0,1} t  1, , H , k  1,2, , N , Z , where p, q are distribution functions in measure space  . transformer Z and H is the total schedule time periods of 1 day. Thermal constraints include (3), (4), indoor temperature comfort constraints: Tk  Tk ,t  Tk (10) Tk ,t  0  Tk ,t  0, set indicate that the HP needs to keep the same mode for at least two time intervals. Then, the deterministic HP-DOSM can be formulated as: are the indoor air temperature comfort range bounds. The switching time-delay constraints is the prediction value and ambiguity set t of  P ,t  P ,t (17) represents the belongs to the , defined as t  {Pt  t | DKL ( Pt || P0t )  t } (18) where is the farthest KL divergence with the nominal P distribution 0t , also referred to as the radius. t 4 In a similar way, we can also reformulate constraints (10) and (13) as max E [ J x  K T  l  T ]  0 Q k k k out k k QQ (19) max EQ [ J k xk  Kk T out  lk  Tk ]  0 QQ max EQ  Z 0 ( M w, k xk  N w, k T out  pw, k )  Tw, k , t  0, set   0 QQ where xk , Tk Tw, k , Tout (21) are the vectors explained in the Z 0  0 0 nomenclature, (20) 1 , and the equalities (3) and T out , t  Tout , t  T , t (4) are merged in these formulae, , for dividing the prediction value and the uncertain part. The  Q distribution function t of T ,t belongs to the ambiguity Q  {Qt  Qt | DKL (Qt || Q0t )  t } Q set t , which is defined as t  and t is the farthest KL divergence (radius) with the Q nominal distribution 0t . Details of this reformulation are provided in Appendix A. Thus, the KL-DRO model for the HP day-ahead operational schedule is described as follows. Model 2: KL-DRO model min (6) s.t. (9), (11)(12)(14), (16)-(21) xk ,t {0,1} t  1, , H , k  1,2, , N , Z , expressions exist, then the minimization problem over  can be solved and these constraints are transformed to P ,Q deterministic ones. Thus, the nominal distributions 0t 0t need to take an exponential form. Two ways are proposed here to obtain the nominal distribution according to the different methods of using the historical data. One is the Gaussian assumption (GA), in which it is assumed that the nominal distribution obeys a Gaussian distribution, the mean and variance of which are calculated from the first and second moments of the historical data, respectively. The other way is the KDE approximation (KDEA) [23], in which the uncertain variable  has the following distribution function: 1 N  i  f N ( )  NhN   {P   | DKL ( P || P0 )  }   H ( )d  0 , and   2 H ( )d  0 can be transformed into the following form on the basis of min h( x) strong duality theory: x (23) S  {s  | s  0, EP0 [esH ( x , ) ]  } if for every x  X , is not empty. Based on the theorem, the expectation constraints, (16) -(21), in Model [2can into x P be  P transformed  P   ]/  min{ ln EP0 [e kZ k HP , k Z sum Z max P ]  }  0  0 (24) min{ ln EQ0 [e[ J k xk  Kk Tout  lk Tk  Kk T ]/ ]  }  0  0 [  J k xk  Kk Tout  lk Tk  Kk T ]/  min{ ln EQ0 [e  0 min{ ln EQ0 [e  0 where Z sum P   P Z sum,1 Z sum,2 P definition format for Z sum, H P  P , T , ,   1 1 e  N i 1 hN 2 2 hN2 (29) It was shown in [24] that the KDE function converges to the real distribution in a 1-norm sense,  | f N ( )  f ( ) | d  0 as N   (30) K Thus, we reach the following formulations for constraints (24)–(27) and show an explanation for (24) here. (1) Gaussian Assumption 2(GA)  N (  P ,t , P ,t ) Suppose P,t , and for t  1,2, , H , (24) equals [ min{ ln  e Z Z ,t  Pmax ]/   xk ,t PHP ,k  Psum kZ  P ,t /  e 1  P ,t 2  e ( P ,t  P ,t )2 2 P2 ,t d P ,t ]  t }  0 Z  , we Z have Determining the xk ,t PHP , k  Pof 2t  0  minimum sum , t  Pmax   P , t   P , t k Z (31), which is a tightened deterministic constraint of (1). The derivation procedure is listed in Appendix B1. (2) KDE Approximation (KDEA) Under KDEA, for t  1,2, , H , the constraint (24) is  N transformed into hN2 , P 1 Z Z xk ,t PHP , k  Psum   ln e  } 0   , t  Pmax  min{t   0 2 N P ,t i 1 k Z (32) P ,t i P ,t (25) ]  }  0 [ Z0 ( M w ,k xk  N w , k Tout  pw ,k  N w ,k T ) Tw ,k ,t 0, set ]/   H ( )d  1 , [15]. We choose H () as a f ( ) standard normal distribution, N (0,1) . Then, the N takes the sum of2 N normal distributions, which have the same h i : (   ) variance N but a different mean N   0  0 (28) i 2 (22) s.t.min{ ln EP0 [e H ( x , )/ ]  }  0    hN is a smooth function satisfying H ()  0 , f N ( )  B. Reformulation P The nominal distribution 0 of the ambiguity set contains all of the information driven from historical data. The historical data are the deviation records of predicted versus real values. Referring to [18], a DRO expectation constrained program min hambiguity ( x) under KL divergence such as x P i 1 Here, N is the amount of valid historical predicted-actual i h errors data  , N is a positive constant number, and H () Selection of the nominal distribution and the radius will be further discussed in subsections B and D. s.t.max EP [ H ( x,  )]  0 H  ]   }  0 N P ,t is the amount of power forecast errors for time t (26) where (27) (details are shown in Appendix B2). We show that with given h  specific t and N , P and historical power forecast error data, T and has the same . If the expectation  Pi ,t , the function g P ,t ( ) 5 g P ,t ( )  t  hN2 , P 2 i   ln 1 N P ,t  e ,  0 N i 1 (33) is a convex function (Appendix C). Then, we denote the g P ,t ,min ( ) g P ,t ( ) minimum value of as and take g P ,min ( )   g P ,1,min ( ) g P ,2,min ( ) g P , H ,min ( )  T . Thus, Z constraint (24) toZ  xkisPHPequivalent , k  Psum  Pmax  g P ,min ( )  0 k Z linked to the conservatism of the DRO program. In [18], it was shown that a EC-DRO is equivalent to a chance-constrained program, where radius  reflects a  decision maker’s risk level,  , with equation   e . For example, when risk level   0.1 , the radius,   2.3026 . This provides a reference for selecting a suitable radius of our DRO model. (34) which is also a deterministic constraint. Similarly, (25)–(27) also can be transformed deterministic forms: J k xk  K kTout  K k gT ,min ( )  lk  Tk  0  J k xk  KkTout  K k gT ,min ( )  lk  Tk  0 IV. to (35) (36) Z 0 (M w, k xk  N w, kTout  N w, k gT ,min ( )  pw, k )  Tw, k ,t  0, set  0 NUMERICAL TESTS In this section, we compared performance between the conventional RO, the KL-DRO with Gaussian assumption (GA-DRO), and the KL-DRO with KDEA assumption (KDEA-DRO) via Monte Carlo simulations. (38) A. Test settings The test system includes 10 heterogeneous houses with HPs and water tanks; their parameters are listed in Table 1. The COP of the HPs and the water-to-house efficiency are set as   1 3 constants: COP and w 2 h . The comfort range for The KL-DRO with KDEA methods can be reformulated as Model 3, shown below. indoor temperature is set to be [18, 24] C , and 0 .A finite difference model of the house [25] is used for the thermal simulations with 5 s for each step. The period number is 288 per day with 5 min for each time interval.  e  ,  0 i 1 , represents the temperature forecast error. Model 3: KL-DRO-KDEA min (6) s.t. (9), (11)(12)(14), (34)-(37) xk ,t {0,1} t  1, , H , k  1,2, , N , Z , C. Historical data utilization with information loss It is clear that the knowledge of uncertainties, concentrated from the available data, dominates the quality of the DRO program. Based on information theory, the uncertain variables and the historical data could be regarded as an information source and many independent observations. We apply the minimum information loss theorem 1 B asP(b ) min{I loss | f ( b )  P( )}  min  ln B b 1 f (b ) (39) P ( b ) S  60 kW Table 1. Parameters of 10 houses, tanks, and heat pumps House R (°C/kW) C (kJ/°C) T0 (°C) Rw (°C/kW) Cw (kJ/°C) Tw0 (°C) PHP (kW) which indicates that if we use the histogram method to estimate the real distribution of the uncertain vectors, we would, at the same time, show the least information loss using the KL divergence. The KDE function is an h approximation of the histogram with an appropriate N and converges to the histogram when N , B   [23], further demonstrating the superiority of this method. D. Risk meaning of the radius of an ambiguity set The radius  of the ambiguity set dominates the possible deviated degree of the nominal distribution and is obviously 2 2.9 5.2 20 2.4 4.9 45 4.7 3 3.0 4.6 21 2.5 4.8 47 4.3 4 2.9 4.1 20 2.6 5.0 45 4.7 5 3.1 5.9 19 2.4 5.0 42 4.8 6 3.1 4.7 19 2.8 5.4 42 5 6h -1 0 1 Prediction errors 18 h 9 2.6 5.1 20 2.6 4.9 45 4.7 10 3.2 4.5 19 2.5 5.3 42 4.8 1 0 -2 2 1.5 -1 0 1 Prediction errors 24 h 2 -1 0 1 Prediction errors 2 1 1 0.5 0 -2 8 3.0 5.3 21 2.6 5.2 47 4.3 2 2 0 -2 7 2.8 5.1 20 2.4 5.8 45 4.7 12 h 4 f ( b ) where and are the integral probability and the dropped-into frequency of bin b , respectively, which means using frequency to estimate probability by depicting a  histogram of all the b . The measured space is divided equally into 1 B B Pbars. (b ) When BP ( ) , we have: min  ln   P( )ln d  DKL ( P( ), f ( )) B  B f (b ) f ( ) b 1 (40), 1 2.8 5.4 19 2.2 4.9 42 5 Frequency gT , H ,min ( )  Ti ,t Frequency NT , t NT ,t Frequency where gT ,min ( )   gT ,1,min ( ) gT ,2,min ( ) h2 1 gT ,t ,min ( )  t  N ,T   ln 2 NT ,t Frequency where (37) T -1 0 1 Prediction errors 2 0.5 0 -2 Figure 2. Histogram of 92 days’ outdoor temperature prediction errors for four typical hours from day-ahead 23:30 to the coming day. As shown in Figure 2, the day-ahead predicted errors of outdoor temperature were recorded for 92 days from November 1, 2016, to January 31, 2017, in Beijing, based on data in [26]. It can be seen that the early time nodes show relatively less forecast deviation. The prediction errors of the zonal power, the summation of PV, and load are generated randomly with an asymmetric χ2 distribution,  P  0.15rand ( 52 )  0.75 for 5000 sample data for every h moment. We tested the performance of different N , P of the KDE function with power predicted errors as shown in 6 hN , P Figure 3. This shows that a larger may lead to a closer KDE function with more burr. We finally chose and hN ,T  0.1 hn = 0.01 hn = 0.1 Frequency Frequency 0.5 -2 0 2 Prediction errors hn = 1 Frequency 1 0.5 -2 0 2 Prediction errors 4 xk ,t 1  0, if xk ,t  1 & Tw, k ,t  T w, k    xk ,t , other conditions 1 0.5 0 -4 4 1.5 Frequency B. Comparison of KDEA-DRO with unscheduled conditions For unscheduled HP the ON/OFF 1, ifoperational xk ,t  0 & Tw,conditions, k , t  T w, k  state of the HP obeys a simple hysteresis rule:  1.5 1 0 -4 and the average solving time for a KDEA-DRO problem was about 10 s. for an appropriately smooth KDE function. 1.5 0 -4 hN , P  0.2 -2 0 2 Prediction errors hn = 10 (41) 4 The water temperature bounds [T w, k , T w, k ] were set 1.5 at [40,45] °C here. The results for KDEA-DRO and 1 unscheduled operation are shown in Figure 6 and Table 2. For the unscheduled scenario, Figure 6 shows that the transformer is overloaded from 17:30 to 19:30, when the electricity price is high. In contrast, the load profile of the transformer is flat and kept within its security limits with KDEA-DRO. Beyond that, HPs in the scheduled model turn off at high price moments to save money, and turn on at night for thermal energy storage, indicating good performance in load shifting. The large numerical differences of these models are shown in Table 3. The scheduled model cuts around 34% of the maximum daily transformer power and reduces the electricity cost for residents by about 18%. 0.5 0 -4 -2 0 2 Prediction errors 4 Figure 3. Histogram and KDE function of 5000 zonal power prediction errors The predictions of PV power and the outdoor temperature curve are from real measurements on February 1, 2017, Tsinghua University, Beijing (Fig. 4). The TOU electricity price  is shown in Figure 5; the mean value is 1 $ / kWh . The penalty weight for transformer capacity  is 10 $ / kW for the test cases. Unscheduled 80 Load Photovoltaic 30 Power (kW) Power forecast (kW) 40 20 60 40 20 10 0 0 0 4 8 12 Time (h) 16 20 0 4 8 24 12 16 KDEA-DRO 60 20 24 Transformer Heat pumps Power (kW) Time of use electricity price ($) Figure 4. Day-ahead PV and load prediction 2 40 20 0 -20 1.5 1 0 4 8 12 Time (h) 16 20 24 Figure 6. Operational power of transformer and heat pumps of the unscheduled model and KDEA-DRO model with y = 10 kW/$. 0.5 0 Table 2. Main results of unscheduled operational model and KDEA-DRO model 0 4 8 12 Time (h) 16 20 24 Figure 5. Curve of TOU electricity price For the radius distance of the ambiguity set, we let t  t  2.3026, t for a 0.9 confidence level. Numerical experiments were conducted in MATLAB 2014b with a core-i7 laptop. The minimization of g ( ) was calculated by an inner-point method and the run time increased slightly when the historical data set increased. The mixed integer program was solved using CPLEX 12.5 with a 1% tolerance, Peak cost ($) Elec. cost ($) Total ($) Unscheduled Pmax (kW) 73.204 732.0 962.7 1694.7 KDEA-DRO 48.612 486.1 787.6 1273.7 C. Comparison of deterministic, KDEA-DRO, GA-DRO, and RO models Operational strategies were generated using the deterministic, KDEA-DRO, GA-DRO, and RO models with the same setting and confirmed with 1000 Monte Carlo experiments. The intervals for RO were chosen with a 95% falling rate of 7    (42) Table 3. Results of Monte Carlo experiments for the operational strategies generated with different models Method Best day Worst day Mean Best day Worst day Mean Best day Worst day Mean Pmax /kW Elec cost /$ Comfo rt rate Determin istic 44.38 47.9 47.18 734.4 818.8 801.7 100.0% 18.10% 85.6% KDEA-D RO 45.82 49.34 48.62 702.8 787.2 770.1 100.0% 84.80% 93.7% GA-DRO RO 48.09 51.61 50.89 720.5 805 787.8 100.0% 86.90% 95.8% 48.76 51.27 50.56 725.7 810.1 793.0 100.0% 83.20% 94.1% , which represent a robust part in the KDEA-DRO model with different divergence settings. As shown in Figure 8, with the increase in divergence and the decrease in g g ( ) ( ) risk level, the P ,min and T ,t ,min increase with a gradually decreasing rate due to the robustness of the relative constraints. Due to the higher forecast accuracy, the gT ,6 h ,min ( ) is smaller than at the three other times (Fig. 8). gP,min(α) gT,6h,min(α) 1.8 gT,12h,min(α) 1.6 gT,18h,min(α) 1.4 gT,24h,min(α) 1.2 (α) Num(t ) gT ,t ,min ( ) 1 0.8 min CRday  min  k     divergences t and t . As discussed in Section III, for an ambiguity set, the risk level  and the set’s divergence  , it  holds that   e . When the risk level increases to one, the divergence decreases to zero, and the DRO problem reduces to a stochastic optimization problem. g ( ) We first analyze the P ,min and four typical hours’ g historical data and are symmetrical about zero (the concrete formulation of RO is shown in Appendix D). The forecast errors of outdoor temperature were generated by normally distributed random numbers, the means and variances of which were calculated from historical data, and the errors in power prediction were generated by the manipulated χ2 distribution mentioned above. The comfort rate (CR) is defined as the time between the comfort bounds divided by  Num(Tk  Tk ,t  Tk )  the total time. 0.6 Temperature (℃ ) Deterministic 40 0.2 0 20 indoor air 20 -0.2 Comfort bound 0 β=0.1 0 1 0 0 6 12 18 24 0 outdoor air 6 GA-DRO Temperature (℃ ) 0.4 KDEA-DRO water 40 40 40 20 20 0 0 0 6 12 Time (h) 12 18 24 RO 18 24 2 β=0.05 β=0.01 β=0.001 3 4 5 Divergence of the ambiguity set 6 7 8 Figure 8. gmin() of power and four typical hours prediction error data with different divergence η of the ambiguity set  0 6 12 Time (h) 18 24 Figure 7. Temperature simulations of deterministic, KDEA-DRO, GA-DRO, and RO model for 10 houses From Table 3, we can see that the DRO methods have relatively high comfort satisfaction with less energy cost than the RO method. Because the uncertainties are not considered, the deterministic method has a poorer comfort rate and a P higher cost. Among the two DRO methods, max and the energy cost with KDEA-DRO are less than with GA-DRO, because the KDE function is more accurate than the Gaussian function in representing historical information, while the comfort satisfaction of KDEA-DRO is acceptable. Regarding the indoor comfort aspect, outage of indoor temperature of one house can be observed in the deterministic curves in Figure 7, while the robustness is better in the three robust methods. D. Discussion: Influence of the divergences t and t The ambiguity sets of the probability distribution of the uncertainties in our KDEA-DRO model are controlled by the  Next, we discuss the influence of divergences t and t on the results of KDEA-DRO via 1000 time Monte Carlo simulations; the other parameters are the same as those in subsection C. We select four risk levels. β = 0.1, 0.05, 0.01, and 0.001, for the power and temperature ambiguity sets for comparison; the outcomes are shown in Table 4. With the  increase in power divergence, t , the power peak increases, the electricity cost decreases, and the comfort rate rises. Thus, a large power divergence could provide an advantage in reducing the electricity cost and improving the users’ thermal satisfaction. Moreover, with an increase in outdoor  temperature divergence, t , the power peak increases slightly, the electricity cost increases, and the comfort rate rises. Based on these results, we can control the robustness and conservatism of the KDEA-DRO by varying the divergence settings. Table 4. Results of the KDEA-DRO under different   divergences of t and t for different risk levels β (a) Pmax (kW) t t (risk level) (risk level) 2.3026 (β = 0.1) 2.9957 2.3026 (β = 0.1) 2.9957 (β = 0.05) 4.6052 (β = 0.01) 6.9078 (β = 0.001) 48.62 49.51 52.11 52.21 48.37 49.42 51.27 52.37  1    k    (β = 0.05) 4.6052 (β = 0.01) 6.9078 (β = 0.001) t t 2.3026 (β = 0.1) 2.9957 (β = 0.05) 4.6052 (β = 0.01) 6.9078 (β = 0.001) t 50.65 51.46 52.56 50.63 51.41 51.76 52.89  k   T   w, k   k    k    8  Tk ,t  0, set     T     out        .  k (b) Electricity cost ($) (risk level) (risk level) t 49.51 1      T  k  k    1  2.3026 (β = 0.1) 2.9957 (β = 0.05) 4.6052 (β = 0.01) 6.9078 (β = 0.001) 770.1 768.6 765.4 755.0 777.0 784.9 771.1 758.0 784.5 785.2 773.7 763.8 788.5 783.5 776.6 764.8 (45) This can be rewritten as AkTk  BkTw, k  CkTout  d k (46) In the same way, we can state that Ew, kTw, k  Fw, kTk  Gw, k xk  hw, k It is easy to show that (c) Comfort rate (risk level) (risk level) 2.3026 (β = 0.1) 2.9957 (β = 0.05) 4.6052 (β = 0.01) 6.9078 (β = 0.001) and Ew, k (47) are non-singular; thus, we have 2.3026 (β = 0.1) 2.9957 (β = 0.05) 4.6052 (β = 0.01) 6.9078 (β = 0.001) 93.70% 95.47% 95.78% 96.02% 94.90% 95.52% 96.28% 96.31% 95.13% 95.68% 96.12% 96.42% 95.71% 95.71% 96.18% 96.50% ( Ak  Bk Ew1, k Fw, k )Tk  Bk Ew1,k Gw,k xk  CkTout  Bk Ew1,k hw,k  dk ( Ew, k  Fw, k Ak1Bk )Tw, k  Fw, k Ak1CkTout  Gw, k xk  hw, k  Fw, k Ak1d k Due to the Schur complement, the matrices and ( Ew, k  Fw, k Ak1Bk ) Tk  J k xk  K kTout  lk where Tk and Tw, k (50) (51) (52) (53) Tw, k  M w, k xk  N w, kTout  pw, k In this paper, we developed a KL distance-based DRO model of HP-DOSM with residential temperature constraints , which can both decrease the peak-valley gap and the cost to residents under a TOU electricity price. This distance-based DRO model can well capture the uncertainties of weather prediction, photovoltaic prediction, and load prediction errors, while it is tractable. Numerical tests showed that our distance-based DRO was robust with less conservatism than the conventional RO model. Moreover, the robustness of this model can be adjusted by tuning the risk level, which has an explicit meaning in the optimization problem. In future work, a distributed algorithm is needed to solve HP-DOSM for large-scale distribution networks integrated with massive heat pumps. (49) are non-singular, so we have: Tw, k  ( Ew, k  Fw, k Ak1Bk )1 ( Fw, k Ak1CkTout  Gw, k xk  hw,k  Fw,k Ak1dk ) CONCLUSIONS AND FUTURE WORK (48) ( Ak  Bk Ew1,k Fw, k ) Tk  ( Ak  Bk Ew1, k Fw, k )1 ( Bk Ew1, k Gw, k xk  CkTout  Bk Ew1, k hw, k  dk ) represented by V. Ak are decoupled. B. Detailed reformulation of Gaussian Assumption and KDE Approximation in constraint (24) B.1 Gaussian Assumption (   ) The inner [formula  ]/  equals  x P  Pof  P(24) 1  / 2  ln  e e e d P ,t ]  t  P ,t 2 2 k ,t HP , k Z sum ,t P ,t Z max kZ P ,t Z Z   xk ,t PHP , k  Psum , t  Pmax   P , t  t  k Z P ,t 2 P ,t  P2 ,t 2 (54) 2 min{t  P ,t }   P ,t 2t 2 Due to   0 , we take (24) as Z x P   P ,t   P ,t 2t  0  k ,t HP,k  PsumZ ,t  Pmax k Z (55) APPENDIX A. Detailed structural transformation of the heat pump dayahead operational schedule model We first apply several simplifications. Transform the (3) and (4) equalities to a simplified form: Tk ,t 1   kTk ,t  kTw, k ,t   kTout ,t (43) Tw, k ,t 1   w, kTk ,t  w, kTw, k ,t  w, k xk ,t B.2 KDE Approximation N The[  inner of x P formula P  P ]/  (24) equals 1  / 1  ln  e e  k ,t HP , k kZ Z sum ,t Z max  P ,t N P ,t i 1 hN , P 2 Z Z   xk ,t PHP , k  Psum , t  Pmax  t  k Z hN2 , P 2   ln (44) With the definition of the vectors in the nomenclature, we have: ( P ,t  Pi ,t )2 e P ,t 2 hN2 , P 1 N P ,t d P ,t ]  t N P ,t  Pi ,t e  i 1 (56) C. Convexity proof of g ( ) The convexity of g ( ) can be calculated by a second order differential function: h2 1 N  i g ( )    N 2   ln N  e  ,  0 i 1 (57) i  9 N e   N     i 1e     i 1   2 hN2 g '( )    2  ln   i 2 N  N   e  2 i 1 i  i  N  i i 2 N e  ( )   i 1e      3 i  1 hN2     g ''( )  3  0 2 i i  N  N     e  i 1   i 1e      i i (58) (59) Thus, g ( ) is convex. D. Robust optimization model Z min (6) max  P  0  xk PHP , k  PsumZ  Pmax s.t.  [ , ] k Z P P P max J k xk  K kTout  lk  Tk  K kT  0 T [T ,T ] max  J k xk  KkTout  lk  Tk  KkT  0 T [T ,T ] max Z0 (M w, k xk  N w, kTout  pw, k  N w, kT )  Tw, k ,t  0, set  0 T [T ,T ] (60) (61) (62) (63) (9), (11)(12)(14) xk ,t {0,1} t  1, , H , k  1,2, , N , Z , REFERENCES [1] C. R. Inc, "Heat pump characterization study," 2010. [2] EHPA, "European Heat Pump Association," Outlook European Heat Pump Statistics, 2011. [3] A. Arteconi, N. J. Hewitt, and F. Polonara, "Domestic demand-side management (DSM): Role of heat pumps and thermal energy storage (TES) systems," Applied Thermal Engineering, vol. 51, no. 1-2, pp. 155-165, 2013. [4] G. Z. C. D.-m. Y. J.-h. J. B. F. X.-m. Z. Liang, "Study on Rural Low-Voltage Distribution Network Planning with Coal-to-Electricity Project," Electrical & Electronics, 2015. [5] Xinhua. http://news.xinhuanet.com/local/2017-01/25/c_11203819 59.htm. [6] H. O. R. Howlader, H. Matayoshi, and T. Senjyu, "Distributed generation incorporated with the thermal generation for optimum operation of a smart grid considering forecast error," Energy Conversion and Management, vol. 96, pp. 303-314, 2015. [7] D. Vanhoudt, D. Geysen, B. Claessens, F. Leemans, L. Jespers, and J. Van Bael, "An actively controlled residential heat pump: Potential on peak shaving and maximization of self-consumption of renewable energy," Renewable Energy, vol. 63, pp. 531-543, 2014. [8] D. K. Wolfram Wiesemann, and Melvyn Sim, "Distributionally Robust Convex Optimization," 2013. [9] Y. Zhang, S. Shen, and J. Mathieu, "Distributionally Robust Chance-Constrained Optimal Power Flow with Uncertain Renewables and Uncertain Reserves Provided by Loads," IEEE Transactions on Power Systems, pp. 1-1, 2016. [10] S. Zymler, D. Kuhn, and B. Rustem, "Distributionally robust joint chance constraints with second-order moment information," Mathematical Programming, vol. 137, no. 1-2, pp. 167-198, 2011. [11] P. Xiong, P. Jirutitijaroen, and C. Singh, "A Distributionally Robust Optimization Model for Unit Commitment Considering Uncertain Wind Power Generation," IEEE Transactions on Power Systems, vol. 32, no. 1, pp. 39-49, 2017. [12] E. D. a. Y. Ye, "Distributionally Robust Optimization under Moment Uncertainty with Application to Data-Driven Problems," Operation Research, 2008. [13] N. Loizou, "Distributionally Robust Game Theory," 2015. [14] D. K. Peyman Mohajerin Esfahani, "Data-driven distributionally robust optimization using the Wasserstein metric Performance guarantees and tractable reformulations," Optimization and Control, 2016. [15] R. Jiang and Y. Guan, "Data-driven chance constrained stochastic program," Mathematical Programming, journal article vol. 158, no. 1, pp. 291-327, 2016. [16] X. Chen and Y. Zhang, "Uncertain Linear Programs: Extended Affinely Adjustable Robust Counterparts," Operations Research, vol. 57, no. 6, pp. 1469-1482, 2009. [17] D. d. H. By Aharon Ben-Tal, Anja De Waegenaere, Bertrand Melenberg, Gijs Rennen, "Robust solutions of optimization problems affected by uncertain probabilities," 2011. [18] Z. Hu, Hong, L. Jeff, "Kullback-Leibler Divergence Constrained Distributionally Robust Optimization," Conference Proceedings, 2012. [19] K.-L. H. S. M. Manish Bansal, "Decomposition Algorithms for Two-Stage Distributionally Robust Mixed Binary Programs," 2017. [20] X. Li, K. Natarajan, C.-P. Teo, and Z. Zheng, "Distributionally robust mixed integer linear programs: Persistency models with applications," European Journal of Operational Research, vol. 233, no. 3, pp. 459-473, 2014. [21] W. Wu, Xin Chen, B. Zhang, C. Lin, "Data-driven DG Capacity Assessment Method for Active Distribution Networks," IEEE Transactions on Power Systems, 2016. to be published. [22] J. Tant, F. Geth, D. Six, P. Tant, and J. Driesen, "Multiobjective Battery Storage to Improve PV Integration in Residential Distribution Grids," IEEE Transactions on Sustainable Energy, vol. 4, no. 1, pp. 182-191, 2013. [23] J. Pintér, "Deterministic approximations of probability inequalities," 1989. [24] L. G. L. Devroye, "Nonparametric Density Estimation: The ℓ1 View," 1985. [25] Q. Z. Qisen Yan, Building thermal process. 1986. [26] http://data.cma.cn/site/index.html. China Meteorological Administration.
3cs.SY
arXiv:1511.09360v1 [cs.DS] 30 Nov 2015 On the Complexity of Multi-Parameterized Cluster Editing✩ Faisal N. Abu-Khzam Department of Computer Science and Mathematics Lebanese American University Beirut, Lebanon Abstract The Cluster Editing problem seeks a transformation of a given undirected graph into a disjoint union of cliques via a minimum number of edge additions or deletions. A multi-parameterized version of the problem is studied, featuring a number of input parameters that bound the amount of both edge-additions and deletions per single vertex, as well as the size of a clique-cluster. We show that the problem remains N P-hard even when only one edge can be deleted and at most two edges can be added per vertex. However, the new formulation allows us to solve Cluster Editing (exactly) in polynomial time when the number of edge-edit operations per vertex is smaller than half the minimum cluster size. In other words, Correlation Clustering can be solved efficiently when the number of false positives/negatives per single data element is expected to be small compared to the minimum cluster size. As a byproduct, we obtain a kernelization algorithm that delivers linear-size kernels when the two edge-edit bounds are small constants. Keywords: Cluster Editing, Correlation Clustering, Multi-parameterization, Kernelization ✩ A preliminary version of a portion of this paper appeared in the 7th Annual International Conference on Combinatorial Optimization and Applications (COCOA 2013) [2] Email address: [email protected] (Faisal N. Abu-Khzam) Preprint submitted to Elsevier January 9, 2018 1. Introduction Given a simple undirected graph G = (V, E) and an integer k > 0, the Cluster Editing Problem asks whether k or less edge additions or deletions can transform G into a graph whose connected components are cliques. Cluster Editing is N P-Complete [20, 23], but it is fixed-parameter tractable with respect to the parameter k [8, 16] 1 . The problem received considerable attention recently as can be seen from a long sequence of continuous algorithmic improvements (see [5, 6, 7, 9, 10, 16, 17]). The current asymptotically fastest fixed-parameter algorithm runs in O∗ (1.618k ) time [5]. Moreover, a kernel of order 2k was obtained recently in [10]. This means that an arbitrary Cluster Editing instance can be reduced in polynomial-time into an equivalent instance where the number of vertices is at most 2k. The number of edges in the reduced instance can be quadratic in k. Cluster Editing can be viewed as a model for accurate unsupervised “correlation clustering.” In such context, edges to be deleted or added from a given instance are considered false positives or false negatives, respectively. Such errors could be small in some practical applications, and they tend to be even smaller per input object, or vertex. In fact, a single data element that is causing too many false positive/negatives might be considered as outlier. We consider a parameterized version of Cluster Editing where both the number of edges that can be deleted and the number of edges that can be added, per vertex, are bounded by input parameters. We refer to these two bounds by error parameters. Similar parameterizations appeared in [18] and [19]. In [18], two parameters p and q were used to bound (respectively) (i) the number of edges that can be added between elements of the same cluster and (ii) the number of edges that can be deleted between a cluster and the rest of the graph. In [19], the total number of edge-edit operations, per vertex, and the number of clusters in the target solution are used as additional parameters. We shall see that setting separate bounds on the two parameters could affect the complexity as well as algorithmic solutions of the problem. We introduce another parameter that bounds, from below, the minimum acceptable cluster size and present a polynomial time algorithm that solves Cluster Editing, exactly, whenever the sum of error parameters is small compared to the minimum cluster size (in the target solution). This condi1 We assume familiarity with the notions of fixed-parameter tractability and kernelization algorithms [11, 14, 15, 22]. 2 tion could be of particular interest in applications where the cluster size is expected to be large or when error parameters per data element are not expected to be high. In this respect, the message conveyed by our work bears the same theme as another, rather experimental, study of various clustering methods conducted in [12] where it was suggested that Clustering is not as hard as claimed by corresponding N P-hardness proofs. We shall also study the complexity of the multi-parameterized version of Cluster Editing when the error-parameters are small constants. In particular, we show that Cluster Editing remains N P-hard even when at most one edge can be deleted and at most two edges can be added per vertex. Moreover, we show in this case that a simple reduction procedure yields a problem kernel whose total size is linear in the parameter k. Previously known kernelization algorithms cannot be applied to the considered multi-parameterized version and they deliver kernels whose order (number of vertices only) is linear in k. The paper is organized as follows: section 2 presents some preliminaries; in section 3 we study the complexity of Cluster Editing when parameterized by the error-parameters; section 4 is devoted to a general reduction procedure; the consequent complexity results are presented in sections 5, and section 6 concludes with a summary. 2. Preliminaries We adopt common graph theoretic terminologies, such as neighborhood, vertex degree, adjacency, etc. The term non-edge is used to designate a pair of non-adjacent vertices. Given a graph G = (V, E), and a set S ⊂ V , the subgraph induced by S is denoted by G[S]. A clique in a graph is a subgraph induced by a set of pair-wise adjacent vertices. An edge-editing operation is either a deletion or an addition of an edge. We shall use the term cluster graph to denote a transitive undirected graph, which consists of a disjoint union of cliques, as connected components. For a given graph G and parameter k, the Parameterized Cluster Editing problem asks whether G can be transformed into a cluster graph via k or less edge-editing operations. In this paper, we consider a multi-parameterized version of this problem that assumes a set of parameters (independent of the input). We shall use the list of parameters in the name of the problem. For example (a, d, k)-Cluster Editing is formally defined as follows. 3 (a, d, k)-Cluster Editing: Input: A graph G, parameters k, a, d, and two functions α : V (G) → {0, 1, · · · , a}, δ : V (G) → {0, 1, · · · , d}. Question: Can G be transformed into a disjoint union of cliques by at most k edge-edit operations such that: for each vertex v ∈ V (G), the number of added (deleted) edges incident on v is at most α(v) (δ(v) respectively)? We shall further use some special terminology to better-present our results. The expression solution graph may be used instead of cluster graph, when dealing with a specific input instance. Edges that are not allowed to be in the cluster graph are called forbidden edges, while edges that are (decided to be) in the solution graph are permanent. An induced path of length two is called a conflict triple, which is so named because it can never be part of a solution graph. To cliquify a set S of vertices is to transform G[S] into a clique by adding edges. A clique is permanent if each of its edges is permanent. To join a vertex v to a clique C is to add all edges between v and vertices of C that are not in N (v). This operation makes sense only when C is permanent or when turning C to a permanent clique. If v already contains C in its neighborhood, then joining v to C is equivalent to making C ∪ {v} a permanent clique. To detach v from C is the opposite operation (of deleting all edges between v and the vertices of C). The first, and simplest, algorithm for Cluster Editing finds a conflict triple in the input graph and “resolves” it by exploring the three cases corresponding to deleting one of the two edges in the path or inserting the missing edge. In each of the three cases, the algorithm proceeds recursively. As such, the said algorithm runs in O(3k ) time (3 cases per conflict triple). The same idea has been used in almost all subsequent algorithms, which added more sophisticated branching rules. We first study the (a, d)-Cluster Editing problem, which corresponds to the case where k is not a parameter. This version is similar to the one introduced in [19] where a bound c is placed on the total number of edgeedit operations per single vertex. The corresponding problem is called cCluster Editing. When c ≥ 4, c-Cluster Editing is N P-hard (shown also in [19]). This does not imply, however, that (a, d)-Cluster Editing is N P-hard when a + d = 4. To see this, note that (a, 0)-Cluster Editing is solvable in polynomial time for any a ≥ 0: any solution must add all the needed edges to get rid of all conflict-triples, if this is possible with at most a edge additions per vertex. 4 Observe that if (a, d)-Cluster Editing is N P-hard then so is (a′ , d′ )Cluster Editing for all a′ ≥ a and d′ ≥ d. This follows immediately from the definition since every instance of the first is an instance of the second. We shall prove that (2, 1)-Cluster Editing is N P-hard, which yields the N P-hardness of (a, 1)-Cluster Editing for all a > 1. It was shown in [19] that (0, 2)-Cluster Editing is N P-hard. We observe in Section 5 that (0, 1)Cluster Editing is solvable in polynomial time, and we conjecture that (1, 1)Cluster Editing is solvable in polynomial-time. A kernelization algorithm with respect to an input parameter k is a polynomial-time reduction procedure that yields an equivalent problem instance whose size is bounded by a function of k. Known kernelization algorithms for Cluster Editing have so far obtained kernels whose order (i.e., number of vertices) is bounded by a linear function of k [9, 10, 17]. The most recent order-bound is 2k [10]. We introduce the minimum acceptable cluster size, s, as another parameter. This is especially useful when the input graph is preprocessed so it is not expected to contain outlier vertices. Observe that the size of a cluster is expected to be relatively large in some correlation clustering applications, such as social networks [21]. We shall present (in Section 4) a simple reduction procedure that leads to solving Cluster Editing in polynomial time when s > 2(a + d). When s ≤ 2(a + d), the same reduction procedure delivers kernels whose number of edges is bounded by 5k 4 max(a, 2d)(a + 3d). In other words, when the constraints a and d are small constants, the kernel size is linear in k. 3. The (a, d)-Cluster Editing Problem We consider the case where the Cluster Editing problem is parameterized by the add and delete capacities a and d, only. In other words, the main objective is to check whether it is possible to obtain a cluster graph by performing at most a additions and d deletions per vertex. We denote the corresponding problem by (a, d)-Cluster Editing. It was shown in [19] that Cluster Editing is N P-hard when the total number of edge-edit operations per vertex is four or more. However, as observed earlier, the result (and proof) of [19] cannot be used in studying the complexity of each of the separate cases (for a and d) when a + d = 4. We prove in this section that (2, 1)-Cluster Editing is N P-hard by reduction from the 4-Bounded-Positive-One-in-Three-SAT problem, which is formally defined as follows: 5 4-Bounded-positive-1-in-3-SAT Given: A 3-CNF formula φ in which each variable appears only positively in at most four clauses. Question: Is there a truth assignment that satisfies φ so that only one variable per clause is set to true? 4-Bounded-positive-1-in-3-SAT was shown to be N P-hard in [13]. The reduction to (2, 1)-Cluster Editing proceeds by constructing a graph with three types of vertices: variable, clause and auxiliary. Each clause c = (x ∨ y ∨ z) is represented by a clause gadget as shown in Figure 1. x 1 0 3 y c 4 z 2 Figure 1: Clause gadget. The node corresponding to clause c = (x ∨ y ∨ z) is forced to lose one of the edges connecting it to a variable gadget. Observe that edge {3, 4} must be deleted since the K4 formed by {0, 1, 2, 3} is permanent. It follows that edge {c, 4} cannot be deleted, so exactly one of the three edges cx, cy and cz must be deleted by any feasible solution. The deletion of the edge cx means that the variable x is set to true, otherwise it is false. x 1 0 3 4 c y 2 Figure 2: Clause gadget resolved after setting z to true while x and y are set to false. 6 In the variable gadget, shown in Figure 3 below, the four edges connecting the vertices labeled x to the cycle are subject to the same edit operation: either all four are deleted or all four are kept as permanent. To see this, note that it is not possible to delete exactly one edge of the cycle {1, 2, 3, 4}. We either have to turn this cycle to a K4 by two edge additions and by removing each of the edges incident on vertices labeled x, or two opposite edges are deleted as shown in Figure 4. x x 1 2 4 3 x x Figure 3: Variable gadget. Variable x may belong to up to four clauses. Each node labeled x is connected to its corresponding clause gadget. If a variable x belongs to i different clause(s) where i < 4, then 4 − i vertice(s) labeled x in the corresponding gadget will be pendant (not connected to a clause gadget). If there is a satisfying truth assignment of a given formula of 4BP -one-in-three-3SAT, then every variable that is set to true will have its variable gadget turned into two clusters as shown in Figure 4, and every variable x that is set to false will have its corresponding four vertices disconnected from the C4 , which is turned into a K4 in its gadget. In the latter case, each of the vertices labeled x will join a (corresponding) clause cluster as shown in Figure 2. Conversely, if there is a solution of the (2, 1)-Cluster Editing instance, then exactly one variable-vertex neighbor of a clause-vertex is deleted. Due to above construction, the corresponding variable can be set to true and a satisfying assignment is obtained for the 4BP -one-in-three-3SAT instance. We have thus proved the following. Lemma 1. The (2, 1)-Cluster Editing problem is N P-Hard. 7 x x x x x 1 2 1 2 4 3 4 3 x x x Figure 4: Variable gadget: the two cases where exactly two edges of C4 are deleted. The membership of (a, 1)-Cluster Editing in N P is obvious. With the above Lemma, and our definition of (a, d)-Cluster Editing, we obtain the following theorem. Theorem 1. For a > 1, the (a, 1)-Cluster Editing problem is N P-Complete. 4. A Reduction Procedure In general, a problem-reduction procedure is based on reduction rules, each of the form hcondition, actioni, where action is an operation that can be performed to obtain an equivalent instance of the problem whenever condition holds. If a reduction is not possible, or the action violates a problem-specific constraint, then we have a no instance. Moreover, a reduction rule is sound if its action results in an equivalent instance. In what follows, we assume an instance (G, k) of (a, d, s, k)-Cluster Editing is given. In other words, the problem is parameterized by the add and delete capacities, as in the previous section, along with the lower-bound on cluster size s and the total number of edge-edit operations k. Any added edge, in what follows, is automatically set to permanent. The main reduction rules are given below. They are assumed to be applied successively in such a way that a rule is not applied, or re-applied, until all the previous rules have been applied exhaustively. Some of the rules are folklore. We shall prove the soundness of new, non-obvious, reduction rules only. 4.1. Base-case Reductions Reduction Rule 1. The reduction algorithm terminates and reports a no instance, whenever any of k, α(v), or δ(v) is negative for some vertex v ∈ V (G). 8 Reduction Rule 2. For any vertex v, if δ(v) = 0 (or becomes zero), then N (v) is cliquified. Note that applying Rule 2 may yield negative parameters, which triggers Rule 1 and causes the algorithm to terminate with a negative answer. Reduction Rule 3. If α(u) = 0, then set every non-edge of u to forbidden. 4.2. Reductions Based on Conflict-Triples Reduction Rule 4. If uv and uw are permanent edges and vw is a nonedge, then add vw and decrement each of k, α(v) and α(w) by one. If vw is a non-permanent edge, then set vw as permanent. Reduction Rule 5. If uv is a permanent edge and uw is a forbidden edge, then set vw as forbidden. If vw exists, delete it and decrement k, δ(v) and δ(w) by one. 4.3. Reductions Based on Common Neighbors Reduction Rule 6. If two non-adjacent vertices u and v have more than 2d common neighbors (or more than δ(u) + δ(v) common neighbors), then add edge uv and decrement each of k, α(u) and α(v) by one. Soundness: If u and v are not in the same clique in the solution graph, then at least one of them has to lose more than d edges, which is not possible. Reduction Rule 7. If two adjacent vertices, u and v, have at least 2d − 1 common neighbors then set uv as permanent edge. Soundness: If the two vertices are in different clusters of a solution graph, then deleting edge uv reduces both δ(u) and δ(v) to at most d − 1 each. Since they have to lose their common neighbors, at least one of them has to lose d edges, which is not possible. Reduction Rule 8. If two vertices u and v are such that |N (u) \ N (v)| > a + d then set edge uv as forbidden. If u and v are adjacent, then delete uv and decrement each of k, δ(u) and δ(v) by one. Soundness: For u and v to be in the same cluster, at most d neighbors may be deleted from N (u) and at most a neighbors can be added to N (v). 9 4.4. Reductions Based on Cluster-Size Reduction Rule 9. If there is a vertex v satisfying: s − 1 > degree(v) + α(v), then return No. Soundness: Obviously, v needs more than α(v) edges to be a member of a cluster in a solution graph. Reduction Rule 10. If there is a vertex v satisfying: δ(v) > degree(v) + α(v) − (s − 1) set δ(v) = degree(v) + α(v) − (s − 1). Soundness: If δ(v) edges incident on v are deleted (so degree(v) is decremented by δ(v)), we get a no-instance by Rule 9. Reduction Rule 11. If s > 2 and two non-adjacent vertices u and v have less than s − 2a common neighbors (or s − α(u) − α(v) such neighbors) then set edge uv as forbidden. Soundness: If α(u)α(v) = 0, then uv is already forbidden by Rule 3. For u and v to belong to the same cluster, they must have at least s − 2 common neighbors. After adding uv, the maximum number of common neighbors we can add is 2a − 2 (a − 1 edges between u and N (v) and vice versa). The total number of common neighbors after adding all possible edges remains less than s − 2(= s − 2a + 2a − 2). Reduction Rule 12. If s > 2 and two adjacent vertices u and v have < s − 2a − 2 common neighbors, then delete edge uv and decrement each of k, δ(u) and δ(v) by one. Soundness: The argument is similar to the previous case, except that each vertex must add at least a neighbors of the other to obtain s − 2 common neighbors. 4.5. Permanent and Isolated Cliques If a clique contains more than 2d vertices, then it is permanent due to Rule 7. Moreover, no vertex can be joined to an isolated permanent clique with more than a vertices. As a consequence, we obtain the following reduction rule. Reduction Rule 13. If a clique C is such that N (C) \ C = ∅ and |C| > max(a, 2d) then delete C. 10 The presence of permanent cliques can yield problem reductions that are not obtained by exhaustive applications of the above reduction rules. Note that a permanent edge is a special case of a permanent clique. The soundness of the following rules is obvious. Reduction Rule 14. If a vertex v has more than d neighbors in a permanent clique C, then v is joined to C. Reduction Rule 15. Let C be a permanent clique of size > a. If a vertex v has less than |C| − a neighbors in C, then v is detached from C. An isolated clique is said to be small if its size is less than s. In general, deleting isolated cliques is a sound reduction rule for the single-parameter Cluster Editing problem. In multi-parameterized versions, we either add a parameter that bounds the number of small isolated cliques, including outliers, or (to adhere to our problem formulation) we must keep a number of such cliques. To see this, note the example of a single isolated vertex v and an isolated clique C with less than α(v) vertices. In this case, v can be joined to C to avoid having a small cluster that can potentially yield a no answer. At this stage, if there is an isolated clique C in the so-far reduced instance, then |C| ≤ max(a, 2d). If C is small (i.e., 1 ≤ |C| < s) then each vertex of C must be affected by at least one edge-editing operation. Consequently: Reduction Rule 16. If the total number of vertices in small isolated cliques is > 2k then (halt and) report a no instance. On the other hand, if an isolated clique C is not small then it must satisfy s ≤ |C| ≤ max(a, 2d). As observed above, we need to keep a few of these cliques. Since this is needed only when s ≥ 2, we can safely keep at most k/2 such cliques. Reduction Rule 17. If s > 1 and there are more than k non-small isolated cliques then delete all but at most k/2 of them. 5. The Complexity of Multi-parameterized Cluster Editing An instance (G, a, d, s, k) of Cluster Editing is said to be reduced if the above reduction rules have been exhaustively applied to the input graph G. Our second main theorem, proved below, addresses the optimization version of Cluster Editing, which seeks a minimum number of edge-edit operations. So k is not a parameter in this case, but we keep the other constraints. 11 Theorem 2. When s > 2(a + d), and ad > 0, the Minimum Cluster Editing problem is solvable in polynomial time. Proof. Let u and v be non-adjacent vertices such that uv is not forbidden. By Rules 6 and 11: s − 2a ≤ |N (u) ∩ N (v)| ≤ 2d. This is impossible since s−2a > 2d, so uv must be forbidden and any two non-adjacent vertices must belong to different clusters. If u and v are adjacent vertices such that uv is not permanent, then by Rules 7 and 12: s − 2a − 2 ≤ |N (u) ∩ N (v)| < 2d − 1. Again, this is impossible (it implies s < 2(a + d) + 1), so edges between adjacent vertices must be permanent. It follows that in a reduced instance any edge is either permanent or deleted. In a typical clustering application, the total number of errors per data element is expected to be small and should be much smaller than a cluster size. In the seemingly common case where the cluster size is large compared to such error, Theorem 2 asserts that Cluster Editing is solvable (exactly) in polynomial time. When s ≤ 2(a + d), the Minimum Cluster Editing problem remains N P-hard even if a and d are small constants and the size of a cluster is not important (i.e., s = 1). In this case, the reduction procedure may still help to obtain faster parameterized algorithms. In fact, we shall prove that applying the above reduction rules yields equivalent instances whose (total) size is bounded by a linear function of the main parameter k. The following key lemma follows from the reduction procedure. Lemma 2. Let (G, a, d, s, k) be a reduced yes-instance of Cluster Editing. Then every vertex of G has at most a + 3d neighbors. Proof. Assume there is a vertex v such that |N (v)| > a + 3d. By Rule 6, any vertex u is either a neighbor of v or has at most 2d common neighbors with v. In the latter case, v has more than a + d vertices that are not common with u. Edge uv would then be forbidden by Rule 8. By Rules 7 and 8, every edge incident on v is either deleted or becomes permanent. Applying Rules 4 and 5 exhaustively leads to cliquifying and isolating N [v], which then results in deleting N [v] due to Rule 13. 5.1. The case where a and d are small fixed constants It was shown in [19] that Cluster Editing is N P-hard when a = 0 and d = 2. This implies the N P-hardness of (a, 2)-Cluster Editing for a ≥ 0. When d = 1, our reduction procedure results in a triangle-free instance or a no answer. To see this observe that every clique of size three or more 12 becomes permanent (2d + 1 = 3). Moreover, a vertex with more than one neighbor in a clique of size three must be in the clique (otherwise we have a no instance) while an edge joining a vertex to only one member of a triangle must be deleted. It follows that cliques of size three or more become isolated and deleted. We also observe that (0, 1)-Cluster Editing is solvable in polynomial time. To see this, note that a vertex of degree three must be part of a clique of size at least three, since at most one of its incident edges can be deleted. Unless we have a no instance, such vertex cannot exist in a reduced instance, being triangle-free. It follows that a reduced yes instance must have a maximum degree of two. In this case, the problem is equivalent to the Maximum Matching problem. At this stage, the only remaining open problem is whether (1, 1)-Cluster Editing is solvable in polynomial time. We believe it is the case, especially since every instance is triangle-free, as observed above. Moreover, the reader would easily observe that every such instance is of maximum degree three. 5.2. Kernelization We now give a bound on the number of vertices in a reduced instance. Theorem 3. There is a polynomial-time reduction algorithm that takes an arbitrary instance of (multi-parameterized) Cluster Editing and either determines that no solution exists or produces an equivalent instance whose order is bounded by 5k 2 max(a, 2d). Proof. Let (G, a, d, k) be a reduced instance of Cluster Editing. Let A be the set of vertices of G that are incident to edges that must be deleted or to non-edges that must be added to obtain some minimum solution, if any. In other words, A is the set of vertices affected by edge-editing operations. If (G, a, d, k) is a yes instance, then |A| ≤ 2k. Let B = N (A) and C = V (G) \ (A ∪ B). The connected components of B are cliques, being non-affected by edgeediting. For the same reason, every vertex x ∈ A satisfies: G[B ∩ N (x)] is a clique. Let Bx = N (x) ∩ B for some x ∈ A and let N (Bx ) = {a ∈ A : Bx ⊂ N (a)}. If |Bx ∪ {x}| > max(a, 2d) then our reduction procedure sets Bx ∪ {x} to permanent and automatically joins every element of N (Bx ) to a larger isolated clique containing Bx , which is then deleted by Rule 13. Therefore |A ∪ B| ≤ 2kmax(a, 2d). Observe that isolated cliques of size < s must be totally contained in A, so their elements are part of the 2kmax(a, 2d) vertices of A ∪ B. It follows 13 by Rule 17 that C consists of at most k/2 (non-small) isolated cliques, each of size max(a, 2d). The proof is now complete. The following corollary follows easily from Theorem 3 and Lemma 2. Corollary 1. There is a polynomial-time reduction algorithm that takes an arbitrary instance of Multi-parameterized Cluster Editing and either determines that no solution exists or produces an equivalent instance whose size is bounded by 5k 4 max(a, 2d)(a + 3d). The above kernel bound is of interest when a and d are fixed small constants. It could be particularly useful since previously known kernelization algorithms for single-parameter Cluster Editing are not applicable to the multi-parameterized version especially due to their use of edge contraction, which also results in assigning weights to vertices. The difficulty of applying edge contraction stems from the fact that merging two adjacent vertices does not yield valid edge editing bounds on the resulting vertex. To explicate, assume we contract edge uv and assign δ(u) + δ(v) as edge-deletion bound to the resulting vertex. Then we might either exceed the d-bound or allow the deletion of more than δ(u) neighbors of u (from the new combined neighborhood), thereby obtaining a wrong solution. 6. Acknowledgement The work on this project has been partially supported by the Lebanese American University under grant SRDC-t2013-45. 7. Concluding Remarks We considered the (a, d)-Cluster Editing problem, a constrained version of Cluster Editing where at most a edges can be added and at most d edges can be deleted per single vertex. We proved that (a, d)-Cluster Editing is N P-hard, in general, for any a ≥ 2 and d ≥ 1. We also observed that (0, 1)-Cluster Editing is solvable in polynomial time while the (0, 2) case is N P-hard [19]. It remains open whether (1, 1)-Cluster Editing can be solved in polynomial time. We presented a reduction procedure that solves the Cluster Editing problem in polynomial-time when the smallest acceptable cluster size exceeds twice the total allowable edge operations per vertex. It is worth noting that edge-editing operations per single data element are expected to be small 14 compared to the cluster size, especially if the input is free of outliers. When the bounds on the two edge-edit operations per vertex are small constants, and the cluster size is unconstrained, our reduction algorithm gives a kernel whose size is linear in the main parameter k. Previously known kernelization algorithms are not applicable to the multi-parameterized version and achieve a linear bound on the number of vertices only. The reduction algorithm presented in this paper has been implemented along with the simple branching on conflict triples described in Section 2. Experiments show a promising performance especially on graphs obtained from clinical research data [3, 4]. The multi-parameterized algorithm finished consistently in seconds, reporting significant clusters. Finally we note that different Cluster Editing solutions to the same problem instance may differ in terms of the practical significance of obtained clusters. A possible approach would be to combine enumeration and editing, by enumerating all possible Cluster Editing solutions. Moreover, in some biology applications, a data element may be an active member of different clusters. In such cases, the enumeration of all maximal cliques was used as a possible alternative [1]. To permit a data element to belong to more than one cluster, we suggest allowing vertex-division (AKA. vertex cleaving) as another edit operation whereby a vertex is replaced by two different vertices. The number of allowed divisions per vertex can be added as (yet) another parameter. This latter formulation is under consideration for future work. References [1] F. N. Abu-Khzam, N. E. Baldwin, M. A. Langston, and N. F. Samatova. On the relative efficiency of maximal clique enumeration algorithms, with applications to high-throughput computational biology. In International Conference on Research Trends in Science and Technology, 2005. [2] Faisal N. Abu-Khzam. The multi-parameterized cluster editing problem. In Peter Widmayer, Yinfeng Xu, and Binhai Zhu, editors, Combinatorial Optimization and Applications - 7th International Conference, COCOA 2013, Chengdu, China, December 12-14, 2013, Proceedings, volume 8287 of Lecture Notes in Computer Science, pages 284–294. Springer, 2013. [3] Faisal N. Abu-Khzam, Judith Egan, Ling-An Lin, Peter Shaw, and Timothy Skinner. Understanding complex interactions of symptoms in pediatric diabetes care: the effect of multi-parameterized correlation 15 clustering on the hvidoere study group on childhood diabetes. 2016. Manuscript. [4] Faisal N. Abu-Khzam, Ling-An Lin, Peter Shaw, Heidi Smith-Vaughan, and Robyn Marsh. Effective use of multi-parameterized correlation clustering in mining nasopharyngeal carriage and disease data from young children. 2016. Manuscript. [5] S. Böcker. A golden ratio parameterized algorithm for cluster editing. J. Discrete Algorithms, 16:79–89, 2012. [6] S. Böcker, S. Briesemeister, Q. B. A. Bui, and A. Truss. Going weighted: Parameterized algorithms for cluster editing. Theoretical Computer Science, 410(52):5467–5480, 2009. [7] S. Böcker, S. Briesemeister, and G. W. Klau. Exact algorithms for cluster editing: Evaluation and experiments. Algorithmica, 60(2):316– 334, 2011. [8] L. Cai. Fixed-parameter tractability of graph modification problems for hereditary properties. Information Processing Letters, 58(4):171–176, May 1996. [9] Y. Cao and J. Chen. Cluster editing: Kernelization based on edge cuts. Algorithmica, 64(1):152–169, 2012. [10] J. Chen and J. Meng. A 2k kernel for the cluster editing problem. J. Comput. Syst. Sci., 78(1):211–220, 2012. [11] Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michal Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer, 2015. [12] A. Daniely, N. Linial, and M. Saks. Clustering is difficult only when it does not matter. CoRR, abs/1205.4891, 2012. [13] R. Denman and S. Foster. Using clausal graphs to determine the computational complexity of k-bounded positive one-in-three {SAT}. Discrete Applied Mathematics, 157(7):1655 – 1659, 2009. [14] Rodney G. Downey and Michael R. Fellows. Fundamentals of Parameterized Complexity. Texts in Computer Science. Springer, 2013. [15] J. Flum and M. Grohe. Parameterized Complexity Theory. Springer, 2006. 16 [16] J. Gramm, J. Guo, F. Hüffner, and R. Niedermeier. Graph-modeled data clustering: Exact algorithms for clique generation. Theory Comput. Syst., 38(4):373–392, 2005. [17] J. Guo. A more effective linear kernelization for cluster editing. Theor. Comput. Sci., 410(8-10):718–726, 2009. [18] Pinar Heggernes, Daniel Lokshtanov, Jesper Nederlof, Christophe Paul, and Jan Arne Telle. Generalized graph clustering: Recognizing (p, q)cluster graphs. In Dimitrios M. Thilikos, editor, Graph Theoretic Concepts in Computer Science - 36th International Workshop, WG 2010, Zarós, Crete, Greece, June 28-30, 2010 Revised Papers, volume 6410 of Lecture Notes in Computer Science, pages 171–183, 2010. [19] C. Komusiewicz and J. Uhlmann. Cluster editing with locally bounded modifications. Discrete Applied Mathematics, 160(15):2259–2270, 2012. [20] M. Křivánek and J. Morávek. Np-hard problems in hierarchical-tree clustering. Acta Inf., 23(3):311–323, June 1986. [21] Jure Leskovec, Kevin J. Lang, Anirban Dasgupta, and Michael W. Mahoney. Community structure in large networks: Natural cluster sizes and the absence of large well-defined clusters. Internet Mathematics, 6(1):29–123, 2009. [22] R. Niedermeier. An Invitation to Fixed-Parameter Algorithms. Oxford University Press, 2006. [23] R. Shamir, R. Sharan, and D. Tsur. Cluster graph modification problems. Discrete Appl. Math., 144(1-2):173–182, November 2004. 17
8cs.DS
Gaussian information matrix for Wiener model identification∗ arXiv:1510.03013v1 [cs.SY] 11 Oct 2015 Kaushik Mahata†1 and Johan Schoukens‡2 1 Department of Electrical Engineering, University of Newcastle, Callaghan, NSW-2308, Australia. 2 Department ELEC, Vrije Universiteit, Brussel, Building K, Pleinlaan 2, 1050, Brussels, Belgium. January 23, 2018 Abstract We present a closed form expression for the information matrix associated with the Wiener model identification problem under the assumption that the input signal is a stationary Gaussian process. This expression holds under quite generic assumptions. We allow the linear sub-system to have a rational transfer function of arbitrary order, and the static nonlinearity to be a polynomial of arbitrary degree. We also present a simple expression for the determinant of the information matrix. The expressions presented herein has been used for optimal experiment design for Wiener model identification. Keywords: Wiener model identification, Information matrix, Gaussian input, Determinant. ∗ The research is supported in part by the Australian Research Council under the contract DP130103909, by the Fund for Scientific Research (FWO-Vlaanderen), by the Flemish Government (Methusalem), the Belgian Government through the Inter university Poles of Attraction (IAP VII) Program, and by the ERC advanced grant SNLSID, under contract 320378. † Email: [email protected] ‡ Email: [email protected] 1 1 Introduction In this paper we present an expression of the information matrix associated with the Wiener model identification problem under a generic setting. Our analysis allows a rational model the linear subsystem, and a polynomial nonlinearity. The rational transfer function can be of arbitrary oder and a nonlinearity with arbitrary polynomial order can be allowed. The analysis assumes Gaussian stationary input process. This work is mainly motivated by the experiment design problem. The standard approach in experiment design is to choose the input excitation in order to optimize some monotonic function of the information matrix [1–3, 8, 9, 11]. When the linear subsystem G of the underlying Wiener system has a generic rational transfer function, it has an infinite impulse response. Consequently, the information matrix J becomes a function of the of higher order joint moments of the input process u(t), u(t − 1), u(t − 2), . . .. It is very challenging to optimize any criterion of J with respect to the all higher order moments of potentially infinitely many consecutive samples of the input u(t). In fact, it is quite difficult to just compute J. Firstly, the available formulae for calculating higher order moments are quite challenging to program. More importantly, the complexity of the resulting algorithm typically grows exponentially with the length of the impulse response of G [12]. In fact, to the best of our knowledge no previous authors have considered handling this issue when G is not a finite impulse response system. Even when a finite impulse response system is considered in the literature, the order of the system have been restricted to 4 or less. In fact, when compared with the experiment design literature for linear system identification [1–3, 8, 9, 11], the the line of research in the nonlinear input design has undergone a significant paradigm shift. Most of the preliminary studies reported so far [6, 7, 10, 13, 16], have considered a deterministic setting. Among these the multi-level excitation approach [4–6, 13] appears to be popular lately. These deterministic methods do have their limitations. The multi-level approach is often not tractable when we increase the number of levels. The majority of these methods are unable to handle IIR-type non-linear systems. We show when the input process is Gaussian there is a simple algorithm to compute J. This analysis also reveals some interesting mathematical structures, that allows us to parameterize the set of all admissible information matrices with a finite number of parameters. Hence the experiment designer needs to solve only a finite dimensional problem. See [14] for the details of how the expressions presented herein can be used in experiment design. 2 Information matrix and its determinant In this section we present our main findings about the information matrix J and its determinant. We start in Section 2.1 with the basic notation and introduce the formal problem setting. In particular, we introduce a generalized framework for setting up the constraint to ensure unique identifiability of the Wiener model. Next in Section 2.2 we list the main results. In particular we use a state space representations of underlying transfer functions. We believe this approach simplifies the analysis, and illuminates the underlying mathematical structures to a significant extent. 2 2.1 Model parameterization and identifiability A Wiener system is a cascade of a linear time invariant system followed by a static nonlinearity. We assume that the linear sub-system has a rational transfer function G(z, θ) = g0 + g1 z −1 + · · · + gn z −n , 1 + a1 z −1 + · · · + an z −n (1) parameterized by the parameter vector θ defined as θ = [ a1 · · · an g1 · · · gn g0 ]⊺ . (2) The output of the linear model is denoted by w: w(t, θ) = G(z, θ)u(t). (3) The static nonlinearity is modeled by a polynomial ℘ of order m: ℘(x, ᾱ) = α0 + α1 x + · · · + αm xm , parameterized by the vector of polynomial coefficients ᾱ = [ α0 α1 · · · αm ]⊺ . Therefore, the Wiener model equation takes the form M(ϑ, ut ) = ℘{G(z, θ)u(t), ᾱ}. (4) It is tempting to choose ϑ = [ ᾱ⊺ θ ⊺ ]⊺ . But this parameterization fails to ensure unique identifiability. We cannot allow all the components of θ and ᾱ to vary freely while remaining independent of each other. The reason is straightforward. The transfer operator between u and y does not change by dividing G by a scalar ̺ 6= 0, and multiplying αk by ̺k for all k = 1, 2, . . . , m. For this reason we must impose some additional constraint on the parameters. In this paper we allow varying the static gain of G freely, and impose a normalization constraint on ᾱ. Assumption 1 There is a known vector υ = [ υ0 υ1 · · · υm ]⊺ (5) α0 υ0 + α1 υ1 + · · · + αm υm = 1, (6) such that where υℓ 6= 0 for some known ℓ ∈ {1, 2, . . . , m}. The choice of ℓ is often governed by the prior knowledge on the type of nonlinearity. Typically ℓ 6= 0, because it is often the case that α0 = 0. For an odd (even) nonlinearity ℓ must be an odd (even) number. In our experience, the choice of ℓ does not influence the asymptotic large sample accuracy of the estimated model. 3 Example 1 It is common to take υ = (0, 1, . . . , 0) or υ = (0, . . . , 0, 1). Another possibility would be to take υ = (1, . . . , 1) implying ℘(1) = 1. Note that the choice υ = (1, 0, · · · , 0) is forbidden. It leads to a model that is not identifiable. Since υℓ 6= 0 under Assumption 1, we can rewrite (6) as         m   X 1 υ k αk . 1− αℓ =  υℓ      k=0   (7) k 6= ℓ Equation (7) can be built into the identification algorithm. We do not identify αℓ separately, but express it using (7). We define the parameter vector α := [ αi1 · · · αim ]⊺ , (8) where the indices ik ∈ {0, 1, . . . , m} are chosen such that ik 6= ℓ for all k, and ik 6= ij whenever k 6= j. Note that mapping k → ik is quite flexible, and we need not impose any further restriction on this mapping. The identification algorithm estimates ϑ = [ α⊺ θ ⊺ ]⊺ from the data. Defining    L=  1 0 .. . 0 · · · 0 −υi1 /υℓ 1 · · · 0 −υi2 /υℓ .. .. .. . . . 0 0 · · · 1 −υim /υℓ P = [ ei1 · · · eim eℓ ]⊺ ,    ,  (9) with ek denoting the k + 1 th column of (m + 1) × (m + 1) identity matrix, it can be verified from (7) that [ α⊺ αℓ ]⊺ = Pᾱ = L⊺ α. (10) 2.2 Main theoretical results Let a = [ a1 · · · an ]⊺ , and g = [ g1 · · · gn ]⊺ . Then we can write (1) as G(z, θ) = g0 + (g − ag0 )⊺ (zI − A1 )−1 b1 , where (A1 , b1 ) is in controllable canonical form, i.e.  −a1 · · · −an−1 −an  1 ··· 0 0  A1 =  .. . .. . .. ..  . . 0 ··· 1 0        , b1 =    1 0 .. . 0 (11)    .  (12) Note that we can impose the structure (11) and (12) without any loss of generality. We make the following assumption throughout the paper, where θ̊ denotes the true value of θ. 4 Assumption 2 G(z, θ̊) is asymptotically stable. Consequently, all the eigenvalues of Å1 (which denotes the true value of A1 ) are located inside the unit disc in the complex plane. In addition, the state space realization (11) is minimal. Lemma 1 Define the matrices A, b, c and C̄ as       I −g̊0 I 0 0n×1 0n×1 I 0  , b =  0n×1  , c =  g̊  , C̄ =  0 0 −å⊺ 1 1 g̊0   Å1 −b1 (g̊ − åg̊0 )⊺ 0n×1 −1 A = C̄  0n×n Å1 b1  C̄ , 01×n 01×n 0 (13) where Å1 ,g̊0 , etc are obtained by setting θ = θ̊ in A1 , g0 , etc. Consider the stochastic process x which is given in state space form as x(t) = Ax(t − 1) + bu(t). (14) Then w(t, θ̊) = c⊺ x(t), and vt =  LPz(t, θ̊) x(t)α⊺2 z(t, θ̊)  , (15) where we define z(t, θ) := [ 1 w(t, θ) {w(t, θ)}2 · · · {w(t, θ)}m ]⊺ , (16) α2 = [ α̊1 2α̊2 · · · mα̊m 0 ]⊺ , (17) with α̊k being the true value of αk . Proof: See Section A. Remark 1 Lemma 1 does cover the case when G is of finite impulse response type, i.e., G(z, θ) = g0 + g1 z −1 + · · · + gn z −n . In this case θ = [ g⊺ g0 ]⊺ , and a = 0. The expressions (11) and (12) still hold with a = 0. While finding a realization of G1 we do not need to consider the derivatives with respect to a. As a result we get     0n×1 Å1 b1 A= , b= , 1 01×n 0 C̄ = I and c = θ. The consequence of Lemma 1 is that J = E{vt vt⊺ } is a function of the moments of the state vector x. For the purpose of setting up an input design problem we can parameterize J in terms of the moments of the random vector x. In particular, when u(t) is Gaussian, then so is x(t). Hence for a Gaussian input J is a function of the mean and the covariance matrix of x(t). As the next Theorem reveals, we can obtain a closed form expression for J. 5 Assumption 3 The input process u(t) is stationary Gaussian with mean ηu . Under Assumption 3, x is a Gaussian random vector with mean η := E{x(t)} = (I − A)−1bηu . (18) Σ = E{[x(t) − η][x(t) − η]⊺ }. (19) Let us define Consequently, c⊺ x(t) is a Gaussian random variable such that γ := E{c⊺ x(t)} = c⊺ η. σ := E{c⊺ x(t) − γ}2 = c⊺ Σc. (20a) (20b) In the rest of the paper we denote Λ := E{z(t, θ̊)[z(t, θ̊)]⊺ }. Remark 2 It is possible to express Σ as well in terms of A, b, and the power spectral density Φ of u. However, we postpone that for a while. We first express J in terms of Σ and η, and later connect Φ with Σ. This approach suits the purpose of input design, where it is simpler to work with a parameterization of Σ than to work with Φ directly. Remark 3 The correlation matrix Λ can be given entirely as a function of the mean γ and variance σ of c⊺ x(t). Many different ways are used in the literature to express the moments of the scalar valued normal density. There are some explicit formulae for smaller orders. We find it convenient to use a recursive formula in the implementation. Let us denote µk (γ, σ) := E{(c⊺ x)k }. So µk is a function of σ and µ. Then µk (γ, σ) satisfies the recursion [15, Chapter 5]: Z k(k − 1) σ k µk−2 (τ, σ) dτ. (21) µk (γ, σ) = γ + 2 0 Note that the recursion (21) needs to be carried out separately for even and odd values of k. For even valued k one can initialize the recursion with µ0 (γ, σ) = 1, and for the odd values of k we initialize with µ1 (γ, σ) = γ. This allows us to form   µ0 (γ, σ) µ1 (γ, σ) · · · µm (γ, σ)  µ1 (γ, σ) µ2 (γ, σ) · · · µm+1 (γ, σ)    Λ= . .. .. ..   . . . µm (γ, σ) µm+1 (γ, σ) · · · µ2m+1 (γ, σ) Since x is Gaussian, all the moments of x can be expressed as functions of η and Σ. This allows us to derive manageable expressions of J as a function of η and Σ. This is shown next. Theorem 1 Define α1 = [ 0 α̊1 , 2α̊2 · · · mα̊m ]⊺ , 6 β = α⊺2 Λα2 , (22) Q= Partition J as  − σγ 0 1 1 σ  , F := [ Σc η ], J=  J11 J⊺21 J21 J22  H=  βσ 0 0 0  . , where J11 is of size m × m, while J22 is of size (2n + 1) × (2n + 1). Then J11 = L1 ΛL⊺1 , J21 = FQL2 ΛL⊺1 J22 = FQ(L2 ΛL⊺2 − H)Q⊺ F⊺ + βΣ, (23) L1 := LP,   ⊺   0 α̊1 2α̊2 · · · mα̊m α1 . = L2 := α̊1 2α̊2 · · · mα̊m 0 α⊺2 (24) where Proof: See Appendix B. Remark 4 Expressions given by Theorem 1 allow us to compute J in a simple way. To the best of our knowledge there is no similar expressions in the literature allowing this computational advantage. The matrices Q, H, Λ, L1 , L2 and β share an interesting property. They depend only on the true parameter vector ϑ̊ and the second order statistics (consisting of γ and σ) of the stochastic process w(t, θ̊) = c⊺ x(t). These quantities remain constant so long γ and σ remain constant, even though the input power spectral density (and thus Σ) may vary. This is due to the fact that the estimation accuracy of the static nonlinearity depends only on the amplitude distribution of w(t), regardless of Σ (or equivalently, Φ). This observation plays a key role in the sequel, and is formalized via the following definition. Definition 1 A quantity is called w-dependent if it is a function of ϑ̊, σ and γ only. The expressions given in Theorem 1 may not seem appealing from the point of view of setting up an optimization problem for input design that can be solved in a tractable manner. The next result is more attractive in that regard. Theorem 2 The determinant of J is given by det(J) = β 2n r12 det(J11 ) det(Σ). σ where r1 = α⊺1 υ(υ ⊺ Λ−1 υ)−1/2 . 7 (25) Proof: See Appendix C Remark 5 The expression of det(J) in (25) has some nice structure. The factor f := β 2n r12 det(J11 )/σ (26) is w-dependent, and remains constant when the statistics of w(t, θ 0 ) remain invariant. On the other hand it is well-known from the literature on the input design for linear systems that we can parameterize det(Σ) in a convex manner using a finite number of parameters. When the mean ηu of the input is kept fixed, then the above facts let us solve the D-optimal design problem for Wiener models via an one dimensional search in σ. To emphasize the w-dependence of f we write it as f (γ, σ). When we consider a situation where γ is fixed and known, then we write it as f (σ). Remark 6 Note that J is singular when r1 = 0. This means that the normalization of the form described in Assumption 1 ensures identifiability (and thus a non-singular information matrix) only when 0 6= α⊺1 υ = υ1 α̊1 + 2υ2α̊2 + · · · + mυm α̊m , (27) see the definition of r1 in the statement of Theorem 2. We can easily construct a case where (27) fails to hold. That is υ = (1, 0, . . . , 0). It is straightforward to see why this choice leads to lack of identifiability: it still allows us to simultaneously vary the gain of the linear subsystem and the factors {αk }m k=1 , while the constraint (6) is satisfied. By imposing the constraint (6) we restrict the search space to the hyperplane ) ( m X αk υ k = 1 H = (α0 , α1 , · · · αm ) : k=0 By assumption, (α̊0 , α̊1 , · · · , α̊m ) ∈ H. The model is identifiable when H intersects with the manifold M = {(α̊0 , ̺α̊1 , · · · , ̺m α̊m ) : ̺ 6= 0} only at the point (α̊0 , α̊1 , · · · , α̊m ), which corresponds to ̺ = 1. We have local identifiability at (α̊0 , α̊1 , · · · , α̊m ) only if M is not oriented along H at (α̊0 , α̊1 , · · · , α̊m ), i.e., ̺ = 1. In other words, we do not want the directional derivative (0, 2α̊1 , · · · , mα̊m ) =: α1 of M at ̺ = 1 to be perpendicular to υ, which is identical to (27). 3 Conclusions We have presented several new results on the analysis of Wiener model identification using Gaussian input processes. One of the main results in this paper is Theorem 1, which gives a closed form expression of the associated information matrix J. This expression holds under very generic assumptions on the model structure. In addition, unlike other similar formulae available in the literature, our expression for J is easy to compute. This aspect makes it attractive in input design problems. Theorem 2 gives a simple expression for the determinant of J. These expressions are particularly useful in experiment design, see [14] for details. 8 A Proof of Lemma 1 By definition of P in (9) we have PP⊺ = I. Using this in (10) gives ᾱ = P⊺ L⊺ α. (28) Using (28) and the definition of z(t, θ) in (16) in (4) we have M(ϑ, ut ) = ᾱ⊺ z(t, θ) = α⊺ LPz(t, θ). (29) Hence ∂M(ϑ̊, ut ) = LPz(t, θ̊). (30) ∂α Also using the definition of z(t, θ) in (16) and differentiating M(t, ϑ) in (29) with respect to θ we get   0   1   ∂M(ϑ̊, ut ) ∂w(t, ϑ̊) ⊺   2w(t, θ̊) = α̊ LP     ∂θ ∂θ ..   . m{w(t, θ̊)}m−1 = ∂w(t, ϑ̊) ⊺ α2 z(t, θ̊), ∂θ (31) where the last equality follows from the definition of α2 in (17) and the definition of z(t, θ) in (16). The proof for the expression of vt in (15) will be complete if we can show ∂w(t, ϑ̊) ∂G(z, θ̊) = u(t) = x(t). ∂θ ∂θ This is done next. By differentiating G with respect to a, g and g0 we get ∂G(z, θ) = −(zI − A1 )−1 b1 g0 ∂a − (zI − A1 )−1 b1 (g − ag0 )⊺ (zI − A1 )−1 b1 , ∂G(z, θ) = (zI − A1 )−1 b1 , ∂g ∂G(z, θ) = 1 − a⊺ (zI − A1 )−1 b1 . ∂g0 (32) (33a) (33b) (33c) Using (33) and (13) it can be verified by direct calculations that ∂G(z, θ̊) = (I − Az −1 )−1 b, ∂θ implying (32). To show w(t, θ̊) = c⊺ x(t) verify from (11) and (33) that G(z, θ̊) = [ 0⊺ g̊⊺ g̊0 ] ∂G(z, θ̊) = c⊺ (I − Az −1 )−1 b. ∂θ 9 (34) B Proof of Theorem 1 Since Σ is positive definite, Σc 6= 0. Hence there exists a full column rank (2n + 1) × (2n) matrix C such that the column space of C is the orthogonal complement of Σc, i.e., C⊺ Σc = 0. Hence    ⊺  σ 0 c Σ[c C]= , (35) 0 Σ1 C⊺ The block diagonal structure of the matrix in the right hand side of (35) ensures that by premultiplying x by [ c C ]⊺ we get two mutually uncorrelated components c⊺ x and x1 := C⊺ x, with γ := E{x1 } = C⊺ η, Σ1 := E{[x1 − γ][x1 − γ]⊺ } = C⊺ ΣC. (36) Because x is a Gaussian random vector, we conclude that [ c⊺ x x⊺1 ]⊺ too is a jointly Gaussian random vector. Since uncorrelated Gaussian variables are independent, c⊺ x and x1 are mutually independent. Define the (m + 2n + 1) × (m + 2n + 1) matrix   I 0 (37) T =  0 c⊺  , ⊺ 0 C where the identity matrix appearing in (37) in the north-west corner is of size m × m. Premultiplying vt in (16) by T we note that   L1 z(t, θ̊) Tvt =  c⊺ x(t)α⊺2 z(t, θ̊)  . (38) ⊺ ⊺ C x(t)α2 z(t, θ̊) From Lemma 1 recall that c⊺ x(t) = w(t, θ̊). Then from the definition of z(t, θ) in (16), the definitions α1 and α2 in (22) and (17) we have c⊺ x(t)α⊺2 z(t, θ̊) = w(t, θ̊)α⊺1 z(t, θ̊). In addition, C⊺ x(t) = x1 (t). Hence   L1 z(t, θ̊) Tvt =  α⊺1 z(t, θ̊)  . x1 (t)α⊺2 z(t, θ̊) (39) Since x1 (t) is independent of w(t, θ̊) = c⊺ x(t), it is also independent of z(t, θ̊), see (16). Using this and (39) we get TJT⊺ = E {[Tvt ] [Tvt ]⊺ }   L1 ΛL⊺1 L1 Λα1 L1 Λα2 γ ⊺ . α⊺1 Λα1 α⊺1 Λα2 γ ⊺ =  α⊺1 ΛL⊺1 ⊺ ⊺ ⊺ ⊺ ⊺ γα2 ΛL1 γα2 Λα1 α2 Λα2 (γγ + Σ1 ) 10 (40) Define the vector d and the (2n + 1) × (2n) matrix D by partitioning the inverse  ⊺ −1 c = [ d D ]. C⊺ (41) Then (37) and (40) imply J=  I 0 0 0 d D Using expression of TJT⊺ in (40) we get   I 0 (TJT⊺ )  0 d⊺  . 0 D⊺  J11 = L1 ΛL⊺1 , J21 = [ d Dγ ] L2 ΛL⊺1 J22 = [ d Dγ ] L2 ΛL⊺2 [ d Dγ ]⊺ + βDΣ1 D⊺ . (42a) (42b) (42c) Now from (35) and (41) we obtain Σ=[d D]  σ 0 0 Σ1  d⊺ D⊺  = dσd⊺ + DΣ1 D⊺ . (43) By definition of d and D in (41) we know    ⊺  1 0 c , [d D]= 0 I C⊺ and this implies C⊺ d = 0, ⇒ d = kΣc. In addition, 1 = c⊺ d = kc⊺ Σc = kσ. Consequently, d= 1 Σc. σ (44) On the other hand I=[d D]  c⊺ C⊺  = dc⊺ + DC⊺ = 1 Σcc⊺ + DC⊺ , σ (45) Now multiply both sides of (45) by η to get η− γ Σc = Dγ σ (46) From (44) and (46) it follows that [ d Dγ ] = FQ. Now we use (43), (44), and (46) in (42) to eliminate d and D from the expressions of J12 and J22 . We have J21 = FQL2 ΛL⊺1 J22 = FQL2 ΛL⊺2 Q⊺ F⊺ + β(Σ − Σcc⊺ Σ/σ) = βΣ + FQL2 ΛL⊺2 Q⊺ F⊺ − FQHQ⊺ F⊺ = FQ(L2 ΛL⊺2 − H)Q⊺ F⊺ + βΣ. 11 C Proof of Theorem 2 C.1 Some Schur complement expressions ⊺ Lemma 2 The Schur complement J22 − J21 J−1 11 J21 admits an expression ⊺ J22 − J21 J−1 11 J21 = βΣ + FQ[L2 υ(υ ⊺ Λ−1 υ)−1 υ ⊺ L⊺2 − H]Q⊺ F⊺ . Proof: In this proof we let Γ be the Cholesky factor of Λ, i.e., Λ = ΓΓ⊺ . From the expressions of J11 , J21 and J22 in Theorem 1 it follows that ⊺ ⊺ ⊺ ⊺ J22 − J21 J−1 11 J21 = βΣ + FQ[L2 ΠL2 − H]Q F , (47) Π = Λ − ΛL⊺1 (L1 ΛL⊺1 )−1 L1 Λ = Γ[I − Γ⊺ L⊺1 (L1 ΓΓ⊺ L⊺1 )−1 L1 Γ]Γ⊺ . (48) where we define However, the matrix Π̄ := I − Γ⊺ L⊺1 (L1 ΓΓ⊺ L⊺1 )−1 L1 Γ is the orthogonal projection operator onto the nullspace of L1 Γ. From (5), (9) and the definition of L1 in (24) verify that that L1 υ = LPυ = 0. This means L1 ΓΓ−1 υ = 0, i.e. the vector Γ−1 υ spans the one dimensional nullspace of L1 Γ. Hence Π̄ is also the orthogonal projection operator onto the span of Γ−1 υ. Hence Π̄ = Γ−1 υ(υ ⊺ Λ−1 υ)−1 υ ⊺ Γ−⊺ . Substituting this expression in (48) gives Π = υ(υ ⊺ Λ−1 υ)−1 υ ⊺ , which upon substitution in (47) yields the desired result. Define ri := α⊺i υ(υ ⊺ Λ−1 υ)−1/2 , Note that −1 −1 L2 υ(υ Λ υ) υ ⊺ ⊺ L⊺2 =  i = 1, 2. r1 r2  r1 r2 ⊺ (49) , (50) see the definition of L2 in Theorem 1. When r2 = 0 the matrix L2 υ(υ ⊺ Λ−1 υ)−1 υ ⊺ L⊺2 − H is of rank 1. Then the calculations turn out to be quite different from the case where r2 6= 0. 12 Lemma 3 If r2 = 0 then ⊺ det(J22 − J21 J−1 11 J21 ) = r12 det(βΣ), βσ (51) Proof: When r2 = 0 then using (49), definition of Q in Theorem 1 and the expressions given by Lemma 2 we get ⊺ J22 − J21 J−1 11 J21   2 r1 − βσ 0 Q⊺ F⊺ = βΣ + FQ 0 0  1   2 γ r − βσ 0 − 1 σ = βΣ + F σ Q⊺ F⊺ 0 0 0 1  1  2  0 r1 /σ − β 0 σ = βΣ + F F⊺ − σγ 1 0 0   2 2 r1 /σ − β/σ 0 F⊺ = βΣ + F 0 0 = βΣ + (r12 /σ 2 − β/σ)Σcc⊺ Σ. (52) In this proof we write q = r12 /σ 2 − β/σ compactly. From (52) we have ⊺ ⊺ det(J22 − J21 J−1 11 J21 ) = det (βΣ + qΣcc Σ)   q = det(βΣ) det I + cc⊺ Σ β   q ⊺ = det(βΣ) det 1 + c Σc β   qσ = det(βΣ) det 1 + β Substituting the value of q we get (51). Lemma 4 Suppose that r2 6= 0. Then r12 det(J22 − = det(βΣ), βσ "  2 # 1 1 r γ 2 ⊺ −1 (J22 − J21 J−1 = 2− −1 cc⊺ 11 J21 ) r1 βσ r1   ⊺  r2 ⊺ r2 ⊺ −1 cη − I [βΣ] cη − I . + r1 r1 ⊺ J21 J−1 11 J21 ) 13 (53) (54) Proof: Define  B := Q   −1 L2 υυ ⊺ L⊺2 − H Q⊺ (υ ⊺ Λ−1 υ)−1 (55) Recall that ζ = r1 /r2 . Hence from (50) we get  −1 L2 υυ ⊺ L⊺2 −H (υ ⊺ Λ−1 υ)−1   1 1 −r1 /r2 =− βσ −r1 /r2 r12 /r22 − βσ/r22   1 1 −ζ . =− βσ −ζ ζ 2 − βσ/r22 Hence by definition of Q, see Theorem 1, we get    1 σ 0 1 −ζ βB = − Q−1 −ζ ζ 2 − βσ/r22 σ γ 1    1 σ γ σ −σζ = − 0 1 βσ γ − ζ −ζ(γ − ζ) − βσ/r22   1 σ2 σ(γ − ζ) = − σ(γ − ζ) (γ − ζ)2 − βσ/r22 σ   σ γ−ζ 2 . = − − β/r22 γ − ζ (γ−ζ) σ Taking determinant we have det(βB) = − βσ . r22 (56) (57) On the other hand, recall that F = [ Σc η ]. Hence using (20) we get   σ γ ⊺ −1 . F Σ F= γ η ⊺ Σ−1 η (58) Combining (56) and (58) we get βB + F⊺ Σ−1 F = " 0 ζ ⊺ −1 ζ η Σ η + rβ2 − 2 (γ−ζ)2 σ # (59) Taking determinant we have det(βB + F⊺ Σ−1 F) = −ζ 2 (60) Now using Lemma 2 and (55) we know ⊺ −1 ⊺ J22 − J21 J−1 11 J21 = βΣ + FB F 14 (61) Hence ⊺ det(J22 − J21 J−1 11 J21 ) = det(βΣ + FB−1 F⊺ ) = det(βΣ) det(I + Σ−1 F(βB)−1 F⊺ ) = det(βΣ) det(I + F⊺ Σ−1 F{βB}−1 )  det(βΣ) det βB + F⊺ Σ−1 F = det(βB) r2 r2ζ 2 = det(βΣ) 2 = det(βΣ) 1 . βσ βσ C.2 Proof of the formula for det(J) Using Schur’s determinant formula we know ⊺ det(J) = det(J11 ) det(J22 − J21 J−1 11 J21 ). (62) ⊺ The result of Theorem 2 is immediate from (62) once we use the expression for det(J22 −J21 J−1 11 J21 ) given by (53). References [1] M. Barenthin, X. Bombois, H. Hjalmarsson, and G. Scorletti. Identification for control of multivariable systems: Controller validation and experiment design via LMIs. Automatica, 44:3070–3078, Dec 2008. [2] M. Barenthin and H. Hjalmarsson. Identification and control: Joint input design and H∞ state feedback with ellipsoidal parametric uncertainty via LMIs. Automatica, 44(2):543–551, Feb 2008. [3] X. Bombois, G. Scorletti, M. Gevers, P. M. J. Van den Hof, and R. Hildebrand. Least costly identification experiment for control. Automatica, 42:3:1651–1662, 2006. [4] A. De Cock, M. Gevers, and J. Schoukens. A preliminary study on optimal input design for nonlinear systems. In Decision and Control (CDC), 2013 IEEE 52nd Annual Conference on, pages 4931–4936, Dec 2013. [5] A. De Cock, M. Gevers, and J. Schoukens. D-optimal input design for FIR-type nonlinear systems: A dispersion based approach. 2014. Submitted for publication. [6] M. Forgione, X. Bombois, P. M. J. Van den Hof, and H. Hjalmarsson. Experiment design for parameter estimation in nonlinear systems based on multilevel excitation. 2014. European Control Conference. [7] M. Gevers, M. Caenepeel, and J. Schoukens. Experiment design for the identification of a simple Wiener system. In Decision and Control (CDC), 2012 IEEE 51st Annual Conference on, pages 7333–7338, Dec 2012. 15 [8] R. Hildebrand and M. Gevers. Identification for control: optimal input design with respect to a worst-case ν-gap cost function. SIAM journal of control and optimization, 41:5:1586–1608, 2003. [9] H. Hjalmarsson and H. Jansson. Closed loop experiment design for linear time invariant dynamical systems via LMIs. Automatica, 44(3):623–636, Mar 2008. [10] H. Hjalmarsson and J. Mårtensson. Optimal input design for identification of non-linear systems: Learning from the linear case. In American Control Conference, 2007. ACC ’07, pages 1572–1576, July 2007. [11] H. Jansson and H. Hjalmarsson. Input design via LMIs admitting frequency-wise model specifications in confidence regions. IEEE Transactions on Automatic Control, 50(10):1534– 1549, Oct 2005. [12] R. Kan. From moments of sum to moments of product. Journal of multivariate analysis, 99:542–554, 2008. [13] C. A. Larsson, H. Hjalmarsson, and C. R. Rojas. On optimal input design for nonlinear FIR-type systems. In Decision and Control (CDC), 2010 49th IEEE Conference on, pages 7220–7225, Dec 2010. [14] K. Mahata, J. Schoukens, and A. De Cock. Information matrix and D-optimal design with gaussian inputs for wiener model identification. Automatica, 2015. In press. [15] A. Papoulis. Probability, Random Variables, and Stochastic Processes. McGraw-Hill, New York, 1991. [16] P. E. Valenzuela, C. R. Rojas, and H. Hjalmarsson. Optimal input design for non-linear dynamic systems: A graph theory approach. In Decision and Control (CDC), 2013 IEEE 52nd Annual Conference on, pages 5740–5745, Dec 2013. 16
3cs.SY
A Hebbian/Anti-Hebbian Neural Network for Linear Subspace Learning: A Derivation from Multidimensional Scaling of Streaming Data Cengiz Pehlevan1, 2 , Tao Hu3 , Dmitri B. Chklovskii2 arXiv:1503.00669v1 [q-bio.NC] 2 Mar 2015 1 Janelia Research Campus, Howard Hughes Medical Institute, Ashburn, VA 20147 2 Simons Center for Data Analysis, 160 Fifth Ave, New York, NY 10010 3 Texas A&M University, MS 3128 TAMUS, College Station, TX 77843 Keywords: Online learning, Linear subspace tracking, Multidimensional scaling, Neural networks Abstract Neural network models of early sensory processing typically reduce the dimensionality of streaming input data. Such networks learn the principal subspace, in the sense of principal component analysis (PCA), by adjusting synaptic weights according to activity-dependent learning rules. When derived from a principled cost function these rules are nonlocal and hence biologically implausible. At the same time, biologically plausible local rules have been postulated rather than derived from a principled cost function. Here, to bridge this gap, we derive a biologically plausible network for subspace learning on streaming data by minimizing a principled cost function. In a departure from previous work, where cost was quantified by the representation, or reconstruction, error, we adopt a multidimensional scaling (MDS) cost function for streaming data. The resulting algorithm relies only on biologically plausible Hebbian and anti-Hebbian local learning rules. In a stochastic setting, synaptic weights converge to a stationary state which projects the input data onto the principal subspace. If the data are generated by a nonstationary distribution, the network can track the principal subspace. Thus, our result makes a step towards an algorithmic theory of neural computation. 1 Introduction Early sensory processing reduces the dimensionality of streamed inputs (Hyvärinen et al., 2009) as evidenced by a high ratio of input to output nerve fiber counts (Shepherd, 2003). For example, in the human retina, information gathered by ≈125 million photoreceptors is conveyed to the Lateral Geniculate Nucleus through ≈1 million ganglion cells (Hubel, 1995). By learning a lower-dimensional subspace and projecting the streamed data onto that subspace the nervous system de-noises and compresses the data simplifying further processing. Therefore, a biologically plausible implementation of dimensionality reduction may offer a model of early sensory processing. For a single neuron, a biologically plausible implementation of dimensionality reduction in the streaming, or online, setting has been proposed in the seminal work of (Oja, 1982), Figure 1A. At each time point, t, an input vector, xt , is presented to the neuron, and, in response, it computes a scalar output, yt = wxt , were w is a row-vector of input synaptic weights. Furthermore, synaptic weights w are updated according to a version of Hebbian learning called Oja’s rule: w ← w + ηyt (x> t − wyt ), where η is a learning rate and > (1) designates a transpose. Then, the neuron’s synap- tic weight vector converges to the principal eigenvector of the covariance matrix of 2 the streamed data (Oja, 1982). Importantly, Oja’s learning rule is local meaning that synaptic weight updates depend on the activities of only pre- and postsynaptic neurons accessible to each synapse and, therefore, biologically plausible. Oja’s rule can be derived by an approximate gradient descent of the mean squared representation error (Cichocki and Amari, 2002; Yang, 1995), a so-called synthesis view of principal component analysis (PCA) (Pearson, 1901; Preisendorfer and Mobley, 1988): min w X xt − w> wxt 2 2 . (2) t Computing principal components beyond the first requires more than one output neuron and motivated numerous neural networks. Some well-known examples are the Generalized Hebbian Algorithm (GHA) (Sanger, 1989), Földiak’s network (Földiak, 1989), the subspace network (Karhunen and Oja, 1982), Rubner’s network (Rubner and Tavan, 1989; Rubner and Schulten, 1990), Leen’s minimal coupling and full coupling networks (Leen, 1990, 1991) and the APEX network (Kung and Diamantaras, 1990; Kung et al., 1994). We refer to (Becker and Plumbley, 1996; Diamantaras and Kung, 1996; Diamantaras, 2002) for a detailed review of these and further developments. However, none of the previous contributions was able to derive a multineuronal single-layer network with local learning rules by minimizing a principled cost function, in a way that Oja’s rule (1) was derived for a single neuron. The GHA and the subspace rules rely on nonlocal learning rules: feedforward synaptic updates depend on other neurons’ synaptic weights and activities. Leen’s minimal network is also nonlocal: feedforward synaptic updates of a neuron depend on its lateral synaptic weights. While Földiak’s, Rubner’s and Leen’s full coupling networks use local Hebbian and 3 anti-Hebbian rules, they were postulated rather than derived from a principled cost function. APEX network, perhaps, comes closest to our criterion: the rule for each neuron can be related separately to a cost function which includes contributions from other neurons. But no cost function describes all the neurons combined. At the same time, numerous dimensionality reduction algorithms have been developed for data analysis needs disregarding the biological plausibility requirement. Perhaps the most common approach is again PCA, which was originally developed for batch processing (Pearson, 1901) but later adapted to streaming data (Yang, 1995; Crammer, 2006; Arora et al., 2012; Goes et al., 2014). For a more detailed collection of references, see e.g. (Balzano, 2012). These algorithms typically minimize the representation error cost function: min X − F> FX F 2 F , (3) where X is a data matrix and F is a wide matrix (for detailed notation, see below). The minimum of (3) is when rows of F are orthonormal and span the m-dimensional principal subspace, and therefore F> F is the projection matrix to the subspace (Yang, 1995)1 . A gradient descent minimization of such cost function can be approximately implemented by the subspace network (Yang, 1995), which, as pointed out above, requires nonlocal learning rules. While this algorithm can be implemented in a neural network using local learning rules, it requires a second layer of neurons (Oja, 1992), making it 1 Recall that, in general, the projection matrix to the row space of a matrix P is given by P> PP> −1 P, provided PP> is full rank (Plumbley, 1995). If the rows of P are orthonormal this reduces to P> P. 4 less appealing. In this paper, we derive a single-layer network with local Hebbian and anti-Hebbian learning rules, similar in architecture to Földiak’s (Földiak, 1989) (see Figure 1B), from a principled cost function and demonstrate that it recovers a principal subspace from streaming data. The novelty of our approach is that, rather than starting with the representation error cost function traditionally used for dimensionality reduction, such as PCA, we use the cost function of classical multidimensional scaling (CMDS), a member of the family of multidimensional scaling (MDS) methods (Cox and Cox, 2000; Mardia et al., 1980). Whereas the connection between CMDS and PCA has been pointed out previously (Williams, 2001; Cox and Cox, 2000; Mardia et al., 1980), CMDS is typically performed in the batch setting. Instead, we developed a neural network implementation of CMDS for streaming data. The rest of the paper is organized as follows. In Section 2, by minimizing the CMDS cost function we derive two online algorithms implementable by a single-layer network, with synchronous and asynchronous synaptic weight updates. In Section 3, we demonstrate analytically that synaptic weights define a principal subspace whose dimension m is determined by the number of output neurons and that the stability of the solution requires that this subspace corresponds to top m principal components. In Section 4, we show numerically that our algorithm recovers the principal subspace of a synthetic dataset, and does it faster than the existing algorithms. Finally, in Section 5, we consider the case when data are generated by a nonstationary distribution and present a generalization of our algorithm to principal subspace tracking. 5 A B y . . . ym y1 Hebbian W w x1 x2 ... anti-Hebbian -M xn x1 x2 ... xn Figure 1: An Oja neuron and our neural network. A. A single Oja neuron computes the principal component, y, of the input data, x, if its synaptic weights follow Hebbian updates. B. A multineuron network computes the principal subspace of the input if the feedforward connection weight updates follow a Hebbian and the lateral connection weight updates follow an anti-Hebbian rule. 2 Derivation of online algorithms from the CMDS cost function CMDS represents high-dimensional input data in a lower-dimensional output space while preserving pairwise similarities between samples2 (Young and Householder, 1938; Torgerson, 1952). Let T centered input data samples in Rn be represented by columnvectors xt=1,...,T concatenated into an n × T matrix X = [x1 , . . . , xT ]. The corresponding output representations in Rm , m ≤ n, are column-vectors, yt=1,...,T , concatenated into an m × T dimensional matrix Y = [y1 , . . . , yT ]. Similarities between vectors in Euclidean spaces are captured by their inner products. For the input (output) data, such 2 Whereas MDS in general starts with dissimilarities between samples that may not live in Euclidean geometry, in CMDS data are assumed to have a Euclidean representation. 6 inner products are assembled into a T × T Gram matrix3 X> X (Y> Y). For a given X, CMDS finds Y by minimizing the so-called “strain” cost function (Carroll and Chang, 1972) : min X> X − Y> Y Y 2 F . (4) For discovering a low-dimensional subspace, the CMDS cost function (4) is a viable alternative to the representation error cost function (3) because its solution is related to PCA (Williams, 2001; Cox and Cox, 2000; Mardia et al., 1980). Specifically, Y is the linear projection of X onto the (principal sub-)space spanned by m principal eigenvectors of the sample covariance matrix CT = 1 T PT t=1 > xt x > t = XX . The CMDS cost function defines a subspace rather than individual eigenvectors because left orthogonal rotations of an optimal Y stay in the subspace and are also optimal, as is evident from the symmetry of the cost function. In order to reduce the dimensionality of streaming data, we minimize the CMDS cost function (4) in the stochastic online setting. At time T , a data sample, xT , drawn independently from a zero-mean distribution is presented to the algorithm which computes a corresponding output, yT prior to the presentation of the next data sample. Whereas in the batch setting, each data sample affects all outputs, in the online setting, past outputs cannot be altered. Thus, at time T the algorithm minimizes the cost depending on all inputs and ouputs up to time T with respect to yT while keeping all the 3 When input data are pairwise Euclidean distances, assembled into a matrix Q, the Gram matrix, X> X, can be constructed from Q by HZH, where Zij = −1/2Q2ij , H = In − 1/n11> is the centering matrix, and In is the n dimensional identity matrix (Cox and Cox, 2000; Mardia et al., 1980). 7 previous outputs fixed: > > yT = arg min X X − Y Y yT 2 F = arg min yT T X T X > x> t xt0 − yt yt0 2 , (5) t=1 t0 =1 where the last equality follows from the definition of the Frobenius norm. By keeping only the terms that depend on current output yT we get: " yT = arg min yT −4x> T T −1 X ! xt yt> yT + 2yT> t=1 T −1 X # ! yt yt> 2 2 yT − 2kxT k kyT k + kyT k t=1 (6) In the large-T limit, expression (6) simplifies further because the first two terms grow linearly with T , and therefore dominate over the last two. After dropping the last two terms we arrive at: " yT = arg min −4x> T yT T −1 X ! xt yt> t=1 yT + 2yT> T −1 X ! # yt yt> yT . (7) t=1 We term the cost in expression (7) the “online CMDS cost”. Because the online CMDS cost is a positive semi-definite quadratic form in yT for sufficiently large T , this optimization problem is convex. While it admits a closed-form analytical solution via matrix inversion, we are interested in biologically plausible algorithms. Next, we consider two algorithms that can be mapped onto single-layer neural networks with local learning rules: coordinate descent leading to asynchronous updates and Jacobi iteration leading to synchronous updates. 2.1 A neural network with asynchronous updates The online CMDS cost function (7) can be minimized by coordinate descent which at every step finds the optimal value of one component of yT while keeping the rest fixed. 8 4 . The components can be cycled through in any order until the iteration converges to a fixed point. Such iteration is guaranteed to converge under very mild assumptions: diagonals of TP −1 yt yt> has to be positive (Luo and Tseng, 1991), meaning that each t=1 output coordinate has produced at least one non-zero output before current time step T . This condition is almost always satisfied in practice. The cost to be minimized at each coordinate descent step with respect to ith channel’s activity is: " T −1 X yT,i = arg min −4x> T yT,i ! T −1 X xt yt> yT + 2yT> t=1 ! yt yt> # yT . t=1 Keeping only those terms that depend on yT,i yields: ! " T −1 X X xt,k yt,i yT,i xT,k yT,i = arg min −4 yT,i t=1 k +4 X yT,j T −1 X T −1 X ! yt,j yt,i yT,i + 2 2 yt,i # 2 yT,i . t=1 t=1 j6=i ! By taking a derivative with respect to yT,i and setting it to zero we arrive at the following closed-form solution: P k yT,i = T −1 P  yt,i xt,k t=1 TP −1 2 yt,i t=1 xT,k − P T −1 P j6=i t=1  yt,i yt,j yT,j TP −1 . (8) 2 yt,i t=1 To implement this algorithm in a neural network we denote normalized input-output and output-output covariances, TP −1 WT,ik = TP −1 yt,i xt,k t=1 TP −1 , MT,i,j6=i = 2 yt,i t=1 yt,i yt,j t=1 , TP −1 2 yt,i t=1 MT,ii = 0, (9) allowing us to rewrite the solution (8) in a form suggestive of a linear neural network: yT,i ← n X WT,ij xT,j − j=1 m X j=1 9 MT,ij yT,j , (10) where WT and MT represent the synaptic weights of feedforward and lateral connections respectively, Figure 1B. Finally, to formulate a fully online algorithm we rewrite (9) in a recursive form. This requires introducing a scalar variable DT,i representing cumulative activity of a neuron i up to time T − 1, DT,i = T −1 X 2 , yt,i (11) t=1 Then, at each time point, T , after the output yT is computed by the network, the following updates are performed: 2 DT +1,i ← DT,i + yT,i WT +1,ij ← WT,ij + yT,i (xT,j − WT,ij yT,i ) /DT +1,i  MT +1,i,j6=i ← MT,ij + yT,i yT,j − MT,ij yT,i /DT +1,i . (12) Equations (10) and (12) define a neural network algorithm that minimizes the online CMDS cost function (7) for streaming data by alternating between two phases: neural activity dynamics and synaptic updates. After a data sample is presented at time T , in the neuronal activity phase, neuron activities are updated one-by-one, i.e. asynchronously, (10) until the dynamics converges to a fixed point defined by the following equation: y T = W T x T − MT y T =⇒ yT = (Im + MT )−1 WT xT , (13) where Im is the m-dimensional identity matrix. In the second phase of the algorithm, synaptic weights are updated, according to a local Hebbian rule (12) for feedforward connections, and according to a local anti10 Hebbian rule (due to the (−) sign in equation (10)) for lateral connections. Interestingly, these updates have the same form as the single-neuron Oja’s rule (1) (Oja, 1982), except that the learning rate is not a free parameter but is determined by the cumulative neuronal activity 1/DT +1,i 4 . To the best of our knowledge such single-neuron rule (Hu et al., 2013) has not been derived in the multineuron case. An alternative derivation of this algorithm is presented in Appendix A.1 Unlike the representation error cost function (3), the CMDS cost function (4) is formulated only in terms of input and output activity. Yet, the minimization with respect to Y recovers feedforward and lateral synaptic weights. 2.2 A neural network with synchronous updates Here, we present an alternative way to derive a neural network algorithm from the largeT limit of the online CMDS cost function (7) . By taking a derivative with respect to yT and setting it to zero we arrive at the following linear matrix equation: T −1 X ! yt yt> yT = t=1 T −1 X ! y t x> t xT , (14) t=1 We solve this system of equations using Jacobi iteration (Strang, 2009), by first splitting the output covariance matrix that appears on the left side of (14) into its diagonal 4 The single neuron Oja’s rule derived from the minimization of a least squares optimization cost function ends up with the identical learning rate (Diamantaras, 2002; Hu et al., 2013). Motivated by this fact, such learning rate has been argued to be optimal for the APEX network (Diamantaras and Kung, 1996; Diamantaras, 2002) and used by others (Yang, 1995). 11 component DT and the remainder RT : T −1 X ! yt yt> = DT + RT , t=1 PT −1 where the i th diagonal element of DT , DT,i = t=1 2 yt,i , as defined in (11). Then, (14) is equivalent to: yT = D−1 T T −1 X ! y t x> t xT − D−1 T RT y T . t=1 Interestingly, the matrices obtained on the right side are algebraically equivalent to the feedforward and lateral synaptic weight matrices defined in (9): WT = D−1 T T −1 X ! yt x > t and MT = D−1 T RT . (15) t=1 Hence, the Jacobi iteration for solving (14) yT ← W T x T − M T y T . (16) converges to the same fixed point as the coordinate descent, (13). Iteration (16) is naturally implemented by the same single-layer linear neural network as for the asynchronous update, Figure 1B. For each stimulus presentation the network goes through two phases. In the first phase, iteration (16) is repeated until convergence. Unlike the coordinate descent algorithm which updated activity of neurons one after another, here, activities of all neurons are updated synchronously. In the second phase, synaptic weight matrices are updated according to the same rules as in the asynchronous update algorithm (12). Unlike the asynchronous update (10), for which convergence is almost always guaranteed (Luo and Tseng, 1991), convergence of iteration (16) is guaranteed only when 12 the spectral radius of M is less than 1 (Strang, 2009). Whereas we cannot prove that this condition is always met, in practice, the synchronous algorithm works well. While in the rest of the paper, we consider only the asynchronous updates algorithm, our results hold for the synchronous updates algorithm provided it converges. 3 Stationary synaptic weights define a principal subspace What is the nature of the lower dimensional representation found by our algorithm? In CMDS, outputs yT,i are the Euclidean coordinates in the principal subspace of the input vector xT (Cox and Cox, 2000; Mardia et al., 1980). While our algorithm uses the same cost function as CMDS, the minimization is performed in the streaming, or online, setting. Therefore, we cannot take for granted that our algorithm will find the principal subspace of the input. In this section, we provide analytical evidence, by a stability analysis in a stochastic setting, that our algorithm extracts the principal subspace of the input data and projects onto that subspace. We start by previewing our results and method. Our algorithm performs a linear dimensinality reduction since the transformation between the input and the output is linear. This can be seen from the neural activity fixed point (13), which we rewrite as yT = FT xT , 13 (17) where FT is a matrix defined in terms of the synaptic weight matrices WT and MT : FT := (Im + MT )−1 WT . (18) Relation (17) shows that the linear filter of a neuron, which we term a “neural filter”, is the corresponding row of FT . The space that neural filters span, the rowspace of FT , is termed a “filter space”. First, we prove that in the stationary state of our algorithm, neural filters are indeed orthonormal vectors (section 3.2, Theorem 1). Second, we demonstrate that the orthonormal filters form a basis of a space spanned by some m eigenvectors of the covariance of the inputs C (section 3.3, Theorem 2). Third, by analyzing linear perturbations around the stationary state, we find that stability requires these m eigenvectors to be the principal eigenvectors and, therefore, the filter space to be the principal subspace (section 3.4, Theorem 3). These results show that even though our algorithm was derived starting from the CMDS cost function (4), FT converges to the optimal solution of the representation error cost function (3). This correspondence suggests that F> T FT is the algorithm’s current estimate of the projection matrix to the principal subspace. Further, in (3), columns of F> are interpreted as data features. Then, columns of F> T , or neural filters, are the algorithm’s estimate of such features. Rigorous stability analyses of PCA neural networks (Oja, 1982; Oja and Karhunen, 1985; Sanger, 1989; Oja, 1992; Hornik and Kuan, 1992; Plumbley, 1995) typically use the ODE method (Kushner and Clark, 1978): Using a theorem of stochastic approximation theory (Kushner and Clark, 1978), the convergence properties of the algorithm 14 are determined using a corresponding deterministic differential equation5 . Unfortunately the ODE method cannot be used for our network. While the method requires learning rates that depend only on time, in our network learning rates (1/DT +1,i ) are activity dependent. Therefore we take a different approach. We directly work with the discrete-time system, assume convergence to a “stationary state”, to be defined below, and study the stability of the stationary state. 3.1 Preliminaries We adopt a stochastic setting where the input to the network at each time point, xt , is an n-dimensional i.i.d. random vector with zero mean, hxt i = 0, where brackets denote an average over the input distribution, and covariance C = xt x> t . Our analysis is performed for the “stationary state” of synaptic weight updates, i.e. when averaged over the distribution of input values, the updates on W and M average to zero. This is the point of convergence of our algorithm. For the rest of the section, we drop the time index T to denote stationary state variables. The remaining dynamical variables, learning rates 1/DT +1,i , keep decreasing at each time step due to neural activity. We assume that the algorithm has run for a sufficiently long time such that the change in learning rate is small and it can be treated as a constant for a single update. Moreover, we assume that the algorithm converges to a stationary point sufficiently fast such that the following approximation is valid at large 5 Application of stochastic approximation theory to PCA neural networks depends on a set of mathematical assumptions. See (Zufiria, 2002) for a critique of the validity of these assumptions and an alternative approach to stability analysis. 15 T: 1 DT +1,i = PT 1 t=1 2 yt,i ≈ 1 , T hyi2 i where y is calculated with stationary state weight matrices. We collect these assumptions into a definition. Definition 1 (Stationary State). In the stationary state, h∆Wij i = h∆Mij i = 0, and 1 1 = , Di T hyi2 i with T large. The stationary state assumption leads us to define various relations between synaptic weight matrices, summarized in the following corollary: Corollary 1. In the stationary state, hyi xj i = yi2 Wij , (19) hyi yj i = yi2 (Mij + δij ), (20) and where δij is the Kronecker-delta. Proof. Stationarity assumption when applied to the update rule on W (12) leads immediately to (19). Stationarity assumption applied to the update rule on M (12) gives: hyi yj i = yi2 Mij , 16 i 6= j. The last equality does not hold for i = j since diagonal elements of M are zero. To cover the case i = j, we add an identity matrix to M, and hence one recovers (20). Remark. Note that (20) implies hyi2 i Mij = yj2 Mji , i.e. that lateral connection weights are not symmetrical. 3.2 Orthonormality of neural filters Here we prove the orthonormality of neural filters in the stationary state. First, we need the following lemma: Lemma 1. In the stationary state, the following equality holds: Im + M = WF> . (21) Proof. By (20), hyi2 i (Mik + δik ) = hyi yk i. Using y = Fx, we substitute for yk on the right hand side: hyi2 i (Mik + δik ) = yields: hyi2 i (Mik + δik ) = hyi2 i P j P j Fkj hyi xj i. Next, the stationarity condition (19) Fkj Wij . Canceling hyi2 i on both sides proves the Lemma. Now we can prove our theorem. Theorem 1. In the stationary state, neural filters are orthonormal: FF> = Im . (22) Proof. First, we substitute for F (but not for F> ) its definition (18): FF> = (Im + M)−1 WF> . Next, using Lemma 1, we substitute WF> by (Im + M). The right hand side becomes (Im + M)−1 (Im + M) = Im . Remark. Theorem 1 implies that rank(F) = m. 17 3.3 Neural filters and their relationship to the eigenspace of the covariance matrix How is the filter space related to the input? We partially answer this question in Theorem 2, using the following lemma: Lemma 2. In the stationary state, F> F and C commute: F> FC = CF> F. (23) Proof. See Appendix A.2. Now we can state our second theorem. Theorem 2. At the stationary state state, the filter space is an m-dimensional subspace in Rn that is spanned by some m eigenvectors of the covariance matrix. Proof. Because F> F and C commute (Lemma 2), they must share the same eigenvectors. Equation (22) of Theorem 1 implies that m eigenvalues of F> F are unity and the rest are zero. Eigenvectors associated with unit eigenvalues span the rowspace of F6 and are identical to some m eigenvectors of C. Which m eigenvectors of C span the filter space? To show that these are the eigenvectors corresponding to the largest eigenvalues of C, we perform a linear stability analysis around the stationary point and show that any other combination would be unstable. 6 If this fact is not familiar to the reader, we recommend Strang’s (Strang, 2009) discussion of Singular Value Decomposition. 18 3.4 Linear stability requires neural filters to span a principal subspace The strategy here is to perturb F from its equilibrium value and show that the perturbation is linearly stable only if the row space of F is the space spanned by the eigenvectors corresponding to the m highest eigenvalues of C. To prove this result, we will need two more lemmas. Lemma 3. Let H be an m × n real matrix with orthonormal rows and G is an (n − m) × n real matrix with orthonormal rows, whose rows are chosen to be orthogonal to the rows of H. Any n × m real matrix Q can be decomposed as: Q = A H + S H + B G, where A is an m × m skew-symmetric matrix, S is an m × m symmetric matrix and B is an m × (n − m) matrix. Proof. Define B := Q G> , A := 1 2  Q H> − H Q> and S := 1 2  Q H> + H Q> .  Then, A H + S H + B G = Q H> H + G> G = Q. Let’s denote an arbitrary perturbation of F as δF, where a small parameter is implied. We can use Lemma 3 to decompose δF as δF = δA F + δS F + δB G, (24) where the rows of G are orthogonal to the rows of F. Skew-symmetric δA corresponds to rotations of filters within the filter space, i.e. it keeps neural filters orthonormal. Symmetric δS keeps the filter space invariant but destroys orthonormality. δB is a perturbation that takes the neural filters outside of the filter space. 19 Next, we calculate how δF evolves under the learning rule, i.e. h∆δFi. Lemma 4. A perturbation to the stationary state has the following evolution under the learning rule to linear order in perturbation and linear order in T −1 : " X X 1 X (Im + M)−1 ik h∆δFij i = δF C − δFkl Frp Clp Frj kl lj T k hyk2 i l lpr # − X Fkl δFrp Clp Frj − lpr 1 δFij . (25) T Proof. Proof is provided in Appendix A.3. Now, we can state our main result in the following theorem: Theorem 3. The stationary state of neuronal filters F is stable, in large-T limit, only if the m dimensional filter space is spanned by the eigenvectors of the covariance matrix corresponding to the m highest eigenvectors. Proof Sketch. Full proof is given in Appendix A.4. Here we sketch the proof. To simplify our analysis, we choose a specific G in Lemma 3 without losing generality. Let v1,...,n be eigenvectors of C and v 1,...,n be corresponding eigenvalues, labeled so that the first m eigenvectors span the row space of F (or filter space). We choose rows of G to be the remaining eigenvectors, i.e. G0 := [vm+1 , . . . , vn ]. By extracting the evolution of components of δF from (25) using (24), we are ready to state the conditions under which perturbations of F are stable. Mutlipying (25) on the right by G> gives the evolution of δB: ∆δBij = X k Pikj δBkj 1 where Pikj ≡ T 20 (Im + M)−1 ik j+m v − δik 2 hyk i ! . Here we changed our notation to δBkj = δBkj to make it explicit that for each j we have one matrix equation. These equations are stable when all eigenvalues of all Pj are negative, which requires as shown in the Appendix A.4:   v 1 , . . . , v m > v m+1 , . . . , v n . This result proves that the perturbation is stable only if the filter space is identical to the space spanned by eigenvectors corresponding to the m highest eigenvalues of C. It remains to analyze the stability of δA and δS perturbations. Multiplying (25) on the right by F> gives, h∆δAij i = 0 h∆δSij i = and −2 δSij . T δA perturbation, which rotates neural filters, does not decay. This behavior is inherently related to the discussed symmetry of the strain cost function (4) with respect to left rotations of the Y matrix. Rotated y vectors are obtained from the input by rotated neural filters and hence δA perturbation does not affect the cost. On the other hand, δS destroys orthonormality and these perturbations do decay, making the orthonormal solution stable. To summarize our analysis, if the dynamics converges to a stationary state, neural filters form an orthonormal basis of the principal subspace. 4 Numerical simulations of the asynchronous network Here, we simulate the performance of the network with asynchronous updates, (10) and (12), on synthetic data. The data were generated by a colored Gaussian process 21 with an arbitrarily chosen “actual” covariance matrix. We choose the number of input channels, n = 64, and the number of output channels, m = 4. In the input data, the ratio of the power in first 4 principal components to the power in remaining 60 components was 0.54. W and M were initialized randomly, the step size of synaptic updates were initialized to 1/D0,i = 0.1. Coordinate descent step is cycled over neurons until magnitude of change in yT in one cycle is less than 10−5 times the magnitude of yT . We compared the performance of the asynchronous updates network, (10) and (12), with two previously proposed networks, APEX (Kung and Diamantaras, 1990; Kung et al., 1994) and Földiak’s (Földiak, 1989), on the same dataset, Figure 2. APEX network uses the same Hebbian/anti-Hebbian learning rules for synaptic weights, but the architecture is slightly different in that the lateral connection matrix, M, is lower triangular. Földiak’s network has the same architecture as ours, Figure 1B, and the same learning rules for feedforward connections. However, the learning rule for lateral connections is ∆Mij ∝ yi yj , unlike (12). For the sake of fairness, we applied the same adaptive step size procedure for all networks. As in (12), the stepsize for each neuron 2 i at time T was 1/DT +1,i , with DT +1,i = DT,i + yT,i . In fact, such learning rate has been recommended and argued to be optimal for the APEX network (Diamantaras and Kung, 1996; Diamantaras, 2002), see also footnote 4. To quantify the performance of these algorithms, we used three different metrics. First is the strain cost function, (4), normalized by T 2 , Figure 2A. Such normalization is chosen because the minimum value of offline strain cost is equal to the power contained in the eigenmodes beyond the top m: T 2 22 Pn k=m+1 2 v k , where {v 1 , . . . , v n } are eigenvalues of sample covariance matrix CT (Cox and Cox, 2000; Mardia et al., 1980). For each of the three networks, as expected, the strain cost rapidly drops towards its lower bound. As our network was derived from the minimization of the strain cost function, it is not surprising that the cost drops faster than in the other two. Second metric quantifies the deviation of the learned subspace from the actual prin> cipal subspace. At each T , the deviation is F> T FT − V V 2 , F where V is a m × n matrix whose rows are the principal eigenvectors, V> V is the projection matrix to the principal subspace, FT is defined the same way for APEX and Földiak networks as ours and F> T FT is the learned estimate of the projection matrix to the principal subspace. Such deviation rapidly falls for each network confirming that all three algorithms learn the principal subspace, Figure 2B. Again, our algorithm extracts the principal subspace faster than the other two networks. Third metric measures the degree of non-orthonormality among the computed neural filters. At each T : FT F> T − Im 2 . F Non-orthonormality error quickly drops for all networks, confirming that neural filters converge to orthonormal vectors, Figure 2C. Yet again, our network orthonormalizes neural filters much faster than the other two networks. 5 Subspace tracking using a neural network with local learning rules We have demonstrated that our network learns a linear subspace of streaming data generated by a stationary distribution. But what if the data are generated by an evolving 23 4 3 Ours Földiak APEX 2 1 5 0 -5 -10 0 -1 -2 0 C 10 -15 2500 T 5000 0 2500 T 5000 non-orthonormality error (dB) B 5 subspace error (dB) normalized strain error (dB) A 10 0 -10 -20 -30 -40 -50 0 2500 T 5000 Figure 2: Performance of the asynchronous neural network compared with existing algorithms. Each algorithm was applied to 40 different random data sets drawn from the same Gaussian statistics, described in text. Weight initializations were random. Solid lines indicate means and shades indicate standard deviations across 40 runs. All errors are in decibells (dB). For formal metric definitions, see text. A. Strain error as a function of data presentations. Dotted line is the best error in batch setting, calculated using eigenvalues of the actual covariance matrix. B. Subspace error as a function of data presentations. C. Non-orthonormality error as a function of data presentations. 24 distribution and we need to track the corresponding linear subspace? Using the algorithm (12) would be suboptimal because the learning rate is adjusted to effectively “remember” the contribution of all the past data points. A natural way to track an evolving subspace is to “forget” the contribution of older data points (Yang, 1995). In this Section, we derive an algorithm with “forgetting” from a principled cost function where errors in the similarity of old data points are discounted: yT = arg min yT T X T X t=1 0 > β 2T −t−t x> t xt0 − yt yt0 2 . (26) t0 =1 where β is a discounting factor 0 ≤ β ≤ 1 with β = 1 corresponding to our original algorithm (5). The effective time scale of “forgetting” is: τ := −1/ ln β. (27) By introducing a T × T -dimensional diagonal matrix βT with diagonal elements βT,ii = β T −i we can rewrite (26) in a matrix notation: yT = arg min βT> X> XβT − βT> Y> YβT yT 2 F . (28) A similar discounting was used in (Yang, 1995) to derive subspace tracking algorithms from the representation error cost function, (3). To derive an online algorithm to solve (28) we follow the same steps as before. By keeping only the terms that depend on current output yT we get: " yT = arg min yT −4x> T T −1 X ! β 2(T −t) xt yt> t=1 yT + 2yT> T −1 X ! β 2(T −t) yt yt> yT t=1  −2kxT k2 kyT k2 + kyT k4 . (29) 25 In (29), provided that past input-input and input-output outer products are not forgotten for a sufficiently long time, i.e. τ >> 1, the first two terms dominate over the last two for large T . After dropping the last two terms we arrive at: " ! ! # T −1 T −1 X X yT = arg min −4x> β 2(T −t) xt yt> yT + 2yT> β 2(T −t) yt yt> yT . (30) T yT t=1 t=1 As in the non-discounted case, minimization of the discounted online CMDS cost function by coordinate descent (30) leads to a neural network with asynchronous updates, yT,i ← n X β WT,ij xT,j j=1 − m X β MT,ij yT,j , (31) j=1 and by a Jacobi iteration - to a neural network with synchronous updates, yT ← WTβ xT − MβT yT , (32) with synaptic weight matrices in both cases given by: TP −1 β WT,ij = TP −1 β 2(T −t) yt,i xt,j t=1 TP −1 β MT,i,j6 =i = , 2 β 2(T −t) yt,i t=1 β 2(T −t) yt,i yt,j t=1 TP −1 , β MT,ii = 0. (33) 2 β 2(T −t) yt,i t=1 Finally, we rewrite (33) in a recursive form. As before, we introduce a scalar variβ representing the discounted cumulative activity of a neuron i up to time T − 1, able DT,i β DT,i = T −1 X 2 β 2(T −t−1) yt,i . (34) t=1 Then, the recursive updates are: β 2 + yT,i DTβ +1,i ← β 2 DT,i WTβ+1,ij ← β WT,ij  + yT,i xT,j − β WT,ij yT,i  /DTβ +1,i   β β MTβ+1,i,j6=i ← MT,ij + yT,i yT,j − MT,ij yT,i /DTβ +1,i . 26 (35) These updates are local and almost identical to the original updates (12) except the DTβ +1,i update, where the past cumulative activity is discounted by β 2 . For suitably chosen β, the learning rate, 1/DTβ +1,i , stays sufficiently large even at large-T , allowing the algorithm to react to changes in data statistics. As before, we have a two-phase algorithm for minimizing the discounted online CMDS cost function (30). For each data presentation, first the neural network dynamics is run using either (31) or (32) until the dynamics converges to a fixed point. In the second step, synaptic weights are updated using (35). In Figure 3, we present the results of a numerical simulation of our subspace tracking algorithm with asynchronous updates similar to that in Section 4 but for nonstationary synthetic data. The data are drawn from two different Gaussian distributions: from T = 1 to T = 2500 - with covariance C1 , and from T = 2501 to T = 5000 - with covariance C2 . We ran our algorithm with 4 different β factors, β = 0.998, 0.995, 0.99, 0.98 (τ = 499.5, 199.5, 99.5, 49.5). We evaluate the subspace tracking performance of the algorithm using a modification of the subspace error metric introduced in Section 4. From T = 1 to T = 2500 the > error is F> T FT − V1 V1 2 , F where V1 is a m × n matrix whose rows are the principal > eigenvectors of C1 . From T = 2501 to T = 5000 the error is F> T F T − V2 V2 2 , F where V2 is a m × n matrix whose rows are the principal eigenvectors of C2 . Figure 3A plots this modified subspace error. Initially, the subspace error decreases, reaching lower values with higher β. Higher β allows for smaller learning rates allowing a fine-tuning of the neural filters and hence lower error. At T = 2501, a sudden jump is observed corresponding to the change in principal subspace. The network rapidly 27 corrects its neural filters to project to the new principal subspace and the error falls to before jump values. It is interesting to note that higher β now leads to a slower decay due to extended memory in the past. We also quantify the degree of non-orthonormality of neural filters using the nonorthonormality error defined in Section 4. Initially, the non-orthonormality error decreases, reaching lower values with higher β. Again, higher β allows for smaller learning rates allowing a fine-tuning of the neural filters. At T = 2501, an increase in orthonormality error is observed as the network is adjusting its neural filters. Then, the error falls to before change values, with higher β leading to a slower decay due to extended memory in the past. 6 Discussion In this paper, we made a step towards a mathematically rigorous model of neuronal dimensionality reduction satisfying more biological constraints than was previously possible. By starting with the CMDS cost function (4), we derived a single-layer neural network of linear units using only local learning rules. Using a local stability analysis, we showed that our algorithm finds a set of orthonormal neural filters and projects the input data stream to its principal subspace. We showed that with a small modification in learning rate updates, the same algorithm performs subspace tracking. Our algorithm finds the principal subspace, but not necessarily the principal components themselves. This is not a weakness since both the representation error cost (3) and CMDS cost (4) are minimized by projections to principal subspace and finding the 28 Figure 3: Performance of the subspace tracking asynchronous neural network with nonstationary data. The algorithm with different β factors was applied to 40 different random data sets drawn from the same nonstationary statistics, described in text. Weight initializations were random. Solid lines indicate means and shades indicate standard deviations. All errors are in decibells (dB). For formal metric definitions, see text. A. Subspace error as a function of data presentations. B. Non-orthonormality error as a function of data presentations. 29 principal components is not necessary. Our network is most similar to Földiak’s network (Földiak, 1989), which learns feedforward weights by a Hebbian Oja rule and the all-to-all lateral weights by an antiHebbian rule. Yet, the functional form of the anti-Hebbian learning rule in Földiak’s network, ∆Mij ∝ yi yj , is different from ours (12) resulting in the following interesting differences: 1) Because the synaptic weight update rules in Földiak’s network are symmetric, if the weights are initialized symmetric, i.e. Mij = Mji , and learning rates are identical for lateral weights, they will stay symmetric. As mentioned above, such symmetry does not exist in our network ((12) and (20)). 2) While in Földiak’s network neural filters need not be orthonormal (Földiak, 1989; Leen, 1991), in our network they will be (Theorem 1). 3) In Földiak’s network output units are decorrelated (Földiak, 1989), since in its stationary state hyi yj i = 0. This need not be true in our network. Yet, correlations among output units do not necessarily mean that information in the output about the input is reduced7 . Our network is similar to the APEX network (Kung and Diamantaras, 1990) in the 7 As pointed before (Linsker, 1988; Plumbley, 1993, 1995; Kung, 2014), PCA maximizes mutual information between a Gaussian input, x, and an output, y = Fx, such that rows of F have unit norms. When rows of F are principal eigenvectors, outputs are principal components and are uncorrelated. However, the output can be multiplied by a rotation matrix, Q, and mutual information is unchanged, y0 = Qy = QFx. y0 is now a correlated Gaussian and QF still has rows with unit norms. Therefore, one can have correlated outputs with maximal mutual information between input and output, as long as rows of F span the principal subspace. 30 functional form of both the feedforward and the lateral weights. However the network architecture is different because the APEX network has a lower-triangular lateral connectivity matrix. Such difference in architecture leads to two interesting differences in the APEX network operation (Diamantaras and Kung, 1996): 1) The outputs converge to the principal components. 2) Lateral weights decay to zero and neural filters are the feedforward weights. In our network lateral weights do not have to decay to zero and neural filters depend on both the feedforward and lateral weights (18). In numerical simulations, we observed that our network is faster than Földiak’s and APEX networks in minimizing the strain error, finding the principal subspace and orthonormalizing neural filters. This result demonstrates the advantage of our principled approach compared to heuristic learning rules. Our choice of coordinate descent to minimize the cost function in the activity dynamics phase allowed us to circumvent problems associated with matrix inversion: y ← (Im +M)−1 Wx. Matrix inversion causes problems for neural network implementations because it is a non-local operation. In the absence of a cost function, Földiak suggested to implement matrix inversion by iterating y ← Wx − My until convergence (Földiak, 1989). We derived a similar algorithm using Jacobi iteration. However, in general, such iterative schemes are not guaranteed to converge (Hornik and Kuan, 1992). Our coordinate descent algorithm is almost always guaranteed to converge because the cost function in the activity dynamics phase (7) meets the criteria in (Luo and Tseng, 1991). Unfortunately, our treatment still suffers from the problem common to most other biologically plausible neural networks (Hornik and Kuan, 1992): a complete global 31 convergence analysis of synaptic weights is not yet available. Our stability analysis is local in the sense that it starts by assuming that the synaptic weight dynamics has reached a stationary state and then proves that perturbations around the stationary state are stable. We have not made a theoretical statement on whether this state can ever be reached or how fast such a state can be reached. Global convergence results using stochastic approximation theory are available for the single-neuron Oja rule (Oja and Karhunen, 1985), its nonlocal generalizations (Plumbley, 1995) and the APEX rule (Diamantaras and Kung, 1996), however applicability of stochastic approximation theory was questioned recently (Zufiria, 2002). Even though a neural network implementation is unknown, Warmuth & Kuzmin’s online PCA algorithm stands out as the only algorithm for which a regret bound has been proved (Warmuth and Kuzmin, 2008). An asymptotic dependence of regret on time can also be interpreted as convergence speed. This paper also contributes to MDS literature by applying CMDS method to streaming data. However, our method has limitations in that to derive neural algorithms we used the strain cost (4) of CMDS. Such cost is formulated in terms of similarities, inner products to be exact, between pairs of data vectors and allowed us to consider a streaming setting where a data vector is revealed at a time. In the most general formulation of MDS pairwise dissimilarities between data instances are given rather than data vectors themselves or similarities between them (Cox and Cox, 2000; Mardia et al., 1980). This generates two immediate problems for a generalization of our approach: 1) A mapping to the strain cost function (4) is only possible if the dissimilarites are Euclidean distances (footnote 3). In general, dissimilarities do not need be Euclidean or even metric distances (Cox and Cox, 2000; Mardia et al., 1980) and one cannot start from the strain 32 cost (4) for derivation of a neural algorithm. 2) In the streaming version of the general MDS setting, at each step, dissimilarities between the current and all past data instances are revealed, unlike our approach where the data vector itself is revealed. It is a challenging problem for future studies to find neural implementations in such generalized setting. The online CMDS cost functions (7) and (30) should be valuable for subspace learning and tracking applications where biological plausibility is not a necessity. Minimization of such cost functions could be performed much more efficiently in the absence of constraints imposed by biology8 . It remains to be seen how the algorithms presented in this paper and their generalizations compare to state-of-the-art online subspace tracking algorithms from machine learning literature (Cichocki and Amari, 2002). Finally, we believe that formulating the cost function in terms of similarities supports the possibility of representation invariant computations in neural networks. Acknowledgments We are grateful to L. Greengard, S. Seung and M. Warmuth for helpful discussions. 8 For example, matrix equation (14) could be solved by a conjugate gradient descent method instead of iterative methods. Matrices that keep input-input and output-output correlations in (14) can be calculated recursively, leading to a truly online method 33 A Appendix A.1 Alternative derivation of an asynchronous network Here, we solve the system of equations (14) iteratively (Strang, 2009). First, we split the output covariance matrix that appears on the left-hand side of (14) into its diagonal component DT , a strictly upper triangular matrix UT and a strictly lower triangular matrix LT : T −1 X yt yt> = DT + UT + LT . (36) t=1 Substituting this into (14) we get: (DT + ωLT ) yT = ((1 − ω) DT − ωUT ) yT + ω T −1 X ! yt x > xT , t (37) t=1 where ω is a parameter. We solve (14) by iterating " −1 yT ←− (DT + ωLT ) ((1 − ω) DT − ωUT ) yT + ω T −1 X ! # yt x > xT , t (38) t=1 until convergence. If symmetric TP −1 yt yt> is positive definite, the convergence is guar- t=1 anteed for 0 < ω < 2 by the Ostrowski-Reich theorem (Reich, 1949; Ostrowski, 1954). When ω = 1 the iteration (38) corresponds to the Gauss-Seidel method and when ω > 1 - to the succesive overrelaxation method. The choice of ω for fastest convergence depends on the problem, and we will not explore this question here. However, values around 1.9 are generally recommended (Strang, 2009). Because in (37) the matrix multiplying yT on the left is lower triangular and on the right is upper triangular, the iteration (38) can be performed component-by-component 34 (Strang, 2009): P yT,i ←− (1 − ω) yT,i + ω k T −1 P  yt,i xt,k t=1 TP −1 2 yt,i t=1 xT,k −ω P T −1 P j6=i t=1  yt,i yt,j yT,j TP −1 . (39) 2 yt,i t=1 Note that yT,i is replaced with its new value before moving to the next component. This algorithm can be implemented in a neural network yT,i ← (1 − ω) yT,i + ω n X WT,ij xT,j − ω j=1 m X MT,ij yT,j , (40) j=1 where WT and MT , as defined in (9), represent the synaptic weights of feedforward and lateral connections respectively. The case of ω < 1 can be implemented by a leaky integrator neuron. The ω = 1 case corresponds to our original asynchronous algorithm, except that now updates are performed in a particular order. For the ω > 1 case, which may converge faster, we do not see a biologically plausible implementation since it requires self-inhibition. Finally, to express the algorithm in a fully online form we rewrite (9) via recursive updates, resulting in (12). 35 A.2 Proof of Lemma 2 Proof of Lemma 2. In our derivation below, we use results from equations (18), (19) and (20) of the main text. X  F> FC ij = Fki Fkl hxl xj i kl = X = X Fki hyk xj i (from (18)) Fki yk2 Wkj (from (19)) Fki yk2 (Mkp + δkp ) Fpj (from (18)) Fki yp2 (Mpk + δpk ) Fpj (from (20)) Wpi yp2 Fpj (from (18)) hyp xi i Fpj (from (19)) k k = X kp = X = X kp p = X p = X Fpk hxk xi i Fpj = pk A.3 X  hxi xk i Fpk Fpj = CF> F ij . (from (18)) pk Proof of Lemma 4 Here we calculate how δF evolves under the learning rule, i.e. h∆δFi and derive equation (25). First, we introduce some new notation to simplify our expressions. We define lateral synaptic weight matrix M with diagonals set to 1 as M̂ := Im + M. 36 (41) We use ˜ to denote perturbed matrices F̃ := F + δF, W̃ := W + δW, ˆ := I + M̃ = M̂ + δM. M̃ M̃ := M + δM, (42) Note that when the network is run with these perturbed synaptic matrices, for input x, the network dynamics will settle to the fixed point ˆ −1 W̃x = F̃x, ỹ = M̃ (43) which is different from the fixed point of the stationary network, y = M̂−1 Wx = Fx. Now we can prove Lemma 4. Proof of Lemma 4. The proof goes in the following steps. 1. Since our update rules are formulated in terms of W and M, it will be helpful to express δF in terms of δW and δM. The definition of F, equation (18), gives us the desired relation: (δ M̂)F + M̂(δF) = δW. (44) 2. Next, we show that in the stationary state h∆δFi = M̂ −1  (h∆δWi − h∆δMi F) + O 1 T2  . (45) Proof. Average changes due to synaptic updates on both sides of (44) are equal: D h iE ∆ (δ M̂)F + M̂(δF) = h∆δWi. Noting that the unperturbed matrices are stationary, i.e. h∆Mi = h∆Fi = h∆Wi = 0, one gets h∆δMi F + M̂ h∆δFi = h∆δWi + O (T −2 ), from which equation (45) follows. 37 3. Next step is to calculate h∆δWi and h∆δMi using the learning rule, in terms of matrices W, M, C, F and δF and plug the result into (45). This manipulation is going to give us the evolution of δF equation, (25). First, h∆δWi : D E h∆δWij i = ∆W̃ij  1  2 hỹ x i − ỹ W̃ i j ij i T hyi2 i ! X X 1 = F̃ik hxk xj i − F̃ik F̃il hxk xl i W̃ij T hyi2 i k kl ! X X 1 F̃ik F̃il Ckl W̃ij F̃ik Ckj − = T hyi2 i kl k = = 1 T hyi2 i X Fik Ckj − k X Fik Fil Ckl Wij + X kl (from (43)) δFik Ckj k ! −2 X δFik Fil Ckl Wij − kl = 1 T hyi2 i X X Fik Fil Ckl δWij (from (42)) kl δFik Ckj − 2 k X δFik Fil Ckl Wij kl ! − X Fik Fil Ckl δWij kl 38 . (from (19)) Next we calculate h∆δMi : D E ˜ h∆δMij i = ∆M̂ij  1  1 ˜ 2 hỹ ỹ i − ỹ M̃ − δij ỹi2 (last term sets ∆M̂ ii = 0) i j ij i 2 T hyi i Di X X 1 = F̃ F̃ hx x i − F̃ik F̃il hxk xl i M̃ij ik jl k l T hyi2 i kl kl ! X −δij F̃ik F̃il hxk xl i (from (43)) = kl ! 1 = T hyi2 i X 1 T hyi2 i = F̃ik F̃jl Ckl − X kl X Fik Fjl Ckl − F̃ik F̃il Ckl M̃ij − δij X kl kl X Fik Fil Ckl Mij − δij X kl kl X + δFik Fjl Ckl + Fik Fil Ckl kl X Fik δFjl Ckl − 2 X δFik Fil Ckl Mij kl kl kl F̃ik F̃il Ckl ! − X Fik Fil Ckl δMij − 2δij kl = 1 T hyi2 i X δFik Fil Ckl (from (42)) kl X δFik Fjl Ckl + X Fik δFjl Ckl − 2 X kl kl kl δFik Fil Ckl Mij ! − X Fik Fil Ckl δMij − 2δij kl X δFik Fil Ckl . (from (20)) kl Plugging these in equation (45), we get " X M̂ −1 X X X ik h∆δFij i = δFkl Clj − 2 δFkl Fkp Clp Wkj − Fkl Fkp Clp δWkj 2 T hy i k k l lp lp − X δFkl Frp Clp Frj − lpr +2 X Fkl δFrp Clp Frj lpr X δFkl Fkp Clp Mkr Frj + lpr X # +2 X Fkl Fkp Clp δMkr Frj lpr δkr δFkl Fkp Clp Frj + O lpr  1 T2  . Mkr and δMkr terms can be eliminated using the previously derived relations (18) and (44). This leads to a cancellation of some of the terms given above, and finally 39 we have " X M̂ −1 X X ik h∆δFij i = δF C − δFkl Frp Clp Frj kl lj 2 T hy i k k l lpr # − X Fkl δFrp Clp Frj − lpr X Fkl Fkp Clp M̂kr δFrj + O lpr  1 T2  . To proceed further, we note that: yk2 = FCF>  kk , (46) which allows us to simplify the last term. Then, we get our final result: " −1 X X 1 X M̂ik h∆δFij i = δF C − δFkl Frp Clp Frj kl lj T k hyk2 i l lpr #   X 1 1 − Fkl δFrp Clp Frj − δFij + O . 2 T T lpr A.4 Proof of Theorem 3 For ease of reference, we remind that in general δF can be written as, δF = δA F + δS F + δB G. (24) Here, δA is an m × m skew symmetric matrix, δS is an m × m symmetric matrix and δB is an m × (n − m) matrix. G is an (n − m) × n matrix with orthonormal rows. These rows are chosen to be orthogonal to the rows of F. Let v1,...,n be the eigenvectors C and v 1,...,n be the corresponding eigenvalues. We label them such that F spans the same space as the space spanned by the first m eigenvectors. We choose rows of G to be the remaining eigenvectors, i.e. G> := [vm+1 , . . . , vn ]. Then, for future reference, FG> = 0, GG> = I(n−m) , and X k 40 Cik G> kj = X k Cik vkj+m = v j+m G> ij . (47) We also remind the definition: M̂ := Im + M. (41) Proof of Theorem 3. Below, we discuss the conditions under which perturbations of F are stable. We work to linear order in T −1 as stated in Theorem 3. We treat separately the evolution of δA, δS and δB under a general perturbation δF . 1. Stability of δB 1.1 Evolution of δB is given by: 1X h∆δBij i = T k −1 M̂ik v j+m − δik hyk2 i ! δBkj . (48) Proof. Starting from (24) and using (47): h∆δBij i = X h∆δFik i G> kj k = −1 X 1 X M̂ik 1 δFkl Clp Gjp − δBij . 2 T k hyk i lp T Here the last line results from equation (47) applied to (25). Let’s look at the first term again using (47) and then (24), −1 X −1 X 1 X M̂ik 1 X M̂ik δF C G = δFkl v j+m Gjl kl lp jp T k hyk2 i lp T k hyk2 i l = −1 1 X M̂ik v j+m δBkj . T k hyk2 i Combining these give (48). 1.2 When is (48) stable? Next, we show that stability requires   v 1 , . . . , v m > v m+1 , . . . , v n . 41 For ease of manipulation, we express (48) as a matrix equation for each column of δB. For convenience we change our notation to δBkj = δBkj ∆δBij = X Pikj δBkj k where Pikj ≡  1 Oik v j+m − δik , T and Oik ≡ −1 M̂ik . hyk2 i We have one matrix equation for each j. These equations are stable if all eigenvalues of all Pj are negative. {eig(P)} < 0 1 , vj =⇒ {eig(O)} < =⇒ {eig(O−1 )} > vj , j = m + 1, . . . , n. j = m + 1, . . . , n. 1.3 If one could calculate eigenvalues of O−1 , the stability condition can be articulated. We start this calculation by noting that X Oik hyk yj i = k X k = X −1 M̂ik hyk yj i hyk2 i −1 M̂ik M̂kj = δij (from (20)). (49) k Therefore, O−1 = yy> = FCF> . Then, we need to calculate the eigenvalues of FCF> . They are:  eig(O−1 ) = v 1 , . . . , v m . Proof. We start with the eigenvalue equation. FCF> λ = λλ 42 (50) Multiply both sides by F> :  F> FCF> λ = λ F> λ . Next, we use the commutation of F> F and C, (23), and the orthogonality of neural filters, FF> = Im , (22) to simplify the left hand side:  F> FCF> λ = CF> FF> λ = C F> λ . This implies that   C F> λ = λ F> λ . (51) Note that by orthogonality of neural filters, the following is also true:   F> F F> λ = F> λ . (52)  All the relations above would hold true if λ = 0 and F> λ = 0, but this  would require F F> λ = λ = 0, which is a contradiction. Then, (51) and  (52) imply that F> λ is a shared eigenvector between C and F> F. F> F and C was shown to commute before and they share a complete set of eigenvectors. However, some n − m eigenvectors of C have zero eigenvalues in F> F. We had labeled shared eigenvectors with unit eigenvalue in F> F to be v1 , . . . , vm .  The eigenvalue of F> λ with respect to F> F is 1, therefore F> λ is one of v1 , . . . , vm . This proves that λ = {v 1 , . . . , v m } and  eig(O−1 ) = v 1 , . . . , v m . 43 1.4 From (50), it follows that for stability   v 1 , . . . , v m > v m+1 , . . . , v n 2. Stability of δA and δS Next, we check stabilities of δA and δS. h∆δAij i + h∆δSij i = X T h∆δFik i Fkj (from definition (24)) k =− −1 X 1 1 X M̂ik Fkl δFjm Clm − (δAij + δSij ) 2 T k hyk i lm T =− −1 X   1 X M̂ik FCFT kl δATlj + δSljT − (δAij + δSij ) . 2 T k hyk i l (53) In deriving the last line, we used equations (24) and (47). The k summation was calculated before (49). Plugging this in (53), one gets h∆δAij i + h∆δSij i = −  −2 1 δSij δAij + δATij + δSij + δSij = T T =⇒ h∆δAij i = 0 =⇒ h∆δSij i = (from skew symmetry of A) −2 δSij . T δA perturbation, which rotates neural filters to other orthonormal basis within the principal subspace, does not decay. On the other hand, δS destroys orthonormality and these perturbations do decay, making the orthonormal solution stable. Collectively, the results above prove Theorem 3. 44 A.5 Perturbation of the stationary state due to data presentation Our discussion of the linear stability of the stationary point assumed general perturbations. Perturbations that arise from data presentation, δF = ∆F, (54) form a restricted class of the most general case, and have special consequences. Focusing on this case, we show that data presentations do not rotate the basis for extracted subspace in the stationary state. We calculate perturbations within the extracted subspace. Using (24) and (47) δA + δS = δF F> = ∆F F> from (54)   = M̂−1 ∆W − ∆M̂ F F> expand (18) to first order in ∆   = M̂−1 ∆W F> − ∆M̂ from (22). (55) Let’s look at ∆W F> term more closely: ∆W F>  ij = X  > ηi yi xk − yi2 Wik Fkj k ! = ηi yi X Fjk xk − yi2 k  X > Wik Fkj k = ηi yi yk − yi2 M̂ij  = ∆M̂ij . Plugging this back into (55) gives, δA + δS = 0, =⇒ δA = 0, 45 & δS = 0, (56) Therefore, perturbations that arise from data presentation do not rotate neural filter basis within the extracted subspace. This property should increase the stability of the neural filter basis within the extracted subspace. References Arora, R., Cotter, A., Livescu, K., and Srebro, N. (2012). Stochastic optimization for pca and pls. Proceedings of the Allerton Conference on Communication, Control, and Computing, pages 861–868. IEEE. Balzano, L. K. (2012) Handling missing data in high-dimensional subspace modeling (Doctoral dissertation, UNIVERSITY OF WISCONSIN–MADISON) Becker, S. and Plumbley, M. (1996). Unsupervised neural network learning procedures for feature extraction and classification. Appl Intell, 6(3):185–203. Carroll, J. and Chang, J. (1972). Idioscal (individual differences in orientation scaling): A generalization of indscal allowing idiosyncratic reference systems as well as an analytic approximation to indscal. In Psychometric meeting, Princeton, NJ. Cichocki, A. and Amari, S.-I. (2002). Adaptive blind signal and image processing. John Wiley Chichester. Cox, T. and Cox, M. (2000). Multidimensional scaling. CRC Press. Crammer, K. (2006). Online tracking of linear subspaces. In Learning Theory, pages 438–452. Springer. 46 Diamantaras, K. (2002). Neural networks and principal component analysis. Diamantaras, K. and Kung, S. (1996). Principal component neural networks: theory and applications. John Wiley & Sons, Inc. Földiak, P. (1989). Adaptive network for optimal linear feature extraction. In International Joint Conference on Neural Networks, pages 401–405. IEEE. Goes, J., Zhang, T., Arora, R., and Lerman, G. (2014). Robust stochastic principal component analysis. Proceedings of the Seventeenth International Conference on Artificial Intelligence and Statistics (AISTAT), pages 266–274. Hornik, K. and Kuan, C.-M. (1992). Convergence analysis of local feature extraction algorithms. Neural Networks, 5(2):229–240. Hu, T., Towfic, Z., Pehlevan, C., Genkin, A., and Chklovskii, D. (2013). A neuron as a signal processing device. Proceedings of the Asilomar Conference on Signals, Systems and Computers, pages 362–366. IEEE. Hubel, D. H. (1995). Eye, brain, and vision. Scientific American Library/Scientific American Books. Hyvärinen, A., Hurri, J., and Hoyer, P. O. (2009). Natural Image Statistics: A Probabilistic Approach to Early Computational Vision., volume 39. Springer. Karhunen, J. and Oja, E. (1982). New methods for stochastic approximation of truncated karhunen-loeve expansions. In Proc. 6th Int. Conf. on Pattern Recognition, pages 550–553. 47 Kung, S. and Diamantaras, K. (1990). A neural network learning algorithm for adaptive principal component extraction (apex). Proceedings of ICASSP, pages 861–864. IEEE. Kung, S.-Y., Diamantaras, K., and Taur, J.-S. (1994). Adaptive principal component extraction (apex) and applications. IEEE T Signal Proces, 42(5):1202–1217. Kung, S.-Y. (2014). Kernel Methods and Machine Learning. Cambridge University Press. Kushner H.J. and Clark D.S. (1978). Stochastic approximation methods for constrained and unconstrained systems. Springer. Leen, T. K. (1990). Dynamics of learning in recurrent feature-discovery networks. Advances in Neural Information Processing Systems 3, pages 70–76 Leen, T. K. (1991). Dynamics of learning in linear feature-discovery networks. Network, 2(1):85–105. Linsker, R. (1988). Self-organization in a perceptual network. IEEE Computer, 21(3):105–117. Luo, Z. Q., and Tseng, P. (1991). On the convergence of a matrix splitting algorithm for the symmetric monotone linear complementarity problem. SIAM J Control Optim, 29(5):1037-1060. Mardia, K., Kent, J., and Bibby, J. (1980). Multivariate analysis. Academic press. Oja, E. (1982). Simplified neuron model as a principal component analyzer. J Math Biol, 15(3):267–273. 48 Oja, E. (1992). Principal components, minor components, and linear neural networks. Neural Networks, 5(6):927–935. Oja, E. and Karhunen, J. (1985). On stochastic approximation of the eigenvectors and eigenvalues of the expectation of a random matrix. J Math Anal Appl, 106(1):69–84. Ostrowksi A.M. (1954). On the linear iteration procedures for symmetric matrices. Rend Mat Appl, 14:140–163. Pearson, K. (1901). On lines and planes of closest fit to systems of points in space. Philos Mag, 2:559-572. Plumbley, M. D. (1993). A Hebbian/anti-Hebbian network which optimizes information capacity by orthonormalizing the principal subspace. Proceedings of ICANN, pages 86–90. IEEE. Plumbley, M. D. (1995). Lyapunov functions for convergence of principal component algorithms. Neural Networks , 8(1):11-23. Preisendorfer, R. and Mobley, C. (1988). Principal component analysis in meteorology and oceanography, volume 17. Elsevier Science Ltd. Reich E. (1949). On the convergence of the classical iterative procedures for symmetric matrices. Ann Math Statistics, 20:448–451. Rubner, J. and Schulten, K. (1990). Development of feature detectors by self- organization. Biol Cybern, 62(3):193–199. Rubner, J. and Tavan, P. (1989). A self-organizing network for principal-component analysis. EPL, 10(7):693. 49 Sanger, T. (1989). Optimal unsupervised learning in a single-layer linear feedforward neural network. Neural networks, 2(6):459–473. Shepherd, G. (2003). The synaptic organization of the brain. Oxford University Press. Strang, G. (2009). Introduction to linear algebra. Wellesley-Cambridge Press Torgerson, W. (1952). Multidimensional scaling: I. theory and method. Psychometrika, 17(4):401–419. Warmuth, M. and Kuzmin, D. (2008). Randomized online pca algorithms with regret bounds that are logarithmic in the dimension. J Mach Learn Res, 9(10). Williams, C. (2001). On a connection between kernel pca and metric multidimensional scaling. Advances in Neural Information Processing Systems 13, pages 675–681. MIT Press. Yang, B. (1995). Projection approximation subspace tracking. IEEE T Signal Proces, 43(1):95–107. Young, G. and Householder, A. (1938). Discussion of a set of points in terms of their mutual distances. Psychometrika, 3(1):19–22. Zufiria, P.J. (2002). On the discrete-time dynamics of the basic Hebbian neural network node.. IEEE Trans Neural Netw, 13(6):1342–1352. 50
9cs.NE
The 15th IEEE International Conference on Smart City (SmartCity 2017), Bangkok, Thailand, December 18-20, 2017 Role of Deep LSTM Neural Networks And Wi-Fi Networks in Support of Occupancy Prediction in Smart Buildings Basheer Qolomany1, Ala Al-Fuqaha1, Driss Benhaddou2, Ajay Gupta1 1 Computer Science Dept., College of Engineering and Applied Sciences, Western Michigan University, Kalamazoo, Michigan, USA {basheer.qolomany, ala.al-fuqaha, ajay.gupta}@wmich.edu 2 Engineering Technology Dept., College of Technology, University of Houston, Houston, Texas, USA [email protected] sensors, microwave sensors, smart cameras, break beam sensors and laser range-finders [3]. However, these sensors extend across a wide range of cost and performance. The ability to determine the actual number of occupants in a place is often beyond the range of current common sensing techniques. Low-cost sensors, like PIR and ultrasonic ranging sensors are typically error-prone and usually only detect binary occupancy values rather than estimating load. Expensive sensors tend to require the complicated site-specific installation and standardization methods [2]. Motion detectors have inherent limitations when occupants remain relatively still [4]. Furthermore, distant passersby and wafts of warm or cold air are interpreted as motion leading to false positives [5]. Video cameras raise privacy concerns and require large amounts of data storage and complex video processing [6]. Other work has focused on the use of carbon dioxide (CO2) sensors in conjunction with building models for estimating the number of people generating the measured CO2 level [7]. Smart buildings have a high degree, if not full, Wi-Fi coverage and thus this paper explores the use of Wi-Fi as sensory data to predict occupancy using Wi-Fi beacon time series. In particular, we use the data to predict the number of occupants in building using Long-Short Term Memory (LSTM) deep learning networks. Abstract— Knowing how many people occupy a building, and where they are located, is a key component of smart building services. Commercial, industrial and residential buildings often incorporate systems used to determine occupancy. However, relatively simple sensor technology and control algorithms limit the effectiveness of smart building services. In this paper we propose to replace sensor technology with time series models that can predict the number of occupants at a given location and time. We use Wi-Fi datasets readily available in abundance for smart building services and train Auto Regression Integrating Moving Average (ARIMA) models and Long Short-Term Memory (LSTM) time series models. As a use case scenario of smart building services, these models allow forecasting of the number of people at a given time and location in 15, 30 and 60 minutes time intervals at building as well as Access Point (AP) level. For LSTM, we build our models in two ways: a separate model for every time scale, and a combined model for the three time scales. Our experiments show that LSTM combined model reduced the computational resources with respect to the number of neurons by 74.48 % for the AP level, and by 67.13 % for the building level. Further, the root mean square error (RMSE) was reduced by 88.2% - 93.4% for LSTM in comparison to ARIMA for the building levels models and by 80.9 % - 87% for the AP level models. Keywords - Time series, Machine Learning, ARIMA, LSTM, Smart Buildings, Smart Homes, IoT services, Wi-Fi networks. Recently, time series methods have been successfully applied in a wide range of IoT application that have a time dimension such as energy usage prediction, non-intrusive activity detection, demand side management and control [8]. One of the main purposes of time series data is that past observations of the data can be used to forecast future values. The use of observations from a time series available at time 𝑡 to predict its value at time 𝑡 + 𝑙 is called forecasting. In this paper we develop and compare two time series models, Auto Regression Integrating Moving Average (ARIMA) model and Long Short-Term Memory (LSTM) deep recurrent neural network to forecast the number of occupants in a smart building at a specific time under three time scales, namely, 15, 30 and 60 minutes. We focus on the following three questions:  How to predict the number of occupants using Wi-Fi beacons?  Which model yields better accuracy, ARIMA or LSTM? I. INTRODUCTION Being able to accurately count the number of occupants in a smart building has high utility for a number of applications. Information on building occupancy can be used to save energy by controlling temperature and ventilation more accurately. Number of users in the environment is important to accurately recognize the activities of (groups of) agents [1]. In the event of an emergency, first responders often need to know if people are trapped and where they might be located in large buildings. In the context of large facilities like conference centers or in the retail space, knowing how many people are in certain locations and how long they dwell can be used to value shelf-space or storefront locations [2]. Commercial, industrial and residential buildings often incorporate many approaches to determine occupancy including: passive infra-red (PIR) sensors, ultrasonic ranging 1 The 15th IEEE International Conference on Smart City (SmartCity 2017), Bangkok, Thailand, December 18-20, 2017   In this paper we use ARIMA and LSTM time series algorithms to predict the number of occupants in a smart building using Wi-Fi network data. To the best of our knowledge, this work is the first attempt that addresses the role of time series methods to forecast the number of occupants in the smart building. One of the main advantages of this technique is that it does not require an additional infrastructure to be able to count the number of people in a building. For LSTM models, which is better -- to build a separate model for a specific time scale or to build a combined model for the three time scales with respect to computational performance and accuracy? For ARIMA and LSTM models, which way is better -- to build one model for the entire building for a specific time scale or to build one model for every AP (Access Point) in the building for a specific time scale? III. MODELS This is the first paper exploring the use of Wi-Fi beacons to predict the number of occupants in a commercial building, to the best of our knowledge. The advantage of using Wi-Fi is that there is no need to deploy an infrastructure to count the number of occupants in a building which reduces the cost and the complexity of the system. Another contribution of this paper is, answering the above questions which are crucial for improving the state-of-the-art in time series forecasting. Time series data is any data that has a timestamp, such as IoT device data, stocks, and commodity prices. Different time series prediction models exist that work on different patterns. In this paper our focus is on an autoregressive integrated moving average (ARIMA) model as this is one of the most widely used statistical models for time series forecasting and thus has a strong potential for occupancy prediction using WiFi time-series data. Deep recurrent neural networks have recently gained a lot of attention in exhibiting good prediction capabilities. Therefore, we also focus on the Long Short-Term Memory (LSTM) model of deep recurrent neural networks. The remainder of this paper is organized as follows: Section II presents the most recent related work. In Section III, we discuss ARIMA and LSTM models. Section IV presents our experimental results and the lessons learned, and finally, Section V concludes the paper. 3.1 ARIMA time series model ARIMA is one of the most common univariate time series models, it is also well-known as Box-Jenkins methodology in the model selection procedure, and the popularity of this model is due to its statistical properties [14]. The AutoRegressive (AR) part of ARIMA indicates that the variable of interest is regressed on its lagged values. The Moving Averages (MA) part indicates that the regression error is actually a linear compound of error terms whose values occurred simultaneously and at various times in the past. The Integrated (I) indicates that the data values have been replaced with the difference between their values and the previous values [15] [16]. II. RELATED WORK A significant amount of work has been done in the past two decades to enable accurate and robust occupants counting. In brief, Krumm and Brush [9] presented an occupancy prediction algorithm that gives probabilities of occupancy at different times of day. However, this algorithm computes a representative Sunday, Monday, etc. for each day of the week, without being able to respond to changing occupancy patterns as PreHeat [11] does. Lu et al. [10] formulate a hidden Markov model (HMM) to predict occupancy and control HVAC systems. They collected occupancy data in eight US households for one to two weeks. Using leave-one-out crossvalidation to train and test the HMM, they evaluate their approach’s MissTime (i.e., total occupied time not at set point) and energy savings for each day in a week using the US Dept. of Energy’s EnergyPlus simulator. Mozer et al. [11] describe a “Neurothermostat” which utilizes a hybrid occupancy predictor, making use of an available daily schedule and a neural network which was trained on five consecutive months of occupancy data. Mozer et al. show that the Neurothermostat results in a lower unified cost, where energy and occupant “comfort” are expressed. Recently, some studies focused on counting pedestrians with binary sensors and Monte-Carlo methods [12] but those are once again hardly usable in homes as they make use of an important number of landmarks such as doors, stairs and elevators, that may not be present in regular homes. Yang et al. [13] propose image-based counting technique that uses a network of simple image sensors. They introduce a geometric algorithm that computes bounds on the number and possible locations of people using silhouettes computed by each sensor through background subtraction. An AutoRegressive of order p, AR(p), component of an ARIMA model is a discrete time linear equations with noise. It can be written in the form: 𝑝 𝑋𝑡 = ∑𝑖=1 𝛼𝑖 𝑋𝑖−1 + 𝑍𝑡 (1) Where the terms in α are autocorrelation coefficients at lags 1,2...p and zt is a residual error term. Note that this error term specifically relates to the current time period t. A Moving Average with order q, MA(q), model can be used to provide a good fit to some datasets. A simple form of such models, based on prior data, can be written as: 𝑞 𝑋𝑡 = ∑𝑖=0 𝛽𝑖 𝑍𝑖−1 (2) Where the βi terms are the weights applied to prior values in the time series, and it is usual to define βi=1, without loss in generality. 2 The 15th IEEE International Conference on Smart City (SmartCity 2017), Bangkok, Thailand, December 18-20, 2017 An AutoRegressive Moving Average with orders p and q, ARMA(p, q), is the one where these two models are combined by simply adding them together as a model of order (p,q), where we have p AR terms and q MA terms. An ARMA discrete time linear equation with noise has the following form: 𝑝 𝑞 Xt = 𝛼0 + ∑𝑖=1 𝛼𝑖 𝑋𝑖−1 + ∑𝑖=0 𝛽𝑖 𝑍𝑡−𝑖 argued that deep layers in LSTM allow the network to learn at different time scales over the input. With the deep LSTM, the input to the network at a given time step goes through multiple LSTM layers in addition to propagation through time and LSTM layers [21]. Figure 1 shows the architecture for one module in an LSTM network. The network takes three inputs. Xt is the input of the current time step. ht-1 is the output from the previous LSTM unit and Ct-1 is the “memory” of the previous unit. As for outputs, ht is the output of the current network. Ct is the memory of the current unit. While the internals of the module are as follows: ft = σ(Wxfxt +Whfht−1 +Wcf ct−1 + bf ) (4) it = σ(Wxixt +Whiht−1 +Wcict−1 + bi) (5) ct = ftct−1 + ittanh(Wxcxt +Whcht−1 + bc) (6) ot = σ(Wxoxt +Whoht−1 +Wcoct + bo) (7) ht = ottanh(ct) (8) (3) where X, is a stationary stochastic process with non-zero mean, α0 is constant term, and Zt, is a white noise disturbance term. A time series is said to be stationary, if the mean of the series and the covariance among its observations do not change over time and do not follow any trend [17]. The ARIMA model which generally overcomes the limitation of non-stationary time series by introducing a differencing process of subtracting the observation in the current period from the previous one. This process effectively transforms the non-stationary data into a stationary one [18]. Hence, the ARIMA model is called “Integrated” ARMA because of the stationary model that is fitted to the differenced data that has to be summed or integrated in order to provide a model for the original non stationary data. Eq. 3 denotes by notation ARIMA (p,d,q) where p is the order of the autoregressive part, which is the number of dependent variable lagged in the right hand side, d is the order of differencing performed on X, before estimating the above model, and q is the order of the moving-average process, which is the lagged error term in the right hand side of Eq. 3. The AR part of the model indicates that the future values of Xt are weighted averages of current and past realizations. Similarly, the MA part of the model shows how current and past random shocks will affect the future values of Xt. The more general ARIMA process model can be written as an AR if the MA process is invertible. One of the best ways to make a series stationary on variance is through transforming the original series through log transform. σ is the logistic sigmoid function, and f, i, c and o are respectively the forget gate, input gate, cell state and output gate. Wcf, Wci, and Wco are denoted weight matrices for peephole connections. bf, bi, bc, and bo are respectively the bias vectors for forget, input, cell state and out gates. Fig. 1: LSTM Module. 3.2 Deep LSTM Model In LSTM, three gates (f, i, o) control the information flow. The forget gate determines whether to pass the previous memory ht−1. The ratio of the previous memory is calculated in equation (4) and used for equation (6). The input gate decides the ratio of input. When calculating the cell state, this ratio has an effect on equation (6). The output gate determines whether to pass the output of memory cell or not [22]. Equation (8) captures this process. The Long Short-Term Memory network, or LSTM network, is a special kind of recurrent neural network (RNN) developed in 1997 by Hochreiter & Schmidhuber [19]. LSTM is trained using Back propagation Through Time (BPTT) and overcomes the vanishing and exploding gradient problem in standard RNN by learning tasks involving long term dependencies. Instead of neurons, LSTM networks have memory blocks that are comprised of memory cell units that are able to remember the value of a state for an arbitrary long time, as well as three different gate units that can learn to keep, utilize, or destroy a state when appropriate. The memory blocks are connected through layers [20]. We can make a deep LSTM by stacking multiple LSTM layers. Although LSTM networks are already deep architectures in the sense that they can be considered as a feed-forward neural network unrolled in time where each layer shares the same model parameters. But the deep LSTM has an additional meaning; it has been While building an LSTM model, one of the difficulties is tuning the numerous parameters when it comes to train the model because there is no good theory on how to do it. One way to tune the parameters is by applying grid search. Or use a systematic method to explore different configurations for the network. Qolomany et al. [23] proposed a systematic way to tune the deep neural network parameters using particle swarm optimization. Since our goal in this paper is to asses efficacy of LSTM and compare it to ARIMA, we simply use grid search to tune the number of hidden layers, number of neurons 3 The 15th IEEE International Conference on Smart City (SmartCity 2017), Bangkok, Thailand, December 18-20, 2017 In our experiments we used 6 weeks (January 15, 2016 – Feb 29, 2016) of Wi-Fi dataset for a building that has 18 AP from the University of Houston campus. We preprocessed the raw dataset as time series format for a use case scenario of services for smart buildings environment. We predict the number of occupants at a given time and location. All our experiments are conducted using ARIMA time series packages in R and Keras package under Theano platform in Python. We run our experiment on a server that has 24 cores of 2.40GHz Intel(R) Xeon(R) CPU and 32 GB memory. in a layer, batch size, number of epochs, and lag size parameters that play the major role in building a time series model using LSTM algorithm. In the experimental results section we discuss more on the role of each parameter to decrease error while building the model. The computational complexity in terms of the total number of neurons needed to build an LSTM model for a time scale is 𝑇𝑠 = 𝑁. 𝐻 + 𝐼 + 1 (9) Where 𝑇𝑠 is the total number of neurons needed to build a separate model with single output, 𝑁 is the number of neurons in each layer, 𝐻 is the number of hidden layers, and 𝐼 is the number of inputs features represented here as the lag size. While the number of neurons needed to build a single combined model for the three time scales can be calculated as 𝑇𝑐 = 𝑁. 𝐻 + 𝑚. 𝐼 + 𝑚 4.2 Data pre-processing and preparation The LSTM and ARIMA algorithms like most of other machine learning algorithms require preparing and preprocessing the raw data into a specific form in order to get the best results. First, we prepared the raw Wi-Fi dataset as a time series format for every time scale (e.g. 60, 30 and 15 minutes), such that the dataset has time with the corresponding number of occupants at that period of time. Then before feeding the data to the model, we transform the time series format into a supervised learning format by dividing it into input and output components. For time series we can achieve this by using the observation from the last time step (t-1) as the input and the observation at the current time step (t) as the output. Because the Wi-Fi dataset that we have is not stationary, the next step of preparing the dataset is to make it stationary by removing trends in the non-stationary data. We transform the time series data into stationary time series data by differencing the data. That is the observation from the previous time step (t-1) is subtracted from the current observation (t). The last step for preparing the time series data is to scale the data. We make the scaling for LSTM different than ARIMA models. The LSTM models like other neural networks expect data to be within the scale of the activation function used by the network. The default activation function for LSTM is the hyperbolic tangent (tanh), which outputs values between -1 and 1. So we scaled the time series data for LSTM into the range -1 and 1. While in the case of ARIMA models we use common logs transform for scaling, due to the popularity of log-returns it is easy to aggregate the log-returns over time. (10) Where 𝑇𝑐 is the total number of neurons needed to build a single combined model with multiple output, 𝑁 is the number of neurons in each layer, 𝐻 is the number of hidden layers, m is the number of different models, which is three in our case, each model represents a specific time scale (15, 30 and 60 minutes time scales), and 𝐼 is the number of inputs features represented here as the lag size. 3.3 Forecast evaluation methods The criterion that we use to make comparisons between the forecasting ability of the ARIMA time series models and LSTM models is the root mean square error (RMSE), a standard statistical metric to measure model performance. RMSE represents the sample standard deviation of the differences between predicted values and observed values. These individual differences are called residuals when the calculations are performed over the data sample that was used for estimation [24]. The formula for RMSE is 2 1 𝑅𝑀𝑆𝐸 = √ ∑(𝑃𝑡 − 𝐴𝑡 )2 𝑁 (11) Where Pt is the predicted value for time t, At, is the actual value at time t, and N is the number of predictions. IV. EXPERIMENTAL SETUP 4.3 Experimental Results 4.1 Dataset In our experiments we build and compare two time series models ARIMA and LSTM to forecast the number of occupants in the smart building at a specific time using three time scales, namely 15, 30 and 60 minutes duration. We build models for the whole building as well as for an individual AP level. In the case of LSTM, we further build our models in two ways, building a separate model for every time scale and building a single combined model for all the three time scales. Combined model is built as many to many architecture of LSTM, such that we feed the network with the inputs of every time scale but all the three models share the same hidden layers, and the outputs of this combined model are three outputs, each representing the output of a specific time scale The data set is collected from the Wi-Fi network at the University of Houston main campus. The campus has full WiFi coverage with Access Points (AP) managed through controllers that manage hand off allowing users to move around without losing the connection. Whenever a user carrying a Wi-Fi enabled device is passing by the network, the device is automatically exchanging beacons with the Wi-Fi network regardless whether the user is actively using the device. The Wi-Fi network captures these beacons and archive them in a storage device for further analysis. The data collected includes, connection time, connection duration, MAC address, access point ID. 4 The 15th IEEE International Conference on Smart City (SmartCity 2017), Bangkok, Thailand, December 18-20, 2017 model. As a clarification for the shortcomings of the labels in Figures 2-7, Com: combined model, Sep: separate model, AP: the models that are on the Access Point level, and Bld: the models that are on the Building-level. For example, LSTMCom15Bld refers to the LSTM combined model for the 15 time scale duration on the Building-level; LSTMSep30AP refers to the LSTM separate model for the 30 time scale duration on the AP-level; and ARIMA60Bld refers to the ARIMA model for the 30 time scale duration on the AP-le Building-level. 93.4 % in case of building level models, and by 80.9 % - 87 % in case of AP level models when compared to ARIMA models. LSTM seems to outperform ARIMA. Figures 5-7 show the effect of the parameters (number of lags, number of neurons in a layer, and number of hidden layers) on reducing the RMSE in case of LSTM models in (a) building level models and (b) AP level models. In every case we fix two parameters and set their values (to the ones that we found are the best in terms of reducing the RMSE using grid search) and start changing the third parameter. For instance, in Figure 5, we are fixing the number of neurons in a layer, and the number of hidden layers to the best corresponding model values that is listed in the Table I, and start changing the number of lags. It can be easily seen from Figures 5-7 that the RMSE values in case of building level models are always greater than the RMSE values for the corresponding time scale models for the AP-level prediction (as expected because of the fine grain modeling). However, as Figure 4 shows, there is a significant computational saving (of almost 94.28%) in terms of the number of neurons needed to build the models for building-level prediction instead of the AP level. Figures 2 compares separate models and combined models with respect to the reduction of the root mean square error (RMSE) and computationally in terms of the number of neurons used to build such models for the three time scales on the building level and on the AP level. We use grid search to explore the best LSTM model configurations for the number of hidden layers, number of neurons in a layer, batch size, number of epochs, and lag size parameters that play a major role in building a time series model for the LSTM algorithm. Table I shows the best configurations to build the building-level as well as the APlevel models for the three time scales in case of LSTM combined and separate individual time scales. So according to Eq. 9 the total number of neurons needed for the three separate individual time scale models for building level prediction model is (3* 48 + 24 + 1) + (3* 32 + 48 + 1) + (2* 48 + 12 + 1) = 423 neurons. And the number of neurons needed for the three separate individual time scale models in case of AP level prediction models is (3* 16 + 48 + 1) + (2* 48 + 24 + 1) + (4* 48 + 24 + 1) = 435 neurons. While according to Eq. 10 the total number of neurons needed to build a single combined model for the three time scales in case of building level prediction is 2*32 + 3*24 + 3 = 139. And the total number of neurons needed to build a single combined model for the three time scales in case of AP level prediction is 3*32 + 3*4 + 3 = 111. 4.3 Lessons learned We can conclude the following based on the results presented in this paper:  Wi-Fi is a practical way to count the number of occupants in building. This information can be utilized for emergency management as well as energy efficient applications. The main advantage of this application is that it does not require an additional infrastructure to count the number of people. One of the challenges is that those who are not carrying a device will not be counted. This could be another research project that estimate the number of occupants that are missed and make it part of the overall accuracy calculation.  As Figures 2 and 3 show LSTM models beat ARIMA models in all three time scale models. LSTM models reduced the RMSE by 88.2 % to 93.4 % on the building level models. And by 80.9 % to 87 % on the AP level when compared to ARIMA models.  Comparing LSTM separate individual time scale models with the combined model, we find that training a single combined model for different time scales is better in terms of achieving less RMSE and better use of computation resources. As it is shown in Figure 2 (b), by building a single combined model for the three time scales we reduced the number of neurons by 74.48 % in case of AP level, and by 67.13 % in case of building level occupancy prediction. And at the same time as Figure 2 (a) shows, by building a single combined model we reduced the RMSE by 17.14 % - 41.33 % in case of building level models and by 20.64 % - 40.15 % in case of AP level models, except an anomaly for the AP-level 60 minute time scale model where the RMSE is increased by 16 %. Therefore, without loss in generality, we can observe that the LSTM combined model performs better – at least from a computation resource point of view. Next, we compare combined LSTM model with the ARIMA (there is no need to compare LSTM individual time scale models because LSTM combined seems to perform better).  Figure 3 shows the comparison of LSTM models with the corresponding ARIMA models for the three time scales for both the building-level as well as the AP-level prediction models. LSTM models exhibit RMSE reduction by 88.2 % - 5 In case of LSTM and ARIMA models, the decision to build a model on the building-level vs. AP-level is application dependent. The applications that care more about localization of the occupants in the building, it is better to build the models on the AP-level, while the applications that care more about the computational resources and energy savings and less about the accuracy, The 15th IEEE International Conference on Smart City (SmartCity 2017), Bangkok, Thailand, December 18-20, 2017 (a) (b) Number of neurons to build the models RMSE Comparison Fig. 2: Comparison between separate & Combined LSTM models. Fig. 4: Total number of neurons used to build the three time scales models for the building level vs. the AP level. Fig. 3: Comparison between LSTM & ARIMA models. (a) Building level (b) AP level Fig. 5: The effect of the lag size on reducing the RMSE in LSTM models. (b) AP level (a) Building level Fig. 6: The effect of the number of neurons on reducing the RMSE in LSTM models. 6 The 15th IEEE International Conference on Smart City (SmartCity 2017), Bangkok, Thailand, December 18-20, 2017 (a) Building level (b) AP level Fig. 7: The effect of the number of hidden layers on reducing the RMSE in LSTM models. TABLE I : THE BEST CONFIGURATIONS FOR LSTM COMBINED AND SEPARATE MODELS FOR THE THREE TIME SCALES 60, 30, AND 15 MINUTES FOR THE WHOLE BUILDING AS WELL AS THE AP LEVEL. (COMBBUILDING REFERS TO BUILDING-LEVEL MODEL FOR THE LSTM COMBINED; SEP30AP REFERS TO THE ACCESS-POINT MODEL FOR THE 30 TIME SCALE DURATION, ETC.) CombBuilding Sep60Building Sep30Building Sep15Building CombAP Sep60AP Sep30AP Sep15AP Neurons 32 48 32 48 32 16 48 48 Layers 2 3 3 2 3 3 2 4 Lags 24 24 48 12 4 48 24 24 Batch size 16 16 16 16 16 16 16 16 Epochs 1000 1000 1000 1000 1000 1000 1000 1000 it is better to build the models on the building level. REFERENCES V. CONCLUSIONS [1] This study built and compared two of state-of-the art time series prediction methods in statistics and machine learning, namely LSTM and ARIMA models based on Wi-Fi networks as an infrastructure to forecast the number of occupants at a given time and location in smart building environments. Results showed that with LSTM combined strategy we are able to reduce the number of neurons needed to build the models for every time scale by 67.13% - 74.48% when compared to individual time scale models. LSTM forecasts were considerably more accurate than those of the traditional ARIMA models, our observations revealed a RMSE reduction of 80.9% - 93.4% by LSTM. Although LSTMs are able to achieve a lower RMSE, they are extremely slow to train, can take a long time to run, often require more data to train than ARIMA models, and have lots of input parameters to tune. [2] [3] [4] [5] [6] [7] [8] [9] 7 T. Labeodan, W. Zeiler, G. Boxem, and Y. Zhao, “Occupancy measurement in commercial office buildings for demand-driven control applications—A survey and detection system evaluation,” Energy and Buildings, vol. 93, pp. 303–314, Apr. 2015. O. Shih and A. Rowe, “Occupancy Estimation Using Ultrasonic Chirps,” in Proceedings of the ACM/IEEE Sixth International Conference on Cyber-Physical Systems, New York, NY, USA, 2015, pp. 149–158. J. Yun and S.-S. Lee, “Human Movement Detection and Identification Using Pyroelectric Infrared Sensors,” Sensors (Basel), vol. 14, no. 5, pp. 8057–8081, May 2014. Z. Wang and H. Aghajan, “Tracking by Detection Algorithms Using Multiple Cameras,” in Distributed Embedded Smart Cameras, C. Bobda and S. Velipasalar, Eds. New York, NY: Springer New York, 2014, pp. 175–188. E. Hailemariam, R. Goldstein, R. Attar, and A. Khan, “Real-time occupancy detection using decision trees with multiple sensor types,” in Proceedings of the 2011 Symposium on Simulation for Architecture and Urban Design, 2011, pp. 141–148. N. Khan et al., “Big Data: Survey, Technologies, Opportunities, and Challenges,” The Scientific World Journal, vol. 2014, p. e712826, 2014. H. Han, K.-J. Jang, C. Han, and J. Lee, “Occupancy estimation based on CO2 concentration using dynamic neural network model,” Proc. AIVC, vol. 13, 2013. Y. Zhou, Z. Kang, L. Zhang, and C. Spanos, “Causal analysis for nonstationary time series in sensor-rich smart buildings,” in 2013 IEEE International Conference on Automation Science and Engineering (CASE), 2013, pp. 593–598. J. Krumm and A. B. Brush, “Learning time-based presence probabilities,” in International Conference on Pervasive Computing, 2011, pp. 79–96. The 15th IEEE International Conference on Smart City (SmartCity 2017), Bangkok, Thailand, December 18-20, 2017 [10] Lu, J, Sookoor, T., Srinivasan V., Gao, G, Holben, B., Stankovic, J., Field, E., Whitehouse, K, “The smart thermostat: using occupancy sensors to save energy in homes,” in Proceedings of the 8th ACM Conference on Embedded Networked Sensor Systems, 2010, pp. 211– 224. [11] Mozer, M.C., Vidmar, L., and Dodier, R.M. “The Neurothermostat: PreHeat Optimal Control of Residential Heating Systems.” Advances in Neural Information Processing Systems 9, pp. 953-959, 1997. [12] S. Fujii, Y. Taniguchi, G. Hasegawa, and M. Matsuoka, “Pedestrian counting with grid-based binary sensors based on Monte Carlo method,” SpringerPlus, vol. 3, no. 1, p. 299, 2014. [13] D. B. Yang, H. H. Gonzalez-Banos, and L. J. Guibas, “Counting people in crowds with a real-time network of simple image sensors,” in Proceedings Ninth IEEE International Conference on Computer Vision, 2003, pp. 122–129 vol.1. [14] G. E. P. Box, G. M. Jenkins, G. C. Reinsel, and G. M. Ljung, Time Series Analysis: Forecasting and Control, 5 edition. Hoboken, New Jersey: Wiley, 2015. [15] R. Kaiser and A. Maravall, “Notes on time serie analysis, ARIMA models and signal extraction,” Banco de Espana, 2000. [16] R. Nau, “Statistical forecasting: notes on regression and time series analysis.” [Online]. Available: http://people.duke.edu/~rnau/411home.htm. [Accessed: 11-Jun-2017]. [17] G. P. Nason, “Stationary and non-stationary time series,” Statistics in Volcanology. Special Publications of IAVCEI, vol. 1, pp. 129–142, 2006. [18] K. E. Cheng, D. J. Crary, J. Ray, and C. Safta, “Structural models used in real-time biosurveillance outbreak detection and outbreak curve [19] [20] [21] [22] [23] [24] 8 isolation from noisy background morbidity levels,” J Am Med Inform Assoc, vol. 20, no. 3, pp. 435–440, 2013. S. Hochreiter and J. Schmidhuber, “Long Short-Term Memory,” Neural Comput., vol. 9, no. 8, pp. 1735–1780, Nov. 1997. N. A. Boukary, “A COMPARISON OF TIME SERIES FORECASTING LEARNING ALGORITHMS ON THE TASK OF PREDICTING EVENT TIMING,” Master of Applied Science thesis, Royal Military College of Canada, 2016. H. Sak, A. Senior, and F. Beaufays, “Long short-term memory recurrent neural network architectures for large scale acoustic modeling,” in Fifteenth Annual Conference of the International Speech Communication Association, 2014. R. Jozefowicz, W. Zaremba, and I. Sutskever, “An empirical exploration of recurrent network architectures,” in Proceedings of the 32nd International Conference on Machine Learning (ICML-15), 2015, pp. 2342–2350. B. Qolomany, M. Maabreh, A. Al-Fuqaha, A. Gupta, D. Benhaddou, “Parameters Optimization of Deep Learning Models using Particle Swarm Optimization,” The 13th International Wireless Communications and Mobile Computing Conference (IWCMC 2017), Smart Cities Symposium, Valencia, Spain, June, 2017. T. Chai and R. R. Draxler, “Root mean square error (RMSE) or mean absolute error (MAE)? ? Arguments against avoiding RMSE in the literature,” Geoscientific Model Development, vol. 7, no. 3, pp. 1247– 1250, Jun. 2014.
2cs.AI
A stochastically verifiable autonomous control architecture with reasoning arXiv:1611.03372v1 [cs.RO] 10 Nov 2016 Paolo Izzo, Hongyang Qu and Sandor M. Veres Department of Automatic Control and Systems Engineering University of Sheffield, Sheffield S1 3JD, UK {pizzo1, h.qu, s.veres}@sheffield.ac.uk November 11, 2016 Abstract A new agent architecture called Limited Instruction Set Agent (LISA) is introduced for autonomous control. The new architecture is based on previous implementations of AgentSpeak and it is structurally simpler than its predecessors with the aim of facilitating designtime and run-time verification methods. The process of abstracting the LISA system to two different types of discrete probabilistic models (DTMC and MDP) is investigated and illustrated. The LISA system provides a tool for complete modelling of the agent and the environment for probabilistic verification. The agent program can be automatically compiled into a Discrete-Time Markov Chain (DTMC) or a Markov Decision Process (MDP) model for verification with Prism. The automatically generated Prism model can be used for both designtime and run-time verification. The run-time verification is investigated and illustrated in the LISA system as an internal modelling mechanism for prediction of future outcomes. 1 Introduction Autonomous control is an area within control sciences that emerged by upgrading classical feedback control by decision making on what control references to use. The purpose of feedback control is to regulate a system in order to make it follow a predefined reference input. Autonomous controllers are designed to make decisions what reference signal to use and, more generally, what goals to achieve and how to achieve them. They do so by generating and executing plans of action that work toward goals [1, 2]. Autonomous controllers aim to introduce a certain level of “intelligence” in control systems, that is the ability of a system to act appropriately in an uncertain environment [3]. A first attempt towards autonomous decision-making software was initially made by using Object Oriented Programming (OOP). However the passive nature of objects in OOP, led to the development of active objects called “agents” [4], which implement decision-making processes. A formal description of autonomous agents can be found in [4–6]. One of the most widely used “anthropomorphic” approaches to the implementation of autonomous agents is the Belief-Desire-Intention (BDI) architecture [4,7]. BDI agent architectures are characterised by three large sets of atomic predicates: Beliefs, Desires and Intentions. The most known implementations of the BDI architecture are the Procedural Reasoning System (PRS) [8, 9] and AgentSpeak [10]. AgentSpeak fully embraces the philosophy of Agent Oriented Programming (AOP) [11], and it offers a customisable Java based interpreter. Autonomous agents have a considerable potential for implementation in all sorts of different applications. However their introduction in real-world scenarios brings along safety concerns, creating the need for model checking [12]. An early attempt to BDI agent verification can be found in [13,14], where the authors present a translation software from AgentSpeak to either Promela or Java, and then use the associated model checkers Spin [15, 16] and Java PathFinder (JPF) [17]. A subsequent effort towards verifiable agents was made by Dennis et al. [18] with a BDI agent programming language called Gwendolen, which is implemented in the Agent Infrastructure Layer (AIL) [19, 20], a collection of Java classes intended for use in model checking agent programs, particularly with JPF. An evolution of JPF is Agent Java PathFinder (AJPF) [21], specifically designed to verify agent programs. However JPF and AJPF introduce a significant bottleneck in the workflow as the internal generation of the program model, which is created by executing all possible paths, is highly computationally expensive. In [22] it is suggested to alleviate this problem by using JPF to generate models of agent programs that can be executed in other model-checkers. This idea is further developed in [23], which shows how AJPF can be modified to output models in the input languages of Spin or Prism [24], a probabilistic model checker. All of the approaches towards agent verification to date, do not provide the user with a complete framework to build and verify a probabilistic model, and mostly they do not perform at a level suitable for real-time applications. In this paper we introduce a new agent architecture called Limited Instruction Set Agent (LISA). The architecture of LISA is based on the threelayer architecture [25] and the agent program is an evolution of Jason [7,26]. The aim is to simplify the structure and the execution of the agent program in order to reduce the size of the state-space required to abstract it and ultimately allow for a fast verification process. The agent program is developed and described with sEnglish [27,28], a natural language programming interface. The use of sEnglish provides a way to define both the agent program and the environment model in an intuitive, natural-language document. The document will then be automatically translated into Prism source code for verification by probabilistic model checking. This is done by first proving that LISA can be abstracted as a DTMC or a MDP, based on design choices made by the user. We also propose the use of probabilistic model checking in Prism to improve the non-deterministic decision making capabilities of the agent in a run-time verification process. Using run-time verification the agent is able to look into the consequences of its own choices by running model checking queries through the previously generated Prism model. 2 Background 2.1 Rational Agents An agent-based system is characterised by its architecture, a description of how the agent reasoning communicates with lower abstraction subsystems and ultimately with the environment. By analogy to previous definitions [4, 5, 27], we define the agent reasoning as follows. Definition 1 (Rational agent). A rational BDI agent is defined as a tuple R = {F, B, B0 , L, A, A0 , Π} where: • F = {p1 , p2 , . . . , pnp } is the set of all predicates. • B ⊂ F is the total atomic Beliefs set. • B0 is the Initial Beliefs set. • L = {l1 , l2 , . . . lnl } is a set of logic-based implication rules on the predicates of B. • A = {a1 , a2 , . . . , ana } ⊂ F \ B is a set of all available actions. Actions can be either internal, when they modify the Beliefs set to generate internal events, or external, when they are linked to external functions. Beliefs generated by internal actions are also called ‘mental notes’. • A0 is the set of Initial Actions. • Π = {π1 , π2 , . . . , πnπ } is the set of executable plans or plans library. Each plan j is a sequence πj (λj ), with λj ∈ [0, nλj ] being the plan index, where π(0) is a logic statement called triggering condition, and πj (λj ) with λj > 0 is an action from A. During an execution the agent also uses the following dynamic subsets of the sets defined above: • B[t] ⊂ B is the Current Beliefs set, the set of all beliefs available at time t. Beliefs can be negated with a ‘~’ symbol. • E[t] ⊂ B is the Current Events set, which contains events available at time t. An event is a belief paired with either a ‘+’ or a ‘−’ operator to indicate that the belief is either added or removed. • D[t] ⊂ Π is the Applicable Plans or Desires set at time t, which contains plans triggered by current events. • I[t] ⊂ Π is the Intentions set, which contains plans that the agent is committed to execute. The triggering condition of each plan of the plan library is composed by two parts: a triggering event and a context, a logic condition to be verified for the plan to apply. We write B[t]  c when the Current Beliefs set “satisfies” the expression c, or in other words when the conditions expressed by c are true at time t. Note that in all our definitions and throughout the paper, time t ∈ N≥1 refers to the integer count of reasoning cycles. Although different AOP languages implement the agent in different ways, generally speaking an agent program is iterative. Each iteration is called reasoning cycle. The reasoning cycle of the LISA system is explained in Sec. 3. 2.2 Model checking and verification Probabilistic model checking is an automated verification method that aims to verify the correctness of probabilistic systems, by establishing if a desired property holds in a probabilistic model of the system [29]. For the purpose of this work we will consider models in particular: DTMC and MDP. Referring to [29–31] we give the following definitions: Definition 2 (Discrete-Time Markov Chain (DTMC)). A (labelled) DTMC is a tuple D = (S, s0 , P , L), where S is a countable set of states, s0 ∈ S is the initial state, P : S × S → [0, 1] is a Transition Probability Matrix such P that s0 ∈S P (s, s0 ) = 1 and L : S → ℘(F) is a labelling function that assigns to each state a set of atomic prepositions that are valid in the state. Definition 3 (Markov Decision Process (MDP)). A (labelled) MDP is a tuple M = (S, s0 , C, Step, L), where S is a countable set of states, s0 ∈ S is the initial state, C is an alphabet of choices with C(s0 ) being the set of choices available in any state s0 , Step : S × C → Dist(S) is a probabilistic transition function with Dist(S) being the set of all probability distributions over S and L : S → ℘(F) is a labelling function that assigns to each state a set of atomic prepositions that are valid in the state. Detailed explanation on the techniques used to perform model checking on probabilistic models goes beyond the scope of this paper. However we report here the syntax of the language used to write properties to verify with model checkers, which is called Probabilistic Computation Tree Logic (PCTL) [32]. Definition 4 (Syntax of PCTL). φ ::= true | a | φ ∧ φ | ¬φ | P./p [ψ] ψ ::= X φ | φ U≤k φ where a is an atomic proposition, ./∈ {≤, <, >, ≥} and p ∈ [0, 1]. We also allow the usual abbreviations such as ‘Fφ’ (equivalent to ‘trueUφ’). A commonly used extension of PCTL is the addition of quantitative versions of the P operator. For example P=? [ψ] asks: “what is the probability of ψ holding?”. In the same way we can add the operators Pmin=? [ψ] and Pmax=? [ψ] for MDP models that ask: “what is the minimum/maximum probability of ψ holding?”. PCTL formulas can be extended with reward properties [31] by the addition of the reward operator R./r [·] and the following state formulas: R./r [C≤k ] | R./r [F φ] (1) where C is the cumulative reward operator, r ∈ R, k ∈ N and φ is a PCTL state formula. 3 The Limited Instruction Set Agent The architecture of LISA, depicted in Fig. 1, is based on the three-layer architecture [25]. Each block with rounded corners is a collection of so called skills that the agent reasoning is able to execute when invoking actions. Note the hybrid nature of the system: the dotted lines represent symbolic flows of information, while the solid line represent numeric information. Abstraction Sensing Reasoning Environment Sequencing Control Figure 1: The LISA architecture The agent program is an evolution of Jason [7, 26]. Here follows a brief overview of the modification that were made to Jason. Perception. In LISA perception predicates can be of two types: sensory perception (p ∈ Bs ) and action feedbacks (p ∈ Ba ), therefore the Beliefs set is defined as: B = {Bs , Ba , Bm } (2) where Bm is the set of all possible mental notes. The action feedbacks are percepts that actions feedback to the Beliefs set of the agent in order to make the agent aware of the outcome of the action itself, i.e. success, partial success or failure. For the purpose of modelling, this classification is very important: the different nature of sensory percepts and action feedbacks needs to be modelled in a different way to accurately describe the behaviour of the environment. Messages are also handled as percepts. Goals. In Jason there is a distinction between beliefs and goals. In a practical sense this distinction does not have a great influence: beliefs and goals can both trigger plans. For this reason in LISA we drop the definition of goals, by also defining goals as beliefs. This can simplify the process of generating a model directly from the agent code, by simplifying the syntax, and it also simplifies the modelling of the belief update process, by reducing the number of states required to describe it. Logic rules. In Jason logic-based implication rules are present but yet not well implemented, to the point that the main text itself [7] advises against their use. In LISA we allow for rule to change the Beliefs set and therefore generate events. This feature potentially reduces the state space by allowing the definition of shorter plans with less actions. In Fig. 2 we describe the reasoning cycle for LISA. The first step is to update the Current Beliefs set with the Beliefs Update Function (fBU ), based on percepts, messages and mental notes, where logic rules are also applied. The Belief Review Function (fBR ) then checks what changes have been made to the Current Beliefs set and it generates the new Events set. The function fP gathers all the plans from the Plan Library that are triggered by the current events, if the plan context is applicable to the Current Beliefs set, the plan is copied to the Desires set. An external function called Plan Selection Function (FO ) selects one plan for each event and it copies it from the Desires set to the Intentions set. Finally for every cycle the function fact executes the next action for each plan. The general flow is similar to that of Jason with mainly one distinction: in every reasoning cycle the Jason agent only allows for the handling of a single event (selected with a function called Event Selection Function FE ), and then the execution of a single action from the Intentions set (selected with a function called Intention Selection Function FI ). In LISA we implement a multi-threaded work flow that allows the handling of multiple events, and then the execution of multiple actions at the same time. This implies that the Desires set becomes: D[t] = {D1 [t], . . . , Dne [t]} (3) Logic rules Current Beliefs Plan Library Events Percepts Messages fBU 1 fBR Action Feedbacks 2 fP 3 4 Desires FO Intentions π1 π2 π3 fact 5 Figure 2: The LISA reasoning cycle, rounded blocks represent internal functions, white square blocks are static sets, grey blocks are dynamic sets where each Dj [t] is the set of plans triggered by an event ej ∈ E[t] and ne = |E[t]| is the number of events. Consequently, the function FO , must be applied to every Dj [t] ⊂ D[t]. It is important to note that plans are copied into the Desires set from the Plan library, but not exclusively, which implies that different subsets of D[t] may have a copy of the same plan. However if a plan is selected multiple times in the same reasoning cycle, it will only be executed once. Furthermore once a plan is selected from the Desires set and copied to the Intentions set for execution, if the plan is selected again in the future it will not be executed a second time, but it will carry on from the current state unless a plan interruption action is issued. This multi-threaded implementation greatly simplifies the modelling process of the agent reasoning by drastically reducing the number of states required to describe it. By eliminating the need for specialised non-deterministic functions the model does not have to keep track of the events and actions activated in previous reasoning cycles therefore reducing the number of states. This also reduces the level of non-determinism in the agent reasoning, which then allows for a more precise generalisation of the abstraction process and in turn the application of an automatic modelling software that generates a complete and verifiable model directly from the agent code. 4 Abstraction to discrete finite-state machine In this section we give a detailed description of the abstraction of the LISA reasoning to two kinds of discrete state machines: DTMC and MDP (see Definitions 2 and 3). The agent defined in Definition 1 is in principle a deterministic system with well defined rules and states. In the Jason implementation however, there are three functions that introduce non-determinism in the reasoning cycle (FE , FO and FI ), which we reduce to one (FO ) with our LISA implementation. In Theorem 1 we show that the LISA system can still be modelled as a DTMC under the right conditions, and in Theorem 2 we show that the LISA system can always be modelled as a MDP. In Definition 1 we introduced the concept of plan as a sequence π = {π(0), π(1), . . . , π(nλ )}. Assuming that a plan is not allowed to be executed multiple times in parallel, let us define a set of plan indices λ[t] = {λ1 , λ2 , . . . , λnπ }, which represents the state of all plans at time t. Note that, according to this definition, a plan πj is a member of the Intentions set I[t] at time t if and only if λj > 0 at time t. From λ[t] we can define a set of all possible indices as Λ = {Λ1 , Λ2 , . . . , Λnπ }, where Λj = {1, . . . , nλj } is the set of natural numbers between 1 and the total number nλj of actions for each plan πj . Theorem 1 (LISA abstraction to DTMC). Assuming the existence of sets of (discrete) probability distributions Dist(Bs ) and Dist(Ba ), over the set of percepts and the set of action feedbacks, if ∀ i, j ∈ [1, nπ ], πi (0) 6= πj (0) the LISA can be modelled as a DTMC . Proof. A DTMC is completely characterised given a countable set of states S and a transition function P : S × S → [0, 1]. According to the definition of LISA, for a reasoning cycle to be completed the agent needs to be aware of E[t] in order to recall plans from the plan library, B[t] in order to check the plans context, and the state of the plans in I[t] in order to execute the next actions. The state of a LISA is only relevant at the end of a reasoning cycle, therefore a generic state can be expressed as s[t] = {B[t], E[t], λ[t]}. The state space, given by S = ℘(B) × ℘(B) × Λ, is therefore finite and countable. The state of the agent is initialised by s0 = {B0 , ∅, 0} and by triggering the actions listed in the initial actions set A0 . The transition function describes the way in which the state changes at every step. For each reasoning cycle, events can be generated from change in beliefs, namely mental notes, action feedbacks and percepts. Changes in mental notes are given by internal actions, which are known from the plan indices λ. Changes in action feedbacks and percept are given by known probability distributions. If ∀ i, j, πi (0) 6= πj (0), e.g. if all plans have different triggering conditions, then ∀t ∈ N≥1 , ne [ Dk [t] = |D[t]| ≤ |E[t]| (4) k=1 each event will trigger at most one plan, therefore FO becomes a trivial oneto-one mapping, therefore the system does not show any non-deterministic behaviour, hence the LISA reasoning can be modelled as a DTMC. Theorem 2 (LISA abstraction to MDP). Assuming the existence of sets of (discrete) probability distributions Dist(Bs ) and Dist(Ba ), over the set of percepts and the set of action feedbacks, the any LISA reasoning can be modelled as a MDP. Proof. A MDP is completely described given a countable set of states S and a transition function Step : S × C → Dist(S), with C(s0 ) being the set of available choices in any state s0 . The set of states can be built as shown in Theorem 1. If ∀ i, j ∈ [1, nπ ], πi (0) 6= πj (0), according to Theorem 1, the system does not show any non-determinism. However, if ∃i, j ∈ [1, nπ ] : πi (0) = πj (0), then ne [ ∃t0 ∈ N≥1 : Dk [t0 ] > E[t0 ] (5) k=1 the number of applicable plans is greater than the number of events, therefore for some event ek [t0 ] (k ∈ [1, ne ]), the application of the Plan Selection Function (FO (Dk [t0 ]) = π) involves a non-deterministic choice that implies different future probabilistic outcomes from action feedbacks, which prevents the modelling with DTMC. However this choice represents the only non-deterministic part of the agent, thus C(s0 ) = D[t0 ]. Once a choice is made by the Plan Selection Function, the transitions can be defined by changes in beliefs, given by internal actions and known probability distributions as shown in Theorem 1, and therefore the LISA modelling as a MDP is complete. Probabilistic models such as DTMCs and MDPs can be verified by means of probabilistic model checking, by using dedicated software such as Prism. Theorems 1 and 2 therefore imply that LISA can be verified, assuming that probability distributions of the percepts and action feedbacks are well defined. Theorems 1 and 2 also imply the availability of two options when designing the agent program: to design an agent with all unique triggering conditions, so to possibly improve model checking speed but requiring more effort from the designer, or design an agent with matching triggering conditions so to simplify the design but requiring more computation for the model checking. 5 Probabilistic modelling within agent programs In this section we describe the process of modelling probabilistic behaviour of the environment and the action feedbacks in the agent code. The aim is to use a unified approach that allows to obtain a complete model of the agent and its interactions with the environment from a single document. The reasoning of the agent is implemented in sEnglish [27, 28], to which we add a few features that give the programmer the option of defining the probabilistic parts of the system. Along with the probabilistic modelling we also introduce a reward structure which allows to define and use the reward properties supported by Prism. The action feedbacks are modelled within the action definition of sEnglish by defining the following three parameters: a probability value p, the average number of reasoning cycles µ in which the action feedback is expected to become true, and a variance σ. In this way we can simulate a time-delay-uncertain phenomenon without the need for real time models. For the percept process we use a similar notation with the possibility of defining probability distributions that are conditional to other beliefs. In particular the user defines: a list of percepts or mental notes to which the percept being modelled is conditioned to, probability, average number of reasoning cycles and variance of activation and deactivation. The last feature we introduce is the possibility for the programmer to describe reward structures, that then allow to use reward properties as described in Equation 1. The reward values can be declared by adding a new ‘{· · · }’ structure to any percept declaration within the Percept Process section, or to any action within any of the executable plans. By specifying all the necessary information, as described above, the designer is able to implement a complete model that includes a probabilistic description of the environment behaviour, e.g. percepts and action feedbacks. This allows to automatically generate Prism input code for verification (see Sec. 6). 6 Design-time verification The software used to perform the design-time and run-time verifications is Prism [24, 33]. The modelling approach showed in Sec. 5 gives an sEnglish program that provides enough information to generate a complete Prism model for verification. The Prism model is generated here with a dedicated Matlab script. The translator only operates on the agent program itself, and it runs in the order of the tens of milliseconds on the laptop PC we used for the testing. For this reason the performances of the translator itself will be considered to be negligible for the results presented in this paper. The automatically generated Prism model is structured as follows: a variable is defined for every belief (percept, mental note and action feedback), a variable is also defined for every plan, representing the plan index λ which captures the state of the plan at any given time. By using the synchronisation feature offered by the Prism software, the reasoning cycle is simulated in two steps: a Beliefs set update, where variables associated with beliefs are updated, and a plan index update, where variables associated to plan indexes are updated according to the beliefs. With this method we en- sure that plans only advance when the appropriate conditions on the Beliefs set are met. Note that there are no variables associated with actions as they are not part of the definition of state of the agent, as shown in Theorem 1. Note that by using the approach presented in this paper, during the verification process, the user has access to every single belief and plan. This means that the property specification can touch any part of the system, allowing the user to define arbitrarily complex properties on any aspect of the reasoning process. This can be used to drastically reduce the design errors for autonomous agents. For example, assume that an agent is implemented to have two opposite actions such as ‘go left’ and ‘go right’. Assuming that the agent is programmed to have π2 (1)=‘go left’ and π4 (2)=‘go right’, the property: Pmax=? [F (plan 2 = 1 & plan 4 = 2)] will ask the model checker to generate “the maximum probability of ‘go left’ and ‘go right’ to be executed at the same time at some point in the future”. 7 Run-time verification for improved decision-making In this section we propose two different methods for using a run-time verification process as an internal model for improving the decision-making capabilities for the LISA system. The automatically generated Prism, presented in Sec. 6, can also be used for run-time verification. Most of the computational power required to verify such a model is usually spent by the model checker when building the model itself, which does not influence the verification time. In other words, once the model is built, the user can run different verification queries without having to rebuild the model. In many cases, PRISM is able to compute the answers to those queries in a matter of seconds, even for a fairly complex model, therefore this can be a reasonable technique to use in this framework. The first method is to implement the run-time verification process as a skill of the agent, e.g. as a module of the full system.The DTMC or MDP model is verified against a set of predefined queries. In particular, in Prism, it is possible to check a query by selecting a starting state with the use of filters [33]. The run-time verification is then used to generate a set of results that will be interpreted by a ‘generate beliefs’ function that will activate or deactivate certain beliefs in the agent Beliefs set. The second method consists of implementing a Plan Selection Function that makes use of model checking to assess probability of success based on user-defined specifications, and selects the most suitable plan. A clear advantage to this approach is that, since the probabilistic model is generated automatically, the user does not need to implement a specialised function for each agent. A possible implementation for this is as follows. The function takes as input the Current Beliefs and Desires set. The model generated at design time can be initialised with the current state and then checked against predefined queries. This results in probability values that can be used as indices to select the most likely to succeed plan amongst the ones in the Desires set. Note that the two methods described here for run-time model checking, are not mutually exclusive: in case the programmer chooses to implement the LISA as a MDP, they could both be used at the same time. 8 A case study Consider an Autonomous Surface Vehicle (ASV) designed for mine detection and disposal. The ASV is equipped with sensing equipment such as sonars and cameras that allow the detection of unidentified objects in the area of interest. These sensors give the vehicle a cone shaped visibility range. Using its pose in the environment and the information from the sensing equipment, the system is able to assess, on the fly, whether or not there has been any area left unclear. All the data collected is continuously sent back to the control centre. Once the mission is started, lower level tasks, such as for example collision avoidance, are carried out automatically by dedicated subsystems. During the exploration of the area, the system tags mine-like objects and logs their positions and available information for the human operators at the control centre to analyse and deliberate. In this scenario, a mission consists of a set of points (in terms of latitude and longitude) that outlines a specific area. An algorithm generates a sequence of waypoints connected by linear tracks, the parallel distance between tracks is calculated by considering the range of the available sensing equipment. We will call the linear tracks, and the area surrounding the tracks, “blocks”. In a best case scenario the exploration plan will be carried out as it is defined. However a number of problems can occur. In case that the weather condition becomes too harsh, the agent will wait for instructions from human operators. If the agent realises that there are areas left unexplored in the last block, it will make a non-deterministic decision on whether to immediately go back to re-explore missed spots, or keep going and come back at the end of the mission. A fragment of the LISA program developed for this example is shown in Fig. 3. In Fig. 4 is shown a fragment of the Prism program that is automatically generated from the agent code. In Table 1 results are reported by running the model in Prism. All the testing was done by using an Apple laptop with a dual-core Intel Core i5-4258U 2.4GHz CPU and 16GB of memory running 64-bit Mac OS X 10.11.3. We implemented two different 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 PERCEPTION PROCESS Monitor the following booleans: //Percepts Sea state is too high. {[],[0.5,10,0]} I am at global waypoint. Areas left unexplored. Last waypoint reached. {[I am at global waypoint],[1,1,0]} ... EXECUTABLE PLANS ... //Plan 5 If ˆ[Block explored] while ˆ[Areas left unexplored] and ~ˆ[ Sea state is too high] then [Activate park mode.] [Generate set of waypoints.] +ˆ[Re_exploring areas] [Activate drive mode.]. ... //Plan 8 If ˆ[Sea state is too high] while true then [Activate park mode.] [Wait for instructions.] +ˆ[Waiting for instructions]. Figure 3: Fragment of the agent program for this case study. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 module plan_5 plan_5: [0..4] init 0; [t] plan_5=0 & !(plan_4=0 & block_explored=1 & ( areas_left_unexplored=1 & sea_state_is_too_high=0)) -> ( plan_5’=0); [t] plan_5=0 & (plan_4=0 & block_explored=1 & ( areas_left_unexplored=1 & sea_state_is_too_high=0)) -> ( plan_5’=1); //activate_park_mode [t] plan_5=1 & !(park_mode=1) -> (plan_5’=1); [t] plan_5=1 & (park_mode=1) -> (plan_5’=2); //generate_set_of_waypoints ... module wait_for_instructions continue: [0..5] init 0; abort: [0..1] init 0; //continue[0.6,5,0] abort[0.4,5,0] [p] !(plan_8=2) & (continue<=1 & abort<=1) -> (continue’=0) & (abort’=0); [p] (plan_8=2) & (continue<=1 & abort<=1) -> (continue’=5); Figure 4: Fragment of the agent program for this case study. Table 1: Verification results for the example. Both models are run with the following query: Pmin=? [F ≤ 100 mission complete = 1]. Model States Transitions Choices Build time Ver. time Memory Result MDP 270, 268 420, 431 276, 454 38.061s 1.901s 10.0 MB 0.6357 DTMC 157, 072 231, 148 N/A 38.146s 2.052s 3.5 MB 0.6389 versions of agent programs for this case study: one by defining the agent to be abstracted as a DTMC, as per Theorem 1, and one as a MDP, as per Theorem 2. Both of the models feature 10 executable plans and 3 logic rules each, 4 percepts, 4 possible actions with a total of 5 action feedbacks, with additional conditions for the DTMC version. Referring to Table 1, as expected, the MDP case generates a model that is larger than the DTMC counterpart. However even though the number of states in the MDP case is about 70% larger than the number of state for the DTMC model, the time required to build the model is very similar. This is possibly due to the way Prism handles the model building: the software constructs a MTBDD [34] structure, that is very much dependent on the logic structure of the model. Both models were then ran with a standard verification query that calculates the minimum probability of completing the mission within 100 steps. Note that for the DTMC model the probability is a single value, which is still indicated here with ‘minimum probability’. The verification time in this case is consistent with the increase in number of states from the DTMC model to the MDP model. 9 Conclusions In this article we introduced a new architecture for BDI agent programming called Limited Instruction Set Agent (LISA). The architecture builds on previous implementations of AgentSpeak but with a simpler structure, in order to facilitate automatic verification of agent reasoning. The reasoning of the agent is defined in the Natural Language Programming (NLP) language sEnglish. We proved that the LISA architecture can be abstracted as a Markovian model (DTMC or MDP), we then showed how to define a full probabilistic model that includes the agent reasoning and the environment, all defined within the agent reasoning program. From the improved agent program we can then automatically generate a full probabilistic model in Prism’s input language for verification. The model generated from the agent code is used for both design-time and run-time verification. The design-time verification can serve to im- prove and validate the agent design. The run-time verification can be used to improve the decision-making capabilities of the agent by implementing model-checking techniques as a means of simulation by the agent in order to predict future events and choose the most suitable strategy. Acknowledgment This work was supported by the EPSRC project EP/J011894/2. References [1] K. J. Aström, Autonomous Control. Berlin: Springer-Verlag, 1992, vol. Future Tendencies in Computer Science, Edts: A. Bensoussan and J.P. Verius, Vol. 653, Lecture Notes in Computer Science. [2] K. J. Aström and R. M. Murray, Feedback systems: an introduction for scientists and engineers. Princeton university press, 2010. [3] A. Meystel and J. Albus, Intelligent Systems: architecture, design and control. Wiley, 2002. [4] S. M. Veres, L. Molnar, N. K. Lincoln, and C. Morice, “Autonomous vehicle control systems - a review of decision making,” vol. 225, no. 2, pp. 155–195, 2011. [5] M. Wooldridge, An Introduction to MultiAgent Systems. Wiley, 2002. Chichester: [6] M. Wooldridge and N. R. Jennings, “Intelligent agents: theory and practice,” The Knowledge Engineering Review, vol. 10, no. 2, pp. 115– 152, 1995. [7] R. H. Bordini, J. F. Hubner, and M. Wooldridge, Programming multiagent systems in AgentSpeak using Jason. Chichester: Wiley, 2007. [8] M. P. Georgeff and A. L. Lansky, “Procedural knowledge,” Proceedings of the IEEE, vol. 74, no. 10, pp. 1383–1398, 1986. [9] ——, “Reactive reasoning and planning.” in AAAI, vol. 87, 1987, pp. 677–682. [10] A. S. Rao, “Agentspeak (l): Bdi agents speak out in a logical computable language,” in Agents Breaking Away. Springer, 1996, pp. 42–55. [11] Y. Shoham, “Agent-oriented programming,” Artificial intelligence, vol. 60, no. 1, pp. 51–92, 1993. [12] E. M. Clarke, O. Grumberg, and D. Peled, Model checking. MIT press, 1999. [13] R. H. Bordini, M. Fisher, C. Pardavila, and M. Wooldridge, “Model checking agentspeak,” in Proceedings of the second international joint conference on Autonomous agents and multiagent systems. ACM, 2003, pp. 409–416. [14] R. H. Bordini, M. Fisher, W. Visser, and M. Wooldridge, “Verifying multi-agent programs by model checking,” Autonomous agents and multi-agent systems, vol. 12, no. 2, pp. 239–256, 2006. [15] G. J. Holzmann, Design and Validation of Computer Protocols. Prentice Hall, 1991. [16] ——, “The model checker spin,” IEEE Transactions on software engineering, vol. 23, no. 5, p. 279, 1997. [17] W. Visser, K. Havelund, G. Brat, S. Park, and F. Lerda, “Model checking programs,” Automated Software Engineering, vol. 10, no. 2, pp. 203–232, 2003. [18] L. A. Dennis and B. Farwer, “Gwendolen: A bdi language for verifiable agents,” in Proceedings of the AISB 2008 Symposium on Logic and the Simulation of Interaction and Reasoning, Society for the Study of Artificial Intelligence and Simulation of Behaviour, 2008, pp. 16–23. [19] L. A. Dennis, B. Farwer, R. H. Bordini, and M. Fisher, “A flexible framework for verifying agent programs,” in Proceedings of the 7th international joint conference on Autonomous agents and multiagent systems-Volume 3. International Foundation for Autonomous Agents and Multiagent Systems, 2008, pp. 1303–1306. [20] L. A. Dennis and M. Fisher, “Programming verifiable heterogeneous agent systems,” in Programming Multi-Agent Systems. Springer, 2008, pp. 40–55. [21] L. A. Dennis, M. Fisher, M. P. Webster, and R. H. Bordini, “Model checking agent programming languages,” Automated software engineering, vol. 19, no. 1, pp. 5–63, 2012. [22] J. Hunter, F. Raimondi, N. Rungta, and R. Stocker, “A synergistic and extensible framework for multi-agent system verification,” in Proceedings of the 2013 international conference on Autonomous agents and multi-agent systems. International Foundation for Autonomous Agents and Multiagent Systems, 2013, pp. 869–876. [23] L. A. Dennis, M. Fisher, and M. Webster, “Two-stage agent program verification,” Journal of Logic and Computation, p. exv003, 2015. [24] M. Kwiatkowska, G. Norman, and D. Parker, “Prism 4.0: Verification of probabilistic real-time systems,” in Computer aided verification. Springer, 2011, pp. 585–591. [25] E. Gat, “On three-layer architectures,” Artificial Intelligence and Mobile Robots: Case Studies of Successful Robot Systems, pp. 195–210, 1998, mIT Press. [26] R. H. Bordini and J. F. Hubner, Jason, A Java-based interpreter for an extended version of AgentSpeak, 2007, manual version 0.9.5. [27] N. K. Lincoln and S. M. Veres, “Natural language programming of complex robotic bdi agents,” Intelligent and Robotic Systems, vol. 71, no. 2, pp. 211–230, 2013. [28] S. M. Veres, Natural Language Programming of Agents and Robotic Devices. London: Sysbrain Ltd, 2008. [29] M. Kwiatkowska and D. Parker, “Advances in probabilistic model checking,” in Verification, Model Checking and Abstract Interpretation (VMCAI). Springer, 2010. [30] V. Forejt, M. Kwiatkowska, G. Norman, and D. Parker, “Automated verification techniques for probabilistic systems,” in Formal Methods for Eternal Networked Software Systems. Springer, 2011, pp. 53–113. [31] M. Kwiatkowska, G. Norman, and D. Parker, “Stochastic model checking,” in Formal methods for performance evaluation. Springer, 2007, pp. 220–270. [32] H. Hansson and B. Jonsson, “A logic for reasoning about time and reliability,” Formal aspects of computing, vol. 6, no. 5, pp. 512–535, 1994. [33] “Prism - probabilistic symbolic model checker.” [Online]. Available: http://www.prismmodelchecker.org/ [34] M. Fujita, P. C. McGeer, and J.-Y. Yang, “Multi-terminal binary decision diagrams: An efficient data structure for matrix representation,” Formal methods in system design, vol. 10, no. 2-3, pp. 149–169, 1997.
3cs.SY
arXiv:1707.04402v2 [cs.MA] 27 Feb 2018 Lenient Multi-Agent Deep Reinforcement Learning Gregory Palmer Karl Tuyls University of Liverpool United Kingdom [email protected] DeepMind and University of Liverpool United Kingdom [email protected] Daan Bloembergen Rahul Savani Centrum Wiskunde & Informatica The Netherlands [email protected] University of Liverpool United Kingdom [email protected] ABSTRACT Much of the success of single agent deep reinforcement learning (DRL) in recent years can be attributed to the use of experience replay memories (ERM), which allow Deep Q-Networks (DQNs) to be trained efficiently through sampling stored state transitions. However, care is required when using ERMs for multi-agent deep reinforcement learning (MA-DRL), as stored transitions can become outdated because agents update their policies in parallel [11]. In this work we apply leniency [23] to MA-DRL. Lenient agents map state-action pairs to decaying temperature values that control the amount of leniency applied towards negative policy updates that are sampled from the ERM. This introduces optimism in the valuefunction update, and has been shown to facilitate cooperation in tabular fully-cooperative multi-agent reinforcement learning problems. We evaluate our Lenient-DQN (LDQN) empirically against the related Hysteretic-DQN (HDQN) algorithm [22] as well as a modified version we call scheduled-HDQN, that uses average reward learning near terminal states. Evaluations take place in extended variations of the Coordinated Multi-Agent Object Transportation Problem (CMOTP) [8] which include fully-cooperative sub-tasks and stochastic rewards. We find that LDQN agents are more likely to converge to the optimal policy in a stochastic reward CMOTP compared to standard and scheduled-HDQN agents. KEYWORDS Distributed problem solving; Multiagent learning; Deep learning 1 INTRODUCTION The field of deep reinforcement learning has seen a great number of successes in recent years. Deep reinforcement learning agents have been shown to master numerous complex problem domains, ranging from computer games [17, 21, 26, 33] to robotics tasks [10, 12]. Much of this success can be attributed to using convolutional neural network (ConvNet) architectures as function approximators, allowing reinforcement learning agents to be applied to domains with large or continuous state and action spaces. ConvNets are often trained to approximate policy and value functions through sampling Proc. of the 17th International Conference on Autonomous Agents and Multiagent Systems (AAMAS 2018), M. Dastani, G. Sukthankar, E. Andre, S. Koenig (eds.), July 2018, Stockholm, Sweden © 2018 International Foundation for Autonomous Agents and Multiagent Systems (www.ifaamas.org). All rights reserved. https://doi.org/doi past state transitions stored by the agent inside an experience replay memory (ERM). Recently the sub-field of multi-agent deep reinforcement learning (MA-DRL) has received an increased amount of attention. Multiagent reinforcement learning is known for being challenging even in environments with only two implicit learning agents, lacking the convergence guarantees present in most single-agent learning algorithms [5, 20]. One of the key challenges faced within multiagent reinforcement learning is the moving target problem: Given an environment with multiple agents whose rewards depend on each others’ actions, the difficulty of finding optimal policies for each agent is increased due to the policies of the agents being non stationary [7, 14, 31]. The use of an ERM amplifies this problem, as a large proportion of the state transitions stored can become deprecated [22]. Due to the moving target problem reinforcement learning algorithms that converge in a single agent setting often fail in fullycooperative multi-agent systems with independent learning agents that require implicit coordination strategies. Two well researched approaches used to help parallel reinforcement learning agents overcome the moving target problem in these domains include hysteretic Q-learning [19] and leniency [23]. Recently Omidshafiei et al. [22] successfully applied concepts from hysteretic Q-learning to MA-DRL (HDQN). However, we find that standard HDQNs struggle in fully cooperative domains that yield stochastic rewards. In the past lenient learners have been shown to outperform hysteretic agents for fully cooperative stochastic games within a tabular setting [35]. This raises the question whether leniency can be applied to domains with a high-dimensional state space. In this work we show how lenient learning can be extended to MA-DRL. Lenient learners store temperature values that are associated with state-action pairs. Each time a state-action pair is visited the respective temperature value is decayed, thereby decreasing the amount of leniency that the agent applies when performing a policy update for the state-action pair. The stored temperatures enable the agents to gradually transition from optimists to average reward learners for frequently encountered state-action pairs, allowing the agents to outperform optimistic and maximum based learners in environments with misleading stochastic rewards [35]. We extend this idea to MA-DRL by storing leniency values in the ERM, and demonstrate empirically that lenient MA-DRL agents that learn implicit coordination strategies in parallel are able to converge on the optimal joint policy in difficult coordination tasks with stochastic AAMAS’18, July 2018, Stockholm, Sweden rewards. We also demonstrate that the performance of Hysteretic Q-Networks (HDQNs) within stochastic reward environments can be improved with a scheduled approach. Our main contributions can be summarized as follows. 1) We introduce the Lenient Deep Q-Network (LDQN) algorithm which includes two extensions to leniency: a retroactive temperature decay schedule (TDS) that prevents premature temperature cooling, and a T (s)-Greedy exploration strategy, where the probability of the optimal action being selected is based on the average temperature of the current state. When combined, TDS and T (s)Greedy exploration encourage exploration until average rewards have been established for later transitions. 2) We show the benefits of using TDS over average temperature folding (ATF) [35]. 3) We provide an extensive analysis of the leniency-related hyperparameters of the LDQN. 4) We propose a scheduled-HDQN that applies less optimism towards state transitions near terminal states compared to earlier transitions within the episode. 5) We introduce two extensions to the Cooperative Multi-agent Object Transportation Problem (CMOTP) [8], including narrow passages that test the agents’ ability to master fully-cooperative sub-tasks, stochastic rewards and noisy observations. 6) We empirically evaluate our proposed LDQN and SHDQN against standard HDQNs using the extended versions of the CMOTP. We find that while HDQNs perform well in deterministic CMOTPs, they are significantly outperformed by SHDQNs in domains that yield a stochastic reward. Meanwhile LDQNs comprehensively outperform both approaches within the stochastic reward CMOTP. The paper proceeds as follows: first we discuss related work and the motivation for introducing leniency to MA-DRL. We then provide the reader with the necessary background regarding how leniency is used within a tabular setting, briefly introduce hysteretic Q-learning and discuss approaches for clustering states based on raw pixel values. We subsequently introduce our contributions, including the Lenient-DQN architecture, T (s)-Greedy exploration, Temperature Decay Schedules, Scheduled-HDQN and extensions to the CMOTP, before moving on to discuss the results of empirically evaluating the LDQN. Finally we summarize our findings, and discuss future directions for our research. 2 RELATED WORK A number of methods have been proposed to help deep reinforcement learning agents converge towards an optimal joint policy in cooperative multi-agent tasks. Gupta et al. [13] evaluated policy gradient, temporal difference error, and actor critic methods on cooperative control tasks that included discrete and continuous state and action spaces, using a decentralized parameter sharing approach with centralized learning. In contrast our current work focuses on decentralized-concurrent learning. A recent successful approach has been to decompose a team value function into agentwise value functions through the use of a value decomposition network architecture [27]. Others have attempted to help concurrent learners converge through identifying and deleting obsolete state transitions stored in the replay memory. For instance, Foerster et al. [11] used importance sampling as a means to identify outdated Gregory Palmer, Karl Tuyls, Daan Bloembergen, and Rahul Savani transitions while maintaining an action observation history of the other agents. Our current work does not require the agents to maintain an action observation history. Instead we focus on optimistic agents within environments that require implicit coordination. This decentralized approach to multi-agent systems offers a number of advantages including speed, scalability and robustness [20]. The motivation for using implicit coordination is that communication can be expensive in practical applications, and requires efficient protocols [2, 20, 29]. Hysteretic Q-learning is a form of optimistic learning with a strong empirical track record in fully-observable multi-agent reinforcement learning [3, 20, 37]. Originally introduced to prevent the overestimation of Q-Values in stochastic games, hysteretic learners use two learning rates: a learning rate α for updates that increase the value estimate (Q-value) for a state-action pair and a smaller learning rate β for updates that decrease the Q-value [19]. However, while experiments have shown that hysteretic learners perform well in deterministic environments, they tend to perform sub-optimally in games with stochastic rewards. Hysteretic learners’ struggles in these domains have been attributed to learning rate β’s interdependencies with the other agents’ exploration strategies [20]. Lenient learners present an alternative to the hysteretic approach, and have empirically been shown to converge towards superior policies in stochastic games with a small state space [35]. Similar to the hysteretic approach, lenient agents initially adopt an optimistic disposition, before gradually transforming into average reward learners [35]. Lenient methods have received criticism in the past for the time they require to converge [35], the difficulty involved in selecting the correct hyperparameters, the additional overhead required for storing the temperature values, and the fact that they were originally only proposed for matrix games [20]. However, given their success in tabular settings we here investigate whether leniency can be applied successfully to MA-DRL. 3 BACKGROUND Q-Learning. The algorithms implemented for this study are based upon Q-learning, a form of temporal difference reinforcement learning that is well suited for solving sequential decision making problems that yield stochastic and delayed rewards [4, 34]. The algorithm learns Q-values for state-action pairs which are estimates of the discounted sum of future rewards (the return) that can be obtained at time t through selecting action at in a state st , providing the optimal policy is selected in each state that follows. Since most interesting sequential decision problems have a large state-action space, Q-values are often approximated using function approximators such as tile coding [4] or neural networks [33]. The parameters θ of the function approximator can be learned from experience gathered by the agent while exploring their environment, choosing an action at in state st according to a policy π , and updating the Q-function by bootstrapping the immediate reward r t +1 received in state st +1 plus the expected future reward from the next state (as given by the Q-function):  Q θ t +1 = θ t + α Yt − Q(st , at ; θ t ) ∇θ t Q(st , at ; θ t ). (1) Q Here, Yt is the bootstrap target which sums the immediate reward r t +1 and the current estimate of the return obtainable from the Lenient Multi-Agent Deep Reinforcement Learning AAMAS’18, July 2018, Stockholm, Sweden next state st +1 assuming optimal behaviour (hence the max operator) and discounted by γ ∈ (0, 1], given in Eq. (2). The Q-value Q(st , at ; θ t ) moves towards this target by following the gradient ∇θ t Q(st , at ; θ t ); α ∈ (0, 1] is a scalar used to control the learning rate. Q Yt ≡ r t +1 + γ max Q(st +1 , a; θ t ). (2) a ∈A Deep Q-Networks (DQN). In deep reinforcement learning [21] a multi-layer neural network is used as a function approximator, mapping a set of n-dimensional state variables to a set of mdimensional Q-values f : Rn → Rm , where m represents the number of actions available to the agent. The network parameters θ can be trained using stochastic gradient descent, randomly sampling past transitions experienced by the agent that are stored within an experience replay memory (ERM) [18, 21]. Transitions are tuples (st , at , st +1 , r t +1 ) consisting of the original state st , the action at , the resulting state st +1 and the immediate reward r t +1 . The network is trained to minimize the time dependent loss function Li (θ i ), h i Li (θ i ) = Es,a∼p(·) (Yt − Q(s, a; θ t ))2 , (3) where p(s, a) represents a probability distribution of the transitions stored within the ERM, and Yt is the target: Yt ≡ r t +1 + γQ(st +1 , argmax Q(st +1 , a; θ t ); θ t′ ). a ∈A (4) Equation (4) is a form of double Q-learning [32] in which the target action is selected using weights θ , while the target value is computed using weights θ ′ from a target network. The target network is a more stable version of the current network, with the weights being copied from current to target network after every n transitions [33]. Double-DQNs have been shown to reduce overoptimistic value estimates [33]. This notion is interesting for our current work, since both leniency and hysteretic Q-learning attempt to induce sufficient optimism in the early learning phases to allow the learning agents to converge towards an optimal joint policy. Hysteretic Q-Learning. Hysteretic Q-learning [19] is an algorithm designed for decentralised learning in deterministic multiagent environments, and which has recently been applied to MADRL as well [22]. Two learning rates are used, α and β, with β < α. The smaller learning rate β is used whenever an update would reduce a Q-value. This results in an optimistic update function which puts more weight on positive experiences, which is shown to be beneficial in cooperative multi-agent settings. Given a spectrum with traditional Q-learning at one end and maximum-based learning, where negative experiences are completely ignored, at the other, then hysteretic Q-learning lies somewhere in between depending on the value chosen for β. Leniency. Lenient learning was originally introduced by Potter and De Jong [25] to help cooperative co-evolutionary algorithms converge towards an optimal policy, and has later been applied to multi-agent learning as well [24]. It was designed to prevent relative overgeneralization [36], which occurs when agents gravitate towards a robust but sub-optimal joint policy due to noise induced by the mutual influence of each agent’s exploration strategy on others’ learning updates. Leniency has been shown to increase the likelihood of convergence towards the globally optimal solution in stateless coordination games for reinforcement learning agents [6, 23, 24]. Lenient learners do so by effectively forgiving (ignoring) sub-optimal actions by teammates that lead to low rewards during the initial exploration phase [23, 24]. While initially adopting an optimistic disposition, the amount of leniency displayed is typically decayed each time a state-action pair is visited. As a result the agents become less lenient over time for frequently visited state-action pairs while remaining optimistic within unexplored areas. This transition to average reward learners helps lenient agents avoid sub-optimal joint policies in environments that yield stochastic rewards [35]. During training the frequency with which lenient reinforcement learning agents perform updates that result in lowering the Qvalue of a state action pair (s, a) is determined by leniency and temperature functions, l(st , at ) and Tt (st , at ) respectively [35]. The relation of the temperature function is one to one, with each stateaction pair being assigned a temperature value that is initially set to a defined maximum temperature value, before being decayed each time the pair is visited. The leniency function l(st , at ) = 1 − e −K ∗Tt (st ,at ) (5) uses a constant K as a leniency moderation factor to determine how the temperature value affects the drop-off in lenience. Following the update, Tt (st , at ) is decayed using a discount factor β ∈ [0, 1] such that Tt +1 (st , at ) = β Tt (st , at ). Given a TD-Error δ , where δ = Yt − Q(st , at ; θ t ), leniency is applied to a Q-value update as follows: ( Q(st , at ) + αδ if δ > 0 or x > l(st , at ). Q(st , at ) = (6) Q(st , at ) if δ ≤ 0 and x ≤ l(st , at ). The random variable x ∼ U (0, 1) is used to ensure that an update on a negative δ is executed with a probability 1 − l(st , at ). Temperature-based exploration. The temperature values maintained by lenient learners can also be used to influence the action selection policy. Recently Wei and Luke [35] introduced Lenient Multiagent Reinforcement Learning 2 (LMRL2), where the average temperature of the agent’s current state is used with the Boltzmann action selection strategy to determine the weight of each action. As a result agents are more likely to choose a greedy action within frequently visited states while remaining exploratory for less-frequented areas of the environment. However, Wei and Luke [35] note that the choice of temperature moderation factor for the Boltzmann selection method is a non-trivial task, as Boltzmann selection is known to struggle to distinguish between Q-Values that are close together [15, 35]. Average Temperature Folding (ATF). If the agents find themselves in the same initial state at the beginning of each episode, then after repeated interactions the temperature values for state-action pairs close to the initial state can decay rapidly as they are visited more frequently. However, it is crucial for the success of the lenient learners that the temperatures for these state-action pairs remains sufficiently high for the rewards to propagate back from later stages, and to prevent the agents from converging upon a sub-optimal policy [35]. One solution to this problem is to fold the average temperature for the n actions available to the agent in st +1 into the AAMAS’18, July 2018, Stockholm, Sweden temperature that is being decayed for (st , at ) [35]. The extent to Í which this average temperature T t (st +1 ) = 1/n ni=1 Tt (st +1 , ai ) is folded in is determined by a constant υ as follows: ( Tt (st , at ) if st +1 is terminal. Tt +1 (st , at ) = β (7) (1 − υ)Tt (st , at ) + υT t (st +1 ) otherwise. Clustering states using autoencoders. In environments with a high dimensional or continuous state space, a tabular approach for mapping each possible state-action pair to a temperature as discussed above is no longer feasible. Binning can be used to discretize low dimensional continuous state-spaces, however further considerations are required regarding mapping semantically similar states to a decaying temperature value when dealing with high dimensional domains, such as image observations. Recently, researchers studying the application of count based exploration to Deep RL have developed interesting solutions to this problem. For example, Tang et al. [30] used autoencoders to automatically cluster states in a meaningful way in challenging benchmark domains including Montezuma’s Revenge. The autoencoder, consisting of convolutional, dense, and transposed convolutional layers, can be trained using the states stored in the agent’s replay memory [30]. It then serves as a pre-processing function д : S → RD , with a dense layer consisting of D neurons with a saturating activation function (e.g. a Sigmoid function) at the centre. SimHash [9], a locality-sensitive hashing (LSH) function, can be applied to the rounded output of the dense layer to generate a hash-key ϕ for a state s. This hash-key is computed using a constant k × D matrix A with i.i.d. entries drawn from a standard Gaussian distribution N (0, 1) as  ϕ(s) = sдn A д(s) ∈ {−1, 1}k . (8) where д(s) is the autoencoder pre-processing function, and k controls the granularity such that higher values yield a more finegrained clustering [30]. 4 ALGORITHMIC CONTRIBUTIONS In the following we describe our main algorithmic contributions. First we detail our newly proposed Lenient Deep Q-Network, and thereafter we discuss our extension to Hysteretic DQN, which we call Scheduled HDQN. 4.1 Lenient Deep Q-Network (LDQN) Approach. Combining leniency with DQNs requires careful considerations regarding the use of the temperature values, in particular when to compute the amount of leniency that should be applied to a state transition that is sampled from the replay memory. In our initial trials we used leniency as a mechanism to determine which transitions should be allowed to enter the ERM. However, this approach led to poor results, presumably due to the agents developing a bias during the initial random exploration phase where transitions were stored indiscriminately. To prevent this bias we use an alternative approach where we compute and store the amount of leniency at time t within the ERM tuple: (st −1 , at −1 , r t , st , l(st , at )t ). The amount of leniency that is stored is determined by the current temperature value T associated with the hash-key ϕ(s) for state s Gregory Palmer, Karl Tuyls, Daan Bloembergen, and Rahul Savani and the selected action a, similar to Eq. (5): l(s, t) = 1 − e −k ×T (ϕ(s),a) . (9) We use a dictionary to map each (ϕ(s), a) pair encountered to a temperature value, where the hash-keys are computed using Tang et al.’s [30] approach described in Section 3. If a temperature value does not yet exist for (ϕ(s), a) within the dictionary then an entry is created, setting the temperature value equal to MaxT emperature. Otherwise the current temperature value is used and subsequently decayed, to ensure the agent will be less lenient when encountering a semantically similar state in the future. As in standard DQN the aim is to minimize the loss function of Eq. (3), with the modification that for each sample j chosen from the replay memory for which the leniency conditions of Eq. (6) are not met, are ignored. Retroactive Temperature Decay Schedule (TDS). During initial trials we found that temperatures decay rapidly for state-action pairs belonging to challenging sub-tasks in the environment, even when using ATF (Section 3). In order to prevent this premature cooling of temperatures we developed an alternative approach using a pre-computed temperature decay schedule β 0 , . . . , βn with a step limit n. The values for β are computed using an exponent ρ which is decayed using a decay rate d: βn = e ρ×d t (10) for each t, 0 ≤ t < n. Upon reaching a terminal state the temperature decay schedule is applied as outlined in Algorithm 1. The aim is to ensure that temperature values of state-action pairs encountered during the early phase of an episode are decayed at a slower rate than those close to the terminal state transition (line 4). We find that maintaining a slow-decaying maximum temperature ν (lines 5-7) that is decayed using a decay rate µ helps stabilize the learning process when ϵ-Greedy exploration is used. Without the decaying maximum temperature the disparity between the low temperatures in well explored areas and the high temperatures in relatively unexplored areas has a destabilizing effect during the later stages of the learning process. Furthermore, for agents also using the temperature values to guide their exploration strategy (see below), ν can help ensure that the agents transition from exploring to exploiting within reasonable time. The decaying maximum temperature ν is used whenever T (ϕ(st −1 ), at −1 ) > νt , or when agents fail at their task in environments where a clear distinction can be made between success and failure. Therefore TDS is best suited for domains that yield sparse large rewards. Applying the TDS after the agents fail at a task could result in the repeated decay of temperature values for state-action pairs leading up to a sub-task. For instance, the sub-task of transporting a heavy item of goods through a doorway may only require a couple of steps for trained agents who have learned to coordinate. However, untrained agents may require thousands of steps to complete the task. If a time-limit is imposed for the agents to deliver the goods, and the episode ends prematurely while an attempt is made to solve the sub-task, then the application of the TDS will result in the rapid decay of the temperature values associated with the frequently encountered state-action pairs. We resolve this problem by setting the temperature values Tt (ϕ(si ), ai ) > ν to ν at the end of incomplete Lenient Multi-Agent Deep Reinforcement Learning Algorithm 1 Application of temperature decay schedule (TDS) 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: Upon reaching a terminal state do n ← 0, steps ← steps taken during the episode for i = steps to 0 do if βnTt (ϕ(si ), ai ) < νt then Tt +1 (ϕ(si ), ai ) ← βnTt (ϕ(si ), ai ) else Tt +1 (ϕ(si ), ai ) ← νt end if n ←n+1 end for ν ← µν AAMAS’18, July 2018, Stockholm, Sweden 4.2 5 Figure 1: Lenient-DQN Architecture. We build on the standard Double-DQN architecture [33] by adding a lenient loss function (top right, see Section 4.1). Leniency values are stored in the replay memory along with the state transitions; we cluster semantically similar states using an autoencoder and SimHash (bottom left), and apply our retroactive temperature decay schedule (TDS, Algorithm 1). Actions are selected using the T (st )-Greedy exploration method. runs instead of repeatedly decaying them, thereby ensuring that the agents maintain a lenient disposition towards one another. T (st )-Greedy Exploration. During initial trials we encountered the same problems discussed by Wei and Luke [35] regarding the selection of the temperature moderation factor for the Boltzmann action selection strategy. This led to the development of a more intuitive T (st )-Greedy exploration method where the average temperature value T (st ) ∈ (0, 1] for a state st replaces the ϵ in the ϵ-Greedy action selection method. An exponent ξ is used to control the pace at which the agents transition from explorers to exploiters. The agent therefore selects action a = arдmax a Q(a) with a probability 1 − T (st )ξ and a random action with probability T (st )ξ . We outline our complete LDQN architecture in Figure 1. Scheduled-HDQN (SHDQ) Hysteretic Q-learners are known to converge towards sub-optimal joint policies in environments that yield stochastic rewards [35]. However, drawing parallels to lenient learning, where it is desirable to decay state-action pairs encountered at the beginning of an episode at a slower rate compared to those close to a terminal state, we consider that the same principle can be applied to Hysteretic Q-learning. Subsequently we implemented Scheduled-HDQN with a pre-computed learning rate schedule β 0 , . . . , βn where βn is set to a value approaching α, and for each βt , 0 ≤ t < n, we have βt = d n−t βn using a decay coefficient d ∈ (0, 1]. The state transitions encountered throughout each episode are initially stored within a queue data-structure. Upon reaching a terminal state the n statetransitions are transferred to the ERM as (st , st +1 , r t +1 , at , βt ) for t ∈ {0, . . . , n}. Our hypothesis is that storing β values that approach α for state-transitions leading to the terminal state will help agents converge towards optimal joint policies in environments that yield sparse stochastic rewards. EMPIRICAL EVALUATION CMOTP Extensions. We subjected our agents to a range of Coordinated Multi-Agent Object Transportation Problems (CMOTPs) inspired by the scenario discussed in Buşoniu et al. [8], in which two agents are tasked with delivering one item of goods to a dropzone within a grid-world. The agents must first exit a room one by one before locating and picking up the goods by standing in the grid cells on the left and right hand side. The task is fully cooperative, meaning the goods can only be transported upon both agents grasping the item and choosing to move in the same direction. Both agents receive a positive reward after placing the goods inside the drop-zone. The actions available to each agent are to either stay in place or move left, right, up or down. We subjected our agents to three variations of the CMOTP, depicted in Figure 2, where each A represents one of the agents, G the goods, and D-ZONE / DZ mark the drop-zone(s). The layout in sub-figure 2a is a larger version of the original layout [8], while the layout in sub-figure 2b introduces narrow-passages between the goods and the drop-zone, testing whether the agents can learn to coordinate in order to overcome challenging areas within the environment. The layout in sub-figure 2c tests the agents’ response to stochastic rewards. Drop-zone 1 (DZ1) yields a reward of 0.8, whereas dropzone 2 (DZ2) returns a reward of 1 on 60% of occasions and only 0.4 on the other 40%. DZ1 therefore returns a higher reward on average, 0.8 compared to the 0.76 returned by DZ2. A slippery surface can be added to introduce stochastic state transitions to the CMOTP, a common practice within grid-world domains where the agents move in an unintended direction with a predefined probability at each time-step. Setup. We conduct evaluations using a Double-DQN architecture [33] as basis for the algorithms. The Q-network consists of 2 convolutional layers with 32 and 64 kernels respectively, a fully connected layer with 1024 neurons and an output neuron for each action. The agents are fed a 16 × 16 tensor representing a grayscale version of the grid-world as input. We use the following pixel values to represent the entities in our grid-world: Aдent1 = 250, Aдent2 = 200, Goods = 150 and Obstacles = 50. Adam [16] is used AAMAS’18, July 2018, Stockholm, Sweden (a) Original (b) Narrow-Passage Gregory Palmer, Karl Tuyls, Daan Bloembergen, and Rahul Savani (c) Stochastic Figure 2: CMOTP Layouts to optimize the networks. Our initial experiments are conducted within a noise free environment, enabling us to speed up the testing of our LDQN algorithm without having to use an autoencoder for hashing; instead we apply python’s xxhash. We subsequently test the LDQN with the autoencoder for hashing in a noisy version of the stochastic reward CMOTP. The autoencoder consists of 2 convolutional Layers with 32 and 64 kernels respectively, 3 fully connected layers with 1024, 512, and 1024 neurons followed by 2 transposed convolutional layers. For our Scheduled-HDQN agents we pre-compute β 0 to n by setting βn = 0.9 and applying a decay coefficient of d = 0.99 at each step t = 1 to n, i.e. βn−t = 0.99t βn , with βn−t being bounded below at 0.4. We summarize the remaining hyper-parameters in Table 1. In Section 7 we include an extensive analysis of tuning the leniency related hyper-parameters. We note at this point that each algorithm used the same learning rate α specified in Table 1. Component Hyper-parameter Setting DQN-Optimization Learning rate α Discount rate γ Steps between target network synchronization ERM Size 0.0001 0.95 5000 250’000 ϵ -Greedy Exploration Initial ϵ value ϵ Decay factor Minimum ϵ Value 1.0 0.999 0.05 Leniency MaxTemperature Temperature Modification Coefficient K TDS Exponent ρ TDS Exponent Decay Rate d Initial Max Temperature Value ν Max Temperature Decay Coefficient µ 1.0 2.0 -0.01 0.95 1.0 0.999 Autoencoder HashKey Dimensions k Number of sigmoidal units in the dense layer D 64 512 Table 1: Hyper-parameters 6 identical actions per state transition. As a result thousands of state transitions are often required to deliver the goods and receive a reward while the agents explore the environment, preventing the use of a small replay memory where outdated transitions would be overwritten within reasonable time. As a result standard Double-DQN architectures struggled to master the CMOTP, failing to coordinate on a significant number of runs even when confronted with the relatively simple original CMOTP. We conducted 30 training runs of 5000 episodes per run for each LDQN and HDQN configuration. Lenient and hysteretic agents with β < 0.8 fared significantly better than the standard DoubleDQN, converging towards joint policies that were only a few steps shy of the optimal 33 steps required to solve the task. Lenient agents implemented with both ATF and TDS delivered a comparable performance to the hysteretic agents with regards to the average steps per episode and the coordinated steps percentage measured over the final 100 steps of each episode (Table 2, left). However, both LDQN-ATF and LDQN-TDS averaged a statistically significant higher number of steps per training run compared to hysteretic agents with β < 0.7. For the hysteretic agents we observe a statistically significant increase in the average steps per run as the values for β increase, while the average steps and coordinated steps percentage over the final 100 episodes remain comparable. Narrow Passage CMOTP. Lenient agents implemented with ATF struggle significantly within the narrow-passage CMOTP, as evident from the results listed in Table 2 (right). We find that the average temperature values cool off rapidly over the first 100 episodes within the Pickup and Middle compartments, as illustrated in Figure 3. Meanwhile agents using TDS manage to maintain sufficient leniency over the first 1000 episodes to allow rewards to propagate backwards from the terminal state. We conducted ATF experiments with a range of values for the fold-in constant υ (0.2, 0.4 and 0.8), but always witnessed the same outcome. Slowing down the temperature decay would help agents using ATF remain lenient for longer, with the side-effects of an overoptimistic disposition in stochastic environments, and an increase in the number of steps required for convergence if the temperatures are tied to the action selection policy. Using TDS meanwhile allows agents to maintain sufficient leniency around difficult sub-tasks within the environment while being able to decay later transitions at a faster rate. As a result agents using TDS can learn the average rewards for state transitions close to the terminal state while remaining optimistic for updates to earlier transitions. DETERMINISTIC CMOTP RESULTS Original CMOTP. The CMOTP represents a challenging fully cooperative task for parallel learners. Past research has shown that deep reinforcement learning agents can converge towards cooperative policies in domains where the agents receive feedback for their individual actions, such as when learning to play pong with the goal of keeping the ball in play for as long as possible [28]. However, in the CMOTP feedback is only received upon delivering the goods after a long series of coordinated actions. No immediate feedback is available upon miscoordination. When using uniform action selection the agents only have a 20% chance of choosing Figure 3: Average temperature per compartment Lenient Multi-Agent Deep Reinforcement Learning SPE CSP SPR Hyst. β = 0.5 36.4 92% 1’085’982 Hyst. β = 0.6 36.1 92% 1’148’652 Original CMOTP Results Hyst. β = 0.7 Hyst. β = 0.8 36.8 528.9 92% 91% 1’408’690 3’495’657 AAMAS’18, July 2018, Stockholm, Sweden LDQN ATF 36.9 92% 1’409’720 LDQN TDS 36.8 92% 1’364’029 Hyst. β = 0.5 45.25 92% 1’594’968 Narrow-Passage CMOTP Results Hyst. β = 0.6 LDQN ATF 704.9 376.2 89% 90% 4’736’936 3’950’670 LDQN TDS 45.7 92% 2’104’637 Table 2: Deterministic CMTOP Results, including average steps per episode (SPE) over the final 100 episodes, coordinated steps percentages (CSP) over the final 100 episodes, and the average steps per training run (SPR). The success of HDQN agents within the narrow-passage CMOTP depends on the value chosen for β. Agents with β > 0.5 struggle to coordinate, as we observed over a large range of β values, exemplars of which are given in Table 2. The only agents that converge upon a near optimal joint-policy are those using LDQN-TDS and HDQN (β = 0.5). We performed a Kolmogorov-Smirnov test with a null hypothesis that there is no significant difference between the performance metrics for agents using LDQN-TDS and HDQN (β = 0.5). We fail to reject the null hypothesis for average steps per episode and percentage of coordinated steps for the final 100 episodes. However, HDQN (β = 0.5) averaged significantly less steps per run while maintaining less overhead, replicating previous observations regarding the strengths of hysteretic agents within deterministic environments. 7 STOCHASTIC CMOTP RESULTS In the stochastic setting we are interested in the percentage of runs for each algorithm that converge upon the optimal joint policy, which is for the agents to deliver the goods to dropzone 1, yielding a reward of 0.8, as opposed to dropzone 2 which only returns an average reward of 0.76 (see Section 5). We conducted 40 runs of 5000 episodes for each algorithm. As discussed in Section 6, HDQN agents using β > 0.7 frequently fail to coordinate in the deterministic CMOTP. Therefore, setting β = 0.7 is the most likely candidate to succeed at solving the stochastic reward CMOTP for standard HDQN architectures. However, agents using HDQN (β = 0.7) only converged towards the optimal policy on 42.5% of runs. The scheduled-HDQN performed significantly better achieving a 77.5% optimal policy rate. Furthermore the SHDQN performs well when an additional funnel-like narrowpassage is inserted close to the dropzones, with 93% success rate. The drop in performance upon removing the funnel suggests that the agents are led astray by the optimism applied to earlier transitions within each episode, presumably around the pickup area where a crucial decision is made regarding the direction in which the goods should be transported. LDQN using ϵ−Greedy exploration performed similar to SHDQN, converging towards the optimal joint policy on 75% of runs. Meanwhile LDQNs using T (st )-Greedy exploration achieved the highest percentages of optimal joint-policies, with agents converging on 100% of runs for the following configuration: K = 3.0, d = 0.9, ξ = 0.25 and µ = 0.9995, which will be discussed in more detail below. However the percentage of successful runs is related to the choice of hyperparameters. We therefore include an analysis of three critical hyperparameters: • The temperature Modification Coefficient K, that determines the speed at which agents transition from optimist to average reward learner (sub-figure 4a). Values: 1, 2 and 3 • The TDS decay-rate d which controls the rate at which temperatures are decayed n-steps prior to the terminal state (sub-figure 4b). Values: 0.9, 0.95 and 0.99 • T (st )-Greedy exploration exponent ξ , controlling the agent’s transition from explorer to exploiter, with lower values for ξ encouraging exploration. Values: 0.25, 0.5 and 1.0 (a) Leniency Schedules (b) TDS Figure 4: TMC and TDS schedules used during analysis. We conducted 40 simulation runs for each combination of the three variables. To determine how well agents using LDQN can cope with stochastic state transitions we added a slippery surface where each action results in a random transition with 10% probability 1 . The highest performing agents used a steep temperature decay schedule that maintains high temperatures for early transitions (d = 0.9 or d = 0.95) with temperature modification coefficients that slow down the transition from optimist to average reward learner (K = 2 or k = 3), and exploration exponents that delay the transition from explorer to exploiter (ξ = 0.25 or ξ = 0.5). This is illustrated in the heat-maps in Figure 5. When using a TDS with a more gradual incline (d = 0.99) the temperature values from earlier state transitions decay at a similar rate to those near terminal states. In this setting choosing larger values for K increases the likelihood of the agents converging upon a sub-optimal policy prior to having established the average rewards available in later states, as evident from the results plotted in sub-figure 5c. Even when setting the exploration exponent ξ to 0.25 the agents prematurely transition to exploiter while holding an overoptimistic disposition towards follow-on states. Interestingly when K < 3 agents often converge towards the optimal joint-policy despite setting d = 0.99. However, the highest percentages of optimal runs (97.5%) were achieved through combining a steep TDS (d = 0.9 or d = 0.95) with the slow transition to average reward learner (k = 3) and exploiter (ξ = 0.25). Meanwhile the lowest percentages for all TDSs resulted from insufficient leniency (K = 1) and exploration (ξ = 1.0). Using one of the best-performing configuration (K = 3.0, d = 0.9 and ξ = 0.25) we conducted further trials analyzing the agents’ 1 Comparable results were obtained during preliminary trials without a slippery surface. AAMAS’18, July 2018, Stockholm, Sweden Gregory Palmer, Karl Tuyls, Daan Bloembergen, and Rahul Savani 8 (a) d = 0.9 (b) d = 0.95 (c) d = 0.99 Figure 5: Analysis of the LDQN hyperparameters. The heat-maps show the percentage of runs that converged to the optimal joint-policy (darker is better). sensitivity to the maximum temperature decay coefficient µ. We conducted an additional set of 40 runs where µ was increased from 0.999 to 0.9995. Combining T (S)-Greedy with the slow decaying µ = 0.9995 results in the agents spending more time exploring the environment at the cost of requiring longer to converge, resulting in an additional 1’674’106 steps on average per run. However, the agents delivered the best performance, converging towards the optimal policy on 100% runs conducted. Continuous State Space Analysis. Finally we show that semantically similar state-action pairs can be mapped to temperature values using SimHash in conjunction with an autoencoder. We conducted experiments in a noisy version of the stochastic CMTOP, where at each time step every pixel value is multiplied by a unique coefficient drawn from a Gaussian distribution X ∼ N (1.0, 0.01). A non-sparse tensor is used to represent the environment, with background cells set to 1.0 prior to noise being applied. Agents using LDQNs with xxhash converged towards the suboptimal joint policy after the addition of noise as illustrated in Figure 6, with the temperature values decaying uniformly in tune with ν . LDQN-TDS agents using an autoencoder meanwhile converged towards the optimal policy on 97.5% of runs. It is worth pointing out that the autoencoder introduces a new set of hyperparameters that require consideration, including the size D of the dense layer at the centre of the autoencoder and the dimensions K of the hash-key, raising questions regarding the influence of the granularity on the convergence. We leave this for future work. 9 Figure 6: Noisy Stochastic CMOTP Average Reward DISCUSSION & CONCLUSION Our work demonstrates that leniency can help MA-DRL agents solve a challenging fully cooperative CMOTP using high-dimensional and noisy images as observations. Having successfully merged leniency with a Double-DQN architecture raises the question regarding how well our LDQN will work with other state of the art components. We have recently conducted preliminary stochastic reward CMOTP trials with agents using LDQN with a Prioritized Experience Replay Memory [1]. Interestingly the agents consistently converged towards the sub-optimal joint policy. We plan to investigate this further in future work. In addition our research raises the question how well our extensions would perform in environments where agents receive stochastic rewards throughout the episode. To answer this question we plan to test our LDQN within a hunter prey scenario where each episode runs for a fixed number of time-steps, with the prey being re-inserted at a random position each time it is caught [20]. Furthermore we plan to investigate how our LDQN responds to environments with more than two agent by conducting CMOTP and hunter-prey scenarios with four agents. To summarize our contributions: 1) In this work we have shown that leniency can be applied to MA-DRL, enabling agents to converge upon optimal joint policies within fully-cooperative environments that require implicit coordination strategies and yield stochastic rewards. 2) We find that LDQNs significantly outperform standard and scheduled-HDQNs within environments that yield stochastic rewards, replicating findings from tabular settings [35]. 3) We introduced two extensions to leniency, including a retroactive temperature decay schedule that prevents the premature decay of temperatures for state-action pairs and a T (st )-Greedy exploration strategy that encourages agents to remain exploratory in states with a high average temperature value. The extensions can in theory also be used by lenient agents within non-deep settings. 4) Our LDQN hyperparameter analysis revealed that the highest performing agents within stochastic reward domains use a steep temperature decay schedule that maintains high temperatures for early transitions combined with a temperature modification coefficient that slows down the transition from optimist to average reward learner, and an exploration exponent that delays the transition from explorer to exploiter. 5) We demonstrate that the CMOTP [8] can be used as a benchmarking environment for MA-DRL, requiring reinforcement learning agents to learn fully-cooperative joint-policies from processing high dimensional and noisy image observations. 6) Finally, we introduce two extensions to the CMOTP. First we include narrow passages, allowing us to test lenient agents’ ability to prevent the premature decay of temperature values. Our second extension introduces two dropzones that yield stochastic rewards, testing the agents’ ability to converge towards an optimal joint-policy while receiving misleading rewards. ACKNOWLEDGMENTS We thank the HAL Allergy Group for partially funding the PhD of Gregory Palmer and gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan X Pascal GPU that enabled this research. Lenient Multi-Agent Deep Reinforcement Learning REFERENCES [1] Ioannis Antonoglou, John Quan Tom Schaul, and David Silver. 2015. Prioritized Experience Replay. arXiv preprint arXiv:1511.05952 (2015). [2] Tucker Balch and Ronald C Arkin. 1994. Communication in reactive multiagent robotic systems. Autonomous robots 1, 1 (1994), 27–52. [3] Nikos Barbalios and Panagiotis Tzionas. 2014. A robust approach for multi-agent natural resource allocation based on stochastic optimization algorithms. Applied Soft Computing 18 (2014), 12–24. [4] Andrew Barto and Richard Sutton. 1998. Reinforcement learning: An introduction. MIT press. [5] Daan Bloembergen, Daniel Hennes, Michael Kaisers, and Karl Tuyls. 2015. Evolutionary dynamics of multi-agent learning: A survey. Journal of Artificial Intelligence Research 53 (2015), 659–697. [6] Daan Bloembergen, Michael Kaisers, and Karl Tuyls. 2011. Empirical and theoretical support for lenient learning. In The 10th International Conference on Autonomous Agents and Multiagent Systems-Volume 3. International Foundation for Autonomous Agents and Multiagent Systems, 1105–1106. [7] Lucian Busoniu, Robert Babuska, and Bart De Schutter. 2008. A comprehensive survey of multiagent reinforcement learning. IEEE Transactions on Systems, Man, And Cybernetics-Part C: Applications and Reviews, 38 (2), 2008 (2008). [8] Lucian Buşoniu, Robert Babuška, and Bart De Schutter. 2010. Multi-agent reinforcement learning: An overview. In Innovations in multi-agent systems and applications-1. Springer, 183–221. [9] Moses S Charikar. 2002. Similarity estimation techniques from rounding algorithms. In Proceedings of the thiry-fourth annual ACM symposium on Theory of computing. ACM, 380–388. [10] Tim de Bruin, Jens Kober, Karl Tuyls, and Robert Babuška. 2015. The importance of experience replay database composition in deep reinforcement learning. In Deep Reinforcement Learning Workshop, NIPS. [11] Jakob Foerster, Nantas Nardelli, Gregory Farquhar, Philip Torr, Pushmeet Kohli, Shimon Whiteson, et al. 2017. Stabilising Experience Replay for Deep Multi-Agent Reinforcement Learning. arXiv preprint arXiv:1702.08887 (2017). [12] Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. 2016. Deep Reinforcement Learning for Robotic Manipulation with Asynchronous Off-Policy Updates. arXiv preprint arXiv:1610.00633 (2016). [13] Jayesh K Gupta, Maxim Egorov, and Mykel Kochenderfer. 2017. Cooperative Multi-Agent Control Using Deep Reinforcement Learning. In Proceedings of the Adaptive and Learning Agents workshop (at AAMAS 2017). [14] Pablo Hernandez-Leal, Michael Kaisers, Tim Baarslag, and Enrique Munoz de Cote. 2017. A Survey of Learning in Multiagent Environments: Dealing with Non-Stationarity. arXiv preprint arXiv:1707.09183 (2017). [15] Leslie Pack Kaelbling, Michael L Littman, and Andrew W Moore. 1996. Reinforcement learning: A survey. Journal of artificial intelligence research 4 (1996), 237–285. [16] Diederik P. Kingma and Jimmy Ba. 2014. Adam: A Method for Stochastic Optimization. In Proceedings of the 3rd International Conference on Learning Representations (ICLR). [17] Guillaume Lample and Devendra Singh Chaplot. 2017. Playing FPS Games with Deep Reinforcement Learning. AAAI (2017), 2140–2146. [18] Long-H Lin. 1992. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning 8, 3/4 (1992), 69–97. [19] Laëtitia Matignon, Guillaume J Laurent, and Nadine Le Fort-Piat. 2007. Hysteretic q-learning: an algorithm for decentralized reinforcement learning in cooperative multi-agent teams. In Intelligent Robots and Systems, 2007. IROS 2007. IEEE/RSJ International Conference on. IEEE, 64–69. [20] Laetitia Matignon, Guillaume J Laurent, and Nadine Le Fort-Piat. 2012. Independent reinforcement learners in cooperative Markov games: a survey regarding coordination problems. The Knowledge Engineering Review 27, 1 (2012), 1–31. [21] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. 2015. Human-level control through deep reinforcement learning. Nature 518, 7540 (2015), 529–533. [22] Shayegan Omidshafiei, Jason Pazis, Christopher Amato, Jonathan P How, and John Vian. 2017. Deep decentralized multi-task multi-agent reinforcement learning under partial observability. In International Conference on Machine Learning. 2681–2690. [23] Liviu Panait, Keith Sullivan, and Sean Luke. 2006. Lenient learners in cooperative multiagent systems. In Proceedings of the fifth international joint conference on Autonomous agents and multiagent systems. ACM, 801–803. [24] Liviu Panait, Karl Tuyls, and Sean Luke. 2008. Theoretical advantages of lenient learners: An evolutionary game theoretic perspective. Journal of Machine Learning Research 9, Mar (2008), 423–457. [25] Mitchell A Potter and Kenneth A De Jong. 1994. A cooperative coevolutionary approach to function optimization. In International Conference on Parallel Problem Solving from Nature. Springer, 249–257. [26] Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. 2015. Prioritized experience replay. arXiv preprint arXiv:1511.05952 (2015). AAMAS’18, July 2018, Stockholm, Sweden [27] Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z Leibo, Karl Tuyls, and Thore Graepel. 2017. Value-Decomposition Networks For Cooperative Multi-Agent Learning. arXiv preprint arXiv:1706.05296 (2017). [28] Ardi Tampuu, Tambet Matiisen, Dorian Kodelja, Ilya Kuzovkin, Kristjan Korjus, Juhan Aru, Jaan Aru, and Raul Vicente. 2017. Multiagent cooperation and competition with deep reinforcement learning. PLoS One 12, 4 (2017), e0172395. [29] Ming Tan. 1993. Multi-agent reinforcement learning: Independent vs. cooperative agents. In Proceedings of the tenth international conference on machine learning. 330–337. [30] Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. 2016. # Exploration: A Study of Count-Based Exploration for Deep Reinforcement Learning. arXiv preprint arXiv:1611.04717 (2016). [31] Karl Tuyls and Gerhard Weiss. 2012. Multiagent Learning: Basics, Challenges, and Prospects. AI Magazine 33, 3 (2012), 41–52. [32] Hado Van Hasselt. 2010. Double Q-learning. In Advances in Neural Information Processing Systems. 2613–2621. [33] Hado Van Hasselt, Arthur Guez, and David Silver. 2016. Deep Reinforcement Learning with Double Q-Learning. AAAI (2016), 2094–2100. [34] Christopher JCH Watkins and Peter Dayan. 1992. Q-learning. Machine learning 8, 3-4 (1992), 279–292. [35] Ermo Wei and Sean Luke. 2016. Lenient Learning in Independent-Learner Stochastic Cooperative Games. Journal of Machine Learning Research 17, 84 (2016), 1–42. http://jmlr.org/papers/v17/15-417.html [36] R Paul Wiegand. 2003. An analysis of cooperative coevolutionary algorithms. Ph.D. Dissertation. George Mason University Virginia. [37] Yinliang Xu, Wei Zhang, Wenxin Liu, and Frank Ferrese. 2012. Multiagent-based reinforcement learning for optimal reactive power dispatch. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews) 42, 6 (2012), 1742–1751.
2cs.AI
Gabora,  L.  (1992).  Should  I  stay  or  should  I  go:  Coordinating  biological  needs  with  continuously-­‐updated   assessments  of  the  environment:  A  computer  model.  In  (S.  Wilson,  J.  A.  Mayer  &  H.  Roitblat,  Eds.)   Proceedings  of  the  Second  International  Conference  on  the  Simulation  of  Adaptive  Behavior  (pp.  156-­‐ 162),  Cambridge  MA:  MIT  Press.       Should  I  Stay  or  Should  I  Go:     Coordinating  Biological  Needs  with  Continuously-­‐updated     Assessments  of  the  Environment     Liane  M.  Gabora       ABSTRACT   This paper presents Wanderer, a model of how autonomous adaptive systems coordinate internal biological needs with moment-by-moment assessments of the probabilities of events in the external world. The extent to which Wanderer moves about or explores its environment reflects the relative activations of two competing motivational sub-systems: one represents the need to acquire energy and it excites exploration, and the other represents the need to avoid predators and it inhibits exploration. The environment contains food, predators, and neutral stimuli. Wanderer responds to these events in a way that is adaptive in the short turn, and reassesses the probabilities of these events so that it can modify its long term behaviour appropriately. When food appears, Wanderer be-comes satiated and exploration temporarily decreases. When a predator appears, Wanderer both decreases exploration in the short term, and becomes more "cautious" about exploring in the future. Wanderer also forms associations between neutral features and salient ones (food and predators) when they are present at the same time, and uses these associations to guide its behaviour. 1.  INTRODUCTION     One approach to modeling animal behaviour is to create an animal that continually assesses its needs, determines which need is most urgent, and implements the behaviour that satisfies that need. However, in the absence of appetitive stimuli such as food or mates, or harmful stimuli such as predators, behaviour is often not directed at the fulfillment of any particular need: an animal either remains still or moves about, and both options haw repercussions on many aspects of survival. So the question is not "What should I do next?", but rather, "Should I stay where I am, conserving energy and minimizing exposure to predators, or should I explore my environment, with the possibility of finding food, mates, or shelter"? In this paper we present a computational model of how positively or negatively reinforcing stimuli affect an animal's decision whether or not, and if so to what extent, to explore its environment. The model is referred to as Wanderer. The architecture of Wanderer is an extension of an architecture used to model the mechanisms underlying exploratory behaviour in the absence of positively or negatively reinforcing stimuli (Gabora and Colgan, 1990). The general approach is to consider an autonomous adaptive system as an assemblage of sub-systems specialized to take care of different aspects of survival, and what McFarland (1975) refers to as the "final behavioural common path" is the emergent outcome of the continual process of attempting to mutually satisfy these competing subsystems. The relative impact of each Gabora,  1992   subsystem on behaviour reflects the animal's internal state and its assessment of the dynamic affordance probabilities of the environment (for example, how likely it seems that a predator or food will appear). This distributed approach is similar in spirit to that of Braitenburg (1984), Brooks (1986), Macs (1990) and Beer (1990). We make the simplifying assumption that the only possible beneficial outcome of exploration is finding food, and the only possible harmful outcome is an encounter with a predator. The amount of exploration that Wanderer engages in at any moment reflects the relative activations of a subsystem that represents the need for food, which has an excitatory effect on exploration, and a subsystem that represents the need to avoid predators, which inhibits exploration. The earlier version of Wanderer exhibited the increase and then decrease in activity shown by animals in a novel environment (Welker, 1956; Dember & Earl, 1957; May, 1963: McCall, 1974; Weisler & 1976) and all four characteristics that differentiate the pattern of exploration exhibited by animals raised under different levels of predation were reproduced in the model by changing the initial value of one parameter: the decay on the inhibitory subsystem, which represents the animals assessment of the probability that a predator could appear. In the present paper, we first address how salient events such as the appearance of food or predators affect exploration. Wanderer does not have direct access to the probabilities that predators and food will appear but it continually reassesses them based on its experiences, and adjusts its behaviour accordingly. This approach merges Gigerenzer and Murray's (1987) notion of cognition as intuitive statistics with Roitblat's (1987) concept of optimal decision making in animals. We then examine how initially neutral features can come to excite or inhibit exploration by becoming associated with salient ones (food or predators). It has long been recognized that animals form associations of this kind between simultaneously occurring stimuli or events (Tolman, 1932; Hull, 1943). This is useful since in the real world features are clustered — for example, predators may dwell in a particular type of cavernous rock, so the presence of rocks of that sort can be a useful indicator that a predator is likely to be near. Thus features of environments that contain a lot of food are responded to with increased exploration (even when there is no food in sight) and features of environments that contain many predators inhibit exploration (even when there are no predators). 2.  ARCHITECTURE  OF  WANDERER     Wanderer consists of two motivational subsystems that receive input from five sensory units and direct their out-put to a motor unit, constructed in Common Lisp (Figure 1). One subsystem represents the need to acquire and maintain energy. It has an excitatory effect on exploration and is linked by a positive weight to the motor unit. Exploration in turn feeds back and inhibits activation of this subsystem: this represents fatigue. Activation of the other subsystem represents the need to avoid predators: it has an inhibitory effect on exploration and is linked by a negative weight to the motor unit. Since every moment that passes without encountering a predator is evidence that there is less need to be cautious, activation of the inhibitory subsystem decreases as a function of time in the absence of predation. In addition, since moving about provides more evidence that there are no predators nearby than does immobility, the inhibitory subsystem, like the excitatory subsystem, receives feedback from the motor unit; its activation decreases by an amount proportional to the amount of exploration that occurred during the previous iteration. 2     Gabora,  1992   Perception units have binary activations. Activation of unit 0 corresponds to detection of food, activation of unit 1 corresponds to detection of a predator, and activation of units 2, 3, and 4 correspond to detection of rock, tree, and sun respectively. Activation can spread from perception units to subsystems, but not the other way around. The output for each iteration is either zero, signifying immobility, or a positive number that indicates how much exploration is taking place.   Figure  1.  The  architecture  of  Wanderer.  Dark  lines  represent  fixed  connections.  Fine  lines  represent   learnable  connections.     The relevant variables and their initial values are ai activation of perception unit i = {0,11} s0 = activation of excitatory subsystem = 0.9 s1 = activation of inhibitory subsystem = 0.9 E = exploration = activation of motor unit wij = weight from perception unit i to subsystem j: w0, 0 =-0.5, w1 = 0.9, all others = 0. w0 = weight from excitatory subsystem to motor unit = -0.5 3     Gabora,  1992   w1 = weight from inhibitory subsystem to motor unit = 0.5 wf = feedback weight from motor unit to subsystems = -0.1 k0 = rate at which hunger increases= 1.05 k1 = decay on inhibitory subsystem = 0.5 Exploration is calculated using a logistic function as follows:   E  =  1  /  [1  +  e -­‐(w0s0  +  w1s1)   ]     Thus exploration only occurs if the activation of the ex-citatory subsystem is greater than that of the inhibitory subsystem. Subsystem activations are then updated:   3.  WANDERER'S  ENVIRONMENT     Wanderer's environment contains three kinds of stimuli: food, predators, and features that have no direct effect on survival, which will be referred to as neutral features. The initial presence or absence of neutral features is random. The more exploration Wanderer engages in, the greater the probability that a neutral feature will change from present to absent or vice versa in the next iteration: c1 = constant = 0.75 p(∆a)t = c1Et-1 Perception unit 2 detects a stimulus that is predictive of the appearance of food. Let us say that Wanderer's primary source of food is a plant that grows on a certain kind of soil, and that a certain kind of tree also grows only in that soil, so that the presence oil that tree is predictive of finding food. Perception unit 2 can only turn on when perception unit 0 is on (that is, food can only be detected when the tree is detected). Also, in accord with the harsh realities of life, Wanderer has to explore if it is to find food. The probability of finding food is proportional to the amount of exploration that took place during the previous iteration: a0 -- activation of food detection unit c2 = constant specified at run-time p(a0 = 1)t = c2a2Et-1 Perception unit 3 detects a stimulus that is predictive of the appearance of a predator. Let us say that the animal that preys upon Wanderer lives in cavernous rocks, and this unit turns on when rocks of that sort are detected. Perception unit 3 can only turn on when perception unit 1 is on (that is, a predator will only appear when the rock is present). Since predators can appear even when Wanderer is immobile, it is not necessary that Wanderer explore in order to come across a predator. 4     Gabora,  1992   a1 = activation of predator detection unit c3 = constant specified at run-time p(a1= 1)t = c3a3 Perception unit 4 detects the presence of the sun, such as when it comes out from under a cloud. The sun is predictive of neither food nor predator. 4.  EFFECT  OF  SALIENT  STIMULI  ON  MOTIVATION     4.1  IMPLEMENTATION  OF  SATIETY     Detection of food is represented by the activation of a single binary unit. Activation of this unit decreases the activation of the excitatory subsystem, which in turn brings a short-term decrease in exploration. This corresponds to satiety; once food has been found, the immediate need for food decreases, thus exploration should decrease. 4.2  IMPLEMENTATION  OF  CAUTION     Detection of a predator is represented by the activation of a single binary node that is positively linked to the inhibitory subsystem. Activation of this unit has two ef-fects. First, it causes an increase in the activation of the inhibitory subsystem, which results in a pronounced short-term decrease in exploration. Second, it decreases the decay on the inhibitory subsystem. This has the long-term effect of decreasing the rate at which exploration is disinhibited; in other words, every encounter with a predator causes Wanderer to be more "cautious". Decay on the inhibitory subsystem is updated each iteration as follows: ∂ =0.2 k1min = 0.5 k1t = max { k1min , (k1t-1 + ∂[s1 – s1t-1])} Since activation of the inhibitory subsystem increases in response to predation, decay increases if a predator appears, and decreases when no predator is present. 5.  LEARNING  ALGORITHM     If a neutral feature — rock, tree, or sun — is present when a salient feature — food or predator — appears, an association forms between the neutral feature and subsystem that is positively linked with the salient feature. Weights on the lines between neutral features and hidden nodes are initialized to zero, corresponding to the state in which no associations, either positive or negative, have formed. If food or a predator appears in the environment, and if one or more initially-neutral features (pi) is present, weights on links connecting initially-neutral features to subsystems are updated as follows: η = learning rate = 0.05 wt = wt-1 + η|st – st-1|ai 5     Gabora,  1992   6.  RESULTS     Figure 2 plots exploration during a run in which the probability of finding food is high and the probability of predation is zero. Exploration increases quickly initially as activation of the excitatory subsystem increases and the activation of the inhibitory subsystem decreases. It falls sharply whenever food is encountered, and then gradually increases again. Each time food is encountered exploration falls to the same level.   Figure  2.  Exploration  when  p(food)  is  high  and  p(predator)  =  0.0.       Figure 3 plots exploration during a run in which the probability of finding food is zero and the probability of predation is high. The appearance of a predator causes activation of the inhibitory subsystem to increase, temporarily decreasing exploration. Since no food is present, activation of the excitatory subsystem is high, and exploration quickly resumes. Two more predators are encountered in quick succession. With each encounter, the response is greater, representing an increase in the assessed probability of predation in the current location. Exploration ceases after the third encounter. 6     Gabora,  1992     Figure  3.  Exploration  when  p(predator)  is  high  and  p(food)  =  0.0.   Figure 4 illustrates the effect of associative learning in the presence of food when there are no predators. The exploration curve is less regular. Rocks are present at the beginning of the run, but disappear before food is found. Food never appears unless a tree is present. Food is first found during iteration 24, and exploration drops sharply. At this point associations are formed be-tween food and both the tree and the sun, and the weights on the lines from feature detection units 3 and 4 to subsystem 1 increase (from 0.0 to 0.015). Note that the, association between sun and food is spurious: the sun is not actually predictive of food. Exploration increases until it reaches a plateau. It drops sharply when food is encountered during iteration 80 since at the same time one of the cues predictive of food, the sun, disappears. (Not only is it no longer hungry, but there is indication that there is no food around anyway.) During iteration 84, the tree, the other feature that has been associated with food, disappears as well. Thus exploration increases very slowly. Since little exploration is taking place, features of the environment change little. Rocks appear in iteration 155, but since no association has been formed between rocks and food, this has no effect on exploration. Exploration increases sharply for a brief period between iterations 176 and 183 when the sun comes out, and then again at iteration 193 when trees appear. It plummets once again in iteration 195, with the final appearance of food. 7     Gabora,  1992     Figure  4.  Effect  of  associative  learning  when  p(food)  is  high  and  p(predator)  =  0.0.  Below:  Black   bar  indicates  presence  of  neutral  feature;  white  bar  indicates  absence.     The effect of associative learning on response to predation is illustrated in Figure 5. (In this experiment, decay on the inhibitory subsystem is held constant so that exploration does not fall quickly to zero despite the high predation rate.) Response ED predation grows increasingly variable throughout the run, reflecting the ex-tent to which features that have become associated with predation are present at the Lime a predator appears. Wanderer eventually associates all three features of its environment with predators, and none with food. Since two of the three features are present, exploration stops at iteration 179 and does not resume by the 200th iteration. Since Wanderer is not moving, there is no further change in the neutral features until the end of the run. 8     Gabora,  1992     Figure  5.  Effect  of  associative  learning  when  p(food)  is  high  and  p(predator)  =  0.0.  Below:  Black  bar   indicates  presence  of  neutral  feature;  white  bar  indicates  absence.     The effect of associative learning in the presence of both food and predators is illustrated in Figure 6. Rocks become associated with predators, and trees become associated with food, as expected. (After 200 iterations the weight on the line from Perception Unit 2 to Sub-system 0 is 0.091, and the weight on the line from Perception Unit 3 to Subsystem 1 is 0.170.) However, spurious associations also form between neutral features and salient features (with weights on the relevant lines ranging from 0.046 to 0.112). 9     Gabora,  1992     Figure  6.  Effect  of  associative  learning  when  both  p(food)  and  p(predator)  are  high.  Below:  Black  bar   indicates  presence  of  neutral  feature;  white  bar  indicates  absence.     7.  DISCUSSION   Wanderer is a simple qualitative model of the mechanisms underlying how animals coordinate internal needs with external affordances. It does not ad-dress a number of real world complexities: the perceptual inputs are ungrounded, and the problems associated with actively moving about in a real environment are bypassed. Since weights never decrease using the delta ride, once associations are formed, they cannot be unlearned. However Wanderer responds to events in a way that is adaptive in the short term, and reassesses the probabilities of these events so that it can modify its long term behaviour appropriately. When food appears, Wanderer becomes satiated and temporarily decreases exploration. When a predator appears, Wanderer both temporarily decreases exploration to avoid being caught, and becomes more cautious in the near future. When predators are not encountered, Wanderer becomes less cautious. Wanderer also forms associations between neutral features of its environment and salient features (predators and food). Since in real environments, features are clustered — neutral features often provide reliable clues regarding the proximity of predators and food — association-forming of this kind can help to optimize behaviour. In summary, this paper illustrates how an animal can be built using a distributed approach in which sub-systems specialized to take care of different needs coordinate internal signals with moment-by-moment assessments of probabilities of events in the external world. The relative 10     Gabora,  1992   activations of these subsystems determine the extent to which the animal moves about or explores its environment.   ACKNOWLEDGEMENTS     I would like to thank Mike Gasser for discussion and Peter Todd for comments on the manuscript. I would also like to thank the Center for the Study of the Evolution and Origin of Life (CSEOL) at UCLA for support.   REFERENCES     Beer, R. D. and H. J. Chiel. (1990), The neural basis of behavioral choice in an artificial insect. In J. A. Meyer and S. W. Wilson (Eds.) From Animals to Animals: Proceedings of the First International Conference on the Simulation of Adaptive Behaviour. 247-254.. London: MIT Press. Braitenburg, V. (1984). Vehicles: Experiments in synthetic psychology. Cambridge, MA: MIT Press. Brooks, R. A. (1986). A robust layered control system for a mobile robot. IEEE Journal of Robotics and Automation RA-2, 1, 253-262. Dember, W. N. and R. W. Earl. (1957). Analysis of exploratory, manipulatory, and curiosity behaviours. Psychological Review 64, 91- 96. Gabora, L. M. and P. W. Colgan. (1990). A model of the mechanisms underlying exploratory behaviour. In J. A. Meyer and S. W. Wilson (Eds.) From Animals to Animals: Proceedings of the First International Conference on the Simulation of Adaptive Behaviour, 475-484. London: MIT Press. Gigerenzer, G. and D. J. Murray. (1987). Cognition as intuitive Statistics. Hillsdale, NI: Lawrence Erlbaum Associates. Hull, C. L. (1943). The problem of intervening variables in molar behavior theory. Psychological Review, 50, 273-291. Maes, P. (1989). The dynamics of action selection. In Proceedings of the Eleventh International Joint Conference on AI (LICA' 89), 991-997. Morgan-Kaufmann Publishers, May, R. B. (1963). Stimulus selection in preschool children under conditions of free choice. Perceptual and Motor Skills, 16,200-206. McCall, R. B. (1974). Exploratory manipulation and play in the human infant. Monographs of the Society for Research in Child Development, 39 (No. 2). McFarland, D. J. and R. M. Sibly. (1975). The behavioural final common path. Philosophical Transactions of the London Royal Society, 270B, 265-293. Roitblat, H. L. (1987). Introduction to comparative cognition. New York: Freeman, Tolman, E. C. (1932). Purposive behaviour in animals and men. New York: Century, We isler, A. and McCall, R. (1976). Exploration and play: resume and redirection. American Psychologist 31, 492-508. 11     Gabora,  1992   Welker, W. I. (1956a). Some determinants of play and exploration in chimpanzees. Journal of Comparative Physiological Psychology 49, 84-89. Welker, W. I. (1956b). Variability of play and exploratory behaviour in chimpanzees. Journal of Comparative Physiological Psychology 49, 181- 185. Wilson, S. W. (1990). The animal path to Al In 3, A. Meyer and S. W. Wilson (Eds.) From Animals to Animals: Proceedings of the First International Conference on the Simulation of Adaptive Behaviour, 247-254. London: MIT Press.     12    
9cs.NE
Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais TRIAGEM VIRTUAL DE IMAGENS DE IMUNO-HISTOQUÍMICA USANDO REDES NEURAIS ARTIFICIAIS E ESPECTRO DE PADRÕES Higor Neto Lima Escola Politécnica de Pernambuco, Universidade de Pernambuco [email protected] Wellington Pinheiro dos Santos Núcleo de Engenharia Biomédica, Centro de Tecnologia e Geociências, Universidade Federal de Pernambuco [email protected] Mêuser Jorge Silva Valença arXiv:1712.01695v1 [cs.CV] 3 Dec 2017 Escola Politécnica de Pernambuco, Universidade de Pernambuco [email protected] Resumo – A importância de se organizar imagens médicas de acordo com sua natureza, aplicação e relevância tem aumentado. Além do mais, a seleção prévia de imagens médicas pode ser bastante útil para reduzir o tempo de análise dispendido por patologistas. Neste artigo é proposto um classificador de imagens para integrar um sistema de CBIR (Content-Based Image Retrieval, Recuperação de Imagens Baseada em Conteúdo) dedicado à seleção prévia de imagens, ou seja, à tarefa de triagem. Esse classificador é baseado na representação das imagens de entrada pelo espectro de padrões e na classificação por redes neurais. A seleção dos atributos é realizada aplicando a Análise de Componentes Principais aos vetores de atributos obtidos pela extração do espectro de padrões, enquanto a classificação de imagens é baseada no uso de redes neurais perceptron multicamadas e na composição de mapas auto-organizados e aprendizado por quantização vetorial. Esses métodos foram aplicados à seleção baseada em conteúdo de imagens de imuno-histoquı́mica de placenta e pulmão de neomortos. Os resultados demonstraram que esta abordagem pode atingir desempenhos de classificação razoáveis. Palavras-chave – CBIR, k-Médias, Algoritmos de Agrupamento, Análise de Componentes Principais, Espectro de Padrões, Imuno-Histoquı́mica. Abstract – The importance of organizing medical images according to their nature, application and relevance is increasing. Furhermore, a previous selection of medical images can be useful to accelerate the task of analysis by pathologists. Herein this work we propose an image classifier to integrate a CBIR (Content-Based Image Retrieval) selection system. This classifier is based on pattern spectra and neural networks. Feature selection is performed using pattern spectra and principal component analysis, whilst image classification is based on multilayer perceptrons and a composition of self-organizing maps and learning vector quantization. These methods were applied for content selection of immunohistochemical images of placenta and newdeads lungs. Results demonstrated that this approach can reach reasonable classification performance. Keywords – CBIR, k-means, clustering algorithms, principal componente analysis, pattern spectrum, immunohistochemistry. 1 Introdução A velocidade de processamento dos computadores e a capacidade de armazenamento, bem como o desenvolvimento de novas mı́dias de armazenamento e evolução das mı́dias existentes, têm passado por um crescimento vertiginoso desde o começo da década de 1990 [1, 2]. Paralelamente, a evolução das tecnologias digitais tem sido cada vez mais empregada no desenvolvimento de soluções baseadas em processamento, armazenamento e análise de imagens digitais, o que, por sua vez, tem demandado mais capacidade de armazenamento e representação de imagens [3]. Aliada a essa demanda surge também a necessidade de construir métodos de busca que permitam a pesquisa de imagens baseada em conteúdo [3]. Recuperação de Imagens Baseada em Conteúdo (Content-Based Image Retrieval, CBIR) é uma forma de buscar imagens por meio de uma imagem-base, selecionada de acordo com o interesse do usuário. Para proporcionar a busca baseada em conteúdo, é preciso, portanto, representar as imagens no banco de dados de forma alternativa. Isso é feito usualmente por meio da construção de vetores de caracterı́sticas que contenham os atributos de interesse para descrição e representação unı́voca do conteúdo de interesse. As caracterı́sticas mais usadas são cor, textura e forma. A recuperação de imagens baseada em conteúdo se fundamenta em três premissas básicas: extração de caracterı́sticas visuais, indexação multidimensional, e projeto de sistemas de recuperação [4]. A representação das imagens nos bancos de dados por meio de vetores de caracterı́sticas proporciona que o usuário possa buscar imagens na base de dados com o contexto requerido fazendo uso de uma imagem base, representada por seu vetor de caracterı́sticas. Esse vetor é comparado aos vetores que representam as outras imagens no banco de dados e, por meio de medidas de similaridade, a pesquisa retorna as imagens de conteúdo similar [3–9]. Neste trabalho as imagens são representadas por vetores 1 Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais de caracterı́sticas obtidos da extração do espectro morfológico de padrões de cada uma das bandas da imagem colorida [10]. A dimensionalidade desses vetores é então reduzida pela aplicação da Análise de Componentes Principais (Principal Component Analysis, PCA). O sistema de triagem virtual proposto neste trabalho é apresentado em duas versões: uma primeira, baseada em redes neurais MLP (Multilayer Perceptron), e uma segunda versão, baseada em redes SOM (Self-Organizing Maps) e redes LVQ (Learning Vector Quantization). As duas configurações são comparadas quanto ao desempenho na tarefa de triagem virtual, ou seja, quanto à taxa de acerto de pré-classificação. A escolha pelo uso de redes neurais se deve ao seu emprego em outros trabalhos envolvendo CBIR [11, 12]. Este trabalho está organizado da forma que segue: na seção ‘Materiais e Métodos’ apresentam-se a teoria básica das redes neurais artificiais do tipo perceptron multicamadas e mapas auto-organizados de Kohonen, os princı́pios de Morfologia Matemática e a definição do espectro de padrões, e a proposta de sistema de triagem virtual; em ‘Resultados Experimentais’ são apresentados os resultados obtidos para as duas configurações de sistema de CBIR para triagem virtual. Por fim, na seção ‘Discussão e Conclusões’ são apresentados comentários e conclusões gerais e especı́ficas levando em conta os resultados obtidos. 2 Materiais e Métodos 2.1 Redes Perceptron de Camada Única As redes perceptron consistem em classificadores lineares propostos por Rosenblatt que emprega neurônios MCP e uma técnica de treinamento supervisionado baseada no aprendizado de Hebb [13, 14]. Em alguns textos tal rede é considerada uma rede de duas camadas de nodos [13]. Neste trabalho, quando se referir a uma rede de M camadas, por exemplo, ficará explı́cito se são M camadas de nodos ou de neurônios propriamente ditos, o que exclui a camada de nodos de entrada, que não executam funções matemáticas, mas apenas distribuem as entradas para a primeira camada de neurônios. O treinamento de uma rede perceptron de camada única é baseado no seguinte procedimento, para uma rede de m neurônios e n atributos de entrada [14]: 1. Inicializar os pesos wi,j (0). 2. Inicializar a taxa de aprendizado η. 3. Repetir até δ(t) ≤  ou um máximo de Nmax iterações, onde  é o máximo erro permitido: (a) Para cada par (x, d) do conjunto de treinamento Ψ, onde Ψ = {(x(l) , d(l) )}L l=1 , o vetor x = (x1 , x2 , . . . , xn )T é o vetor de atributos de entrada e d = (d1 , d2 , . . . , dm )T é o vetor de saı́das desejadas dos m neurônios, repetir: i. Calcular as saı́das yi (t) dos neurônios:  yi (t) = g  n X  wi,j (t)xj (t) , j=1 onde 1 ≤ i ≤ m. ii. Calcular o ajuste ∆wi,j (t): δi (t) = di (t) − yi (t), ∆wi,j (t) = ηδi (t)xj (t), onde 1 ≤ i ≤ m e 1 ≤ j ≤ n. iii. Atualizar os pesos: wi,j (t + 1) = wi,j (t) + ∆wi,j (t), onde 1 ≤ i ≤ m e 1 ≤ j ≤ n. (b) Calcular δ(t) da forma que segue: δ(t) = max(δ1 (t), δ2 (t), . . . , δm (t)). As redes perceptron têm o inconveniente de apenas convergirem para casos linearmente separáveis, ou seja, casos em que existem hiperplanos que separam os conjuntos de entrada [15]. Essa limitação é resolvida com as redes perceptron multicamadas. 2 Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais 2.2 Redes Perceptron Multicamadas As redes perceptron multicamadas foram um avanço muito importante para o fim da estagnação das pesquisas em RNAs, devido à possibilidade de, utilizando neurônios MCP e arquitetura multicamadas, resolver problemas não-linearmente separáveis [13]. Elas utilizam um algoritmo chamado algoritmo de retropropagação, que consiste em uma generalização do algoritmo de (k) (k+1) treinamento do perceptron de camada única através da estimação dos erros δi de uma camada k a partir dos erros δi da camada superior k + 1. É possı́vel provar que, para modelagem de funções, é possı́vel modelar qualquer função contı́nua com uma rede perceptron de duas camadas de neurônios, enquanto qualquer função pode ser modelada usando um perceptron de três camadas de neurônios, diferente das redes de camada única, que só conseguem modelar funções contı́nuas e lineares [14]. O algoritmo de retropropagação, também chamado de regra delta generalizada, consiste no seguinte procedimento, para uma rede de M + 1 camadas de nodos, cada uma com Nk nodos, sendo N0 = n atributos de entrada e NM = m neurônios de saı́da, onde 0 ≤ k ≤ M [14]: (k) 1. Inicializar os pesos wi,j (0). 2. Inicializar a taxa de aprendizado η. 3. Repetir até δ(t) ≤  ou um máximo de Nmax iterações, onde  é o máximo erro permitido: (a) Para cada par (x, d) do conjunto de treinamento Ψ, onde Ψ = {(x(l) , d(l) )}L l=1 , o vetor x = (x1 , x2 , . . . , xn )T é o vetor de atributos de entrada e d = (d1 , d2 , . . . , dm )T é o vetor de saı́das desejadas dos N (M ) = m neurônios de saı́da, repetir: (k) i. Calcular as saı́das yi (t) dos neurônios:   Nk−1 (k) yi (t) = g  X (k) (k) wi,j (t)xj (t) , j=1 onde 1 ≤ i ≤ Nk e (k) (k−1) xj (t) = yj onde 1 ≤ k ≤ M e (t), (0) yj (t) = xj (t), para 1 ≤ j ≤ Nk−1 , N0 = n e NM = m. ii. Calcular os erros da camada de saı́da: (M ) δi (M ) (t) = (di (t) − yi (M ) (t))g 0 (yi (t)), onde 1 ≤ i ≤ NM e g 0 () é a derivada de g(). iii. Calcular os erros das outras camadas: Nk+1 (k) (k) δi (t) = g 0 (yi (t)) X (k+1) wj,i (k+1) (t)δj (t), j=1 onde 1 ≤ i ≤ Nk e 1 ≤ k ≤ M − 1. (k) iv. Calcular os ajustes ∆wi,j (t): (k) (k) (k) ∆wi,j (t) = ηδi (t)xj (t), onde 1 ≤ i ≤ Nk , 1 ≤ j ≤ Nk−1 e 1 ≤ k ≤ M . v. Atualizar os pesos: (k) (k) (k) wi,j (t + 1) = wi,j (t) + ∆wi,j (t), onde 1 ≤ i ≤ Nk , 1 ≤ j ≤ Nk−1 e 1 ≤ k ≤ M . (b) Calcular δ(t) da forma que segue: (M ) δ(t) = max(δ1 3 (M ) (t), δ2 (M ) (t), . . . , δNM (t)). Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais As funções de ativação dos neurônios nas redes perceptron multicamadas devem ser contı́nuas, monotonicamente crescentes e diferenciáveis [16]. Existem outras versões do algoritmo de retropropagação onde os ajustes dos pesos são calculados segundo outros métodos, mas o princı́pio básico é o mesmo, estando a diferença apenas em questões como a rapidez da convergência e outras questões cuja natureza e interesse dependem da aplicação. 2.3 Redes SOM Os mapas auto-organizados de Kohonen foram originalmente desenvolvidos para fazer agrupamento de dados. Também chamados de redes SOM (Self-Organizing Maps) [14], os mapas auto-organizados possuem uma arquitetura bastante diferente das redes neurais usuais: neles os neurônios podem ser dispostos matricialmente, tentando emular a distribuição dos neurônios biológicos no cérebro. Nas redes SOM os neurônios podem ser dispostos de forma linear ou matricial, em todas as dimensões possı́veis, sendo que a quantidade de vizinhos influencia apenas na etapa de aprendizado, estabelecendo dependências entre o ajuste dos pesos de um neurônio e os pesos de seus vizinhos, segundo uma determinada função de vizinhança, como se mostra na descrição do processo de aprendizado. No processo de aprendizado, áreas especı́ficas de neurônios vão sendo ativadas. Ao final do processo, a rede SOM fica dividida em áreas especialistas, responsáveis pela classificação de padrões especı́ficos, semelhante ao cérebro, onde cada região é responsável por uma atividade especı́fica. Os mapas auto-organizados utilizam neurônios suja saı́da é a que segue: 2 yi = e−||x−wi || , (1) onde wi = (wi,1 , wi,2 , . . . , wi,n )T é o vetor de pesos do i-ésimo neurônio, para 1 ≤ i ≤ m e 1 ≤ j ≤ n. Os pesos das redes SOM podem ser ajustados pelo seguinte procedimento modificado, baseado no procedimento clássico de ajuste de redes SOM, mas tendo como critérios de parada o número máximo de iterações e a soma dos ajustes dos pesos: 1. Inicializar os pesos wi,j (0), onde 1 ≤ i ≤ m e 1 ≤ j ≤ n, com valores aleatórios e necessariamente diferentes. 2. Entrar com os vetores posição ri , correspondentes à posição do i-ésimo neurônio na grade, onde 1 ≤ i ≤ m. 3. Inicializar a taxa de aprendizado inicial η0 , onde 0 < η0 < 1. 4. Inicializar a largura topológica σ0 . A largura topológica é a largura da função de vizinhança gaussiana hi,k (t), utilizada para definir a vizinhança do neurônio vencedor a ser treinada. 5. Repetir até δ(t) = 0 ou um máximo de Nmax iterações: (a) Para cada padrão x = (x1 , x2 , . . . , xn )T do conjunto de entrada Ψ = {x(l) }L l=1 , repetir: i. Calcular as saı́das yi (t) dos neurônios, onde 1 ≤ i ≤ m. ii. Calcular ymax (t): ymax (t) = max(y1 (t), y2 (t), . . . , ym (t)). iii. Calcular o ı́ndice k do neurônio vencedor: yi = ymax ⇒ k = i. iv. Calcular o ajuste ∆wi,j (t): ∆wi,j (t) = η(t)hi,k (t)(xj (t) − wi,j (t)), onde 1 ≤ i ≤ m e 1 ≤ j ≤ n. v. Atualizar os pesos: wi,j (t + 1) = wi,j (t) + ∆wi,j (t), onde:   t σ(t) = σ0 exp − , τ1 ! d2i,k hi,k (t) = exp − 2 , 2σ (t)   t η(t) = η0 exp − , τ2 onde τ1 e τ2 são constantes de tempo e: di,k = ||ri − rk ||, para 1 ≤ i ≤ m e 1 ≤ j ≤ n. 4 Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais (b) Calcular δ(t) da forma que segue: δ(t) = m X n X |∆wi,j (t)|. i=1 j=1 As redes SOM podem ser utilizadas também como etapa de classificação ou agrupamento de dados para uma RNA supervisionada [13, 14, 17], tendo diversas aplicações potenciais em reconhecimento de padrões na Engenharia Biomédica como, por exemplo, o auxı́lio ao diagnóstico da epilepsia a partir de sintomas [18]. 2.4 Classificador LVQ de Kohonen O algoritmo LVQ, ou algoritmo de quantização vetorial por aprendizagem (LVQ, Learning Vector Quantization) consiste em uma técnica supervisionada de treinamento que tanto pode ser utilizada para adicionar novos padrões a uma rede SOM já treinada quanto permite criar uma rede neural supervisionada com a mesma arquitetura de uma rede SOM [14, 19]. (l) Dado o conjunto de treinamento Ψ = {x(l) , C (l) }L é a classe correta a priori, calcula-se a saı́da da rede para cada l=1 , onde C elemento x de Ψ pertencente à classe C e, caso o neurônio vencedor seja o i-ésimo, considerando que este neurônio está associado à classe Ci , para uma rede de n entradas e m saı́das projetada para reconhecer padrões de um universo Ω = {C1 , C2 , . . . , Cm }, onde 1 ≤ i ≤ m, os pesos serão atualizados da forma que segue [14, 19]:  wi,j (t) + η(t)(xj (t) − wi,j (t)), Ci = C wi,j (t + 1) = , (2) wi,j (t) − η(t)(xj (t) − wi,j (t)), Ci 6= C onde 1 ≤ j ≤ n e η é a taxa de aprendizado. A inicialização da rede LVQ é idêntica à da rede SOM. A rede LVQ pode usar como critério de parada tanto o número de iterações quanto o erro de classificação, dado que o treinamento é supervisionado. 2.5 Morfologia Matemática e Espectro de Padrões Uma imagem f : S → K é definida como sendo a função que mapeia um vetor bidimensional u ∈ S no ponto f (u) ∈ K, onde S é a grade ou suporte da imagem, u é o pixel da grade S; f (u) ∈ K é o valor do pixel u ∈ S. De forma mais rigorosa, [20] define pixel como sendo o par (u, f (u)), ou seja, o vetor formado pela sua posição u na grade S e seu valor associado f (u). Já K é o conjunto dos valores possı́veis de f (u). Denota-se K S o conjunto de todas as imagens possı́veis na grade S em K [20]. Quando a grade S é discreta, isto é, S ⊆ Z2 , diz-se que f : S → K é uma imagem discreta. K é definido como sendo da forma K = V p , onde V ∈ R é o conjunto dos nı́veis de cinza e p ∈ N∗ é o número de bandas presentes na imagem f . Assim, seja f uma imagem de p bandas f : S → V p , f pode ser denotada de forma equivalente por f (u) = {f1 (u), f2 (u), . . . , fp (u)}, u ∈ S, onde fj (u) é a j-ésima banda de f : S → V p , para fj : S → V e 1 ≤ j ≤ p. Quando p = 1 diz-se que a imagem é uma imagem em nı́veis de cinza ou monocromática. Uma imagem é dita ser uma imagem colorida quando p = 3 e multiespectral quando 4 ≤ p ≤ 100 [21]. Já uma imagem é dita hiperespectral quando p > 100 [21]. Para generalizar, pode-se dizer que uma imagem é multiespectral quando p > 1. Uma imagem f : S → K é dita ser uma imagem digital quando, além de ser discreta, ela é quantizada, ou seja, seus pixels assumem apenas vetores discretos. Matematicamente, f : S → K é uma imagem digital quando K = {0, 1, . . . , k}p e S ∈ Z, onde p ∈ N∗ . Quando uma imagem digital é representada com N bits, k = 2N − 1. Assim, uma imagem digital f : S → K de 8 bits tem K = {0, 1, . . . , 255}p , enquanto que imagens digitais de 16 bits tem K = {0, 1, . . . , 65535}p . Conseqüentemente, uma imagem binária de banda única f : S → K é uma imagem digital com K = {0, 1}. Por uma questão de conveniência, é comum representar as imagens digitais como imagens discretas normalizadas, substituindo K = {0, 1, . . . , k}p por K = [0, 1]p . Desta forma não é preciso explicitar quantos bits são utilizados na representação dos valores possı́veis dos pixels. Assim, uma imagem f : S → {0, 1, . . . , k}p passa a ser representada por f˜ : S → [0, 1]p . É importante realçar que as imagens binárias são apenas casos particulares das imagens em nı́veis de cinza. Assim, uma imagem binária f : S → {0, k}p passa a ser denotada utilizando a notação normalizada por f˜ : S → {0, 1}p . Salvo indicação em contrário, neste texto uma imagem f : S → K sempre será representada por sua versão normalizada, sendo K S o conjunto de todas as imagens normalizadas, onde K = [0, 1]p , para p bandas. Usualmente S é uma região retangular de Z2 , podendo-se representar as imagens digitais em nı́vel de cinza f : S → {0, 1, . . . , k} como matrizes [22, 23]. [23] representaria uma imagem f : S → V da seguinte forma, para S sendo uma grade m × n centrada em (r, s):   a11 a12 · · · a1n  a21 a22 · · · a2n    f = . , .. ..  ..  .. . . .  am1 ··· am2 5 amn (r,s) Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais onde aij ∈ V , para 1 ≤ i ≤ m e 1 ≤ j ≤ n. Isto implica dizer que, segundo esta notação: f (u) = aij ⇒ u = (i − r, j − s), u ∈ S. Note que, neste caso, a grade S é uma região retangular de Z2 do tipo: S = {(1 − r), (2 − r), . . . , (m − r)} × {(1 − s), (2 − s), . . . , (n − s)}. Esta será a notação utilizada ao longo deste texto sempre que for conveniente representar uma imagem como uma matriz. As operações básicas entre imagens em Morfologia Matemática são a comparação, a subtração, a intersecção e a união. É importante afirmar que as operações básicas da Morfologia Matemática só podem ser aplicadas a imagens que mantenham uma relação de ordem entre os pixels. Somente as imagens em nı́veis de cinza e as imagens binárias mantêm tal relação. No caso das imagens multiespectrais ou hiperespectrais, é necessário trabalhar banda a banda ou supor algum artifı́cio para manter a relação de ordem. A relação de ordem é a base da Morfologia Matemática [20]. Dadas duas imagens f1 : S → [0, 1] e f2 : S → [0, 1], a comparação 5 é a operação de [0, 1]S × [0, 1]S em [0, 1]S definida como segue [20]:  1, f1 (u) ≤ f2 (u) (f1 5 f2 )(u) = , ∀u ∈ S. (3) 0, c.c. Dada uma imagem f : S → [0, 1], o negativo de f , denotado por f ou ∼ f , é o operador de [0, 1]S em [0, 1]S definido como sendo [24]: f (u) = 1 − f (u), ∀u ∈ S. (4) A união entre f1 : S → [0, 1] e f2 : S → [0, 1] é o operador de [0, 1]S × [0, 1]S em [0, 1]S , denotado f1 ∨ f2 , definido como segue [20]: (f1 ∨ f2 )(u) = max{f1 (u), f2 (u)}, ∀u ∈ S. (5) A intersecção entre f1 : S → [0, 1] e f2 : S → [0, 1] é o operador de [0, 1]S × [0, 1]S em [0, 1]S , denotado f1 ∧ f2 , definido como [20]: (f1 ∧ f2 )(u) = min{f1 (u), f2 (u)}, ∀u ∈ S. (6) Pode-se notar que as operações de união e intersecção entre imagens se assemelham às operações de mesmo nome entre conjuntos nebulosos. A semelhança entre estas operações da Morfologia Matemática e da Lógica Nebulosa cresce com a adoção da notação de imagem normalizada, o que faz com que, de certa forma, as imagens normalizadas se assemelhem a conjuntos nebulosos. A subtração ou diferença entre f1 : S → [0, 1] e f2 : S → [0, 1] é operação de [0, 1]S × [0, 1]S em [0, 1]S dada por [24]: (f1 ∼ f2 )(u) = (f1 ∧ f 2 )(u), ∀u ∈ S. (7) A partir destas operações é possı́vel definir os operadores básicos da Morfologia Matemática: a dilatação, a erosão, o gradiente morfológico, a abertura, o fechamento, as aberturas e fechamentos por reconstrução e as dilatações e erosões condicionais. Pode-se dizer que a Morfologia Matemática é uma teoria construtiva, devido ao fato de que operadores mais complexos podem ser construı́dos a partir dos mais simples. Destes, os operadores fundamentais são a dilatação e a erosão, originando-se todos os outros a partir de combinações destes [25]. A dilatação de f : S → [0, 1] por g : S → [0, 1], denotada δg (f ) ou f ⊕ g (soma de Minkowsky, no caso binário [20]), é um operador de [0, 1]S × [0, 1]S em [0, 1]S definido como: _ δg (f )(u) = (f ⊕ g)(u) := f (v) ∧ g(u − v), ∀u ∈ S, (8) v∈S onde g é denominado elemento estruturante. Na prática, a dilatação transforma a imagem original de forma a fazer o elemento estruturante se “encaixar” na imagem, ou seja, a imagem original f será modificada de modo a fazer as áreas semelhantes a g “crescerem”, “encaixando” g. Visualmente, a dilatação resulta no crescimento das áreas claras e na eliminação das áreas escuras menores do que o elemento estruturante, considerando o fato de que, usualmente, os pixels mais claros são representados por valores mais próximos de 1, enquanto os mais escuros, por valores mais próximos de 0. A erosão de f : S → [0, 1] por g : S → [0, 1], denotada g (f ) ou f g (subtração de Minkowsky, no caso binário [20]), é um operador de [0, 1]S × [0, 1]S em [0, 1]S definido como: ^ (9) g (f )(u) = (f g)(u) := f (v) ∨ g(v − u), ∀u ∈ S. v∈S Na prática, a erosão transforma a imagem original f de modo a fazer as áreas semelhantes a g “diminuirem”, “encaixando” g, conforme o exemplo anterior. 6 Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais Tabela 1: Operações de dilatação, erosão e convolução Operação Expressão W Dilatação (f ⊕ g)(u) = Vv∈S f (v) ∧ g(u − v) Erosão (f g)(u) =P v∈S f (v) ∨ g(v − u) Convolução (f ∗ g)(u) = v∈S f (v)g(u − v) Visualmente, a erosão resulta no crescimento das áreas escuras e na eliminação das áreas claras menores do que o elemento estruturante, considerando o fato de que, usualmente, os pixels mais claros são representados por valores mais próximos de 1, enquanto os mais escuros, mais próximos de 0. Em [24] a dilatação e a erosão são mostradas esquematicamente por meio de exemplos e ilustrações, que mostram o elemento estruturante percorrendo uma imagem binária. É uma abordagem bastante ilustrativa, que dá ao leitor uma idéia de como são implementadas de forma algorı́tmica a dilatação e a erosão. A Tabela 1 mostra as expressões das operações de dilatação, erosão e convolução, podendo-se perceber a semelhança entre estas três operações. Quanto às suas propriedades, a dilatação é uma operação extensiva devido ao fato de δg (f )(u) ≥ f (u), ∀u ∈ S, enquanto que a erosão é uma operação anti-extensiva, pois g (f )(u) ≤ f (u), ∀u ∈ S [10]. A anti-dilatação de f : S → [0, 1] por g : S → [0, 1], denotada por δga (f ), é dada por: δga (f )(u) := δg (f )(u), ∀u ∈ S. (10) A anti-erosão de f : S → [0, 1] por g : S → [0, 1], denotada por ag (f ), é dada por: ag (f )(u) := g (f )(u), ∀u ∈ S. (11) A n-dilatação de f : S → [0, 1] por g : S → [0, 1], denotada por δgn (f ), é dada por, para n > 1: δgn (f )(u) := δg δg · · · δg (f )(u), ∀u ∈ S. | {z } (12) n De forma semelhante, a n-erosão de f : S → [0, 1] por g : S → [0, 1], denotada por ng (f ), é dada por, para n > 1: ng (f )(u) := g g · · · g (f )(u), ∀u ∈ S. | {z } (13) n O elemento estruturante quadrado 3 × 3 é dado por:  1 1 1  1 1  . 1 (2,2)  1 1 1  0 1  . 0 (2,2) 1 b= 1 1 O elemento estruturante cruz 3 × 3 é dado por: 0 b= 1 0 Em [24] é demonstrado que qualquer elemento estruturante de dimensões maiores que 3 × 3 pode ser decomposto em vários 3 × 3. Isto quer dizer que uma dilatação por um elemento estruturante h de dimensões m × n, tal que m > 3 e n > 3, pode ser executada por meio de um certo número de dilatações por bk de dimensões 3 × 3, onde cada bk é um elemento estruturante que constitui h [24]. Uma das aplicações mais importantes da Morfologia Matemática é a implementação de filtros morfológicos, os quais consistem em filtros não lineares baseados em operações morfológicas. Os filtros morfológicos mais comuns são a abertura, o fechamento, a n-abertura, o n-fechamento e os filtros alternados. Segundo [20], uma transformação ξ é um filtro morfológico se for ao mesmo tempo idempotente e crescente. A transformação ξ é crescente se, dadas duas imagens f : S → K e g : S → K, a seguinte condição é satisfeita [20]: f (u) ≤ g(u) ⇒ ξ(f )(u) ≤ ξ(g)(u), ∀u ∈ S. (14) Por sua vez, a transformação ξ é idempotente se [20]: ξξ(f )(u) = ξ(f )(u), ∀u ∈ S, 7 (15) Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais ou seja, se ξ é idempotente, a imagem f não é alterada por aplicações sucessivas da mesma transformação ξ. O filtro morfológico de abertura é utilizado para “eliminar” regiões claras na imagem que não possam estar contidas no elemento estruturante. Assim, a abertura realiza na imagem uma espécie de “peneiramento” dos pontos claros. Como resultado, fazendo uma analogia entre uma imagem em nı́veis de cinza e um relevo topográfico, os picos (pontos de máximo ou regiões mais claras) inferiores em tamanho ao elemento estruturante são “eliminados”. Matematicamente, a abertura de f : S → [0, 1] pelo elemento estruturante g : S → [0, 1], denotada γg (f ), é a transformação de [0, 1]S em [0, 1]S definida por [20]: γg (f ) := δg g (f ). (16) A abertura γg (f ) é uma transformação anti-extensiva, pois: γg (f )(u) ≤ f (u), ∀u ∈ S. (17) O filtro morfológico de fechamento é utilizado para “eliminar” regiões escuras na imagem que não possam estar contidas no elemento estruturante. Assim, o fechamento realiza na imagem uma espécie de “peneiramento” dos pontos escuros. Como resultado, novamente utilizando uma analogia entre uma imagem em nı́veis de cinza e um relevo topográfico, os vales (pontos de mı́nimo ou regiões mais escuras) inferiores em tamanho ao elemento estruturante são “eliminados”. Matematicamente, o fechamento de f : S → [0, 1] pelo elemento estruturante g : S → [0, 1], denotado φg (f ), é a transformação de [0, 1]S em [0, 1]S definida da forma que segue [20]: φg (f ) := g δg (f ). (18) O fechamento φg (f ) é uma transformação extensiva, pois: f (u) ≤ φg (f )(u), ∀u ∈ S. (19) A n-abertura de f : S → [0, 1] por g : S → [0, 1], denotada γgn (f ), é definida da forma que segue [20]: γgn (f ) := δgn ng (f ). (20) O n-fechamento de f : S → [0, 1] por g : S → [0, 1], denotado φng (f ), é definido como segue [20]: φng (f ) := ng δgn (f ). (21) Dentre as ferramentas da Morfologia Matemática para a descrição de tamanho e forma em análise de imagens, as granulometrias constituem algumas das mais utilizadas. A idéia básica de uma granulometria é realizar diversas crivagens (ou peneiramentos) seguidas de medições quantitativas dos resı́duos, tais como medição de área ou perı́metro. Ou seja, realiza-se um peneiramento da imagem original utilizando uma certa peneira e depois medem-se os grãos que passaram; em seguida, utiliza-se uma peneira com furos menores e novamente se medem os resı́duos, e assim por diante. No caso, o tamanho dos furos da peneira é determinado pela dimensão do elemento estruturante utilizado na transformação granulométrica. A famı́lia de transformações {ψj }, parametrizadas com um parâmetro j ≥ 0, onde ψ0 (f )(u) = f (u), ∀u ∈ S, f : S → [0, 1], é chamada de uma granulometria se constituir um critério de forma [10], ou seja: ψj (f )(u) ≤ f (u), (22) f (u) ≤ g(u) ⇒ ψj (f )(u) ≤ ψj (g)(u), (23) ψj [ψk (f )](u) = ψk [ψj (f )](u) = ψmax(j,k) (f )(u), ∀j, k ≥ 0, (24) ∀u ∈ S, onde g : S → [0, 1]. A última condição expressa a idéia intuitiva de que dois peneiramentos seguidos são equivalentes a um só peneiramento com a peneira de buracos menores (max(j, k)), já que o ı́ndice j da transformação ψj expressa o rigor do peneiramento: quanto maior o j, mais rigoroso o peneiramento, ou seja, menores os grãos passantes. É possı́vel demonstrar que o conjunto de transformações morfológicas que constitui um critério de forma é o conjunto das j-aberturas por um elemento estruturante disco digital [10]. Os discos digitais mais elementares são o quadrado 3 × 3 e a cruz 3 × 3 [10]. Assim, {γgj } é uma granulometria, onde j ≥ 0 e g é um disco digital. Logo, uma granulometria passa a ser expressa da forma {ψj = γgj }, r ≥ 0, onde g é um disco digital [10]. Analogamente, define-se uma anti-granulometria como sendo o conjunto dos j-fechamentos {φjg }, onde j ≥ 0 e g é um disco digital [10]. Seja uma imagem f : S → [0, 1]. A função V : Z+ → R é definida como sendo [10]: X V (k) = γgk (f )(u), (25) u∈S 8 Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais onde g é a cruz ou o quadrado 3 × 3. Assim, a função Ξ : Z+ → [0, 1] é definida da forma que segue: Ξ[k] = 1 − V (k) , k ≥ 0. V (0) (26) Considerando a imagem f um conjunto aleatório e observando que Ξ é uma função monotônica, crescente e limitada em [0, 1], pois V (k + 1) < V (k), ∀k ≥ 0, podemos afirmar que Ξ é uma função de distribuição acumulada discreta associada à imagem f [10]. Assim, pode-se definir uma função densidade discreta ξ : Z+ → R+ por meio da diferença: ξ[k] = Ξ[k + 1] − Ξ[k], k ≥ 0. (27) A função densidade definida na equação 27 é denominada espectro de padrões [10]. O espectro de padrões, ou espectro morfológico, é uma espécie de histograma de tamanho e forma, sendo único para uma imagem especı́fica f e um determinado elemento estruturante g, desde que f seja binária [10]. Uma vez que as transformações granulométricas têm a propriedade de “espalhar” informações de tamanho e forma nas imagens resı́duo, muitas outras representações diferentes do histograma de padrões dos objetos de interesse podem ser geradas, desde que uma quantidade adequada de transformações seja utilizada. Como é de se esperar, o número de transformações (ou peneiramentos) necessário, ou seja, o maior valor de k, varia de acordo com a aplicação, pois está diretamente associado à dimensão do vetor de atributos a ser utilizado na aplicação de reconhecimento de padrões. 2.6 Triagem virtual A Triagem Virtual consiste em agrupar imagens médicas semelhantes para facilitar a sua distribuição para os especialistas responsáveis pela análise de imagens e, por conseguinte, pelo diagnóstico. Neste trabalho foi estudada uma aplicação baseada em imagens de imuno-histoquı́mica da placenta e do pulmão do tipo CD68 [26, 27]. Essas imagens são utilizadas para se poder auxiliar o patologista no seu diagnóstico fazendo comparação com outros pacientes e seus respectivos diagnósticos. Fazendo a comparação visual ou com o auxı́lio de algum programa o patologista pode analisar o caso atual de maneira a reduzir a probabilidade de erro. A busca de imagens em uma base de imagens médicas pode ser prejudicada por fatores como os que seguem: 1. As imagens foram agrupadas de maneira subjetiva: influência da subjetividade de cada patologista na análise pode gerar inconsistências no agrupamento; 2. A recuperação das imagens pode retornar um número insuficiente de imagens ou um conjunto de imagens com pouca relevância com o problema; 3. O sistema pode demorar muito para recuperar imagens relevantes: mesmo que o sistema recupere uma quantidade grande de imagens relevantes, a quantidade de tempo gasta com essa recuperação também é importante para o usuário. Neste trabalho as imagens são representadas por meio de vetores de atributos construı́dos usando uma concatenação dos espectros de padrões das bandas R, G e B que compõem as imagens coloridas; em seguida são feitos estudos usando PCA para redução da dimensionalidade do vetor de atributos, objetivando a redução do custo computacional na tarefa de classificação. Assim, a metodologia de busca da solução do problema de triagem virtual estudado neste trabalho foi dividida em cinco etapas: (1) pré-processamento, (2) segmentação das imagens, (3) construção dos espectros de padrões, (4) análise PCA sobre os espectros e (5) uso de SOM-LVQ e MLP para classificar os vetores de caracterı́sticas. Essas etapas são ilustradas no esquema da Figura 1. Na última fase foram utilizados conjuntos de treino e teste para poder avaliar quantitativamente a taxa de acertos na triagem das imagens. A segmentação das imagens R, G e B foi feita com uma implementação de k-médias com 4 classes. As imagens utilizadas foram analisadas e na média existiam de 3 a 6 classes com o maior número de pixels. Dentre essas classes, apenas 4 seriam suficientes para representar as imagens. Com isso, foram escolhidas 3 classes para representar os objetos presentes na imagem, enquanto uma quarta classe representa fundo da imagem. Ao fim da segmentação a quarta classe é removida, restando apenas três classes. Foram calculados os espectros de padrões para as imagens R, G e B usando 25 iterações para compor cada espectro, ficando assim cada banda espectral com um espectro de 25 atributos. Em seguida esses espectros foram concatenados em um vetor único, obtendo-se ao fim um vetor de 75 dimensões. A análise PCA foi o passo que teve como entrada a matriz unificada gerada, que representava as imagens dos dois tipos. Essa matriz foi processada para obter a menor representação, i.e. com a menor quantidade de atributos, mas mantendo uma boa representação dos dados. Foi usada uma rede SOM-LVQ e uma rede MLP para classificar os dados usando a validação cruzada como condição de parada da rede. As duas redes foram testadas usando a matriz resultante da análise PCA e a matriz sem o uso da análise PCA. A classificação foi dividida em duas etapas, como descrito adiante. Primeiro foi feita uma análise para se descobrir a melhor configuração de rede para o problema. Para isso foi estabelecida uma bateria de testes que fez os treinamentos da rede variando a quantidade de neurônios na camada escondida. Foram utilizados de 10 a 30 neurônios com 20 repetições para cada rede. Em cada passo foi guardada a melhor rede, baseando-se na taxa de 9 Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais Figura 1: Metodologia empregada: etapas da classificação para triagem virtual 10 Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais (a) (c) (b) (d) Figura 2: Tipos de imagens de imuno-histoquı́mica CD68: (a) NP com mais zoom; (b) NP com menos zoom; (c) P com mais zoom; e (d) P com menos zoom. acertos e na média de acertos de todas as redes. O segundo passo foi repetir os testes com a melhor rede e obter a média, desvio padrão e mediana da taxa de acertos. A matriz de entrada foi dividida em 19% para teste e 81% para treino e os valores foram embaralhados no inı́cio dos treinos. Com isso, o resultado obtido foi uma comparação da abordagem usando o PCA, para reduzir a complexidade, mas com o intuito de manter uma boa representação das imagens com uma abordagem de referência usando todos os parâmetros do vetor de entrada. Neste trabalho foram utilizadas imagens de imuno-histoquı́mica CD68 da placenta e do pulmão [26, 27]. As imagens foram diferenciadas pela nomenclatura P (pulmão) e NP (placenta). As imagens foram adquiridas usando dois tipos de zoom. A Figura 2 ilustra quatro de todas as imagens utilizadas. A base de dados tem um total de 113 imagens, sendo 53 imagens do tipo NP e 60 imagens do tipo P. 3 Resultados Experimentais As imagens na aplicação de CBIR de Triagem Virtual foram representadas usando vetores multidimensionais baseados nos seguintes passos, e com os resultados que seguem: 1. Cada imagem foi separada em bandas R, G e B; 2. Cada banda foi segmentada, resultando uma imagem com quatro clusters, sendo o maior retirado; 3. Foi construı́do o espectro de padrões da cada banda resultando em um vetor de 25 dimensões. Depois de serem unificados, resultaram em um vetor de 75 dimensões. As classes de imagens NP e P ficaram com matrizes 53 por 75 e 60 por 75, respectivamente. Por fim, foi gerada a matriz de caracterı́sticas para representar a base de dimensão 113 por 75 pela união dessas duas matrizes; 4. A análise PCA reduziu a complexidade da base para uma matriz 113 por 50. Obteve-se assim uma redução de 33,33% na quantidade de atributos da matriz. Ou seja, uma redução de cerca de 1/3. Os testes de agrupamento das imagens foram feitos em duas etapas. Para implementar o método proposto para triagem virtual foi usado o ambiente Matlab na versão R2007b como plataforma para construção, teste e treinamento da metodologia proposta. 11 Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais Foram utilizados 22 padrões para teste e 91 padrões para treinamento. Desses valores de teste, 11 eram do tipo NP e 11 eram do tipo P. Dos 91 padrões para treinamento, 42 eram do tipo NP e 49 eram do tipo P. Todos os treinamentos usaram validação cruzada com parte dos dados de treinamento. Após a primeira etapa de classificação foram geradas estatı́sticas para embasar a seleção da melhor rede. Os resultados são mostrados na Tabela 2, com a rede utilizada, a quantidade de atributos que foram usados como entrada da rede (m), a taxa de acerto da melhor rede (ηOTM ), a média (η̄), o desvio padrão (∆η), a mediana (ηMED ) e a quantidade de neurônios da melhor rede (nOTM ). Tabela 2: Resultados da primeira etapa da classificação, usando PCA (m = 50) e sem uso do PCA (m = 75) Rede MLP SOM LVQ m 50 75 50 75 ηOTM (%) 95,23 90,47 66,66 80,95 η̄ ± ∆η (%) 57,05 ± 0,48 53,83 ± 0,47 50,49 ± 0,23 47,14 ± 0,15 ηMED (%) 68,18 50,00 40,91 50,00 nOTM 22 19 10 17 Nas Tabelas 2 e 3 são apresentados os resultados para MLP e SOM-LVQ, considerando quantidades de atributos 50 e 75, com e sem o uso de PCA, respectivamente. Para as redes MLP usando padrões obtidos com o uso de PCA (m = 50) foi observada uma média de acertos de 57,05% e um desvio padrão de 0,48%; no entanto, foi observada uma mediana distante da média (mediana de 68,18%), indicando que houve resultados dı́spares em relação à média. Isso fica evidente quando se observa a taxa de acerto da melhor rede, de 95,23%. Neste caso, a rede com 22 neurônios na camada escondida foi escolhida como a melhor rede, baseando-se na sua alta taxa de acertos. No caso das redes MLP sem usar padrões obtidos com PCA (m = 75) foi observada uma média de acertos de 53,83% e um desvio padrão de 0,47%; porém não foi observada uma mediana tão distante da média (mediana de 50,00%), indicando que os resultados estavam mais simétricos. Neste caso, a rede com 19 neurônios na camada escondida foi escolhida como a melhor rede, baseando-se na sua alta taxa de acertos de 90,47%. Para as redes SOM-LVQ com o uso de PCA (m = 50) foi observada uma redução na média de acertos das redes em comparação com as redes MLP. Com uma média de acertos de 50,49% e um desvio padrão de 0,23%. Como nas redes anteriores, foi observada uma mediana distante da média (mediana de 40,91%), indicando que houve resultados dı́spares em relação à média. Contudo, o baixo valor do desvio padrão indica que os valores das taxas de acertos para as redes não oscilaram muito em relação à média. Assim, a rede com 10 neurônios na camada escondida foi escolhida como a melhor rede, com uma taxa de acerto de 66,66%. Para as redes SOM-LVQ, sem usar padrões obtidos com PCA (m = 75), observou-se também uma redução da efetividade de acertos da rede em comparação com as redes MLP, com uma média de acertos de 47,14% e um desvio padrão de 0,15, com uma mediana não muito distante da média (mediana de 50,00%) indicando que não houve resultados dı́spares em relação à média, embora possa ser notado com clareza que a taxa de acerto da melhor rede foi bastante alta: 81%. Neste caso, a rede com 17 neurônios na camada escondida foi escolhida como a melhor rede, baseando-se na sua alta taxa de acertos. Depois de selecionar as melhores redes, na segunda etapa foram obtidos os resultados da Tabela 3. Tabela 3: Resultados da segunda etapa da classificação, usando PCA (m = 50) e sem uso do PCA (m = 75) Rede MLP SOM LVQ m 50 75 50 75 η̄ ± ∆η (%) 60,95 ± 0,47 55,71 ± 0,49 52,85 ± 0,21 49,76 ± 0,15 ηMED (%) 70,45 68,18 36,36 45,45 ηOTM (%) 80,95 80,95 61,90 71,42 Para as redes MLP usando padrões obtidos com PCA (m = 50), foi observada uma média de acertos de 60,95%, um desvio padrão de 0,47%, e uma mediana de 70,45%, indicando uma certa distância entre as taxas de acertos das redes. Isso fica mais claro quando se observa a taxa de acerto da melhor rede, de 80,95%. No caso das redes MLP sem usar padrões obtidos com PCA (m = 75), obteve-se uma média de acertos de 55,71%, desvio padrão de 0,49% e mediana de 68,18%. A melhor rede teve uma taxa de acerto de 80,95%. Foi obtido, assim, um resultado parcialmente similar àquele obtido para as redes com PCA, porém com uma média de acertos inferior. Para as redes com SOM-LVQ usando padrões com PCA (m = 50), novamente foi observada uma redução na média de acertos das redes em comparação com as redes MLP. Observou-se uma taxa de acertos de 52,85%, um desvio padrão de 0,21%, e uma mediana de 36,36%. O baixo desvio padrão e o valor da mediana sugerem uma razoável assimetria entre os dados. Contudo a taxa de acerto da melhor rede não ficou tão distante da média: 61,90%. No caso das redes SOM-LVQ sem usar padrões obtidos com PCA (m = 75), obteve-se uma média de acertos de 49,76%, uma média de 0,15%, e mediana de 45,45%. Porém, mesmo com o valor relativamente baixo de desvio padrão e a proximidade entre mediana e média, obteve-se uma melhor rede com uma taxa de acerto de 71,42%, ficando acima da melhor rede SOM-LVQ com PCA. 4 Discussão e Conclusões O uso de redes MLP no método de triagem virtual proposto neste trabalho resultou numa taxa de acerto de 81%, o que pode ser considerado razoável, uma vez que a triagem virtual desempenha o papel de pré-classificação. Contudo, para validar a proposta, seria necessário realizar uma triagem usando especialistas humanos, especificamente patologistas. Este trabalho busca 12 Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais na verdade ser uma prova de conceito, mostrando que é possı́vel aplicar a ideia de CBIR para desenvolver um sistema de triagem virtual para otimizar o trabalho de análise de imagens realizado por especialistas humanos, usando o espectro de padrões para representar as imagens, sendo este o maior diferencial deste trabalho em relação a outras aplicações de CBIR. Os resultados obtidos indicam que o uso de PCA para reduzir a quantidade de atributos suficiente para representar os dados reduziu o custo computacional, dado que reduziu a dimensionalidade, e aumentou a taxa de acerto da classificação. Nas redes MLP houve uma melhora de aproximadamente 9% da taxa de acerto com o uso de PCA. Já nas redes SOM-LVQ houve uma melhora de 6% em relação à taxa de acertos com o uso de PCA. As redes MLP se mostraram mais adequadas ao problema, com alta taxa de acerto nas melhores redes: 81%. As redes SOM-LVQ obtiveram resultados não tão razoáveis nas suas classificações. As redes obtiveram uma melhor rede com uma taxa de 71,4% sem usar PCA superior a melhor rede com o uso de PCA, indicando que, nesse caso, as redes SOM-LVQ necessitam de mais informações para poder ter uma melhor generalização e por conseguinte se adequar ao problema em questão. A comparação dos resultados da triagem usando MLP e SOM mostrou que as redes MLP se adequaram melhor ao problema, com uma maior taxa de acerto. Uma das dificuldades encontradas foi o alto custo computacional aparente necessário para obtenção dos espectros de padrões das imagens, já que era calculado o espectro para cada banda de uma imagem e isso era repetido para toda a base. Depois de gerado os vetores, o treinamento para se obter as melhores redes exigia um tempo de processamento também razoável. Como trabalho futuro podem ser investigadas arquiteturas paralelas para otimização do tempo dispendido no cálculo dos espectros de padrões, buscando paralelizar ao máximo a execução das granulometrias. Referências [1] G. Gagaudakis and P. L. Rosin. “Shape measures for image retrieval”. Pattern Recognition Letters, vol. 24, no. 15, pp. 2711–2721, 2003. [2] G. Gagaudakis and P. L. Rosin. “Incorporating shape into histograms for CBIR”. Pattern Recognition, vol. 35, no. 1, pp. 81–91, 2002. [3] C. A. B. Castañón. “Recuperação de imagens por conteúdo através de análise multiresolução de Wavelets”. Master’s thesis, Instituto de Ciências Matemáticas e de Computação da Universidade de São Paulo, São Paulo, Brasil, 2003. [4] T. S. H. Y. Rui and S. F. Chang. “Image Retrieval: Current Techniques, Promising Directions, and Open Issues”. Journal of Visual Communication and Image Representation, vol. 10, no. 1, pp. 39–62, 1999. [5] A. Zhang, R. S. Aygün and Y. Song. “Feature-based retrieval in visual database systems”. In Multimedia Information Retrieval and Management: Technological Fundamentals and Applications, edited by D. Feng, W. C. Siu and H. J. Zhang, New York, 2003. Springer-Verlag. [6] H. K. Huang. “PACS, image management and imaging informatics”. In Multimedia Information Retrieval and Management: Technological Fundamentals and Applications, edited by D. Feng, W. C. Siu and H. J. Zhang, New York, 2003. Springer-Verlag. [7] T. W. Cai, D. D. Feng and R. Fulton. “Content-based retrieval for medical data”. In Multimedia Information Retrieval and Management: Technological Fundamentals and Applications, edited by D. Feng, W. C. Siu and H. J. Zhang, New York, 2003. Springer-Verlag. [8] F. Long, H. Zhang and D. D. Feng. “Fundamentals of content-based image retrieval”. In Multimedia Information Retrieval and Management: Technological Fundamentals and Applications, edited by D. Feng, W. C. Siu and H. J. Zhang, New York, 2003. Springer-Verlag. [9] J. S. jin. “Indexing and retrieving high dimensional visual features”. In Multimedia Information Retrieval and Management: Technological Fundamentals and Applications, edited by D. Feng, W. C. Siu and H. J. Zhang, New York, 2003. SpringerVerlag. [10] U. M. Braga Neto. “Reconstrução Volumétrica e Análise de Imagens Tridimensionais por Morfologia Matemática”. Master’s thesis, Faculdade de Engenharia Elétrica da Universidade Estadual de Campinas, Campinas, Brasil, 1994. [11] A. Antani, L. R. Long, G. R. Thoma and R. J. Stanley. “Vertebra shape classification using MLP for content-based image retrieval”. In Proceedings of the International Joint Conference on Neural Networks, pp. 160–165. IEEE, 2003. [12] K. K. Seo. “An application of one-class support vector machines in content-based image retrieval”. Expert Systems with Applications, vol. 33, no. 2, pp. 491–498, 2007. [13] Z. L. Kovács. Redes Neurais Artificiais: Fundamentos e Aplicações. Acadêmica São Paulo, São Paulo, 1996. [14] A. P. Braga, A. C. P. L. F. Carvalho and T. B. Ludermir. Redes Neurais Artificiais: Teoria e Aplicações. LTC, São Paulo, 2000. 13 Learning and Nonlinear Models - Revista da Sociedade Brasileira de Redes Neurais (SBRN), Vol. XX, No. XX, pp. XX-XX, 2010 c Sociedade Brasileira de Redes Neurais [15] J. Sklansky and G. N. Wassel. Pattern Classifiers and Trainable Machines. Springer-Verlag, first edition, 1981. [16] S. Arik. “An Analysis of Exponential Stability of Delayed Neural Networks with Time Varying Delays”. Neural Networks, , no. 17, pp. 1027–1031, 2004. [17] F. M. Ham and I. Kostanic. Principles of Neurocomputing for Science and Engineering. McGraw-Hill, 2001. [18] F. A. Sala, F. M. Azevedo and F. I. M. Argoud. “Mapas de Kohonen na detecção de eventos epileptogênicos”. In III Congresso Latino-Americano de Engenharia Biomédica, pp. 533–536, João Pessoa, Brasil, 2004. Sociedade Brasileira de Engenharia Biomédica. [19] S. Haykin. Redes Neurais: Princı́pios e Prática. Bookman, Porto Alegre, 2001. [20] A. L. B. Candeias. “Aplicação da Morfologia Matemática à Análise de Imagens de Sensoriamento Remoto”. Ph.D. thesis, Departamento de Computação Aplicada do Instituto Nacional de Pesquisas Espaciais, São José dos Campos, Brasil, 1997. [21] D. Landgrebe. “Hyperspectral Image Analysis”. IEEE Signal Processing Magazine, Jan 2002. [22] R. Klette and P. Zamperoni. Handbook of Image Procesing Operators. John Wiley & Sons, first edition, 1995. [23] E. R. Dougherty and C. R. Giardina. Matrix Structured Image Processing. Prentice Hall, 1987. [24] G. J. F. Banon and J. Barrera. Bases da Morfologia Matemática para Análise de Imagens Binárias. UFPE-DI, 1994. [25] P. Soille. Morphological Image Analysis: Principles and Applications. Springer-Verlag, New York, 2004. [26] W. P. Santos. “Análise de Imagens Digitais em Patologia utilizando Morfologia Matemática e Lógica Nebulosa”. Master’s thesis, Programa de Pós-Graduação em Engenharia Elétrica da Universidade Federal de Pernambuco, Recife, Brasil, 2003. [27] W. P. Santos, A. L. B. Candeias, A. F. S. Bezerra and A. F. D. Silva. “Auxı́lio ao Diagnóstico da Doença da Membrana Hialina utilizando Análise de Imagens por Lógica Nebulosa”. In III Congresso Latino-Americano de Engenharia Biomédica, pp. 1243–1246, João Pessoa, Brasil, 2004. Sociedade Brasileira de Engenharia Biomédica. 14
9cs.NE
JOURNAL, VOL. XX, NO. X, 2017 1 Unsupervised Despeckling Deepak Mishra, Santanu Chaudhury, Mukul Sarkar and Arvinder Singh Soin arXiv:1801.03318v1 [cs.CV] 10 Jan 2018 Abstract Contrast and quality of ultrasound images are adversely affected by the excessive presence of speckle. However, being an inherent imaging property, speckle helps in tissue characterization and tracking. Thus, despeckling of the ultrasound images requires the reduction of speckle extent without any oversmoothing. In this letter, we aim to address the despeckling problem using an unsupervised deep adversarial approach. A despeckling residual neural network (DRNN) is trained with an adversarial loss imposed by a discriminator. The discriminator tries to differentiate between the despeckled images generated by the DRNN and the set of high-quality images. Further to prevent the developed DRNN from oversmoothing, a structural loss term is used along with the adversarial loss. Experimental evaluations show that the proposed DRNN is able to outperform the state-of-the-art despeckling approaches. Index Terms Ultrasound image, speckle, deep learning, GAN. I. I NTRODUCTION Speckle extent or size of speckle in ultrasound (US) images is a function of axial and lateral resolution of ultrasonic transducers. The transducers with small apertures are convenient to use, however, produce images with large speckle extent due to their poor lateral resolution [1]. The reduction of speckle extent in such images is required to improve the image contrast and diagnostic quality [2]. However, an excessive speckle filtering results in loss of the features presented by speckle characteristics [3], [4]. Thus, despeckling of US images is basically the reduction of speckle extent without losing the characteristics details of tissues. Manuscript received X, XXXX. D. Mishra, S. Chaudhury and M. Sarkar are with the Electrical Engineering department, Indian Institute of Technology Delhi, 110016 New Delhi, India. (e-mail: [email protected], [email protected], [email protected]). A. S. Soin is with the Medanta Hospital, Gurgaon, India. (e-mail: [email protected]) JOURNAL, VOL. XX, NO. X, 2017 2 The conventional approaches consider speckle as noise and try to reduce inter-pixel intensity variations [5]–[15]. Most of these approaches suffer from oversmoothing and generate images with artificial appearances. Few recent approaches, for example [3], [4], [16], prohibit the filtering in high echogenicity regions to reduce the oversmoothing effect. However, they end up with no despeckling in the images of the organs containing large volumes of parenchymal tissues like liver. Further, these approaches require a precise tuning of the implementation parameters for every input image to obtain the desired results. Speckle reduction has also been modeled as an optimization problem in [17]–[19]. However, these approaches result in suboptimal performances due to oversimplified assumptions for example the speckle is assumed to have multiplicative nature, which is not entirely correct for the US images [20]. Considering despeckling as an optimization problem, it can be solved using supervised and unsupervised learning. The supervised learning approaches appear to be impractical due to the unavailability of the required annotated training data. Hence, in this work, a deep unsupervised learning method is proposed to reduce speckle extent while preserving the characteristic details. A deep residual network (ResNet) [21], as a part of a generative adversarial network (GAN), is trained to produce the despeckled images. GANs have recently been used in several computer vision applications for natural images [22]– [27]. However, their use in US images is been limited to simulated data generation [28]. In this work, GAN is used for US image despeckling and to best of our knowledge, this is the first attempt to use GAN for the processing of US images. Concurrent to this work, a GAN with Wasserstein distance and perceptual similarity for CT image denoising is proposed in [29], however the contrasting nature of the imaging modalities differentiates the two works. The unsupervised training of the developed despeckling residual neural network (DRNN) is accomplished in two steps. The DRNN, which is used as the generator in GAN framework, is first trained to reproduce the inputs. Later, it is combined with a discriminator network and trained for the despeckling. A convolutional neural network (CNN) is used as the discriminator. Two sets of liver US images are created for GAN training. One set contains low-quality US images with high speckle extent whereas the second set contains the images with high contrast and considerably less speckle. During training, the generator network learns to reduce the speckle extent of the poor quality images and produce similar speckle characteristics as the better quality set. The generator is trained with the adversarial loss imposed by the discriminator. However, to prevent the generator from copying the data from the high-quality set and maintaining the characteristic details of the input, the adversarial loss is combined with a structural loss. The structural loss works as a regularizer and helps in producing the desired outputs. The paper is organized as follows. Section II provides the details of the proposed method. Section III presents the experimental results which are compared with the existing approaches. Finally, conclusions JOURNAL, VOL. XX, NO. X, 2017 3 Fig. 1. Despeckling or generator network architecture. The first convolutional (Conv) layer contains 7×7 kernels and has 64 channels (ch). It is combined with batch normalization (Batch Norm) and rectified linear units (ReLU). The first layer is followed by a chain of six ResNet blocks and a final Conv layer. Fig. 2. Discriminator network architecture. The strided convolutional layers are used to avoid the maxpooling layers along with the Leaky ReLU (α = 0.2). The final output is a single value from the sigmoid activation. are presented in section IV. II. M ETHOD In this work, US image despeckling is modeled as a single image input-output problem where the objective is to get a high-quality low speckle extent image (x̂) given the speckle contaminated lowquality US image (x). GAN architecture used to accomplish the desired objective is explained below. A. Network Architecture GANs combine generative and discriminative models to implicitly learn the distribution of output class. The architecture of the generator (G) used in this work is shown in Fig. 1. It contains a convolutional layer with batch normalization and rectified linear non-linearities (ReLU), followed by a chain of six ResNet blocks [21] and a final convolutional layer for the desired output. As shown in Fig. 1, each ResNet block contains three convolutional layers and weighted shortcut connection between input and output of the block. Each convolutional layer, except the final layer, has 64 channels and is combined with batch normalization and ReLU non-linearities. JOURNAL, VOL. XX, NO. X, 2017 4 Similarly, the architecture of the discriminator (D) is shown in Fig. 2. The findings of [23] are adopted to build this network. All convolutional layers contain 3×3 kernels and are combined with leaky ReLU (α = 0.2) [30], [31] non-linearities. Further, strided convolutions, with stride of 2, are used to avoid the pooling layers. The number of channels is doubled after the strided convolution to have a uniform computational complexity of each convolutional layer. A global average pooling layer [32] is used after the final convolutional layer to have a flexible input size and avoid overfitting associated with the conventional fully connected layers with a large number of neurons. At the end, a single neuron fully connected layer with sigmoid activation is used to get the desired output. B. Training The generator G is first trained to reproduce the input using `1 loss as:   L1 (θ) = Ex ||G(x; θ) − x||1 (1) where θ represent the parameters of G, ||.|| is the `1 norm and E[.] represents the expectation. G is trained for 100 epochs on the samples of size 192×192 obtained by randomly cropping the low-quality speckled images. Adam optimizer [33] with an initial learning rate of 10−4 is used to optimize the parameters θ. The batchsize used for training is 16. Similarly, D is trained to distinguish between the samples drawn from the set of high-quality US images (y ) and the despeckled images (G(x; θ)) generated from the set of low-quality speckled US images (x). The binary cross-entropy loss used in the training is:     LD (φ) = Ey − log (D(y; φ)) + Ex − log (1 − D (G(x; θ); φ)) (2) where φ represents the parameters of D, which is trained for 5 epochs on the samples of size 128×128. The training samples are randomly cropped in equal proportion from the high-quality US images and the despeckled images generated by G. As the output of D is a value resulting in from the sigmoid activation, the target labels for y and (G(x; θ)) are 1 and 0, respectively. D is trained using Adam optimizer with an initial learning rate of 10−6 and batchsize 80. The initial training of G and D is followed by the training of the two networks in GAN framework. Same input sizes as the initial training, but half of the batchsizes, are used due to the memory limitation of the available hardware (Nvidia GeForce GTX 1080 GPU, 8GB). D is trained with the same loss as (2), however, G is trained with a combination of adversarial and structural loss given by (3).   LG (θ) = Ex − log (D (G(x; θ); φ)) + λ (L1 (θ) + LMS-SSIM (θ)) (3) JOURNAL, VOL. XX, NO. X, 2017 5 First term in (3) is the adversarial loss. In presence of this loss, the parameters θ are optimized such that the generated images are close to the high-quality US images. Further, the minimization of adversarial loss helps G to implicitly learn the features used by D to distinguish the high-quality US images and the generated despeckled images. However, to avoid the overestimation of the features, which may result in loss of input image characteristics, the structural loss, downweighted with the parameter λ(= 0.5), is used. Recent works on despeckling [3], [4] show that the structural similarity index measure (SSIM) [34] is an important metric to evaluate the effect of overfilteirng. Further, as reported in [35], a combination of `1 and multi-scale SSIM (MS-SSIM) loss is useful to obtain perceptually correct images. Thus, the structural loss is defined as the sum of L1 (θ) and LMS-SSIM (θ) losses, where L1 (θ) is given by (1) and LMS-SSIM (θ) is defined as [35]:  M Y LMS-SSIM (θ) = 1 − Ex lM (θ).  csj (θ) (4) j=1 lM (θ) = csj (θ) = 2µx µx̂ + C1 µ2x + µ2x̂ + C1 j 2σxx̂ + C2 (5) 2 (6) µx = Gσ ∗ x (7) σxj = Gσj ∗ x2 − µ2x (8) j σxx̂ = Gσj ∗ (x.x̂) − µx µx̂ (9) 2 σxj + σx̂j + C2 2 where x̂ = G(x; θ) is the despeckled image generated by G. Gσj is the Gaussian kernel used to calculate mean and variances of the input and output images. σ j is the standard deviation of Gσj where j ∈ {1, 2, ..., M } represents the size or scale of the kernel. “∗” and “.” represent convolution and element- wise multiplication, respectively. The small constants C1 and C2 are added for stability. In this work C1 and C2 are chosen to be 0.01. GAN is trained for 500 iterations. The parameters θ and φ are optimized by alternatively minimizing LG (θ) and LD (φ). In a single iteration of GAN, D is trained once whereas G is trained for 20 times. The Adam optimizer with an initial learning rate of 10−6 for D and an order less for G is used. In each iteration, 50% of samples in a minibatch used by D are randomly selected from the high-quality set and remaining 50% are generated by G from the high speckle extent low-quality images. However, instead of generating all the 50% samples using the current G(θ), 25% samples are obtained from a buffer of the despeckled samples generated during the previous iterations. The buffer is updated after every iteration by replacing the old despeckled samples with the current ones, equal to the 25% of the minibatch size. JOURNAL, VOL. XX, NO. X, 2017 6 (a) Image from RAB6-D scanner (b) Image from X7-2t scanner Fig. 3. Examples of (a) low speckle extent image (y) acquired using RAB6-D probe, (b) high speckle extent image (x) acquired using X7-2t probe. As reported in [27], the buffering helps in the stabilization of the GAN training. The networks are is build on keras [36]. III. E XPERIMENTS AND R ESULTS A. Data The RAB6-D convex array transducer with larger side of the aperture as 63.6 mm from GE Healthcare is used to acquire US images with low speckle extent. On the other hand, the US images with high speckle extent are acquired using the Philips X7-2t sector array probe with considerably smaller aperture and transducer elements. Acquisition is done in accordance with the regulations prescribed for medical experiments and with the full consent of the subjects. Sample images from the two probes are shown in Fig 3. Both the US images in Fig 3 show liver of healthy subjects. However, the high speckle extent in the image from X7-2t probe affects the tissue contrast and detectability. Given the smaller aperture, the reduction in speckle extent can increase the utility of the probe for applications like intra-operative navigation and control. The initial trainings of G and D are performed using 12,000 and 4,000 samples extracted from the images acquired using the two probes. For GAN training, all the images acquired using the two probes are cropped to the respective input sizes using a moving window with 50% overlap. The total number of low-quality (x) and high-quality (y ) samples available for training are 24,620 and 9,613, respectively. B. Experimental results Performance of the proposed method is compared with DPAD [9], OBNLM [13], SBF [5], RTAD [15], ADMSS [3], EAGF [2] and EPPRSRAD [4]. The implementation parameter values for DPAD, OBNLM, JOURNAL, VOL. XX, NO. X, 2017 7 (a) DPAD (b) OBNLM (c) SBF (d) RTAD (e) ADMSS (f) EAGF (g) EPPRSRAD (h) Proposed Fig. 4. Despeckled outputs obtained using different approaches. PDFs observed from the reference (y), input (x) and output (x̂) are also shown. The proposed method results in the PDF closest to the reference. SBF and EAGF are obtained from [2]. For the remaining methods, the values are taken from [4]. To compare the performance, two parenchymal regions of similar dimensions are identified in the images shown in Fig. 3. The probability density function (PDF) of the pixel intensities inside the marked regions are used to qualitatively compare the speckle characteristics. The PDFs obtained from the low speckle extent image (y , Fig. 3(a)), input image (x, Fig. 3(b)) and the despeckled images (x̂) are shown in Fig. 4. The despeckled outputs are also shown in Fig. 4. The closest match to the desired PDF is produced by JOURNAL, VOL. XX, NO. X, 2017 8 TABLE I Q UANTITATIVE EVALUATION OF DESPECKLING APPROACHES Method SSNRx̂ KL(x,x̂) KL(y,x̂) Input (no filter) 7.2990 0 0.7512 DPAD 9.7542 31.7018 31.5043 OBNLM 25.529 9.5010 0.9810 SBF 20.5514 8.8660 1.5440 RTAD 9.3614 1.9490 0.7325 ADMSS 7.3641 0.3242 0.7547 EAGF 19.3142 5.4180 1.0210 EPPRSRAD 7.5651 0.3428 0.7183 Proposed 12.016 3.0570 0.2107 the proposed method. The observation is further validated by quantitative comparison of the obtained PDFs. KL-divergence is used for this purpose and the observed values are listed in Table I. The smallest value of KL(y,x̂) and a reasonable value of KL(x,x̂) , resulted in by the proposed method reflects its ability to produce the desired speckle characteristics. Further, the speckle extent in the identified regions is measured using the speckle region’s signal to noise ratio (SSNR) [4]. The SSNR value observed from the reference image (y ) is 18.2451. Nearest to this value is resulted in by EAGF, however, it is unable to provide the desired characteristics. In contrast, the proposed method gives optimal performance with a decent SSNR value and the desired speckle characteristics. Further, the proposed method is able to produce the despeckled output in less than 0.3 seconds on GPU and in about 16.5 seconds on CPU which is considerably smaller than the time taken by the approaches like OBNLM. IV. C ONCLUSION In this paper, an unsupervised despeckling approach is presented. The combination of adversarial and structural loss used to train the DRNN results in the despeckled images without losing the characteristic details. A better qualitative and quantitative performance of the proposed approach as compared to the state-of-the-art approaches is observed. The proposed work will provide motivation to explore the possibility of unsupervised deep learning for US image applications. JOURNAL, VOL. XX, NO. X, 2017 9 R EFERENCES [1] K. K. Shung and G. A. Thieme, “Ultrasonic scattering in biological tissues,” CRC press, 1992. [2] D. Mishra, S. Chaudhury, M. Sarkar, and A. S. Soin, “Edge aware geometric filter for ultrasound image enhancement,” Annual Conference on Medical Image Understanding and Analysis, pp. 109–120, 2017. [3] G. Ramos-Llorden, G. Vegas-Sanchez-Ferrero, M. Martin-Fernandez, C. Alberola-Lopez, and S. Aja-Fernandez, “Anisotropic diffusion filter with memory based on speckle statistics for ultrasound images,” IEEE Trans. Image Process., vol. 24, no. 1, pp. 345–358, 2015. [4] D. Mishra, S. Chaudhury, M. Sarkar, A. S. Soin, and V. Sharma, “Edge probability and pixel relativity based speckle reducing anisotropic diffusion,” IEEE Trans. Image Process., 2017. [5] P. C. Tay, C. D. Garson, S. T. Acton, and J. A. Hossack, “Ultrasound despeckling for contrast enhancement,” IEEE Trans. Image Process., vol. 19, no. 7, pp. 1847–1860, 2010. [6] J.-S. Lee, “Speckle analysis and smoothing of synthetic aperture radar images,” Computer graphics and image processing, vol. 17, no. 1, pp. 24–32, 1981. [7] D. T. Kuan, A. Sawchuk, T. C. Strand, P. Chavel et al., “Adaptive restoration of images with speckle,” IEEE Trans. Acoustics, Speech and Signal Process., vol. 35, no. 3, pp. 373–383, 1987. [8] Y. Yu and S. T. Acton, “Speckle reducing anisotropic diffusion,” IEEE Trans. Image Process., vol. 11, no. 11, pp. 1260– 1270, 2002. [9] S. Aja-Fernández and C. Alberola-López, “On the estimation of the coefficient of variation for anisotropic diffusion speckle filtering,” IEEE Trans. Image Process., vol. 15, no. 9, pp. 2694–2701, 2006. [10] Y. Yue, M. M. Croitoru, A. Bidani, J. B. Zwischenberger, and J. W. Clark, “Nonlinear multiscale wavelet diffusion for speckle suppression and edge enhancement in ultrasound images,” IEEE Trans. Med. Imag., vol. 25, no. 3, pp. 297–311, 2006. [11] K. Krissian, C.-F. Westin, R. Kikinis, and K. G. Vosburgh, “Oriented speckle reducing anisotropic diffusion,” IEEE Trans. Image Process., vol. 16, no. 5, pp. 1412–1424, 2007. [12] F. Zhang, Y. M. Yoo, L. M. Koh, and Y. Kim, “Nonlinear diffusion in laplacian pyramid domain for ultrasonic speckle reduction,” IEEE Trans. Med. Imag., vol. 26, no. 2, pp. 200–211, 2007. [13] P. Coupé, P. Hellier, C. Kervrann, and C. Barillot, “Nonlocal means-based speckle filtering for ultrasound images,” IEEE Trans. Image Process., vol. 18, no. 10, pp. 2221–2229, 2009. [14] S. Balocco, C. Gatta, O. Pujol, J. Mauri, and P. Radeva, “Srbf: Speckle reducing bilateral filtering,” Ultrasound Med. Biol., vol. 36, no. 8, pp. 1353–1363, 2010. [15] Y. Deng, Y. Wang, and Y. Shen, “Speckle reduction of ultrasound images based on rayleigh-trimmed anisotropic diffusion filter,” Pattern Recognit. Lett., vol. 32, no. 13, pp. 1516–1525, 2011. [16] C. Munteanu, F. C. Morales, and J. Ruiz-Alzola, “Speckle reduction through interactive evolution of a general order statistics filter for clinical ultrasound imaging,” IEEE Transactions on Biomedical Engineering, vol. 55, no. 1, pp. 365–369, 2008. [17] T. C. Aysal and K. E. Barner, “Rayleigh-maximum-likelihood filtering for speckle reduction of ultrasound images,” IEEE Transactions on Medical Imaging, vol. 26, no. 5, pp. 712–727, 2007. [18] G. Aubert and J.-F. Aujol, “A variational approach to removing multiplicative noise,” SIAM Journal on Applied Mathematics, vol. 68, no. 4, pp. 925–946, 2008. [19] J. M. Bioucas-Dias and M. A. Figueiredo, “Multiplicative noise removal using variable splitting and constrained optimization,” IEEE Transactions on Image Processing, vol. 19, no. 7, pp. 1720–1730, 2010. JOURNAL, VOL. XX, NO. X, 2017 10 [20] O. V. Michailovich and A. Tannenbaum, “Despeckling of medical ultrasound images,” ieee transactions on ultrasonics, ferroelectrics, and frequency control, vol. 53, no. 1, pp. 64–78, 2006. [21] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. [22] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, “Generative adversarial nets,” in Advances in neural information processing systems, 2014, pp. 2672–2680. [23] A. Radford, L. Metz, and S. Chintala, “Unsupervised representation learning with deep convolutional generative adversarial networks,” arXiv preprint arXiv:1511.06434, 2015. [24] C. Ledig, L. Theis, F. Huszár, J. Caballero, A. Cunningham, A. Acosta, A. Aitken, A. Tejani, J. Totz, Z. Wang et al., “Photo-realistic single image super-resolution using a generative adversarial network,” arXiv preprint arXiv:1609.04802, 2016. [25] X. Wang and A. Gupta, “Generative image modeling using style and structure adversarial networks,” European Conference on Computer Vision, pp. 318–335, 2016. [26] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros, “Unpaired image-to-image translation using cycle-consistent adversarial networks,” arXiv preprint arXiv:1703.10593, 2017. [27] A. Shrivastava, T. Pfister, O. Tuzel, J. Susskind, W. Wang, and R. Webb, “Learning from simulated and unsupervised images through adversarial training,” The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. [28] Y. Hu, E. Gibson, L.-L. Lee, W. Xie, D. C. Barratt, T. Vercauteren, and J. A. Noble, “Freehand ultrasound image simulation with spatially-conditioned generative adversarial networks,” Molecular Imaging, Reconstruction and Analysis of Moving Body Organs, and Stroke Imaging and Treatment, pp. 105–115, 2017. [29] Q. Yang, P. Yan, Y. Zhang, H. Yu, Y. Shi, X. Mou, M. K. Kalra, and G. Wang, “Low dose ct image denoising using a generative adversarial network with wasserstein distance and perceptual loss,” arXiv preprint arXiv:1708.00961, 2017. [30] A. L. Maas, A. Y. Hannun, and A. Y. Ng, “Rectifier nonlinearities improve neural network acoustic models,” Proc. ICML, vol. 30, no. 1, 2013. [31] B. Xu, N. Wang, T. Chen, and M. Li, “Empirical evaluation of rectified activations in convolutional network,” arXiv preprint arXiv:1505.00853, 2015. [32] M. Lin, Q. Chen, and S. Yan, “Network in network,” arXiv preprint arXiv:1312.4400, 2013. [33] D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014. [34] Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli, “Image quality assessment: from error visibility to structural similarity,” IEEE Trans. Image Process., vol. 13, no. 4, pp. 600–612, 2004. [35] H. Zhao, O. Gallo, I. Frosio, and J. Kautz, “Loss functions for image restoration with neural networks,” IEEE Transactions on Computational Imaging, vol. 3, no. 1, pp. 47–57, 2017. [36] F. Chollet et al., “Keras,” 2015.
1cs.CV
arXiv:1701.01394v1 [cs.DS] 5 Jan 2017 Signed Laplacian for spectral clustering revisited∗ Andrew V. Knyazev§¶k Abstract Classical spectral clustering is based on a spectral decomposition of a graph Laplacian, obtained from a graph adjacency matrix representing positive graph edge weights describing similarities of graph vertices. In signed graphs, the graph edge weights can be negative to describe disparities of graph vertices, for example, negative correlations in the data. Negative weights lead to possible negative spectrum of the standard graph Laplacian, which is cured by defining a signed Laplacian. We revisit comparing the standard and signed Laplacians and argue that the former is more natural than the latter, also showing that the negative spectrum is actually beneficial, for spectral clustering of signed graphs. Keywords: spectral clustering, signed graph, signed Laplacian, mass-spring vibration AMS: 05C50, 05C70, 15A18, 58C40, 65F15, 65N25, 62H30, 91C20. 1 Background and Motivation Spectral clustering groups together related data points and separates unrelated data points, using spectral graph theory, i.e., spectral properties of matrices associated with the graph, such as graph adjacency and Laplacian matrices; see, e.g., [23, 24, 27, 28, 33, 37, 30]. Internet search for “spectral clustering” nowadays returns over 200,000 links, 25,000 scholar publications, and 1,000 patent applications. The graph Laplacian matrix is obtained from the graph adjacency matrix that represents graph edge weights describing similarities of graph vertices. The graph weights are commonly defined using a distance function measuring similarity between data points, where graph vertices represent the data points and graph edges are drawn between pairs of vertices, e.g., if the distance between the corresponding data points has been measured. Classical spectral clustering bi-partitions the graph according to the signs of the components of the Fiedler vector; see [7, 8]. ∗ January § ¶ k 6, 2017. Submitted. A preliminary version posted at arXiv. Mitsubishi Electric Research Laboratories (MERL); 201 Broadway Cambridge, MA 02139 e-mail: {knyazev[at]merl[dot]com} URL: {http://www.merl.com/people/knyazev } 1 Signed Laplacian for spectral clustering revisited 2 Some important applications, e.g., Slashdot Zoo [20] and correlation [2] clustering, naturally lead to signed graphs, i.e., both with positive and negative weights. Negative values in the graph adjacency matrix result in more difficult spectral graph theory; see, e.g., [3]. Applying the original definition of the graph Laplacian to signed graphs breaks many useful properties of the graph Laplacian, e.g., leading to negative eigenvalues, making the definition of the Fiedler vector ambivalent. The row-sums of the graph Laplacian may vanish, invalidating the definition of the normalized Laplacian. These difficulties are typically avoided by using the signed Laplacian, e.g., [9, 19, 21], defined similarly to the graph Laplacian, but with the diagonal entries forced to be always positive large enough to make the signed Laplacian positive semi-definite and its eigenvalues non-negative, allowing one to formally reuse the definitions of the Fiedler vector and the normalized Laplacian. In this work, we argue that the original graph Laplacian is a more natural and beneficial choice, compared to the signed Laplacian, for spectral clustering. Using a model of vibrations of a mass-spring system with some repulsive springs, we explain, why the definition of the Fiedler vector should be based on the smallest eigenvalue, no matter whether it is positive or negative. In comparison, an “inverting amplifier” idea in [21, Sec. 7] appears artificial, lacks intuition and leads to a questionable argument, where the sign of negative edges changes in the denominator, but not in the numerator, of the potential. Turning to justification of the spectral clustering via relaxation, we compare the standard “ratio cut,” e.g., [27, 28], and “signed ratio cut” of [21], noting that minimizing the signed ratio cut puts less emphasis on cutting negative edges. We illustrate the behavior of the Fiedler vector for an intuitively trivial case of partitioning a linear graph modelled by vibrations of a string. We demonstrate numerically and analyze deficiencies of the popular signed Laplacian vs. the standard Laplacian for spectral clustering on a few simple examples. Efficiency of solvers for eigenvalue problems in spectral clustering is crucial for practical computations, where the data become enormous in size and multithreaded computational platforms get easily available; e.g. cf. [26, 6, 36, 1, 18]. A closely related to spectral clustering area of research is graph-based signal processing, that introduces eigenvectors of the graph Laplacian as natural extensions of the Fourier bases. For example, in [15], graph-based edge-preserving denoising is performed by projecting the noisy signal on a lower dimensional Krylov subspace of the graph Laplacian, constructed using the signal. The construction of the graph Laplacian of [15] is extended in [14] to the case, where weights can be negative, leading to edge enhancing denoising. In the present work, we extend this idea to clustering. The rest of the paper is organized as follows. We formally introduce the spectral clustering in Section 2 via eigendecomposition of the graph Laplacian. Section 3 deals with a simple, but representative, example—a linear graph,—and motivates spectral clustering by utilizing properties of low frequency mechanical vibration eigenmodes of a string, as an example of a mass-spring model. Negative edge weights are then naturally introduced in Section 4 as corresponding to repulsive springs, and the effects of the negative weights on the eigenvectors of Signed Laplacian for spectral clustering revisited 3 the Laplacian are informally predicted by the repulsion of the masses connected by the repulsive spring. In Section 5, we present simple motivating examples, discuss how the original and signed Laplacians are introduced via relaxation of combinatorial optimization, and numerically compare their eigenvectors and gaps in the spectra. In Sections 6 and 7, we explain benefits and peculiarities of using the negative weights for spectral clustering. Possible future research directions are spotlighted in Section 8. 2 Brief introduction to spectral clustering Let entries of the symmetric N -by-N data similarity matrix matrix W be called weighs and the matrix D be diagonal, made of row-sums of the matrix W . The matrix W is a data similarity matrix that may be viewed as a matrix of scores, representing the similarity between pairs of N data points. Similarity matrices are commonly determined from their counterparts, distance matrices. The distance matrix is a matrix containing the distances, taken pairwise, of a set of points. The general connection is that the similarity is small if the distance is large, and vice versa. Traditionally, all the entries (weighs) in W are assumed to be non-negative, which is automatically satisfied for distance-based similarities. We extend clustering to a general case of both positive and negative weighs, e.g., associated with correlations between pairs of data points. Commonly, the data clustering problem is formulated as a graph partition problem, defined on data represented in the form of a graph G = (V, E), with N vertices V and M edges E such that it is possible to partition G into subgraphs. Entries of W are weighs of the corresponding edges E, and the matrix W is called the graph adjacency matrix. The graph is called signed if it has edges with negative weighs. Let us introduce the Laplacian L = D − W and the normalized Laplacian D−1 L = I − D−1 W matrices, assuming that D is invertible, where I is the identity matrix. Normalizing the graph Laplacian is basically vertex scaling, conveniently mapping the spectrum of the normalized Laplacian D−1 L on the real interval [0, 2], if the edge-weighs are all non-negative. To simplify our presentation for the signed graphs, we mostly avoid the normalized Laplacian. A good partition in the classical case of non-weighted graphs is informally described as the one in which the number of edges between separated subgraphs is small. The goal of partitioning of signed graphs, e.g., by cutting into two sub-graphs, is informally to minimize the total weight of the cut positive edges, while at the same time to maximize the absolute total weight of the cut negative edges. For uniform partitioning, one also needs to well-balance sizes or volumes of the resulting sub-graphs. Traditional approaches to graph partitioning are combinatorial and naturally fall under the category of NP-hard problems, solved using heuristics, such as relaxing the combinatorial constraints, as we briefly discuss below in Subsection 5.2. Data clustering via graph spectral partitioning is a state-of-the-art tool, which is known to produce high quality clusters at reasonable costs of numerical Signed Laplacian for spectral clustering revisited 4 solution of an eigenvalue problem for a matrix associated with the graph, e.g., the graph Laplacian. Each eigenvector, denoted by x, of the matrix L is a solution of the eigenvalue problem Lx = λx, where the scalar λ denotes the eigenvalue corresponding to the eigenvector x. Together, λ and x are called an eigenpair. The column-vector of ones is always a trivial eigenvector of L corresponding to the zero eigenvalue. It is easy to show that the symmetric matrix L has all non-negative eigenvalues λ, if all weights are non-negative. The graph Laplacian matrix is symmetric, due to the earlier assumed symmetry of the adjacency matrix W , which implies that all the eigenvalues are real, and the various eigenvectors can be chosen to be mutually orthogonal. A nontrivial eigenvector of the matrix L corresponding to smallest eigenvalue λ of L, commonly called the Fiedler vector after the author of [7, 8], bisects the graph G into only two partitions, according to the signs of the entries of the eigenvector. Since the Fielder vector, as any other nontrivial eigenvector, is orthogonal to the vector of ones, it must have entries of opposite signs, thus, the sign-based bisection always generates a non-trivial two-way graph partitioning. We explain in Section 3, why such a partitioning method can be considered meaningful. A multiway spectral partitioning is obtained from “low frequency eigenmodes,” i.e., eigenvectors corresponding to a cluster of smallest eigenvalues, of the Laplacian matrix L. The cluster of (nearly)-multiple eigenvalues naturally leads to the need of considering a Fiedler invariant subspace of L, spanned by the corresponding eigenvectors, extending the Fielder vector, since the latter may be not unique or well numerically defined in this case. The Fiedler invariant subspace provides a geometric embedding of the graph’s vertices, reducing the general graph clustering problem to the problem of clustering of a point cloud (of embedded graph vertices) in a low-dimensional Euclidean space. However, the simple and efficient idea of sign-based partitioning from the Fiedler vector has no evident extension to the Fiedler invariant subspace. Practical multiway spectral partitioning can be performed using various competing heuristic algorithms, greatly affecting the results; see, e.g., [5, 31, 12, 35]. While these same heuristic algorithms can as well be used in our context of signed graphs, we restrict ourselves in this work only to the two-way partitioning using the component signs of the Fiedler vector, for clarity of presentation and consistency. The presence of negative weights in signed graphs brings new theoretical and practical challenges to spectral graph partitioning: • possible negative eigenvalues of the graph Laplacian, making the definition of the Fiedler vector somewhat ambiguous, e.g., whether the smallest negative, positive, or by absolute value, eigenvalues should be used in the definition; • more difficult spectral graph theory; e.g., cf. [24] and [9]; • possible zero diagonal entries in the degree matrix D, nullifying the definition of the normalized Laplacian D−1 L, cf. [33]; Signed Laplacian for spectral clustering revisited 5 • violation of the maximum principle, which is the cornerstone in the proof of connectivity of clusters; see [7, 8]; • breaking the connection of spectral clustering to random walks and Markov chains, cf. [27]; • invalidating an interpretation of the quadratic form xT Lx as “energy,” e.g., in the heat (diffusion) equation; cf. a forward-and-backward diffusion in [10, 34]; • the graph Laplacian can no longer be viewed as a discrete analog of the Laplace-Beltrami operator on a Riemannian manifold that motivates Laplacian Eigenmaps methods for manifold learning; e.g., see [11, 32]. Some of these challenges can be addressed by defining a signed Laplacian as follows. Let the matrix D̄ be diagonal, made of row-sums of the absolute values of the entries of the matrix W , which thus are positive, so that D̄−1 is well-defined. We define the signed Laplacian L̄ = D̄ − W and the normalized signed Laplacian D̄−1 L̄ = I − D̄−1 W matrices, following, e.g., [9, 19, 21]. The signed Laplacian is positive semi-definite, with all eigenvalues non-negative. The Fiedler vector of the signed Laplacian is defined in [9, 19, 21] as an eigenvector corresponding to the smallest eigenvalue and different from the trivial constant vector. In the rest of the paper, we justify spectral partitioning of signed graphs using the original definition of the graph Laplacian L, and argue that better quality clusters can generally be expected from eigenvectors of the original L, rather than from the signed Laplacian L̄. 3 3.1 Linear graph Laplacian and low frequency eigenmodes of a string All edges with unit weights Spectral clustering can be intuitively justified via a well-known, see, e.g., [29], identification of the graph Laplacian matrix L with a classical problem of transversal vibrations of a mass-spring system with N masses and M springs, where the stiffness of the springs is related to the graph weights—the entries of the graph adjacency matrix W. We start with the simplest non-trivial example, where the mass-spring system is a discrete analog of a string. Let wi−1 i = wi i+1 = 1 with all other zero entries, so that the graph Laplacian L = D − W is a tridiagonal matrix   1 −1   −1 2 −1     . . . .. .. .. (1) L=      −1 2 −1 −1 1 Signed Laplacian for spectral clustering revisited 6 Fig. 1: Low frequency eigenmodes of a string (left) and two disconnected pieces of the string (right). that has nonzero entries 1 and −1 in the first row, −1 and 1 in the last row, and [−1 2 −1] in every other row—a standard finite-difference approximation of the negative second derivative of functions with vanishing first derivatives at the end points of the interval. Its eigenvectors are the basis vectors of the discrete cosine transform; see the first five low frequency eigenmodes (the eigenvectors corresponding to the smallest eigenvalues) of L displayed in the left panel in Figure 1. Let us note that these eigenmodes all turn flat at the end points of the interval. The flatness is attributed to the vanishing first derivatives, which manifests itself in the fact, e.g., that the Laplacian row sums in the first and last rows always vanish. Eigenvectors of matrix (1) are well-known in mechanics, as they represent shapes of transversal vibration modes of a discrete analog of a string—a linear system of masses connected with springs. Figure 2 illustrates a system with N = 4 masses and M = 3 springs. The frequency ω of the vibration mode x satisfies ω 2 = λ ≥ 0. The eigenvectors of the graph Laplacian are often called eigenmodes because of this mechanical analogy. The smallest eigenvalues λ = ω 2 correspond to low frequencies ω, explaining the terminology used in the caption in Figure 1. The system of masses is not attached, thus there is always a trivial eigenmode, where the whole system goes up/down, i.e., the eigenvector x is constant and ω 2 = λ = 0. Figure 2 shows transversal displacements of the masses from the equilibrium plane for the first nontrivial mode, which is the Fiedler vector, where the two masses on the left side of the system move synchronously up, while the two masses on the right side of the system move synchronously down. This is the same eigenmode as drawn in red color in Figure 1 left panel for a similar linear system with a number of masses large enough to make a visual appearance of a continuous string. Performing the bisection partitioning according to the signs of the Fiedler vector, one puts the data points corresponding to the masses in the left half of the mass-spring system into one cluster and those in the right Signed Laplacian for spectral clustering revisited 7 mass displacement Equilibrium plane Second cluster Fig. 2: Traditional linear mass-spring system. half into the other. The amplitudes of the Fiedler vector are also very important. For example, the Fiedler vector in Figure 2 has smaller by absolute value components in the middle of the system. With the number of masses increased, the components in the middle of the system gets smaller. Then, a perturbation of the graph weights can easily lead to a sign change in a small by the absolute value component, putting the corresponding data point into a difference cluster, as intuitively should be expected. Thus, the squared amplitude of the component, after a proper scaling, can be interpreted as a probability of the corresponding data point to belong to the cluster determined according to the sign of the component. 3.2 A string with a single weak link (small edge weight) Next, we set a very small value wi i+1 = wi+1 i for some index i, keeping all other entries of the matrix W the same as before. In terms of clustering, this example represents a situation, where there is an intuitively evident bisection partitioning, with one cluster containing all data points with indexes 1, . . . , i and the other with i + 1, . . . , N . In terms of our mass-spring system interpretation, we have a discrete string with one weak link, i.e., one spring with such a small stiffness that makes two pieces of the string nearly disconnected. Let us check how the low frequency eigenmodes react to such a change. The first five vectors of the corresponding Laplacian are shown in Figure 1, right panel. We observe that all the plotted in Figure 1 eigenvectors are aware of the soft (having small stiffness) spring between the masses with the indexes i and i + 1. Moreover, their behavior around the soft spring is very specific—they Signed Laplacian for spectral clustering revisited 8 are all flat on both sides of the soft spring! The presence of the flatness in the low frequency modes of the graph Laplacian L on both sides of the soft spring is easy to explain mathematically. When the value wi i+1 = wi+1 i is small relative to other entries, the matrix L becomes nearly block diagonal, with two blocks, which approximate graph Laplacian matrices on sub-strings to the left and to the right of the soft spring. The low frequency eigenmodes of the graph Laplacian L thus approximate combinations of the low frequency eigenmodes of the graph Laplacians on the sub-intervals. But each of the low frequency eigenmode of the graph Laplacian on the sub-interval is flat on both ends of the sub-interval, as explained above. Combined, it results in the flatness in the low frequency modes of the graph Laplacian L on both sides of the soft spring. The flatness is also easy to explain in terms of mechanical vibrations. The soft spring between the masses with the indexes i and i + 1 makes the masses nearly disconnected, so the system can be well approximated by two independent disconnected discrete strings with free boundary conditions, on the left and on the right to the soft spring. Thus, the low frequency vibration modes of the system are discontinuous at the soft spring, and nearly flat on both sides of the soft spring. Can we do better in this toy example and make the flat ends to bend in the opposite directions, making it easier to determine the bisection partitioning even using low accuracy computations of the eigenvectors? In [14], where graph based edge-preserving signal denoising is analyzed, we have suggested to enhance the edges of the signal by introducing negative edge weights in the graph, cf. [10]. In the next subsection, we put a spring, which separates the masses by repulsing them, and see how it affects the low-frequency vibration modes. 4 Negative weights for spectral clustering In our mechanical vibration model of a spring-mass system, the masses that are tightly connected have a tendency to move synchronically in low-frequency free vibrations. Analyzing the signs of the components corresponding to different masses of the low-frequency vibration modes thus allows determining the clusters. The mechanical vibration model describes conventional clustering when all the springs are pre-tensed to create attracting forces between the masses, where the mass-spring system is subject to transverse vibrations, i.e., enable the masses to move only in a transverse direction, perpendicular to a plane of the massspring system. However, one can also pre-tense some of the springs to create repulsive forces between some pairs of masses, as illustrated in Figure 3. In the context of data clustering mathematically formulated as graph partitioning, that corresponds to negative entries in the adjacency matrix. The negative entries in the adjacency matrix are not allowed in conventional spectral graph partitioning. However, the model of mechanical vibrations of the spring-mass system with repulsive springs is still valid, allowing us to extend the conventional Signed Laplacian for spectral clustering revisited 9 First cluster equilibrium state + attractive repulsive attractive displacement Second cluster - Fig. 3: Linear mass-spring system with repulsion. Fig. 4: The same eigenmodes, but negative weights, original (left) and signed (right) Laplacians. approach to the case of negative weights. The masses, which are attracted, move together in the same direction in low-frequency free vibrations, while the masses, which are repulsed, have the tendency to move in the opposite direction. Moreover, the eigenmode vibrations of the spring-mass system relate to the corresponding wave equation, where the repulsive phenomenon makes it possible for the time-dependent solutions of the wave equation to exponentially grow in time, if they correspond to negative eigenvalues. Figure 3 shows the same linear mass-spring system as Figure 2, except that the middle spring is repulsive, bending the shape of the Fiedler vector in the opposite directions on different sides of the repulsive spring. The clusters in Figure 2 and Figure 3 are the same, based on the signs of the Fiedler vectors. Signed Laplacian for spectral clustering revisited 10 masses equilibrium plane repulsive springs ransverse direction mass attractive springs Fig. 5: Mass-spring system with repulsive springs. However, the data points corresponding to the middle masses being repulsed more clearly belong to different clusters in Figure 3, compared to Figure 2, because the corresponding components in the Fiedler vector are larger by absolute value in Figure 3 vs. Figure 2. Determination of the clusters, using the signs of the Fiedler vector, is easier for larger components that are less likely to be computed with a wrong sign due to data noise or inaccuracy of computations, e.g., small number of iterations. Figures 4 left panel displays the five eigenvectors, including the trivial one, for the five smallest eigenvalues of the same tridiagonal graph Laplacian as that corresponding to the right panel in Figure 1 except that the small positive entry of the weights wi i+1 = wi+1 i for the same i is substituted by −0.05 in Figure 4. 5 Comparing the original and signed Laplacians We present a few simple motivating examples, discuss how the original and signed Laplacians are introduced via relaxation of combinatorial optimization, and compare their eigenvectors and gaps in the spectra, computed numerically for these examples. 5.1 Simple examples The graph corresponding to the mass-spring system in Figure 5, assuming unit by absolute value weights of the edges, leads to the following graph Laplacian   −2 1 1 0 0  1 0 0 −1 0     0 0 −1 0  (2) L= 1 ,  0 −1 −1 3 −1  0 0 0 −1 1 Signed Laplacian for spectral clustering revisited 11 and the signed Laplacian    L̄ =    2 1 1 0 0 1 1 0 0 2 0 −1 0 0 2 −1 0 −1 −1 3 −1 0 0 −1 1    ,   (3) where the top left in Figure 5 mass, positioned between the repulsive springs, is assigned the index 1, i.e., corresponds to the first row and column of L. Even without computing the eigenvalue decomposition, one can easily predict that the eigenvector of L, orthogonal to the trivial eigenvector of ones and corresponding to the smallest eigenvalue, should have the first component of the opposite sign compared to all other components, separating the first mass from the rest. To setup a proper comparison, let us consider a graph like the one corresponding to the mass-spring system in Figure 5, but with both repulsive springs being already eliminated. In terms of the graph, we substitute both negative weights with the zero weights, leading to the graph Laplacian   0 0 0 0 0  0 1 0 −1 0     1 −1 0  L0 =  0 0 (4) .  0 −1 −1 3 −1  0 0 0 −1 1 The Fiedler vector of L0 in (4) is evidently piece-wise constant, with the first component having the opposite sign compared to all other components, separating the first mass from the rest. Let x0 denote the Fiedler vector of L0 in (4) shifted by the vector of ones and scaled so that its components with the opposite sign are simply +1 and −1, i.e., e.g., x0 = (−1 1 1 1 1)T. We still have that L0 x0 = 0. Considering   2 1 1 0 0  1 1 0 0 0     L̄ − L0 =   1 0 1 0 0 ,  0 0 0 0 0  0 0 0 0 0 we get (L̄ − L0 )x0 = 0, thus, also L̄x0 = 0, i.e., x0 is also an eigenvector of L̄, corresponding to the smallest eigenvalue. Therefore, in this example, we come to the surprising conclusion that performing graph spectral bi-partitioning based on the signed Laplacian has no advantages compared to the spectral bipartitioning, where the negative weights are simply nullified! In another example, for the discrete string with one negative edge, we obtain   ··· ··· ··· ··· ··· ···  ··· 0 1 1 0 ···  , L̄ − L0 =   ··· 0 1 1 0 ···  ··· ··· ··· ··· ··· ··· Signed Laplacian for spectral clustering revisited 12 where the graph Laplacian L0 corresponds to the two disconnected string pieces, and all dotted entries are zeros. Again, we observe that the eigenvector x0 of L0 such that L0 x0 = 0 is piece-wise constant, and can be chosen to have components +1 and −1, separating the left string piece from the right one. And yet again, (L̄ − L0 )x0 = 0, thus, L̄x0 = 0, i.e., x0 is an eigenvector of both matrices L̄ and L0 , corresponding to the smallest eigenvalue, in this example. 5.2 Spectral clustering via relaxation A common approach to formulate spectral graph partitioning is via relaxation of combinatorial minimization problems. Let us compare the standard “ratio cut,” e.g., [27, 28], leading to the traditional graph Laplacian, and “signed ratio cut” of [21], used to justify the definition of the signed Laplacian. Let the graph V be cut into sub-graphs X and V \ X. The associated cut value Cut(X, V \ X) is defined as the number of cut edges for graphs without weight and the sum of the weights of cut edges for weighted graphs. In signed graphs, thus, Cut(X, V \X) = Cut+ (X, V \X)−Cut−(X, V \X), where Cut+ (X, V \X) (Cut− (X, V \ X)) denotes the sum of the absolute values of the weights of cut positive (negative) edges. For uniform partitioning, one wants to balance the resulting sub-graphs, which is typically done dividing the cut by the size of the clusters, giving RatioCut(X, V \ X) = Cut(X, V \ X)/(|X| + |V \ X|). Minimizing the RatioCut is a combinatorial problem, but its relaxation, see e.g., [27, 28], leads to minimizing the Rayleigh quotient for the graph Laplacian. Substituting sub-graph volumes for sizes similarly leads to the normalized Laplacian, not covered here. The signed ratio cut of [21] is defined by substituting the “signed cut” SignedCut(X, V \ X) ≡ 2Cut+ (X, V \ X) + Cut−(X, X) + Cut−(V \ X, V \ X) for the “cut”. However, the value Cut− (X, V \ X) + Cut− (X, X) + Cut− (V \ X, V \ X) of all negative edges in the signed graph remains constant, no matter what X is. We notice that, up to this constant value, SignedCut(X, V \ X) is equal to 2Cut+ (X, V \ X) − Cut− (X, V \ X). This expression is similar to that of Cut(X, V \X), but the term Cut+ (X, V \X) appears with the multiplier 2, which suggests that the cuts minimizing quantities involving SignedCut(X, V \ X) could tend to ignore the edges with negative weights, focusing instead on cutting the edges with small positive weights. In contrast, in the definition of Cut(X, V \ X), the positive and negative weights play equal roles. It appears hard to argue why minimizing the signed ratio cut would make more sense compared to the standard ratio cut for signed graphs. Moreover, doubling the term Cut+ (X, V \ X) appears somewhat arbitrary. While the relaxation argument is often used as a motivation for spectral clustering, it is difficult to mathematically analyze how different cost functions in Signed Laplacian for spectral clustering revisited 13 the combinatorial formulation affect their relaxed versions. It is also challenging to directly quantitively compare various spectral clustering formulations, where the clusters are determined from eigenvectors, since shapes of eigenvectors depend on the matrix coefficients in a complex way. We use the intuitive mass-spring system model to explain novel effects of spring repulsion on eigenmodes of the standard Laplacian, but we are unaware of such a physical model for the signed Laplacian. 5.3 Comparing the eigenvectors Since there is apparently still no algorithm universally accepted by experts for an ultimate determination of multiway clusters from several eigenvectors, we restrict ourselves to determining the clusters from the component signs of only one eigenvector, the Fiedler vector for the traditional Laplacian, and the first, or the second, smallest eigenvector of the signed Laplacian, as advocated in [21]. The shape of this single eigenvector that determines bi-partitioning is not the only important factor for spectral clustering. Since the eigenvector has to be computed numerically and is subject to data noise, it is also important to check the shapes of other eigenvectors, corresponding to the nearby eigenvalues, that are likely to contaminate the approximate eigenvector of interest. Figure 4 right panel displays the eigenmodes of the signed Laplacian for the same weights as in the left panel. We observe that, indeed, as we have proved above, one of the eigenvectors is piece-wise constant, as in Figure 1 right panel. Moreover, the shapes of the other eigenmodes of the signed Laplacian in Figure 4 right panel also look more similar to those in Figure 1 right panel, corresponding to the zero weight, than Figure 4 left panel, corresponding to the original graph Laplacian with the same weights. The eigenvectors the original Laplacian with negative weights are preferably shaped, compared to those of the signed Laplacian, potentially giving better clustering. To setup a direct numerical comparison, for the string example, we need to choose a practical eigensolver, so let us briefly discuss computational aspects of spectral clustering. The Fiedler vector, or a group of eigenvectors, corresponding to the left-most eigenvalues of a symmetric eigenvalue problem can be computed by an iterative method, for example, as proposed in [16], by the Locally Optimal Block Preconditioned Conjugate Gradient (LOBPCG) method; see [13]. LOBPCG does not even need to store the matrix L in memory, but only needs the results from multiplying the matrix L by a given vector, or a block of vectors. This characteristic makes LOBPCG applicable to eigenvalue analysis problems of very high dimensions, and results in good parallel scalability to large matrix sizes processed on many parallel processors; e.g., see reference [18], describing one open source and publicly available implementation of LOBPCG. Available convergence theory of LOBPCG in [13] requires the matrix be symmetric, but not necessarily with all non-negative eigenvalues, i.e., a possible presence of negative eigenvalues still satisfies the convergence assumptions. The calculation of the product of the matrix L by a vector is the main cost per iteration, no matter if the weights are positive or negative. Signed Laplacian for spectral clustering revisited 0.2 0.25 0.2 0.15 14 0.4 0.2 0.3 0.15 0.15 0.1 0.2 0.1 0.05 0.1 0.05 0 0 0 -0.1 -0.05 0.1 0.05 0 -0.05 -0.05 -0.1 -0.1 -0.15 -0.2 -0.15 -0.2 -0.2 0 20 40 60 80 100 -0.1 -0.3 0 20 40 60 80 100 -0.15 0 20 40 60 80 100 0 20 40 60 80 100 Fig. 6: Approximate Laplacian eigenmode, unit (a), zero (b), and negative weight at one edge for the original (c) and signed (d) Laplacian. To this end, we perform 30 iterations of LOBPCG, without preconditioning and starting from a random initial approximation—the same for various choices of the weights and for different Laplacians for our discrete string example. The number of iterations is chosen small enough to amplify the influence of inaccuracy in approximating the eigenvector on its shape. We display a representative case in Figure 6. Figure 6 shows the approximately computed Laplacian eigenmodes with the unit (a), zero (b), and negative (c) weight at one edge, as well as the signed Laplacian (d), corresponding to the exact eigenfunctions in Figures 1 and 4. Initial large contributions from other eigenmodes, shown in Figures 1 and 4, remain unresolved, as anticipated. If the bi-partitioning was performed according to the signs of the components of the computed eigenmode of the Laplacian with the negative weight nullified, Figure 6 (b), or the signed Laplacian, Figure 6 (d), the resulting clusters would be wrong. In a sharp contrast, the exact eigenmode of the original Laplacian with the negative weight −0.05, Figure 4 left panel the blue line, as well its approximation in Figure 6 (c), which is very different from all other approximate eigenmodes in Figure 6, clearly demonstrate a sharp edge with a large jump in the functions at the correct location of the negative edge, between the 37 and 38 vertices. The signs of their components allow one to determine the optimal bi-partitioning. 5.4 Comparing gaps in the spectra There are two reasons why the computed eigenmode in Figure 6 (c) visually much better approximates the exact Fiedler vector compared to other cases in Figure 6. The first one is that the shape of the exact Fiedler eigenmode (blue line) is very pronounced and quite different from those of other eigenfunctions with small eigenvalues in Figure 4 left panel. The second reason is more important and qualitative, but less evident, requiring additional information and explanations as follows. It is related to condition numbers of eigenvectors, which is primarily determined by a gap in the matrix spectrum. The convergence speed of iterative approximation to an eigenvector, as well as eigenvector sensitivity with respect to perturbations in the matrix entries, e.g., due to noise, is mostly determined by a quantity, called the condition number of the eigenvector, defined for symmetric matrices as the ratio of the Signed Laplacian for spectral clustering revisited 15 spread of the matrix spectrum to the gap in the eigenvalues. Since we are interested in the eigenvector, corresponding to the smallest eigenvalue, the gap is simply the difference between the smallest eigenvalue and the other nearest eigenvalue, where the trivial zero eigenvalue of the Laplacian can be excluded, since the corresponding trivial eigenvector, made of ones, can simply be ignored. What happens in our example, as we see numerically, the largest eigenvalue remains basically the same for all variants, so we only need to check the gap. It turns out that the gap for the signed Laplacian is about 3 times smaller, for all tested values of the negative weight, compared the gap for the case of the zero weight, explaining why we see no improvement in Figures 6 (b) and (d), compared to (a). In contrast, introducing the negative weight in the original Laplacian tends to make the target smallest eigenvalue smaller, even negative, in our test for the discrete string, while not changing enough the other eigenvalues nearby. As a result, the gap with the negative weight −0.05 is 4 times larger compared to the baseline case of the zero weight. We conclude that the eigenvector condition number for the signed Laplacian is about 3 time larger, while for the original Laplacian is 4 times smaller, depending on the negative weight −0.05, compared to the baseline eigenvector condition number for the Laplacian with the zero weight, suggesting that the signed Laplacian is numerically inferior for spectral clustering. 5.5 Signed Laplacian failure We have observed that the approximate eigenvector of the signed Laplacian in Figure 6 (d) produces wrong clusters, although either the first (red) or the second (blue) exact eigenvector of the signed Laplacian in Figure 4 left panel would result in ideal clusters, cutting our linear graph at the correct location of the negative edge, between the 37 and 38 vertices. Now, we present a bit more sophisticated example, where neither the first nor the second exact eigenvectors of the signed Laplacian result in meaningful clusters, using the signs of the eigenvector components as suggested in [21]. In other words, the signed Laplacian fails. We consider another standard linear mass-spring system with 12 masses and one repulsive spring, w89 = w98 = −1/2 between masses 8 and 9, but add to the graph adjacency an extra “noise” full random matrix with entrees uniformly distributed between 0 and 10−2 . It turns out that in this example the two smallest eigenvalues of the signed Laplacian form a cluster, making individual eigenvectors unstable with respect to the additive noise, leading to meaningless spectral clustering, if based on the signs on the components of any of the two eigenvectors. The exact Laplacian eigenmodes, are shown in Figure 7, the original Fiedler (left panel) and both eigenvectors of the signed Laplacian (right panel). The signs of neither eigenvectors of the signed Laplacian give any meaningful clusters, while the Fiedler vector clearly suggests the perfect cut, as well as in our previous tests. Signed Laplacian for spectral clustering revisited 0.5 16 0.5 0.4 0.3 0.2 0 0.1 0 -0.1 -0.5 -0.2 2 4 6 8 10 12 2 4 6 8 10 12 Fig. 7: Laplacian eigenmodes, original (left) and signed (right), a “noisy” 12mass string with a negative weight at one edge between vertices 8 and 9. 5.6 Signed Laplacian possible fix A closer look at the two eigenvectors of the signed Laplacian in Figure 7 (right panel) reveals a visible aperture between the values of the components in every eigenvector at the actually correct location, between graph vertices 8 and 9, separating the graph partitions. This aperture, however, is not aligned with the sign change in any of the two eigenvectors, suggesting that partitioning, using the eigenvectors of the signed Laplacian, should be based on the location of the aperture, rather than the signs of the components of the eigenvector, in contrast to [21]. For example, the correct partitioning in this case can be determined via clustering of the one-dimensional point cloud, consisting of the components of the eigenvector, such as by K-means initiated with centroids at the local maximal cloud density points (see, e.g., [22] and references there), which in 1D is easy to estimate. 6 Benefits of negative weights for clustering Clustering methods, which allows both the non-negative and negative entries in the graph adjacency matrix, are advantageous because situations where the pair of data points is disparate can be explicitly represented in the graph adjacency matrix. In the traditional approach, the entries in the graph adjacency matrix must be all non-negative, which does not admit negative data comparisons, available in many practical applications. For example, a practically important case is where the data points are feature vectors of some underlining original data, or just vectors themselves. In such an example, the pair-wise comparing of data points can be determined based on a correlation or a covariance, instead of a distance, where the correlation and the covariance quantify a linear dependence between the vectors, such that the entry of the graph adjacency matrix is positive, negative, or zero, depending on whether the two vectors are positively correlated, negatively correlated, or uncorrelated, in contrast to [4], where negatively correlated data result in zero Signed Laplacian for spectral clustering revisited 17 weights, while uncorrelated data give moderate positive weights. Such a determination is advantageous because it directly uses the correlation or the covariance for the data comparing, even when the correlation or the covariance is negative for at least some pairs of the data points, thus potentially improving the quality of the clustering. In the traditional approach, the vectors would be typically compared using a kernel distance function leading to the graph adjacency matrix with all non-negative entries, enabling the conventional spectral clustering to proceed, but nullifying valid comparisons. The repulsive phenomenon is beneficial for clustering, increasing the quality of distinguishing data points having negative similarities. In the vibration model of the mass-spring system, any eigenmode corresponding to a negative eigenvalue, contributes to increasing the amplitudes of vibrations of components when the interaction between the components is repulsive. The increasing of the amplitudes of vibrations of the components is an indication that the components are not likely to appear in the same cluster, which makes the determining of clusters simpler. This argument also suggests that the repulsive (negative) spectrum is more important compared to the attractive (positive) spectrum or even the zero spectrum, and thus should be treated preferentially, as we discuss below in § 7. 7 Dos and don’ts for negative weights The graph adjacency matrix with both positive and negative entries can lead to the graph Laplacian having positive and negative eigenvalues. The repulsive spectrum of the negative eigenvalues of the graph Laplacian is impossible in the conventional approach, creating a need to adjust some conventional tools used in traditional spectral clustering. For the purpose of determining the clustering, the repulsive spectrum is advantageous, since the left-most negative eigenvalue corresponds to the least stable eigenmode in the mass-spring wave equation (or the heat equation, cf. [25]) and, thus, is best suitable for determining the bisection partitioning using the signs of the components of the corresponding eigenvector. In contrast to the conventional case of spectral clustering with all nonnegative weights, the presence of the repulsive (negative) spectrum may apparently result in clustering, where every cluster does not have to be connected. The mathematical reason for the lost of the connectivity is that the corresponding classical proof is based on a maximum principle; see [7, 8]. In its turn, the maximum principle relies on negativity of all off-diagonal non-zero entries of the graph Laplacian matrix L, which is equivalent to non-negativity of all the entries of the graph adjacency matrix W. Some results of the traditional spectral graph theory significantly use the assumption of the positivity of the non-zero graph edge weights, and may fail if the assumption is violated. For example, [17] bounds changes in the graph Laplacian spectra, by representing the graph Laplacian matrix as a diffusion operator on the vertexes of the graph, and then transforming the diffusion op- Signed Laplacian for spectral clustering revisited 18 erator on the vertexes of the graph to a diffusion operator on the edges of the graph. The latter involves positive square roots of the graph edge weights, thus requiring weight positiveness. Even if the diagonal degree matrix D is not degenerate, so that P = D−1 W is correctly defined, some entries of P may be negative. In the conventional case of all non-negative entries of W , the matrix P is associated with a Markov random walk on the vertices of the graph, with the entries of P , also all non-negative giving the probabilities of the walk; e.g., see [27]. Since in our scenario the adjacency matrix W can have negative entries, so can P , failing the association with the random walk (unless some probabilities are allowed to be negative!). It is always possible to define D̄−1 W , but it would not be row-stochastic, if negative entries are present. 8 Possible extensions for future work We concentrate on the model of the system of masses connected with springs only because it directly leads to the standard definition of the graph Laplacian, giving us a simple way to justify our introduction of the negative weights. Similarly, we restrict the vibrations to be transversal, since then we can use the classical bisection partitioning definition based on the signs of the components of the Fiedler vector. It is important to realize that the negative weights can as well be introduced in other models, cf. [11], that intuitively perform clustering. Below we describe two more general models incorporating the negative weights. The first model is based on vibration modes of a wave equation of a system of interacting quasi-particles subjected to vibrations. Each quasi-particle of the vibration model corresponds to one of the data points, and interaction coefficients of the vibration model are determined by pair-wise comparison of the data points, wherein the interacting is attractive and the interaction coefficient is positive if the data points in the pair are similar, or the interacting is absent and the interaction coefficient is zero when the data points in the pair are not comparable, or the interacting is repulsive and the interaction coefficient is negative when the data points in the pair are disparate, and where a strength of the interacting and an amplitude of the interaction coefficient represent a level of similarity or disparity. The eigenmodes are defined as eigenvectors of an eigenvalue problem, resulted from the usual separation of the time and spacial variables. In lowfrequency or unstable vibration modes, the quasi-particles are expected to move synchronically in the same direction if they are tightly connected by the attractive interactions, but in the opposite directions if the interactions are repulsive, or in the complementary (if available) directions if the interacting is absent. Compared to the already considered transversal vibrations, where the masses can only move up or down, on the one hand, determining the clusters by analyzing the shapes of the vibrations is less straightforward than simply using the signs of the components, but, on the other hand, allows reliable detection of more than two clusters from a single eigenmode. For example, a quasi-particle Signed Laplacian for spectral clustering revisited 19 representing an elementary volume of an elastic body in three-dimensional space has six degrees of freedom, allowing to reliably define up to twelve clusters from a single vibration mode. Already mentioned multiway spectral partitioning heuristic algorithms, such as in [5, 31, 12, 35], would have to be adopted to the new case, where a quasi-particle, associated with a graph vertex, has multiple degrees of freedom. A second, alternative, model is based on the concentration-diffusion equation, for a system made of interacting quasi-particles, subjected to concentration or diffusion, where each quasi-particle of the concentration-diffusion model corresponds to a point in the data, and the model quasi-particle interaction conductivity coefficients are determined by pair-wise comparison of data points, wherein the interaction is diffusive and the interaction conductivity coefficient is positive if the data points in the pair are similar, or the interaction is absent and the interaction conductivity coefficient is zero, if the data points in the pair are not comparable, or the interaction is concentrative and the interaction conductivity coefficient is negative, if the data points in the pair are disparate. The strength of the interaction and the amplitude of the interaction coefficient represent the level of similarity or disparity. As in the first model, the eigenvalue problem is obtained by the separation of the time and spacial variables in the time dependent diffusion equation. The clusters are defined by analyzing the eigenvectors corresponding to the left part of the spectrum, describing unstable or slowest modes. Quasi-particles that concentrate together form a cluster by definition. A forward-and-backward diffusion in [10, 34] provides a different interpretation of a similar diffusion equation, but where the negative sign in the conductivity coefficient is moved to the time derivative, thus making the time to go backward. This model requires the time to go forward on the graph edges with the positive weights and backward on the edges with the negative weights. Conclusions Spectral clustering has been successful in many applications, ranging from traditional resource allocation, image segmentation, and information retrieval, to more recent bio- and material-informatics, providing good results at reasonable costs. Improvements of cluster quality and algorithm performance are important, e.g., for big data or real-time clustering. We discuss introducing negative weights in the graph adjacency matrix for incorporating disparities in data via the powerful technique of spectral clustering that traditionally handles data with similarities. The direct incorporating of the disparities in the data into spectral clustering is expected to be of significance and have impact in any application domain, where the data disparities naturally appear, e.g., if the data comparison involves the correlation or the covariance. If the data or data features are represented by elements of a vector space equipped with a vector scalar product, it can be used for determining the pair-wise comparison function, having both negative Signed Laplacian for spectral clustering revisited 20 and non-negative values. Our arguments aim at convincing the reader that the main framework of the traditional spectral clustering, with only non-negative weights, remains largely intact when negative weights are present. For example, the eigenvectors corresponding to the algebraically smallest eigenvalues (that can be negative) of the graph Laplacian allow defining the clusters, at similar computational costs, but higher quality, compared to a naive substitution dissimilarities for disparities, to preserve the weights non-negative, as required in the traditional technique, or compared to the signed Laplacian. For signed graphs, we argue that the standard Laplacian may outperform the signed Laplacian for spectral clustering, and is better justified, using both the mass-spring system model with repulsive springs and the spectral clustering introduction via relaxation of the combinatorial minimization. The repulsive phenomenon is beneficial for clustering, increasing the quality of distinguishing data points having negative similarities, as well as increasing the relevant gap in the spectrum of the original graph Laplacian, making the Fiedler vector easier to compute and more robust to noise, compared to the eigenvectors of the signed Laplacian. References [1] H. Anzt, S. Tomov, and J. Dongarra, On the performance and energy efficiency of sparse linear algebra on gpus, The International Journal of High Performance Computing Applications, 0 (0), p. 1094342016672081, https://doi.org/10.1177/1094342016672081. [2] N. Bansal, A. Blum, and S. Chawla, Correlation clustering, Machine Learning, 56 (2004), pp. 89–113, http://dx.doi.org/10.1023/B:MACH.0000033116.57574.95. doi:10.1023/B:MACH.0000033116.57574.95. [3] J. C. Bronski and L. DeVille, Spectral theory for dynamics on graphs containing attractive and repulsive interactions, SIAM Journal on Applied Mathematics, 74 (2014), pp. 83–105, https://doi.org/10.1137/130913973, http://dx.doi.org/10.1137/130913973. doi:10.1137/130913973. [4] W. Casaca, A. Paiva, and L. Nonato, Spectral segmentation using cartoon-texture decomposition and inner product-based metric, in Graphics, Patterns and Images (Sibgrapi), 2011 24th SIBGRAPI Conference on, Aug 2011, pp. 266–273, https://doi.org/10.1109/SIBGRAPI.2011.34. doi:10.1109/SIBGRAPI.2011.34. [5] P. K. Chan, M. D. F. Schlag, and J. Y. Zien, Spectral k-way ratiocut partitioning and clustering, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 13 (1994), pp. 1088–1096, https://doi.org/10.1109/43.310898. Signed Laplacian for spectral clustering revisited 21 [6] M. Cucuringu, I. Koutis, S. Chawla, G. Miller, R. Peng, and C. Qatar, Simple and scalable constrained clustering: A generalized spectral method, in Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, 2016, pp. 445–454, http://www.jmlr.org/proceedings/papers/v51/cucuringu16.pdf. [7] M. Fiedler, Algebraic connectivity of graphs, vak mathematical journal, 23 (1973), pp. http://dml.cz/handle/10338.dmlcz/101168. Czechoslo298–305. [8] M. Fiedler, A property of eigenvectors of nonnegative symmetric matrices and its application to graph theory, Czechoslovak Mathematical Journal, 25 (1975), pp. 619–633. http://hdl.handle.net/10338.dmlcz/101357. [9] J. Gallier, Spectral Theory of Unsigned and Signed Graphs. Applications to Graph Clustering: a Survey, ArXiv e-prints, (2016), https://arxiv.org/abs/1601.04692. http://adsabs.harvard.edu/abs/2016arXiv160104692G. [10] G. Gilboa, N. Sochen, and Y. Y. Zeevi, Forward-and-backward diffusion processes for adaptive image enhancement and denoising, IEEE Transactions on Image Processing, 11 (2002), pp. 689–703. doi:10.1109/TIP.2002.800883. [11] J. Ham, D. D. Lee, S. Mika, and B. Schölkopf, A kernel view of the dimensionality reduction of manifolds, in Proceedings of the Twenty-first International Conference on Machine Learning, ICML ’04, New York, NY, USA, 2004, ACM, pp. 47–, http://doi.acm.org/10.1145/1015330.1015417. doi:10.1145/1015330.1015417. [12] R. Jothi, S. K. Mohanty, and A. Ojha, On the Impact of Post-clustering Phase inMulti-way Spectral Partitioning, Springer International Publishing, Cham, 2015, pp. 161–169, https://doi.org/10.1007/978-3-319-26832-3_16. [13] A. Knyazev, Toward the optimal preconditioned eigensolver: locally optimal block preconditioned conjugate gradient method, SIAM J. Scientific Computing, 23 (2001), pp. 517–541. doi:10.1561/0600000020. [14] A. Knyazev, Edge-enhancing filters with negative weights, in 2015 IEEE Global Conference on Signal and Information Processing (GlobalSIP), Dec 2015, pp. 260–264. doi:10.1109/GlobalSIP.2015.7418197. [15] A. Knyazev and A. Malyshev, Conjugate gradient acceleration of non-linear smoothing filters, in 2015 IEEE Global Conference on Signal and Information Processing (GlobalSIP), Dec 2015, pp. 245–249. doi:10.1109/GlobalSIP.2015.7418194. Signed Laplacian for spectral clustering revisited 22 [16] A. V. Knyazev, Modern preconditioned eigensolvers for spectral image segmentation and graph bisection, in Proceedings of the workshop Clustering Large Data Sets; Third IEEE International Conference on Data Mining (ICDM 2003), Boley, Dhillon, Ghosh, and Kogan, eds., Melbourne, Florida, 2003, IEEE Computer Society, pp. 59–62. http://math.ucdenver.edu/~aknyazev/research/conf/ICDM03.pdf. [17] A. V. Knyazev and M. E. Argentati, Majorization for changes in angles between subspaces, Ritz values, and graph Laplacian spectra, SIAM Journal on Matrix Analysis and Applications, 29 (2007), pp. 15–32, https://doi.org/10.1137/060649070. doi:10.1137/060649070. [18] A. V. Knyazev, M. E. Argentati, I. Lashuk, and E. E. Ovtchinnikov, Block Locally Optimal Preconditioned Eigenvalue Xolvers (BLOPEX) in Hypre and PETSc., SIAM J. Scientific Computing, 29 (2007), pp. 2224–2239. doi:10.1137/060661624. [19] R. Kolluri, J. R. Shewchuk, and J. F. O’Brien, Spectral surface reconstruction from noisy point clouds, in Proceedings of the 2004 Eurographics/ACM SIGGRAPH Symposium on Geometry Processing, SGP ’04, New York, NY, USA, 2004, pp. 11–21, http://doi.acm.org/10.1145/1057432.1057434. doi:10.1145/1057432.1057434. [20] J. Kunegis, A. Lommatzsch, and C. Bauckhage, The Slashdot Zoo: Mining a social network with negative edges, in Proceedings of the 18th International Conference on World Wide Web, WWW ’09, New York, NY, USA, 2009, ACM, http://doi.acm.org/10.1145/1526709.1526809. pp. 741–750, doi:10.1145/1526709.1526809. [21] J. Kunegis, S. Schmidt, A. Lommatzsch, J. Lerner, E. W. D. Luca, and S. Albayrak, Spectral analysis of signed graphs for clustering, prediction and visualization, in Proceedings of the 2010 SIAM International Conference on Data Mining, SIAM, 2010, pp. 559– 570, http://epubs.siam.org/doi/abs/10.1137/1.9781611972801.49. doi:10.1137/1.9781611972801.49. [22] F. Li, H. Qiao, and B. Zhang, Effective deterministic initialization for $k$-means-like methods via local density peaks searching, CoRR, abs/1611.06777 (2016), http://arxiv.org/abs/1611.06777. [23] J. Liu and J. Han, Spectral clustering, in Data Clustering: Algorithms and Applications, C. Aggarwal and C. Reddy, eds., Chapman and Hall/CRC Press, 2013. http://www.crcnetbase.com/doi/pdf/10.1201/b15410-9. [24] U. Luxburg, A tutorial on spectral clustering, Statistics and Computing, 17 (2007), pp. 395–416, https://doi.org/10.1007/s11222-007-9033-z. doi:10.1007/s11222-007-9033-z. Signed Laplacian for spectral clustering revisited 23 [25] J. Ma, W. Huang, S. Segarra, and A. Ribeiro, Diffusion filtering of graph signals and its use in recommendation systems, in 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), March 2016, pp. 4563–4567. doi:10.1109/ICASSP.2016.7472541. [26] J. McQueen, M. Meila, J. VanderPlas, and Z. Zhang, megaman: Manifold learning with millions of points, CoRR, abs/1603.02763 (2016), http://arxiv.org/abs/1603.02763. [27] M. Meila and J. Shi, Learning segmentation by random walks, in Advances in Neural Information Processing Systems 13, T. K. Leen, T. G. Dietterich, and V. Tresp, eds., MIT Press, 2001, pp. 873–879. http://papers.nips.cc/paper/1830-learning-segmentation-by-random-walks.pdf. [28] A. Y. Ng, M. I. Jordan, and Y. Weiss, On spectral clustering: Analysis and an algorithm, in Advances in Neural Information Processing Systems 14, T. G. Dietterich, S. Becker, and Z. Ghahramani, eds., MIT Press, 2002, pp. 849–856. http://papers.nips.cc/paper/2092-on-spectral-clustering-analysis-and-an-algorithm.pdf. [29] J. Park, M. Jeon, and W. Pedrycz, Spectral clustering with physical intuition on spring-mass dynamics, J. Franklin Institute, 351 (2014), pp. 3245 – 3268, http://www.sciencedirect.com/science/article/pii/S0016003214000532. doi:10.1016/j.jfranklin.2014.02.017. [30] A. Pothen, H. D. Simon, and K.-P. Liou, Partitioning sparse matrices with eigenvectors of graphs, SIAM Journal on Matrix Analysis and Applications, 11 (1990), pp. 430–452, https://doi.org/10.1137/0611030, http://dx.doi.org/10.1137/0611030. [31] M. A. Riolo and M. E. J. Newman, First-principles multiway spectral partitioning of graphs, Journal of Complex Networks, 2 (2014), p. 121, https://doi.org/10.1093/comnet/cnt021. [32] L. Rossi, A. Torsello, and E. R. Hancock, Unfolding kernel embeddings of graphs: Enhancing class separation through manifold learning, Pattern Recognition, (2015), pp. –, https://doi.org/http://dx.doi.org/10.1016/j.patcog.2015.03.018, http://www.sciencedirect.com/science/article/pii/S0031320315001193. doi:10.1016/j.patcog.2015.03.018. [33] J. Shi and J. Malik, Normalized cuts and image segmentation, IEEE Trans. Pattern Anal. Mach. Intell., 22 (2000), pp. 888–905, http://dx.doi.org/10.1109/34.868688. doi:10.1109/34.868688. [34] L. Tang and Z. Fang, Edge and contrast preserving in total variation image denoising, EURASIP Journal on Advances in Signal Processing, 2016 (2016), pp. 1–21, https://doi.org/10.1186/s13634-016-0315-5, Signed Laplacian for spectral clustering revisited 24 http://dx.doi.org/10.1186/s13634-016-0315-5. doi:10.1186/s13634-016-0315-5. [35] J. Voss, M. Belkin, and L. Rademacher, The hidden convexity of spectral clustering, 2016, http://www.aaai.org/ocs/index.php/AAAI/AAAI16/paper/view/12307. [36] M. M. Wolf, A. M. Klinvex, and D. M. Dunlavy, Advantages to modeling relational data using hypergraphs versus graphs, in 2016 IEEE High Performance Extreme Computing Conference (HPEC), Sept 2016, pp. 1–7, https://doi.org/10.1109/HPEC.2016.7761624. [37] L. Wu, X. Wu, A. Lu, and Y. Li, On spectral analysis of signed and dispute graphs, in 2014 IEEE International Conference on Data Mining, Dec 2014, pp. 1049–1054. doi:10.1109/ICDM.2014.113.
8cs.DS
Optimal Stochastic Delivery Planning in Full-Truckload and Less-Than-Truckload Delivery arXiv:1802.08540v1 [cs.AI] 4 Feb 2018 Suttinee Sawadsitang∗, Rakpong Kaewpuang∗, Siwei Jiang†, Dusit Niyato∗ , Ping Wang∗ ∗ School of Computer Science and Engineering, Nanyang Technological University † Singapore Institute of Manufacturing Technology (SIMTech) A*STAR Abstract—With an increasing demand from emerging logistics businesses, Vehicle Routing Problem with Private fleet and common Carrier (VRPPC) has been introduced to manage package delivery services from a supplier to customers. However, almost all of existing studies focus on the deterministic problem that assumes all parameters are known perfectly at the time when the planning and routing decisions are made. In reality, some parameters are random and unknown. Therefore, in this paper, we consider VRPPC with hard time windows and random demand, called Optimal Delivery Planning (ODP). The proposed ODP aims to minimize the total package delivery cost while meeting the customer time window constraints. We use stochastic integer programming to formulate the optimization problem incorporating the customer demand uncertainty. Moreover, we evaluate the performance of the ODP using test data from benchmark dataset and from actual Singapore road map. Index Terms—Full-truckload, less-than-truckload, stochastic programming. I. I NTRODUCTION Recently, new businesses such as franchise and online shopping have been introduced and become popular rapidly. However, these businesses introduce sophisticated logistics requirements for product/package delivery. Given an increase in delivery destinations and demand fluctuation, suppliers need to strategize their delivery plan to minimize cost while meeting customer demand. Meanwhile, two delivery modes exist. The first delivery mode is for the supplier to rent a whole truck and use the truck for package delivery. This is referred to as full-truckload (FTL) delivery mode.1 The second mode is for the supplier to outsource the delivery to a third-party carrier in an on-demand basis. This is referred to as less-than-truckload (LTL) delivery mode.2 Suppliers can use either FTL, LTL, or the combination to achieve their business goal. The FTL, i.e., renting a truck, is likely to be cheaper than LTL if the truck capacity is fully or almost fully utilized. However, truck renting requires an advance reservation at which the supplier may not know the exact customer demands. The actual demand can be more or less than the reserved truck capacity, which result in under- and over-reservation problems, respectively. Furthermore, a customer may specify a time window of delivery. The time window is a period of time that a package must be delivered. Time window constraints 1 “FTL”,“Fleet”, 2 “LTL” “Private vehicle”, and “Truck” are interchangeable. and “Carrier” are interchangeable. can be hard and soft. In hard time window constraint, the delivery must be done within the window. In soft time window constraint, the delivery can be outside the window, but this incurs penalty cost to the delivery. With the time window constraints, the supplier can use on-demand LTL delivery services from a third party carrier. To address the aforementioned challenges, we consider the vehicle planning and routing problem to design optimal delivery routes from a depot to a number of geographically scattered customers [1]. In particular, we aim to obtain the routes for full-truckload (FTL) vehicles from a single depot to the customers to which their packages have to be delivered. The delivery must be in the time window of each customer. Alternatively, the LTL service can be used by the supplier in which the carrier is responsible to find the delivery route by itself. In this paper, we propose the Optimal Delivery Planning (ODP) to minimize the total delivery cost for suppliers. As such, we formulate an optimization problem based on stochastic integer programming. Uncertainty in the customer demands is taken into account together with customer time window constraints. The stochastic integer programming model allows to analyze and optimize FTL vehicle planning and routing and LTL services on multiple time stages given the available information of the uncertainty. Moreover, we perform extensive performance evaluation of the ODP based on both standard benchmark and actual test data of Singapore road map. Compared with the baseline methods, the proposed ODP can achieve significantly lower total delivery cost. II. R ELATED W ORK Vehicle Routing Problem (VRP) is one of the major research topics in supply chain management. The survey by Canhong Lin et al [1] (2014) shows the significantly increasing interests of VRP from researchers in academia and practitioners in industry due to new emerging business opportunities such as online shopping. However, most of the related work considered only private truckloads or full-truckload (FTL). Meanwhile, Vehicle Routing Problem with Private fleet and common Carrier (VRPPC) has got only little attention. VRPPC has some benefits over classical VRP as it allows more flexibility for the suppliers to use less-than-truckload (LTL) for delivery. However, VRPPC is more complex than VRP as external carriers are involved. VRPPC has been introduced in [2]. The VRPPC was formulated using mathematical programming to obtain the solutions regarding (i) which size of the FTL truck will be applied, (ii) which customer should be served by the FTL truck or an LTL carrier, and (iii) what the routing path of the FTL truck will be. To obtain the solutions, the greedy algorithm is adopted. The VRPPC [2] has been extended since then, e.g., [3], [4], [5], [6]. The authors in [3] formulated VRPPC by using integer programming [3]. They added initial cost of FTL trucks and cost of LTL carrier into objective function. The decision variable of LTL carriers was added into the optimization model, and the LTL decision variable was solved together with FTL and routing path. They proposed a heuristic algorithm, called TL-LTL algorithm to obtain the solution. The authors in [4] proposed the improved heuristic algorithm of [3], called “Selection, Routing and Improvement (SRI)”. The authors in [4] used λ-interchange procedure in the result improvement step while the authors in [3] used three procedures, i.e., intra-route twoexchanges, inter-route one-exchange and two-exchanges. The results from SRI algorithm are always closer to optimal values than TL-LTL results. The authors in [5] introduced the Iterated Density Estimation Evolutionary Algorithm (IDEA). It was shown that IDEA performs better than SRI. The comparison between genetic, SRI, and TL-LTL algorithms were presented in [6]. The evaluation indicated that under various settings the genetic and SRI algorithms can reach optimal results more frequently than the TL-LTL algorithm. Furthermore, the genetic algorithm obtains a solution faster than the TL-LTL algorithm. Although there are different optimization formulations and algorithms for VRPPC, we consider different aspects of the problem. In particular, as the customer demand is not known exactly when the supplier makes a decision in reality, existing formulations and algorithms which rely heavily on this information are not applicable. Therefore, we introduce the two-stage stochastic integer programming model to address the uncertainty issue of the customer demand. Moreover, we consider the time window constraint and truck traveling limit constraints as well as the improved subtour elimination. The comparison between the ODP and existing algorithms i.e., TLLTL, SRI, IDEA, is not presented as they did not consider randomness in the formulation. III. S YSTEM M ODEL AND A SSUMPTIONS In this section, we describe the Optimal Delivery Planning (ODP) system model. With the last mile delivery, we consider the decisions in the ODP to be made in two stages (Figure 1). The first stage is when the supplier decides how many and which FTL trucks will be used to deliver packages to which customers. The decision will be made based on the available FTL truck information and the probability distribution of customer demand. Here, the exact customer demand has not been known yet. In the second stage, the supplier makes two decisions after the actual demand is observed. The first FTL truck routing FTL truck routing LTL carrier assignment Reserve FTL trucks (1st stage) LTL carrier assignment FTL truck routing LTL carrier assignment Delivery Xi,t Yi,r Vu,v,t Morning time window Actual demand is observed Delivery Afternoon time window Delivery Evening time window 2nd stage Fig. 1: Timing diagram of decision making in Optimal Delivery Planning (ODP). decision is to determine the customers to be served by a particular FTL truck or by LTL service from a carrier. The second decision is to find the best delivery route of the FTL trucks to the assigned customers. The supplier has a set of customers to deliver packages. Let C = {C1 , C2 , . . . , Cn′ } denote the set of customers, where n′ denotes the total number of customers. Let ω = (D1 , D2 , . . . , Dn′ ) be a scenario of all customers. Di represents a binary parameter of demand from customer i in which Di = 1 means that customer Ci has demand, i.e., there is a package to be delivered, and Di = 0 otherwise. Note that two or more packages for the same customer can be grouped as one package. ω can be regarded as a scenario in which the set of scenarios is denoted by Q, i.e., ω ∈ Q. For example, if the supplier has three customers, the demand scenario is denoted by ω = (D1 , D2 , D3 ) in which (1, 1, 0) indicates that customers 1 and 2 have the demand while customer 3 does not. Let A = (A1 , A2 , . . . , An′ ) be a list of package weights, the unit of which is kilogram. We assume that if customer i has demand, i.e., Di = 1, then the package of the demand has the weight of Ai . Let T = {T1 , T2 , . . . , Tt′ } denote a set of FTL trucks of the supplier, where t′ is the total number of trucks. Let R = {R1 , R2 , . . . , Rr′ } denote a set of LTL carriers, where r′ is the total number of carriers. The supplier has to determine the route of FTL trucks starting from the depot to visit all assigned customers, and returning to the depot after the delivery is completed. Let U = C ∪ {depot} denote a set of locations of customers and the depot, which is the source and the sink of the routing. The distance from location u to location v is denoted by Ku,v . A. Customer Time Windows Time window is a time period that a customer requires its package to be delivered. In this paper, we consider three time windows, i.e., morning, afternoon, and evening. Let Im , Ia , and Ie be the sets of customers who will receive their packages in the morning, afternoon, and evening, respectively (Im , Ia , Ie ⊂ C and Im ∪ Ia ∪ Ie = C). The sets Im , Ia , and Ie must not include the same customers (Im ∩ Ia = ∅, Im ∩ Ie = ∅, Ia ∩ Ie = ∅). For each time window, a route of each FTL truck must not exceed its distance limit. The traveling distance limits are denoted as L(m) , L(a) , and L(e) for morning, afternoon, and evening, respectively. In addition, we assume that the package dispatching time at each customer is short and negligible. X X Xi,t + ∀i ∈ C, ∀ω ∈ Q (3) Ai Xi,t ≤ Ft , ∀t ∈ T (4) Xi,t ≤ 1000Wt , ∀t ∈ T (5) ∀u ∈ U , ∀t ∈ T , ∀ω ∈ Q (6) ∀t ∈ T , ∀ω ∈ Q (7) ∀t ∈ T , ∀ω ∈ Q (8) Vu,i,t (ω) = Xi,t Di (ω) ∀i ∈ C, ∀t ∈ T , ∀ω ∈ Q (9) Vi,u,t (ω) = Xi,t Di (ω) ∀i ∈ C, ∀t ∈ T , ∀ω ∈ Q (10) ∀t ∈ T , ∀ω ∈ Q (11) Vu,i,t (ω)Ku,i ≤ L(a) ∀t ∈ T , ∀ω ∈ Q (12) Vu,i,t (ω)Ku,i ≤ L(e) ∀t ∈ T , ∀ω ∈ Q (13) t∈T Yi,r (ω) ≥ Di (ω), r∈R X i∈C X i∈C Vu,u,t (ω) = 0 X Vu,0,t (ω) ≤ 1, u∈U X B. Pricing V0,u,t (ω) ≤ 1, u∈U Three different payments are considered. • C̄t denotes the initial cost for FTL truck t. The initial cost can include driver stipend, truck rental fee, and maintenance expense. bi,r denotes the LTL carrier service charge of delivering • C a package to customer i by carrier r. • C̈u,v denotes the routing cost of the FTL truck from location u to location v, where u, v ∈ U. The routing costs are calculated based on the distance between u and v. X u∈U X u∈U X X Vu,i,t (ω)Ku,i ≤ L(m) u∈U i∈I (m) X X u∈U i∈I (a) X X u∈U i∈I (e) Si,t (ω) − Sj,t (ω) + |C|Vi,j,t (ω) ≤ |C| − 1, ∀i, ∀j ∈ C, ∀t ∈ T , ∀ω ∈ Q IV. P ROBLEM F ORMULATION We formulate the stochastic integer programming model for the ODP. There are five decision variables in the model. Xi,t is an FTL truck allocation in which Xi,t = 1 if FTL truck t is allocated to customer i, and Xi,t = 0 otherwise. • Yi,r is an LTL carrier allocation in which Yi,r = 1 if LTL carrier r is used for customer i, and Yi,r = 0 otherwise. • Wt is a variable indicating the use of FTL truck for the delivery in which Wt = 1 if FTL truck t will be used, and Wt = 0 otherwise. • Vu,v,t is a routing variable in which Vu,v,t = 1 if FTL truck t will travel from location u to location v. Again, u, v = 0 represents the depot. • Si,t is an auxiliary variable for eliminating a subtour in the routing solution. The objective function given in (1) and (2) is to minimize total payment which includes (i) initial cost of FTL truck, (ii) LTL carrier service charge, and (iii) the cost of FTL vehicle routing. The expressions in (1) and (2) represent the first stage and second stage objectives, respectively. In the secondP stage, P (ω) is the probability of scenario ω. The term P i∈C t∈T Xi,t is used to minimize the allocation of FTL trucks to customers. • Minimize: XX Xi,t + i∈C t∈T X C̄t Wt + E[Q(Xi,t (ω), Wt (ω))], (1) t∈T where Q(Xi,t (ω), Wt (ω)) = X X X i∈C r∈R ω∈Q bi,r Yi,r (ω)+ P (ω)C X X X X u∈U v∈U t∈T ω∈Q subject to: (3) - (19) (2) P (ω)C̈u,v Vu,v,t (ω) (14) Si,t (ω)Di (ω) ≤ Sj,t (ω) + |I (m) |(1 − Di (ω)), ∀i ∈ I (m) , ∀j ∈ I (a) , ∀t ∈ T , ∀ω ∈ Q (15) Si,t (ω)Di (ω) ≤ Sj,t (ω) + |I(a) |(1 − Di (ω)), ∀i ∈ I (a) , ∀j ∈ I (e) , ∀t ∈ T , ∀ω ∈ Q Xi,t , Wt ∈ {0, 1}, Yi,r (ω), Vu,v,t (ω), ∈ {0, 1}, Si,t (ω) ∈ {0, 1, 2, 3, . . . , n′ }, ∀i ∈ C, ∀t ∈ T (16) (17) r ∈ R, ∀u, ∀v ∈ U , ∀t ∈ T , ∀ω ∈ Q (18) ∀i ∈ C, ∀t ∈ T , ∀ω ∈ Q (19) The constraint in (3) ensures that if customers have demand, their packages will be assigned to one FTL truck or one LTL carrier. For each FTL truck, the constraint in (4) ensures that the weight of packages must not exceed the capacity of FTL truck t denoted by Ft . The initial cost of each FTL truck t must be paid when any demand is assigned to FTL truck t as indicated in the constraint in (5). We assume that the total number of customers is less than 1000. The constraints in (6)-(10) are to find an optimal routing path. The constraint in (6) eliminates all the paths that start and end at the same point. The constraints in (7)-(8) are for the depot constraints. In particular, they guarantee that FTL trucks will have one path departing from and returning to the depot. Similar to the depot constraints, the constraints in (9)(10) are for the customers to be delivered by the FTL truck. In this case, the routing of customer Ci will not be selected, i.e., Vu,i,t , Vi,u,t = 0, if customer Ci does not have demand, or the customer has demand but the demand is not assigned to FTL truck t. To control the delivery distance limit of each FTL truck, the constraints in (11), (12), and (13) are used for morning, afternoon, and evening time windows, respectively. For example, each FTL truck cannot travel more than 100 kilometres in the morning, e.g., due to speed limit regulations. The subtour elimination constraint is given in (14). Si,t (ω) indicating a visiting order of routing if the path from and to customer i by truck t is selected. For each FTL truck, this constraint does not allow two or more disjointed tours to cover all assigned customers. One example of FTL truck t serving five customers is depot → C5 → C3 → C1 → C2 → C4 → depot, where S1,t = 3, S2,t = 4, S3,t = 2, S4,t = 5, S5,t = 1. This constraint can be explained that if the path from customer i to j is selected, i.e., Vi,j,t (ω) = 1, then Si,t (ω) must be less than Sj,t (ω). In addition, the constraint in (15) uses Si,t (ω) to ensure that all customers in the morning time window will be served before the afternoon time window. Similar to the constraint in (15), that in (16) ensures that all customers in the afternoon time window will be served before the evening time window. The last three constraints in (17)-(19) indicate the types and bounds of the decision variables. Xi,t , Wt , Yi,r (ω), and Vu,v,t (ω) are binary variables, and Si,t (ω) takes a value between one and the total number of customers. V. P ERFORMANCE E VALUATION A. Parameter Setting We consider the system model with three types of FTL trucks and one LTL carrier. FTL trucks include a panel van, a 10ft box truck, and a 14ft box truck, the capacities of which are F1 = 1060, F2 = 1360 and F3 = 2268 kilograms, respectively. Based on Singapore commercial vehicle rental agencies [8], [9], the initial costs for renting a truck are set as C̄1 = S$280, C̄2 = S$440 and C̄3 = S$640. The cost of FTL truck routing is C̈u,v = Ku,v × 1.05 × 0.1, which is calculated based on the distance between locations u and v multiplied by the approximate fuel price (S$ per litre) and the average fuel consumption rate (litre per kilometer). We base the values of the parameters on that from Singapore Government statistics [10]. For the LTL carrier, we adopt the parameters from the Speedpost service offered by SingPost company [11]. The LTL carrier service charge is S$21 for a 30 kilogram package. Ai is set equal to 30 kilograms. In this paper, we present the evaluation results from two different datasets including Solomon Benchmark Suite [7] and Singapore road network. For Solomon Benchmark Suite, we adopt the file C101 with some modification in our evaluation. The customer time window is calculated based on READYTIME/150 + 9 (12 < I (m) , 12 ≤ I (a) < 15, 15 ≤ I (e) ). For Singapore road network, we randomly choose 20 customer addresses and the location of the depot in Singapore. We assume that the traveling distance from location u to location v and from location v to location u are the same. The time windows are based on Solomon Benchmark Suite. For the presented experiments, we implement the stochastic integer programming model using GAMS Script [12]. Note that some parameters are varied for different experiment scenarios. B. Results and Explanations The vehicle routing solutions are presented in Figure 2 and Figure 3 for Singapore road network (20 customers) and Fig. 2: The van vehicle route of the real Singapore Road Network dataset. Solomon Benchmark Suite (40 customers), respectively. From the figures, only one panel van is selected. We observe that all customers in Singapore dataset are served by the FTL truck. However, for the Solomon Benchmark test result, 5 customers are served by the LTL carrier due to the capacity limit of the FTL truck. The total costs from the Solomon Benchmark and Singapore road map are S$400.686 and S$294.826. Note that the former includes S$280 of truck initial cost, $105 of LTL carrier service charge, and $15.686 of routing cost. The latter includes only $280 of truck initial cost and $14.826 of routing cost. C. Impact of the Number of Customers We consider the case that all customers have demand, i.e., one scenario in this case. The total cost when the number of customers increases is presented in Figure 4. When the number of customers is few, e.g., less than 15, the supplier always serves all the customers by the LTL truck. This is because the initial cost of the FTL truck is more expensive. When the number of customers increases to more than 15, only the FTL truck is used since its initial cost and routing cost become cheaper than that using LTL carrier. The truck can handle up to 35 customers due to the capacity limit, i.e., a package of each customer is 30 kilograms. D. Comparison We next compare the different schemes including using only van, using only 14ft lorry, using only 16ft lorry, using only LTL carrier, and our proposed ODP. The results are shown in Figure 5. If the supplier uses only FTL trucks, each truck has an initial cost. When the number of customers increases, the total cost increases almost linearly due to routing cost. Moreover, each truck has a capacity limit, and the number of customers that can be served is confined by such a constraint. On the other hand, using the LTL carrier is more flexible, and the supplier only needs to pay according to the actual demand. However, the LTL carrier charge is expensive and the total cost increases sharply especially when the number of customers is large. Evidently, the proposed ODP based on stochastic integer 1100 400 15 17 18 11 9 6 4 3 7 5 8 30 28 26 23 25 22 21 27 20 24 29 36 37 33 35 900 800 2 1 250 200 Exceed capacity 150 depot 34 38 Change to Van 700 600 Using 14ft + Carrier 500 100 Using Van + Carrier 400 32 Exceed 14ft truck capacity 50 31 Only Van Only 14ft Lorry Only 16ft Lorry Only LTL ODP 1000 300 13 10 39 350 Cost (S$) 19 14 12 Cost of Van Cost of Carrier Cost of Routing Total cost Cost (S$) 16 Morning Afternoon Evening Depot 300 40 Exceed Van capacity 0 10 15 20 25 30 35 40 200 10 15 20 Number of customers Fig. 3: The van vehicle route of Solomon benchmark. Fig. 4: Variant numbers of customers with one van truck in a system programming achieves the lowest total cost. This is due to the fact the ODP always uses the cheapest option. E. Impact of Customer Locations We then consider 21 customers, where customers C1 to C20 are from Solomon Benchmark dataset. The location of customer C21 is varied. The locations of all customers in this experiment are shown in Figure 6(a). Figure 6(b) presents the total cost. When customer C21 ’s location becomes farther away from C1 , the truck routing cost to this customer increases. Until the distance is more than the traveling distance limit, i.e., 50 kilometers, the supplier uses the LTL carrier to serve this customer C21 . Otherwise, the customer may not be served during the time window. 25 30 35 40 45 Number of Customers Fig. 5: The comparison between using only carrier, only one kind of FTL trucks, and the ODP. The ODP optimizes the total delivery cost for the supplier. The trade-off between truck allocation and carrier assignments has been optimized. The experiment results from two datasets, i.e., Solomon Benchmark and Singapore road network, have been presented. Compared to the other baseline schemes, the ODP has successfully achieved the lowest delivery cost. For the future work, we will incorporate a truck break down event into the optimization model. VII. ACKNOWLEDGMENT This work is partially supported by Singapore Institute of Manufacturing Technology-Nanyang Technological University (SIMTech-NTU) Joint Laboratory and Collaborative research Programme on Complex Systems. R EFERENCES 350 Morning Afternoon Evening Depot 16 14 12 15 18 17 300 250 13 11 10 9 6 4 8 7 3 5 2 1 distance between 1 to 21 is X 21 Cost (S$) 19 200 Cost of Van Cost of Carrier Cost of Routing Total cost Exceed distance limit 150 100 depot 20 50 0 10 20 30 40 50 60 70 80 90 100 Distance between Customer 1 to Customer 21 (a) (b) Fig. 6: Adding a customer (C21 ) to various locations as presented in (a). (b) presents total delivery cost. VI. C ONCLUSION In this paper, we have proposed the Optimal Delivery Planning (ODP) for a supplier to make the best decisions of fulltruckload and less-than truckload delivery. However, the delivery demand from customers is random and the information of which is not known when the trucks have to be reserved. Therefore, we have formulated the ODP as the two-stage stochastic programming with customer demand uncertainty. [1] C. Lin, K. L. Choy, G. T. S. Ho, S. H. Chung, and H. Y. Lam. “Survey of Green Vehicle Routing Problem: Past and future trends”. Expert Systems with Applications, vol. 41, pp. 1118-1138, 2014. [2] Ball, M. O., Golden, A., Assad, A., & Bodin, L. D. (1983). “Planning for truck fleet size in the presence of a common-carrier option”. Decision Sciences, 14, pp. 103-120, 1983. [3] C.-W. Chu, “A heuristic algorithm for the truckload and less-thantruckload problem”, European Journal of Operational Research, vol. 165, issue 3, pp. 657-667, 2005. [4] M.-C. Bolduc, J. Renaud, and F. Boctor,“A heuristic for the routing and carrier selection problem”, European Journal of Operational Research, vol. 183, no. 2, pp. 926-932, 1 December 2007. [5] Euchi J., Chabchoub H. “Iterated Density Estimation with 2-opt local search for the vehicle routing problem with private fleet and common carrier”. In Proceedings of International Conference on Computers & Industrial Engineering (CIE), vol., no., pp.1058-1063, 6-9 July 2009. [6] J. Kratica, T. Kostic, D. Tosic, D. Dugosija, and V. Filipovic,“A Genetic Algorithm for the Routing and Carrier Selection Problem”, Computer Science and Information Systems, vol. 9, no. 1, pp. 49-62, 2012. [7] M. M. Solomon,“Algorithms for the vehicle routing and scheduling problems with time window constraints”, Operations Research, vol. 35, no. 2, pp. 254-265, 1987. [8] http://sgvehiclerent.com/ [9] https://rentalorrysingapore.com/lorry-dimensions/ [10] https://www.lta.gov.sg/content/dam/ltaweb/corp/PublicationsResearch/files/ FactsandFigures/Statistics in Brief 2009.pdf [11] http://www.singpost.com/ [12] D. Chattopadhyay, “Application of General Algebraic Modeling System to Power System Optimization”, IEEE Transactions on Power Systems, vol.14 pp.15-22, 1999. 50
2cs.AI
Koji Tsukuda∗; Shuhei Mano† Abstract Consider two forms of sampling from a population: (i) drawing s samples of n elements with replacement and (ii) drawing a single sample of ns elements. In this paper, under the setting where the descending order population frequency follows the Poisson–Dirichlet distribution with parameter θ, we report that the magnitude relation of the Fisher information, which sample partitions converted from samples (i) and (ii) possess, can change depending on the parameters, n, s, and θ. Roughly speaking, if θ is small relative to n and s, the Fisher information of (i) is larger than that of (ii); on the contrary, if θ is large relative to n and s, the Fisher information of (ii) is larger than that of (i). The result represents one aspect of random distributions. MSC-2010. primary:62F10. secondary: 62D05, 92D10. key words and phrases: Bayesian nonparametrics; Fisher information; Microdata disclosure risk assessment; Population genetics; Random distribution. 1 Introduction Let us consider the statistical modeling of a random sampling that produces data containing ns records by drawing s sets of n elements with replacement, where n and s are positive integers. Let Zij be random variables corresponding j(= 1, . . . , n)-th element in i(= 1, . . . , s)-th sample. For example, when ∗ Graduate School of Arts and Sciences, The University of Tokyo, 3-8-1 Komaba, Meguro-ku, Tokyo 153-8902, Japan. mail: [email protected] † Department of Mathematical Analysis and Statistical Inference, The Institute of Statistical Mathematics, 10-3 Midori-cho, Tachikawa, Tokyo, 190-8562, Japan. mail: [email protected] 1 arXiv:1802.00578v1 [math.ST] 2 Feb 2018 A reversal phenomenon in estimation based on multiple samples from the Poisson–Dirichlet distribution we are interested in the population mean µ and the normal distribution N(µ, 1) with unit variance is used as a population model, the sample mean Z̄·· of ns records, which is a complete sufficient statistic, coincides with the sample mean of s sample means Z̄1· , . . . , Z̄n· , which are calculated from each sample set of size n. There exists a relation nsZ̄·· = n s X Z̄i· , i=1 and both samples have the same information for µ. Under the same setting, if we use the sample median Z̃·· of ns records to estimate the population mean µ (which is identical to the population median in the case of N(µ, 1)), which is not a sufficient statistic, have different information from one of which the sample mean Z̃¯·· of s sample medians Z̃1· , . . . , Z̃n· , which are calculated from each sample set of size n. This implies that when to pool affects the efficiency of inference. However, both of the asymptotic distributions of Z̃·· and Z̃¯·· as n → ∞ are N(µ, π/(2ns)), which indicates that they asymptotically have the same Fisher information, and so the efficiencies of inference asymptotically coincide. In this paper, we report a more curious phenomenon that the magnitude relation of the Fisher information reverses depending on the values of parameters. For the purpose of inferring the population diversity, the Poisson–Dirichlet distribution (Kingman, 1975) with parameter θ is assumed as a statistical model of the descending order population frequency. If θ is known, the homozygosity (1/(1 + θ)), the probability of discovering a new species (θ/(n + θ) where n is the sample size), the expected number of singletons (population uniques) in a finite population (n0 θ/(n0 + θ − 1) where n0 is the population size), and so on can be determined. Moreover, the Poisson–Dirichlet distribution prior (or the Dirichlet process prior) plays an important role in the nonparametric Bayesian estimation when there exist possibly infinite labels. For example, see Crane (2016) and its discussions; Ewens (1972); Hoshino and Takemura (1998); Samuels (1998). Therefore, estimating θ efficiently is a problem and we will show that sampling procedure influence the magnitude relation of the Fisher information, so our result can be applied to considering sampling procedures for estimating θ efficiently. Remark 1. Professor Masaaki Sibuya pointed out that our result represents an aspects of differences between independently and identically distributed (iid) sequences and non-iid sequences (in this paper exchangeable sequences are considered). 2 2 Sampling from the Poisson–Dirichlet distribution 2.1 Sampling procedures Assume that the descending order frequency of the infinite population follows the Poisson–Dirichlet distribution with parameter θ. For details about the properties of the Poisson–Dirichlet distribution and related distributions, we refer the reader to Feng (2010). In this paper, the following two types of samples are considered: • Sample (i) Drawing s samples of n elements with replacement. The numbers of distinct components in the respective sample partitions are denoted by X1 , . . . , Xs . • Sample (ii) Drawing a single sample of ns elements. The number of distinct components in the sample partition is denoted by Y . If a sample of m elements is drawn from a population that follows the Poisson–Dirichlet distribution with parameter θ, then we have a sample frequency. When the population diversity is in interest, we convert the sample frequency to a sample partition, and the sample partition follows the Ewens sampling formula with parameter (m, θ). Then, the number of distinct components in the sample partition, which is the number of labels in the sample, follows the falling factorial distribution with parameter (m, θ) (this distribution is described in the next subsection). Note that the number of distinct components in the sample is the complete sufficient statistic for θ. Hence, X1 , . . . , Xs independently and identically follow the falling factorial distribution with parameter (n, θ), and Y follows the falling factorial distribution with parameter (ns, θ). Even though the total numbers of elements are ns in both sampling processes, Samples (i) and (ii) contain different information. In this paper, we calculate the Fisher information acquired from the samples obtained using these two sampling processes and demonstrate that the magnitude relation of the Fisher information can be reversed based on the values of the parameters n, s and θ. In the literature, there is another model called the multi-observer ESF (Barbour and Tavaré, 2010), where the 2-observer version is considered in 3 Ewens et al. (2007). In the model, a sample of size n0 consists of S subsamples whose sizes are n1 , . . . , nS where n1 + · · · + nS = n0 . The motivation of Barbour and Tavaré (2010) is testing of the spatial homogeneity of tumors, which means the parameters θ are common in the left side and right side of a tumor. In the tumor example, when a common underlying evolution process is considered, Sample (i) fits the situation because the population frequencies are considered to be different even in the same side (see the data in Table 2.1 of Barbour and Tavaré (2010), or its original methylation patterns data in Fig 2 of Siegmund et al. (2009)). Remark 2. As for the multi-observer ESF, the marginal distributions of subsamples are also the Ewens sampling formula. Even if s subsamples in the whole S subsamples are considered with n1 + · · · + ns << n0 , s subsamples are not regarded as independent. However, they are exchangeable, and conditionally iid when the population frequency is fixed to one realization. On the other hand, our Sample (i) corresponds to the case where there are different s population frequencies. Remark 3. In the context of microdata disclosure risk assessments, the Ewens sampling formula has been used as a model for the frequency of frequencies, which is sometimes called the size index. See, for example, Hoshino and Takemura (1998) and Samuels (1998). The problem considered here fits the situation where an investigation is conducted in s areas and n individuals are surveyed in each area with an assumption on the Poisson– Dirichlet hyperpopulation. Sample (i) corresponds to the case where there are different s population frequencies for each area, and Sample (ii) corresponds to the case where there is only one population frequency. When collecting survey data, it is natural to consider that sample sizes are different area-by-area. However, to clearly observe the reversal phenomenon of the Fisher information, we assume that the sample sizes of all areas are the same. Remark 4. Consider there exists possibly infinite number of labels, and we have sample frequency with finite number of labels. In such situation, the Poisson-Dirichlet distribution can be used as a prior distribution, and in order to conduct empirical Bayes estimation its parameter should be estimated. Suppose there are s samples of size n. If the samples are drawn from different populations which independently follow the Poisson–Dirichlet distribution then Sample (i) is suitable; on the other hand if the samples are drawn from one population which follows the Poisson–Dirichlet distribution then Sample (ii) is suitable. 4 2.2 The falling factorial distribution If the probability distribution of a positive-integer-valued random variable X is given by pr(X = x) = f (x, θ) = s̄(n, x)θx , (θ)n (x = 1, 2, . . . , n), then the distribution of X is sometimes called the falling factorial distribution with parameter (n, θ) (Watterson, 1974), where (θ)n = θ(θ + 1) · · · (θ + n−1) and s̄(n, x) is the coefficient of θx in (θ)n . The falling factorial distribution is also called STR1F in Sibuya (1988). In a random partition following the Ewens sampling formula with parameter (n, θ), the number of distinct components follows the falling factorial distribution with parameter (n, θ) (Ewens, 1972). Since the number of distinct components is the complete sufficient statistic for θ, considering the falling factorial distribution is enough in order to estimate θ. In this subsection, we describe the known properties of a random variable X which follows the falling factorial distribution with parameter (n, θ). The moment generating function of X is given as E[eXt ] = n X s̄(n, i)(θet )i i=1 (θ)n = (θet )n Γ(θet + n)Γ(θ) = , (θ)n Γ(θ + n)Γ(θet ) where Γ(·) is the gamma function. Letting Ln (θ) = n X i=1 1 , θ+i−1 `n (θ) = n X i=1 i−1 , (θ + i − 1)2 the mean and variance of X can be written as E[X] = θLn (θ), var(X) = θ`n (θ). Let  lθ (x) = log(f (x, θ)) = log s̄(n, x)θx (θ)n  . Then, the log-likelihood is lθ (X) and its derivative l˙θ (X) with respect to θ is n X X 1 ∂ l˙θ (X) = lθ (X) = − . ∂θ θ θ+i−1 i=1 5 Since E[l˙θ (X)] = 0, the Fisher information of θ is  2  1 `n (θ) E l˙θ (X) = 2 var(X) = . θ θ The maximum likelihood estimator θ̂ of θ is the root of X− n X θ̂ i=1 θ̂ + i − 1 = 0. It is well known that if θ is fixed then θ̂ enjoys the asymptotic normality as n → ∞: p log n(θ̂ − θ) ⇒ N (0, θ) as n → ∞, where ⇒ denotes the convergence in distribution. Moreover, it may be useful for some situation to consider the case where θ grows with n (Feng, 2007; Griffiths and Tavaré, 2017; Tsukuda, 2017). In particular, the asymptotic normality of θ̂ has been extended to the asymptotic case where both n and θ tend to infinity (Tsukuda, 2017): r `n (θ) (θ̂ − θ) ⇒ N (0, 1) θ as n, θ → ∞ with n2 /θ → ∞, or as n → ∞ leaving θ > 0 fixed. The asymptotic variance θ/`n (θ) of θ̂ generally does not become θ/ log n. Indeed if n/θ → ∞ then `n (θ) ∼ log(n/θ) and if n/θ → 0 then `n (θ) ∼ n2 /(2θ2 ), where n and θ grow simultaneously. Therefore, it holds that if n/θ → ∞ then θ/`n (θ) ∼ θ/ log(n/θ); further, if n/θ → 0 then θ/`n (θ) ∼ 2θ3 /n2 . 3 The Fisher information of two samples In this section, the Fisher information of Samples (i) and (ii) is calculated, and the maximum likelihood estimators are presented. 3.1 Sample (i) Since X1 , . . . , Xs independently and identically follow the falling factorial distribution with a parameter (n, θ), the likelihood is given by s Y f (Xk , θ). k=1 6 Thus, the log-likelihood Mθ is Mθ = s X lθ (Xk ), k=1 so its derivative with respect to θ is Ṁθ = s X l˙θ (Xk ) = k=1 s X n Xk X 1 − θ θ+i−1 ! = i=1 k=1 s X Xk k=1 θ − n X i=1 s . θ+i−1 It follows from E[Ṁθ ] = 0 and from the independence of {l˙θ (Xk )}sk=1 that the Fisher information I1 (θ; n, s) with respect to θ is I1 (θ; n, s) = E  Ṁθ 2  = var(Ṁθ ) = s X k=1   s` (θ) n . var l˙θ (Xk ) = θ The maximum likelihood estimator θ̂(1) is the root of X̄ − n X θ̂(1) i=1 θ̂(1) + i − 1 = 0, where X̄ = s−1 T denotes the sample mean of {Xk }sk=1 where T = s X Xi . (3.1) i=1 Remark 5. The moment generating function of T is  Tt E e   = (θet )n (θ)n s = n  Y j=1 θ j−1 et + θ+j−1 θ+j−1 s . (3.2) Therefore, when s 6= 1, T does not follow the falling factorial distribution. Moreover, when n → ∞, if and only if sn2 /θ → ∞, T − sθLn (θ) p ⇒ N(0, 1) sθ`n (θ) (see Proposition 5 in Appendix). 7 3.2 Sample (ii) Since Y follows the falling factorial distribution with parameter (ns, θ), the Fisher information I2 (θ; n, s) with respect to θ is given as ns I2 (θ; n, s) = 1X i−1 `ns (θ) = . θ (θ + i − 1)2 θ i=1 The maximum likelihood estimator θ̂(2) is the root of Y − 4 ns X θ̂(2) i=1 θ̂(2) + i − 1 = 0. Comparing the two samples As is stated before, the Fisher information of Samples (i) and (ii) –I1 (θ; n, s) and I2 (θ; n, s), respectively– are different even though the total numbers of elements in the two Samples are the same. Considering simple asymptotic settings, the asymptotic magnitude relation between I1 (θ; n, s) and I2 (θ; n, s) can be observed as follows: If n → ∞ leaving s(≥ 2) and θ fixed, then s log n log n I1 (θ; n, s) ∼ , I2 (θ; n, s) ∼ , θ θ so I1 (θ; n, s) > I2 (θ; n, s) asymptotically; if s → ∞ leaving n(≥ 2) and θ fixed, then s`n (θ) log s I1 (θ; n, s) = , I2 (θ; n, s) ∼ , θ θ so I1 (θ; n, s) > I2 (θ; n, s) asymptotically. On the contrary, if n = 1 and s ≥ 2, I1 (θ; 1, s) = 0 < I2 (θ; 1, s), so I1 (θ; n, s) < I2 (θ; n, s). These observations indicate that the magnitude relation can be reversed based on the values of the parameters n, s and θ. To demonstrate this phenomenon more precisely, non-asymptotic sufficient conditions that guarantee the magnitude relation between I1 (θ; n, s) and I2 (θ; n, s) are provided in Subsection 4.1. Moreover, the asymptotic conditions that guarantee the asymptotic magnitude relation where a pair of parameters either (n, θ), (s, θ), or (n, s), grows simultaneously leaving the rest parameter fixed are provided in Subsection 4.2. 8 4.1 Non-asymptotic results In this subsection, let us provide sufficient conditions under which s`n (θ) > `ns (θ) and a sufficient condition under which s`n (θ) < `ns (θ). The results indicate that, roughly speaking, the former inequality holds when θ is relatively small in comparison to n and s, and the latter inequality holds when θ is relatively large in comparison to that relative to n and s. Firstly, we provide a sufficient condition under which s`n (θ) > `ns (θ). Theorem 1. (1) When θ ≥ 2, if integers s and n satisfy s ≥ 2 and n>1+ bθc − 1 + 1s , `bθc (θ) (4.1) then s`n (θ) > `ns (θ). (2) When θ < 2, if integers s and n satisfy s ≥ 2 and   1 n > 1 + (θ + 1)2 +1 , s (4.2) then s`n (θ) > `ns (θ). Proof. First, note that x 7→ x(θ + x)−2 is decreasing as x increases in the range x > θ because its derivative is x 7→ (θ − x)(θ + x)−3 . Moreover, either the hypothesis of (1) or (2) implies n > θ, since 1+ bθc − 1 + `bθc (θ) 1 s bθc − 1 + 1/2 2 ≥ bθc − 2 + , s −θ > 1+ where 1 s − θ = 2bθc − 1 + bθc(bθc − 1) θ(θ − 1) 1 < < 2 2 2θ 2θ 2 are used in the first inequality and   2 1 1 + (θ + 1) + 1 > θ. s `bθc (θ) < 9 2 −θ s Therefore, s`n (θ) − `ns (θ) n ns−s+1 X X i−1 i−1 = (s − 1) − − (θ + i − 1)2 (θ + i − 1)2 i=2 > (s − 1) n X i=2 i=n+1 ns X i=ns−s+2 i−1 (θ + i − 1)2 n i−1 − (ns − n − s + 1) 2 (θ + i − 1) (θ + n)2 (4.3) ns − s + 1 −(s − 1) (θ + ns − s + 1)2 # " n   X n ns − s + 1 i−1 . (4.4) − − = (s − 1) (θ + i − 1)2 (θ + n)2 (θ + ns − s + 1)2 i=2 Hereafter, the assertions (1) and (2) are considered separately. (1) When θ ≥ 2, the right-hand side of (4.4) is larger than    bθc  X i−1 n ns − s + 1 . (s − 1)  − − (θ + i − 1)2 (θ + n)2 (θ + ns − s + 1)2 i=2 Further, if the hypothesis is true then this display is positive, because the terms enclosed in the brackets are bθc  X i=2 i−1 n − (θ + i − 1)2 (θ + n)2  − ns − s + 1 (θ + ns − s + 1)2 ns − s + 1 n − (θ + n)2 (θ + ns − s + 1)2 1 1 > `bθc (θ) − (bθc − 1) − n − 1 s(n − 1)   1 1 = `bθc (θ) − bθc − 1 + . s n−1 = `bθc (θ) − (bθc − 1) (2) When θ < 2, the right-hand side of (4.4) is larger than   1 n ns − s + 1 (s − 1) − − . (θ + 1)2 (θ + n)2 (θ + ns − s + 1)2 Further, if the hypothesis is true then this display is positive, because the 10 θ= s=2 s=3 s = 10 Table 1: Values of 2 3 4 13.50 17.54 22.32 12.00 16.37 21.26 9.90 14.74 19.77 (4.5) 5 27.30 26.29 24.87 10 52.83 51.90 50.61 100 518.53 517.66 516.44 terms enclosed in the brackets are > = 1 n ns − s + 1 − − 2 2 (θ + 1) (θ + n) (θ + ns − s + 1)2 1 1 1 − − 2 (θ + 1) n − 1 s(n − 1)   1 1 1 − 1+ . (θ + 1)2 s n−1 This completes the proof. Remark 6. To evaluate (4.1), some values of 1+ bθc − 1 + `bθc (θ) 1 s (4.5) are shown in Table 1. The condition given in Theorem 1 is only a sufficient condition; when (n, s, θ) = (7, 2, 3), s`n (θ) − `ns (θ) = 0.042 > 0. If θ ≤ 1 then (4.2) is satisfied for n ≥ 8 and s ≥ 2. Therefore, we have the following corollary. Corollary 2. If θ ≤ 1, then I1 (θ; n, s) > I2 (θ; n, s) for any integers n ≥ 8 and s ≥ 2. Next, we provide another sufficient condition under which s`n (θ) > `ns (θ). Theorem 3. If  1≤θ≤ s log(1 + ns) 1/2 − 1, then s`n (θ) > `ns (θ) for any integers n ≥ 2 and s ≥ 2. Proof. From `n (θ) = Ln (θ) − θ n X i=1 11 1 , (θ + i − 1)2 (4.6) n X i=1 and 1 n ≥ , (θ + i − 1)2 θ(n + θ)  n n Ln (θ) < log 1 + + θ θ(θ + n) (see the proof of Proposition 1 in Tsukuda (2017) for derivations of these inequalities), it follows that    n 1 n `n (θ) < log 1 + + −1 . θ θ θ+n When θ ≥ 1, this display implies that  ns  `ns (θ) < log 1 + θ ≤ log (1 + ns) . On the other hand, when n ≥ 2, it holds that s s`n (θ) ≥ . (θ + 1)2 (4.7) (4.8) (4.9) Hence, (4.8) and (4.9) imply that s`n (θ) − `ns (θ) > s − log (1 + ns) ≥ 0, (θ + 1)2 where the last inequality follows from the assumption (4.6). This completes the proof. Remark 7. By using (4.7) instead of (4.8), we can loose (4.6) to  1/2 s 1≤θ≤ − 1. log (1 + ns/θ) Remark 8. By assuming more direct condition, we may have sharper sufficient conditions. For example, if `n (θ) > nθ log s − s + 1 (n + 1 + θ)(ns + 1 + θ) (4.10) then s`n (θ) − `ns (θ) > 0. That is because   n+θ (s − 1)nθ + s`n (θ) − `ns (θ) > (s − 1)`n (θ) + log ns + θ (n + 1 + θ)(ns + 1 + θ)   log s nθ > (s − 1) `n (θ) + − , (n + 1 + θ)(ns + 1 + θ) s + 1 12 where we have used b X i=a i (i + θ)2  b  X 1 θ − i + θ (i + θ)2 i=a   b+θ θ(b − a + 1) < log − a−1+θ (a + θ)(b + 1 + θ) = for positive integers a, b (a ≤ b). However, interpreting (4.10) in the current form may be difficult. Finally, we provide a sufficient condition under which s`n (θ) < `ns (θ). Theorem 4. If θ> p (n − 1)(ns + n − 1), (4.11) then s`n (θ) < `ns (θ) for any integers n ≥ 1 and s ≥ 2. Proof. Define the function g : s 7→ g(s) as g(s) = s`n (θ) − `ns (θ). First, when n = 1, it holds that g(s) = −`s (θ) < 0 for s = 2, 3, . . .. Next, consider n ≥ 2. Since g(1) = 0, it is sufficient to show that g(s + 1) < g(s) when (4.11) is satisfied. It holds that g(s + 1) − g(s) = `n (θ) − `n(s+1) (θ) + `ns (θ) n X ns+n X i−1 i−1 = − 2 (θ + i − 1) (θ + i − 1)2 i=1 i=ns+1  n  X i−1 ns + i − 1 = − (θ + i − 1)2 (θ + ns + i − 1)2 i=1  n  X (i − 1)(θ + ns + i − 1)2 − (ns + i − 1)(θ + i − 1)2 = , (θ + i − 1)2 (θ + ns + i − 1)2 i=1 where the numerator of the fraction contained in the brackets on the righthand side is negative since   ns −θ2 + (i − 1)(ns + i − 1) ≤ ns −θ2 + (n − 1)(ns + n − 1) < 0. Therefore it holds that g(s + 1) < g(s), which implies g(s) < g(1) = 0 for s = 2, 3, . . .. This completes the proof. 13 Table 2: Asymptotic values of s`n (θ) and `ns (θ) and the asymptotic magnitude relations of the corresponding Fisher information asymptotic setting s`n (θ) `ns (θ) magnitude relation (I) n/θ → ∞, s:fixed s log(n/θ) log(n/θ) I1 > I2 (II) n/θ → 0, s:fixed n2 s/(2θ2 ) n2 s2 /(2θ2 ) I1 < I2 (III) s/θ → ∞, n:fixed n2 s/(2θ2 ) log(s/θ) case-by-case 2 2 (IV) s/θ → c 6= 0, n:fixed n s/(2θ ) `ns (θ) I1 < I2 (V) s/θ → 0, n:fixed n2 s/(2θ2 ) n2 s2 /(2θ2 ) I1 < I2 (VI) n, s → ∞, θ:fixed s log n log(ns) I1 > I2 4.2 Asymptotic results In this subsection, we consider situations where two of n, s, and θ tend to infinity simultaneously leaving the rest one fixed. The results presented in this subsection are summarized in Table 2, where I1 (θ; n, s) and I2 (θ; n, s) are denoted by I1 and I2 , respectively. Six different cases with various asymptotic settings are considered as follows: (I) n/θ → ∞, leaving s ≥ 2 fixed Since n n s`n (θ) ∼ s log , `ns (θ) ∼ log , θ θ it follows that s`n (θ) > `ns (θ) asymptotically. This corresponds to Theorem 1 since `bθc (θ)  1 as θ → ∞. (II) n/θ → 0, leaving s ≥ 2 fixed Since n2 n2 s2 s`n (θ) ∼ s 2 , `ns (θ) ∼ , 2θ 2θ2 it follows that s`n (θ) < `ns (θ) asymptotically. This corresponds to Theorem 4. (III) s/θ → ∞, leaving n ≥ 2 fixed Since s n2 , s`n (θ) ∼ s 2 , `ns (θ) ∼ log 2θ θ there are three possible cases that differ in terms of the asymptotic magnitude relation between s and θ2 log (s/θ): (a) If s/(θ2 log (s/θ)) → ∞ then 14 s`n (θ) > `ns (θ) asymptotically, which corresponds to Theorem 3 (see Remark 7). (b) If s/(θ2 log (s/θ)) → 0 then s`n (θ) < `ns (θ) asymptotically, which partly corresponds to Theorem 4. (c) If s  θ2 log (s/θ) then s`n (θ) ∼ n2 K log θ, 2 `ns (θ) ∼ log θ, where K = lim s/(θ2 log (s/θ)); therefore, in this case, the asymptotic magnitude relation between s`n (θ) and `ns (θ) is determined by the magnitude relation between K and 2/n2 . (IV) s  θ, leaving n ≥ 2 fixed Since s`n (θ) ∼ s and  lim inf `ns (θ) > lim inf s,θ s,θ n2 →0 2θ2 ns(ns − 1) 1 2θ2 (1 + ns/θ)2  > 0, which follows from `ns (θ) > ns X 1 ns(ns − 1) 1 (j − 1) = , (θ + ns)2 2θ2 (1 + ns/θ)2 i=1 it holds that s`n (θ) < `ns (θ) asymptotically. This corresponds to Theorem 4. (V) s/θ → 0, leaving n ≥ 2 fixed Since n2 n2 s2 s`n (θ) ∼ s 2 , `ns (θ) ∼ , 2θ 2θ2 it follows that s`n (θ) < `ns (θ) asymptotically. This corresponds to Theorem 4. (VI) n, s → ∞, leaving θ fixed Since s`n (θ) ∼ s log n, `ns (θ) ∼ log (ns) , it follows that s`n (θ) > `ns (θ) asymptotically. This corresponds to Theorem 1. 15 5 Concluding remarks Under the assumption of the Poisson–Dirichlet population, we have presented that two ways (i) and (ii) of sampling procedures have different information, that is to say, they lead totally different results. The reason of this phenomenon is that the Ewens sampling formula represents the law of samples from the Poisson–Dirichlet population, a typical random discrete distribution. By virtue of the de Finetti theorem, for an exchangeable sequence there exists a directing measure such that the sequence is conditionally iid. Our result indicates that when data analyses using random distributions are conducted, it is crucial to decide whether the data in interest is sample from an unobservable identical directing measure or not. A Appendix: The asymptotic normality of T In this Appendix, the following proposition, which was mentioned in Remark 5, is proven. Proposition 5. If then sn2 → ∞, θ (A.1) T − sθLn (θ) ⇒ N(0, 1) σ (A.2) where T is as defined in (3.1) and σ = σ(n, s, θ) = (sθ`n (θ))1/2 . Moreover, when n → ∞, (A.1) is also necessary for (A.2). Proof. For i = 1, 2, . . . , ns, let pi = θ , θ+j (i − 1 ≡ j (mod n)). Consider a triangular sequence {ξi }ns i=1 of independent Bernoulli variables, where E[ξi ] = pi for all i = 1, . . . , ns. Then, from (3.2), the distribution of T is the same as the distribution of ns X ξi . i=1 First, we prove that (A.1) implies Pns i=1 ξi − sθLn (θ) ⇒ N(0, 1). σ 16 (A.3) From the central limit theorem for bounded random variables, it is sufficient to show that σ → ∞. When n/θ → ∞ or n/θ → c > 0, it follows that σ 2 = sθ`n (θ) → ∞. When n/θ → 0, it follows from (A.1) that σ 2 = sθ`n (θ) ∼ sn2 → ∞. 2θ Next, we prove that when n → ∞ (A.3) implies (A.1). Assume that (A.1) does not hold. Consider n, s, θ such that ns < θ. Since σ 2 ∼ sn2 /(2θ) and ns − 1 ns pi (1 − pi ) ≤ θ ∼ 2 (θ + ns − 1) θ for all i which follows from the fact that x(θ + x)−2 is increasing for x < θ, it holds that 1 max {pi (1 − pi )} → 0. σ 2 1≤i≤ns Hence, in order for (A.3) to hold, the Lindeberg condition ns  1 X  E |ξi − pi |2 1{|ξi − pi | > εσ} = 0 2 n,s,θ σ lim (A.4) i=1 for any ε > 0 is necessary where 1{·} is the indicator function, so we see that (A.4) does not hold. Since sup (s`n (θ)) < ∞, n,s,θ we can take  ε = inf n,s,θ θ σ(θ + n)  > 0. Then, we have pi θ > >ε σ σ(θ + n) for all i = 1, . . . , ns, which yields that   E |ξi − pi |2 1{|ξi − pi | > εσ} = (1 − pi )2 pi 1{1 − pi > εσ} + (pi )2 (1 − pi )1{pi > εσ} ≥ (pi )2 (1 − pi ). 17 Therefore, we have ns  1 X  E |ξi − pi |2 1{|ξi − pi | > εσ} 2 σ ≥ = > = 1 σ2 s σ2 i=1 ns X (pi )2 (1 − pi ) i=1 n−1 X j=0 θ θ+j 2  j θ+j  n−1 sθ2 X j 2 σ (θ + n)3 j=0 2 sθ n(n − 2(θ + 1) n)3 σ 2 . When (A.1) does not hold, it holds that σ 2 ∼ sn2 /(2θ), which guarantees that the right-hand side of the above display can not converge to 0 because θ3 sθ2 n(n − 1) ∼ 6→ 0. 2(θ + n)3 σ 2 (θ + n)3 This completes the proof. Letting s = 1 in Proposition 5, we have the following corollary, which is essentially equivalent to Theorem 2 of Tsukuda (2017) (the necessary part is given from Theorem 3 of Tsukuda (2017)). Corollary 6. n2 /θ → ∞ is equivalent to X − θLn (θ) p ⇒ N(0, 1), θ`n (θ) where X follows the falling factorial distribution with parameter (n, θ). Remark 9. When n → ∞, Proposition 5 yields that (A.2) holds only if n2 s/θ → ∞. On the contrary, when n → ∞, Corollary 6 yields that Y − θLns (θ) p ⇒ N(0, 1) θ`ns (θ) (A.5) if (and only if ) n2 s2 /θ → ∞, where Y follows the falling factorial distribution with parameter (ns, θ). Hence, even when (A.2) does not hold, (A.5) can hold. 18 Acknowledgments The authors would like to express their gratitude to Professor Nobuaki Hoshino for explaining his motivation in disclosure risk assessments concerning Remark 3 and Professor Masaaki Sibuya for providing us valuable comments. This work was supported by Grant-in-Aid for Scientific Research (B) 16H02791, from Japan Society for the Promotion of Science. References Barbour, A.D. and Tavaré, S. (2010). Assessing molecular variability in cancer genomes. Chapter 4 of “Probability and Mathematical Genetics: Papers in Honour of Sir John Kingman” (Editors N.H. Bingham and C.M. Goldie), Cambridge University Press. Crane, H. (2016). The ubiquitous Ewens sampling formula. Statist. Sci. 31, no.1, 1–19. Ewens, W.J. (1972). The sampling theory of selectively neutral alleles. Theoret. Population Biology 3, 87–112 Ewens, W.J., Choudhury, A.R., Lewontin, R.C., Wiuf, C. (2007). Two variance results in population genetics theory. Math. Popul. Stud. 14 (2), 93–110. Feng, S. (2007). Large deviations associated with Poisson–Dirichlet distribution and Ewens sampling formula. Ann. Appl. Probab. 17, no. 5–6, 1570–1595. Feng, S. (2010). The Poisson-Dirichlet distribution and related topics. Models and asymptotic behaviors. Springer, Heidelberg. Fisher, R.A., Corbet, A.S. and Williams, C.B. (1943). The relation between the number of species and the number of individuals in a random sample of an animal population. J. Animal Ecology 12, 42–58. Griffiths, R.C. and Tavaré, S. (2017) Ancestral distributions in the coalescent. arxiv: 1705.09485. Hoshino, N. and Takemura, A. (1998). Relationship between logarithmic series model and other superpopulation model useful for microdata disclosure risk assessment. J. Japan Statist. Soc. 28, 125–134. 19 Kingman, J.F.C. (1975). Random discrete distribution. J. Roy. Statist. Soc. Ser. B 37, 1–15. Samuels, S.M. (1998). A Bayesian, species-sampling-inspired approach to the uniques problem in microdata disclosure risk assessment. J. Official Statist. 14, 373–383. Sibuya, M. (1988). Log-concavity of Stirling numbers and unimodality of Stirling distributions. Ann. Inst. Statist. Math. 40, no.4, 693–714. Siegmund, K.D., Marjoram, P., Woo, Y.-J., Tavaré, S., and Shibata, D. (2009). Inferring clonal expansion and cancer stem cell dynamics from DNA methylation patterns in colorectal cancers. Proc. Natl. Acad. Sci. USA 106, no.12, 4828–4833. Tsukuda, K. (2017). Estimating the large mutation parameter of the Ewens sampling formula. J. Appl. Probab. 54, no.1, 42–54. Watterson, G.A. (1974). Models for the logarithmic species abundance distributions. Theoret. Population Biology 6, 217–250. 20
10math.ST
Submitted to Bernoulli Second Order Correctness of Perturbation Bootstrap M-Estimator of Multiple Linear Regression Parameter∗ arXiv:1605.01440v2 [math.ST] 17 Dec 2017 DEBRAJ DASa and S. N. LAHIRIb a Department of Statistics, University of Wisconsin-Madison, 1300 University Avenue, Madison, WI 53706, USA. E-mail: [email protected] b Department of Statistics, North Carolina State University, 2311 Stinson Dr, Raleigh, NC 27695-8203, USA. E-mail: [email protected] Abstract. Consider the multiple linear regression model yi = x′i β + ǫi , where ǫi ’s are independent and identically distributed random variables, xi ’s are known design vectors and β is the p × 1 vector of parameters. An effective way of approximating the distribution of the M-estimator β̄n , after proper centering and scaling, is the Perturbation Bootstrap Method. In this current work, second order results of this non-naive bootstrap method have been investigated. Second order correctness is important for reducing the approximation error uniformly to o(n−1/2 ) to get better inferences. We show that the classical studentized version of the bootstrapped estimator fails to be second order correct. We introduce an innovative modification in the studentized version of the bootstrapped statistic and show that the modified bootstrapped pivot is second order correct (S.O.C.) for approximating the distribution of the studentized M-estimator. Additionally, we show that the Perturbation Bootstrap continues to be S.O.C. when the errors ǫi ’s are independent, but may not be identically distributed. These findings establish perturbation Bootstrap approximation as a significant improvement over asymptotic normality in the regression M-estimation. Keywords: M-Estimation, S.O.C., Perturbation Bootstrap, Edgeworth Expansion, Studentization, Residual Bootstrap, Generalized Bootstrap, Wild Bootstrap. 1. Introduction Consider the multiple linear regression model : yi = x′i β + ǫi , i = 1, 2, . . . , n (1.1) where y1 , . . . , yn are responses, ǫ1 , . . . , ǫn are independent and identically distributed (IID) random variables with common distribution F (say), x1 , . . . , xn are known non random design vectors and β is the p-dimensional vector of parameters. ∗ Research partially supported by NSF grants no. DMS 1310068, DMS 1613192 1 2 Das D. and Lahiri S. N. Suppose β̄n is the M-estimator of β corresponding to the objective function Λ(·) i.e. β̄n = arg mint Pn i=1 Λ(yi − x′i t). Now if ψ(·) is the derivative of Λ(·), then β̄n is the M- estimator corresponding to the score function ψ(·) and is defined as the solution of the vector equation n X i=1 xi ψ(yi − x′i β) = 0. It is known [cf. Huber(1981)] that under some conditions on the objective function, design vectors and error distribution F ; (β̄n − β) with proper scaling has an asymptotically normal distribution with mean 0 and dispersion matrix σ 2 Ip where σ 2 = Eψ 2 (ǫ1 )/E2ψ ′ (ǫ1 ). After introduction of bootstrap by Efron in 1979 as a resampling technique, it has been widely used as a distributional approximation method. Resampling from the naive empirical distribution of the centered residuals in a regression setup, called residual bootstrap, was introduced by Freedman (1981). Freedman (1981) and Bickel and Freedman (1981b) had √ shown that given data, the conditional distribution of n(βn∗ − β̄n ) converges to the same √ normal distribution as the distribution of n(β̄n − β) when β̄n is the usual least square estimator of β, that is, when Λ(x) = x2 . It implies that the residual bootstrap approximation to the exact distribution of the least square estimator is first order correct as in the case of normal approximation. The advantage of the residual bootstrap approximation over normal approximation for the distribution of linear contrasts of least square estimator for general p was first shown by Navidi (1989) by investigating the underlying Edgeworth Expansion (EE); although heuristics behind the same was given by Liu (1988) in restricted case p = 1. Consequently, EE for the general M-estimator of β was obtained by Lahiri (1989b) when p = 1; whereas the same for the multivariate least square estimator was found by Qumsiyeh (1990a). EE of standardized and studentized versions of the general M-estimator in multiple linear regression setup was first obtained by Lahiri (1992). Lahiri (1992) also established the second order results for residual bootstrap in regression M-estimation. A natural generalization of sampling from the naive empirical distribution is to sample from a weighted empirical distribution to obtain the bootstrap sample residuals. Broadly, the resulting bootstrap procedure is called the weighted or generalized bootstrap. It was introduced by Mason and Newton (1992) for bootstrapping mean of a collection of IID random variables. Mason and Newton (1992) considered exchangeable weights and established its consistency. Lahiri (1992) established second order correctness of generalized bootstrap in approximating the distribution of the M-estimator for the model (1.1) when the weights are chosen in a particular fashion depending on the design vectors. Wellner and Zhan (1996) proved the consistency of infinite dimensional generalized bootstrapped M-estimators. Con- S.O.C. of Perturbation Bootstrap 3 sequently, Chatterjee and Bose (2005) established distributional consistency of generalized bootstrap in estimating equations and showed that generalized bootstrap can be used in order to estimate the asymptotic variance of the original estimator. Chatterjee and Bose (2005) also mentioned the bias correction essential for achieving second order correctness. An important special case of generalized bootstrap is the bayesian bootstrap of Rubin (1981). Rao and Zhao (1992) showed that the distribution function of M-estimator for the model (1.1) can be approximated consistently by bayesian bootstrap. See the monograph of Barbe and Bertail (2012) for an extensive study of generalized bootstrap. A close relative to the generalized bootstrap procedure is the wild bootstrap. It was introduced by Wu (1986) in multiple linear regression model (1.1) with errors ǫi ’s being heteroscedastic. Beran (1986) justified wild bootstrap method by pointing out that the distribution of the least square estimator can be approximated consistently by the wild bootstrap approximation. Second order results of wild bootstrap in heteroscedastic regression model was first established by Liu (1988) when p = 1. Liu (1988) also showed that usual residual bootstrap is not capable of approximating the distribution of the least square estimator upto second order in heteroscedastic setup and described a modification in resampling procedure which can establish second order correctness. For general p, the heuristics behind achieving second order correctness by wild bootstrap in homoscedastic least square regression were discussed in Mammen (1993). Recently, Kline and Santos (2011) developed a score based bootstrap method depending on wild bootstrap in M-estimation for the homoscedastic model (1.1) and established consistency of the procedure for Wald and Lagrange Multiplier type tests for a class of M-estimators under misspecification and clustering of data. A novel bootstrap technique, called the perturbation bootstrap was introduced by Jin, Ying, and Wei (2001) as a resampling procedure where the objective function having a Uprocess structure was perturbed by non-negative random quantities. Jin, Ying, and Wei (2001) showed that in standardized setup, the conditional distribution of the perturbation resampling estimator given the data and the distribution of the original estimator have the same limiting distribution which means this resampling method is first order correct without studentization. In a recent work, Minnier, Tian, and Cai (2011) also applied this perturbation resampling method in penalized regression setup such as Adaptive Lasso, SCAD, lq penalty and showed that the standardized perturbed penalized estimator is first order correct. But, second order properties of this new bootstrap method have remained largely unexplored in the context of multiple linear regression. In this current work, the perturbation bootstrap approximation is shown to be S.O.C. for the distribution of studentized M-estimator for the regression model (1.1). An extension to the case of independent and non-IID errors is also established, showing the robustness of perturbation bootstrap towards the presence 4 Das D. and Lahiri S. N. of heteroscedasticity. Therefore, besides the existing bootstrap methods, the perturbation bootstrap method can also be used in regression M-estimation for making inferences regarding the regression parameters and higher order accuracy can be achieved than the normal approximation. A classical way of studentization in bootstrap setup, in case of regression M-estimator and for IID errors, is to consider the studentization factor to be σn∗ = s∗n τn∗−1 , τn∗ = n−1 −1 s∗2 n = n Pn i=1 Pn i=1 ψ ′ (ǫ∗i ), ψ 2 (ǫ∗i ) where ǫ∗i = yi − x′i βn∗ , i ∈ {1, . . . , n}, with βn∗ being the perturbation bootstrapped estimator of β, defined in Section 2. Although the residual bootstrapped es- timator is S.O.C. after straight-forward studentization, the same pivot fails to be S.O.C. in the case of perturbation bootstrap. Two important special cases are considered as examples in this respect. The reason behind this failure is that although the bootstrap residuals are sufficient in capturing the variability of the bootstrapped estimator in residual bootstrap, it is not enough in the case of perturbation resampling. Modifications have been proposed as remedies and are shown to be S.O.C. The modifications are based on the novel idea that the variability of the random perturbing quantities G∗i (1 ≤ i ≤ n) along with the bootstrap residuals are required to capture the variability of the perturbation bootstrapped estimator; whereas individually they are not sufficient. For technical details, see Section 4.2 and Section 5.1. With a view to establish second order correctness, we start with the standardized setup and then proceed to studentization. First, we find a two-term EE of the conditional density of a suitable stochastic approximation of the concerned bootstrapped pivot and then we show that it is the required two-term EE corresponding to the bootstrapped pivot. The result then follows by comparing the EE of the bootstrapped pivot with that of underlying original pivot. The techniques that are to be used in finding EE have been demonstrated and discussed in Bhattacharya and Ghosh (1978), Bhattacharya and Rao (1986), Navidi (1989) and Lahiri (1992). A significant volume of work is available in bootstrapping M-estimators. We will conclude this section by briefly reviewing the literature. Bootstrapping M-estimators in linear model has been studied by Navidi(1989), Lahiri (1992, 1996), Rao and Zhao (1992), Qumsiyeh (1994), Karabulut and Lahiri (1997), Jin, Ying and Wei (2001), Hu (2001), El Bantli (2004) among others. And in the applications other than linear model, bootstrapping in M-estimation and its subclasses has been investigated by Arcones and Giné (1992), Lahiri (1994), Wellner and Zhan (1996), Allen and Datta (1999), Hu and Kalbfleisch (2000), Hlavka (2003), Wang and Zhou (2004), Chatterjee and Bose (2005), Ma and Kosorok (2005), Lahiri and Zhu (2006), Cheng and Huang (2010), Feng et. al. (2011), Lee (2012), Cheng (2015), among others. S.O.C. of Perturbation Bootstrap 5 The rest of the paper is organized as follows. Perturbation bootstrap is described briefly in Section 2. Section 3 states the assumptions and motivations behind considering those assumptions. Main results for IID case, along with the modification in bootstrap studentization, are stated in Section 4. An extension to the case of independent and non-IID errors is proposed in Section 5. An outline of the proofs are given in Section 6. Section 7 states concluding remarks. The details of the proofs are available in a supplementary material Das and Lahiri (2017). 2. Description of Perturbation Bootstrap In the perturbation bootstrap, the objective function Λ(·) has been perturbed several times by a non-negative random quantity to get a bootstrapped estimate of β. It has nothing to do with residuals in resampling stage, unlike the residual and weighted bootstrap. More precisely, the perturbation bootstrap estimator βn∗ is defined as βn∗ = arg min t n X i=1 Λ(yi − x′i t)G∗i or in terms of the score function ψ(·), as the solution of the vector equation n X i=1 xi ψ(yi − x′i β)G∗i = 0 (2.1) where G∗i , i ∈ {1, . . . , n} are non-negative and non-degenerate completely known random ∗ variables, considered  as perturbation quantities.  Note that, if µG∗ is the mean of G1 , then β̄n is the solution of E Pn i=1 xi ψ(ǭi ) G∗i |ǫ1 , . . . , ǫn = Pn i=1 xi ψ(ǭi )µG∗ = 0 where ǭi = yi − x′i β̄n , i ∈ {1, . . . , n}, are the residuals corresponding to the M-estimator β̄n . This observation will be helpful in finding a suitable stochastic approximation in bootstrap regime. For details, see Section 6. The central idea of the perturbation bootstrap is to draw a relatively large collection of ∗b ∗ IID random samples {(G∗b 1 , . . . , Gn ) : b = 1, . . . , B} from the distribution of G1 and then to √ find the conditional empirical distribution of n(βn∗ − β̄n ) given data yi : i = 1, . . . , n, by solving n X i=1 xi ψ(yi − x′i β)G∗b i = 0 for each b ∈ {1, . . . , B}; to approximate the distribution of √ n(β̄n − β) asymptotically. As a result the bootstrapped distribution may be used as an approximation to the original distribution, just like the normal approximation, in constructing confidence intervals and testing of hypotheses regarding β. 6 Das D. and Lahiri S. N. Now, in the perturbation bootstrap M-estimation, G∗i ’s can be thought of as weight cor- responding to the ith data point (xi , yi ). To make it easier to understand, consider the least square setup i.e. Λ(x) = x2 . In this case βn∗ takes the form βn∗ = X n xi x′i G∗i −1  X n xi yi G∗i i=1 i=1  (2.2) indicating that the perturbing quantities G∗i ’s can be thought of as weights. Remark 2.1. Consider the least square estimator β̂n . Then keeping the asymptotic prop∗ erties fixed, the perturbation bootstrap version β̂1n of β̂n can be defined alternatively as the solution of n X i=1   xi (yi − x′i β) G∗i − µG∗ + n X i=1   xi x′i (β̂n − β) 2µG∗ − G∗i = 0 ∗ which in turn implies that β̂1n is the solution of n X i=1 xi (zi∗ − x′i β) = 0 (2.3) ′ ∗ where zi∗ = x′i β̂n + ǫ̂i [µ−1 G∗ (Gi − µG∗ )], ǫ̂i = yi − xi β̂n , i ∈ {1, . . . , n}. On the other hand, the ∗ simple wild bootstrap version β̂2n of β̂n is defined as the solution of n X i=1 xi (yi∗ − x′i β) = 0 (2.4) where yi∗ = x′i β̂n + ǫ̂i ti , i ∈ {1, . . . , n} and {t1 , . . . , tn } is a set of IID random variables independent of {ǫ1 , . . . , ǫn } with Et1 = 0, Var(t1 ) = 1. Additionally, one needs E(t31 ) = 1 for establishing second order correctness of wild bootstrap approximation [cf. Liu (1988), Mammen (1993)]. Now Looking at (2.3) and (2.4) and in view of assumption (A.5)(ii), it can be said that the perturbation bootstrap coincides with the wild bootstrap in least square setup. Therefore one can view perturbation bootstrap as a generalization of the wild bootstrap in regression M-estimation. Remark 2.2. There is a basic difference between perturbation bootstrap and weighted bootstrap with respect to the construction of the bootstrapped estimator. Whereas in the perturbation bootstrap, the bootstrapped estimator is defined through the non-negative and non-degenerate random perturbations of the objective function; in weighted bootstrap, the bootstrapped estimator is defined through bootstrap samples drawn from a weighted empirical distribution. See for example the construction of the weighted bootstrapped estimator corresponding to Theorem 2.3 of Lahiri (1992) and compare it with our construction as S.O.C. of Perturbation Bootstrap 7 stated in Section 2. However, as pointed out by a referee, one can think of the perturbation bootstrap, defined in Section 2, as the weighted bootstrap version of some statistical functional if the design vectors are random. Suppose, {(x1 , y1 ) . . . , (xn , yn )} are IID with underlying probability measure Q. Then one can write  β = T (Q) = arg min EQ Λ(yi − t x′i t)  for some statistical functional T (·). Define empirical measures Qn = n−1 −1 Qn,W = n Pn i=1 Pn i=1 1(xi , yi ) and 1(xi , yi)Wi where 1(·) is the indicator function and {W1 , . . . , Wn} are weights. Then we have β̄n = T (Qn ) and βn∗ = T (Qn,W ) when Wi = G∗i , i ∈ {1, . . . , n}. The weighted bootstrap of general statistical functionals of only the IID random variables is considered in the monograph of Barbe and Bertail (2012). Second order correctness of weighted bootstrap of standardized mean of IID random variables was established by Haeusler et. al. (1992) under two choices of weights. One choice is the non-negative IID weights and the other one is the self-normalized sum of non-negative IID random variables. Their results were extended by Barbe and Bertail (2012) for general statistical functionals in IID case when the weights are self-normalized sum of non-negative IID random variables [cf. Corollary 4.1 of Barbe and Bertail (2012)]. For general M-estimation, Chatterjee (1999) showed that weighted bootstrap estimator is generally biased and established its second order correctness after properly correcting for the bias. To the best of our knowledge, there is no second order result available in the literature under studentized setup for general statistical functional. In this article, we have assumed the design vectors to be non-random, implying that our setup fits neither in the general statistical functional setup of Barbe and Bertail (2012) nor in the general M-estimation setup of Chatterjee (1999); although Theorem 5.1 continue to hold when the design is random. Throughout the article we consider weights to be non-negative IID. Our main motivation is to explore second order results in studentized setup which, unlike the standardized (i.e., the known variance) case, is applicable in practice. Further, we prove our results in the situation when errors are heteroscedastic. We establish all our second order correctness results without requiring any bias correction. 3. Assumptions Suppose, xi = (xi1 , xi2 , . . . , xip )′ . Define, Dn ≡ D = ( ni=1 xi x′i )1/2 , An = n−1 D2 , di = p(p + 1) D−1 xi , 1 ≤ i ≤ n and q = . Also define, q × 1 vector zi = (x2i1 , xi1 xi2 , . . . , xi1 xip 2 P , x2i2 , xi2 xi3 , . . . , xi2 xip , . . . , x2ip )′ . Note that for any constants ai , . . . , an ∈ R, ni=1 ai zi = 0 P which implies and is implied by Pn i=1 ai xi x′i = 0. Hence, {z1 , . . . , zn } are linearly independent 8 Das D. and Lahiri S. N. if and only if {xi x′i : 1 ≤ i ≤ n} are linearly independent. Therefore, rn = the rank of Pn zi z′i is nondecreasing in n. So, if r = max{rn : n ≥ 1} then without loss of generality Pn zi z′i as i=1 (w.l.g.), we can assume that rn = r for all n ≥ q. Consider canonical decomposition of i=1  n X  Ir 0  L( zi z′i )L′ =  0 0 i=1 where L is a q × q non-singular matrix. Partition L as L′ = [L′1 L′2 ], where L1 is of order r × q. Define r × 1 vector z̃i by z̃i = L1 zi , Note that Pn i=1 z̃i z̃′i = L1 ( Pn i=1 1≤i≤n zi z′i )L′1 = Ir . Suppose, vi = (x′i ψ(ǫ1 ), z′i ψ ′ (ǫ1 ))′ . z̆i = (z′i , n−1 )′ . Let, ΦV denotes the normal distribution with mean 0 and dispersion matrix V and φV is the density of ΦV . Write ΦV = Φ and φV = φ when V is the identity matrix. h′ , h′′ denote respectively first and second derivatives of real valued function h that is twice differentiable. Also ||.|| denotes euclidean norm.For any set B ∈ R p and ǫ > 0, δB denotes the boundary of B, |B| denotes the cardinality of B and B ǫ = {x : x ∈ R p and d(x, B) < ǫ} where d(x, B) = inf{||x − y|| : y ∈ B}. For a function f : R l → R and a non-negative integral α vector α = (α1 , α2 , . . . , αl )′ , D α f = D1α1 . . . Dlαl f , where Dj j f denotes αj times partial derivative of f with respect to the jth component of its argument, 1 ≤ j ≤ l. Also assume that (e1 , . . . , ep )′ is the standard basis of R p . Let, P∗ and E∗ respectively denote conditional bootstrap probability and conditional expectation of G∗1 given data. The class of sets B denotes the collection of borel subsets of R p satisfying sup Φ((δB)ǫ ) = O(ǫ) as ǫ ↓ 0 (3.1) B∈B Next we state the assumptions: (A.1) ψ(·) is twice differentiable and ψ ′′ (·) satisfies a Lipschitz condition of order α for some (A.2) 0 < 2α ≤ 1. (i) An → A1 as n → ∞ for some positive definite matrix A1 . (ii) E(n−1 Pn vi vi′ ) → A2 as n → ∞ for some non-singular matrix A2 , where Pn ṽi ṽi′ ) → A3 as n → ∞ for some non-singular matrix A3 where ṽi is i=1 expectation is with respect to F . (ii)′ E(n−1 i=1 defined as same way as vi with zi being replaced by z̆i . (iii) nα/2 ( Pn i=1 ||di ||6+2α )1/2 + Pn i=1 ||z̃i ||4 = O(n−1) S.O.C. of Perturbation Bootstrap 9 (i) Eψ(ǫ1 ) = 0 and σ 2 = Eψ 2 (ǫ1 )/E(ψ ′ (ǫ1 )) ∈ (0, ∞). (A.3) (ii) E|ψ(ǫ1 )|4 + E|ψ ′(ǫ1 )|4 + E|ψ ′′ (ǫ1 )|2 < ∞. (A.4) G∗i and ǫi are independent for all 1 ≤ i ≤ n. (i) EG∗3 1 < ∞ (A.5) (ii) Var(G∗1 ) = µ2G∗ , E(G∗1 − µG∗ )3 = µ3G∗ .   (iii) G∗1 − µG∗ satisfies Cramer’s condition: (iii)′      lim sup|t|→∞ E exp it G∗1 − µG∗   G∗1 − µG∗ , G∗1 − µG∗  2   < 1. satisfies Cramer’s condition:     lim sup||(t1 ,t2 )||→∞ E exp it1 G∗1 − µG∗ + it2 G∗1 − µG∗  (i) ψ(ǫ1 ), ψ ′ (ǫ1 ) satisfies Cramer’s condition: (A.6)     lim sup||(t1 ,t2 )||→∞ E exp it1 ψ(ǫ1 ) + it2 ψ ′ (ǫ1 )    2  <1 <1 (i)′ ψ(ǫ1 ), ψ ′ (ǫ1 ), ψ 2 (ǫ1 ) satisfies Cramer’s condition: lim sup||(t1 ,t2 ,t3 )||→∞ E exp it1 ψ(ǫ1 ) + it2 ψ ′ (ǫ1 ) + it3 ψ 2 (ǫ1 )  <1 Define v̄i = (x̄′i , z̄′i )′ where x̄i = xi ψ(ǭi ), z̄i = zi ψ ′ (ǭi ); {ǭ1 , . . . , ǭn } being the set of residuals. Also, define Ā2n = n−1 Pn i=1 x̄i x̄′i and Ā1n = n−1 −1 Pn an estimate of the matrix E(n i=1 Pn i=1 vi vi′ ) and due to assumption (A.2)(ii), Pn ′ i=1 v̄i v̄i is ′ i=1 v̄i v̄i is non- xi x′i ψ ′ (ǭi ). Note that n−1 Pn singular for sufficiently large n. Hence, without loss of generality the canonical decomposition of Pn i=1 v̄i v̄i′ can be assumed as B X n v̄i v̄i′ i=1  B′ = Ik where k = p + q and B is a k × k non-singular matrix. Define k × 1 vector v̆i by v̆i = Bv̄i , 1≤i≤n To find valid EE in the perturbation bootstrap regime, the following condition [cf. Navidi (1989)] is also required: (A.7) There exists a δ > 0 such that −Kn (δ)/logγn → ∞ where Bn (δ) = {1 ≤ i ≤ n : (v̆i′ t)2 > δγn2 for all t ∈ R k with ||t||2 = 1}, Kn (δ) = |Bn (δ)|, the cardinality of the set Bn (δ), and γn = ( Pn i=1 ||v̆i ||4 )1/2 . But note that the condition (A.7) has already been satisfied in our set up due to Lemma 6.2 and the proposition in Lahiri (1992). 10 Das D. and Lahiri S. N. Now we briefly explain the assumptions. Assumption (A.1) is smoothness condition on the score function ψ(·). This condition is essential for obtaining a Taylor’s expansion of ψ(·) around regression errors. Assumption (A.2) presents the regularity conditions on the design vectors necessary to find EE. For the validity of asymptotic normality of the regression Mestimator, only (A.2)(i) is enough [cf. Huber (1981)]; whereas additional condition (A.2)(ii) is required for the validity of the EE. (A.2)(iii) states atmost how fast the L2 norm of the design vectors can increase to get a valid EE. This condition is somewhat stronger than the condition (C.6) assumed in Lahiri (1992); although there was a reduction in accuracy of bootstrap approximation due to this relaxation. This type of conditions are quite common in the literature of edgeworth expansions in regression setup; see for example Navidi (1989), Qumsiyeh (1990a). We now state an example where assumption (A.2) (iii) is fulfilled. Example 3.1. Suppose, {X(1) , . . . , X(p) } is a set of independent random vectors where X(j) = (X1j , . . . , Xnj )′ is a vector of n IID copies of the non-degenerate random variable 2 2 X1j , j ∈ {1, . . . , p}. Define, p × p matrix M = ((mjk ))j,k=1,...,p where mjk = E(X1j X1k ) and   3 ) = 0 and E|X1j |8 < ∞ for all n × p matrix X = X(1) , . . . , X(p) . Assume, E(X1j ) = E(X1j j ∈ {1, . . . , p} and det(M) 6= 0. Then for the design matrix X, assumption (A.2) (iii) holds with probability 1 (w.p. 1). proof : 2 2 For the design matrix X, xi = (Xi1 , Xi2 , . . . , Xip )′ and zi = (Xi1 , Xi1 Xi2 , . . . , Xi1 Xip , Xi2 2 ′ ) for i ∈ {1, . . . , n}. , Xi2 Xi3 , . . . , Xi2 Xip , . . . , Xip First note that if all the entries of X are IID then the condition det(M) 6= 0 is redundant.  2 2 By Kolmogorov strong law of large numbers, An = n−1 D2 → diag E(X11 ), . . . , E(X1p ) and n−1 Pn i=1 ||xi ||6+2α → E||x1 ||6+2α both w.p.1 and hence nα/2 X n i=1 ||di ||6+2α 1/2 ≤ nα/2 ||D−1 ||3+α = O(n−1 ) w.p.1 Again, since M is a non-singular matrix, n−1 Pn i=1 X n i=1 ||xi ||6+2α  1/2 (3.2) zi z′i → N w.p.1, for some positive definite matrix N. This implies that ||L|| = O(n−1/2 ) w.p.1 and hence n X i=1 ||z̃i ||4 ≤ ||L||4 n X i=1 −1 ||zi ||4 = O(n ) w.p.1 Therefore, our claim follows from (3.2) and (3.3). (3.3) S.O.C. of Perturbation Bootstrap 11 Assumption (A.3) is the moment condition on the error variables through the score function ψ(·). (A.3)(i) is generally assumed to establish asymptotic normality. Assumption (A.4) is inherent in the present setup, since G∗i ’s are introduced by us to define the bootstrapped estimator whereas ǫi ’s are already present in the process of data generation. The conditions present in Assumption (A.5) are moment and smoothness conditions on the perturbing quantities G∗i ’s, required for the valid two term EE in bootstrap setup. The Cramer’s condition is very common in the literature of edgeworth expansions. Cramer’s condition is satisfied when the distribution of (G∗1 − µG∗ ) or ((G∗1 − µ∗G ), (G∗1 − EG∗1 )2 ) has a non-degenerate compo- nent which is absolutely continuous with respect to Lebesgue measure [cf. Hall (1992)]. An immediate choice of the distribution of G∗1 is Beta(γ, δ) where 3γ = δ = 3/2. Also one can investigate Generalized Beta family of distributions for more choices of the distribution of G∗1 . Assumption (A.6) is the Cramer’s condition on the errors. Although this assumption is not needed for obtaining EE of the bootstrapped estimators, it is needed for obtaining EE for the original M-estimator. Note that the condition (A.7) is somewhat abstract. Hence as pointed out by a referee, some clarification would be helpful. To this end, it is worth mentioning that to find formal EE for the standardized bootstrapped pivot (see section 4.1), the most difficult step is to show Z max ′ |α|≤p+q+4 C1 ≤γn ||t||≤C2 where C1 , C2 are non-negative constants and T∗n =    ∗ |D α E∗ eit Tn |dt = op n−1/2 Pn i=1   (3.4)  X̆∗i − E∗ (X̆∗i ) , with X̆∗i = v̆i (Gi − ′ ∗ µG∗ )1 ||v̆i (Gi − µG∗ )|| ≤ 1 . Now it is easy to see that for any |α| ≤ p + q + 4, |D α E∗ eit Tn | is bounded above by a sum of n|α| -terms, each of which is bounded above by C(α) · max{E∗||X̆∗i − E∗ (X̆∗i )|||α| : i ∈ I∗n } · Y i∈I∗c n ′ ∗ |E∗ eit X̆i | ∗ where I∗n ⊂ {1, . . . , n} is of size |α| and I∗c n = {1, . . . , n}\In and C(α) is a constant which depends only on α. Now note that for all i ∈ {1, . . . , n}, E∗ ||X̆∗i − E∗ (X̆∗i )|||α| ≤ 2|α| and ′ ∗ ′  |E∗ eit X̆i | ≤ |E∗ eit v̆i (Gi −µG∗ ) | + 2P∗ ||v̆i (Gi − µG∗ )|| > 1  Hence, in view of Cramer’s condition (A.5) (iii) and Lemma 6.2, if there exists a sequence of sets {Jn }n≥1 such that Jn ⊂ {1, . . . , n} and for all i ∈ Jn , γn−1 |t′v̆i | > ξ for some ξ > 0, 12 Das D. and Lahiri S. N. then for some 0 < θ < 1 we have sup  Y i∈I∗c n ≤ sup ≤θ  it′ X̆∗i |E∗e Y i∈I∗c n ∩Jn | : C1 ≤ γn ||t|| ≤ C2 −1 ′ ∗ t X̆i |E∗ eiγn  | : C1 ≤ ||t|| ≤ C2  |I∗c n ∩Jn | (3.5) −1 Again |I∗c n ∩ Jn | ≥ |Jn | − |α| and γn ≥ kn . Therefore, to achieve (3.4), it is enough to have n2(p+q)+4 · θ|Jn |−(p+q+4) = o(n−1/2 ) Hence due to Lemma 6.2, it is enough to have |Jn | ≥ an −C ·log γn for some positive constant C and a sequence of constants {an } increasing to ∞. This observation together with (3.5) justifies condition (A.7). We will denote the assumptions (A.1)-(A.5) by (A.1)′ -(A.5)′ when (A.2) and (A.5) are respectively defined with (ii)′ and (iii)′ instead of (ii) and (iii). 4. Main Results 4.1. Rate of Perturbation Bootstrap Approximation Here we will state the approximation results both in standardized and studentized setup. It √ is well known that nβ̄n has asymptotic variance σ 2 A−1 n . So, the standardized version of √ −1 1/2 the M-estimator β̄n is defined as Fn = nσ An (β̄n − β). Now to define the standardized version of the corresponding bootstrapped statistic βn∗ , we need its conditional asymptotic variance, given the data. Using Taylor’s expansion, it is quite easy to get the conditional √ −1 −1 asymptotic variance of nβn∗ as Ā−1 1n Ā2n Ā1n . Note that inverse of the matrices Ā1n and Ā−1 2n are well defined for sufficiently large sample size n due to the assumption (A.2)(i) and (A.3)(ii). Hence, the standardized bootstrapped M-estimator F∗n can be defined as F∗n = −1/2 √ nΣ̄−1/2 (βn∗ − β̄n ) n 1/2 where Σ̄−1/2 = Ā2n Ā1n, Ā2n being defined in terms of the spectral decomposition of Ā2n ; n although it can be defined in many different ways [cf. Lahiri (1994)]. Under some regularity conditions, both the distribution of Fn and the conditional distribution of F∗n can be shown to be approximated asymptotically by a Normal distribution with mean 0 and variance Ip . Hence, it is straightforward that perturbation bootstrap approximation to the distribution S.O.C. of Perturbation Bootstrap 13 of the M-estimator is first order correct. The second order result in standardized case is formally stated in Theorem 4.1. Proposition 4.1. Suppose, the assumptions (A.1)-(A4), (A.5)(i) hold. Then there exist constant C1 > 0 and a sequence of Borel sets Q1n ⊆ R n , such that P((ǫ1 , . . . , ǫn ) ∈ Q1n ) → 1 as n → ∞, and given (ǫ1 , . . . , ǫn ) ∈ Q1n , n ≥ C1 such that there exists a sequence of statistics {βn∗ }n≥1 such that   P∗ βn∗ solves (2.1) and ||βn∗ − β̄n || ≤ C1 .n−1/2 .(logn)1/2 ≥ 1 − δn n−1/2 where δn ≡ δn (ǫ1 , . . . , ǫn ) tends to 0. Theorem 4.1. Let {βn∗ }n≥1 be a sequence of statistics satisfying Proposition 4.1 depending on (ǫ1 , . . . , ǫn ). Assume, the assumptions (A.1)-(A.5) hold. (a) Then there exist constant C2 > 0 and a sequence of Borel sets Q2n ⊆ R n and polynomial a∗n (·, ψ, G∗ ) depending on first three moments of G∗1 and on ψ(·), ψ ′ (·) & ψ ′′ (·) through the residuals {ǭ1 , . . . , ǭn } such that given (ǫ1 , . . . , ǫn ) ∈ Q2n , with P((ǫ1 , . . . , ǫn ) ∈ Q2n ) → 1, we have for n ≥ C2 , sup B∈B |P∗(F∗n ∈ B) − Z B ξn∗ (x)dx| ≤ δn n−1/2 where ξn∗ (x) = (1 + n−1/2 a∗n (x, ψ, G∗ ))φ(x) and δn ≡ δn (ǫ1 , . . . , ǫn ) tends to 0. (b) Suppose in addition assumption (A.6)(i) holds. Then we have, sup P∗ (F∗n ∈ B) − P(Fn ∈ B) = op (n−1/2 ) B∈B Now, the quantity σ 2 is mostly unavailable in practical circumstances. Hence, the nonpivotal quantity like Fn is very rare in use in providing valid inferences. It is more reasonable to explore the asymptotic properties of a pivotal quantity, like the studentized version of the M-estimator β̄n . Depending on the observed residuals ǭi = yi − xi ′ β̄n , i ∈ {1, . . . , n}, the natural way to define an estimator of σ 2 is σ̂n2 where σ̂n = sn τn−1 , τn = n−1 and s2n = n−1 Pn i=1 defined as Hn = √ Pn i=1 ψ ′ (ǭi ) ψ 2 (ǭi ). Hence, the studentized M-estimator in regression setup may be nσ̂n−1 A1/2 n (β̄n − β). Define the studentized version of the corresponding bootstrapped estimator as H∗n = where σn∗ = s∗n τn∗−1 , τn∗ = n−1 defined earlier. Pn i=1 √ nσn∗−1 σ̂n Σ̄−1/2 (βn∗ − β̄n ) n −1 ψ ′ (ǫ∗i ), s∗2 n = n Pn i=1 ψ 2 (ǫ∗i ) and σ̂n2 and Σ̄−1/2 are as n 14 Das D. and Lahiri S. N. Theorem 4.2. Suppose, the assumptions (A.1)-(A.5) hold. (a) Then there exist constant C3 > 0 and a sequence of Borel sets Q3n ⊆ R n and polynomial ã∗n (·, ψ, G∗ ) depending on first three moments of G∗1 and on ψ(·), ψ ′ (·) & ψ ′′ (·) through the residuals {ǭ1 , . . . , ǭn }, such that given (ǫ1 , . . . , ǫn ) ∈ Q3n , with P((ǫ1 , . . . , ǫn ) ∈ Q3n ) → 1, we have for n ≥ C3 , sup B∈B |P∗ (H∗n ∈ B) − Z B ξ˜n∗ (x)dx| ≤ δn n−1/2 where ξ˜n∗ (x) = (1 + n−1/2 ã∗n (x, ψ, G∗ ))φ(x) and δn ≡ δn (ǫ1 , . . . , ǫn ) tends to 0. Suppose in addition assumption (A.6)(i)′ holds. Then (b) for the collection of Borel sets B defined by (3.1), sup P∗ (H∗n ∈ B) − P(Hn ∈ B) = Op (n−1/2 ) B∈B (c) if 2Eψ 2 (ǫ1 )Eψ(ǫ1 )ψ ′ (ǫ1 ) 6= Eψ ′ (ǫ1 )Eψ 3 (ǫ1 ), then there exists ǫ > 0 such that,   √  ∗ P lim inf n sup P∗ (Hn ∈ B) − P(Hn ∈ B) > ǫ = 1 n→∞  B∈B Remark 4.1. Proposition 4.1 states that there exists a sequence of perturbation bootstrapped estimator βn∗ within a neighborhood of length C.n−1/2 (logn)1/2 around the original M-estimator β̄n outside a set of bootstrap probability op (n−1/2 ). This existence result is essential in finding valid EEs in bootstrap regime. This can be compared with Theorem 2.3 (a) of Lahiri (1992), where similar kind of result was shown in case of residual and generalized bootstrap. Remark 4.2. Note that, where as the error term in approximating the distribution of Mestimator by perturbation bootstrap is of order Op (n−1/2 ) in the prevalent studentize setup, it reduces the order of the error of approximation to op (n−1/2 ) in simple standardized setup. This means that the difference between coefficients corresponding to the term n−1/2 in the EEs of original and bootstrapped estimator can be made arbitrarily small in standardized setup, but not in usual studentized setup. Remark 4.3. To understand part (c) of Theorem 4.2, consider the usual least square estimator. In least square setup, the condition in the Theorem 4.2 (c) reduces to Eǫ3 6= 0. This simply means that if the studentization in perturbation bootstrapped version is performed analogously as in case of original least square estimator, then the bootstrap distribution can S.O.C. of Perturbation Bootstrap 15 not correct the original distribution upto second order. If this is investigated more deeply, then it can be observed that the usual studentized perturbation bootstrap approximation can not correct for the skewness of the error distribution F . 4.1.1. Examples Theorem 4.2 concludes that the standard way of performing studentization of the bootstrapped estimator is first order correct. In order to show that the usual studentized setup is not second order correct, we consider following two important special cases with ψ(x) = x. Example 4.1 Consider the observations {y1, . . . , yn } are coming from the distribution F with a location shift µ. This in terms of regression model becomes yi = µ + ǫi Hence, in this setup p = 1, β = µ and xi = 1 for all i ∈ {1, . . . , n}. It can be shown that in this setup, ξ˜n (·) and ξ˜n∗ (·), the EE of Hn and H∗n respectively, turn out to be n d d3 o ξ˜n (x) = 1 − n−1/2 b̃11 + 6−1 b̃31 3 φ(x) dx dx   n d3 o d + 6−1 b̃∗31 3 φ(x) ξ˜n∗ (x) = 1 − n−1/2 b̃∗11 dx dx  where  b̃11 = −2−1 σ −3 Eǫ31 , b̃31 = −2σ −3 Eǫ31 b̃∗11 = −2σn−1 n−1 Pn i=1 ǭi , b̃∗31 = σn−3 − 12σn−1 n−1 Pn i=1 ǭi It is clear that b̃∗11 as well as b̃∗31 are not converging respectively to b̃11 and b̃31 in probability and hence the perturbation bootstrap method is not second order correct in the above setup when the bootstrapped estimator is studentized in the usual manner. Example 4.2 Consider the simple linear regression model yi = β0 + β1 xi + ǫi 16 Das D. and Lahiri S. N. where β0 and β1 are parameters of interest and ǫi ’s are IID errors. This model, in terms of our multivariate linear regression structure, can be written as yi = x̃′i β + ǫi where β = (β0 , β1 )′ and x̃i = (1, xi )′ . Hence, the EEs of the original and bootstrapped estimators upto the order o(n−1/2 ), after usual studentization, respectively becomes  X 2 (j,3−j)  X 2 ∗(j,3−j) ξ˜n (y1 , y2 ) = 1 − n−1/2 ξ˜n∗ (y1 , y2 ) = 1 − n−1/2 where  (j) b̃11 = −2−1 n−1  3 X b̃31 ∗(j) ∂ b̃11 + D (j,3−j) φ(y1 , y2) ∂y j!(3 − j)! j j=1 j=0   3 X b̃31 ∗(j) ∂ b̃11 + D (j,3−j) φ(y1 , y2) ∂y j!(3 − j)! j j=1 j=0   Pn ′ −1/2 x̃i γ1 i=1 ej An ∗(j) b̃11 = op (1)  where e1 , . . . , ep −1 Pn of ǫ1 , An = n ′ i=1 is the standard basis of R p , j = 1 or 2, γ1 is the coefficient of skewness x̃i x̃′i =  1   x̄  P P where x̄ = n−1 ni=1 xi and x¯2 = n−1 ni=1 x2i . Ā2n is as x¯2 x̄ defined in general setup with x̃i in place of xi for i ∈ {1, . . . , n}. The form of the coefficients (j ,j2 ) b̃311 ∗(j ,j2 ) and b̃31 1 are given in the supplementary material Das and Lahiri (2017) for all (j1 , j2 ) ∈ {(a, b) : a, b ∈ {0, 1, 2, 3} and a + b = 3}. (j) Note that, the coefficients b̃11 , 1 ≤ j ≤ p, all can not vanish together unless γ1 = 0 and ∗(j) hence b̃11 (j) can not converge to b̃11 unless γ1 = 0. Similarly, it can be shown that same (j,3−j) condition is required to have the closeness of the coefficients b̃31 ∗(j,3−j) and b̃31 . Hence, the two EEs can not get closer unless γ1 = 0, similar to the Example 4.1. This is exactly what is stated in the part (c) of Theorem 4.2 in most general form. 4.2. Modification to the bootstrapped pivot As it has been seen that H∗n , the usual studentized version of the perturbation bootstrapped estimator is not attending the desired optimal rate op (n−1/2 ), so in the perspective of statistical inference, perturbation bootstrap is not advantageous over asymptotic normal approximation. For the sake of obtaining second order correctness, define the modified studentized βn∗ as H̃∗n = √ n(σ̃n∗ )−1 σ̂n Σ̄−1/2 (βn∗ − β̄n ) n (4.1) S.O.C. of Perturbation Bootstrap 17 where σ̃n∗ = s̃∗n τ̃n∗−1 , τ̃n∗ = n−1 Pn i=1 −1 ψ ′ (ǫ∗i )G∗i , s̃∗2 n = n Pn i=1 ψ 2 (ǫ∗i )(G∗i − µG∗ )2 . The bootstrapped statistic H̃∗n can be seen to be achieving the optimal rate, namely op (n−1/2 ), in approximating the original studentized M-estimator Hn , which is formally stated in the following theorem: Theorem 4.3. Suppose, the assumptions (A.1)′ -(A.5)′ hold. Also assume EG∗4 1 < ∞. (a) Then there exist constant C4 > 0 and a sequence of Borel sets Q4n ⊆ R n and polynomial ā∗n (·, ψ, G∗ ) depending on first three moments of G∗1 and on ψ(·), ψ ′ (·) & ψ ′′ (·) through the residuals {ǭ1 , . . . , ǭn }, such that given (ǫ1 , . . . , ǫn ) ∈ Q4n , with P((ǫ1 , . . . , ǫn ) ∈ Q4n ) → 1, we have for n ≥ C4 , sup |P∗ (H̃∗n ∈ B) − B∈B Z B ξ¯n∗ (x)dx| ≤ δn n−1/2 where ξ¯n∗ (x) = (1 + n−1/2 ā∗n (x, ψ, G∗ ))φ(x) and δn ≡ δn (ǫ1 , . . . , ǫn ) tends to 0. (b) Suppose, in addition (A.6)(i)′ holds. Then, for the collection of Borel sets defined by (3.1), sup P∗ (H̃∗n ∈ B) − P(Hn ∈ B) = op (n−1/2 ) B∈B Remark 4.4. The modification that is needed to make the perturbation bootstrap method correct upto second order, suggests that besides incorporating the effect of bootstrap randomization through ψ(·) and ψ ′ (·) in the studentization factor of the bootstrap estimator, it is also essential to blend properly the effect of randomization that is coming directly from the perturbing quantities G∗i s. Remark 4.5. As pointed out by a referee, the usefulness of the above results depend   critically on the rate of the probability P (ǫ1 , . . . , ǫn ∈ Qin ) , i = 1, 2, 3, 4. Following the    steps of the proofs, it can be shown that P (ǫ1 , . . . , ǫn ∈ Qn ) = 1 − O n−1/2 (log n)−2+γ2  where Qn = ∩4i=1 Qin , for some γ2 ∈ (0, 2), although the rate can be improved under moment condition stronger than (A.3) (ii). In general, if E|ψ(ǫ1 )|2γ3 + E|ψ ′ (ǫ1 )|2γ3 + E|ψ ′′ (ǫ1 )|γ3 < ∞  for some natural number γ3 ≥ 2, then analogously it can be shown that P (ǫ1 , . . . , ǫn ∈    Qn ) = 1 − O n−(2γ3 −3)/2 (log n)−γ3 +γ2 for some γ2 ∈ (0, γ3). This implies that second order correctness of perturbation bootstrap can be established in almost sure sense under higher moment condition. 18 Das D. and Lahiri S. N. Remark 4.6. The condition (3.1) on the collection of Borel subsets B of R p , that is considered in the above theorems, is somewhat abstract. This condition is needed for achieving two goals. One is to obtain valid EE for the normalized part of the underlying pivot [cf. Corollary 20.4 of Bhattacharya and Rao (1986)] and the other one is to bound the remainder term with an order o(n−1/2 ) with probability (or bootstrap probability) 1 − o(n−1/2 ). These two together allow us to get EE for the underlying pivots. A natural choice for B is the collection of all Borel measurable convex subsets of R p . 5. Extension to independent and non-identically distributed errors In this section, we will extend second order results of perturbation bootstrap to the model (1.1) with independent and non-identically distributed [hereafter referred to as non-IID] errors. Clearly the case of non-IID errors includes the situation when the regression errors are heteroscedastic. In many practical situations, the measurements obtained have different variability due to a number of reasons and hence it is crucial for an inference procedure to be robust towards the presence of heteroscedasticity. We will show that perturbation bootstrap can approximate the exact distribution of the regression M-estimator β̄n upto second order even when the errors are non-IID. Before stating second order result in non-IID case, we describe briefly the literature available on bootstrap methods in heteroscedastic regression. Although there is huge literature available on bootstrap in homoscedastic regression, literature on bootstrap in heteroscedastic regression models is limited. Wu (1986) mentioned the limitation of residual bootstrap in heteroscedasticity and introduced wild bootstrap in least square regression. Beran (1986) gave justification behind consistency of wild bootstrap. Liu (1988) established second order correctness of wild bootstrap in heteroscedastic least square regression when dimension p = 1. Liu (1988) proposed a modification of residual bootstrap in resampling stage and gave justification behind second order correctness. You and Chen (2006) proved consistency of wild bootstrap in approximating the distribution of least square estimator in semiparametric heteroscedastic regression model. Davidson and Flachaire (2008) and Davidson and Mackkinnon (2010) developed wild bootstrap procedure for testing the coefficients in heteroscedastic linear regression. Arlot (2009) developed a resampling-based penalization procedure for model selection based on exchangeable weighted bootstrap. We state some additional assumptions needed to establish second order correctness. Define, A1n = n−1 Pn i=1 xi x′i Eψ ′ (ǫi ) and A2n = n−1 Pn i=1 xi x′i Eψ 2 (ǫi ). S.O.C. of Perturbation Bootstrap (A.2)(iii)′′ n−2 (A.3)(i) ′′ ′′ (A.6)(i) 12 i=1 ||xi || + Pn i=1  Pn i=1 h i ||z̃i ||4 max{1, E|ψ ′(ǫi )|4 } = O(n−1 ). ψ(ǫn ), ψ ′ (ǫn ), ψ 2 (ǫn ) lim sup n→∞ i E|ψ(ǫi )|6+υ + E|ψ ′ (ǫi )|6+υ + E|ψ ′′(ǫi )|4+υ = O(1) for some υ > 0. any positive b, (A.8) h Eψ(ǫi ) = 0 for all i ∈ {1, . . . , n}. (A.3)(ii) n−1 ′′ Pn 19 ∞ n=1  satisfies Cramer’s condition in a uniform sense i.e. for  E exp it1 ψ(ǫn ) + it2 ψ ′ (ǫn ) + it3 ψ 2 (ǫn ) sup ||(t1 ,t2 ,t3 )||>b  < 1. A1n and A2n both converge to non-singular matrices as n → ∞. We will denote the assumptions (A.1)-(A.4) by (A.1)′′ -(A.4)′′ when (A.2) is defined with (iii)′′ instead of (iii) and (A.3) is defined with (i)′′ , (ii)′′ in place of (i) and (ii) respectively. 5.1. Rate of Perturbation Bootstrap Approximation Note that when the regression errors are non-identically distributed, √ nβ̄n has asymptotic −1 variance A−1 1n A2n A1n . Hence, the natural way of defining studentized pivot corresponding to β̄n is H̆n = −1/2 √ nΣ̄−1/2 (β̄n − β) n where Σ̄−1/2 = Ā2n Ā1n with Ā1n = n−1 n Pn xi x′i ψ ′ (ǭi ), Ā2n = n−1 i=1 Pn i=1 xi x′i ψ 2 (ǭi ) and ǭi = yi − x′i β̄n , i ∈ {1, . . . , n}. Define the corresponding bootstrap pivot as √ (βn∗ − β̄n ) H̆∗n = nΣ∗−1/2 n ∗−1/2 where Σ∗−1/2 = A2n n −1 Pn n i=1 A∗1n with ǫ∗i = yi − x′i βn∗ , A∗1n = n−1 xi x′i ψ 2 (ǫ∗i )(Gi − µG∗ )2 , i ∈ {1, . . . , n}. Theorem 5.1. Pn i=1 xi x′i ψ ′ (ǫ∗i )G∗i and A∗2n = Suppose, the assumptions (A.1)′′ -(A.4)′′ and (A.5)(i) hold. (a) Then there exist constant C5 > 0 and a sequence of Borel sets Q5n ⊆ R n , such that P((ǫ1 , . . . , ǫn ) ∈ Q5n ) → 1 as n → ∞, and given (ǫ1 , . . . , ǫn ) ∈ Q5n , n ≥ C5 such that there exists a sequence of statistics {βn∗ }n≥1 such that    P∗ βn∗ solves (2.1) and ||βn∗ − β̄n || ≤ C5 .n−1/2 .(logn)1/2 ≥ 1 − o n−1/2  (b) Suppose in addition (A.5)(ii),(iii)′ and (A.8) hold. Then there exist polynomial ă∗n (·, ψ, G∗ ) depending on first three moments of G∗1 and on ψ(·), ψ ′ (·) & ψ ′′ (·) through the residuals {ǭ1 , . . . , ǭn }, such that given (ǫ1 , ....., ǫn ) ∈ Q5n , we have for n ≥ C5 , sup |P∗ (H̆∗n ∈ B) − B∈B Z B ξ˘n∗ (x)dx| ≤ δn n−1/2 20 Das D. and Lahiri S. N. where ξ˘n∗ (x) = (1 + n−1/2 ă∗n (x, ψ, G∗ ))φ(x) and δn ≡ δn (ǫ1 , . . . , ǫn ) tends to 0. (c) Suppose, in addition to the assumptions (A.1)′′ -(A.4)′′ , (A.5)(i),(ii),(iii)′ and (A.8), (A.6)(i)′′ holds. Then, for the collection of Borel sets defined by (3.1), sup P∗ (H̆∗n ∈ B) − P(H̆n ∈ B) = op (n−1/2 ) B∈B Remark 5.1. The form of the studentized pivot H̆∗n , defined for achieving second order correctness in non-IID case is different from H̃∗n , due to the difference in asymptotic variances of β̄n in two setups. In non-IID case, one cannot ignore computation of the negative square root of a matrix at each bootstrap iteration. But Theorem 5.1 is more general than Theorem 4.3 in the sense that it also includes the case when errors are IID. Note that ∗−1 ∗ ∗ −1 Σ̄∗n = Ā∗−1 1n Ā2n Ā1n where Ā1n = n σn∗ σn∗ Pn ′ ′ ∗ ∗ −1 Pn ′ 2 ∗ i=1 xi xi ψ (ǫi ) and Ā2n = n i=1 xi xi ψ (ǫi ) P n −1 2 ∗ ∗ s∗2 n = n i=1 ψ (ǫi ). We need to modify Σ̄n P = s∗n τn∗−1 where τn∗ = n−1 ni=1 ψ ′ (ǫ∗i ), to Σ∗n and σ̃n∗ respectively to achieve second and and order correctness. Remark 5.2. There is no difference in employing perturbation bootstrap and the usual residual bootstrap with respect to the accuracy of inference. Under some mild conditions, both are second order correct. But in view Theorem 5.1, the advantage of employing perturbation bootstrap instead of residual counterpart is evident when the errors are no longer identically distributed. Perturbation bootstrap continues to be S.O.C. in non-IID case without any modification, whereas a modification in the resampling stage is required for residual bootstrap to achieve the same. To see this, consider the heteroscedastic simple linear regression model yi = βxi + ǫi (5.1) where ǫi ’s are independent, Eǫi = 0 and Eǫ2i = σi2 . The least square estimator of β is β̂ = Pn i=1 xi yi / Pn i=1 x2i and hence Var(β̂) = Pn i=1 x2i σi2 /( Pn i=1 x2i )2 . The bootstrap observa- tions in residual bootstrap are yi∗∗ = xi β̂ + e∗i where {e∗1 , . . . , e∗n } is a random sample from {(e1 − ē), . . . , (en − ē)}, ē = n−1 Pn i=1 ei and ei = yi − xi β̂, i ∈ {1, . . . , n}, are least square residuals. The residual bootstrapped least square estimator is β̂ ∗∗ = Hence, Var(β̂ ∗∗ |ǫ1 , . . . , ǫn ) = Pn i=1 (ei − ē)2 / Pn i=1 x2i where n−1 Pn i=1 [(ei Pn i=1 xi yi∗∗ / Pn i=1 x2i . − ē)2 − σi2 ] → 0 as n → ∞. Thus Var(β̂ ∗∗ |ǫ1 , . . . , ǫn ) is not a consistent estimator of Var(β̂)and hence residual bootstrap is not second order correct in approximating the distribution of β̂ when errors are heteroscedastic. For details see Liu (1988). On the other hand, if β̂ ∗ is the perturbation bootstrapped least square estimator, then it is easy to show Var(β̂ ∗ |ǫ1 , . . . , ǫn ) = S.O.C. of Perturbation Bootstrap Pn i=1 x2i σi2 /( Pn i=1 21 x2i )2 + Op (n−1 ). Additionally, a centering adjustment is required in the def- inition of residual bootstrapped version of the regression M-estimator to achieve second order correctness even when the regression errors are IID [cf. Lahiri (1992)]; whereas in the perturbation bootstrap no adjustment is needed. Remark 5.3. In view of second order correctness of bootstrap in heteroscedastic linear regression, Theorem 5.1 is the most general result available. Nonparametric or residual bootstrap fails in heteroscedasticity, as shown by Liu (1988). Liu (1988) developed a weighted bootstrap method as a modification of residual bootstrap in least square setup for the simple linear regression model (5.1). She proposed the weight to be xi / Pn i=1 x2i corresponding to ith centered residual (ei − ēn ), i ∈ {1, . . . , n}, to achieve second order correctness. There is no general theory available on weighted bootstrap for the multiple linear regression model (1.1) even in heteroscedastic least square setup, to the best our knowledge. 6. Proofs First we define some notations. Throughout this section, C, C1, C2 , . . . will denote generic constants that do not depend on the variables like n, x, and so on. For a non-negative integral vector α = (α1 , α2 , . . . , αl )′ and a function f = (f1 , f2 , . . . , fl ) : R l → R l , l ≥ 1, write |α| = α1 + . . . + αl , α! = α1 ! . . . αl !, f α = (f1α1 ) . . . (flαl ). For t = (t1 , . . . tl )′ ∈ R l and α as above, define tα = tα1 1 . . . tαl l . The collection B will always be used to denote the collection 2 of Borel subsets of R p which satisfy (3.1). µG∗ and σG ∗ will respectively denote mean and variance of G∗1 . We want to mention here that only the important steps are presented in the proofs of the proposition and the theorems. For further details see the supplementary material Das and Lahiri (2017). Although the proofs for second order results of perturbation bootstrap go through more or less same line as that for residual bootstrap in Lahiri (1992), the advantage in perturbation bootstrap is that the perturbing quantities are independent of the regression errors and hence it is much easier to obtain suitable stochastic approximation to the bootstrapped pivot and finally the EE than the same in case of residual bootstrap. On the negative side, in our proofs atleast we need Cramer’s condition separately on regression errors and on the perturbing quantities [see assumptions (A.5) and (A.6)], whereas for residual bootstrap, one can derive a restricted Cramer’s condition on resampled residuals from the Cramer’s condition on regression errors to obtain second order correctness. Moreover, second order results can be established for residual bootstrap, after a modification, without any Cramer type condition in the case p = 1 [cf. Karabulut and Lahiri (1997)]. We do not know yet if similar conclusion can be drawn in case of perturbation bootstrap. 22 Das D. and Lahiri S. N. Before coming to the proofs we state some lemmas: Lemma 6.1. Let, {Yi = (Yi1 , Yi2 )′ , 1 ≤ i ≤ n} be a collection of mean zero independent random vectors. Define, for some non random vectors l1i and l2i of dimensions p1 and p2 respectively with Pn ′ i=1 lji lji = Ipj and γ̃n = ( Ui = (l′1i Yi1 , l′2i Yi2 )′ , P2 j=1 Vn = Cov Pn i=1 ||lji || X n i=1 for 1 ≤ i ≤ n, and Sn = Pn i=1 Ũi . Let α̃n = n−1 Pn i=1 4 1/2 )  Ui , = O(n−1/2 ), Ũi = Vn−1/2 Ui E||Yi||3 I(||Yi||2 > λγ̃n−1 ), where I(·) is the indicator function and λ satisfies 0 < λ < lim inf λn , λi = the smallest eigen value of Σi , n→∞ Σi = Cov(Yi ). Suppose, {M0n }n≥1 , {Min }n≥1 , i = 1, . . . , p be (p + 1) sequence of matrices such that for each n ≥ 1, M0n is of order p × (p + r). and Min , 1 ≤ i ≤ p, are of order (p + r) × (p + r), p ≥ 1, r ≥ 1. Let, k = p + r, M̄0n = [0 : Ir ]r×k and M̃0n = [M0n ′ : M̄′0n ]′ . Define the functions gn : R k → R p by gn (x) = M0n x + (x′ M1n x, . . . , x′ Mpn x)′ , x ∈ R k , n ≥ 1. Assume that (a) there exists a constant k such that n−1 (b) α̃n = o(1). Pn i=1 E||Yi||3 < k for all n ≥ 1. (c) the characteristic function gn of Yn satisfies lim supn→∞ sup||(t)||>b |gn (t)| < 1 for all b > 0. (d) max{||Min || : 1 ≤ i ≤ p} = O(γ̃n ). (e) ||M0n || = O(1), lim inf n→∞ inf{||M̃0nu|| : ||u|| = 1, u ∈ R k } ≥ δ for some constant δ > 0. Then for the class B of Borel sets satisfying (3.1), sup P(gn (Sn ) ∈ B) − B∈B Z B ˚ ξn (x)dx = o(γ̃n ) as n → ∞ where ˚ ξn (.) = (1 + n−1/2 å(·))φD̊n (·), D̊n = M0n M′0n and å(·) is a polynomial whose coefficients are continuous functions of E(Yi )α , |α| ≤ 3 and i ∈ {1, . . . , n}. proof : The above Lemma follows from Theorem 20.6 of Bhattacharya and Rao (1986) and retracting the proofs of Lemma 3.1 and 3.2 of Lahiri (1992). Lemma 6.2. P n i=1 ||v̆i ||4 Under the assumptions (A.1)-(A.3) or (A.1)′′ -(A.3)′′ , it follows that 1/2 = Op (n−1/2 ). S.O.C. of Perturbation Bootstrap 23 proof : See supplementary material Das and Lahiri (2017). Lemma 6.3. Under the assumptions (A.2) (i) and (A.2) (iii) or (A.2) (iii)′′ , the following is true. (a) (b) P n i=1 Pn ||di ||6 i=1 ||xi || j 1/4 + P n i=1 ||di ||4 1/2 = O(n−1/2 ). = O(n) for j = 3, 4, 5, 6, 6 + 2α when the errors are IID and for j = 6 + 2α, 3, . . . , 12 when the errors are non-IID. proof : This lemma follows from assumption (A.2) and by applying Hölders inequality. We present only outline of the proofs of the main results from Section 4 and 5 to save space. For details, see the supplementary material Das and Lahiri (2017). 6.1. Outline of the proof of Proposition 4.1 Suppose, n X i=1 xi ψ(yi − x′i t∗n )G∗i = 0 Then by Taylor’s expansion we have, n X xi ψ(ǭi )G∗i + n X i=1 i=1 xi x′i (β̄n − t∗n )ψ ′ (ǭi )G∗i + n X i=1 xi [xi ′ (β̄n − t∗n )]2 ′′ ψ (ui )G∗i = 0 2 (6.1) where for each i ∈ {1, . . . , n}, |ui − ǭi | ≤ |ǫ∗i − ǭi |. Now (6.1) can be written as L∗n (t∗n − β̄n ) = ∆∗n + Rn∗ (6.2) where ∆∗n = n−1 Pn ∗ i=1 xi ψ(ǭi )(Gi − µG∗ ) P L∗n = n−1 ni=1 xi x′i ψ ′ (ǭi )G∗i P E∗ L∗n = n−1 ni=1 xi x′i ψ ′ (ǭi )µG∗ [x′ (β̄n − t∗n )]2 ′′ P Rn∗ = n−1 ni=1 xi i ψ (ui )G∗i 2 By Fuk and Nagaev inequality (1971) [hereafter referred to as FN(71)], lemma 6.3, the Lipschitz property of ψ ′′ (·) and the Taylor’s expansion of ψ(·) and ψ ′ (·), it follows that 24 Das D. and Lahiri S. N. there exist a constant C > 0 and a sequence of Borel sets Qn ⊆ R n , such that given (ǫ1 , ....., ǫn ) ∈ Qn with P((ǫ1 , ......, ǫn ) ∈ Qn ) → 1 , for n ≥ C and any 0 < ǫ < 1, P∗  X n i=1 P∗  X n xij xik ψ ′ ||xi || (ǭi )(G∗i i=1  3+α − P∗ ||∆∗n || (G∗i EG∗i ) − EG∗i )  > nǫ = o(n−1/2 )  > nǫ = o(n−1/2 ), −1/2 > C.n (logn) 1/2  j, k ∈ {1, . . . , p} = o(n−1/2 ) (6.3) (6.4) (6.5) Hence, from (6.3)-(6.5), on the set Qn and given (ǫ1 , ....., ǫn ) ∈ Qn with P((ǫ1 , ......, ǫn ) ∈ Qn ) → 1, for n ≥ C1 , (6.2) can be rewritten as (t∗n − β̄n ) = fn (t∗n − β̄n ), where fn is a continuous function from R p to R p satisfying P∗ (||fn (tn∗ − β̄n )|| ≤ C1 .n−1/2 (logn)1/2 ) = 1 −o(n−1/2 ) as n → ∞ whenever ||t∗n − β̄n || ≤ C1 .n−1/2 (logn)1/2 for some constants C1 > 0. Hence, Proposition 4.1 follows by Brouwer’s fixed point theorem. 6.2. Outline of the proof of Theorem 4.1 Consider, the sequence of statistics {βn∗ }n≥1 which satisfies the proposition. Then (6.2) can be written as √ where χ̃∗n = n−1 Pn i=1 xi √ ∗ n(βn∗ − β̄n ) = L∗−1 n[∆∗n + χ̃∗n + R1n ] n √ ∗ = L∗−1 n∆∗n + R2n n (6.6) (6.7) [xi ′ (βn∗ − β̄n )]2 ′′ ψ (ǭi )G∗i 2 Now, by FN(71), for some constant C > 0, ∗ P∗ (||R1n || > C.n−(2+α)/2 (logn)(2+α)/2 ) = op (n−1/2 ) and ∗ P∗ (||R2n || > C.n−1/2 (logn)) = op (n−1/2 ) Again, L∗−1 = (E∗ L∗n )−1 + Wn∗ + Z̃n∗ n where (6.8) S.O.C. of Perturbation Bootstrap 25 Wn∗ = (E∗ L∗n )−1 (E∗ L∗n − L∗n )(E∗ L∗n )−1 Z̃n∗ = (E∗ L∗n )−1 (E∗ L∗n − L∗n )(E∗L∗n )−1 (E∗ L∗n − L∗n )L∗−1 n Now, it can be shown by FN(71) that for some constant C1 > 0, as n ≥ C1 , P∗ (||Z̃n∗ || > C1 .n−1/2 (logn)−1 ) ≤ P∗ (||L∗n − E∗ L∗n || > C1 .n−1/4 (logn)−1/2 ) = op (n−1/2 ) (6.9) Therefore, it follows that there exists C2 > 0 and a sequence of Borel sets Q2n , such that P((ǫ1 , ......, ǫn ) ∈ Q2n ) → 1 as n → ∞, and given (ǫ1 , ....., ǫn ) ∈ Q2n and n ≥ C2 , √ √ √ √ ∗ n(βn∗ − β̄n ) = (E∗L∗n )−1 n∆∗n + Wn∗ n∆∗n + (E∗ L∗n )−1 nχ∗n + R3n where χ∗n = n−1 and Pn i=1 xi (6.10) [xi ′ ((E∗ L∗n )−1 ∆∗n )]2 ′′ ψ (ǭi )µG∗ 2 ∗ P∗ (||R3n || = o(n−1/2 )) = 1 − o(n−1/2 ) Since Σ̄−1/2 = Op (1), so by argument similar to (4.12) of Qumsiyeh (1990a), we have n sup |P∗ (F∗n ∈ B) − P∗ (U∗n ∈ B)| = op (n−1/2 ) (6.11) B∈B where U∗n = √ nΣ̄−1/2 n " (E∗ L∗n )−1 ∆∗n + Wn∗ ∆∗n + (E∗ L∗n )−1 χ∗n # Now, for all 1 ≤ i ≤ n, defining Yi∗ = (G∗i − µG∗ ), X∗i = v̆i Yi∗ , Vn∗ = X̃∗i = Vn∗−1/2 X∗i and S∗n = Pn i=1 X̃∗i , it can be established that U∗n = M∗0n S∗n + (S∗n ′ M∗1n S∗n , . . . , S∗n ′ M∗pn S∗n )′ Pn ∗ i=1 Cov∗ (Xi ), (6.12) where M∗0n = Op (1) and M∗jn = Op (n−1/2 ) for all j ∈ {1, . . . , p}. Therefore, by Lemma 6.1 and 6.2, sup B∈B where |P∗(U∗n  ∈ B) − ξn∗ (x) = 1 − n−1/2 Z B ξn∗ (x)dx| = op (n−1/2 ) ∗(ν) as n → ∞   b31 ∗(ν) D ν φ(x) b11 D ν + ν! |ν|=1 |ν|=3 X X (6.13) (6.14) 26 Das D. and Lahiri S. N. ∗(ν) Now, the coefficients b11 ∗(ν) and b31 can be computed using the transformation techniques of Bhattacharya and Ghosh (1978). If ν1 is a p × 1 vector with all the elements being 0, except the jth one and ν2 is a p × 1 vector with all the elements being 0, except the j1 , j2 and j3 positions then after some algebraic calculations it can be shown that ∗(ν ) b11 1 = p X  −1 hjkn n k=1 n h X ′ z′i E∗kn Ā−1 1n xi ψ(ǭi )ψ (ǭi ) i=1 n X + (2n)−1 i −1 ′′ a∗jin x′i Ā−1 1n Ā2n Ā1n xi ψ (ǭi ) (6.15) i=1 ∗(ν ) b31 2 −1 =n n X i=1  3 Y  + 2n−2 −2 + 2n a∗jm in m=1 n X  i,j=1 n  X ! ψ 3 (ǭi ) a∗j1 in a∗j2 in + 3n−3 n  X i,j=1 n X 2 ′ hj3 kn z′i E∗kn Ā−1 1n xj ψ (ǭi )ψ(ǭj )ψ (ǭj )     k=1 a∗j1 in a∗j3 in i,j=1 + 2n−2 p X  p X hj2 kn z′i E∗kn Ā−1 1n xj k=1 a∗j2 in a∗j3 in p X 2 ′ ψ (ǭi )ψ(ǭj )ψ (ǭj )  2 ′ hj1 kn z′i E∗kn Ā−1 1n xj ψ (ǭi )ψ(ǭj )ψ (ǭj ) k=1    ′ −1 ′′ 2 2 a∗j1 in a∗j2 in a∗j3 in x′j Ā−1 1n xl xl Ā1n xi ψ (ǭl )ψ (ǭi )ψ (ǭj ) i,j,l=1 −1/2 where Ā1n and Ā2n are as defined earlier and Ā2n = (h1n , . . . , hpn ), (6.16) h′jn xi = a∗jin , hjn = (h1jn , . . . , hpjn ), j ∈ {1, · · · , p}, i ∈ {1, . . . , n} and E∗kn is a q×p matrix with ||E∗kn|| ≤ q for all k ∈ {1, . . . , p} Now, one can find the two term EE of Fn = √ (for detail see Lahiri(1992)) sup |P(Fn ∈ B) − B∈B where  Z ξn (x) = 1 − n−1/2 (ν ) (ν ) B nσ −1 A1/2 n (β̄n − β) in similar way such that ξn (x)dx| = o(n−1/2 ) X |ν|=1 (ν) b11 D ν + X |ν|=3 (ν) b31 ν! as n → ∞  (6.17)  D ν φ(x) (6.18)  ∗(ν1 ) where the coefficients b111 and b312 are such that for all j, j1 , j2 , j3 ∈ {1, . . . , p}, b11  ∗(ν2 ) and b31 (ν ) −b312  (ν ) −b111  both can be shown to converge in probability to 0. Hence by (6.12)-(6.18), Theorem 4.1 follows. S.O.C. of Perturbation Bootstrap 27 6.3. Outline of the proof of Theorem 4.2 We have, H∗n = √ nσn∗−1 σ̂n Σ̄−1/2 (βn∗ − β̄n ) n (6.19) where σn∗ is as defined earlier. Now using Taylor’s expansion and Lipschitz property of ψ ′′ (·), it can be established that H∗n = F∗n − √ ∗ nσ̂n Σ̄−1/2 Zn∗ ((E∗ L∗n )−1 ∆∗n ) + R4n n (6.20) where  Zn∗ =(2s3n |τn |)−1 2τn s2n − τn2   n 1X ψ ′′ (ǭi )[xi ′ ((E∗ L∗n )−1 ∆∗n )] n i=1 n 2X ψ(ǭi )ψ ′ (ǭi )[xi ′ ((E∗ L∗n )−1 ∆∗n )] n i=1   and there exist constants C3 > 0 and a sequence of Borel sets Q3n such that P(Q3n ) ↑ 1 and given (ǫ1 , ........ǫn ) ∈ Q3n and n ≥ C3 , ∗ P∗ (||R4n || = o(n−1/2 )) = 1 − o(n−1/2 ) (6.21) ∗ Therefore, writing H∗n as H∗n = Ũ∗n + R4n , we have Ũ∗n = M̃∗0n S∗n + (S∗n ′ M̃∗1n S∗n , . . . , S∗n ′ M̃∗pn S∗n )′ (6.22) where M̃∗0n = Op (1) and M̃∗jn = Op (n−1/2 ) for all j ∈ {1, . . . , p}. Hence, by Lemma 6.1, sup B∈B |P∗(Ũ∗n where ξ˜n∗ (x)  ∈ B) − −1/2 = 1 − n Z B ξ˜n∗ (x)dx| = op (n−1/2 ) X |ν|=1 ∗(ν) ∗(ν) b̃11 D ν as n → ∞ (6.23)   b̃31 D ν φ(x) + ν! |ν|=3 X (6.24) Hence part (a) follows by (4.12) of Qumsiyeh (1990a). Suppose the two term EE of the original studentized regression M-estimator Hn = √ nσ̂n−1 A1/2 n (β̄n −β) is  ξ˜n (x) = 1 − n−1/2 (ν)  b̃31 ν  (ν) D φ(x) b̃11 D ν + ν! |ν|=1 |ν|=3 X X  (6.25) 28 Das D. and Lahiri S. N. Now part (b) of Theorem 4.2 follows directly by comparing (6.24) and (6.25). Again after (ν) (ν) some algebraic calculations, it can be shown that b̃11 and b̃31 both contain terms involving h i 2Eψ 2 (ǫ1 ) Eψ(ǫ1 )ψ ′ (ǫ1 ) − Eψ ′ (ǫ1 )Eψ 3 (ǫ1 ) which cannot be replicated by the terms present ∗(ν) in b̃11 ∗(ν) and b̃31 [cf. Supplementary material Das and Lahiri (2017)]. Hence part (c) of Theorem 4.2 follows. 6.4. Outline of the proof of Theorem 4.3 We have the modified studentized bootstrapped M-estimator as, √ H̃∗n = n(σ̃n∗ )−1 σ̂n Σ̄−1/2 (βn∗ − β̄n ) n where σ̃n∗ = s̃∗n τ̃n∗−1 , τ̃n∗ = n−1 suppose, τ̄n = µG∗ τn and s̄2n = Pn i=1 ψ 2 σG∗ s2n . ′ −1 (ǫ∗i )G∗i and s̃∗2 n = n (6.26) Pn i=1 ψ 2 (ǫ∗i )(G∗i − µG∗ )2 . Also Now using the same line of arguments which is working behind (6.20) in the proof of Theorem 4.2, it can be shown that H̃∗n = F∗n − √ ∗ nσ̂n Σ̄−1/2 (Zn∗ − Z̄n∗ )((E∗ L∗n )−1 ∆∗n ) + R5n n (6.27) where Z̄n∗ is as defined in the proof of Theorem 4.2 and Z̃n∗ is defined as Z̄n∗ =2 −1  τ̄n s̄n  −2 − τ̄n2 n−1  2τ̄n s̄2 n X i=1 n  −1 n n X ψ ′ (ǭi )(G∗i i=1 − µ G∗ )    2  ψ 2 (ǭi )[(G∗i − µG∗ )2 − σG ∗] and there exist constant C4 > 0 and a sequence of Borel sets Q4n such that P(Q4n) ↑ 1 and given (ǫ1 , ........ǫn ) ∈ Q4n and n ≥ C4 , ∗ P∗ (||R5n || = o(n−1/2 )) = 1 − o(n−1/2 ) (6.28) 2 Therefore, defining Y1i∗ = G∗i − µG∗ , Y2i∗ = (G∗i − µG∗ )2 − σG ∗  ′ P P n X∗i = v̆i′ Y1i∗ , n−1/2 ψ 2 (ǭi )Y2i∗ , Vn∗ = i=1 Cov∗ (X∗i ), X̃∗i = Vn∗−1/2 X∗i , S̄∗n = ni=1 X̃∗i with v̄i defined with z̆i in place of zi . ∗ Hence, we have H̃∗n as H̃∗n = Ū∗n + R5n , where ′ ′ Ū∗n = M̄∗0n S̄∗n + (S̄∗n M̄∗1n S̄∗n , . . . , S̄∗n M̄∗pn S̄∗n )′ (6.29) S.O.C. of Perturbation Bootstrap 29 with M̄∗0n = Op (1) and M̄∗jn = Op (n−1/2 ) for all j ∈ {1, . . . , p}. Hence, there exists a two term EE ξ¯∗ (·), as in Theorem 4.2, such that sup |P∗ (H̃∗n ∈ B) − B∈B Z B ξ¯n∗ (x)dx| = op (n−1/2 ) as n → ∞ (6.30) Now, ξ¯n∗ (·) can be found explicitly as in standardized case. See supplementary material Das and Lahiri (2017) for more details. Again if ξ¯∗ (·) is compared with ξ˜n (·), given by (6.25), n then it can be established that all the coefficients in ξ¯n∗ (·) are close in probability to that of ξ˜n (·), unlike the case of naive studentized bootstrapped estimator. One point we want to make here that the term Z̄n∗ which is present in the expression of H̃∗n , unlike the expression of H∗n , introduces important third order terms which are crucial in getting second order correctness. Therefore, Theorem 4.3 follows. 6.5. Outline of the proof of Theorem 5.1 See supplementary material Das and Lahiri (2017). 7. Conclusion Second order results of Perturbation Bootstrap method in regression M-estimation are established. It is shown that the classical way of studentization in perturbation bootstrap setup is not sufficient for correcting the distribution of the regression M-estimator upto second order. This is a general statement corresponding to the fact that the usual studentized perturbation bootstrapped estimator is not capable of correcting the effect of skewness of the error distribution in least square regression. Novel modification is proposed in general setup by properly incorporating the effect of the randomization of the random perturbing quantities in the prevalent studentization factor and is shown as second order correct in both IID and non-IID error setup. Thus, in a way the results in this paper establish perturbation bootstrap method as a refinement of the approximation of the exact distribution of the regression M-estimator over asymptotic normality. The second order result in non-IID case establishes robustness of the perturbation bootstrap towards the presence of heteroscedasticity, similar to the wild bootstrap, but in the more general setup of M-estimation. This is an important finding from the perspective of S.O.C. inferences regarding the regression parameters. 30 Das D. and Lahiri S. N. Acknowledgement The authors would like to thank the two referees, the associate editor and the editor for many constructive comments. They encouraged the authors to add a section on the performance of perturbation bootstrap when the errors are heteroscedastic (Section 5). Supplementary Material Supplement to “Second Order Correctness of Perturbation Bootstrap M-Estimator of Multiple Linear Regression Parameter” (; .pdf). Details of the proofs are provided. References [1] ALLEN, M. and DATTA, S. (1999). A Note on Bootstrapping M-Estimators in ARMA Models. J. Time Series Analysis 20 365379. [2] ARCONES A. M. and GINÉ. (1992). On the bootstrap of M-estimators and other statistical functionals. Exploring the Limits of Bootstrap. Edited by R. LePage and L. Billard. Wiley, New York. 13-47. [3] ARLOT, S. (2009). Model selection by resampling penalization. Electron. J. Statist. 3 557–624. [4] BARBE, P. and BERTAIL, P. (2012). The weighted bootstrap . Lecture Notes in Statistics, 98. [5] BERAN, R. (1986). Discussion: Jackknife, Bootstrap and Other Resampling Methods in Regression Analysis. Ann. Statist. 14 1295–1298. [6] BHATTACHARYA, R. N. and GHOSH, J. K. (1978). On the validity of the formal Edgeworth expansion. Ann. Statist. 6 434-451. [7] BHATTACHARYA, R. N. and RANGA RAO, R. (1986). Normal approximation and asymptotic expansions. John Wiley & Sons. [8] BICKEL, PETER J. and FREEDMAN, D. A. (1981b). Some Asymptotic Theory for the Bootstrap. Ann. Statist. 9.6 11961217. [9] CHATTERJEE, S. (1999). Generalised bootstrap techniques. Ph.D. dissertation. Indian Statistical Institute, Calcutta. [10] CHATTERJEE, S. and BOSE, A. (2005). Generalized bootstrap for estimating equations. Ann. Statist. 33 414-436. S.O.C. of Perturbation Bootstrap 31 [11] CHATTERJEE, A. and LAHIRI, S. N. (2013). Rates of convergence of the adaptive LASSO estimators to the oracle distribution and higher order refinements by the bootstrap. Ann. Statist. 41 12321259. [12] CHENG, G. and HUANG, J. Z. (2010). Bootstrap consistency for general semiparametric M -estimation. Ann. Statist. 38 2884–2915. [13] CHENG, G. (2015). Moment Consistency of the Exchangeably Weighted Bootstrap for Semiparametric M-estimation. Scand J Statist. 42 665684. [14] DAS, D. and Lahiri S. N. (2017). Supplement to “Second Order Correctness of Perturbation Bootstrap M-Estimator of Multiple Linear Regression Parameter”. [15] DAVIDSON, R. and FLACHAIRE, E. (2008). The wild bootstrap, tamed at last. Journal of Econometrics. 146 162-169. [16] DAVIDSON, R. and MACKINNON, J. G. (2010). Wild Bootstrap Tests for IV Regression. Journal of Business & Economic Statistics. 28 128-144. [17] EFRON, B. (1979). Bootstrap Methods: Another Look at the Jackknife. Ann. Statist. 7 1-26. [18] EL BANTLI, F. (2004). M-estimation in linear models under nonstandard conditions. J. Statist. Plann. Inference 121 231-248. [19] FENG X., HE X. and HU J. (2011). Wild bootstrap for quantile regression. Biometrika 98 995999. [20] FREEDMAN, D. A. (1981). Bootstrapping Regression Models. Ann. Statist. 9 12181228. [21] FUK, D. H. and NAGAEV, S. V. (1971). Probabilistic inequalities for sums of independent random variables. Teor. Verojatnost. i Primenen. 16 660-675. [22] HAEUSLER, E., MASON, D. M. and NEWTON, M.A. (1991). Weighted Bootstrapping of Means. Centrum voor Wiskunde en Informatica Quarterly. 4 213-228. [23] HALL, P. (1992). The bootstrap and Edgeworth expansion. Springer Series in Statistics. [24] HLAVKA, Z. (2003). Asymptotic properties of robust three-stage procedure based on bootstrap for M-estimator. J. Statistical Planning and Inference 115 637-656. [25] HU, F. (1996). Efficiency and Robustness of a Resampling M-Estimator in the Linear Model. J. Multivariate Analysis 78 252-271. [26] HU, F. and KALBFLElSCH D. J. (2000). The estimating function bootstrap. The Canadian Journal of Statistics 28 449-499. [27] HUBER, P. (1981). Robust Statistics. Wiley, New York. [28] JIN, Z. , YING, Z. and WEI, L. J. (2001). A simple resampling method by perturbing the minimand. Biometrika. 88 381-390 . [29] KARABULUT, I.K. and LAHIRI, S.N. (1997). Two-term Edgeworth expansion for M- 32 Das D. and Lahiri S. N. estimators of a linear regression parameter without Cramer-type conditions and an application to the bootstrap. Proceedings of the Australian Mathematical Society, Ser. A. 62 361-370. [30] KLINE, P. and SANTOS, A. (2012). A Score Based Approach to Wild Bootstrap Inference. Journal of Econometric Methods 1 2341. [31] LAHIRI, S. N. (1989b). Bootstrap approximation and Edgeworth Expansion for the distributions of the M-estimators of a regression parameter. Preprint 89-36, Dept. Statistics, Iowa State Univ. [32] LAHIRI, S. N. (1992). Bootstrapping M-estimators of a multiple linear regression parameter. Ann. Statist. 20 1548-1570. [33] LAHIRI, S. N. (1994). On two-term Edgeworth expansions and bootstrap approximations for Studentized multivariate M-estimators. Sankhya A. 56 201-226. [34] LAHIRI, S. N. (1996). On Edgeworth Expansion and Moving Block Bootstrap for Studentized M-Estimators in Multiple Linear Regression Models. J. Multivariate Analysis 56 42-59. [35] LAHIRI, S. N., and ZHU, J. (2006). Resampling methods for spatial regression models under a class of stochastic designs. Ann. Statist. 34 1774-1813. [36] LEE, STEPHEN M.S (2012). General M-estimation and its bootstrap. J. Korean Statistical Society 41 471-490. [37] LIU, R. Y. (1988). Bootstrap Procedures under some Non-IID Models. . Ann. Statist. 16 1696–1708. [38] MA, S. and KOSOROK, M. R (2004). Robust semiparametric M-estimation and the weighted bootstrap. J. Multivariate Analysis 96 190-217. [39] MAMMEN E. (1993). Bootstrap and Wild Bootstrap for High Dimensional Linear Models. Ann. Statist. 21 255–285. [40] MASON, D. M. and NEWTON, M. A. (1992). A Rank Statistics Approach to the Consistency of a General Bootstrap. Ann. Statist. 20 1611–1624. [41] MINNIER, J., TIAN, L. and CAI, T (2011). A perturbation method for inference on regularized regression estimates. J. Amer. Statist. Assoc. 106 1371-1382. [42] NAVIDI, W. (1989). Edgeworth Expansions for Bootstrapping Regression Models. Ann. Statist. 17 1472–1478. [43] QUMSIYEH, M. B. (1990a). Edgeworth expansion in regression models. J. Multivariate Analysis 35 86-101. [44] QUMSIYEH, M. B. (1994). Bootstrapping and empirical edgeworth expansions in multiple linear regression models. Comm. Statist. Theory Methods 23 32273239. [45] RAO, C. and ZHAO, L. (1992). Approximation to the Distribution of M-Estimates in S.O.C. of Perturbation Bootstrap 33 Linear Models by Randomly Weighted Bootstrap. Sankhya A 54 323-331. [46] RUBIN, D. B. (1981). The Bayesian Bootstrap. Ann. Statist. 9 130–134. [47] WANG, X. M. and ZHOU, W. (2004). Bootstrap Approximation to the Distribution of M-estimates in a Linear Model. Acta Math Sinica. 20 93104. [48] WELLNER, J. A and ZHAN, Y. (1996), ”Bootstrapping Z-Estimators”. Technical report, University of Washington, Dept. of Statistics. [49] WU, C. F. J. (1986). Jackknife, Bootstrap and Other Resampling Methods in Regression Analysis. Ann. Statist. 14 1261–1295. [50] YOU, J. and CHEN, G. (2006). Wild bootstrap estimation in partially linear models with heteroscedasticity. Statistics & Probability Letters. 76 340–348.
10math.ST
Background Subtraction Using the Factored 3-Way Restricted Boltzmann Machines arXiv:1802.01522v1 [cs.CV] 5 Feb 2018 Soonam Lee Daekeun Kim Department of Electrical Engineering and Computer Science University of Michigan Ann Arbor, MI 48105 [email protected] [email protected] Abstract In this paper, we proposed a method for reconstructing the 3D model based on continuous sensory input. The robot can draw on extremely large data from the real world using various sensors. However, the sensory inputs are usually too noisy and high-dimensional data. It is very difficult and time consuming for robot to process using such raw data when the robot tries to construct 3D model. Hence, there needs to be a method that can extract useful information from such sensory inputs. To address this problem our method utilizes the concept of Object Semantic Hierarchy (OSH). Different from the previous work that used this hierarchy framework, we extract the motion information using the Deep Belief Network technique instead of applying classical computer vision approaches. We have trained on two large sets of random dot images (10,000) which are translated and rotated, respectively, and have successfully extracted several bases that explain the translation and rotation motion. Based on this translation and rotation bases, background subtraction have become possible using Object Semantic Hierarchy. 1 Introduction In order to drive the real world in terms of robot’s perspective, recognizing the 3-dimensional environment is one of the most important problem to address. Robot can learn the environment via various sensors such as vision, laser or pressure. We choose to work with vision sensor because it can provide abundant information compared with other sensors. Input data from vision sensor contains not only edge, corner, and line, but also RGB information that helps robot perceive object in its surroundings. Since the input given to the robot is continuous, we use sequence of images as input data. Although input data contains the whole information about the environment including background and foreground, robot cannot extract any useful information unless the data is processed manually. Thus, the method that filters information from given input data is necessary. In this paper, we proposed a method that helps robot learn the motion of dynamic objects. In order to address this problem, in [1] and [2] introduced a method called the Object Semantic Hierarchy (OSH), which consists of multiple representations with different ontologies. The OSH by itself can provide analysis of given sequential image. Through this analysis, robot can detect dynamic objects and recognize its existence. However, the OSH is only the framework that helps segmenting the background information. This framework requires some techniques to pull out the invariant property under the camera motion and detect objects. Previous works using this framework applied SIFT feature and HOG [1] or Homography transformation [2]. Here, we would like to incorporate Deep Belief Network (DBN) model so the robot can not only detect the object, but understand it. Reconstructing the 3D model by combining structure of the OSH to differentiate the noise and DBN technique would give robot a better understanding about its environment. A robot could learn 3-dimensional environment and recognize the real world as human does using our proposed method. 2 2.1 Related Work Review of Previous Work Since the history of background subtraction or background modeling is long, there are lots of approaches to address this problem. The simplest methods for background subtraction are frame difference between two frames 1 such as median, average, or running average of the previous frames. However, these methods are too sensitive to the threshold as well as they do not cope with multiple model background distributions. A number of probabilistic methods have been proposed for solving this problem such as mixtures of Gaussians [3], kernel density estimators [4], and mean shift [5]. Mixtures of Gaussians consider multiple model background distributions by the accumulation of supporting evidence [3]. In [4] the background probability density function is given by the histogram of the most recent pixel values. Mean shift [5] is a gradient-ascent method that can detect the multiple model distribution together with their covariance. There are also several papers that contribute to background modeling. In [6] a bankground is modeled using the joint spatial color model. They recently described the method that using the RANSAC algorithm and the Markov Random Field, do background subtraction under the freely moving camera [7]. Apart from the previous methods since this vision sensor can be considered as a significant role of mobile robotics, running this background subtraction algorithm in real time is a crucial step. In [8] the method that adaptively deciding the background model was described and they can do real-time tracking. In addition, statistical approach to solve the background subtraction in a real time was introduced in [9]. Different from these approaches mentioned above, our method did not use traditional computer vision methods or assumed the model of background. Instead, our proposed method learn the pattern of the motions using the Restricted Boltzmann Machines (RBM) and obtain the global motion from the sequential images. Once this global motion is identified between frames, we can select the regions that violate the global motion. This violated regions against global motion can be considered as the foreground region as suggested in the OSH [1]. 2.1.1 Restricted Boltzmann Machines The Deep Belief Network is cutting edge technique originated from neural network where its motivation is to mimic human’s perception process. This technique is probabilistic generative models that are composed of multiple layers of stochastic, latent variables. To get the probabilistic model the RBM imported the concept called energy-based model from thermodynamics. The energy function of the RBM can explain the relationship between visible unit, which is from input images, and hidden unit, which is latent variables. Given visible unit x and hidden units h the energy function of the RBM can be written as follows: E(x, h) = − X xi hj Wij − i,j X bi x i − i X cj hj (1) j where b is the visual biases and c is the hidden biases. Using this energy function in Eq (1), the probability distribution can be derived as such: P (hj = 1|x) = g(cj + Wj x) P (xi = 1|h) = g(bi + WiT h). (2) (3) This g(·) can be a sigmoid function, hyperbolic tangent function or Gaussian function depending on the input data type. The DBN is well known to have good performance in classification because the DBN can actually learn the meaningful bases from the given input. For example, several experiments were introduced to extract the bases that explain different objects [10]. The DBN is represented as a hierarchal model where each layer contains high level information of its previous layer. In the first hidden layer, the hidden units contain the edge like bases from the objects. In the second hidden layer, there is information about the specific part of the objects. As the depth of hidden layer increases, information that hidden layer contains are the higher level features of objects. In addition, since the DBN technique is one of the machine learning techniques, it involves training and testing stages. Many experiments have been performed using the RBM and they turned out that the performance of unsupervised learning or semi-supervised learning is better than the performance of supervised learning in object detection and classification [11]. 2.1.2 Higher-Order Restricted Boltzmann Machines Conventional RBM only focused on the mean intensity of each pixel. However, to capture the correlation of multiple images, the visible unit input images should be multiple too. As shown in Eq (1) and (??), the energy function and probability expressions of the RBM only have one visible unit input. We should use higher order Boltzmann Machines to get more than two inputs. One of the drawback to use the nth-order Boltzmann machines is that the higher order Boltzmann machines are too complicated to compute the hidden units and cannot be applied to the real time data. More specifically, the weight matrix W that connects visible unit and hidden units is n-dimensional tensor and finding this W requires high computational cost. To reduce the computational cost of this weight matrix, the method that reduced the complexity of weight matrix through factorization is proposed in [14]. Moreover, new type of RBM called covariance RBM 2 that can capture the correlation of image is introduced in [12]. This factorization idea in [14] is also applied in [12]. In particular, the 3-way factored RBM model is introduced to compute the covariance of input data. By applying this model to still image, their proposed method can capture the self-correlation of given image with duplicated images as two visible units [12]. 2.1.3 Object Semantic Hierarchy In [1, 2] the robot initially treats the every input from sensors as noise (Layer 0: Noisy world). Then, using the static background model, the layer can extract the static background (Layer 1: Static Background). During the static background stage a static model of the background is assumed to be time-invariant and dynamic change is considered as noise. Through the 2nd layer, the OSH extracts the set of constant 2D object view and the timevariant 2D object poses (Layer 2: 2D object in 2D space). In the 3rd layer, it collects each constant 2D image components to reconstruct the time-variant 3D poses (Layer 3: 2D object in 3D space). Finally, in the last layer, the same collection of 2D components but with invariant relations among 3D poses and the time-invariant 3D pose of the objects are extracted as a whole (Layer 4: 3D object in 3D space). The framework of the OSH is displayed in Figure 1. In this paper, we utilize the framework of the OSH to perform the background subtraction which is described in the 1st stage of the OSH. Figure 1: The framework of the OSH 2.2 Main Contribution Having mentioned from previous section, the hidden layer can contain the high level features such as edges, the part of objects, and the whole objects from the given image. However, this technique was mainly applied for single still image [10] so far. In [12] the 3rd-order RBM that uses two sets of visible units was introduced. Note that previous RBM models use a single set of visible unit. Our intuition in this paper is to apply such a model to extract the motion information of two sequential images, whereas [12] uses single images as two visible units. More specifically, if two sequential images are used as inputs, the hidden units in the RBM may contain some meaningful information such as the relationship between two images. More precisely, these factors could include each pixel’s motion information and correlation rather than edges or objects obtained from using single still image. Once having the motion information, we can successfully extract optical flow-like field in between two images, namely max-flow field. This is a fairly unconventional but probably quite biologically plausible representation of what happened between two images. There are the number of possible ways of using this flow field including background subtraction. Since the flow field of every pixel is estimated, we could figure out the global motion of each image pairs. Based on the assumption that background regions are large enough compared to foreground regions, we can expect that the global motion regions may represent the background regions. Using the concept of 1st stage of the OSH, background subtraction can be done by dividing the two motion subfields: the background motion regions and the motion regions that violate the background motion. 3 3 Technical Content 3.1 Summary of the Technical Solution As previously discussed, the method using two visible units as inputs was introduced in [12]. However, different from [12], we suggested taking the different images as inputs. More specifically, by taking two sequential images as inputs to the 3-way RBM model, we successfully obtained the motion information between the given inputs. After the motion information from inputs were obtained, we displayed max flow field using the weight matrix computed by the 3-way RBM. Then, based on the max-flow field, we extracted the global motion of two sequential images. Once estimating the flow field of image at pixel level is performed, we can apply the 1st stage of the OSH framework to segment foreground object. 3.2 3.2.1 Details of the Technical Solution Spatial Covariance and Temporal Covariance Our proposed method starts from the factored 3-way RBM model in [12]. The energy function of 3rd-order RBM is expressed as below [12]: X X X E(x, h) = − xi xj hk Wijk − bj xj − ck hk . (4) j i,j,k k The energy function of the 3rd-order RBM consists of two visible units xi , xj , one hidden unit hk and three dimensional tensor Wijk . Note that two visible units xi and xj are same still image input in [12]. Using the factorization method, the weight matrix Wijk can be approximately computed by the summation of the products of the two-dimensional weight matrices as: X Wijk ≈ − Wif Wjf Wkf (5) f where Wif represents the weight matrix between visible units and factor and Wjf is the weight matrix between another input visible units and factor. Similarly, Wkf is the weight matrix between hidden units and factor. Since the 3-dimensional tensor is factorized by the product of 2-order weight matrix, the complexity of computation reduces from O(N 3 ) to O(N 2 ) [14]. Moreover, the weight matrix Wif and Wjf are the same matrix since the duplicated images xi and xj are used as visible unit inputs in spatial covariance case [12]. So given energy function in Eq (4) can be simplified as XX X E(x, h) = − ( xi Wif )2 ( hk Wkf ). (6) i f k Using this energy function, we can easily get the probability distribution based on the same inference of conventional RBM such as X X P (hk = 1|x) = g( Wkf ( xi Wif )2 + ck ). (7) i f Figure 2: The factored 3-way RBM model in sequential images Eq (7) represents the probability distribution based on the energy function shown in Eq (6). The relationship between visible units and hidden units can be observed in Figure 2. In Figure 2, factored 3-way RBM model is 4 conceptually presented. Visible units and hidden units are connected with each weight matrix from visible units or hidden units to factor. The weight matrices between visible units and factor (Wif and Wjf ) can be computed and obtained by Eq (6) and (7). To get the concrete result, [12] used the Hybrid Monte Carlo (HMC) method by using leapfrog steps 20-times per epoch to reject the abnormal output with given probability. Hence, the computed weights based on parameters such as visible units, hidden units converge. We expect for these weight matrices to contain the information that can explain the correlation inputs. Since the inputs are the same images in this case, the useful information to explain image would be edge-like features and we denote this method as a spatial covariance method. As shown in Figure 2, we take the similar concept from 3-way factorized RBM model introduced from [12]. However, our proposed method uses time sequential images as inputs. We denote our proposed method as a temporal covariance method. Since our input images are two sequential images denoted as previous image (xi ) and current image (yj ), respectively, the weight matrix Wif between previous image and factor should be different from the matrix Wjf between current image and factor. Therefore, the energy functions under the different image inputs are shown as X X X E(y, h; x) = − xi yj hk Wijk − bj yj − ck hk . (8) j i,j,k k Here, x and y are the visible unit inputs and h is hidden units. Different from Eq (4), we deal with the conditional energy function to simplify the computational complexity. From this energy function, the probability distributions are similarly computed as Eq (2) and (3) such that X P (hk = 1|y; x) = g( Wijk xi yj + ck ) (9) i,j X P (yj = 1|h; x) = g( Wijk xi hk + bj ) (10) i,j where the Eq (9) represents a positive hidden probability and the Eq (10) represents a negative hidden probability. Again, this g(·) can be a sigmoid function when the input images are expressed as binary data and the Gaussian distribution when the input images are continuous data. After computing these hidden probabilities, this algorithm calculates the error between original output (y) and new output (y’). When we applied the Hybrid Monte Carlo (HMC) technique to our two input images, the reconstruction error failed to reduce and the output results no longer had edge-like features in calculated weights. Therefore, we had to find different method to get the robust weight matrix. We choose to apply the k-steps Contrastive Divergence (CD-k) and the results seem to converge well with only k = 1. After the reconstruction error is converged, the reconstruction error is decreased. Brief implementation algorithm is provided from Algorithm 1 at Section 3.3. 3.2.2 Max Flow Field and Background Subtraction As we expect to get the edge-like bases from spatial covariance, the hidden units computed by two sequential images have the information of translation and rotation motion behaviors. Once we get the motion bases through the temporal covariance method, max-flow fields are extracted from motion. More specifically, given the motion bases which are factored into three weights, we can estimate optical flow as a binary vector, or as a vector of Bernoulli probabilities. The hidden states inferred from positive hidden probability can give the relationship between the xi and yj . For every pixel in the xi the strongest outgoing connection is declared the output pixel which this connection leads to as the target of corresponding input pixel. This is denoted as a max-flow field that maps every input pixel to an output pixel. In order to apply this max-flow field to subtract background, we need to assume two things; the background has a consistent rigid body under the camera motion and the portion of background is dominant from the dynamic objects. Under the these assumptions, finding the global motion can be done by deducing the max-flow field in pixel level. Here, since the robot moves in the real world, robot’s camera sensor should not be considered as a fixed camera. Our method should segment foreground objects from background taking consideration of randomly moved camera motion. To subtract background we need to know about the background motion information. After global motion is estimated, since background region is bigger than foreground regions as we already assumed, the regions that are governed by global motion can be regarded as background regions. Similar to the OSH framework, the regions that violate the invariant property (global motion) will be treated as foreground regions. As such, subtracting the background regions using max-flow field is possible. Brief implementation algorithm is provided from Algorithm 2 at Section 3.3. 3.3 Main Implementation Algorithm We described the brief algorithm of 3-way RBM for learning weights and biases. Implementation is done with Matlab by referring Memisevic’s paper [14]. In our implementation we used 200 factors, 100 mapping units, 0.9 5 Algorithm 1 Train3WayRBM(x,y) 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: Wxf is the input weight matrix, of dimension (number of input units, number of factors) Wyf is the output weight matrix, of dimension (number of output units, number of factors) Whf is the hidden weight matrix, of dimension (number of hidden units, number of factors) hbias is the bias vector for hidden units ybias is the bias vector for output units for epoch = 1 to numEpoch do for batch = 1 to numBatches do • Given x and y, compute the positive hidden probability. • Compute the positive gradient of the energy function with respect to the parameters and positive hidden probability. • Sample from the positive hidden probability to get the hidden units. • Compute the negative gradient of the energy function with respect to the parameters and negative hidden probability. • Update the parameters by subtracting positive gradient and adding negative gradient. end for end for return [Wxf , Wyf , Whf , hbias, ybias] for momentum, 0.01 for learning rate, and 0.02 for target hidden probability as detailed in Algorithm 1. These values were chosen by parameter tuning on a development set of 100 inference tasks. After training, the model can infer optical flow from a pair of test images with factored weights by computing the hidden unit activations as detailed in Algorithm 2. The representation of optical flow in the model is as a binary vector and the binary vector over hidden units defines a matrix that maps the input image to the output image. One can find, for example, for every input pixel the strongest outgoing connection to the output pixel that leads to as the target of this input pixel. This defines a max-flow field that maps every input pixel to an output pixel. Algorithm 2 MaxFlowField(x,y, Wxf , Wyf , Whf , hbias, ybias) 1: Given a pair of images with parameters, calculate the hidden unit activations. 2: for all input units i do 3: • Compute the input factor units with ith mask. 4: • Find a reconstructed output units (ŷ) through ith mask. 5: j ← argmaxi (ŷ) 6: • Maps index i and index j into 2D-matrix. 7: • Make a connection between i and j into 2D-matrix which indicates the optical flow. 8: end for 4 4.1 Experiments Learning Weights As the first stage of experiments, we trained on different types of translations and rotations on dot binary images which were generated randomly with about ten percents of the pixels on. 10, 000 created image of size 13 × 13 pixels were used to do the training for translation and rotation and each of their corresponding pairs as a sequential frame was transformed at random direction, respectively. Implementation results of translation and rotation are shown in Figure 3 and Figure 4, respectively. Figure 3 shows the results for finding the temporal covariance between sequential frames when translation motion is trained and Figure 4 shows the similar results when the rotation motion is trained. Since the input images for training translations or rotations are the binary inputs, the given probability that shows from the Eq (9) and (10) should be the sigmoid function. Note that Eq (10) should be Gaussian if the input image is the real-valued input. Empirically, the epoch was set to 500 for optimal results in the translation training and the epoch was set to 700 for optimal results in the rotation training. As shown in Figure 3 and 4, corresponding motion information was extracted successfully. From the learned weights we can infer optical flow as well as reconstruct new output images as shown in the next section. 4.2 Max-Flow Field and Reconstructed Output In order to verify whether the model is able to infer transformations such as translation and rotation, we constructed max-flow fields and then displayed them. More specifically, given the learned weights shown in Figure 3 and 4, 6 we can infer optical flow pattern from pairs of test images by computing hidden unit activations. It is possible to visualize motion flows in the hidden units by drawing arrows from the input pixel to the output pixel. To express the flow field efficiently, we drew only one arrow from the each input pixel which is selected by maximizing the corresponding output pixel location. This connection is defined as a max-flow field as we already discussed in previous section. Note that this process may loose some information since it cannot visualize the case where an input pixel is mapped to multiple output pixels and it may loose all information about uncertainty [13]. (a) Left: input Wxf bases (b) Right: output Wyf bases Figure 3: Visible Factor Weights for two sequential input images x and y (Translation). It shows the translation information for each basis. (a) Left: input Wx f bases (b) Right: output Wy f bases Figure 4: Visible Factor Weights two sequential input images x and y (Rotation). It shows the rotation information for each basis. Figure 5 and 6 shows four image pairs of translation and rotation and each inferred max-flow fields, respectively. For translation, given a test set of 1, 000 binary random dot 13 × 13 images, we constructed 9 kinds of transformations for this experiments such as no shift, up, down, left, right, and four diagonal directions as output images. After generating learned weights, 100 hidden units are used to map into input images and output images. Hence, we could extract max-flow fields as shown in the rightmost picture for each pair in Figure 5. For rotation, given a test set of 1, 000 binary MNIST 13 × 13 images, we rotated images ranging from 0◦ to 360◦ as output images. 7 With the same configuration and procedure we could extract max-flow fields as shown in the rightmost picture for each pair in Figure 6. Figure 5: Translation test set. Each group of binary random dot images from left to right represent: input images; output images. The rightmost images indicate representations of inferred max-flow fields between input images and output images From the max-flow fields, we can easily observe that there is a global motion between two sequential images. As an example of translation shown in Figure 5, a group of flow fields indicates one dominant direction such as up, lower-left diagonal, right, and upper-left diagonal, respectively. Similarly, as an example of rotation in Figure 6, we can clearly observe that there is a global rotation motion. Each input and output pairs represents the global rotation motion such as counterclockwise, clockwise, no-rotation, and reverse turns, respectively. Figure 6: Rotation test set. Each group of binary MNIST images from left to right represent: input images; output images. The rightmost images indicate representation of inferred max-flow field between input images and output images 8 Figure 7: Analogies in Rotation (Example of images in the MNIST data set). Left column: Input images (xi ), Center column: Output images (yj ), Right column: Reconstructed images using the input images and inferred max-flow fields which came from hidden unit activations Moreover, once we compute the correspondence between input image and output image pairs, we can apply these transformations to previously unseen images. Whatever the input image is, it is successfully reconstruct the output image by analogy since we know the max-flow fields. Figure 7 illustrates the reconstructed images. 5 Future Work and Conclusion We have proposed a method that combines OSH framework and DBN techniques in order to learn the foreground motion information in a video sequence. Our first step was to reproduce the work of existing DBN technique,called 3-way factored RBM [12]. There was a further modification to accept two different images as visible units. We have shown that the DBN can not only extract the useful information about single image but also find the correlation between two sequential images, for example, the max-flow fields. With these max-flow fields, we could estimate the global motions. Some of remaining future work includes background and foreground segmentation. As defined in OSH [1], [2], we consider the regions that move along to the global motion as background region. On the contrary, foreground region is defined such that the region violates the global motion. Since we finished extracting the flow-field from given test set and estimated the direction of the global motion regions which is become possible to determine background region followed by the foreground regions segmentation. We further believe that building on top of our proposed technique could construct the 3D modeling since we do not need to consider the background information. References [1] C. Xu and B. Kuipers, “Towards the object semantic hierarchy,” Proc. of the ICDL, 2010. [2] C. Xu and B. Kuipers, “Construction of the object semantic hierarchy,” Fifth International Cognitive Vision Workshop, 2009. [3] C. Stauffer and W. E. L. Grimson, “Adaptive background mixture models for real-time tracking,” Proc. of the CVPR, pp. 246-252, 1999. [4] A. Elgammal, D. Harwood, and L. S. Davis, “Non-parametric model for background subtraction,” Proc. of the ICCV, Frame-rate Workshop, 1999. [5] D. Comaniciu and P. Meer, “Mean Shift: A robust approach toward feature space analysis,” IEEE Transactions on PAMI, vol. 24, no. 5, pp. 603-619, 2002. [6] Y. Sheikh and M. Shah, “Bayesian object detection in dynamic scenes,” IEEE Transactions on PAMI, 2005. [7] Y. Sheikh, O. Javed, and T. Kanade, “Background subtraction for freely moving cameras,” Proc. of the ICCV, pp. 12191225, 2009. [8] C. Stauffer, W. Eric, and L. Grimson, “Adaptive background mixture models for real-time tracking,” Proc. of the CVPR, pp. 2246-2252, 1999. [9] T. Horprasert, D. Harwood, and L. Davis, “A statistical approach for real-time robust background subtraction and shadow detection,” Proc. of the ICCV, 1999. [10] H. Lee, R. Grosse, R. Ranganath, and A. Y. Ng, “Convolutional deep belief networks for scalable unsupervised learning of hierarchical representations,” Proc. of the ICML, 2009. [11] Y. Bengio, “Learning deep architectures for AI,” Technical Report 1312, University of Montreal, 2007. [12] M. Ranzato, A. Krizhevsky, and G. E. Hinton, “Factored 3-Way restricted Boltzmann machines for modeling natural images.” Proc. of the AISTATS, 2010. 9 [13] R. Memisevic and G. E. Hinton, “Unsupervised learning of image transformations,” Proc. of the CVPR, 2007. [14] R. Memisevic and G. E. Hinton, “Learning to represent spatial transformations with factored higher-order Boltzmann machines,” Neural Computation, June 2010. 10
1cs.CV
arXiv:1605.05042v1 [cs.NA] 17 May 2016 Computational issues and numerical experiments for Linear Multistep Method Particle Filtering Daniela Calvetti A11 , Salvatore Cuomo B22 , Monica Pragliola32 , Erkki Somersalo41 and Gerardo Toraldo52 1 Department of Mathematics, Case Western Reserve University, 10900 Euclid Ave., Cleveland, OH 44106, USA 2 Department of Mathematics and Applications, University of Naples Federico II, Strada Vicinale Cupa Cintia 21, 80126, Naples, Italy. 1 [email protected] [email protected] 3 [email protected] 4 [email protected] 5 [email protected] 2 0.1 Introduction The Linear Multistep Method Particle Filter (LMM PF) is a method for predicting the evolution in time of a evolutionary system governed by a system of differential equations. In order to appreciate the contribution of the LMM PF, let us suppose to deal with an ODEs system modelling an inverse problem and depending on unknown or poorly known parameters. The estimate of states and parameters for such a system from noisy measurements of a function of some of the states at discrete times is a central problem in several applications. In general, inverse problems are ill posed, that means, for instance, that the solution does not exist. A possible way to overcome the mentioned difficulties is to resort to a statistical approach, outlining a framework in which the unknown states and parameters are modelled as random variables and the uncertainties on them are represented by probability density functions. A great advantage in adopting such a point of view is that we do not have to worry about the existence of the solution, or of a unique solution, since the solution is not a single value, but a probability density function (posterior density). Nevertheless the original problem is not formulated in statistical terms. To find the value of the generic unknown, we can, for example, maximize the density function of the corresponding random variable. However, this optimization problem can not be solved directly. We need to appeal to a pre-processing phase that makes the issue practicable from a computational point of view, resorting to sampling techniques, such as LMM PF. The aim of sampling techniques is to draw information from probability density functions, whose analytical form is approximated by sample points. The computational efficiency of the sampling technique is crucial for the success of the method, since, the better the sampling, the more accurate and reliable is the final solution. Let us present a more detailed analysis of the issue and consider a system of differential equations depending on a vector of unknown parameters θ: du = f (t, u, θ), dt u(0) = u0 , t ∈ [0, T ]. (1) where u = u(t) ∈ Rd is a vector containing the states of the system, f : R × Rd × Rk −→ Rd is the known model function, and θ ∈ Rk is the vector of model parameters. Observe that (1) is not required to model an inverse problem, since the method proposed in the following can be successfully applied to every kind of ODEs system. Setting a discretization step for the time interval [0, T ], suppose that the measured observations are given by bj = g(u(tj ), θ) + ej ∈ Rm , (2) where g : Rd × Rk −→ Rm is a known function and ej denotes the noise in the measurement process, which is additive for sake of simplicity. Formally, we are looking for an estimate of u(t) at given times and θ from the measurements bj . Let us denote by Dj the set of data accumulated up to time t = tj , Dj = {b1 , ..., bj }. As mentioned before, adopting a statistical approach, the final solution is a probability density function. In particular, here we are interested in updating the posterior density from one time instant to the next: π(uj , θ|Dj ) −→ π(uj+1 , θ|Dj+1 ), (3) where uj denotes the discrete approximation of the state vector u(tj ). As we are working in a statistical framework, the analytical model (1) must be converted into a statistical one, the so called evolution-observation model. Let us show a possible way to carry 1 out the mentioned transformation. Consider (1) over the time interval [tj , tj+1 ] du = f (t, u, θ), dt tj < t < tj+1 , and let ψ exact be the formal exact propagation operator: u(tj+1 ) = ψ exact (tj+1 , u(tj , θ)). We need to replace ψ exact by a numerical scheme. In particular, we choose an r-step solver ψ such that uj+1 = ψ(uj , uj−1 , ..., uj−r+1 , θ, h), (4) where h is the constant time step. Substituting in (4) the exact solution for the numerical one, the equality is retained if we take into account the approximation error, or local truncation error: u(tj+1 ) = ψ(u(tj ), u(tj−1 ), ..., u(tj−r+1 ), θ, h) + wj+1 . If we look at u(tj ) as the realization of the random variable Uj , the previous formula defines an r-Markov model: Uj+1 = ψ(Uj , Uj−1 , ..., Uj−r+1 , θ, h) + Wj+1 , (5) for the stochastic process {Uj }Tj=0 , where {Wj }Tj=1 is the associated innovation process. It is possible to turn the r-Markov model (5) into a 1-Markov model by a change of variables:       Wj+1 ψ(Xj , θ, h) Uj  0    Uj  .         .    .  Vj+1 =   Ψ(Xj , θ, h) =   . Xj =     .    .      .   .    . Uj−r+1 0 Uj−r+2 In the end we obtain the 1-Markov model: Xj+1 = Ψ(Xj , θ, h) + Vj+1 . (6) Assume that {Yj }Tj=1 is the stochastic process modelling the observations of Uj . Then we have Yj = G(Xj ) + Ej , (7) where {Ej }Tj=1 represents the measurement noise. Equations (6)-(7) constitute the discrete-time evolution-observation model obtained from a discretetime propagation system. It is worth observing that the innovation term Vj+1 in (6) represents mainly the numerical approximation error due to the propagation scheme ψ, since most of its components are null. 0.2 LMM PF Let us consider the discrete-time evolution-observation model (6)-(7): Vj+1 ∼ N (0, Γj+1 (Xj , θ)) Xj+1 = Ψ(Xj , θ, h) + Vj+1 , Yj = G(Xj ) + Ej , Ej ∼ N (0, Σj ). 2 (8) As mentioned in the previous section, Vj+1 is connected with the approximation error, in fact its covariance matrix Γj+1 is computed by resorting to error estimate strategies, such as the Higher Order Method Error Control strategy (HOMEC). Adopting HOMEC, we need to consider an LMM method of order p and an LMM method of order p̂ ≥ p + 1 from the same family. Denoting with u the solution computed by the LMM method of order p, and with û the solution computed by the LMM method of order p̂, we obtain the following expression for the innovation covariance Γj+1 = diag(γ), γi = τ 2 (uj+1 − ûj+1 )2i , i = 1, ..., d, where τ > 1 is introduced to compensate for the omission of the higher order terms. Our purpose is to compute a sequential update of the posterior density such as (3): π(xj , θ|Dj ) −→ π(xj+1 , θ|Dj+1 ). (9) As in the classical particle filter [ref], we deal with samples approximating densities. Hence, the update we are actually interested in is:  N Sj −→ Sj+1 , Sj = (xnj , θjn , wjn ) n=1 , where the pairs (xnj , θjn ) for n = 1, ..., N , have been drawn from the posterior density π(xj , θ|Dj ) with relative probabilities wjn . For simplicity, we first assume that the parameter θ is known and can therefore be dropped from the notation in (4.2) and the sample Sj has the form:  N Sj = (xnj , wjn ) n=1 . The model (6)-(7) satisfies the following Markov properties: • the state Xj+1 depends on the past data Dj only through the previous state, i.e. π(xj+1 |xj , Dj ) = π(xj+1 |xj ); • the observation Yj+1 depends on the past only through the current state Xj+1 , i.e. π(yj+1 |xj+1 , Dj ) = π(yj+1 |xj+1 ). The previous properties suggest us to rewrite the chain of update (9) adding an intermediate step: π(xj |Dj ) −→ π(xj+1 |Dj ) −→ π(xj+1 |Dj+1 ), Hence, two updating formulas must be derived. The first one is based on the ChapmanKolmogorov formula and controls the evolution update: Z π(xj+1 |Dj ) = π(xj+1 |xj , Dj )π(xj |Dj )dxj Z = π(xj+1 |xj )π(xj |Dj )dxj . The second updating formula is obtained by applying the Bayes’ formula and the Monte Carlo approximation and controls the observation update: Z π(xj+1 |Dj+1 ) ∝ π(yj+1 |xj+1 ) π(xj+1 |xj )π(xj |Dj )dxj ∝ π(yj+1 |xj+1 ) N X n=1 3 (10) wjn π(xj+1 |xnj ). Basing on the layered sampling procedure, outlined in [ref], a new proposal x̂nj+1 is drawn from the density π(xj+1 |xnj ), for n = 1, ..., N . After the evaluation of the likelihoods π(yj+1 |x̂nj+1 ) for each proposal particle, the algorithm resamples according to the relative likelihood. A possible consequence of this approach is the thinning of the sample, which is due to the discarding of the particles with the lowest likelihoods, and can be avoided by resorting to the auxiliary particle strategy [ref]. So, we choose as auxiliary particle µnj+1 = xnj+1 for each n, where xnj+1 = Ψ(xnj , h) is the expectation of Xj+1 conditioned that Xj = xnj . In particular, xnj+1 is a predictor of the value of Xj+1 given the initial value xnj . We can now rewrite the updating formula (10) π(xj+1 |Dj+1 ) ∝ N X wjn π(yj+1 |xnj+1 ) n=1 π(yj+1 |xj+1 ) π(xj+1 |xnj ), π(yj+1 |xnj+1 ) n The above equation can be seen as a mixture model, where gj+1 = wjn π(yj+1 |xnj+1 ) is said to be the fitness of the n-th predictor. In the following we are giving the algorithm of PF LMM for state estimation [ref]: Algorithm 3: LMM PF for state estimation Input: π(x0 ) = π(x0 |D0 ) prior distribution. (i) Initialize: Draw the particle sample from π(x0 ), N S0 = {(x10 , w01 ), ..., (xN 0 , w0 )}. Set j = 0; (ii) Propagation: Compute the predictor using LMM, xnj+1 = Ψ(xnj , h), 1 ≤ n ≤ N ; (iii) Survival of the fittest: For each n - Compute the normalized fitness weights: n gj+1 = wjn π(yj+1 |xnj+1 ), n gj+1 n gj+1 ←− P n ; n gj+1 k - Draw indices with replacement ln ∈ {1, ..., N } using probabilities P (ln = k) = gj+1 ; - Reshuffle: xnj ←− xljn , xnj ←− xljn , 1 ≤ n ≤ N. (iv) Innovation: For each n - Using LMM error control, estimate Γnj+1 ; n - Draw vj+1 ∼ N (0, Γnj+1 ); n - Proliferate: xnj+1 = xnj+1 + vj+1 . (v) Weight updating: For each n compute n wj+1 = π(yj+1 |xnj+1 ) , π(yj+1 |xnj+1 ) n wj+1 n wj+1 ←− P n ; n wj+1 (vi) if j < T , set j = j + 1 and repeat from Step 2; otherwise, stop. 4 Output: Sk+1 , k = 0, ..., T − 1. The LMM PF can also face up with parameter estimation problem, as clearly shown in [ref]. Let us have a quick review of the types of errors we are dealing with. First of all, we must consider the error introduced in order to generate the initial particle ensemble S0 , i.e. the initial variance V0 of the prior distribution π0 . Furthermore, at each time instant tj , the variance Vj of the sample Sj and the absolute error Ej can be computed. In particular, denoted with y exact (tj ) the analytical solution of (1) in tj and with y mean (tj ) the mean of the particle ensemble Sj , we have Ej = |y mean (tj ) − y exact (tj )|. The absolute error takes into account the contribution of the global truncation error and of the round off error at each time instant tj . Our aim is to study the behaviour of the variances Vj and of the errors Ej for different values of V0 , when different numerical integration methods are considered. 0.3 Computational experiments The LMM PF is applied to the dynamics of the skeletal muscle metabolism, in order to approximate concentrations of some metabolites in the blood and in the tissue during an episode of ischemia; 30 out of 39 are concentrations of metabolites in the tissue. The data consist of noisy observations of eight metabolites in the blood, which are glucose, lactate, alanine, triglyceride, glycerine, free fatty acid, carbon dioxide, and oxygen. The measurements are collected at 11 time instants. It is worth doing some considerations about the nuemrical results. At first, we choose the method BDF1 of order p = 1 to propagate the particle ensemble, and the method BDF2 to get an estimate of the error. In Figure 1, the black solid line represents the approximated solution, while the blue solid line represents the real behavior of the metabolite taken into account. The red solid line describes the evolution of the absolute error, that is the difference between the approximated and the real concentration for each metabolite. We can observe that the error presents an edge corresponding to the most complex dynamical phase. Moreover, in the second half of the time interval the red line increases significantly. This could be due to an accumulation of the error, which is reasonable since the system is studied over a very large time interval. Let us try and consider more accurate integration methods, such as BDF3 of order p = 3 to propagate the particle ensemble, and BFD4 to get an estimate of the error (Figure 2). Although the error significantly decreases, it presents an increasing tendency towards the end of the time interval. Enlarging the observation time interval, it could be possible to observe a progressive separation between the blue and the black line, which is not reasonable comparing to the smoothness of the dynamic. It is worth emphasizing that the real solution of the ODEs system governing the problem is not known. The blue solid line is obtained by integrating the system with ode15s, which is a variable order solver usually used to deal with stiff problems, such as in this case. Therefore, the accumulation of the error could be due to the usage of three numerical solvers. To investigate the nature of the error, we apply the LMM PF to a test problem whose analytic solution is known. This allows us to avoid a possible source of error. We start by considering a 5 Figure 1: Computed concentrations of succinate, fatty acyl-CoA and NAD reduced compared with their respective errors (BDF1-BDF2). 6 Figure 2: Computed concentrations of succinate, fatty acyl-CoA and NAD reduced compared with their respective errors (BDF3-BDF4). 7 Figure 3: Computed result of (11) compared with the respective error (AB1-AB2). very smooth problem: x0 (t) = cos2 (t), x(0) = 1, (11) where x(t) = arctg(t). We need to set the number Nsample of particles, the variance V of the initial set of particles and the discretization step dt: Nsample=150; V=0.1; dt=0.1; We choose the Adams-Bashforth method of order p = 1 to propagate the particle ensemble, and the Adams-Bashforth method of order p = 2 to get an estimate of the error. The error curve presents a reasonable edge corresponding to the increasing dynamical phase. Then, it does not increase anymore. The LMM PF algorithm does not worsen the stability of the numerical method chosen. Let us consider a less smooth problem, such as x0 (t) = −2(t − 1)x, x(0) = 1, t ∈ [0, 5], (12) where x(t) = e−t(t−2) . We are going to compute the solution for V=0.1,0.01,0.001,0.0001 when different integration methods are considered. The numerical results are compared in terms of the absolute error and of the sample variance at each time instant. In the following experiments the discretization step and the number of particles are fixed as before: Nsample=150; dt=0.1; 8 Figure 4: Numerical results computed with AB12 (left) and AB34 (right) for V = 0.1. Figure 5: Numerical results computed with AB12 (left) and AB34 (right) for V = 0.0001. We considered explicit and implicit linear multistep methods, such as Adams-Bashforth methods and Adams-Moulton methods. In particular, the adopted pair are AB1-AB2, AB3-AB4, AM1AM2, AM3-AM4. In Figure 4 and Figure 5, numerical results obtained with AB12 and AB34 respectively for V=0.1 and V=0.0001 are compared. Observe that the choice of a higher order method does not lead to a greater accuracy in the final solution. This is due to a reduction of the stability regions. An improvement could be observed decreasing h. The same issue occurs when considering the implicit pairs AM1-AM2 and AM3-AM4 (Figure 6, Figure 7). Table 1-4 emphasize the worsening in the accuracy, by showing the norm of the absolute error vector and of the variance vector for the above mentioned linear multistep method when different values of the initial variance V are chosen. Furthermore, as we would expect, the choice of implicit methods rather than the explicit ones ensures an higher accuracy. As the initial variance V decreases, the distance of the generic particle of the sample from 9 Figure 6: Numerical results computed with AM12 (left) and AM34 (right) for V = 0.1. Figure 7: Numerical results computed with AM12 (left) and AM34 (right) for V = 0.0001. Method AB1 − AB2 AB3 − AB4 AM 1 − AM 2 AM 3 − AM 4 Absolute error (k·k∞ ) 0, 4292 0, 6795 0, 2265 0, 5728 Sample variance (k·k2 ) 0, 1015 0, 1011 0, 1011 0, 1005 Table 1: Numerical results for V=0.1 10 Method (V=0.01) AB1 − AB2 AB3 − AB4 AM 1 − AM 2 AM 3 − AM 4 Absolute error (k·k∞ ) 0, 3724 0, 6142 0, 1545 0, 5030 Sample variance (k·k2 ) 0, 0218 0, 0127 0, 0181 0, 0172 Table 2: Numerical results for V=0.01 Method (V=0.001) AB1 − AB2 AB3 − AB4 AM 1 − AM 2 AM 3 − AM 4 Absolute error (k·k∞ ) 0, 1216 0, 3645 0, 1132 0, 2873 Sample variance (k·k2 ) 0, 0107 0, 0067 0, 0061 0, 0044 Table 3: Numerical results for V=0.001 the sample mean decreases too, i.e. the LMM PF is more precise. Let us now test the Runge-Kutta integration class method on (12). It is worth remarking that, as the order of the RK method increases, the stability region enlarges. Hence, we can consider RK methods of order p ≥ 3 without worrying about the stability properties of the final solution and we can consider a larger integration time interval, such as [0, 10]. In the following, numerical results obtained with RK12 and RK45 for different values of V are compared. Let us emphasize that a better accuracy has been obtained without changing the integration step dt=0.1, that means that the integration time does not significantly increases. Moreover, fixing an admissible upper bound for the error, we can choose a not very accurate solver and a low initial variance, or a more accurate solver and a higher initial variance, i.e. we do not need to sample as better as possible at the initial time t0 . Method (V=0.0001) AB1 − AB2 AB3 − AB4 AM 1 − AM 2 AM 3 − AM 4 Absolute error (k·k∞ ) 0, 1140 0, 2484 0, 0681 0, 2282 Sample variance (k·k2 ) 0, 0059 0, 0031 0, 0014 0, 0017 Table 4: Numerical results for V=0.0001 11 Figure 8: Numerical results computed with RK12 (left) and RK45 (right) for V = 0.1. Figure 9: Numerical results computed with RK12 (left) and RK45 (right) for V = 0.0001. Method (V=0.1) RK1 − RK2 RK4 − RK5 Absolute error (k·k∞ ) 0, 3337 0, 2596 Sample variance (k·k2 ) 0, 1024 0, 1014 Table 5: Numerical results for V=0.1 Method (V=0.01) RK1 − RK2 RK4 − RK5 Absolute error (k·k∞ ) 0, 3303 0, 2862 Sample variance (k·k2 ) 0, 0180 0, 0152 Table 6: Numerical results for V=0.01 Method (V=0.001) RK1 − RK2 RK4 − RK5 Absolute error (k·k∞ ) 0, 1574 0, 1488 Sample variance (k·k2 ) 0, 0088 0, 0077 Table 7: Numerical results for V=0.001 12 Method (V=0.0001) RK1 − RK2 RK4 − RK5 Absolute error (k·k∞ ) 0, 1418 0, 0267 Sample variance (k·k2 ) 0, 0035 0, 0023 Table 8: Numerical results for V=0.0001 13 Bibliography [1] D. CALVETTI, E. SOMERSALO, An Introduction to Bayesian Scientific Computing: ten Lectures on Subjective Computing, Springer, 2007. [2] A. ARNOLD, Sequential Monte Carlo parameter estimation for differential equations, Case Western Reserve University, 2014. [3] A. ARNOLD, D. CALVETTI, E. SOMERSALO, i, IOP publishing, 2014. [4] A. ARNOLD, D. CALVETTI, E. SOMERSALO, Parameter estimation for stiff deterministic dynamical systems via ensemble Kalman filter 14
10math.ST
INSTITUT NATIONAL DE RECHERCHE EN INFORMATIQUE ET EN AUTOMATIQUE Pierre Genevès — Nabil Layaïda N° 6726 February 18, 2018 apport de recherche ISRN INRIA/RR--6726--FR+ENG Thème SYM ISSN 0249-6399 arXiv:0812.3550v1 [cs.PL] 18 Dec 2008 XML Static Analyzer User Manual XML Static Analyzer User Manual Pierre Genevès∗ , Nabil Layaı̈da Thème SYM — Systèmes symboliques Équipes-Projets Wam Rapport de recherche n° 6726 — February 18, 2018 — 17 pages Abstract: This manual provides documentation for using the logical solver introduced in [Genevès, 2006; Genevès et al., 2007]. Key-words: Static Analysis, Logic, Satisfiability Solver, XML, Schema, XPath, Queries ∗ CNRS Centre de recherche INRIA Grenoble – Rhône-Alpes 655, avenue de l’Europe, 38334 Montbonnot Saint Ismier Téléphone : +33 4 76 61 52 00 — Télécopie +33 4 76 61 52 52 Analyseur Statique pour XML et XPath: Manuel Utilisateur Résumé : Ce manuel documente l’utilisation du solveur logique décrit dans[Genevès, 2006; Genevès et al., 2007]. Mots-clés : Analyse Statique, Logique, Solveur, Satisfaisabilité, XML, Schema, Requêtes, XPath XML Reasoning Solver User Manual 1 3 Introduction This document describes the logical solver introduced in [Genevès, 2006; Genevès et al., 2007] and provides informal documentation for using its implementation. The solver allows automated verification of properties that are expressed as logical formulas over trees. A logical formula may for instance express structural constraints or navigation properties (like e.g. path existence and node selection) in finite trees. A decision procedure for a logic traditionally defines a partition of the set of logical formulas: formulas which are satisfiable (there is a tree which satisfies the formula) and remaining formulas which are unsatisfiable (no tree satisfies the given formula). Alternatively (and equivalently), formulas can be divided into valid formulas (formulas which are satisfied by all trees) and invalid formulas (formulas that are not satisfied by at least one tree). The solver is a satisfiabilitytesting solver: it allows checking satisfiability (or unsatisfiability) of a given logical formula. Note that validity of a formula ϕ can be checked by testing ¬ϕ for unsatisfiability. The solver can be used for reasoning over finite ordered trees whatever these trees do actually represent. In particular, the logic and the solver are specifically adapted for formulating and solving problems over XML tree structures [Bray et al., 2004]. The logic can express navigational properties like those expressed with the XPath standard language [Clark and DeRose, 1999] for navigating and selecting sets of nodes from XML trees. Additionally, the logic is expressive enough to encode any regular tree language property (it subsumes finite tree automata). It can encode constraints definable with common XML tree type definition languages (such as DTD [Bray et al., 2004], XML Schema [Fallside and Walmsley, 2004], and Relax NG [Clark and Murata, 2001]). The logic provides high-level constructs specifically designed for reasoning directly with such XML concepts: the user can directly write an expression using XPath notation in the logic, or even refer to an XML type in the logic. These characteristics make the system especially useful for solving problems like those encountered in the static analysis of XML code, static verification of XML access control policies, XML data security checking, XML query optimization, and the construction of static type-checkers, and optimizing compilers for a wide variety of tree-manipulating programs and XML processors. Outline This user manual is organized as follows: Section 2 describes the basics for using the solver without requiring any logical knowledge; Section 3 gives some insights on the logic, especially on the simple yet general data tree model used by the logic (Section 3.1) and on the syntax of logical formulas (Section 3.2) including high-level constructs for embedding XPath expressions and XML tree types directly in the logic. Finally, Section 4 provides an overview of the background theory underlying the logic and its solver, with related references. 2 Getting Started with XML Applications The logical solver is shipped as a compressed file which, once extracted, provides binaries along with all required libraries. The “solver.jar” executable file RR n° 6726 4 Genevès, Layaı̈da, & Quint takes a filename as a parameter1 . The filename refers to a text file containing the logical formula to solve. For example, provided a recent2 Java runtime engine is installed, the following command line: java -jar solver.jar formula.txt runs the solver on the logical formula contained in “formula.txt”. The full syntax of logical formulas is given in Section 3.2. The following examples introduce the logical formulation of some simple yet fundamental XML problems, and how the solver output should be interpreted. Example 1: emptiness test for an XPath expression. The most basic decision problem for a query language is the emptiness test of an expression: whether or not a query is self contradictory and always yields an empty result. This test is important for error-detection and optimization of host languages implementations, i.e. implementations that process languages in which XPath expressions are used. For instance, if one can decide at compile time that a query result is empty then subsequent bound computations can be ignored. For checking emptiness of the XPath expression a/b[following-sibling::c/parent::d], the contents of the “example1.txt” file simply consists of the following line: example1.txt select("a/b[following-sibling::c/parent::d]") Running the solver with “ example1.txt” as parameter yields the following trace: Output for example1.txt Reading example1.txt Satisfiability Tested Formula: (mu X5.(((b & (mu X2.(<-1>(a & (mu X1.(<-1>T | <-2>X1))) | <-2>X2))) & (mu X4.(<2>((mu X3.(<-1>d | <-2>X3)) & c) | <2>X4)))|(<1>X5|<2>X5))) Computing Relevant Closure Computed Relevant Closure [1 ms]. Computed Lean [1 ms]. Lean size is 20. It contains 14 eventualities and 6 symbols. Computing Fixpoint.....[4 ms]. Formula is unsatisfiable [14 ms]. The input XPath expression is first parsed and compiled into the logic. The corresponding logical translation whose satisfiability is going to be tested is printed. The solver then computes the Fisher-Ladner closure and the Lean of the formula: the set of all basic subformulas that notably defines the search space that is going to be explored by the solver (see [Genevès et al., 2007] for details). The solver attempts to build a satisfying tree in a bottom-up way, in the manner of a fixpoint computation that iteratively updates a set of tree 1 Running the command “java -jar solver.jar” prints the list of required and optional arguments. 2 A Java virtual machine version 1.5.0 (or further) and a Java compiler compliance level version 5.0 (or further). INRIA XML Reasoning Solver User Manual 5 nodes. This computation is performed in at most 2O(n) steps with respect to size n of the Lean. In this example, no satisfying tree is found: the formula is unsatisfiable (in other terms, no matter on which XML document this XPath expression is evaluated, it will always yield an empty result). Intuitively, that is because this XPath expression contains a contradiction: according to the query, the same node is required to be named both “a” and “d”, which is not allowed for an XML tree. Empty queries often come from the use of an XPath expression in a constrained setting. The combination of navigational information of the query and structural constraints imposed by a DTD (or XML Schema) may rapidly yield contradictions. Such contradictions can also be detected by checking a logical formula for satisfiability. Example 2: checking XPath emptiness in the presence of tree constraints. Suppose we want to check emptiness of the XPath expression descendant::switch[ancestor::head]/descendant::seq/ descendant::audio[preceding-sibling::video] over the set of documents defined by the DTD of the SMIL language [Hoschka, 1998]. The following formula is used: example2.txt select("descendant::switch[ancestor::head]/descendant::seq/ descendant::audio[preceding-sibling::video]", type("sampleDTDs/smil.dtd", "smil")) The first argument for the predicate type() is a path to the DTD file (here the DTD is assumed to be located in a subdirectory called “sampleDTDs”), and the second argument is the name of the element to be considered as top-level start symbol. Running the solver with this “example2.txt” file as parameter yields the following trace: Output for example2.txt Reading example2.txt Converted tree grammar into BTT [169 ms]. Translated BTT into Tree Logic [60 ms]. Satisfiability Tested Formula: (mu X22.(((audio & (mu X20.(<-1>((seq & (mu X19.(<-1>(((switch & (mu X17.(<-1>( (let_mu X1=(((meta & ~(<1>T)) & ~(<2>T)) | ((meta & ~(<1>T)) & <2>X1)), ... X16=((smil & (~(<1>T) | <1>X15)) & ~(<2>T)) in X16) | X17) | <-2>X17))) & (mu X18.(<-1>(head | X18) | <-2>X18))) | X19) | <-2>X19))) | X20) | <-2>X20))) & (mu X21.(<-2>video | <-2>X21))) | (<1>X22 | <2>X22))) Computing Relevant Closure Computed Relevant Closure [39 ms]. RR n° 6726 6 Genevès, Layaı̈da, & Quint Computed Lean [1 ms]. Lean size is 50. It contains 31 eventualities and 19 symbols. Computing Fixpoint......[37 ms]. Formula is satisfiable [99 ms]. A satisfying finite binary tree model was found [52 ms]: smil(head(switch(seq(video(#, audio), layout), meta), #), #) In XML syntax: <smil xmlns:solver="http://wam.inrialpes.fr/xml" solver:context="true"> <head> <switch> <seq> <video/> <audio solver:target="true"/> </seq> <layout/> </switch> <meta/> </head> </smil> The referred external DTD (tree grammar) is first parsed, converted into an internal representation on binary trees (called “BTT” and that corresponds to the mapping described in 3.1), and then compiled into the logic. The XPath expression is also parsed and compiled into the logic so that the global formula can be composed. In that case, the formula is satisfiable (the XPath expression is non-empty in the presence of this DTD). The solver outputs a sample tree for which the formulas is satisfied. This sample tree is enriched with specific attributes: the “solver:target” attribute marks a sample node selected by the XPath expression when evaluated from a node marked with “solver:context”. Example 3: checking containment and equivalence between XPath expressions. One of the most essential problem for a query language is the containment problem: whether or not the result of one query is always included into the result of another one. Containment for XPath expressions is for instance needed for the static type-checking of XPath queries, for the control-flow analysis of XSLT [Clark, 1999], for checking integrity constraints in XML databases, for XML data security... Suppose for instance that we want to check containment between the following XPath expressions: descendant::d[parent::b]/following-sibling::a and: ancestor-or-self::*/descendant-or-self::b/a[preceding-sibling::d] Since containment corresponds to logical implication, we actually want to check whether the implication of the two corresponding formulas is valid. Since we use a satisfiability-testing algorithm, we verify this validity by checking for the unsatisfiability of the negated implication, as follows: INRIA XML Reasoning Solver User Manual 7 example3.txt ~( select("descendant::d[parent::b]/following-sibling::a",#) => select("ancestor-or-self::*/descendant-or-self::b /a[preceding-sibling::d]",#)) Note that XPath expressions must be compared from the same evaluation context, which can be any set of nodes, but should be the same set of nodes for both expressions. This is denoted by “#”. Running the solver with this “example3.txt” file results in the following trace: Output for example3.txt Reading example3.txt Satisfiability Tested Formula: (mu X26.(((a & (mu X15.((<-2>T & (~(<-2>T) | <-2>((d & (mu X13.((<-1>T & (~(<-1>T) | <-1>(_context | X13))) | (<-2>T & (~(<-2>T) | <-2>X13))))) & (mu X14.((<-1>T & (~(<-1>T) | <-1>b)) | (<-2>T & (~(<-2>T) | <-2>X14))))))) | (<-2>T & (~(<-2>T) | <-2>X15))))) & ((~(a) | (mu X22.((~(<-1>T) | <-1>(~(b) | ((~(_context) & (~(<1>T) | <1>(mu X18.((~(_context) & (~(<1>T) | <1>X18)) & (~(<2>T) | <2>X18))))) & (mu X20.((~(<-1>T) | <-1>((~(_context) & (~(<1>T) | <1>(mu X19.((~(_context) & (~(<1>T) | <1>X19)) & (~(<2>T) | <2>X19))))) & X20)) & (~(<-2>T) | <-2>X20)))))) &(~(<-2>T) | <-2>X22)))) | (mu X25.((~(<-2>T) | <-2>~(d)) & (~(<-2>T) | <-2>X25))))) | (<1>X26 | <2>X26))) Computing Relevant Closure Computed Relevant Closure [4 ms]. Computed Lean [1 ms]. Lean size is 29. It contains 23 eventualities and 6 symbols. Computing Fixpoint.....[8 ms]. Formula is unsatisfiable [22 ms]. The tested formula is unsatisfiable (in other terms: the implication is valid), so one can conclude that the first XPath expression is contained in the second XPath expression. A related decision problem is the equivalence problem: whether or not two queries always return the same result. It is important for reformulation and optimization of an expression, which aims at enforcing operational properties while preserving semantic equivalence. Equivalence is reducible to containment (bi-implication) and is noted <=> in the logic. Note that the previous XPath expressions are not equivalent. The reader may check this by using the solver, that will generate the following counter-example tree: <b xmlns:solver="http://wam.inrialpes.fr/xml"> <d/> <a solver:context="true" solver:target="true"/> </b> RR n° 6726 8 Genevès, Layaı̈da, & Quint 3 Logical Insights 3.1 Data Model for the Logic An XML document is considered as a finite tree of unbounded depth and arity, with two kinds of nodes respectively named elements and attributes. In such a tree, an element may have any number of children elements, and may carry zero, one or more attributes. Attributes are leaves. Elements are ordered whereas attributes are not, as illustrated on Figure 1. The logic allows reasoning on such trees. Notice that from an XML perspective, data values are ignored. <r c=" " a=" " b=" "> <s d=" "> <v/><w/><x e=" "/> </s> <t/> <u/> </r> XML Notation a s v b r d u t w c x e Figure 1: Sample XML Tree with Attributes. Unranked and Binary Trees There are bijective encodings between unranked trees (trees of unbounded arity) and binary trees. Owing to these encodings binary trees may be used instead of unranked trees without loss of generality. The logic operates on binary trees. The logic relies on the “firstchild & next-sibling” encoding of unranked trees. In this encoding, the first child of a node is preserved in the binary tree representation, whereas siblings of this node are appended as right successors in the binary representation. The intuition of this encoding is illustrated on Figure 2 for a sample tree. Trees can be seen as terms or function calls. More formally, a binary tree t can 0 0 1 2 1 2 3 3 Figure 2: Binary Encoding Principle. INRIA XML Reasoning Solver User Manual 9 a b r d c s v t w u e x Figure 3: Binary Encoding of Tree of Figure 1. be defined by the recursive syntax t ::= σ(t, t0 ) |  where σ is a node label and  denotes the empty tree. Similarly unranked trees can be defined as t ::= σ(h) where h is a hedge (a sequence of unranked trees) defined as h ::= σ(h), h0 | . The function f that translates unranked trees into binary trees is then defined by f (σ(h), h0 ) = σ(f (h), f (h0 )) and f () = . The reverse mapping used for reconstructing unranked trees from binary trees can be expressed as: f −1 (σ(t, t0 )) = σ(f −1 (t)), f −1 (t0 ) and f −1 () = . In the remaining part of this manual, the binary representation of a tree is implicitly considered, unless stated otherwise. From an XML point of view, notice that only the nested structure of XML elements (which are ordered) is encoded into binary form like this. XML attributes (which are unordered) are left unchanged by this encoding. For instance, Figure 3 presents how the sample tree of Figure 1 is mapped. 3.2 Syntax of Logical Formulas Modal Formulas for Navigating in Trees The logic uses two programs for navigating in binary trees: the program 1 allows to navigate from a node down to its first successor and the program 2 for navigating from a node down to its second successor. The logic also features converse programs -1 and -2 for navigating upward in binary trees, respectively from the first and second successors to the parent node. Some basic logical formulas together with corresponding satisfying binary trees are shown on Table 1. When using XPath expressions, like e.g. select("a[b]"), the XPath expression is automatically compiled into a logical formula over the binary tree representation (see Section 3.2). The set of logical formulas is defined by the syntax given on Figure 4, where the meta-syntax hXi means one or more occurences of X separated by commas. Models of a formula are finite binary trees for which the formula is satisfied at some node. The semantics of logical formulas is formally defined in [Genevès, 2006; Genevès et al., 2007]. Table 1 gives basic formulas that use modalities for navigating in binary trees and node names. Recursive Formulas The logic allows expressing recursion in trees through the use of a fixpoint operator. For example the recursive formula: RR n° 6726 10 Genevès, Layaı̈da, & Quint Sample Formula Satisfying Binary Tree a b a & <1>b XML syntax <a><b/></a> a b a & <2>b <a/><b/> a b c a & <1>(b & <2>c) <a><b/><c/></a> d e & <-1>(d & <2>g) f & <-2>(g & ~<2>T) g e none <d><e/></d><g/> none Table 1: Sample Formulas using Modalities. ϕ ::= p formula T true | F false | l element name | p atomic proposition | # start context | ϕ|ϕ disjunction | ϕ&ϕ conjunction | ϕ => ϕ implication | ϕ <=> ϕ equivalence | (ϕ) parenthesized formula | ˜ϕ negation | <p>ϕ existential modality | <l>T attribute named l | $X variable | let h$X = ϕi in ϕ binder for recursion | predicate predicate (See Figure 5) ::= program inside modalities 1 first child | 2 next sibling | -1 parent | -2 previous sibling Figure 4: Syntax of Logical Formulas. INRIA XML Reasoning Solver User Manual 11 let $X = b | <2>$X in $X means that either the current node is named b or there is a sibling of the current node which is named b. For this purpose, the variable $X is bound to the subformula b | <2>$X which contains an occurence of $X (therefore defining the recursion). The scope of this binding is the subformula that follows the “in” symbol of the formula, that is $X. The entire formula can thus be seen as a compact recursive notation for a infinitely nested formula of the form: b | <2>(b | <2>(b | <2>(...))) Recursion allows expressing global properties. For instance, the recursive formula: ~ let $X = a | <1>$X | <2>$X in $X expresses the absence of nodes named a in the whole subtree of the current node (including the current node). Furthermore, the fixpoint operator makes possible to bind several variables at a time, which is specifically useful for expressing mutual recursion. For example, the mutually recursive formula: let $X = (a & <2>$Y) | <1>$X | <2>$X, $Y = b | <2>$Y in $X asserts that there is a node somewhere in the subtree such that this node is named a and it has at least one sibling which is named b. Binding several variables at a time provides a very expressive yet succinct notation for expressing mutually recursive structural patterns (that may occur in DTDs for instance). The combination of modalities and recursion makes the logic one of the most expressive (yet decidable) logic known. For instance, regular tree grammars can be expressed with the logic using recursion and (forward) modalities. The combination of converse programs and recursion allows expressing properties about ancestors of a node for instance. The possibility of nesting recursive formulas allow XPath expressions to be translated into the logic. Cycle-Freeness Restriction There is a restriction on the use of recursive formulas. Only formulas that are cycle-free are allowed. Intuitively a formula is cycle-free if it does not contain both a program and its converse inside the same recursion. For instance, the formula let $X = a | <-1>$X | <1>$X in $X is not cycle-free since 1 and -1 occur in front of the same variable bound by the same binder. A formula is cycle-free if one cannot find both a program and its converse by starting from a variable and going up in the formula tree to the binder of this variable. For instance, the following formula is cycle-free: let $X = a & (let $X = b | <1>$X in $X) | <-1>$X in $X since variable binders are properly nested and a program and its converse never appear in front of the same variable bound by the same binder. Translations of XPath expressions and XML tree types into the logic always generate cycle-free formulas, whatever the translated XPath or XML type is. The cycle-freeness restriction only matters when one directly writes recursive logical formulas. From a theoretical perspective the cycle-freeness restriction RR n° 6726 12 Genevès, Layaı̈da, & Quint predicate ::= | | | select("query") select("query", ϕ) exists("query") exists("query", ϕ) | | | | type("f ", l) type("f ", l, ϕ, ϕ0 ) forward incompatible(ϕ, ϕ0 ) backward incompatible(ϕ, ϕ0 ) | | | | | | element(ϕ) attribute(ϕ) descendant(ϕ) exclude(ϕ) added element(ϕ, ϕ0 ) added attribute(ϕ, ϕ0 ) | | | | | non empty("query", ϕ) new element name("query", "f ", "f 0 ", l) new region("query", "f ", "f 0 ", l) new content("query", "f ", "f 0 ", l) predicate-name(hϕi ) Figure 5: Syntax of Predicates for XML Reasoning. spec ::= def | ::= | ϕ def ; ϕ predicate-name(hli ) = ϕ0 def ; def formula (see Fig. 4) custom definition list of definitions Figure 6: Global Syntax for Specifying Problems. comes from the fact that converse programs may interact with recursion in a subtle manner such that the finite model property is lost, so the cycle-freeness restriction ensures that the negation of every formula can also be expressed in the logic, or in other terms, that the logic is closed under negation and all other boolean operations (a detailed discussion on this topic can be found in [Genevès et al., 2007]). Supported XPath Expressions The logic provides high-level constructions for facilitating the formulation of problems involving XPath expressions. The construct select(”e”, ϕ) where e is an XPath expression provides a way of embedding XPath expression directly into the logic (e is automatically compiled INRIA XML Reasoning Solver User Manual 13 query ::= /path absolute path | path relative path | query | query union | query ∩ query intersection path ::= path/path path composition | path[qualifier] qualified path | a::nt step qualifier ::= qualifier and qualifier conjunction | qualifier or qualifier disjunction | not(qualifier) negation | path path | path/@nt attribute path | @nt attribute step nt ::= node test σ node label | ∗ any node label a ::= tree navigation axis self | child | parent | descendant | ancestor | descendant-or-self | ancestor-or-self | following-sibling | preceding-sibling | following | preceding Figure 7: XPath Expressions. into a logical formula, see [Genevès et al., 2007] for details on the compilation technique). The second parameter ϕ denotes the context from which the XPath is applied; it can be any formula. The other construct select(”e”) is simply a shorthand for select(”e”, #), where # is the initial context node mark. The syntax of supported XPath expressions is given on Figure 7. We observed that, in practice, many XPath expressions contain syntactic sugars that can also fit into this fragment. Figure 8 presents how our XPath parser rewrites some commonly found XPath patterns into the fragment of Figure 7, where the notation (a::nt)k stands for the composition of k successive path steps of the same form: a::nt/.../a::nt . {z } | k steps Supported XML Types The logic is expressive enough to allow for the encoding of any regular tree grammar. The logical construction type("filename", start) provides a convenient way of referring to tree grammars written in usual notations like DTD, XML Schema, or Relax NG. The referred tree type is automatically parsed and compiled into the logic, starting from the given start symbol (which can be the root symbol or any other symbol defined by the tree type). RR n° 6726 14 Genevès, Layaı̈da, & Quint nt[position() = 1] nt[not(preceding-sibling::nt)] nt[position() = last()] nt[not(following-sibling::nt)] nt[position() = |{z} k ] nt[(preceding-sibling::nt)k−1 ] k>1 count(path) = 0 not(path) count(path) > 0 path count(nt) > |{z} k nt/(following-sibling::nt)k k>0 preceding-sibling::∗[position() = last() and qualifier] preceding-sibling::∗[not(preceding-sibling::∗) and qualifier] Figure 8: Syntactic Sugars and their Rewritings. 3.3 Predicates We build on the aforementioned query and schema compilers, and define additional predicates that facilitate the formulation of decision problems at a higher level of abstraction. Specifically, these predicates are introduced as logical macros with the goal of allowing system usage while focusing (only) on the XML-side properties, and keeping underlying logical issues transparent for the user. Ultimately, we regard the set of basic logical formulas (such as modalities and recursive binders) as an assembly language, to which predicates are translated. Some built-in predicates include: ˆ .... ˆ the predicate exclude(ϕ) which is satisfiable iff there is no node that satisfies ϕ in the whole tree. This predicate can be used for excluding specific element names or even nodes selected by a given XPath expression. ˆ the predicate element(T ) builds the disjunction of all element names occuring in T . ˆ the predicate descendant(ϕ) forces the existence of a node satisfying ϕ in the subtree, and predicate-name(hϕi ) is a call to a custom predicate, as explained in the next section. 3.4 Custom Predicates Following the spirit of predicates presented in the previous section, users may also define their own custom predicates. The full syntax of XML logical specifications to be used with the system is defined on Figure 6, where the meta-syntax hXi means one or more occurrence of X separated by commas. A global problem specification can be any formula (as defined on Figure 4), or a list of custom predicate definitions separated by semicolons and followed by a formula. A custom predicate may have parameters that are instanciated with actual formulas INRIA XML Reasoning Solver User Manual 15 when the custom predicate is called (as shown on Figure 5). A formula bound to a custom predicate may include calls to other predicates, but not to the currently defined predicate (recursive definitions must be made through the let binder shown on Figure 4). 4 Overview of the Background Theory The logic and its solver are formally described in [Genevès, 2006; Genevès et al., 2007]. The logic is a modal logic of trees, more specifically an alternation-free µ-calculus with converse for finite trees. The logic is equipped with forward and backward modalities, which are notably useful for capturing all XPath (including reverse) axes. The logic is also equipped with a fixed-point operator for expressing recursion in finite trees. A n-ary fixed-point operator is also provided so that mutual recursion occurring in XML types can be succintly expressed in the logic. The logic is also able to express any propositional property, for instance about nodes labels (XML element and attribute names). Last but not least, the logic is closed under negation [Genevès, 2006; Genevès et al., 2007], that is, the negation of any logical formula can be expressed in the logic too (this property is essential for checking XPath containment which corresponds to logical implication). All these features together: propositions, forward and backward modalities, recursion (fixed-points operators), and boolean connectives yield a logic of very high expressive power. Actually, this logic is one of the most expressive yet decidable known logic. It can express properties of regular tree languages. Specifically, it is as expressive as tree automata (which notably provide the foundation for the Relax NG language in the XML world) and monadic second-order logic of finite trees (often referred as WS2S or “MSO” in the literature) [Thatcher and Wright, 1968; Doner, 1970]. However, the logical solver is considerably (orders of magnitude) faster than solvers for monadic second-order logic, like e.g., the MONA solver [Klarlund et al., 2001] (the MONA solver nevertheless remains useful when one wants to write logical formulas using MSO syntax). Technically, the truth status of a logical formula (satisfiable or unsatisfiable) is automatically determined in exponential time, and more specifically in time 2O(n) where n is proportional to (and smaller than) the size of the logical formula [Genevès, 2006; Genevès et al., 2007]. In comparison, the complexity of monadic second-order logic is much higher: it was proved in the late 1960s that the best decision procedure for monadic second order logic is at least hyper-exponential in the size of the formula [Thatcher and Wright, 1968; Doner, 1970] that is, not bounded by any stack of exponentials. The tree logic described in this document currently offers the best balance known between expressivity and complexity for decidability. The acute reader may notice that the complexity of the logic is optimal since it subsumes tree automata and less expressive logics such as CTL [Clarke and Emerson, 1981], for instance. XPath expressions and regular tree types can be linearly translated into the logic. This observation allows to generalize the complexity of the algorithm for solving the logic to a wide range of problems in the XML world. The decision procedure for the logic is based on an inverse tableau method that searches for a satisfying tree. The algorithm has been proved sound and complete in [Genevès, 2006; Genevès et al., 2007]. The solver is implemented RR n° 6726 16 Genevès, Layaı̈da, & Quint using symbolic techniques like binary decision diagrams (BDDs) [Bryant, 1986]. It also uses numerous optimization techniques such as on-the-fly formula normalization and simplification, conjunctive partitioning, early quantification. Finally, another benefit of this method (illustrated in Section 2) is that the solver can be used to generate an example (or counter-example) XML tree for a given property, which allows for instance to reproduce a program’s bug in the developer environment, independently from the logical solver. References [Bray et al., 2004] Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve Maler, and François Yergeau. Extensible markup language (XML) 1.0 (third edition), W3C recommendation, February 2004. http://www.w3.org/TR/2004/RECxml-20040204/. [Bryant, 1986] Randal E. Bryant. Graph-based algorithms for boolean function manipulation. IEEE Transactions on Computers, 35(8):677–691, 1986. [Clark and DeRose, 1999] James Clark and Steve DeRose. XML path language (XPath) version 1.0, W3C recommendation, November 1999. http://www.w3.org/TR/ 1999/REC-xpath-19991116. [Clark and Murata, 2001] James Clark and Makoto Murata. RELAX NG specification, OASIS committee specification, December 2001. http://relaxng.org/spec-20011203.html. [Clark, 1999] James Clark. XSL transformations (XSLT) version 1.0, W3C recommendation, November 1999. http://www.w3.org/TR/1999/REC-xslt19991116. [Clarke and Emerson, 1981] Edmund M. Clarke and E. Allen Emerson. Design and synthesis of synchronization skeletons using branching-time temporal logic. In Logic of Programs, Workshop, volume 131 of LNCS, pages 52–71, London, UK, 1981. Springer-Verlag. [Doner, 1970] John Doner. Tree acceptors and some of their applications. Journal of Computer and System Sciences, 4:406–451, 1970. [Fallside and Walmsley, 2004] David C. Fallside and Priscilla Walmsley. XML Schema part 0: Primer second edition, W3C recommendation, October 2004. http://www.w3.org/TR/xmlschema-0/. [Genevès et al., 2007] Pierre Genevès, Nabil Layaı̈da, and Alan Schmitt. Efficient static analysis of XML paths and types. In PLDI ’07: Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 342–351, New York, NY, USA, 2007. ACM Press. [Genevès, 2006] Pierre Genevès. Logics for XML. PhD thesis, Institut National Polytechnique de Grenoble, December 2006. http://www.pierresoft.com/pierre.geneves/phd.htm. INRIA XML Reasoning Solver User Manual 17 [Hoschka, 1998] Philipp Hoschka. Synchronized multimedia integration language (SMIL) 1.0 specification, W3C recommendation, June 1998. http://www.w3.org/TR/REC-smil/. [Klarlund et al., 2001] Nils Klarlund, Anders Møller, and Michael Schwartzbach. MONA 1.4, January 2001. http://www.brics.dk/mona/. I. [Thatcher and Wright, 1968] James W. Thatcher and Jesse B. Wright. Generalized finite automata theory with an application to a decision problem of second-order logic. Mathematical Systems Theory, 2(1):57–81, 1968. RR n° 6726 Centre de recherche INRIA Grenoble – Rhône-Alpes 655, avenue de l’Europe - 38334 Montbonnot Saint-Ismier (France) Centre de recherche INRIA Bordeaux – Sud Ouest : Domaine Universitaire - 351, cours de la Libération - 33405 Talence Cedex Centre de recherche INRIA Lille – Nord Europe : Parc Scientifique de la Haute Borne - 40, avenue Halley - 59650 Villeneuve d’Ascq Centre de recherche INRIA Nancy – Grand Est : LORIA, Technopôle de Nancy-Brabois - Campus scientifique 615, rue du Jardin Botanique - BP 101 - 54602 Villers-lès-Nancy Cedex Centre de recherche INRIA Paris – Rocquencourt : Domaine de Voluceau - Rocquencourt - BP 105 - 78153 Le Chesnay Cedex Centre de recherche INRIA Rennes – Bretagne Atlantique : IRISA, Campus universitaire de Beaulieu - 35042 Rennes Cedex Centre de recherche INRIA Saclay – Île-de-France : Parc Orsay Université - ZAC des Vignes : 4, rue Jacques Monod - 91893 Orsay Cedex Centre de recherche INRIA Sophia Antipolis – Méditerranée : 2004, route des Lucioles - BP 93 - 06902 Sophia Antipolis Cedex Éditeur INRIA - Domaine de Voluceau - Rocquencourt, BP 105 - 78153 Le Chesnay Cedex (France) http://www.inria.fr ISSN 0249-6399
6cs.PL
Survey on Semi-Explicit Time Integration of Eddy Current Problems Jennifer Dutiné Markus Clemens Sebastian Schöps February 12, 2018 arXiv:1709.07068v1 [cs.CE] 20 Sep 2017 Abstract The spatial discretization of the magnetic vector potential formulation of magnetoquasistatic field problems results in an infinitely stiff differential-algebraic equation system. It is transformed into a finitely stiff ordinary differential equation system by applying a generalized Schur complement. Applying the explicit Euler time integration scheme to this system results in a small maximum stable time step size. Fast computations are required in every time step to yield an acceptable overall simulation time. Several acceleration methods are presented. 1 Introduction Spatially discretizing the magnetic vector potential formulation of eddy current problems, e.g by the Finite Element Method (FEM), yields a differential-algebraic equation system (DAE) [1]. Commonly, only unconditionally stable implicit time integration methods as e.g. the implicit Euler method or the singly diagonal implicit Runge-Kutta schemes can be used for time integration of the infinitely stiff DAE system [2]. In every time step at least one large nonlinear algebraic equation system needs to be solved due to the nonlinear BH-characteristic in ferromagnetic materials. The Newton-Raphson method is frequently used for linearization and requires at least one iteration per time step. Here, the Jacobian and the resulting stiffness matrix are updated in each iteration and the resulting linear algebraic equation system needs to be solved efficiently. Applying explicit time integration schemes avoids the necessity of linearization, because nonlinearities only appear in right-hand side expressions. A first approach to use an explicit time integration method for eddy current problems has been proposed in [3], where in the conducting regions of the problems the Finite Difference Time Domain (FDTD) method is used. In the nonconducting regions, i.e., in the air, the corresponding parts of the solution are computed using the boundary element method (BEM) [3]. In a second approach presented in [4], the Discontinuous Galerkin FEM and an explicit time integration method are used for computations in the conducting regions. Continuous FEM ansatz functions and an implicit time integration scheme are applied to the nonconducting regions of the problem [4]. Both approaches in [3] and [4] are based on a separate treatment of conducting and nonconducting regions. A different approach presented in [1] and [5] proposes a Schur complement reformulation of the eddy current problem. In[6] the use of a generalized Schur complement is proposed. Here, a pseudo-inverse of the singular curl-curl matrix in nonconducting regions is evaluated using the preconditioned conjugate gradient (PCG) method. This evaluation forms a multiple-right hand side problem and suitable start vectors for the PCG method are computed using the cascaded Subspace Projection Extrapolation (CSPE) method, which is a modification of the Subspace Projection Extrapolation (SPE) method [7, 6]. Alternatively, the Proper Orthogonal Decomposition (POD) method can be used for computing improved start vectors [8]. Computations can be accelerated further by using a selective update strategy for updating the reluctivity matrix in conducting regions [9]. This paper presents a survey on the methods presented in [6, 8, 9]. 2 Mathematical Formulation The partial differential equation κ    ∂A(t) + ∇ × ν A(t) ∇ × A(t) = Js (t), ∂t 1 (1) describes magnetoquasistatic field problems using the time-dependent magnetic vector potential A(t), where κ is the electrical conductivity, ν is the eventually ferromagnetic, i.e., nonlinearly field dependent, reluctivity and Js (t) is the transient source current density. Discretizing (1) in space, e.g. by FEM using edge elements [10, 11], yields a differential-algebraic equation system (DAE) described by d M a + K(a)a = js , (2) dt where M is the mass-matrix, a is the time dependent vector of the magnetic vector potential, K is the stiffness-matrix and js is the vector of the transient source currents. The degrees of freedom (DoFs) are separated into two vectors ac and an for conducting and nonconducting material, respectively and (2) is re-ordered into          Kcc (ac ) Kcn ac Mcc 0 d ac 0 + = , (3) 0 0 dt an a j KT K n s,n nn cn where Mcc is the conductivity matrix in conducting regions, Kcc (ac ) is the nonlinear part of the reluctivity related stiffness matrix in conducting regions, Knn is the part of the curl-curl operator in air, which is singular, and js,n is the source current vector corresponding to excitations in nonconducting regions. Mcc is positive definite if using a conventional Galerkin scheme with (possibly high-order) edge elements as test and ansatz functions [10, 11]. The generalized Schur complement expression > KS := Kcn K+ nn Kcn , (4) where K+ nn is the matrix representation of a pseudo-inverse of Knn , is applied to (3) and transforms the DAE into an ordinary differential equation (ODE) system Mcc d ac + (Kcc (ac ) − KS ) ac dt an = −Kcn K+ nn js,n , (5) + > = K+ nn js,n − Knn Kcn ac , (6) for the vector ac , i.e., the degrees of freedom only situated in conductive material [5, 1, 6]. The preconditioned conjugate gradient (PCG) method is used for evaluating a pseudo-inverse of Knn [6]. Alternatively, the singular matrix Knn can be regularized using a grad-div regularization by which Knn is transformed into the discrete Laplacian operator in free space [5]. Due to finite stiffness, (5) can be integrated in time using explicit time integration schemes as e.g. the explicit Euler method. Here, in the m-th time step the expressions    m−1 + m m−1 am + ∆tM−1 ) − KS acm−1 , (7) c : = ac cc −Kcn Knn js,n − Kcc (ac am n : = m + > m K+ nn js,n − Knn Kcn ac , (8) are evaluated for the degrees of freedom in the conductor domain and in the nonconductive domains consecutively, where ∆t is the time step size. Evaluating a pseudo-inverse of Knn and the inverse of Mcc in (7) and (8) repeatedly using the PCG method forms multiple right-hand side (mrhs) problems since the matrices involved remain constant. The subspace extrapolation (SPE) method can be used for computing improved start vectors for the PCG method [7, 6]. Solution vectors from n previous time steps are orthonormalized using the modified GramSchmidt method and form the linearly independent column vectors of the operator V. The projected system V> Knn Vz = V> r, (9) where r represents the new right-hand side for the full system, is solved for z ∈ Rn using a direct method. The linear combination of the column vectors in V weighted with the coefficients in z yields the improved start vector x0,CSPE : x0,CSPE := Vz. (10) Only the last column vector in the operator V changes in every time step. Therefore, when computing Knn V in (9), all other matrix-column-vector products evaluated can be reused from previous time steps. This modification of the SPE start vector generation method is referred to as ”cascaded SPE” (CSPE). Alternatively, the proper orthogonal decomposition (POD) method can be used for computing improved start vectors for the PCG method [8, 12]. A snapshot matrix X is assembled using solutions from 2 previous time steps as column vectors. This matrix is decomposed by the singular value decomposition (SVD) [13] into: X = UΣV> , (11) where Σ is a diagonal matrix of the singular values and U and V are orthogonal matrices. The first k column vectors of U corresponding to the k largest singular values σ1 , ..., σk , for which holds σi ≥ σj , for i < j, σ1 ≥ tolPOD , σk (12) (13) become the column vectors of the reduced matrix Ur with a threshold value tolPOD . A threshold value commonly used in practical computations is tolPOD := 104 . The improved start vector x0,POD for the PCG method is computed by  −1 > > x0,POD := Ur U> Ur Kcn ac . r Knn Ur (14) The explicit Euler method is only stable for time step sizes ∆t smaller than a Courant-Friedrich-Levytype time step size ∆tCFL given by [1]: ∆tCFL ≤ 2 , λmax M−1 (K cc cc (ac ) − KS ) (15) where the maximum eigenvalue λmax is proportional to  λmax M−1 cc (Kcc (ac ) − KS ) ∝ 1 h2 κµ , (16) assuming non-singularity of Mcc . Here, h is the smallest edge length in the mesh, κ is the electrical conductivity, and µ is the permeability. Numerical tests have shown that 1/(h2 κµ) unfortunately does not give a sharp estimate of λmax , such that the largest eigenvalue has to be computed numerically. Fine spatial discretization can result in small stable time step sizes, due to (15), that can be in the micro- to nano second range. Considering the dynamics of the usual excitation currents in magnetoquasistatic problems, this corresponds to a strong over-sampling. It is assumed that the excitation current does not change significantly between succeeding time steps. Therefore it is expected that the vector ac in (7), (8) also only changes marginally between succeeding time steps. The matrix Kcc (ac ) is thus l only updated if the change between thevector am c at the time step m and the vector ac from the time l step l < m at which the matrix Kcc ac has last been updated is larger than a chosen tolerance tol, as described by [9]: l kam c − ac k > tol, (17) l kac k where k · k denotes the l2-norm. However, depending on the gauging used, a different norm might be more appropriate, e.g. using the magnetic energy norm. 3 Numerical Validation The ferromagnetic TEAM 10 benchmark problem is spatially discretized using first order edge element FEM ansatz functions [14, 15]. The model geometry is shown in Fig. 1a. The excitation current is described by a (1 − exp (−t/τ )) function. A time interval of 120 ms duration is calculated. The accuracy of the employed simulation code is proven using an implicit time integration method and a fine mesh discretization of about 700,000 DoFs. The resulting average magnetic flux density is compared with the measurement results published in [14] in Fig. 1b. As this simulation takes a simulation time of 5.38 days on a workstation with an Intel Xeon E5 processor, a coarser mesh is applied for the simulations using the explicit Euler method for time integration. The applied coarse spatial discretization yields 29,532 DoFs and results in a maximum stable time step size ∆tCFL = 1.2 µs, such that 100,000 explicit Euler time steps are required for this problem. Computing improved start vectors for the PCG method using either CSPE or POD reduces the average number of required PCG iterations compared to using the solution from the previous time step as start vector. An algebraic multigrid method is used as preconditioner. The results for the evaluation of the pseudo-inverse of Knn using a PCG tolerance of 10−6 are shown in Fig. 2a. Using the selective update strategy for updating the matrix Kcc (ac ) does not significantly decrease accuracy, as is shown in Fig. 2d. 3 (a) TEAM 10 model geometry and position S1. Steel plates are colored in blue and red, the coil in green. There is a 0.5 mm wide air gap between the blue and red steel plates. (b) Comparison of simulation results using a mesh of 700,000 DoFs and the measured results published in [14] at position S1. Figure 1: TEAM 10 model geometry and comparison of simulation results. The number of required updates and the simulation time are significantly reduced, as is depicted in Fig. 2c and Fig. 2b. If Kcc (ac ) is updated in every time step 100,000 updates are performed during the entire simulation. A workstation with an Intel Xeon E5 processor and an NVIDIA TESLA K80 GPU are used for these simulations. The matrix Mcc is inverted directly using GPU acceleration. This is only possible, as the matrix Mcc is only of dimension 5955x5955 in this test problem. For more refined discretizations the PCG method should be used for inverting the matrix Mcc . 4 Conclusion The application of a generalized Schur complement to the spatially discretized magnetic vector potential formulation of magnetoquasistatic field problems transformed a DAE of infinite stiffness into a finitely stiff system of ODEs. This ODE system is integrated with the explicit Euler method. For the evaluation of a pseudo-inverse the PCG method was adopted. Improved start vectors were computed with the CSPE and the POD method, reducing the number of required PCG iterations in simulations of the ferromagnetic TEAM 10 benchmark problem. A selective update strategy for the reluctivity matrix taking into account the specific problem dynamics reduced the number of required updates and the simulation time. So far, the small stable time step size of the explicit Euler method results in high computational effort which can be overcome using massive GPU-parallelization to reduce the required computational time per time step significantly. Acknowledgement This work was supported by the German Research Foundation DFG (grant numbers CL143/11-1 and SCHO1562/1-1). The third author is supported by the Excellence Initiative of the German Federal and State Governments and The Graduate School of Computational Engineering at TU Darmstadt. References [1] Schöps, S., Bartel, A., Clemens, M.: Higher order half-explicit time integration of eddy current problems using domain substructuring. IEEE Trans. Mag., 48(2), 623–626 (2012) [2] Hairer, E., Wanner, G.: Solving Ordinary Differential Equations II: Stiff and Differential-Algebraic Problems (2nd rev. edn.). Springer, Berlin (1996) [3] Yioultsis, T.V., Charitou, K.S., Antonopoulos, C.S., Tsiboukis, T.D.: A finite difference time domain scheme for transient eddy current problems. IEEE Trans. Mag., 37(5), 3145–3149 (2001) [4] Außerhofer, S., Bı́ro, O., Preis, K.: Discontinuous galerkin finite elements in time domain eddycurrent problems. IEEE Trans. Mag., 45(3), 1300–1303 (2009) 4 (a) Averagely required number of PCG iterations for evaluating the pseudo-inverse of Knn using either CSPE, POD, or the solution from the previous time step as start vector for the PCG method. (b) Comparison of simulation times for a simulation using implicit Euler method, the explicit Euler method with updates of Kcc (ac ) in every time step and the explicit Euler method using the selective update strategy and different tolerances tol. (c) Number of updates of Kcc (ac ) for different tolerances tol in (17). (d) Average magnetic flux density at position S1. Figure 2: Numerical results for implicit and various variants of the explicit Euler method. [5] Clemens, M., Schöps, S., De Gersem, H., Bartel, A.: Decomposition and regularization of nonlinear anisotropic curl-curl daes. Compel, 30(6), 1701–1714 (2011) [6] Dutiné, J., Clemens, M., Schöps, S., Wimmer, G.: Explicit time integration of transient eddy current problems. presented at the 10th International Symposium on Electric and Magnetic Fields (EMF2016), full paper submitted. [7] Clemens, M., Wilke, M., Schuhmann, R., Weiland, T.: Subspace projection extrapolation scheme for transient field simulations. IEEE Trans. Mag., 40(2), 934–937 (2004) [8] Dutiné, J., Clemens, M., Schöps, S.: Multiple right-hand side techniques in semi-explicit time integration methods for transient eddy current problems, accepted for presentation at the 17th Biennial IEEE Conference on Electromagnetic Field Computation (CEFC 2016). [9] Dutiné, J., Clemens, M., Schöps, S.: Explicit Time Integration of Eddy Current Problems Using a Selective Matrix Update Strategy. accepted for presentation at the 17th International IGTE Symposium on Numerical Field Calculation in Electrical Engineering (IGTE 2016). [10] Monk, P.: Finite element methods for Maxwells equations. Oxford University Press, Oxford (2003) [11] Jin, J.-M.: The finite element method in electromagnetics (3rd Edition), Wiley-IEEE Press, Hoboken (2014) [12] Chatterjee, A.: An introduction to the proper orthogonal decomposition. Current Sci., 78(7), 808– 817 (2000) [13] Trefethen, L.N., Bau, D.: Numerical Linear Algebra. Society for Industrial and Applied Mathematics, Philadelphia (1997) 5 [14] Nakata, T., Fujiwara, K.: Results for benchmark problem 10 (steel plates around a coil). Compel, 9(3), 181–192 (1990) [15] Kameari, A.: Calculation of transient 3d eddy current using edge-elements. IEEE Trans. Mag., 26(2), 466–469 (1990) 6
5cs.CE
1 Interference Exploitation Precoding Made Practical: Closed-Form Solutions with Optimal Performance arXiv:1712.07846v1 [cs.IT] 21 Dec 2017 Ang Li, Student Member, IEEE, and Christos Masouros, Senior Member, IEEE Abstract—In this paper, we propose closed-form precoding schemes with optimal performance for constructive interference (CI) exploitation in the multiuser multiple-input single-output (MU-MISO) downlink. We first consider an optimization where we maximize the distance between the constructive region and the detection thresholds. The cases of both strict and non-strict phase rotation are considered and can further be formulated as convex optimization problems. For optimization with strict phase rotation, we mathematically derive the optimal beamforming structure with Lagrangian and Karush-Kuhn-Tucker (KKT) conditions. By formulating its dual problem, the optimization problem is further shown to be equivalent to a quadratic programming (QP) over a simplex, which can be solved more efficiently. We then extend our analysis to the case of non-strict phase rotation, where it is mathematically shown that a Kdimensional optimization for non-strict phase rotation is equivalent to a 2K-dimensional optimization for strict phase rotation in terms of the problem formulation. The connection with the conventional zero-forcing (ZF) precoding is also discussed. Based on the above analysis, we further propose an iterative closedform scheme to obtain the optimal beamforming matrix, where within each iteration a closed-form solution can be obtained. Numerical results validate our analysis and the optimality of the proposed iterative scheme, and further show that the proposed closed-form scheme is more efficient than the conventional QP algorithms with interior-point methods, which motivates the use of CI beamforming in practical wireless systems. Index Terms—MIMO, transmit beamforming, constructive interference, optimization, Lagrangian, closed-form solutions. I. I NTRODUCTION M ULTIPLE-input multiple-output (MIMO) systems have been widely acknowledged as a promising technology in the field of wireless communications, due to the significant gains over single-antenna systems [1]. When the channel knowledge is known at the base station (BS), the capacityachieving dirty-paper coding (DPC) scheme is proposed in [2] by pre-subtracting the interference prior to transmission. However, DPC is difficult to implement in practical systems due to the impractical assumption of infinite length of codewords and its high computational cost. To achieve a compromise between performance and complexity, its non-linear counterparts in the form of Tomlinson-Harashima precoding (THP) [3] and vector perturbation (VP) [4] have been proposed, which however are still too complicated for practice due to the inclusion Manuscript received TIME; revised TIME. A. Li and C. Masouros are with the Department of Electronic and Electrical Engineering, University College London, Torrington Place, London, WC1E 7JE, UK (e-mail: [email protected], [email protected]). This work was supported by the Royal Academy of Engineering, UK, the Engineering and Physical Sciences Research Council (EPSRC) project EP/M014150/1 and the China Scholarship Council (CSC). of the sophisticated sphere-search algorithms. Therefore, lowcomplexity linear precoding schemes based on zero-forcing (ZF) have received increasing research attention [5], and a regularized ZF (RZF) scheme is proposed in [6] to further improve the performance of ZF. On the other hand, transmit beamforming schemes based on optimization have also been a popular research topic [7]-[13]. Among the optimization-based schemes, one form of the optimization known as signal-tointerference-plus-noise ratio (SINR) balancing is to maximize the minimum SINR subject to a total power constraint [7], [8] or a per-antenna power constraint [9]. An alternative downlink beamforming targets at minimizing the total transmit power at the BS subject to a minimum SINR requirement [10]-[12]. It has been shown that the power minimization problems can be formulated either as a virtual uplink problem with power control or as a semi-definite programming (SDP) and solved via semi-definite relaxation (SDR) [11]. As for the SINR balancing problem, it is proven to be an inverse problem to the power minimization optimization, based on which schemes via bisection search [7] and iterative algorithms [10] have been proposed. Nevertheless, both the above precoding schemes and the optimization-based transmit beamforming designs mentioned above have ignored the fact that interference can be beneficial and further exploited on an instantaneous basis [14], [15]. The concept of constructive interference (CI) was firstly introduced in [16], where it is shown that the instantaneous interference can be categorized into constructive and destructive. A modified ZF precoding scheme is then proposed in [17], where the constructive interference is exploited while the destructive interference is cancelled. A correlation rotation scheme has been further proposed in [18], where it is shown that the destructive interference can be manipulated and rotated such that all the interference becomes constructive. Symbol-level transmit beamforming schemes based on convex optimization for CI has been proposed in [19], [20], where the concept of constructive region is introduced to relax the strict phase rotation constraint in [18] and achieve an improved performance. Further studies on the optimization-based CI beamforming schemes can be found in [20]-[23]. Due to the performance benefits over conventional schemes, the concept of CI has been extended to many wireless application scenarios, including cognitive radio [24], [25], constant envelope precoding [26], wireless information and power transfer [27] and mutual coupling exploitation [28]. The above studies show that MIMO systems can benefit from the CI with a symbollevel beamforming. Nevertheless, while the performance of CIbased beamforming approaches is superior, they need to solve 2 a convex optimization problem, which can be computationally inefficient, especially when executed on a symbol-by-symbol basis. In this paper, we design low-complexity optimal and suboptimal solutions for CI precoding, culminating in closedform iterative precoders. We consider an optimization problem where we maximize the distance between the constructive region and the detection thresholds such that the effect of CI is maximized. We firstly consider the optimization for strict phase rotation, where the phases of the interfering signals are rotated such that they are strictly aligned to the symbol of interest. By analyzing the formulated second-order cone programming (SOCP) optimization with Lagrangian and KKT conditions, we derive the structure of the optimal beamforming matrix, which leads to an equivalent optimization and further simplifies the beamforming design. By formulating the dual problem of the equivalent optimization problem, it is mathematically shown that the optimization for CI beamforming is equivalent to a quadratic programming (QP) optimization over a simplex, which finally leads to a closed-form expression. We extend our analysis to the case of non-strict phase rotation, where the phases of the interfering signals are rotated such that the resulting interfered signal is located within the constructive region. By following a similar approach for the case of strict phase rotation, we analytically show that the optimal beamforming matrix for theses two scenarios shares a similar closed-form expression, and a K-dimensional optimization for non-strict phase rotation is equivalent to a 2K-dimensional optimization for strict phase rotation in terms of the problem formulation. Our above analysis also provides some insights on the connection between the CI beamforming and the generic ZF precoding. Moreover, our efforts to facilitate the symbol-level CI beamforming in practice culminate in an iterative closedform scheme to efficiently obtain the optimal beamforming matrix, where a closed-form solution is obtained within each iteration. We show that only in a few iterations, the closedform approach obtains optimal performance. Numerical results validate our above analysis and the optimality of the proposed iterative closed-form method for both strict and non-strict phase rotation. Moreover, it is numerically shown that the proposed iterative approach is more time-efficient compared to the conventional QP algorithms based on interior-point methods, especially when the number of users is small. By constraining the maximum number of iterations, we further obtain a flexible performance-complexity tradeoff for the proposed iterative method, based on its connection with conventional ZF precoding. Both of the above motivate the use of CI-based beamforming in practical wireless systems. For reasons of clarity, we summarize the contributions of this paper as: 1) We formulate the optimization problem for CI-based beamforming, where we maximize the distance between the constructive region and the detection thresholds. We derive the optimal beamforming matrix for strict phase rotation and further formulate an equivalent and simplified optimization problem. 2) The optimization for strict phase rotation is transformed and further shown to be equivalent to a QP problem over a simplex, which can be more efficiently solved than the originally formulated problem. 3) We extend our analysis to the case of non-strict phase rotation, where the closed-form expression is similar to the case of strict phase rotation. It is further shown that a K-dimensional optimization for non-strict phase rotation is equivalent to a 2K-dimensional optimization for strict phase rotation in terms of the problem formulation. 4) We analytically study the connection between the CI beamforming and the ZF precoding, where it is shown that ZF precoding can be regarded as a special case of CI-based beamforming with all the dual variables being zero. 5) We further propose an iterative closed-form scheme to obtain the optimal beamforming matrix for both the strict and non-strict phase rotation cases, where within each iteration a closed-form solution can be derived. We show that the closed-form precoder obtains an optimal performance in only a few iterations. The remainder of this paper is organized as follows. Section II introduces the system model and briefly reviews CI. Section III includes the analysis for the optimization problems with both strict and non-strict phase rotation constraints. The connection between the CI beamforming and conventional ZF precoding is discussed in Section IV. The proposed iterative closed-form scheme is introduced in Section V. The numerical results are shown in Section VI, and Section VII concludes the paper. N otations: a, a, and A denote scalar, vector and matrix, respectively. (·)T , (·)H and tr {·} denote transposition, conjugate transposition and trace of a matrix, respectively. j denotes the imaginary unit, and vec (·) denotes the vectorization operation. A (k, i) denotes the entry in the k-row and i-th column of A. |·| denotes the absolute value of a real number or the modulus of a complex number, and k·kF denotes the Frobenius norm. C n×n represents an n × n matrix in the complex set, and I denotes the identity matrix. ℜ(·) and ℑ(·) denote the real and imaginary part of a complex number, respectively. card (·) denotes the cardinality of a set. II. S YSTEM M ODEL AND C ONSTRUCTIVE I NTERFERENCE In this section, the system model that we consider is firstly introduced, followed by a brief review of CI and the constructive region. A. System Model We consider a multiuser MISO system in the downlink, where the BS structure with a symbol-level precoding is depicted in Fig. 1, where the iterative closed-form algorithm will be introduced in Section V. The BS with Nt transmit antennas is simultaneously communicating with K singleantenna users in the same time-frequency resource, where K ≤ Nt . We focus on the transmit beamforming designs and perfect CSI is assumed throughout the paper. The data symbol vector is assumed to be from a normalized PSK modulation 3 Fig. 1: A block diagram for the proposed symbol level precoding based on constructive interference constellation [19], denoted as s ∈ C K×1 . Then, the received signal at the k-th user can be expressed as rk = hk Ws + nk , (1) where hk ∈ C 1×Nt denotes the flat-fading Rayleigh channel vector from user k to the BS, and each entry in hk follows a standard complex Gaussian distribution. W ∈ C Nt ×K is the beamforming matrix and nk is the additive Gaussian noise with zero mean and variance σ 2 at the receiver. B. Constructive Interference CI is defined as the interference that pushes the received signals away from the detection thresholds [14]-[18]. CI for strict phase rotation refers to the cases where the phases of the interfering signals are controlled and rotated, such that they are strictly aligned to those of the data symbols of interest [18]. The constructive region has been further introduced in [19], where it is shown that the phases of the interfering signals may not be necessarily strictly aligned to that of the data symbols of interest, known as the non-strict phase rotation. It is demonstrated that, as long as the resulting interfered signals are located in the constructive region, this increases the distance to the detection thresholds and returns an improved performance. To show this intuitively, in Fig. 2 and Fig. 3 we depict the case for strict phase rotation and non-strict phase rotation respectively, where the constellation Fig. 2: Constructive interference, QPSK, strict phase rotation   point √12 + √12 · j from a normalized QPSK constellation is employed as the example to illustrate these two cases. We can observe that for both strict phase rotation and nonstrict phase rotation, the distance of the received signals to the detection thresholds is increased, which will improve the 4 where p0 denotes the total available transmit power. A symbollevel power constraint is employed, as the exploitation of CI is related to the transmit symbol vector, which will also be shown mathematically in the following. P1 belongs to the SOCP and can be solved with convex optimization tools such as CVX [19]. We decompose the beamforming matrix into vectors W = [w1 , w2 , · · · , wK ] , (6) and based on the virtual multicast formulation in [19] we obtain that each wi si is identical. This leads to the equivalent transformation of the power constraint, given by 2 kWskF ≤ p0 ⇒ K X i=1 H sH i wi wi s i ≤ p0 . K (7) We further transform P1 in (5) into a standard minimization problem, expressed as P2 : min − t Fig. 3: Constructive region, QPSK, non-strict phase rotation wi , t s.t. hk detection performance. K X i=1 In this section, we firstly focus on the CI beamforming for strict phase rotation, and we further extend our analysis to the case of non-strict phase rotation. A. Strict Phase Rotation Before formulating the optimization problem, based on the geometry of the modulation constellation we firstly construct the conditions that the beamformer should satisfy to achieve the strict phase rotation. In Fig. 2, without loss of generality → → we denote OA = t · sk and t = | OA | is the object to be maximized. We further assume that the node ‘B’ denotes the → noiseless received signal for user k that is co-linear to OA for strict phase rotation, which leads to → → (3) where based on the geometry we can obtain that λk is a real number, and the condition on λk to achieve CI for strict phase rotation is given by λk ≥ t, ∀k ∈ K, W, t λk ≥ t, ∀k ∈ K 2 kWskF ≤ p0 i=1 H sH i wi wi s i − (5) p0 ≤0 K In the following we analyze P2 with Lagrangian and KKT conditions. The Lagrangian of P2 is expressed as [29] ! K K X X wi si − λk sk L (wi , t, δk , µk , µ0 ) = −t + δ k hk + K X k=1 i=1 k=1 K X H sH i wi wi s i − i=1 µk (t − λk ) + µ0 p0 K ! , (9) where δk , µk and µ0 are the dual variables, and we have µ0 ≥ 0 and µk ≥ 0, ∀k ∈ K. Based on the Lagrangian in (9), the KKT conditions for optimality can be obtained as K X ∂L = −1 + µk = 0 ∂t (10a) k=1 ∂L = ∂wi K X δ k · hk δk hk k=1 ! K X i=1 (4) where K = {1, 2, · · · , K}. With the above formulation, we can construct the optimization problem for strict phase rotation as P1 : max t s.t. hk Ws = λk sk , ∀k ∈ K K X (2) Then, by introducing a real-valued scaling factor λk , we → further express OB as OB = hk Ws = λk sk , (8) t − λk ≤ 0, ∀k ∈ K III. C ONSTRUCTIVE I NTERFERENCE B EAMFORMING OB = hk Ws. wi si − λk sk = 0, ∀k ∈ K µ0 si + µ0 · wiH = 0, ∀i ∈ K ! (10b) = 0, ∀k ∈ K (10c) µk (t − λk ) = 0, ∀k ∈ K ! p0 H H s i wi wi s i − =0 K i=1 (10d) wi si − λk sk K X (10e) Based on (10b), it is firstly obtained that µ0 6= 0, and with the fact that µ0 ≥ 0 we can further obtain µ0 > 0. Then, wiH in (10b) can be expressed as ! K 1 X H wi = − (11) δk · hk si , ∀i ∈ K. µ0 k=1 5 By denoting δH (12) υk = − k , ∀k ∈ K, µ0 where we note that δk can be complex, the expression of wi is obtained as ! K X H (13) wi = υ k · hk s H i , ∀k ∈ K. where we note that λH k = λk as each λk is real, and T is defined as −1  diag (s) . (20) T = diag sH HHH It is easy to obtain that T is Hermitian and positive semidefinite, which further leads to k=1 ΛT TΛ = ΛT ℜ (T) Λ = ΛT VΛ = p0 , Based on (13), we further obtain that ! K X H wi s i = υk · hk , ∀i ∈ K, where V = ℜ (T) is a symmetric and positive semi-definite matrix. With (21) obtained, we can formulate a new convex optimization problem on Λ that is equivalent to the original optimization P1 , expressed as (14) k=1 which is a constant for any i. This mathematically verifies that the beamforming vector for one symbol is a phase-rotated version of the beamforming vector for another symbol. Then, with each wi obtained, the beamforming matrix W can be obtained and further expressed in a matrix form as (21) P3 : min − t Λ, t T s.t. Λ VΛ − p0 = 0 t − λk ≤ 0, ∀k ∈ K (22) The optimal beamforming matrix for the original problem P1 in (5) can be obtained with (18) based on the obtained Λ by solving P3 . In the following, we analyze the convex optimization P3 with the Lagrangian approach, where the k=1  H H   Lagrangian of P3 is formulated as T  H H = h1 , h2 , · · · , hH s1 , s2 , · · · , sH K K [υ1 , υ2 , · · · , υK ] K  X T H H + µk (t − λk ) Λ VΛ − p L (Λ, t, α , µ ) = −t + α = H Υs . 0 0 k 0 (15) k=1  We further express (3) in a compact form as = 1T u − 1 t + α0 · ΛT VΛ − uT Λ − α0 p0 , (23) HWs = diag (Λ) s, (16) where α and µ are the dual variables and µ ≥ 0, ∀k ∈ K. 0 k k T  is the channel matrix and u = [µ1 , µ2 , · · · , µK ]T is a column vector that consists of the where H = hT1 , hT2 , · · · , hTK T T Λ = [λ1 , λ2 , · · · , λK ] . By substituting (15) into (16), we dual variables and the vector 1 = [1, 1, · · · , 1] . Based on (23), the KKT conditions of P3 for optimality are expressed can further obtain H H as HH Υs s = diag (Λ) s ∂L (17) −1 1 = 1T u − 1 = 0 (24a) ⇒Υ = · HHH diag (Λ) s. ∂t K  ∂L With (17), we can obtain the structure of the optimal beam(24b) = α0 V + VT Λ − u = 0 ∂Λ forming matrix as a function of scaling vector Λ as  (24c) α0 ΛT VΛ − p0 = 0  1 H H −1 H W= · H HH diag (Λ) ss . (18) µk (t − λk ) = 0, ∀k ∈ K (24d) K W = [w1 , w2 , · · · , wK ] ! K X   H H H = υ k · hk · s H 1 , s2 , · · · , sK It is easy to observe from (18) that the CI beamforming is a symbol-level beamforming scheme since the beamforming matrix includes the expression of the symbol vector s. Moreover, with (18) the original optimization problem on W is transformed into an optimization on the real-valued scaling vector Λ. With the fact that µ0 > 0, based on (10e) we can obtain that the power constraint is strictly active, which leads to 2 kWskF = p0  ⇒ tr WssH WH = p0 ⇒ sH WH Ws = p0 −1 1 diag (Λ) ssH s = p0 ⇒ 2 · sH ssH diag (Λ) HHH K −1 ⇒ sH diag (Λ) HHH diag (Λ) s = p0   H −1 T H HH diag (s) Λ = p0 ⇒ Λ diag s ⇒ ΛT TΛ = p0 , (19) Based on (24b), firstly we have α0 6= 0, and we can further obtain the expression of Λ, given by Λ= 1 V−1 u, 2α0 (25) where we note that V is symmetric. With α0 6= 0, based on (24c) it is obtained that the power constraint is strictly active, and by substituting (25) into (24c), we can express α0 as a function of the dual vector u, given by  T   1 1 −1 −1 V u V V u = p0 2α0 2α0 1 ⇒ 2 uT V−1 VV−1 u = p0 (26) 4α0 s uT V−1 u ⇒ α0 = . 4p0 For the convex optimization P3 in (22), it is easy to verify that the Slater’s condition is satisfied [29], which means that 6 the dual gap is zero. Therefore, we can solve P3 by solving its corresponding dual problem, which is given by U = max min L (Λ, t, α0 , u) . u, α0 Λ, t (27) For the dual problem U, the inner minimization is achieved with (24a) and the obtained Λ in (25), and therefore the dual problem can be further transformed into T    1 1 −1 −1 V u V V u U = max α0 u, α0 2α0 2α0   1 − uT V−1 u − α0 p0 2α0 1 T −1 1 T −1 = max u V VV−1 u − u V u − α0 p0 u, α0 4α0 2α0 1 T −1 u V u − α0 p0 = max − u, α0 4α0 s uT V−1 u uT V−1 u = max − q − · p0 T V−1 u u 4p0 4 u 4p 0 p T = max − p0 · u V−1 u. u (28) √ Due to the fact that y = x is a monotonic function, therefore the dual problem U is equivalent to the following optimization problem P4 : min uT V−1 u u T s.t. 1 u = 1 µk ≥ 0, ∀k ∈ K (29) where the first constraint comes from (24a). Based on our analysis and transformations above, we have transformed and simplified the original problem, and shown that the original optimization can be solved by solving P4 . To be more specific, through (26), (25) and (18), we arrive at a final closed-form expression of the optimal beamforming matrix as a function of u, given by r  −1 p0 1 −1 W = HH HHH diag V u ssH . K uT V−1 u (30) Moreover, it is observed that P4 is a typical QP optimization problem over a simplex, which can be more efficiently solved with the simplex method [30] or interior-point methods [31], compared to the original CI beamforming formulation P1 which is a SOCP optimization. B. Non-Strict Phase Rotation We extend our analysis to the case of non-strict phase rotation. Similarly, before formulating the optimization problem, we firstly construct the condition that the beamforming designs should satisfy such that the received signals are located in the constructive region. Based on Fig. 3, for consistency we denote → → OA = t · sk and t = | OA | is the objective to be maximized. → Following (2), we denote the received signal for user k as OB, which is expressed as → OB = hk Ws = λk sk . (31) In the case of non-strict phase rotation, each λk can be a complex value, which mathematically represents that a phase → rotation is included for the received signal OB compared to the data symbol sk , as shown in Fig. 3. This is different from the case of strict phase rotation where each λk is strictly real. → → Then, based on the fact that OC and CB are perpendicular, → → we can obtain the expression of OC and CB, given by → → ℑ OC = ℜ (λk ) sk = λℜ k sk , CB = j · ℑ (λk ) sk = j · λk sk , (32) where based on Fig. 3 the imaginary unit ‘j’ denotes a phase rotation of 90o geometrically. For simplicity of denotation, we ℑ denote λℜ k = ℜ (λk ) and λk = ℑ (λk ), respectively. Due to the fact that the nodes ‘O’, ‘A’ and ‘C’ are co-linear, we can → further obtain the expression of AC as →  AC = λℜ (33) k − t sk . → In Fig. 3, we can observe that to have the received signal OB located in the constructive region is equivalent to the following condition: θAB ≤ θt ⇒ tan θAB ≤ tan θt → ⇒ | CB | → = λℑ k sk  ≤ tan θt − t sk (34) λℜ k | AC |  ℑ ⇒ λℜ k − t tan θt ≥ λk . In the case of λℑ k = 0, ∀k ∈ K, (34) is identical to (4), and the non-strict phase rotation reduces to the strict phase rotation. For M-PSK modulation, it is observed from the modulation constellation that the threshold angle θt can be expressed as π . (35) θt = M With the above formulation, we can construct the optimization problem of CI for non-strict phase rotation as P5 : max t W, t s.t. hk Ws = λk sk , ∀k ∈ K  ℑ λℜ k − t tan θt ≥ λk , ∀k ∈ K (36) kWsk2F ≤ p0 To further analyze the optimization problem for non-strict phase rotation, we first transform P5 in (36) into a standard minimization form, given by P6 : min − t W, t s.t. hk Ws − λk sk = 0, ∀k ∈ K  ℜ λℑ k − λk − t tan θt ≤ 0, ∀k ∈ K K X i=1 H sH i wi wi s i − (37) p0 ≤0 K Then, by following a similar step in (9)-(17) with the Lagrangian approach, we can obtain that the optimal beamforming structure for non-strict phase rotation is the same as that 7 for strict phase rotation, which is given in (18). With the power constraint strictly active, we can further obtain that 2 kWskF = p0 ⇒ sH WH Ws = p0 −1  diag (Λ) s = p0 ⇒ sH diag ΛH HHH   −1 diag (s) Λ = p0 ⇒ ΛH diag sH HHH (38) where û ∈ C 2K×1 and S ∈ C 2K×2K , the Lagrangian for P7 can be further simplified into    L Λ̂, t, α̂0 , û = 1T û − 1 t + α̂0 Λ̂T T̂Λ̂ − ûT SΛ̂ − α̂0 p0 . (44) Based on (44), we express the KKT conditions for optimality of P7 in the following: H ⇒ Λ TΛ = p0 , ∂L where T is given by (20). However, we note that, different from the case of strict phase rotation, for the case of nonstrict phase rotation (38) is not in a quadratic form since each λk can be complex. By decomposing      ℜ (T) −ℑ (T) T T T Λ̂ = ℜ Λ , ℑ Λ , T̂ = , ℑ (T) ℜ (T) (39) we can expand (38) with its real and imaginary components and further transform the power constraint into a quadratic form, given by 2 kWskF = p0 (40) ⇒ Λ̂T T̂Λ̂ − p0 = 0. Similar to the optimization P3 in (22) for strict phase rotation, we can formulate an optimization problem on Λ̂ for non-strict phase rotation, expressed as P7 : min − t Λ̂, t s.t. Λ̂T T̂Λ̂ − p0 = 0 λℑ k + t − λℜ k ≤ 0, ∀k ∈ K tan θt λℑ k − + t − λℜ k ≤ 0, ∀k ∈ K tan θt (41) ∂L = 1T û − 1 = 0 ∂t = 2α̂0 T̂Λ̂ − ST û = 0   α̂0 Λ̂T T̂Λ̂ − p0 = 0  ℑ  λk ℜ µ̂k + t − λk = 0, ∀k ∈ K tan θt   λℑ ℜ k ν̂k − + t − λk = 0, ∀k ∈ K tan θt ∂ Λ̂ (45a) (45b) (45c) (45d) (45e) Based on (45b) we can obtain α̂0 6= 0 and the expression of Λ̂, given by 1 −1 T Λ̂ = T̂ S û, (46) 2α̂0 where we note that T̂ is symmetric. Moreover, from (45c) we obtain that the power constraint is strictly active with α̂0 6= 0, and we can further obtain the expression of α̂0 as  T   1 1 T T T̂S û T̂ T̂S û = p0 2α̂0 2α̂0 s s (47) ûT ST̂−1 ST û ûT V̂−1 û = ⇒ α̂0 = 4p0 4p0 where for simplicity and consistency we introduce V̂−1 = ST̂−1 ST . (48) Similar to the case for strict phase rotation, it is easy to observe that the Slater’s condition is satisfied for P7 , and therefore by following a similar approach in (27) and (28), the dual problem for P7 can be formulated into q (49) Û = max − p0 · ûT V̂−1 û, where we have transformed the CI constraint with the absolute value on λℑ k into two separate constraints. We then analyze P7 with Lagrangian and KKT conditions, where the Lagrangian of P7 is constructed as     û L Λ̂, t, α̂0 , µ̂k , ν̂k = −t + α̂0 Λ̂T T̂Λ̂ − p0 which further leads to the following equivalent optimization  ℑ   X for non-strict phase rotation K K ℑ X λ λk + µ̂k + ν̂k − k + t − λℜ + t − λℜ k k tan θt tan θt P8 : min ûT V̂−1 û k=1 k=1 û "K # T X (50) s.t. 1 û = 1 = (µ̂k + ν̂k ) − 1 t + α̂0 Λ̂T T̂Λ̂ − α̂0 p0 ûk ≥ 0, ∀k ∈ {1, 2, · · · , 2K} k=1 − K X k=1 (µ̂k + ν̂k ) λℜ k + K X k=1 (µ̂k − ν̂k ) λℑ k , tan θt (42) where α̂0 , µ̂k and ν̂k are the dual variables, and µ̂k ≥ 0, ν̂k ≥ 0, ∀k. By introducing T û = [µ̂1 , µ̂2 , · · · , µ̂K , ν̂1 , ν̂2 , · · · , ν̂K ] ,   I − tan1 θt · I S= , 1 I tan θt · I (43) where we denote ûk as the k-th entry in û, and we obtain V̂−1 ∈ C 2K×2K based on (48). P8 is also a QP optimization over a simplex, which can be efficiently solved. The final optimal beamforming matrix for non-strict phase rotation can be similarly obtained in a closed form as a function of û, given by  r  1 H p0 −1 T H −1 W = H HH UT̂ S û ssH , diag K ûT V̂−1 û (51) 8   where U = I j · I is a transformation matrix that transform the real-valued vector Λ̂ into its complex equivalence. Based on the formulated equivalent optimization problems P4 in (29) and P8 in (50), we note the similarity of the optimization problem for strict phase rotation and non-strict phase rotation. We observe that the objective function of P4 for strict phase rotation and P8 for non-strict phase rotation is identical, and both optimization problems share the same constraints. It is further observed that the only difference between P4 and P8 is the problem size. It is then concluded that a K-dimensional optimization problem for non-strict phase rotation and a 2Kdimensional optimization for strict phase rotation share the same problem formulation, and therefore they can be solved in a similar way. where the vector q = [q1 , q2 , · · · , qK ]T consists of each nonnegative dual variable qk of P4 . Based on (55), we express the KKT conditions of P4 as ∂L = 2V−1 u + q0 · 1 − q = 0 ∂u  q0 1T u − 1 = 0 qk µk = 0, ∀k ∈ K (56a) (56b) (56c) Based on (56a) we can obtain the expression of u as a function of the dual variables, given by u= 1 V (q − q0 · 1) , 2 (57) and each µk as 1 (vk q − q0 ak ) , ∀k ∈ K, (58) 2   T T where we have decomposed V into V = v1T , v2T , · · · , vK . a = [a1 , a2 , · · · , aK ]T denotes the column vector obtained from the sum of V by column, with each entry given by µk = IV. CI AS A G ENERALIZATION OF ZF P RECODING In this section, we discuss the connection between the CI beamforming for strict phase rotation and the conventional ZF precoding. For the CI beamforming with non-strict phase rotation, the connection can be obtained in a similar way. To compare the CI beamforming and the conventional ZF precoding, as a reference we first present the precoded signal vector of ZF, given by xZF = WZF s = −1 1 s, · HH HHH f (52) where f is the scaling factor to meet the transmit power constraint. For fairness of comparison, we employ a symbol2 level normalization for WZF such that kWZF skF = p0 as for the considered CI beamforming, which leads to the expression of f as f= s 2 kWZF skF p0 = s −1 sH (HHH ) p0 s . (53) −1  By denoting C = HHH , the expression of f can be further transformed into v u P K u K P u C (m, n) sH m sn t m=1 n=1 f= p0 (54) K K XX 2 ⇒ C (m, n) sH m sn = f p 0 . m=1 n=1 Subsequently, we perform the mathematical analysis on the optimization problem P4 on u for strict phase rotation. By applying the Lagrangian approach, we can obtain the Lagrangian of P4 , given by K  X L (u, q0 , q) = uT V−1 u + q0 1T u − 1 − qk µk k=1 = uT V−1 u + q0 · 1T u − qT u − q0 , (55) ak = K X V (k, i). (59) i=1 By substituting the expression of u into (53b), we further obtain that 1T u − 1 = 0 ) # (" K K X 1X ⇒ V (k, i) qi − q0 ak − 1 = 0 2 i=1 k=1 "K # K 1X X 1 ⇒ V (k, i) qi − q0 c − 1 = 0 2 i=1 2 (60) k=1 K ⇒ 1 1X bi qi − q0 c − 1 = 0 2 i=1 2 bq − 2 , c where b is a row vector obtained from the sum of V by row and c denotes the sum of all the entries in V. b and c are given by K X b= vk = aT , ⇒q0 = k=1 c= K X K X (61) T V (k, i) = a 1, k=1 i=1 where b = aT is based on the fact that V is symmetric. By substituting the expression of q0 in (60) into (58), the expression of each µk can be further transformed into 1 ak aT q − 2 vk q − 2 2 c 1 ak T  ak = vk − a q + , 2 c c which further leads to the expression of u as µk = u= 1 a (V − Φ) q + , 2 c (62) (63) 9 T where Φ = aac . By substituting the expression of u into the expression of Λ in (25), we can further obtain that   1 a 1 V−1 (V − Φ) q + Λ= 2α0 2 c  1 1 −1 −1 (64) V a+ I−V Φ q = 2α0 c 4α0  1 1 = m+ I − V−1 Φ q, 2α0 c 4α0 where we have defined m = V−1 a. (65) T In (65), m ∈ C K×1 and m = [m1 , m2 , · · · , mK ] . Based on the expression of a, each mk is obtained as mk = = = K X n=1 K X n=1 K X V −1 (k, n) an V−1 (k, n) K X V (n, i) i=1 V −1 (k, n) V (n, k) + n=1 =1+ K XX V−1 (k, n) V (n, i) i6=k n=1 X 0 i6=k = 1, (66) which also means that m = V−1 a = 1. With this fact, the expression of Λ is further transformed into  1 1 1+ I − V−1 Φ q, (67) Λ= 2α0 c 4α0 based on which we shall discuss the connection between the CI beamforming and the conventional ZF scheme. In (67), if we set qk = 0, ∀k ∈ K, (68) based on (63) we can obtain that a u= (69) c and based on (26) we further obtain that s s r 1 aT V−1 a aT 1 c = = = √ . (70) α0 = 4c2 p0 4c2 p0 4c2 p0 2 cp0 Then, the expression of Λ is simplified into r √ 2 cp0 p0 1 Λ= 1= = . (71) 2α0 c 2c c Based on the expression of T in (20), we can obtain the expression of T (m, n) as T (m, n) = C (m, n) sH m sn , (72) and with the fact that T is Hermitian, we further obtain that c= = = K X K X m=1 n=1 K X K X m=1 n=1 f 2 p0 . V (m, n) = K X K X (74) In this case, with all dual variables equal to zero, each λk is real and identical, which further leads to the expression of the precoded signal vector for CI as −1 1 H 1 · HH HHH ss s K f −1 1 s = · HH HHH f = xZF , xCI = Ws = (75) which is identical to the precoded signal vector based on ZF, where we denote xCI as the transmit signal vector for the CI beamforming. The above results show that the conventional ZF precoding can be regarded as a special case of the CI beamforming with all the dual variables being zero, as demonstrated in (68). The performance of ZF method is therefore the lower-bound of the CI beamforming. We shall discuss under what conditions the CI beamforming is equivalent to the ZF approach in the following section. It can be further observed that the performance of the CI beamforming will be superior to the ZF scheme if not all the dual variables are zero, as shown in (67) where the existence of non-zero dual variables will increase the minimum value in Λ. We further note that when the optimality is achieved, the minimum value in Λ is guaranteed to be not smaller than (74), for otherwise the ZF beamforming will generate a larger minimum value in Λ, which means that ZF should be the optimal and this causes contradiction. V. P ROPOSED I TERATIVE C LOSED -F ORM S CHEME In this section, our proposed iterative close-form scheme is introduced. Throughout this section, we consider the case of strict phase rotation, while the extension to the nonstrict phase rotation is trivial and briefly included, as both optimization problems share the same problem formulation, discussed in Section IV. To introduce the proposed scheme, we first transform the expression of u in (63) into u= a 1 Gq + , 2 c (76) where G is defined as G = V − Φ. (77) Then, based on the optimality conditions in (55), as long as we find a u and the corresponding dual vector q that satisfy (55), the obtained u is the optimal solution for P4 . This further leads to the following optimization problem P9 : find u T (m, n) q m=1 n=1 C (m, n) sH m sn By substituting (73) into (71), we obtain r 1 p0 = . Λ= 2 f p0 f (73) a 1 Gq + 2 c 1T u − 1 = 0 s.t. u = µk qk = 0, µk ≥ 0, qk ≥ 0, ∀k ∈ K (78) 10 For clarity of description, we define a set S as S = {k | ak < 0, ∀k ∈ K} . (79) In the following based on S we discuss the solution of P9 and propose the iterative closed-form scheme. and a set I that consists of all the entries in i, where we denote i = [i1 , i2 · · · , iM ] and card (I) = M . By updating q with the updated qk based on (85), the updated u can be expressed as a 1X (87) gk qk + , u= 2 c k∈I A. S = ∅ When S = ∅, this means ak ≥ 0, ∀k ∈ K. Then, based on the fact that 1T a = c in (61), it is obvious that a u = , qk = 0, ∀k ∈ K (80) c satisfies all the conditions in (78). Therefore, when S = ∅, the optimal u∗ and q∗ can be obtained as a (81) u∗ = , q∗ = 0. c In this case, based on our analysis in Section IV the CI beamforming is identical to the ZF approach, where no performance gains can be obtained. B. card (S) 6= ∅ When card (S) 6= ∅, this means that there is at least one entry in a that is smaller than zero. It is then obvious that the optimal u∗ 6= ac due to the requirement that µk ≥ 0. In this case, we can obtain that not all the dual variables are zero, and we need to introduce at least one positive qi such that each µk ≥ 0. We firstly set a (82) u = , q = 0. c Subsequently, we sort the entries in u following an ascending order, expressed as d = sort (u) , (83) T where d is the sorted vector and d = [d1 , d2 , · · · , dK ] . sort (·) denotes the sort function, and without loss of generality we denote k as the minimum value in u, which leads to µk = min (u) = d1 . (84) With (84) we can also obtain ak < 0 and d1 < 0. Let us firstly introduce only one positive dual variable qk that corresponds to µk while keeping other dual variables zero. Based on the complementary slackness condition, when qk 6= 0, we obtain µk = 0, and this further leads to K µk = 1X ak G (k, i)qi + =0 2 i=1 c 1 ak ⇒ G (k, k) qk + =0 2 c 2ak . ⇒qk = − G (k, k) c (85) where we have decomposed G = [g1 , g2 , · · · , gK ], and (87) satisfies µk = 0. We verify whether the minimum value in the updated u satisfies the non-negative condition, and the updated u is the optimal solution of P9 if min (u) is non-negative. If this condition is not satisfied, this means that one dual variable is not enough and we need to introduce an additional dual variable. In this case, we first sort the updated u based on (83) and then find the minimum value in the updated d, where without loss of generality we denote µl = d1 , ql 6= 0, (88) where we note that d1 in (88) is different from d1 in (84) as u has been updated. With the existence of two non-zero dual variables, we obtain i = [k, l] and I = {k, l}. We can then formulate a matrix Z ∈ C card(S)×card(S) as   G (k, k) G (k, l) Z= . (89) G (l, k) G (l, l) By defining T T q̃ = [qk , ql ] , ã = [ak , al ] , ũ = [µk , µl ] T (90) that consists of the entries that correspond to the numbers of non-zero dual variables, we obtain ũ = 0, (91) which is due to the complementary slackness condition. With (87) and (91), we can further obtain q̃ as      ã 1 G (k, k) G (k, l) qk + ql + = 0 ũ = G (l, k) G (l, l) 2 c 1 ã ⇒ Zq̃ + = 0 2 c 2 ⇒ q̃ = − · Z−1 ã. c (92) If each entry in the obtained q̃ satisfies the non-negative condition, we update u based on (87) with the updated I, and further check whether the minimum value in the updated u satisfies the non-negative condition. Nevertheless, when card (S) > 1, it cannot be guaranteed that each entry in the obtained q̃ in (92) satisfies the nonnegative condition. In this case, a retraction approach is required. To be more specific, if there is one entry in the obtained q̃ that is negative, we firstly find the corresponding number of the negative dual variable, given by k = find (qk < 0) , (93) where based on the definition of G we can verify that G (k, k) > 0. Based on the fact that ak < 0 it is then obtained that qk > 0. We further define a vector i where the ‘find’ function returns the index of the negative entry in q. We further obtain the corresponding column index of k in i, expressed as i = [k] , ∀qk 6= 0, im = k. (86) (94) 11 We then reset C. The Iterative Algorithm i = [i1 , i2 , · · · , im−1 ] , (95) which means that there are currently (m − 1) positive dual variables and we set all the obtained dual variables obtained after (m−1) to 0. With (95), we reformulate the corresponding I and u. Then, for the m-th dual variable, instead of selecting the number that corresponds to the minimum value in d as in (84), we select µm that corresponds to the second minimum value in d. Based on (83) we obtain µm = d2 , (96) and we update i and I. With the updated I, we calculate q̃ based on (92), and we repeat the above process (83)-(96) by increasing the number of non-zero dual variables one at a time until all the entries in the updated u are non-negative, on the condition that in each step the entries in the obtained q̃ are non-negative. Algorithm 1 Proposed Iterative Closed-form Scheme for Strict Phase Rotation input : s, H output : W∗ Initialize i = [ ], I = ∅, N = [1], t = 1, and n = 0; Calculate T based on (20); Obtain V = ℜ (T); Calculate a based on (59) and c based on (61); T Calculate G = V − aac ; Calculate u = ac ; Obtain S based on (79); if card (S) = ∅ then Obtain u∗ = u; else while min (u) < 0 and n < nmax do d = sort (u); find k such that µk = dt ; Stack N = N 1 ; Update i and I; Formulate Z based on I and G; Calculate q̃ based on I and Z with (92); if min (q̃) ≥ 0 then Update u based on (87); t = 1; else find k such that qk = min (q̃); find m such that im = k; Set i based on (95); Update I; Formulate Z based on I and G; Update q̃ with (92); Update u with (86); Reformulate N = N (1 : m); Update N (m) ← N (m) + 1; Update t = N (m); end if n ← n + 1; end while Obtain u∗ = u; end if Calculate W∗ based on the obtained u∗ with (29). Based on the above description, we summarize the proposed scheme for strict phase rotation in Algorithm 1. Since the algorithm will find the u and q that satisfy the KKT conditions for optimality, the obtained u is therefore the optimal solution to the optimization problem P4 for strict phase rotation, and the optimal beamforming matrix can be obtained with (29) accordingly. While the algorithm is for the case of the strict phase rotation, it is trivial to extend to the case of non-strict phase rotation by substituting V with V̂ in (48) to obtain the optimal û∗ . Subsequently, the optimal beamforming matrix for non-strict phase rotation is obtained with (50). We note that, while the above algorithm includes an iterative design, within each iteration a closed-form solution is indeed obtained and the algorithm only includes linear matrix manipulations, which is computationally efficient. Moreover, it will be shown that the number of iterations required is small, especially when the number of users is small. We further note that, while the KKT optimality conditions are not satisfied before the final iteration, the solution obtained within each iteration is indeed a feasible solution that satisfies the power constraint for the beamforming and achieves an improved performance over ZF but a sub-optimal performance compared to the optimal CI beamforming. Indeed, the obtained beamformer in each iteration approaches the optimal beamforming strategy with the increasing iteration number. Therefore, the proposed iterative scheme can also achieve a flexible performance-complexity tradeoff by limiting the maximum number of iterations nmax in Algorithm 1. The complexity gain of the proposed scheme and the performancecomplexity tradeoff will both be numerically studied in the following section. VI. N UMERICAL R ESULTS In this section, the numerical results of the proposed schemes are presented and compared with the traditional CI beamforming based on the Monte Carlo simulations. In each plot, we assume the total transmit power available as p0 = 1,  and the transmit SNR per antenna as ρ = 1 σ 2 . We compare our proposed iterative schemes with the traditional closedform ZF-based methods, optimization-based SINR balancing approaches [7][10], and CI beamforming approaches P1 and P5 for both strict and non-strict phase rotation. For clarity the following abbreviations are used throughout this section: 1) ‘ZF’: traditional ZF scheme with symbol-level power normalization in (52) and (53); 2) ‘RZF’: traditional RZF scheme with symbol-level power normalization, where the precoded signal vector is given by  −1 K 1 H H ·I s (97) xRZF = WRZF s = ·H HH + f ρ with the symbol-level scaling factor f given by f= kWRZF skF ; √ p0 (98) 12 100 100 QPSK 10 -2 10 ZF RZF SINR Balancing CI-opt, Strict CI-opt, Non-strict CI-CF, Strict CI-CF, Non-strict -3 10 -4 10 -5 BER -1 BER 10 0 5 QPSK 10 15 20 25 30 10 -1 10 -2 10-3 10 -4 10 -5 10 -6 ZF RZF SINR Balancing CI-opt, Strict CI-opt, Non-strict CI-CF, Strict CI-CF, Non-strict 0 5 10 SNR (dB) Fig. 4: BER v.s. transmit SNR, QPSK, Nt = K = 8 25 30 102 Average number of required iterations 8PSK BER 10-1 10 20 Fig. 6: BER v.s. transmit SNR, QPSK, Nt = K = 12 100 10 15 SNR (dB) ZF RZF SINR Balancing CI-opt, Strict CI-opt, Non-strict CI-CF, Strict CI-CF, Non-strict -2 -3 0 5 10 15 20 25 30 SNR (dB) Fig. 5: BER v.s. transmit SNR, 8PSK, Nt = K = 8 3) ‘SINR Balancing’: the SINR balancing approach based on bisection search method [7]; 4) ‘CI-opt, Strict/Non-Strict’: traditional CI beamforming, P1 for strict phase rotation and P5 for non-strict phase rotation; 5) ‘CI-CF, Strict/Non-Strict’: the proposed iterative closedform scheme for strict/non-strict phase rotation based on Algorithm 1. In Fig. 4, we compare the bit error rate (BER) performance of different schemes with QPSK modulation, and Nt = K = 8. As can be observed, the CI beamforming approaches for both strict phase rotation and non-strict phase rotation achieve an improved performance over the ZF approach, and the gain for non-strict phase rotation is more significant. For the CI beamforming for non-strict phase rotation at high SNR regime, we observe a SNR gain of more than 10dB over ZF and 8dB SNR gain over RZF. Moreover, we observe that the proposed iterative closed-form algorithm achieves exactly the same performance as the optimization-based CI beamforming, which validates the effectiveness of the proposed method in 10 QPSK Nt =K 1 100 10-1 CI-CF, Strict, K=N t 10-2 CI-CF, Non-strict, K=N t Nt =16 CI-CF, Strict, N t =16 CI-CF, Non-strict, N t =16 10 -3 4 6 8 10 12 14 16 Number of users, K Fig. 7: Average number of iterations required for the iterative closed-form scheme, QPSK, Nt = K and Nt = 16 Section V. In Fig. 5, we show the BER performance with respect to the increasing transmit SNR when 8PSK modulation is employed, where Nt = K = 8. Similarly, both transmit beamforming approaches based on the CI achieve an improved performance over the ZF method, and the proposed iterative closed-form schemes achieve the same performance as the optimizationbased schemes. At high SNR (ρ > 20dB), both CI-based approaches outperform the ZF-based schemes. For CI with non-strict phase rotation, we observe a SNR gain of over 7dB compared to ZF, and a SNR gain of 5dB compared to RZF precoding. Fig. 6 shows the BER performance of different schemes for QPSK with Nt = K = 12, where a similar BER trend can be observed. Particularly, comparing Fig. 4 and Fig. 6, we observe that the performance gains of the CI-based approaches over the conventional ZF precoding are more significant with the increasing number of antennas and users. In Fig. 7, the average number of iterations required for 10-2 ZF RZF CI-opt, Strict CI-opt, Non-strict CI-CF, Strict CI-CF, Non-strict Execution time per channel realization (s) 13 BER QPSK 10 -3 0 1 2 3 4 5 6 Maximum number of iterations, n max Fig. 8: BER v.s. maximum number of iterations nmax , QPSK, Nt = K = 4, SNR=30dB the proposed iterative scheme is numerically studied with the increasing number of users, where we include two cases of Nt = K and Nt = 16. We observe that the average number of iterations increases with the increase in the number of users, as a larger number of users means a high possibility that more entries in a can be negative. The non-strict phase rotation requires more iterations than the strict phase rotation because the problem size is doubled. We also observe that when the number of users K is small, the average number of iterations can be smaller than 1 because the number of iterations is zero when S = ∅. To show the flexible performance-complexity tradeoff for the proposed algorithm, in Fig. 8 we depict the BER performance of the proposed iterative approach with respect to the maximum iteration number nmax , where Nt = K = 4. As expected, we observe that the performance of the iterative approach is identical to the conventional ZF approach when nmax = 0. With nmax increases, the performance of the iterative method approaches the optimal CI-based beamforming, which validates our statement in Section V-C. In Fig. 9, we compare the execution time required for each scheme to show the complexity benefits of the proposed iterative closed-form scheme over 5000 channel realizations, where ‘CI-QP, Strict/Non-Strict’ refers to the QP optimizations P4 and P8 , and ‘CI-SOCP, Strict/Non-Strict’ refers to the SOCP optimizations P1 and P5 . It is observed that the optimization for non-strict phase rotation requires more time to obtain the optimal solution that the strict-phase rotation because of the larger problem size. It is also observed that solving the equivalent QP optimization is much faster than solving the original SOCP optimization. More importantly, our proposed iterative scheme is more time-efficient than the QP algorithms, which motivates the use of the symbol-level CI beamforming in practice. VII. C ONCLUSION In this paper, we study the symbol-level downlink beamforming schemes based on CI, where both the strict and non- 102 10 1 10 0 10 ZF RZF SINR Balancing CI-SOCP, Strict CI-SOCP, Non-strict CI-QP, Strict CI-QP, Non-Strict CI-CF, Strict CI-CF, Non-strict QPSK -1 10-2 10-3 10 -4 4 6 8 10 12 14 16 18 20 Number of users K, N t =K Fig. 9: Execution time required for different schemes, QPSK, Nt = K, 5000 channel realizations strict phase rotation cases are considered. By analyzing the optimization problems with Lagrangian and KKT conditions, we firstly obtain the optimal structure of the beamforming matrix, and further transform the optimization into a QP over a simplex by formulating the dual problem. We show that the optimizations for strict and non-strict phase rotation are equivalent in terms of the problem formulation. We further illustrate that ZF precoding is a special case and lowerbound of the CI beamforming. The proposed iterative closedform scheme is shown to achieve an identical performance to the optimization-based schemes with a reduced computational cost, which enables the use of symbol-level CI beamforming in practical wireless systems. R EFERENCES [1] L. Zheng and D. N. C. Tse, “Diversity and Multiplexing: A Fundamental Tradeoff in Multiple-Antenna Channels,” IEEE Trans. Inf. Theory, vol. 49, no. 5, pp. 1073–1096, May 2003. [2] M. Costa, “Writing on Dirty Paper,” IEEE Trans. Inf. Theory, vol. IT-29, no. 3, pp. 439–441, May 1983. [3] L. Sun and M. Lei, “Quantized CSI-based Tomlinson-Harashima Precoding in Multiuser MIMO Systems,” IEEE Trans. Wireless Commun., vol. 12, no. 3, pp. 1118–1126, Mar. 2013. [4] B. M. Hochwald, C. B. Peel, and A. L. Swindlehurst, “A VectorPerturbation Technique for Near-Capacity Multiantenna Multiuser Communication-part II: Perturbation,” IEEE Trans. Commun., vol. 53, no. 3, pp. 537–544, Mar. 2005. [5] T. Haustein, C. von Helmolt, E. Jorswieck, V. Jungnickel, and V. Pohl, “Performance of MIMO Systems with Channel Inversion,” in Vehicular Technology Conference. IEEE 55th Vehicular Technology Conference. VTC Spring 2002 (Cat. No.02CH37367), vol. 1, 2002, pp. 35–39. [6] C. B. Peel, B. M. Hochwald, and A. L. Swindlehurst, “A VectorPerturbation Technique for Near-Capacity Multiantenna Multiuser Communication-part I: Channel Inversion and Regularization,” IEEE Trans. Commun., vol. 53, no. 1, pp. 195–202, Jan. 2005. [7] A. Wiesel, Y. C. Eldar, and S. Shamai (Shitz), “Linear Precoding via Conic Optimization for Fixed MIMO Receivers,” IEEE Trans. Sig. Process., vol. 54, no. 1, pp. 161–176, Jan. 2006. [8] M. F. Hanif, L.-N. Tran, A. Tolli, and M. Juntti, “Computationally Efficient Robust Beamforming for SINR Balancing in Multicell Downlink with Applications to Large Antenna Array Systems,” IEEE Trans. Commun., vol. 62, no. 6, pp. 1908–1920, June 2014. 14 [9] F. Wang, X. Wang, and Y. Zhu, “Transmit Beamforming for Multiuser Downlink with Per-Antenna Power Constraints,” in 2014 IEEE International Conference on Communications (ICC), Sydney, NSW, 2014, pp. 4692–4697. [10] M. Schubert and H. Boche, “Solution of the Multiuser Downlink Beamforming Problem with Individual SINR Constraints,” IEEE Trans. Veh. Tech., vol. 53, no. 1, pp. 18–28, Jan. 2004. [11] M. Bengtsson and B. Ottersten, “Optimal and Suboptimal Transmit Beamforming,” Handbook of Antennas in Wireless Communications, Jan. 2001. [12] N. D. Sidiropoulos, T. N. Davidson, and Z.-Q. Luo, “Transmit Beamforming for Physical-Layer Multicasting,” IEEE Trans. Sig. Process., vol. 54, no. 6, pp. 2239–2251, June 2006. [13] E. Karipidis, N. D. Sidiropoulos, and Z.-Q. Luo, “Quality of Service and Max-Min Fair Transmit Beamforming to Multiple Cochannel Multicast Groups,” IEEE Trans. Sig. Process., vol. 56, no. 3, pp. 1268–1279, Mar. 2008. [14] C. Masouros, T. Ratnarajah, M. Sellathurai, C. B. Papadias, and A. K. Shukla, “Known Interference in the Cellular Downlink: A Performance Limiting Factor or a Source of Green Signal Power?” IEEE Commun. Mag., vol. 51, no. 10, pp. 162–171, Oct. 2013. [15] G. Zheng, I. Krikidis, C. Masouros, S. Timotheou, D. A. Toumpakaris, and Z. Ding, “Rethinking the Role of Interference in Wireless Networks,” IEEE Commun. Mag., vol. 52, no. 11, pp. 152–158, Nov. 2014. [16] C. Masouros and E. Alsusa, “A Novel Transmitter-Based SelectivePrecoding Technique for DS/CDMA Systems,” IEEE Sig. Process. Lett., vol. 14, no. 9, pp. 637–640, Sept. 2007. [17] ——, “Dynamic Linear Precoding for the Exploitation of Known Interference in MIMO Broadcast Systems,” IEEE Trans. Wireless Commun., vol. 8, no. 3, pp. 1396–1401, Mar. 2009. [18] C. Masouros, “Correlation Rotation Linear Precoding for MIMO Broadcast Communicaitons,” IEEE Trans. Sig. Process., vol. 59, no. 1, pp. 252–262, Jan. 2011. [19] C. Masouros and G. Zheng, “Exploiting Known Interference as Green Signal Power for Downlink Beamforming Optimization,” IEEE Trans. Sig. Process., vol. 63, no. 14, pp. 3628–3640, July 2015. [20] M. Alodeh, S. Chatzinotas, and B. Ottersten, “Constructive Multiuser Interference in Symbol Level Precoding for the MISO Downlink Channel,” IEEE Trans. Sig. Process., vol. 63, no. 9, pp. 2239–2252, May 2015. [21] ——, “Energy-Efficient Symbol-Level Precoding in Multiuser MISO based on Relaxed Detection Region,” IEEE Trans. Wireless Commun., vol. 15, no. 5, pp. 3755–3767, May 2016. [22] C. Masouros, M. Sellathurai, and T. Ratnarajah, “Vector Perturbation based on Symbol Scaling for Limited Feedback MISO Downlinks,” IEEE Trans. Sig. Process., vol. 62, no. 3, pp. 562–571, Feb. 2014. [23] M. Alodeh, S. Chatzinotas, and B. Ottersten, “Symbol-Level Multiuser MISO Precoding for Multi-Level Adaptive Modulation,” IEEE Trans. Wireless Commun., vol. 16, no. 8, pp. 5511–5524, Aug. 2017. [24] C. Masouros and T. Ratnarajah, “Interference as a Source of Green Signal Power in Cognitive Relay Assisted Co-Existing MIMO Wireless Transmissions,” IEEE Trans. Commun., vol. 60, no. 2, pp. 525–536, Feb. 2012. [25] K. L. Law, C. Masouros, and M. Pesavento, “Transmit Precoding for Interference Exploitation in the Underlay Cognitive Radio Z-Channel,” IEEE Trans. Sig. Process., vol. 65, no. 14, pp. 3617–3631, July 2017. [26] P. V. Amadori and C. Masouros, “Constant Envelope Precoding by Interference Exploitation in Phase Shift Keying-Modulated Multiuser Transmission,” IEEE Trans. Wireless Commun., vol. 16, no. 1, pp. 538– 550, Jan. 2017. [27] S. Timotheou, G. Zheng, C. Masouros, and I. Krikidis, “Exploiting Constructive Interference for Simultaneous Wireless Information and Power Transfer in Multiuser Downlink Systems,” IEEE J. Sel. Areas Commun., vol. 34, no. 5, pp. 1772–1784, May 2016. [28] A. Li and C. Masouros, “Exploiting Constructive Mutual Coupling in P2P MIMO by Analog-Digital Phase Alignment,” IEEE Trans. Wireless Commun., vol. 16, no. 3, pp. 1948–1962, Mar. 2017. [29] L. Vandenberghe and S. Boyd, Convex Optimization. Cambridge University Press, 2004. [30] P. Wolfe, “The Simplex Method for Quadratic Programming,” Econometrica, vol. 27, no. 3, pp. 382–398, July 1959. [31] G. Cornuejols and R. Tutuncu, Optimization Methods in Finance. Cambridge University Press, Dec. 2006.
7cs.IT
RapidMind: Portability across Architectures and its Limitations Iris Christadler and Volker Weinberg arXiv:1001.1902v2 [cs.PF] 19 Feb 2010 Leibniz-Rechenzentrum der Bayerischen Akademie der Wissenschaften, D-85748 Garching bei München, Germany Abstract. Recently, hybrid architectures using accelerators like GPGPUs or the Cell processor have gained much interest in the HPC community. The “RapidMind Multi-Core Development Platform” is a programming environment that allows generating code which is able to seamlessly run on hardware accelerators like GPUs or the Cell processor and multi-core CPUs both from AMD and Intel. This paper describes the ports of three mathematical kernels to RapidMind which have been chosen as synthetic benchmarks and representatives of scientific codes. Performance of these kernels has been measured on various RapidMind backends (cuda, cell and x86) and compared to other hardware-specific implementations (using CUDA, Cell SDK and Intel MKL). The results give an insight into the degree of portability of RapidMind code and code performance across different architectures. 1 Introduction The vast computing horsepower which is offered by hardware accelerators and their usually good power efficiency has aroused interest of the high performance computing community in these devices. The first hybrid system which entered the Top500 list [1] was the TSUBAME cluster at Tokyo Institute of Technology in Japan. Several hundred Clearspeed cards were used to accelerate an Opteron based cluster; the system was ranked No. 9 in the Top500 list in November 2006. Already in June 2006, a sustained Petaflop/s application performance was firstly reached with the RIKEN MD-GRAPE 3 system in Japan, a special purpose system dedicated for molecular dynamics simulations. In 2008, the first system ever to reach a sustained High Performance LINPACK (HPL) performance of more than one Petaflop/s was “Roadrunner”, the No. 1 system on the lists in July 2008 and November 2008. Roadrunner is a hybrid system based on Opteron processors and accelerated with PowerXCell8i processors, a variant of the Cell B.E. (Broadband Engine) with increased double-precision capability. However, applicability of hardware accelerators for general-purpose HPC systems is still a source of debate. In 2008, the landscape was quite diverse; many different hardware solutions existed (Cell, Nvidia and AMD/ATI GPUs, ClearSpeed accelerator boards, FPGA based systems) and every system had its own programming language and paradigm. At the same time, the x86 processors started to become multi-core processors and first HPC systems were based on hundred thousands of cores. Improving the scalability of HPC codes to be able to utilize the increased core counts was already difficult for the scientific communities; trying to add support for one of the new accelerators was a huge porting effort with a high risk: what if either the hardware or the software would not be supported on the long run? Solutions which offered support for different hardware architectures became appealing. While in the meantime several solutions (e.g. OpenCL [2], PGI accelerator compiler [3], CAPS hmpp [4], StarSs [5]) exist which provide an abstraction of the underlying hardware characteristics from the programmer, the situation was different two years ago: RapidMind Inc. was one of the first companies providing support for general purpose computing on graphic processing units, nowadays known as GPGPUs. RapidMind started in 2004 based on the academic research related to the Sh project [6] at the University of Waterloo. Their work was started at a time when the first “programmable” GPUs were just released and the only way to program these devices was by using “shading languages”. Already at that time people tried porting simulation codes to GPUs [7]. Since then, RapidMind has subsequently added the Cell processor backend (2007) and the x86 multi-core processor backend with the rise of multi-core processor CPUs for the consumer market (2008). In 2009, version 4.0 was released which introduced the cuda backend, necessary to support double-precision arithmetic on GPUs. Even today, RapidMind is still the only product that fully supports Cell, GPUs and multi-core CPUs. All other solutions are either limited by the hardware which they support or require an adaptation of the code. At SC06 a paper was published which showed impressive performance gains by using RapidMind for porting three algorithms (SGEMM, FFT and BlackScholes) to the GPU [8]. This is a follow-on work assessing the state-of-theart three years later. However, the main reason for choosing RapidMind for a deeper investigation has been its programming paradigm which differs from serial programming languages and abstracts the massive parallelism of the underlying hardware more than any other language concept currently discussed for HPC. 2 2.1 Overview Software The “RapidMind Multi-Core Development Platform” promises easy and portable access not only to multi-core chips from Intel and AMD but also to hardware accelerators like GPUs and Cell. The basic concept of the RapidMind language is called “data-stream processing”; a powerful technology to express data parallelism. A simple example of a RapidMind program is given in Fig. 1 (a). Figure 1 (b) represents a schematic view of the executed stream program. A call to a RapidMind program can be inserted in any valid C++ program and needs to include the RapidMind library in the header of the file and during linkage. Unless specified explicitly, the RapidMind runtime environment will automatically search for available accelerator hardware and compile the program at runtime using the RapidMind backend for the detected hardware. #include <rapidmind/platform.hpp> using namespace RapidMind; ... // declaration Array<1, Value4i> input; Array<1, Value4f> output; Array<1,Value4i> input Array<1,Value4f> output 1 Program example= BEGIN { 1.1 7 In<value4i> input; Out<value4f> output; 7.1 output= input + 0.1f; Program example = BEGIN { // program definition } END; // program call output = example(input); 5 5.1 } END; 9 (a) 9.1 (b) Fig. 1. RapidMind programming scheme RapidMind adds special types and functions to C++ which allow the programmer to define sequences of operations (RapidMind programs) on streams of data (special arrays). With these, data dependencies and data workflows can be easily expressed and will naturally contain all necessary information for an efficient (data-) parallelization. The compiler and the runtime environment then have maximum information to decide how to auto-parallelize the code. The structure of RapidMind code forces the programmer to decide early in the development process which operations could be performed in parallel without any side-effects. This usually results in many small code snippets that can run in parallel which is optimal to fill the pipeline of a GPU or other massively parallel devices. 2.2 Hardware Hardware 1 C1060 GPU 1 Tesla S1070 Nehalem-EP (2.53 GHz, 1 core) Nehalem-EP (2.53 GHz, 8 cores) 1 PowerXCell8i (8 SPUs) 1 QS22-blade 2 PowerXCell8i (16 SPUs) SP peak perf. 933 GFlop/s 4140 GFlop/s 20 GFlop/s 162 GFlop/s 205 GFlop/s 410 GFlop/s DP peak perf. 78 GFlop/s 345 GFlop/s 10 GFlop/s 81 GFlop/s 102 GFlop/s 205 GFlop/s Table 1. Hardware overview Three different platforms are used for the performance measurements. An Nvidia Tesla based system is used to measure the cuda backend from RapidMind against implementations based on CUDA and the CUDA libraries cuBLAS and cuFFT. Tesla is Nvidia’s first dedicated general purpose GPU with enhanced double-precision capability. A C1060 supports partly IEEE-754, consists of 240 thread processors with an overall performance of 78 GFlop/s in double-precision and 933 GFlop/s in single-precision. One Nvidia Tesla S1070 1U rack consists of four C1060 computing processors with a total single-precision performance of around 4 TFlop/s. An IBM QS22-blade based system is used to compare RapidMind’s cell backend with code using Cell intrinsics which is taken from the SDK. Each QS22blade hosts two PowerXCell8i, the processors used to accelerate Roadrunner [9]. Each PowerXCell8i is running at 3.2 GHz, is partly IEEE-754 conform and has a single-precision peak performance of 204.8 GFlop/s and a double-precision peak performance of 102.4 GFlop/s. A QS22-blade has therefore a total of slightly more than 400 GFlop/s single-precision performance. The main difference between the Cell processor and GPUs or current multi-core CPUs is its inhomogeneity; eight synergistic processor units (SPUs) are added to one PowerPC processor unit (PPU). The Cell processor has a very good performance per Watt ratio and the 6 most energy efficient supercomputers, as ranked by Green500 [10] in November 2009, are based on PowerXCell8i technology. RapidMind’s x86 backend is benchmarked against code using Intel’s Math Kernel Library (MKL) on one of the latest Intel processors, a Xeon E5540 known as “Nehalem-EP”. A Nehalem-EP core running at 2.53 GHz has a singleprecision peak performance slightly above 20 GFlop/s and a double-precision peak performance of around 10 GFlop/s. One Nehalem-EP node consists of 2 sockets with four cores per socket. A Nehalem-EP node with 8 cores reaches 162 GFlop/s single and 81 GFlop/s double-precision performance. The performance figures of all three architectures are summarized in Table 1. Since the double-precision peak performance of one Nehalem-EP node (8 cores, 81 GFlop/s) is quite comparable with the double-precision performance of 1 Nvidia C1060 GPU (78 GFlop/s) and 1 PowerXCell8i (102 GFlop/s) we tried to compare these platforms directly where possible. 3 The RapidMind ports and their performance To judge the suitability of recent accelerator hardware for scientific computing and high-performance computing, three mathematical kernels from the Euroben benchmark suite [11] have been chosen: – mod2am: a dense matrix-matrix multiplication, – mod2as: a sparse matrix-vector multiplication, – mod2f: a one-dimensional Fast Fourier Transformation (FFT). The kernels have been selected to show both the advantages and the pitfalls of current accelerators. They are representatives of three (dense linear algebra, sparse linear algebra and spectral methods) of the “seven dwarfs”, an ontology for scientific codes introduced by [12]. According to Fig. 11 in [13] these three dwarfs account for approximately one third of the workload of current European HPC Tier-1 centers. The selection of kernels was performed by the EU FP7project PRACE, published in [14] and should be extended to cover all important dwarfs in the future. 3.1 Dense matrix-matrix multiplication (mod2am) The dense matrix-matrix multiplication (C = A × B) is one of the most basic algorithms used in scientific computing. It is the basis of the High Performance LINPACK code, which determines the Top500 rank of a system. The schoolbook version of the algorithm is composed of three nested for-loops. Many sophisticated optimization strategies exist, and one of the fastest implementations is the MKL version. Making use of the MKL functions is straightforward and basically needs a call to cblas dgemm (double-precision arithmetic) or cblas sgemm (single-precision arithmetic). A first implementation in RapidMind is straightforward. In a first step, the RapidMind data types must be used to express the matrices A (of size m × l), B (l × n) and C (m × n). All matrices can be represented by two-dimensional arrays of floating point data: Array<2,Value1f> A(m,l); Array<2,Value1f> B(l,n); Array<2,Value1f> C(m,n); In a second step the RapidMind program mxm needs to be declared. Since there are no clear data streams which could be fed into the program a helper index array is used. This index array ensures that the defined program mxm can sum up the corresponding entries of the input matrices A and B. All matrices are automatically transferred to the GPU memory at execution time. The RapidMind control flow construct RM FOR is used to allow manipulation of the streamed data. Program mxm = BEGIN { In<Value2i> ind; Out<Value1f> c = Value1f(0.); Value1i k; // Computation of C(i,j) RM_FOR (k=0, k < Value1i(l), k++) { c += A[Value2i(ind(0),k)]*B[Value2i(k,ind(1))]; } RM_ENDFOR; } END; The call to the RapidMind program then looks as follows: C= mxm(grid(m,n)); The call to the RapidMind function grid(m,n) generates a virtual helper array of size m × n which does not require additional storage. The whole helper array is automatically initialized with integers from (0, 0) to (m, n) and is directly passed to the program and used for the index computation. After this first naive approach a second, GPU-optimized version of the matrix multiplication has been produced. This version is based on code available at the RapidMind developer portal [15]. The basic difference between both versions is the fact, that the GPU-optimized version operates on arrays of Value4f, to optimal use the GPU vector registers; 4 × 4 submatrices are multiplied and accumulated. Dense matrix-matrix multiplication (mod2am, simple version) 100 10 1 GFlop/s RM gpu-opt version (sp) cuda, 1 C1060, sp cuda, 1 C1060, dp 0.1 x86, 8 N-EP, sp x86, 8 N-EP, dp 0.01 0.001 8 16 32 64 128 256 512 1024 2048 4096 8192 Matrix size (m) Fig. 2. Performance comparison of the simple mod2am version on various RapidMind backends and associated hardware. The simple version is also compared to the GPUoptimized version running on 1 C1060 GPU in single-precision. Figure 2 1 shows the performance of the simple version using the cuda and x86 RapidMind backends and compares the single-precision cuda backend performance with the GPU-optimized version. It can be seen that the GPU-optimized version is indeed four times faster than the naive approach for single-precision arithmetic. This means that the use of Value4f instead of Value1f really improves performance. It is important to note, that neither the language nor the program definition of the simple approach should prevent the compiler from doing this optimization by itself. 1 Time is always measured for the execution of the whole kernel. This includes the time to transfer data between host and accelerator for GPU and Cell results. The y-axis uses log-scale to better cover the whole performance range for all matrix sizes. Dense matrix-matrix multiplication (mod2am, gpu-version, dp) 100 10 GFlop/s 1 MKL (8 N-EP cores) CUDA (C1060 GPU) RapidMind gpu-opt. (C1060 GPU) 0.1 RapidMind gpu-opt. (8 N-EP cores) 0.01 0.001 8 16 32 64 128 256 512 1024 2048 4096 Matrix size(m) Fig. 3. Performance comparision of the GPU-optimized version on various backends. Performance measurements have been performed both on an Nvidia GPU and a Nehalem-EP socket with eight cores. The RapidMind version is compared to a CUDA version based on cuBLAS and an MKL implementation of the dense matrix-matrix multiplication. Performance measurements are based on double-precision arithmetic. Dense matrix-matrix multiplication (mod2am, cell-version, sp) 1000 100 GFlop/s Cell SDK (16 SPUs) Cell SDK (8 SPUs) MKL (8 N-EP cores) RapidMind cell-opt. (16 SPUs) RapidMind cell-opt. (8 SPUs) 10 RapidMind cell-opt. (8 N-EP cores) 1 64 128 256 512 1024 2048 4096 8192 Matrix size (m) Fig. 4. Performance comparison of the Cell-optimized version on various RapidMind backends. Performance measurements have been performed on 1 PowerXCell8i (8 SPUs), 1 QS22-blade (16 SPUs) and an 8-core Nehalem-EP node. The RapidMind version is compared to a dense matrix-matrix multiplication example from the Cell SDK and the MKL implementation. All performance results are based on single-precision arithmetic. Measurements for double-precision reveal that the simple approach is actually faster than the GPU-optimized version. This is counterintuitive and only becomes understandable if one takes into account, that the cuda backend is the latest RapidMind backend and was introduced with version 4.0 in July 2009. The target of this version was to enable RapidMind to support Nvidia Tesla cards; a RapidMind version with improved performance of the cuda backend was scheduled for version 4.1. Figure 3 shows the performance of the GPU-optimized version on various backends and compares it with hardware-specific languages (CUDA and MKL). It shows that the performance of the RapidMind implementation is more than an order of magnitude slower than the MKL implementation, while the difference between RapidMind and CUDA performance is only a factor of 3. Comparing Fig. 2 with Fig. 3 reveals that the performance difference between the two RapidMind implementations varies extremely for certain matrix sizes, although the implementations vary only slightly. The performance of both the simple version and the GPU-optimized version are not able to deliver decent performance on the Cell platform. A third version optimized for the Cell processor is based on another code available through the RapidMind developer portal. This time, computation is performed using a block partitioning of 64 by 64 blocks. All matrices are in a “block swizzled” format so that these blocks are contiguous in memory. The computations and memory transfers are overlapped using double buffering and are partly based on the matrix-matrix multiplication example from the IBM Cell SDK (/opt/cell/sdk/src/demos/matrix mul/). The Cell SDK version is also used for performance comparison. Figure 4 gives an insight into the performance of the Cell-optimized version. Again the RapidMind figures have been compared with implementations in other languages. Since the Cell SDK version is based on single-precision arithmetic, it has been compared to single-precision results obtained with the RapidMind cell and x86 backends and an SGEMM implementation using MKL on 8 Nehalem-EP cores. This time, the RapidMind version is able to nearly meet the performance of the hardware-specific and highly optimized Cell SDK version; it reaches 88% of the SDK version. However, this comes at the price of a hardware-specific RapidMind implementation and contradicts the idea of seamlessly portable code. In conclusion, the three different implementations illustrate the current limitations of code and performance portability. Hardly any problems were experienced when moving the code to other platforms, but in many cases the performance was not predictable. Tuning the code to better exploit certain characteristics of the employed hardware normally yields better performance but requires to stick with this hardware. The idea behind RapidMind is that the language and program definitions are generic enough to allow the compiler to do hardware-specific optimizations itself. 3.2 Sparse matrix-vector multiplication (mod2as) Sparse linear algebra is another building block of many scientific algorithms. The sparse matrix-vector multiplication exposes a low computational intensity and is usually memory bound. It is a good example for code that will not perform well on recent hardware accelerators on which the transfer between the x86 host memory and the accelerator memory is a severe bottleneck. Even x86 hardware will only run at a small percentage of its theoretical peak performance. While mod2am reaches more than 90% of peak, mod2as runs at rates less than 5% of peak on Nehalem-EP. Since this algorithm is not well suited for accelerators, we provided only one RapidMind mod2as implementation and put a special focus on the performance achieved with the x86 backend on Nehalem-EP (shown in Fig. 5). The implementation of mod2as is based on [16]. The input matrix A of mod2as is stored in a 3-array variation of the CSR (compressed sparse row) format which can be easily transferred to RapidMind. The array matvals contains the non-zero elements of A, the element i of the integer array indx is the number of the column in A that contains the i-th value in the matvals array and element j of the integer array rowp gives the index of the element in the matvals array that is the first non-zero element in row j of A. The input and output vectors are declared as: Array<1,Value1i> indx(nelmts); Array<1,Value1i> rowp(nrows+1); Array<1,Value1f> matvals(nelmts); Array<1,Value1f> invec(ncols); Array<1,Value1f> outvec(nrows); Once again a helper array based on a call to grid(nrows) is created and used as input vector to allow the correct index computation. The RapidMind program is very clean: using RapidMind’s RM FOR() control structure, the program loops over one row of the input matrix and computes the matrix-vector product. Program spMXV = BEGIN { In<Value1i> i; Out<Value1f> c; c = Value1f(0.); Value1i j; RM_FOR(j=rowp[i], j < rowp[i+1] , j++) { c += matvals[j] * invec[indx[j]]; } RM_ENDFOR; } END; Sparse matrix-vector multiplication (mod2as, dp) 10000 1000 Performance in MFlop/s 100 10 MKL (8 N-EP cores) CUDA (C1060 GPU) RapidMind (8 N-EP cores) 1 RapidMind (C1060 GPU) RapidMind (Cell, 8 SPUs) 0.1 0.01 0.001 64 128 256 512 1024 2048 4096 8192 #Rows Fig. 5. Performance comparison of the sparse matrix-vector multiplication. Performance results for the RapidMind implementation on various backends are given and compared with implementations in CUDA and based on MKL. The difference between the MKL and the RapidMind x86-results is less than a factor of 3 for big matrix sizes. 3.3 One-dimensional Fast Fourier Transformation (mod2f ) The Fast Fourier Transformation (FFT) is widely used in many scientific programs. Its computational intensity is not as high as for mod2am, but is already in a range where accelerators should be beneficial. The RapidMind version of mod2f computes the FFT using a split-stream algorithm as described in [17]. The implementation is a straightforward conversion of a one butterfly CooleyTukey radix-2 FFT; the butterfly kernels are defined as RapidMind programs. Figure 6 gives the achieved performance for different platforms and shows that one implementation is able to deliver performance on at least two backends. 4 Conclusions and Future Work The work presented in this paper has shown that RapidMind really offers code portability across various architectures, both multi-core x86 CPUs and accelerators like GPUs or the Cell processor. Using RapidMind for the Euroben kernels has been straightforward: the code development of the first naive implementation took only a few days for each. Adapting the original version to new backends comes practically for free and is a matter of hours and of getting used to the new environments. However, performance portability differs: code written naturally without a deep understanding of the hardware and RapidMind’s internal mode of operation will not deliver optimal performance in most circumstances and hardly exploit Fast Fourier Transformation (mod2f, sp) 100 10 1 GFlop/s MKL (1 N-EP core) CUDA (C1060 GPU) RapidMind (C1060 GPU) 0.1 RapidMind (8 N-EP cores) RapidMind (Cell, 8 SPUs) 0.01 0.001 256 1024 4096 16384 65536 262144 1048576 Length Fig. 6. Performance comparison of the one-dimensional Fast Fourier Transformation. The RapidMind implementation is compared to a CUDA version of mod2f based on cuFFT and the corresponding MKL implementation. The gap between the RapidMind cuda-results and the highly-optimized cuFFT version is a factor of 5, the difference between the x86-results and the MKL version is again less than a factor of 3. the potential of the hardware. For mod2am, the highly optimized cell-version is able to reach 88% of the SDK implementation but will deliver poor performance when used on GPUs. The fastest mod2am implementation using CUDA is three times faster than any RapidMind code. For none of the used benchmarks, RapidMind code was able to fully reach the performance of hardware-specific implementations. This is not a big surprise, since it is one of the drawbacks of the achieved code portability. But it is important to state, that the language design optimally supports the compiler. To efficiently use this information to full capacity requires that many people constantly improve all backends, adapting them to the latest hardware and its accompanying language features. Recently, RapidMind Inc. has been acquired by Intel. Their product will dissolve in Intel’s new language Ct (C for throughput computing) [18]. The basic concepts of both languages have always been very similar. The acquisition has pros and cons: on one hand, it is up to speculations if – or when – Ct will support non-Intel architectures. On the other hand, Intel has much experience with mantaining high-performance compilers and analyzing tools. Future work will focus on Intel’s Ct and other approaches that are able to deliver support for multiple accelerators. This might include OpenCL, the PGI accelerator compiler, hmpp from CAPS and the StarSs concept. Our work will focus on the question of portability, both in terms of source code and in terms of achievable performance. The number of kernels will be increased to get a better coverage of the “Berkeley dwarfs”. Acknowledgements This work was financially supported by the KONWIHR-II project “OMI4papps” and by the PRACE project funded in part by the EU’s 7th Framework Programme (FP7/2007-2013) under grant agreement no. RI-211528. We specially thank our colleague Hans Hacker for providing the CUDA ports and performance figures, and JSC and CEA for access to their accelerator systems and support. References 1. 2. 3. 4. 5. The Top500 supercomputing sites, http://www.top500.org/ OpenCL, http://www.khronos.org/opencl/ PGI Accelerator Compiler, http://www.pgroup.com/resources/accel.htm CAPS hmpp workbench, www.caps-entreprise.com/hmpp.html J. Planas, R. M. Badia, E. Ayguade, J. Labarta: Hierarchical Task-Based Programming with StarSs, The International Journal of High Performance Computing Applications, Vol. 23, No. 3, 284-299 (2009) 6. Sh project, http://libsh.org/ 7. M. Ernst, Ch. Vogelgsang, G. Greiner: Stack Implementation on Programmable Graphics Hardware, VMV 2004: 255-262 8. M. McCool, K. Wadleigh, B. Henderson, H.-Y. Lin: Performance evaluation of GPUs using the RapidMind development platform, Proceedings of the 2006 ACM/IEEE conference on Supercomputing, 2006 9. Los Alamos Lab: Roadrunner, http://www.lanl.gov/roadrunner/ 10. The Green500 list of energy efficient supercomputers, http://www.green500.org/ 11. The Euroben benchmark home page, http://www.euroben.nl/ 12. K. Asanovic et. al.: The Landscape of Parallel Computing Research: A View from Berkeley, 2006, http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS2006-183.pdf 13. A. Simpson, M. Bull, J. Hill: PRACE Deliverable D6.1 Identification and Categorisation of Applications and Initial Benchmarks Suite, http://www.praceproject.eu/documents/Identification and Categorisation of Applications and Initial Benchmark Suite final.pdf 14. C. Cavazzoni, I. Christadler, G. Erbacci, F. Spiga: PRACE Deliverable D6.6 Report on petascale software libraries and programming models, to appear at http://www.prace-project.eu/documents/public-deliverables-1/ 15. RapidMind developer site, https://developer.rapidmind.com/sample-code/matrixmultiplication-samples/rm-sgemm-gpu-5938.zip 16. N. Bell, M. Garland: Efficient Sparse Matrix-Vector Multiplication on CUDA, http://www.nvidia.com/object/nvidia research pub 001.html 17. T. Jansen, B. von Rymon-Lipinski, N. Hanssen, E. Keeve: Fourier Volume Rendering on the GPU Using a Split-Stream-FFT. VMV 2004: 395-403 18. Intel Ct Technology, http://software.intel.com/en-us/data-parallel/
6cs.PL
Graph-Cut RANSAC Daniel Barath Machine Perception Research Laboratory MTA SZTAKI, Budapest, Hungary arXiv:1706.00984v2 [cs.CV] 16 Nov 2017 [email protected] Jiri Matas Centre for Machine Perception, Department of Cybernetics Czech Technical University, Prague, Czech Republic [email protected] Abstract support, i.e. the number of inliers, is obtained. The model with the highest support, polished e.g. by a least squares fit on inliers, is returned. In the last three decades, many modifications of RANSAC have been proposed. For instance, NAPSAC [20], PROSAC [4] or EVSAC [8] modify the sampling strategy to increase the probability of selecting an allinlier sample earlier. NAPSAC considers spatial coherence in the sampling of input data points, PROSAC exploits the ordering of the points by their predicted inlier probability, EVSAC uses an estimate of the confidence in each point. Modifications of the model support step has also been proposed. In MLESAC [28] and MSAC [10], the model quality is estimated by a maximum likelihood process, albeit under certain assumptions, with all its beneficial properties. In practice, MLESAC results are often superior to the inlier counting of plain RANSAC and less sensitive to the userdefined threshold. The termination of RANSAC is controlled by a manually set confidence value η and the sampling stops when the probability of finding a model with higher support falls below η 2 . Observing that RANSAC requires in practice more samples than theory predicts, Chum et al. [5] identified a problem that not all all-inlier samples are “good”, i.e. lead to a model accurate enough to distinguish all inliers, e.g. due to poor conditioning of the selected random all-inlier sample. They address the problem by introducing the locally optimized RANSAC (LO-RANSAC) that augments the original approach with a local optimization step applied to the so-far-the-best model. In the original paper [5], local optimization is implemented as an iterated least squares refitting with a shrinking inlier-outlier threshold inside an inner RANSAC applied only to the inliers of the current model. In the reported experiments, LO-RANSAC outper- A novel method for robust estimation, called Graph-Cut RANSAC1 , GC-RANSAC in short, is introduced. To separate inliers and outliers, it runs the graph-cut algorithm in the local optimization (LO) step which is applied when a sofar-the-best model is found. The proposed LO step is conceptually simple, easy to implement, globally optimal and efficient. GC-RANSAC is shown experimentally, both on synthesized tests and real image pairs, to be more geometrically accurate than state-of-the-art methods on a range of problems, e.g. line fitting, homography, affine transformation, fundamental and essential matrix estimation. It runs in real-time for many problems at a speed approximately equal to that of the less accurate alternatives (in milliseconds on standard CPU). 1. Introduction The RANSAC (RANdom SAmple Consensus) algorithm proposed by Fischler and Bolles [7] in 1981 has become the most widely used robust estimator in computer vision. RANSAC and similar hypothesize-and-verify approaches have been successfully applied to many vision tasks, e.g. to short baseline stereo [27, 29], wide baseline stereo matching [22, 17, 18], motion segmentation [27], image mosaicing [9], detection of geometric primitives [25], multi-model fitting [31], or for initialization of multi-model fitting algorithms [12, 21]. In brief, the RANSAC approach repeatedly selects random subsets of the input data and fits a model, e.g. a line to two points or a fundamental matrix to seven point correspondences. In the second step, the model 1 Available at graph-cut-ransac https://github.com/danini/ 2 This 1 interpretation of η holds for the standard cost function only. forms standard RANSAC in both accuracy and the required number of iterations. The number of LO runs is close to the logarithm of the number of verifications, and it does not create a significant overhead in the processing time in most of the cases tested. However, it was shown by Lebeda et al. [15] that for models with high inlier counts the local optimization step becomes a computational bottleneck due to the iterated least squares model fitting. This is addressed by using a 7m-sized subset of the inliers in each LO step, where m is the size of a minimum sample; the factor of 7 was set by exhaustive experimentation. The idea of local optimization has been included in state-of-the-art RANSAC approaches like USAC [23]. Nevertheless, the LO procedure remains ad hoc, complex and requires multiple parameters. In this paper, we combine two strands of research to obtain a state-of-the-art RANSAC. In the large body of RANSAC-related literature, the inlier-outlier decision has always been a function of the distance to the model, done individually for each data point. Yet both inliers and outliers are spatially coherent, a point near an outlier or inlier is more likely to be an outlier or inlier respectively. Spatial coherence, leading to the Potts model [3], has been exploited in many vision problems, for instance, in segmentation [30], multi-model fitting [12, 21] or sampling [20]. In RANSAC techniques, it has only been used to improve efficiency of sampling in NAPSAC [20]. It is computationally prohibitive to formulate the model verification in RANSAC as a graph-cut problem. But when applied as the LO step in [5] just to the so-far-the-best model, the number of graphcuts is only the logarithm of the number of sampled and verified models, and can be achieved in real-time. The proposed method, called Graph-Cut RANSAC (GCRANSAC), is a locally optimized RANSAC alternating graph-cut and model re-fitting as the LO step. GCRANSAC is superior to LO-RANSAC in a number of aspects. First, it is capable of exploiting spatial coherence of inliers and outliers. The LO step is conceptually a simple, easy to implement, globally optimal and computationally efficient graph-cut with only a few intuitive and learnable parameters unlike the ad hoc, iterative and complex LO steps [5]. Third, we show experimentally that GCRANSAC outperforms LO-RANSAC and its recent variants in both accuracy and the required number of iterations on a wide range of publicly available datasets. On many problems, it is faster than the competitors in terms of the wall-clock time. Finally, we were surprised to observe that GC-RANSAC terminates before the theoretically expected number of iterations. The reason is that the local optimization that takes spatial proximity into account is often capable of converging to a “good” model even when starting from a sample that is not all-inlier, i.e. it contains outliers. PEARL [12] introduced pair-wise energy to geometric model fitting. However, it cannot be used for problems solved by RANSAC – in PEARL, the user has to manually set the number of hypotheses tested to the worst-case, i.e. corresponding to the lowest inlier ratio possible. The α-expansion step just in the first iteration of PEARL executes a graph-cut as many times as the number of hypotheses tested. The number is calculated from the worst-case scenario and is typically orders of magnitude higher than the number of iterations determined by the RANSAC adaptive termination criterion. Moreover, in GC-RANSAC, applying the local optimization to only the so-far-the-best models ensures that the graph-cut is executed only very few times, paying only a small penalty. 2. Local Optimization and Spatial Coherence In this section, we formulate the inlier selection of RANSAC as an energy minimization considering point-topoint proximity. The proposed local optimization is seen as an iterative energy minimization of a binary labeling (outlier – 0 and inlier – 1). For the sake of simplicity, we start from the original RANSAC scheme and then formulate the maximum likelihood estimation as an energy minimization. The term considering the spatial coherence will be included into the energy. 2.1. Formulation as Energy Minimization Suppose that a point set P ⊆ Rn (n > 0), a model represented by a parameter vector θ ∈ Rm (m > 0) and a distance function φ : P × Rm → R measuring the point-tomodel assignment cost are given. For the standard RANSAC scheme which applies a tophat fitness function (1 – close, 0 – far), the implied unary energy is as follows: X E{0;1} (L) = ||Lp ||{0;1} , p∈P where ||Lp ||{0;1} =   0   1 if (Lp = 1 ∧ φ(p, θ) < ) ∨ (Lp = 0 ∧ φ(p, θ) ≥ ) otherwise. Parameter L ∈ {0, 1}|P| is a labeling, ignored in standard RANSAC, Lp ∈ L is the label of point p ∈ P, |P| is the number of points, and  is the inlier-outlier threshold. Using energy E{0,1} we get the same result as RANSAC since it does not penalize only two cases: (i) when p is labeled inlier and it is closer to the model than the threshold, or (ii) when p is labeled outlier and it is farer from the model than . This is exactly what RANSAC does. Since the publication of RANSAC, several papers discussed, e.g. [15], replacing the {0, 1} loss with a kernel 2 function K : R × R → [0, 1], e.g. the Gaussian-kernel. Such choice is close to maximum likelihood estimation as proposed in MLESAC [28]. This improves the accuracy and reduces the sensitivity to threshold . Unary term EK exploiting this continuous loss is as follows: EK (L) = P p∈P ||Lp ||K , where ( ||Lp ||K = 1 − K(φ(p, θ), ) if Lp = 1 K(φ(p, θ), ) if Lp = 0 and δ2 K(δ, ) = e− 22 , arg minL E(L) can easily be determined in polynomial time using graph-cut algorithm. 3. GC-RANSAC In this section, we include the proposed energy minimization-based local optimization into RANSAC. Benefiting from this approach, the LO step is getting simpler and cleaner than that of LO-RANSAC. The main algorithm is shown in Alg.1. The first step is the determination of neighborhood graph A for which we use a sphere with a predefined radius r – this is a parameter of the algorithm – and Fast Approximate Nearest Neighbors algorithm [19]. In Alg. 1, function H is as follows [7]: (1) (2) which equals to one if the distance is zero. In GCRANSAC, we use EK as the unary energy term in the graphcut-based verification. H(|L∗ |, µ) = 2.2. Spatial Coherence log(µ) , log(1 − PI ) (4)  ∗  | where PI = |Lm | / |P m . It calculates the required iteration number of RANSAC on the basis of desired probability µ, the size of the required minimal point set m and the inlier number |L∗ | regarding to the current so-far-the-best model. Note that norm | · | applied to the labeling counts the inliers. Every kth iteration draws a minimal sample using a sampling strategy, e.g. PROSAC [4], then computes the parameters θk of the implied model and its support X wk = K(φ(p, θk ), ) (5) Benefiting from a binary labeling energy minimization, additional energy terms, e.g. to consider spatial coherence of the points, can be included yet keep the problem solvable efficiently and globally via the graph-cut algorithm. Considering point proximity is a well-known approach for sampling [20] or multi-model fitting [12, 21, 1]. To the best of our knowledge, there is no paper exploiting it in the local optimization step of methods like LO-RANSAC. Applying the Potts model which penalizes all neighbors having different labels would be a justifiable choice to be the pairwise energy term. The problem arises when the data contains significantly more outliers, probably close to desired model, than inliers. In that case, penalizing differently labeled neighbors using the same penalty for all classes many times leads to the domination of outliers forcing all inliers to be labeled outlier. To overcome this problem, we modified the Potts model to use different penalty for each neighboring point pair on the basis of their inlier probability. The proposed pair-wise energy term is  if Lp 6= Lq 1 X  1 ES (L) = (K + Kq ) if Lp = Lq = 0 , 2 p (p,q)∈A 1 − 1 (K + K ) if L = L = 1 p q p q 2 (3) where Kp = K(φ(p, θ), ), Kq = K(φ(q, θ), ) and (p, q) is an edge of neighborhood graph A between points p and q. In ES , if both points labeled outlier the penalty is 12 (Kp + Kq ) thus “rewarding” label 0 if the neighboring points are far from the model. The penalty of considering a point as inlier is 1 − 21 (Kp + Kq ) which rewards the label if the points are close to the model. The proposed overall energy measuring the fitness of points to a model and considering spatial coherence is E(L) = EK (L) + λES (L), where λ is a parameter balancing the terms. The globally optimal labeling L∗ = p∈P w.r.t. the data points, where function K is a Gaussian-kernel as proposed in Eq. 2. If wk is higher than that of the so-farthe-best model w∗ , this model is considered the new so-farthe-best, all parameters are updated, i.e. the labeling, model parameters and support, and local optimization is applied if needed. Note that the application criterion of the local optimization step is discussed later. The proposed local optimization is written in Alg. 2. The main iteration can be considered as a grab-cut-like [24] alternation consisting of two major steps: (i) graph-cut and (ii) model re-fitting. The construction of problem graph G using unary and pair-wise terms Eqs. 1, 3 is shown in Alg. 3. Functions AddTerm1 and AddTerm2 are discussed in [13] in depth. Graph-cut is applied to G determining the optimal labeling L which considers the spatial coherence of the points and their distances from the so-far-the-best model. Model parameters θ are computed using a 7m-sized random subset of the inliers in L, thus speeding up the process, similarly to [15] does, where m is the size of a minimal sample, e.g. m = 2 for lines. Note that 7m is set by exhaustive experimentation in [15] and this value also suited for us. Finally, the support w of θ is computed and the so-far-the-best model is updated if the new one has higher support, otherwise the process terminates. After the main algorithm, a local optimization step is performed if it has 3 Algorithm 3 Problem Graph Construction. Input: P – data points, A – neighborhood-graph θ – model parameters, θ∗ – model; Output: G – problem graph; not been yet applied to the obtained so-far-the-best model. Then the model parameters are re-estimated using the whole inlier set similarly to plain RANSAC does. Remark: Adding to the local optimization step a RANSAC-like procedure selecting 7m-size samples is straightforward. In our experiments, it had a high computational overhead without adding significantly to accuracy. 1: 2: 3: Algorithm 1 The GC-RANSAC Algorithm. Input: P – data points; r – sphere radius,  – threshold conf – LO application threshold, µ – confidence; Output: θ - model parameters; L – labeling 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 4: 5: 6: 7: 8: w∗ , nLO ← 0, 0. A ← Build neighborhood-graph using r. for k = 1 → H(|L∗ |, µ) do . Eq. 4 Sk ← Draw a minimal sample. θk ← Estimate a model using Sk . wk ← Compute the support of θk . . Eq. 5 if wk > w∗ then θ∗ , L∗ , w∗ ← θk , Lk , wk if ApplyLocalOptimization(conf ) then θLO , LLO , wLO ← Local opt. . Alg. 2 nLO ← nLO + 1. if wLO > w∗ then θ∗ , L∗ , w∗ ← θLO , LLO , wLO if nLO = 0 then θ∗ , L∗ , w∗ ← Local opt. . Alg. 2 ∗ θ ← least squares model fitting using L∗ . 9: G ← EmptyGraph(). for p ∈ P do c0 , c1 ← K(φ(p, θ), 1 − K(φ(p, θ), ) G ← AddTerm1(G, p, c0 , c1 ). for (p, q) ∈ A do c01 , c10 ← 1, 1. c00 ← 0.5(K(φ(q, θ) + K(φ(p, θ)). c11 ← 1 − 0.5(K(φ(q, θ) + K(φ(p, θ)). G ← AddTerm2(G, p, q, c00 , c01 , c10 , c11 ). duce a simple heuristics for replacing the iteration limit with a data driven strategy which allows to apply LO only a few times without deterioration in accuracy. As it is well-known for RANSAC, the required iteration number k, w.r.t. the inlier ratio η, sample size m and confidence µ, is calculated as k = log(1 − µ)/ log(1 − η m ). Re-arranging this formula to µ leads to equation µ = 1 − m 10k log(1−η ) which determines the confidence of finding the desired model in the kth iteration if the inlier ratio is η. Suppose that the algorithm finds a new so-far-the-best model with inlier ratio η2 in the k2 th iteration, whilst the previous best model was found in the k1 th iteration with inlier ratio η1 (k2 > k1 , η2 > η1 ). The ratio of the confidences µ12 in those two models is calculated as follows: m µ12 = Algorithm 2 Local optimization. Input: P – data points, L∗ – labeling, w∗ – support, θ∗ – model; ∗ ∗ – model; – support, θLO Output: L∗LO – labeling, wLO 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: µ2 1 − 10k2 log(1−η2 ) = m . µ1 1 − 10k1 log(1−η1 ) (6) In experiments, we observed that a model that leads to termination if optimized often shows a significant increase in the confidence. Replacing the parameter blocking LO in the first k iterations, we adopt a criterion q12 > conf , where conf is a user-defined parameter determining a significant increase. ∗ ∗ , changed ← w∗ , L∗ , θ∗ , 1. wLO , L∗LO , θLO while changed do G ← Build the problem graph. . Alg. 3 L ← Apply graph-cut to G. I7m ← Select a 7m-sized random inlier set. θ ← Fit a model using labeling I7m . w ← Compute the support of θ. changed ← 0. ∗ if w > wLO then ∗ ∗ θLO , L∗LO , wLO , changed ← θ, L, w, 1. 4. Experimental Results In this section, GC-RANSAC is validated both on synthesized and publicly available real world data and compared with plain RANSAC [7], LO-RANSAC [5], LO+ RANSAC, LO’-RANSAC [15], and EP-RANSAC [14]. The parameter setting is reported in Table 1. For EPRANSAC3 , we tuned the threshold parameter to achieve the lowest mean error and the other parameters were set to the values reported by the authors. Note that the comparison of the processing time with this method is affected by the The criterion for applying the LO step was proposed to be: (i) the model is so-far-the-best and (ii) after a userdefined iteration limit, in [15]. However, in our experiments, this approach still spends significant time on optimizing models which are not promising enough. We intro- 3 The Matlab source is available at http://cs.adelaide.edu. au/˜huu/publication/exact_penalty/ 4 Table 1: Setting for the tests. Outlier threshold (), radius used for proximity computation (r), weight of the pair-wise term (λ), and the threshold of the confidence change (conf ). conf 10 Angular Error (°) λ 0.10 0.15 0.1 0.05 0 L F LO’ 4% 24% 0.1 0.05 0 1 2 3 4 5 6 7 8 0 9 0 1 2 3 (a) GC−RSC LO−RSC LO+−RSC LO‘−RSC 0.25 Angular Error (°) 6 7 8 9 6 7 8 9 0.35 0.3 GC−RSC LO−RSC LO+−RSC LO‘−RSC 0.3 0.25 0.2 0.15 0.1 0 5 (b) 0.35 GC 15% 32% 4 Noise (px) 0.05 LO+ 5% 30% 0.15 Noise (px) Table 2: Percentage of “not-all-inlier” minimal samples leading to the correct solution during line (L) and fundamental matrix (F) fitting. For lines, the average over 1000 runs on three different outlier percentage (100%, 500%, 1000%) and noise levels 0.0−9.0 px is reported, thus 15000 runs were performed. For F, the mean of 1000 runs on the AdelaideRMF dataset is shown. LO 6% 29% GC−RSC LO−RSC LO+−RSC LO‘−RSC 0.2 Angular Error (°) r 20 px 0.25 GC−RSC LO−RSC LO+−RSC LO‘−RSC 0.2 Angular Error (°)  0.31 0.25 0.2 0.15 0.1 0.05 0 1 2 3 4 5 6 7 8 9 0 0 Noise (px) 1 2 3 4 5 Noise (px) (c) (d) Figure 1: The mean angular error (in degrees) of the obtained 2D lines plotted as the function of noise σ (in pixels). On each noise σ, 1000 runs were performed. The line type and outlier number is (a) straight line, 100%, (b) straight line, 500% (c) dashed line, 100% and (c) dashed line, 500%. availability of a Matlab implementation only. All methods apply PROSAC [4] sampling and encapsulates the point-tomodel distance, e.g. re-projection error for homographies, with a Gaussian-kernel using  = 0.31, which is set by an exhaustive search. EP-RANSAC uses inlier maximization strategy since its cost function cannot be replaced straightforwardly. The radius of the sphere to determine neighboring points is 20 pixels and it is applied to the concatenated 4D coordinates of the correspondences. Parameter λ for GC-RANSAC was set to 0.1 and conf = 10. Synthetic Tests on 2D Lines. To compare GC-RANSAC with the state-of-the-art in a fully controlled environment, we chose two simple tests: detection of a 2D straight or dashed line. For each trial, a 600 × 600 window and a random line was generated in its implicit form, sampled at 100 locations and zero-mean Gaussian-noise with σ standard deviation was added to the coordinates. For a straight line, the points were generated using uniform distribution (see Fig. 2a). For a dashed line, 10 knots were put randomly into the window, then the line is sampled at 10 locations with uniform distribution around each knot, at most 10 pixels far (see Fig. 2b). Finally, k outliers were added to the scene. 1000 tests were performed on every noise level. Fig. 1 shows the mean angular error (in degrees) plotted as the function of the noise σ. The first and second rows report the results of the straight and dashed line cases. For the two columns, 100 and 500 outliers were added, respectively. According to Fig. 1, GC-RANSAC obtains more accurate lines than the competitor algorithms. (a) (b) Figure 2: An example input for (a) straight and (b) dashed lines. The 1000 black points are outliers, the 100 red ones are inliers. Best viewed in color. tion we used kusvod2 (24 pairs)4 , Multi-H5 (5 pairs), and AdelaideRMF6 (19 pairs) datasets (see Fig. 3 for examples). Kusvod2 consists of 24 image pairs of different sizes with point correspondences and fundamental matrices estimated using manually selected inliers. AdelaideRMF and Multi-H consist a total of 24 image pairs with point correspondences, each assigned manually to a homography (or the outlier class). For them, all points which are assigned to a homography were considered as inliers and others as outliers. On total, the proposed method was tested on 48 4 http://cmp.felk.cvut.cz/data/geometry2view/ Estimation of Fundamental Matrix. Evaluating the performance of GC-RANSAC on fundamental matrix estima- 5 http://web.eee.sztaki.hu/ ˜dbarath/ ˜hwong/doku.php?id=data 6 cs.adelaide.edu.au/ 5 image pairs from three publicly available datasets for fundamental matrix estimation. All methods applied the 7-point method [10] to estimate F, thus drawing minimal sets of size seven in each RANSAC iteration. For the model reestimation from a non-minimal sample in the LO step, the normalized 8-point algorithm [11] is used. Note that all fundamental matrices were discarded for which the oriented epipolar constraint [6] did not hold. The first three blocks of Table 3, each consisting of four rows, report the quality of the epipolar geometry estimation on each dataset as the average of 1000 runs on every image pair. The first two columns show the name of the tests and the investigated properties: (1) LO: the number of applied local optimization steps (graph-cut steps are shown in brackets). (2) E is the geometric error (in pixels) of the obtained model w.r.t. the manually annotated inliers. For fundamental matrices and homographies, it is defined as the average Sampson distance and re-projection error, respectively. For essential matrices, it is the mean Sampson distance of the implied fundamental matrix and the correspondences. (3) T is the mean processing time in milliseconds. (4) S is the average number of minimal samples have to be drawn until convergence, basically, the number of RANSAC iterations. It can be clearly seen that for fundamental matrix estimation GC-RANSAC always obtains the most accurate model using less samples than the competitive methods. (a) Homography; homogr dataset (b) Homography; EVD dataset (c) Fundamental matrix; kusvod2 dataset Estimation of Homography. In order to test homography estimation we downloaded homogr7 (16 pairs) and EVD8 (15 pairs) datasets (see Fig. 3 for examples). Each consists of image pairs of different sizes from 329 × 278 up to 1712 × 1712 with point correspondences and manually selected inliers – correctly matched point pairs. Homogr dataset consists of short baseline stereo pairs, whilst the pairs of EVD undergo an extreme view change, i.e. wide baseline. All methods apply the normalized four-point algorithm [10] for homography estimation both in the model generation and local optimization steps. Therefore, each minimal sample consists of four correspondences. The 4th and 5th blocks of Fig. 3 show the mean results computed using all the image pairs of each dataset. It can be seen that GC-RANSAC obtains the most accurate models for all but one, i.e. EVD dataset with time limit, test cases. (d) Fundamental matrix; AdelaideRMF dataset (e) Essential matrix; Strecha dataset (f) Affine transformation; SZTAKI dataset Estimation of Essential Matrix. To estimate essential matrices, we used the strecha dataset [26] consisting of image sequences of buildings. All image sizes are 3072 × 2048. The ground truth projection matrices are provided. The methods were applied to all possible image pairs in Figure 3: Results of GC-RANSAC on example pairs from each dataset and problem. Correspondences are drawn by lines and circles, outliers by black lines and crosses, every third correspondence is drawn. 7 http://cmp.felk.cvut.cz/data/geometry2view/ 8 http://cmp.felk.cvut.cz/wbs/ 6 each sequence. The SIFT detector [16] was used to obtain correspondences. For each image pair, a reference point set with ground truth inliers was obtained by calculating the fundamental matrix from the projection matrices [10]. Correspondences were considered as inliers if the symmetric epipolar distance was smaller than 1.0 pixel. All image pairs with less than 20 inliers found were discarded. In total, 467 image pairs were used in the evaluation. The results are reported in the 6th block of Table 3. The reason of the high processing time is that the mean inlier ratio is relatively low (27%) and there are many correspondences, 2323, on average. GC-RANSAC obtains the most accurate essential matrices both in the wall-clock time limited and solution confidence above 95% experiments. A significant drop can be seen in accuracy for all methods if a time limit is given. λ=0 λ = 0.1 λ=1 λ = 10 λ = 100 100 (a) Ratio (%) 80 60 40 20 0 L F E H A Problem 120 Processing Time LO Number GC Number Geometric Error 100 (b) Ratio (%) 80 60 40 20 0 L F E H A Problem Estimation of Affine Transformation. The SZTAKI Earth Observation dataset9 [2] (83 image pairs of size 320 × 240) was used to test estimation of affine transformations. The dataset contains images of busy road scenes taken from a balloon. Due to the altitude of the balloon, the image pair relation is well approximate by an affine transformation. Point correspondences were detected by the SIFT detector. For ground truth, 20 inliers were selected manually. Point pairs with the distance from the ground truth affine transformation lower than 1.0 pixel were defined as inliers. The estimation results are shown in the 7th block of Table 3. The reported geometric error is |Ap1 − p2 |, where A is the estimated affine transformation and pk is the point in the kth image (k ∈ {1, 2}). It can be seen that the methods obtained fairly similar results, however, GC-RANSAC is slightly more accurate. It is marginally slower due to the neighborhood computation. However, it is still faster than real time. Neighborhood Calc. Fitting and Sampling Model Verification Graph Cut 100 (c) Ratio (%) 80 60 40 20 0 L F E H A Problem Figure 4: (a) The effect of the λ choice weighting the spatial term. The ratio of the geometric error (in percentage) compared to the λ = 0 case (no spatial coherence) for each problem (L – lines, F – fundamental matrix, E – essential matrix, H – homography, A – affine transformation). (b) The effect of replacing the iteration limit before the first LO applied with the proposed criterion, i.e. the confidence radically increases. The ratios (in percentage) of each property of the proposed and that of standard approaches. (c) The breakdown of the processing times in percentage w.r.t. the total runtime. All values were computed as the mean of all tests. Best viewed in color. Convergence from a Not-All-Inlier Sample. Table 2 reports the frequencies when a “not-all-inlier” sample led to the correct model. For lines (L), it is computed using 1000 runs on each outlier (100, 500 and 1000) and noise level (from 0.0 up to 9.0 pixels). Thus 15000 runs were performed. A minimal sample is counted as a “not-all-inlier” if it contains at least one point farther from the ground truth model than the ground truth noise σ. For fundamental matrices (F), the frequencies of success from a “not-all-inlier” sample are computed as the mean of 1000 runs on all pairs of the AdelaideRMF dataset. In this dataset, all inliers are labeled manually, thus it is easy to check whether a sample point is inlier or not. Evaluation of the λ setting. To evaluate the effect of the λ parameter balancing the spatial coherence term, we applied GC-RANSAC to all problems with varying λ. The evaluated values are: (i) λ = 0, which turns off the spatial coherence term, (ii) λ = 0.1, (iii) λ = 1, (iv) λ = 10, and (v) λ = 100. Fig. 4a shows the ratio of the geometric errors for λ 6= 0 and λ = 0 (in percent). For all investigated non-zero λ values, the error is lower than for λ = 0. Since λ = 0.1 led to the most accurate results on average, we chose this setting in the tests. 9 http://mplab.sztaki.hu/remotesensing 7 F, #24 F, #19 F, #4 E, #467 A, #52 H, #16 H, #15 Adelaide strecha SZTAKI homogr EVD Multi-H kusvod2 Table 3: Fundamental matrix estimation applied to kusvod2 (24 pairs), AdelaideRMF (19 pairs) and Multi-H (4 pairs) datasets, homography estimation on homogr (16 pairs) and EVD (15 pairs) datasets, essential matrix estimation on the strecha dataset (467 pairs), and affine transformation estimation on the SZTAKI Earth Observation benchmark (52 pairs). Thus the methods were tested on total on 597 image pairs. The datasets, the problem (F/H/E/A), the number of the image pairs (#) and the reported properties are shown in the first three columns. The next five report the results at 99% confidence with a time limit set to 60 FPS, i.e. the run is interrupted after 1/60 secs (EP-RANSAC is removed since it cannot be applied in real time). For the other columns, there was no time limit but the confidence was set to 95%. Values are the means of 1000 runs. LO is the number of local optimizations and the number of graph-cut runs are shown in brackets. The geometric error (E, in pixels) of the estimated model w.r.t. the manually selected inliers is written in each second row; the mean processing time (T , in milliseconds) and the required number of samples (S) are written in every 3th and 4th rows. The geometric error is the Sampson distance for F and E, and the projection error for H and A. LO E T S LO E T S LO E T S LO E T S LO E T S LO E T S LO E T S Approx. 60 FPS (or 99% confidence) RSC LO LO+ LO’ GC – 2 2 2 1 (3) 5.01 4.95 4.97 5.02 4.65 6.2 6.1 6.3 5.9 4.6 117 96 99 111 70 – 2 2 2 1 (3) 0.55 0.53 0.52 0.55 0.50 14.2 14.8 14.9 14.1 18.9 124 113 113 122 116 – 1 1 1 1 (3) 0.35 0.34 0.34 0.34 0.32 10.3 11.5 11.1 10.3 14.6 83 76 76 82 74 – 2 2 2 2 (2) 1.53 1.63 1.51 1.58 1.53 16.8 18.3 18.0 16.8 19.2 320 298 301 318 301 – 2 2 2 1 (3) 0.53 0.53 0.53 0.53 0.51 7.1 10.4 9.8 7.1 7.6 193 175 175 189 159 – 1 1 1 1 (1) 11.81 12.34 12.07 12.12 11.6 11.6 17.3 17.2 17.2 17.3 31 30 31 31 30 – 1 1 1 1 (3) 0.41 0.41 0.41 0.41 0.40 3.5 3.2 3.2 3.2 10.3 26 26 26 26 26 RSC – 5.18 4.9 93 – 0.44 262.7 1 363 – 0.33 12.8 107 – 0.96 247.3 4 303 – 0.50 17.1 450 – 3.03 3 581.9 3 654 – 0.45 1.7 9 Evaluation of the criterion for the local optimization. The proposed criterion (Eq. 6) ensuring that local optimization is applied only to the most promising model candidates is tested in this section. We applied GC-RANSAC to all problems combined with the proposed and the standard approaches. The standard technique sets an iteration limit (default value: 50) and the LO procedure is afterwards applied to all models that are so far the best. Fig. 4b reports the ratio of each property (processing time – dark blue, LO – light blue, and GC steps – yellow, geometric error – brown) LO 1 5.08 5.2 76 2 0.45 194.2 1 126 2 0.33 15.1 89 4 0.95 248.0 4 203 2 0.50 10.1 212 7 2.95 3 638.5 3 646 1 0.46 1.7 9 Confidence 95% LO+ LO’ 1 1 5.03 5.22 5.1 4.9 78 87 2 3 0.43 0.44 210.9 237.1 1 205 1 305.00 1 2 0.33 0.34 14.1 12.4 90 100 4 4 0.95 0.96 251.3 247.0 4 248 4 291 2 2 0.49 0.50 9.9 8.5 214 226 7 7 2.94 2.87 3 648.4 3 570.0 3 634 3 653 1 1 0.44 0.45 1.7 1.7 9 9 EP-RSC – 7.87 439.9 – – 0.71 2 121.9 – – 0.44 2 371.8 – – 1.17 > 104 – – 0.58 3 339.7 – – 3.32 > 106 – – 0.48 4 718.2 – GC 2 (3) 4.69 3.6 53 2 (4) 0.43 227.1 1 115 1 (3) 0.32 36.0 78 3 (6) 0.92 249.9 4 204 1 (4) 0.47 7.9 165 7 (7) 2.83 3 466.4 3 651 1 (3) 0.41 10.2 9 of the proposed and standard approaches. The new criterion leads to significant improvement in the processing time with no deterioration in accuracy. Processing Time. Fig. 4c shows the breakdown of the processing times of GC-RANSAC applied to each problem. The time demand of the neighborhood computation (dark blue) linearly depends on the point number. The light blue one is the time demand of the sampling and model fitting step, the yellow and brown bars show the model verification 8 (support computation) and the proposed local optimization step, respectively. The sampling and model fitting part dominates the process. [11] R. I. Hartley. In defense of the eight-point algorithm. Transactions on Pattern Analysis and Machine Intelligence, 1997. 6 [12] H. Isack and Y. Boykov. Energy-based geometric multimodel fitting. International Journal of Computer Vision, 2012. 1, 2, 3 [13] V. Kolmogorov and R. Zabin. What energy functions can be minimized via graph cuts? Pattern Analysis and Machine Intelligence, 2004. 3 [14] H. Le, T.-J. Chin, and D. Suter. An exact penalty method for locally convergent maximum consensus. 4 [15] K. Lebeda, J. Matas, and O. Chum. Fixing the locally optimized ransac. In British Machine Vision Conference. Citeseer, 2012. 2, 3, 4 [16] D. G. Lowe. Object recognition from local scale-invariant features. In International Conference on Computer vision. IEEE, 1999. 6 [17] J. Matas, O. Chum, M. Urban, and T. Pajdla. Robust widebaseline stereo from maximally stable extremal regions. Image and Vision Computing, 2004. 1 [18] D. Mishkin, J. Matas, and M. Perdoch. MODS: Fast and robust method for two-view matching. Computer Vision and Image Understanding, 2015. 1 [19] M. Muja and D. G. Lowe. Fast approximate nearest neighbors with automatic algorithm configuration. International Conference on Computer Vision Theory and Applications, 2009. 3 [20] D. Nasuto and J. M. B. R. Craddock. NAPSAC: High noise, high dimensional robust estimation - its in the bag. 2002. 1, 2, 3 [21] T. T. Pham, T.-J. Chin, K. Schindler, and D. Suter. Interacting geometric priors for robust multimodel fitting. Transactions on Image Processing, 2014. 1, 2, 3 [22] P. Pritchett and A. Zisserman. Wide baseline stereo matching. In International Conference on Computer Vision. IEEE, 1998. 1 [23] R. Raguram, O. Chum, M. Pollefeys, J. Matas, and J.-M. Frahm. USAC: a universal framework for random sample consensus. Transactions on Pattern Analysis and Machine Intelligence, 2013. 2, 9 [24] C. Rother, V. Kolmogorov, and A. Blake. Grabcut: Interactive foreground extraction using iterated graph cuts. In Transactions on Graphics. ACM, 2004. 3 [25] C. Sminchisescu, D. Metaxas, and S. Dickinson. Incremental model-based estimation using geometric constraints. Pattern Analysis and Machine Intelligence, 2005. 1 [26] C. Strecha, R. Fransens, and L. Van Gool. Wide-baseline stereo from multiple views: a probabilistic account. In Conference on Computer Vision and Pattern Recognition. IEEE, 2004. 6 [27] P. H. S. Torr and D. W. Murray. Outlier detection and motion segmentation. In Optical Tools for Manufacturing and Advanced Automation. International Society for Optics and Photonics, 1993. 1 [28] P. H. S. Torr and A. Zisserman. MLESAC: A new robust estimator with application to estimating image geometry. Computer Vision and Image Understanding, 2000. 1, 3 5. Conclusion GC-RANSAC was presented. It is more geometrically accurate than state-of-the-art methods. It runs in real-time for many problems at a speed approximately equal to the less accurate alternatives. It is much simpler to implement in a reproducible manner than any of the competitors (RANSAC’s with local optimization). Its local optimization step is globally optimal for the so-far-the-best model parameters. We also proposed a criterion for the application of the local optimization step. This criterion leads to a significant improvement in processing time with no deterioration in accuracy. GC-RANSAC can be easily inserted into USAC [23] and be combined with its ”bells and whistles“ like PROSAC sampling, degeneracy testing and fast evaluation with early termination. References [1] D. Barath, J. Matas, and L. Hajder. Multi-H: Efficient recovery of tangent planes in stereo images. In British Machine Vision Conference, 2016. 3 [2] C. Benedek and T. Szirányi. Change detection in optical aerial images by a multilayer conditional mixed markov model. Transactions on Geoscience and Remote Sensing, 2009. 7 [3] Y. Boykov, O. Veksler, and R. Zabih. Markov random fields with efficient approximations. In Computer Vision and Pattern Recognition. IEEE, 1998. 2 [4] O. Chum and J. Matas. Matching with PROSAC-progressive sample consensus. In Computer Vision and Pattern Recognition. IEEE, 2005. 1, 3, 4 [5] O. Chum, J. Matas, and J. Kittler. Locally optimized ransac. In Joint Pattern Recognition Symposium. Springer, 2003. 1, 2, 4 [6] O. Chum, T. Werner, and J. Matas. Epipolar geometry estimation via RANSAC benefits from the oriented epipolar constraint. In International Conference on Pattern Recognition, 2004. 6 [7] M. A. Fischler and R. C. Bolles. Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography. Communications of the ACM, 1981. 1, 3, 4 [8] V. Fragoso, P. Sen, S. Rodriguez, and M. Turk. EVSAC: accelerating hypotheses generation by modeling matching scores with extreme value theory. In International Conference on Computer Vision, 2013. 1 [9] D. Ghosh and N. Kaabouch. A survey on image mosaicking techniques. Journal of Visual Communication and Image Representation, 2016. 1 [10] R. Hartley and A. Zisserman. Multiple view geometry in computer vision. Cambridge university press, 2003. 1, 5, 6, 7 9 [29] P. H. S. Torr, A. Zisserman, and S. J. Maybank. Robust detection of degenerate configurations while estimating the fundamental matrix. Computer Vision and Image Understanding, 1998. 1 [30] R. Zabih and V. Kolmogorov. Spatially coherent clustering using graph cuts. In Conference onComputer Vision and Pattern Recognition. IEEE, 2004. 2 [31] M. Zuliani, C. S. Kenney, and B. S. Manjunath. The multiransac algorithm and its application to detect planar homographies. In International Conference on Image Processing. IEEE, 2005. 1 10
1cs.CV
G ENERATIVE A DVERSARIAL A DAPTIVE C ONVOLUTION N ETWORKS USING arXiv:1802.02226v1 [cs.CV] 25 Jan 2018 Nhat M. Nguyen, Nilanjan Ray Department of Computing Science University of Alberta Edmonton, Alberta T6G 2R3 Canada {nmnguyen,nray1}@ualberta.ca A BSTRACT Most existing GANs architectures that generate images use transposed convolution or resize-convolution as their upsampling algorithm from lower to higher resolution feature maps in the generator. We argue that this kind of fixed operation is problematic for GANs to model objects that have very different visual appearances. We propose a novel adaptive convolution method that learns the upsampling algorithm based on the local context at each location to address this problem. We modify a baseline GANs architecture by replacing normal convolutions with adaptive convolutions in the generator. Experiments on CIFAR-10 dataset show that our modified models improve the baseline model by a large margin. Furthermore, our models achieve state-of-the-art performance on CIFAR-10 and STL-10 datasets in the unsupervised setting. 1 I NTRODUCTION Generative Adversarial Networks (Goodfellow et al., 2014) (GANs) are an unsupervised learning method that is able to generate realistic looking images from noise. GANs employs a minimax game where a generator network learns to generate synthesized data from random noise and in conjunction, a discriminator network learns to distinguish between real and generated data. Theoretically, the training processes of the two networks intertwine and iterate until both networks reach a Nash equilibrium where real and synthesized data are indistinguishable. However, in practice, GANs are notoriously hard to train. For the learning of the generator to happen effectively, hyper-parameters, as well as the architectures of the generator and discriminator, must be chosen carefully. Nevertheless, on datasets with visually similar images, such as bedroom scenes (Yu et al., 2015) and faces (Chen et al., 2016), GANs have produced good results (Radford et al., 2015). This success, however, does not translate to datasets that have diverse visual categories. GANs models trained on ImageNet (Russakovsky et al., 2015) were only able to learn basic image statistics and some shapes, but they did not learn any object (Salimans et al., 2016). Recent works address this problem by incorporating additional high-level information to guide the generator, such as training the discriminator in a semi-supervised manner (Salimans et al., 2016), adding a second training objective to direct the generator toward similar samples from the training set (Warde-Farley & Bengio, 2016) or using artificial class labels by clustering in the representation space (Grinblat et al., 2017). We take a different approach to tackle this problem. We hypothesize that the rigidity of the normal convolution operator is partially responsible for the difficulty of GANs to learn on diverse visual datasets. Most GANs generators upsample low resolution feature maps toward higher resolution using fixed convolutions (note that a transposed convolution is equivalent to a convolution) or resize-convolution (Odena et al., 2016a). Such operations are unintuitive, because, pixel locations have different local contexts and belong to diverse object categories. Consequently, different pixel locations should have different upsampling schemes. This shortcoming of normal convolution is especially problematic in the early upsampling layers where higher level information usually associates with the object shapes and the context of images. 1 We propose the use of a novel adaptive convolution (Niklaus et al., 2017) architecture, called Adaptive Convolution Block, that replaces normal convolutions to address the aforementioned shortcoming of GANs generators. Instead of learning a fixed convolution for the upsampling of all pixels from the lower to the higher resolution feature map, an AdaConvBlock learns to generate the convolution weights and biases of the upsampling operation adaptively based on the local feature map at each pixel location. AdaConvBlock helps the generator to learn to generate upsampling algorithms that take into account the local context. We believe that this kind of adaptive convolution is more intuitive and more akin to the process when a human draws something: the same thought process is used in the whole drawing but the style of each stroke should vary and depend on the local context around each pixel position. We conduct experiments to compare our adaptive convolution method to normal convolution in the unsupervised setting. We progressively replace all convolutions of a GANs generator with AdaConvBlocks from the lowest resolution to the highest resolution. Experiments on CIFAR-10 dataset show that the modified adaptive convolution models have superior qualitative and quantitative performance over the baseline architecture and just replacing convolution of the upsampling from the lowest resolution feature map with adaptive convolution can have significant impacts on the baseline model. Furthermore, our best models achieve state-of-the-art unsupervised performance on both CIFAR-10 and STL-10 datasets. Our code and models will be released. 2 2.1 BACKGROUND G ENERATIVE A DVERSARIAL N ETWORKS Generative Adversarial Networks (Goodfellow et al., 2014) is a framework where a generator G that tries to mimic real data of a target distribution is pitted against a discriminator D that tries to distinguish the generated samples from the target distribution. G is trained to increase the chance that generated samples are classified as real data while D is trained to minimize it. The training processes of D and G alternate and can be formulated as a minimax game: min max V (D, G) = Ex∼qdata (x) [log D(x)] + Ez∼px (z) [log (1 − D(G(z))] (1) G D where qdata (x) is the real data distribution on Rn , px (z) is a commonly used distribution such as N (0, I), z ∈ Rm is a random noise variable drawn from px (z), G : Rm → Rn is a generator function that maps the random noise variable to the real data space, D : Rn → [0, 1] is a function that outputs the probability of a data point in Rn belonging to the target real data distribution. The training process of GANs takes turns to update the discriminator for a number of times before updating the generator once. Ideally, the discriminator should be trained to convergence before updating the generator. However, this is computationally infeasible and causes the D to overfit on datasets with finite data. In the framework of GANs, G and D can be any differentiable functions. For image generation, they are usually formulated as convolutional neural networks. The generator G usually consist of a fully connected layer to project the random variable to a small 3D volume followed by upsampling layers using convolutions that progressively refine the volume to have the desired spatial dimensions while the discriminator D is usually constructed as the reverse of the generator, using strided convolutions to downsample the feature maps. 2.2 D IFFICULTIES IN TRAINING GAN S The difficulties of training GANs is well known. For example, the balance between the strength of the generator and that of the discriminator is essential for successful training. If D is too strong, log (1 − D(G(z)) will be close to zero and there would be almost no gradient from where G could learn to generate data. On the other hand, if D is too weak, it will not be able to provide a good feedback for G to improve. Another prominent issue is mode collapse where G learns to map the majority of the random distribution px (z) to a few regions in the real data space, resulting in near duplicate images. Overall, the training of GANs is unstable and very sensitive to hyper-parameters. Several works have been done to address the difficulties of training GANs. WGAN (Arjovsky et al., 2017) pioneered the conditioning of D to be a Lipschitz function by using weight clipping. Danihelka et al. (2017) proposed an improved version, called WGAN-GP, that enforces this conditioning 2 by penalizing the gradient of D on the set of straight lines between real and generated samples. Spectral Normalization GANs (Miyato et al., 2017) is one of the most recent works in this category. Spectral Normalization controls the Lipschitz constant of the discriminator by dividing the weight matrix of each layer by its own spectral norm, which is equal to its largest singular value. The largest singular value of a matrix can be efficiently computed by an approximation algorithm (Miyato et al., 2017). Spectral Normalization has been shown to make GANs robust to hyper-parameters choices without incurring any significant overhead. For these reasons, we use spectral normalization to train our architectures. 3 A DAPTIVE C ONVOLUTION B LOCK FOR G ENERATIVE A DVERSARIAL N ETWORKS Although a lot of progress has been made in improving the training procedure, datasets with visually diverse images still pose a challenge for GANs. GANs fail to produce good-looking samples even on low dimension datasets like CIFAR-10 and STL-10. In this paper, we propose a novel Adaptive Convolution Block (AdaConvBlock) as a replacement for normal convolutions in GANs generator to tackle this issue. The AdaConvBlock can be thought of as a way to increase the capacity of the generator, making it easier to learn the sophisticated multimodal distributions underlying the visually diverse datasets. The details of our network architectures that use AdaConvBlocks are shown in section 5.2. Note that the kind of AdaConvBlock we describe in this paper only replace a normal convolution. In the case of a transposed convolution, an Adaptive Transposed Convolution Block can be implemented by simply rearranging the input volume (in the same way when converting a transposed convolution to a normal convolution) first, then apply an AdaConvBlock to the rearranged volume. Due to implementation difficulties of this rearrangement operation in Tensorflow (Abadi et al.), the deep learning framework we use, we only experiment with Adaptive Convolution Blocks in this paper. 3.1 A DAPTIVE C ONVOLUTION B LOCK Consider a convolution operation with filter size Kf ilter × Kf ilter and number of output channels Cout on an feature map that has Cin input channels. At every location, a convolution requires a weight matrix W of size Kf ilter × Kf ilter × Cin × Cout as the filters to be convolved with the local feature map that has spatial dimension of size Kf ilter × Kf ilter followed by adding a bias matrix b of size Cout to each channels of the previous convolution. For a normal convolution, all spatial locations in the input feature map will have the same weight Wnormal and bias bnormal . The shared weight and bias matrices serve as the learned variables of a normal convolution. For an adaptive convolution, however, all spatial locations do not share the same weight and bias variables. Rather, they share the variables that are used to generate the weight and bias for each pixel location based on the local information. For each pixel (i, j), an adaptive convolution consists of two normal convolutions to regress the adaptive weight W (i, j) and adaptive bias b(i, j) at each location followed by the local convolution of W (i, j) with the local feature map and the addition of b(i, j) to the previous local convolution. In this case, the learnable variables of an adaptive convolution are the weights and bias matrices of the convolutions that are used to generate W (i, j) and b(i, j). A naive AdaConvBlock learns four matrices Ww,w , Ww,b , Wb,w and Wb,b with the size of Kadaptive × Kadaptive × Cin × Cadaptive , Cadaptive , Kadaptive × Kadaptive × Cout , Cout , in a serial order. Ww,w , Ww,b are the weight and bias matrices of the convolution to regress the adaptive weight W (i, j) for and Wb,w , Wb,b are the weight and bias matrices of the convolution to regress the adaptive bias b(i, j) for each pixel location. Kadaptive is the filter size of the convolution (i.e. the size of the local window around the pixel location) in the input feature map to regress W (i, j) and b(i, j) from. Cadaptive = Kf ilter × Kf ilter × Cin × Cout is the number of output channels of the convolution to regress W (i, j), which is equal to the size of the matrix Wnormal of a normal convolution. Note that Kadaptive controls the amount of local information used in an AdaConvBlock and can be different from the regressed filter size Kf ilter . Denote Fin as the input feature map, Fout as the output feature map of a naive AdaConvBlock, the exact formulation of Fout from Fin is 3 described as below: Wadaptive = ReLU (Fin ∗ Ww,w + bw,b ) badaptive = Fin ∗ Wb,w + bb,b Fout = Fin ∗local W adaptive + badaptive (2) (3) (4) where Wadaptive , badaptive are the 3D volumes consisting of all adaptive convolution weights W (i, j) and biases b(i, j). Note that Wadaptive contains all the weights W (i, j) that have been flattened into vectors. W adaptive denotes Wadaptive after the adaptive weight matrices are reshaped back into the appropriate shape for convolution. ReLU denotes the ReLU activation function. ∗local denotes the local convolution operator. One drawback of a naive AdaConvBlock, however, is the extremely expensive operation of computing adaptive convolution weights from the input volume (i.e. Fin ∗ Ww,w ). The amount of memory and computation used by this operation grow proportionally to Kadaptive × Kadaptive × 2 2 Cin × Cadaptive = Kf2ilter × Kadaptive × Cin × Cout . We use depthwise separable convolution (Sifre & Mallat, 2014) in place of normal convolution to reduce computation cost as well as memory usage of this operation. A depthwise separable convolution replaces a normal convolution with two convolutions: one convolution (called depthwise convolution) that acts separately on each channel followed immediately by a 1x1 convolution (called pointwise convolution) that mixes the output of the previous convolution into the number of output channels (Chollet, 2016). The first depthwise convolution has memory and computation costs proportional to 2 Kadaptive × Cin × Cdepthwise while the second pointwise convolution has memory and compu2 tation costs proportional to Cdepthwise × Kf2ilter × Cin × Cout with the depth multiplier Cdepthwise being the number of output channels for each input channel of the depthwise convolution. For the AdaConvBlocks in our architectures, cost of the pointwise convolution dominates cost of the depthwise convolution. By choosing Cdepthwise = 1, this separation of one big convolution into two smaller convolutions cuts the amount of memory and computation cost of our models by roughly 2 Kadaptive times. Equation 2 is rewritten as: Wadaptive = ReLU (Fin ∗ Ww,w,depthwise ∗ Ww,w,pointwise + bw,b ) (5) where Ww,w,depthwise and Ww,w,pointwise are the weight matrices of the depthwise and pointwise 2 2 convolution that have size of Kadaptive × Cin and Kf2ilter × Cin × Cout , respectively. Figure 1 illustrates the full structure of an AdaConvBlock. Note that we do not use Batch Normalization (Ioffe & Szegedy, 2015) in our AdaConvBlock. 3.2 D ESIGN C HOICES OF AN A DAC ONV B LOCK In this subsection, we discuss some design choices for the Adaptive Convolution Block. First, both the adaptive convolution weights and biases do not have to be regressed necessarily from the input volume. Additional transformations can be applied to the input volume before regressing the weights and biases. We tried a few transformations and found them to cripple the performance of our network. For example, 3x3 dilated convolutions (Yu & Koltun, 2015) can be used to exponentially increase the receptive field to the regression of the weights and biases. The increase of receptive field can make object shapes more coherent. However, in practice, we found using multiple 3x3 dilated convolutions made training more unstable. The same effect can be achieved to by increasing Kadaptive of the adaptive convolution without this downside. Another idea we tried was to add 1x1 convolutions before the regression to increase the nonlinearity of an AdaConvBlock. However, experiments showed that they were detrimental to the generator and hammered our model’s performance. Next, we considered the choice of activation functions and the lack of batch normalization in an AdaConvBlock. To regress both convolution weights and biases, we did not apply batch normalization as there were no reasons for the regressed weights and biases to follow any probability distribution. We applied a non-linearity after the convolution to regress the weights. Empirically, we found the ReLu activation made AdaConvBlock work better than other activation functions, including the identity activation (i.e. no activation). To regress the biases, we do not apply an activation function because doing so results in unwanted effects of limiting the output of an AdaConvBlock in a range. 4 Figure 1: Diagram of an AdaConvBlock with local window size of Kadaptive . Lastly, as described in section 3.1, to reduce the memory and computation cost, we used depthwise separable convolutions with a depth multiplier equal to one in place of normal convolutions while regressing adaptive convolution weights. The use of depthwise separable convolutions also had another benefit in that it made the memory and computation cost almost insensitive to the parameter Kadaptive and allowed us to increase the receptive field to the regression at almost no cost. The choice of depth multiplier came from experiments. Empirically, we found increasing the depth multiplier not only increased the memory and computation cost but also slowed down the training progress. And overall, it did not improve our model’s performance. 4 R ELATED WORKS There have been several works that seek to improve GANs performance on datasets that have high visual variability. Salimans et al. (2016) proposed a semi-supervised training procedure for GANs. Instead of learning to only distinguish real and fake samples, the discriminator also learns to classify which class the real data points belong to. Their method turns the discriminator into K + 1-way classifier, with K classes of the real data and one class for the fake sample. Empirical results show that this kind of formulation surprisingly improves the quality of generated images. Based on the findings in this work, Warde-Farley & Bengio (2016) trained a denoising auto-encoder on the feature of the discriminator penultimate layer. For each generated sample, the squared difference between the discriminator feature and the reconstructed feature by the denoising auto-encoder for the penultimate layer is minimized. This additional training objective has the effect of guiding the generated samples toward regions in the feature space that correspond to higher probability configurations. The procedure is referred to by the authors as denoising feature matching. Grinblat et al. (2017) employed a simple but successful artificial class augmentation method for training GANs by dividing the samples using k-means clustering on the representation learned by the last hidden layer. Each cluster is treated as one artificial class. The networks are trained as an ACGAN (Odena et al., 2016b) using the artificial class labels. The generator uses both the random noise variable z and the artificial class label to generate fake samples while the discriminator tries to not only classify whether a sample is real or fake but to also construct the probability distribution over the artificial class labels. The discriminator starts with one cluster for the unsupervised case. Training progresses until a cluster is split into two when it has more samples than a threshold. Labels of the old cluster are then replaced with those of the new ones on the whole dataset. After this step, training is resumed with the new clusters. The aforementioned methods have been successful to varifying degrees. However, the common theme among all of them is that they all try to make use of additional high level information, whether directly from the training labels or indirectly from the discriminator, to augment new training objectives that can direct the generator toward better sample generation. Our approach is different as we try to better the generator output by improving the architecture. Our method is complementary to these existing methods and a combination has the potential to yield better results. Our method is inspired by the work of Niklaus et al. (2017) that applies adaptive convolution in video frame interpolation. The authors trained an encoder-decoder network to extract features on 5 Table 1: Architecture of the baseline generator. Mg = 4 for CIFAR-10 and Mg = 6 for STL-10. z ∈ R128 ∼ N (0, I) dense → Mg × Mg × 128 neareast-neighbor 2x resize. 3x3, stride=1, 64 output channels conv. BatchNorm. ReLU neareast-neighbor 2x resize. 3x3, stride=1, 32 output channels conv. BatchNorm. ReLU neareast-neighbor 2x resize. 3x3, stride=1, 16 output channels conv. BatchNorm. ReLU 3x3, stride=1, 3 output channels conv. Tanh two large image patches of the two video frames. The features are then fed into four subnetworks to estimate four 1D kernels that are then used for the interpolation. Although the base idea of using adaptive convolution is similar, there are differences between their work and ours that originates from differences in the problems. For the video interpolation task, they only have to regress a small number of outputs for each pixel location, while the size of our model, as well as outputs, grow cubically with the size of our base channels. This constraint makes the efficient use of memory more important in our work. Secondly, the filters of a video frame interpolation task are limited in the range [0, 1] but that is not the case for our GANs convolution filters. Therefore, the design paradigms for the two architectures are different. 5 E XPERIMENTS We perform experiments on CIFAR-10 (Krizhevsky, 2009) and STL-10 (Coates et al., 2011) datasets in a purely unsupervised setting. No labels or additional training objectives are used in the training process. Spectral Normalization (Miyato et al., 2017) is applied to the discriminator to stabilize training in all experiments. Zero padding is used for convolutions. All weights are initialized using a truncated normal distribution with mean zero and standard deviation of 0.02. Biases are initialized to zero. Following Miyato et al. (2017), we use Adam optimizer (Kingma & Ba, 2014) with α = 0.0002, β1 = 0.5, beta2 = 0.999 and batch size of 64 in all experiments. The number of discriminator updates per generator update is also fixed to one. Aligning with previous works, we compute the mean and standard deviations of the Inception score (Salimans et al., 2016) over 10 groups of 5000 randomly generated images. These two metrics are reported every 5000 training iterations and finally, the model with the highest mean score is selected for each architecture. 5.1 BASELINE Our baseline architecture is based on the Spectral Norm GAN (Miyato et al., 2017) architecture. We replace all transposed convolution in the generator network with resize-convolution as an upsampling algorithm. The generator consists of six layers. The first layer is a Gaussian noise generator N (0, I) followed immediately by a fully connected layer to project the noise vector into a 3D volume that has spatial shape of a square with side of Mg that depends on the dataset and depth of ”base channels” equal to 512. We reduce the base channels of the baseline generator from 512 to 128. The reason is that our architectures using AdaConvBlocks can only fit into GPU memory with 128 base channels. Table 1 show the architecture of the baseline generator. Note that this baseline generator and the discriminator we use in this work are not balanced, which leads to a relatively low Inception score. The discriminator network is kept unchanged from the work of Miyato et al. (2017). We use this discriminator for the baseline model as well as for all of our architectures. 5.2 O UR A RCHITECTURES We progressively replace 3x3 convolutions from the third to the last layer of the baseline generator in Table 1 with AdaConvBlocks. Note that the 3x3 convolution in the last layer is not part of an upsampling step. However, in our experiments, we find that replacing this convolution also improves the performance of our model slightly. The AdaConvBlocks that replace normal convolutions must keep the filter size Kf ilter and output channels Cout intact, leaving the only one parameter left 6 Table 2: Architecture of AdaGAN. Mg = 4 for CIFAR-10 and Mg = 6 for STL-10. Kadaptive for each AdaConvBlock are not specified. z ∈ R128 ∼ N (0, I) dense → Mg × Mg × 128 neareast-neighbor 2x resize. Kf ilter = 3, Cout = 64 AdaConvBlock. BatchNorm. ReLU neareast-neighbor 2x resize. Kf ilter = 3, Cout = 32 AdaConvBlock. BatchNorm. ReLU neareast-neighbor 2x resize. Kf ilter = 3, Cout = 16 AdaConvBlock. BatchNorm. ReLU Kf ilter = 3, Cout = 3 AdaConvBlock. Tanh that can vary is the size of the local window to regress the adaptive weights and biases Kadaptive . For a generator with base channel of 512, our architectures that use AdaConvBlocks do not fit into our GPU memory. The memory and computation cost of an AdaConvBlock grows cubically with the number of input channels Cin and Cin of the AdaConvBlocks, which are determined by the base channels. Therefore, we have to reduce the number of base channels from 512 to 128 for our architecture. Consequently, we have to reduce the base channels of our baseline generator as well. We name our architectures based on the number of AdaConvBlocks used to replace normal convolution in the baseline model. For example, AdaGAN-1 is the model that has the 3x3 convolution in the third layer replaced with an AdaConvBlock, AdaGAN-2 is the model that has both convolutions in the third and the fourth layers replaced with AdaConvBlocks and AdaGAN-3 is the model that has all convolutions replaced except for the last layer. Additionally, we name AdaGAN as the model that has all 3x3 convolutions replaced with AdaConvBlocks. Table 2 shows the architecture of AdaGAN model. For AdaGAN-1, AdaGAN-2 and AdaGAN-3, their architectures can be derived easily from table 1 and table 2. The choice of Kadaptive is an important factor for the performance of our architectures. Ideally, Kadaptive should be chosen separately for each layer. However, for simplicity, we fix Kadaptive for all AdaConvBlocks in an architecture. We append Kadaptive × Kadaptive to the name of every architecture. For example, AdaGAN-1-3x3 is an AdaGAN-1 architecture that has Kadaptive set to three, AdaGAN-5x5 is an AdaGAN architecture that has Kadaptive set to five. 5.3 CIFAR-10 To show the effectiveness of AdaConvBlocks, we compare the performance of the baseline generator with our architectures on the CIFAR-10 dataset. We use Kadaptive = 3 for all AdaConvBlock in this experiment. We train all models for 200,000 iterations. Table 3 shows the Inception score of the baseline generator versus our architectures. Experimental results show that the Inception score increases with the number of AdaConvBlocks used in place of normal convolutions. Replacing the convolution in the first upsampling layer (layer three) with an AdaConvBlock has the highest impact, improving the mean Inception score from 6.55 to 7.30, a 0.75 points difference. The AdaConvBlock in this upsampling layer helps increase the generator capacity significantly, allowing the generator to counterbalance the discriminator strength and thus leads to much better training results. The benefits of AdaConvBlocks weaken gracefully in the subsequent layers and become negligible in the last layer. Our AdaGAN-3x3 architecture with 128 base channels beats Spectral Norm GAN (Miyato et al., 2017), which use normal convolutions, by a large margin, even though the latter uses a generator with 512 base channels and has arguably better balance. Therefore, the increases in Inception scores of our models compared to the baseline model cannot be attributed to the effect of balancing between the generator and discriminator alone and the flexibility induced by AdaConvBlocks must have played a major role. This confirms our hypothesis that using normal convolution in the upsampling layers limits the performance of the generator and adaptive convolution can be used to alleviate this problem. To test the effects of Kadaptive , we additionally train another AdaGAN-5x5 model (Kadaptive = 5). This leads to a small increase in mean Inception score over the AdaGAN-3x3 model. Both of our AdaGAN models achieve state-of-the-art performance on CIFAR-10 dataset. Table 4, second column, shows the unsupervised Inception scores of our AdaGAN models compared to other methods on CIFAR-10. Figure 2 and 3 in appendix A show the samples generated by our AdaGAN models. 7 Table 3: Unsupervised Inception scores on CIFAR-10 of the baseline generator versus our architectures. Architecture Inception score Baseline 6.55 ± 0.08 AdaGAN-1-3x3 7.30 ± 0.11 7.74 ± 0.06 AdaGAN-2-3x3 AdaGAN-3-3x3 7.85 ± 0.13 AdaGAN-3x3 7.96 ± 0.08 Table 4: Unsupervised Inception scores on CIFAR-10 and STL-10 Method Real Data (Warde-Farley & Bengio, 2016) DFM (Warde-Farley & Bengio, 2016) Spectral Norm GAN Miyato et al. (2017) Splitting GAN ResNet-A Grinblat et al. (2017) AdaGAN-3x3 AdaGAN-5x5 AdaGAN-7x7 5.4 CIFAR-10 11.24 ± 0.12 7.72 ± 0.13 7.42 ± 0.08 7.90 ± 0.09 7.96 ± 0.08 8.06 ± 0.12 STL-10 26.08 ± 0.26 8.51 ± 0.13 8.69 ± 0.09 9.50 ± 0.13 9.19 ± 0.08 9.67 ± 0.10 9.89 ± 0.20 STL-10 For STL-10 experiments, we train on the unlabeled set and downsample the images from 96 × 96 to 48 × 48, following Warde-Farley & Bengio (2016). As STL-10 has bigger image size than CIFAR10, a larger Kadaptive maybe helpful. Thus, we train an AdaGAN-7x7 model on this dataset as well. Our architectures converge much slower on STL-10 therefore we train our models for 400000 iterations. The two AdaGAN-5x5 and AdaGAN-7x7 models achieve state-of-the-art performance while the AdaGAN-3x3 model is just behind the work of Grinblat et al. (2017). Table 4, third column, shows the unsupervised Inception scores of our models against other methods. Figure 4, 5 and 6 in appendix A show the samples generated by our models. 6 D ISCUSSION We have demonstrated that using adaptive convolutions to replace normal convolutions in a GANs generator can improve the performance of a weak baseline model significantly on visually diverse datasets. Our AdaGAN models were able to beat other state-of-the-art methods without using any augmented training objectives. The samples generated by our models show that they seem to be able to learn the global context pretty well and be able to learn the rough shapes of the objects in most cases and the sample quality is quite reasonable on CIFAR-10 dataset. Furthermore, there are not much visible convolution artifacts in the generated images. The success of our models suggests that non-trivial performance improvement can be gained from modifying architectures for GANs. The approach we take is different from other methods that try to inject high level information into the discriminator. These existing methods and AdaGAN can complement each other. More experiments need to be done, but we believe that our architectures can benefit from the augmented training objectives from existing methods. Our method is not without a downside. Even though we used depthwise separable convolution to reduce the cost, the amount of memory and computation is still extremely high. More tricks could be applied to alleviate this issue. For example, in a similar manner to Niklaus et al. (2017) work, both the local convolutions and the convolution to regress the adaptive weights for the local convolutions in our AdaConvBlock can be approximated by separate 1-D convolutions. This can reduce the cost by more than 50%. Another idea is to exploit locality. We expect the adaptive convolution weights and biases of a pixel location to be quite similar to its neighbors and can be interpolated in a certain way. We will address this issue in our future work. 8 R EFERENCES Martı́n Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for largescale machine learning. Martin Arjovsky, Soumith Chintala, and Léon Bottou. arXiv:1701.07875, 2017. Wasserstein gan. arXiv preprint Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2172–2180, 2016. François Chollet. Xception: Deep learning with depthwise separable convolutions. arXiv preprint arXiv:1610.02357, 2016. Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 215–223, 2011. Ivo Danihelka, Balaji Lakshminarayanan, Benigno Uria, Daan Wierstra, and Peter Dayan. Comparison of maximum likelihood and gan-based training of real nvps. arXiv preprint arXiv:1705.05263, 2017. Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014. Guillermo L. Grinblat, Lucas C. Uzal, and Pablo M. Granitto. Class-splitting generative adversarial networks, 2017. Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015. Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009. Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. 08 2017. Simon Niklaus, Long Mai, and Feng Liu. Video frame interpolation via adaptive separable convolution. arXiv preprint arXiv:1708.01692, 2017. Augustus Odena, Vincent Dumoulin, and Chris Olah. Deconvolution and checkerboard artifacts. Distill, 1(10):e3, 2016a. Augustus Odena, Christopher Olah, and Jonathon Shlens. Conditional image synthesis with auxiliary classifier gans. arXiv preprint arXiv:1610.09585, 2016b. Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015. Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pp. 2234–2242, 2016. Laurent Sifre and Stéphane Mallat. Rigid-motion scattering for texture classification. arXiv preprint arXiv:1403.1687, 2014. 9 David Warde-Farley and Yoshua Bengio. Improving generative adversarial networks with denoising feature matching. 2016. Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. arXiv preprint arXiv:1511.07122, 2015. Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. 10 A S AMPLES GENERATED BY OUR MODELS ON CIFAR-10 AND STL-10 DATASETS Figure 2: Samples generated by AdaGAN-3x3 on CIFAR-10 dataset Figure 3: Samples generated by AdaGAN-5x5 on CIFAR-10 dataset 11 Figure 4: Samples generated by AdaGAN-3x3 on STL-10 dataset Figure 5: Samples generated by AdaGAN-5x5 on STL-10 dataset 12 Figure 6: Samples generated by AdaGAN-7x7 on STL-10 dataset 13
1cs.CV
A MATLAB Code for Three Dimensional Linear Elastostatics using Constant Boundary Elements Kirana Kumara P Centre for Product Design and Manufacturing Indian Institute of Science Bangalore, India e-mail: [email protected] Abstract—Present work presents a code written in the very simple programming language MATLAB, for three dimensional linear elastostatics, using constant boundary elements. The code, in full or in part, is not a translation or a copy of any of the existing codes. Present paper explains how the code is written, and lists all the formulae used. Code is verified by using the code to solve a simple problem which has the well known approximate analytical solution. Of course, present work does not make any contribution to research on boundary elements, in terms of theory. But the work is justified by the fact that, to the best of author’s knowledge, as of now, one cannot find an open access MATLAB code for three dimensional linear elastostatics using constant boundary elements. Author hopes this paper to be of help to beginners who wish to understand how a simple but complete boundary element code works, so that they can build upon and modify the present open access code to solve complex engineering problems quickly and easily. The code is available online for open access (as supplementary file for the present paper), and may be downloaded from the website for the present journal. Keywords-elastostatics; BEM; constant; code;MATLAB I. INTRODUCTION Ready availability of computer codes encourages the use of any numerical technique. Reference [1], in its last paragraph of the section “Conclusion”, opines that boundary elements are a good idea in principle but not in practice because of the lack of proper software. This opinion remains true even today. There are some open source BEM libraries. Helsinki BEM library [2] is a MATLAB source code library for problems that obey the Laplace or Poisson equation. The web source [3] contains codes that are specifically useful for solving acoustics problems. The source also contains codes for solving Laplace problems and Helmholtz problems. Book [4] gives FORTRAN codes for Laplace’s equation and Helmholtz equation, in two and three dimensions. The codes can be freely downloaded from [5], website for the book. A BEM code for two dimensional (2D) pulsating cylinders is available from [6]. Fast Multipole Boundary Element Method (FastBEM) software is available from [7]. Software for three dimensional (3D) elasticity is also available here. Still, source codes are not available here. The website [8] for the book [9] contains many programs in Fortran. It contains programs for 3D elasticity also. But the website tells that the programs supplied there are for use by purchasers of the book only. Here, the Fortran program for 3D elasticity is not written as a single program; the main program calls different modules to perform different tasks. It is difficult to fully understand programs, without referring to the book. But, although three dimensional elasticity is such an important area, apart from the codes which might be available in the websites (e.g., the website [8]) that are companions to some non open access books, one cannot find an open access source code in any of the programming languages, although author of this paper could find a program on two dimensional elasticity in a file sharing system. Extension of a code on two dimensional elasticity into three dimensions is not very trivial and one needs some new formulae also. Also, file sharing systems sometimes delete some of the hosted files. Since codes are readily available for potential problems in three dimensions, it may be possible to cast a three dimensional elasticity problem as a three dimensional potential problem using potential representations like Papkovich-Neuber representation, but this is not the standard way an elasticity problem is solved using boundary elements. Hence, author of the present work thought of writing the present code on three dimensional elasticity and making it available for open access, through the present paper in the present open access journal. Present paper does not explain the theory behind boundary elements in detail. Aim is to list all the formulae that are needed to write the code, and explain how these formulae are assembled to produce a working code. The present paper is helpful to understand the working of the present code. Present work does not aim to provide source code for whole of three dimensional elasticity. It provides a MATLAB code only for the most basic form of three dimensional elasticity, i.e., three dimensional linear elastostatics. Although very basic, three dimensional linear elastostatics has wide applications in product design and structural design. Purpose of selecting MATLAB is that it is very easy to learn, and people who do not know the language also can follow the logic of the code. Using Parallel Computing Toolbox, now a MATLAB code can very easily be parallelized to run on multiple CPUs/GPUs. Code can be precompiled to increase speed. While solving complex realworld problems, a MATLAB code can readily interact with already developed subroutines in other languages like C/C++ and Fortran, using ‘External Interfaces’ feature of MATLAB. With little modification, a MATLAB code may be executed in one of open source and free equivalents of MATLAB such as GNU Octave, FreeMat and Scilab. Although very simple and very basic, the present code is not a subroutine but a complete program. Also, the present code does not contain any subroutines. Even input data has to be entered in the code itself. In terms of theory, present work does not make any contribution to research on boundary elements. All theory behind the present code, including all formulae, is taken from [9] and [4]. But the present code, in full or in part, is not a translation or a copy of any of the existing codes. The present work may also be useful as an educational aid to learn the basics of the boundary element method as applied to 3D linear elastostatics especially since it uses the most basic form of 3D elasticity, i.e., 3D linear elastostatics, and the most basic form of elements, constant elements. It may be noted that [10] presents a way of implementing the boundary element method using MATLAB, including details on coding, but for solving the Laplace's equation only. With detailed explanation of the theory, a MATLAB code for two dimensional Laplace’s equation is presented in [11]; it makes use of constant elements. Present paper is organized as follows. Next section describes the theory that is essential to develop the code. The subsequent section explains the code. The section that follows illustrates the use of the code to solve a well known simple problem which has a well known solution, and thus verifies the code. II. the geometry For 3D problems, the fundamental solutions are given by 1 U ij ( P, Q) = C (C1 ln δ ij + r,i r, j ) r (2) Tij ( P, Q) = − C2 rn (C3δ ij + (n + 1)r,i r, j )cosθ    − C3 (1 − δ ij )(n j r,i − ni r, j )  (3) In (2) and (3), r is the distance between P and Q , and ni and n j are the outward normals. The derivative of r with respect to the Cartesian axis i is denoted as r, i and the derivative of r with respect to the Cartesian axis ui ( p) = ∫ U ij ( P, Q)t j (Q)dS − ∫ Tij ( P, Q)u j (Q)dS denoted as r, j . The term cosθ is given by 1r r cosθ = r • n r (4) δ ij is given by  1 for (i = j )    0 for (i ≠ j )  δ ij =  (5) n=2 C= 1 16πG (1 − ν ) C1 = 3 − 4ν S (1) where j is The values of the constants are given by THEORY Only theory that is essential to understand the present code is explained here. One can refer to [4] and [9] for further details. From the Appendix of [9], for static elasticity, in indicial notation, the displacement ui at an internal point P, in the absence of initial stresses and strains, is given by S S is the surface (for 3D problems) which represents ui , ti (or u j , t j ) are the displacements and tractions C2 = 1 8π (1 − ν ) U ij ( P, Q), Tij ( P, Q) are called the fundamental solutions C3 = 1 − 2ν P is called the source point and Q is called the field point (6) where ν is the Poisson’s ratio. B3 = u z (Qm ) ∫ Txz (Pe , Qm )dS m Sm The shear modulus G is given by A4 = t x (Qm ) ∫ U yx (Pe , Qm )dS m E G= 2(1 + ν ) Sm A5 = t y (Qm ) ∫ U yy (Pe , Qm )dS m (7) where E is the modulus of elasticity. Sm A6 = t z (Qm ) ∫ U yz (Pe , Qm )dS m Sm In the present work, a 3D solid is represented by 3D boundary triangles, i.e., 3D triangular surface mesh. T is the total number of triangles which together represent the 3D solid; hence, the total number of elements is equal to T . Let m S be the surface of the element with element number m . Here, since constant elements are used, over each of the elements, displacements and tractions are assumed constant. For each of the elements, either displacement or traction is known, the other being an unknown that has to be calculated. In this work, solution is sought only on the boundary. For a point P on the boundary of a solid, if P is located inside a smooth region of the boundary, (1) can be reduced to the following three equations, i.e., (8), (9) and (10). T 1 u x (Pe ) = ∑ [A1 + A2 + A3 − B1 − B 2 − B3] 2 m =1 B 4 = u x (Qm ) ∫ Tyx (Pe , Qm )dS m Sm B5 = u y (Qm ) ∫ Tyy (Pe , Qm )dS m Sm B6 = u z (Qm ) ∫ Tyz (Pe , Qm )dS m Sm A7 = t x (Qm ) ∫ U zx (Pe , Qm )dS m Sm A8 = t y (Qm ) ∫ U zy (Pe , Qm )dS m Sm A9 = t z (Qm ) ∫ U zz (Pe , Qm )dS m Sm B7 = u x (Qm ) ∫ Tzx (Pe , Qm )dS m Sm (8) T 1 u y ( Pe ) = ∑ [ A4 + A5 + A6 − B 4 − B5 − B6] 2 m =1 B8 = u y (Qm ) ∫ Tzy (Pe , Qm )dS m Sm B9 = u z (Qm ) ∫ Tzz (Pe , Qm )dS m Sm (9) T 1 u z ( Pe ) = ∑ [ A7 + A8 + A9 − B7 − B8 − B9] 2 m =1 (10) where A1 = t x (Qm ) ∫ U xx (Pe , Qm )dS m To be clearer, equations (8)-(10) may also be written in the expanded form given by the following three equations, i.e., (11), (12) and (13). 1 u x ( Pe ) = [A11 + A21 + A31 − B11 − B 21 − B31] 2 + [ A12 + A22 + A32 − B12 − B 22 − B32] + K Sm A2 = t y (Qm ) ∫ U xy (Pe , Qm )dS m Sm A3 = t z (Qm ) ∫ U xz (Pe , Qm )dS m Sm K + [ A1m + A2m + A3m − B1m − B 2m − B3m ] + K K + [ A1T + A2T + A3T − B1T − B 2T − B3T ] B1 = u x (Qm ) ∫ Txx (Pe , Qm )dS m Sm B 2 = u y (Qm ) ∫ Txy (Pe , Qm )dS m Sm (11) B 4m = u x (Qm ) ∫ Tyx (Pe , Qm )dS m 1 u y ( Pe ) = [A41 + A51 + A61 − B 41 − B51 − B61] 2 Sm B5m = u y (Qm ) ∫ Tyy (Pe , Qm )dS m + [ A42 + A52 + A62 − B 42 − B52 − B 62] + K Sm B6m = u z (Qm ) ∫ Tyz (Pe , Qm )dS m K + [ A4m + A5m + A6m − B 4m − B5m − B 6m ] + K Sm A7 m = t x (Qm ) ∫ U zx (Pe , Qm )dS m Sm K + [ A4T + A5T + A6T − B 4T − B5T − B 6T ] A8m = t y (Qm ) ∫ U zy (Pe , Qm )dS m Sm A9m = t z (Qm ) ∫ U zz (Pe , Qm )dS m (12) Sm 1 u z ( Pe ) = [ A71 + A81 + A91 − B71 − B81 − B91] 2 B7 m = u x (Qm ) ∫ Tzx (Pe , Qm )dS m Sm B8m = u y (Qm ) ∫ Tzy (Pe , Qm )dS m + [ A72 + A82 + A92 − B 72 − B82 − B92] + K Sm B9m = u z (Qm ) ∫ Tzz (Pe , Qm )dS m K + [A7 m + A8m + A9m − B 7 m − B8m − B9m ] + K K + [ A7T + A8T + A9T − B 7T − B8T − B9T ] (13) where A1m = t x (Qm ) ∫ U xx (Pe , Qm )dS Sm A2m = t y (Qm ) ∫ U xy (Pe , Qm )dS m Sm A3m = t z (Qm ) ∫ U xz (Pe , Qm )dS m Sm B1m = u x (Qm ) ∫ Txx (Pe , Qm )dS m Sm B 2m = u y (Qm ) ∫ Txy (Pe , Qm )dS m Sm B3m = u z (Qm ) ∫ Txz (Pe , Qm )dS m Sm A4m = t x (Qm ) ∫ U yx (Pe , Qm )dS m Sm A5m = t y (Qm ) ∫ U yy (Pe , Qm )dS m Sm where m takes values from 1 to T . Equations (8)-(10) (or equations (11)-(13)) are the basic equations upon which the present code is developed. Since displacements and tractions are constants over each of the elements, for each of the elements, displacements and tractions are considered only for just one chosen point inside each element. Pe and Qm refer to these points; here, the e or m in Pe or Qm refer to the element number. The subscript e in Pe varies from 1 to T which is the total number of elements. Further, m = e implies that Pe = Qm . Hence, if a solid is discretized by T boundary elements, subscripts equation (8)-(10) (or equation (11)-(13)) give rise to a set of coupled 3T linear algebraic equations in 3T unknowns. Unknowns are either displacements ( u x , u y or u z at Pe or Qm ) or tractions ( t x , t y or t z at Qm (or Pe when e = m )). For elements with prescribed displacements ( u x , u y and u z ), the tractions ( t x , t y and t z ) are the unknowns. On the other hand, for elements with prescribed tractions ( t x , t y and t z ), the displacements ( u x , u y and u z ) are the unknowns. The set of may be written in the form 3T algebraic equations [K ]3T ×3T {U }3T ×1 = {F }3T ×1 Sm A6m = t z (Qm ) ∫ U yz (Pe , Qm )dS m Sm m (14) where {U } denotes the vector of unknowns, which consists of unknown displacements and unknown tractions. The matrix K is fully populated, in general. Solving (14) for 1 16 f ( xk , yk , zk )(1 − vk )J m ∫m f ( x, y, z)dS = 16 ∑ k =1 S m [ ] {U } , one can straight away obtain the values of the unknowns, be it unknown displacements or unknown tractions. Now, the method used to find the integrals of the fundamental solutions over the elements is explained, i.e., the goal now is to evaluate the integrals ∫U xx ( Pe , Qm )dS m , Sm xy ( Pe , Qm )dS m , m , ( Pe , Qm )dS m , m ∫ Txz ( Pe , Qm )dS , ∫T xy S m ∫ U xz ( Pe , Qm )dS , Sm m , m ∫ Tyx ( Pe , Qm )dS m ∫ U yy ( Pe , Qm )dS , Sm , m ∫ Tyy ( Pe , Qm )dS needs to be integrated over the element that has the element number m . Let (xa , ya , za ) , (xb , yb , zb ) and (xc , yc , zc ) be the coordinates of the vertices which define the triangular element m . Of course, the vertices always have to be m properly ordered such that the normal vector to S points out of the 3D solid under consideration. Then J in (16) is given by ( )( )( J m = 2 σ m σ m −αm σ m − β m σ m − γ m ) (17) , , Sm m ∫ Tyz ( Pe , Qm )dS , Sm ∫U zx ( Pe , Qm )dS m , m ∫T zx S ∫U zy ( Pe , Qm )dS m , zy (xa − xb )2 + ( ya − yb )2 + (za − zb )2 ( Pe , Qm )dS m , γm = (xc − xa )2 + ( yc − ya )2 + (zc − za )2 m ∫ Tzz ( Pe , Qm )dS To evaluate xk , These integrals are evaluated by numerical integration, as explained in Chapter 6 of [4]. All these integrals are evaluated by using the common formula 1 1− v m dudv 0 0 (t1, v1 ) =  1 + 1 1 1  , +  4 4 3 4 4 3 (t2 , v2 ) =  1 + 1 , 1 − 1  4 4 3 4 4 3 (t3 , v3 ) =  1 − 1 1 1  , +  4 4 3 4 4 3 (t4 , v4 ) =  1 − 1 , 1 − 1  4 4 3 4 4 3 1 1 = ∫∫ f ( x, y, z )(1 − v) J dtdv m 0 0 1 16 ≅ ∑ f (t k , vk ) 16 k =1 1 16 = ∑ f ( xk , yk , zk )(1 − vk )J m 16 k =1 (t5 , v5 ) =  3 + (15) Equation (15) may simply be written as yk and zk in (16), the following values for (tk , vk ) have to be noted down. Sm ∫ f ( x, y , z ) J αm = (xb − xc )2 + ( yb − yc )2 + (zb − zc )2 m ∫ U zz ( Pe , Qm )dS , f ( x, y, z )dS = ∫ 2 βm = Sm m α + β +γ m , Sm Sm σm = m ( Pe , Qm )dS m m ∫T m where Sm m ∫ U yz ( Pe , Qm )dS Sm Tyy , U yz , Tyz , U zx , Tzx , U zy , Tzy , U zz , Tzz ) which Sm Sm ∫ f ( x, y , z ) (i.e., U xx , Txx , U xy , Txy , U xz , Txz , U yx , Tyx , U yy , In equation (16), m Sm m ∫ U yx ( Pe , Qm )dS S ( Pe , Qm )dS m xx Sm ∫U S ∫T (16) is the fundamental solution 1 1  , +  4 3 4 4 3 1 4 (t6 , v6 ) =  3 + 1 , 1 − 1  4 4 3 4 4 3 (t7 , v7 ) =  3 − 1 1  , +  4 4 3 4 4 3 (t8 , v8 ) =  3 − 1 , 1 − 1  4 4 3 4 4 3 1 nzm = d (20) where (t9 , v9 ) =  3 + 1 , 3 + 1  4 4 3 4 4 3 (t10 , v10 ) =  3 + 1 , 3 − 1  4 4 3 4 4 3 (t11, v11 ) =  3 − (xb − xa )( yc − ya ) − ( yb − ya )(xc − xa ) 3 1  , +  4 4 3 4 4 3 (t12 , v12 ) =  3 − 1 , 3 − 1  4 4 3 4 4 3 d = [ (( yb − ya )( zc − za ) − ( zb − za )( yc − ya )) 2 + ((zb − za )(xc − xa ) − (xb − xa )(zc − za ))2 + ((xb − xa )( yc − ya ) − ( yb − ya )(xc − xa ))2 ]1/2 1 Now, depending on the values of and zk in (16) can be calculated using the appropriate equation from one of the following (21)-(23). 1 3 xk = ( xb − xa )uk + ( xc − xa )vk + xa yk = ( yb − ya )uk + ( yc − ya )vk + ya (t13 , v13 ) =  1 + 1 , 3 + 1  4 4 3 4 4 3 (t14 , v14 ) =  1 + 1 , 3 − 1  4 4 3 4 4 3 If (t15 , v15 ) =  1 − 1 , 3 + 1  4 4 3 4 4 3 (t16 , v16 ) =  1 − 1 , 3 − 1  4 4 3 4 4 3 zk = − nzm nzm ≥ ( ) [n (x −1 m x k ] − xa ) + n my ( yk − ya ) + za (21) (18) Now, nzm and n my , xk , yk 1 1 m m Else, if nz < and n y ≥ 3 3 xk = ( xb − xa )uk + ( xc − xa )vk + xa zk = ( zb − za )uk + ( zc − za )vk + za ( ) [n (x uk is calculated as uk = tk (1 − vk ) yk = − n my −1 m x k ] − xa ) + nzm ( zk − za ) + ya (22) (19) Next, to calculate xk , yk and zk in (16), one needs to also calculate the components of the unit normal vector to the element surface (xb , yb , zb ) and S m . Again, assuming that ( xa , ya , za ) , (xc , yc , zc ) are the coordinates of the vertices of the triangular element the unit normal vector in the x , given by nxm = m , the components of y and z direction are ( yb − ya )(zc − za ) − (zb − za )( yc − ya ) d (z − za )(xc − xa ) − (xb − xa )(zc − za ) n ym = b d 1 1 m and n y < 3 3 yk = ( yb − ya )uk + ( yc − ya )vk + ya zk = ( zb − za )uk + ( zc − za )vk + za Else, if nzm < ( ) [n ( y xk = − nxm −1 m y k ] − ya ) + nzm ( zk − za ) + xa (23) Equations (21)-(23) are also used to evaluate the Cartesian coordinates of Pe or Qm , which may be denoted as (x m , y m , z m ) , by setting uk = ( m m m ) 1 1 and vk = . Hence, for 4 2 element m , x , y , z which is the chosen point inside the element m and which is the only point on the element where displacement or traction is considered (the other points on the element having the same value of displacement or traction as that of this point), is given by (24)-(26). If nzm ≥ 1 1 x m = ( xb − xa ) + ( xc − xa ) + xa 4 2 1 1 y m = ( yb − ya ) + ( yc − ya ) + ya 4 2 ( ) [n (x −1 m x m ) ( )] − xa + nym y m − ya + za (24) ( ) [n (x −1 m x m ) ( )] − xa + nzm z m − za + ya (25) 1 1 m m Else, if nz < and n y < 3 3 1 1 y m = ( yb − ya ) + ( yc − ya ) + ya 4 2 1 1 z m = ( zb − z a ) + ( zc − z a ) + z a 4 2 ( ) [n (y x m = − nxm −1 m y m ) (    )] − ya + nzm z m − z a + xa  C  dr  dr  U zx = U xz =      r  dz  dx  2  − C2   dr   Txx = 2 C3 + 3   cos θ  r   dx    2   dr   − C2  Tyy = 2 C3 + 3   cosθ  r    dy    2  − C   dr   Tzz = 2 2 C3 + 3   cos θ  r   dz     dr − C   dr  dr  dr  Txy = 2 2 3   cosθ − C3  n ym − nxm  r   dx  dy  dy   dx Tyx =  dr − C2   dr  dr  dr   3   cosθ − C3  nxm − n my 2   r   dy  dx  dx   dy Tyz =  dr − C2   dr  dr  dr   3   cos θ − C3  nzm − n my 2   r   dy  dz  dz   dy Tzy =  m dr − C2   dr  dr  m dr      3 cos θ − C n − n    3 y z  dz r 2   dz  dy  dy   Tzx = − C2 r2   dr  dr   m dr m dr  3 dz  dx  cos θ − C3  nx dz − nz dx        Txz = − C2 r2   dr  dr   m dr m dr  3 dx  dz  cos θ − C3  nz dx − nx dz        (26) Now, one can see that (16) can now be evaluated if one knows the expressions for the fundamental solutions (i.e., U xx , Txx , U xy , Txy , U xz , Txz , U yx , Tyx , U yy , Tyy , U yz , Tyz , U zx , Tzx , U zy , Tzy , U zz , Tzz ). Using (2) and (3), expressions for the fundamental solutions may be written in the expanded form as given by (27) below. In these equations, ( x1 , y1 , z1 ) denotes the coordinates of the Pe while ( x2 , y2 , z2 ) denotes the coordinates of the point ( xk , yk , zk ) . point 2  C  dr  dr  U xy = U yx =      r  dx  dy   C  dr  dr  U yz = U zy =      r  dy  dz  1 1 m m and n y ≥ Else, if nz < 3 3 1 1 x m = ( xb − xa ) + ( xc − xa ) + xa 4 2 1 1 z m = ( zb − z a ) + ( zc − z a ) + z a 4 2 y m = − n ym  dr  C U yy = C1 +   r  dy   2 C  dr   U zz = C1 +    r   dz   1 3 z m = − nzm 2 C  dr   U xx = C1 +    r   dx   (27) where r = ( x2 − x1 ) + ( y2 − y1 ) + (z 2 − z1 ) dr ( x2 − x1 ) dr ( y2 − y1 ) = = dx r dy r dr ( z2 − z1 ) = dz r 2 cosθ = 2 2 1 (x2 − x1 )nxm + ( y2 − y1 )nym + (z2 − z1 )nzm r [ ] (From equation (4)) Other notations have the same meanings as earlier nxm , nym and nzm are constant over an element m nxm , nym and nzm are different for different elements, in general Here one can note that since there are sixteen (xk , yk , zk ) m , when one integrates a fundamental m solution over an element surface S (which contains the point Qm ), for every ( x1 , y1 , z1 ) , there are sixteen different ( x2 , y2 , z2 ) . Further, when the whole code is considered, since the total number of elements equals T , for every ( x1 , y1 , z1 ) , there are 16T different ( x2 , y2 , z2 ) ; and there are T different ( x1 , y1 , z1 ) in total. for every element III. THE CODE EXPLAINED The present code is explained in this section. The variables in the program (code) may or may not be identical to the corresponding notations in the previous (i.e., ‘Theory’) section. One can note that there are eight supplementary files that are available with the online version of the present paper. Logging into the website (after creating an account for free) of the present journal may be necessary to access the supplementary files. The present code is available through either of ‘code_medium.m’ or ‘code_high.m’. The only difference between the files is that they contain different input data; otherwise codes are the same. Since the .m files ‘code_medium.m’ and ‘code_high.m’ are self-contained (i.e., since they contain input data also), they may readily be run from within MATLAB (author has used MATLAB R2010b). When the file ‘code_medium.m’ is run, the result obtained in the MATLAB Command Window is manually saved into ‘result_medium.txt’. Similarly, when the file ‘code_high.m’ is run, the result obtained is manually saved into ‘result_high.txt’. To use the present code to solve any other 3D linear elastostatic problem, one need to just change the input data portion of either of ‘code_medium.m’ or ‘code_high.m’. The file ‘mesh_medium.stl’ is the .stl file which represents the example 3D geometry discretized into 172 boundary elements. The file ‘mesh_high.stl’ represents the same geometry with 428 boundary elements. The .stl files are manually edited and formatted in a text editor such as Notepad into the format of the input mesh for the present code ‘code_medium.m’ or ‘code_high.m’, and saved as .txt files. The ‘mesh_medium.stl’ is edited, formatted and then saved as ‘mesh_medium.txt’ whereas ‘mesh_high.stl’ is edited, formatted and saved as ‘mesh_high.txt’. Since ‘code_medium.m’ and ‘code_high.m’ contain input data also, ‘code_medium.m’ already contains ‘mesh_medium.txt’ and ‘code_high.m’ already contains ‘mesh_high.txt’. To use the present code to solve problems other than the present test problem, in the similar fashion, one needs to prepare a mesh for the geometry under consideration, and use the prepared mesh as an input data for either of ‘code_medium.m’ or ‘code_high.m’, the other input data being the specification of boundary conditions, i.e., the specification of displacements for elements with specified displacements and the specification of tractions for the rest of the elements. Now, the code ‘code_medium.m’ is explained in detail, line by line. Except input data portion, ‘code_medium.m’ and ‘code_high.m’ are identical. For that matter, except input data portion, the code to solve any other 3D linear elastostatic problem would be the same as ‘code_medium.m’. The 5th line of ‘code_medium.m’ specifies the modulus of elasticity, while the 6th line specifies the Poisson’s ratio. The 7th line specifies the displacement boundary conditions; “161 0 0 0” here means that the element number 161 has specified zero displacements along x, y and z directions; similarly, “162 0 0 0” means the element 161 is fixed; same for elements up to 166. The 8th line specifies the nonzero force boundary conditions; “167 0 0 10000” here means that the element 167 is subjected to zero traction along x direction, zero traction along y direction, but 10000 units of traction along the z direction; same is the case for elements up to 172. Now, one can see that the elements which are not subjected to displacement boundary conditions and are not subjected to nonzero force boundary conditions also, are subjected to zero force boundary conditions; Lines 9-12 specify zero force boundary conditions; tractions on the elements mentioned here are zero in x, y and z directions. Line 13 combines zero and nonzero force boundary conditions. The variable ‘xyzofelements’ in line 14 takes a mesh as input; the mesh has 172 elements; the mesh describes the 3D geometry under consideration; mesh is just copy-pasted from ‘mesh_medium.txt’; “1 2.000000e+000 0.000000e+000 1.000000e+001; 1 1.000000e+000 0.000000e+000 1.000000e+001; 1 1.000000e+000 0.000000e+000 5.000000e+000” in line 14 means that for element 1, xa =2.000000e+000, ya = 0.000000e+000, za = 1.000000e+001, again for element 1, xb = 1.000000e+000, yb = 0.000000e+000, zb = 1.000000e+001, again for element 1, xc = 1.000000e+000, yc = 0.000000e+000, zc = 5.000000e+000; lines 15-185 have similar meaning. Data entered until now form the input portion of the code. The code now contains the geometry, boundary conditions, and the material property. One can use the code ‘code_medium.m’ to solve any other 3D linear elastostatic problem by just changing this portion of the code to provide the data that are relevant to the new problem. Lines 186-191 evaluate the constants G, C, C1, C2, C3 and n. Lines 192-193 calculate the total number of elements. Lines 194-195 calculate the total number of elements with displacement boundary condition. Lines 196-197 calculate the total number of elements with force boundary condition. Lines 198-204 are initializations. Lines 205-237, using (20) calculate nxm , n my , nzm , using (17) calculate J m , using (24) m m m or (25) or (26) calculate x , y , z ; these are calculated for each and every element. Lines 238-239 input the values of tk and vk , as given in (18). Line 240 calculates uk using (19). Lines 241-242 are initializations. Purpose of lines 243-520 is to calculate K and {F } of (14). The outermost for loop starts at line 243 and ends at line 520; the iteration here is for different values of Pe ; hence, there are as many iterations of this loop as the total number of elements. The for loop starting at line 244 and ending at line 381 iterates for every element with force boundary condition, for a fixed Pe defined by the outer loop; [ ] xk , yk , zk using (21) or (22) or (23) (here, x1 means xa , y2 means yb etc.); lines lines 245-284 evaluate the values of 285-302 are just initializations. There is one more for loop which starts at line 303 and ends at line 345; the loop is within the previous loop; purpose of this loop is to evaluate (16); of course, the loop evaluates sixteen times the value of the right hand side of (16); lines 304-308 evaluate the values of r, dr/dx, dr/dy, dr/dz and cosθ , for every ( xk , yk , zk ) of the element defined by the outer loop; lines 309-317 and lines 327-335 evaluate the expressions in (27) at each of (xk , yk , zk ) , and lines 318-326 and lines 336-344 add the evaluated values to accumulate to sixteen times the value of the right hand side of (16). Coming out of the innermost for loop, lines 346-363 evaluate the right hand side of (16); lines 364-375 build K and {F } of (14); here one can remember that (14) is the same as (11)-(13) considered together. Lines 376-380 address the case while, during iterations, e = m ; in this case, terms on the left hand side of (11)-(13) are unknowns and hence belong to K {U } and [ ] [ ] [K ] (not {F }) has to be modified by adding ‘0.5’ to the appropriate elements of [K ] , as has been done in lines hence 376-380; ‘0.5’ here arises out of ‘1/2’ in 1 1 u x , u y and 2 2 1 u z , on the left hand side of (11)-(13). Now, the for loop 2 from the line 382 to the line 520 iterates for every element with force boundary condition, for a fixed Pe defined by the outer loop; here, lines 382-513 have the same purpose as the lines 244-375. Again, lines 514-518 address the case while, during iterations, e = m ; in this case, terms on the left hand side of (11)-(13) are known and hence belong to {F } and [ ] hence {F } (not K ) has to be modified, as has been done in lines 514-518; again, ‘0.5’ here arises out of ‘1/2’ in 1 1 1 u x , u y and u z , on the left hand side of (11)-(13). 2 2 2 Now, line 522 calculates {U } of (14). Line 524 displays calculated values of the unknowns in the MATLAB Command Window; the unknowns could be either displacements u x , u y , u z or tractions t x , t y , t z ; for ( ) ( ) elements with known displacements, tractions are the unknowns; for elements with known tractions, displacements are the unknowns; line 524 displays the result {U } in this format: value of the unknown (in the x direction, for element number 1), value of the unknown (in the y direction, for element number 1), value of the unknown (in the z direction, for element number 1), value of the unknown (in the x direction, for element number 2), value of the unknown (in the y direction, for element number 2), value of the unknown (in the z direction, for element number 2), value of the unknown (in the x direction, for element number 3) etc. IV. ILLUSTRATION AND VERIFICATION In the present section, the present code is tested by using the code to solve a simple problem with the known solution, i.e., a bar subjected to end force. Geometry of the test problem is a prismatic bar. The bar has a (4 mm x 4 mm) cross section, and the bar is 100 mm long. One end of the bar is fixed, while the other end is loaded with 160000 N force in the axial direction. The coordinates of the vertices which describe the fixed end of the bar are given by (0,4,0), (4,4,0), (4,0,0) and (0,0,0). The coordinates of the vertices which describe the loaded end are given by (0,0,100), (4,0,100), (4,4,100) and (0,4,100). All dimensions here are expressed in millimeters. The problem is to find the displacement at the loaded end upon the application of the load. Modulus of elasticity is assumed as 200000 N/mm2, and the Poisson’s ratio is assumed to be equal to 0.33. For simple geometries like a prismatic bar, one can manually prepare a mesh. But, here, since it is a cumbersome and also an error prone process to manually prepare the mesh, the commercial software Rhinoceros (Version 3.0) is used for this purpose. Of course, the mesh may be prepared by using any of the much commercial or free software that can do the job. First, the prismatic bar is constructed in Rhinoceros; then the geometry is saved as a .stl file. A .stl file describes a 3D geometry in terms of a 3D surface mesh consisting of triangles. Rhinoceros has the option to save a 3D geometry as an .stl file, with different total number of triangles, i.e., one can save the geometry in different resolutions. One should remember to save .stl files in the ASCII format; this format is human readable. Here, the geometry constructed in Rhinoceros is saved with two different resolutions, which resulted in a total of 172 and 428 elements. The mesh with 172 elements is named as ‘mesh_medium.stl’, and the mesh with 428 elements is named as ‘mesh_high.stl’. When ‘mesh_medium.stl’ is opened in Notepad, on the 4th line, one can read this: “vertex 2.000000e+000 0.000000e+000 1.000000e+001”. This means that for the first element, xa = 2.000000e+000, ya= 0.000000e+000, za=1.000000e+001. The 5th line reads as: “vertex 1.000000e+000 0.000000e+000 1.000000e+001” which means that for the first element, xb = 1.000000e+000, yb= 0.000000e+000, zb=1.000000e+001. Similarly 6th line means that xc = 1.000000e+000, yc= 0.000000e+000, zc=5.000000e+000, for the first element. In the same way, lines 11-13 give the coordinates of xa, ya, za, xb, yb, zb, xc, yc, zc, for the second element; lines 18-20 give the coordinates of these for the third element, and so on. Now, the file ‘mesh_medium.stl’ is edited and formatted to the form that is saved as ‘mesh_medium.txt’. Same way, ‘mesh_high.txt’ is obtained from ‘mesh_high.stl’. Mesh data from ‘mesh_medium.txt’ or ‘mesh_high.txt’ can readily be cutpasted into the present code. Now, one needs to identify the elements which are fixed, and the elements which are subjected to tractions. For the example problem considered here, one can note that the elements that have the z coordinates of all their vertices equal to zero are the ones which are fixed, i.e., they are the elements that are subjected to displacement boundary conditions, with all the displacements being zero. One can also note that the elements that have the z coordinates of all their vertices equal to 100 are subjected to traction in the z direction. Hence, for the lower resolution mesh, by looking at ‘mesh_medium.txt’, one can note that the elements 161166 are fixed, the elements 167-172 are subjected to nonzero tractions, and the other elements (i.e., the elements 1-160) are subjected to zero traction. Similarly, for the higher resolution mesh, by looking at ‘mesh_high.txt’, one can note that the elements 409-418 are fixed, the elements 419-428 are subjected to nonzero tractions, and the other elements (i.e., the elements 1-408) are subjected to zero traction. The nonzero traction in the z direction (for the elements on the loaded end) is given by tz = Force 160000 = = 10000 N / mm 2 Area 4× 4 This value is the same whether one uses a medium resolution mesh or a high resolution mesh. For the test problem considered here, all input data (discussed in the previous four paragraphs) are already contained in the codes ‘code_medium.m’ and ‘code_high.m’, for the medium resolution mesh and high resolution mesh cases respectively. After running the codes ‘code_medium.m’ and ‘code_high.m’, results are saved in the files ‘result_medium.txt’ and ‘result_high.txt’ respectively. Considering ‘result_medium.txt’, the last eighteen rows give the displacement solutions for the last six elements (the last six elements are the ones which are subjected to nonzero tractions). The solutions, as obtained from the last eighteen rows of the file ‘result_medium.txt’, are tabulated in Table I. TABLE I. DISPLACEMENT SOLUTIONS AT THE LOADED END (FOR MEDIUM RESOLUTION MESH) Element No. ux*103 mm uy*103 mm uz*103 mm 167 168 169 170 171 172 0.000475723884518 -0.000288557449754 -0.000227579883863 0.000350870893377 0.000061463916240 -0.000001691317047 0.000239277914653 0.000350459191737 -0.000253099680184 -0.000146245484676 0.000227509412390 -0.000015656433286 0.004667990981856 0.004640913749073 0.004662295196899 0.004666785214835 0.004136294937252 0.004147373087041 Now, considering ‘result_high.txt’, the last thirty rows give the displacement solutions for the last ten elements (the last ten elements are the ones which are subjected to nonzero tractions). The solutions, as obtained from the last thirty rows of the file ‘result_high.txt’, are tabulated in Table II. TABLE II. DISPLACEMENT SOLUTIONS AT THE LOADED END (FOR HIGH RESOLUTION MESH) Element No. ux*104 mm uy*104 mm uz*104 mm 419 420 421 422 423 424 425 426 427 428 0.000014972072838 -0.000053933725093 -0.000084785786018 0.000019080155101 -0.000027613176014 0.000005898472131 0.000032708654327 -0.000056504866697 -0.000025959290317 -0.000020851664801 0.000069229499481 0.000032473982250 0.000055690465021 0.000032731914270 -0.000011163464531 0.000062564046813 0.000036306507440 0.000061990516729 0.000052674228475 0.000043533648613 0.000548700220572 0.000533494879700 0.000561328889982 0.000534518762716 0.000553379281037 0.000530196484107 0.000554565304403 0.000528972628751 0.000538346574184 0.000537601022532 From Table I and Table II, one can note that displacements in the x and y directions are an order of magnitude less than the displacements in the z direction, for all the elements, in general. This is expected since, for the present example problem, displacements in the z direction should be dominant. In fact, as far as the present test problem is concerned, one is interested in the displacements along the z direction only. Now, considering only the displacements along the z direction and rounding off the decimal values into three digits, and comparing the results with the result from the analytical formula, one can compile the tables Table III and Table IV. For the present test problem, the analytical solution, i.e., the result from the well known analytical formula is obtained as Displacement = Force × Length Area × E where ‘Displacement’ implies the displacement of the loaded end in the z direction ‘Force’ implies the total force applied at the loaded end (= 160000 N) ‘Length’ implies the length of the prism (= 100 mm) ‘Area’ implies the cross sectional area of the prism (= (4 x 4) mm = 16 mm) E is the modulus of elasticity (= 200000 N/mm2) Using the above formula, the analytical result is found to be equal to 5 mm, for all the elements on the loaded end, for both medium resolution and high resolution meshes. TABLE III. COMPARISON OF THE RESULTS FROM THE CODE AND THE ANALYTICAL FORMULA (FOR MEDIUM RESOLUTION MESH) Element Number 167 168 169 170 171 172 uz From the Code (mm) 4.668 4.641 4.662 4.667 4.136 4.147 uz From the Analytical Formula (mm) 5.000 5.000 5.000 5.000 5.000 5.000 TABLE IV. COMPARISON OF THE RESULTS FROM THE CODE AND THE ANALYTICAL FORMULA (FOR HIGH RESOLUTION MESH) Element Number 419 420 421 422 423 424 425 426 427 428 uz From the Code (mm) 5.487 5.335 5.613 5.345 5.534 5.302 5.546 5.290 5.383 5.376 uz From the Analytical Formula (mm) 5.000 5.000 5.000 5.000 5.000 5.000 5.000 5.000 5.000 5.000 From Table 3 and Table 4, one can see that the results from the code are in good agreement with the results from the analytical formula. Thus, one can infer that the present code has performed satisfactorily. However, one can note that there is not much improvement in accuracy, when the total number of elements is increased from 172 (which corresponds to the medium resolution mesh) to 428 (which corresponds to the high resolution mesh). The reasons could be that the analytical formula itself is just an approximate one, and the present code solves the present example problem as a 3D problem; also, when the boundary elements are limited in number, it may be difficult to apply the boundary conditions accurately. Further, numerical integration here always uses only sixteen function evaluations per element, which may be insufficient sometimes especially since singularity of the fundamental solutions is not addressed in the present work. Using very large number of elements might improve accuracy, or one has to use linear or quadratic elements for better convergence; to improve accuracy, one may need to do higher number of function evaluations per element during numerical integration; to improve the accuracy further, one may have to properly address the singularities of the fundamental solutions also. V. CONCLUDING REMARKS This work presents a code written in the very simple programming language MATLAB, for three dimensional linear elastostatics, using constant boundary elements. Present work is justified by the fact that, to the best of his knowledge, author of the present work, apart from the codes which might be available in the websites that are companions to some non open access books, is not aware of any open access source code available in the internet that is written in any of the programming languages. The present code is tested by using the code to solve a simple problem with the known solution, i.e., a bar subjected to end force. Result from the code matched well with that obtained from the analytical formula, thus verifying the code. The code may be used to solve three dimensional linear elastostatic problems. Present work could also be an educational aid to those who would like to acquire just a working knowledge of the boundary element method, as applied to three dimensional elastostatics, quickly and easily. Since the code is available for open access, and also since the code is properly documented (documentation includes listing of all the formulae used) through the present paper, present work would also be of help to those who want to modify and/or build upon the present very basic code to suit their requirements. The present code is applicable to homogeneous and isotropic materials only, and self weight is not taken into account. In this work, only constant boundary elements are considered. Although constant boundary elements can provide adequate accuracy upon fine discretization, whenever greater accuracy is important, linear and quadratic elements may help to get highly accurate results quickly. Since the emphasis in this work is on readability, the code is not optimized for efficiency. Numerical integration here always uses only sixteen function evaluations per element, which may be insufficient sometimes. Also, singularity of the fundamental solutions is not addressed in the present work and hence, while evaluating the integrals, whenever integrand becomes singular, accuracy of the evaluation of the value of the integrals may not be good enough, especially since the present work always uses only sixteen function evaluations per element; this may make the final results less accurate, and even inaccurate sometimes. These are the limitations of the present work. As future work, singularity of the fundamental solutions has to be properly addressed. Also, there should be a provision in the code to use more number of function evaluations per element, while evaluating the integrals. The code may be improved for better performance, and the code may be parallelized for multiple CPUs/GPUs. The code may also be extended to cover three dimensional nonlinear elasticity. Also, body forces and dynamics may be taken into account. In addition to constant elements, linear and quadratic elements may also be included. The code can further be extended to cover inhomogeneous and anisotropic materials also. [2] [3] [4] http://peili.hut.fi/BEM/ http://www.boundary-element-method.com/ Ang W.T., A Beginner's Course in Boundary Element Methods, Universal Publishers, Boca Raton, USA, 2007. [5] http://www.ntu.edu.sg/home/mwtang/bem2011.html [6] http://www.mathworks.com/matlabcentral/fileexchange/16074-bemcode-for-2d-pulsating-cylinder [7] http://urbana.mie.uc.edu/yliu/Software/ [8] http://www.ifb.tugraz.at/BEM [9] Beer G., Smith I. and Duenser C., The Boundary Element Method with Programming, SpringerWienNewYork, 2008. [10] Ang K.C., “Introducing the Boundary Element Method with MATLAB,” International Journal of Mathematical Education in Science and Technology, Vol. 39, No. 4, pp. 505-519, 2008. [11] Kirkup S. and Yazdani J., “A Gentle Introduction to the Boundary Element Method in Matlab/Freemat,” http://www.boundary-elementmethod.com/AR0814BEM.pdf DISCLAIMER Codes are provided without any guarantee and without any warranty. Author is not responsible for any loss or damage that may arise because of the use of the codes that are made available with this paper. ACKNOWLEDGMENT Author is grateful to the Robotics Lab, Department of Mechanical Engineering & Centre for Product Design and Manufacturing, Indian Institute of Science, Bangalore, INDIA, for providing the necessary infrastructure to carry out this work. REFERENCES [1] Watson J. O., “Boundary Elements from 1960 to the Present Day,” Electronic Journal of Boundary Elements, Vol. 1, No. 1, pp. 34-46, 2003. .
5cs.CE
arXiv:1504.04648v3 [math.GR] 14 Sep 2017 On equivariant asymptotic dimension Damian Sawicki∗ Institute of Mathematics, Polish Academy of Sciences Śniadeckich 8, 00-656 Warsaw, Poland www.impan.pl/˜dsawicki Abstract. The work discusses equivariant asymptotic dimension (also known as “wide equivariant covers”, “N -F -amenability” or “amenability dimension”, and “d-BLR condition”) and its generalisation, transfer reducibility, which are versions of asymptotic dimension invented for the proofs of the Farrell–Jones and Borel conjectures. We prove that groups of null equivariant asymptotic dimension are exactly virtually cyclic groups. We show that a covering of the boundary always extends to a covering of the whole compactification. We provide a number of characterisations of equivariant asymptotic dimension in the general setting of homotopy actions, including equivariant counterparts of classical characterisations of asymptotic dimension. Finally, we strengthen the result of Mole and Rüping about equivariant refinements from finite groups to infinite groups. Mathematics Subject Classification (2010). 20F65 (18F25, 20F67, 57M07). Keywords. Equivariant cover, asymptotic dimension, homotopy action, transfer reducible group, Farrell–Jones conjecture. Introduction The concept of equivariant asymptotic dimension was introduced by Bartels, Lück, and Reich in [6]. Proving finiteness of equivariant asymptotic dimension was a major technical step in the proof of the Farrell–Jones conjecture for hyperbolic groups [7]. A generalisation of this property – transfer reducibility (see Section 2) – was used to prove the Farrell–Jones conjecture for CAT(0) groups [5]. Then, the Borel conjecture was derived for a class of groups containing hyperbolic and CAT(0) groups [5]. ∗ The author was partially supported by the Foundation for Polish Science with the grant HOMING PLUS Bis/2011-4/6. 1 Equivariant asymptotic dimension and transfer reducibility have been extensively studied in the last years, mostly as a tool to prove the Farrell–Jones conjecture. The scope of this research involves GLn (Z) [8] and other linear groups [14, 18], virtually solvable groups [21], CAT(0) groups [4, 20], and relatively hyperbolic groups [2]. Very recently, in [13], a new construction of covers was proposed, which – in particular – provides improved bounds on equivariant asymptotic dimension of hyperbolic groups. There are more positive results regarding transfer reducibility [4, 8, 18, 20, 21] than equivariant asymptotic dimension [2, 6], because its definition is formally less restrictive. However, it seems to be an open question whether the two notions are equivalent, cf. [1, Remark 3.15]. All the known proofs [2, 6, 13] showing finiteness of equivariant asymptotic dimension are complex and involve the notion of (coarse) flow space. Some elementary constructions, even in the simplest cases such as that of the free group, are unknown and desired, cf. [1, Remark 3.12]. We make a step in this direction, showing that it is enough to study the equivariant asymptotic dimension eq-asdim G × ∂X for the boundary ∂X. More precisely, we describe a method of extending coverings from the boundary and obtain the following result. Theorem A (Theorem 1.9). Under appropriate assumptions, eq-asdim G × X ≤ eq-asdim G × ∂X + dim X. Another quantitative result is the following characterisation of the situation when the equivariant asymptotic dimension vanishes, which yields, as a corollary, a geometric characterisation of virtually cyclic groups. Theorem B (Theorem 1.14). For a family of groups F , F-eq-asdim G = 0 if and only if F contains a finite-index subgroup of G. The notion of equivariant asymptotic dimension relates to some other concepts, most importantly to asymptotic dimension (but also to amenable actions). The similarity of definitions and quantitative relations are discussed in Subsection 1.3. The second part of the paper, Section 2, is devoted to providing a number of different characterisations of equivariant asymptotic dimension and transfer reducibility (Theorem 2.4). Interestingly, appropriate forms of characterisations invented originally for asymptotic dimension are still valid in the very general framework of homotopy actions (transfer reducible groups). In Proposition 2.8, we present two more characterisations and a different proof (not using metrisability) of their equivalences, assuming that we deal with ordinary (not homotopy) group actions. In Appendix A, we strengthen the result of [14] stating that for an equivariant covering one can find an equivariant refinement of dimension at most equal to the dimension of the space. In that sense, “equivariant topological dimension” is equal to the topological dimension. The theorem was originally formulated for finite groups and we generalise it to infinite groups provided the action is assumed to be proper. It is used in Subsection 1.2 in the proof of Lemma 1.8, but can be read independently from the rest of the paper. 2 1 Genuine group actions – the vanishing theorem and extending coverings from the boundary 1.1 Definition Let us start by fixing some notation. The S metric neighbourhood of a subset A of radius r will be denoted by B(A, r) = x∈A B(x, r) and B(x, r) will denote a closed ball. When a group G acts on a topological space X (on a set Y ), we will shortly say that X (Y ) is a G-space (a G-set). Sometimes we will write “for all α < ∞...” to denote “for all α ∈ (0, ∞)...” in order to clarify that the following condition is trivial for “small” α and interesting for “large” ones. Unless stated otherwise, we will assume that G is a finitely generated group with a fixed word-length metric, and X will denote a compact G-space. Definition 1.1. A family F of subgroups of a group G is a set of subgroups closed under conjugation and taking subgroups. A family F is virtually closed if for every H ∈ F and H ≤ H ′ ≤ G such that ′ [H : H] < ∞, also H ′ ∈ F . Our considerations are general enough to hold for any family F as in Definition 1.1. However, in the context of the Farrell–Jones conjecture it is the (virtually closed) family of virtually cyclic subgroups, denoted VCyc, that appears most naturally [4–7]. Definition 1.2. Let Y be a G-set and F be a family of subgroups of G. A subset U ⊆ Y is called an F -subset if: (a) elements gU of the orbit of U are either equal or disjoint, (b) the stabiliser of U , GU = {g ∈ G | gU = U }, is a member of F . A cover that consists of F -subsets and is G-equivariant will be called an F cover. The name “equivariant asymptotic dimension” comes from the fact that the coverings in its definition are F -covers. For a family of subsets U of set Y , by dim U (the dimension of U) we will denote the value supy∈Y |{U ∈ U | y ∈ U }| − 1, where |A| is the cardinality of A. Definition 1.3. Let Y be any set and U be a covering of G × Y . We say that α < ∞ is a G-Lebesgue number of U, given that for each (g, y) ∈ G × Y there exists U ∈ U such that B(g, α) × {y} ⊆ U . The following definition originates in [6, Theorem 1.1], see also [7, Assumption 1.4] and [2, Definition 0.1]. Definition 1.4. The equivariant asymptotic dimension of G × X with respect to family F , denoted by F-eq-asdim G × X, is the smallest integer n such that for every α < ∞ there exists an open F -cover U of G×X (with the diagonal G-action) satisfying: 1. dim(U) ≤ n, 3 2. α is a G-Lebesgue number of U. If no such integer exists, we say that the dimension is infinite. When the family F is irrelevant or clear from the context, we will skip it from notation. The coverings U = U(α) from the above definition will be called eq-asdim-coverings and α-eq-asdim-coverings, in case the constant α is important. Remark 1.5. In [6, Theorem 1.1], eq-asdim-coverings were also required to be Gcofinite, but by compactness one can choose cofinite subcoverings from arbitrary coverings, so this requirement can be skipped. One generalisation of equivariant asymptotic dimension (still sufficient for the Farrell–Jones conjecture) is transfer reducibility. It occurs in many flavours in the literature, but the main difference between it and equivariant asymptotic dimension is that in transfer reducibility one can choose a space X depending on a parameter (for eq-asdim this parameter is α) and instead of a genuine group action a “homotopy action” is considered. Very roughly, in homotopy action the action of gh is equal to the composition of actions of g and h only up to homotopy. We study this notion in Section 2, see in particular Definition 2.1 and Remark 2.5. Remark 1.6. Note that if we have a G-equivariant map p : Y → X, then eq-asdimcoverings of G × X can be pulled back to eq-asdim-coverings of G × Y . Hence, the minimal possible value of eq-asdim G×X for X compact and Hausdorff is acquired for X = βG – we will sometimes call it the equivariant asymptotic dimension of G. It is not enough to restrict to X = βG, though, since in applications conditions similar to the following are utilised, cf. [7, Theorem 1.1 and Assumption 1.2]. • X is a metrisable compactification of its G-invariant subset X, • X is a realisation of an abstract simplicial complex, • X is contractible, • (weak Z-set condition) there exists a homotopy H : X ×[0, 1] → X, such that H0 = idX and Ht (X) ⊆ X for every t > 0. However, we do not adopt any of these conditions as a convention. In the above context, considerations may become less complicated if one constructs coverings of G × ∂X rather than the whole G × X (where ∂X = X \ X). The fact that the latter can be reconstructed from the former is the content of Theorem 1.9. A natural setting to have in mind is when the space X admits a geometric action of G (for example, it is a Rips complex of the group) and ∂X is the Gromov boundary of G, cf. [6]. 4 1.2 The role of X Since the applications of equivariant asymptotic dimension concern the group G, it is natural to ask what the role of X is. What happens if we just take X = {∗} or, on the other extreme, drop the compactness assumption. A special case of the latter is the question whether we can drop the requirement that eq-asdim-coverings are open, which corresponds to equipping X with the discrete topology. Another question is whether a decomposition of X into invariant subspaces can be used to simplify the problem of finding eq-asdim-coverings. It turns out that compactness of X is crucial to the notion of eq-asdim. Remark 1.7. If the compactness assumption for X in Definition 1.4 is skipped, then for X = G we have eq-asdim G × X = 0. Proof. A good eq-asdim-covering for G × X is U = {G × {x} | x ∈ X}, which is clearly an open T -cover of dimension 0 with the infinite G-Lebesgue number, where T is the singleton family of the trivial subgroup of G. Clearly, the same construction of eq-asdim-coverings works for any discrete X provided that point stabilisers belong to F . The above proof exemplifies a more general approach indicated in [6]. While eq-asdim-coverings must be α-large in the G-coordinate, making them small in the X-coordinate may be helpful in obtaining the properties desired in Definition 1.2. The following lemma generalises the above remark and covers a wide range of examples (e.g., the spaces considered in [6]). Below, a G-simplicial complex such that all the stabilisers of simplices belong to F is called an F -simplicial complex. Lemma 1.8. Assume that a finitely generated group G acts on a topological space X. There is an F-eq-asdim-covering U∞ (with α = ∞) of the space G × X under any of the following conditions: (a) X is a finite-dimensional F -simplicial complex (the same is true for CWcomplexes); (b) X is regular, the G-action is proper, isotropy groups belong to F , and either of the following conditions holds: (i) the G-action is cocompact; (ii) X is of finite covering dimension and admits a G-invariant metric. In cases (a) and (ii), we have dim U∞ ≤ dim X. Proof. Ad (a). For each open simplex ∆o of X, one can construct (using a barycentric subdivision, compare the proof of implication (3) =⇒ (2) in Theorem 2.4 or [14, Lemma 3.4] for more details) a neighbourhood N (∆o ) such that neighbourhoods of simplices of the same dimension are disjoint and the family of such neighbourhoods is equivariant. Thus, the stabiliser of N (∆o ) is equal to the stabiliser of ∆o and hence belongs to F . Putting U = {G × N (∆o ) | ∆ ∈ X} finishes the proof, because each point x of X belongs to a neighbourhood of at most one simplex of each dimension. 5 Ad (b). For each x ∈ X we will construct its neighbourhood Ux being an F -subset. By properness of the action (and T1 -property), we can find a neighbourhood Ux0 such that the set RSx = {g | gUx0 ∩ Ux0 6= ∅} is finite and such that Ux0 is disjoint with the completion Cx = Gx \ {x} of x in its orbit Gx. Then, using regularity of X, we choose a smaller neighbourhood Ux1 , such that its closure Ux1 is contained in Ux0 – in particular it is disjoint with Cx . But we have the equivalence ∀g:gx6=x gx 6∈ Ux1 ⇐⇒ ∀g:gx6=x x 6∈ gUx1 , S so the set Ux2 = Ux1 \ g:gx6=x gUx1 contains x. It is open, as the sum can be taken over the finite set RSx without affecting the difference. What we achieved  is emptiness of the intersection Ux2 ∩ gUx2 ⊆ Ux1 \ gUx1 ∩ gUx1 = ∅ forTgx 6= x. To handle the case gx = x, we do the last tweak setting Ux = g:gx=x gUx2 . The intersection is finite (as the stabiliser of x is a subset of RSx ), so we have just obtained a neighbourhood of x with the stabiliser equal to the stabiliser of x, and conclude that Ux is an F -subset. We still need to bound the dimension of the covering. Provided that X is finite-dimensional and the action is isometric, we can use Proposition A.8 to find an equivariant refinement UX of the covering {gUx | g ∈ G, x ∈ X} with dimension at most dim X. Otherwise, we can assume that the action is cocompact. Since the quotient q map X → X/G is open, {q(Ux )}x∈X is an open covering of a compact set. Consequently, there is a finite family x0 , . . . , xn such that {q(Uxi )}0≤i≤n covers X/G and thus UX = {gUxi | g ∈ G, 0 ≤ i ≤ n} covers X. Clearly, the dimension of UX is at most n. Finally, the family U∞ = {G× U | U ∈ UX } is an α-eq-asdim-covering of G× X for any α ≤ ∞. We would like to mention that actually G-invariant coverings of X (rather than of G × X) were constructed in the above proof and that it relied mainly on topological properties of X (not on the geometry of G). Assume now that X is a compactification of X and recall that we denote ∂X = X \ X. An eq-asdim-covering U of G × X breaks up into two invariant parts: U o = {U ∈ U | U ∩ G × ∂X = ∅}, U ∂ = {U ∈ U | U ∩ G × ∂X 6= ∅}. Conversely, if we are given two open F -families U o , U ∂ of subsets of G × X, which – after restriction to G × X and G × ∂X respectively – have G-Lebesgue numbers α, then the family U o ∪ U ∂ is an F -cover of G × X with G-Lebesgue number α and dimension at most dim U o + dim U ∂ + 1. Hence, if the assumptions of Lemma 1.8 are satisfied, we can always assume (at the expense of possible increase in the bound on the dimension) that eq-asdimcoverings U of G × X satisfy U o = U∞ and thus the only relevant part of U is U ∂ . In other words, it is enough to deal with a neighbourhood of the boundary to obtain a covering of G × X. 6 Even more is true. An open F -cover of G × ∂X can be extended to a family U ∂ of the same dimension that is open in G × X. Thus, one can indeed restrict their attention to the boundary itself. Theorem 1.9. If X is a metrisable compactification of X and any of the assumptions of Lemma 1.8 hold, then eq-asdim G × X ≤ eq-asdim G × ∂X + dim U∞ + 1, where U∞ is the covering from Lemma 1.8. Proof. For a given α < ∞, we will define an α-eq-asdim-covering U of G × X as the sum of the covering U∞ and a covering U ∂ constructed from an α-eq-asdimcovering V of G × ∂X. For V ⊆ G × ∂X let Vg = V ∩ ({g} × ∂X) and let V1 = {V1 | V ∈ V}. We will describe a dimension-preserving method of enlarging sets Y ∈ V1 to open subsets W (Y ) of {1} × X ≃X. It will satisfy: Y 6= Y ′ =⇒ W (Y ) 6= W (Y ′ );   \ \ W (Y i ) = W  Y i . 1≤i≤n (1) (2) 1≤i≤n Fix a metric d inducing the topology of X. As dim V1 ≤ dim V, every x ∈ ∂X 1 k belongs to a finite number S > 0 be such that T j of elements Yx , . . . , Yx of V1 . Let ε(x) B(x, ε(x)) ∩ ∂X ⊆ j Yx . For any Y ⊆ ∂X we define W (Y ) = x∈Y B(x, ε(x)/2). Condition (1) is clear from the fact that W (Y T) ∩ ∂X = Y . We will show condition (2) by induction. Let us denote Y (n) = 1≤i≤n Y i . The base is trivial, so we assume n > 1:   \ \   W Yi = W Y i ∩ W (Y n ) = W Y (n−1) ∩ W (Y n ) 1≤i≤n 1≤i≤n−1      (n−1) n (n−1) n ∪W Y ∩Y = W Y \Y      n (n−1) n (n−1) ∪W Y ∩Y ∩ W Y \Y        = W Y (n−1) \ Y n ∩ W Y n \ Y (n−1) ∪ W Y (n) We claim that the first summand of the right-hand side is empty. Suppose some z belongs to it. Then, there must be x ∈ Y (n−1) \ Y n and y ∈ Y n \ Y (n−1) such that z ∈ B(x, ε(x)/2) ∩ B(y, ε(y)/2). Thus, d(x, y) < max(ε(x), ε(y)). Hence, T either x ∈ B(y, ε(y)) ∩ ∂X ⊆ j Yyj ⊆ Y n (contradicting x ∈ Y (n−1) \ Y n ), or T y ∈ B(x, ε(x)) ∩ ∂X ⊆ j Yxj ⊆ Y (n−1) (contradicting y ∈ Y n \ Y (n−1) ). S Now, for V ∈ V with a decomposition V = g {g} × Vg let us define U (V ) =  S −1 −1 −1 {g} g S× gW (g Vg ) (note that g Vg = g V 1 ∈ V1 ). We have the equality hV = g {g} × hVh−1 g , so one gets: [ [ U (hV ) = {g} × gW (g −1 hVh−1 g ) = {hk} × hkW (k −1 Vk ) = hU (V ); g∈G k∈G 7 i.e., the obtained family is equivariant. From (1) and the equivariance it follows that the stabiliser of U (V ) is equal to the stabiliser of V , hence it belongs to F . Condition (2) (for n = 2) guarantees that different translates U (V ), gU (V ) = U (gV ) are disjoint and (for arbitrary n) it assures that the dimension of U ∂ = {U (V ) | V ∈ V} is equal to the dimension of V. Putting U = U ∂ ∪ U∞ finishes the proof. Example 1.10. The crucial part of the proof is the definition of sets W (Y ). For X = Cay(F2 , {a, b}) and its Gromov boundary as ∂X, it is enough to define W (Y ) ∩ X as all those points x ∈ X such that the endpoint of any geodesic ray from 1 via x ends in Y (geometrically: we take “cones” over the boundary). Group G can be embedded in G×X in various ways yielding different pullbacks of U. Assume for example that the conclusion of the Švarc–Milnor lemma is true, that is, the orbit map G ∋ g 7→ gx0 ∈ X is a quasi-isometry for some metric on X, and consider the pullback of U in G via the map g 7→ (1, gx0 ). Inverse images of U ∈ U∞ will be uniformly bounded. On the other hand, we expect the inverse image of U ∈ U ∂ to be unbounded, as it contains neighbourhoods of “points at infinity”, cf. condition (3) in the Remarks subsection. Thus, some elements of the covering are small, independently of α, while others are unbounded. It differs from asdim-coverings (see Definition 1.11 below), where elements of the covering grow with α, but uniform boundedness is preserved at each step. Nonetheless, equivariant and classical asymptotic dimension are related and we discuss it in the next subsection. 1.3 Asymptotic dimension and the vanishing theorem A natural question coming to mind is how equivariant asymptotic dimension is related to asymptotic dimension. Let us recall the definition. Definition 1.11. The asymptotic dimension of a metric space G is the smallest integer n such that for all α < ∞ there is an open covering U of G such that: 1. dim(U) ≤ n, 2. for each g ∈ G there exists U ∈ U such that B(g, α) ⊆ U , 3. supU∈U diam(U ) < ∞ (uniform boundedness). We can see that the first two conditions in the definition of asdim are analogues of the conditions for eq-asdim. Such a similarity occurs also for various characterisations of asdim, compare the following Theorem 1.12 (see [9, Theorem 1] or [16, Theorem 9.9]) characterising asdim with Theorem 2.4 and Proposition 2.8 characterising eq-asdim. Theorem 1.12. Let X be a metric space. The following conditions are equivalent. 1. asdim X ≤ n; 2. for every r < ∞ there exist uniformly r-disjoint families (U i ) for S bounded, i 0 ≤ i ≤ n of subsets of X such that i U covers X. 8 3. for every ε > 0 there is a uniformly cobounded, ε-Lipschitz map φ : X → K to a simplicial complex of dimension n. 4. for every d < ∞ there exists a uniformly bounded cover V of X with dmultiplicity at most n + 1; In the above theorem, a family of subsets is r-disjoint if the distance of any two of its members is at least r; a map to a simplicial complex is uniformly cobounded if there is a bound on diameter of inverse images of stars; a simplicial complex K is viewed as a subset of ℓ1 (V (K)), where V (K) is the set of vertices of K; and d-multiplicity of a covering means the maximal number of its elements intersecting a d-ball. We would like to mention that if we relax condition (3) so that φ is a map into the sphere in ℓ1 instead of an n-dimensional complex, then it becomes (in the case of bounded geometry metric spaces) equivalent to property A ([22, Theorem 1.2.4 (6)], see also [11]). The equivalence is established by replacing ε-Lipschitz maps L x 7→ φ(x) into the unit sphere of ℓ1 (V (K)) by maps x 7→ Ax into ( v N) \ {0}, where v ∈ V (K), such that for d(x, y) ≤ R we have kAx − Ay k/k min(Ax , Ay )k < ε (and vice versa). A similar transition would give one more characterisation also in the equivariant case. Guentner, Willet, and Yu [12] show that F in-eq-asdim G × βG = asdim G, where F in is the family of finite subgroups. Clearly, the equivariant asymptotic dimension decreases when F increases, so F-eq-asdim G × βG ≤ asdim G for any F ⊇ F in. On the other hand, Willett and Yu observed that the appropriate version of the argument from [10, Proposition 5.2.1] gives the inequality 1 + asdim G ≤ (1 + F -eq-asdim G × X) · (1 + sup asdim F ); F ∈F in particular, finite VCyc-eq-asdim implies finite asymptotic dimension of G. The proof uses the language of amenable actions (we recall the definition in the discussion after Theorem 2.4). The definition of equivariant asymptotic dimension involves a family of groups F , for example VCyc, which causes the two notions – classical and equivariant asymptotic dimension – to disagree even in the simplest cases. In particular, the second factor on the right-hand side of the above inequality is necessary, because it is not true that asdim G ≤ F-eq-asdim G: Example 1.13. For G = Z and, say, X = [−∞, +∞] with the action by translations, the one-element covering {G × X} is an α-eq-asdim-covering for any α < ∞ and F = VCyc. Hence, VCyc-eq-asdim Z = 0, while asdim Z = 1. Apparently, eq-asdim is a more subtle (or at least less understood) notion than asdim – for several years the only class of groups that were known to be of finite equivariant asymptotic dimension with a reasonable X was the family of hyperbolic groups [6], and the fact that they also have finite asymptotic dimension is classical and has a short proof [17]. (Now, we have similar results for relatively hyperbolic groups [2] and mapping class groups [3].) On the other hand, we have 9 no examples of finite-asdim groups which are known to have infinite equivariant asymptotic dimension if we put some restrictions on X. The difficulty with proving finiteness of eq-asdim arises (see the Remarks subsection) already in the case of the simplest non-hyperbolic group, namely Z2 , which can be immediately proven to be of asymptotic dimension 2. It turns out that Example 1.13 can be generalised to give a complete characterisation of groups with vanishing equivariant asymptotic dimension. Theorem 1.14. Equivariant asymptotic dimension of G vanishes if and only if F contains a finite-index subgroup of G. Proof. For the “if” part, let H ∈ F be a finite-index subgroup of G. Let X be the quotient G/H and U = {G × {x} | x ∈ X}. It is a G-invariant, disjoint and open covering with respect to the discrete topology on X, and stabilisers of elements of U are conjugates of H, hence they belong to F . For the converse, assume that there is an F -cover U of G × X of dimension 0 (that is, disjoint) and of G-Lebesgue number α ≥ 1. Take U ∈ U and (g, x) ∈ U . Then there exists U ′ ∈ U such that B(g, α) × {x} ⊆ U ′ – but then U ∩ U ′ 6= ∅, so U = U ′ . Thus, we showed that (g, x) ∈ U implies B(g, α) × {x} ⊆ U – hence G × {x} ⊆ U and we conclude that S U = G × UX for an open set UX ⊆ X. Consider now the sum W = GUX of the orbit GUX . We claim that W is ′ ′ closed. Indeed, for y ∈ X \ W , there is U ′ = G × UX ∈ U such that y ∈ UX , and ′ disjointness of U implies UX ∩ W = ∅. So W is a compact subset of X covered by the disjoint family GUX , meaning that the family must be finite. Thus, the orbit of UX is finite and the same is true for the orbit of U . Summing up, the stabiliser of U belongs to F and is of finite index in G. Corollary 1.15. VCyc-eq-asdim G = 0 if and only if G is virtually cyclic. Example 1.16. In particular, eq-asdim is not a function of the asymptotic dimension of a group and/or the topological dimension of its boundary, as asdim Z = asdim Fn = 1 and dim ∂Z = dim ∂Fn = 0, but for n > 1: VCyc-eq-asdim Z = 0 < VCyc-eq-asdim Fn . Moreover, equivariant asymptotic dimension does not satisfy a logarithmic inequality holding for other notions of dimension (dim G × H ≤ dim G + dim H), as eq-asdim Zn > 0 = eq-asdim Z. In fact, it seems to be an open problem whether the product of groups of finite eq-asdim has finite eq-asdim. Remarks Let us now consider the following situation. Assume that G acts geometrically on j (X, d) for a suitable proper and geodesic metric d. Then, any orbit map G ∋ g 7→ gx0 ∈ X is a quasi-isometry. Assume further that if a sequence (xn ) of points 10 of X converges to x ∈ ∂X and (yn ) ∈ X is asymptotic to (xn ), then (yn ) also converges to x: sup d(xn , yn ) < ∞ =⇒ lim yn = x (3) n n (which holds in particular for the Gromov boundary of a hyperbolic space). Then, any finitely generated abelian subgroup H ≤ G has to belong to family F . Indeed, let {z1 , . . . zk } be a generating set of H, and let a sequence (hn ) ∈ H and a point x0 ∈ X be such that xn = hn x0 converges to some x ∈ ∂X. Then for any i ∈ {1, . . . , k} and a sequence yn = hn zi x0 we have supn d(xn , yn ) < ∞ (as dG (hn , hn zi ) = dG (1, zi ) and j is a quasi-isometry), and thus zi x = lim zi hn x0 = lim hn zi x0 = x; i.e., H stabilises x. But finitely generated subgroups of isotropy groups of X belong to F : let α be large enough for B(1, α) to contain  {z1 , . . . zk } and let U ∈ U(α) contain B(1, α) × {x}. Then zi B(1, α) × {x} = B(zi , α) × {x} intersects nontrivially with B(1, α) × {x} and thus zi U ∩ U 6= ∅, so zi must stabilise U and thus H is a subgroup of the stabiliser of U , which belongs to F by the definition of F-eq-asdimcoverings. This reasoning also shows that space X in the definition of eq-asdim is necessary; i.e., there are no α-eq-asdim-coverings of G = G × {∗} (unless α < 1 or G ∈ F ). The above suggests that commutativity (or existence of large abelian subgroups) may be an obstacle for (proving) finiteness of eq-asdim. Such a proof (if we assume X ≃ G) would require a compactification violating very natural condition (3). The condition holds for compactifications of CAT(0) groups used in [4], and thus Bartels and Lück used suitable subspaces of the compactification and showed transfer reducibility (not finiteness of eq-asdim). However, if we already have a free action with G nilpotent and X metrisable, we can use the following estimate from [19] (the paper uses the name amenability dimension): 1 + T -eq-asdim G × X ≤ 3ℓ(G) · (1 + dim X), where T is the singleton family of the trivial subgroup of G, ℓ(G) is the Hirsch length and dim X is the Lebesgue covering dimension of X. 2 Characterisations of equivariant asymptotic dimension The aim of this section is to provide a number of equivalent characterisations of equivariant asymptotic dimension. We will state our theorem in a generality broader than in the previous section to handle the notion of transfer reducible groups that are defined in terms of homotopy group actions. 2.1 Homotopy actions Consider the map ρ(g, x) = (g, g −1 x). It is a G-equivariant homeomorphism from G × X with the diagonal action onto G × X with the action on the first coordinate by left multiplication (we will call this the action by translations). The condition 11 B(g, α) × {x} ⊆ U , is equivalent to DB α (ρ(g, x)) ..= ρ(B(g, α) × {x}) ⊆ ρ(U ), where DB stands for “diagonal (closed) ball” and can be described as follows: DB α (g, x) = {(gh, h−1 x) | |h| ≤ α}. Hence, we could define equivariant asymptotic dimension using diagonal balls and the action by translations on G × X. Note that in this reformulation the action on X is used only to define DBs. Thus, if we are able to generalise the definition of DB, we could ease the requirement that G acts on X. Definition 2.1 ([4, Definition 0.1]). Let X be a compact metric space, and S a finite and symmetric subset of a group G containing the neutral element 1. (i) A homotopy S-action (ϕ, H) on X consists of continuous maps ϕg : X → X t for g ∈ S and homotopies Hg,h : X → X for g, h ∈ S with gh ∈ S and 0 1 t ∈ [0, 1] such that Hg,h = ϕg ◦ ϕh and Hg,h = ϕgh . Moreover, we require t H1,1 = ϕ1 = idX for all t ∈ [0, 1]; (ii) Let (ϕ, H) be a homotopy S-action on X. For g ∈ S let Fg = Fg (ϕ, H) be t the set of all maps Hr,s , where rs = g. 1 (g, x) be the subset of G × X consisting of For (g, x) ∈ G × X, let DBϕ,H all (gs, y) ∈ G × X such that y = fs−1 (x) or x = fs (y), where s ∈ S, 1 (A) = fs−1 ∈ Fs−1 and fs ∈ Fs . For A ⊆ G × X and n ∈ N we put DBϕ,H  S n+1 1 1 n DB (g, x) and inductively DB (A) = DB DB (A) ϕ,H ϕ,H ϕ,H ϕ,H (g,x)∈A (iii) Let (ϕ, H) be a homotopy S-action on X, U be an open cover of G × X, and n ∈ N. We say that U is n-long with respect to (ϕ, H) if for every n (g, x). (g, x) ∈ G × X there is U ∈ U containing DBϕ,H Note that – due to the fact that 1 ∈ S and idX ∈ F1 (ϕ, H) – we have A ⊆ 1 n DBϕ,H (A), so n 7→ DBϕ,H (A) is “increasing”. n Lemma 2.2. Let A be a compact subset of G × X. Then DBϕ,H (A) is also n compact. Moreover, for every ε > 0 there exists δ > 0 such that DBϕ,H (B(A, δ)) ⊆  n B DBϕ,H (A), ε , where the neighbourhoods are taken with respect to the product metric on G × X. n 1 Proof. Since DBϕ,H is the n-th power of DBϕ,H (viewed as a function from the 1 power set of G × X to itself), it is enough to restrict to the case of DB ..= DBϕ,H . Moreover, we can restrict to the case when A = {h} × Y , for some closed Y ⊆ X. Observe that DB({h} × Y ) is the union of two sets I and II: [ [ [ t {hg} × Hr,s (Y ), I= g∈S r,s∈S t∈[0,1] rs=g−1 II = [ [ [ −1 t {hg} × (Hr,s ) g∈S r,s∈S t∈[0,1] rs=g 12 (Y ). S t t (Y ) Let us denote the map (x, t) 7→ Hr,s (x) by Hr,s . Instead of t∈[0,1] Hr,s  S −1 t −1 one can write Hr,s (Y ×[0, 1]) and similarly t∈[0,1] (Hr,s ) (Y ) = πX Hr,s (Y ) , where πX : X × [0, 1] → X is the projection. Consequently: I= [ [ {hg} × Hr,s (Y × [0, 1]), [ [  {hg} × πX Hr,s −1 (Y ) . g∈S r,s∈S rs=g−1 II = g∈S r,s∈S rs=g The above sums are finite, so the obtained set is compact, because images and inverse images of compact sets are compact as long as all the spaces considered are compact. Maps Hr,s are uniformly continuous, so the “moreover” part is clear for I, and in order to obtain it for II it suffices to prove the following (because πX is also uniformly continuous). Claim. Let H : Z → Z ′ be a continuous map between compact metric spaces. For every compact subset A ⊆Z ′ and every ε > 0 there exists δ > 0 such that H −1 (B(A, δ)) ⊆ B H −1 (A), ε . Suppose the contrary, that for some ε > 0 there is a sequence of zn′ approaching A such that there are zn ∈ H −1 (zn′ ) at least ε-distant from H −1 (A). By passing to a subsequence, we can assume that zn converge to some z0 ∈ / B(H −1 (A), ε). However, by continuity, H(z0 ) ∈ A, which yields a contradiction. 2.2 The characterisations Definition 2.3. Let Y be a G-set. Its subset is called an almost F -subset if its stabiliser belongs to F . An almost F -cover is a covering consisting of almost F -subsets and closed under the induced action of G. That is, what distinguishes an almost F -subset U from an F -subset is that it may happen that U 6= gU , but still U ∩ gU 6= ∅. Conditions (1), (2), and (3) below correspond to conditions (1), (2), and (3) in Theorem 1.12. Condition (0), a version of (1), is introduced to relate to the “almost” versions of transfer reducibility present in the literature, [8]. Similar to condition (3), condition (4) comes from [1, Theorem A] and resembles the definition of an amenable action. Maps from condition (3) yield functors crucial for the proofs of the Farrell– Jones and Borel conjectures, compare [7, Section 4], [20, Proposition 3.6 and Section 5] and [5, Proposition 3.9 and Section 11]. Theorem 2.4. Let n ∈ N and S be a finite symmetric subset of G containing the identity element 1. Below, we require each X to be a compact metrisable space and (ϕ, H) to be a homotopy S-action of G on X. The action on G × X considered below is given by h(g, x) = (hg, x). 13 The following conditions (1– 4) are equivalent and they imply condition (0). They are all equivalent if F is virtually closed (e.g., F = VCyc): 0. for every m ∈ N there is (X, ϕ, H) and an m-long almost F -cover of G × X of dimension at most n; 1. for every m ∈ N there is (X, ϕ, H) and an m-long F -cover of G × X of dimension at most n; 2. for every r ∈ N there is (X, ϕ, H) and F -families (U i ) for 0 ≤ i ≤ n S disjoint i of open subsets of G × X such that i U is an r-long covering of G × X; 3. for every ε > 0 there is (X, ϕ, H), an F -simplicial complex K of dimension n, and a G-equivariant continuous map φ : G × X → K, which is “diagonally (G, ε)-Lipschitz”: kφ(g, x) − φ(gs−1 , fs (x))k ≤ ε ∀s∈S ∀fs ∈Fs ∀(g,x)∈G×X ; 4. for every ε > 0 there is (X, ϕ, H), an F -simplicial complex K of dimension n, and a continuous map ψ : X → K, which is ε-equivariant: kψ(fs (x)) − sψ(x)k ≤ ε ∀s∈S ∀fs ∈Fs ∀x∈X . Remark 2.5. If a group G satisfies the equivalent conditions (1– 4) from the theorem for all finite symmetric subsets S ⊆ G with some additional technical requirements on X, then G is said to be transfer reducible over F , [4]. The above theorem is stated in terms of existence of homotopy actions, however we do not construct spaces X and homotopy actions in the proof. Hence, all the equivalences stay true for a fixed G-action on a fixed X as in the definition of equivariant asymptotic dimension for G × X (Definition 1.4). It was pointed out by M. Bridson that condition (4) of Theorem 2.4 is very similar to the concept of amenable action [1, Remark 3.6]. As explained in [2], this is – on one hand – more than an amenable action, where the target space is the whole unit sphere of ℓ1 (G), not just an n-dimensional complex in it. On the other hand, for eq-asdim, space ℓ1 (Y ) can be build on any G-set Y as long as its isotropy groups belong to F and for amenable actions we have Y = G. In [2], an action of G on X such that F -eq-asdim G × X ≤ N is called N -F -amenable. Proof of Theorem 2.4. Implications (1) =⇒ (0) and (2) =⇒ (1) are immediate. (3) ⇐⇒ (4) was suggested in [1, Remark 3.7] and holds even for a fixed ε. For the “if” part we put φ(g, x) = gψ(x). Map φ is clearly G-equivariant and also satisfies the required condition: kφ(g, x) − φ(gs−1 , fs (x))k = kgψ(x) − gs−1 ψ(fs (x))k = ksψ(x) − ψ(fs (x))k ≤ ε. For the “only if” part we put ψ(x) = φ(1, x) and check: ksψ(x) − ψ(fs (x))k = ksφ(1, x) − φ(1, fs (x))k = kφ(s, x) − φ(ss−1 , fs (x))k ≤ ε. 14 (3) =⇒ (2). We will replace K from (3) by its barycentric subdivision SK. The identity map K → SK is Lipschitz with the constant depending only on n. Each vertex of SK corresponds to a subset (simplex) of vertices of K, vertices of the same cardinality are not adjacent, and the cardinality of a vertex is clearly preserved under the group action. Moreover, the stabiliser of a vertex in SK is the stabiliser of a simplex in K, so it belongs to F (in fact also simplex stabilisers belong to F ). 1 To obtain (2), we put ε = (n+1)(r+1) and let φ : G × X → SK be diagonally i −1 (G, ε)-Lipschitz. We define U = {φ (Sy ) | y ∈ V (SK), |y| = i + 1}, where i ∈ {0, . . . , n} and Sy is the open star about y; that is, Sy = {p ∈ SK | p(y) > 0} (recall that we view SK as a subset of ℓ1 (V (SK))). The fact that two vertices are non-adjacent is equivalent to disjointness of the respective stars; hence, different elements of U i are disjoint. By G-equivariance of φ we get gφ−1 (Sy ) = φ−1 (Sgy ), so U i is G-invariant and the stabiliser of φ−1 (Sy ) is the stabiliser of y and thus belongs to F . Let now (g, x) ∈ G×X and v0 be an element v ∈ V (SK) maximising φ(g, x)(v). 1 . Thus, since φ is diagonally (G, ε)-Lipschitz and We have φ(g, x)(v0 ) ≥ n+1 1 1 r (g, x) we have φ(g ′ , x′ )(v0 ) ≥ n+1 − ε = (n+1)(r+1) , for any (g ′ , x′ ) ∈ DBϕ,H r r i −1 (Sv0 ) ∈ U for i = |v0 | − 1. (n+1)(r+1) > 0. Therefore, DBϕ,H (g, x) ⊆ φ (1) =⇒ (3). This proof is based on techniques from [5, Section 3]. Let m be an integer greater than 3(n+1) and U be an m-long F -cover of ε m (g, x) ⊆ U } G × X. From Lemma 2.2 it follows that I(U ) = {(g, x) | DBϕ,H is open provided that U is. The family I = {I(U ) | U ∈ U} is G-invariant (as m m hDBϕ,H (g, x) = DBϕ,H (hg, x)), which means that it looks the same when restricted to {g} × X for any g. There is a finite cover of {1} × X by compact subsets (Wi )ki=1 such that each Wi is contained in some I(Ui ) with Ui ∈ U. Thus, m DBϕ,H (Wi ) is contained in Ui . By compactness (see Lemma 2.2) there exists εi  m such that B DBϕ,H (Wi ), εi ⊆ Ui . 0,δ For δ > 0 let us define DBϕ,H (A) = B(A, δ) and inductively:     k,δ k+1,δ 1 DBϕ,H (A) , δ . DBϕ,H (A) = B DBϕ,H From Lemma 2.2 and induction, it  follows that for each i there is δi such that m,δi m (Wi ) ⊆ B DBϕ,H DBϕ,H (Wi ), εi ⊆ Ui . Let δ = mini δi and Λ = m δ . We will define a G-invariant metric d on G × X such that m will be a Lebesgue number of U. Let ( Λ · dX (x, x′ ), if g = g ′ , d0 ((g, x), (g ′ , x′ )) = max(m, Λ · diam X), otherwise. For y, z ∈ G×X let d(y, z) be equal to the infimum of finite sums 15 Pk i=1 ∆i ((gj , xj )j ) over finite sequences (gj , xj )kj=0 such that (g0 , x0 ) = y, (gk , xk ) = z, where   if (gi , xi ) = (gi−1 s−1 , fs (xi−1 )) 1, ∆i ((gj , xj )j ) = 1, if (gi−1 , xi−1 ) = (gi s−1 , fs (xi ))   d0 ((gi−1 , xi−1 ), (gi , xi )), where s ∈ S and fs ∈ Fs (note that the three cases are not mutually exclusive so we always choose the smallest value). It is easy to notice that d is symmetric and satisfies the triangle inequality. Moreover, d0 (y, z) < 1 ⇐⇒ d(y, z) < 1 and then they are equal, hence they induce the same topology (the product topology). k P If d(y, z) < m, there exists a sequence (gi , xi )i=0 joining y and z such that ∆i < m. In particular, each time ∆i is equal to the distance d0 between (gi−1 , xi−1 ) and (gi , xi ), this distance is smaller than m, meaning that dX (xi−1 , xi ) = Λ−1 · d0 ((gi−1 , xi−1 ), (gi , xi )) < Λ−1 · m = δ. m,δ The other case happens at most m times. Thus, z belongs to DBϕ,H (y). Since each y ∈ G × X belongs to some Wi (or a translation of it) and for Wi we have m,δ DBϕ,H (Wi ) ⊆ Ui , we conclude that m is a Lebesgue number of U with respect to d. Define lU (y) = min (m, sup{r | Bd (y, r) ⊆ U }). It is clearly 1-Lipschitz, in particular continuous. Moreover, d((g, x), (gs−1 , fs (x))) ≤ 1 for fs ∈ Fs , so we have |lU (g, x) − lU (gs−1 , fs (x))| ≤ 1. Furthermore, by G-invariance of d, we have lU (y) = lgU (gy) for any g ∈ G. P Φ(g,x) We define Φ(g, x) = U∋x lU (g, x) · 1U ∈ ℓ1 (U) and φ(g, x) = kΦ(g,x)k . −1 From the fact that lU (0, ∞) ⊆ U and that the dimension of U is at most n + 1 we conclude that map φ acquires its values in an n-dimensional complex −1 K ⊆ ℓ1 (U). Moreover, since hU 6= U implies hU ∩ U = ∅, we get that lU (0, ∞) ∩ −1 lhU (0, ∞) = ∅, so we can assume that U and hU in K are not adjacent. Hence, the stabiliser of a simplex stabilises it pointwise, so it is the intersection of stabilisers of its vertices (corresponding to elements of U) and belongs to F . We have to check if φ is diagonally (G, ε)-Lipschitz. Let (g, x) ∈ G × X, s ∈ S, and fs ∈ Fs . Without loss of generality: m ≤ kΦ(g, x)k ≤ kΦ(gs−1 , fs (x))k ≤ kΦ(g, x)k + n + 1 (in the last inequality we use the fact that Φ(gs−1 , fs (x)) has at most n + 1 points in its support) thus we can write: Φ(g, x) Φ(gs−1 , fs (x)) − kΦ(g, x)k kΦ(gs−1 , fs (x))k Φ(g, x) − Φ(gs−1 , fs (x)) ≤ kΦ(g, x)k   1 1 − + Φ(gs−1 , fs (x)) kΦ(g, x)k kΦ(gs−1 , fs (x))k   2(n + 1) 2(n + 1) n + 1 kΦ(gs−1 , fs (x))k ≤ + −1 ≤ + < ε. m kΦ(g, x)k m m φ(g, x) − φ(gs−1 , fs (x)) = 16 (0) =⇒ (3) can be proved in the same way as (1) =⇒ (3), but we cannot guarantee that simplex stabiliser is a pointwise stabiliser. Simplex stabiliser permutes vertices of the simplex and the kernel of this action is the pointwise stabiliser. This kernel is a finite index subgroup of the stabiliser, hence – if F is virtually closed – the stabiliser belongs to F . Corollary 2.6. For a virtually closed F , the notions [8] of groups transfer reducible over F and almost transfer reducible over F are equivalent. The above theorem is formulated for a particular definition of a homotopy action, but should hold for all similar definitions such as [20, Definition 2.1]. Remark 2.7. To show (3) =⇒ (1) directly we do not need the continuity of φ. It is enough to assume only that inverse images of stars are open and vertices in the same orbit are not adjacent, and put U = {φ−1 (Sy ) | y ∈ V (K)}. Conversely, to obtain such a version of (3) from (1) it suffices to define lU (g, x)  r as max r ∈ {1, . . . , m} | DBϕ,H (g, x) ⊆ U . Note that the implication (1) =⇒ (3) (and similar (0) =⇒ (3)) was the only step where we used the metrisability of X. In Subsection 2.3, we show how to avoid this requirement if we deal with genuine group actions. The analogue of condition (4) from Theorem 1.12 is also provided. 2.3 Theorem 2.4 without metrisability In this subsection we restrict our attention to non-homotopy actions but allow non-metrisable spaces X. We already noticed (Remark 2.7) that the only part of the proof of Theorem 2.4 utilising metrisability was the implication (1) =⇒ (3), more precisely, the definition of lU . In Subsection 2.3.1, we propose a definition of function lU in the compact Hausdorff case, which enables proving (1) =⇒ (3) in the non-metric setting. Subsection 2.3.2 provides more conditions characterising equivariant asymptotic dimension. Again, metrisability is not needed for the equivalences to hold. For the sake of the subsequent reasoning, we will overload our notation: for U ⊆ G × X and α > 0 by B(U, α) we will denote the set [ B(U, α) = B(g, α) × {x} = {(h, x) | B(h, α) × {x} ∩ U 6= ∅}, (g,x)∈U and similarly (for −A meaning the complement of A): B(U, −α) = {(h, x) | B(h, α) × {x} ⊆ U } = −B(−U, α). Observe that not only U 7→ B(U, α) but also U 7→ B(U, −α) preserves open sets. Indeed, (h, x) ∈ B(U, −α) implies B(h, α) × {x} ⊆ U . As U is open and B(h, α) is finite, B(h, α) × W ⊆ U for some neighbourhood W of x – and thus {h} × W ⊆ B(U, −α). 17 2.3.1 Function lU for a compact Hausdorff G-space X 2 Let k > 3(n+1) and U be a k-eq-asdim-covering of G×X. Let ϕ0U : X → [0, 1] be a ε partition of unity subordinate to the restriction of the family I = {I(U ) | U ∈ U} to {1} × X, where I(U ) = B(U, −k). We put ϕU = k · ϕ0U . Let now:  0 lU (g, x) = max ϕh−1 U (h−1 x) − dG (g, h) . h∈G (Note that since ϕU (·) ∈ [0, k], the maximum is in fact taken over a finite set 0 dG (g, h) ≤ k.) The positivity of lU for some (g, x) means the existence of h such −1 that dG (g, h) < ϕh−1 U (h x), in particular ϕh−1 U (h−1 x) > 0 and dG (g, h) ≤ k. Thus, point (1, h−1 x) belongs to set I(h−1 U ), which is equivalent to (h, x) ∈ I(U ), which, in turn, implies (g, x) ∈ U by the definition of I(U ). We conclude that 0 −1 (lU ) (0, ∞) ⊆ U . 0 Clearly, lU also takes values in [0, k] and for each (g, x) there is U such that k 0 lU (g, x) ≥ n+1 (it suffices to put h = g and then select U ). Additionally, it is G-invariant:  0 lU (g, x) = max ϕh−1 U (h−1 x) − dG (g, h) = h∈G  max ϕ(jh)−1 jU ((jh)−1 jx) − dG (jg, jh) = ljU (jg, jx), h∈G where j ∈ G. Furthermore, it is 1-Lipschitz with respect to the G-coordinate. Indeed, let s be a generator of G:  0 lU (g, x) = max ϕh−1 U (h−1 x) − dG (g, h) ≤ h∈G  0 max ϕh−1 U (h−1 x) − dG (gs, h) + 1 = lU (gs, x) + 1. h∈G 0 Hence, lU (g, x) = lU (g, gx) is diagonally (G, 1)-Lipschitz. 0 This time, the construction of lU is based on a partition of unity (locally finite), so the continuity of φ (defined as in the proof of Theorem 2.4) is automatic, whereas in Theorem 2.4 it followed from the Lipschitz property of Φ. The proof of diagonal (G, ε)-Lipschitz property of φ is analogous. 2.3.2 d-disjointness and r-multiplicity In Theorem 1.12, there is condition (4) characterising asymptotic dimension by the existence, for arbitrary d < ∞, of a uniformly bounded cover with d-multiplicity at most n + 1. This condition has no counterpart in Theorem 2.4 characterising transfer reducibility. Moreover condition (2) in 1.12 is formulated in terms of rdisjoint families, while in 2.4 (2) we have disjoint families forming a covering with a G-Lebesgue number equal to r. This lack of analogy is due to the fact that it is not clear how to preserve openness while enlarging sets in order to force large G-Lebesgue numbers in the case of homotopy actions. We fix it in the following proposition. Condition (2) of 1.12 has its analogue in condition (2) below and condition (4) of 1.12 is reflected by (3). 18 We say that a covering of G × X has (G, d)-multiplicity n if each set of the form B(g, d) × {x} intersects at most n elements of the covering. A family of subsets of G × X is (G, r)-disjoint if for any two of its elements U 6= U ′ we have B(U, r) ∩ U ′ = ∅. Note that in this subsection we return to the conventions of Section 1, where the action is diagonal, but the notions of G-multiplicity, G-disjointness etc. involve only the first coordinate (formally, the map ρ(g, x) = (g, g −1 x) intertwines the two conventions). Proposition 2.8. Let X be a compact Hausdorff space. Conditions (1) and (2) are equivalent and imply condition (3). They are all equivalent if F is virtually closed. 1. F-eq-asdim G × X ≤ n; i 2. for each S ri < ∞ there exist (r, G)-disjoint F -families (I ) for 0 ≤ i ≤ n such that i I is an open cover of G × X; 3. for each d < ∞ there exists an open F -cover I of G × X with (G, d)multiplicity at most n + 1. Proof. For (1) =⇒ (3), we put I = {B(U, −d) | U ∈ U} (we remove the empty set if it appears) for a d-eq-asdim family U. Elements of I are subsets of elements of U, so the stabilisers may only be smaller (since the definition is equivariant, they are equal). Let us check the G-multiplicity. Consider any G-d-ball: B(g, d) × {x}. If it intersects B(U, −d) at point (h, x), then, by symmetry of the metric, set B(h, d) × {x} contains point (g, x). But we have the inclusion B(h, d) × {x} ⊆ U following from the definition of B(U, −d), meaning that also set U contains point (g, x). Therefore, the number of sets B(U, −d) intersecting B(g, d) × {x} does not exceed the number of sets U containing point (g, x), which is bounded by n + 1. For (3) =⇒ (1) we take I for d = α and U = {B(V, α) | V ∈ I}. It is clearly G-invariant, open and have a G-Lebesgue number equal to α. Set B(V, α) contains point (h, x) if and only if B(h, α) × {x} intersects V . Thus, the multiplicity of U is bounded by the (G, α)-multiplicity of I, so we obtain dim U ≤ n. We have the equality gB(V, α) = B(gV, α), so for all elements g ∈ G such that gB(V, α) = B(V, α) and for all (h, x) ∈ B(V, α) the set B(h, α) × {x} intersects all translates gV . Hence, the number of such gV is at most n + 1 and thus the stabiliser of B(V, α) maps into the symmetric group S(n + 1) and the kernel is the intersection of stabilisers of sets gV . Consequently, the stabiliser of B(V, α) has a finite index subgroup from F . Hence, if F is virtually closed, covering U satisfies all the conditions for an α-F -eq-asdim covering apart from the fact we do not know whether distinct sets from one orbit are disjoint; it is an almost F -covering. Theorem 2.4 (see condition (0)) in its non-metrisable version shows that for virtually closed F it suffices. For (1) =⇒ (2) it is enough to take families U i from condition (2) of Theorem 2.4 and set I i = {B(U, −d) | U ∈ U i } as the desired family (we remove empty sets 19 if they appear). Conversely, if families (I i ) are (G, 2r + 1)-disjoint, then families U i defined by U i = {B(I, r) | I ∈ I i } satisfy condition (2) of 2.4. Appendix A Equivariant topological dimension Recall that the Lebesgue covering dimension of a topological space X is the smallest integer n such that any open covering has a refinement of dimension at most n. The number n is sometimes called the topological dimension and is denoted by dim X. If X is an F -space for some group F , a natural question to ask is whether any F -covering has an F -refinement of dimension n. By an F -covering we mean an F -cover, where F is the family of all subgroups of F . In other words: the covering is F -invariant and two distinct elements of an orbit are disjoint. The question was answered in positive in [14] for a finite group F acting on a metric space by isometries. This made the bound in Propositions 3.2, 3.3 of [6] independent of the order of the group F . In [6, 8] a bound on the orders of finite subgroups F of a group was needed. Due to the above improvement, a proof of the Farrell–Jones conjecture became possible in a situation where no such bound exists [18]. We will prove that the assumption that the group F acting on the space is finite, is superfluous. It is enough to assume properness of the action. Moreover, our argument remains true for F -covers with arbitrary F . A.1 Dimension theory – auxiliaries Recall some definitions and facts from dimension theory after [15]. Theorem A.1 ([15, 9.2.16]). Let f : X → Y be a continuous open surjection of metrisable spaces. If every fibre f −1 (y) is finite, then dim X = dim Y . Definition A.2 ([15, 5.1.1]). The local dimension, loc dim X, of a topological space X is defined as follows. If X is empty, then loc dim X = −1. Otherwise, loc dim X is the smallest integer n such that for every point x ∈ X there is an open set U ∋ x such that dim U ≤ n. If there is no such n, then loc dim X = ∞. Theorem A.3 ([15, 5.3.4]). If X is a metric space, then loc dim X = dim X. Corollary A.4. If V is an open subset of a metric space X, then dim V ≤ dim X. Proof. By the above theorem, it is enough to prove loc dim V ≤ dim X. Consider x ∈ V . There is an open neighbourhood Vx ∋ x such that V x ⊆ V . Hence, since the dimension of a closed subset never exceeds the dimension of the space, we obtain: loc dim V = sup inf dim U ≤ sup dim V x ≤ dim X x∈V V ⊇U∋x x∈V (where U is open and the closure of U is taken in V ). 20 Corollary A.5. In the case of metric spaces, there is no need for taking closures of neighbourhoods in the definition of local dimension (it is enough to consider open neighbourhoods and calculate their dimension). Proof. Fix x ∈ X. It suffices to check the equality inf U∋x dim U = inf U∋x dim U , where U are open neighbourhoods of x. Let Ux be an open neighbourhood of x such that U x has the smallest possible dimension. Then dimension of Ux – by Corollary A.4 – is no larger. On the other hand, if there is an open neighbourhood V of x such that dim V < dim U x , then there would be an open neighbourhood W such that W ⊆ V and thus dim W ≤ dim V < dim U x , contradicting the minimality of dim U x . Proposition A.6. The dimension of a metric space X is equal to the supremum of dimensions of its open subsets. It is enough to consider the supremum over any open cover of X. Proof. Let U by any open covering of X. By Corollary A.4, the dimension of X is no smaller than dimensions of its open subsets, thus dim X ≥ supU∈U dim U . On the other hand, it equals the local dimension, which is equal – by Corollary A.5 – to the supremum over points of infima over open neighbourhoods of their dimensions. But clearly, we have the inequalities: dim X = sup inf dim U ≤ sup inf dim U ≤ x U∋x A.2 x U ∋U∋x sup dim U = sup dim U. x, U ∋U∋x U∈U Equivariant refinements The following proposition strengthens [14, Corollary 2.5]. Proposition A.7. Let (X, d) be a metric space with an isometric proper action of a group G. Then dim X/G = dim X. Proof. We can fix a pseudometric on the quotient space: d′ ([x], [x′ ]) = inf d(gx, g ′ x′ ). ′ g,g ∈G The action is isometric, so it is equal to inf g∈G d(gx, x′ ). If [x] 6= [x′ ], then – by properness of the action – there is no infinite sequence gn x converging to x′ and thus d′ ([x], [x′ ]) > 0. Therefore, X/G is a metric space (it is easy to check that the quotient topology and the metric topology agree). Let x ∈ X. Similarly as above, there is ε = ε(x) > 0 such that B(x, 2ε) is disjoint with all the other elements of the orbit Gx. Consequently, B(x, ε) is disjoint with its translates and has a finite stabiliser S (the one of x). Denote by f the restriction of the quotient map q : X → X/G to B(x, ε). For x′ ∈ B(x, ε) and y ′ = f (x′ ), the fibre f −1 (y ′ ) is equal to Sx′ and thus finite. Clearly f is an open surjection onto its (open) image, so Theorem A.1 applies: dim f (B(x, ε)) = dim B(x, ε). Using the openness and the surjectivity again, we notice that the family   q B x, ε(x) | x ∈ X 21 is an open covering of X/G. With Proposition A.6 we conclude: dim X/G = sup dim q (B (x, ε(x))) = sup dim B(x, ε(x)) = dim X. Finally, we can prove a version of [14, Proposition 2.6]. Proposition A.8. Let X be a metric space with an isometric proper action of a group G and dim X = n. Any open F -cover U of X has an open F -refinement W with dimension at most n. Proof. Denote the quotient map by q. By Proposition A.7, we know that the open covering {q(U ) | U ∈ U} of X/G has a refinement V of dimension at most n. Clearly q −1 (V ) for V ∈ V is G-invariant, in particular it is a G-subset. The covering {q −1 (V ) | V ∈ V} has the same dimension as V. In order to obtain the required refinement of U, it is enough to divide each q −1 (V ) into appropriate disjoint parts. Note that division into disjoint parts does not increase the dimension of a covering. Let UV be such an element of U that V ⊆ q(UV ). Then clearly: G gUV , q −1 (V ) ⊆ q −1 (q(UV )) = [g]∈G/S F where S is the stabiliser of UV . The required division is [g] gUV ∩ q −1 (V ). The covering W = {gUV ∩ q −1 (V ) | V ∈ V, g ∈ G} is clearly a G-covering and refines U. Moreover, if U is an F -cover, then W also is, as the stabiliser of UV ∩ q −1 (V ) is the same as the stabiliser of UV . Acknowledgements This work is based on the author’s Master’s thesis defended in September 2014 at the Faculty of Mathematics, Informatics and Mechanics of the University of Warsaw. The author is grateful to the supervisor of the thesis, Piotr Nowak, for his guidance and help. The author wishes to thank Rufus Willett for explaining the quantitative relations between equivariant and classical asymptotic dimension. The author especially thanks the referee and Łukasz Garncarek for very helpful remarks that greatly improved the manuscript. References [1] A. Bartels, On proofs of the Farrell-Jones conjecture, Topology and geometric group theory, Springer Proc. Math. Stat., vol. 184, Springer, [Cham], 2016, pp. 1–31, DOI 10.1007/978-3319-43674-6_1. [2] A. Bartels, Coarse flow spaces for relatively hyperbolic groups, Compos. Math. 153 (2017), no. 4, 745–779, DOI 10.1112/S0010437X16008216. [3] A. Bartels and M. Bestvina, The Farrell-Jones Conjecture for mapping class groups (2016), available at arXiv:1606.02844. [4] A. Bartels and W. Lück, Geodesic flow for CAT(0)-groups, Geom. Topol. 16 (2012), no. 3, 1345–1391, DOI 10.2140/gt.2012.16.1345. 22 [5] A. Bartels and W. Lück, The Borel conjecture for hyperbolic and CAT(0)-groups, Ann. of Math. (2) 175 (2012), no. 2, 631–689, DOI 10.4007/annals.2012.175.2.5. [6] A. Bartels, W. Lück, and H. Reich, Equivariant covers for hyperbolic groups, Geom. Topol. 12 (2008), no. 3, 1799–1882, DOI 10.2140/gt.2008.12.1799. [7] A. Bartels, W. Lück, and H. Reich, The K-theoretic Farrell-Jones conjecture for hyperbolic groups, Invent. Math. 172 (2008), no. 1, 29–70, DOI 10.1007/s00222-007-0093-7. [8] A. Bartels, W. Lück, H. Reich, and Henrik Rüping, K- and L-theory of group rings over GLn (Z), Publ. Math. Inst. Hautes Études Sci. 119 (2014), 97–125, DOI 10.1007/s10240013-0055-0. [9] G. Bell and A. Dranishnikov, Asymptotic dimension in Będlewo, Topology Proc. 38 (2011), 209–236. [10] N. P. Brown and N. Ozawa, C ∗ -algebras and finite-dimensional approximations, Graduate Studies in Mathematics, vol. 88, American Mathematical Society, Providence, RI, 2008. [11] M. Cencelj, J. Dydak, and A. Vavpetič, Property A and asymptotic dimension, Glas. Mat. Ser. III 47(67) (2012), no. 2, 441–444, DOI 10.3336/gm.47.2.17. [12] E. Guentner, R. Willett, and G. Yu, Dynamic asymptotic dimension: relation to dynamics, topology, coarse geometry, and C ∗ -algebras, Math. Ann., posted on 2016, 1–45, DOI 10.1007/s00208-016-1395-0. [13] D. Kasprowski and H. Rüping, Long and thin covers for cocompact flow spaces (2015), available at arXiv:1502.05001v1. [14] A. Mole and H. Rüping, Equivariant Refinements (2013), available at arXiv:1308.2799v2. [15] A. R. Pears, Dimension theory of general spaces, Cambridge University Press, Cambridge, England-New York-Melbourne, 1975. [16] J. Roe, Lectures on coarse geometry, University Lecture Series, vol. 31, American Mathematical Society, Providence, RI, 2003. [17] J. Roe, Hyperbolic groups have finite asymptotic dimension, Proc. Amer. Math. Soc. 133 (2005), no. 9, 2489–2490 (electronic), DOI 10.1090/S0002-9939-05-08138-4. [18] H. Rüping, The Farrell-Jones conjecture for some general linear groups, Ph.D. Thesis, Universität Bonn, Bonn, 2013. http://hss.ulb.uni-bonn.de/2013/3262/3262.pdf. [19] G. Szabo, J. Wu, and J. Zacharias, Rokhlin dimension for actions of residually finite groups (2014), available at arXiv:1408.6096v3. [20] C. Wegner, The K-theoretic Farrell-Jones conjecture for CAT(0)-groups, Proc. Amer. Math. Soc. 140 (2012), no. 3, 779–793, DOI 10.1090/S0002-9939-2011-11150-X. [21] C. Wegner, The Farrell-Jones conjecture for virtually solvable groups, J. Topol. 8 (2015), no. 4, 975–1016, DOI 10.1112/jtopol/jtv026. [22] R. Willett, Some notes on property A, Limits of graphs in group theory and computer science, EPFL Press, Lausanne, 2009, pp. 191–281. 23
4math.GR
arXiv:1010.1697v1 [cs.PL] 8 Oct 2010 Certifying cost annotations in compilers∗ Roberto M. Amadio(1) Yann Régis-Gianas(2) Nicolas Ayache(2) Ronan Saillard(2) (1) (2) Université Paris Diderot (UMR-CNRS 7126) Université Paris Diderot (UMR-CNRS 7126) and INRIA (Team πr2 ) February 17, 2017 Abstract We discuss the problem of building a compiler which can lift in a provably correct way pieces of information on the execution cost of the object code to cost annotations on the source code. To this end, we need a clear and flexible picture of: (i) the meaning of cost annotations, (ii) the method to prove them sound and precise, and (iii) the way such proofs can be composed. We propose a so-called labelling approach to these three questions. As a first step, we examine its application to a toy compiler. This formal study suggests that the labelling approach has good compositionality and scalability properties. In order to provide further evidence for this claim, we report our successful experience in implementing and testing the labelling approach on top of a prototype compiler written in ocaml for (a large fragment of) the C language. 1 Introduction The formal description and certification of software components is reaching a certain level of maturity with impressing case studies ranging from compilers to kernels of operating systems. A well-documented example is the proof of functional correctness of a moderately optimizing compiler from a large subset of the C language to a typical assembly language of the kind used in embedded systems [9]. In the framework of the Certified Complexity (CerCo) project [3], we aim to refine this line of work by focusing on the issue of the execution cost of the compiled code. Specifically, we aim to build a formally verified C compiler that given a source program produces automatically a functionally equivalent object code plus an annotation of the source code which is a sound and precise description of the execution cost of the object code. We target in particular the kind of C programs produced for embedded applications; these programs are eventually compiled to binaries executable on specific processors. The current state of the art in commercial products such as Scade [4, 7] is that the reaction time of the program is estimated by means of abstract interpretation methods (such as those developed by AbsInt [1, 6]) that operate on the binaries. These methods rely on a specific knowledge of the architecture of the processor and may require explicit annotations of the binaries to ∗ This work was supported by the Information and Communication Technologies (ICT) Programme as Project FP7-ICT-2009-C-243881 CerCo. 1 determine the number of times a loop is iterated (see, e.g., [15] for a survey of the state of the art). In this context, our aim is to produce a functionally correct compiler which can lift in a provably correct way the pieces of information on the execution cost of the binary code to cost annotations on the source C code. Eventually, we plan to manipulate the cost annotations with automatic tools such as Frama − C [5]. In order to carry on our project, we need a clear and flexible picture of: (i) the meaning of cost annotations, (ii) the method to prove them sound and precise, and (iii) the way such proofs can be composed. Our purpose here is to propose a methodology addressing these three questions and to consider its concrete application to a simple toy compiler and to a moderately optimizing untrusted C compiler. Meaning of cost annotations The execution cost of the source programs we are interested in depends on their control structure. Typically, the source programs are composed of mutually recursive procedures and loops and their execution cost depends, up to some multiplicative constant, on the number of times procedure calls and loop iterations are performed. Producing a cost annotation of a source program amounts to: • enrich the program with a collection of global cost variables to measure resource consumption (time, stack size, heap size,. . .) • inject suitable code at some critical points (procedures, loops,. . .) to keep track of the execution cost. Thus producing a cost-annotation of a source program P amounts to build an annotated program An(P ) which behaves as P while self-monitoring its execution cost. In particular, if we do not observe the cost variables then we expect the annotated program An(P ) to be functionally equivalent to P . Notice that in the proposed approach an annotated program is a program in the source language. Therefore the meaning of the cost annotations is automatically defined by the semantics of the source language and tools developed to reason on the source programs can be directly applied to the annotated programs too. Soundness and precision of cost annotations Suppose we have a functionally correct compiler C that associates with a program P in the source language a program C(P ) in the object language. Further suppose we have some obvious way of defining the execution cost of an object code. For instance, we have a good estimate of the number of cycles needed for the execution of each instruction of the object code. Now the annotation of the source program An(P ) is sound if its prediction of the execution cost is an upper bound for the ‘real’ execution cost. Moreover, we say that the annotation is precise with respect to the cost model if the difference between the predicted and real execution costs is bounded by a constant which depends on the program. Compositionality In order to master the complexity of the compilation process (and its verification), the compilation function C must be regarded as the result of the composition of a certain number of program transformations C = Ck ◦ · · · ◦ C1 . When building a system of cost annotations on top of an existing compiler a certain number of problems arise. First, the estimated cost of executing a piece of source code is determined only at the end of the compilation process. Thus while we are used to define the compilation functions Ci in 2 increasing order (from left to right), the annotation function An is the result of a progressive abstraction from the object to the source code (from right to left). Second, we must be able to foresee in the source language the looping and branching points of the object code. Missing a loop may lead to unsound cost annotations while missing a branching point may lead to rough cost predictions. This means that we must have a rather good idea of the way the source code will eventually be compiled to object code. Third, the definition of the annotation of the source code depends heavily on contextual information. For instance, the cost of the compiled code associated with a simple expression such as x+ 1 will depend on the place in the memory hierarchy where the variable x is allocated. A previous experience described in [2] suggests that the process of pushing ‘hidden parameters’ in the definitions of cost annotations and of manipulating directly numerical cost is error prone and produces complex proofs. For this reason, we advocate next a ‘labelling approach’ where costs are handled at an abstract level and numerical values are produced at the very end of the construction. Labelling approach to cost annotations The ‘labelling’ approach to the problem of building cost annotations is summarized in the following diagram. LO 1 I L1,ℓ C1 I L / L2,ℓ er 1 L1 C1 ... Ck ... Ck / Lk+1,ℓ er k+1 er 2  / L2 er i+1 ◦ Ci er 1 ◦ L An = = = Ci ◦ er i id L1 I◦L  / Lk+1 For each language Li considered in the compilation process, we define an extended labelled language Li,ℓ and an extended operational semantics. The labels are used to mark certain points of the control. The semantics makes sure that whenever we cross a labelled control point a labelled and observable transition is produced. For each labelled language there is an obvious function er i erasing all labels and producing a program in the corresponding unlabelled language. The compilation functions Ci are extended from the unlabelled to the labelled language so that they enjoy commutation with the erasure functions. Moreover, we lift the soundness properties of the compilation functions from the unlabelled to the labelled languages and transition systems. A labelling L of the source language L1 is just a function such that er L1 ◦ L is the identity function. An instrumentation I of the source labelled language L1,ℓ is a function replacing the labels with suitable increments of, say, a fresh global cost variable. Then an annotation An of the source program can be derived simply as the composition of the labelling and the instrumentation functions: An = I ◦ L. Suppose s is some adequate representation of the state of a program. Let P be a source program and suppose that its annotation satisfies the following property: (An(P ), s[c/cost ]) ⇓ s′ [c + δ/cost ] (1) where c and δ are some non-negative numbers. Then the definition of the instrumentation and the fact that the soundness proofs of the compilation functions have been lifted to the labelled languages allows to conclude that (C(L(P )), s[c/cost ]) ⇓ (s′ [c/cost ], λ) 3 (2) where C = Ck ◦ · · · ◦ C1 and λ is a sequence (or a multi-set) of labels whose ‘cost’ corresponds to the number δ produced by the annotated program. Then the commutation properties of erasure and compilation functions allows to conclude that the erasure of the compiled labelled code er k+1 (C(L(P ))) is actually equal to the compiled code C(P ) we are interested in. Given this, the following question arises: under which conditions the sequence λ, i.e., the increment δ, is a sound and possibly precise description of the execution cost of the object code? To answer this question, we observe that the object code we are interested in is some kind of assembly code and its control flow can be easily represented as a control flow graph. The fact that we have to prove the soundness of the compilation functions means that we have plenty of information on the way the control flows in the compiled code, in particular as far as procedure calls and returns are concerned. These pieces of information allow to build a rather accurate representation of the control flow of the compiled code at run time. The idea is then to perform two simple checks on the control flow graph. The first check is to verify that all loops go through a labelled node. If this is the case then we can associate a finite cost with every label and prove that the cost annotations are sound. The second check amounts to verify that all paths starting from a label have the same cost. If this check is successful then we can conclude that the cost annotations are precise. A toy compiler As a first case study for the labelling approach to cost annotations we have sketched, we introduce a toy compiler which is summarised by the following diagram. Imp C / Vm C′ / Mips The three languages considered can be shortly described as follows: Imp is a very simple imperative language with pure expressions, branching and looping commands, Vm is an assembly-like language enriched with a stack, and Mips is a Mips-like assembly language with registers and main memory. The first compilation function C relies on the stack of the Vm language to implement expression evaluation while the second compilation function C ′ allocates (statically) the base of the stack in the registers and the rest in main memory. This is of course a naive strategy but it suffices to expose some of the problems that arise in defining a compositional approach. A C compiler As a second, more complex, case study we consider a C compiler we have built in ocaml whose structure is summarised by the following diagram: Mips ← C → Clight → Cminor → LIN ← LTL ← ERTL ← RTLAbs ↓ RTL (front end) (back-end) The structure follows rather closely the one of the CompCert compiler [9]. Notable differences are that some compilation steps are fusioned, that the front-end goes till RTLAbs (rather than Cminor) and that we target the Mips assembly language (rather than PowerPc). These differences are contingent to the way we built the compiler. The compilation from C to Clight relies on the CIL front-end [13]. The one from Clight to RTL has been programmed from scratch and it is partly based on the Coq definitions available in the CompCert compiler. Finally, the back-end from RTL to Mips is based on a compiler developed in ocaml for pedagogical purposes [14]. The main optimisations it performs are common subexpression elimination, liveness analysis and register allocation, and graph compression. We ran some 4 benchmarks to ensure that our prototype implementation is realistic. The results are given in appendix B.9 and the compiler is available from the authors. Organisation The rest of the paper is organised as follows. Section 2 describes the 3 languages and the 2 compilation steps of the toy compiler. Section 3 describes the application of the labelling approach to the toy compiler. Section 4 reports our experience in implementing and testing the labelling approach on the C compiler. Section 5 summarizes our contribution and outlines some perspectives for future work. Appendix A sketches the proofs that have not been mechanically checked in Coq and appendix B provides some details on the structure of the C compiler we have implemented. 2 A toy compiler We formalise the toy compiler introduced in section 1. 2.1 Imp: language and semantics The syntax of the Imp language is described below. This is a rather standard imperative language with while loops and if-then-else. id n v e b S P ::= x | y | . . . ::= 0 | −1 | +1 | . . . ::= n | true | false ::= id | n | e + e ::= e < e ::= skip | id := e | S; S | if b then S else S | while b do S ::= prog S (identifiers) (integers) (values) (numerical expressions) (boolean conditions) (commands) (programs) Let s be a total function from identifiers to integers representing the state. If s is a state, x an identifier, and n an integer then s[n/x] is the ‘updated’ state such that s[n/x](x) = n and s[n/x](y) = s(y) if x 6= y. The big-step operational semantics of Imp expressions and boolean conditions is defined as follows: (v, s) ⇓ v (x, s) ⇓ s(x) (e, s) ⇓ v (e′ , s) ⇓ v ′ (e + e′ , s) ⇓ (v +Z v ′ ) (e, s) ⇓ v (e′ , s) ⇓ v ′ (e < e′ , s) ⇓ (v <Z v ′ ) A continuation K is a list of commands which terminates with a special symbol halt: K ::= halt | S · K. Table 1 defines a small-step semantics of Imp commands whose basic judgement has the shape: (S, K, s) → (S ′ , K ′ , s′ ). We define the semantics of a program prog S as the semantics of the command S with continuation halt. We derive a big step semantics from the small step one as follows: (S, s) ⇓ s′ if (S, halt, s) → · · · → (skip, halt, s′ ). 2.2 Vm: language and semantics Following [10], we define a virtual machine Vm and its programming language. The machine includes the following elements: (1) a fixed code C (a possibly empty sequence of instructions), (2) a program counter pc, (3) a store s (as for the source program), (4) a stack of integers σ. Given a sequence C, we denote with |C| its length and with C[i] its ith element (the leftmost element being the 0th element). The operational semantics of the instructions is formalised by rules of the shape C ⊢ (i, σ, s) → (j, σ ′ , s′ ) and it is fully described in table 5 (x := e, K, s) → (skip, K, s[v/x]) if (e, s) ⇓ v (S; S ′ , K, s) → (S, S ′ · K, s) (if b then S else S ′ , K, s) →  (S, K, s) (S ′ , K, s) (while b do S, K, s) →  (S, (while b do S) · K, s) (skip, K, s) (skip, S · K, s) → (S, K, s) if (b, s) ⇓ true if (b, s) ⇓ false if (b, s) ⇓ true if (b, s) ⇓ false Table 1: Small-step operational semantics of Imp commands Rule C ⊢ (i, σ, s) → (i + 1, n · σ, s) C ⊢ (i, σ, s) → (i + 1, s(x) · σ, s) C ⊢ (i, n · σ, s) → (i + 1, σ, s[n/x]) C ⊢ (i, n · n′ · σ, s) → (i + 1, (n +Z n′ ) · σ, s) C ⊢ (i, σ, s) → (i + k + 1, σ, s) C ⊢ (i, n · n′ · σ, s) → (i + 1, σ, s) C ⊢ (i, n · n′ · σ, s) → (i + k + 1, σ, s) C[i] = cnst(n) var(x) setvar(x) add branch(k) bge(k) and n <Z n′ bge(k) and n ≥Z n′ Table 2: Operational semantics Vm programs 2. Notice that Imp and Vm semantics share the same notion of store. We write, e.g., n · σ to stress that the top element of the stack exists and is n. We will also write (C, s) ⇓ s′ if ∗ C ⊢ (0, ǫ, s) → (i, ǫ, s′ ) and C[i] = halt. Code coming from the compilation of Imp programs has specific properties that are used in the following compilation step when values on the stack are allocated either in registers or in main memory. In particular, it turns out that for every instruction of the compiled code it is possible to predict statically the height of the stack whenever the instruction is executed. We now proceed to define a simple notion of well-formed code and show that it enjoys this property. In the following section, we will define the compilation function from Imp to Vm and show that it produces well-formed code. Definition 1 We say that a sequence of instructions C is well formed if there is a function h : {0, . . . , |C|} → N which satisfies the conditions listed in table 3 for 0 ≤ i ≤ |C| − 1. In this case we write C : h. The conditions defining the predicate C : h are strong enough to entail that h correctly C[i] = cnst(n) or var(x) add setvar(x) branch(k) bge(k) halt Conditions for C : h h(i + 1) = h(i) + 1 h(i) ≥ 2, h(i + 1) = h(i) − 1 h(i) = 1, h(i + 1) = 0 0 ≤ i + k + 1 ≤ |C|, h(i) = h(i + 1) = h(i + k + 1) = 0 0 ≤ i + k + 1 ≤ |C|, h(i) = 2, h(i + 1) = h(i + k + 1) = 0 i = |C| − 1, h(i) = h(i + 1) = 0 Table 3: Conditions for well-formed code 6 C(x) = var(x) C(e + e′ ) = C(e) · C(e′ ) · add C(n) = cnst(n) C(e < e′ , k) = C(e′ ) · C(e) · bge(k) C(x := e) = C(e) · setvar(x) C(S; S ′ ) = C(S) · C(S ′ ) C(if b then S else S ′ ) = C(b, k) · C(S) · (branch(k′ )) · C(S ′ ) where: k = sz (S) + 1, k′ = sz (S ′ ) C(while b do S) = C(b, k) · C(S) · branch(k′ ) where: k = sz (S) + 1, k′ = −(sz (b) + sz (S) + 1) C(prog S) = C(S) · halt Table 4: Compilation from Imp to Vm predicts the stack height and to guarantee the uniqueness of h up to the initial condition. ∗ Proposition 2 (1) If C : h, C ⊢ (i, σ, s) → (j, σ ′ , s′ ), and h(i) = |σ| then h(j) = |σ ′ |. (2) If C : h, C : h′ and h(0) = h′ (0) then h = h′ . 2.3 Compilation from Imp to Vm In table 4, we define compilation functions C from Imp to Vm which operate on expressions, boolean conditions, statements, and programs. We write sz (e), sz (b), sz (S) for the number of instructions the compilation function associates with the expression e, the boolean condition b, and the statement S, respectively. We follow [10] for the proof of soundness of the compilation function for expressions and boolean conditions (see also [11] for a much older reference). Proposition 3 The following properties hold: ∗ (1) If (e, s) ⇓ v then C · C(e) · C ′ ⊢ (i, σ, s) → (j, v · σ, s) where i = |C| and j = |C · C(e)|. ∗ (2) If (b, s) ⇓ true then C ·C(b, k)·C ′ ⊢ (i, σ, s) → (j+k, σ, s) where i = |C| and j = |C ·C(b, k)|. ∗ (3) If (b, s) ⇓ false then C · C(b, k) · C ′ ⊢ (i, σ, s) → (j, σ, s) where i = |C| and j = |C · C(b, k)|. Next we focus on the compilation of statements. We introduce a ternary relation R(C, i, K) which relates a Vm code C, a number i ∈ {0, . . . , |C|−1} and a continuation K. The intuition is that relative to the code C, the instruction i can be regarded as having continuation K. (A formal definition is available in appendix 4.) We can then state the correctness of the compilation function as follows. ∗ Proposition 4 If (S, K, s) → (S ′ , K ′ , s′ ) and R(C, i, S · K) then C ⊢ (i, σ, s) → (j, σ, s′ ) and R(C, j, S ′ · K ′ ). As announced, we can prove that the result of the compilation is a well-formed code. Proposition 5 For any program P there is a unique h such that C(P ) : h. 7 Rule M ⊢ (i, m) → (i + 1, m[n/R]) M ⊢ (i, m) → (i + 1, m[m(l)/R]) M ⊢ (i, m) → (i + 1, m[m(R)/l])) M ⊢ (i, m) → (i + 1, m[m(R′ ) + m(R′′ )/R]) M ⊢ (i, m) → (i + k + 1, m) M ⊢ (i, m) → (i + 1, m) M ⊢ (i, m) → (i + k + 1, m) M [i] = loadi R, n load R, l store R, l add R, R′ , R′′ branch k bge R, R′ , k and m(R) <Z m(R′ ) bge R, R′ , k and m(R) ≥Z m(R′ ) Table 5: Operational semantics Mips programs 2.4 Mips: language and semantics We consider a Mips-like machine [8] which includes the following elements: (1) a fixed code M (a sequence of instructions), (2) a program counter pc, (3) a finite set of registers including the registers A, B, and R0 , . . . , Rb−1 , and (4) an (infinite) main memory which maps locations to integers. We denote with R, R′ , . . . registers, with l, l′ , . . . locations and with m, m′ , . . . memories which are total functions from registers and locations to (unbounded) integers. We denote with M a list of instructions. The operational semantics is formalised in table 5 by rules of the shape M ⊢ (i, m) → (j, m′ ), where M is a list of Mips instructions, i, j are natural numbers ∗ and m, m′ are memories. We write (M, m) ⇓ m′ if M ⊢ (0, m) → (j, m′ ) and M [j] = halt. 2.5 Compilation from Vm to Mips In order to compile Vm programs to Mips programs we make the following hypotheses: (1) for every Vm program variable x we reserve an address lx , (2) for every natural number h ≥ b, we reserve an address lh (the addresses lx , lh , . . . are all distinct), and (3) we store the first b elements of the stack σ in the registers R0 , . . . , Rb−1 and the remaining (if any) at the addresses lb , lb+1 , . . .. We say that the memory m represents the stack σ and the store s, and write m k−σ, s, if the following conditions are satisfied: (1) s(x) = m(lx ), and (2) if 0 ≤ i < |σ| then σ[i] = m(Ri ) if i < b, and σ[i] = m(li ) if i ≥ b. The compilation function C ′ from Vm to Mips is described in table 6. It operates on a well-formed Vm code C whose last instruction is halt. Hence, by proposition 5(3), there is a unique h such that C : h. We denote with C ′ (C) the concatenation C ′ (0, C) · · · C ′ (|C| − 1, C). Given a well formed Vm code C with i < |C| we denote with p(i, C) the position of the first instruction in C ′ (C) which corresponds to the compilation of the instruction with position i in C. This is defined as1 p(i, C) = Σ0≤j<i d(i, C), where the function d(i, C) is defined as d(i, C) = |C ′ (i, C)|. Hence d(i, C) is the number of Mips instructions associated with the ith instruction of the (well-formed) C code. The functional correctness of the compilation function can then be stated as follows. Proposition 6 Let C : h be a well formed code. If C ⊢ (i, σ, s) → (j, σ ′ , s′ ) with h(i) = |σ| ∗ and m k−σ, s then C ′ (C) ⊢ (p(i, C), m) → (p(j, C), m′ ) and m′ k−σ ′ , s′ . 1 There is an obvious circularity in this definition that can be easily eliminated by defining first the function d following the case analysis in table 6, then the function p, and finally the function C ′ as in table 6. 8 C[i] = cnst(n) var(x) add setvar(x) branch(k) bge(k) halt ′ C  (i, C) = (loadi Rh , n) if h = h(i) < b otherwise  (loadi A, n) · (store A, lh ) (load Rh , lx ) if h = h(i) < b otherwise  (load A, lx ) · (store A, lh ) (add R , R , R ) if h = h(i) < (b − 1)  h−2 h−2 h−1   (load A, lh−1 ) · (add Rh−2 , Rh−2 , A) if h = h(i) = (b − 1) (load A, lh−1 ) · (load B, lh−2 ) if h = h(i) > (b − 1)    (add A, B, A) · (store A, l ) h−2  (store Rh−1 lx ) if h = h(i) < b (load A, lh−1 ) · (store A, lx ) if h = h(i) ≥ b (branch k′ ) if k′ = p(i + k + 1, C) − p(i + 1, C)  (bge Rh−2 , Rh−1 , k′ ) if h = h(i) < (b − 1)    (load A, lh−1 ) · (bge Rh−2 , A, k′ ) if h = h(i) = (b − 1) (load A, lh−2 ) · (load B, lh−1 ) · (bge A, B, k′ ) if h = h(i) > (b − 1), k′ =    p(i + k + 1, C) − p(i + 1, C) halt Table 6: Compilation from Vm to Mips 3 Labelling approach for the toy compiler We apply the labelling approach introduced in section 1 to the toy compiler which results in the following diagram. Imp O I Impℓ C I er Imp L Imp 3.1 / Vmℓ C C′ er Mips er Vm  / Vm er Vm ◦ C er Mips ◦ C ′ er Imp ◦ L An Imp / Mipsℓ C ′ = = = = C ◦ er Imp C ′ ◦ er Vm idImp I ◦L  / Mips Labelled Imp We extend the syntax so that statements can be labelled: S ::= . . . | ℓ : S. For instance, ℓ : (while (n < x) do ℓ : S) is a labelled command. The small step semantics of statements defined in table 1 is extended as follows. (ℓ : S, K, s) ℓ → − (S, K, s) We denote with λ, λ′ , . . . finite sequences of labels. In particular, we denote with ǫ the empty sequence and identify an unlabelled transition with a transition labelled with ǫ. Then the small step reduction relation we have defined on statements becomes a labelled transition system. There is an obvious erasure function er Imp from the labelled language to the unlabelled one which is the identity on expressions and boolean conditions, and traverses commands removing all labels. We derive a labelled big-step semantics as follows: (S, s) ⇓ (s′ , λ) if λ λ 1 n (S, halt, s) −→ · · · −→ (skip, halt, s′ ) and λ = λ1 · · · λn . 9 Labelled Vm 3.2 We introduce a new instruction nop(ℓ) whose semantics is defined as follows: ℓ C ⊢ (i, σ, s) − → (i + 1, σ, s) if C[i] = nop(ℓ) . The erasure function er Vm amounts to remove from a Vm code C all the nop(ℓ) instructions and recompute jumps accordingly. Specifically, let n(C, i, j) be the number of nop instructions in the interval [i, j]. Then, assuming C[i] = branch(k) we replace the offset k with an offset k′ determined as follows: k′ =  k − n(C, i, i + k) k + n(C, i + 1 + k, i) if k ≥ 0 if k < 0 The compilation function C is extended to Impℓ by defining: C(ℓ : b, k) = (nop(ℓ)) · C(b, k) C(ℓ : S) = (nop(ℓ)) · C(S) . Proposition 7 For all commands S in Impℓ we have that: (1) er Vm (C(S)) = C(er Imp (S)). (2) If (S, s) ⇓ (s′ , λ) then (C(S), s) ⇓ (s′ , λ). Remark 8 In the current formulation, a sequence of transitions λ in the source code must be simulated by the same sequence of transitions in the object code. However, in the actual computation of the costs, the order of the labels occurring in the sequence is immaterial. Therefore one may consider a more relaxed notion of simulation where λ is a multi-set of labels. Labelled Mips 3.3 The labelled extension of Mips is similar to the one of Vm. We add an instruction nop ℓ whose semantics is defined as follows: ℓ M ⊢ (i, m) − → (i + 1, m) if M [i] = (nop ℓ) . The erasure function er Mips is also similar to the one of Vm as it amounts to remove from a Mips code all the (nop ℓ) instructions and recompute jumps accordingly. The compilation function C ′ is extended to Vmℓ by simply translating nop(ℓ) as (nop ℓ): C ′ (i, C) = (nop ℓ) if C[i] = nop(ℓ) λ 1 The evaluation predicate for labelled Mips is defined as (M, m) ⇓ (m′ , λ) if M ⊢ (0, m) −→ λ n · · · −→ (j, m′ ), λ = λ1 · · · λn and M [j] = halt. The following proposition relates Vmℓ code and its compilation and it is similar to proposition 7. Proposition 9 Let C be a Vmℓ code. Then: (1) er Mips (C ′ (C)) = C ′ (er Vm (C)). (2) If (C, s) ⇓ (s′ , λ) and m k−ǫ, s then (C ′ (C), m) ⇓ (m′ , λ) and m′ k−ǫ, s′ . 10 3.4 Labellings and instrumentations Assuming a function κ which associates an integer number with labels and a distinct variable cost which does not occur in the program P under consideration, we abbreviate with inc(ℓ) the assignment cost := cost + κ(ℓ). Then we define the instrumentation I (relative to κ and cost ) as follows: I(ℓ : S) = inc(ℓ); I(S) . The function I just distributes over the other operators of the language. We extend the function κ on labels to sequences of labels by defining κ(ℓ1 , . . . , ℓn ) = κ(ℓ1 ) + · · · + κ(ℓn ). The instrumented Imp program relates to the labelled one has follows. Proposition 10 Let S be an Impℓ command. ∃ λ κ(λ) = δ and (S, s[c/cost ]) ⇓ (s′ [c/cost ], λ). If (I(S), s[c/cost ]) ⇓ s′ [c + δ/cost ] then Definition 11 A labelling is a function L from an unlabelled language to the corresponding labelled one such that er Imp ◦ L is the identity function on the Imp language. Proposition 12 For any labelling function L, and Imp program P , the following holds: er Mips (C ′ (C(L(P ))) = C ′ (C(P )) . (3) Proposition 13 Given a function κ for the labels and a labelling function L, for all programs P of the source language if (I(L(P )), s[c/cost ]) ⇓ s′ [c + δ/cost ] and m k−ǫ, s[c/cost ] then (C ′ (C(L(P ))), m) ⇓ (m′ , λ), m′ k−ǫ, s′ [c/cost ] and κ(λ) = δ. 3.5 Sound and precise labellings With any Mipsℓ code M we can associate a directed and rooted (control flow) graph whose nodes are the instruction positions {0, . . . , |M | − 1}, whose root is the node 0, and whose directed edges correspond to the possible transitions between instructions. We say that a node is labelled if it corresponds to an instruction nop ℓ. Definition 14 A simple path in a Mipsℓ code M is a directed finite path in the graph associated with M where the first node is labelled, the last node is the predecessor of either a labelled node or a leaf, and all the other nodes are unlabelled. Definition 15 A Mipsℓ code M is soundly labelled if in the associated graph the root node 0 is labelled and there are no loops that do not go through a labelled node. In a soundly labelled graph there are finitely many simple paths. Thus, given a soundly labelled Mips code M , we can associate with every label ℓ a number κ(ℓ) which is the maximum (estimated) cost of executing a simple path whose first node is labelled with ℓ. We stress that in the following we assume that the cost of a simple path is proportional to the number of Mips instructions that are crossed in the path. Proposition 16 If M is soundly labelled and (M, m) ⇓ (m′ , λ) then the cost of the computation is bounded by κ(λ). Thus for a soundly labelled Mips code the sequence of labels associated with a computation is a significant information on the execution cost. 11 Ls (prog S) Ls (skip) Ls (x := e) Ls (S; S ′ ) Ls (if b then S1 else S2 ) Ls (while b do S) = prog ℓ : Ls (S) = skip = x := e = Ls (S); Ls (S ′ ) = if b then Ls (S1 ) else Ls (S2 ) = while b do ℓ : Ls (S) Lp (prog S) Lp (S) L′ p (S) L′ p (if b then S1 else S2 ) L′ p (while b do S) L′ p (S1 ; S2 ) = prog Lp (S) = let ℓ = new , (S ′ , d) = L′ p (S) in ℓ : S ′ = (S, 0) if S = skip or S = (x := e) = (if b then Lp (S1 ) else Lp (S2 ), 1) = (while b do Lp (S), 1) = let (S1′ , d1 ) = L′ p (S1 ), (S2′ , d2 ) = L′ p (S2 ) in case d1 0 : (S1′ ; S2′ , d2 ) 1 : let ℓ = new in (S1′ ; ℓ : S2′ , d2 ) Table 7: Two labellings for the Imp language Definition 17 We say that a soundly labelled code is precise if for every label ℓ in the code, the simple paths starting from a node labelled with ℓ have the same cost. In particular, a code is precise if we can associate at most one simple path with every label. Proposition 18 If M is precisely labelled and (M, m) ⇓ (m′ , λ) then the cost of the computation is κ(λ). The next point we have to check is that there are labelling functions (of the source code) such that the compilation function does produce sound and possibly precise labelled Mips code. To discuss this point, we introduce in table 7 two labelling functions Ls and Lp for the Imp language. The first labelling relies on just one label while the second one relies on a function “new” which is meant to return fresh labels and on an auxiliary function L′ p which returns a labelled command and a binary directive d ∈ {0, 1}. If d = 1 then the command that follows (if any) must be labelled. Proposition 19 For all Imp programs P : (1) C ′ (C(Ls (P )) is a soundly labelled Mips code. (2) C ′ (C(Lp (P )) is a soundly and precisely labelled Mips code. For an example of command which is not soundly labelled, consider ℓ : while 0 < x do x := x + 1, which when compiled, produces a loop that does not go through any label. On the other hand, for an example of a program which is not precisely labelled consider ℓ : (if 0 < x then x := x + 1 else skip). In the compiled code, we find two simple paths associated with the label ℓ whose cost will be quite different in general. Once a sound and possibly precise labelling L has been designed, we can determine the cost of each label and define an instrumentation I whose composition with L will produce the desired cost annotation. 12 1. Label the input Clight program. 2. Compile the labelled Clight program in the labelled world. This produces a labelled Mips code. 3. For each label of the labelled Mips code, compute the cost of the instructions under its scope and generate a label-cost mapping. An unlabelled Mips code — the result of the compilation — is obtained by removing the labels from the labelled Mips code. 4. Add a fresh cost variable to the labelled Clight program and replace the labels by an increment of this cost variable according to the label-cost mapping. The result is an annotated Clight program with no label. Table 8: Building the annotation of a Clight program in the labelling approach Definition 20 Given a labelling function L for the source language Imp and a program P in the Imp language, we define an annotation for the source program as follows: An Imp (P ) = I(L(P )) . Proposition 21 If P is a program and C ′ (C(L(P ))) is a sound (sound and precise) labelling then (An Imp (P ), s[c/cost ]) ⇓ s′ [c+δ/cost ] and m k−ǫ, s[c/cost ] entails that (C ′ (C(P )), m) ⇓ m′ , m′ k−ǫ, s′ [c/cost ] and the cost of the execution is bound (is exactly) δ. To summarise, producing sound and precise labellings is mainly a matter of designing the labelled source language so that the labelling is sufficiently fine grained. For instance, in the toy compiler, it enough to label commands while it is not necessary to label boolean conditions and expressions. Besides soundness and precision, a third criteria to evaluate labellings is that they do not introduce too many unnecessary labels. We call this property economy. There are two reasons for this requirement. On one hand we would like to minimise the number of labels so that the source program is not cluttered by too many cost annotations and on the other hand we would like to maximise the length of the simple paths because in a modern processor the longer the sequence of instructions we consider the more accurate is the estimation of their execution cost (on a long sequence certain costs are amortized). In practice, it seems that one can produce first a sound and possibly precise labelling and then apply heuristics to eliminate unnecessary labels. 4 Labelling approach for the C compiler This section informally describes the labelled extensions of the languages in the compilation chain (see appendix B for details), the way the labels are propagated by the compilation functions, the labelling of the source code, the hypotheses on the control flow of the labelled Mips code and the verification that we perform on it, the way we build the instrumentation, and finally the way the labelling approach has been tested. The process of annotating a Clight program using the labelling approach is summarized in table 8 and is detailed in the following sections. 13 4.1 Labelled languages Both the Clight and Cminor languages are extended in the same way by labelling both statements and expressions (by comparison, in the toy language Imp we just labelled statements). The labelling of expressions aims to capture precisely their execution cost. Indeed, Clight and Cminor include expressions such as a1 ?a2 ; a3 whose evaluation cost depends on the boolean value a1 . As both languages are extended in the same way, the extended compilation does nothing more than sending Clight labelled statements and expressions to those of Cminor. The labelled versions of RTLAbs and the languages in the back-end simply consist in adding a new instruction whose semantics is to emit a label without modifying the state. For the CFG based languages (RTLAbs to LTL), this new instruction is emit label → node. For LIN and Mips, it is emit label . The translation of these label instructions is immediate. In Mips, we also rely on a reserved label begin function to pinpoint the beginning of a function code (cf. section 4.2). 4.2 Labelling of the source language As for the toy compiler (cf. end of section 3), the goals of a labelling are soundness, precision, and possibly economy. We explain our labelling by considering the constructions of Clight and their compilation to Mips. Sequential instructions A sequence of Clight instructions that compile to sequential Mips code, such as a sequence of assignments, can be handled by a single label which covers the unique execution path. Ternary expressions and conditionals Most Clight expressions compile to sequential Mips code. Ternary expressions, that introduce a branching in the control flow, are one exception. In this case, we achieve precision by associating a label with each branch. This is similar to the treatment of the conditional we have already discussed in section 3. As for the Clight operations && and || which have a lazy semantics, they are transformed to ternary expressions before computing the labelling. Loops Loops in Clight are guarded by a condition. Following the arguments for the previous cases, we add two labels when encountering a loop construct: one label to start the loop’s body, and one label when exiting the loop. This is similar to the treatment of while loops discussed in section 3 and it is enough to guarantee that the loop in the compiled code goes through a label. Program Labels and Gotos In Clight, program labels and gotos are intraprocedural. Their only effect on the control flow of the resulting assembly code is to potentially introduce an unguarded loop. This loop must contain at least one cost label in order to satisfy the soundness condition, which we ensure by adding a cost label right after a program label. 14 Clight Labelling −−−−−−→ lbl: i++; ... goto lbl; Labelled Clight Compilation −−−−−−−−→ lbl: cost: i++; ... goto lbl; Labelled Mips lbl: emit li add ... j cost $v0, 1 $a0, $a0, $v0 lbl Function calls Function calls in Mips are performed by indirect jumps, the address of the callee being in a register. In the general case, this address cannot be inferred statically. Even though the destination point of a function call is unknown, when the considered Mips code has been produced by our compiler, we know for a fact that this function ends with a return statement that transfers the control back to the instruction following the function call in the caller. As a result, we treat function calls according to the following global invariants of the compilation: (1) the instructions of a function are covered by the labels inside this function, (2) we assume a function call always returns and runs the instruction following the call. Invariant (1) entails in particular that each function must contain at least one label. To ensure this, we simply add a starting label in every function definition. The example below illustrates this point: Clight void f () { f’s body } Labelling −−−−−−→ Labelled Clight void f () { cost: f’s body } Compilation −−−−−−−−→ Labelled Mips f start: Frame Creation Initializations emit cost f’s body Frame Deletion return We notice that some instructions in Mips will be inserted before the first label is emitted. These instructions relate to the frame creation and/or variable initializations, and are composed of sequential instructions (no branching). To deal with this issue, we take the convention that the instructions that precede the first label in a function code are actually under the scope of the first label. Invariant (2) is of course an over-approximation of the program behaviour as a function might fail to return because of an infinite loop. In this case, the proposed labelling remains correct: it just assumes that the instructions following the function call will be executed, and takes their cost into consideration. The final computed cost is still an over-approximation of the actual cost. 4.3 Verifications on the object code The labelling previously described has been designed so that the compiled Mips code satisfies the soundness and precision conditions. However, we do not need to prove this, instead we have to devise an algorithm that checks the conditions on the compiled code. The algorithm assumes a correct management of function calls in the compiled code. In particular, when we call a function we always jump to the first instruction of the corresponding code segment and when we return we always jump to an an instruction that follows a call. We stress that this is a reasonable hypothesis that is essentially subsumed by the proof that the object code simulates the source code. 15 In our current implementation, we check the soundness and the precision conditions while building at the same time the label-cost mapping. To this end, the algorithm takes the following main steps. • First, for each function a control flow graph is built. • For each graph, we check whether there is a unique label that is reachable from the root by a unique path. This unique path corresponds to the instructions generated by the calling conventions as discussed in section 4.2. We shift the occurrence of the label to the root of the graph. • By a strongly connected components algorithm, we check whether every loop in the graphs goes through at least one label. • We perform a (depth-first) search of the graph. Whenever we reach a labelled node, we perform a second (depth-first) search that stops at labelled nodes and computes an upper bound on the cost of the occurrence of the label. Of course, when crossing a branching instruction, we take the maximum cost of the branches. When the second search stops we update the current cost of the label-cost mapping (by taking a maximum) and we continue the first search. • Warning messages are emitted whenever the maximum is taken between two different values as in this case the precision condition may be violated. 4.4 Building the cost annotation Once the label-cost mapping is computed, instrumenting the labelled source code is an easy task. A fresh global variable which we call cost variable is added to the source program with the purpose of holding the cost value and it is initialised at the very beginning of the main program. Then, every label is replaced by an increment of the cost variable according to the label-cost mapping. Following this replacement, the cost labels disappear and the result is a Clight program with annotations in the form of assignments. There is one final problem: labels inside expressions. As we already mentioned, Clight does not allow writing side-effect instructions — such as cost increments — inside expressions. To cope with this restriction, we produce first an instrumented C program — with side-effects in expressions — that we translate back to Clight using CIL. This process is summarized below. Labelled Clight label-cost mapping 4.5  Instrumentation −−−−−−−−−−→ Instrumented C CIL −−→ Instrumented Clight Testing It is desirable to test the coherence of the labelling from Clight to Mips. To this end, each labelled language comes with an interpreter that produces the trace of the labels encountered during the computation. Then, one naive approach is to test the equality of the traces produced by the program at the different stages of the compilation. Our current implementation passes this kind of tests. For some optimisations that may re-order computations, the weaker condition mentioned in remark 8 could be considered. 5 Conclusion and future work We have discussed the problem of building a compiler which can lift in a provably correct way pieces of information on the execution cost of the object code to cost annotations on the source code. To this end, we have introduced the so called labelling approach and discussed its formal application to a toy compiler. Based on this experience, we have argued that the approach has good scalability properties, and to substantiate this claim, we have reported 16 on our successful experience in implementing and testing the labelling approach on top of a prototype compiler written in ocaml for a large fragment of the C language which can be shortly described as Clight without floating point. We discuss next a few directions for future work. First, we are currently testing the current compiler on the kind of C code produced for embedded applications by a Lustre compiler. Starting from the annotated C code, we are relying on the Frama − C tool to produce automatically meaningful information on, say, the reaction time of a given synchronous program. Second, we are porting the current compiler to other assembly languages. In particular, we are interested in targeting one of the assembly languages covered by the AbsInt tool so as to obtain more realistic estimations of the execution cost of sequences of instructions. Third, we plan to formalise and validate in the Calculus of Inductive Constructions the prototype implementation of the labelling approach for the C compiler described in section B. This requires a major implementation effort which will be carried on in collaboration with our partners of the CerCo project [3]. References [1] AbsInt Angewandte Informatik. http://www.absint.com/. [2] R.M. Amadio, N. Ayache, K. Memarian, R. Saillard, Y. Régis-Gianas. Compiler Design and Intermediate Languages. Deliverable 2.1 of [3]. [3] Certified Complexity (Project http://cerco.cs.unibo.it. description). ICT-2007.8.0 FET Open, Grant 243881. [4] Esterel Technologies. http://www.esterel-technologies.com. [5] Frama − C software analysers. http://frama-c.com/. [6] C. Ferdinand, R. Heckmann, T. Le Sergent, D. Lopes, B. Martin, X. Fornari, and F. Martin. Combining a high-level design tool for safety-critical systems with a tool for WCET analysis of executables. In Embedded Real Time Software (ERTS), 2008. [7] X. Fornari. Understanding how SCADE suite KCG generates safe C code. White paper, Esterel Technologies, 2010. [8] J. Larus. Assemblers, linkers, and the SPIM simulator. Appendix of Computer Organization and Design: the hw/sw interface, by Hennessy and Patterson, 2005. [9] X. Leroy. Formal verification of a realistic compiler. Commun. ACM, 52(7):107-115, 2009. [10] X. Leroy. Mechanized semantics, with applications to program proof and compiler verification. Marktoberdorf summer school, 2009. [11] J. McCarthy and J. Painter. Correctness of a compiler for arithmetic expressions. In Math. aspects of Comp. Sci. 1, vol. 19 of Symp. in Appl. Math., AMS, 1967. [12] K. Memarian. Complexité Certifiée. Travail d’étude et de recherche, Master Informatique, Université Paris Diderot, 2010. http://www.pps.jussieu.fr/~ yrg/miniCerCo/ [13] G. Necula, S. McPeak, S.P. Rahul, and W. Weimer. CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs. In Proceedings of Conference on Compiler Construction, Springer LNCS 2304:213–228, 2002. [14] F. Pottier. Compilation (INF 564), École Polytechnique, http://www.enseignement.polytechnique.fr/informatique/INF564/. 2009-2010. [15] R. Wilhelm et al. The worst-case execution-time problem - overview of methods and survey of tools. ACM Trans. Embedded Comput. Syst., 7(3), 2008. 17 A Proofs We omit the proofs that have been checked by K. Memarian with the Coq proof assistant [12]. A.1 Notation t Let − → be a family of reduction relations where t ranges over the set of labels and ǫ. Then we define: ( ǫ (− →)∗ if t = ǫ t ⇒= ǫ ∗ t ǫ ∗ (− →) ◦ − → ◦(− →) otherwise where as usual R∗ denote the reflexive and transitive closure of the relation R and ◦ denotes the composition of relations. A.2 Proof of proposition 4 C Given a Vm code C, we define an ‘accessibility relation’ ❀ as the least binary relation on {0, . . . , |C| − 1} such that: C[i] = branch(k) C C (i + k + 1) ❀ j C i❀i i❀j We also introduce a ternary relation R(C, i, K) which relates a Vm code C, a number i ∈ {0, . . . , |C| − 1} and a continuation K. The relation is defined as the least one that satisfies the following conditions. C i ❀ i′ C = C1 · C(S) · C2 i = |C1 | j = |C1 · C(S)| R(C, j, K) R(C, i, S · K) C ′ i❀j C[j] = halt R(C, i, halt) . The following properties are useful. C Lemma 22 (1) The relation ❀ is transitive. C (2) If i ❀ j and R(C, j, K) then R(C, i, K). C The first property can be proven by induction on the definition of ❀ and the second by induction on the structure of K. i Next we can focus on the proposition. The notation C · C ′ means that i = |C|. Suppose that: (S, K, s) → (S ′ , K ′ , s′ ) From (2), we know that there exist C i ❀ i′ (3), i′ and i′ (1) i′′ and R(C, i, S · K) (2) . such that: i′′ C = C1 · C(S) · C2 (4), and R(C, i′′ , K) and from (3) it follows that: ∗ C ⊢ (i, σ, s) → (i′ , σ, s) (3′ ) . We are looking for j such that: ∗ C ⊢ (i, σ, s) → (j, σ, s′ ) (6), 18 and R(C, j, S ′ · K ′ ) (7) . (5) We proceed by case analysis on S. We just detail the case of the conditional command as the the remaining cases have similar proofs. If S = if e1 < e2 then S1 else S2 then (4) is rewritten as follows: i′ a b i′′ c C = C1 · C(e1 ) · C(e2 ).bge(k1 ) · C(S1 ) · branch(k2 ) · C(S2 ) · C2 where c = a + k1 and i′′ = c + k2 . We distinguish two cases according to the evaluation of the boolean condition. We describe the case (e1 < e2 ) ⇓ true. We set j = a. • The instance of (1) is (S, K, s) → (S1 , K, s). ∗ ∗ • The reduction required in (6) takes the form C ⊢ (i, σ, s) → (i′ , σ, s) → (a, σ, s′ ), and it follows from (3′ ), the fact that (e1 < e2 ) ⇓ true, and proposition 3(2). • Property (7), follows from lemma 22(2), fact (5), and the following proof tree: C j❀j C b ❀ i′′ R(C, i′′ , K) R(C, b, K) R(C, j, S1 · K) . ✷ A.3 Proof of proposition 5 We actually prove that for any expression e, statement S, and program P the following holds: (1) For any n ∈ N there is a unique h such that C(e) : h, h(0) = n, and h(|C(e)|) = h(0) + 1. (2) For any S, there is a unique h such that C(S) : h, h(0) = 0, and h(|C(e)|) = 0. (3) There is a unique h such that C(P ) : h. A.4 Proof of proposition 7 (1) By induction on the structure of the command S. (2) By iterating the following proposition. t Proposition 23 If (S, K, s) → (S ′ , K ′ , s′ ) and R(C, i, S · K) with t = ℓ or t = ǫ then t C ⊢ (i, σ, s) ⇒ (j, σ, s′ ) and R(C, j, S ′ · K ′ ). This is an extension of proposition 4 and it is proven in the same way with an additional case for labelled commands. ✷ A.5 Proof of proposition 9 (1) The compilation of the Vm instruction nop(ℓ) is the Mips instruction (nop ℓ). (2) By iterating the following proposition. t Proposition 24 Let C : h be a well formed code. If C ⊢ (i, σ, s) → (j, σ ′ , s′ ) with t = ℓ or t t = ǫ, h(i) = |σ| and m k−σ, s then C ′ (C) ⊢ (p(i, C), m) ⇒ (p(j, C), m′ ) and m′ k−σ ′ , s′ . This is an extension of proposition 6 and it is proven in the same way with an additional case for the nop instruction. ✷ 19 A.6 Proof of proposition 10 We extend the instrumentation to the continuations by defining: I(S · K) = I(S) · I(K) I(halt) = halt . Then we examine the possible reductions of a configuration (I(S), I(K), s[c/cost ]). • If S is an unlabelled statement such as while b do S ′ then I(S) = while b do I(S ′ ) and assuming (b, s) ⇓ true the reduction step is: (I(S), I(K), s[c/cost ]) → (I(S ′ ), I(S) · I(K), s[c/cost ]) . Noticing that I(S) · I(K) = I(S · K), this step is matched in the labelled language as follows: (S, K, s[c/cost ]) → (S ′ , S · K, s[c/cost ]) . • On the other hand, if S = ℓ : S ′ is a labelled statement then I(S) = inc(ℓ); I(S ′ ) and, by a sequence of reductions steps, we have: ∗ (I(S), I(K), s[c/cost ]) → (I(S ′ ), I(K), s[c + κ(ℓ)/cost ]) . This step is matched by the labelled reduction: ℓ (S, K, s[c/cost ]) − → (S ′ , K, s[c/cost ]) . ✷ A.7 Proof of proposition 12 By diagram chasing using propositions 7(1), 9(1), and the definition 11 of labelling. A.8 ✷ Proof of proposition 13 Suppose that: (I(L(P )), s[c/cost ]) ⇓ s′ [c + δ/cost ] and m k−s[c/cost ] . Then, by proposition 10, for some λ: (L(P ), s[c/cost ]) ⇓ (s′ [c/cost ], λ) and κ(λ) = δ . Finally, by propositions 7(2) and 9(2) : (C ′ (C(L(P ))), m) ⇓ (m′ , λ) and m′ k−s′ [c/cost ] . ✷ A.9 Proof of proposition 16 If λ = ℓ1 · · · ℓn then the computation is the concatenation of simple paths labelled with ℓ1 , . . . , ℓn . Since κ(ℓi ) bounds the cost of a simple path labelled with ℓi , the cost of the overall computation is bounded by κ(λ) = κ(ℓ1 ) + · · · κ(ℓn ). ✷ 20 A.10 Proof of proposition 18 Same proof as proposition 16, by replacing the word bounds by is exactly and the words bounded by by exactly. ✷ A.11 Proof of proposition 19 In both labellings under consideration the root node is labelled. An obvious observation is that only commands of the shape while b do S introduce loops in the compiled code. We notice that both labelling introduce a label in the loop (though at different places). Thus all loops go through a label and the compiled code is always sound. To show the precision of the second labelling Lp , we note the following property. Lemma 25 A soundly labelled graph is precise if each label occurs at most once in the graph and if the immediate successors of the bge nodes are either halt (no successor) or labelled nodes. Indeed, in a such a graph starting from a labelled node we can follow a unique path up to a leaf, another labelled node, or a bge node. In the last case, the hypotheses in the lemma 25 guarantee that the two simple paths one can follow from the bge node have the same length/cost. ✷ A.12 Proof of proposition 21 By applying consecutively proposition 13 and propositions 16 or 18. 21 ✷ B A C compiler This section gives an informal overview of the compiler, in particular it highlights the main features of the intermediate languages, the purpose of the compilation steps, and the optimisations. B.1 Clight Clight is a large subset of the C language that we adopt as the source language of our compiler. It features most of the types and operators of C. It includes pointer arithmetic, pointers to functions, and struct and union types, as well as all C control structures. The main difference with the C language is that Clight expressions are side-effect free, which means that side-effect operators (=,+=,++,. . .) and function calls within expressions are not supported. Given a C program, we rely on the CIL tool [13] to deal with the idiosyncrasy of C concrete syntax and to produce an equivalent program in Clight abstract syntax. We refer to the CompCert project [9] for a formal definition of the Clight language. Here we just recall in figure B.1 its syntax which is classically structured in expressions, statements, functions, and whole programs. In order to limit the implementation effort, our current compiler for Clight does not cover the operators relating to the floating point type float. So, in a nutshell, the fragment of C we have implemented is Clight without floating point. B.2 Cminor Cminor is a simple, low-level imperative language, comparable to a stripped-down, typeless variant of C. Again we refer to the CompCert project for its formal definition and we just recall in figure B.2 its syntax which as for Clight is structured in expressions, statements, functions, and whole programs. Translation of Clight to Cminor As in Cminor stack operations are made explicit, one has to know which variables are stored in the stack. This information is produced by a static analysis that determines the variables whose address may be ‘taken’. Also space is reserved for local arrays and structures. In a second step, the proper compilation is performed: it consists mainly in translating Clight control structures to the basic ones available in Cminor. B.3 RTLAbs RTLAbs is the last architecture independent language in the compilation process. It is a rather straightforward abstraction of the architecture-dependent RTL intermediate language available in the CompCert project and it is intended to factorize some work common to the various target assembly languages (e.g. optimizations) and thus to make retargeting of the compiler a simpler matter. We stress that in RTLAbs the structure of Cminor expressions is lost and that this may have a negative impact on the following instruction selection step. Still, the subtleties of instruction selection seem rather orthogonal to our goals and we deem the possibility of retargeting easily the compiler more important than the efficiency of the generated code. 22 Expressions: a ::= id |n | sizeof(τ ) | op1 a | a op2 a | ∗a | a.id | &a | (τ )a | a?a : a variable identifier integer constant size of a type unary arithmetic operation binary arithmetic operation pointer dereferencing field access taking the address of type cast conditional expression Statements: s ::= skip |a=a | a = a(a∗ ) | a(a∗ ) | s; s | if a then s else s | switch a sw | while a do s | do s while a | for(s,a,s) s | break | continue | return a? | goto lbl | lbl : s empty statement assignment function call procedure call sequence conditional multi-way branch “while” loop “do” loop “for” loop exit from current loop next iteration of the current loop return from current function branching labelled statement Switch cases: sw ::= default : s | case n : s; sw default case labelled case Variable declarations: dcl ::= (τ Functions: F d ::= τ id(dcl){dcl; s} | extern τ id(dcl) internal function external function Programs: P ::= dcl; F d∗ ; main = id global variables, functions, entry point id)∗ type and name Figure 1: Syntax of the Clight language 23 Signatures: sig ::= ~ (int|void) sig int arguments and result Expressions: a ::= id |n | addrsymbol(id) | addrstack(δ) | op1 a | op2 a a | κ[a] | a?a : a local variable integer constant address of global symbol address within stack data unary arithmetic operation binary arithmetic operation memory read conditional expression Statements: s ::= skip | id = a | κ[a] = a | id? = a(~a) : sig | tailcall a(~a) : sig | return(a? ) | s; s | if a then s else s | loop s | block s | exit n | switch a tbl | lbl : s | goto lbl empty statement assignment memory write function call function tail call function return sequence conditional infinite loop block delimiting exit constructs terminate the (n + 1)th enclosing block multi-way test and exit labelled statement jump to a label Switch tables: tbl ::= default:exit(n) | case i: exit(n);tbl Functions: F d ::= ~ id ~ ns internal sig id Programs: P ::= | external id sig internal function: signature, parameters, local variables, stack size and body external function prog (id = data)∗ (id = F d)∗ id global variables, functions and entry point Figure 2: Syntax of the Cminor language 24 return type memq ::= instruction ::= ::= int | void int8s | int8u | int16s | int16u | int32 global decl ::= ::= ::= (int →)∗ return type fun ref ::= | skip → node | psd reg := op(psd reg ∗ ) → node | psd reg := &var name → node | psd reg := &locals[n] → node | psd reg := fun name → node | psd reg := memq(psd reg[psd reg ]) → node | memq(psd reg [psd reg ]) := psd reg → node | psd reg := fun ref (psd reg ∗ ) : signature → node | fun ref (psd reg ∗ ) : signature | test op(psd reg ∗ ) → node, node | return psd reg ? fun def init datum signature ::= fun name | psd reg (no instruction) (operation) (address of a global) (address of a local) (address of a function) (memory load) (memory store) (function call) (function tail call) (branch) (return) fun name(psd reg ∗ ) : signature result :psd reg ? locals :psd reg ∗ stack :n entry :node exit :node (node :instruction )∗ reserve(n) | int8(n) | int16(n) | int32(n) var var name{init data} program fun decl ::= ::= init data ::= init datum + extern fun name(signature) | fun def global decl ∗ fun decl ∗ Table 9: Syntax of the RTLAbs language Syntax. In RTLAbs, programs are represented as control flow graphs (CFGs for short). We associate with the nodes of the graphs instructions reflecting the Cminor commands. As usual, commands that change the control flow of the program (e.g. loops, conditionals) are translated by inserting suitable branching instructions in the CFG. The syntax of the language is depicted in table 9. Local variables are now represented by pseudo registers that are available in unbounded number. The grammar rule op that is not detailed in table 9 defines usual arithmetic and boolean operations (+, xor, ≤, etc.) as well as constants and conversions between sized integers. Translation of Cminor to RTLAbs. Translating Cminor programs to RTLAbs programs mainly consists in transforming Cminor commands in CFGs. Most commands are sequential and have a rather straightforward linear translation. A conditional is translated in a branch instruction; a loop is translated using a back edge in the CFG. 25 size instruction ::= ::= Byte | HalfWord | Word fun ref ::= | skip → node | psd reg := n → node | psd reg := unop(psd reg ) → node | psd reg := binop(psd reg , psd reg ) → node | psd reg := &globals[n] → node | psd reg := &locals[n] → node | psd reg := fun name → node | psd reg := size(psd reg [n]) → node | size(psd reg[n]) := psd reg → node | psd reg := fun ref (psd reg ∗ ) → node | fun ref (psd reg ∗ ) | test uncon(psd reg ) → node, node | test bincon(psd reg, psd reg ) → node, node | return psd reg? fun def ::= fun name(psd reg ∗ ) result :psd reg ? locals :psd reg ∗ stack :n entry :node exit :node (node :instruction)∗ program fun name | psd reg (no instruction) (constant) (unary operation) (binary operation) (address of a global) (address of a local) (address of a function) (memory load) (memory store) (function call) (function tail call) (branch unary condition) (branch binary condition) (return) ::= globals : n fun def ∗ Table 10: Syntax of the RTL language B.4 RTL As in RTLAbs, the structure of RTL programs is based on CFGs. RTL is the first architecturedependant intermediate language of our compiler which, in its current version, targets the Mips assembly language. Syntax. RTL is very close to RTLAbs. It is based on CFGs and explicits the Mips instructions corresponding to the RTLAbs instructions. Type information disappears: everything is represented using 32 bits integers. Moreover, each global of the program is associated to an offset. The syntax of the language can be found in table 10. The grammar rules unop, binop, uncon, and bincon, respectively, represent the sets of unary operations, binary operations, unary conditions and binary conditions of the Mips language. Translation of RTLAbs to RTL. This translation is mostly straightforward. A RTLAbs instruction is often directly translated to a corresponding Mips instruction. There are a few exceptions: some RTLAbs instructions are expanded in two or more Mips instructions. When the translation of a RTLAbs instruction requires more than a few simple Mips instruction, it is translated into a call to a function defined in the preamble of the compilation result. B.5 ERTL As in RTL, the structure of ERTL programs is based on CFGs. ERTL explicits the calling conventions of the Mips assembly language. 26 size instruction ::= ::= Byte | HalfWord | Word fun ref ::= | skip → node | NewFrame → node | DelFrame → node | psd reg := stack[slot , n] → node | stack[slot , n] := psd reg → node | hdw reg := psd reg → node | psd reg := hdw reg → node | psd reg := n → node | psd reg := unop(psd reg ) → node | psd reg := binop(psd reg , psd reg ) → node | psd reg := fun name → node | psd reg := size(psd reg [n]) → node | size(psd reg[n]) := psd reg → node | fun ref (n) → node | fun ref (n) | test uncon(psd reg ) → node, node | test bincon(psd reg, psd reg ) → node, node | return b fun def ::= fun name(n) locals :psd reg ∗ stack :n entry :node (node :instruction)∗ program fun name | psd reg (no instruction) (frame creation) (frame deletion) (stack load) (stack store) (pseudo to hardware) (hardware to pseudo) (constant) (unary operation) (binary operation) (address of a function) (memory load) (memory store) (function call) (function tail call) (branch unary condition) (branch binary condition) (return) ::= globals : n fun def ∗ Table 11: Syntax of the ERTL language Syntax. The syntax of the language is given in table 11. The main difference between RTL and ERTL is the use of hardware registers. Parameters are passed in specific hardware registers; if there are too many parameters, the remaining are stored in the stack. Other conventionally specific hardware registers are used: a register that holds the result of a function, a register that holds the base address of the globals, a register that holds the address of the top of the stack, and some registers that need to be saved when entering a function and whose values are restored when leaving a function. Following these conventions, function calls do not list their parameters anymore; they only mention their number. Two new instructions appear to allocate and deallocate on the stack some space needed by a function to execute. Along with these two instructions come two instructions to fetch or assign a value in the parameter sections of the stack; these instructions cannot yet be translated using regular load and store instructions because we do not know the final size of the stack area of each function. At last, the return instruction has a boolean argument that tells whether the result of the function may later be used or not (this is exploited for optimizations). Translation of RTL to ERTL. The work consists in expliciting the conventions previously mentioned. These conventions appear when entering, calling and leaving a function, and when referencing a global variable or the address of a local variable. Optimizations. A liveness analysis is performed on ERTL to replace unused instructions by a skip. An instruction is tagged as unused when it performs an assignment on a register that will not be read afterwards. Also, the result of the liveness analysis is exploited by 27 size instruction ::= ::= Byte | HalfWord | Word fun ref ::= | skip → node | NewFrame → node | DelFrame → node | hdw reg := n → node | hdw reg := unop(hdw reg ) → node | hdw reg := binop(hdw reg, hdw reg ) → node | hdw reg := fun name → node | hdw reg := size(hdw reg[n]) → node | size(hdw reg [n]) := hdw reg → node | fun ref () → node | fun ref () | test uncon(hdw reg) → node, node | test bincon(hdw reg , hdw reg ) → node, node | return fun def ::= fun name(n) locals :n stack :n entry :node (node :instruction)∗ program fun name | hdw reg (no instruction) (frame creation) (frame deletion) (constant) (unary operation) (binary operation) (address of a function) (memory load) (memory store) (function call) (function tail call) (branch unary condition) (branch binary condition) (return) ::= globals : n fun def ∗ Table 12: Syntax of the LTL language a register allocation algorithm whose result is to efficiently associate a physical location (a hardware register or an address in the stack) to each pseudo register of the program. B.6 LTL As in ERTL, the structure of LTL programs is based on CFGs. Pseudo registers are not used anymore; instead, they are replaced by physical locations (a hardware register or an address in the stack). Syntax. Except for a few exceptions, the instructions of the language are those of ERTL with hardware registers replacing pseudo registers. Calling and returning conventions were explicited in ERTL; thus, function calls and returns do not need parameters in LTL. The syntax is defined in table 12. Translation of ERTL to LTL. The translation relies on the results of the liveness analysis and of the register allocation. Unused instructions are eliminated and each pseudo register is replaced by a physical location. In LTL, the size of the stack frame of a function is known; instructions intended to load or store values in the stack are translated using regular load and store instructions. Optimizations. A graph compression algorithm removes empty instructions generated by previous compilation passes and by the liveness analysis. 28 size instruction ::= ::= Byte | HalfWord | Word fun ref | NewFrame | DelFrame | hdw reg := n | hdw reg := unop(hdw reg ) | hdw reg := binop(hdw reg, hdw reg ) | hdw reg := fun name | hdw reg := size(hdw reg[n]) | size(hdw reg [n]) := hdw reg | call fun ref | tailcall fun ref | uncon(hdw reg ) → node | bincon(hdw reg, hdw reg ) → node | mips label : | goto mips label | return fun def ::= fun name(n) locals :n instruction ∗ program ::= fun name | hdw reg (frame creation) (frame deletion) (constant) (unary operation) (binary operation) (address of a function) (memory load) (memory store) (function call) (function tail call) (branch unary condition) (branch binary condition) (Mips label) (goto) (return) ::= globals : n fun def ∗ Table 13: Syntax of the LIN language B.7 LIN In LIN, the structure of a program is no longer based on CFGs. Every function is represented as a sequence of instructions. Syntax. The instructions of LIN are very close to those of LTL. Program labels, gotos and branch instructions handle the changes in the control flow. The syntax of LIN programs is shown in table 13. Translation of LTL to LIN. This translation amounts to transform in an efficient way the graph structure of functions into a linear structure of sequential instructions. B.8 Mips Mips is a rather simple assembly language. As for other assembly languages, a program in Mips is a sequence of instructions. The Mips code produced by the compilation of a Clight program starts with a preamble in which some useful and non-primitive functions are predefined (e.g. conversion from 8 bits unsigned integers to 32 bits integers). The subset of the Mips assembly language that the compilation produces is defined in table 14. Translation of LIN to Mips. This final translation is simple enough. Stack allocation and deallocation are explicited and the function definitions are sequentialized. B.9 Benchmarks To ensure that our prototype compiler is realistic, we performed some preliminary benchmarks on a 183MHz MIPS 4KEc processor, running a linux based distribution. We compared the 29 load ::= lb | lhw | lw instruction ::= store ::= sb | shw | sw | nop | li hdw reg , n | unop hdw reg , hdw reg | binop hdw reg, hdw reg, hdw reg | la hdw reg , fun name | load hdw reg, n(hdw reg) | store hdw reg , n(hdw reg ) | call fun ref | uncon hdw reg , node | bincon hdw reg , hdw reg , node | mips label : | j mips label | return program ::= fun ref ::= fun name | hdw reg (empty instruction) (constant) (unary operation) (binary operation) (address of a function) (memory load) (memory store) (function call) (branch unary condition) (branch binary condition) (Mips label) (goto) (return) globals : n entry : mips label ∗ instruction ∗ Table 14: Syntax of the Mips language badsort fib mat det min quicksort search gcc -O0 55.93 76.24 163.42 12.21 27.46 463.19 acc 34.51 34.28 156.20 16.25 17.95 623.79 gcc -O1 12.96 45.68 54.76 3.95 9.41 155.38 Figure 3: Benchmarks results (execution time is given in seconds). 30 wall clock execution time of several simple C programs compiled with our compiler against the ones produced by Gcc set up with optimization levels 0 and 1. As shown by Figure 3, our prototype compiler produces executable programs that are on average faster than Gcc’s without optimizations. 31
6cs.PL
A Novel Fault Classification Scheme Based on Least Square SVM H.C. Dubey1, A.K. Tiwari2, Nandita3, P.K. Ray4, S.R. Mohanty2 and Nand Kishor2 Abstract-- This paper presents a novel approach for fault classification and section identification in a series compensated transmission line based on least square support vector machine. The current signal corresponding to onefourth of the post fault cycle is used as input to proposed modular LS-SVM classifier. The proposed scheme uses four binary classifier; three for selection of three phases and fourth for ground detection. The proposed classification scheme is found to be accurate and reliable in presence of noise as well. The simulation results validate the efficacy of proposed scheme for accurate classification of fault in a series compensated transmission line. Index Terms-- Digital relaying, distance relay, fault classification, least square-support vector machine, modular classifier, series compensated transmission line. I. INTRODUCTION T ransmission lines are protected by digital relays which operate accurately and reliably as compared to their solid state counterparts. Digital relay are invariably based on signal processing techniques. Faults occurring in transmission lines need to be detected, classified, and located fastly and accurately for keeping faulty part isolated from the healthy part thereby, ensuring minimum damage and disturbance. The speed, accuracy and reliability of digital protective relays are dependent on underlying techniques used in design. Fault classification task is an important task after the detection of fault for isolating the faulty section from healthy one, thus reducing damages to power systems [1]-[2]. The FACTS employed in modern power system achieve enhancement in transmittable power, improvement in the system stability, reduction in transmission losses and more flexibility in power control. On the other hand, 1 Harish Chandra Dubey is with the Department of Electronics and Communication Engineering, Motilal Nehru National Institute of Technology, Allahabad-211004, INDIA (e-mail: [email protected] ). 2 Ashutosh Kumar Tiwari, Soumya Ranjan Mohanty and Nand Kishor are with the Department of Electrical Engineering, Motilal Nehru National Institute of Technology, Allahabad-211004, INDIA(e-mail: aktiwari@ieee .org , [email protected], [email protected] ). 3 Nandita received the Bachelor of Technology degree in Electronics and Communication Engineering from Birla Institute of Technology (BIT), Mesra-814142, INDIA (email: [email protected]). 4 Prakash Kumar Ray is with the Department of Electrical and Electronics Engineering, International Institute of Information Technology, Bhubaneswar- 751003, INDIA (email: [email protected]). presence of FACTS devices like TCSC complicates the protection task because [1, 2]: the metal oxide varistor (MOV) is employed for protection of the series capacitor from over-voltage during faulty situations. However, it acts non-linearly during faults and increases the complexity of the protection problem. Due to resonance between the system inductance and series capacitor, non fundamental decaying components as well as decaying DC components are present in the voltage and current signals. Odd harmonics are due to MOV conduction during faults and sub-synchronous frequencies having frequency components varying around half the fundamental frequency value, high frequency components (which results from resonance between line capacitance and line inductance) are present in addition to fundamental components of the steady state fault current. Thus, these signals are not processed very accurately with conventional methods such as full cycle DFT/half cycle DFT (FCDFT/HCDFT) or least square error (LSE) technique; thereby cause large error in estimation of the fundamental phasor. In light of these issues, the fault classification task is complicated in the presence of TCSC [3]-[4]. Techniques based on fuzzy logic, adaptive Kalman filtering, neural network, wavelet transform and support vector machine have been addressed in research studies for fault classification task [5-14]. In [5], Kalman filtering based technique has been used for fault classification task. However, the validity of the proposed method had been tested on a limited number of test cases. Classification technique based on artificial neural network (ANN) in a series compensated transmission lines is addressed in [6]-[8]. However, ANN involves empirical risk minimization and suffers from drawbacks like over fitting and trapping in local minima. Further in [6]-[8], the performance of the classification schemes have not been investigated over extensive test cases and the compensation level was kept constant. In [9]-[10], authors have suggested classification schemes based on wavelet transformation. Also, in [9]-[10], the proposed technique was validated only for limited cases. Some techniques based on fuzzy logic have also been presented for fault classification applications in [11][13]. A hybrid approach based on wavelet transform and fuzzy logic is proposed in [11]-[12]. Combination of fuzzy logic and higher order statistics (HOS) has been investigated in [13] for classification task considering a wide variation in the system conditions. Recently, support vector machine (SVM) based technique has been proposed for fault classification [14]-[17]. This material is presented to ensure timely dissemination of scholarly and technical work. Copyright and all rights therein are retained 978-1-4673-0455-9/12/$31.00 ©2012 by the authors or by the respective copyright holders. IEEE The original citation of this paper is: Harishchandra Dubey, A. K. Tiwari, Nandita, P. K. Ray, S. R. Mohanty and N. Kishor, "A novel fault classification scheme based on least square SVM," Engineering and Systems (SCES), 2012 Students Conference on, Allahabad, Uttar Pradesh, 2012, pp. 1-5. DOI: 10.1109/SCES.2012.6199047 The presence of FACTS devices in transmission line influence pre-fault as well as post-fault current signals thereby making the task of fault classification a complicated one. In spite of research studies done, fault classification in series compensated transmission lines still remains a challenge in terms of accurate and reliable classification with reduced computational burden and number of data sets for sake of online implementation. One of the most promising approach used for fault classification applications in a transmission line as reported [13, 15] is SVM. SVMs are classifiers based on structural risk minimization. An improved version of SVM is least square SVM (LSSVM) that retains all advantages of SVM with lesser computational burden. This paper proposes a novel scheme for accurate classification of faults in a series compensated transmission line based on LSSVM classifier using modular topology. The use of modular topology reduces the computational burden and time complexity of the proposed classification technique. The novelty of the work is three fold. First, the fault classification is studied in a series compensated transmission line rather a normal transmission line. Second, the introduction of LSSVM is new to fault classification task. Third, the modular topology of binary LSSVM classifier improves the performance. The proposed classifier is trained with input and output data-sets generated using Simulink model of studied power system in MATLAB environment. The rest of the paper is presented as follows; the LSSVM is briefly described in section II, proposed scheme is discussed in section III, followed by simulation and results in section IV. Finally, conclusions based on simulation results are given in section V. N y(x) = ∑α K (x, x )+b k f k (1) k=1 The optimal separation of hyperplane is shown in Fig.1. LSSVM aims to build a classifier which is chracterized by following optimization problem: 1 T 1 N 2 ( , , ) J w b e = w w + γ ∑ek LS min 2 2 k =1 w,b,e (2) Subject to the equality constraints yk = wT xk +b+ek ,k =1",2,...,n (3) Where ek are slack variable and γ is a positive real constant known as regularization parameter. The parameter γ > 0 determines the trade-off between fitting error minimization and smoothness. II. LEAST SQUARE SUPPORT VECTOR MACHINE Support vector machines (SVMs) are statistical learning systems based on structural risk minimization used for pattern recognition. But, the computational complexity of SVMs is related to the number of training samples. As the sample size increases, the solution of the corresponding quadratic programming problem becomes complex resulting in slow computing speed. Least square SVM (LSSVM) is an improvement over SVM without losing its advantages [18]-[19]. LSSVM technique for classification and non-linear regression are characterized by linear Karaush-Kuhn-Tucker (KKT) systems [19]. Sparseness can be imposed in LSSVM using pruning as known in NNs. Non-linear SVM for classification and regression problems involves convex quadratic programming. The LSSVM as a classifier differs from conventional SVM in two ways; firstly it uses equality constraints and secondly, a squared loss function is taken as error variable [19]. Given a training data set of N points ( xk , yk ) , k=1,2,…,n where xk ∈ Rn is the k-th input data-set and yk ∈ R is the k-th output data-set. The SVM based classifier involves a decision function which is given by y = wT x + b . Using the kernel function, the non-linear SVM becomes: Fig.1 The optimal hyperplane of the binary classifier The lagrangian involved in the optimization problem is T Lwbea +γ ( , , ; )=ww 1n 2 n ei −∑ai (wTϕ(xi )+b+ei −yi ) ∑ 2 i=1 i=1 (4) Where ai ∈ R N , i = 1, 2,.., n are Lagrange multipliers. The conditions for optimality are given by: n ⎧∂L ⎫ ⎪ = o; gives; w = ∑ aiϕ(xi ) ⎪ ⎪∂w ⎪ i =1 ⎪ ⎪ n ⎪∂L = 0; gives; ∑ a = 0 ⎪ i ⎪∂b ⎪ i =1 ⎪ ⎪ ⎪∂L ⎪ 0; ; , 1,2,3,..., = = = γ gives a e i n ⎨ ⎬ i i ⎪∂b ⎪ ⎪ ∂L ⎪ T ⎪∂e = 0; gives;b = yi − w ϕ(xi ) − ei;i =1,2,3,.., n⎪ ⎪ i ⎪ ⎪ ∂L ⎪ ⎪ =0 ⎪ ⎪∂ai ⎪ ⎩ ⎭ (5) The solution of eqn. (5) is obatined as: →T ⎞ ⎛ 1 ⎟⎛b⎞ ⎛ 0⎞ ⎜0 ⎜→ ⎟⎜a⎟ = ⎜ y⎟ 1 − ⎟⎝ ⎠ ⎝ ⎠ ⎜ ⎝ 1 Ω+γ 1⎠ (6) → a = [a1, a2 , a3 ,..., an ] (7) Ωij = ϕ ( xi ) ϕ ( x j ) = K f ( xi , x j ); i, j = 1,2,3,..., n (8) 1 = [1,1,1,...,1]T , T The classifier based on LS-SVM model is then constructed as follows: 1 1 n min wT w + γ ∑ei2 a,b,e 2 2 i=1 such that ei = yi − (wTφ(xi ) + b), 3 4 5 6 7 8 9 10 -1 1 1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 1 1 -1 1 1 1 -1 1 1 1 1 1 1 1 -1 -1 -1 B-G R-Y-G R-B-G Y-B-G R-Y- B-G R-Y R-B Y-B The outputs of four modules of binary classifiers are used for deciding fault type as according to Table I. Here, +1 represents the involvement of phase or ground in fault and -1 represents its absence. The binary LSSVM classifier are combined to form a modular network of four binary classifier, thus forming a multi-class classifier to discriminate between R-G, RY, RY-G, RYB and RYB-G faults. A. LSSVM for section identification (9) i =1,2,3,..., n The feature vector φ ( x) is known by means of the positive definite kernel function. The kernel function are required to satisfy Mercer’s condition, which implies that K f (xk , x j ) = Φ(xk )T Φ(x j ) Identification of faulty section is also necessary with fault classification in a series compensated transmission line. Due to presence of FACTS devices the apparent impedance of the transmission changes and hence just after the midpoint and just before that there is a significant change in current, so the section having fault must be identified. (10) The kernel function which are commonly used are linear, polynomial radial basis function (RBF) and multi-layer perceptron (MLP). The selection of regularization parameter γ and the kernel parameter σ 2 is very important for the classifiers. This work uses grid-search to decide appropriate regularization parameter γ and the kernel parameter σ 2 . Grid-search is easy and direct as each pairparameter J,V is independent and it can be sorted in parallel. This classifier finds the optimal parameters in the objective function with cross-validation until the best parameters with high precision are found. Fig.2 Proposed LSSVM based classification scheme III. PROPOSED SCHEME TABLE II This section presents the application LSSVM to develop the modular multiclass classifier [20]. The block diagram of proposed scheme for fault classification and section identification is shown in Fig.2. The LSSVM based classifier are found to perform better when trained on lesser data sets thus enabling better accuracy with lesser training data sets [18]-[19]. TABLE I FAULT TYPE IDENTIFICATION S.No. 1 2 Output of LS SVM-R 1 -1 Output of LSSVM-Y -1 1 Output of LSSVM-B -1 -1 Output of LSSVM-G 1 1 Type of fault R-G Y-G TESTING OF LSSVM-S FOR SECTION IDENTIFICATION Fault Kernel Classification Poly RBF Parameter Value 1.3269 0.208 RY fault at 25%, FIA=135o, LA=40o, Rf= 60 ohm RB-G fault at 30%, FIA=175o , LA=30o, Rf= 80 ohm RYB-G fault at 75%,FIA=120o , A=65o, Rf = 80 ohm YB-G fault at 90%, FIA= 95 o LA=55o, Rf= 100 ohm Poly RBF 1.322 0.206 1 1 Poly RBF 1.440 0.220 1 -1 Poly RBF 1.389 0.276 1 -1 1 1 RB fault at 30%, FIA=110 o LA=45o , Rf= 85 ohm RYB fault at 10%, FIA=125o LA=55 o, Rf= 80 ohm Poly RBF 1.889 0.250 1 1 Poly RBF 1.888 0.246 1 1 Section identification is accomplished byy training the LSSVM-S to build an optimized classifierr. The current samples corresponding to one-fourth cyclee of post fault current are fed as input to the LSSVM-S andd the output is +1 (before series capacitor) or -1 (after serries capacitor). The training is done using 208 data sets and tthe accuracy of identification is tested over 916 datasets. The average classification rate for section identification foor 916 data sets is found to be 97.25 % for all fault tyypes which is reasonably good. Table II depicts the resuults for section identification with proposed approoach. Also, misclassification is observed for the RYB-G G fault at 75%, FIA=120o, LA=65o, Rf=80ohm, Poly misclasssifies showing the output as 1.Other cases shown in Table III shows correct identification. IV. SIMULATION STUDIES A three phase transmission line of 2250 km length, 230 kV, 50 Hz connecting two systems w with MOV and series capacitor kept at midpoint of line as sshown in Fig.3 is used for testing of proposed scheme. T The model of transmission system with TCSC shown in F Fig.3 has been simulated using MATLAB/Simulink enviironment. The various parameters of transmission line used for simulation are given in Table III. The post-fault currrent signal is retrieved at the relaying end bus A and used ffor recognition of fault events. The sampling rate used iis 1.0 kHz at nominal frequency 50 Hz, thus giving 200 samples per cycle. Bus A CT MOV Relay Air-gap (uF/km m) Series compensated MOV Current transformer (CT) 70 % C =178.54 of 40 kV 5 MJ 230kV V, 50 Hz, 2000:1 turns ratio To demonstrate the potential of the t proposed approach, all ten cases of fault event are simullated. The data-set consists of 916 test cases comprising all the t ten types of faults with varying fault resistances, differeent fault inception angles, different source impedance valuees, different fault positions, different percentage compensatio on levels for validation of proposed approach. Fig.4 shows the t current signals of three phases in case of R-G fault with h fault resistance 50 ohm and fault inception angle off 50 degree with 50% compensation level. D V. RESULTS AND DISCUSSIONS The classification acccuracy of LSSVM-R classifier with RBF kernel as fun nction of two parameters is shown in Fig.6. There is no signiificant change observed in accuracy as these parameters are a varied. The proposed LSSVM based classifier perform ms consistently well and gives accurate classification for fo all fault types. This suggests the efficacy of prroposed technique. The classification accuracy indicates the average performance obtained by different types of keernel functions used in the proposed scheme. Fig.6 show ws overall classification accuracy of the proposed technique which again supports its utility in fault classification tassk. Buss B C Source 1 Source 2 Fig.3 Series compensated transmission line Fig.4 Current signal for the R-G fault TABLE III System voltage System frequency Voltage of source 1 Voltage of source 2 Transmission line length Positive sequence Zero sequence 230 kV 50 Hz 1.0 0 degree pu 1.0 ∠ 20 degree pu 250 km R = 0.0368 (ohm/km m), L = 0.55(mH/km), C = 00.028 (uF/km) R = 0.0328 (ohm/km m), L=1.722 (mH/km), C = 0.024 100.5 Classification accuracy PARAMETERS OF THE SIMULATED TRANSMIISSION LINE 100 99.5 99 98.5 98 0 10 20 2 30 Regularization parameter (a) Regularization parameter, γ 40 Classification accuracy [5] 99.2 99 98.8 98.6 98.4 98.2 98 97.8 [6] [7] 0 0.1 0.2 0.3 [8] Kernel parameter (b) Kernel parameter, [9] Classification accuracy of LSSVM-R classifier with RBF Kernel Overall classification accuracy Fig.5 σ2 [10] 97.9 97.8 [11] 97.7 97.6 [12] 97.5 [13] Fault type [14] [15] Fig.6 Classification accuracy of the proposed scheme VI. CONCLUSION The present paper investigates a nnovel approach for fault classification and section identificattion in a series compensated transmission line. The propossed scheme is based on a modular network consisting oof four binary LSSVM classifiers. The proposed classifier hhas been tested under various system changing conditionns. One-fourth cycle of post-fault current samples are useed as input by classification scheme. Simulation result validates the consistency and accuracy of proposed schem me. It is found that LSSVMs require lesser training sets for most optimized classification with less numbeer of training samples compared to the neural network annd neuro-fuzzy systems. Hence the proposed method is compparatively fast, accurate and robust for the protection of transsmission line. REFERENCES [1] [2] [3] [4] A.G.Phadke, J.S.Thorp, “Computer Relaying forr Power Systems”, Second edition, Wiley-IEEE press, Sept. 2009 ((ISBN: 978-0-47005713-1). Applications”, 2nd W.A.Elmore, “Protective Relaying Theory and A Edition, Marcel Dekker, New York, 2003. M.Khederzadeh, T.S.Sidhu, “Impact of TCSC onn the protection of transmission lines”, IEEE Trans. Power Del., voll. 21,no.1, pp. 80– 87, 2006. M.Noroozian, L.Angquist, M.Ghandhari, G.Andderson, “Improving power system dynamics by series connected FACTS devices”, IEEE Trans. Power Del., vol.12,no.4, pp. 1635–16641, 1997. [16] [17] [18] [19] [20] ntation of Kalman and adaptive A.A.Girgis, D.G.Hart,“Implemen Kalman filtering algorithms for digital distance protection on a vector signal processor”, IEEE Trans. T Power Del., vol. 4, no.1, pp.141-156, Jan.1989. ns, R.Morgan, D.Williams, Q.Y.Xuan,Y.H.Song, A.T.John Performance of an adaptive protection scheme for series compensated EHV transmission systems using neural networks. Electric Power Systems Research, vol.36, no.1, pp.57-66,1996. Y.H.Song, A.T.Johns, Q.Y.Xuan, “Artificial neural network based protective scheme for controllaable series compensated EHV transmission lines”, IET Gener. Transm. Distrib., vol.143, no.6, pp.535–540,1996. A.Y.Abdelaziz,A.M.Ibrahim, M.Mansour, H.E.Talaat, “Modern approaches for protection of seeries compensated transmission lines”, Electric Power Systems Research, R vol.75, no.1, pp.85-98, 2005. A.I.Megahed, M.A.Monem, A.E E.Bayoumy,”Usage of wavelet transform in the protection of series-compensated s transmission lines”, IEEE Trans. Power Del.,voll.21,no.3,pp.1213-1221,2006. P.K.Dash, S.R.Samantray, “Phasse selection and fault section identification in thyristor controlleed series compensated line using discrete wavelet transform”, Electrical Power and Energy Systems vol.26, no.9,pp.725-732, 2004. M.J.Reddy, D.K.Mohanta, “A waavelet-fuzzy combined approach for classification and location of traansmission line faults”, Electrical Power and Energy Systems, vol.29 9, no.9, pp.669-678, 2007. A.K.Pradhan, A.Routray, D.K.Praadhan, “Wavelet fuzzy combined approach for fault classificatiion of a series-compensated transmission line”, IEEE Trans. Po ower Del., vol.19, no.4, pp.16121620, 2004. A.K.Pradhan, A.Routray, B.Biswaal, “Higher order statistics–fuzzy integrated scheme for fault classifi fication of a series compensated line”, IEEE Trans Power Del., Voll.19, no.2, pp.891-893, 2004. P.K.Dash, S.R.Samantaray, G.Paanda, “Fault classification and section identification of an advanced series-compensated transmission line using support vector machine”, IEEE Trans. Power Del., vol.22, no.1,pp.67–73,, 2007. B.Ravikumar, D.Thukaramand, H.P.Khincha, “Application of support vector machines for fault diagnosis in power transmission system”, IET Gener. Transm. Diistrib., vol. 2, no.1,pp.119–130, 2008. U.B.Parikh, B.Das, and R.P.Maaheshwari, “Combined waveletSVM technique for fault zone deetection in a series compensated transmission line”, IEEE Trans. Power Del., vol.23, no. 4, pp. 1789-1794, Oct. 2008. U.B.Parikh, B.Das, and, R.P.Maheshwari, “Fault classification technique for series compensated transmission line using support vector machine”, Electrical Power and Energy Systems 32(2010) 629–636. J.A.K.Suykens, L.Lukas, P.V.Dooren, B.deMoor and J. ort vector machine classifiers: A Vandewalle, “Least square suppo large scale algorithm,” Neural Prrocess. Lett.,vol.9, pp. 293-300, 1999. D.Brabanter, B.DeMoor, and J.A.K.Suykens, T.V.Gestel, J.D J.Vandewalle, “Least square suppo ort vector machine”. First edition, World Scientific, Singapore, 2002 (ISBN 981-238-151-1). position and module combination Lu BL, and M. Ito, “Task decomp based on class relations: a modu ular neural network for pattern classification,” IEEE Trans. on Neural Networks, vol. 10, pp. 12241255, 1999.
3cs.SY
1 Stochastic Control of Computation Offloading to a Helper with a Dynamically Loaded CPU arXiv:1802.10011v1 [cs.IT] 27 Feb 2018 Yunzheng Tao, Changsheng You, Ping Zhang, and Kaibin Huang Abstract Due to densification of wireless networks, there exist abundance of idling computation resources at (network) edge devices (e.g., access points and handheld computers). These resources can be scavenged by offloading heavy computation tasks from small IoT devices (e.g., sensors and wearable computing devices) in proximity, thereby overcoming their limitations and lengthening their battery lives. However, unlike dedicated servers, the spare resources offered by edge helpers are random and intermittent. Thus, it is essential for a user (IoT device) to intelligently control the amounts of data for offloading and local computing so as to ensure a computation task can be finished in time consuming minimum energy. In this paper, we design energy-efficient control policies in a computation offloading system with a random channel and a helper with a dynamically loaded CPU (due to the primary service). Specifically, the policy adopted by the helper aims at determining the sizes of offloaded and locally-computed data for a given task in different slots such that the total energy consumption for transmission and local CPU is minimized under a task-deadline constraint. As the result, the polices endow an offloading user robustness against channel-and-helper randomness besides balancing offloading and local computing. By modeling the channel and helper-CPU as Markov chains, the problem of offloading control is converted into a Markov-decision process. Though dynamic programming (DP) for numerically solving the problem does not yield the optimal policies in closed form, we leverage the procedure to quantify the optimal policy structure and apply the result to design optimal or sub-optimal policies. For different cases ranging from zero to large buffers, the low-complexity of the policies overcomes the “curse-of-dimensionality” in DP arising from joint consideration of channel, helper CPU and buffer states. I. I NTRODUCTION Mobile edge computing has emerged as a promising technology for realizing the vision of Internet of Things (IoT) by reducing computation latency and energy consumption of IoT devices. Y. Tao and P. Zhang are with the State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications, Beijing 100876, China. C. You and K. Huang are with the Department of Electrical and Electronic Engineering, The University of Hong Kong, Hong Kong. Corresponding author: K. Huang (Email: [email protected]). 2 These advantages are achieved by mobile-edge computation offloading (MECO), a primary operation of edge computing, that offloads complex computation from small IoT devices to nearby edge helpers (or servers) such as access points (APs) and smartphones [1], [2]. Among edge helpers, while some are dedicated servers, others provide edge computing opportunistically as a secondary service without affecting their primary functions. For example, the primary function of a base station is to support radio access and networking and that of a smartphone is personal computing. In other words, only when not performing the primary function, an opportunistic helper offers its idling CPU for the intermittent use by an offloading user. Then from the perspective of an offloading user, an opportunistic helper appears to be one with a dynamically loaded CPU. The randomness in both the available computing resources and wireless channel requires a user to adapt the offloading process to the states of the helper and channel. Specifically, by observing the states, the user should control 1) the size of input-data for a particular task to be computed in the current slot and 2) its partitioning for computing “remotely” and “locally”, such that the task can be completed in time with the minimum energy consumption. In this paper, we study this complex problem of optimal MECO control using stochastic optimization theory. A. Prior Works 1) Mobile-edge computation offloading: MECO is a key enabler for a wide range of computationintensive and latency-sensitive mobile applications, such as augmented/virtual reality, highdefinition video streaming and online gaming. This drives growing research interests in both the academia and industry to design efficient computation-offloading systems and techniques [3]– [7]. For single-user MECO systems, the energy-efficient binary offloading was investigated in [3] where the CPU-cycle frequency and offloading rates were optimized for reducing the energy consumption of local computing and offloading, respectively. This work was extended in [4] by powering MECO with wireless energy. Subsequently, partial offloading allowing more flexible offloading than binary offloading has been designed for enhancing the performance of energy savings and latency reduction using diverse techniques such as adaptive program partitioning [5], [6] and live prefetching based on computation prediction [7]. For multiuser MECO systems, the radio-and-computational resource management has been intensively investigated [8]–[11]. Specifically, an optimization problem was formulated in [8] to minimize the weighted sum userenergy consumption. The derived optimal centralized resource-allocation policy is shown to have 3 a simple threshold-based structure. Moreover, the distributed energy-efficient resource-allocation for multiuser MECO systems was studied in [9], [10] by using game theory and decomposition techniques, respectively. In addition, an energy-efficient multiuser MECO scheduling policy was proposed in [11] by assigning different mobiles with diverse levels of priorities based on their latency requirements. Last, the latency performance of large-scale MECO networks was analyzed in [12] using stochastic geometry. Recently, peer-to-peer (P2P) computation offloading between mobile devices has emerged to be an active research area [13]–[19]. The technology can enhance the computing capabilities of mobiles by sharing as well as equalizing the uneven distribution of computation workloads and computation resources over heterogeneous devices. Specifically, an energy-efficient peer computation offloading framework was proposed in [13], where mobiles cooperatively compute tasks and share computation results to balance the energy consumption of mobile users. From the perspective of wireless transmission, P2P computation offloading can be implemented by device-to-device (D2D) communications [14]–[16]. The interplay between user incentives and interdependent security risks in D2D offloading was investigated in [17] by leveraging tools from game theory and epidemic theory. Last, a protocol for helper-assisted computation offloading to a central cloud was proposed in [18] and designed for maximizing user energy efficiency via the energy-efficient joint computation-and-communication control. All of the above prior works assume dedicated helpers or servers (see e.g., [8], [16]). This, however, overlooks the fact that many helpers in practice are opportunistic since their primary functions are not edge computing. Recently, computation offloading to an opportunistic helper was studied in [19] where the user exploits non-causal information on the helper-CPU state to control offloaded data sizes in different slots. Computation prediction for acquiring such information may not be accurate in practice and furthermore places an extra burden on the CPU. In this work, the offloading is controlled instead based on the distribution of the dynamic helper CPU, as such information can be easily inferred from historical data. The corresponding optimal control policy can be derived using stochastic optimization theory. 2) Stochastic computation offloading: The stochastic control of MECO has been extensively studied in the literature targeting a time-varying channel [20]–[26]. In the area of wireless communications, energy-efficient data transmission over dynamic channels under a deadline constraint is a classic topic where the optimal policies can be typically computed using dynamic programming (DP) assuming the Markov-chain channel models (see e.g., [27]). However, for 4 stochastic control of computation offloading, the policy design is more complicated as it requires the joint control of local computing and offloading (transmission), accounting for different types of dynamics arising in channels, computation tasks and helper CPUs. The challenge has been tackled recently by a series of research [20]–[26]. In [20], considering the joint mobile-andcloud task scheduling, the problem of optimal offloading control is formulated as a shortest path problem and solving it reveals the “one-climb” policy structure (i.e., the tasks should only migrate at most once between the mobile and the cloud). In the presence of random channel and computation-data arrivals, a stochastic offloading algorithm for controlling offloading decision and rate was designed in [21] using the approach of Markov decision process (MDP). Accounting for different task-call graphs, a set of online task offloading algorithms were proposed in [22] to minimize the completion time for sequential or concurrent tasks. Another line of research assumes that only the instantaneous information (e.g., random channel, data arrival and renewable energy) is available at the user and applies the Lyapunov optimization techniques to design the control policies for controlling computation offloading [23], [24], integrated with the CPU-frequency control for local computing [25] or server on/off switching [26]. Again, the prior works assume dedicated edge servers and do not consider opportunistic helpers that widely exist in practice. Accounting for the corresponding randomness in computation resources in addition to channel dynamics complicates the stochastic offloading control. This work thus aims to bridge this gap by investigating stochastic offloading control targeting both dynamic channel and dynamic helper CPU. B. Contributions To the best of the authors’ knowledge, this paper represents the first attempt on investigating the optimal stochastic control of MECO to an opportunistic helper. In particular, the work addresses two new design issues that are not addressed in the literature focusing on dedicated helpers. • (Channel-and-helper dual opportunism) The dual opportunism refers to exploiting both the channel temporal diversity and the random computation resources at the helper for reducing transmission-energy and computing-latency, respectively. Note that the intermittent computation resources at the helper can only be utilized in real time but not earlier or later. Then the offloading control policy should be designed to balance the offloading of sufficient input-data prior to the availability of random helper CPU and delaying offloading 5 so as to exploit channel temporal diversity. Thus the policy design is more complex than the conventional ones without helper randomness (see e.g., [14]–[16]). • (Curse of dimensionality) The second issue is the dramatic increasing in the complexity of computing offloading control policy due to a larger state space including both the channel, helper CPU and helper buffer, which is the effect of the well-known curse-of-dimensionality in stochastic optimization. The problem is even more complicated given an adjustable CPU frequency for local computing, as considered in the current work. In contrast, given noncausal information on the helper state, the problem of optimal offloading control in [19] is a convex problem and much simpler to solve. To address these issues, we consider an MECO system where a user is assisted by an opportunistic helper to compute a fixed size of input-data before a deadline. To reduce energy consumption, the user allocates the data over different slots for computation and furthermore partitions the per-slot data for local computing with an adjustable local-CPU frequency and offloading to an opportunistic helper. Both the dynamic channel and helper-CPU states are modeled as Markov chains. The models allow the approach of transforming the considered offloading control into stochastic optimization problems. The main results are summarized as follows. 1) Opportunistic helper without a buffer: First, consider the case where the helper has no buffer for storing the offloaded data from the user. We formulate a stochastic optimization problem for minimizing the expected user-energy consumption and derive the optimal offloading policy for controlling data partitioning (for local computing and offloading) in different slots. The result shows that, in each slot, both the locally-computed and offloaded data sizes are proportional to the remaining un-computed data size with the scaling factors depending on the instantaneous channel and helper-CPU states. 2) Opportunistic helper with a large buffer: Solving the problem of stochastic offloading control for the case of a large helper buffer is mathematically intractable. To overcome the difficulty, we derive an approximated function for the expected future user-energy consumption. Based on this, we propose an effective sub-optimal computation offloading policy, which is shown to be close-to-optimal in simulations. Interestingly, the resultant policy has the similar structure as that of zero-buffer counterpart but is much simpler to compute. 3 Opportunistic helper with a small buffer: Last, assume that the helper has a small buffer. The 6 Offloading control Opportunistic Offloading Q Offloading Buffer D -bit Input-data Local Computing Mobile User Local (Primary) task Task Info. & CSI Offloading Controller CPU Opportunistic Helper Figure 1: Computation offloading system with an opportunistic helper. introduced buffer constraint renders the derivation for the optimal computation offloading policies intractable. To address this challenge, we propose a practical offloading control scheme that switches between two candidate policies for the earlier cases of zero buffer and large buffer. The switching threshold can be computed by a simple bisection-search. Despite its simplicity, the proposed scheme achieves close-to-optimality in terms of energy savings as demonstrated by simulation results. The rest of this paper is organized as follows. The system models and problem formulation are presented in Section II and Section III, respectively. The optimal and suboptimal policies for controlling computation offloading are designed for three cases, namely zero, large and small buffers, in Sections IV, V, and VI, respectively. Section VII provides simulation results, followed by concluding remarks in Section VIII. II. S YSTEM M ODEL Consider an MECO system shown in Fig. 1, consisting of one user and one opportunistic helper both equipped with a single-antenna. The user is required to compute D-bit input-data with 1-bit data-size unit before a deadline T , which is divided into K slots, each with a duration of t0 = T /K. Controlled by the helper, the user allocates data for computing in each slot and further partitions the data for simultaneous local computing and computation offloading to the helper. Models are described as follows. A. helper CPU Model The opportunistic helper is assumed to operate at a constant frequency. Due to intermittent primary tasks, the helper-CPU states can be modeled by a random process denoted by 7 1 P11 P11 Idle 1 Pgg Busy P00 Pgg Good Bad 1 P00 1 Pbb (a) Helper-CPU model (b) Channel model Pbb Figure 2: Markov-chain models of helper-CPU and channel. 4 {C1 , · · · , CK }. In each slot k, the helper-CPU state ck ∈ C = {0, 1}, where ck = 0 and ck = 1 denote the busy and idle states, respectively. Assumption 1 (helper CPU Dynamics). As shown in Fig. 2(a), the process of the random helper-CPU states, {Ck } for k = 1, · · · , K, is a finite-state stationary Markov chain. This assumption means that for any slot k, the current helper-CPU state Ck only depends on the previous random state Ck−1 and is independent of the past states {C1 , · · · , Ck−2 }. Let P00 and P11 denote the busy-to-busy and idle-to-idle transition probabilities, respectively. Then the busy-to-idle and idle-to-busy transition probabilities, denoted by P01 and P10 , are: P01 = 1 − P00 and P10 = 1 − P11 , respectively. Last, the helper is assumed to reserve a Q-bit buffer for storing the offloaded data before processing in the CPU. B. Models of Local Computing and Computation Offloading Let Lk denote the remaining data size for processing at the beginning of slot k. In this slot, (of) (lo) the user offloads uk -bit data to the helper and computes uk -bit data using its local CPU. First, consider local computing. Let fk denote the adjustable CPU-cycle frequency of the user during slot k, and w the number of CPU cycles required for computing 1-bit input-data at the user. Given a fixed data size for computing in a slot, operating at a constant CPU-cycle frequency within the slot is most energy-efficient for local computing [28]. Thus the adjustable CPU-cycle (lo) frequency of the user is chosen as fk = wuk /t0 . Following the practical model in [29], the energy consumption of each CPU cycle can be modeled by E (cyc) = γfk2 , where γ is a constant depending on the circuit. The energy consumption for local computing during slot k, denoted (lo) by Ek , follows (lo) (Local-computing energy consumption) Ek (lo) = wγfk2 uk (lo) = α(uk )3 , (1) 8 6 M 0 o . 0 d 2 u 5 l a t i o r n s c h e m e 3 5 SNR/symbol 2 PAM 1 0.25 d2 4 QAM 2 0.50 d2 16 QAM 4 1.25 d2 64 QAM 6 5.25 d 4 b o l Bits/symbol S N R / s y m Modulation 3 2 1 2 0 0 1 2 3 r a t e ( b i t s / s y m 4 b 5 o 6 l ) Figure 3: Modulation scheme given in the table is considered in [31], where d represents the minimum distance between signal points and SNR is short for the signal-to-noise ratio. The corresponding plot shows 0.025r3 to the scaled piecewise linear power-rate curve. where α = γw3 /t20 . Next, consider computation offloading. Let {H1 , · · · , HK } denote the random process of the channel (power) gain between the user and helper. The channel state is modeled by the widelyused Gilbert-Elliott model (see e.g., [30]), where the channel with the power gain above or below a given threshold is labeled as “good” or “bad”, with the average channel power gains denoted 4 by g and b, respectively. Mathematically, hk ∈ H = {g, b}. Assumption 2 (Channel Dynamics). As shown in Fig. 2(b), the process of the random channel states, {Hk } for k = 1, · · · , K, is a finite-state stationary Markov chain. Let Pgg and Pbb denote the transition probability from good-to-good and bad-to-bad respectively, then the transition probabilities from good-to-bad and from bad-to-good, denoted by Pgb and Pbg , are given as: Pgb = 1 − Pgg and Pbg = 1 − Pbb , respectively. Following the empirical model in the literature [3], [7], [30], the transmission power in slot k, denoted by pk , can be modeled by a monomial function with respect to the achievable transmission rate rk (in bits/s): (rk )m , (2) (Monomial offloading power) pk = λ0 hk where λ0 denotes the energy coefficient incorporating the effects of bandwidth and noise power, and m is the monomial order determined by the modulation-and-coding scheme. This monomial order is a positive integer, taking on values in the typical range of 2 ≤ m ≤ 5. Specifically, considering the coding scheme for the targeted error probability less than 10−6 [31], the monomial order of (m = 3) can approximate transmission energy consumption as shown in Fig. 3. Then 9 for tractability, the offloading energy consumption in slot k can be modeled by the following (of) monomial function of the offloaded data size uk : (of) (of) (Monomial offloading energy consumption) Ek = pk t0 = λ (uk )3 , hk (3) where λ = λ0 /t20 . C. Model of Opportunistic Computation Offloading Assume that the random helper CPU and channel states are independent and the helper has the knowledge of channel-and-CPU distributions as given in Assumption 1 and 2. Using the user’s information by feedback including the input-data size D, computation deadline T and local-computing parameters {w, γ}, the helper computes the control policy and then controls the offloading process so as to minimize user-energy consumption. Assumption 3 (Causal State Information). The helper has causal information of the helper CPU and channel state information (CSI), where CSI is obtained by feedback. The opportunistic computation offloading is elaborated as follows. Consider slot k. At the beginning of this slot, the user observes the helper CPU and channel states, and makes decisions on the locally-computed and offloaded data sizes in this slot. The remaining data size in the next 4 slot, denoted by Lk+1 ∈ L = {1, · · · , D}, evolves as: (of) (Remaining data size) Lk+1 = Lk − uk (lo) − uk , ∀k = 1, · · · , K − 1, (4) with L1 = D. For the offloaded data, it is assumed to be first stored in the helper buffer and 4 then fetched to the helper CPU for computing. Let Qk ∈ Q = {1, · · · , Q} denote the buffered data size at the beginning of slot k. Assume that the helper CPU has unlimited computation capacity, such that it can compute all the buffered data if it is idle (not occupied by a primary task). Mathematically, if ck = 1, it has Qk+1 = 0. Otherwise, if the helper CPU is busy (i.e., ck = 0), all the newly-offloaded data is stored in the buffer in the next slot. Then the buffered data size evolves as follows: (Buffered data size) Qk+1 =   Qk + u(of) , ck = 0,  0, ck = 1, k ∀k = 1, · · · , K − 1, (5) (of) with Q1 = 0, which can be rewritten as Qk+1 = (Qk + uk )(1 − ck ). To guarantee that all the offloaded data is computed by the deadline, we propose a demand-computing scheme as follows. 10 Definition 1 (Demand-Computing). In the last slot K, if the helper CPU is busy, demandcomputing refers to the scheme at the user that receives feedback from the helper on the uncomputed data as offloaded by the user and then computes it completely using the local CPU by adjusting its frequency. III. P ROBLEM F ORMULATION In this section, the energy-efficient stochastic control of opportunistic computation offloading is formulated as a finite-horizon MDP problem for minimizing the expected user-energy consumption. Solving the problem yields policies for the helper to control the offloading process. The formulated problem consists of the following components. (C) (H) (L) (Q) 1) State space: Let xk = (xk , xk , xk , xk ) denote the system state in each slot k, where (C) (H) (L) xk , xk , xk (Q) and xk redenote the helper-CPU state ck , channel state hk , remaining data size Lk , and buffered data size Qk , respectively. Then system state space is the product space X = C × H × L × Q. (of) (lo) (of) 2) Action space: Let uk = (uk , uk ) denote the action in slot k with uk (lo) ≥ 0 and uk ≥ 0. The action space is L × L. Given a specific system state xk , the feasible action uk depends on the state, that is, uk ∈ U(xk ) for all xk ∈ X where U(xk ) is the space of all feasible actions in slot k satisfying the following constraints. First, the data constraints require: (of) (Data constraints) uk (lo) + uk (L) ≤ xk , ∀k = 1, · · · , K − 1. Next, in the last slot K, the demand-computing enforces the following constraint:   (C) u(of) = 0, u(lo) = x(L) + x(Q) , xK = 0, K K K K (Demand-computing constraint)  (C) u(of) + u(lo) = x(L) , xK = 1. K K K Last, the finite helper buffer leads to:   u(of) ≤ Q − x(Q) , k k (Buffer constraints)  u(of) ≤ x(L) , k k (C) = 0, (C) = 1, xk xk ∀k. Based on the above discussion, the feasible action space can be summarized as n o   uk (6), (8), u(of) ≥ 0, u(lo) ≥ 0 , k = 1, · · · , K − 1; k k U(xk ) = n o   uk (7), (8), u(of) ≥ 0, u(lo) ≥ 0 , k = K. k k (6) (7) (8) (9) 11 3) State transition probability: The state transition probability, denoted by Pr(xk+1 |xk , uk ), is the probability that the system will be in the state xk in slot (k +1), given the current state xk and (C) (H) (L) the action uk . Since xk , xk , xk (Q) and xk are independent, the controllable state transition probability can be written as: (C) (C) (H) (H) Pr(xk+1 xk , uk ) = Pr(xk+1 xk ) × Pr(xk+1 xk ) h i h i (L) (L) (of) (lo) (Q) (Q) (of) (C) × I xk+1 = xk − uk − uk × I xk+1 = (xk + uk )(1 − xk ) , ∀ xk+1 ∈ X , (10) where I[·] denotes the indicator function. According to (4) and (5), the state transition probability (L) (L) (of) (lo) is positive only when xk+1 = xk −uk −uk (C) (Q) (Q) (of) (C) and xk+1 = (xk +uk )(1−xk ), simultaneously, (C) (H) (H) for which Pr(xk+1 xk , uk ) = Pr(xk+1 xk ) × Pr(xk+1 xk ). 4) Cost function, control rule and policy: The cost function is specified by the function R(xk , uk ), giving the total energy consumption in each slot k: (of) (Cost function) R(xk , uk ) = (lo) α(uk )3 +λ (uk )3 (H) . (11) xk Let the function πk denote the control rule that maps state xk to the action uk = πk (xk ) such that πk (xk ) ∈ U(xk ). An admissible policy is a sequence of control rules in each slot, π = {π1 , · · · , πK }. The set of all admissible policies is denoted by Π. Then given any initial state x1 , the optimization problem for the minimum expected sum user-energy consumption can be formulated as: # " K X (P1) min E R(Xk , πk (Xk )) x1 , π∈Π k=1 where the expectation is taken with respect to the system state vector Xk = {X1 , · · · , XK }. Denote the minimum expected sum user-energy consumption as J ∗ (x1 ). To solve Problem P1, note that the optimization for πk (xk ) in different slots cannot be performed independently, since the action in slot k affects the system transition probability in subsequent slots [see (10)] and thus the future energy cost. This difficulty is overcome in the following lemma according to the Principle of Optimality [32]. (C) (H) (C) Lemma 1 (DP Approach). For any initial state x1 = (x1 , x1 , D, 0) where x1 (H) x1 ∈ C and ∈ H, the minimum expected sum user-energy consumption J ∗ (x1 ) is equal to J1 (x1 ), which can be recursively solved based on the Bellman Equation, starting from JK (xK ), JK−1 (xK−1 ) to J1 (x1 ) by evaluation all possible states in each slot k = 1, · · · , K. Specifically, Jk (xk ) denotes 12 the cost-to-go function that gives the minimum expected user-energy cost from slot k to K, which is defined as: Jk (xk ) =     min {R(xk , uk ) + E [Jk+1 (Xk+1 )|xk , uk ]} , k < K,    min k = K, uk ∈U (xk ) uK ∈U (xK ) R(xK , uK ), (12) where U(xk ) is defined in (9). Furthermore, if u∗k = πk∗ (xk ) is the optimal control rule for solving ∗ }. (12) for each xk and k, the optimal policy for solving Problem P1 is given by π ∗ = {π1∗ , · · · , πK Denote the problem for deriving J1 (x1 ) [or J ∗ (x1 )] as Problem P2. The resultant optimal computation-offloading policy for solving Problem P2 can be computed numerically, but the result yields little insight into the policy structure, which is important for practical policy computation and design. Thus, we quantify the policy structure and develop low-complexity schemes for offloading control in the following sections. The analysis involves solving convex problems using the Lagrange method. For simplicity, we assume in the analysis that data is continuously divisible, following a common approach in the literature (see e.g., [30]). In practice, the derived data sizes are rounded to bits. IV. C OMPUTATION O FFLOADING C ONTROL : N O H ELPER B UFFER In this section, we derive the optimal offloading-control policy for the case where the helper has no buffer for storing the offloaded data. To this end, we first derive the optimal computation offloading policy for the last slot and then build on the result to obtain the optimal policy for multi-slots. (Q) In this case, due to the zero buffer, the state of buffered data size is xk = 0, ∀k. Consider the offloading control in the last slot K given the system state xK . The user can offload partial data if the helper CPU is idle, but can only perform local computing if the helper CPU is busy. Thus the problem for JK (xK ) can be simplified as follows. ( )  (of)  (uK )3 (C) (lo) 3   min α(uK ) + λ (H) , xK = 1, xK (P3) JK (xK ) = uK ∈U (xK )   (C) α(x(L) )3 , xK = 0, K where U(xK ) is defined in (9), which can be explicitly written as (lo) (of) (lo) (of) (L) U(xK ) = {uK | uK ≥ 0, uK ≥ 0, uK + uK = xK }. (13) 13 It is easy to prove that Problem P3 is a convex optimization problem. Applying the Lagrange method yields the optimal solution given the following lemma. Lemma 2 (Optimal Control for Last Slot). For the last slot, the optimal locally-computed and (lo)∗ (of)∗ offloaded data sizes uK and uK for solving Problem P3 are given by !−1 s r  −1 q α λ (lo)∗ (C) (H) (L) (of)∗ (L) (C) uK = 1 + x xK xK and uK = 1 + xK xK . (H) λ K αxK The minimum user-energy consumption JK (xK ) is r  −2 q α (C) (H) (L) 3 xK . JK (xK ) = α(xK ) 1 + x λ K (14) (15)  Proof: See Appendix A. Remark 1 (Channel-Aware Proportional Offloading). Lemma 2 shows that when the helper CPU is data size is proportional to the remaining data size with the scaling factor  idle,qthe offloaded −1 (H) (H) 1 + λ/(αxK ) , which is determined by the channel state xK . In particular, the user offloads more data when the channel is in a good state. Moreover, one can observe from (15) that, compared with no offloading (i.e., only local computing), the current offloading  opportunistic  q −2 (H) can help reduce user’s energy consumption by the proportional factor 1 + αxK /λ when the helper CPU is idle. Lemma 2 gives the minimum energy consumption in the last slot, which is expressed in a compact form accounting for different system states. This key observation facilitates the stochastic computation offloading policy design. Specially, using Lemma 2 and applying backward induction for solving Problem P2, the optimal offloading policy can be derived as shown below. Theorem 1 (Optimal Policy for Multi-Slots). Consider that the helper has no buffer. For k = (of)∗ 1, · · · K, the optimal computation offloading policy allocates uk and local computing, respectively, which satisfy the following relation: r q (of)∗ uk α (C) (H) = xk xk . (lo)∗ λ uk (lo)∗ Specifically, uk  (lo)∗ uk (of)∗ and uk (lo)∗ and uk bits for offloading (16) are given by: 1 (L) = xk 1+ q + (C) (H) Sk (xk , xk ) r −1 r q q α (C) α (C) (H) (of)∗ (H) (lo)∗ x xk and uk = x xk uk , (17) λ k λ k 14 (C) (H) where Sk (xk , xk ) is defined as  X X (C) (C) (H) (H)   Pr(xk+1 xk ) Pr(xk+1 xk )    (C) (H)  xk+1 ∈{0,1} xk+1 ∈{g,b}     −2   r q (C) (H) Sk (xk , xk ) = α (C) 1 (H) 1 + q  xk+1 xk+1  , k < K, +   λ (C) (H)   Sk+1 (xk+1 , xk+1 )      ∞, k = K. The corresponding minimum expected user-energy consumption is  −2 r q α (C) 1 (H) + x1 x1  . J1 (x1 ) = αD3 1 + q λ (C) (H) S1 (x1 , x1 ) (18) (19)  Proof: See Appendix B. Theorem 1 shows that in each slot, the optimal computation offloading control is not only determined by the current state xk , but also the future energy cost from slot (k + 1) to K by (C) (H) (C) (H) the term of Sk (xk , xk ). Specifically, a smaller Sk (xk , xk ) indicates less expected energy consumption for computing per bit data in future slots. In this case, the user should reduce both the locally-computed and offloaded data sizes. Moreover, if the helper-CPU state is idle in slot k, the fraction between the optimal offloaded q and locally-computed data sizes is determined by (H) (of)∗ (lo)∗ the channel state. Specifically, uk /uk = αxk /λ. This result implies that given the sum processed data in one slot, more data should be offloaded if the local-computing complexity is higher and channel is better, which is aligned with intuition. Remark 2 (Low-Complexity Algorithm). The computational complexity for the direct DP approach depends on the dimensions of state space, action space and finite horizon. As the dimensions of the state space and action space are O(2 × 2 × D) and O(D2 ), respectively, the total computational complexity has the order of O(16D2 × D2 × K), which is impractical for large K and D. This curse of dimensionality [32] is overcome by deriving the closed-form expression for the optimal solution as in Theorem 1, avoiding the exhausted search for the optimal control in the action space in each slot. Specifically, the optimal control is directly determined by (C) (H) the observed system state xk and Sk (xk , xk ), which essentially depends on the dimensions of helper CPU and channel state spaces and the number of slots. Thus the computational complexity (C) (H) for the proposed algorithm is the complexity for calculating S1 (x1 , x1 ), which is O (4K) and much lower than that of the brute-force DP approach. 15 V. C OMPUTATION O FFLOADING C ONTROL : L ARGE H ELPER B UFFER In this section, we consider the design of computation offloading policy for the case where the helper has a large buffer with a size Q sufficient for storing the maximum offloaded data D: Q ≥ D. The direct application of iterative DP results in complexity linearly scaling with Q. To tackle this challenge, a low-complexity policy with close-to-optimality is designed based on approximating the minimum expected energy cost function and found to have a similar structure as the zero-buffer counterpart studied in the preceding section. A. Optimal Policy Computation In this subsection, we derive the procedure for computing the optimal offloading policy using DP, which facilitates the low-complexity policy design in the sequel. To begin with, consider computation offloading in the last slot K. Note that compared with the case of no buffer (see Section IV), the current case requires an additional constraint that, if the helper CPU is busy (Q) and xK -bit uncomputed data is buffered, the demand-computing requires local computing to (L) (Q) finish all the remaining computation, yielding the energy consumption of α(xK + xK )3 . Thus, Problem P3 can be rewritten as (P4) JK (xK ) =     min uK ∈U (xK ) ( (of) (lo) α(uK )3 + λ   α(x(L) + x(Q) )3 , K K (uK )3 (H) xK ) , (C) xK = 1, (C) xK = 0, where U(xK ) is given in (13). Following the same procedure as for solving Problem P3 leads to the optimal solution to Problem P4 as follows. Lemma 3 (Optimal Policy for Last Slot). For the K-th slot, the optimal locally-computed and offloaded data sizes for solving Problem P4 are given by: r  −1 h q i α (C) (lo)∗ (H) (L) (C) (Q) uK = 1 + xK xK xK + (1 − xK )xK , λ !−1 s λ (of)∗ (C) (L) uK = 1 + xK xK . (H) αxK The corresponding minimum user-energy consumption is r −2 q h i3  α (C) (L) (C) (Q) (H) JK (xK ) = α xK + (1 − xK )xK 1+ x xK . λ K (20) (21) (22) Comparing Lemma 3 and Lemma 2, we can observe that offloading policies in the last slot for the two scenarios of large and zero buffers are the same, while the local computing policy 16 for the case of large buffer should compute more data than the zero-buffer counterpart when the helper CPU is busy, due to the demand-computing constraint. Though the last-slot policy has a closed form, the optimal multi-slot policy is intractable due to the helper buffer. Based on DP, the backward iterative computation of the minimum expected user-energy cost in slot (K − 1) is given as JK−1 (xK−1 ) = min uK−1 ∈U (xK−1 ) {R(xK−1 , uK−1 ) + E [JK (XK )|xK−1 , uK−1 ]} , (23) where the action space U(xK−1 ) is defined in (9). In particular, using (10) and Lemma 3, the expected conditional energy cost in slot (K − 1) is obtained as E[JK (XK )|xK−1 , uK−1 ] (C) = αF (xK−1 , uK−1 , xK ) (H) (H) (C) (C) Pr(xK xK−1 ) Pr(xK xK−1 )  r 2 , q α (C) (H) (C) (H) xK ∈{0,1} xK ∈{g,b} x xK 1+ λ K X X (24) where the function F (·) is defined as h i3 (C) (L) (lo) (of) (C) (C) (Q) (of) F (xK−1 , uK−1 , xK ) = (xK−1 − uK−1 − uK−1 ) + (1 − xK )(1 − xK−1 )(xK−1 + uK−1 ) . (25) One can observe from (24) and (25) that the total computed data in the last slot depends on (C) (L) (lo) (of) the random helper-CPU state XK , which, however, is equal to (xK−1 − uK−1 − uK−1 ) for the counterpart of zero buffer. This is due to that for the large buffer, the user can offload data in (C) slot (K − 1) even when the helper CPU is busy (i.e, xK−1 = 0) and the buffered data should be (C) computed locally in the last slot if the helper CPU is busy (i.e, xK = 0). It is difficult to derive a closed-form expression for the optimal offloading-control policy for the (K − 1)-th slot. This is also true for all of the 1 to (K − 1)-th slots. Alternatively, computing the optimal policy has to rely on the numerical method of DP, based on iterations similar to that in (12). The complexity, however, is high as discussed in the following remark. Remark 3 (Curse of Dimensionality). The computational complexity for the numerical of DP is similar to the case of zero buffer. Due the large buffer (i.e., Q > D), the state space of the buffered data size can be bounded as D. Thus, the dimensions of the state space and action space are O(2 × 2 × D2 ) and O(D2 ), respectively. Then the total computational complexity for the optimal policy can be derived as O(16D4 × D2 × K), which incurs prohibitive computation complexity if K and D are large. 17 B. Sub-Optimal Policy Design To address the above complexity issue in computing the optimal policy, we design a tractable sub-optimal offloading-control policy by approximation the expected future energy-cost function as follows. 1) Approximate Energy Cost Function: To approximate the expected conditional energy cost in (24), the function E[JK (XK )|xK−1 , uK−1 ] is firstly bounded as follows. Lemma 4. The expected conditional energy-cost function, E[JK (XK )|xK−1 , uK−1 ], in (24) can be lower-bounded as (C) (H) E[JK (XK )|xK−1 , uK−1 ] ≥ αFe(xK−1 , uK−1 )S(xK−1 , xK−1 ), (26) where the two functions Fe(·) and S(·) are defined as h i3 (L) (lo) (of) (C) (Q) (of) Fe(xK−1 , uK−1 ) = (xK−1 −uK−1 −uK−1 ) + V (xK−1 )(xK−1 + uK−1 ) , (27) r −2 q X X α (C) (C) (H) (C) (C) (H) (H) (H) x , (28) S(xK−1 , xK−1 ) = Pr(xK |xK−1 ) Pr(xK |xK−1 ) xK + 1 λ K (C) (H) xK ∈C xK ∈H and the function V (·) is defined as (C) (C) V (xK−1 ) = (1 − xK−1 )P00 . (29) The equality in (26) holds if the user has non-causal information of channel and helper-CPU states.  Proof: See Appendix C. It can be observed that the function of Fe(xK−1 , uK−1 ) in (27) has a similar form with (C) (C) (C) F (xK−1 , uK−1 , xK ) in (25). The key difference is that, (1 − xK−1 )(1 − xK ) in (25) is replaced (C) with V (xK−1 ) in (27), which helps derive the closed-form expression for the lower-bound (C) of E[JK (XK )|xK−1 , uK−1 ] as shown in (26). Intuitively, V (xK−1 ) can be interpreted as the conditional probability that the buffered data in slot (K − 1) will be locally-computed in slot K. (C) In particular, if xK−1 = 1, all the buffered data is computed by the helper within this slot and (C) (C) (C) thus V (xK−1 ) = 0. On the other hand, if xK−1 = 0, V (xK−1 ) = P00 showing that the probability (Q) (of) of demand-computing for (xK−1 + uK−1 )-bit is the conditional busy probability in slot K. Given the objective of energy minimization, though it is desirable to obtain a tight and tractable upper bound on the expected energy cost, finding such a bound is difficult. For this reason, we 18 instead approximate the function using its lower bound in Lemma 4 as follows and verify the close-to-optimality by simulation. (C) (H) E[JK (XK )|xK−1 , uK−1 ] ≈ αFe(xK−1 , uK−1 )S(xK−1 , xK−1 ). (30) The approximate form decomposes the energy-cost function into two product factors, depending on the state xK−1 and action uK−1 . This simplifies the sub-optimal policy design in the sequel. 2) Design Sub-Optimal Offloading-Control Policy: Using (30), the cost-to-go function JK−1 (xK−1 ) can be approximated as JK−1 (xK−1 ) ≈ n o (C) (H) e R(xK−1 , uK−1 ) + αF (xK−1 , uK−1 )S(xK−1 , xK−1 ) . min uK−1 ∈U (xK−1 ) (31) Denote the optimization problem in (31) as Problem P5. It can be easily proved that Problem P5 is convex optimization problem. Applying the Lagrange method yields the optimal solution for Problem P5, which is also the sub-optimal policy for slot (K − 1). Lemma 5 (Sub-Optimal Policy for slot (K − 1)). By approximating the expected conditional energy-cost as in (30), the sub-optimal offloading-control policy for solving the optimization problem JK−1 (xK−1 ) is: −1  r  3q    α 1 2 (C) (H) (lo)∗ (L) (C) (Q) 1−V (xK−1 ) + xK−1  , (32) uK−1 = xK−1 +V (xK−1 )xK−1 1+ q λ (C) (H) S(xK−1 , xK−1 ) r  α (H)  (C) (lo)∗ (of)∗ (33) uK−1 = xK−1 1 − V (xK−1 ) uK−1 , λ (C) (H) (C) where S(xK−1 , xK−1 ) and V (xK−1 ) are defined in (28) and (29), respectively. The corresponding minimum expected user-energy consumption is approximated as  3 (L) (C) (Q) JK−1 (xK−1 ) ≈α xK−1 + V (xK−1 )xK−1  −2 r  3 q  1 α 2 (C) (H) 1 + q + 1 − V (xK−1 ) xK−1  . λ (C) (H) S(xK−1 , xK−1 ) (34)  Proof: See Appendix D. Remark 4. Computation offloading can potentially save energy when the buffer is sufficient and the channel is favorable, but it may cause more energy consumption due to demand computing. (C) (C) Recall that if xK−1 = 0, V (xK−1 ) represents the conditional probability of the helper-CPU busy (of)∗ (lo)∗ state in slot K. It can be obtained from Lemma 5 that the ratio between uK−1 and uK−1 decreases 19 (C) with the increase of V (xK−1 ). This indicates that it is energy efficient to allocate more data for local computing when the helper CPU is more likely to be busy in slot K. In particular, the user should not offload data if P00 = 1. Moreover, it can be obtained from (34) that JK−1 (xK−1 ) (C) monotonically increases with V (xK−1 ), since a larger probability of the helper-CPU busy state tends to stop input-data offloaded to the helper and thus increases the expected user-energy consumption. Note that using (29), the approximated minimum expected user-energy consumption JK−1 (xK−1 ) in (34) has the similar form as JK (xK ) in (22). This suggests that by performing backward induction, the sub-optimal offloading-control policy in each slot k is expected to have closedform expressions similar to (32) and (33) by using the similar approximation techniques as for deriving (30). To this end, following the similar procedure as for deriving Theorem 1, the sub-optimal offloading-control policy in each slot k for the large-buffer case can be derived as follows. Theorem 2 (Sub-Optimal Policy for Multi-Slots). Given a large buffer (Q ≥ D) at the helper, for k = 1, 2, . . . , K − 1, the sub-optimal offloading-control policy is given as follows by approximating the expected conditional energy-cost: −1  r  3 q    α 1 2 (C) (H) (lo)∗ (L) (C) (Q) uk = xk + Vk (xk )xk 1 + q 1 − Vk (xk ) xk  , (35) + λ (C) (H) Sek (xk , xk ) r  α (H)  (of)∗ (C) (lo)∗ uk = xk 1 − Vk (xk ) uk , (36) λ (C) (C) (C) (H) K−k where Vk (xk ) , (1 − xk )P00 , and the function Sek (xk , xk ) is defined as  X X (C) (C) (H) (H)   Pr(xk+1 |xk ) Pr(xk+1 |xk )    (C) (H)  xk+1 ∈{0,1} xk+1 ∈{g,b}     −2   r  (C) (H) 3q  e Sk (xk , xk ) = 1 α 2 (H) (C) 1+ q  + 1 − Vk+1 (xk+1 ) xk+1  , k < K,   λ (C) (H)   Sek+1 (xk+1 , xk+1 )      ∞, k = K. (C) (H) (C) (C) (H) Note that for slot (K − 1), SeK−1 (xK−1 , xK−1 ) and VK−1 (xK−1 ) reduce to S(xK−1 , xK−1 ) and (C) V (xK−1 ) in (28) and (29), respectively. Moreover, one can observe that the above sub-optimal offloading-control policy has the similar structure with the optimal policy in Theorem 1. The key 20 difference resides in that for the large-buffer case, the offloading-control policy should account for the potential energy consumption arising from demanding computing if offloading data given helper CPU’s busy state. Remark 5 (Approximation Accuracy and Dimensionality Reduction). Similar to Lemma 4, the (C) (H) approximation is accurate if the user has the non-causal information of xk and xk for all   (C) (C) K−k k. In addition, note that if xk = 0, we have Vk xk = P00 , which can be interpreted as the conditional helper-CPU all-busy probability. This reflects the key fact that when the helper CPU is busy in slot k, the offloaded and buffered bits at the helper will consume energy from demand-computing by the local CPU, only if the helper CPU is constantly busy until the last slot. Furthermore, the proposed sub-optimal policy can achieve close-to-optimality as shown by simulation in the sequel, but it considerately reduce the computation complexity from O(16D4 × D2 × K) to O(4K). Remark 6 (Effects of Buffer). The large helper buffer affects both the offloading and localcomputing policies as follows. First, for offloading, in the case of zero buffer, the user does not offload data when the helper CPU is busy as indicated in (17). Instead, due to the large buffer at the helper, the user can offload partial data for potentially utilizing future helper CPU resources and thus reducing transmission-energy consumption in favorable channels, which can be inferred from (35). Next, for local computing, with a large buffer, the user computes less data with the local CPU than in the case of zero buffer, due to a larger offloaded data size in the busy states. These properties are confirmed by simulation results in the sequel. VI. C OMPUTATION O FFLOADING C ONTROL : S MALL H ELPER B UFFER In this section, the solution approach for the energy-efficient stochastic computation offloading developed in the preceding sections is extended to the case of a small buffer at the helper (i.e., Q < D). The closed-form expression for the optimal policy is intractable due to the buffer constraints in each slot [see (8)]. To address this issue, by exploiting the insight from policies for the earlier cases of zero and large buffers, we design a sub-optimal offloading-control policy that sheds light on the optimal policy structure and can achieve close-to-optimality as confirmed by simulation. The derivation for the optimal policy for multi-slots encounters the following two key challenges. The first one is the difficulty for deriving a closed-form expression for the expected future 21 energy cost, which is elaborated in Section V-A. The second one lies in the buffer constraint (Q) (of) (i.e., xk + uk (C) ≤ Q, if xk = 0), which bounds the amount of offloaded data according to the instantaneous buffered data size. To tackle these challenges, we propose a tractable buffer-aware candidate-policy selection (BACS) scheme, which is defined as follows. Definition 2 (Buffer-Aware Candidate-Policy Selection). The BACS scheme chooses one of the two candidate policies as the sub-optimal computation offloading policy, namely, truncated largebuffer based policy (TLBP) and zero-buffer based policy (ZBP) defined in the sequel, depending on the helper buffer size Q. To be specific, the BACS scheme selects the TLBP or ZBP policy, if the buffer size Q is above or below a switching threshold Qth that is specified in the sequel. The key idea of the proposed BACS is to exploit the useful structures in the developed policies for the earlier cases of zero buffer and large buffer, and use them to design the sub-optimal policy for the case of small helper buffer. Intuitively, if the buffer size is relatively large (i.e., Q → D− ), modifying the sub-optimal policy for the large buffer (see Section V) is expected to achieve desirable energy-savings performance. This modified policy, however, is unsuitable for the case of a relatively small buffer (i.e., Q → 0+ ), as it is based on the assumption of a large buffer. This suggests to choose another candidate policy that is modified from the optimal policy for the zero buffer. In the following, we elaborate both the TLBP and ZBP policies, and characterize the switching threshold. 1) Truncated Large-Buffer based Policy: This candidate policy is designed by applying the relaxation-and-truncation (RT) approach for the solution approach of the large-buffer counterpart, accounting for the limited buffer size. To this end, in each slot, we first relax the buffer constraint and thus the problem reduces to the large-buffer counterpart. The corresponding sub-optimal n o (lo)∗ (of)∗ policy can be derived in Theorem 2, denoted by u bk , u bk . Next, to account for the small buffer size, the control policy is further given by  (of)∗ (C)  u xk = 1, bk , (lo)∗ (lo)∗ (of)∗ uk = u bk , and uk = D EQ−xk(Q)  (of)∗ (C)  u bk , xk = 0, (37) 0 where h·izz21 denotes the truncation below z1 and above z2 . Note that the offloaded data only needs to be truncated if the helper CPU is busy. 2) Zero-Buffer based Policy: Recall that the optimal policy for the case of zero buffer (see Section IV) does not offload data when the helper CPU is busy. This key fact allows directly 22 Algorithm 1 Proposed Bisection-Search Algorithm for the Switching Threshold Step 1: Calculate the expected user-energy consumption over 104 realizations for ZBP using the results in Theorem 1, denoted by ĒZ . Step 2 [Bisection-search for Qth ]: Initialize Q` = 0, Qh = D/2, and ε > 0. Repeat (1) Set Qm = (Q` + Qh )/2, and calculate the expected user-energy consumption over 104 realizations for TLBP, denoted as ĒT . (2) If ĒT < ĒZ , let Qh = Qm ; otherwise, Q` = Qm . Until |ĒT − ĒZ | ≤ ε. Return Qth = Qm . using the solution approach for the zero-buffer counterpart to the current case of a small buffer. 3) Switching Threshold: Let G1 (Q) and G2 (Q) denote the expected user-energy consumption with a K-slot deadline by using TLBP and ZBP, respectively, which can be numerically computed. First, the existence of the switching threshold is established in the following lemma. Lemma 6 (Existence of the Switching Threshold). There exists a switching threshold Qth in the range of 0 ≤ Qth ≤ D, which satisfies G1 (Qth ) = G2 (Qth ). Proof: See Appendix E.  In addition, though the expected user-energy consumption using TLBP, G1 (Q), is intractable due to the RT procedure, it can be evaluated by simulation that G1 (Q) is non-increasing with the buffer size Q. This is expected since a larger buffer size allows more data to be offloaded, if offloading consumes less energy than local computing. The effects of the computing deadline on the switching threshold are evaluated by simulation in the sequel. The switching threshold can be efficiently computed by a proposed bisection-search procedure as detailed in Algorithm 1. VII. S IMULATION R ESULTS AND D ISCUSSIONS In this section, simulation results are presented for evaluating the performance of the proposed stochastic computation offloading policies. The parameters are set as follows unless stated otherwise. The user is required to compute 3000-bit given a 5-slot deadline, each slot with a time duration t0 = 100 ms. For local computing, γ = 10−28 and the required CPU cycles for computing 1-bit data is w = 105 cycle/bit [4], [8]. For offloading, the channel gain Hk between the user and the helper follows a stationary Markov chain with the transition probabilities set as 23 . 0 1 2 O p t i m a l p o l i c y : L a r g O p t i m a l p o l i c y : S m e b u f f e r a l l b u f f e r S u b o p t i m a l p o l i c y : L a r g S u b o p t i m a l p o l i c y : S m e b u f f e r a l l b u f f e r 0 . 0 1 0 0 . 0 0 8 0 . 0 0 6 0 . 0 0 4 0 . 0 0 2 0 . 0 0 0 E x p e c t e d u s e r - e n e r g y c o n s u m p t i o n ( J ) 0 2 0 0 0 2 5 0 0 3 0 I n 0 0 p 3 u t - d 5 a t a 0 0 s i z e 4 ( b 0 0 0 4 5 0 0 5 0 0 0 i t s ) Figure 4: Close-to-optimality of proposed policies. Pgg = 0.8 and Pbb = 0.7. The channel gains of the two channel states are set as g = 10−3 and b = 10−5 , respectively. The energy coefficient is λ = 10−15 . The helper-CPU state follows another Markov chain with P11 = 0.8 and P00 = 0.7. For the case of small buffer, the helper buffer size is Q = 300 bits. For performance comparison, the optimal policy is numerically computed by DP. Furthermore, a baseline algorithm is considered, called equal-allocation policy, which first equally allocates the total data into K slots and then optimizes the locally-computed and offloaded data sizes in each slot. A. Close-to-Optimality Fig. 4 shows close-to-optimal performance of the proposed sub-optimal policies. It is observed that for the case of a large buffer, the expected user-energy consumption of the sub-optimal policy is close to that of the optimal one, especially when the data size is small. Moreover, even in the large-data regime e.g., D = 5000 bits, the sub-optimal policy only results in additional 7% of the user-energy consumption. Next, for the case of small buffer, the proposed sub-optimal policy also achieves close-to-optimal performance and has slightly larger user-energy consumption in the large-data regime. B. Effects of Parameters The curves of the expected user-energy consumption versus the input-data size are plotted in Fig. 5(a). Several observations are made as follows. First, as the input-data size increases, the expected user-energy consumption of each policy grows at an increasing rate. Next, for the case of zero buffer, the optimal policy has less user-energy consumption than the equal-allocation 24 O 3 p t i m a l p o l i c y : N o b u f f e E q u a l - a l l o c a t i o n S u b o a l l i c y : E q u a l - a l l o c a t i o n S u b o a l l i c y : E q u a l - a l l o t i m p o o l i c y : L a r g N e b b u u f f e f f e r r n 0 0 . 0 0 9 L a r g e b u f f e r t i o l i c y : 5 t i m p o c a t i o n p o S m a l l l i c y : b S m u f f e a l l r b u f f e r . 0 2 0 0 . 0 0 8 0 . 0 0 7 0 . 0 0 6 y 5 0 . 0 1 0 0 . 0 0 5 0 . 0 0 0 l i c y : N o b c a t i o n S u E q b o a l l i c y : u a l - a l l o c a t i o n S u b o a l l i c y : E q u a l - a l l o p t i m p o p o u f f e l i c y : r l a r g N 0 . 0 0 5 0 . 0 0 4 0 . 0 0 3 0 . 0 0 2 0 . 0 0 1 p t i m p o c a t i o p n o e p o l i c y : o b b u u f f e f f e S m L a r g r r a l l l i c y : b u S m e b f f e a l l u f f e r u f f e r 1 0 r b s e u d c t e e E x p 0 0 2 5 0 0 3 0 0 0 p 3 u t - d 5 0 a t a 0 4 s i z e . 0 0 ( b 0 0 0 4 5 0 0 5 0 0 4 0 p t i m a l p o 0 u m b e r o 7 f t i m e s l o 8 t s (b) Effects of computing deadline l i c y : N o b E q u a l - a l l o c a t i o n S u b o a l l i c y : 8 E q u a l - a l l o c a t i o n S u b o a l l i c y : E q u a l - a l l o t i m p o p o u f f e l i c y : p o l a r g r N e l i c y : o b b u u f f e f f e L a r g r r e b u f f e r . 0 0 7 S u u f f e r O p o S m a l l b u f f e r t i o t i m p o l i c y : S m a l l b . 0 0 7 0 . 0 0 6 0 . 0 0 5 0 . 0 0 6 0 . 0 0 5 p u t i m a l a l o p a l - a l l o p o l i c y l i c y c a t i o n p o l i c y th N o b u f f e r c o u n t e r p a r t e r g y r g y n c o n s u m s u 0 c o n e c a t i o o t i m p p p b p E q Q n p ( J ) ( J ) . 0 6 N 0 0 5 i t s ) 9 t i o n o r - e n r - e s e c t e 0 O 0 m p e 1 n . 0 (a) Effects of data size 0 . 0 0 4 0 . 0 0 3 0 . 0 0 2 . 0 0 4 0 . 0 0 3 0 . 0 0 2 E x p e E x p c t e d c t e d u 0 s e s e r - e n r - e n a l a l - a l l o r g y r g e 0 I n u t i m u c o 0 2 e p E q n s u s u m p p 2 o c o n 1 m t i o . 0 p 0 p d u . 0 O o n p p e E x p 0 r 0 ( J ) . 0 ( J ) 0 0 L a r g . 2 0 . 3 0 . 4 0 . 5 0 . 6 0 . 7 0 0 H e l p e r - C P U i d l e p r o b a b e b u f f e r c o u n t e r p a r t . 8 i l i t y . 0 0 1 0 2 0 0 4 0 0 6 B (c) Effects of the helper-CPU idle probability 0 u 0 f f e 8 r 0 s i z e 0 1 ( b 0 0 0 1 2 0 0 4 0 i t s ) (d) Effects of buffer size Figure 5: The effects of parameters on the expected user-energy consumption for the three cases: (a) input-data size with K = 5; (b) computing deadline with D = 3000 bits; (c) helper-CPU idle probability with D = 3000 bits and K = 5; (d) buffer size with D = 3000 bits and K = 5. policy, especially in the large-data regime. Similarly, the proposed sub-optimal policies for the case of large/small buffer achieve significant performance gains, both of them achieving about 30% reduction of energy consumption compared with the equal-allocation policies at D ≈ 5000 bits. Moreover, for the proposed optimal/sub-optimal policies, the policy of the large-buffer case consumes less user-energy consumption than the case of small buffer; and the case of zero buffer consumes the largest user-energy consumption. This shows that increasing the buffer size can potentially reduce the user-energy consumption, as it allows more data to be offloaded to the helper for energy savings. Fig. 5(b) depicts the curves of expected user-energy consumption versus the computing dead- 25 lines. Observe that the expected user-energy consumption of each policy is monotonically decreasing with the increasing of number of slots, which is aligned with intuition. In particular, the decreasing rate is larger at a shorter deadline (i.e., smaller number of total slots), indicating that it is highly energy-efficient to extend the deadline for energy savings when the current deadline requirement is stringent. In addition, for the case of no buffer, the optimal policy has almost constant performance gain compared with the equal-allocation policy, while the gain deceases with the number of slots for the cases of large and small buffer. Moreover, the proposed policy for the case of large buffer has much smaller user-energy consumption than the counterparts with a small buffer and no buffer. The effects of the helper-CPU idle probability on the expected user-energy consumption are evaluated in Fig. 5(c). It can be observed that as the helper-CPU idle probability increases, the user-energy consumptions of the proposed policies are almost linearly decreasing. The reason is that, with a higher idle probability, the helper CPU is more likely at the idle state in the whole slots, allowing the user to offload more data to the helper for energy savings. Again, the performances of proposed sub-optimal policies significantly outperform the corresponding equal-allocation policies. Other observations are similar to those of Fig. 5(b). The curves of expected user-energy consumption versus the buffer size are shown in Fig. 5(d). It is observed that enlarging the buffer size can considerably help reduce the expected user-energy consumption of the proposed sub-optimal policy when the buffer size is small. However, after the buffer size exceeds a threshold (about 1000 bits), the performance cannot be further improved and converges to that of the large-buffer counterpart. The reason is that the buffer size is no longer the bottleneck for offloading data, when the buffer size is sufficiently large. Next, the switching threshold Qth is quite small (about 40 bits), which means that for the helper with a moderate buffer size, the ZBP policy outperforms the TLBP policy. In addition, the proposed sub-optimal policy has close-to-optimal performance, especially in the large-buffer size regime. C. Buffer Gain To quantify the amount of energy-consumption reduction obtained from the helper buffer, we define a performance metric, called buffer gain, as the expected user-energy consumption ratio between the computation offloading policies without and with a buffer Q. Fig. 6(a) shows the effects of buffer size on the buffer gain with different computing deadlines. It is observed that the buffer gains for different deadlines see a fast increase in the small buffer- 26 2 2 . 6 . 4 . 2 2 . 0 1 . 8 1 . 6 1 . 4 1 . 2 = 5 K = 6 K = 7 2 . 5 2 . 4 . 3 2 . 2 2 . 1 2 . 0 1 . 9 1 . 8 1 . 7 1 . 6 1 . 5 = 2 0 0 b i t s Q = 4 0 0 b i t s Q = 8 0 0 b i t s r g 2 Q B B u u f f e f f e r g a i n a i n 2 K 1 . 0 0 2 0 0 4 0 0 6 B 0 u 0 f f e 8 r 0 s i z e 0 1 ( b 0 0 0 1 2 0 0 1 4 0 0 0 . 2 0 . 3 0 H i t s ) (a) Effects of buffer size e . 4 l p 0 e r - C P U . 5 i d l e 0 p r o b a b . 6 0 . 7 0 . 8 i l i t y (b) Effects of the helper-CPU idle probability Figure 6: The effects of parameters on the buffer gain: (a) buffer size with D = 3000 bits; (b) helper-CPU idle probability with D = 3000 bits and K = 5. size regime and then converge gradually to a constant corresponding to the case of a large buffer. It implies that the maximum buffer gain is finite and independent of the buffer size. Moreover, the proposed policy with a longer computing deadline has a relatively larger buffer gain. The curves of buffer gain versus the helper-CPU idle probability are depicted in Fig. 6(b). Observe that given a fixed buffer size, as the helper-CPU idle probability increases, the buffer gain firstly slowly increases and then sees a fast and almost-linear increase when the helper-CPU idle probability is larger than 0.3. The reason is that, with a higher idle probability, the buffered data is more likely to be computed by the helper. On the other hand, given a fixed helper-CPU idle probability, the larger buffer size enjoys a larger buffer gain, which is expected. VIII. C ONCLUDING R EMARKS This paper investigates the stochastic computation offloading to a helper with a dynamically loaded CPU. Assuming that the user only has statistical information of the helper CPU and channel states, one MDP optimization problem is formulated to minimize the expected userenergy consumption by controlling the offloaded and locally-computed data sizes in different slots. We first characterize the optimal policy structure for the case of zero buffer at the helper. Then for the cases of large and small helper buffer, we propose effective sub-optimal computation offloading policies by using approximation techniques and candidate-policy selection scheme, respectively, which are shown to have close-to-optimal performance in simulation. This work can be extended in several interesting directions. First, the current work focusing on one-shot 27 task arrival can be generalized to the case of bursty data arrivals. Second, P2P computation offloading can be integrated with advanced computing techniques such as parallel computing to achieve higher energy savings gain. Last, it is interesting to extend the current helper-assisted computation offloading system to a more complex one, e.g., finite computation capacity at helpers and collaborative offloading among mobiles. A PPENDIX A. Proof of Lemma 2 (C) First, if xK = 0, computation offloading is not allowed and thus the user-energy consumption (L) (C) is directly given by JK (xK ) = α(xK )3 . Next, if xK = 1, taking the first-order derivative of the objective function −1and setting it to zero yields the optimal local computed  inqProblem P3 (lo)∗ (H) (L) xK . The corresponding minimum energy consumption data size uK = 1 + αxK /λ −2  q (H) (C) (C) (L) 3 . Last, combining the results for xK = 0 and xK = 1 JK (xK ) = α(xK ) 1 + αxK /λ together leads to the desired results. B. Proof of Theorem 1 We first derive the minimum expected user-energy from slot (K − 1) to K for both the cases (C) (C) (C) of xK−1 = 1 and xK−1 = 0 as follows. If xK−1 = 0, the input-data cannot be offloaded, i.e., (of) uK−1 = 0. Then the optimization problem reduces to io n h (lo) (lo) JK−1 (xK−1 ) = min α(uK−1 )3 + E JK (XK ) xK−1 , uK−1 . (L) (lo) 0≤uK−1 ≤xK−1 (i) = min (lo) (L) 0≤uK−1 ≤xK−1 n o (lo) (L) (lo) (C) (H) α(uK−1 )3 + α(xK−1 − uK−1 )3 × SK−1 (xK−1 , xK−1 ) , (38) where (i) is according to Lemma 2 and (C) (H) SK−1 (xK−1 , xK−1 ) = X X (C) xK ∈{0,1} (H) xK ∈{g,b} (C) (C) (H) (H) Pr(xK |xK−1 ) Pr(xK |xK−1 ) r  1+ α (C) x λ K −2 q (H) xK . Taking the first-order derivative of the objective function in (38) and setting it to zero, we have  −1 1 (lo)∗  x(L) uK−1 = 1 + q (39) K−1 . (C) (H) SK−1 (xK−1 , xK−1 ) 28 Substituting (39) into (38) yields: −2  1 (L)  JK−1 (xK−1 ) = α(xK−1 )3 1 + q (C) (H) SK−1 (xK−1 , xK−1 ) (C) , if xK−1 = 0. (40) (C) If xK−1 = 1, both the locally-computed and offloaded data sizes should be optimized. The optimization problem reduces to ( JK−1 (xK−1 ) = min uK−1 ∈U (xK−1 ) (lo) α(uK−1 )3 + λ (of) (uK−1 )3 (H) xK−1  (L) (lo) (of) + α xK−1 − uK−1 − uK−1 3 ) (C) (H) SK−1 (xK−1 , xK−1 ) . Using the Lagrange method leads to the following optimal local computing and offloading policy: −1  r r α α (H) (lo)∗ 1 (H) (lo)∗ (L) (of)∗ + xK−1  xK−1 , and uK−1 = x u . (41) uK−1 = 1 + q λ λ K−1 K−1 (C) (H) SK−1 (xK−1 , xK−1 ) The corresponding minimum expected user-energy consumption is:  −2 r 1 α (H)  (L) (C) JK−1 (xK−1 ) = α(xK−1 )3 1 + q , if xK−1 = 1. + xK−1 λ (C) (H) SK−1 (xK−1 , xK−1 ) (42) Then combining (39) and (41) leads to the optimal offloading-control policy in slot (K − 1):  −1 r q 1 α (C) (lo)∗ (L) (H) uK−1 = 1 + q (43) + xK−1 xK−1  xK−1 , λ (C) (H) SK−1 (xK−1 , xK−1 ) r q α (C) (of)∗ (H) (lo)∗ uK−1 = xK−1 xK−1 uK−1 . (44) λ The minimum expected user-energy consumption for slot (K − 1) to K can be derived as below by combining (40) and (42):  1 (L) JK−1 (xK−1 ) = α(xK−1 )3 1 + q + (C) (H) SK−1 (xK−1 , xK−1 ) r −2 α (C) x λ K−1 q (H) xK−1  . (45) Observe that the expected user-energy consumption from slot (K − 1) and K, given in (45), has the similar form with that in slot K as given in (15). Therefore, using the backward induction and the similar procedure as for deriving (45), we can derive the optimal computation offloading policy in each slot k and the minimum expected user-energy consumption, as expressed in Theorem 1, completing the proof. 29 C. Proof of Lemma 4 We prove this lemma by deriving the minimum expected user-energy for both the cases of (C) xK−1 (C) (C) = 1 and xK−1 = 0 respectively, and then combining the results together. First, if xK−1 = 1, (C) (L) (lo) (of) (C) we have F (xK−1 , uK−1 , xK ) = (xK−1 − uK−1 − uK−1 )3 where F (xK−1 , uK−1 , xK ) is defined in (25), and thus   (L) (lo) (of) (C) (H) (C) E JK (XK ) xK−1 , uK−1 = α(xK−1 − uK−1 − uK−1 )3 × S(xK−1 , xK−1 ), if xK−1 = 1, (46) (C) (H) (C) where S(xK−1 , xK−1 ) is defined in (28). Next, if xK−1 = 0, the newly-offloaded data in slot (K − 1) is stored at the buffer and thus h i3 (C) (L) (lo) (of) (C) (Q) (of) F (xK−1 , uK−1 , xK ) = (xK−1 − uK−1 − uK−1 ) + (1 − xK )(xK−1 + uK−1 ) . Then it follows   E JK (XK ) xK−1 , uK−1 # " r −2   q (i) α (C) (H) (C) X xK−1 XK ≥ αE F (xK−1 , uK−1 , XK ) xK−1 , uK−1 × E 1 + λ K   3 (ii) (C) (H) (L) (lo) (lo) (C) (Q) (of) × S(xK−1 , xK−1 ) ≥ α E (xK−1 − uK−1 − uK−1 ) + (1 − XK )(xK−1 + uK−1 ) xK−1 , uK−1 (iii) = α  (L) xK−1 − (lo) uK−1 − (lo) uK−1 ) + (Q) P00 (xK−1 + (of) uK−1 ) 3 (C) (H) × S(xK−1 , xK−1 ), (C) if xK−1 = 0, (47) r  −2 q α (C) (H) where (i) is due to that and 1 + X XK are positively corλ K (C) related; (ii) follows from Jensen’s inequality; and (iii) is due to that E[(1 − XK )|xK−1 , uK−1 ] = (C) F (xK−1 , uK−1 , XK ) (C) P00 , if xK−1 = 0. Last, combining the results of (46) and (47) and using the definition of (C) V (xK−1 ) in (29) lead to the desired results. D. Proof of Lemma 5 (C) (C) We prove this lemma by solving Problem P5 for both the cases of xK−1 = 1 and xK−1 = 0 (C) respectively, and then combining the results together. First, if xK−1 = 1, the optimal solution for solving Problem P5 is same as that of zero-buffer case, given as  −1 r r 1 α (H)  α (H) (lo)∗ (lo)∗ (L)  (of)∗ uK−1 = xK−1 1+ q + xK−1 and uK−1 = x u . λ λ K−1 K−1 (C) (H) S(xK−1 , xK−1 ) (48) 30 The minimum expected user-energy consumption is  −2 r 1 α (H)  (C) (L) xK−1 , if xK−1 = 1. (49) JK−1 (xK−1 ) = α(xK−1 )3 1 + q + λ (C) (H) S(xK−1 , xK−1 ) h i3 (C) (L) (lo) (of) (Q) (of) e Next, if xK−1 = 0, we have F (xK−1 , uK−1 ) = (xK−1 −uK−1 −uK−1 ) + P00 (xK−1 + uK−1 ) . Substituting it into Problem P5 and solving it by the Lagrangian method, the optimal policy for Problem P5 is    (lo)∗ (L) (Q) uK−1 = xK−1 + P00 xK−1 1 + q 1 (C) (H) S(xK−1 , xK−1 ) r + −1 3 α (1 − P00 ) 2 λ (H) xK−1  , (50) r α (H) (lo)∗ xK−1 (1 − P00 )uK−1 , λ The corresponding minimum expected user-energy consumption is 3  (L) (Q) JK−1 (xK−1 ) = α xK−1 + P00 xK−1  −2 r 3 1 α (H)  1 + q , x + (1 − P00 ) 2 λ K−1 (C) (H) ŜK−1 (xK−1 , xK−1 ) (of)∗ q uK−1 = (C) (51) if (C) xK−1 = 0. (C) Last, combining the policies for the cases of xK−1 = 1 (see (48)) and xK−1 = 0 (see (50)) gives the sub-optimal policy in slot (K − 1), as presented in the lemma. The expected user-energy consumption in slot (K − 1) can be expressed as (34) by combining (49) and (51), completing the proof. E. Proof of Lemma 6 Assume that both G1 (Q) and G2 (Q) are continuous functions with Q. First, when Q = 0, we can obtain that G1 (0) < G2 (0), since it corresponds to the case of zero buffer and ZBP leads to the optimal policy. On the other hand, when Q = D, we have G1 (D) > G2 (D) as it refers to the case of large buffer and TLBP yields the better solution. Then, applying the intermediate-value theorem leads to the desired result. R EFERENCE [1] M. Patel, B. Naughton, C. Chan, N. Sprecher, S. Abeta, A. Neal, et al., “Mobile-edge computing introductory technical white paper,” White Paper, Mobile-edge Computing (MEC) industry initiative, Sep. 2014. [2] Y. Mao, C. You, J. Zhang, K. Huang, and K. B. Letaief, “A survey on mobile edge computing: The communication perspective,” IEEE Commun. Surv. Tutor., vol. 19, no. 4, pp. 2322–2358, Aug. 2017. 31 [3] W. Zhang, Y. Wen, K. Guan, D. Kilper, H. Luo, and D. O. Wu, “Energy-optimal mobile cloud computing under stochastic wireless channel,” IEEE Trans. Wireless Commun., vol. 12, no. 9, pp. 4569–4581, Sep. 2013. [4] C. You, K. Huang, and H. Chae, “Energy efficient mobile cloud computing powered by wireless energy transfer,” IEEE J. Sel. Areas Commun., vol. 34, no. 5, pp. 1757–1771, May 2016. [5] S. E. Mahmoodi, R. N. Uma, and K. P. Subbalakshmi, “Optimal joint scheduling and cloud offloading for mobile applications,” IEEE Trans. on Cloud Comput., vol. PP, no. 99, pp. 1–1, Apr. 2016. [6] Y. Wang, M. Sheng, X. Wang, L. Wang, and J. Li, “Mobile-edge computing: Partial computation offloading using dynamic voltage scaling,” IEEE Trans. Commun., vol. 64, no. 10, pp. 4268–4282, Oct. 2016. [7] S.-W. Ko, K. Huang, S.-L. Kim, and H. Chae, “Live prefetching for mobile computation offloading,” IEEE Trans. Wireless Commun., vol. 16, no. 5, pp. 3057–3071, May 2017. [8] C. You, K. Huang, H. Chae, and B.-H. Kim, “Energy-efficient resource allocation for mobile-edge computation offloading,” IEEE Trans. Wireless Commun., vol. 16, no. 3, pp. 1397–1411, Mar. 2017. [9] X. Chen, L. Jiao, W. Li, and X. Fu, “Efficient multi-user computation offloading for mobile-edge cloud computing,” IEEE Trans. Netw., vol. 24, no. 5, pp. 2795–2808, Oct. 2016. [10] X. Lyu, H. Tian, C. Sengul, and P. Zhang, “Multiuser joint task offloading and resource optimization in proximate clouds,” IEEE Trans. Veh. Technol., vol. 66, no. 4, pp. 3435–3447, Apr. 2017. [11] L. Yang, J. Cao, H. Cheng, and Y. Ji, “Multi-user computation partitioning for latency sensitive mobile cloud applications,” IEEE Trans. Comput., vol. 64, no. 8, pp. 2253–2266, Aug. 2015. [12] S.-W. Ko, K. Han, and K. Huang, “Wireless networks for mobile edge computing: Spatial modeling and latency analysis (extended version),” [Online]. Available: https://arxiv.org/pdf/1709.01702.pdf. [13] J. Song, Y. Cui, M. Li, J. Qiu, and R. Buyya, “Energy-traffic tradeoff cooperative offloading for mobile cloud computing,” in Proc. IEEE Int. Symp. Quality of Service (IWQoS), pp. 284–289, May 2014. [14] Y. Li, L. Sun, and W. Wang, “Exploring device-to-device communication for mobile cloud computing,” in Proc. IEEE Int. Conf. Commun. (ICC), pp. 2239–2244, Jun. 2014. [15] X. Chen, L. Pu, L. Gao, W. Wu, and D. Wu, “Exploiting massive D2D collaboration for energy-efficient mobile edge computing,” [Online]. Available: https://arxiv.org/pdf/1703.10340.pdf. [16] N. T. Ti and L. B. Le, “Computation offloading leveraging computing resources from edge cloud and mobile peers,” in Proc. IEEE Int. Conf. Commun. (ICC), pp. 1–6, May 2017. [17] J. Xu, L. Chen, K. Liu, and C. Shen, “Less is more: Participation incentives in D2D-enhanced mobile edge computing under infectious ddos attacks,” [Online]. Available: https://arxiv.org/pdf/1611.03841.pdf. [18] X. Cao, F. Wang, J. Xu, R. Zhang, and S. Cui, “Joint computation and communication cooperation for mobile edge computing,” [Online]. Available: https://arxiv.org/pdf/1704.06777.pdf. [19] C. You and K. Huang, “Exploiting non-causal CPU-state information for energy-efficient mobile cooperative computing,” [Online]. Available: https://arxiv.org/pdf/1704.04595.pdf. [20] W. Zhang, Y. Wen, and D. O. Wu, “Collaborative task execution in mobile cloud computing under a stochastic wireless channel,” IEEE Trans. Wireless Commun., vol. 14, no. 1, pp. 81–93, Jan. 2015. [21] J. Liu, Y. Mao, J. Zhang, and K. B. Letaief, “Delay-optimal computation task scheduling for mobile-edge computing systems,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), pp. 1451–1455, Jul. 2016. [22] M. Jia, J. Cao, and L. Yang, “Heuristic offloading of concurrent tasks for computation-intensive applications in mobile cloud computing,” in Proc. IEEE INFOCOM Workshops, pp. 352–357, Apr. 2014. [23] D. Huang, P. Wang, and D. Niyato, “A dynamic offloading algorithm for mobile computing,” IEEE Trans. Wireless Commun., vol. 11, no. 6, pp. 1991–1995, Jun. 2012. 32 [24] Y. Mao, J. Zhang, and K. B. Letaief, “Dynamic computation offloading for mobile-edge computing with energy harvesting devices,” IEEE J. Sel. Areas Commun., vol. 34, no. 12, pp. 3590–3605, Dec. 2016. [25] J. Kwak, Y. Kim, J. Lee, and S. Chong, “Dream: Dynamic resource and task allocation for energy minimization in mobile cloud systems,” IEEE J. Sel. Areas Commun., vol. 33, no. 12, pp. 2510–2523, Dec. 2015. [26] L. Chen, S. Zhou, and J. Xu, “Energy efficient mobile edge computing in dense cellular networks,” [Online]. Available: https://arxiv.org/pdf/1701.07405.pdf. [27] A. Fu, E. Modiano, and J. N. Tsitsiklis, “Optimal transmission scheduling over a fading channel with energy and deadline constraints,” IEEE Trans. Wireless Commun., vol. 5, no. 3, pp. 630–641, Mar. 2006. [28] B. Prabhakar, E. U. Biyikoglu, and A. El Gamal, “Energy-efficient transmission over a wireless link via lazy packet scheduling,” in Proc. IEEE INFOCOM, vol. 1, pp. 386–394, Apr. 2001. [29] A. P. Chandrakasan, S. Sheng, and R. W. Brodersen, “Low-power CMOS digital design,” IEICE Trans. Electron., vol. 75, no. 4, pp. 371–382, Apr. 1992. [30] M. Zafer and E. Modiano, “Minimum energy transmission over a wireless channel with deadline and power constraints,” IEEE Trans. Autom. Control, vol. 54, no. 12, pp. 2841–2852, Dec. 2009. [31] M. J. Neely, E. Modiano, and C. E. Rohrs, “Dynamic power allocation and routing for time-varying wireless networks,” IEEE J. Sel. Areas Commun., vol. 23, no. 1, pp. 89–103, Jan. 2005. [32] D. P. Bertsekas, Dynamic programming and optimal control, vol. 1. Athena scientific Belmont, MA, 1995.
7cs.IT
Contextual Multi-Scale Region Convolutional 3D Network for Activity Detection Yancheng Bai1 , Huijuan Xu2 , Kate Saenko2 , Bernard Ghanem1 1 KAUST, Saudi Arabia, 2 Boston University, USA, 3 Institute of Software, CAS, China arXiv:1801.09184v1 [cs.CV] 28 Jan 2018 {yancheng.bai, bernard.ghanem}@kaust.edu.sa, {hxu, saenko}@bu.edu Abstract Activity detection is a fundamental problem in computer vision. Detecting activities of different temporal scales is particularly challenging. In this paper, we propose the contextual multi-scale region convolutional 3D network (CMSRC3D) for activity detection. To deal with the inherent temporal scale variability of activity instances, the temporal feature pyramid is used to represent activities of different temporal scales. On each level of the temporal feature pyramid, an activity proposal detector and an activity classifier are learned to detect activities of specific temporal scales. Temporal contextual information is fused into activity classifiers for better recognition. More importantly, the entire model at all levels can be trained end-to-end. Our CMSRC3D detector can deal with activities at all temporal scale ranges with only a single pass through the backbone network. We test our detector on two public activity detection benchmarks, THUMOS14 and ActivityNet. Extensive experiments show that the proposed CMS-RC3D detector outperforms state-of-the-art methods on THUMOS14 by a substantial margin and achieves comparable results on ActivityNet despite using a shallow feature extractor. Figure 1. In unconstrained settings, activity instances in videos have varying durations. However, most of prior activity detectors deploy feature maps of the fixed temporal resolution for activity detection. This creates an inconsistency between the inherent variability in temporal length of activity instances and the fixed temporal resolution of features, thus, leading inferior performance. es, a subset of proposals are generated via sliding window or proposal methods and then a classifier is used to classify these temporal segments as a specific activity category. Most approaches suffer from the following major drawbacks. 1) When detecting activity instances of multiple temporal scales, they rely on either hand-crafted feature maps, or deep convolutional (conv) feature maps like VGG [27], Inception [29], ResNet [11] or C3D [30] with a fixed temporal resolution. However, as shown in Figure 1, activity instances of the same category in the same video have different temporal scales (durations). Thus, there is an inconsistency between the inherent temporal scale variability of activity instances and the fixed temporal resolution of the feature maps, which might degrade the detection performance. Clearly, we can deal with this problem by observing video segments at multiple temporal scales like multi-scale sliding windows, however, this increases inference time. 2) With fixed temporal resolution of the conv feature maps, contextual information, which has been demonstrated to be very effective in describing activities and boosting activity classification performance [19, 12, 34], is not fully exploited. 1. Introduction Temporal activity detection has attracted a lot of attention in computer vision in recent years due to its many applications, including content based video retrieval for web search engines, activity monitoring in video surveillance, etc. Activity detection in untrimmed videos is a challenging problem, since instances of an activity can happen at arbitrary times in arbitrarily long videos. Many works have been proposed to solve this problem and much progress has been made [25, 24, 3, 33, 8, 37]. However, how to detect temporal activity boundaries in untrimmed videos precisely is still an open question. Inspired by the great success of R-CNN [10] and Faster RCNN [22] in object detection, most existing state-of-theart activity detection approaches [25, 3, 33, 37] deal with this problem as detection by classification. In most cas- Following the detection by classification framework, we propose the contextual multi-scale (duration) region convolutional 3D network (CMS-RC3D) for activity detection in videos. To deal with activities of various temporal scales, we create the multi-scale temporal feature pyramid to represent activities. One model is trained on each level of the temporal feature pyramid to detect activity instances within 4321 specific duration ranges. Each model has its own conv feature maps of different temporal resolutions, which can handle activities of different temporal scales better than using a single scale approach. In doing so, contextual information is fused when recognizing activities, thus, enabling our proposed detector to achieve state-of-the-art performance. improve classification accuracy. However, these approaches focus on activity recognition rather than activity detection. In [3], semantic context information garnered from activityobject and activity-scene relationships is exploited to address challenges in activity detection. However, it requires an extra generic object proposal generator and classifier to prune out activity proposals and classes that are not likely in the context. As such, it inherently has the same limited temporal resolution issue as before, requires more processing and semantic information, and is not end-to-end. Compared to [3], our contextual encoding method is relatively simple and can be trained end-to-end. Contributions. This paper makes three main contributions. (1) A new multi-scale region convolutional 3D network architecture for activity detection is proposed, where each scale model is trained to handle activities of a specific temporal scale range. More importantly, the detector can detect activities in videos with a variety of temporal scales in a single pass. (2) Contextual information is fused to recognize activities, which can improve detection performance. (3) The proposed CMS-RC3D detector achieves state-of-theart results on THUMOS14 benchmark, and gets improved results on ActivityNet compared to the original RC3D model without multi-scale and context consideration. 2.3. Multi-Scale Modeling for Activity Detection To deal with activities of multiple durations in untrimmed videos, deep action proposals (DAPs) [9] use long short term memory (LSTM) to model the temporal dependencies across frames. To save computations on overlapping temporal windows, single-stream temporal action proposals (SST) [2] exploits a Gated Recurrent Unit (GRU)based sequence encoder to model proposals of different temporal scales at each time step. The state of the Recurrent Neural Networks (RNNs) tends to saturate for long sequences, thus making the previous methods [9, 2] not appropriate for the multi-scale modeling problem. Compared to both these methods, the proposed CMS-RC3D detector constructs the temporal feature pyramid of different temporal resolutions explicitly rather than using LSTM or GRU to learn the temporal dependencies. 2. Related Work 2.1. Temporal Activity Detection Temporal activity detection needs to locate when and which type of activity happens in untrimmed diverse videos, leading to a very challenging task. In contrast to object detection, most existing temporal activity detection approaches [25, 33, 37, 3] can be categorized into the detection by classification framework. S-CNN [25] proposes a three-stage CNN for candidate segment generation, action classification and temporal boundary refinement. To deal with the limited temporal resolution issue it faces, SCNN needs to consider video segments of varied temporal lengths and then uniformly samples 16 frames for C3D [30] feature extraction. Recently, an end-to-end trainable network named R-C3D [33] was proposed, which learns taskdependent convolutional features by jointly optimizing proposal generation and activity classification. R-C3D utilizes a fixed temporal length feature for multi-scale activity detection, which might contribute to imprecise results when detecting activities of various durations in videos. In [37], to deal with the limited temporal resolution issue, a heuristic multi-scale grouping strategy is proposed in the structured segment network (SSN). Compared to these methods, the proposed CMS-RC3D detector constructs the temporal feature pyramid and learns a multi-scale model end-to-end to deal with activities of different temporal scales. 2.4. Object Detection Recently, with the break-through results of CNNs for image classification and scene recognition [17, 27, 29, 11], generic object detectors based on CNNs, e.g., the Regionbased CNN (RCNN) [10], Faster RCNN [22] and other variants have been introduced [18, 6]. These methods share a similar two-stage pipeline (proposals followed by classification). Specifically, Faster RCNN [22] has recently achieved a balance between both detection performance and computational efficiency. To deal with small objects, the work [6] uses intermediate conv feature maps with fine resolution to represent small objects and learn multi-scale proposal models. Feature Pyramid Network (FPN) [18] fuses different conv feature maps by the lateral connection and topdown pathway, which makes the features at fine resolution more powerful and represent small objects better. These two works [6, 18] show significant improvements on small object detection due to this multi-scale fine representation. Analogous to spatial scales in object detection, there are activities with different temporal scales in real-world videos. Inspired by [6, 18], we construct the temporal feature pyramid for a video, which consists of feature maps with different temporal resolutions to represent activities 2.2. Context Modeling for Activity Detection Many approaches have incorporated context cues to boost activity recognition performance [13, 32]. In [13], the co-occurrence between activities and a sparse number of objects has been studied. In [32], neural network are introduced to learn object, scene, and activities relationships to 4322 Figure 2. The pipeline of the proposed CMS-R3CD activity detector. (A) Input videos can contain activities of different temporal scales; (B) The shared feature extractor is used to extract spatio-temporal features from input videos, which can be any type of typical architectures; (C) To deal with activities of different temporal scales, the temporal feature pyramid is created, of which each level is with different temporal resolutions to represent activities of short, medium and long temporal scales simultaneously; (D) On each level of the temporal feature pyramid, an activity proposal detector is learned to detect candidate activity segments within specific temporal scale ranges; (E) 3D-RoI pooling is used to extract contextual and non-contextual features for the selected activity proposals from each level of the temporal feature pyramid. Then, the contextual and non-contextual features are concatenated and fed into the kth specific activity classifier, which outputs activity categories and refines activity segment boundaries. I3D [7] and P3D ResNet [21], etc. However, it has been shown that both spatial and temporal features are important for representing videos. A 3D ConvNet [30, 7, 21] encodes rich spatial and temporal features in a hierarchical manner, which has been experimentally demonstrated to be effective in summarizing spatio-temporal patterns from raw videos into high-level semantics. Therefore, in our current implementation, we use the shallow C3D ConvNet [30] as the backbone network to extract spatial-temporal features from a given input video buffer. We adopt the conv1a to conv5b layers from C3D ConvNet [30] as the feature extraction network. C3D takes an input sequence V of RGB frames with dimension R3×L×H×W as input, and outputs the conv feature mapL H W s R512× 8 × 16 × 16 , whereby there are 512 channel dimensions of layer conv5b, and 8 and 16 temporal and spatial strides. H and W denote the height and width of input frames, respectively. The conv5b feature maps are used as the shared inputs to the following temporal feature pyramid, activity proposal and classification sub-networks. Such feature sharing makes our detector efficient, since this step is the most time-consuming in the whole system. with short, medium and long duration, leading to better fidelity in localizing activity segments. 3. Approach In this section, we introduce our contextual multi-scale region convolutional 3D network (CMS-RC3D) for activity detection. As shown in Figure 2, the whole architecture consists of five components, network input, feature extraction network, temporal feature pyramid network, activity proposal and activity classification networks. In the following, we give a detailed description of each component. 3.1. The Network Input The input of our network is an untrimmed video with arbitrary length, which is only limited by GPU memory. Let us denote a video V as a series of frames V = {Il }L l=1 , where Il is the lth frame and L is the total number of frames. When training, each video V is annotated with a set of temend N poral activities Ψ = {(tst n , tn , cn )}n=1 , where N is the st number of temporal activities in V, tn and tend n are the startend times of the segment window for the nth activity. cn stands for the category and cn ∈ {1, · · · , C}, where C is the number of activity categories. When inferring, we need to predict all categories of activities in a video V, and locate the start-end times of their segment windows. 3.3. Temporal Feature Pyramid Network In unconstrained settings, activities in videos have varying temporal scales. To address this fact, many previous works (e.g. [25]) create different temporal scales of the input and perform several forward passes during inference. Although this strategy makes it possible to detect activities 3.2. Feature Extraction Network The backbone network can be any of the typical architectures, including the two-stream network [26], C3D [30], 4323 Table 1. The anchor settings for each level of the temporal feature pyramid in the proposed CMS-RC3D activity detector. with different temporal scales, it inevitably increases the inference time. In contrast, we create a temporal feature pyramid (TFP) with different temporal strides to detect activities of different temporal scales, as shown in Figure 2 (C). More specifically, a three-level pyramid is created, which is designed to detect short, medium and long duration activities simultaneously. With this temporal feature pyramid, our detector can efficiently detect activities of all temporal scales in a single forward pass. The temporal stride of the conv5b feature maps in the C3D network is 8. To detect activities of longer durations, we add two extra branches with temporal strides of 16 and 32, respectively. Thus, there are K = 3 levels of the temporal feature pyramid and the strides of each level are sk ∈ {8, 16, 32}. To create the temporal feature pyramid, down-sampling is applied on the final conv5b map to produce two extra level feature maps with different temporal strides. In our current implementation and for simplicity, max pooling and 3-D convolution with stride 2 are used for down-sampling. Using this temporal feature pyramid can save a substantial amount of computational cost compared to generating multi-scale video segments, which have to pass through the backbone network several times. Strides 8 16 32 Anchor Settings 1:7 4 : 10 6 : 16 Temporal Scale Ranges 8 − 56 64 − 160 192 − 512 these levels are {8, 16, 32}, respectively. As presented in Table 1, we use {7, 7, 11} anchors of different temporal scales for the corresponding levels of the temporal feature pyramid. And the temporal scale ranges of each level are 8 − 56, 64 − 160, 192 − 512 frames1 , respectively. Therefore, our proposal detector can handle a very wide range of temporal scales in an input video in a single shot. Training: When training, we need to assign labels to the anchors based on their time intersection-over-union (tIoU) ratios with ground-truth activities. Typically, we assign an anchor with a positive label if it has the highest tIoU for a given ground-truth activity or it has a tIoU higher than 0.7 with any ground-truth activity, and a negative label if it has a tIoU lower than 0.3 for all ground-truth activities. All other candidates are excluded from training. For proposal segment window regression, anchors are transformed according to the corresponding ground truth activities using the coordinate transformations in [33]. The same minibatch size of 64 is employed for each scale model. And we fix the positive/negative ratio to 1:1. 3.4. Activity Proposal Network Activity proposal network (APN) is a class-agnostic activity detector to find candidate activity segments for the final classification network. To detect activity proposals of different scales more efficient, the single temporal scale feature map in [33] is replaced by the multi-scale TFP of this paper and we learn an APN on each level of the TFP, as shown in Figure 2 (D). Inspired by [33], an additional 3D conv filters with kernel size 3 × 3 × 3 operates on each level of the TFP to generate feature maps for predicting temporal proposals. The spatial dimensions of these new conv maps are down-sampled to produce temporal only feature map512× sL ×1×1 k k , where sk denotes the temporal s Ctpn ∈ R stride of the k th level of the TPN. Specifically, this is done H by applying a 3D pooling with kernel size 1 × 16 ×W 16 . Fik nally, a sub-network slides on the Ctpn features densely to perform activity/non-activity binary classification and time window regression by adding two sibling 1×1×1 conv layk ers on top of Ctpn . In order to detect activity proposals of different durations, anchors of multiple temporal scales are pre-defined, in which an anchor denotes a candidate time window associated with a scale and serves as a reference segment for activity proposals at each temporal location. As compared to [33], each scale model in our architecture only needs to predict activities whose temporal scales lie in a limited range, rather than a single wide range. We assign anchors of specific temporal scales to each level according to training statistics. As mentioned earlier, there are K = 3 levels of the feature pyramid. The strides of 3.5. Activity Classification Network The activity classification network (ACN) is a segmentbased activity detector. Due to the arbitrary length of activity proposals, 3D-Region-of-Interest (3D-RoI) pooling [33] is used to extract fixed-size features for selected proposal segments. Then, the pooled features are fed into fc6 and fc7 layers in the C3D network, followed by two sibling networks, which output activity categories and refine activity boundaries by classification and regression, respectively. In [33], ACN is only performed on a single-scale feature map conv5b. To use the TFP, we need to assign activity proposals of different temporal scales to the levels of the TFP so as to perform 3D-RoI pooling. We propose three different strategies for assigning activity proposals to learn the ACN. In Strategy 1 (S1), we assign all proposals to the conv5b feature maps (the first level of the TFP) as in [33]. However, this will not fully exploit the feature maps with multiple temporal resolutions of the TFP. In Strategy 2 (S2), we assign proposals to the specific level of the TFP, from which proposals are generated. 1 We can increase temporal scale ranges of all anchors by sampling video frames at a lower frame rate. For example, the temporal ranges are approximately 2 − 245 seconds covering over 99% training activities in ActivityNet if we sample videos at 3 frames per second. 4324 However, the ACN for activities of long duration might not train well, since activities of long duration might be small in number. In Strategy 3 (S3), we assign all proposals to all levels of the TFP, which takes advantage of the feature maps of multiple resolutions and avoids the issues of training ACN on less frequent activities (especially those with long duration). We validate the effectiveness of these three strategies in Section 4.3. Our ACN can easily incorporate contextual information, which has been shown to be important for activity detection [3]. We simply double the time window of candidate proposals and use 3D-RoI pooling to extract the contextual information for the doubled time window, as shown in Figure 2 (E). To make the feature maps fit into the fc6 layer of C3D, we reduce the number of channels in the contextual and original pooled feature maps from 512 to 256 using 3 × 3 × 3 conv layers and concatenate them. As in [33], the new feature maps are passed through the fc6 layer for activity prediction. Training: When training the activity classifiers, an activity label needs to be assigned to each proposal generated by APN. If a proposal’s highest tIoU with any groundtruth activity is greater than 0.5, it is allocated that groundtruth activity label. A proposal is allocated the background label if its tIoU with all ground-truth activities is lower than 0.5. For segment window regression, the startend times are transformed according to the corresponding ground-truth activities using the coordinate transformation employed in [33]. We set the same mini-batch size of 64 with the positive/negative ratio of 1 : 3 for each scale model. the same importance. This can be changed to reflect the duration statistics of activities in the training data. λk is the tradeoff parameter between classification and localization. In our experiments, each λk is set to 1. 3.7. Inference Since our method falls into the detection by classification category, there are two main steps for activity detection in our model. First, APN scores all anchors and predicts start-end segment window offsets. Then, non-maximum suppression (NMS) with tIoU threshold 0.7 is applied to all anchors of all temporal scales to obtain final proposal candidates. Second, the selected proposals are classified into specific activities and segment boundaries are further refined by ACN. Finally, NMS with a lower tIoU threshold 0.4 is applied to predicted activities to get the final results. 4. Experiments In this section, we experimentally validate our proposed CMS-RC3D detector on two large-scale action detection benchmark datasets: THUMOS14 [15] and ActivityNet [5]. Firstly, we introduce these datasets and other experimental settings and then investigate the impact of different components via a set of ablation studies on the ActivityNet validation set. Secondly, we evaluate our CMS-RC3D detector on both these public benchmarks, while comparing the performance against other state-of-the-art approaches. 4.1. Evaluation Datasets 3.6. Optimization To train the proposal and classification networks, we need to optimize both classification and regression tasks jointly. Following conventions in the field, the softmax loss function and the smooth L1 loss function are used for classification and time window regression, respectively. Specifically, the objective loss function is defined by: L(y, t) = K X k=1 γk N X ∗ ∗ (Lcls (yki , yki ) + λk yki Lloc (tki , t∗ki )) i=1 (1) where y = [y1i , ...y1N , ..., yK1 , ..., yKN ] and t = [p1i , ...t1N , ..., tK1 , ..., tKN ] denote the vectors of predicted labels and time windows of the corresponding anchors or proposals, respec∗ ∗ ∗ ∗ tively. y∗ = [y1i , ...y1N , ..., yK1 , ..., yKN ] and ∗ ∗ ∗ ∗ ∗ t = [t1i , ...t1N , ..., tK1 , ..., tKN ] denote the vectors of ground-truth labels and time windows. N denotes the mini-batch size, while γk balances the importance of models at different branches. In our experiments, each γk is set to 1, which means that all K sub-models have 4325 THUMOS14 [15] contains 1010 videos for validation and 1574 videos for testing. These videos contain annotated action instances from 20 different sport activities. This dataset is particularly challenging as there are many activity instances of very short duration in very long videos. Since the training set is trimmed, we resort to training our models on its validation set and evaluate them on the testing set. In summary, there are about 200 untrimmed videos from 20 action classes for training and 213 videos for testing. ActivityNet [5] is a recently released large-scale activity detection benchmark. There are two versions, and we use the latest version 1.3, which consists of 10024, 4926 and 5044 videos in the training, validation and testing subsets respectively. ActivityNet contains 200 different types of activities. Many videos in this dataset contain activity instances of a single class covering most of the duration of the video. Compared to THUMOS14 [15], ActivityNet has much more diversity both in terms of the number of activity categories and the number of videos. Since the ground-truth annotations of test videos are not public, following traditional evaluation practices on this dataset and for fair comparison, we use the evaluation subset for ablation studies. Evaluation Metrics. Each dataset has its own convention of performance metrics. Following their conventions, Table 2. Ablation study of each component in the CMS-RC3D framework. Action detection results are measured by mean average precision (mAP) @0.5, [email protected], [email protected] and the average mAP of tIoU thresholds from 0.5 : 0.05 : 0.95 on ActivityNet validation dataset. MS denotes the multi-scale model. MAX and CONV denote different methods to construct the temporal feature pyramid. S1, S2 and S3 denote different strategies for assigning proposals. CTX denotes contextual modeling. The same annotations are used in Table 3. we report the mean average precision (mAP) at different tIoU thresholds. On THUMOS14, we report the detection results at tIoU thresholds {0.1, 0.2, 0.3, 0.4, 0.5}. Following traditional evaluation practises, the mAP at 0.5 tIoU is used for comparing final results from different methods. On ActivityNet, we use the standard evaluation protocol and report the mAP at different tIoU thresholds, i.e. 0.5, 0.75, 0.95, and the average of mAP values with tIoU thresholds [0.5 : 0.05 : 0.95] for comparing different methods. Method RC3D [33] MS(MAX)(S1) MS(CONV)(S1) MS(MAX)(S1)(CTX) MS(CONV)(S1)(CTX) MS(CONV)(S2)(CTX) MS(CONV)(S3)(CTX) 4.2. Implementation Details Training setup. When training the CMS-RC3D detector, each mini-batch is constructed from one video, chosen uniformly at random from the training dataset. Each frame in a video is resized to 172 × 128 (width × height) pixels, and we randomly crop regions of 112×112 from each frame. To fit each batch into GPU memory, we create a video buffer of 768 frames. The buffer is generated by sliding from the beginning of the video to the end and from the end of the video to the beginning to increase the amount of training data, which can be seen as a data augmentation strategy. We also employ data augmentation by horizontally flipping all frames in a batch with a probability of 0.5. 0.5 26.33 27.65 28.01 31.81 32.57 31.89 32.92 0.75 10.46 13.93 13.80 17.05 16.92 17.23 18.36 0.95 1.25 1.12 1.20 1.06 1.07 1.16 1.13 Average 12.71 14.91 15.12 17.58 17.89 17.72 18.46 Table 3. The activity proposal detection results generated by RC3D and our multi-scale models. Method RC3D [33] MS(MAX)(S1) MS(CONV)(S1) Hyper-parameters. The weights of the filters of all new added layers are initialized by randomly drawing from a zero-mean Gaussian distribution with standard deviation 0.01. Biases are initialized at 0.1. All other layers are initialized from the pre-trained C3D model. The learning rate is initially set to 10−4 and then reduced by a factor of 10 after every 100k iterations. Training is terminated after a maximum of 150k iterations. We also use a momentum of 0.9 and a weight decay of 5 × 10−4 . Our system is implemented in Caffe [14] and its source code will be made publicly available. Prop. 100 100 100 AR 56.0 56.6 56.8 conv layers to construct the TFP. As shown in the 2nd and 3rd rows of Table 2, we observe that the MS(CONV)(S1) model (i.e. a model using conv for the TFP shows slightly better performance than the MS(MAX)(S1) model (i.e. a model using max pooling for the TFP). The improvement can be also observed when incorporating contextual information (refer to the 4th and 5th rows of Table 2). Contextual vs. Non-contextual Modeling. Here, we evaluate the impact of temporal context information on detection performance. To incorporate contextual information, We simply double the time window of activity proposals and use 3D-RoI pooling to extract contextual features. Table 2 lists the performance of models with and without contextual modeling. From these results, we conclude that contextual modeling can significantly improve detection performance (about 2.5% improvement in the average mAP; refer to the 2nd and 4th , the 3rd and 5th rows of Table 2). Activities are continuous in nature and temporal context gives information on when an activity might begin and end. Therefore, contextual modeling can lead to better activity localization, thus, improve the detector’s performance. 4.3. Ablation study Multi-Scales vs Single-Scale. The main strength of our multi-scale model is that it uses a conv feature map pyramid with different temporal resolutions for activity detection of different temporal scales. Compared to our baseline method RC3D [33], our MS(MAX)(S1) and MS(CONV)(S1) use the temporal feature pyramid for proposal generation and assign proposals on the conv5 layer for 3D ROI-Pooling. Detection results from our multi-scale models register an improvement of 2.2% and 2.4% in the average mAP over those from the single-scale model (refer to the 1st , 2nd and 3rd rows of Table 2). We also present the proposal detection results in Table 3, which shows better results of multi-scale models over the single scale model. These highlight the motivation of our method. Strategies For Assigning Proposals. To study the effect of assigning proposals for training the activity classifier discussed in Section 3.5, we evaluate the detection performances of different assigning strategies, which are presented in the 5th -7th rows in Table 2. From the comparisons, the detector with Strategy 3 achieves the best performance. How to Construct the Temporal Feature Pyramid? As we discuss in Section 3.3, we can employ max pooling or 4326 Table 4. Activity detection results on THUMOS14 testing dataset, measured by the mean average precision (mAP) of different tIoU thresholds α. Method Karaman et al. [16] Wang et al. [31] Oneata et al. [20] SparseProp [4] DAPs [9] SLM [23] FG [35] PSDF [36] S-CNN [25] CDC [24] TCN [8] RC3D [33] SS-TAD [1] SSN [37] Our RC3D CMS-RC3D 0.1 4.6 18.2 36.6 39.7 48.9 51.4 47.7 54.5 66.0 57.4 61.6 0.2 3.4 17.0 33.6 35.7 44.0 42.6 43.5 51.5 59.4 54.9 59.3 0.3 2.1 14.0 27.0 30.0 36.0 33.6 36.3 40.1 44.8 51.9 51.1 54.7 0.4 1.4 11.7 20.8 23.2 26.4 26.1 28.7 29.4 33.3 35.6 45.7 41.0 43.1 48.2 Table 5. Activity detection results on ActivityNet v1.3 testing dataset. The performances are measured by mean average precision (mAP) at different tIoU thresholds α and the average mAP of tIoU thresholds from 0.5 : 0.05 : 0.95. 0.5 0.9 8.3 14.4 13.5 13.9 15.2 17.1 18.8 19.0 23.3 25.6 28.9 29.2 29.8 35.8 40.0 Method RC3D [33] MSN [28] TCN [8] SSN [37] CMS-RC3D 0.5 26.45 28.67 37.49 43.26 32.79 0.75 11.47 17.78 23.47 28.70 18.39 0.95 1.69 2.88 4.47 5.63 1.24 Average 13.33 17.68 23.58 28.28 18.68 over prior state-of-the-art approaches at high tIoU thresholds (about 10.0% improvement @mAP 0.5 over the 2nd best method except our RC3D model), thus, indicating that the CMS-RC3D detector can more precisely localize activity intervals in untrimmed video sequences. This result provides even more justification of the temporal feature pyramid for multi-scale activity detection. Some qualitative detection results on THUMOS14 are shown in Figure 3(a). 4.5. Evaluation on ActivityNet [5] To measure the performance of CMS-RC3D on the ActivityNet v1.3 testing dataset, we submit our prediction results to the publicly available evaluation server maintained by the ActivityNet organizers. As shown in Table 5, we compare CMS-RC3D with state-of-the-art methods [33, 28, 8, 37] published recently. From the comparisons, CMSRC3D shows a significant improvement (about 5.0% in the average mAP of tIoU thresholds from 0.5 : 0.05 : 0.95) over our baseline method RC3D [33], which demonstrates the motivation of our method. CMS-RC3D shows inferior performance over TCN [8] and SSN [37]. However, both these methods use the two-stream network [26] as their feature extractor, which has been shown to be more discriminative than the C3D extractor deployed in our model. Compared to the much deeper two-stream network, which uses RGB and optical flow information, C3D only uses low resolution RGB information. We expect that the incorporation of flow in CMS-RC3D to further improve detection results as attested by previous works that make use of this extra information (about 4.0% in average mAP [8]). Moreover, our model is agnostic of the exact manifestation of the feature extractor and it can be changed into other networks, e.g., I3D [7] or P3D ResNet [21]. Some qualitative detection results on ActivityNet are shown in Figure 3(b). In Strategy 3, all proposals are assigned to each level of the TFP, which takes advantage of the temporal feature pyramid of different temporal resolutions and avoids the issues of training the activity classifiers on less frequent activities. This demonstrates that the advantage of using the TFP when training the activity classifiers. From the above comparisons, we conclude that modeling activities with the temporal feature pyramid of different temporal resolutions and encoding temporal contextual information can increase the activity detection performance significantly. In what follows, the CMS-RC3D detector is chosen to be the MS(CONV)(S3)(CTX) model, which learns the activity detector via using conv layers to construct the temporal feature pyramid, Strategy 3 for assigning activity proposals and contextual modeling. 4.4. Evaluation on THUMOS14 [15] In Table 4, we summarize the results of our CMS-RC3D detector for the task of temporal activity detection on THUMOS14 in comparison to existing state-of-the-art detectors. We re-train the origin RC3D model with better hyperparameter fine-tuning as our baseline model (i.e. akin to the single-scale version of our model), and we achieve better results for the original RC3D compared to the results reported in [33] (about 7.0% improvement @mAP 0.5; refer to the 12th and 15th rows of Table 4). The CMSRC3D shows about 4.0% improvement @mAP 0.5 over our RC3D model (refer to the last two rows of Table 4), which indicates the importance of exploiting the temporal feature pyramid and context information. Moreover, we also observe that CMS-RC3D registers superior performance 5. Conclusion In this paper, we propose a contextual multi-scale region convolutional C3D network for activity detection. In our CMS-RC3D, each scale model uses conv feature maps of specific temporal resolution to represent activities within specific temporal scale ranges. More importantly, the w4327 (a) THUMOS14 (b) ActivityNet Figure 3. Qualitative visualization of the predicted activities by CMS-RC3D (best viewed in color). Figure 3(a) and 3(b) show results for two videos each in THUMOS14 and ActivityNet. The ground-truth and predicted activity segments are marked in black and light blue respectively. Corresponding start-end times and confidence scores are shown inside brackets. From the results, we see that the CMS-RC3D detector can deal with activities of different temporal scales. hole detector can detect activities within all temporal ranges in a single shot, which makes it computationally efficient. CMS-RC3D is evaluated on two public activity detection benchmarks, THUMOS14 and ActivityNet, and achieves superior or at least comparable performance compared to other state-of-the-art detectors. Moreover, deep feature extractors can be used in the CMS-RC3D detector to further improve the performance. We will exploit various feature extractors and see their influence on activity prediction. 4328 References [1] S. Buch, V. Escorcia, B. Ghanem, L. Fei-Fei, and J. C. Niebles. End-to-end, single-stream temporal action detection in untrimmed videos. In Proceedings of the British Machine Vision Conference (BMVC), 2017. [2] S. Buch, V. Escorcia, C. Shen, B. Ghanem, and J. C. Niebles. SST: Single-stream temporal action proposals. In CVPR, 2017. [3] F. Caba Heilbron, W. Barrios, V. Escorcia, and B. Ghanem. Scc: Semantic context cascade for efficient action detection. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. [4] F. Caba Heilbron, J. Carlos Niebles, and B. Ghanem. Fast temporal activity proposals for efficient detection of human actions in untrimmed videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1914–1923, 2016. [5] F. Caba Heilbron, V. Escorcia, B. Ghanem, and J. Carlos Niebles. Activitynet: A large-scale video benchmark for human activity understanding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 961–970, 2015. [6] Z. Cai, Q. Fan, R. Feris, and N. Vasconcelos. A unified multi-scale deep convolutional neural network for fast object detection. In ECCV, 2016. [7] J. Carreira and A. Zisserman. Quo vadis, action recognition? A new model and the kinetics dataset. CoRR, abs/1705.07750, 2017. [8] X. Dai, B. Singh, G. Zhang, L. S. Davis, and Y. Q. Chen. Temporal context network for activity localization in videos. arXiv preprint arXiv:1708.02349, 2017. [9] V. Escorcia, F. C. Heilbron, J. C. Niebles, and B. Ghanem. Daps: Deep action proposals for action understanding. In European Conference on Computer Vision, pages 768–784. Springer, 2016. [10] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Regionbased convolutional networks for accurate object detection and segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(1):142–158, Jan 2016. [11] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. [12] N. Ikizler-Cinbis and S. Sclaroff. Object, scene and actions: Combining multiple features for human action recognition. Computer Vision–ECCV 2010, pages 494–507, 2010. [13] M. Jain, J. C. van Gemert, and C. G. M. Snoek. What do 15,000 object categories tell us about classifying and localizing actions? In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 46–55, June 2015. [14] Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. Girshick, S. Guadarrama, and T. Darrell. Caffe: Convolutional architecture for fast feature embedding. arXiv preprint arXiv:1408.5093, 2014. [15] Y.-G. Jiang, J. Liu, A. Roshan Zamir, G. Toderici, I. Laptev, M. Shah, and R. Sukthankar. THUMOS challenge: Ac- [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] 4329 tion recognition with a large number of classes. http: //crcv.ucf.edu/THUMOS14/, 2014. S. Karaman, L. Seidenari, and A. Del Bimbo. Fast saliency based pooling of fisher encoded dense trajectories. In ECCV THUMOS Workshop, volume 1, page 5, 2014. A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. T. Lin, P. Dollár, R. B. Girshick, K. He, B. Hariharan, and S. J. Belongie. Feature pyramid networks for object detection. CoRR, abs/1612.03144, 2016. M. Marszalek, I. Laptev, and C. Schmid. Actions in context. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pages 2929–2936. IEEE, 2009. D. Oneata, J. Verbeek, and C. Schmid. The lear submission at thumos 2014. 2014. Z. Qiu, T. Yao, and T. Mei. Learning spatio-temporal representation with pseudo-3d residual networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5533–5541, 2017. S. Ren, K. He, R. Girshick, and J. Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pages 91–99, 2015. A. Richard and J. Gall. Temporal action detection using a statistical language model. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3131–3140, 2016. Z. Shou, J. Chan, A. Zareian, K. Miyazawa, and S.-F. Chang. Cdc: Convolutional-de-convolutional networks for precise temporal action localization in untrimmed videos. In CVPR, 2017. Z. Shou, D. Wang, and S.-F. Chang. Temporal action localization in untrimmed videos via multi-stage cnns. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1049–1058, 2016. K. Simonyan and A. Zisserman. Two-stream convolutional networks for action recognition in videos. In Advances in neural information processing systems, pages 568–576, 2014. K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. B. Singh, T. K. Marks, M. Jones, O. Tuzel, and M. Shao. A multi-stream bi-directional recurrent neural network for finegrained action detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1961–1970, 2016. C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1–9, 2015. D. Tran, L. Bourdev, R. Fergus, L. Torresani, and M. Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 4489–4497, 2015. [31] L. Wang, Y. Qiao, and X. Tang. Action recognition and detection by combining motion and appearance features. THUMOS14 Action Recognition Challenge, 1(2):2, 2014. [32] Z. Wu, Y. Fu, Y. G. Jiang, and L. Sigal. Harnessing object and scene semantics for large-scale video understanding. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3112–3121, June 2016. [33] H. Xu, A. Das, and K. Saenko. R-C3D: region convolutional 3d network for temporal activity detection. CoRR, abs/1703.07814, 2017. [34] Z. Xu, Y. Yang, and A. G. Hauptmann. A discriminative cnn video representation for event detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1798–1807, 2015. [35] S. Yeung, O. Russakovsky, G. Mori, and L. Fei-Fei. Endto-end learning of action detection from frame glimpses in videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2678–2687, 2016. [36] J. Yuan, B. Ni, X. Yang, and A. A. Kassim. Temporal action localization with pyramid of score distribution features. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3093–3102, June 2016. [37] Y. Zhao, Y. Xiong, L. Wang, Z. Wu, X. Tang, and D. Lin. Temporal action detection with structured segment networks. In ICCV, 2017. 4330
1cs.CV
Learning the Enigma with Recurrent Neural Networks Sam Greydanus arXiv:1708.07576v2 [cs.NE] 7 Sep 2017 [email protected] Department of Physics and Astronomy, Dartmouth College Hanover, New Hampshire 03755 Abstract Recurrent neural networks (RNNs) represent the state of the art in translation, image captioning, and speech recognition. They are also capable of learning algorithmic tasks such as long addition, copying, and sorting from a set of training examples. We demonstrate that RNNs can learn decryption algorithms – the mappings from plaintext to ciphertext – for three polyalphabetic ciphers (Vigenere, Autokey, and Enigma). Most notably, we demonstrate that an RNN with a 3000-unit Long Short-Term Memory (LSTM) cell can learn the decryption function of the Enigma machine. We argue that our model learns efficient internal representations of these ciphers 1) by exploring activations of individual memory neurons and 2) by comparing memory usage across the three ciphers. To be clear, our work is not aimed at ’cracking’ the Enigma cipher. However, we do show that our model can perform elementary cryptanalysis by running known-plaintext attacks on the Vigenere and Autokey ciphers. Our results indicate that RNNs can learn algorithmic representations of black box polyalphabetic ciphers and that these representations are useful for cryptanalysis. Figure 1: Our LSTM-based model can learn the decryption function of the Enigma from a series of ciphertext and plaintext examples. Introduction Given an encrypted sequence, a key and a decryption of that sequence, can we reconstruct the decryption function? We might begin by looking for small patterns shared by the two sequences. When we find these patterns, we can piece them together to create a rough model of the unknown function. Next, we might use this model to predict the translations of other sequences. Finally, we can refine our model based on whether or not these guesses are correct. During WWII, Allied cryptographers used this process to make sense of the Nazi Enigma cipher, eventually reconstructing the machine almost entirely from its inputs and outputs (Rejewski 1981). This achievement was the product of continuous effort by dozens of engineers and mathematicians. Cryptography has improved in the past century, but piecing together the decryption function of a black box cipher such as the Enigma is still a problem that requires expert domain knowledge and days of labor. The process of reconstructing a cipher’s inner workings is the first step of cryptanalysis. Several past works have Copyright c 2018, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. sought to automate – and thereby accelerate – this process, but they generally suffer from a lack of generality (see Related Work). To address this issue, several works have discussed the connection between machine learning and cryptography (Kearns and Valiant 1994) (Prajapat and Thankur 2015). Early work at the confluence of these two fields has been either theoretical or limited to toy examples. We improve upon this work by introducing a general-purpose model for learning and characterizing polyalphabetic ciphers. Our approach is to frame the decryption process as a sequence-to-sequence translation task and use a Recurrent Neural Network (RNN) -based model to learn the translation function. Unlike previous works, our model can be applied to any polyalphabetic cipher. We demonstrate its effectiveness by using the same model and hyperparameters (except for memory size) to learn three different ciphers: the Vigenere, Autokey, and Enigma. Once trained, our model performs well on 1) unseen keys and 2) ciphertext sequences much longer than those of the training set. All code is avail- able online1 . By visualizing the activations of our model’s memory vector, we argue that it can learn efficient internal representations of ciphers. To confirm this theory, we show that the amount of memory our model needs to master each cipher scales with the cipher’s degree of time-dependence. Finally, we train our model to perform known-plaintext attacks on the Vigenere and Autokey ciphers, demonstrating that these internal representations are useful tools for cryptanalysis. To be clear, our objective was not to crack the Enigma. The Enigma was cracked nearly a century ago using fewer computations than that of a single forward pass through our model. The best techniques for cracking ciphers are handcrafted approaches that capitalize on weaknesses of specific ciphers. This project is meant to showcase the impressive ability of RNNs to uncover information about unknown ciphers in a fully automated way. In summary, our key contribution is that RNNs can learn algorithmic representations of complex polyalphabetic ciphers and that these representations are useful for cryptanalysis. Related work Recurrent models, in particular those that use Long ShortTerm Memory (LSTM), are a powerful tool for manipulating sequential data. Notable applications include stateof-the art results in handwriting recognition and generation (Graves 2014), speech recognition (Graves, Mohamed, and Hinton 2013), machine translation (Sutskever, Vinyals, and Le 2014), deep reinforcement learning (Mnih et al. 2016), and image captioning (Karpathy and Fei-Fei 2015). Like these works, we frame our application of RNNs as a sequence-to-sequence translation task. Unlike these works, our translation task requires 1) a keyphrase and 2) reconstructing a deterministic algorithm. Fortunately, a wealth of previous work has focused on using RNNs to learn algorithms. Past work has shown that RNNs can find general solutions to algorithmic tasks. Zaremba and Sutskever (Zaremba and Sutskever 2015) trained LSTMs to add 9-digit numbers with 99% accuracy using a variant of curriculum learning. Graves et. al. (Graves, Wayne, and Danihelka 2014) compared the performance of LSTMs to Neural Turing Machines (NTMs) on a range of algorithmic tasks including sort and repeatcopy. More recently, Graves et al. (Graves et al. 2016) introduced the Differentiable Neural Computer (DNC) and used it to solve more challenging tasks such as relational reasoning over graphs. As with these works, our work shows that RNNs can master simple algorithmic tasks. However, unlike tasks such as long addition and repeat-copy, learning the Enigma is a task that humans once found difficult. In the 1930s, Allied nations had not yet captured a physical Enigma machine. Cryptographers such as the Polish Marian Rejewski were forced to compare plaintext, keyphrase, and ciphertext messages with each other to infer the mechanics of the machine. After several years of 1 https://github.com/greydanus/crypto-rnn carefully analyzing these messages, Rejewski and the Polish Cipher Bureau were able to construct ’Enigma doubles’ without ever having seen an actual Enigma machine (Rejewski 1981). This is the same problem we trained our model to solve. Like Rejewski, our model uncovers the logic of the Enigma by looking for statistical patterns in a large number of plaintext, keyphrase, and ciphertext examples. We should note, however, that Rejewski needed far less data to make the same generalizations. Later in World War II, British cryptographers led by Alan Turing helped to actually crack the Enigma. As Turing’s approach capitalized on operator error and expert knowledge about the Enigma, we consider it beyond the scope of this work (Sebag-Montefiore 2000). Characterizing unknown ciphers is a central problem in cryptography. The comprehensive Applied Cryptography (Schneier 1996) lists a wealth of methods, from frequency analysis to chosen-plaintext attacks. Papers such as (Dawson, Gustafson, and Davies 1991) offer additional methods. While these methods can be effective under the right conditions, they do not generalize well outside certain classes of ciphers. This has led researchers to propose several machine learning-based approaches. One work (Spillman et al. 2017) used genetic algorithms to recover the secret key of a simple substitution cipher. A review paper by Prajapat et al. (Prajapat and Thankur 2015) proposes cipher classification with machine learning. Alallayah et al. (Alallayah et al. 2010) succeeded in using a small feedforward neural network to decode the Vigenere cipher. Unfortunately, they phrased the task in a cipherspecific manner that dramatically simplified the learning objective. For example, at each step, they gave the model the single keyphrase character that was necessary to perform decryption. One of the things that makes learning the Vigenere cipher difficult is choosing that keyphrase character for a particular time step. We avoid this pitfall by using an approach that generalizes well across several ciphers. There are other interesting connections between machine learning and cryptography. Abadi and Andersen trained two convolutional neural networks (CNNs) to communicate with each other while hiding information from from a third. The authors argue that the two CNNs learned to use a simple form of encryption to selectively protect information from the eavesdropper. Another work by Ramamurthy et al. (Ramamurthy et al. 2017) embedded images directly into the trainable parameters of a neural network. These messages could be recovered using a second neural network. Like our work, these two works use neural networks to encrypt information. Unlike our work, the models were neither recurrent nor were they trained on existing ciphers. Problem setup We consider the decryption function m = P (k, c) of a generic polyalphabetic cipher where c is the ciphertext, k is a key, and m is the plaintext message. Here, m, k, and c are sequences of symbols a drawn from alphabet Al (which has length l). Our objective is to train a neural network with parameters θ to make the approximation P̂N N (k, m, θ) ≈ (a) Data (b) Model Figure 2: (a) Expressing the decryption process as a sequence-to-sequence translation task. (b) Our Recurrent Neural Network (RNN) -based model unrolled for time steps 6 to 9 (FC: fully-connected layer). Our model P (k, m) such that θ̂ = arg min L(P̂N N (k, m, θ) − P (k, c)) θ (1) where L is L2 loss. We chose this loss function because it penalizes outliers more severely than other loss functions such as L1. Minimizing outliers is important as the model converges to high accuracies (e.g. 95+ %) and errors become infrequent. In this equation, P (k, c) is a one-hot vector and P̂N N is a real-valued softmax distribution over the same space. Representing ciphers. In this work, we chose A27 as the uppercase Roman alphabet plus the null symbol, ’-’. We encode each symbol ai as a one-hot vector. The sequences m, k, and c then become matrices with a time dimension and a one-hot dimension (see Figure 2a). We allow the key length to vary between 1 and 6 but choose a standard length of 6 for k and pad extra indices with the null symbol. If N is the number of time steps to unroll the LSTM during training, then m and c are N − 6 × 27 matrices and k is a 6 × 27 matrix. To construct training example (xi , yi ), we concatenate the key, plaintext, and ciphertext matrices according to Equations 2 and 3. xi = (k, c) yi = (k, m) (2) (3) Concretely, for the Autokey cipher, we might obtain the following sequences: input : KEY---ISSIBIGACPUWGNRBTBBBO target: KEY---YOUKNOWNOTHINGJONSNOW We could also have fed the model the entire key at each time step. However, this would have increased the size of the input layer (and, as a result, total size of θ) introducing an unnecessary computational cost. We found that the LSTM could store the keyphrase in its memory cell without difficulty so we chose the simple concatenation method of Equations 2 and 3 instead. We found empirical benefit in appending the keyphrase to the target sequence; loss decreased more rapidly early in training. Recurrent neural networks (RNNs). The simplest RNN cell takes as input two hidden state vectors: one from the previous time step and one from the previous layer of the network. Using indices t = 1 . . . T for time and l = 1 . . . L for depth, we label them hlt−1 and hl−1 respectively. Using t the notation of Karpathy et al. (Karpathy, Johnson, and FeiFei 2016), the RNN update rule is hlt = tanh W l  hl−1 t hlt−1  where h ∈ Rn , W l is a n × 2n parameter matrix, and the tanh is applied elementwise. The Long Short-Term Memory (LSTM) cell is a variation of the RNN cell which is easier to train in practice (Hochreiter and Schmidhuber 1997). In addition to the hidden state vector, LSTMs maintain a memory vector, clt . At each time step, the LSTM can choose to read from, write to, or reset the cell using three gating mechanisms. The LSTM update takes the form:     sigm i   clt = f clt−1 + i g f  sigm l hl−1 t  o  = sigm W hlt−1 hlt = o tanh(clt ) g tanh The sigmoid (sigm) and tanh functions are applied element-wise, and W l is a 4n × 2n matrix. The three gate vectors i, f, o ∈ Rn control whether the memory is updated, reset to zero, or its local state is revealed in the hidden vector, respectively. The entire cell is differentiable, and the three gating functions reduce the problem of vanishing gradients (Bengio, Simard, and Frasconi 1994) (Hochreiter and Schmidhuber 1997). We used a single LSTM cell capped with a fullyconnected softmax layer for all experiments (Figure 2b). We also experimented with two and three stacked LSTM layers and additional fully connected layers between the input and LSTM layers, but these architectures learned too slowly or not at all. In our experience, the simplest architecture worked best. (b) Test accuracy (a) Train loss Figure 3: Loss decreases rapidly at first, around 5000 train steps, as the network learns to capture simple statistical distributions. Later, around 100000 train steps, model learns the Enigma cipher itself and accuracy spikes. A significant portion of training, starting around 350000 train steps, is spent gaining the last 5% accuracy. Experiments too slow given our limited computational resources. We considered three types of polyalphabetic substitution ciphers: the Vigenere, Autokey, and Enigma. Each of these ciphers is composed of various rotations of A, called Caesar shifts. A one-unit Caesar shift would perform the rotation A[i] 7→ A[(i + 1) mod N ]. The Vigenere cipher performs Caesar shifts with distances that correspond to the indices of a repeated keyphrase. For a keyphrase k of length z, the Vigenere cipher decrypts a plaintext message m according to: P (kti , mjt ) = A[(j + (i mod z)) mod l] (4) where the lower indices of k and m correspond to time and the upper indices correspond to the index of the symbol in alphabet Al . The Autokey cipher is a variant of this idea. Instead of repeating the key, it concatenates the plaintext message to the end of the key, effectively creating a new and non-repetitive key:  i if t ≤ z kt , i as in (5) mit−z , otherwise The Enigma also performs rotations over Al , but with a function P that is far more complex. The version used in World War II contained 3 wheels (each with 26 ring settings), up to 10 plugs, and a reflector, giving it over 1.07 × 1023 possible configurations (Miller 2017). We selected a constant rotor configuration of A-I-II-III, ring configuration of 2, 14, 8 and no plugs. For an explanation of these settings, see (Rejewski 1981). We set the rotors randomly according to a 3-character key, giving a subspace of settings that contained 263 possible mappings. With these settings, our model required several days of compute time on a Tesla k80 GPU. The rotor and ring configurations could also be allowed to vary by appending them to the keyphrase. We tried this, but convergence was Synthesizing data. The runtime of P (k, m) was small for all ciphers so we chose to synthesize training data on-the-fly, eliminating the need to synthesize and store large datasets. This also reduced the likelihood of overfitting. We implemented our own Vigenere and Autokey ciphers and used the historically accurate crypto-enigma2 Python package as our Enigma simulator. The symbols of the input sequences k and m were drawn randomly (with uniform probability) from the Roman alphabet, A26 . We chose characters with uniform distribution to make the task more difficult. Had we used grammatical (e.g. English) text, our model could have improved its performance on the task simply by memorizing common n-grams. Differentiating between gains in accuracy due to learning the Enigma versus those due to learning the statistical distributions of English would have been difficult. Optimization. Following previous work by Xavier et al. (Glorot and Bengio 2010), we use the ’Xavier’ initialization for all parameters. We use mini-batch stochastic gradient descent with batch size 50 and select parameter-wise learning rates using Adam (Kingma and Ba 2014) set to a base learning rate of 5 × 10−4 and β = (0.9, 0.999). We trained on ciphertext sequences of length 14 and keyphrase sequences of length 6 for all tasks. As our Enigma configuration accepted only 3-character keys, we padded the last three entries with the null character, ’-’. On the Enigma task, we found that our model’s LSTM required a memory size of at least 2048 units. The model converged too slowly or not at all for smaller memory sizes and multi-cell architectures. We performed experiments on a model with 3000 hidden units because it converged approximately twice as quickly as the model with 2048 units. For 2 http://pypi.python.org/pypi/crypto-enigma (a) Vigenere (hidden unit 252) Figure 4: The model, trained on messages of 20 characters, generalizes well to messages of over 100 characters for the Vigenere and Autokey ciphers. Generalization occurs on the Enigma, but to a lesser degree, as the task is far more complex. the Vigenere and and Autokey ciphers, we explored hidden memory sizes of 32, 64, 128, 256, and 512. For each cipher, we halted training after our model achieved 99+ % accuracy; this occurred around 5 × 105 train steps on the Enigma task and 1 × 105 train steps on the others. The number of possible training examples, ≈ 1019 , far exceeded the total number of examples the model encountered during training, ≈ 107 (each of these examples were generated on-the-fly). We were, however, concerned with another type of overfitting. On the Enigma task, our model contained over thirty million learnable parameters and encountered each three-letter key hundreds of times during training. Hence, it was possible that the model might memorize the mappings from ciphertext to plaintext for all possible (263 ) keys. To check for this sort of overfitting, we withheld a single key, KEY, from training and inspected our trained model’s performance on a message encrypted with this key. Generalization. We evaluated out model on two metrics for generalization. First, we tested its ability to decrypt 20 randomly-generated test messages using an unseen keyphrase (’KEY’). It passed this test on all three ciphers. Second, we measured its ability to decrypt messages longer than those of the training set. On this test, our model exhibited some generalization for all three ciphers but performed particularly well on the Vigenere task, decoding sequences an order of magnitude longer than those of the trainign set (see Figure 4). We observed that the norm of our model’s memory vector increased linearly with the number of time steps, leading us to hypothesize that the magnitudes of some hidden activations increase linearly over time. This phenomenon is probably responsible for reduced decryption accuracy on very long sequences. Memory usage. Based on our model’s ability to gener- (b) Autokey (hidden unit 30) (c) Enigma (hidden unit 1914) Figure 5: Shown above are examples of plaintext messages decrypted by our model. The red and blue heat maps correspond to the activations of indicated hidden units taken from the LSTM’s memory vector c. The char index label corresponds to the index of the plaintext character in alphabet A. The net shift label corresponds to the number of Caesar shifts between the ciphertext and the plaintext. (a) Hidden unit 252 of the Vigenere model has a negative activation once every n steps where n is the length of the keyphrase (examples for n = 3, 4 are shown). We hypothesize that this is a timing unit which allows the model to index into the keyphrase as a function of the encryption step. (b) The 30th hidden unit of the Autokey model has negative activations for specific character indices (e.g. 2 and 14) and positive activations for others (e.g. 6 and 18). We hypothesize that this shift unit helps the model compute the magnitude of the Caesar shift between the ciphertext and plaintext. (c) The hidden activations of the Enigma model were generally sparse. Hidden unit 1914 is no exception. For different messages, only its activation magnitude changes. For different keyphrases, its entire activation pattern (signs and magnitudes) change. We hypothesize that it is a switch unit which activates only when the Enigma enters a particular rotor configuration. (a) Vigenere task (b) Autokey task Figure 6: Shown above are test accuracies of our model on the Vigenere and Autokey cipher tasks. Notice that for small RNN memory sizes (64 and 128 hidden units), the model achieves better performance on the Vigenere task. Meanwhile, for large memory sizes (256 and 512 hidden units), the model converges to 99+ % accuracy more rapidly on the Autokey task. Evidently, the model’s test accuracy is more sensitive to memory size on the Autokey task than on the Vigenere task. alize over unseen keyphrases and message lengths, we hypothesized that it learns an efficient internal representation of each cipher. To explore this idea, we first examined how activations of various units in the LSTM’s memory vector changed over time. We found, as shown in Figure 5, that 1) these activations mirrored qualitative properties of the ciphers and 2) they varied considerably between the three ciphers. We were also interested in how much memory our model required to learn each cipher. Early in this work, we observed that the model required a very large memory vector (at least 2048 hidden units) to master the Enigma task. In subsequent experiments (Figure 6), we found that the size of the LSTM’s memory vector was more important when training on the Autokey task than the Vigenere task. We hypothesize that this is because the model must continually update its internal representation of the keyphrase during the Autokey task, whereas on the Vigenere task it needs only store a static representation of the keyphrase. The Enigma, of course, requires dramatically more memory because it must store the configurations of three 26-character wheels, each of which may rotate at a given time step. Based on these observations, we claim that the amount of memory our model requires to learn a given cipher can serve as an informal measure of how much each encryption step depends on previous encryption steps. When characterizing a black box cipher, this information may be of interest. is trivial: the task reduces to measuring the shifts between the plaintext and ciphertext characters. We made this task more difficult by training the model on target keyphrases of unknown length (1-6 characters long). In most real-world cryptanalysis applications, the length of the keyphrase is unknown which also motivated our choice. Our model obtained 99+ % accuracy on the task. Reconstructing the keyphrase of the Autokey was a more difficult task, as the keyphrase is used only once. This happens during the first 1-6 steps of encryption. On this task, accuracy exceeded 95%. In future work, we hope to reconstruct the keyphrase of the Engima from plaintext and ciphertext inputs. Reconstructing keyphrases. Having verified that our model learned internal representations of the three ciphers, we decided to take this property one step further. We trained our model to predict keyphrases as a function of plaintext and ciphertext inputs. We used the same model architecture as described earlier, but the input at each timestep became two concatenated one-hot vectors (one corresponding to the plaintext and one to the ciphertext). Reconstructing the keyphrase for a Vigenere cipher with known keylength This work proposes a fully-differentiable RNN model for learning the decoding functions of polyalphabetic ciphers. We show that the model can achieve high accuracy on several ciphers, including the the challenging 3-wheel Enigma cipher. Furthermore, we show that it learns a general algorithmic representation of these ciphers and can perform well on 1) unseen keyphrases and 2) messages of variable length. Our work represents the first general method for reconstructing the functions of polyalphabetic ciphers. The pro- Limitations. Our model is data inefficient; it requires at least a million training examples to learn a cipher. If we were interested in characterizing an unknown cipher in the real world, we would not generally have access to unlimited examples of plaintext and ciphertext pairs. Most modern encryption techniques rely on public-key algorithms such as RSA. Learning these functions requires multiplying and taking the modulus of large numbers. These algorithmic capabilities are well beyond the scope of our model. Better machine learning models may be able to learn simplified versions of RSA, but even these would probably be data- and computation-inefficient. Conclusions cess is fully automated and an inspection of trained models offers a wealth of information about the unknown cipher. Our findings are generally applicable to analyzing any black box sequence-to-sequence translation task where the translation function is a deterministic algorithm. Finally, decoding Enigma messages is a complicated algorithmic task, and thus we suspect learning this task with an RNN will be of general interest to the machine learning community. Acknowledgements We are grateful to Dartmouth College for providing access to its cluster of Tesla K80 GPUs. We thank Jason Yosinski and Alan Fern for insightful feedback on preliminary drafts. References [Alallayah et al. 2010] Alallayah, K.; Amin, M.; El-Wahed, W. A.; and Alhamami, A. 2010. Attack and Construction of Simulator for Some of Cipher Systems Using NeuroIdentifier. The International Arab Journal of Information Technology 7(4):365–371. [Bengio, Simard, and Frasconi 1994] Bengio, Y.; Simard, P.; and Frasconi, P. 1994. Learning long-term dependencies with gradient descent is difficult. Neural Networks, IEEE Transactions 5(2):157–166. [Dawson, Gustafson, and Davies 1991] Dawson, E.; Gustafson, N.; and Davies, N. 1991. Black Box Analysis of Stream Ciphers. Australasian Journal of Combinatorics 4:59–70. [Glorot and Bengio 2010] Glorot, X., and Bengio, Y. 2010. Understanding the difficulty of training deep feedforward neural networks. Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics 9. [Graves et al. 2016] Graves, A.; Wayne, G.; Reynolds, M.; Harley, T.; Danihelka, I.; Grabska-Barwinska, A.; Colmenarejo, S. G.; Grefenstette, E.; Ramalho, T.; Agapiou, J.; Badia, A. P.; Hermann, K. M.; Zwols, Y.; Ostrovski, G.; Cain, A.; King, H.; Summerfield, C.; Blunsom, P.; Kavukcuoglu, K.; and Hassabis, D. 2016. Hybrid computing using a neural network with dynamic external memory. Nature 538(7626):471–476. [Graves, Mohamed, and Hinton 2013] Graves, A.; Mohamed, A.-R.; and Hinton, G. 2013. Speech recognition with deep recurrent neural networks. Acoustics, Speech and Signal Processing (ICASSP), IEEE International Conference 6645–6649. [Graves, Wayne, and Danihelka 2014] Graves, A.; Wayne, G.; and Danihelka, I. 2014. Neural Turing Machines. ArXiv Preprint (1410.5401v2 ). [Graves 2014] Graves, A. 2014. Generating Sequences With Recurrent Neural Networks. ArXiv Preprint (1308.0850v5 ). [Hochreiter and Schmidhuber 1997] Hochreiter, S., and Schmidhuber, J. 1997. Long Short-Term Memory. Neural Computation 9(8):1735–1780. [Karpathy and Fei-Fei 2015] Karpathy, A., and Fei-Fei, L. 2015. Deep Visual-Semantic Alignments for Generating Image Descriptions. CVPR. [Karpathy, Johnson, and Fei-Fei 2016] Karpathy, A.; Johnson, J.; and Fei-Fei, L. 2016. Visualizing and Understanding Recurrent Networks. International Conference on Learning Representations. [Kearns and Valiant 1994] Kearns, M., and Valiant, L. 1994. Cryptographic Limitations on Learning Boolean Formulae and Finite Automata. Journal of the ACM (JACM) 41(1):67– 95. [Kingma and Ba 2014] Kingma, D. P., and Ba, J. L. 2014. Adam: A Method for Stochastic Optimization. ArXiv Preprint (1412.6980 ). [Miller 2017] Miller, R. 2017. The Cryptographic Mathematics of Enigma. Cryptologia 19(1):65–80. [Mnih et al. 2016] Mnih, V.; Puigdomènech Badia, A.; Mirza, M.; Graves, A.; Harley, T.; Lillicrap, T. P.; Silver, D.; and Kavukcuoglu, K. 2016. Asynchronous Methods for Deep Reinforcement Learning. International Conference on Machine Learning 1928–1937. [Prajapat and Thankur 2015] Prajapat, S., and Thankur, R. 2015. Various approaches towards cryptanalysis. International Journal of Computer Applications 127(14). [Ramamurthy et al. 2017] Ramamurthy, R.; Bauckhage, C.; Buza, K.; and Wrobel, S. 2017. Using Echo State Networks for Cryptography. [Rejewski 1981] Rejewski, M. 1981. How Polish Mathematicians Broke the Enigma Cipher. IEEE Annals of the History of Computing 3(3):213–234. [Schneier 1996] Schneier, B. 1996. Applied cryptography : protocols, algorithms, and source code in C. Wiley. [Sebag-Montefiore 2000] Sebag-Montefiore, H. 2000. Enigma : the battle for the code. J. Wiley. [Spillman et al. 2017] Spillman, R.; Janssen, M.; Nelson, B.; and Kepner, M. 2017. Use of a Genetic Algorithm in the Cryptanalysis of Simple Substitution Ciphers. Cryptologia 17(1):31–44. [Sutskever, Vinyals, and Le 2014] Sutskever, I.; Vinyals, O.; and Le, Q. V. 2014. Sequence to Sequence Learning with Neural Networks. Advances in Neural Information Processing Systems 3104–3112. [Zaremba and Sutskever 2015] Zaremba, W., and Sutskever, I. 2015. Learning to Execute. Conference paper at ICLR 2015.
9cs.NE
Parameterized complexity of fair deletion problems.? Tomáš Masařı́k1?? and Tomáš Toufar2 arXiv:1605.07959v2 [cs.DS] 4 Jan 2017 1 Department of Applied Mathematics, Faculty of Mathematics and Physics, Charles University, Prague, Czech Republic, [email protected] 2 Computer Science Institute of Charles University, Faculty of Mathematics and Physics, Charles University, Prague, Czech Republic [email protected]. Abstract. Deletion problems are those where given a graph G and a graph property π, the goal is to find a subset of edges such that after its removal the graph G will satisfy the property π. Typically, we want to minimize the number of elements removed. In fair deletion problems we change the objective: we minimize the maximum number of deletions in a neighborhood of a single vertex. We study the parameterized complexity of fair deletion problems with respect to the structural parameters of the tree-width, the path-width, the size of a minimum feedback vertex set, the neighborhood diversity, and the size of minimum vertex cover of graph G. We prove the W[1]-hardness of the fair FO vertex-deletion problem with respect to the first three parameters combined. Moreover, we show that there is no algorithm for fair FO vertex-deletion problem running in time √ 3 no( k) , where n is the size of the graph and k is the sum of the first three mentioned parameters, provided that the Exponential Time Hypothesis holds. On the other hand, we provide an FPT algorithm for the fair MSO edgedeletion problem parameterized by the size of minimum vertex cover and an FPT algorithm for the fair MSO vertex-deletion problem parameterized by the neighborhood diversity. 1 Introduction We study the computational complexity of fair deletion problems. Deletion problems are a standard reformulation of some classical problems in combinatorial optimization examined by Yannakakis [20]. For a graph property π we can formulate an edge deletion problem. That means, given a graph G = (V, E), find the minimum set of edges F that need to be deleted for graph G0 = (V, E \ F ) to satisfy property π. A similar notion holds for the vertex deletion problem. ? ?? Research was supported by the project GAUK 338216 and by the project SVV-2016260332. Author was supported by the project CE-ITI P202/12/G061. II Many classical problems can be formulated in this way such as minimum vertex cover, maximum matching or minimum feedback arc set. For example minimum vertex cover is formulated as a vertex deletion problem since we aim to find a minimum set of vertices such that the rest of the graph forms an independent set. An example of an edge deletion problem is perfect matching: we would like to find a minimum edge set such that the resulting graph has all vertices being of degree exactly one. Many of such problems are NP-complete [19,1,13]. Fair deletion problems are such modifications where the cost of the solution should be split such that the cost is not too high for anyone. More formally, the fair edge deletion problem for a given graph G = (V, E) and a property π finds a set F ⊆ E which minimizes the maximum degree of the graph G∗ = (V, F ) where the graph G0 = (V, E \ F ) satisfies the property π. Fair deletion problems were introduced by Lin and Sahni [17]. Minimizing the fair cost arises naturally in many situations, for example in defective coloring [5]. A graph is (k, d)-colorable if every vertex can be assigned a color from the set {1, . . . , k} in such a way that every vertex has at most d neighbors of the same color. This problem can be reformulated in terms of fair deletion; we aim to find a set of edges of maximum degree d such that after its removal the graph can be partitioned into k independent sets. We focus on fair deletion problems with properties definable in either first order (FO) or monadic second order (MSO) logic. Our work extends the result of Kolman et al. [12]. They showed an XP algorithm for a generalization of fair deletion problems definable by MSO2 formula on graphs of bounded tree-width. We give formal definitions of the problems under consideration in this work. Definition 1 (Fair FO edge-deletion). An undirected graph G, an FO sentence ψ, and a positive integer k. Question: Is there a set F ⊆ E(G) such that G \ F |= ψ and for every vertex v of G, the number of edges in F incident with v is at most k? Input: Similarly, fair vertex deletion problem finds, for a given graph G = (V, E) and a property π, the solution which is the minimum of maximum degree of graph G[W ] where graph G[V \ W ] satisfy property π. Those problems are NPcomplete for some formulas. For example Lin and Sahni [17] showed that deciding whether a graph G has a degree one subgraph H such that G \ H is a spanning tree is NP-complete. Definition 2 (Fair FO vertex-deletion). An undirected graph G, an FO sentence ψ, and a positive integer k. Question: Is there a set W ⊆ V (G) such that G \ W |= ψ and for every vertex v of G, it holds that |N (v) ∩ W | ≤ k? Input: III Both problems can be straightforwardly modified for MSO1 or MSO2 . The following notions are useful when discussing the fair deletion problems. The fair cost of a set F ⊆ E is defined as maxv∈V |{e ∈ F | v ∈ e}|. We refer to the function that assigns each set F its fair cost as the fair objective function. In case of vertex-deletion problems, the fair cost of a set W ⊆ V is defined as maxv∈V |N (v)∩W |. The fair objective function is defined analogously. Whenever we refer to the fair cost or the fair objective function, it should be clear from context whether we mean the edge or the vertex version. We now describe the generalization of fair deletion problems considered by Kolman et al. The main motivation is that sometimes we want to put additional constraints on the deleted set itself (e.g. Connected Vertex Cover, Independent Dominating Set). However, the framework of deletion problems does not allow that. To overcome this problem, we define the generalized problems as follows. Definition 3 (Generalized Fair MSO edge-deletion). An undirected graph G, an MSO formula ψ with one free edgeset variable, and a positive integer k. Question: Is there a set F ⊆ E(G) such that G |= ψ(F ) and for every vertex v of G, the number of edges in F incident with v is at most k? Input: Definition 4 (Generalized Fair MSO vertex-deletion). An undirected graph G, an MSO formula ψ with one free vertexset variable, and a positive integer k. Question: Is there a set W ⊆ V (G) such that G |= ψ(W ) and for every vertex v of G, it holds that |N (v) ∩ W | ≤ k? Input: In this version, the formula ψ can force that G has the desired property after deletion as well as imposing additional constraints on the deleted set itself. Courcelle and Mosbah [4] introduced a semiring homomorphism framework that can be used to minimize various functions over all sets satisfying a given MSO formula. A natural question is whether this framework can be used to minimize the fair objective function. The answer is no, as we exclude the possibility of an existence of an FPT algorithm for parameterization by tree-width under reasonable assumption. Note that there are semirings that capture the fair objective function, but their size is of order O(ntw (G) ), so this approach does not lead to an FPT algorithm. 1.1 Our results We prove that the XP algorithm given by Kolman et al. [12] is almost optimal under the exponential time hypothesis (ETH) for both the edge and the vertex version. Actually we proved something little bit stronger. We prove the hardness of the classical (weaker) formulation of fair deletion problems described in (weaker as well) FO logic. IV Theorem 1. If there is an FPT algorithm for Fair FO vertex-deletion parameterized by the size of the formula ψ, the pathwidth of G, and the size of minimum feedback vertex set of G combined, then FPT = W[1]. Moreover, let k denote pw(G) + fvs(G). If there√is an algorithm for Fair FO vertex-deletion 3 with running time f (|ψ|, k)no( k) , then Exponential Time Hypothesis fails. Theorem 2. If there is an FPT algorithm for Fair FO edge-deletion parameterized by the size of the formula ψ, the pathwidth of G, and the size of minimum feedback vertex set of G combined, then FPT = W[1]. Moreover, let k denote pw(G) + fvs(G). If there is an algorithm for Fair FO edge-deletion √ 3 with running time f (|ψ|, k)no( k) , then Exponential Time Hypothesis fails. √ By a small modification of our proofs we are able to derive tighter ( k instead √ of 3 k) results using MSO2 logic or MSO1 logic respectively. However, there is still a small gap that has been left open. Theorem 3. If there is an FPT algorithm for Fair MSO1 vertex-deletion parameterized by the size of the formula ψ, the pathwidth of G, and the size of minimum feedback vertex set of G combined, then FPT = W[1]. Moreover, let k denote pw(G) + fvs(G). If there is an algorithm for Fair MSO1 vertex√ o( k) deletion with running time f (|ψ|, k)n , then Exponential Time Hypothesis fails. Theorem 4. If there is an FPT algorithm for Fair MSO2 edge-deletion parameterized by the size of the formula ψ, the pathwidth of G, and the size of minimum feedback vertex set of G combined, then FPT = W[1]. Moreover, let k denote pw(G)+fvs(G). If there√is an algorithm for Fair MSO2 edge-deletion with running time f (|ψ|, k)no( k) , then Exponential Time Hypothesis fails. On the other hand we show some positive algorithmic results for the generalized version of the problems. Theorem 5. Generalized Fair MSO1 vertex-deletion is in FPT with respect to the neighborhood diversity nd(G) and the size of the formula ψ. We also provide an algorithm for the MSO2 logic (strictly more powerful than MSO1 ), however we need a more restrictive parameter because model checking of an MSO2 formula is not even in XP for cliques unless E = NE [3,15]. We consider the size of minimum vertex cover that allows us to attack the edge-deletion problem in FPT time. Theorem 6. Generalized Fair MSO2 edge-deletion is in FPT with respect to the size of minimum vertex cover vc(G) and the size of the formula ψ. 2 Preliminaries Throughout the paper we deal with simple undirected graphs. For further standard notation in graph theory, we refer to Diestel [6]. For terminology in parameterized computational complexity we refer to Downey and Fellows [7]. V 2.1 Graph parameters We define several graph parameters being used throughout the paper. cw tw fvs nd pw vc Fig. 1. Hierarchy of graph parameters. An arrow indicates that a graph parameter upper-bounds the other. Thus, hardness results are implied in direction of arrows and FPT algorithms are implied in the reverse direction. We start by definition of vertex cover being a set of vertices such that its complement forms an independent set. By vc (G) we denote the size of a smallest such set. This is the strongest of considered parameters and it is not bounded for any natural graph class. A feedback vertex set is a set of vertices whose removal leaves an acyclic graph. Again, by fvs (G) we denote the size of a smallest such set. Another famous graph parameter is tree-width introduced by Bertelé and Brioshi [2]. Definition 5 (Tree decomposition). A tree decomposition of a graph G is a pair (T, X), where T = (I, F ) is a tree, and X = {Xi | i ∈ I} is a family of subsets of V (G) such that: – the union of all Xi , i ∈ I equals V , – for all edges {v, w} ∈ E, there exists i ∈ I, such that v, w ∈ Xi and – for all v ∈ V the set of nodes {i ∈ I | v ∈ Xi } forms a subtree of T . The width of the tree decomposition is max(|Xi | − 1). The tree-width of a graph tw (G) is the minimum width over all possible tree decompositions of the graph G. The parameter of path-width (analogously pw (G)) is almost the same except the decomposition need to form a path instead of a general tree. A less known graph parameter is the neighborhood diversity introduced by Lampis [14]. Definition 6 (Neighborhood diversity). The neighborhood diversity of a graph G is denoted by nd (G) and it is the minimum size of a partition of vertices into classes such that all vertices in the same class have the same neighborhood, i.e. N (v) \ {v 0 } = N (v 0 ) \ {v}, whenever v, v 0 are in the same class. It can be easily verified that every class of neighborhood diversity is either a clique or an independent set. Moreover, for every two distinct classes C and C 0 , either every vertex in C is adjacent to every vertex in C 0 , or there is no edge between them. If classes C and C 0 are connected by edges, we refer to such classes as adjacent. VI 2.2 Parameterized problems and Exponential Time Hypothesis Definition 7 (Parameterized language). Let Σ be a finite alphabet. A parameterized language L ⊆ Σ ∗ × N set of pairs (x, k) where x is a finite word over Σ and k is a nonnegative integer. We say that an algorithm for a parameterized problem L is an FPT algorithm if there exist a constant c and a computable function f such that the running time for input (x, k) is f (k)|x|c and the algorithm accepts (x, k) if and only if (x, k) ∈ L. A standard tool for showing nonexistence of an FPT algorithm is W[1]hardness (assuming FPT 6= W[1]). For the definition of W[1] class and the notion of W[1]-hardness, we refer the reader to [7]. A stronger assumption than FPT 6= W[1] that can be used to obtain hardness results is the Exponential Time Hypothesis (ETH for short). It is a complexity theoretic assumption introduced by Impagliazzo, Paturi and Zane [11]. We follow a survey on the topic of lower bounds obtained from ETH by Lokshtanov, Marx, and Saurabh [18], which contains more details on this topic. The hypothesis states that there is no subexponential time algorithm for 3SAT if we measure the time complexity by the number of variables in the input formula, denoted by n. Exponential Time Hypothesis (ETH) [11] There is a positive real s such that 3-SAT with parameter n cannot be solved in time 2sn (n + m)O(1) . Definition 8 (Standard parameterized reduction). We say that parameterized language L reduces to parameterized language L0 by a standard parameterized reduction if there are functions f, g : N → N and h : Σ ∗ × N → Σ ∗ such that function h is computable in time g(k)|x|c for a constant c, and (x, k) ∈ L if and only if (h(x, k), f (k)) ∈ L0 . For preserving bounds obtained from the ETH, the asymptotic growth of the function f need to be as slow as possible. 2.3 Logic systems We heavily use graph properties that can be expressed in certain types of logical systems. In the paper it is Monadic second-order logic (MSO) where monadic means that we allow quantification over sets (of vertices and/or edges). In first order logic (FO) there are no set variables at all. We distinguish MSO2 and MSO1 . In MSO1 quantification only over sets of vertices is allowed and we can use the predicate of adjacency adj(u, v) returning true whenever there is an edge between vertices u and v. In MSO2 we can additionally quantify over sets of edges and we can use the predicate of incidence inc(v, e) returning true whenever a vertex v belongs to an edge e. VII It is known that MSO2 is strictly more powerful than MSO1 . For example, the property that a graph is Hamiltonian is expressible in MSO2 but not in MSO1 [16]. Note that in MSO1 it is easy to describe several complex graph properties like being connected or having a vertex of a constant degree. 3 Hardness results In this section, we prove hardness of Fair FO vertex-deletion by exhibiting a reduction from Equitable 3-coloring. Definition 9 (Equitable 3-coloring). Input: An undirected graph G. Question: Is there a proper coloring of vertices of G by at most 3 colors such that the size of any two color classes differ by at most one? The following result was proven implicitly in [9]. Theorem 7. Equitable 3-coloring is W[1]-hard with respect to pw(G) and fvs(G) combined. Moreover, if there exists an algorithm for Equitable 3-color√ 3 ing running in time f (k)no( k) , where k is pw(G)+fvs(G), then the Exponential Time Hypothesis fails. The proof in [9] relies on a reduction from Multicolored Clique [10] to Equitable coloring. The reduction transforms an instance of Multicolored clique of parameter k into an Equitable coloring instance of path-width and feedback vertex size at most O(k) (though only tree-width is explicitly stated in the paper). Algorithm for Equitable coloring running in √ 3 time f (k)no( k) would lead to an algorithm for Multicolored Clique running in time f (k)no(k) . It was shown by Lokshtanov, Marx, and Saurabh [18] that such algorithm does not exist unless ETH fails. We now describe the idea behind the reduction from Equitable 3-coloring to Fair FO vertex-deletion. Let us denote by n the number of vertices of G and assume that 3 divides n. The vertices of G are referred to as original vertices. First, we add three vertices called class vertices, each of them corresponds to a particular color class. Then we add edge between every class vertex and every original vertex and subdivide each such edge. The vertices subdividing those edges are called selector vertices. We can encode the partition of V (G) by deleting vertices in the following way: if v is an original vertex and c is a class vertex, by deleting the selector vertex between v and c we say that vertex v belongs to the class represented by c. If we ensure that the set is deleted in such a way that every vertex belongs to exactly one class, we obtain a partition of V (G). The equitability of the partition will be handled by the fair objective function. Note that if we delete a subset W of selector vertices that encodes a partition VIII then |W | = n. Those n vertices are adjacent to 3 class vertices, so the best possible fair cost is n/3 and thus a solution of the fair cost n/3 corresponds to an equitable partition. Of course, not every subset W of vertices of our new graph encodes a partition. Therefore, the formula we are trying to satisfy must ensure that: – every original vertex belongs to exactly one class, – no original or class vertex was deleted, – every class is an independent set. However, the described reduction is too naive to achieve those goals; we need to slightly adjust the reduction. Let us now describe the reduction formally: Proof (of Theorem 1). Let G be a graph on n vertices. We can assume without loss of generality (by addition of isolated vertices.) that 3 divides n and n ≥ 6. First we describe how to construct the reduction. All vertices of G will be referred to as original vertices. We add three vertices called class vertices and connect every original vertex with every class vertex by an edge. We subdivide each such edge once; the vertices subdividing those edges are called selector vertices. Finally, for every original vertex v, we add n new vertices called dangling vertices and connect each of them by an edge to v. We denote the graph obtained in this way as G0 . For a schema of the reduction, see Figure 2. class vertices selector vertices G ··· ··· | {z } ··· original vertices ··· dangling vertices n Fig. 2. The schema of the reduction Now, we wish to find a set W ⊆ V (G0 ) such that it encodes an equitable 3coloring of a graph G. The set is described by the following FO formula eq 3 col imposed on a graph G \ W . We claim that whenever this set satisfy following claims it encodes an equitable 3-coloring. A set W can contain only selector vertices and some dangling vertices (but those do not affect the coloring). For IX each vertex v of a graph there can be only one selector vertex in the set W and that vertex has only one class vertex as a neighbor. That vertex determine the color of v. We use the following shorthand ∃=k meaning there are exactly k distinct elements satisfying a given predicate: (∃=k w)(pred(w)) ≡ (∃v1 , . . . , vk ) ^ k i=1 pred(vi ) ∧ 0 ^ 1≤i<j≤k  (vi 6= vj ) 0 ∧ (∀v ) pred(v ) → The building blocks for the formula are as follows: isol(v) ≡ (∀w)(¬adj(v, w)) k _  (v = vi ) i=1 dangling(v) ≡ (∃w) adj(v, w) ∧ (∀w0 )(adj(v, w0 ) → w = w0 ) original(v) ≡ (∃w)(dangling(w) ∧ adj(v, w)) selector(v) ≡ (∃=2 w)(adj(v, w)) 0  class(v) ≡ ¬orig(v) ∧ ¬selector(v) ∧ ¬dangling(v) belongs to(v, a) ≡ original(v) ∧ class(a) ∧ ¬(∃w)(adj(v, w) ∧ adj(w, a)) same class(v, w) ≡ original(v) ∧ original(w) ∧ (∃a)(class(a) ∧ belongs to(v, a) ∧ belongs to(w, a)) valid deletion ≡ (∀v)(¬isol(v))  ∧ (∀v) original(v) → (∃=1 c)(belongs to(v, c)) eq 3 col ≡ valid deletion ∧ (∀v, w)(same class(v, w) → ¬adj(v, w)) The described reduction maps an instance G of an Equitable coloring into an instance (G0 , eq 3 col, n/3) of Fair FO vertex-deletion. We claim that there exists a set W ⊆ V (G0 ) of the fair cost at most n/3 if and only if G admits an equitable 3-coloring. If we have an equitable 3-coloring of G then it is easy to see that the set W ⊆ V (G0 ) corresponding to a partition into color classes has the fair cost exactly n/3 and it is straightforward to check that G0 \ W |= eq 3 col. For the other implication we prove that if we delete a subset W ⊆ V (G0 ) of the fair cost at most n/3, and the formula valid deletion is true, then we obtained an equitable 3-coloring of a graph G. To get there we made a few basic claims. Claim 1: no original vertex was deleted: Suppose for the contradiction that original vertex v was deleted. If we kept at least one of the dangling vertices attached to v, but this vertex is now isolated and formula valid deletion is not true. On the other hand if we delete all dangling vertices that were attached to v, our deleted set has fair cost at least n. X Claim 2: if w has degree one in G0 \ W , then its only neighbor is an original vertex: If w is dangling, then its only neighbor is original vertex by the construction of G0 . Suppose that w has degree one in G0 \ W but is not dangling. Since both class and original vertices have degree at least n in G0 , we cannot bring them down to degree one without exceeding the fair cost limit n/3. This leaves the only possibility that w is a selector and exactly one of its two neighbors is in the deleted set W . By Claim 1, the deleted neighbor must have been a class vertex so the only remaining neighbor of w in G0 \ W is an original vertex. Claim 3: the formula original correctly recognizes original vertices: If v is original, then at least one of its dangling neighbors is not in W , otherwise we would exceed the fair cost. In this case the formula original(v) is true. The other direction (original(v) is true implies v is original) is proved by Claim 2. Claim 4: if v is a dangling vertex such that v ∈ / W then dangling(v) is true: By Claim 1, we cannot delete the only neighbor of v, which means v has exactly one neighbor and so dangling(v) is true. Claim 5: the formula class(v) is true if and only if v is a class vertex that was not deleted: Suppose that v ∈ / W is a class vertex. It cannot have neighbor of degree one in G0 \W , because that would mean that an original vertex was deleted which violates Claim 1. This means that original(v) is false. Moreover, we cannot decrease the degree of v to two or less by deleting at most n/3 neighbors of v, so dangling(v) and selector(v) are false too. But then class(v) is true. For the other direction suppose that v is not a class vertex. If it is original or dangling, then original(v) or dangling(v) is true (by Claim 3 or Claim 4) and hence class(v) is false. If v is a selector then either none of its neighbors were deleted, v has degree two in G0 \ W and selector(v) is true, or its class neighbor was deleted, v has degree one in G0 \ W and dangling(v) is true. Either way, class(v) is false as required. Claim 6: no class vertex was deleted: since valid deletion is true, we know that for every original vertex v there is exactly one class vertex c such that there is no path of length two between v and c (in other words, the selector vertex that was on the unique path of length two between v and c was deleted). Suppose for contradiction that one of the class vertices was deleted; then by Claim 5 we have at most two class vertices. But the valid deletion formula implies that at least n selector vertices were deleted. By pigeonhole principle, one of the class vertices has at least n/2 deleted neighbors which means the fair cost is greater than n/3, a contradiction. The chain of claims we just proved guarantees that the deleted set W indeed obeys the rules we required and corresponds to a partition (though we might have deleted a small number of dangling vertices, this does not affect the partition in any way). In order to meet the fair cost limit, each class of the partition must have at most n/3 vertices and since no original vertex was deleted, it has exactly n/3 vertices. Now it is easy to see that the formula eq 3 col forces that each class of the partition is independent and so the graph G has an equitable 3-coloring. Let us now discuss the parameters and the size of the Fair FO vertexdeletion instance. If G has a feedback vertex set S of size k, then the union XI of S with the set of class vertices is a feedback vertex set of G0 . Therefore, fvs(G0 ) ≤ fvs(G) + 3. To bound the path-width, observe that after deletion of the class vertices we are left with G with O(n2 ) added vertices of degree one; the addition of degree one vertices to the original vertices can increase the pathwidth by at most one and so we have pw(G0 ) ≤ pw(G) + 4. Moreover it is clear that the size of instance is of size O(n2 ). It is obvious that the reduction can be carried out in polynomial time. t u Let us mention that if we are allowed to use MSO formulas, we are actually able to reduce any equitable partition problem to fair vertex deletion. This allows us to reduce for example Equitable connected partition to Fair MSO vertex-deletion which in turn allows us to prove Theorem 3. Definition 10 (Equitable connected partition). Input: An undirected graph G, a positive integer r Question: Is there a partition of V (G) into r sets such that each of them induces a connected graph and the sizes of every two sets differ by at most one? Enciso et al. [8] showed that Equitable Connected Partition is W[1]-hard for combined parameterization by fvs(G), pw(G), and the number of partitions √ r. The part that f (k)no( k) algorithm would refute ETH is again contained only implicitly; the proof reduces an instance of Multicolored clique of parameter k to an instance of Equitable connected partition of parameter O(k 2 ). Our reduction can be easily adapted to r parts (we just add r class vertices and we set the fair cost limit to n/r). We define the formula eq conn as follows. class set(W ) ≡ (∃v ∈ W ) ∧ (∀v, w ∈ W )(same class(v, w)) ∧ (∀w ∈ W, z ∈ / W )(¬same class(w, z)) eq conn ≡ (∀W )(class set(W ) → connected(W )) By the same argument as in the proof of Theorem 1, we can show that there exists W ⊆ V of fair cost at most n/r such that G0 \ W |= eq conn if and only if G admits an equitable connected partition. Sketch of proof of Theorem 2: We do not present the complete proof, as the critical parts are the same as in proof of Theorem 1. The reduction follows the same idea as before: we add three class vertices and connect each class vertex to each original vertex by an edge. This time, we do not subdivide the edges, as the partition is encoded by deleting the edges. The protection against tampering with the original graph has to be done in slightly different way: in this case, we add n/3 + 1 dangling vertices of degree one to each original vertex. Note that if we delete a set F ⊆ E(G) of fair cost at most n/3, at least one of the added edges from every original vertex survives XII the deletion, so we can recognize the original vertices by having at least one neighbor of degree one. In our formula, we require that each vertex has at most two neighbors of degree one. This forces us to delete all of those added edges except two. Since at least one edge from the original vertex must be deleted to encode a partition, by deleting an edge of the original graph G we would exceed the fair cost limit n/3. For the edge-deletion the formula eq 3 col is built as follows. dangling(v) ≡ (∃w) adj(v, w) ∧ (∀w0 )(adj(v, w0 ) → w = w0 ) original(v) ≡ (∃w)(dangling(w) ∧ adj(v, w))  class(v) ≡ ¬orig(v) ∧ ¬dangling(v) belongs to(v, a) ≡ original(v) ∧ class(a) ∧ ¬adj(v, a) same class(v, w) ≡ original(v) ∧ original(w) ∧ (∃a)(class(a) ∧ belongs to(v, a) ∧ belongs to(w, a)) valid deletion ≡ (∀v)(∃≤2 w)(adj(v, w) ∧ dangling(w))  ∧ (∀v) original(v) → (∃=1 c)(belongs to(v, c)) eq 3 col ≡ valid deletion ∧ (∀v, w)(same class(v, w) → ¬adj(v, w)) The complete proof of correctness is omitted due to space considerations, however, it is almost exactly the same as in the proof of Theorem 1. t u The transition between the FO case and the MSO case of edge-deletion (Theorem 4) is done in exactly the same way as before. 4 FPT algorithms We now turn our attention to FPT algorithms for fair deletion problems. 4.1 FPT algorithm for parameterization by neighborhood diversity Definition 11. Let G = (V, E) be a graph of neighborhood diversity k and let N1 , . . . , Nk denote its classes of neighborhood diversity. A shape of a set X ⊆ V in G is a k-tuple s = (s1 , . . . , sk ), where si = |X ∩ Ni |. We denote by s the complementary shape to s, which is defined as the shape of V \ X, i.e. s = (|N1 | − s1 , . . . , |Nk | − sk ). Proposition 1. Let G = (V, E) be a graph, π a property of a set of vertices, and let X, Y ⊆ V be two sets of the same shape in G. Then X satisfies π if and only if Y satisfies π. Proof. Clearly, we can construct an automorphism of G that maps X to Y . t u Definition 12. Let r be a non-negative integer and let (s1 , . . . , sk ), (t1 , . . . , tk ) be two shapes. The shapes are r-equivalent, if for every i: XIII – si = ti , or – both si , ti are strictly greater than r, and the same condition hold for the complementary shapes s, t. The following proposition gives a bound on the number of r-nonequivalent shapes. Proposition 2. For any graph G of neighborhood diversity k, the number of r-nonequivalent shapes is at most (2r + 3)k . Proof. We show that for every i, there are at most (2r + 3) choices of si . This holds trivially if |Ni | ≤ 2r + 3. Otherwise we have following 2r + 3 choices: – si = k and si > r for k = 0, 1, . . . , r, or – both si , si > r, or – si > r and si = k for k = 0, 1, . . . , r. t u The next lemma states that the fair cost of a set can be computed from its shape in a straightforward manner. Before we state it, let us introduce some auxiliary notation. If a graph G of neighborhood diversity k has classes of neighborhood diversity N1 , . . . , Nk , we write i ∼ j if the classes Ni and Nj are adjacent. If the class Ni is a clique, we set i ∼ i. Moreover, we set ηi = 1 if the class Ni is a clique and ηi = 0 if it is an independent set. The classes of size one are treated as cliques for this purpose. Lemma 1. Let G = (V, E) be a graph of neighborhood diversity k and let Ni be its classes of neighborhood diversity. Moreover, let X ⊆ V be a set of shape s. Then the fair vertex cost of X is  X   sj − ηi . max i j:i∼j Proof. It is straightforward to check that vertex v ∈ Ni has exactly neighbors in X. P j:i∼j sj −ηi t u Our main tool is a reformulation of Lemma 5 from [14]: Lemma 2. Let ψ be an MSO1 formula with one free vertex-set variable, qE vertex element quantifiers, and qS vertex set quantifiers. Let r = 2qS qE . If G = (V, E) is a graph of neighborhood diversity k and X, Y ⊆ V are two sets such that their shapes are r-equivalent, then G |= ψ(X) if and only if G |= ψ(Y ). The last result required is the MSO1 model checking for graphs of bounded neighborhood diversity [14]: Theorem 8. Let ψ be an MSO1 formula with one free vertex-set variable. There exists an FPT algorithm that given a graph G = (V, E) of neighborhood diversity k and a set X ⊆ V decides whether G |= ψ(X). The running time of the algorithm is f (k, |ψ|)nO(1) . XIV We now have all the tools required to prove Theorem 5. Proof (Proof of Theorem 5). Let ψ be an MSO1 formula in the input of Fair MSO1 vertex-deletion. Denote by qS the number of vertex-set quantifiers in ψ, by qE the number of vertex-element quantifiers in ψ, and set r = 2qS qE . By Proposition 1, the validity of ψ(X) depends only on the shape of X. Let us abuse notation slightly and write G |= ψ(s) when “X has shape s” implies G |= ψ(X). Similarly, Lemma 1 allows us to refer to the fair cost of a shape s. From Lemma 2 it follows that the validity of ψ(s) does not depend on the choice of an r-equivalence class representative. The fair cost is not same for all r-equivalent shapes, but since the fair cost is monotone in s, we can easily find the representative of the minimal fair cost. Suppose we have to decide if there is a set of a fair cost at most `. The algorithm will proceed as follows: For each class of r-equivalent shapes, pick a shape s of the minimal cost, if the fair cost is at most ` and G |= ψ(s), output true, if no such shape is found throughout the run, output false. By the previous claims, the algorithm is correct. Let us turn our attention to the running time. The number of shapes is at most (2r + 3)k by Proposition 2, and so it is bounded by f (|ψ|, k) for some function f . The MSO1 model checking runs in time f 0 (|ψ|, k)nO(1) by Theorem 8, so the total running time is f (|ψ|, k)f 0 (|ψ|, k)nO(1) , so the described algorithm is in FPT. t u 4.2 FPT algorithm for parameterization by vertex cover The FPT algorithm for parameterization by the size of minimum vertex cover uses the same idea. We use the fact that every MSO2 formula can be translated to MSO1 formula — roughly speaking, every edge-set variable is replaced by vc (G) vertex-set variables. We only sketch translation from MSO2 to MSO1 , for the proof we refer the reader to Lemma 6 in [14]. Let G = (V, E) be a graph with vertex cover C = {v1 , . . . , vk } and F ⊆ E a set of edges. We construct vertex sets U1 , . . . , Uk in the following way: if w is a vertex such that an edge in F connects w with vi , we put w into Ui . It is easy to see that the sets U1 , . . . , Uk together with the vertex cover v1 , . . . , vk describe the set F . In this way, we reduce the problem of finding a set F to finding k-tuple of sets (U1 , . . . , Uk ). We can define shapes and classes of r-equivalence in an analogous way as we did in previous section. Since the number of r-equivalence classes defined in this way is still bounded, we can use essentially the same algorithm: for each class of r-equivalence, run a model checking on a representative of this class. From those representatives that satisfy ψ, we choose the one with best fair cost. The translation from set of edges into k sets of vertices is captured by the following definition. Definition 13. Let G = (V, E) be a graph with vertex cover v1 , . . . , vk . For a set F ⊆ E, we define the signature of F with respect to v1 , . . . , vk as the k-tuple XV U = (U1 , . . . , Uk ), where Ui = {w ∈ V | {w, vi } ∈ F }. We refer to it simply as the signature of F and denote it by S(F ) if the vertex cover is clear from the context. In the original problem, we had an MSO2 formula ψ2 with one free edge-set variable. By the translation, we obtain an MSO1 formula ψ with k free vertex-set variables and k free vertex-element variables (the vertex-element variables will describe the vertex cover; the formula need to have access to a vertex cover and it will be useful to fix one throughout the whole run of the algorithm). We start by finding a vertex cover v1 , . . . , vk (this can be solved by an FPT algorithm [7]). We now want to find the sets U1 , . . . , Uk such that: G |= ψ(v1 , . . . , vk , U1 , . . . , Uk ). To find such k-tuple of sets, we need to extend the notion of shapes to signatures. Definition 14. Let G = (V, E) be a graph with vertex cover v1 , . . . , vk , and let U = (U1 , . . . , Uk ) be a collection of k subsets of V . Denote by N1 , . . . , N` the classes of neighborhood diversity of G. For j ∈ {1, . . . , `} and I ⊆ {1 . . . k}, denote by I the set {1, . . . , k} \ I. Furthermore, we define SU (j, I) as SU (j, I) = Nj ∩ \ i∈I Ui ∩ \ i∈I (V \ Ui ) . The mapping SU is called the shape of a signature U. The shapes defined in this way have properties similar to those defined for neighborhood diversity; we only state those properties without proofs. Definition 15. Two shapes S, S 0 are r-equivalent if for every j ∈ {1, . . . , k}, I ⊆ {1, . . . , k} it holds that – S(j, I) = S 0 (j, I), or – both S(j, I), S 0 (j, I) are strictly greater than r. As in the neighborhood diversity case, the number of r-nonequivalent shapes is bounded by a function of r and k. Proposition 3. Let G = (V, E) be a graph with vertex cover v1 , . . . , vk and denote by ` the neighborhood diversity of G. The number of r-nonequivalent k shapes is at most (2r + 3)`2 . We now state corresponding variants of Lemma 1 and Lemma 2. Lemma 3. Let G = (V, E) be a graph with a vertex cover v1 , . . . , vk and let F ⊆ E. The number of edges in F incident to vi is |Ui |. If w is a vertex different from v1 , . . . , vk , then the number of edges in F incident to w is |{i | w ∈ Ui }|. Those quantities (and therefore the fair cost of F ) can be determined from the shape of S(F ). XVI Lemma 4. Let G = (V, E) be a graph with a vertex cover v1 , . . . , vk , let ψ be an MSO1 formula with k free vertex-element variables and k free vertex-set variables, and let U = (U1 , . . . , Uk ), W = (W1 , . . . , Wk ) be two signatures. If the shapes of U and W are r-equivalent, then G |= ψ(v1 , . . . , vk , U1 , . . . , Uk ) if and only if G |= ψ(v1 , . . . , vk , W1 , . . . , Wk ). Proof (Proof of Theorem 6). The algorithm goes as follows: – we translate the MSO2 formula ψ2 with one free edge-set variable to the MSO1 formula ψ with k vertex-element variables and k vertex-set variables. – We find a vertex cover c1 , . . . , ck . – For each class of r-equivalent shapes, we pick the one achieving the minimal fair cost, determine the signature U1 , . . . , Uk and check whether: G |= ψ(c1 , . . . , ck , U1 , . . . , Uk ). Similarly to Theorem 5, the algorithm is correct. Moreover, we do only bounded number (Proposition 3) of MSO1 model checking, so the whole algorithm runs in FPT time. t u 5 Open problems The main open problem is whether the bound in Theorems 2 and 1 can be improved to f (|ψ|, k)no(k/ log k) or even to f (|ψ|, k)no(k) . The authors would like to thank Martin Koutecký and Petr Hliněný for helpful discussions. References 1. T. Ae, T. Watanabe, and A. Nakamura, On the NP-hardness of edge-deletion and -contraction problems, Discrete Applied Mathematics, 6 (1983), pp. 63–78. 2. U. Bertelè and F. Brioschi, Nonserial Dynamic Programming, Mathematics in science and engineering, Academic Press, 1972. 3. B. Courcelle, J. A. Makowsky, and U. Rotics, Linear time solvable optimization problems on graphs of bounded clique-width, Theory of Computing Systems, 33 (2000), pp. 125–150. 4. B. Courcelle and M. Mosbah, Monadic second-order evaluations on treedecomposable graphs, Theor. Comput. Sci., 109 (1993), pp. 49–82. 5. L. J. Cowen, R. Cowen, and D. R. Woodall, Defective colorings of graphs in surfaces: Partitions into subgraphs of bounded valency, Journal of Graph Theory, 10 (1986), pp. 187–195. 6. R. Diestel, Graph Theory, 4th Edition, vol. 173 of Graduate texts in mathematics, Springer, 2012. 7. R. G. Downey and M. R. Fellows, Fundamentals of Parameterized Complexity, Texts in Computer Science, Springer, 2013. 8. R. Enciso, M. R. Fellows, J. Guo, I. A. Kanj, F. A. Rosamond, and O. Suchý, What Makes Equitable Connected Partition Easy, in IWPEC 2009, 2009, pp. 122–133. XVII 9. M. R. Fellows, F. V. Fomin, D. Lokshtanov, F. A. Rosamond, S. Saurabh, S. Szeider, and C. Thomassen, On the complexity of some colorful problems parameterized by treewidth, in COCOA 2007, 2007, pp. 366–377. 10. M. R. Fellows, D. Hermelin, F. A. Rosamond, and S. Vialette, On the parameterized complexity of multiple-interval graph problems, Theor. Comput. Sci., 410 (2009), pp. 53–61. 11. R. Impagliazzo, R. Paturi, and F. Zane, Which problems have strongly exponential complexity?, Journal Comput. Syst. Sci., 63 (2001), pp. 512–530. 12. P. Kolman, B. Lidický, and J.-S. Sereni, Fair edge deletion problems on treedecomposable graphs and improper colorings, 2010. 13. M. S. Krishnamoorthy and N. Deo, Node-deletion np-complete problems, SIAM Journal on Computing, 8 (1979), pp. 619–625. 14. M. Lampis, Algorithmic meta-theorems for restrictions of treewidth, Algorithmica, 64 (2011), pp. 19–37. 15. M. Lampis, Model checking lower bounds for simple graphs, Logical Methods in Computer Science, 10 (2014). 16. L. Libkin, Elements of Finite Model Theory, Texts in Theoretical Computer Science. An EATCS Series, Springer, 2004. 17. L. Lin and S. Sahni, Fair edge deletion problems, IEEE Trans. Comput., 38 (1989), pp. 756–761. 18. D. Lokshtanov, D. Marx, and S. Saurabh, Lower bounds based on the exponential time hypothesis, Bulletin of the EATCS, 105 (2011), pp. 41–72. 19. M. Yannakakis, Node- and edge-deletion NP-complete problems, in ACM STOC 1978, 1978, pp. 253–264. 20. , Edge-deletion problems, SIAM J. Comput., 10 (1981), pp. 297–309.
8cs.DS
Optimal H2 model approximation based on multiple input/output delays systems I. Pontes Duffa , C. Poussot-Vassalb , C. Serenb SUPAERO & ONERA - The French Aerospace Lab, F-31055 Toulouse, France a ISAE arXiv:1511.05252v1 [cs.SY] 17 Nov 2015 b ONERA Abstract In this paper, the H2 optimal approximation of a ny × nu transfer function G(s) by a finite dimensional system Ĥd (s) including input/output delays, is addressed. The underlying H2 optimality conditions of the approximation problem are firstly derived and established in the case of a poles/residues decomposition. These latter form an extension of the tangential interpolatory conditions, presented in [1, 2] for the delay-free case, which is the main contribution of this paper. Secondly, a two stage algorithm is proposed in order to practically obtain such an approximation. Keywords: Model reduction, time-delay systems, large-scale systems, linear systems. 1. Introduction Model approximation plays a pivotal role in many simulation based optimization, control, analysis procedures. Indeed, due to memory and computational burden limitations working with a reduced order model in place of the original one, potentially large-scale, might be a real advantage. To this aim, most of the results presented in the literature address the linear dynamical systems approximation problem in the delay-free case1 . More specifically, this problem has been widely studied using either Lyapunov-based methods [3, 4, 5], interpolation-based algorithm [6, 1, 2, 7], or matching moments approaches [8, 9], leading to a variety of solutions and applications. Recent surveys are available in [10, 11, 12]. The presence of input/output delays in the approximation model was tackled in [13] (exploiting both Lyapunov equations and grammians properties derived in [4] for the free-delay case). The bottleneck of this approach is that it requires to solve Lyapunov equations which might be costly in the large-scale context. From the moment matching side, [14] proposed a problem formulation that enables the construction of an approximation which contains very rich delay structure (including state delay), but where the delays and the interpolation points are supposed to be a priori known. From the Loewner framework side, [15] and after [16] generalizes the Loewner framework from [17] to the state delay case enabling data-driven interpolation. However, as for the moment matching case, the delays and the interpolation points are supposed to be a priori known. In this paper, the problem of approximating a given large-scale model by a low order one including (a priori unknown) I/O delays using the interpolatory framework, is addressed. An alternative ”poles/residues”-based approach is developed, which enables to reach the H2 optimality 1 ”Delay-free case” means that the approximation model is a dynamical model without any input/output/state delays. Preprint submitted to Elsevier March 31, 2018 conditions, treated as interpolation ones. Then, the main contribution of this paper consists in extending the interpolation results of [1] to the case of approximate models with an extended structure, namely, including non-zero input(s)/output(s) delays. Last but not least, H2 optimality conditions for such cases are also elegantly derived together with a single numerical procedure. The paper is organized as follows: after introducing the notations and the mathematical problem statement in Section 2, Section 3 recalls some necessary preliminary results related to the computational aspects of the H2 inner product and H2 norm when the calculations are based on the poles/residues decomposition of a transfer function. Section 4 establishes the H2 optimality conditions solving the input/output delay dynamical model approximation problem. It also proposes an algorithm which permits to practically compute such an approximation. Section 5 details the results obtained after treating an academic example. Conclusions and prospects end this article in Section 6. 2. Notations and problem statement Notations. Let us consider a stable Multiple-Input/Multiple-Output (MIMO) linear dynamical system, denoted by G in the sequel, with nu (resp. ny ) ∈ N∗ input(s) (resp. output(s)), repren ×n sented by its transfer function G(s) ∈ Cny ×nu . Let H2 y u be the Hilbert space of holomorny ×nu phic F : C → which are analytic in the open right-half plane and for which  C  R +∞ functions n ×n T F(iω)F (iω) dω<+∞. For given G, H ∈ H2 y u , the associated inner-product reads: trace −∞ hG, HiH2 n ×nu and the H2 y 1 = 2π Z +∞   trace G(iω)HT (iω) dω, (1) −∞ induced norm can be explained: kGkH2 1 = 2π Z +∞ !1/2 kG(iω)kF dω = hG, GiH2 , 2 (2) −∞ where kGk2F = hG, GiF and hG, HiF = trace(GHT ) are the Frobenius norm and inner-product, respectively. Dynamical system H will be said real iff. ∀s ∈ C, H(s) = H(s). It is noteworthy n ×n that if G(s), H(s) ∈ H2 y u are real, then hG, HiH2 = hH, GiH2 ∈ R+ . n ×n Besides, any dynamical matrix ∆(s) will belong to H∞y u iff. sup{σmax (∆(iω))/ω ∈ R} < +∞. σmax (∆(iω)) refers to the largest singular value of matrix ∆(iω). n ×n Followingly, let Ĥd be a multiple-input/output delays MIMO system s.t. Ĥd (s) ∈ H2 y u and represented by: ( ˙ Êx̂(t) = Âx̂(t) + B̂∆i (u(t)) , (3) Ĥd : ŷ(t) = ∆o (Ĉx̂(t)) where Ê,  ∈ Rn×n (with state dimension n ∈ N∗ ), B̂ ∈ Rn×nu , Ĉ ∈ Rny ×n and ∆i and ∆o are delay operators. The matrix transfer functions ∆ˆ i (s) and ∆ˆ o (s) defined in (5) represent the frequency behavior of the delays operators ∆i and ∆o , receptively. The transfer function of the underlying system (3) from input û(t) to output ŷ(t) vectors is given by: n ×n Ĥd (s) = ∆ˆ o (s)Ĥ(s)∆ˆ i (s) ∈ H2 y u , 2 (4) where:    Ĥ(s) =    ˆ ∆  i (s) =     ∆ˆ o (s) = n ×n Ĉ(Ês − Â)−1 B̂ ∈ H2 y u n ×n diag(e−sτ̂1 . . . e−sτ̂nu ) ∈ H∞u u n ×n −sγ̂ny −sγ̂1 diag(e ... e ) ∈ H∞y y . (5) From this point, we will denote by Ĥd = (Ê, Â, B̂, Ĉ, ∆ˆ i , ∆ˆ o ) a MIMO input/output delayed system of the form (4). Ĥd will also be said to have order n  N (where N is the original model order). Problem statement. The main objective addressed in this paper is to solve the following H2 approximation problem: Problem 2.1. (Delay model H2 -optimal approximation) Given a stable N th order system n ×n G ∈ H2 y u , find a reduced nth order (s.t. n  N) multiple-input/output delays model Ĥ?d = (Ê, Â, B̂, Ĉ, ∆ˆ i , ∆ˆ o ) s.t.: Ĥ?d = argmin kG − Ĥd kH2 , ny ×nu Ĥd ∈ H2 dim(Ĥd ) ≤ n where Ĥd = ∆ˆ o Ĥ∆ˆ i as in, (4). This search for an optimal solution will be carried out assuming that both G and Ĥ from Eq. (5) have semi-simple poles i.e., s.t. their respective transfer function matrix can be decomposed as follows: n N X X l j rTj ĉk b̂Tk , (6) and Ĥ(s) = G(s) = s − µj j=1 k=1 s − λ̂k where ∀ j = 1 . . . N, ∀k = 1 . . . n, r j , b̂k ∈ Cnu ×1 and l j , ĉk ∈ Cny ×1 . The poles µ j , λ̂k are elements n ×n of C− so that G and Ĥ belong to H2 y u . 3. Preliminary results In this section, some elementary but important, results, which will be useful along this paper, are recalled and generalized. First of all, a fundamental result dealing with the H2 norm invariance in case of input/output delayed systems is presented. n ×nu Proposition 3.1. (H2 norm invariance) Let Ĥ ∈ H2 y n ×n nu ×nu M ∈ H∞ , N ∈ H∞y y s.t.: be a stable dynamical system and ∀ω ∈ R, M(iω)M(iω)T = Inu , N(iω)T N(iω) = Iny . If Ĥd = NĤM then kĤd kH2 = kĤkH2 . 3 (7) Proof. If Ĥd = NĤM, the scaled term 2πkĤd k2H2 will then read by definition: Z +∞   trace N(iω)Ĥ(iω)M(iω)MT (iω)ĤT (iω)NT (iω) dω −∞ Z +∞   = trace N(iω)Ĥ(iω)ĤT (iω)NT (iω) dω Z−∞  +∞  = trace Ĥ(iω)ĤT (iω)NT (iω)N(iω) dω Z−∞  +∞  = trace Ĥ(iω) Ĥ(iω)T dω = 2πkĤk2H2 .  −∞ One can easily check that condition (7) appearing in Proposition 3.1 is satisfied by the delays matrices of the two last lines of (5) when M = ∆ˆ i and N = ∆ˆ o . In other words, the H2 norm does not depend on the input, nor output delays. The following proposition makes now explicit the calculation of the H2 norm associated with the dynamical mismatch gap G − Ĥd , which conditions Problem 2.1 criterion. n ×n Proposition 3.2. Let G, Ĥd ∈ H2 y u s.t. Ĥd is given by Eq. (4). The H2 norm of the approximation gap (or mismatch error), denoted by J, can be expressed as: J = = kG − ∆ˆ o Ĥ∆ˆ i k2H2 kGk2H2 − 2hG, ∆ˆ o Ĥ∆ˆ i iH2 + kĤk2H2 . (8) Proof. Simply develop the H2 norm using the inner product definition and exploit the previous result k∆ˆ o Ĥ∆ˆ i kH2 = kĤkH2 .  Obviously, regarding Eq. (8), minimizing J is equivalent to minimize −2hG, ∆ˆ o Ĥ∆ˆ i iH2 + kĤk2H2 and thus to look for the optimal values of the decision variables contained in both the n ×n n ×n realization Ĥ ∈ H2 y u and the delay blocks ∆ˆ i , ∆ˆ o ∈ H∞y u . At this point, it could be profitable to derive suitable analytical expressions for the inner-product and the H2 norm of Ĥ in order to define more precisely the aforementioned H2 gap between the two transfer functions. To this aim, the previous assumption made for both G and Ĥ systems (see Eq. (6)) will be essential to obtain the following results. Proposition 3.3. (H2 inner product computation with input/output delays) Let G, Ĥ be two n ×n systems ∈ H2 y u whose respective transfer functions G(s) and Ĥ(s) can be expressed as in (6). n ×n nu ×nu Let ∆ˆ i , ∆ˆ o be real, H∞ and H∞y y respectively, models satisfying sup{k∆ˆ o (s), k∆ˆ i (s)k/s ∈ C− } = M < +∞. By denoting Ĥd = ∆ˆ o Ĥ∆ˆ i , the inner product hĤd , GiH2 reads: hĤd , GiH2 = N X  h trace Res Ĥd (−s)GT (s), µ j i j=1 = N X (9) lTj ∆ˆ o (−µ j )Ĥ(−µ j )∆ˆ i (−µ j )r j . j=1 Proof. Observing that the poles of the complex function Ĥd (−s)G(s) are µ1 , µ2 , . . . , µN ∈ C− and −λ̂1 , −λ̂2 , . . . , −λ̂n ∈ C+ , let us consider the following semi-circular contour ΓC located in the left half plane s.t.: ΓC = ΓI ∪ ΓR 4 ( with: ΓI = {s ∈ C/s = iω and ω ∈ [−R; R], R ∈ R+ } . ΓR = {s ∈ C/s = Reiθ where θ ∈ [π/2; 3π/2]} Thus, for a sufficient large radius value R, the ΓC contour will contain all the poles of the transfer function G(s) i.e., µ1 , µ2 , . . . , µN . Thus, by applying the residues theorem, it follows that: Z +∞   1 trace Ĥd (iω)GT (iω) dω hĤd , GiH2 = 2π −∞ Z 1 = lim Ĥd (−s)G(s)ds R→+∞ 2iπ Γ C N X  h i = trace Res Ĥd (−s)GT (s), µ j . j=1 where Res(.) denotes the residue operator. The second equality line holds true since: Z Z Ĥd (−s)G(s)ds ≤ M 2 Ĥ(−s)G(s)ds → 0+ , ΓR ΓR when R → +∞.  One may note that Proposition 3.3 is a generalization of Lemma 3.5 appearing in [1] in the case of MIMO systems with multiple-input/output delays. It is noteworthy that the ∆ˆ i , ∆ˆ o matrices defined by (5) clearly verifies the hypothesis Proposition 3.3. Remark 3.1. (Delay-free case ”symmetry”) An equivalent proposition was derived in the delay-free case [1]. It can be recovered from Proposition 3.3 by taking ∆ˆ i = Inu and ∆ˆ o = Iny . The result corresponds to the symmetric expression of the inner product i.e., the evaluation of G in the poles of Ĥ and its associated residues ĉk and b̂k s.t.: n N X X hG, ĤiH2 = ĉTk Ĝ(−λ̂k )b̂k = lTj Ĥ(−µ j )r j =hĤ, GiH2 . j=1 k=1 In the presence of input/output delays, since the H2 norm cannot be approximated using one contour containing the poles of Ĥd only, this result is no longer true. Indeed, it can be easily shown that in this case, the integral on ΓR will depend on a positive exponential argument which will not converge to 0+ when R → +∞. This justifies the assumption that sup{k∆ˆ o (s), k∆ˆ i (s)k/s ∈ C− } = M < +∞ and relevance of Proposition 3.3. Finally, let us recall the pole(s)/residue(s) H2 norm formula. n ×nu Corollary 3.1. (Poles/residues H2 norm [1]) Assume that Ĥd (s), Ĥ(s) belong to H2 y that Ĥd = ∆ˆ o Ĥ∆ˆ i . Besides, suppose that Ĥ can be expressed such as in (6), then, Ĥd 2 H2 = n X and ĉTk Ĥ(−λ̂k )b̂k . k=1 Proof. See [1].  In the next section, the main result, namely H2 optimality conditions related to Problem 2.1, are firstly established and an interpolation-based algorithm is proposed to numerically compute the approximation Ĥd . 5 4. Approximation by multiple I/O delays MIMO systems: H2 optimality conditions Considering the mathematical formulation of Problem 2.1 and the reduced order system structure Ĥd = ∆ˆ o Ĥ∆ˆ i , where Ĥ(s) is given as in (6), the underlying optimization issue that must be solved is parameterized by (k = 1, . . . , n): (i) the n pole(s) λ̂k ∈ C− ; (ii) the n bi-tangential directions (b̂k , ĉk ) ∈ Cnu ×1 × Cny ×1 ; and (iii) the nu + ny delay values (τ̂l , γ̂m ), l = 1 . . . nu , m = 1 . . . ny . Our primary objective consists in rewriting the expression of the H2 gap J as a function of these latter parameters which will subsequently facilitate the derivation of the H2 optimality conditions for Problem 2.1. This forms the topic of the three following propositions and of Theorem 4.1, which stands as the main result of the paper. Proposition 4.1. From the preliminary results, the mismatch H2 gap defined previously in Proposition 3.2 can be equivalently rewritten as: J = kGk2H2+ n X ĉTk Ĥ(−λ̂k )b̂k . . . k=1 −2 N X (10) lTj ∆ˆ o (−µ j )Ĥ(−µ j )∆ˆ i (−µ j )r j . j=1 Proof. The result is immediate. To be established, it requires to develop the H2 norm expression showing the inner product and then to use both Proposition 3.3 and Corollary 3.1 results.  From the previous equation (10), the first-order optimality conditions related to the minimization of J can be analytically computed. The gradient expressions of the H2 gap w.r.t. each parameters (delays, tangential directions and poles) are detailed in the two following propositions. Starting with the simplest calculations, we first derive the gradient of J w.r.t. the delays since the second term of the right-hand side part of (10) is delay-dependent, only. Proposition 4.2. The gradients of the H2 gap J with respect to the delays read ∀l = 1 . . . nu , ∀m = 1 . . . ny :      ∇τ̂l J                        ∇γ̂m J                ∂hĤd , GiH2 ∂τ̂l N X = −2 µ j lTj ∆ˆ o (−µ j )Ĥ(−µ j )Dl ∆ˆ i (−µ j )r j , = −2 j=1 ∂hĤd , GiH2 = −2 ∂γ̂m N X = −2 µ j lTj Dm ∆ˆ o (−µ j )Ĥ(−µ j )∆ˆ i (−µ j )r j , j=1 where elements of Dl ∈ Rnu ×nu , Dm ∈ Rny ×ny , are defined as: ( 1 if i = j = k [Dk ]i j = δi jk = . 0 otherwise Proof. The proof is straightforward to establish since both ∆ˆ i and ∆ˆ o terms are diagonal matrices and the exponential derivative function is obvious.  6 Proposition 4.3. The gradients of the H2 gap J with respect to parameters ĉk , b̂k and λ̂k , ∀k = 1 . . . n read:  2   ∂hĤd , GiH2 ∂kĤkH2    ∇ J = −2 +  ĉ k   ∂ĉk     ∂ĉk  T  T = −2 b̂ G̃(− λ̂ ) − Ĥ(− λ̂k ) ,  k k        ∇b̂k J = −2ĉTk G̃(−λ̂k ) − Ĥ(−λ̂k ) ,         ∇ J = 2ĉT G̃0 (−λ̂k ) − Ĥ0 (−λ̂k ) b̂k , λ̂k k where: G̃(s) = N X ∆ˆ o (−µ j ) j=1 lTj r j s − µj ∆ˆ i (−µ j ). (11) and where G̃0 and Ĥ0 are the Laplace derivative of G̃ and Ĥ, respectively. Proof. By defining r̃ j = ∆ˆ i (−µ j )r j and l̃Tj = lTj ∆ˆ o (−µ j ) with j = 1 . . . N, the H2 gap can be written as: N n X X ĉm b̂Tm  J = kGk2H2 − 2 l̃Tj r̃ j j=1 m=1 −µ j − λ̂m n n X X ĉm b̂Tm  + ĉTk b̂k . m=1 −λ̂k − λ̂m k=1 Then, calculating the gradients w.r.t. b̂l , ĉl and λ̂l (l = 1 . . . n) gives: ∇b̂l J = −2 ∂hĤd , GiH2 ∂b̂l ∂kĤk2H2 + ∂b̂l Thus, by computing both terms on this expression ∂kĤk2H2 ∂b̂l n X n X (ĉTk ĉm ) = k=1 m=1 −λ̂k − n X ĉTl ĉk b̂Tk = 2 k=1 and ∂hĤd , GiH2 ∂b̂l = = −λ̂k − λ̂l ∂  λ̂m ∂b̂l b̂Tm b̂k  = 2ĉTl Ĥ(−λ̂l ) N X n (l̃T ĉ )r̃T X j m j ∇b̂l b̂m j=1 m=1 −µ j − λ̂m N X l̃ j r̃Tj = ĉTl j=1 −µ j − λ̂l ĉTl G̃(−λ̂l ). one obtains the gradient. It is noteworthy that ∇ĉl J can be obtained in the same way as ∇b̂l J. The calculation of ∇λ̂l J 7 is straightforwardly derived as follows: ∇λ̂l J = −2 + = N X l̃Tj ĉl b̂Tl r̃ j 2 j=1 (−λ̂l − µ j ) n X ĉTk ĉl b̂Tl b̂k − ĉTl Ĥ0 (−λ̂l )b̂l . . . 2 k=1  (−λ̂l − λ̂k )  T 0 2ĉl G̃ (−λ̂l ) − Ĥ0 (−λ̂l ) b̂l .  Theorem 4.1 gathers all the first-order optimality conditions related to Problem 2.1 and stands as the main result of the paper. Theorem 4.1. (Delay model approximation first-order H2 optimality conditions) Let us conn ×n sider G ∈ H2 y u whose transfer function is G(s) ∈ Cny ×nu . Let Ĥd = ∆ˆ o Ĥ∆ˆ i be a local optimum n ×n of Problem 2.1. It is assumed that Ĥ ∈ H2 y u corresponds to a model with semi-simple poles only and whose transfer function is denoted by Ĥ(s) = Ĉ(sÊ − Â)−1 B̂ ∈ Cny ×nu . Let ∆ˆ i , ∆ˆ o be n ×n nu ×nu elements of H∞ and H∞y y , respectively, s.t. Propositions 3.1 and 3.3 are verified. Then, the following equalities hold:    Ĥ(−λ̂k )b̂k = G̃(−λ̂k )b̂k ,    T T (12) ĉ   k Ĥ(−λ̂k ) = ĉk G̃(−λ̂k ),    ĉT Ĥ0 (−λ̂k )b̂k = ĉT G̃0 (−λ̂k )b̂k , k k  N X      µ j lTj ∆ˆ o (−µ j )Ĥ(−µ j )Dl ∆ˆ i (−µ j )r j = 0,      j=1 (13)  N  X    T  ˆ ˆ  µ l D ∆ (−µ j )Ĥ(−µ j )∆i (−µ j )r j = 0,    j=1 j k m o for all k = 1 . . . n, l = 1 . . . nu and m = 1 . . . ny where G̃(s) is given by (11). Proof. The interpolation conditions gathered in (12) are deduced by taking ∇ĉl J = 0, ∇b̂l J = 0 and ∇λ̂l J = 0. Conditions (13) are obtained similarly by taking ∇τ̂l J = 0 and ∇γ̂m J = 0.  Theorem 4.1 asserts that any solution of the H2 model approximation Problem 2.1, denoted by Ĥd = ∆ˆ o Ĥ∆ˆ i is s.t. Ĥ satisfies, at the same time, a set of 3n bi-tangential interpolation conditions detailed in (12) and another set of nu + ny relations on the delays contained in the ∆ˆ i and ∆ˆ o diagonal matrices (13). Remark 4.1. (H2 optimality conditions in the SISO case) In the SISO case, all the conditions provided in Theorem 4.1 appear much simpler and can be stated as follows. Considering: G(s) = N X j=1 n X ψj φk e−τs , Ĥd (s) = , s − µj k=1 s − λ̂k s.t. Ĥd is a local optimum of Problem 2.1, then the following conditions hold: ( Ĥ(−λ̂k ) = G̃(−λ̂k ), Ĥ0 (−λ̂k ) = G̃0 (−λ̂k ), 8 (14) N X j=1  n X µ j ψ j  k=1  φk  τµ j  e = 0. µ j + λ̂k (15) for all k = 1 . . . n, and where G̃ is as in (11): G̃(s) = N X j=1 ψ j τµ j e . s − µj Remark 4.2 (Impulse response of G̃(s) and advance effect). The H2 -optimality conditions given in Theorem 4.1 involves a model G̃(s) which has a pole-residue decomposition defined by (11). For simplicity, let us consider the SISO case where G and G̃ is given by G(s) = N X j=1 N X ψ j µ jτ ψj G̃(s) = e . s − µj s − µj j=1 Thus, the the impulse response of G̃(s) is g̃(t) = N X j=1 ψ j eµ j t eµ j τ 1(t) = N X ψ j eµ j (t+τ) 1(t) j=1 = g(t + τ)1(t), t ∈ R where 1(t) corresponds to the Heaviside step function and g(t) is the impulse response of model G(s). Therefore, G̃(s) behaves as a time advance of G(s) and correspond to the ”causal part” of the model G(s)e sτ . 4.1. Practical considerations In this subsection, three considerations about Problem 2.1 and Theorem 4.1 are discussed. These latter are relevant to sketch an algorithm which enables the computation of model ∆ˆ o Ĥ∆ˆ i satisfying the optimality conditions of Theorem 4.1. Let us consider that Ĥd = ∆ˆ o Ĥ∆ˆ i is a local minimum of the H2 optimization Problem 2.1 where Ĥ is given by (6), then: • Consideration Ê. If the matrices ∆ˆ o , ∆ˆ i and the reduced order model poles λ̂1 , λ̂2 , . . . , λ̂n are assumed to be known, Problem 2.1 is reduced to a much simpler problem that can be solved, for example, by using the well-known Loewner framework such as in [17]; • Consideration Ë. If the delay matrices ∆ˆ o , ∆ˆ i are known, then Problem 2.1 can be solved by finding a model realization Ĥ which satisfies the interpolation conditions (12) of Theorem 4.1, only. This can be done using, for instance, a very efficient iterative algorithm, e.g., IRKA (see [1]); • Consideration Ì. Assume that the system realization Ĥ has already been determined. ? ? It follows that Problem 2.1 is equivalent to look for optimal delays matrices (∆ˆ o , ∆ˆ i ) ∈ ny ×ny nu ×nu H∞ × H∞ s.t.: ? ? (16) (∆ˆ o , ∆ˆ i ) = argmaxh∆ˆ o Ĥ∆ˆ i , GiH2 . (∆ˆ o ,∆ˆ i ) Interestingly, since h∆ˆ o Ĥ∆ˆ i , GiH2 → 0 when the delays go to infinity, this problem can be restricted to a compact set and thus a global solution exists. 9 4.2. Computational considerations An algorithm which allows to numerically compute a model Ĥd satisfying the previous H2 optimality conditions is proposed in this subsection. It relies on the considerations above discussed (Section 4.1). Therefore, the proposed approach corresponds to an iterative algorithm in which each iteration can be decomposed in two steps. The first one aims at computing a realization Ĥ which satisfies the interpolation conditions (12) while fixing the matrices ∆ˆ o , ∆ˆ i at their values obtained from the previous iteration. This can be done using, for instance, the IRKA algorithm (Step 4). In the second step, the resulting Ĥ is then exploited to determine the nu + ny optimal values for the ∆ˆ o , ∆ˆ i matrices elements (Step 5). This step is achieved by solving the nonlinear optimization problem defined in (16) using an appropriate solver. Then, the whole process is repeated and these two steps performed again until the convergence2 . At the end of the procedure, the model built will satisfy the H2 optimality conditions on which Theorem 4.1 relies. This sequential procedure can be summarized such as in Algorithm 1, and referred to as MIMO IO-dIRKA. Algorithm 1 MIMO IO-dIRKA (MIMO Input Output delay IRKA) n ×n Require: A N th -order model G ∈ H2 y u , dimension n ∈ N∗ (n  N) and initial guesses for it=0 it=0 both ∆ˆ i , ∆ˆ o . 1: while not converged do 2: Set it ← it + 1 3: Build G̃it as in (11) 4: Build Ĥit satisfying the bi-tangential interpolation conditions (12) using IRKA [1] on G̃it ? ? 5: Determine (∆ˆ i , ∆ˆ o ) which solve (16) using Ĥit ? it ? it 6: Set ∆ˆ i ← ∆ˆ i , ∆ˆ o ← ∆ˆ o 7: end while ˆ ito Ĥit ∆ˆ iti 8: Construct Ĥd = ∆ Ensure: Ĥd satisfies the interpolation conditions of Theorem 4.1. 4.3. Structured input/output delays All the previous results are left unchanged in the case of structured input/output delays i.e., if, for example, delays does not apply on given input(s) and/or output(s) of Ĥd . The results can be derived in a straightforward way, without any loss of generality, just by considering the following ordered delays matrices (where delays are present on the first nd1 < nu inputs and nd2 < ny outputs): ( ∆ˆ i (s) = diag(e−sτ̂1 , e−sτ̂2 , . . . , e−sτ̂nd1 , 1, . . . , 1) ∆ˆ o (s) = diag(e−sγ̂1 , e−sγ̂2 , . . . , e−sγ̂nd2 , 1, . . . , 1). One can easily note that the preliminary results from Sections 3 and 4 still remain true when introducing these matrices. The main result stated in Theorem 4.1 thus remains unchanged. 2 In practice, different stopping criteria might be considered, e.g. (i) the variation of the interpolation points materialized by λ̂k (k = 1, . . . , n), as in [1], (ii) the interpolation conditions check (Theorem 4.1) or (iii) the mismatch H2 error check (if the order N of the original system is reasonably low). 10 5. Numerical application This section is dedicated to the application of the results obtained in Sections 4, namely, the input/output-delay optimal H2 model approximation and its first -order optimality conditions. We will emphasize the potential benefit and effectiveness of the proposed approach. Let us consider a model G of order N = 20, given by the following transfer function G(s) = N Y j=1 µj , s − µj (17) where µ j ∈ R− ( j = 1, . . . , N) are linearly spaced between [−2 − 1]. The impulse response of G is given by the solid dotted blue line in Figure 1. Interestingly, it behaves like a system with an input delay. In order to fit the framework proposed in this paper, input-delay H2 optimal model Ĥd = ∆ˆ o Ĥ∆ˆ i of order n = 2 (solid red) was obtained by applying Theorem 4.1 and IO-dIRKA, as described in Section 4. The obtained delay model is compared with delay-free approximations of order n = {2, 3, 4}, obtained with IRKA3 . All the results are reported on Figure 1. Impulse response G, N = 20 Ĥd , n = 2, τ = 8.7179 (IO-dIRKA) Ĥ, n = 2 (IRKA) Ĥ, n = 3 (IRKA) Ĥ, n = 4 (IRKA) 0.12 0.1 Amplitude 0.08 0.06 0.04 0.02 0 −0.02 −0.04 0 5 10 15 20 25 30 35 40 Time (s) Figure 1: Impulse response of the original model H of order N = 20 (solid dotted blue line), the input-delay H2 -optimal model Ĥd of order n = 2 (solid red line) and the delay-free H2 -optimal models Ĥ of order n = {2, 3, 4} (dashed dark green, light green and yellow lines). As clearly shown on Figure 1, the proposed methodology allows to obtain an input-delay H2 approximation of model G that clearly provides a better matching than the delay-free cases, even for higher orders (here, IRKA with n = 4 still have a bad matching and exhibits difficulties in accurately catching the delay and main dynamics). Indeed, the delay-free cases exhibits an oscillatory behaviour during the first seconds while the input-delay model Ĥd takes benefit of the delay structure to focus on the main dynamical effect. Moreover, the approximation model of Ĥd satisfies the conditions given in Theorem 4.1. Remark 5.1 (Numerical results (SISO case, n = 2)). For sake of completeness, the optimal numerical values obtained with MIMO IO-dIRKA are: λ̂1,2 = −2.0320 × 10−1 ± i 2.0700 × 10−1 , 3 Using the implementation available in the MORE toolbox [18], http://w3.onera.fr/more/. 11 φ̂1,2 = 1.5713 × 10−3 ± i 1.8691 × 10−1 and the optimal delay τ = 8.7179. The interpolation conditions can then easily be checked: • Condition (14) leads to Ĥ(−λ̂1,2 ) = G̃(−λ̂1,2 ) = 2.3567 × 10−1 − i 2.3614 × 10−1 and Ĥ0 (−λ̂1,2 ) = G̃0 (−λ̂1,2 ) = 5.6466 × 10−1 ± i 1.1465.  n  N X X φk   eτµ j , one obtains 9.7284 × 10−5 , which is close to µ j ψ j  • When evaluating j=1 k=1 µ j + λ̂k zero, as stated by condition (15). With reference to Figure 2, similar results are obtained in the case of an input delay-dependent approximation of order n = 4 (using IO-dIRKA) and delay-free approximation of order n = {4, 5, 6} (using IRKA). Then, Figure 3 shows the impulse response mismatch error for these different configurations. For each reduced order models, the mean square absolute error ε of the impulse response are computed. The main observation that can be made is that the mismatch error obtained for Ĥd of order n = 4 is lower that the one obtained by a delay-free model Ĥ of order n = 6 (a better result is obtained for a delay-free model with an order n = 7). This motivates the use of the specific approximation model delay structure. Impulse response G, N = 20 Ĥd , n = 4, τ = 6.4103 (IO-dIRKA) Ĥ, n = 4 (IRKA) Ĥ, n = 5 (IRKA) Ĥ, n = 6 (IRKA) 0.12 0.1 Amplitude 0.08 0.06 0.04 0.02 0 −0.02 0 5 10 15 20 25 30 35 40 Time (s) Figure 2: Impulse response of the original model H of order N = 20 (solid dotted blue line), the input-delay H2 -optimal model Ĥd of order n = 4 (solid red line) and the delay-free H2 -optimal models Ĥ of order n = {4, 5, 6} (dashed dark green, light green and yellow lines). 12 Impulse response error −2 10 −3 Amplitude 10 −4 10 −5 10 −6 10 −7 10 −8 10 0 Ĥd , n = 4, τ = 6.4103 with mean error ε =2.55906e-07 (IO-dIRKA) Ĥ, n = 4 with mean error ε =3.75348e-05 (IRKA) Ĥ, n = 5 with mean error ε =4.94274e-06 (IRKA) Ĥ, n = 6 with mean error ε =4.56304e-07 (IRKA) 5 10 15 20 25 30 35 40 Time (s) Figure 3: Impulse response error between the original model H of order N = 20 and the input-delay H2 -optimal model Ĥd of order n = 4 (solid red line) and the delay-free H2 -optimal models Ĥ of order n = {4, 5, 6} (dashed dark green, light green and yellow lines). 6. Conclusion The main contribution of this paper is the derivation of the first-order H2 optimality conditions for Problem 2.1. It forms a direct extension of the bi-tangential interpolation conditions of the delay-free case derived in [1, 2]. Theorem 4.1 establishes that if Ĥd = ∆ˆ o Ĥ∆ˆ i is a local optimum, then the parameters of this latter verify an extended set of matricial equalities. These ones are of two types: first, (i) a subset of interpolation conditions (12) satisfied by the rational part Ĥ of Ĥd , which generalizes the delay-free case; secondly, (ii) a subset of matricial relationships (13) focussing on the input/output delay blocks ∆ˆ o , ∆ˆ i . These conditions all are dependent on the reduced order model parametrization described by b̂k , ĉk , λ̂k , τ̂l and γ̂m , and solving Problem 2.1 requires to tackle a non-convex optmization problem. Nevertheless, an algorithm referred to as IO-dIRKA, has been proposed to practically address this issue. This latter decorrelates the decision variables between them by solving, firstly for given ∆ˆ i , ∆ˆ o matrices, an optimal H2 approximation problem, and then, in a second stage, a nonlinear maximization problem (16) to determine the optimal values of the delays. Both optimizations rely on descent methods, taking benefits from the analytical expressions of the gradients of the H2 mismatch gap ∇J. Numerical experiment have also been presented, illustrating the benefit of the proposed approximation delay structure with respect to standard delay-free approximation methods. References [1] S. Gugercin, A. C. Antoulas, C. Beattie, H2 model reduction for large-scale linear dynamical systems, SIAM Journal on matrix analysis and applications 30 (2) (2008) 609–638. [2] P. Van Dooren, K. A. Gallivan, P.-A. Absil, H2 -optimal model reduction of MIMO systems, Applied Mathematics Letters 21 (12) (2008) 1267–1273. [3] J. T. Spanos, M. H. Milman, D. L. Mingori, A new algorithm for l2 optimal model reduction, Automatica 28 (5) (1992) 897–909. [4] D. C. Hyland, D. S. Bernstein, The optimal projection equations for model reduction and the relationships among the methods of Wilson, Skelton, and Moore, IEEE Transactions on Automatic Control 30 (12) (1985) 1201–1211. 13 [5] D. A. Wilson, Optimum solution of model-reduction problem, in: Proceedings of the Institution of Electrical Engineers, Vol. 117, IET, 1970, pp. 1161–1165. [6] L. Meier III, D. G. Luenberger, Approximation of linear constant systems, IEEE Transactions on Automatic Control 12 (5) (1967) 585–588. [7] C. A. Beattie, S. Gugercin, A trust region method for optimal H2 model reduction, in: Proceedings of the 48th Conference on Decision and Control, IEEE, 2009, pp. 5370–5375. [8] E. J. Grimme, Krylov projection methods for model reduction, Ph.D. thesis, Ph.D. thesis, University of Illinois, Urbana-Champaign, Urbana, IL (1997). [9] A. Astolfi, Model reduction by moment matching for linear and nonlinear systems, IEEE Transactions on Automatic Control 55 (10) (2010) 2321–2336. [10] A. C. Antoulas, D. C. Sorensen, S. Gugercin, A survey of model reduction methods for large-scale systems, Contemporary mathematics 280 (2001) 193–220. [11] A. C. Antoulas, Approximation of large-scale dynamical systems, Vol. 6, SIAM, 2005. [12] M. Opmeer, Optimal model reduction for non-rational functions, in: 14th annual European Control Conference July 15th, Vol. to appear, 2015. [13] Y. Halevi, Reduced-order models with delay, International journal of control 64 (4) (1996) 733–744. [14] G. Scarciotti, A. Astolfi, Model reduction by moment matching for linear time-delay systems, in: 19th IFAC World Congress, Cape Town, South Africa, August 24, Vol. 29, 2014. [15] I. Pontes Duff, C. Poussot-Vassal, C. Seren, Realization independent single time-delay dynamical model interpolation and H2 -optimal approximation, in: Proceedings of the 54st IEEE Conference on Decision and Control, 2015. [16] P. Schulze, B. Unger, Data-driven interpolation of dynamical systems with delay, Preprint-Reihe des Instituts fur Mathematik, Technische Universitat Berlin. [17] A. J. Mayo, A. C. Antoulas, A framework for the solution of the generalized realization problem, Linear algebra and its applications 425 (2) (2007) 634–662. [18] C. Poussot-Vassal, P. Vuillemin, Introduction to MORE: a MOdel REduction Toolbox, in: Proceedings of the IEEE Multi-conference on Systems and Control, Dubrovnik, Croatia, 2012, pp. 776–781. 14
3cs.SY
Accelerating Empowerment Computation with UCT Tree Search arXiv:1803.09866v1 [cs.AI] 27 Mar 2018 Christoph Salge1,2, Christian Guckelsberger3, Rodrigo Canaan2 and Tobias Mahlmann Abstract— Models of intrinsic motivation present an important means to produce sensible behaviour in the absence of extrinsic rewards. Applications in video games are varied, and range from intrinsically motivated general game-playing agents to non-player characters such as companions and enemies. The information-theoretic quantity of Empowerment is a particularly promising candidate motivation to produce believable, generic and robust behaviour. However, while it can be used in the absence of external reward functions that would need to be crafted and learned, empowerment is computationally expensive. In this paper, we propose a modified UCT tree search method to mitigate empowerment’s computational complexity in discrete and deterministic scenarios. We demonstrate how to modify a Monte-Carlo Search Tree with UCT to realise empowerment maximisation, and discuss three additional modifications that facilitate better sampling. We evaluate the approach both quantitatively, by analysing how close our approach gets to the baseline of exhaustive empowerment computation with varying amounts of computational resources, and qualitatively, by analysing the resulting behaviour in a Minecraft-like scenario. I. I NTRODUCTION The empowerment formalism [1], [2] offers interesting game applications in terms of believable NPC behaviour [3], general game-play [4] and player experience modelling [5]. But the high computational complexity of empowerment is problematic for a wider application in games. In this paper we show how a UCT tree search formalism [6], [7] can be adapted to approximate empowerment maximisation in the discrete domain. But first, we motivate the application of empowerment to games in more detail. A. Motivation Empowerment is a measure of how much an agent can affect the world it itself perceives. Empowerment maximisation is considered an intrinsic motivation (IM) [8], and has been recently linked to competence and autonomy, two motivations which are frequently discussed in a games context [9]. As intrinsic motivation, i.e. as an essential motivation linked to agency itself, empowerment can generate behaviour even in the absence of externally defined goals. Behaviour then results from fulfilling a motivation that arises from the agent-world interaction. An illustrative, non-empowerment example for this is the work of Merrick and Maher [10], [11], where an agent’s actions are selected based on learning progress [12] and curiosity [13]. Curiosity, or the desire 1 School of Computer Science, University of Hertfordshire, College Lane, AL10 9AB, Hatfield, UK [email protected] 2 Department of Computer Science and Engineering, New York University, 5 MetroTech Center, 11201, Brooklyn, NY, USA [email protected] 3 Computational Creativity Group Goldsmiths, University of London London, SE14 6NW, UK [email protected] to experience something new, can create behaviour without further reward. The broad concept of curiosity is also a good illustration of an intrinsic motivation, as it is hard to imagine agency without the least desire to experience novelty or learn something new. Empowerment, in contrast, is about having affordances, about self-efficacy and the ability to affect one’s own world. Empowerment has also been linked to the idea of an organism’s striving to preserve its precarious existence [14]. Applied to a Minecraft-like simulation this drive to selfpreservation resulted in behaviour where the agent would restructure the world to keep itself alive [15], producing different behaviour patterns in reaction to changes in the environment. The same work also demonstrated how the embodiment of the agent was reflected in the structures built in the world. This apparent self-directed behaviour, arising from- and reacting to changes in the game world make the application of empowerment in games interesting. Previously, empowerment has been applied to play Sokoban and PacMan [4]. In this work, Anthony et al. speak about the generality of empowerment by asserting that it provides a utility that: “1) derives only from the structure of the problem itself and not from an external reward; 2) identifies the desirability of states in a way that matches intuition; and 3) carries over between scenarios of apparently different character.” This would make empowerment a good proxy for general game-play, and thus biasing the decision making of reward-optimising agents with empowerment might lead to better performance. Similar approaches have been used in the domain of robotics, where a robotic follower [16] and underwater vehicles [17] had their decision making biased or enhanced with empowerment maximisation. But while the empowerment formalism is generally applicable, i.e. can be computed based just on the structure of a given forward model, the utility it provides may not always agree with an externally defined reward. Hence, it is possible to define a (possibly contrived) win condition that conflicts with empowerment. In a lot of cases, though, games are designed to be aligned with intrinsic motivations, and progressing in a game usually goes along with increasing player empowerment. Creating believable non-player characters in a game is another possible application of empowerment in games. Empowerment maximisation can, without defined goals, produce behaviour related to self-preservation and maximisation of options. This can be used to give NPCs an appearance of selfdetermination. The general applicability of the formalism also allows NPCs to adapt to changing circumstances. This has been explored by Guckelsberger et.al. [3] for the design of general companion characters. In addition to having the companion NPC maximise their own empowerment, two ad- ditional empowerment drives where introduced. Maximising the empowerment of the player motivates the companion to protect and help. It would, for example, shoot enemies that try to kill the player. This multi-perspective approach has also been explored in relation to robots, where it could produce generic robot behaviour guidelines [18]. Finally, there is also the question to which extent a player’s empowerment in a game can be used as predictor for their experience. A preliminary study [5] identified causal efficacy as potential candidate experience that empowerment is closely related to, with mediate effects on “challenge, involvement, attention and engagement, learning and emotions”. Having a measure that computes user experience without an actual player would be beneficial in rapid prototyping and when creating or adapting games automatically. Yet, one downside of empowerment maximisation is its lack of scalability, due to the formalism’s high computational complexity, especially when looking at longer time horizons. Approximations have been developed both for the continuous domain [19] and discrete but noisy models [4]. In this paper, we use UCT to accelerate the computation of the most empowered action in a discrete and deterministic model. B. Overview We first describe the actual empowerment formalism, and then focus on empowerment in discrete and deterministic models. We discuss the problems arising from sparse sampling, and introduce a modified UCT tree search algorithm to find the most empowered actions with less sampling. We complement this with three modifications – novelty bias, aggregated empowerment and full branching – to further enhance the sampling. We evaluate the optimisation scheme in a Minecraft-like world model which has also been used in previous work [15]. We briefly introduce the model, followed by a quantitative and a qualitative evaluation. We demonstrate how the UCT approach and the different modifications perform better with less samples than the current baseline of sparse random sampling. II. E MPOWERMENT Rt+1 At Rt+2 St+1 At+1 Rt+3 St+2 At+2 St+3 Figure 1. The perception-action-loop visualised as a Bayesian network. S is the sensor, A is the actuator, and R represents the rest of the system. The index t indicates the time at which the variable is considered. This model is a minimal model for a simple memoryless agent. The red arrows indicate the direction of the potential causal flow relevant for 3-step empowerment. III. E MPOWERMENT Empowerment [1], [15] is an information-theoretic formalism that captures how much an agent can affect the world it itself perceives. It is defined for all systems that can be modelled as an action-perception loop, as seen in Fig. 1. Where the random variables S, A and R model the sensors, actions and remaining state of the world, respectively. Empowerment for a given state r ∈ R is formally defined as the channel capacity from an agent’s actions at time t to its sensors at a later point in time. This channel goes through the environment R. A common generalisation is nstep empowerment, where all actions from at to at+n−1 are considered as input to the channel, and the output is the sensor of the agent at t + n: E(rt ) = max p(at...t+n−1 ) I(St+n ; At...t+n−1 |rt ). (1) The quantity captures how much information an agent can “inject” into its sensor St+n via the environment by intervening earlier in At...t+n−1 . It is equivalent to potential causal information flow as defined in [20]. An agent is usually high empowered if it has a lot of different options that all lead to different, predictable outcomes, unaffected by noise. A highly empowered agent can reliably bring about many different sensor states. A more detailed discussion of the general concept and its information theoretic basis can be found in [1], [15]. Empowerment maximisation is the idea that an agent wants to be in a state that is highly empowered. Note, when computing the empowerment for a given state the channel capacity achieving distribution p(at...t+n−1 ) might contain a lot of action sequences that lead to bad outcomes. But the action policy, i.e the way the agent picks it actions, is not determined by this distribution. Instead, a greedy empowerment maximisation strategy computes the empowerment for all possible successor states to the current states, and then chooses the action leading to the one with the most empowerment. It is empowerment maximisation that is considered an intrinsic motivation, and in this paper, we are focussing on how to efficiently determine which actions will lead us to the most empowered state. While empowerment can be defined for both a noisy and even a continuous channel, in this paper we focus on discrete and deterministic models. In the deterministic case, where each possible action sequence at , ..., at+n−1 leads to one specific state st+n , the channel capacity is the logarithm of all reachable states. So, to calculate the empowerment we have to determine the resulting sensor state for each possible n-step action sequence, and then count how many different states there are in total. This simplifies the computation significantly, and allows to compute n-step empowerment for larger time horizons n. We will refer to these reachable sensor states as “reachable states”, dropping the word sensor for brevity. Despite this simplification, if we look at a model where each action step has, for example, a branching factor of 5, we still have to evaluate 5n action sequences and the corresponding final states. This number quickly grows infeasibly. In previous work [15] this was addressed with sub-sampling, where a random subset of all possible action sequences was evaluated to compute 15-step empowerment, with a branching factor of 12. In this work the limitations of random sampling became evident. Sometimes, the empowerment-maximising agent would be in a situation where it could get to a part of the world where it would be able to reach a lot of different sensor states, but to get there it would have to perform very specific actions in the beginning of the action sequence - think of a bridge as an evocative example. Due to the random nature of the sampling, this bridge might only be crossed with a few of the sequences, and the evaluation would miss the considerable gain that going over the bridge yields for the agent’s empowerment. In this work, we aim to use UCT tree search to both (i) bias the exploration towards those initial sequences, and to (ii) identify the best possible action more efficiently. IV. E MPOWERMENT WITH UCT T REE S EARCH In this section we outline how to use tree search with UCT (upper confidence bound applied to tree search, [6]) to accelerate the decision making based on deterministic empowerment. To find the best action, we need to determine which of the successor states of the current world state has the most different sensor states reachable with action sequences of length n. Note, that while we compute the empowerment for sensor states derived form the world, the computations to determine the empowerment are done with a complete model of all world state transitions. In other words, our computation is not limited by the agent’s perspective. Our approach is inspired by Monte Carlo tree search (MCTS) with UCT [7], but there are substantial adaptations in the expansion, simulation and backpropagation steps. The basic idea of MCTS UCT, or any informed search for that matter, is to guide the use of resources, such as forward model calls, to the parts of the search space which yield the most information for picking the best action. So, when we sample action sequences to determine reachable sensor states, we assume that sequences starting with actions that have led to new results are more likely to yield new results again. We then use the UCT formula [6] to bias our exploration towards those actions that have previously led to new states. Further analysis is still needed to determine if the mathematical properties of the bandit problem, which UCT is derived from, hold for empowerment computation. Here we look at simulated results only. In the next section, we describe the algorithm in detail, and motivate three modifications. Both are further illustrated with pseudocode in Alg. 1. Keep in mind, the goals is to determine which successor state of the current world state has the most reachable sensor states, i.e. is the most empowered. A. UCT tree search In our algorithm nodes are associated with world states. We start by creating a root node that is associated with the world in its current state. This node has a depth of zero. 1) Expansion: The algorithm starts at the root, and checks if there are unexpanded, i.e. unvisited children. As long as there are unvisited children we select randomly one of the actions that would lead to an unexpanded child. We create the child node with a depth value one higher than its parent node. We then repeat the expansion step, i.e. expanding another unvisited child, until we reach a node that has a depth equal to the empowerment horizon n plus one. This is because the first step just creates the successor nodes that we are evaluation for their empowerment, and the successive n steps realise the n-step empowerment approximation. 2) Backpropagation: Once we reach a node at the horizon, we obtain the agent’s sensor state and store it in the set of reachable states in the node. We then also add this reachable state to the node’s parent node. The parent checks if it already has this state in its reachability set, and if not, adds it. It then also adds it to its own parent, recursively. After the backpropagation finishes, the tree should be in a state where each node has a reachability set that contains all sensor states that can be reached from it with the already expanded action sequences. After this step the algorithm starts over at the root of the tree, if there is time left. 3) Selection: As the tree fills up, the algorithm will encounter nodes where all children have at least been visited once, and it then has to decide which node to expand again. At this point we sort the children c with the modified UCT formula and pick the child c with the highest value: r log (root.visits) c.states.size() + 0.01 · (2) uct(c) = c.visits c.visits The function states.size() gives us the size of the reachability set, and visits() tells us how often the root node and the child node have been visited. The size of the reachability set divided by the visits to the child gives us a value between 0.0 and 1.0, the ratio of how many new states each visit to this particular child found. The best value here is 1.0, meaning every visit leads to one new sensor state. The term in the square root guides selection towards underexplored states; it grows larger as more action sequences are sampled that do not go through c. The factor of 0.01 was determined experimentally, as it lead to a good balance where the distribution of visits among children was neither approximately uniform (as it would be for a larger value), nor heavily skewed towards the first best solution (as it would be for a smaller value). 4) Action Selection: At some point the algorithm runs out of time (or some other computational limiter) and it needs to decide what action to take. It looks at the root and picks the action leading to the child with the biggest reachability set. This action should lead to a state with the highest n-step empowerment, meaning that from this state, the agent can reach the maximum number of different sensor states within n steps. Note that the algorithm does not select the state with the highest ratio of new states vs. visits, which was used for the UCT based selection. Algorithm 1 Overview of the agent’s decision making algorithm. Methods that take place in other objects, such as applying actions to the world or selecting a random number are omitted for brevity. HORIZON is n + 1 for n-step empowerment, as we can determine the initial successor states in the same tree. The colours indicate code changes for the modification. For basic UCT empowerment read just the code in black. For aggregated empowerment, add the red line at 18. For novelty bias add the two blue code snippets in 29 and 36. For the full branching modification add the code in green, and set DEPTH to a non-zero value. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: procedure B EST ACTION(World w) Node root ← new Node while time left do depth ← 0 Node t ← root World test ←copy(w) while depth < HORIZON - DEPTH do t.visits++ depth++ if t has unexpanded children then Action a ← R ANDOM ACTION(t, test) test.applyAction(a) Node child ← new Node child.parent ← t child.action ← a t.children.add(child) state ← test.s() ⊲ Agent sensor state A DD S TATE(state, child) t ← child else ⊲ use UCT selection t ← B EST C HILD(t, root) test.applyAction(t.action) B RANCH(t, test, DEPTH, root) return root.children[max(states)].action 28: 29: 30: 33: 34: 35: 36: 37: 38: procedure A DD S TATE(state, Node n) if state 6∈ n.states then n.states.add(state) if state 6∈ parent.states then n.unique++ if ∃ n.parent then A DD S TATE(state, n.parent) Rationale: Compared with randomly sampling action sequences for each successor state, this algorithm should perform better at finding the state with the highest empowerment, as it spends less time on investigating the worst alternatives. The UCT function in selection should bias computational resources towards the most promising candidates. While the utility of a node for action selection is the size of the reachability set, we chose to divide this value by the number of visits for the selection phase. We thus keep the value between 0.0 and 1.0 and the nodes remain comparable. If this was not the case, nodes that had been explored more would be preferred as the number of found reachable states heavily depends on the number of visits. Before we evaluate this approach, referred to as UCT from now on, we introduce three modifications to the algorithm. procedure B EST C HILD(Node t, Node root) best ← null f itness ← 0 for c ∈ t.children do f= |c.states|+c.unique c.visits q root.visits + 0.01 · log c.visits if f > f itness then f itness ← f ; best ← c return best 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 25: 26: 27: 31: 32: procedure B RANCH(Node t, World w, d, Node root) if d = 0 then state ← test.s() ⊲ Agent sensor state A DD S TATE(state, t, root) else Action[] a ← w.getPossibleActions() for action ∈ a do World test ← copy(w) test.applyAction(action) Node child ← new Node child.parent ← t child.action ← action t.children.add(child) B RANCH(child, test, d - 1, root) 54: 55: 56: 57: 58: procedure R ANDOM ACTION(Node t, World w) Action[] a ← w.getPossibleActions() for actions ∈ t.children do a.remove(action) return random(a) B. UCT with Novelty Bias For this modification we check every time a child node adds a reachable state to its parents reachability set, if this state is new to the set. If this is the case, no other child of that parent has an expanded action sequence leading to that sensor state yet. In case of a novel addition, the child increases its novelty counter by one (line 29 in Alg. 1). The novelty counter is added to the size of the reachability set in the UCT function. This means that the performance of the nodes is now not only defined by how many different states it found, but also by how many of those states were novel contribution to the reachability set of its parent node. Rationale: This modification is aimed at biasing exploration towards sub-sequences that add novel states. Consider an agent in front of a doorway. One action leads through it, while the others keep the agent moving around in the room. The sequences that stay in the room end up overlapping, and while they might each lead to a sizeable amount of states, they all lead to the same states. In contrast, sequences that go through the door can add new reachable states to the parent nodes, and should therefore be preferred. C. Aggregated Empowerment For aggregated empowerment, which we will refer to as UCTa, we not only consider the sensor states reached at tree depth n, but we also consider all reachable states along the way. This is achieved by simply adding the sensor state of the current world state to every newly expanded node and propagating it upward (line 18 in Alg.1). Rationale: Aggregated empowerment corresponds to a somewhat different quantity, and the implications of this measure go beyond the scope of this paper. Using this value to approximate regular empowerment however still has the advantages that it allows to differentiate between single action sequences. Normally, each sequence reaches exactly one state. But with aggregated empowerment, sequences that go through different sensor sequences along the way are considered better. This difference can indicate that the agent is still operational and able to affect the world. More conceptually, it also allows to differentiate between different sequences, even if they ultimately end in the same state, e.g. death. In this case, the agents prefers to live a less boring life. In a way, this introduces a form of count-based novelty into the empowerment calculation. the agent will ‘climb’ to the location above the target block. In all other cases the move fails (is blocked) and the agent remains in its current position. The agent can also act in all six directions (above, below, north, south, east, west). This action is context-sensitive on the agent’s inventory, which can hold exactly one block. If the inventory is empty, the agent will try to take the block from the target location into its inventory, if there is any. If the inventory contains a block, the agent will try to place it. This will succeed if the target location is empty. If an action fails, the world remains unchanged. There are two additional actions, waiting and destroying the current block in the inventory. Overall, this gives the agent 12 actions in each time step. Between actions the world simulates liquid flow and gravity. Agents and lava are affected by gravity, i.e. they fall until they rest above a filled block. Earth blocks are not affected by gravity. Lava spreads to neighbouring tiles every 4 time steps, if they are empty. Lava is an environmental hazard, and the agent dies if it is next to a lava block. ‘Death’ in this case means that the agent’s actions have no effect any more on its world. The sensors considered for the empowerment computation capture the agent’s x, y, z position. B. Method D. UCT with Full Branching For n-step empowerment with k-step full branching, the algorithm only expands the tree to a depth of n − k, i.e. it stops k steps before it reaches the time horizon. It then fully expands the tree from that node for the remaining k steps with depth-first search, and eventually propagates all found sensor states upwards. All full branching examples in this paper use 1-step full branching. This modification is implemented by the extension of the BRANCH function in Alg.1, highlighted in green. 1) Rationale: Full branching also aims to differentiate between sequences. It basically computes 1-step deterministic empowerment for the semi-leaf node. This local empowerment ideally gives us an idea of how empowered close-by states are, and thus should guide our exploration towards- or away from action sequences starting with the same actions. V. E VALUATION A. Simulation Model To evaluate the different UCT algorithms we implemented a three-dimensional block world, similar to [15]. The world is a three dimensional grid, and each grid cell is empty or contains exactly one block such as earth, the agent and lava. The agent can try to move in the four cardinal directions (north, east, west, south). The move will be successful, if a) the target location is empty, or if b) the target location is filled, but the one above is empty. In the second case, Fig. 2: Typical randomly generated world used for the quantitative evaluation. Two red lava blocks are visible among the grey earth blocks. The agent is colored blue. For the quantitative evaluation we created 1000 different random worlds of size 7x7x7. Each block has a 40% chance to be an earth block, a 2% chance to be a lava block, and remains empty otherwise. Fig. 2 shows an example world. The agent (blue) is placed in a random position, replacing the block in that position if necessary. For each world we computed 4-step empowerment with an exhaustive depth-first search to obtain a baseline comparison. We recorded the number of reachable states, which determine the empowerment, for each immediate successor state and the action leading to that state from the root. This gives us an empowerment value for each action. The UCT algorithm can ultimately be applied to longer action sequences, but 1 Ratio of Optimal Decisions 0.9 0.8 0.7 0.6 Basic UCT UCT with Novelty UCT with Branching UCT with Both UCTa UCTa with Novelty UCTa with Branching UCTa with Both 0.5 0.4 0.3 0.2 10−2 10−1 100 Forward Calls in % of Exhaustive Search 101 102 Fig. 3: Ratio of selecting the optimal action for different budgets of forward model calls. The evaluation is based on 1000 different random worlds, computing 4-step action sequences. 1 Average Relative Performance 0.95 0.9 0.85 Basic UCT UCT with Novelty UCT with Branching UCT with Both UCTa UCTa with Novelty UCTa with Branching UCTa with Both 0.8 0.75 0.7 0.65 10−2 10−1 100 Forward Calls in % of Exhaustive Search 101 102 Fig. 4: Average relative performance (in reachable states) for the picked actions compared to the optimal action, for different budgets of forward model calls. The evaluation is based on 1000 different random worlds, computing 4-step action sequences. we chose a horizon of 4 for the quantitative evaluation, as it allows us to compare the approximations to an exact baseline. We evaluated 9 different algorithms. The basic agent realises just random sampling, as describe in [15]. We evaluated the described UCT algorithm with each of the three modifications (novelty bias, aggregated empowerment, full branching for 1 step) turned on or off. Additionally, we evaluated the UCTa algorithm based on aggregated empow- erment for each modification. For each of the 1000 different worlds, each of the 9 algorithms tried to find the most empowered action. Our goal was to see how the algorithm’s performance would degrade if they were given less computational resources. To have a hardware-independent comparison, we limited each algorithm to a certain number of forward model calls, which are used every time a world is advanced by applying an action. This decision was based on a preliminary analysis, showing that forward model calls were (unsurprisingly) the main contributor to computational load. We recorded the number of forward model calls used by the depth-first algorithm from the exhaustive baseline computation. This number, 22621, was considered as 100 % of needed calls. We then evaluated all 9 algorithms on all 1000 worlds by giving them only 1/2, 1/4, 1/8, etc, of the forward calls required for the baseline. The performance of returned actions was evaluated in two ways. We checked, in comparison to the baseline computation, if the action selected by an action is optimal, i.e. if it has as many reachable states as the best answer. The average performance in this case is the ratio of how many of the chosen actions where optimal. We also implemented a second performance measure, where we compared the empowerment of the given action to the empowerment of the best action. If for example the best action would lead to a state with 20 reachable states, and the given answer would lead to a state with 10 reachable states, the performance would be 0.5. The performance is then averaged over the 1000 tested worlds. C. Results Figs. 3 and 4 show the results of the evaluation. As expected, both performance measures get worse if the agents get fewer forward calls to determine the best action. The important result here is that the UCT algorithms, especially those with modifications, outperform the basic agent from [15] for less forward calls. If we look at the graph in more detail, we see that for the least amount of samples, all agents perform at about 0.7 in Fig. 4 and at about 0.25 in Fig. 3. This is basically the performance of a random agent that occasionally finds the best action by chance, or picks an action that has decent empowerment. Keep in mind that in some worlds several actions are optimal, or close to optimal. The remaining graph can be split into three parts. For the first 5 sample points, i.e. the part with the least forward , as well as UCT calls, we see that the basic agent and UCT with novelty all perform at the random level. At this point so few forward calls are made that each child of the root is only expanded once, i.e. has one full actions sequence going through it evaluated. This does not allow yet for an informed choice, as all sequences in this case lead to exactly one sensor state, making all choices equivalent. The algorithms with aggregated empowerment ( , , , ) perform better here, as even a single sequence becomes informative. Each sequence might be visiting more or fewer different states, giving a better picture of how much an agent that picked a specific first action can affect the world afterwards. If, for example, the first action would lead the agent to touch lava and die, or fall in a hole, then all successive states of that sequence would be identical. The four algorithms with full 1-step , , , ) perform best in the segment, branching ( as they create the most information for a single sequence. By evaluating how many states could be reached from the second to last step, the algorithms can differentiate between different starting actions. These approaches cost slightly more, as they use 11 additional forward calls in the end, but then saves forward calls by not having to go down the same full sequence several times. In the middle segment of the graph we see an increase in performance for all algorithms. Noteworthy here is that for every configuration the variant with novelty outperforms the respective variant without novelty bias. As we now have enough samples so that children are fully expanded, the UCT selection comes into play. The bias towards those states that brought novel contributions seems to guide us towards better states. Aggregated Empowerment seems to have little effect on performance in this segment. Towards the end, where the algorithms get nearly enough calls to exhaustively sample the space we can see that the marginal difference in performance gets slimmer as the performances increase overall. The algorithms basically split into two groups, those with full 1-step branching , , , ) clearly outperforming those without. ( We should also note that the basic agent performing random sampling gets more competitive once we get to nearly 100% of the needed samples. D. Bridge Example Fig. 5: Bridge example world. The agent (blue) should cross over the narrow bridge and avoid the lava (red). The qualitative effect of the different algorithms becomes more evident if we are looking at a concrete example. In Fig. 5 we see an agent on a small platform surrounded by lava. The agent should cross over the narrow bridge to reach the much larger area. This would massively increase its empowerment. Looking at 10-step empowerment, the agent has a long enough time horizon to figure this out. But it is infeasible to evaluate all 61917364224 10-step action sequences, so we do not have a ground truth to evaluate against. This is the kind of scenario the algorithm in this paper was developed for. We evaluated this example with 10000 forward calls and less, for all previously described algorithmic variations. We ran the world seen in Fig. 5 100 times, and we checked how often the agent started moving onto the bridge leading to more empowerment. From our conceptual understanding of discrete empowerment we know that this is the most empowered option. The graph in Fig. 6 shows the results of the evaluation. The basic and the UCT agent struggle to find the optimal action, as fewer than 5% actually move towards the bridge with the first action. The bridge defines a bottleneck that first has to be crossed with an initial, very specific 4-step sequence, and biasing the exploration of the graph towards this one sequence does not happen in this case. The addition of novelty bias seems to add relatively little, but full branching and aggregated empowerment pick the optimal action far more often. The algorithm that combines all modifications performs best, finding the optimal solution 52% of the time compared to 2% for the basic agent from [15]. As a side note, this is also an example of how directed behaviour arises in a world without the kind of utility function typical to most games. The agent prefers to be on the bigger platform, as it can move around more and dig down to obtain blocks to climb up. 0.6 Optimal Choice 0.5 0.4 0.3 Basic UCT UCT with Novelty UCT with Branching UCT with Both UCTa UCTa with Novelty UCTa with Branching UCTa with Both 0.2 0.1 0 103 104 Forward Model Calls Fig. 6: Evaluation of the bridge example in Fig. 5 for 10-step sequences. The optimal choice is going towards the bridge. VI. CONCLUSION The results indicate that all three modifications introduced in this paper improve the performance of empowerment maximising agents that have a limited amount of computational resources. While the approach is intended to be used for longer, i.e. above 10-steps, action sequences, we evaluated 4-step sequences. Due to computational intractability, we do not have a baseline comparison for longer sequences. The bridge example is promising though, as it showed that the modified algorithms can deal with bottlenecks in longer sequences, something the basic algorithm from previous work [15] struggled with considerably. A. Future Work This technical improvement opens up possible applications of empowerment in the discrete and deterministic domain. For example, this would make it more feasible to apply an empowerment-biased agent to games such as those found in general game-playing competitions [21], [22]. The other possible extension of this work is to extend it to nondeterministic but discrete models. While there are faster approximations for this domain [4], it might prove useful to apply the extensive catalogue of MCTS enhancement to this problem. ACKNOWLEDGEMENT CS is funded by the EU Horizon 2020 programme under the Marie Sklodowska-Curie grant 705643. CG is funded by EPSRC grant [EP/L015846/1] (IGGI). RC gratefully acknowledges the financial support from Honda Research Institute Europe (HRI-EU). R EFERENCES [1] A. S. Klyubin, D. Polani, and C. L. Nehaniv, “Keep Your Options Open: An Information-Based Driving Principle for Sensorimotor Systems,” PloS one, vol. 3, no. 12, pp. 1–14, 2008. [2] C. Salge, C. Glackin, and D. Polani, “Empowerment – an Introduction,” Guided Self-Organization: Inception, pp. 67–114, 2014. [3] C. Guckelsberger, C. Salge, and S. Colton, “Intrinsically Motivated General Companion NPCs via Coupled Empowerment Maximisation,” in Proc. Conf. Computational Intelligence and Games. IEEE, 2016, pp. 1–8. [4] T. Anthony, D. Polani, and C. L. Nehaniv, “General Self-Motivation and Strategy Identification: Case Studies based on Sokoban and PacMan,” Trans. CIAIG, vol. 6, no. 1, pp. 1–17, 2014. [5] C. Guckelsberger, C. Salge, J. Gow, and P. Cairns, “Predicting Player Experience without the Player.: An Exploratory Study,” in Proc. Symp. Computer-Human Interaction in Play. ACM, 2017, pp. 305–315. [6] L. Kocsis and C. Szepesvári, “Bandit based monte-carlo planning,” in Machine Learning: ECML 2006. Springer, 2006, pp. 282–293. [7] C. B. Browne, E. Powley, D. Whitehouse, S. M. Lucas, P. I. Cowling, P. Rohlfshagen, S. Tavener, D. Perez, S. Samothrakis, and S. Colton, “A survey of monte carlo tree search methods,” Trans. CIAIG, vol. 4, no. 1, pp. 1–43, 2012. [8] P.-Y. Oudeyer and F. Kaplan, “How Can We Define Intrinsic Motivation?” in Proc. 8th Conf. Epigenetic Robotics, 2008, pp. 93–101. [9] S. Roohi, J. Takatalo, C. Guckelsberger, and P. Hämäläinen, “Review of intrinsic motivation in simulation-based game testing,” in Proc. 36th ACM Conf. Human Factors in Computing Systems (CHI’18), 2018. [10] K. Merrick, “Modeling Motivation for Adaptive Nonplayer Characters in Dynamic Computer Game Worlds,” CiE, vol. 5, no. 4, p. 1, 2008. [11] K. E. Merrick and M. L. Maher, Motivated Reinforcement Learning. Curious Characters for Multiuser Games. Springer, 2009. [12] P. Y. Oudeyer, F. Kaplan, and V. V. Hafner, “Intrinsic motivation systems for autonomous mental development,” IEEE Trans. Evolutionary Computation, vol. 11, no. 2, pp. 265–286, April 2007. [13] J. Schmidhuber, “Developmental Robotics, Optimal Artificial Curiosity, Creativity, Music, and the Fine Arts,” Connection Science, vol. 18, no. 2, pp. 173–187, 2006. [14] C. Guckelsberger and C. Salge, “Does Empowerment Maximisation Allow for Enactive Artificial Agents?” in Proc. 15th Conf. ALIFE, 2016. [15] C. Salge, C. Glackin, and D. Polani, “Changing the Environment Based on Empowerment as Intrinsic Motivation,” Entropy, vol. 16, no. 5, pp. 2789–2819, 2014. [16] A. Leu, D. Ristić-Durrant, S. Slavnić, C. Glackin, C. Salge, D. Polani, A. Badii, A. Khan, and R. Raval, “CORBYS Cognitive Control Architecture for Robotic Follower,” in Proc. Symp. System Integration. IEEE/SICE, Dec 2013, pp. 394–399. [17] P. Abreu, G. Antonelli, F. Arrichiello, A. Caffaz, A. Caiti, G. Casalino, N. C. Volpi, I. B. De Jong, D. De Palma, H. Duarte et al., “Widely scalable mobile underwater sonar technology: An overview of the h2020 wimust project,” Marine Technology Society Journal, vol. 50, no. 4, pp. 42–53, 2016. [18] C. Salge and D. Polani, “Empowerment As Replacement for the Three Laws of Robotics,” Frontiers in Robotics and AI, vol. 4, p. 25, 2017. [19] C. Salge, C. Glackin, and D. Polani, “Approximation of Empowerment in the Continuous Domain,” Advances in Complex Systems, vol. 16, 2012. [20] N. Ay and D. Polani, “Information flows in causal networks,” Advances in complex systems, vol. 11, no. 01, pp. 17–41, 2008. [21] M. Genesereth, N. Love, and B. Pell, “General game playing: Overview of the aaai competition,” AI magazine, vol. 26, no. 2, p. 62, 2005. [22] D. Perez-Liebana, S. Samothrakis, J. Togelius, S. M. Lucas, and T. Schaul, “General video game ai: Competition, challenges and opportunities,” in AAAI Conf. on Artificial Intelligence, 2016, pp. 4335–4337.
7cs.IT
Hybrid Optimization Method for Reconfiguration of AC/DC Microgrids in All-Electric Ships Qimin Xu, Bo Yang, Zhizhang Pan, Feilong Lin, Qiaoni Han, Cailian Chen, Xinping Guan arXiv:1709.05505v2 [cs.SY] 19 Sep 2017 Department of Automation, Shanghai Jiao Tong University, Shanghai, China Collaborative Innovation Center for Advanced Ship and Deep-Sea Exploration, Shanghai, China Key Laboratory of System Control and Information Processing, Ministry of Education of China, Shanghai, China Email: {qiminxu, bo.yang, cailianchen, and xpguan}@sjtu.edu.cn Abstract—Since the limited power capacity, finite inertia, and dynamic loads make the shipboard power system (SPS) vulnerable, the automatic reconfiguration for failure recovery in SPS is an extremely significant but still challenging problem. It is not only required to operate accurately and optimally, but also to satisfy operating constraints. In this paper, we consider the reconfiguration optimization for hybrid AC/DC microgrids in all-electric ships. Firstly, the multi-zone medium voltage DC (MVDC) SPS model is presented. In this model, the DC power flow for reconfiguration and a generalized AC/DC converter are modeled for accurate reconfiguration. Secondly, since this problem is mixed integer nonlinear programming (MINLP), a hybrid method based on Newton Raphson and Biogeography based Optimization (NRBBO) is designed according to the characteristics of system, loads, and faults. This method facilitates to maximize the weighted load restoration while satisfying operating constraints. Finally, the simulation results demonstrate this method has advantages in terms of power restoration and convergence speed. I. I NTRODUCTION Shipboard power system (SPS) can be considered as an isolated microgrid, because it is self-powered by distributed electrical power generators [1]. Comparing with terrestrial systems, the reliability, safety and fault tolerance design for all-electric ships (AES) is more rigorous. There are three salient features as follows. Firstly, the consequences of a minor fault in a system component can be catastrophic due to the intensive coupling feature of SPS [2]; Secondly, system failure is more fatal for ships than for terrestrial systems, because the personal safety on board is more endangered [1]; Lastly, dynamic loads constitute a large proportion of ship power systems, which changes with operation mode switching. Therefore, effective and intelligent reconfiguration of SPS is essential in response to electric plant casualties and mission changes of the ships. From the perspective of electrical design of AES, there are three architectures of SPS to date, i.e., medium voltage DC (MVDC), AC (MVAC), and higher frequency AC (HFAC). As the ever-increasing DC-based loads, it is likely that AES will feature a medium voltage primary distribution system in the future [1]. Many works have been done on the optimal This work was supported by National Key Research and Development Program of China (2016YFB0901901), National Natural Science Foundation of China (61221003, 61174127, 61104033, and 61273181) SPS reconfiguration in MVDC AES. The objectives include reducing the operating cost, maximizing either the weighted power or the current supplied to loads [3], [4], maximizing stability margins [5], minimizing the number of switch operation [6], etc. All of these works only focused on load management, but was no consideration of the impact of ship operation. Additionally, since the MVDC SPS is a converter based electric power system and the converter power losses make up the most of its power loss, converter model is needed for accurate control and system level analysis. For example, as shown in [7], the maximum converter and transformer power losses in MVDC and MVAC can be up to 1102 kW and 1474 kW, respectively. Therefore, if the power loss cannot be well considered, a invalid control decision would be made, which would result in electrical energy quality descend or even system instability. On the other hand, for the optimal reconfiguration of SPS without speed constraint and converter model, various algorithms have been proposed with different methodologies. In [6], [8]–[10], evolutionary algorithms including genetic algorithm (GA) and particle swarm optimization (PSO) are proposed for the optimal SPS reconfiguration. To the same problem, an interior-point based method was proposed in [3]. A reinforcement learning based algorithm was proposed in [4], which also considers the optimal sequence of switching operation. Most of these works focus on improving the restored power under the operating constraints. However, in IEEE Std. 45-2002 [11] the maximum frequency deviations of ± 3% for continuous operation and ± 4% for transients must be less than 2 seconds. The SPS reconfiguration delay is particularly significant to guarantees the ship’s survivability. Time constrain of algorithms must draw enough attention, especially when growing loads increases the complexity of problem. Taken these considerations into account, firstly we formulate the comprehensive model of MVDC SPS including converter model and multi-zone DC power flow model. The formulated optimal reconfiguration problem is maximizing the weight load power considering generator, load, AC and DC power flow constraints, which is an mixed-integer non-linear programming (MINLP) with integer variables (load switches and redundancy switches) and continous variables (active and reactive power of generators). Secondly, to solve this problem, we design a hybrid algorithm based on Newton Raphson and Biogeography based Optimization (NRBBO) method to realize fast and effective reconfiguration. Specifically, (i) Decoupling: The DC and AC power flows are decoupled and calculated iteratively, thus the orignal problem is converted to mixedinteger linear programming (MILP) problem and non-linear programming (NLP) problem. BBO is responsible for DC part, while NR is for AC and converter part. (ii) Mode distinction: Three fault modes are defined by the fault position. Based on DC power flow formulation, the optimal solutions of three modes can be obtained respectively with reduced complexity. (iii) Layer search: The switch variables used for load control are layered according to load priority, thus each search set consisting of switch variables are reduced greatly. The mode processing and layered methods used for reconfiguration does not impose any restrictions on the topology of SPS. Thirdly, the relationship between the restored power and the position and number of faults is analyzed, which aims at quantifying the system restoring ability against faults and giving a suggestion for structure design. The paper is organized as follows: in Section II, MVDC SPS is modeled and the optimization problem is formulated; Section III details the proposed NRBBO method; the performance of our method is evaluated and compared with existing reconfiguration methodologies in Section IV. Finally, the conclusion is drawn in Section V. II. M ODEL OF S HIPBOARD P OWER S YSTEM In this section, the system models of SPS are described in detail. The classic architecture of MVDC SPS with K electric zones is demonstrated in Fig.1. The DC zones are powered by a starboard bus (SB) and a port bus (PB) which connect to M converters and generators. There are two type generators: main generator (MG) and auxiliary generator (AG). The main notations used in this work are summarized in Table I. Zone 2 3 4 Vital and Semivital loads G1 MTG Redundancy Switch AC/DC AC/DC 9 10 G2 Bus ATG Non-vital loads 5 6 7 STARBOARD SIDE Qacm = Uacm n=1 M X n=1 Iini , Ibi wVg Pl , wl Ydcij Ydc Udci , Idci Pacm , Qacm Uacm , δacm Iacmn , Ymn δm P Cm , Q Cm U Cm , I Cm Pcplm , Plossm Pocm SP k , SS k PV , PSV , PNV PVg (t) P Cm ≤ Pgm ≤ Pgmax Pgmin m m PM: Propulsion Module max Qmin gm ≤ Qgm ≤ Qgm The power flows in SPS can be modeled using the branch ow model Pacm = Uacm Iloadl , Iloadi Physical interpretation Set, number and index of loads Set, number and index of DC zones Number and indexes of generators and converters Number and indexes of DC buses Set of the h-th habitat(solution), h ∈ {1, 2, · · · , H} Number, index of species(switches), Z = L Number, index of layers Layer number that the BBO starts from Fault position between i-th and j-th DC buses Set of fault positions Superscript denoting minimum and maximum Set of loads at the i-th DC bus, Bi ⊂ L Switch of the l-th load, sl ∈ {0, 1} Set of all switches and the switches at the i-th DC bus, Si = {sl : l ∈ Bi } Current of the l-th load, and set of load currents in the i-th DC bus, Iloadi = {Iloadl : l ∈ Bi } Injected current and total load current in the i-th DC bus Weight factor of the g-th grade loads, and there are three grades loads: vital, semi-vital, non-vital Power and weight factor of the l-th load, wl ∈ {wV1 , wV2 , wV3 } Branch admittance between the i-th and j-th DC buses DC admittance matrix Voltage and input current at the i-th DC bus Active and reactive power of m-th generator Voltage and angle of the m-th AC bus Current and branch admittance between the m-th and n-th AC bus Angle associated with the voltage at the bus m Active and reactive input power of i-th converter Input voltage and current of m-th converter Constant and total power loss of m-th converter Output power of m-th converter Redundancy switches of PB and SB in the k-th zone, SPk , SSk ∈ {0, 1} Sets of vital, semi-vital, non-vital loads’ power Power of one load in the g-th grade, PV1 ∈ PV , PV2 ∈ PSV , PV3 ∈ PNV Active Power of converter in the t-th iteration, t ∈ {1, 2, · · · , T } 8 Fig. 1: MVDC shipboard power system architecture. A. AC Power Flow Model M X Notation L, L, l K, K, k M ; m, n N ; i, j Hh Z, z G, g Gs Fpoi,j Fpo max, min Bi Sl S, Si where Pacm , Qacm , Uacm , and δm denote the active power, reactive power, voltage, and phase angle at the AC bus m. In each bus, Pacm = Pgm − Pdm , where Pdm denotes the load demand at the AC bus m. Yacmn represents the branch admittance between the AC bus m and n. The generator at each AC bus also need to satisfy the following constraints: PORT SIDE 11 TABLE I: Main notations Uacn Ymn Re{δm − δn } (1) Uacn Ymn Im{δm − δn }, (2) max min ≤ Uacm ≤ Uac Uac m m Iacmn ≤ min δm max Iac mn ≤ δm ≤ max . δm (3) (4) (5) (6) (7) B. Converter Loss Model The power loss of converter m has three parts, namely, the constant part Pcplm , the linear and the quadratical parts. The latter two depend on the current ICm , which can be calculated by the input power PCm , QCm and voltage UCm . Thus, the power loss model of converter [12] can be expressed as Plossm = Pcplm + a · ICm + b · IC2 m , ICm with (8) SPk + SSk = 1, q PC2 m + Q2Cm √ , = 3UCm (9) where Pcplm , and coefficients a and b are related to the electrical feature of the converter. Moreover the relationship between output power Pocm and input power ICm can be written as Pocm = PCm − Plossm . (10) The current and active power of converter model are bounded as follow: ICm ≤ ICmax m min Poc m (11) ≤ Pocm ≤ max . Poc m (12) C. DC Zone Power Flow Model In the DC zone, there are N buses in total. The power flow can be expressed in a similar way as a general AC power flow. The injected current at the bus i can be written as the sum of the total load currents in this bus and the total current flowing to other N − 1 buses. Since loads are controlled by corresponding switches, the current equation at the bus i is given as: Iini = X l∈Bi N X sl · Iloadl + Ydcij · (Udci − Udcj ), j =1 j 6= i (13) where Bi is the set of loads powered by the bus i. Iloadl and sl indicate the current and switch status of load l at the bus i. sl is a binary variable. Here, for convenience we set the loads as constant current components for analysis. They can also be set as constant impedance or power components. 1 Sp1 11 Converter MG 9 SS1 2 S1 P1 S4 P4 Sp2 S2 P2 P3 S3 5 3 SS 2 S5 P5 4 S7 Sp4 S8 P8 SS3 P9 P6 SS4 S9 S6 6 Switch PB S10 P10 P7 Sp3 12 S11 P11 Converter 10 AG P12 S12 7 The redundancy switches in each zone is mutually exclusive, which determine if the vital and semi-vital loads is powered by PB or SB. The constraint is written as: 8 SB Load Fig. 2: Ship power system model. In order to simplify the DC admittance matrix, the DC buses are numbered like Fig.2. The buses in PB and SB are numbered in order respectively, and the buses connected to the converter are numbered in the last. SPk , SSk ∈ {0, 1}, k ∈ K, (14) thus SPk , SSk determine the load sets Bi at corresponding bus. Combining all the current equations in (13) result in   S1 Iload1   ..   .    S Iload  N̂ N̂   Iin =  (15)  + Ydc U , 0     ..   . 0 T where Iin = [Iin1 Iin2 · · · IinN ] denotes the current vector, Si Ii the total load current at the bus i, N̂ = N − M , and T U = [Udc1 Udc2 · · · UdcN ] the voltage vector. Assuming a unipolar DC grid, the active power injected in the bus i from AC grid can be expressed as Poci = Udci Idci , ∀i ≤ M, (16) Combining (15) and (16), the DC power can be written as     0 S1 Iload1 ..     ..     . .         0  =  SN̂ IloadN̂  + Ydc U , (17)      Poc /UdcN̂+1   0 N̂ +1       .. ..     . . 0 PocN /UdcN Under normal conditions, we assume that one converter bus is the DC slack bus. Here converter N is set as slack bus, the undetermined variables contain Udc1 , · · · , UdcN −1 and PocN . The simplified equations is written as T  PocN PocN ∗ = Ydc · U , ··· −Ib1 · · · − IbN −M UdcN ∗ UdcN (18) where Ibi denote total load current at the i-th DC bus. The detail equations are written as   −Ib1   ..     . Udc1       −IbN −M   ..    .  Poc ∗ /Udc ∗  = Ydc11 Ydc12  .  N N   y Y  UdcN −1  dc22 dc21   ..   . UdcN    PocN −1 /UdcN −1  PocN /UdcN (19) where the matrix Ydc11 is (N − 1) × (N − 1) dimensional matrix, Ydc12 and Ydc21 are N − 1 dimensional column and row vector, and ydc22 is a scale. It is divided into two parts. Therefore, the DC power flow can be calculated iteratively by (19). Additionally, the current and volatage are meet the constraints as follow: max min ≤ Udci ≤ Udc Udc i i Iij ≤ (20) max Iij . (21) D. Load Model The loads are powered by a set of buses which run longitudinally along the PB and SB. The circuit breaks (switches), which can be used to connect the loads and buses. There are three kinds of electric loads: vital loads PV , semi-vital loads PSV and non-vital loads PN V . At a certain time vital and semi-vital loads can only be powered by one bus (PB or SB), which is determined by the redundancy switches. This redundency topology aims to improve the stability of power supply for vital and semi-vital loads. Non-vital loads only connect to one bus, PB or SB. For the safety operation of vital loads, it is necessary to guarantee the power supply of vital loads all the time, which is described as follow: X X (22) Pl > 0. Poc,m − m∈M l∈PV E. Reconfiguration Optimization Problem of MVDC SPS In this paper, with the objective of maximizing the power delivering to loads, we formulate the problem as a MINLP subjected to operation constraints. The constrains are divided into AC, converter, DC zone, and load constraints described in the former subsections. Specifically, the objective function and constrains are expressed as max {S,Pg ,Qg } s.t. L X l=1 wl · sl Pl (23) (1) − (12), (14), (18), (20) − (22). (24) where Pg = {Pg1 , · · · , PgM }, and Qg = {Qg1 , · · · , QgM }. wl ∈ {wV1 , wV2 , WV3 } and sl ∈ S denotes the weight factor and switch status of the load l. The weight factors of three type loads are represented by wV1 , wV2 , and wV3 . III. S YSTEM M ANAGEMENT be updated to recalculate. The constraint (10) in next BBO iteration will update in turn, thus optimal switch set So can be gradully obtained. Fig.3 is the flow chart of the proposed method. AND R ECONFIGURATION Since the MVDC SPS is an AC/DC hybrid system, an NRBBO method is proposed to solve AC power flow and DC load allocatoin separately by updating Plossm . Considering the objective of restored load maximization, DC power flow is calculated by equation (19) before AC part. Firstly, fault mode distinction is executed according to the fault positions. Secondly, the layer number Gs where the search starts is checked. Thirdly, BBO algorithm is applied to calculate the parameters of DC part, such as switch set S and voltage Udci . This algorithm is based on BBO because of its good performance in high dimensional optimization. Then, NR iteration is used to obtain the converter parameters. So the generators parameters can be obtained. At last, if the parameters of converters and generators don’t satisfy the constraints, the Plossm and Gs will Mode Distinction Layer Check Input: ࣠op Output: Mode, Ydc Input: Mode, Ydc Output: Gs LBBO Ploss=0 Input: Gs Output: S , Udc, Idc, POC NR Update Ploss, Gs Input: POC Output: Pc, Ug, Ig, Pg End Y Satisfy constraints ? N Fig. 3: NRBBO flowchart. A. Mode Distinction In order to accurately and effectively calculate DC power flow for reconfiguration, we divide all the fault scenarios into three modes, i.e., non-island fault, island fault and semi-island fault. The mode distinction algorithm is shown in Algorithm 1. If only one side bus (PB or SB) has fault, these cases are Algorithm 1 MODE Distinction if More than one fault in PB and SB respectively then if Two faults in PB and SB of one zone then Mode = island; else Mode = semi-island; end if else Mode = non-island; end if defined as non-island mode. In island mode, there are faults happened in same zone, which causes the system is divided into two part. One case is shown in Fig. 4. If there are more than two faults which happen in different zone, the system is also divided into two part. But there are coupled part between the two part. For example, in Semi-Island fault of Fig. 4, zone 2 is the couple part, and the SS2 , SP2 are the coupled redundancy switches. If SS2 = 0, SP2 = 1, the vital and semivital loads in zone 2 are powered by left island part connected to MG. Otherwise, powered by right island part connected to AG. In island mode as shown in Fig.4, the DC power grid has been divided into two independent parts. The redundancy switches do not need to be changed, and it is just need to modify the admittance Ydc . If fault position is between bus 1 and 2, Ydc12 is set equal to zero. In each isolated part, the bus which connect to converter is selected to be slack bus. And the DC power flow of each part is calculated separately based on (19). 1 S1 P1 Converter MG 9 SS,1 S2 P2 P3 S3 5 Zone 1 SS,2 S10 P10 Sp,4 Sp,3 Sp,2 Sp,1 11 S7 P7 S4 P4 S5 P5 P6 S6 6 Zone 2 Semi-Island SS,3 factors of three level loads respectively. Then, the lower bound of weight factors determined by (25)-(26) can be expressed as PB 4 3 2 S8 P8 SS,4 P9 S9 7 Zone 3 12 Converter S11 P11 10 8 Zone 4 SB Island Fig. 4: Semi-Island and Island scenario. In semi-island mode, the orignal structure is damaged. The coupled redundancy switches SPk , SSk , k ∈ Ωc are need to be reconfigured. Ωc ∈ K denotes the set of coupled zone numbers. Thus the control vector contains S, Pg , Qg , and SPk , SSk , k ∈ Ωc . In order to reduce the computational complexity, two loop search is employed: the outer heuristic search is used to find optimal coupled redundancy switch reconfiguration due to the small scale variables; the inner search is used for optimal load shedding, which is described in the following subsection. Additionally, the corresponding admittences in Ydc need to be modified according to the fault positions. In non-island mode, the redundancy switches in the damaged sides are reconfigured to connect to another side bus. In order to avoid the over-voltage or over-current at the DC buses, the remaining redundancy switches SPk , SSk , k ∈ Ωud are need to be reconfigured. Ωud ∈ K denotes the set of undamaged zone numbers. The latter process of this mode is similar with the semi-island mode. B. Layer Search based on BBO Algorithm When mode distinction is finished, layered search method is employed to calculate the DC power flow according to the priority of loads. Here the layer number G = 3. The L search space is reduced from 2L to G · 2 3 if each priority loads has same quantity. Certainly, the layer number G can be determined by the requirement of actual system. The sets are searched according to the priority from high to low. If constraints check based on (19) are passed, skip ahead to search the next level set directly. To distinguish the priority of loads, the weight factors must satisfy the following constraints: wV2 wV1 wV3 · PV3 , PV3 ∈ PN V , PV2 ∈ PSV , > PV2 wV2 · PV2 > , PV1 ∈ PV , PV1 (27) wV1 (28) AG P12 S12 (25) (26) where PN V , PSV and PV are the sets of non-vital, semi-vital, vital loads respectively. wN V , wSV and wV denote the weight wV3 · PVmax 3 , PVmin 2 wV2 · PVmax 2 , > PVmin 1 wV2 > where wV3 = 1 is considered as reference value, PVmax and 3 PVmax represent the maximum element of P and P sets N V SV 2 respectively, PVmin and PVmin the minimum element of PSV 2 1 and PV sets respectively. In order to solve the mixed integer programming (MILP) problem, BBO algorithm is employed in the layer search. BBO algorithm is an evolutionary algorithm (EA) proposed by Dan Simon in 2008 [13]. The concept was motivated by biogeography based on migration and mutation of the distribution of biological species through time and space. As the major concept in BBO algorithm, migration and mutation are discussed below. 1) Migration: BBO algorithm is a population-based optimization algorithm where the population (habitat in BBO) is a set of candidate solutions. The goodness of candidate solutions are evaluated by the habitat suitability index (HSI). Higher HSI means the solutions have better quality in the optimization problem. Features correlated with HSI include topographic diversity, land area and so on. Each of these features is called a suitability index variable (SIV ). Emigration and immigration are used to probabilistically exchange information between solutions. Specifically, immigration rate λ is used to probabilistically determine whether modifying each SIV or not in a solution. Migration rate µ of other solutions are used to probabilistically determine which one among the solution set will emigrate. A solution with high HSI has abundance of species, so its emigration rate µ is correspondingly large. Since the habitat has finite environment resources for further immigration, its immigration rate λ is small. µ and λ of the h-th habitat can be expressed as µh = E · h , H λh = A(1 − (29) h ), H (30) where E denotes the maximum emigration rate, A the maximum immigration rate, H the maximum habitat count. In the case E = A, the equations above result in µh + λh = E. (31) 2) Mutation: Due to cataclysmic events, the HSI of a natural habitat may be changed drastically. In BBO when this event happens, the SIV mutates by the mutation rates. Hence the solutions have a chance to be better than their previous values. The mutation scheme tends to increase diversity among the solutions. But mutation operation is a high risk process, solutions probabilistically become inferior after mutation process than the previous. Mutation scheme has many kinds of implementations, such as replacing with randomly generated solution, mutation like GA and so on. In migration and mutation process, a few elite solutions are kept in BBO to prevent the best solutions from being damaged. Mutation Habitat1 Mutation Habitat2 , g ∈ {1, 2, 3}, Og = wVg PVmin g PVmin g Mutation Migration Habitat3 Habitat4 HSI(•) < HSI(•) < HSI(•) < HSI(•) • Switch status of Habitat1 (33) {PVmin , PVmin , PVmin }. 1 2 3 ∈ where wVg ∈ {wV1 , wV2 , wV3 }, In order to keep enough search, if the objective error e of the best solutions among two generations is lower than Og , we also execute RE iterations. In [14], the result indicates that when BBO algorithm is used in a binary search problem, the elite version that maintains the best solution can converge to a solution subset, which contains one global optimal solution. Our layered search and mode distinction will reduce the search space of switch variables and increase the mutation probability. It does not change the convergence characteristic of BBO. Migration Migration Migration Mutation Third, we check whether the algorithm would converge when finish the one generation calculation. Due to weight factor, the cut-off conditions of layered search cannot be the same. Og denotes the cut-off error between the best solutions of two generations. According to (27)-(28), it can be defined as C. Converter Power Loss and AC Power Flow Load Fig. 5: BBO algorithm for reconfiguration. Algorithm 2 The proposed hybrid method-NRBBO Input: The fault bus number set: Fpo ; Output: S, Pgm , and Qgm . 1: MODE distinction by Algorithm 1; 2: Layer check by constraints (14), (18); 3: Generate H habitats by Gs ; Plossm ← 0; 4: repeat Hh =[SIVh,1 , SIVh,2 , · · · , SIVh,Z ] = [Sh,1 , Sh,2 , · · · , Sh,L ], 5: for g ← Gs to G do 6: for h ← 1 to H do (32) 7: Calculate the objective value of solutions, keep 2 elite solutions, and operate migration by λh and where SIVh,z represents the value of the z-th independent µh ; variable in the h-th habitat. 8: Bus status calculation by MODE and (18); In the previous section, the power equation in DC zone 9: while Not satisfy constraints (20) - (21) do is written as (18). Due to that zone power is calculated in Generate a new habitat that satisfy (20) - (21); the external iteration firstly, Pocm is needed. However, Plossm 10: end while calculated by (8) is still unknown in the initial state, we set it 11: 12: end for to zero. The lines between generators and PMconverters are also if e < Og and r ≥ RE then assumed to be lossless. So the initial m=1 Pocm equals to 13: PM 14: break; . The detail process of BBO for reconfiguration P m=1 Gm 15: end if in DC zone is introduced as follows. end for First, the solutions Hh are generated by the search start 16: Calculate PCm , Plossm , Pgm , and Qgm by (34), (36)layer Gs . If Gs = 3, the random solutions only generate in (37); switches of non-vital loads while vital and semi-vital loads are 17: Update Plossm , Gs ← g; all set to work. 18: until Satisfy (3)-(7) and (11)-(12) Second, the feasibility of generated solutions are checked BBO algorithm is used to solve DC zone power flow problem and obtain optimal solutions satisfying zonal constrains. In this section it is introduced in detail. Fig.5 shows the migration and mutation processes of BBO for reconfiguration. In the formulated problem, SIV represents the switch status sl , so the h-th habitats Hh can be expressed as by (20)-(21). In each solution the load power of each bus can be calculated by the load switch configuration. The voltage and current can be checked after calculation of dc power flow based on (18). If a solution does not pass the feasibility check, mutation operation is carried on until a feasible one is generated, which is different from the traditional BBO algorithm. The migration operation is carried out after feasibility check. In this part, at first the parameters of converter are calculated by the Pocm obtained in subsection III-B, then the generator’s can be determined by the voltage drop and power loss equations of transmission line while keeping it in the restricted range. According to the equations (8), the converter loss depend on the input current magnitude ICm . Because PORT SIDE 13 in 6 Zone SPS TABLE III: Loads DC network is calculated in the first step, ICm is unknown. In this part, Pocm obtained in the former part are constant parameters. In order to calculate Plossm , an Newton-Raphson iteration based on PCm and QCm is used. VCm and θCm are kept constant. For each converter, the iteration is updated as follows " (t)  (t) # ∂f ∂f (t) fm = − ∂PCm ∂QCm (34) iT h · ∆PCm (t) ∆QCm (t) , with the function fm given by Power & Number PV L (MW) PSV L (MW) PNV L (MW) 1 2 PORT SIDE 3 4 ∆Plnm + ∆Qlnm = PC2 m + Q2Cm (Rm + jXm ), UC2 m 8 9 10 11 STARBOARD SIDE (35) (36) (37) A MVDC SPS with K = 6, N = 14 and M = 2 is shown in Fig. 2. Six DC load zones are fed power from one MG and AG. This model is used for validation and analysis of our algorithm. The simulation parameters of power network are chosen by shipboard power requirements of IEEE Std 1709 [15]. The detail parameters in MVDC SPS model are shown in Table II. The algorithm parameters are set as follows. The weight factors are set as wV1 = 12, wV2 = 4, wV3 = 1 by (27)-(28). Here E and I = 1 and keep elitism = 2. 5 6 14 13 7 12 8 9 10 11 STARBOARD SIDE (a) (b) CASE IV The system work in an optimal configuration under normal condition, in which all the loads are powered to their full capacities. Fig. 6(a) shows a pre-fault condition where all the loads are serviced for a particular switch configuration. After a fault happens, the power can be restored by result of reconfiguration method in a optimal or suboptimal status. Now a fault scenario is considered where faults occur as shown in Fig. 6(b). The portion of the PB between 7 and 10 is thus left without power and the configuration of switches needs to be changed so that the loads can be serviced based on their priorities. The restored power is shown in Table IV. It can be observed that best solution is found by our algorithm. Due to the stochastic characteristic of our algorithm in DC part, nearoptimal solutions are obtained in the most time. The power of MG and AG drops to 5.85 MW and 3.78 MW in the best solution. Table V also shows the switch status of best solution. In this Table, S2(5/11) denote the switch of semi-vital load 2 between bus 5 and 11, N1,2(1,2) the four switches of non-vital loads 1 and 2, which connect to bus 1 and 2. TABLE IV: Load Restored Ptotal 11.6 9.5 9.33 9 9.5 Initial Final Best Mean Worst LINGO Ploss 0.34 0.30 0.29 0.29 0.30 PG1 7.94 5.98 5.85 5.57 5.98 PG2 3.998 3.82 3.78 3.72 3.82 P C1 7.91 5.95 5.83 5.55 5.95 P C2 3.99 3.81 3.77 3.71 3.81 TABLE V: Switch Change Switch No. Initial Status Best 13 12 Fig. 6: Initial and fault scenario. TABLE II: Simulation Parameters Min. 0MW 0MW 2.97kV -1 0.9kV PORT SIDE 3 4 A. Performance of NRBBO IV. S IMULATIONS Max. 8MW 4MW 3.49kV 1 1.1kV 2 6 0.3×2 0.4×2 0.2×2 CASE III where UGm , δGm denote the voltage and angle of generator, UCm , δC m the voltage and angle of converter, ∆Plnm , ∆Qlnm the active and reactive power loss in transmission line. At last, AC constraints (3)-(7) are checked in the overall iteration loop. The detail NRBBO algorithm is shown in Algorithm 2. Parameters P Gi (M G) P Gi (AG) Vac δi Vdc 1 6 14 where t is the iteration index of Newton-Raphson method. After the convergence of fm , the active and reactive power of generators can be calculated by (36)-(37). PCm Rm + QCm Xm UGm ∠δG m = UCm ∠δC m + UCm PCm Rm + QCm Xm +j , UCm 5 Zone No. 3 4 5 0.3×2 0.5×2 0.8×2 10 11 12 0.3×2 0.2×2 STARBOARD SIDE 0.2×2 0.2×2 0.2×2 0.1×2 2 0.5×2 0.3×2 0.1×2 13 7 fm (t) = PCm (t) − Pocm − Plossm (t) , 1 0.2×2 0.4×2 0.2×2 15 14 1 1 0 Zone 2 6 0 0 1 1 S2(5/11) 1 0 Load N1,2(1,2,3,4,5,7,10) 1 0 N2(11) 1 0 Fig. 7 present results of sensitivity analysis of NRBBO with different parameters H and RE. These include best, worst 8 6 4 RE=2 RE=4 RE=6 RE=8 0.9 0.8 Mean Time(MW) Mean power(MW) 10 0.4 40 50 0.1 0.2 0.5 0.05 0.4 0 0.3 0 20 20 30 0.1 30 0.15 0.6 2 20 0.25 0.6 0.2 0.7 0.2 0 Comparison of Calculation Time Devitation Comparison of Calculation Time 1 RE=2 RE=4 RE=6 RE=8 12 BBO 40 0 20 30 40 50 Habitat Size Habitat Size (a) 30 PSO 50 Habitat Size GA NRBBO BBO 40 PSO 50 Habitat Size Algoritm (b) (a) Fig. 7: (a) Average restored load power and error. (b) average run time and error. and mean value. Different with most evolutionary algorithm, H and RE have a little effect on the performance of restored power in our algorithm. It is clear that the increasing the size of solution set will increase the exploration during simulation but at the cost of execution time. Moreover, increasing the number of iterations will not necessarily improve the performance as the objective value will converge after certain iterations. B. Comparison With Other Evolutionary Algorithms GA NRBBO Algoritm (b) Fig. 9: (a) Average calculation time comparison. (b) calculation time deviation comparison. The comparison of calculate time is shown in Fig. 9. We can know that the execution time of our algorithm is less than traditional BBO and PSO based algorithm, and it’s close to GA based algorithm. But our stability of execution time is better than the others. In summary, the algorithm that we proposed has good performance in restore power and execution time. At the same time, it performs better stability than the others in this problem. C. Comparison With Other Reconfiguration Methodologies Comparison of Restored Power Comparison of Restored Power Deviation 10 2.5 8 2 6 1.5 4 1 2 0.5 0 0 20 20 30 30 BBO 40 50 PSO 50 GA NRBBO Habitat Size BBO 40 PSO GA NRBBO Habitat Size Algoritm (a) Algoritm (b) Fig. 8: (a) Average restored power comparison. (b) average restored power deviation comparison. Since the goal of this study is to design an algorithm to realize fast reconfiguration in MVDC SPS, a comparison of the performance of NRBBO between the traditional BBO, PSO and GA based algorithms is given including restored power and execution time. The switches status within our proposed algorithm depends on stochastically generated variable. Therefore, to improve the reliability of the conclusions about performance, simulations for 50 consecutive runs were carried out for all the four algorithm. The habitat size (population size) and the maximum generation Ng were kept same for all the algorithms to make better comparison of the results. Fig. 8 show the comparison of the average restored power and its deviation among NRBBO, BBO, PSO and GA based algorithms with different repetition RE and habitat size H. The comparisons demonstrate that our algorithm can find a better solution, which can restored more loads than others. The deviation of solutions found with NRBBO is also lower than the others. Lower deviation value of restored power suggests our algorithm performs better stability. The execution time of an algorithm is determined by its computational complexity. In this subsection, the complexity of the methods provided to realize optimal reconfiguration of the MVDC SPS is analyzed. The former classic methods include branch-and-bound method (”LINGO” software), Interior-point method by combining Newton’s method [3], Reinforce learning [4]. The Interior-point method solves the reconfiguration problem by applying Newton’s method to a sequence of equality constrained problems. The worst-case complexity for interior-point based method is more than O(Ld2 ), where L is the number of loads, d is the number of constraints. Reinforcement learning based reconfiguration method uses greedy strategy to exploration. The learning process will increase the complexity. So the complexity is greater than O(2L ). TABLE VI: Comparison of Algorithm Complexity Algorithm LINGO Das, Sanjoy & Bose, Sayak [4] Bose, S & Pal, S [3] Complexity O(2L ) O(2L ) O(Ld2 ) NRBBO O(2( 3 ) ) L For NRBBO, the feasibility check of solutions to satisfy the constraints is the major contributor to computational complexity. The execution time is directly proportional to the number of the feasibility check, which is correlation to the habitat size. Due to the layered search and mode distinction methods used in our algorithm, the maximum search space of switch L variables is reduced to 2( 3 ) . The complexity comparison with the other methodologies in reconfiguration of MVDC SPS is shown in Table. VI. D. Relationship between Fault Position and Restored Power R EFERENCES In this subsection, an analysis of the relationship between the fault position, number and restored power is illustrated by cumulative distribution function (CDF). It is defined as f (Pd ) = P rob.{Pr ≤ Pd }, where Pd is the desired power. The CDF of the restored power to the loads is plotted for all the possible locations for two and three faults, which is shown in Fig. 10. [1] R. E. Hebner, F. M. Uriarte, A. Kwasinski, A. L. Gattozzi, H. B. Estes, A. Anwar, P. Cairoli, R. A. Dougal, F. Xianyong, C. Hung-Ming, et al., “Technical cross-fertilization between terrestrial microgrids and ship power systems,” Journal of Modern Power Systems and Clean Energy, pp. 1–19, 2015. [2] Y. Zhang and J. Jiang, “Bibliographical review on reconfigurable faulttolerant control systems,” Annual reviews in control, vol. 32, no. 2, pp. 229–252, 2008. [3] S. Bose, S. Pal, B. Natarajan, C. M. Scoglio, S. Das, and N. N. Schulz, “Analysis of optimal reconfiguration of shipboard power systems,” IEEE Transactions on Power Systems, vol. 27, no. 1, pp. 189–197, 2012. [4] S. Das, S. Bose, S. Pal, N. N. Schulz, C. M. Scoglio, and B. Natarajan, “Dynamic reconfiguration of shipboard power systems using reinforcement learning,” IEEE Transactions on Power Systems, vol. 28, no. 2, pp. 669–676, 2013. [5] V. Arcidiacono, A. Monti, and G. Sulligoi, “Generation control system for improving design and stability of medium-voltage DC power systems on ships,” IET Electrical Systems in Transportation, vol. 2, no. 3, pp. 158–167, 2012. [6] Y. Jiang, J. Jiang, and Y. Zhang, “A novel fuzzy multiobjective model using adaptive genetic algorithm based on cloud theory for service restoration of shipboard power systems,” IEEE Transactions on Power Systems, vol. 27, no. 2, pp. 612–620, 2012. [7] L. Qi, J. Pan, J. Daniel, O. Apeldoorn, J. Li, and Z. Wang, “Integrated converter modeling for medium voltage DC shipboard distribution system simulation,” in Proc. IEEE PES General Meeting— Conference & Exposition, pp. 1–5, IEEE, 2014. [8] T. Amba, K. L. Butler-Purry, and M. Falahi, “Genetic algorithm based damage control for shipboard power systems,” in Proc. Electric Ship Technologies Symposium (ESTS), pp. 242–252, IEEE, 2009. [9] N. Kumar, A. K. Srivastava, and N. N. Schulz, “Shipboard power system restoration using binary particle swarm optimization,” in Proc. 39th North American Power Symposium (NAPS), pp. 164–169, IEEE, 2007. [10] K. R. Padamati, N. N. Schulz, and A. K. Srivastava, “Application of Genetic Algorithm for Reconfiguration of Shipboard Power System,” in Proc. 39th North American Power Symposium (NAPS), pp. 159–163, IEEE, sep 2007. [11] IEEE Recommended Practice for Electrical Installations on Shipboard. IEEE Std. 45-2002 (Revision of IEEE Std. 45-1998), 2002. [12] J. Beerten, S. Cole, and R. Belmans, “Generalized steady-state VSC MTDC model for sequential AC/DC power flow algorithms,” IEEE Transactions on Power Systems, vol. 27, no. 2, pp. 821–829, 2012. [13] D. Simon, “Biogeography-based optimization,” IEEE Transactions on Evolutionary Computation, vol. 12, no. 6, pp. 702–713, 2008. [14] H. Ma, D. Simon, and M. Fei, “On the convergence of biogeographybased optimization for binary problems,” Mathematical Problems in Engineering, vol. 2014, 2014. [15] IEEE Recommended Practice for 1 kV to 35 kV Medium-Voltage DC Power Systems on Ships. IEEE Std. 1709, DC Power System on Ships Working Group of the IEEE Industry Applications Society Petroleum & Chemical Industry (IAS/PCI) Committee, Nov. 2010. Restored Power CDF 1 CDF with 2 Faults 0.9 CDF with 3 Faults 0.8 0.7 CDF 0.6 0.5 0.4 0.3 0.2 0.1 0 2 4 6 8 Desired Power (MW) 10 12 Fig. 10: Restore Power CDF. The restored power also can drop to less than 6 MW in the 2-fault and 3-fault scenarios, which can be observed from the CDF analysis of the system. In 2-fault scenarios, the vital loads can be always serviced. But in 3-fault scenarios, there are less than 10 % probability that the vital loads cannot be fully seriviced. The restored power is not only correlation with numbers of fault, but also related to the position. The line faults impact on the restored power are greater when they are closer to the MG. For example, if the faults happen in 1-2 and 7-8 buses, the MG just need to deliver power to one zone, and the power will drop greatly. Therefore, the transmission lines that close to MGs need to be more protected. V. C ONCLUSION In this paper, comprehensive multi-zone MVDC SPS is modeled. The multi-zone DC power flow calculation and converter power model for reconfiguration is given. Additionally an hybrid optimization method NRBBO is proposed to solve reconfiguration problem with multi-constraints when the power network has faults in SPS. The performance of our algorithm is better than traditional evolutionary based methods for this problem. The results clearly demonstrate the stability that the solutions found by this method have small deviation. Besides, our algorithm has relative low complexity than other reconfiguration methods used in MVDC SPS. The future works include the optimization of minimizing power loss for energy saving, while maximizing the weighted loads, and application of this method in other SPSs.
3cs.SY
Stochastic Systems arXiv: arXiv:0000.0000 CASCADE MARKOV DECISION PROCESSES: THEORY AND APPLICATIONS By Manish Gupta∗ , arXiv:1509.00392v1 [cs.SY] 1 Sep 2015 Harvard School of Engineering and Applied Sciences This paper considers the optimal control of time varying continuous time Markov chains whose transition rates are themselves Markov processes. In one set of problems the solution of an ordinary differential equation is shown to determine the optimal performance and feedback controls, while some other cases are shown to lead to singular optimal control problems which are more difficult to solve. Solution techniques are demonstrated using examples from finance to behavioral decision making. 1. Introduction. For over five decades the subject of control of Markov processes has enjoyed tremendous successes in areas as diverse as manufacturing, communications, machine learning, population biology, management sciences, clinical systems modelling and even human memory modeling [12]. In a Markov decision process (MDP) the transition rates depend upon controls, which can be chosen appropriately so as to achieve a particular optimization goal. The subject of this paper is to explore a class of MDPs where the transition rates are, in addition, dependent upon the state of another stochastic processes and are thus Markov processes themselves. Our purpose is to describe a broad range of optimal control problems in which these socalled cascade Markov decision processes (CMDP) admit explicit solutions [1], as well as problems in which dynamic programming is not applicable at all. Cascade processes are ideal in modeling games against nature. An epidemic control system where infection rates vary in accordance with uncontrollable factors such as the weather is one such case. They are also applicable in behavioral models of decision making where available choices at each step may be uncertain. For example, a behavioral decision-making problem called the ”Cat’s Dilemma” first appeared in [7] as an attempt to explain ”irrational” choice behavior in humans and animals where observed ∗ Ph.D Candidate in Applied Mathematics, Harvard School of Engineering and Applied Sciences. MSC 2010 subject classifications: Primary 60J20, ; secondary 90C40 Keywords and phrases: Markov Decision Processes, Continuous-time Markov Processes 1 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 2 M. GUPTA. preferences seemingly violate the fundamental assumption of transitivity of utility functions [6],[9]. In this problem, each day the cat needs to choose one among the many types of food presented to it so as to achieve a longterm balanced diet goal. However, the pet owner’s daily selection of food combinations presented to the cat is random. The cat’s feeding choice forms a controlled Markov chain, but the available foods themselves are contingent on the owner’s whim. Another example is found in dynamically-hedged portfolio optimization, where dynamic (stochastic) rebalancing of allocated weights can be modeled as a controlled Markov chain. However, what reallocations are possible may depend on the current prices of assets, which are themselves stochastic. Such MDP models have the advantage, for example, of being more realistic than their continuously-hedged counterpart, which have traditionally been studied using Gauss/Markov models on augmented state spaces [11], [8]. Other examples where CMDP are applicable include queuing systems where service times depend on the state of another queue and models of resource sharing where one process requires exclusivity and another doesn’t (e.g., determining the optimal sync rate for an operating system). While a cascade Markov process can be equivalently represented on the joint (coupled) state space as a non-cascade, the main purpose of this paper is to investigate solutions on decomposed state spaces. The main contributions in doing so include: • Decoupled matrix differential equations as solutions to a variety of fully observable cascade problems involving optimization of the expectation of a utility functional, which are computationally easier to implement than their non-decoupled counterpart, and require solving of a onepoint instead of a two-point boundary value problem. • Reduction of a partially observable cascade optimal control problem to a lower dimensional non-cascade problem (via a process we call diagonalization ) that facilitates the use of standard optimization techniques on a reduced state space, thereby circumventing the ”curse of dimensionality”. • Simpler analysis, via diagonalization, of a class of problems those that involve optimization of a non-linear function of expectation (such as a fairness or diversity index) and a full solution to a particular example of such singular optimal control problems. • A simple toy model for the dynamically-hedged portfolio optimization problem and solutions that can be easily generalized to computationally feasible algorithms for optimal allocation of large scale portfolios. imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 3 In addition to having the advantages of being able to efficiently represent large state space Markov processes by factorization to simpler lower dimensional problems and thus derive computationally simpler solutions, our approach of working decomposed representations is generalizable to multi-factor processes, stochastic automata networks [10], and even quantum Markov chains and controls [5],[3]. The particular framework of Markov decision processes closely follows the assumptions and modeling of [1], which are characterized by finite or denumerably many states with perfect state observations and affine dependence of transition rates on controls. The paper is organized as follows. A mathematical framework is first outlined, more details of which are in Appendix A. We then derive solutions to two classes of optimal control problems. In the first case the cost function is a the expectation of a functional, one that can be solved by dynamic programming requiring solution to a one point boundary value problem. The second class is the case where the cost function can not be written as an expectation, a rather non-standard stochastic control problem but one that arises in applications requiring diversification (entropy) maximization or variance minimization and requires solution to two-point boundary value problems. In many cases the latter is a singular optimal control problem. We will then discuss toy examples in each class of problems: a portfolio optimization problem and animal behavior (decisionmaking) problem. More examples of portfolio optimization and their cascade solutions appear in the Appendix. 2. Cascade Markov Decision Processes. 2.1. Markov Decision Process Model. We use the framework of [1] for continuous-time finite-state (FSCT) Markov processes. We assume a probability space (Ω, F, P) and right-continuous stochastic processes adapted to a filtration F = (Ft )t∈T on this space. An FSCT Markov process xt that is assumed to take values in {ei }ni=1 , the set of nstandard basis vectors in Rn , has the following sample path (Itô) description: descriptions: (2.1) dx = m X Gi xdNi i=1 (2.2) imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 4 M. GUPTA. where Gi ∈ Gn are distinct 1 , Gn being the space of square n−matrices of the form Fkl − Fll where Fij is the matrix of all zeros except for one in the i0 th row and j 0 th column, and Ni are Poisson counters with rates λi . The resulting infinitesimal generator that governs the transition probabilities of the process is P ∈ Pn , the space of all stochastic n−matrices and is given by: P = m X G i λi i=1 In a Markov decision process, the transition rates are allowed to depend on Ft −progressively measurable control processes u = (u1, u2 ...up ) in an affine accordance with2 : p X λi = λi0 + µij uj j=1 so that the infinitesimal generator can be written as:   p m X X P (u) = Gi λi0 + µij uj  i=1 j=1 2.2. Cascade MDP Model. We are interested in the case where transition rates of xt ∈ {ei }ni=1 are themselves stochastic: specifically, they depend on the state of another Markov process, say, zt ∈ {ei }ri=1 . We will call such a pair to form a Cascade Markov chain (CMC) In general, various levels of interactions between two processes xt and zt defines a joint Markov process yt = zt ⊗xt that evolves on the product space {ei }ni=1 ×{ei }ri=1 (see Appendix A) but we are specifically interested in CMCs where sample paths of zt and xt have the following have the following Ito description (Proposition A.7, Appendix A): (2.3) (2.4) dz = dx(z) = s X i=1 m X Hi zdMi Gi (z)xdNi (z) i=1 If the G0i s are not distinct, then one can combine the Poisson counters corresponding to identical G0i s to get a set of distinct G0i s. For example, G1 ydN1 + G1 ydN2 can be replaced by G1 ydN where dN = dN1 + dN2 , a Poisson counter with rate equal sum of the rates of the counters N1 , N2 2 that is, we assume an affine dependence on controls 1 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 5 CASCADE MDPS where Hi ∈ Gr , Gi (z) ∈ Gn and the rates of Poisson counters Mi and Ni are νi and λi with λi depending on the state of zt . Thus the infinitesimal generators P and C of xt and zt (P depends on zt and P (z) propagates the conditional probabilities of xt given z) are P (z) = (2.5) C = (2.6) m X i=1 s X Gi λi (z) Hi νi i=1 In a Cascade Markov decision process (CMDP), we assume the rates λi of counters Ni are allowed to additionally depend on Ft −progressively measurable control processes u = (u1, u2 ...up ) in accordance with 3 λi (z) = λ0i0 + λi0 (z) + p X µij (z)uj j=1 so that the conditional probability vector p(z, u) 4 of xt given z evolves as   p m X X ṗ(z, u) = Gi λ0i0 + λi0 (z) + µij (z)uj  p(z, u) i=1 j=1 which will be abbreviated as (2.7) P (z, u) = A0 + A(z) + p X uj Bj (z) j=1 (2.8) ṗ(z, u) = P (z, u)p(z, u) The CMDP model is completely specified by (A0 , A, Bj ). The Admissible Controls, defining U: The requirements on P (z, u) to be an infinitesimal generator for each z put constraints on the matrices A0 , A, Bj and impose admissibility constraints on the controls uj. We will require A0 and A to be infinitesimal generators themselves (for each t and z) and the Bj to be matrices whose columns sum to zero (for each t and z). We also allow the controls to be dependent on z and x which will define the set of admissible controls U as the set of measurable functions mapping 3 Each term is, in additional, a function of time t but for clarity explicit dependence on t will not be specified in notation. 4 same as above. imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 6 M. GUPTA. the space {ei }ri=1 × {ei }ni=1 to the space of controls Rp such that the matrix with j th column fj = A0 ej + A(ek )ej + p X ui (ek , ej )Bj (ek ) i=1 for j = 1..n, k = 1..r is an infinitesimal generator. Explicit dependence on t is omitted in notation above for clarity. 2.3. Examples of CMDP. Two toy examples of CMDP that will be later discussed are outlined below. Some background on the terminology used in description of portfolio optimization is in Appendix C.1. 2.3.1. Example 1: A Self-Financing Portfolio Model. In this toy example on portfolio optimization5 we will assume that there is one bond and one stock in the portfolio, with the bond price being fixed at 1 and the stock having two possible prices 1 and −1/3. Thus the price vector takes values in the set {(1, 1), (1, − 31 )}. Assume a portfolio that can shift weights between the two assets with allowable weights W of (0, 2), (−1, −1), (0, −2) so that the portfolio has a constant total position (of −2 3 ). Further, we allow only weight adjustments of +1 or −1 for each asset, and we further restrict the weight shifts to only those that do not cause a change in net value for any given asset price. The latter condition makes the portfolio self-financing. The resulting process can be modeled as a cascade MDP. Let zt be the (joint) prices of the two assets with prices (1, 1), (1, 31 ) represented as states e1 , e2 respectively. Let xt be the choice of weights with weights (0, 2), (−1, −1), (0, −2) represented as states e1 , e2 , e3 respectively. Transition rates of zt are determined by some pricing model, whereas the rates of xt which represent allowable weight shifts are controlled by the portfolio manager. The portfolio value v(zt , xt ) can be written using its matrix representation, v(z, x) = z T V x, where V is  2 − 23 V = −2 − 23  −2 32  (2.9) The portfolio manager is able to adjust the rate u of buying stock (which has the effect of simultaneously decreasing or increasing the weight of the bond). The resulting transitions of xt depend on zt (see Figure 1(a) ) and transition 5 See Appendix C, Section C.1 for some basic definitions on Portfolio Optimization imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 7 CASCADE MDPS matrices P (z) of the weights xt can be written as P (z) = A(z)+uB(z), where A(z) and B(z)are:     0 0 0 −1 1 0 A(e1 ) = 21 1 −1 1  A(e2 ) = 21  1 −1 0 0 0  0 1 −1  0 0 0 0 1 1 0 1 B(e1 ) = 0 1 B(e2 ) = −1 −1 0 0 −1 −1 0 0 0 For P (z) to be a proper transition matrix we require admissible controls u needs to satisfy |u| ≤ 12 . The portfolio manager may choose u in accordance with current values of xt and zt so that u is a Markovian feedback controls u(t, zt , xt ). Note that this model differs from the traditional Merton-like models where only feedback on the total value vt is allowed. Note that it is the self-financing constraint that leads to the dependence on the current price zt of the transitions of x, which allows us to model this problem as a cascade. 1 2 1 2 −u (-1,-1) (0,-2) 1 2 +u (a) z = e1 −u (0,2) (-1,-1) 1 2 +u (b) z = e2 Fig 1. Transition diagram of weight x(t) in the self-financing portfolio for various asset prices z(t) are shown in (a) and (b). States e1 ,e2 of z(t) correspond to price vectors (1,1),(1,-1/3) respectively. Self-transitions are omitted for clarity. 2.3.2. Example 2: The Cat’s Dilemma Model. As an example of a cascade MDP, we discuss the cat feeding problem introduced in Section 1. The feeding cat is represented by the process x(t) with four states e4 =Unfed, e1 =Ate Meat, e2 =Ate Fish, e3 =Ate Milk. We assume a constant feeding rate f , and a constant ”satisfaction” (digestion) rate s for each food, upon feeding which the cat always returns to the Unfed state. The Markov process z(t) ∈ {e1 , e2, e3 } represents availability of different combinations of food where e1 , e2 , e3 denote the combinations {Fish,Milk },{Meat,Milk } and {Meat,Fish} respectively. The food provider is unaffected by the cat’s eating rate, and so we can model the process as a cascade with the transition imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 8 M. GUPTA. Ate Milk Ate Fish ( 12 + u)f s Ate Meat ( 12 + u)f s Unfed Unfed ( 12 − u)f ( 12 − u)f s ( 21 + u)f s Unfed s ( 21 − u)f s Ate Milk Ate Meat Ate Fish (a) z = e1 (Fish/Milk) (b) z = e2 (Milk/Meat) (c) z = e3 (Meat/Fish) Fig 2. Transition diagram of cat feeding states x(t) in the Cat’s Dilemma for various food combinations z(t) are shown in (a), (b) and (c). Self-transitions are omitted for clarity. matrix P of x given by (see Figure 2.3.2), (2.10) P (z, u) = A0 + A(z) + B(z)u 1 where the control u(z, x) ∈ [ −1 2 , 2 ] represents the cat’s choice strategy (extreme values ± 12 denoting strongest affinity for a particular food in the combination z), and with A0 , A(z) and B(z) given by  −s  0 A0 =   0 s  0 0 A(e1 ) =  0 0 0 0 B(e1 ) =  0 0 0 −s 0 s 0 0 0 0 0 0 0 0  0 0 0 0  −s 0 s 0  0 0 f  0 2  f  0 2 0 −f  0 0 0 f   0 −f  0 0  0 0 A(e2 ) =  0 0 0 0 B(e2 ) =  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 f 2   0   f  0 0 A(e3 ) =  0 −f  −f 0   f  0 0 0 0 B(e3 ) =  0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 f 2 f 2    0  −f  f −f   0  0 3. Optimal Control Problem Type I : Expected Utility Maximization. As alluded to in the introduction, the first category of optimal control problems on cascade MDPs is one where performance measure is the expectation of a functional, and hence linear in the underlying probabilities. We will primarily discuss the fully observable (full feedback), finite timehorizon case and derive a general solution as a matrix differential equation. imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 9 CASCADE MDPS 3.1. Problem Definition. Fix a finite time horizon T on the cascade MDP (zt , xt ) defined in Section 2.2. and define the cost function η, Z (3.1) η(u) = E T (z T (σ)LT (σ)x(σ) + ψ(u(σ))dσ + z T (T )ΦT (T )x(T ) 0 where c, φ are real-valued functions on the space R+ ×{ei }ri=1 ×{ei }ni=1 , that are represented by the real matrices L(t) and Φ(t) as c(t, z, x) = z T L(t)x and φ(t, z, x) = z T Φ(t)x; and ψ a (Borel) measurable function Rp → R. If c is bounded the problem of finding the solution to η ∗ = min η(u) (3.2) u∈U is well-defined and will be subsequently referred to as Problem (OCP-I). The corresponding optimal control is given by u∗ = arg min η(u) (3.3) u∈U 3.2. Solution Using Dynamic Programming Principle. Theorem 3.1. Let (zt , xt ) be a cascade MDP as defined in Section 2.2 with C, A0 , A and Bi as defined thereof. Let T > 0, and U, ψ,Φand η be as defined in section 3.1. Then there exists a unique solution to the equation (on the space of n × r matrices) K̇ (3.4)= −KC − L − AT0 K T − A (z)K − min ( u(z,x)∈U p X ui z T K T Bi (z)x + ψ(u)) i=1 K(T(3.5) ) = Φ(T ) on the interval [0, T ], where AT (z)K denotes the matrix j 0 th column P whose T T T is A(ej )K ej (which can be more explicitly written as z A (z)Kzz T , that is, the matrix representation of the functional xT AT (z)Kz). Furthermore, if K(t) is the solution to 3.4 then the optimal control problem OCP-I defined in (3.2) has the solution (3.6) (3.7) η ∗ = Ez T (0)K T (0)x(0) p X u∗ = arg min ( z T K T ui Bi (z)x + ψ(ui )) u(z,x)∈U i=1 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 10 M. GUPTA. Proof. With z,x, η as defined above let the minimum return function be k(t, z, x) = z T K T (t)x,where K(t) is an n×r matrix, so that k(0, z(0), x(0) = η ∗ . Using Ito rule for z T K T x T T d(z K x) = s X z T HiT K T xdMi T T + z K̇ x + i=1 E( z T K T Gi xdNi i=1 Since the process dNi − (λ0i0 + λi0 (z) + equating the expectation to zero gives n X n X Pp j=1 µij (z)uj )dt is a martingale z T K T Gi xdNi ) = E(g(t, x, z, u)dt) i=1 E( s X z T HiT K T xdMi ) = E(z T C T K T x) i=1 P with g(t, x, z, u) = z T K T A0 x + z T K T A(z) + pi=1 z T K T ui Bi (z)x. Writing c(t, z, x) + ψ(u) = f (t, z, x, u) and z T C T K T x + g(t, x, z, u) = ξ(t, x, z, u), a simple application of the stochastic dynamic programming principle shows that z(t)T K̇(t)T x(t) + min(ξ(t, x, z, u) + f (t, z, x, u)) ≥ 0 u The minimum value of 0 is actually achieved by u∗ so that the inequality above must be an equality. Introducing notation AT (z)K, we get precisely (3.4). Proof of uniqueness is identical to that in [1] Theorem 1. Note that the Bellman equation (3.4) is very similar to that of a single (non cascade) MDP with the additional term −KC representing the backward (adjoint) equation for the process z(t) and the appearance of z in the term for minimization which permits feedback of the optimal control u∗ on z in addition to x. The matrix K above is also known as the Minimum Return Function. The above solution is a single point boundary value problem instead of two-point. For small KC, the above decouples one column at a time. This form is readily generalizable to multifactor MDPs as well. Corollary 3.2. ( Quadratic Cost of Control) Under the hypothesis of T T the above theorem, if ψ(ui ) = u2i then if ui (t, z, x) = −1 2 z (t)K (t)Bi (z)x(t) lies in the interior of U then it is the optimal control. Otherwise the optimal control is on the boundary of U. If the former is the case at every t ∈ [0, T ], imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 11 CASCADE MDPS then equation (3.4) defining the optimal solution becomes (where the notation M .2 for a matrix is element-wise squared matrix): p 1X T (Bi (z)K).2 4 K̇ = −KC − L − AT0 K − AT (z)K + i=1 Corollary 3.3. ( No Cost of Control) Under the hypothesis of the above theorem, if ψ(ui ) = 0 then the optimal control is at the boundary of U. If U is defined as the set { −ai ≤ |ui | ≤ ai } the optimal control is the bang-bang control ui (t, z, x) = −ai sgn(z T K T (t)Bi (z)x) and equation (3.4) defining the optimal solution becomes K̇ = −KC − L − AT0 K T − A (z)K + p X ai BiT (z)K ; i=1 3.3. Solution Using The Maximum Principle. The stochastic control problem OCP-I can be formulated as a deterministic optimization problem (and hence also an open-loop optimization problem) using probability densities permitting the application of variational techniques. While this gives us no particular advantage over the DPP approach in providing a solution to OCP-I , understanding this formulation is useful for a broader class of problems. First we note that for the cascade MDP of Section 2.2 the transition matrices P (z, u) in (2.7) can be written in open-loop form (3.8) P i = Ai + p X Bij Dij j=1 where Dij (u) is a diagonal matrix with diagonal [uj (ei , e1 )...uj (ei , en )]T , Ai = A0 + A(ei ), Bij = Bj (ei ) and Pi (u) = P (ej , u). Next, we can write evolution of the marginal probabilities ci (t) = Pr{z(t) = ei } and joint probabilities pij (t) = Pr{z(t) = ei , x(t) = ej } as the state equations (3.9) ċ = Cc ṗi = Pi pi + pi ċi /ci where pi (t) is the vector [pi1 (t) pi2 (t)...pin (t)]T , c(t) the vector [c1 (t)...cr (t)]T . Now we are ready to show the equivalence of the variational approach to the Bellman approach for the problem (OCP-I) imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 12 M. GUPTA. Theorem 3.4. Let z ∈ {ei }ri=1 , x ∈ {ei }ni=1 and C, A0 , A(z), Bi (z) be as defined in Section 2.2 and let the n−vectors pi (t) (for i = 1..r) and r−vector c(t) satisfy (3.9) with Pi as defined by (3.8) for Dij arbitrary time dependent diagonal p−matrices, considered as controls. Then the minimization of Z TX p r r X X (eTi LT pi + eT ψ(Dij )pi )dt + eTi ΦT pi (T ) 0 i=1 j=1 i=1 for n×r real matrices L and Φ and (Borel) measurable function ψ : Rp → R, subject to the constraints that Pi ∈ Pn results in a choice for the k th element of Dij which equals the optimal control u∗j (ei, ek ) of Theorem 3.1. Proof. Using (3.8) the Hamiltonian H and costate (q, s) for state equations (3.9) for the minimization problem of the theorem become, assuming normality and stationarity of z(t), are H = r X qiT Ai + i=1 (3.10) q̇i = −(Ai + p X qiT Bij Dij pi + eT ψ(Dij )pi + liT pi j=1 p X T Bij Dij ) qi − j=1 liT − p X ψ(Dij )e j=1 where li ≡ eTi LT , φi ≡ eTi ΦT and ψ(Dij ) ≡ ψ(uj (ei , x)). Introducing minimization of H with respect to Dij we see that it is achieved by minimizP P ing ri=1 pj=1 qiT Bij Dij pi + eT ψ(Dij )pi . Noting that ψ(Dij ) is also diagonal, observation shows that the above is precisely minimized when Pp simple T B T q + ψ(D )e) is minimized for each i (as p ≥ 0). The maxi(D ij ik ij ij i j=1 mum priniciple thus gives the following necessary condition for optimality: q̇i = −ATi qi − liT p X T T Dij Bij qi + ψ(Dij )e) − min( Dij j=1 We note that since stationarity of z(t) was assumed, the above equation exactly corresponds to each column of the Bellman matrix equation (3.4) for K, of Theorem 3.1. (Note that the result is valid for non-stationary z(t) as well and algebraic manipulation shows (ċi /ci ) terms to correspond to the −KC term in 3.4). Remark 3.5. Note that in the variational formulation, linearity of the Hamiltonian in the state variable p for the problem OCP-I resulted in complete decoupling of the state and costate equations qi and pi thereby permitting an explicit solution identical to that of 3.4. However, if we we restrict imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 13 the set of admissible controls in to allow feedback on the state x but not on the state z in problem OCP-I we get a non-trivial variant problem, a partial feedback problem, in which P case, P one can see that in the analysis in r Theorem 3.4 the minimization of i=1 pj=1 qiT Bij Dij pi + eT ψ(Dij )pi , in general, does not lead to a decoupling of the state and costate equations. 3.4. Example: A Self-Financing Portfolio. A toy model of portfolio optimization is discussed as an example or problem OCP-I. Appendix B has a short background on portfolio theory and also discusses a variety of OCP-I problems on different portfolio models. Consider the problem of maximizing the expected terminal value v(T ) of the portfolio for a fixed horizon T for the self-financing portfolio model of Section 2.3.1. With x, z, u, d, V, A, B, D as defined thereof, we wish to maximize the performance measure given by η(u, d) = E(v(T )) Using Theorem 3.1 we see the solution to this OCP-I problem is obtained by solving the matrix equation with boundary condition K(T ) = −V (3.11) K̇ = −KC − AT (z)K + 1 1 K T B(z) + K T D(z) 2 2 with the optimum performance measure and controls (in feedback form) given by η ∗ = z T (0)K T (0)x(0) 1 u∗ (t, z, x) = − sgn(z T K(t)T B(z)x) 2 1 d∗ (t, z, x) = − sgn(z T K(t)T D(z)x) 2 with K(t) being the solution to (3.11). Some solutions for (3.11) and corresponding optimal controls are plotted for T = 15 is shown in Figure 3 for various initial conditions (mixes of the assets in the portfolio initially). Results also show that as T → ∞,the value of η ∗ approaches a constant value of 1.24 regardless of the initial values z(0), x(0). That is the maximal possible terminal value for the portfolio is 1.24. However, we do not see a steady state constant value for the optimal controls u∗ (z, x) and d∗ (z, x) and that near the portfolio expiration date, more vigorous buying/selling activity is necessary. If the matrix C were reducible or time-varying in our example, multiple steady-states are possible as T → ∞ and the initial trading activity will be more significant. imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 14 M. GUPTA. Optimal Portfolio Values for Initial Portfolio Mixes (z(0),x(0)) 2 Optimal Portfolio Value 1.5 1 0.5 0 −0.5 (e1,e1) (e1,e2) (e1,e3) (e2,e1) (e2,e2) (e2,e3) −1 −1.5 −2 0 5 10 15 Portfolio Expiration Time, T Fig 3. Minimum Return Function k(t, z, x), for the self-financing portfolio with maximal terminal wealth, shown for various values of z, x specified as (ei , ej ) vectors. Two instances of simulation of application of the above optimal controls are shown in Figures 4 and 5. In the first case we see that one is able to benefit from x(0) being in state e2 which is the one that corresponds to maximal value of the portfolio, but in which state no trading can take place. We can hold that value and it more than offsets any devaluation due to stock price decline since the stock is more probable to have a higher price than lower. In the second simulation, we are unable to achieve state x = e2 , which happens because this state can be attained only in the less probable case of a lower stock price. However, the optimal strategy still trues to maximize the portfolio value by forcing state x = e3 when the price is lower, but since this state is less likely, we need only switch to this sell-out strategy for a small portion of the time. The final value is most sensitive to the final trading activity. The optimal strategy allows us to maximize the portfolio value in all cases, and on the average, gives us the best value. Our approach of using a cascade model is a more realistic model for portfolio as it is dynamic hedged. Traditional Gauss-Markov models assume continuous hedging which is unrealistic. Our model can be easily extended to include features such as transaction costs, etc. Furthermore, by modeling it as a cascade, we have a computationally scalable solution. The computation time as a function of the dimensionality of the weight szt for a decomposed imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 15 CASCADE MDPS Units of Stock, x 1 0 −1 Portfolio Value, v Buying Rate Adjustment, u* Stock Price, z Simulation of Optimal Strategy Execution for z(0)=e1, x(0)=e2 1 0 −1 0 2 4 6 8 10 2 0 −2 2 0 −2 0 time 2 4 6 8 10 time Fig 4. Simulation 1 of optimal control for self-financing portfolio in 3.4 . representation and fully coupled representation (using Bellman equations on the joint process directly) for various expiration times are shown in Figure 6. We see that the solution on a coupled state space grows exponentially with the dimensionality of zt whereas our solution scales linearly. 4. Optimal Control Problem Type II: Diversification Maximization. The second category of cascade MDP problems are those of optimization of functionals that are non-linear with respect to the probabilities pij , such as portfolio diversification or fairness of choices in decision making. As alluded to in the introduction, these problems are often singular in the sense that the dynamic programming or maximum principle fail to give a solution, and we will explore this through an example. In general, this class of problems falls in the category where the performance measure to be optimized is a non-linear function of expectation. That is, for a non-linear imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 16 M. GUPTA. Units of Stock, x 1 0 −1 Portfolio Value, v Buying Rate Adjustment, u* Stock Price, z Simulation of Optimal Strategy Execution for z(0)=e1, x(0)=e2 1 0 −1 0 2 4 6 8 2 0 −2 2 0 −2 10 0 2 time 4 6 8 10 time Fig 5. Simulation 2 of optimal control for self-financing portfolio in 3.4 . (a) T = 1 (b) T = 10 (c) T = 100 Fig 6. CPU time in seconds for asset/bond self-financing toy problem when the number of states of zt (possible price combinations) increases, for different expiration times T = 1, 10, 100. The decoupled solution scales with dimensionality whereas the coupled solution does not. f we want to minimize Z (4.1) η(u) = T f (E(l(t, zt , xt , u)))dt 0 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 17 CASCADE MDPS RT where l(.) is some loss function. For example, η(u) = 0 (f (x) − Ef (x))2 dt RT minimizes the variance of function f and η(u) = 0 (Ex1 − Ex2 )2 dt specifies adherence to a particular state. 4.1. Quadratic Problem with No Control Cost. We formulate a problem that is a particular case of (4.1). Given a cascade (zt , xt , U) with model (A, Bi ) we define Problem OCP-II as the optimal control problem Z 1 T T ∗ (4.2) η = min lim (pt Qpt + mT pt )dt u∈U T →∞ T 0 where Q ≥ 0, m is a vector and pt is the marginal probability vector of xt . We note that the stochastic dynamic programming principle is not directly applicable a problem of the form (4.1), and application of variational techniques at best gives us a two-point boundary value problem. Even if we did not have a cascade, the functional of the above form can result in singular arcs. To see this heuristically, consider the optimal control problem on a non-cascade defined as X (4.3) ṗ = (A + ui Bi )p i 1 η = lim T →∞ T T Z pT Qpdt 0 with U = {ai ≤ ui ≤ bi }. The costate and Hamiltonian equations for this problem are ! X T T q̇ = −2Qp − A q − ui Bi q i T H = q Ap + X T q ui Bi p + pT Qp i so that ∂H = q T Bi p ∂ui If q T Bi p = 0 for any finite time interval, then we have a singular arc so that the Hamiltonian provides no useful information. Characterizing solutions to such singular optimal control problems is notoriously hard. To see how we can get a singular arc in the case above, consider a simplification of (4.3) with A + uB of the form A + ufi eTj for u ∈ [a, b].For example, 0 B= 0 0 " 0 −1 1 # " #T 0 0 0 = −1 0 1 # " 0 1 0 = (−e2 + e3 )eT2 = f3 eT2 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 18 M. GUPTA. In steady state, one can show that p(u) = p(0) − (eTj p(0))u A+ fi 1 + u(eTj A+ fi ) where A+ is the Moore-Penrose inverse of A. If η(u) were of the form cT p (the ”usual” stochastic control case), then u∗ lies on the boundary of U. In the case η(u) is of the form pT Qp (i.e. the non-linear stochastic control case), then it is possible that u∗ is in the interior of U. For the class of constant controls, if u∗ ∈ Int(U) then one can show by computation that the corresponding (p(u), q(u) correspond to singular arcs. The above argument heuristically shows why the quadratic control problem OCP-II can be singular. For a non-cascade, however, the steady state optimal control problem reduces to a non-functional optimization problem, i.e. that of minimizing pT (u)Qp(u) + mT p(u). However, for a cascade, η depends on the marginal probabilities of xt but it is the conditional probabilities xt |zt that evolve in accordance with ṗ = Ap. In general, it is difficult to get an expression for p(u) of the steady state marginal probabilities of xt but we will below consider a special diagonalizable case where p(ui ) satisfy Ai p = 0 where p represents the marginal probability vector of xt . 4.2. ”Cat’s Dilemma” Revisited. In the model presented in Section 2.3.2, the combination of dishes available is random and the cat needs to optimize its selection strategy so as to get a balance of all three dishes. If we assume s = f = 1 we note that E(x4 ) → 12 as t → ∞ regardless of z or u. Hence, the best balance of foods is achieved when each of E(x1 ), E(x2 ), E(x3 ) are as close as possible to 61 . Hence the problem can be defined as one of minimizing the performance measure Z 1 T kE(Qx(t, z, u)) − mk2 dt (4.4) η(u) = lim T →∞ T 0 where kk is the Euclidean norm on R4 and Q, m defined as     1 0 0 0 1 0 1 0 0 1 1    (4.5) Q= 0 0 1 0 ; m = 6 1 0 0 0 0 0 4.3. A Binary Decision Problem. The cat’s dilemma can be generalized to a class of problems where one needs to make a choice given two possibilities at a time, so as to maximize the diversity of outcomes as a result of imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 19 one’s choices. If the total number of outcomes is N then binary possibilities are represented by the Markov process z(t) ∈ {ei }ri=1 , r = 12 N (N − 1), having generator C where, and the outcomes by the cascade Markov process x(t) ∈ {ei }ni=1 , n = N + 1, with transition matrix as in (2.10) with r and n dimensional analogs for A0 , A(z) and B(z). The admissibility set U of con1 trols u(t, z, x) is the set of functions u : R+ ×{ei }ri=1 ×{ei }ni=1 → [ −1 2 , 2 ] such that for each z and t the matrix P (t, z, u) is stochastic. (We can generalize to the situation where, for example, B(eij ) = (ei − ej )T en where eij is choice (i, j) etc.). This cascade model has simpler representations as follows. We will assume s = f = 1. Proposition 4.1. properties. The model described in Section 4.3 has the following 1. (Open loop w.r.t x ) For all t, z the dynamics of x(t) do not depend on the controls u(t, z, x) for all x 6= en 2. (Open loop representation w.r.t z ) There exist rank one matrices Aj , Bj of the form fj eTn and (open-loop) controls uj : R+ → [a, b] for j = 1..r such that the transition matrix (2.10) can be written as (4.6) P (t, ej , u) = A0 + Aj + Bj uj (t), for j = 1..r 3. (Triangular Representation) The marginal probabilities cj (t) = Pr{z(t) = ej } and pk (t) = Pr{x(t) = ek } satisfy the triangular equations (4.7) ċ(t) = Cc(t) ṗ(t) = (A0 + r X cj (Aj + Bj uj (t)))p j=1 where p(t) = [p1 (t) ...pn (t) ]T and c(t) = [c1 (t) ...cr (t) ]T Proof. Since B(ej ) is of rank one and of the form fj eTn where fj is a column vector, the dynamics of x(t) depend only the value of control in state x = en and z. Thus w.lo.g write u(t, z, x) as u(t, z) instead. Open loop representation (4.6) w.r.t z is made possible by using the parametrization uj (t) ≡ u(t, ej ) with Bj = B(ej ) and Aj = A(ej ). The triangular representation follows from Corollary B.2 (Appendix B) since (Aj + uj Bj )ek = 0 for j = 1..r , k = 1..(n − 1) and that the form of A0 in (2.10) above above implies that Pr(x = en ) is independent of Pr(z = ej ) for j = 1..r. The performance measure to maximize diversification of outcomes is (4.4) which can be written using notation introduced in Proposition 4.1 (with p(t) imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 20 M. GUPTA. explicitly written as p(t, u) instead), Z 1 T (4.8) η(u) = lim (Qp(t, u) − m)T (Qp(t, u) − m)dt T →∞ T 0 Two classes of optimal control problems are discussed. 4.4. Problem 1 : The Steady State Case. We assume z(t) to be stationary6 . Using the Given a fixed value T0 admissibility set UT0 is restricted to the set of functions uj (t), j = 1..r that are constant for t ≥ T0 , as per representation defined in (4.6). With η(u) is in (4.8), the optimization problem is η ∗ = min η(u), u∗ = arg min η(u) (4.9) u∈UT0 u∈UT0 We will call this problem OCP-IIS Theorem 4.2. The solution to the optimization problem OCP-IIS is given by the solution to the quadratic programming problem 1 1 1 η ∗ = min uT Hu + f T u + k , subject to − e ≤ Iu ≤ e u 2 2 2 where u ∈ R3 , H = 12 AT A, f = AT b, k = bT b with matrix A and vector b depending on (c1 , c2 ...cr ) only, and if u0 is the minimizing value for the above, then any function u(t) such that u(t) = u0 for t ≥ T0 is an optimal control u∗ . Proof. The infinitesimal generator X(u) for x(t) defined in (4.7) is irreducible. Writing the unique time invariant solution to as p(u) a routine calculation shows that p(u) = (eeT + X T (u)X(u))−1 e (4.10) For u ∈ UT0 we can write η(u) = Z T0 1 ( (Qp(t, u) − m)T (Qp(t, u) − m))dt T →∞ T 0 Z 1 T + lim (Qp(u) − m)T (Qp(u) − m))dt T →∞ T T0 lim = (Qp(u) − m)T (Qp(u) − m) 6 If the generator C of z(t) is irreducible then eventually z(t) will attain a time invariant distribution and hence the solution is no different. imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 21 Since the first integrand (Qp(t, u) − m)T (Qp(t, u) − m)) is bounded and the second integrand (Qp(u) − m)T (Qp(u) − m)) is independent of t. Using (4.10) write (Qp(u) − m)T (Qp(u) − m) = peT pe where pe = 12 Au + B and A, b are per the statement. Expanding peT pe we get the quadratic programming equation. Claim 4.3. The quadratic programming equation (Theorem 4.2) has a solution η ∗ = 0 if and only if the corresponding minimizing value u0 lies in the interior of the hypercube [− 21 , 12 ]r Remark 4.4. Theorem 4.2 can also be proved using explicit computation for the Cat’s Dilemma, with X(u) and p(u) given by    −1 0 0 c3 u3 + 12  − c2 u2 − 12   0 −1 0 c1 u1 + 1 − c3 u3 − 1  2 2  X(u) =  0 0 −1 c2 u2 + 12 − c1 u1 − 12  1 1 1 −1     c u + 1 − c2 u2 − 12  1  3 3 21  c1 u1 + 2  − c3 u3 − 12  p(u) = 2 c2 u2 + 12 − c1 u1 − 12 and A, b thus being computed as     1 1 0 −c2 c3 − 6 + 4 (c3 + c2 ) 0 −c3  , b = − 61 + 14 (c1 + c3 ) A =  c1 − 61 + 14 (c2 + c1 ) −c1 c2 0 Remark 4.5. We can solve the quadratic programming explicitly. The solutions u0 ∈ C where C is the closed cube [− 12 , 12 ]3 . For the general case of dimensions r and n the results are similar. Case 1: When 0 < cj ≤ 23 , j = 1..3.In this case,η ∗ = 0 and  optimal solutions u0 are given by the lines u1 = 2c11 c2 + 2c3 u3 + 23 , u2 =  1 2 2 2c2 −c1 + 2c3 u3 + 3 in the interior of C. Case 2: When cj ≤ 3 for all j, ∗ and cj = 0 for some j, j = 1..3.In this case η = 0 and the solutions are given by, for example, in the case { c1 = 0, c3 ≤ 23 and c2 ≤ 32 } the set of lines u3 = − 3c13 + 12 , u2 = 3c12 − 12 in the interior of C but parallel to the faces. Case 3: When 23 < cj ≤ 1 for some j. Since H is singular, several local minima may exist. However, the isolines of global minima are attained along constant values of ci in the case of 32 < ci ≤ 1 and the minimal values increase from 0 for ci = 23 to 0.0408 for ci = 1. For example, if c2 > 0 then imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 22 M. GUPTA. at most two global minima are attained at u = (0, − 12 , 12 ) or u = (0, 21 , 21 ) i.e. on the edges of C. If c2 = 0 then the global minimum is attained on the line u1 = 0, u3 = 12 4.5. Problem 2: The Time Varying Case. Again, we assume z(t) to be stationary. With the admissibility set U is set of functions uj (t), j = 1..r such that uj (t) ∈ [− 21 , 12 ]. As per representation defined in (4.6) and with η(u) is in (4.8) the problem is (4.11) η ∗ = min η(u), u∈U u∗ = arg min η(u) u∈U which we call OCP-IIT. In the cases where the steady state optimal control lies in the interior of U, these controls are also optimal within the class of time-varying controls. Proposition 4.6. In the cases described in example of Section 4.4 where the solution u0 to the quadratic programming equation (Theorem 4.2) lies in the interior of the hypercube [− 21 , 12 ]r the solution defined in Proposition 4.2 to OCP-IIS for any T0 is also a solution to OCP-IIT. Proof. In the cases of the example of Section 4.4 where the optimal controls are in the interior, optimal performance measure is η ∗ = 0. Since the performance measure η defined in (4.4) always satisfies η ≥ 0, thus in these cases a constant control is also optimal within the class of time-varying controls. And this holds for constant controls in the class UT0 for any finite T0 (and thus by no means unique). 4.6. Singularity Of Optimal Controls. The problems in Section 4.3 belong to the category of singular control, and an analysis of singularity of optimal solutions presents a slightly more general approach to finding the solution to the time-varying problem (4.11) than the approach above. For this problem, using the representation of Proposition 4.1, the Hamiltonian, state and costate equations can be written as (4.12) H = (Qp − m)T (Qp − m) + q T (A0 + r X cj Aj + j=1 (4.13) ṗ = (A0 + r X r X cj uj Bj )p j=1 cj (Aj + Bj uj (t)))p j=1 (4.14) q̇ = −2(Qp − m) − (AT + r X j=1 r X cj ATj )q − ( cj uj BjT )q j=1 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 23 However, we see from (4.12) that the costate and state equations are no longer decoupled, and thus trajectories (q, p) that minimize the Hamiltonian can not simply be obtained by solving an equivalent minimization of the individual costate/state equations. In fact, as shown below, we have the case of singular arcs, that is, trajectories (solutions) where q T Bi p = 0. Such trajectories fail to give a minimization condition for H with respect to ui .In such cases, the Maximum Principle at best remains a necessary condition failing to provide the optimal solution. Controls ui such that the corresponding solutions (p, q) to the state/costate equations form singular arcs will be called singular controls. Proposition 4.7. For t > T0 , the solutions u∗ to the optimal control problem OCP-IIS that lie in the interior of U are singular. Proof. As T → ∞, u∗ is a constant control and so p reaches an invariant distribution. Since the optimal trajectory must satisfy the state/costate equation, we seeP that q̇ must be zero as well. Thus, from (4.12) we get by putting X(u) = rj=1 (A0 + cj Aj + cj uj Bj ) −2(Qp − m) − X T (u)q = 0 Expanding the above for the first (n−1) rows of X T (u)q we get the equations 1 qn − qi = −2(pi − 2N ) for i = 1..n − 1. These give us the equations qi − qj = 2(pi − pj ) for i, j = 1..n − 1. The singularity conditions q T Bi p = 0 expand to, by putting in the steady value of p(u), to qi − qj = 0 for i, j = 1..n − 1. 1 Since pi = pj = 2N when u∗ is in the interior of U we see that the optimal solutions are singular. Thus, in the steady state case, optimal trajectories are singular. We now show that this is also the case for the time-varying case. Proposition 4.8. For the problem OCP-IIT, the value of the Hamiltonian on singular arcs is zero. Proof. The state/costate/Hamiltonian are given by (4.12). Without loss of generality, let p(0) = en . The state equations can be solved explicitly for pn using ṗn = 1 − 2pn to yield pn (t) = 12 (1 + e−2t ). Singular arcs satisfy q T Bj p = 0 which expands to pn (qi − qj ) = 0 for i, j = 1..(n − 1) i.e. qi = qj for i, j = 1..n − 1. From qi (∞) = 0 we get P q̇i = q̇j or pi = pj for i, j = 1..n − 1 using the costate equation. Using ni=1 pi = 1 we get the solution 1 (1 − e−2t ) for i = 1..(n − 1). Now plugging these into the costate pi (t) = 2N imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 24 M. GUPTA. equations we can explicitly solve for qi , i = 1..n for terminal condition qi (∞) = 0. Omitting details, plugging the solutions into the Hamiltonian, it can be readily seen that H = 0. Corollary 4.9. The solutions u∗ to the optimal control problem (4.11), such that limt→∞ u∗ (t) lies in the interior of U, are singular. Proof. In steady state, we see that the optimal trajectories (for which u is in the interior of U) yields H = 0 since (Cp − m)T (Cp − m) = 0 and X(u)p = 0. From the Maximum Principle, this must be the minimizing value of H and since there is no explicit dependence of H on t this must be the value of H on optimal trajectories at all times. Hence, singular trajectories that satisfy the state/costate equations also minimize the Hamiltonian and so the entire optimal trajectory is singular. Now we show that singular solutions are also optimal for the case when optimal controls are in the interior of U. Proposition 4.10. For the problem OCP-IIT the value of η as defined in (4.8) on singular arcs is zero. ∂H Proof. As in the proof of proposition 4.8, on singular arcs, ∂u = q T Bj p = j 0 for j = 1..r give the conditions qi = qj for i, j = 1...(n − 1). Evaluating d ∂H dt ( ∂uj ) for j = 1..r and setting this to zero (details omitted) yields further 2 d ∂H the conditions pi = pj for i, j = 1...(n − 1). Next, evaluating dt 2 ( ∂u ) for j j = 1..r and setting this to zero yields the same equations as in Case 1 and Case 2 of (a generalized version of) the example presented in Section 4.4 .That is, the equations corresponding to (Qp(u) − m)T (Qp(u) − m) = 0 where p(u) is given by (4.10). That is, η = 0. Note that due to the singular nature of the problem, the above analysis does not give us any information about the optimal control u∗ . However, we saw from the steady state analysis that a u such that is a constant value satisfying the quadratic programming problem (QPP) (Proposition 4.2) after some finite time is an optimal solution. So if we initially start on a singular trajectory then we remain on it. Otherwise since u is bounded, we can’t jump immediately to the singular trajectories and so it will be a bang/bang like control till we transition to an optimal trajectory (though not necessarily constant) control - however, eventually this will become constant. Thus any control that becomes the constant value that is the solution to the QPP in finite time, and one that eventually steers the system onto a singular trajectory is an optimal control. imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 25 5. Conclusion. A framework for studying the class of problems where the dynamics of a controllable continuous-time finite-state Markov chain are dependent on an external stochastic process was introduced in this paper and two categories of optimal control problems were discussed. In the ”type I” or ”expected utility maximization” problems, techniques based upon dynamic programming were used to provide solutions for a general class of problems in the form of a matrix differential equation. This result, proved in Theorem 3.1 using the stochastic dynamic programming, was alternately derived as using the maximum principle, and in the process we were able to see a more general applicability of the variational approach. These solutions were applied to a variety of toy examples in the area of dynamic portfolio optimization. Our factored solutions reduce storage requirements as well as computational complexity significantly. For example, in our representation, a coupled problem with r = 10, n = 1000 that would normally require storing a 1000 × 1000 matrix needs at most ten 100 × 100 matrices, thereby providing a reduction by a factor of 10. This approach is also generalizable to multi-factor processes, with many interacting Markov chains and with even synchronizing transitions. Another category of problems, called ”type II” or ”diversification maximization” problems with performance functionals that are non-linear in underlying state probabilities was discussed in the context of a cat feeding example. It was shown that this problem is singular in the sense that the maximum principle fails to provide an optimal solution, and alternative techniques were explored in the solution of this problem. Ongoing and future work in this area is focused on general techniques for such singular problems, and extending the class of problems to more complex ones such as multi-cascades (a set of multiple inter-dependent Markov chains), hybrid cascades (for instance, a discrete-state Markov chain with dependencies on continuous-state Gauss-Markov processes) and even decision processes in the context of quantum Markov chains or quantum controls. Computational considerations for large scale versions of the toy portfolio examples presented in this paper will also be investigated. In this paper only the singular control problem defined in Section 4.3 was analyzed. The general problem of minimizing a performance measure of the form Z T 1 1 η= ( pT Qp + cT p)dt + pT (T )Sf p(T ) + φTf p 2 2 0 on a cascade MDP where Q, Sf ≥ 0 needs to be investigated. For the timeinvariant case, following the analysis in where it was shown that if a miniimsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 26 M. GUPTA. mizer of cT p is in the interior of the admissibility set U then it must define a singular arc, we would like to derive a similar result for the above case. We would further like to derive, for the time-invariant case, sufficient conditions for singular arcs to be optimal (i.e. analog of Proposition 4.10). Future work in this class of singular problems also involves other techniques such as variable transformations, as in [2], the method of singular perturbations (as in [4]), and numerical methods such as Chebyshev-point collocation techniques. APPENDIX A: MARKOV PROCESSES ON PRODUCT STATE SPACES We explore representations of a Markov Process yt that evolves on the product state space {ei }ri=1 × {ei }ni=1 . The sample path y(t) can be written as the tuple (z(t), x(t)) where z(t) ∈ {ei }ri=1 and x(t) ∈ {ei }ni=1 . The corresponding stochastic processes zt and xt are the components of yt . The transition matrix for xt may depend on z(t) and hence describes the propagation of the conditional probability distribution px|z : The dynamics of component marginal probabilities are not necessarily governed by a single stochastic matrix. Different degrees of coupling between xt and yt leads to a possible categorization of the joint Markov Process yt . Definition A.1. A Markov process yt on the state space {ei }ri=1 × {ei }ni=1 is called tightly coupled or non-decomposable if there exist states (ei , ej ) and (ek , el ) with i 6= k and j 6= l having non-zero transition probability. If all non-zero transition probabilities are between states of the form (ei , ej ) to (ei , ek ), or (ei , ej ) to (el , ej ) then yt is called weakly-coupled or decomposable. Definition A.2. A decomposable chain on {ei }ri=1 × {ei }ni=1 where the transition probability from state (ei , ej ) to (el , ej ) does not depend on j, for all i, l, j where 1 ≤ i, l ≤ r and 1 ≤ j ≤ n, is called a Cascade Markov process7 . Definition A.3. A cascade Markov process on {ei }ri=1 × {ei }ni=1 where the transition probability from state (ei , ej ) to (ei , ek ) does not depend on i, for alli, j, k where 1 ≤ i ≤ r and 1 ≤ j, k ≤ n, is called an Uncoupled Markov Process. 7 In this paper we mainly focus on Cascade Markov processes, and they are closely related to Markov-modulated Poisson processes (MMPPs) which have vast applications in traffic control, operations research and electronics and communications. imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 27 Thus, in a decomposable chain, the jumps in the two component processes are uncorrelated. However, the rates of the counters (and hence transition probabilities) in a component can depend on the state of the another component. In a cascade chain, the rates of the first component (zt ) do not depend on the second component xt . In an uncoupled chain, the component processes zt and xt are completely independent. Decomposable Markov chains have functional transition rates, that is, the transition rates are state dependent but do not have any synchronous transitions. Non-decomposable Markov chains exhibit synchronous transitions: that is, transitions amongst states of xt and zt can occur simultaneously. A.1. Sample Path and Transition Probability Representations. It will be convenient to represent sample paths y(t) using the Kronecker tensor product y(t) = z(t) ⊗ x(t) instead of the tuple (z(t), x(t)). The state set y(t) then becomes standard basis for Rr×n . Following the model in (2.1) sample paths y(t) have the Ito representation (A.1) dy = q X Gi ydNi i=1 where Gi ∈ Grn are distinct. Correspondingly, the infinitesimal generator Pq b P ∈ Prn can be written as P = i=1 Gi λi where λi is the rate of counter Ni .The following results relate decomposability of sample path and transition probability representations to the various levels of couplings defined above. Proposition A.4. Let the Markov process yt be defined on the state space {ei }rn i=1 with the Ito representation (A.1). Then for each (distinct) Gi , i = 1..q (see notation defined in Appendix D), 1. yt is a decomposable Markov process if and only if Gi can be written as either Gi = Eir ⊗ Gni or Gi = Gri ⊗ Ein . 2. If Gi can be written as Gi = Eir ⊗ Gni or Gi = Gri ⊗ In then yt is a cascade Markov process. 3. If Gi can be written as Gi = Ir ⊗ Gni or Gi = Gri ⊗ In then yt is an uncoupled Markov process Pq1 r n Proof. 1. To prove sufficiency, write (A.1) as dy = i=1 (Ei ⊗Gi )(z⊗ Pq x)dNi + j=q1 +1 (Grj ⊗ Ejn )(z ⊗ x)dNj . Since (Eir ⊗ Gni )(z ⊗ x) = Eir z ⊗ Gni x is a rank one tensor, zxT is a rank one matrix with exactly one non-zero row. Thus jumps in Ni change x but not z. Conversely, imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 28 M. GUPTA. jumps in Ni that change both x and z must have d(zxT ) of rank > 1, i.e. Gi 6= Eir z ⊗ Gni x for any Eir and Gni . 2. In the decomposable change, transitions that change z but not x correspond to terms such as (Grj ⊗ In )(z ⊗ x)dNj = (Grj z ⊗ In )dNj . Thus the transition Grj is driven by Nj only, regardless of x. Since Grj are distinct for distinct j, each transition in z is independent of the value of x. 3. Follows by repeating the argument of (2) for the terms (Ir ⊗ Gni )(z ⊗ x)dNi Proposition A.5. Let the Markov process yt be defined on the joint state space {ei }rn i=1 with infinitesimal generator P. Then, as per notation defined in Appendix D, P1 1. If yt is decomposable, then P can be written in the form P = pi=1 Eir ⊗ P P 2 1 Bin + pi=1 Bir ⊗Ein where Bin , Bir are matrices such that pi=1 Bin ∈ Pbn Pp2 and i=1 Bir ∈ Pbr . 2. P If yt is a cascade Markov process then P can be written as P = p Eir ⊗ Bin + C ⊗ In where C ∈ Pbr , where Bin are matrices such i=1P 1 that pi=1 Bin ∈ Pbn 3. If yt is an uncoupled Markov process then P can be written as (A.2) P = Ir ⊗ A + C ⊗ In where A ∈ Pbn and C ∈ Pbr . Proof. 1. For a decomposable chain from Proposition A.4 we can Pp1 r n write (with q1 = p1 and p1 + p2 = q) P = i=1 (Ei ⊗ P PGmi λid) + q r n i=1 Gi λi j=p1 +1 (Gj λj ⊗Ej ) . The result follows from the fact that b ∈ Pd for any integers m and d, and by shifting the summation index in the second sum. P 2. Follows from Proposition A.4(2) by setting C = qj=p1 +1 Grj λj noting that C ∈ Pbr 3. Follows from Proposition A.4(1) as above. The transition matrix representation (A.2) above is not unique to an uncoupled Markov process. In fact, any Markov process yt on joint state space {ei }rn i=1 whose transition matrix P can be written in the form (A.2) is said to be diagonalizable. We will shortly see some sufficient conditions imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 29 for diagonalizability in the context of MDPs. An important property of diagonalizable Markov processes is that the marginal probabilities of the component processes evolve in accordance with stochastic matrices given by the diagonal decomposition, and in fact this condition is also sufficient to guarantee diagonalizability: Proposition A.6. Given a diagonalizable Markov process yt = zt ⊗ xt whose transition matrix has the diagonal representation (A.2), the marginal probability distributions pz and px of the component processes zt and xt evolve in accordance with ṗz (t) = Cpz (t) and ṗx (t) = Apx (t) respectively. Conversely, given a decomposable Markov process yt = zt ⊗ xt such that the marginal probability distributions pz and px of zt and xt evolve on {ei }ri=1 and {ei }ni=1 in accordance with ṗz (t) = Cpz (t) and ṗx (t) = Apx (t) respectively, where A ∈ Pbn and C ∈ Pbr , then yt is diagonalizable with the representation given by (A.2). From Propositions A.5 and A.4 we get the following: Proposition A.7. Let yt = zt ⊗ xt be a Markov process in r × n states where zt ∈ {ei }ri=1 and xt ∈ {ei }ni=1 . Then sample paths of yt can be written as dyt = (zt ⊗ dxt ) + (dzt ⊗ xt ) + (dzt ⊗ dxt ) If yt is decomposable, then the sample paths can be decomposed into m X zt ⊗ dxt = zt ⊗ Gj (z)xt dNj (zt ) j=1 dzt ⊗ xt = s X Hi (z)zt dMi (zt ) ⊗ xt i=1 dzt ⊗ dxt = 0 where Gj (z) ∈ Gn , Hi ∈ Gr for each z, x and Nj , Mi are doubly stochastic (Markov modulated) Poisson counters. Furthermore, if yt is a Cascade MC then we get the following decoupled Ito representation s X dz = Hi zdMi i=1 dx = m X Gi (z)xdNi (z) i=1 Remark A.8. If yt is non-decomposable, the term dzt ⊗ dxt is non-zero, so we can not write sample paths in decoupled form. imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 30 M. GUPTA. APPENDIX B: DIAGONALIZABLE MARKOV DECISION PROCESSES B.0.1. Properties of Diagonalizable MDPs. If the MDP is diagonalizable, then some simplifications of the solutions presented above are possible. Once again consider optimal control problem (3.2) except that now the cascade is diagonalizable. Using notation of Section 3.3, the joint probabilities pi satisfy (assume stationarity of z(t)) ṗi = (Ai + p X Bij Dij )pi j=1 From Proposition A.6 and the fact that the marginal probability vector Pr of x(t) is i=1 pi we must have, for some stochastic matrix A, (B.1) p r r X X X (Ai + Bij Dij )pi = A pi i=1 j=1 i=1 Thus we have the following useful lemma: Lemma B.1. Let z ∈ {ei }ri=1 , x ∈ {ei }ni=1 and A(t, z), Bj (t, z), uj (t, z, x), j = 1..p, and a cascade MDP on z ⊗ x be as defined in Section 2.2. As before, use shorthand Ai ≡ A(t, ei ), Bij ≡ Bj (t, ei ), and uj (t, ei , x) as the diagonal matrix Dij .Then the resulting Markov process is diagonalizable if and only if there exists a stochastic matrix A(t) such that the joint probabilities written as vectors {pi (t) = [pi1 , pi2 ...pin ]T , i = 1..r} where pik (t) = Pr{z(t) = ei , x(t) = ek } at each t satisfy the equation (B.1), assuming that z(t) is stationary8 Corollary B.2. (Sufficient Conditions for diagonalizable MDP).The cascade MDP defined in the hypothesis of Lemma B.1 is diagonalizable if any of following hold: 1. A(t, z), Bj (t, z) and uj (t, z, x) are independent of z, j = 1, 2..p. That is, U is restricted to the set of measurable functions on the space R+ ×{ei }ni=1 only (i.e. no feedback allowed on state P z ) 2. For each x ∈ {ek }nk=1 and t, the sum A(t, z) + pj=1 uj (t, z, x)Bj (t, z) is independent of z for all admissible controls uP j. 3. For each i, k such that the k 0 th row of Ai + pj=1 Bij Dij does not vanish for all t and admissible controls Dij , the marginal probabilities X pZ i (t) ≡ Pr{z(t) = ei } and pk (t) ≡ Pr{x(t) = ek } are uncorrelated, Z X i.e. pik (t) = pi (t)pk (t) 8 Similar equation can be derived for non-stationary z(t) but not needed in this paper imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 31 CASCADE MDPS Proof. The first and second conditions are trivial. For the third, note X 0 that if pik (t) = pZ i (t)pk (t) then we can write the m th row of the left hand side of (B.1) as in fully expanded form, using notation (M )ij for the (i, j)th entry of matrix M p n X r X X (Ai + Bij Dij )mk pik = = k=1 i=1 j=1 p n X r X X X (Ai + Bij Dij )mk pZ i pk k=1 i=1 j=1 p n X r X X Z ( pi (Ai j=1 k=1 i=1 + Bij Dij ))mk r X plk l=1 Pp P Setting A = ri=1 pZ i j=1 (Ai + Bij Dij )which is readily verified to be a stochastic matrix, the result follows from Lemma B.1. B.0.2. Some Problems on Diagonalizable MDPs. Note that from (B.1) above, a diagonalizable MDP can be rewritten as a partial feedback problem, by possibly introducing matrices A0 (t), Bi (t) and controls uj (t, x) such that P A(t) = A0 (t) + pj=1 uj (t, x)Bi (t). Thus all optimal control problems on diagonalizable MDPs are in the category of partial feedback problems. Consider, once again the optimal control problem (3.2) except that now the MDP is diagonalizable. Simplified solutions are available in the following two cases. Theorem B.3. Let z ∈ {ei }ri=1 , x ∈ {ei }ni=1 and A0 , A,Bi ,T , U, ψ,Φ,L, η,be as defined for the cascade MDP on z ⊗ x of Theorem 3.1. In addition, let A,Bi and U satisfy the hypothesis of Corollary B.2.1. Then if the cost functional L or terminal condition Φ do not depend on z, the to the optimal control problem defined in (3.2) has the solution η ∗ = Ek T (0)x(0) p X ∗ u = arg min ( ui k T Bi x + ψ(u)) u(x)∈U i=1 where k satisfies the vector differential equation p X k̇ = −AT k − LT e1 − min ( ui k T Bi x + ψ(u)) u(x)∈U i=1 k(T ) = ΦT e1 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 32 M. GUPTA. Proof. In this case since we have no dependence of A1, Bj or uj on z and neither that of L or Φ the Bellman equation (3.4) reduces to the single state Bellman equation (See Theorem 1 in [2]) defined on the state space of x(t). Hence we can use a much simplified version of the Bellman equation to find the optimal control. Note, however, this does not necessarily imply complete independence, in the sense that the marginal probabilities may still be correlated. Remark B.4. Note that in view of the introductory remark in Section B.0.2 the condition requiring satisfaction of hypothesis of Corollary B.2.1 is not necessary for a diagonalizable MDP. Theorem B.5. Let z ∈ {ei }ri=1 , x ∈ {ei }ni=1 and A0 , A,Bi ,T ,ψ,Φ,L, η,be as defined for the cascade MDP on z ⊗x of Theorem 3.1. Let U be restricted to the set of measurable functions on the space R+ ×{ei }ni=1 (i.e. no feedback allowed on state z ), and further let the MDP satisfy the hypothesis of Corollary B.2.3. Using notation ci (t) = Pr{z(t) = ei }, Ai (t) = A(t, ei ), Bij (t) = Bj (t, ei ) the optimal control problem defined in (3.2) has the solution η ∗ = cT (0)Ek T (0)x(0) p r X X u∗ = arg min ( ui k T ( ci Bij )x + ψ(u)) u(x)∈U i=1 i=1 where k satisfies the vector differential equation r X k̇ = −AT0 k − ( ci ATi )k − LT c i=1 p X r X i=1 i=1 ui k T ( − min ( u(x)∈U ci Bij )x + ψ(u)) k(T ) = ΦT c Proof. In this case, if we examine theP Hamiltonian Pp Pnin (3.10) weT note r that in the term to be minimized becomes i=1 j=1 k=1 pik (ujk qi Bij ), (assuming no control cost) But since pik = pk ci where pk and ci are the marginal probabilities of x(t) = ek and z(t) = ei respectively, this otherwise non trivial minimization becomes trivial since we can now interchange Pr the summation order to write this sum as by writing B = . j i=1 ci Bij Pn Pp Pr T since pk ≥ 0 we achieve minimizak=1 pk j=1 ujk ( i=1 ci (qi Bj )) and Pr tion by choosing ujk to minimize ( i=1 ci (qiT Bj )). This then becomes the condition for the minimum in the costate equation as well, and hence we imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 33 have removed dependency of the costate equation on the state p and so we can solve the costate equation (i.e. this becomes the single state Bellman equation). APPENDIX C: PORTFOLIO OPTIMIZATION C.1. Background: Portfolio Value, Wealth and Investment. A portfolio consists of a finite set of assets (such as stocks or bonds), with the weight process xt denoting the vector of amounts (also called allocations or weights) of the assets. The price process zt denotes the vector of market prices of the assets We define the portfolio value v(t, z, x) as the net value of the current asset holdings for weights x and prices z. If x(t) and z(t) take values in finite sets of standard basis vectors, then v can be represented by the matrix V (t) as v(t, z, x) = z T V (t)x. Using the Ito rule, we can write dv = dz T V T x + z T V T dx In a non self-financing model, depending on the current value of the portfolio, a weight shift will require buying/selling assets using an investment (or consumption, which is the negative of the investment). If s(t) represents the net investment into the portfolio up to time t, the incremental investment is the change in the portfolio value due to weight shift. Hence, (C.1) ds = z T V T dx Similarly, the wealth of the portfolio (i.e. its intrinsic worth) at time t is defined as w(t) = v(t) − s(t). So that the wealth represents the net effect of changes in asset prices, and we can write (C.2) dw = dz T V T x C.2. Self-Financing Portfolio Problem. We assume there are two stocks S1 and S2 whose prices each evolve independently on a state space of {−1, 1}. Assume a portfolio that can shift weights between the two assets with allowable weights W of (2, 0), (1, 1), (0, 2) so that the portfolio has a constant total position (of 2). Further, we allow only weight adjustments of +1 or −1 for each asset, and we further restrict the weight shifts to only those that do not cause a change in net value for any given asset price. The latter condition makes the portfolio self-financing. The resulting process can be modeled as a cascade MDP. Let zt be the (joint) prices of the two assets with prices (−1, −1), (−1, 1), (1, −1), (1, 1) imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 34 M. GUPTA. represented as states e1 , e2 , e3 , e4 respectively. Let xt be the choice of weights with weights (0, 2), (1, 1), (2, 0) represented as states e1 , e2 , e3 respectively. Transition rates of zt are determined by some pricing model, whereas the rates of xt which represent allowable weight shifts are controlled by the portfolio manager. The portfolio value v(zt , xt ) can be written using its matrix representation, v(z, x) = z T V x, where V is (C.3) V = −2 −2 −2 2 2 0 0 −2 −2  2 2 2 The portfolio manager is able to adjust the rate of increasing the first weight by an amount u and, independently that of decreasing the first weight by an amount d (which has the effect of simultaneously decreasing or increasing the weight of the second asset). The resulting transitions of xt depend on zt (see Figure C.2 ) and transition matrices P (z) of the weights xt can be written as P (z) = A(z) + uB(z) + dD(z), where A(z), B(z), D(z) are:   −1 1 0   1 −2 1 A(e1 ) = 1 2 1 −1   0 −1 0 0 −1 0 B(e1 ) =  1 0 1 0  0 1 0 −1 1  D(e1 ) = 0 0 0 −1  −1 1  1 −1 A(e2 ) = 1 2 0  0 −1 0 0 B(e2 ) =  1 0  0 0 1  −1 D(e2 ) = 0 0 0  0 0 0  0 0 0 0 0 0  0 0 A(e3 ) = 1 2 0 0 B(e3 ) = 0 0 0 D(e3 ) = 0 0  0 0 −1 1  1 −1  0 0 −1 0 1 0 0 0 0 1  0 −1   −1 1 0   1 −2 1 A(e4 ) = 1 2 1 −1  0 0 0 0 −1 0 B(e4 ) = 0 0 1 0   0 1 0 −1 1  D(e4 ) = 0 0 0 −1 For P (z) to be a proper transition matrix we require admissible controls u, d to satisfy |u| , |d| ≤ 21 . The portfolio manager may choose u, d in accordance with current values of xt and zt so that u, d are Markovian feedback controls u(t, zt , xt ) and d(t, zt , xt ). Note that this model differs from the traditional Merton-like models where only feedback on the total value vt is allowed. Note that it is the self-financing constraint that leads to the dependence on the current price zt of the transitions of x which allows us to model this problem as a cascade. Consider the problem of maximizing the expected terminal value v(T ) of the portfolio for a fixed horizon T for the above self-financing portfolio model 2.3.1. With x, z, u, d, V, A, B, D as defined thereof, we wish to maximize the performance measure given by η(u, d) = E(v(T )) Using Theorem 3.1 we see the solution to this OCP-I problem is obtained by solving the matrix equation with boundary condition K(T ) = −V (C.4) K̇ = −KC − AT (z)K + 1 1 K T B(z) + K T D(z) 2 2 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 35 CASCADE MDPS 1 2 1 2 +d (0, 2) (1, 1) 1 2 +u 1 2 +d (2, 0) 1 2 (0, 2) (1, 1) 1 2 +u (a) z = e1 or z = e4 +d +u (b) z = e2 1 2 +d (1, 1) (2, 0) 1 2 +u (c) z = e3 Fig 7. Transition diagram of weight x(t) in the self-financing portfolio for various asset prices z(t) are shown in (a), (b) and (c). States e1 ,e2 ,e3 ,e4 of z(t) correspond to price vectors (-1,-1),(-1,1),(1,-1),(1,1) respectively. Self-transitions are omitted for clarity. with the optimum performance measure and controls (in feedback form) given by η ∗ = z T (0)K T (0)x(0) 1 u∗ (t, z, x) = − sgn(z T K(t)T B(z)x) 2 1 ∗ d (t, z, x) = − sgn(z T K(t)T D(z)x) 2 with K(t) being the solution to (C.4). Some solutions for (C.4) and corresponding optimal controls are plotted for T = 1, 15 in Figure 8 for various initial conditions (mixes of the assets in the portfolio initially). Results also show that as T → ∞,the value of η ∗ approaches a constant value of 0.4725 regardless of the initial values z(0), x(0). That is the maximal possible terminal value for the portfolio is 0.4725. However, we do not see a steady state constant value for the optimal controls u∗ (z, x) and d∗ (z, x) and that near the portfolio expiration date, more vigorous buying/selling activity is necessary. If the matrix C were reducible or time-varying in our example, multiple steady-states are possible as T → ∞ and the initial trading activity will be more significant. C.3. An Investment-Consumption Portfolio Problem. An alternate model for portfolio allocation than discussed in the self-financing Portfolio example (Section ) is presented as a OCP-I problem in this section. imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 36 Optimal Portfolio Value, K(t) T=1 2 1 0 −1 −2 0 0.2 0.4 0.6 0.8 1 T=15 1 0 −1 −2 0 5 10 0.6 0.4 0.4 0.2 0.2 0.2 0.2 0 d*(t) 0.6 0.4 u*(t) 0.6 0.4 0 0 −0.2 −0.2 −0.2 −0.4 −0.4 −0.4 −0.4 −0.6 0 0.5 time, t 1 −0.6 0 0.5 time, t 1 15 0 −0.2 −0.6 (e1,e1) (e1,e2) (e1,e3) (e2,e1) (e2,e2) (e2,e3) (e3,e1) (e3,e2) (e3,e3) (e4,e1) (e4,e2) (e4,e3) 2 0.6 d*(t) u*(t) Optimal Portfolio Value, K(t) M. GUPTA. −0.6 0 10 time, t 20 0 10 20 time, t Fig 8. Solution to problem C.2. Minimum Return Function k(t, z, x), optimal up controls u∗ (t, z, x) and down controls d∗ (t, z, x) for the self-financing portfolio with maximal terminal wealth. Figures(a) and (b) are for T = 1 and T = 15 respectively. Various (z, x) values are represented by the vectors (ei , ej ). If we do not restrict the weight adjustments in the model of Section 2.3.1 to cases which keep the value a constant, (i.e. we allow only weight adjustments of +1 or −1 for each asset, regardless of the current portfolio value) we get a non self-financing portfolio. The difference in the portfolio value as a result of weight shift must be the result of an equivalent investment or consumption. Once again, modeling this is as a cascade with zt and xt as in Section 2.3.1, the portfolio value matrix (C.3) is replaced by   −2 2 −2 2 (C.5) V = −2 0 0 2 −2 2 2 2 As before, the portfolio manager can control the up and down rates u, d resulting in the transitions of xt (See Figure) described by the matrices imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 37 CASCADE MDPS 1 2 1 2 +d (0, 2) +d (1, 1) 1 2 (2, 0) 1 2 +u +u Fig 9. Transition diagram of weights x(t) for controls u,d in the investment/consumption portfolio. Self-transitions are omitted for clarity. P (z) = A(z) + uB(z) + dD(z) with  1 1  −2 2 0 A(z) =  12 −1 12  1 − 12 2 0 −1 0 0 B(z) =  1 −1 0 0 1 0   0 1 0 D(z) = 0 −1 1  0 0 −1 and admissibility condition |u| , |d| ≤ 12 . Note in this cascade model the matrices A, B, D do not depend on z but we will see next that the performance measure does depend on z. C.3.1. Problem 1: Minimal Investment. We wish to minimize the total amount of investment up to a fixed horizon T. We can write a performance measure η(u, d) that represents the net investment into the portfolio up to time T as η(u, d) = E(s(T )) where s(t) is the investment process (See Appendix C.1). Using (C.1) E(ds(t)) = E(z T V T dx) = E(z T V T (A + uB + dD)x)dt Writing the matrix Φ(u, d) = V T (A + uB + dD) Z η(u, d) = E T z T (t)Φ(u, d)x(t)dt 0 The goal then is to choose u, d so as to minimize η(u, d) subject to u, d ∈ U where the admissibility set U is the set of past measurable functions u(z, x) such that |u(z, x)| ≤ 12 for each z, x. Using Theorem 3.1 we see the solution imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 38 M. GUPTA. to this OCP-I problem is obtained by solving the matrix equation with boundary condition K(T ) = 0 (C.6) K̇ = −KC − AT (K + V ) + 1 T 1 B (K + V ) + DT (K + V ) 2 2 (where the notation |M | for a matrix M above represents the element-byelement absolute value of a matrix) with the optimal performance measure and controls (in feedback form) given by η ∗ = z T (0)K(0)x(0) 1 u∗ (t, z, x) = − sgn(z T (K(t) + V )T Bx) 2 1 d∗ (t, z, x) = − sgn(z T (K(t) + V )T Dx) 2 where K(t) is the solution to (C.6). Some solutions to (C.6) and corresponding optimal controls are plotted for T = 1, 10 in Figure 10(a) and 10(b). Results also show that as T → ∞,the value of η ∗ /T approaches a constant value of −0.535 regardless of the initial values z(0), x(0) and in this case we see that the optimal controls u∗ (z, x) and d∗ (z, x) expressed in matrix form (u∗ (z, x) written as z T u∗ x etc.)  1    1 1 1 0 0 0 0 2 2 −2 2 u∗ = − 21 12 − 12 12  ; d∗ = − 12 − 12 12 − 21  1 − 12 12 − 21 0 0 0 0 2 (the values of u∗ (z, e3 ) and d∗ (z, e1 ) are immaterial as they do not impact the dynamics). This means that one can expect a constant cash flow of 0.535 by the above strategy, and that this value is maximal. Note also that the optimal controls do depend on z and so the resulting weight and asset probabilities are not independent. C.3.2. Problem 2 : Maximal Terminal Wealth. In this case the performance measure that needs to be maximized is given by Z T η(u, d) = E(w(T )) = E z T (t)C T V T x(t)dt 0 where w(t) is the wealth process (Appendix C.1) for u, d ∈ U as above. Again, from Theorem 3.1 the solution to this OCP-I problem is obtained by solving the matrix equation with boundary condition K(T ) = 0 (C.7) K̇ = −(K − V )C − AT K + 1 T 1 B K + DT K 2 2 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 39 Optimal Portfolio Value, K(t) T=1 0.2 0 −0.2 −0.4 −0.6 −0.8 −1 −1.2 0 0.2 0.4 0.6 0.8 1 T=10 2 0 −2 −4 −6 −8 0 2 4 6 0.6 0.6 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0 0 d*(t) 0.6 u*(t) 0.6 d*(t) u*(t) Optimal Portfolio Value, K(t) CASCADE MDPS 0 −0.2 −0.2 −0.2 −0.4 −0.4 −0.4 −0.4 −0.6 0 0.5 time, t 1 −0.6 0 0.5 time, t 1 10 0 −0.2 −0.6 8 (e1,e1) (e1,e2) (e1,e3) (e2,e1) (e2,e2) (e2,e3) (e3,e1) (e3,e2) (e3,e3) (e4,e1) (e4,e2) (e4,e3) −0.6 0 5 10 0 time, t 5 10 time, t Fig 10. Solution to problem C.3.1. Minimum Return Function k(t, z, x), optimal up controls u∗ (t, z, x) and down controls d∗ (t, z, x) for the self-financing portfolio with maximal terminal wealth. Figures(a) and (b) are for T = 1 and T = 10 respectively. Various (z, x) values are represented by the vectors (ei , ej ). whose solution K(t) gives the optimal performance measure and controls as: η ∗ = z T (0)K(0)x(0) 1 u∗ (t, z, x) = − sgn(z T K T (t)Bx) 2 1 d∗ (t, z, x) = − sgn(z T K T (t)Dx) 2 Some numerical results for the above problem with V as in (C.5) are plotted for T = 1, 10 in Figure 11 (a) and 11 (b). Results also show that as T → ∞,the value of η ∗ /T approaches a constant value of −0.533 regardless of the initial values z(0), x(0) and in this case we see that the optimal controls u∗ (z, x) and d∗ (z, x) expressed in matrix form (u∗ (z, x) written as z T u∗ x imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 40 M. GUPTA. etc.) are  1 2 − 12 − 12 0 1 2   0 − 12  ; d∗ = − 12 1 0 0 2 Optimal Portfolio Value, K(t) T=1 1 0 −1 −2 −3 −4 0 0.2 0.4 0.6 0.8 1 0 1 2 − 12 0 − 12 − 12 −2 −4 −6 −8 −10 0 2 4 6 0.4 0.4 0.2 0.2 0.2 0.2 d*(t) 0.4 u*(t) 0.4 0 −0.2 −0.2 −0.2 −0.4 −0.4 −0.4 −0.4 −0.6 −0.6 −0.6 −0.6 0.5 1 0 0.5 time, t 1 0 5 time, t 10 8 10 0 −0.2 time, t  0 0.6 0 1 2 T=10 0.6 0  2 0.6 0 0 − 21 0.6 d*(t) u*(t) Optimal Portfolio Value, K(t) u∗ = − 12 0 1 2 1 2 0 5 10 time, t Fig 11. Solution to problem C.3.2. Minimum Return Function k(t, z, x), optimal up controls u∗ (t, z, x) and down controls d∗ (t, z, x) for the self-financing portfolio with maximal terminal wealth. Figures(a) and (b) are for T = 1 and T = 10 respectively. Various (z, x) values are represented by the vectors (ei , ej ). C.3.3. Problem 3 - Minimal Investment with Partial Feedback. In the investment/consumption model, the control matrices A, B, D do not depend on z. As a result one may be tempted to think that a partial feedback optimization problem, i.e. where the controls are allowed to depend on x but not z would give the same optimal performance. However, one sees from Theorem 3.1 the solution to the minimal investment case is obtained by imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 41 solving the matrix equation subject to K(T ) = 0 (C.8) ṗz = Cpz ; pz (0) = Ez(0) K̇ = −KC − AT (K + V ) + + 1 T B (K + V )(er pTz ) 2 1 T D (K + V )(er pTz ) 2 where pz is the probability vector for z. And the optimal performance and controls are given by η ∗ = pTz (0)K T (0)x(0) 1 u∗ (t, x) = − sgn((er pTz (t))(K(t) + V )T Bx) 2 1 ∗ d (t, x) = − ((er pTz (t))(K(t) + V )T Dx) 2 where K(t), pz (t) are solutions to C.8. The best performance in this case is worse than that in the full feedback case, as indeed shown by numerical simulation as in 12(a),(b) for T = 1, 10. Comparing with the respective minimum return functions of the full feedback case, the steady state case maximal cash flow rate is only 0.22 compared to 0.533. C.4. Some Variations on Portfolio Problems. Some variants of the examples presented here and in Section 3.4 include the following: C.4.1. Utility Functions.and Discounting. In traditional portfolio optimization problems, one minimizes E(U (s(T )))o maximizes E(U (w(T ))) where U (.) is a non-decreasing and concave function, called the utility function. In the above examples, for simplicity of demonstration of the MDP techniques, we assumed U (C) = C. Utility functions are chosen based upon risk preferences of agents and the financial environment, and some standard ones γ include the U (C) = Cγ (with γ < 1) or U (C) = log C. Furthermore, one RT may wish to optimize the discounted value i.e E 0 e−αt U (w(t))dt for some α > 0 instead. The solutions to optimization problems of minimum investment and maximum wealth in these cases are identical to (C.6) and (C.7) with V replaced by e−αt U (V ). C.4.2. Value Payoff Functions. The particular model we chose led to a value payoff V as in (C.5) though the problems presented above are completely generic with respect to V in that any other value of V would work as well. In that case we will have different mappings of the states e1 , e2 , e3 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 M. GUPTA. Optimal Portfolio Value, K(t) T=1 0.4 0.2 0 −0.2 −0.4 −0.6 0 0.2 0.4 0.6 0.8 1 T=10 0.6 0.4 0.2 0 −0.2 −0.4 −0.6 −0.8 0 2 4 6 0.6 0.6 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0 0 d*(t) 0.6 u*(t) 0.6 d*(t) u*(t) Optimal Portfolio Value, K(t) 42 0 −0.2 −0.2 −0.2 −0.4 −0.4 −0.4 −0.4 −0.6 0 0.5 1 −0.6 0 0.5 time, t time, t 1 10 0 −0.2 −0.6 8 (e1,e1) (e1,e2) (e1,e3) (e2,e1) (e2,e2) (e2,e3) (e3,e1) (e3,e2) (e3,e3) (e4,e1) (e4,e2) (e4,e3) −0.6 0 5 time, t 10 0 5 10 time, t Fig 12. Solution to problem C.3.3. Minimum Return Function k(t, z, x), optimal up controls u∗ (t, z, x) and down controls d∗ (t, z, x) for the self-financing portfolio with maximal terminal wealth. Figures(a) and (b) are for T = 1 and T = 10 respectively. Various (z, x) values are represented by the vectors (ei , ej ). of x to the weights and that of e1 , e2 , e3 , e4 of z to asset prices, but it is only the value matrix V that appears in any of the solutions and these mappings are immaterial. C.4.3. Transaction Costs. If buying/selling of assets incurs a transaction cost then every weight shift is associated with a cost. This can be modeled in terms of the control costs. We can see that a value of u = − 21 represents the case of a minimal rate of buying the first asset, while u = 12 represents a maximal rate of buying the first asset. Likewise, the values d = − 21 to d = 12 represent the range of the rates of selling the first asset. Hence a reasonable metric for the transaction costs would be (u + 21 )2 + (d + 12 )2 . For example, a performance measure like (α > 0) Z η(u, d) = E 0 T 1 1 α((u + )2 + (d + )2 )dt + E(U (s(T ))) 2 2 imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 CASCADE MDPS 43 APPENDIX D: SUMMARY OF NOTATIONS AND SYMBOLS A stochastic basis (Ω, F, F, P) is assumed where (Ω, F, P) is a probability space and F a filtration (Ft )t∈T on this space for a totally ordered index set T (⊆ R+ in our case). All stochastic processes are assumed to be right continuous and adapted to F. F A filtration (Ft )t∈T on (Ω, F, P) where T is a totally ordered index set Gn The space of square matrices of dimension n of the form Fkl − Fll where Fij is the matrix of all zeros except for one in the i0 th row and j 0 th column n E The space of diagonal n × n matrices with only 1’s or 0’s In n × n identity matrix, In ∈ En Pn The space of all stochastic matrices of dimension n {ei }ni=1 The set of n standard basis vectors in Rn φ(t) A real-valued function φ on R+ × {ei }ni=1 will be written as the vector φ(t) ∈ Rn as φ(t, x) = φT (t)x where x ∈ {ei }ni=1 Φ(t) A real-valued function φ on R+ × {ei }ri=1 ×{ei }ni=1 is written as the r × n real matrix Φ(t) as φ(t, z, x) = z T Φ(t)x where z ∈ {ei }ri=1 and x ∈ {ei }ni=1 T A (z)K Denotes the matrix whose j 0 th column is A(ej )K T eTj which can be more exP plicitly written as z AT (z)Kzz T |M | For a matrix M represents the elementby-element absolute value of a matrix M .2 For a matrix M represents the elementby-element squared er The r−vector [1 1...1]T ACKNOWLEDGEMENTS Special thanks to Dr. Roger Brockett of Harvard School of Engineering and Applied Sciences who provided inspiration for the problems discussed in this paper, and to Dr. Andrew JK Phillips at Harvard Medical School for valuable feedback. imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018 44 M. GUPTA. REFERENCES [1] Brockett, R. (2008). Optimal control of observable continuous time markov chains. In Decision and Control, 2008. CDC 2008. 47th IEEE Conference on. 4269–4274. [2] Geerts, T. (1989). All optimal controls for the singular linear-quadratic problem without stability; a new interpretation of the optimal cost. Linear Algebra and its Applications 116, 135 – 181. [3] Gough, J., Belavkin, V. P., and Smolyanov, O. G. (2005). Hamiltonjacobibellman equations for quantum optimal feedback control. Journal of Optics B: Quantum and Semiclassical Optics 7, 10, S237. [4] Grasman, J. (1980). On a class of nearly singular optimal control problems. Stichting Mathematisch Centrum. Toegepaste Wiskunde TW 196/80 (Jan.), 1–12. http://www.narcis.nl/publication/RecordID/oai%3Acwi.nl%3A7657. [5] Gudder, S. (2008). Quantum Markov chains. JOURNAL OF MATHEMATICAL PHYSICS 49, 7 (JUL). [6] Kalenscher, T., Tobler, P. N., Huijbers, W., Daselaar, S. M., and Pennartz, C. (2010). Neural signatures of intransitive preferences. Frontiers in Human Neuroscience 4, 49. [7] Makowski, M. and Piotrowski, E. W. (2005). Quantum Cat’s Dilemma. eprint arXiv:quant-ph/0510110 . [8] Noh, E.-J. and Kim, J.-H. (2011). An optimal portfolio model with stochastic volatility and stochastic interest rate. Journal of Mathematical Analysis and Applications 375, 2, 510 – 522. [9] Piotrowski, E. and Makowski, M. (2005). Cat’s dilemma - Transitivity vs. intransitivity. FLUCTUATION AND NOISE LETTERS 5, 1 (MAR), L85–L95. [10] Plateau, B. and Stewart, W. J. (1997). Stochastic automata networks. In Computational Probability. Kluwer Academic Press, 113–152. [11] Zhou, E., Lin, K., Fu, M., and Marcus, S. (2009). A numerical method for financial decision problems under stochastic volatility. In Winter Simulation Conference (WSC), Proceedings of the 2009. 1299 –1310. [12] Zilli, E. A. and Hasselmo, M. E. (2008). Analyses of markov decision process structure regarding the possible strategic use of interacting memory systems. Frontiers in Computational Neuroscience 2, 6. 31 Oxford Street, Cambridge MA 02138, E-mail: [email protected] imsart-ssy ver. 2014/10/16 file: Cascade_MDP_Arxiv.tex date: March 19, 2018
3cs.SY
Model Based Design Environment for Launcher Upper Stage GNC Development Hans Strauch(1), Klaus Luig(1), Samir Bennani(2) (1) Airbus DS GmbH Airbus Allee , 28361 Bremen Germany Email:[email protected]. [email protected] (2) ESA/ESTEC Keplerlaan 1, 2201 AZ Noordwijk The Netherlands Email:[email protected] INTRODUCTION The cost associated with developing flight control forms a significant part of the overall development cost. The increased demand for greater functionality and for extending the domain of applicability of future launchers leads to higher complexity of the GNC algorithms. Furthermore, there is also a need for a responsive design methodology, which can quickly adapt to changes in the requirements during the development process. These demands are stretching the current, largely manual, development process, which is fragmented in the different disciplines and activities concerning modelling, algorithm design, software coding, implementation on the avionics platform and the associated testing at the different stages. The model-based-design (MBD) philosophy presents an attractive solution in addressing the multi-disciplinary nature of the flight algorithm design task. In terms of design process, this materializes in a tight coupling between the modelling, the design and the analysis activities. An integrated design framework for the GNC development for future launcher upper stages has been realized with the 'Upper Stage Attitude Development Framework' (USACDF) research effort. USACDF has been initiated by the ESA Launcher Directorate within its Future Launcher Preparatory Program (FLPP). FLPP aims at preparing the Next Generation Launcher (NGL) by supporting activities, which increase the maturity level of launcher technologies and acquire new ones. It specifically implements a system-driven approach. The framework seamlessly covers, in a dynamic fashion, the entire design process from requirement capturing activities until verification and validation of the auto-coded GNC and the related mission and vehicle management (MVM) application software, which runs on flight representative processors and hardware (LEON II used for demonstration). The basis of the design suite relies on the commercially available MathWorks' tool-chain accompanied by the dSPACE system (see [1], [2]). However, it is not limited to the algorithm design, but also heavily using those elements, supporting model based design, automatic report generation, requirement tracing between software and specifications and automated verification, including real-time processor performance profiling. Mathworks' GNC and SW tool-chain has been augmented to physical modelling approaches, namely Modelica and EcosimPro (beside Mathworks' own SimMechanics). The particular strength of the physical modelling is the injection of failure cases directly at the physical level. This allows for designing and testing advanced failure recovery elements of the flight software. The algorithms, developed in the USACDF framework, can be run in a TASTE/RASTA/LEON environment (see [3]) via autocoding. The plant dynamics is realized on a dSPACE system connecting to RASTA via Ethernet communication. The transfer from a PC based functional engineering simulator (FES) to a LEON/dSPACE closed loop configuration can be achieved quickly and nearly automatically. The paper is organized as follows: The next section will place the USACDF approach into an overall context by discussing contributions found in the literature. Next, the limitations and constrains of the current way to develop flight control for space application are discussed. The following sections will then highlight the USACDF design suite features and explain how they answer to the needs and how they extent the domain of applicability. The last section discusses the benchmark problem, which was used to test the framework and to carry out algorithm design for some particular uppers attitude control problems. RELATED WORK The need to enable effective collaboration of people across multiple disciplines and organize them during the integration and testing phase has been identified early on. Ref [4] discusses this topic and highlights the need for increased parallelization especially for the testing phase. Ref [5] drives the approach for this phase even further by discussing automated test generation combining UML and the MathWorks toolchain. Ref [6] concentrates on the model-based design strategies for real-time hardware-in-the-loop simulations for flight code validation. While above papers deal with the way of how to efficiently organize different disciplines and groups of engineers and how to improve the process of interaction, [1] discusses the improvement potential by using graphical tools for function specification. This paper shows that MathWorks was an early pioneer in promoting the model-based paradigm and transformed its toolchain accordingly. Ref [7] and [8] show that the concept has been actually adopted in the recent development of the Orion GNC development and already presents "lessons learned". After the wide adoption of the MBD principle, activities are under way to standardize the ideas and fit them into the known standards like DO-178 (see e.g. [9]). While MBD is a general approach, space approved flight software has its town particularities, which is discussed in [10]. The references above have been mainly concerned with the processes and the tools. However, MBD can also influence and improve the GNC algorithms themselves. Ref. [11] shows how autonomy (termed "self-management") and online reconfiguration capable system can be better developed within the MBD concept. The study presented in this paper also went into that direction by illustrating the improvement potential of MBD applied to a particular difficult flight phase of an upper stage ("long coasting phase"). The next section gives a detailed description of the needs and how they are answered by the MBD principle. CURRENT GAPS, LIMITANTIONS AND NEEDS As already indicated in the discussion of the related literature, it is a common perception that the current way of development is not sufficiently adapted to the challenge. In the following we will provide an overview of the shortcomings of the current way of working and highlight the needs. Fig 1 illustrates the current situation and contrasts it with the model-based design (MBD) approach. The involved disciplines, like structure, propulsion, software, etc., are usually working within separated analysis environments and with a wide collection of tools, with only limited interfacing options ("throw-it-over-the-wall process" [4]). Creating a combined simulation model, which is adapted to the needs of the GNC algorithm development, is tedious work and the degree of model complexities varies over the disciplines. What is needed are models suited for closed loop simulation. The option for closed loop simulation is important, because running the models in the closed loop assures that the models will be excited in the right input domain (signal pattern, frequency, amplitude, etc.). For example, the thrust from a cold gas propulsion system depends on the pressure in the tank, which depends on the attitude orientation (thermal impact). On the other hand, the attitude evolution is determined by the controller, but its performance depends on the variation in the thrust level. Currently, dependencies like that can be evaluated only very late, if at all. In the beginning of the design cycle the models must be lean and quick to execute, but later they must be capable of gradually increasing the model fidelity, as soon as results from hardware subsystem tests become available. This tight connection and the option to upgrade are not only important for speedingup the design, but also for identifying needed GNC algorithm improvements as early as possible. Fig 1. Current fragmented, manual intensive Process (left) and unified, multi-disciplinary, effective MBD Approach The activity of setting-up a unified, multi-disciplinary modelling environment with a tight link to the validation via subsystem hardware tests, will implicitly move the subsystem engineers closer to the overall system engineering needs and will lead to better adapted models for use at system level. The GNC development activity plays a pivotal role in this task. The desired GNC performance can only be achieved with the right combination of sensors, actuation system, understanding of the environmental constrains and limitations in software and avionics. Therefore GNC design is inherently multi-disciplinary and, as such, one of the closest subsystem to the overall system engineering. This is illustrated in Fig 2. GNC is placed at a quite central position in the bottom figure, actually establishing the link not only between most of the subsystems but also between development activities: System definition, S/W development and testing. Fig 2. Current sequential, lowly connected design cycle (top). Strongly integrated, overlapping, partly concurrent process in the MBD approach centered on GNC (bottom). In the following we will list, on a more detailed level, the gaps and constraints in the current methodology: 1. System Oriented GNC Design Due to the separation and sequentiality of the classical design phases, the link and flow-down of the requirements on system level to GNC subsystem requirements is a laborious and failure prone process. What is missing is the option for a quick check, early in the development state, on the preliminary GNC requirements set, allowing for fast iteration with the system specification. As the GNC performance is heavily influenced by the choice on sensors, actuators and environmental constrains, a quick closed loop simulation capability can support the system design. This centrality of GNC in upper stages is naturally accounted for in a MBD approach. 2. Modelling Domain The current way we model, leads to limitations on what we can achieve. The external environment and the interdependency of structure, actuator, propellant location, thermal condition and sensor physics is a kind of closed loop in itself. It must be adequately reflected in the composite model onto which the GNC algorithm is build. Especially for the attitude dynamics of upper stages the thermal condition and the evolution of thrust, used for actuation, is tightly connected via the physics of thermal, fluid and orbital dynamics. This is not reflected in current simulators. The effects are phased-in iteratively via open loop profiles for thermal and fluid. The USACDF development suits addressed this issue. A further example is the separation of payloads. Usually the separation process is modeled in the current closed loop simulators as an equivalent delta v, augmented with some uncertainties in magnitude and direction. These parameters are evaluated in dedicated studies. The detailed physics is simulated separately and only phased-in partially into the end-to-end simulator. With a physical modelling approach the details of the separation process, including the electrical command chain, can be captured directly and the consequences of failures in the way of interaction with GNC commands can be studied in a representative way. USACDF has addressed this problem via the Modelica simulation of the full separation chain. 3. 4. 5. 6. 7. 8. 9. Operational Robustness The degree of operational robustness is small in current launchers. Although redundant actuators are not common on upper stages, there are still options for mitigating actions, provided that MVM is flexible enough to adapt in real-time. In order to achieve this, three new elements are needed: An appropriate way of specifying adaptive mechanism in mission definition languages, the corresponding simulation capability of inducing failures into the closed loop execution and verification methods for building a sufficient confidence in the algorithm. The first need is answered by the programming language of higher abstraction like state machine, temporal logic, etc. The second need is covered by physical modeling and the third need is covered by automated and formal methods, like Polyspace analysis. USACDF has addressed this issue with StateFlow as a mean of defining the nominal, as well as failure recovery, payload release sequence Avionics Resources Modern control techniques have the promise of extending the domain of adaptations, responsiveness and robustness of upper stage control. However, they will often increase the demand on the hardware resources. Currently the demand on avionics resources establishes itself only lately in development phase. A capability of achieving processor-in-the- loop (PIL) early is missing. In USACDF a nearly automated process for moving, via autocode, to PIL on flight representative hardware has been achieved. Failure Handling Currently there is only a limited amount of failure recovery in upper stages. Although the hardware resources for real redundancies are limited in launchers, there are still options to cope with hardware degradations providing one can adapt flexible, automated and in real-time the MVM and retune the control algorithm (e.g. jeopardizing performance for recovering a certain loss in gain and phase margin due to unexpected, but identifiable uncertainties). A complete physical modeling of the full command chain, which can be used in closed loop, is often missing. Each failure case currently demands an extra, dedicated set of differential equation, which must be set-up manually. A unified modelling approach, covering nominal and off-nominal, is needed to build-up confidence into GNC based failure response features. USACDF provided some improvements by employing physical modelling connected with partly automated V&V features. Autonomy Improved operational robustness and failure handling capabilities are part of an overall increase of autonomy. The current models, simulation and applied control methods are tuned only to sequential and deterministic execution of the mission sequence. New and improved elements in terms of physical models, integrated simulation tools and modern, adaptive control methods already exists and they are employed in other application areas successfully [2]. The presented study results of USACDF are a step in introducing these techniques into the launcher development environment. Requirement Process Establishing requirements from the system down to the various subsystems is a laborious process, involving many engineers, many hand written documents and many loops to weed-out failures in the interfaces. Working in an integrated way, based on the principals of the physics involved, this process can be sped-up, if tools are available, which supports the linking of the requirements with the software and provide automatic reports. Such an environment also encourages a tree like structure of the requirements, as opposed to separated and flat sets of requirements currently given for each subsystem. In USACDF a benchmark launcher test case has been set-up, based on such an approach using various Mathworks toolboxes for requirement handling, linking and reporting. Domain of Applicability New systems often demand a wider or different domain in which the vehicle must operate. In the current approach, extending the domain demands lots of additional work, incorporating various groups on engineers. MBD can prove this situation by having already the mechanism of modelling and interfacing, in a general and unified way, in place. Once the physics of the particular, new phenomenon has been set-up in the relevant model, the already established process and tool chain is automatically applied. In USACDF this was tested by working on a control technique for the long coasting phase, which demands a control algorithm taking into account simultaneously the effects of minimum impulse bit, large amount of propellant and certain phenomenon of attitude dynamics like nutation and precession. The current development approach was not able to cover this adequately. Closed Loop, Multi-Physics Simulation It has been already sufficiently emphasized that closing the loop is necessary. The current situation often does not allow this. For example the internal sloshing phenomenon is often simulated by a constant, body fixed torque, simply because of the lack of the capability to use CFD simulation in closed loop with the control algorithm. Another example is the following: First a simple rigid body simulation of the mission is performed, the attitude profile is provided to the propulsion department for analyzing the propellant motion along the tank wall, this profile is provided to the tank development group for establishing the temperature and pressure profile. The pressure profile defines the available thruster force as function of time. This profile must be fed-back to the GNC simulation and will change attitude evolution. The cycle must be repeated, but without guarantee of converging. In an MBD tool chain the sloshing CFD simulation is connected with thermal ESATAN simulation and the system is in closed loop with the flight software. It is automated, repeatable and rigorous and it can be employed in the early stages. OVERVIEW OF MODEL BASED DESIGN IN USACDF The model-based concept encompasses the whole activity from first feasibility analysis to final testing and verification. As such it is a wide area and the study had to concentrate on some aspects which were:  A seamless approach from Simulink based attitude control algorithm via autocoding to processor-in-the-loop  Physical modelling for some subsystems which are special for upper stages  Unified requirement process, testing and documentation.  System identification and adaptive control Fig 3 illustrates the main elements. The left hand sided figure shows that a part to the plant dynamics has been realized with Modelica (separation process) and EcosimPro (attitude thruster and main engine). It also shows elements dealing with the analysis. They are worst case case/cross entropy analysis, visualization and automated generation of the payload release sequence. Fig 3. Left: Functional Representation of the Simulator illustrating Modelling Languages and off-line Tools. Middle: Illustration of the Process from deriving PIL. Right: Hardware Configuration with dSPACE and LEON in closed loop via Ethernet. The figure placed in the middle of fig 3 illustrates the autocode process. The software is first developed in the graphical language of Simulink. The application software is then converted via the embedded coder of MathWorks to C and tested (software-in-the-loop). Very often the exact mechanism of the analog to digital (AD) and the reverse (DA) links are not fully and correctly captured in the Functional Engineering Simulator (FES). Therefore it is important to quickly move to a dual board implementation or even to a flight representative processor. This is shown in the right hand sided figure. Within the USACDF framework the testing on a LEON can be done very early in the algorithm design phase because the process of code generation is nearly automated. The physical modelling approach has been applied in a hybrid configuration. EcosimPro is firmly rooted in some areas of the propulsion development. The framework succeeded to link the already available models into the Simulink closed loop simulation. The electrical command chain and the physics of the payload separation have been modelled with Modelica. These physical models easily allowed implementing failures (leakage, separation spring uncertainties, delays, etc.) As discussed in [1] MathWorks has augmented their original set of algorithmic toolboxes with model-based features, namely the toolboxes: Report Generator, Verification and Validation, Design Verifier, Simscape, SimMechanics. In the USACDF framework the features allowing requirement linking between specification documents and software are used. Requirements and software definition reports are generated automatically. The framework was then applied to several benchmark cases representing the anticipated range of future uppers stage applications. That way the framework was tested while it was build. One application was the adaptive control of a particular flight phase, namely the "long coasting phase". System identification, adaptive and model predictive control was employed within the MBD paradigm. ELEMENTS OF THE DESIGN ENVIRONMENT The processor-in-the-loop (PIL) configuration consists of a dSPACE with DS1006 processor. The 'ControlDesktop' software provides advanced graphical control features to handle the closed loop simulation. An Ethernet connection is used for the link to a LEON2 GR-CPCI-AT679. The application software on the LEON2 is generated via the 'embedded coder' toolbox from MathWorks. (see fig.4) The critical design task was to accurately map the synchronization features and the delay of the Ethernet based hardware link in the Function Simulation (FES) based on Simulink. It was possible to achieve this to such a degree that closed loop results on FES and LEON2 revealed differences in the order of 10^-14 only. The design suite also has an Extended Functional Simulator Fig 4. RASTA Configuration (EFES) which contains those physical model elements which cannot be used in the real-time based configuration discussed above. The separation mechanism has been modeled with Modelica as well as with MathWorks Simmechanics. However, some mechanical separation effects need very high sampling rates. Therefore this phenomenon needs a highfidelity and a coarse model, one in the EFES and the other for the real-time closed loop. The Modelica version also contains the electrical command chain as triggered by Mission and Vehicle Management software (MVM). Because the modeling is physics based any conceivable hardware failure can easily be implemented at the very location where it occurs. A new, manual generation of differential equation is not necessary. Fig. 5 illustrates the separation model. As a second subsystem the attitude thrusters and the Vinci Fig 5. Separation Mechanism with Modelica engine is modelled physically via EcosimPro (see fig 6). Contrary to SimMechanics, EcosimPro and Modelica have their own modeling software. Both are incorporated via the sfunction mechanism of Matlab. This is not an ideal solution as it demands manual switching between three simulation environments. Because of the model heritage of EcosimPro for propulsion and the wide application of Modelica this drawback has been accepted. Fig. 11 illustrates the requirement linking feature. Requirements can be written in DOORS or as Word file. A hyperlink can then point to the place of the Simulink software where the requirement is dealt with. The link is bi-directional. The advantage of this feature is that the programmer is always reminded of the link and will deal with potential software modification accordingly and carefully. The auto-report feature can extract the information and generates a well- Fig 6. Vinci Engine with EcosimPro formatted document. A second document is the 'Software Design Definition' which is built from the comments in the Simulink software (free comments, description of the connections, variables, etc.). Not illustrated on the right side is a feature concerning testing and verification. In line with the MBD philosophy, which suggests that software designing, programming and testing should be performed as concurrently as possible, test points are placed at the appropriate places in the software right at the beginning. The test elements are triggered by violations of thresholds or perform statistical evaluations of signals etc. They can be selectively switched on or off. The next section illustrates some application of the design suite. UPPER STAGE MISSION DESIGN WITH USACDF The framework has been developed incremetally. Several benchmark design tasks have been studied in order to validate and improve the framework. In the following we will briefly present one case. Fig 6 illustrates an upper stage with one payload during a particular mission phase named 'long coasting phase'. Essentialy this is a barbecue mode of up to 5 hours with a spin rate of about 2 to 5 deg/sec. The special dynamics of nutation and precession can collect the propellant of a centrally placed tank in the form of a bulge (blue fluid in fig 7). Obviously a high dynamic unbalance (i.e. non-diagonal elements of the Fig 7. Spinning Stage with Sloshing Bulge inertia matrix) will occur. The long coasting phase with a high amount of propellant is a good example to illustrate the enhanced options, offered in an MBD framework, when it comes to advanced control algorithm design. A model predictive approach (see [12], [13]) has been used to establish the optimal solution in terms of minimum number of actuation. A second adaptive solution has then been developed based on system identification of the propellant position and transformation of the control in the principal axis system. MBD allows exploring advanced concepts easily. Modern control concepts most often rely on the availability models including uncertainties. They are readily available in the MBD framework to various degree of details. On-board re-configurability is illustrated in fig.8. The mission and Fig 8. StateFlow Implementation of MVM vehicle management has been implemented with a state machine concept via MathWorks Stateflow toolbox. A state machine based expression of the mission sequence provides a very transparent way of defining branches at any place in the nominal sequence when a failure occurs. Emergency releases are triggered when an excessive propellant depletion is detected. Depending on when the failure occurs different actions have to be taken. The use of state machine syntax as opposed to a convolute of if, then, else, case, constructs is more reliable in terms of avoiding programming errors. Fig 9 illustrates a complete payload release sequence expressed in angular rates. Two payloads are released. The supporting structure is released in between. The framework also contains Monte Carlo, Worst Case and Cross Entropy features (see [14]). Finally Fig 10 illustrates the Fig 9. Angular Rate of a two Payload Release tree like composition of the requirements . Fig 10. Tree-like Requirement Specification with two-way linking to Simulink Implementation CONCLUSION The current framework has been designed to answer cross disciplinary system wide questions related to the safety and efficiency of complex space operations. Using coupled GNC CFD simulations and analyses permitted the prediction of nonlinear flight mechanics evolutions related to tank fluids motions in micro gravity flight. By closing the loop it was possible to assess nutation stability boundaries of the current system. Furthermore, the framework has allowed taking adequate design measures using model predictive control strategies for optimizing the actuation profile under stability and mission constraints such as roll reversals and spinned separations. Integrating adequate physical propulsion models allows further to perform detailed GNC propulsion FDIR analyses for the development and sizing of adequate reconfiguration strategies. Furthermore, efficient and safe payload separation strategies have been integrated into the MVM and GNC simulation tools. It is now possible to optimize upper stage mission sequences respecting timing, plume impingement as well as collision avoidance constraints. New worst case and stochastic verification strategies have been developed to better understand the limitations of existing designs as well as to be able to explore the limits of performance by adopting advance control concepts without too much conservatism. The subsequent project follow-up will concentrate on the experimental capabilities of the USACDF framework. This will include experimental modeling, control and uncertainty validation techniques applied on various flight benchmarks and laboratory test facilities in order to assess innovative designs and to accelerate the TRL maturation process which is the only way to develop in time competitive technologies. ACKNOWLEDGMENT The work was been performed within ESA's Future Launcher Preparatory Program (FLPP). Part of the works has been carried out by DLR Institute of Space Systems, Bremen, Germany and Astos Solustions GmbH, Unterkirnach, Germany. The authors thank Maxime Perrotin for the support concerning TASTE and all the reviewers of ESTEC TECECN for sharing their thoughts and time. REFERENCES [1] R. A. Hyde, “Fostering Innovation in Design and Reducing Implementation Costs by Using Graphical Tools for Functional Specification,” AIAA Modelling and Simulation Conference, AIAA 2002-4689, August 2002, Monterey, California, USA. [2] K. Lamberg and P. Wältermann "Using HIL Simulations to Test Mechatronic Components in Automotive Engineering", 2nd Congress on "Mechatronik im Automobil", Nov. 2000, Munich [3] M. Perrotin, et al "TASTE: A Real Time Software Engineering Tool", 2011,doi 10.1007/978-3-642-25264-8_4 [4] D. A. Wagner and T. N. Hurst, “Multi-disciplinary Approach for the Integrating and Testing Phase of Simulation Development,” AIAA Modelling and Simulation Conference, AIAA 2008-6354, August 2008, Hawaii, USA. [5] Pasareanu, C.S.; Schumann, J.; Mehlitz, P.; Lowry, M.; Karsai, G.; Nine, H.; Sandeep Neema, "Model Based Analysis and Test Generation for Flight Software," Space Mission Challenges for Information Technology, 2009. SMC-IT 2009. Third IEEE International Conference on , July 2009 [6] S. A. Kowalchuk, “Model-Based Design Strategies For Real-Time Hardware-in-the-Loop Rocket System Simulations,” AIAA Modelling and Simulation Conference, AIAA 2012-4627, August 2012, Minneapolis, USA. [7] M. C. Jackson and J. R. Henry, “Orion GN&C Model Based Development: Experience and Lessons Learned,” AIAA Guidance, Navigation and Control Conference, AIAA 2012-5036, August 2012, Minneapolis, USA. [8] S. Tamblyn, J. Henry. J. King, E., "A model-based design and testing approach for Orion GN&C flight software development," Aerospace Conference, 2010 IEEE , vol., no., pp.1,12, 6-13 March 2010 [9] R. G. Estrada, E. Dillaber, and G.Sasaki, “Best practices for development DO-178 compliant software using Model-Based Design,” AIAA Guidance, Aerospace Conference, AIAA 2013-4566, August 2013, Boston, Massachusetts, USA. [10] R.G. Pettit and N. Mezcciani, "Highlighting the challenges of model-based engineering for spaceflight software systems," Modeling in Software Engineering, 5th International Workshop on , vol., no., pp.51,54, May 2013 [7] T. Saxena, A. Dubey, D. Balasubramanian and G Karsai, "Enabling Self-Management by Using Model-Based Design Space Exploration," Engineering of Autonomic and Autonomous Systems (EASe), 2010 Seventh IEEE International Conference and Workshops on , vol., no., pp.137,144, 22-26 March 2010 [10] P. Sopasakis, D. Bernardini, H. Strauch, S. Bennani and A. Bemporad, "Sloshing-aware attitude control of impulsively actuated spacecraft", ECC15 2015, in press [11] P. Sopasakis, D. Bernardini, H. Strauch, S. Bennani and A. Bemporad, "A Hybrid Model Predictive Control Approach to Attitude Control with Minimum-Impulse-Bit Thrustesrs", ECC15 2015, in press [12] A. Mujumdar, H. Strauch, S. Bennani and P. Menon, "Worst Case Analysis of the Attitude Control System for the Long Coasting Phase of a Launcher Upper Stage", EUROGNC2015, 2015, in press
3cs.SY
Missing Value Imputation With Unsupervised Backpropagation M ICHAEL S. G ASHLER arXiv:1312.5394v1 [cs.NE] 19 Dec 2013 [email protected] Department of Computer Science and Computer Engineering, University of Arkansas, Fayetteville, Arkansas, USA. M ICHAEL R. S MITH , R ICHARD M ORRIS , T ONY M ARTINEZ [email protected], [email protected], [email protected] Department of Computer Science, Brigham Young University, Provo, Utah, USA. Many data mining and data analysis techniques operate on dense matrices or complete tables of data. Realworld data sets, however, often contain unknown values. Even many classification algorithms that are designed to operate with missing values still exhibit deteriorated accuracy. One approach to handling missing values is to fill in (impute) the missing values. In this paper, we present a technique for unsupervised learning called Unsupervised Backpropagation (UBP), which trains a multi-layer perceptron to fit to the manifold sampled by a set of observed point-vectors. We evaluate UBP with the task of imputing missing values in datasets, and show that UBP is able to predict missing values with significantly lower sum-squared error than other collaborative filtering and imputation techniques. We also demonstrate with 24 datasets and 9 supervised learning algorithms that classification accuracy is usually higher when randomly-withheld values are imputed using UBP, rather than with other methods. Key words: Imputation; Manifold learning; Missing values; Neural networks; Unsupervised learning. 1. INTRODUCTION Many effective machine learning techniques are designed to operate on dense matrices or complete tables of data. Unfortunately, real-world datasets often include only samples of observed values mixed with many missing or unknown elements. Missing values may occur due to human impatience, human error during data entry, data loss, faulty sensory equipment, changes in data collection methods, inability to decipher handwriting, privacy issues, legal requirements, and a variety of other practical factors. Thus, improvements to methods for imputing missing values can have far-reaching impact on improving the effectiveness of existing learning algorithms for operating on real-world data. We present a method for imputation called Unsupervised Backpropagation (UBP), which trains a multilayer perceptron (MLP) to fit to the manifold represented by the known features in a dataset. We demonstrate this algorithm with the task of imputing missing values, and we show that it is significantly more effective than other methods for imputation. Backpropagation has long been a popular method for training neural networks (Rumelhart et al., 1986; Werbos, 1990). A typical supervised approach trains the weights, W, of a multilayer perceptron (MLP) to fit to a set of training examples, consisting of a set of n feature vectors X = hx1 , x2 , ..., xn i, and n corresponding label vectors Y = hy1 , y2 , ..., yn i. With many interesting problems, however, training data is not available in this form. In this paper, we consider the significantly different problem of training an MLP to estimate, or impute, the missing attribute values of X . Here X is represented as an n × d matrix where each of the d attributes may be continuous or categorical. Because the missing elements in X must be predicted, X becomes the output of the MLP, rather than the input. A new set of latent vectors, V = hv1 , v2 , ..., vn i, will be fed as inputs into the MLP. However, no examples from V are given in the training data. Thus, both V and W must be trained using 2 M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION only the known elements in X. After training, each vi may be fed into the MLP to predict all of the elements in xi . Training in this manner causes the MLP to fit a surface to the (typically non-linear) manifold sampled by X. After training, V may be considered as a reduced-dimensional representation of X. That is, V will be an n × t matrix, where t is typically much smaller than d, and the MLP maps V 7→ X. UBP accomplishes the task of training an MLP using only the known attribute values in X with on-line backpropagation. For each presentation of a known value of the cth attribute from the rth instance (xr,c ∈ X), UBP simultaneously computes a gradient vector g to update the weights W, and a gradient vector h to update the input vector vr . (xr,c is the element in row r, column c of X.) In this paper, we demonstrate UBP as a method for imputing missing values, and show that it outperforms other approaches at this task. We compare UBP against 5 other imputation methods on a set of 24 data sets. 10% to 90% of the values are removed from the data sets completely at random. We show that UBP predicts the missing values with signficantly lower error (as measured by sum-squared difference with normalized values) than other approaches. We also evaluated 9 learning algorithms to compare classification accuracy using imputed data sets. Learning algorithms using imputed data from UBP usually achieve higher classification accuracy than with any of the other methods. The increase is most significant when 30% to 70% of the data is missing. The remainder of this paper is organized as follows. Section 2 reviews related work to UBP and missing value imputation. UBP is described in Section 3. Section 4 presents the results of comparing UBP with other imputation methods. We provide conclusions and a discussion of future directions for UBP in Section 5. 2. RELATED WORK As an algorithm, UBP falls at the intersection of several different paradigms: neural networks, collaborative filtering, data imputation, and manifold learning. In neural networks, UBP is an extension of generative backpropagation (Hinton, 1988). Generative backpropagation adjusts the inputs in a neural network while holding the weights constant. UBP, by contrast, computes both the weights and the input values simultaneously. Related approaches have been used to generate labels for images (Coheh and Shawe-Taylor, 1990), and for natural language (Bengio et al., 2006). Although these techniques have been used for labeling images and documents, to our knowledge, they have not been used for the application of imputing missing values. UBP differs from generative backpropagation in that it trains the weights simultaneously with the inputs, instead of training them as a pre-processing step. UBP may also be classified as a manifold learning algorithm. Like common non-linear dimensionality reduction (NLDR) algorithms, such as Isomap (Tenenbaum et al., 2000), MLLE (Zhang and Wang, 2007), or Manifold Sculpting (Gashler et al., 2008), it reduces a set of high-dimensional vectors, X, to a corresponding set of low-dimensional vectors, V. Unlike these algorithms, however, UBP also learns a model of the manifold. Also unlike these algorithms, UBP is designed to operate with incomplete observations. In collaborative filtering, UBP may be viewed as a non-linear generalization of matrix factorization (MF). MF is a linear dimensionality reduction technique that can be effective for collaborative filtering (Adomavicius and Tuzhilin, 2005) as well as imputation. This method has become a popular technique, in part due to its effectiveness with the data used in the NetFlix competition (Koren et al., 2009). MF involves factoring the data matrix into two much-smaller matrices. These smaller matrices can then be combined to predict all of the missing values in the original dataset. It is equivalent to using linear regression to project M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION 3 the data onto its first few principal components. Unfortunately, MF is not well-suited for data that exhibits non-linearities. It was previously shown that matrix factorization could be represented with a neural network model involving one hidden layer and linear activation functions (Takács et al., 2009). In comparison with this approach, UBP uses a standard MLP with an arbitrary number of hidden layers and non-linear activation functions, instead of the network structure previously proposed for matrix factorization. MF produces very good results at the task of imputation, but we demonstrate that UBP does better. As an imputation technique, UBP is a refinement of Nonlinear PCA (Scholz et al., 2005) (NLPCA), which has been shown to be effective for imputation. This approach also uses gradient descent to train an MLP to map from low to high-dimensional space. After training, the weights of the MLP can be used to represent non-linear components within the data. If these components are extracted one-at-a-time from the data, then they are the principal components, and NLPCA becomes a non-linear generalization of PCA. Typically, however, these components are all learned together, so it would more properly be termed a non-linear generalization of MF. NLPCA was evaluated with the task of missing value imputation (Scholz et al., 2005), but its relationship to MF was not yet recognized at the time, so it was not compared against MF. One of the contributions of this paper is that we show NLPCA to be a significant improvement over MF at the task of imputation. We also demonstrate that UBP achieves even better results than NLPCA at the same task, and is the best algorithm for imputation of which we are aware. The primary difference between NLPCA and UBP is that UBP utilizes a three-phase training approach (described in Section 3) which makes it more robust against falling into a local optimum during training. UBP is comparable with the latter-half of an autoencoder (Hinton and Salakhutdinov, 2006). Autoencoders create a low dimensional representation of a training set by using the training examples as input features as well as the target values. The first half of the encoder reduces the input features into low dimensional space by only have n nodes in the middle layer where n is less than the number of input features. The latter-half of the autoencoder then maps the low dimensional representation of the training set back to the original input features. However, to capture non-linear dependencies in the data, autoencoders require deep architectures to allow for layers between the inputs and low dimensional representation of the data and between the low dimensional representation of the data and the output. The deep architecture makes training an autoencoder difficult and computationally expensive, generally requiring unsupervised layer-wise training (Bengio et al., 2007; Erhan et al., 2009). Because UBP trains a network with half the depth of a corresponding autoencoder, UBP is practical for many problems for which autoencoders are too computationally expensive. Since we demonstrate UBP with the application of imputing missing values in data, it is also relevant to consider other approaches that are classically used for this task. Simple methods, such as dropping patterns that contain missing values or randomly drawing values to replace the missing values, are often used based on simplicity for implementation. These methods, however, have significant obvious disadvantages when data is scarce. Another common approach is to treat missing elements as having a unique value. This approach, however has been shown to bias the parameter estimates for multiple linear regression models (Jones, 1996) and to cause problems for inference with many models (Shafer, 1997). We take it for granted that better accuracy is desirable, so these methods should generally not be used, as better methods do exist. A simple improvement over BL is to compute a separate centroid for each output class. The disadvantages of this method are that it is not suitable for regression problems, and it cannot generalize to unlabeled data since it depends on labels to impute. Methods based on maximum likelihood (Little and Rubin, 2002) have long been studied in statistics, but these also depend on pattern labels. Since it is common to have more unlabeled data than labeled 4 M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION data, we restrict our analysis to unsupervised methods that do not rely on labels to impute missing values. Another well-studied approach involves training a supervised learning algorithm to predict missing values using the non-missing values as inputs (Quinlan, 1989; Lakshminarayan et al., 1996; Alireza Farhangfar, 2008). Unfortunately, the case where multiple values are missing in one pattern present a difficulty for these approaches. Either a learning algorithm must be used that implicitly handles missing values in some manner, or an exponential number of models must be trained to handle each combination of missing values. Further, it has also been shown that results with these methods tend to be poor when there are high percentages (more than about 15%) of missing values (Acuña and Rodriguez, 2004). One very effective collaborative filtering method for imputation is to cluster the data, and then make predictions according to the centroid of the cluster in which each point falls (Adomavicius and Tuzhilin, 2005). Luengo compared several imputation methods by evaluating their effect on classification accuracy (Luengo, 2011). He found cluster-based imputation with Fuzzy k-Means (FKM) (Li et al., 2004) using Manhattan distance to outperform other methods, including those involving state of the art machine learning methods and other methods traditionally used for imputation. Our analysis, however, finds that most of the methods we compared outperform FKM. A related imputation method called instance-based imputation (IBI) is to combine the non-missing values of the k-nearest neighbors of a point to replace its missing values. To evaluate the similarity between points, cosine correlation is often used because it tends to be effective in the presence of missing values (Adomavicius and Tuzhilin, 2005; Li et al., 2008; Sarwar et al., 2001). UBP, as well as the aforementioned imputation techniques, are considered single imputation techniques because only one imputation for each missing value is made. Single imputation has the disadvantage of introducing large amounts of bias since the imputed values do not reflect the added uncertainty from the fact that values are missing. To overcome this, Rubin (1987) proposed multiple imputation that estimates the added variance by combining the outcomes of I imputed data sets. Similarly, ensemble techniques have also been shown to be effective for imputing missing values (Schafer and Graham, 2002). In this paper, we do not compare against ensemble methods because UBP involves a single model, and it may be included in an ensemble as well as any other imputation method. 3. UNSUPERVISED BACKPROPAGATION In order to formally describe the UBP algorithm, we define the following terms. The relationships between these terms are illustrated graphically in Figure 1. • Let X be a given n×d matrix, which may have many missing elements. We seek to impute values for these elements. n is the number of instances. d is the number of attributes. • Let V be a latent n × t matrix, where t < d. • If xr,c is the element at row r, column c in X, then x̂r,c is the value predicted by the MLP for this element when vr ∈ V is fed forward into the MLP. • Let wij be the weight that feeds from unit i to unit j in the MLP. • For each network unit i on hidden layer j, let βj,i be the net input into the unit, let αj,i be the output or activation value of the unit, and let δj,i be an error term associated with the unit. • Let l be the number of hidden layers in the MLP. M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION Low dimensional V h 5 High dimensional W X g Backpropagation e = x r,c ^ x r,c F IGURE 1. UBP trains an MLP to fit to high-dimensional observations, X. For each known xr,c ∈ X, UBP uses backpropagation to compute the gradient vectors g and h, which are used to update the weights, W, and the input vector vr . • Let g be a vector representing the gradient with respect to the weights of an MLP, such that gi,j is the component of the gradient that is used to refine wi,j . • Let h be a vector representing the gradient with respect to the inputs of an MLP, such that hi is the component of the gradient that is used to refine vr,i ∈ vr . Using backpropagation to compute g, the gradient with respect to the weights, is a common operation for training MLPs (Rumelhart et al., 1986; Werbos, 1990). Using backpropagation to compute h, the gradient with respect to the inputs, however, is much less common, so we provide a derivation of it here. In this deriviation, we compute each hi ∈ h from the presentation of a single element xr,c ∈ X. It could also be derived from the presentation of a full row (which is typically called “on-line training”), or from the presentation of all of X (“batch training”), but since we assume that X is high-dimensional and is missing many values, it is significantly more efficient to train with the presentation of each known element individually. We begin by defining an error signal, E = (xr,c − x̂r,c )2 , and then express the gradient as the partial derivative of this error signal with respect to the inputs: ∂E hi = . (1) ∂vr,i The intrinsic input vr,i affects the value of E through the net value of a unit βi and further through the output of a unit αi . Using the chain rule, Equation 1 becomes: ∂E ∂α0,c ∂β0,c hi = . (2) ∂α0,c ∂β0,c ∂vr,i ∂α 0,c ∂E ∂E (which is ∂β for a network unit) as The backpropagation algorithm calculates ∂α 0,c ∂β0,c j,i the error term δj,i associated with a network unit. Thus, to calculate hi the only additional ∂βj calculation that needs to be made is ∂vr,i . For a network with 0 hidden layers: ∂β0,c ∂ X = wt,c vr,t , ∂vr,i ∂vr,i t which is non-zero only when t equals i and is equal to wi,c . When there are no hidden layers (l = 0): hi = −wi,c δc . (3) 6 M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION If there is at least one hidden layer (l > 0), then, ∂β0,c ∂β0,c ∂α1 ∂αl ∂βl = ... , ∂vr,i ∂α1 ∂β1 ∂βl vr,i where the αk and βk represent the output values and the net values for the units in the k th hidden layer. As part of the error term for the units in the lth layer, backpropagation ∂β ∂α1 l calculates ∂α0,c . . . ∂α ∂βl as the error term associated with each network unit. Thus, the 1 ∂β1 only additional calculation for hi is: ∂βl ∂ XX = wj,t vr,t . ∂vr,i ∂vr,i t j As before, ∂βl ∂vr,i is non-zero only when t equals i. For network with at least one hidden layer: X hi = − wi,j δj . (4) j Equation 4 is a strict generalization of Equation 3. Equation 3 only considers the one output unit, c, for which a known target value is being presented, whereas Equation 4 sums over each unit, j, into which the intrinsic value vr,i feeds. 3.1. 3-phase Training UBP trains V and W in three phases: 1) the first phase computes an initial estimate for the intrinsic vectors, V, 2) the second phase computes an initial estimate for the network weights, W, and 3) the third phase refines them both together. All three phases train using stochastic gradient descent, which we derive from the classic backpropagation algorithm. We now briefly give an intuitive justification for this approach. In our initial experimentation, we used the simpler approach of training in a single phase. With several problems, we observed that early during training, the intrinsic point vectors, vi ∈ V, tended to separate into clusters. The points in each cluster appeared to be unrelated, as if they were arbitrarily assigned to one of the clusters by their random initialization. As training continued, the MLP effectively created a separate mapping for each cluster in the intrinsic representation to the corresponding values in X. This effectively places an unnecessary burden on the MLP, because it must learn a separate mapping from each cluster that forms in V to the expected target values. In phase 1, we give the intrinsic vectors a chance to self-organize while there are no hidden layers to form nonlinear separations among them. Likewise, phase 2 gives the weights a chance to organize without having to train against moving inputs. These two preprocessing phases initialize the system (consisting of both intrinsic vectors and weights) to a good initial starting point, such that gradient descent is more likely to find a local optimum of higher quality. Our empirical results validate this theory by showing that UBP produces more accurate imputation results than NLPCA, which only refines V and W together. Pseudo-code for the UBP algorithm, which trains V and W in three phases, is given in Algorithm 1. This algorithm calls Algorithm 2, which performs a single epoch of training. A detailed description of Algorithm 1 follows. A matrix containing the known data values, X, is passed in to UBP (See Algorithm 1). UBP returns V and W. V is a matrix such that each row, vi , is a low-dimensional representation of the corresponding row, xi . W is a set or ragged matrix containing weight values for an MLP that maps from each vi to an approximation of xi ∈ X. vi may be forwardpropagated into this MLP to estimate values for any missing elements in xi . Lines 1-9 perform the first phase of training, which computes an initial estimate for V. Line 1 of Algorithm 1 initializes the elements in V with small random values. Our M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION 7 Algorithm 1 UBP(X) 1: Initialize each element in V with small random values. 2: Let T be the weights of a single-layer perceptron 3: Initialize each element in T with small random values. 4: η 0 ← 0.01; η 00 ← 0.0001; γ ← 0.00001; λ ← 0.0001 5: η ← η 0 ; s0 ← ∞ 6: while η > η 00 7: s ← train epoch(X, T, λ, true, 0) 8: if 1 − s/s0 < γ then η ← η/2 9: s0 ← s 10: Let W be the weights of a multi-layer perceptron with l hidden layers, l > 0 11: Initialize each element in W with small random values. 12: η ← η 0 ; s0 ← ∞ 13: while η > η 00 14: s ← train epoch(X, W, λ, false, l) 15: if 1 − s/s0 < γ then η ← η/2 16: s0 ← s 17: η ← η 0 ; s0 ← ∞ 18: while η > η 00 19: s ← train epoch(X, W, 0, true, l) 20: if 1 − s/s0 < γ then η ← η/2 21: s0 ← s 22: return {V, W} implementation draws values from a Normal distribution with a mean of 0 and a deviation of 0.01. Lines 2-3 initialize the weights, T, of a single-layer perceptron using the same mechanism. This single-layer perceptron is a temporary model that is only used in phase 1 to assist the initial training of V. Line 4 sets some heuristic values that we used to detect convergence. We note that many other techniques could be used to detect convergence. Our implementation, used the simple approach of dividing half of the training data for a validation set. We decay the learning rate whenever predictions fail to improve by a sufficient amount on the validation data. This simple approch always stops, and it yielded better empirical results than a few other variations that we tried. η 0 specifies an initial learning rate. Convergence is detected when the learning rate falls below η 00 . γ specifies the amount of improvement that is expected after each epoch, or else the learning rate is decayed. λ is a regularization term that is used during the first two phases to ensure that the weights do not become excessively saturated before the final phase of training. No regularization is used in the final phase of training because we want the MLP to ultimately fit the data as closely as possible. (Overfit can still be mitigated by limiting the number of hidden units used in the MLP.) We used the default heuristic values specified on this line in all of our experiments because tuning them seemed to have little impact on the final results. We believe that these values are well-suited for most problems, but could possibly be tuned if necessary. Line 5 sets the learning rate, η, to the initial value. The value s0 is used to store the previous error score. As no error has yet been measured, it is initialized to ∞. Lines 6-9 train V and T until convergence is detected. T may then be discarded. Lines 10-16 perform the second phase of training. This phase differs from the first phase in two ways: 1) an MLP is used instead of a temporary single-layer perceptron, and 2) V is held constant during this phase. 8 M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION Algorithm 2 train epoch(X, W, λ, p, l) 1: for each known xr,c ∈ X in random order 2: Compute αc by forward-propagating vr into an MLP with weights W. 3: δc ← (xr,c − αc )f 0 (βc ) 4: for each hidden unit i feeding into output unit c 5: δi ← wi,c δc f 0 (βi ) 6: for eachP hidden unit j in an earlier hidden layer (in backward order) 7: δj ← k wj,k δk f 0 (βj ) 8: for each wi,j ∈ W 9: gi,j ← −δj αi 10: W ← W − η(g + λW) 11: if p = true then 12: for i from 0 to t − 1 13: if l = 0 then P hi ← −wi,c δc else hi ← − j wi,j δj 14: vr ← vr − η(h + λvr ) 15: s ← measure RMSE with X 16: return s Lines 17-21 perform the third phase of training. In this phase, the same MLP that is used in phase 2 is used again, but V and W are both refined together. Also, no regularization is used in the third phase. 3.2. Stochastic gradient descent Next, we describe Algorithm 2, which performs a single epoch of training by stochastic gradient descent. This algorithm is very similar to an epoch of traditional backpropagation, except that it presents each element individually, instead of presenting each vector, and it conditionally refines the intrinsic vectors, V, as well as the weights, W. Line 1 presents each known element xr,c ∈ X in random order. Line 2 computes a predicted value for the presented element given the current vr . Note that efficient implementations of line 2 should only propagate values into output unit c. Lines 3-7 compute an error term for output unit c, and each hidden unit in the network. The activation of the other output units is not computed, so the error on those units is 0. Lines 8-10 refine W by gradient descent. Line 11 specifies that V should only be refined during phases 1 and 3. Lines 12-14 refine V by gradient descent. Line 15 computes the root-mean-squared-error of the MLP for each known element in X. In order to enable UBP to process nominal (categorical) attributes, we convert such values to a vector representing a membership weight in each category. For example, a given value of “cat” from the value set {“mouse”,“cat”,“dog”} is represented with the vector in h0, 1, 0i. Unknown values in this attribute are converted to 3 unknown real values, requiring the algorithm to make 3 predictions. After missing values are imputed, we convert the data back to its original form by finding the mode of each categorical distribution. For example, the predicted vector h0.4, 0.25, 0.35i would be converted to a prediction of “mouse”. 3.3. Complexity Because UBP uses a heuristic technique to detect convergence, a full analysis of the computational complexity of UBP is not possible. However, it is sufficiently similar to other M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION 9 well-known techniques that comparisons can be made. Matrix factorization is generally considered to be a very efficient imputation technique (Koren et al., 2009). Nonlinear PCA is a nonlinear generalization of matrix factorization. If a linear activation function is used, then it is equivalent to matrix factorization, with the additional (very small) computational overhead of computing the activation function. When hidden layers are added, computational complexity is increased, but remains proportional to the number of weights in the network. UBP adds two additional phases of training to Nonlinear PCA. Thus, in the worst case, UBP is 3 times slower than Nonlinear PCA. In practice, however, the first two phases tend to be very fast (because they optimize fewer values), and these preprocessing phases may even cause the third phase to be much faster (by initializing the weights and intrinsic vectors to start at a position much closer to a local optimum). 4. EMPIRICAL VALIDATION Because running time was not a significant issue with UBP, our empirical validation focuses on imputation accuracy. We compared UBP with 5 other imputation algorithms. The imputation methods that we examined as well as their algorithmic parameter values (including UBP) are: • Mean/Mode or Baseline (BL). To establish a “baseline” for comparison, we compare with the method of replacing missing values in continuous attributes with the mean of the non-missing values in that attribute, and replacing missing values in nominal (or categorical) attributes with the most common value in the non-missing values of that attribute. There are no parameters for BL. It is expected that any reasonable algorithm should outperform this baseline algorithm with most problems. • Fuzzy K-Means (FKM). We varied k (the number of clusters) over the set {4, 8, 16}, we varied the LP -norm value for computing distance over the set {1, 1.5, 2} (Manhattan distance to Euclidean distance), and the fuzzification factor over the set {1.3, 1.5} which were reported to be the most effective values (Li et al., 2004). • Instance-Based Imputation (IBI). We used cosine correlation to evaluate similarity, and we varied k (the number of neighbors) over the set {1, 5, 21}. These values were selected because they were all odd, and spanned the range of intuitively suitable values. • Matrix Factorization (MF). We varied the number of intrinsic values over the set {2, 8, 16}, and the regularization term over the set {0.001, 0.01, 0.1}. Again, these values were selected to span the range of intuitively suitable values. • Nonlinear PCA (NLPCA). We varied the number of hidden units over the set {0, 8, 16}, and the number of intrinsic values over the set {2, 8, 16, 32}. In the case of 0 hidden units, only a single layer of sigmoid units was used. • Unuspervised Backpropagation (UBP). The parameters were varied over the same ranges as those of NLPCA. For NLPCA and UBP, we used the logistic function as the activation function and summed squared error as the objective function. Thus, we imputed missing values in a total of 66000 dataset scenarios. For each algorithm, we found the set of parameters that yielded the best results, and we compared only these best results for each algorithm averaged over the ten runs of differing random seeds. To facilitate reproduction of our results, and to assist with related research efforts, we have integrated our implementation of UBP and all of the competitor algorithms into the Waffles machine learning toolkit (Gashler, 2011) In order to evaluate the effectiveness of UBP and related imputation techniques, we gathered a set of 24 datasets from the UCI repository (Frank and Asuncion, 2010), the Promise 10 M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION Vehicle Segment FKM MF BL SSE SSE MF IBI NLPCA UBP Sparsity BL FKM IBI NLPCA UBP Sparsity F IGURE 2. A comparison of the average sum-squared error in each pattern by 5 imputation techniques over a range of sparsity values with two representative datasets. (Lower is better.) repository (Sayyad Shirabad and Menzies, 2005), and mldata.org: {abalone, arrhythmia, bupa, colic, credit-g, desharnais, diabetes, ecoli, eucalyptus, glass, hypothyroid, ionosphere, iris, nursery, ozone, pasture, sonar, spambase, spectrometer, teaching assistant, vote, vowel, waveform-500, and yeast}. To ensure an objective evaluation, this collection was determined before evaluation was performed, and was not modified to emphasize favorable results. To ensure that our results would be applicable for tasks that require generalization, we removed the class labels from each dataset so that only the input features could be used for imputing missing values. We normalized all real-valued attributes to fall within a range from 0 to 1 so that every attribute would carry approximately equal weight in our evaluation. We then removed completely at random1 u% of the values from each dataset, where u ∈ {10, 30, 50, 70, 90}. For each dataset, and for each u, we generated 10 datasets with missing values, each using a different random number seed, to make a total of 1200 tasks for evaluation. The task for each imputation algorithm was to restore these missing values. We measured error by comparing each predicted (imputed) value with the corresponding original normalized value, summed over all attributes in the dataset. For nominal (categorical) values, we used Hamming distance, and for real values, we used the squared difference between the original and predicted values. The average error was computed over all of the patterns in each dataset. Figure 2 shows two representative comparisons of the error scores obtained by each algorithm at varying levels of sparsity. Comparisons with other datasets generally exhibited similar trends. MF, NLPCA, and UBP did much better than other algorithms when 50% or 70% of the values were missing. No algorithm was best in every case, but UBP achieved the best score in more cases than any other algorithm. Table 1 summarizes the results of these comparisons. UBP achieved lower error than the other algorithm in 20 out of 25 pair-wise comparisons, each comparing imputation scores with 24 datasets averaged over 10 runs with different random seeds. In 15 pair-wise comparisons, UBP did better with a sufficient number 1 Other categories of “missingness”, besides missing completely at random (MCAR), have been studied (Little and Rubin, 2002), but we restrict our analysis to the imputation of MCAR values. M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION 11 of datasets to establish statistical significance according to the Wilcoxon Signed Ranks test. √ These cases are indicated with a “ ” symbol. TABLE 1. A high-level summary of comparisons between UBP and five other imputation techniques. Results are shown for each of the 5 sparsity values. Each row in this table summarizes a comparison between UBP and a competitor imputation algorithm for predicting missing values. 0.9 0.7 0.5 0.3 0.1 S PARSITY A LGORITHM UBP COMPARATIVE W INS ,T IES ,L OSSES P- VALUE BL FKM IBI MF NLPCA 20,0,4 19,0,5 15,0,9 12,0,12 11,7,6 √ 0.001√ 0.004 0.250 0.348 0.176 BL FKM IBI MF NLPCA 20,0,4 22,0,2 19,0,5 11,0,13 10,11,3 √ 0.001√ 0.000√ 0.022 0.437 √ 0.036 BL FKM IBI MF NLPCA 20,0,4 20,0,4 17,0,7 12,0,12 10,11,3 √ 0.003√ 0.000√ 0.018 0.394 √ 0.046 BL FKM IBI MF NLPCA 16,0,8 17,0,7 15,0,9 13,0,11 7,14,3 √ 0.022√ 0.004√ 0.040 0.312 √ 0.038 BL FKM IBI MF NLPCA 7,0,17 17,0,7 13,0,11 16,0,8 2,10,12 0.437 √ 0.006 0.147 0.123 0.495 To help us further understand how UBP might lead to better classification results, we also performed experiments involving classification with the imputed datasets. We restored class labels to the datasets in which we had imputed feature values. We then used 5 repetitions of 10-fold cross validation with each of 9 learning algorithms from the WEKA (Witten and Frank, 2005) machine learning toolkit: backpropagation (BP), C4.5 (Quinlan, 1993), 5nearest neighbor (IB5), locally weighted learning (LWL) (Atkeson et al., 1997), naı̈ve Bayes (NB), nearest neighbor with generalization (NNGE) (Martin, 1995), Random Forest (RandF) (Breiman, 2001), RIpple DOwn Rule Learner (RIDOR) (Gaines and Compton, 1995), and RIPPER (Repeated Incremental Pruning to Produce Error Reduction) (Cohen, 1995). The learning algorithms were chosen with the intent of being diverse from one another, where diversity is determined using unsupervised meta-learning (Lee and Giraud-Carrier, 2011). 12 M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION TABLE 2. Results of classification tests at a sparsity level of 0.1., (meaning 10% of data values were removed and then imputed prior to classification). The 3 upper numbers in each cell indicate the wins, ties, and losses for UBP in a pair-wise comparison. The lower number in each cell indicates the Wilcoxon signed ranks √ test P-value evaluated over the 24 datasets. (When the value is smaller than 0.05, indicated with a “ ” symbol, the performance of UBP was better with statistical significance.) BL FKM IBI MF NLPCA BP 16,1,7√ 0.013 14,0,10 √ 0.080 12,0,12 0.835 9,0,15 0.874 6,7,11 0.915 C4.5 16,0,8√ 0.039 18,0,6√ 0.011 12,0,12 0.727 14,1,9 0.219 9,7,8 0.715 IB5 17,1,6√ 0.011 17,0,7√ 0.005 15,0,9√ 0.039 11,0,13 0.616 9,8,7 0.688 LWL 16,2,6√ 0.015 12,5,7 0.134 7,4,13 0.731 9,2,13 0.652 7,9,8 0.601 NB 12,0,12 0.374 13,0,11 0.302 12,0,12 0.594 13,2,9 0.487 9,7,8 0.538 N NGE 17,1,6√ 0.001 19,1,4√ 0.000 17,1,6 0.121 16,0,8 0.109 10,7,7 0.353 R AND F 17,0,7√ 0.003 16,1,7√ 0.006 14,0,10 0.151 16,0,8 0.054 8,8,8 0.572 R IDOR 20,0,4√ 0.000 20,1,3√ 0.000 12,0,12 0.254 15,0,9 0.220 6,8,10 0.757 RIPPER 16,1,7√ 0.009 12,1,11 0.134 12,0,12 0.517 15,0,9 0.057 10,7,7 0.388 We evaluated each learning algorithm at each of the previously mentioned sparsity levels using each imputation algorithm with the parameters that resulted in the lowest SSE error score for imputation. The results from this experiment are summarized for each of the 5 sparsity levels in Tables 2 through 6. Each cell in these tables summarizes a set of experiments with an imputation algorithm and classification algorithm pair. The three upper numbers in each cell indicate the number of times that UBP lead to higher, equal, and lower classification accuracy. When the left-most of these three numbers is biggest, this indicates that classification accuracy was higher in more cases when UBP was used as the imputation algorithm. The lower number in each cell indicates the P-value obtained from the Wilcoxon signed ranks test by performing a pair-wise comparison between UBP and the imputation algorithm of that column. When this value is below 0.05, UBP did better in a sufficient number of pair-wise comparisons √ to demonstrate that it is better with statistical significance. These cases are indicated with a “ ” symbol. Some classification algorithms were more responsive to the improved imputation accuracy that UBP offered than others. For example, UBP appears to have a more beneficial effect on classification results when used with Random Forest than with naı̈ve Bayes. Overall, UBP was demonstrated to be more beneficial as an imputation algorithm than any of the other imputation algorithms. As expected, NLPCA was the closest competitor. UBP did better than NLPCA in a larger number of cases, but we were not able to demonstrate that it was M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION TABLE 3. 13 Results of classification tests at a sparsity level of 0.3. BL FKM IBI MF NLPCA BP 18,0,6√ 0.008 18,0,6√ 0.002 15,0,9√ 0.048 12,0,12 0.550 6,10,8 0.884 C4.5 15,0,9√ 0.024 15,1,8√ 0.017 15,0,9√ 0.025 13,0,11 0.461 7,10,7 0.735 IB5 16,0,8√ 0.016 18,0,6√ 0.004 10,0,14 0.539 10,0,14 0.658 4,10,10 0.970 LWL 17,1,6√ 0.005 16,2,6√ 0.008 15,2,7 0.109 12,2,10 0.218 7,12,5 0.484 NB 11,0,13 0.689 13,0,11 0.342 12,0,12 0.374 13,0,11 0.561 9,10,5 0.226 N NGE 14,0,10 0.132 16,0,8√ 0.020 15,0,9 0.138 14,0,10 0.245 7,10,7 0.774 R AND F 14,0,10 0.132 17,0,7√ 0.021 15,0,9 0.084 13,1,10 0.083 6,10,8 0.842 R IDOR 16,1,7√ 0.004 17,1,6√ 0.001 16,0,8√ 0.018 10,0,14 0.583 4,10,10 0.942 RIPPER 14,0,10 0.051 16,0,8√ 0.042 17,0,7√ 0.026 9,0,15 0.868 7,10,7 0.500 better with statistical significance until sparsity level 0.7. It appears from these results that the improvements of UBP over NLPCA generally have a bigger impact when there are more missing values in the data. This is significant because the difficulty of effective imputation increases with the sparsity of the data. To demonstrate the difference between UBP and NLPCA (and, hence, the advantage of 3-phase training), we briefly examine UBP as a manifold learning (or non-linear dimensionality reduction) technique. We trained both NLPCA and UBP using data from the MNIST dataset of handwritten digits. We used a multilayer perceptron with a 4 → 8 → 256 → 1 topology. 2 of the 4 inputs were treated as latent values, and the other 2 inputs we used to specify (x, y) coordinates in each image. The one output was trained to predict the grayscale pixel value at the specified coordinates. We trained a separate network for each of the 10 digits in the dataset. After training these multilayer perceptrons in this manner, we uniformly sampled the two-dimensional latent inputs in order to visualize how each multilayer perceptron organized the digits that it had learned. Matrix factorization was not suitable for this application because it is linear, so it would predict only a linear gradient instead of an image. The other imputation algorithms are not suitable for this task because they are not designed to be used in a generative manner. Figure 4 shows a sample of ’4’s generated by NLPCA and UBP. (Note that the images shown are not part of the original training data. Rather, each was generated by the multilayer perceptron after it was trained. Because the multilayer perceptron is a continuous function, these digits could be generated with arbitrary resolution, independent of the original training data.) 14 M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION TABLE 4. Results of classification tests at a sparsity level of 0.5. BL FKM IBI MF NLPCA BP 13,1,10 0.055 14,1,9√ 0.033 20,1,3√ 0.002 14,0,10 0.195 6,11,7 0.472 C4.5 14,0,10 0.245 14,0,10 0.076 14,0,10 0.080 15,0,9 0.115 9,11,4 0.104 IB5 15,0,9√ 0.015 17,0,7√ 0.001 16,1,7√ 0.002 13,1,10 0.093 8,11,5 0.338 LWL 14,1,9√ 0.016 14,2,8√ 0.009 13,2,9 0.077 14,1,9 0.193 4,13,7 0.825 NB 13,0,11 0.302 13,0,11 0.322 12,1,11 0.458 15,0,9 0.363 8,11,5 0.132 N NGE 13,0,11 0.245 15,0,9√ 0.048 18,0,6√ 0.021 15,0,9 0.084 7,11,6 0.338 R AND F 14,0,10 0.109 17,0,7√ 0.015 19,0,5√ 0.002 14,1,9 0.202 7,10,7 0.401 R IDOR 15,1,8√ 0.022 16,0,8√ 0.005 19,0,5√ 0.000 13,0,11 0.395 6,11,7 0.758 RIPPER 15,0,9√ 0.030 16,0,8√ 0.028 19,0,5√ 0.001 14,0,10 0.384 7,11,6 0.338 Both algorithms did approximately equally well at generating digits that appear natural over a range of styles. The primary difference between these results is how they ultimately formed order in the intrinsic values that represent the various styles. In the case of UBP, somewhat better intrinsic organization is formed. Three distinct styles can be observed in three horizontal stripes in Figure 4b: boxey digits in the top two rows, slanted digits in the middle rows, and digits with a closed top in the bottom two rows. The height of the horizontal bar in the digit varies clearly from left-to-right. Along the left, the horizontal bar crosses at a low point, and along the right, the horizontal bar crosses at a high point. In the case of NLPCA, similar styles were organized into clusters, but they do not exhibit the same degree of organization that is apparent with UBP. For example, it does not appear to be able to vary the height of the horizontal bar in each of the three main styles of this digit. This occurs because NLPCA does not have an extra step designed explicitly to promote organization in the intrinsic values. This demonstration also serves to show that techniques for imputation and techniques for manifold learning are merging. In the case of these handwritten digits, the multilayer perceptron was flexible enough to generate visibly appealing digits, even when the intrinsic organization was poor. However, better generalization can be expected when the mapping is simplest, which occurs when the intrinsic values are better organized. Hence, as imputation and manifold learning are applied to increasingly complex problems, the importance of finding good organization in the intrinsic values will increase. Future work in this area will explore other techniques for promoting organization within the intrinsic values, and contrast them with the simple approach proposed by UBP. M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION TABLE 5. 15 Results of classification tests at a sparsity level of 0.7. BL FKM IBI MF NLPCA BP 13,0,11 0.264 17,0,7√ 0.008 17,1,6√ 0.001 16,0,8 0.051 8,14,2 √ 0.026 C4.5 9,0,15 0.763 9,2,13 0.474 16,0,8√ 0.064 13,0,11 0.332 5,14,5 0.658 IB5 14,0,10 0.165 17,0,7√ 0.005 15,0,9√ 0.032 17,0,7√ 0.008 8,14,2 √ 0.042 LWL 14,1,9√ 0.013 16,1,7√ 0.002 18,2,4√ 0.000 14,1,9 0.121 6,16,2 0.147 NB 16,0,8 0.104 15,0,9 0.203 14,0,10 0.539 12,0,12 0.506 6,14,4 0.305 N NGE 12,1,11 0.169 15,0,9√ 0.011 14,0,10 √ 0.068 14,0,10 √ 0.018 8,14,2 √ 0.010 R AND F 16,0,8√ 0.017 18,0,6√ 0.001 18,0,6√ 0.001 19,0,5√ 0.002 10,12,2 √ 0.003 R IDOR 13,1,10 0.052 16,0,8√ 0.017 19,0,5√ 0.000 16,0,8√ 0.042 4,15,5 0.453 RIPPER 13,0,11 0.211 15,0,9 0.060 18,0,6√ 0.015 14,0,10 0.195 8,15,1 √ 0.038 to generate high-quality digits, UBP was able to organize the various styles more effectively. Note that the height of the horizontal bar varies from left-to-right. The results from NLPCA do not provide the ability to vary the height of this bar in each of the possible styles of the digit. 5. CONCLUSIONS Since the NetFlix competition, matrix factorization and related linear techniques have generally been considered to be the state-of-the-art in imputation. Unfortunately, the focus on imputing with a few large datasets has caused the community to largely overlook the value of nonlinear imputation techniques. One of the contributions of this paper is the observation that Nonlinear PCA, which was presented almost a decade ago, consistently outperforms matrix factorization across a diversity of datasets. Perhaps this has not yet been recognized because a thorough comparison between the two techniques across a diversity of datasets was not previously performed. The primary contribution of this paper, however, is an improvement to Nonlinear PCA, which improves its accuracy even more. This contribution consists of a 3-phase training process that initializes both weights and intrinsic vectors to better starting positions. We theorize that this leads to better results because it bypasses many local optima in which the network could otherwise settle, and places it closer to the global optimum. We empirically compared results from UBP with 5 other imputation techniques, including baseline, fuzzy k-means, instance-based imputation, matrix factorization, and Nonlinear 16 M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION TABLE 6. Results of classification tests at a sparsity level of 0.9. BL FKM IBI MF NLPCA BP 12,0,12 0.658 14,0,10 0.180 16,3,5√ 0.033 16,0,8 0.057 8,10,6 0.265 C4.5 8,0,16 0.936 10,0,14 0.689 13,0,11 0.282 15,0,9 0.151 6,10,8 0.827 IB5 10,0,14 0.880 11,0,13 0.637 11,0,13 0.658 17,0,7√ 0.032 5,11,8 0.712 LWL 12,1,11 0.458 14,1,9 0.070 15,1,8 0.140 14,1,9 0.109 4,10,10 0.949 NB 21,0,3√ 0.000 18,0,6√ 0.001 14,0,10 0.172 13,0,11 0.228 10,10,4 √ 0.012 N NGE 14,0,10 0.180 17,0,7√ 0.004 14,0,10 √ 0.010 18,0,6√ 0.008 8,10,6 0.265 R AND F 12,0,12 0.439 15,0,9 0.145 17,0,7√ 0.008 20,0,4√ 0.001 10,10,4 0.074 R IDOR 7,0,17 0.880 14,0,10 0.187 15,0,9 0.084 20,0,4√ 0.002 7,10,7 0.599 RIPPER 10,1,13 0.811 12,0,12 0.363 18,0,6√ 0.004 19,0,5√ 0.010 7,10,7 0.450 PCA, with 24 datasets across a range of parameters for each algorithm. UBP predicts missing values with lower error than any of these other methods in the majority of cases. We also demonstrated that using UBP to impute missing values leads to better classification accuracy than any of the other imputation techniques over all, especially at higher levels of sparsity, which is the most important case for imputation. We demonstrated that UBP is also bettersuited for manifold learning than NLPCA with a problem involving handwritten digits. Ongoing research seeks to demonstrate that better organization in the intrinsic variables naturally leads to better generalization. This has significant potential application in unsupervised learning tasks such as automation. REFERENCES ACU ÑA , E DGAR, and C AROLINE RODRIGUEZ. 2004. The treatment of missing values and its effect on classifier accuracy. In Classification, Clustering, and Data Mining Applications. Springer Berlin / Heidelberg, pp. 639–647. A DOMAVICIUS , G., and A. T UZHILIN. 2005. Toward the next generation of recommender systems: A survey of the state-of-the-art and possible extensions. IEEE transactions on knowledge and data engineering, 17(6):734–749. ISSN 1041-4347. A LIREZA FARHANGFAR , L UKASZ K URGAN J ENNIFER DY. 2008. Impact of imputation of missing values on classification error for discrete data. Pattern Recognition, 41:3692–3705. ATKESON , C HRISTOPHER G., A NDREW W. M OORE, and S TEFAN S CHAAL. 1997. Locally weighted learning. Artificial Intelligence Review, 11:11–73. ISSN 0269-2821. B ENGIO , YOSHUA, PASCAL L AMBLIN, DAN P OPOVICI, and H UGO L AROCHELLE. 2007. Greedy layer-wise M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION 17 F IGURE 3. An MLP trained with NLPCA (a) and UBP(b) on digits from the MNIST dataset a b of handwritten digits. After training, the digits shown here were generated by uniformly sampling over the space of intrinsic values, and generating an image at each sampled intrinsic point.Although both NLPCA and UBP were able to generate high-quality digits, UBP was able to organize the various styles more effectively. Note that the height of the horizontal bar varies from left-to-right. The results from NLPCA do not provide the ability to vary the height of this bar in each of the possible styles of the digit. training of deep networks. In NIPS, pp. 153–160. B ENGIO , Y., H. S CHWENK, J.S. S EN ÉCAL, F. M ORIN, and J.L. G AUVAIN. 2006. Neural probabilistic language models. In Innovations in Machine Learning. Springer, pp. 137–186. B REIMAN , L. 2001. Random forests. Machine Learning, 45(1):5–32. C OHEH , D., and J. S HAWE -TAYLOR. 1990. Daugman’s gabor transform as a simple generative back propagation network. Electronics Letters, 26(16):1241–1243. C OHEN , W ILLIAM W. 1995. Fast effective rule induction. In In Proceedings of the Twelfth International Conference on Machine Learning, Morgan Kaufmann, pp. 115–123. E RHAN , D UMITRU, P IERRE -A NTOINE M ANZAGOL, YOSHUA B ENGIO, S AMY B ENGIO, and PASCAL V IN CENT . 2009. The difficulty of training deep architectures and the effect of unsupervised pre-training. Journal of Machine Learning Research - Proceedings Track, 5:153–160. F RANK , A., and A. A SUNCION. 2010. UCI machine learning repository. http://archive.ics.uci. edu/ml. G AINES , B RIAN R., and PAUL C OMPTON. 1995. Induction of ripple-down rules applied to modeling large databases. Journal of Intelligent Information Systems, 5:211–228. ISSN 0925-9902. G ASHLER , M ICHAEL, DAN V ENTURA, and T ONY M ARTINEZ. 2008. Iterative non-linear dimensionality reduction with manifold sculpting. In Advances in Neural Information Processing Systems 20. MIT Press, pp. 513–520. G ASHLER , M ICHAEL S. 2011. Waffles: A machine learning toolkit. Journal of Machine Learning Research, MLOSS 12:2383–2387. H INTON , G. E. 1988. Generative back-propagation. In Abstracts 1st INNS. H INTON , G. E., and R. R. S ALAKHUTDINOV. 2006. Reducing the dimensionality of data with neural networks. Science, 28(313 (5786)):504–507. J ONES , M ICHAEL P. 1996. Indicator and stratificaion methods for missing explanatory variables in multiple linear regression. Journal of the American Statistical Association, 91:222–230. KOREN , Y., R. B ELL, and C. VOLINSKY. 2009. Matrix factorization techniques for recommender systems. Computer, 42(8):30–37. ISSN 0018-9162. L AKSHMINARAYAN , K., S.A. H ARP, R. G OLDMAN, T. S AMAD, and OTHERS. 1996. Imputation of missing data using machine learning techniques. In Proceedings of the Second International Conference on 18 M ISSING VALUE I MPUTATION W ITH U NSUPERVISED BACKPROPAGATION Knowledge Discovery and Data Mining, pp. 140–145. L EE , J UN, and C HRISTOPHE G IRAUD -C ARRIER. 2011. A metric for unsupervised metalearning. Intelligent Data Analysis, 15(6):827–841. L I , DAN, J ITENDER D EOGUN, W ILLIAM S PAULDING, and B ILL S HUART. 2004. Towards missing data imputation: A study of fuzzy k-means clustering method. In Rough Sets and Current Trends in Computing, Volume 3066 of Lecture Notes in Computer Science. Springer Berlin / Heidelberg, pp. 573–579. L I , Q., Y.P. C HEN, and Z. L IN. 2008. Filtering Techniques For Selection of Contents and Products. In Personalization of Interactive Multimedia Services: A Research and development Perspective, Nova Science Publishers. ISBN 978-1-60456-680-2. L ITTLE , R.J.A., and D.B. RUBIN. 2002. Statistical analysis with missing data. Wiley series in probability and mathematical statistics. Probability and mathematical statistics. Wiley. ISBN 9780471183860. L UENGO , J. 2011. Soft Computing based learning and Data Analysis: Missing Values and Data Complexity. Ph. D. thesis, Department of Computer Science and Artificial Intelligence, University of Granada. M ARTIN , B RENT. 1995. Instance-based learning: nearest neighbour with generalisation. Technical Report 95/18, University of Waikato, Department of Computer Science. Q UINLAN , J. R. 1989. Unknown attribute values in induction. In Proceedings of the sixth international workshop on Machine learning, pp. 164–168. Q UINLAN , J. ROSS. 1993. C4.5: Programs for Machine Learning. Morgan Kaufmann, San Mateo, CA, USA. RUBIN , D. B. 1987. Multiple Imputation for Nonresponse in Surveys. Wiley. RUMELHART, D.E., G.E. H INTON, and R.J. W ILLIAMS. 1986. Learning representations by back-propagating errors. Nature, 323:9. S ARWAR , B., G. K ARYPIS, J. KONSTAN, and J. R EIDL. 2001. Item-based collaborative filtering recommendation algorithms. In Proceedings of the 10th international conference on World Wide Web, ACM. ISBN 1581133480. pp. 285–295. S AYYAD S HIRABAD , J., and T.J. M ENZIES. 2005. The PROMISE Repository of Software Engineering Databases. School of Information Technology and Engineering, University of Ottawa, Canada. http: //promise.site.uottawa.ca/SERepository. S CHAFER , J.L., and J.W. G RAHAM. 2002. Missing data: Our view of the state of the art. Psychological methods, 7(2):147. ISSN 1939-1463. S CHOLZ , M., F. K APLAN, C. L. G UY, J. KOPKA, and J. S ELBIG. 2005. Non-linear pca: a missing data approach. Bioinformatics, 21(20):3887–3895. S HAFER , J. L. 1997. Analysis of Incomplete Multivariate Data. Chapman and Hall, London. TAK ÁCS , G., I. P IL ÁSZY, B. N ÉMETH, and D. T IKK. 2009. Scalable collaborative filtering approaches for large recommender systems. The Journal of Machine Learning Research, 10:623–656. T ENENBAUM , J OSHUA B., V IN DE S ILVA, and J OHN C. L ANGFORD. 2000. A global geometric framework for nonlinear dimensionality reduction. Science, 290:2319–2323. W ERBOS , P.J. 1990. Backpropagation through time: What it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560. ISSN 0018-9219. W ITTEN , I AN H., and E IBE F RANK. 2005. Data Mining: Practical machine learning tools and techniques (2nd ed.). Morgan Kaufmann, San Fransisco. Z HANG , Z., and J. WANG. 2007. MLLE: Modified locally linear embedding using multiple weights. Advances in Neural Information Processing Systems, 19:1593. ISSN 1049-5258.
9cs.NE
Submitted to the Annals of Statistics arXiv:1711.02123v1 [math.ST] 6 Nov 2017 CONSISTENCY OF MAXIMUM LIKELIHOOD FOR CONTINUOUS-SPACE NETWORK MODELS By Cosma Rohilla Shalizi and Dena Asta Network analysis needs tools to infer distributions over graphs of arbitrary size from a single graph. Assuming the distribution is generated by a continuous latent space model which obeys certain natural symmetry and smoothness properties, we establish three levels of consistency for non-parametric maximum likelihood inference as the number of nodes grows: (i) the estimated locations of all nodes converge in probability on their true locations; (ii) the distribution over locations in the latent space converges on the true distribution; and (iii) the distribution over graphs of arbitrary size converges. 1. Introduction. The statistical analysis of network data, like other sorts of statistical analysis, models the data we observe as the outcome of stochastic processes, and rests on inferring aspects of those processes from their results. It is essential that the methods of inference be consistent, that as they get more and more information, they should come closer and closer to the truth. In this paper, we address the consistency of non-parametric maximum likelihood estimation for a popular class of network models, those based on continuous latent spaces. In these models, every node in the network corresponds to a point in a latent, continuous metric space, and the probability of an edge or tie between two nodes is a decreasing function of the distance between their points in the latent space. These models are popular because they are easily interpreted in very plausible ways, and often provide good fits to data. Moreover, they have extremely convenient mathematical and statistical properties: they lead to exchangeable, projectively-consistent distributions over graphs; the comparison of two networks reduces to comparing two clouds of points in the latent space, or even to comparing two densities therein; it is easy to simulating new networks from the estimated model for purposes of bootstrapping, etc. While the latent space has typically been taken to be a low-dimensional Euclidean space (Hoff, Raftery and Handcock, 2002), recent work has suggested that in many applications it would be better to take the space to non-Euclidean, specifically negatively curved or hyperbolic (Krioukov et al., 2010; Asta and Shalizi, 2015). We provide three levels of consistency for all continuous latent space models which obey certain natural symmetry and smoothness assumptions, including standard Euclidean and hyperbolic models. The first level is the 1 2 SHALIZI AND ASTA consistency of embedding: given an observed graph, we wish to work backwards the locations of the nodes in the latent space, i.e., to “embed” the graph in the latent space. We prove that nonparametric maximum likelihood embedding is consistent, i.e., that the sum of distances between real and estimated locations tends to zero in probability [Theorem 7]. The second level is that if the node locations are drawn IIDly from a fixed but unknown distribution on the latent space, that distribution can be recovered by applying suitable nonparametric density estimators (Asta, 2015) to the locations obtained by embedding [Corollary 8]. The third level is that the distribution over new graphs produce by simulating from a model estimated in this way converges in probability on the true generating distribution [Corollary 9]. Section §2 reviews background on continuous latent space models of networks. Section §3 states our main results, along with certain technical assumptions. All proofs, and a number of subsidiary results and lemmas, are deferred to Section §4. 2. Background. In typical network data-analysis situations, we have only one network — perhaps not even all of that one network — from which we nonetheless want to draw inferences about the whole data-generating process. This clearly will require a law of large numbers or ergodic theorem to ensure that a single large sample is representative of the whole process. The network, however, is a single high-dimensional object where every part is dependent on every other part. This is also true of time-series and spatial data, but there we can often use the fact that distant parts of the data should be nearly independent of each other. General networks lack a natural, exogenous sense of distance for such decay of dependence. Continuous latent space (CLS) models are precisely generative models for networks which exhibit just such an exogenous sense of distance. Each node is represented as a location in a continuous metric space, the latent space. Conditional on the vector of all node locations, the probability of an edge between two nodes is a decreasing function of the distance between their locations, and all edges are independent. As mentioned above, the best-known CLS model for social networks is that of Hoff, Raftery and Handcock (2002), where the metric space is taken to be Euclidean, and node locations are assumed to be drawn iidly from a Gaussian distribution. In random geometric graphs (Penrose, 2003), the locations are drawn iidly from a distribution on a metric space possibly more general than Euclidean space and the probabilities of connecting edges are either 0 or 1 based on a threshold. As also mentioned above, there is more recent work which indicates that CONSISTENCY FOR CONTINUOUS NETWORK MODELS 3 for some applications it would be better to let the latent space be negatively curved, i.e. hyperbolic (Albert, DasGupta and Mobasheri, 2014; Kennedy, Narayan and Saniee, 2013; Krioukov et al., 2010). Mathematically, this is because many real networks can be naturally embedded into such spaces. More substantively, many real-world networks show highly skewed degree distributions, very short path lengths, a division into a core and peripheries where short paths between peripheral nodes “bend back” towards the core, and a hierarchical organization of clustering. Thus if the latent space is chosen to be a certain hyperboloid, one naturally obtains graphs exhibiting all these properties (Krioukov et al., 2010). The CLS models we have mentioned so far have presumed that node locations follow tractable, parametric families in the latent space. This is mathematically inessential — many of the results carry over perfectly well to arbitrary densities — and scientifically unmotivated. Because CLS models may need very different spaces depending on applications, we investigate consistency of nonparametric estimation for them at a level of generality which abstracts away from many of the details of particular spaces and their metrics. We therefore investigate three levels of estimation. The first and essential one is that of estimating the nodes’ locations when we have observed the graph. This is the problem of embedding the graph into the latent space. We show that the maximum likelihood embedding converges in probability on the true locations, up to a global isometry. Here the crucial quantity controlling the rate of convergence turns out to be the richness of the latent space’s group of isometries, i.e., the complexity of its geometry. The second level is that of estimating a distribution over the latent space from the cloud of embedded points. Here the key issue is whether the space has enough symmetry to allow for the definition of a generalization of the Fourier transform, and with it of convolution and so of generalized kernel density estimates, which are minimax-optimal. (We defer details to Asta (2015).) We show that when the generalized KDE is well-defined, applying it to the maximum-likelihood embedding consistently estimates the distribution from which nodes are drawn. The third level is that of distributions over graphs, i.e., does the distribution over new graphs implied by our estimated node density converge on the true data-generating process? Here again the answer is in the affirmative. This in turn opens the way to model-based bootstraps for assessing uncertainty, and to two-sample tests for checking whether networks obtained under different conditions could have come from the same probabilistic source (Asta and Shalizi, 2015). 4 SHALIZI AND ASTA To the best of our knowledge, there are no results in the existing literature on the consistency of embedding for CLS models, much less for estimation of nodes densities or the distribution over graphs. 3. Geometric Network Inference. Our goal is to show that when the continuous latent space model is sufficiently smooth, and the geometry of the latent space is itself sufficiently symmetric, then the maximum-likelihood embedding of a graph consistently estimates the true locations of the nodes (Theorem 7). This will allow us to consistently estimate the density of nodes (Corollary 8) and the distribution over graphs (Corollary 9) from a single observed graph. All proofs are postponed to §4. 3.1. Setting and Conventions. All the metrics of metric spaces will be denoted by dist; context will make clear which metric dist is describing. Our model for generating random graphs begins with a metric measure space M , a metric space equipped with a Borel measure, and the corresponding group isom(M ) of measure-preserving isometries M ∼ = M . Every node is located at (equivalently, “represented by” or “labeled with”) a point in M , xi for the ith node; the location of the first n nodes is x1:n ∈ M n , and a countable sequence of locations will be x1:∞ . For each n, there is a non-increasing link function wn : [0, ∞) 7→ [0, 1], and nodes i and j are joined by an edge with probability wn (dist (xi , xj )). By a latent space (M, w1:∞ ), we will mean the combination of M and a sequence w1:∞ of link functions. When the latent space is understood, we write graphn (x1:n ) for the distribution of a random graph on n vertices located at x1:n . It is clear that for any φ ∈ isom(M ), we have for every n, (1) d graphn (x1:n ) = graphn (φ(x1:n )) Accordingly, we will use [x1:n ] to indicate the equivalence class of n-tuples in M n carried by isometries to x1:n ; the metric on M extends to these isometry classes in the natural way, (2) dist ([x1:n ] , [y1:n ]) = inf φ∈isom(M ) n X dist (xi , φ(yi )) . i=1 We cannot hope to identify x1:n by observing the graph it leads to, but we can hope to estimate [x1:n ]. CONSISTENCY FOR CONTINUOUS NETWORK MODELS 5 If we introduce a density f on M , we can make the node locations themselves random, with Xi drawn independently 1 from f . Edges between the first n nodes are then conditionally independent given X1:n . A random graph G having n nodes is thus defined by the hierarchical procedure Xi ∼iid f (3) (4) G|X1:n ∼ graphn (X1:n ) Which is to say, nodes are connected as before, but now node locations are random. Edges are conditionally independent given these random locations. The corresponding continuous latent space model (CLS model) will be written (M, f, w1:∞ ). When the latent space is understood, we write graphn (f ) for the distribution of G above. Again, d graphn (f ) = graphn (f ◦ φ) , (5) so the node density f can only be identified up to a global isometry. Accordingly, we will use [f ] to indicate the equivalence class of densities g on M , such that g = f ◦ φ for some φ ∈ isom(M ) We cannot hope to estimate a density f by observing the graphs it generates, but we can hope to estimate [f ]. We will carefully distinguish, below, between results which hold with fixed, or conditioned-on, node locations, and those which presume IID node locations. Conventions. When n and m are integers, n < m, n : m will be the set {n, n + 1, . . . m − 1, m}. Unless otherwise specified, all limits will be taken as n → ∞. All probabilities and expectations will be taken with respect to the actual generating distribution of G. 3.2. Axioms on the generative model. Definition 1. A metric space M is rigid when 1. For each n and x1:n , y1:n ∈ M n , [x1:n ] = [y1:n ] whenever (6) dist (xp , xq ) = dist (yp , yq ) p, q ∈ 1 : n 2. isom(M ) has a finite number BM of connected components. 1 A closely related alternative is to distribute the Xi according to a point process, rather than drawing from a density. Drawing from a density leads to dense graph sequences; point processes can lead to sparse graphs sequences. 6 SHALIZI AND ASTA By extension, the CLS model (M, f, w1:∞ ) is also rigid when M is rigid. The metric spaces Rd and H2 are rigid, with Proposition 2. BH2 = BRd = 2. The particular manner in which we define w1:∞ determines how the random graph sequence changes. Definition 3. A sequence of link functions w1:∞ is logit-bounded with bounds vn when for all n and x, y ∈ M , (7) −vn 6 log wn (dist (x, y)) = logit wn (dist (x, y)) 6 vn . 1 − wn (dist (x, y)) and n/vn → ∞ as n → ∞. Two remarks are in order. First, demanding that vn = o(n), rather than just finite, is done with an eye towards the needs of the proofs in §4. Second, if the range of wn is the same proper sub-interval of (0, 1) for all n, then w1:∞ is logit-bounded, but the converse is not true. Identifiability of graph distributions determined by certain CLS models is possible. We define such CLS models below. Definition 4. A latent space (M, w1:∞ ) is regular when: 1. M is a complete rigid Riemannian manifold; and 2. The function wn is injective and smooth for each n; and 3. The sequence w1:∞ is logit-bounded. By extension, CLS models are regular when (M, w1:∞ ) are. Theorem 5. (8) For regular CLS model d graphn (x1:n ) = graphn (y1:n ) ⇐⇒ [x1:n ] = [y1:n ] n = 1, 2, . . . Theorem 5 lets us identify graph distributions of the form graphn (x1:n ) with isometry classes [x1:n ]. We can therefore define distances between such distributions by the distance between the isometry classes (2). Theorem 6. (9) For regular CLS models (M, f, w1:∞ ) and (M, g, w1:∞ ), d graphn (f ) = graphn (g) ⇐⇒ [f ] = [g] n = 1, 2, . . . CONSISTENCY FOR CONTINUOUS NETWORK MODELS 7 The theorem allows us to identify sequences of distributions of random graphs determined by regular CLS models (M, f, w1:∞ ) with isometry classes [f ] of densities f on M . We can define distances between such sequences by (10) dist ([f ] , [g]) = inf φ∈isom(M ) kf − g ◦ φk2 . 3.3. An example in the literature. Latent spaces of the form (H2 , wn ). where H2 = {z ∈ C | Im(z) > 0} is the Poincaré halfplane with metric dz = y −2 dx dy were introduced (Krioukov et al., 2010) to model networks in nature with tree-like characteristics (e.g. the internet). The wn ’s considered can take one of the two following forms: ( 1 t 6 ln n 1 wn (t) = wn (t) = λ(t−ln n) 1+e 0 t > ln n With this latter choice of link functions, the latent space is regular. A variant of CLS models are then defined so that the node densities vary according to the number of nodes. Our notion of CLS models and hence our main results do not apply to such generative models, although we hope to address such density-varying models in future work. 3.4. Estimators. Given a latent space model (M, w1:∞ ) and an n-node graph G, we define the log-likelihood of the location x1:n ∈ M n by: X X (11) ℓ(x1:n ; G) = log wn (dist (xp , xq )) + log(1 − wn (dist (xp , xq ))) (p,q)∈G (p,q)6∈G As usual, when there is no ambiguity about the graph G providing the data, we will suppress that as an argument, writing ℓ(x1:n ). A maximum likelihood (ML) embedding of an n-node graph G into M is (12) x̂1:n = argmax ℓ(x1:n ; G) x1:n ∈M n The point x̂i ∈ M is, naturally, the estimated location in M of vertex i. The MLE is consistent in the following sense: 8 SHALIZI AND ASTA Theorem 7. Fix a x∗1:∞ ∈ M ∞ and w1:∞ , where the latent space (M, w1:∞ ) is regular. Suppose that for each n, Gn ∼ graphn (x1:n ). Then h (13) i P X̂1:n → [x∗1:n ] . The theorem, as stated, presumes the model is well-specified; the maximum likelihood embedding can be shown to converge for a broader class of random graphs where the model is mis-specified; details are given in the Appendix. We can combine a consistent density estimator with an ML embedding to obtain a consistent node density estimator. An example of a consistent density estimator is a kernel density estimator on Rd , or suitable generalizations (Asta, 2015). We say that a density estimator is continuous if the density it outputs is continuous on the data points it is given as input (with respect to L2 -distances between estimated densities and distances in M n , respectively.) Corollary 8. Suppose that for each n, the graph Gn is drawn from a regular CLS model, Gn ∼ graphn (f ), and that fˆ is a consistent, continuous density estimator on M . Then h i P (14) fˆ → [f ] . X̂1:n h i P Here fˆX̂1:n → [f ] means that for each ǫ > 0, (15) Corollary 9. (16)  h i   n→∞ P r dist fˆX̂1:n , [f ] > ǫ −−−→ 0. Under the assumptions of Corollary 8, P graphm (fˆX̂1:n ) → graphm (f ) m = 1, 2, . . . 4. Proofs. fThis section furnishes proofs of main results about networks, such as observations about the generative model and its assumptions (Proposition 2 and Theorem 6) and the consistency of the graph embeddings (Theorem 7). The consistency of the node density estimator (Corollary 8) and of the estimated graph distribution (Corollary 9) follow easily. Since everything turns on the consistency of maximum likelihood embedding, and the argument is somewhat intricate, it is worth sketching the approach. We show that the expected log-likelihood achives its maximum CONSISTENCY FOR CONTINUOUS NETWORK MODELS 9 precisely at the true coordinates up to isometry (Lemma 13). We then show that (in large graphs) the log-likelihood ℓ(x1:n ) is, with arbitrarily high probability, arbitrarily close to its expectation value for each x1:n (Lemmas 14 and 15). We then extend that to a uniform convergence in probability, over all of M n (Theorem 16). To do so, we need to bound the richness (pseudodimension) of the family of log-likelihood functions (Theorem 12), which involves the complexity of the latent space’s geometry, specifically of its isometry group isom(M ). Having done this, we have shown that the MLE also has close to the maximum expected log-likelihood. 4.1. Notation. Before we dive into details, we first fix some additional notation for our proofs. We will use G for both a (random or deterministic) graph and its adjacency matrix. We assume that for each random graph G considered in this paper, there exists some random quantity µ such that the edges of G are conditionally inependent given µ. For the case where G is drawn from a CLS model, µ can be taken to be the random latent coordinates of the nodes of G. We fix the latent space as (M, w1:∞ ). For brevity, define (17) λn (xp , xq ) = logit wn (dist (xp , xq )) . As usual with binary observations, we can write the log-likelihood function for coordinates given a graph G of n nodes as (18) n X X 1 log (1 − wn (dist (xp , xq ))) + Gpq λn (xp , xq ). ℓ(x1:n ; G) = n(n − 1) p=1 q6=p This brings out that the only data-dependent (and hence random) part of ℓ is linear in the entries of the adjacency matrix, and in the logit transform of the link-probability function. We write the class of log-likelihood functions as Ln . Taking expectations with respect to the actual graph distribution of a random graph G having n nodes, we define the expected log-likelihood (the cross-entropy; Cover and Thomas 2006, ch. 2) by ℓ(x1:n ) = E [ℓ(x1:n ; G)] . (19) ∗ (a) = P r (G = a | µ), Setting πpq (a) = P r (Gpq = a | Xp , Xq ) and πpq pq ℓ(x1:n ) = n X X X 1 ∗ πpq (a) log πpq (a). n(n − 1) p=1 q6=p a∈{0,1} 10 SHALIZI AND ASTA From information theory (Cover and Thomas, 2006, ch. 2), observe X ∗ ∗ ∗ − πpq (a) log πpq (a) = H[πpq ] + D(πpq kπpq ), a∈{0,1} as the left side is the cross-entropy of the distribution πpq with respect to ∗ and the right side is the sum of ordinary entropy H with the distribution πpq the Kullback-Leibler divergence D. Since both entropy and KL divergence are additive over independent random variables (Cover and Thomas, 2006, ch. 2) like Gpq , we have2 , defining H[π ∗ ] and D(π ∗ kπ) in the obvious ways, (20) −ℓ(x1:n ) = H[π ∗ ] + D(π ∗ kπ) 4.2. Generative-Model Properties. We first show that Euclidean space and the hyperboloid are rigid. proof of Proposition 2. We consider first the case M = H2 . We wish to show that for all n, if two ordered sets of n points x1:n and y1:n have the same inter-point distances, then there is a isometry φ ∈ isom(H2 ) taking xi to yi for each i ∈ 1 : n. This is trivially true when n = 1. It is also easily seen to be true when n = 2, because there is always an isometry φ1 taking x1 to the origin (in the Poincaré disk representation of H2 ), and a second isometry φ2 doing the same to y1 . Since φ1 (x2 ) and φ2 (y2 ) are points equidistant from the origin, there is a third isometry φ3 taking φ1 (x2 ) to φ2 (y2 ) while leaving the origin fixed. Hence the composition φ−1 2 ◦ φ3 ◦ φ1 is an isometry taking each xi to yi . Almost the same argument works when n = 3: φ1 and φ2 again take x1 and y1 (respectively) to the origin, so that φ1 (x2 ) and φ1 (x3 ) sit on the same circles around the origin as φ2 (y2 ) and φ2 (y3 ) ( respectively). Then φ3 can take φ1 (xi ) to φ2 (yi ) by some combination of rotation and reflection, leaving the origin fixed, and the again the composition φ−1 2 ◦ φ3 ◦ φ1 takes every xi to yi . Cases where n > 3 are handled by induction. Suppose that the result holds for n − 1; we now show that it also holds for n. By the inductive hypothesis, there exists at least one φ where yi = φ(xi ) for i ∈ 1 : (n − 1). Because φ is a global isometry, φ(xn ) is well-defined. We will be done if φ(xn ) can be shown to equal yn . Now, an arbitrary point y ∈ H2 can be uniquely identified by its distance from three points y1 , y2 , y3 in general position. This is because circles in the Poincaré disk are also Euclidean circles, and three circles with 2 The decomposition of expected log-likelihood into a entropy term which only involves the true distribution of the data, plus a KL divergence, goes back to at least Kullback (1968). CONSISTENCY FOR CONTINUOUS NETWORK MODELS 11 non-collinear centers will have a unique intersection, if they intersect at all. So yn is uniquely determined by dist (y1 , yn ), dist (y2 , yn ) and dist (y3 , yn ). But since φ is an isometry, (21) dist (xj , xn ) = dist (φ(xj ), φ(xn )) = dist (yj , φ(xn )) , j ∈ 1 : 3 where the second equality holds by the inductive hypothesis. Hence φ(xn ) must equal yn . But this means that φ takes all n of the xi to the corresponding yi . Hence H2 satisfies condition (1) in the definition of a rigid space (Definition 1). According to Katok (1992, Theorem 1.4.1, p. 10), the group of isometries of H2 consists of the semi-direct product of the continuous group of orientation-preserving isometries, P SL(2, R) (generated from translations, rotations and dilations), with the two-element group consisting of the identity and the orientation-reversing reflection around (in the upper-half-plane representation) the imaginary axis. Moreover, the P SL(2, R) subgroup has index 2 in the full group of isometries. Thus, the number of connected components is 2. Hence (2) is satisfied in the definition of rigidity. As for the case M = Rd with the Euclidean metric, the proof is entirely parallel. Cases up through n = d + 1 can be handled due to the degrees of freedom of the isometry group, while when n > d+ 1 rely on induction, since an arbitrary point is uniquely determined by its distance to d + 1 points in general position. This takes care of condition (1) in the definition of rigidity. As for condition (2), isom(Rd ) can be divided into the orientation-preserving and orientation-reversing isometries. The former form a sub-group. Every orientation-reversing isometry is the composition of a single reflection with an orientation-preserving isometry, so the orientation-preserving isometries have index 2 in isom(Rd ). Thus, the number of connected components is 2, independent of the dimension d. We next show that regular CLS models are identifiable. proof of Theorem 6. For densities h and g on M , let the Xi be IID with distribution h, and Xi′ be IID with distribution g, and let ∆h,n and ∆g,n respectively represent the random matrices  dist (Xi , Xj )i,j , dist Xi′ , Xj′ i,j . First, we assume that h = g ◦ φ for some isometry φ ∈ isom(M ), and show that the resulting graph distributions are equal. Consider an isometry φ : M ∼ = M and assume h = g ◦ φ. Then, (22) d d ∆h,n = ∆g◦φ,n = ∆g,n ; 12 SHALIZI AND ASTA the first equality holding by assumption, the second because φ is an isometry. Since edge probabilities are function of distances alone, the distribution over graphs is a function of the distribution of distances, it follows that for all n, d graphn (g) = graphn (h). Now suppose h and g generate the same distribution over random graphs for all sizes n. By the fact that wn is injective for each n, it follows that d ∆h,n = ∆g,n . Then there is a version of ∆h,n and ∆g,n on a common probability space such that ∆h,n = ∆g,n a.s. by Theorem 3.30 of Kallenberg (2002). Thus the metric subspaces {X1 , X2 . . . Xn }, {X1′ , X2′ . . . Xn′ } of M are isometric a.s. Hence there exists an isometry φ : M ∼ = M such that Xi = φ(Xi′ ) a.s. for i = 1, 2, . . . n by Condition 1 of Definition 1. It follows h = g ◦ φ. 4.3. Geometric Complexity of Continuous Spaces. We consider the normalized log-likelihood functions of latent space models. For various adjacency matrices G1 , G2 , etc., let us abbreviate ℓ(x1:n ; Gi ) as ℓi (x1:n ) (following Anthony and Bartlett 1999, p. 91). Let us pick r different  adjacency 1 r 1 r matrices G , . . . G , and set ψ(x1:n ) = ℓ (x1:n ), . . . ℓ (x1:n ) . We will be concerned with the geometry of the level sets of ψ, i.e., the sets defined by ψ −1 (c) for c ∈ Rr . Definition 10. A function ψ : M n → Rr has bounded connected components (with bound B) when, for any r ≤ n, and for almost all c ∈ Rr , (23) CC(ψ −1 (c)) ≤ B where CC(S) counts the number of connected components of the set S. Proposition 11. Suppose that all functions in Ln are C d in their d parameters almost everywhere, and that Ln has bounded connected components with bound B. Then the growth function of Ln , i.e., the maximum number of ways that m data points G1 , . . . Gm could be dichotomized by thresholded functions from Ln , is at most (24) Π(m) ≤ B  em d d Thus the pseudo-dimension of Ln is at most 2 log2 B + 2d log2 e. CONSISTENCY FOR CONTINUOUS NETWORK MODELS 13 Proof. The inequality (24) is a simplification of Theorem 7.6 of Anthony and Bartlett (1999, p. 91), which allows for sets to be defined by k-term Boolean combinations of thresholded functions from Ln . (That is, the quoted bound is that of the theorem with k = 1.) Moreover, while Theorem 7.6 of Anthony and Bartlett (1999, p. 91) assumes that all functions in Ln are C d , the proof only requires this to be true almost everywhere. The last statement follows from Lemma 4.6(3) of Vidyasagar (2003, p. 134), which asserts3 that (25) m ≤ γ + α log2 (βm) ⇒ m < 2γ + 2α log2 αβ We apply this to bound on the growth function from Proposition 11: if m ≤ v, the VC dimension, then 2m ≤ Π(m). Taking the log2 of both sides, m ≤ log2 B + d log2 (em) − d log2 d (26) Setting α = d, β = e, and γ = log2 B − d log2 d, the inequality gives us (27) m < 2 log2 B − 2d log2 d + 2d log2 de = 2 log2 B + 2d log2 e which is the upper bound on the VC dimension of the subgraphs of Ln , and so on the pseudo-dimension of Ln . Next we bound the complexity of log-likelihoods for certain latent spaces. Theorem 12. of Ln is at most (28) Suppose that (M, w1:∞ ) is regular. The pseudo-dimension 2 log2 BM + 2n dim M log2 e, where BM is the number of connected components of isom(M ). Proof. By the fact that (M, w1:∞ ) is smooth, Ln is C ∞ in all its n dim M continuous parameters almost everywhere, so in applying Proposition 11, we may set d = n dim M . By condition 1 of Definition 1, two parameter vectors x1:n and y1:n give the same distribution over graphs if and only if [x1:n ] = [x1:n ]. Thus, by appropriate choices of G1 , . . . Gr , we can ensure that ψ(x1:n ) = ψ(y1:n ) only if x1:n and y1:n are isometric, since each distance shows up as a distinct term in the log-likelihood sum. The number of connected components of ψ −1 (c) is thus (at most) BM < ∞. The hypotheses of Proposition 11 being satisfied, (28) follows from Proposition 11. 3 Note Vidyasagar writes “lg” for “log 2 ”. 14 SHALIZI AND ASTA Unsurprisingly, ℓ achieves a maximum at the (isometry class of) the true coordinates4 . Lemma 13. For M satisfying (1) in Definition 1 and G ∼ graphn (x∗1:n ), [x∗1:n ] = argmax ℓ(x1:n ) . x1:n ∈M n Proof. Letting H and D respectively denote entropy and KL divergence, D(π ∗ kπ) ≥ 0, with equality if and only if π ∗ = π. Therefore we have that the divergence-minimizing π must be the distribution over graphs generated by some x1:n ∈ [x∗1:n ], and conversely that any parameter vector in that isometry class will minimize the divergence. The lemma follows from (20). 4.4. Pointwise Convergence of Log-Likelihoods. Lemma 14. Suppose that all of the edges in G are conditionally independent given some random variable µ. Then for any ǫ > 0, ) (  n2 (n − 1)2 ǫ2 (29) P r |ℓ(x1:n ) − ℓ(x1:n )| > ǫ ≤ 2 exp − Pn P 2 p=1 q>p λ2n (xp , xq ) In particular, this holds when G ∼ graphn (x∗1:n ) or G ∼ graphn (f ). Proof. Changing a single Gpq , but leaving the rest the same, changes 2 ℓ(x1:n ; G) by n(n−1) λn (xp , xq ). (The factor of 2 arises because Gpq = Gqp in an undirected graph.) The Gpq are all independent given µ. We may thus appeal to the bounded difference (McDiarmid) inequality (Boucheron, Lugosi and Massart, 2013, Theorem 6.2, p. 171): if ℓ is a function of independent random variables, and changing the kth variable changes ℓ by at most ck , then  2 ǫ (30) P r (|ℓ − E [ℓ] | > ǫ) ≤ 2 exp − 2ν 4 The statement and proof of the following lemma presume that the model is wellspecified. If the model is mis-specified, then inf x1:n D(π ∗ kπ) is still well-defined, and still defines the value of the supremum for ℓ. The pseudo-true parameter value would be one which actually attained the infimum of the divergence (White, 1994). This, in turn, would be the projection of π ∗ on to the manifold of distributions generated by the model (Amari et al., 1987). All later invocations of Lemma 13 could be replaced by the assumption merely that this pseudo-truth is well-defined. 15 CONSISTENCY FOR CONTINUOUS NETWORK MODELS where ν = (31) 1 4 P c2k . In the present case, we have cpq = 2 n(n−1) λn (xp , xq ). Thus, n X n X X X 1 4 1 2 ν= λn (xp , xq ) = 2 λ2n (xp , xq ) 2 4 n2 (n − 1)2 n (n − 1) q>p q>p p=1 p=1 and so ( n2 (n − 1)2 ǫ2 (32) P r |ℓ(x1:n ) − ℓ(x1:n )| > ǫ | µ ≤ 2 exp − Pn P 2 p=1 q>p λ2n (xp , xq )  )  Since the unconditional deviation probability P r |ℓ(x1:n ) − ℓ(x1:n )| > ǫ is just the expected value of the conditional probability, which has the same upper bound regardless of µ, the result follows (cf. Shalizi and Kontorovich 2013, Theorem 2). Finally, note that all edges in graphn (x∗1:n ) are unconditionally independent, while those in graphn (f ) are conditionally independent given X1:n , which plays the role of µ. 4 ) rate, This lemma appears to give exponential concentration at  an O(n n 2 but of course the denominator of the rate itself contains 2 = O(n ) terms, so the over-all rate is only O(n2 ). Of course, there must be some control over the elements in the denominator. Lemma 15. (33) Assume wn is logit-bounded. Then for any x1:n and ǫ > 0,    n(n − 1)ǫ2 P r |ℓ(x1:n ) − ℓ(x1:n )| > ǫ ≤ 2 exp − vn2 Proof. By assumption, λ2n (xp , xq ) ≤ vn2 . Thus  n 2 2 vn , and the result follows from Lemma 14. Pn p=1 P 2 q>p λn (xp , xq ) ≤ 4.5. Uniform Convergence of Log-Likelihoods. Lemmas 14 and 15 show that, with high probability, ℓ(x1:n ) is close to its expectation value ℓ(x1:n ) for any given parameter vector x1:n . However, we need to show that the MLE X̂1:n has an expected log-likelihood close to the optimal value. We shall do this by showing that, uniformly over M n , ℓ(x1:n ) is close to ℓ(x1:n ) with high probability. That is, we will show that (34) P sup ℓ(x1:n ) − ℓ(x1:n ) → 0 x1:n 16 SHALIZI AND ASTA This is a stronger conclusion than even that of Lemma 15: since M is a continuous space, even if each parameter vector has a likelihood which is exponentially close to its expected value, there are an uncountable infinity of parameter vectors. Thus, for all we know right now, an uncountable infinity of them might be simultaneously showing large deviations, and continue to do so no matter how much data we have. We will thus need to show that likelihood at different parameter values are not allowed to fluctuate independently, but rather are mutually constraining, and so eventually force uniform convergence. If there were only a finite number of allowed parameter vectors, we could combine Lemma 15 with a union bound to deduce (34). With an infinite space, we need to bound the covering number of Ln . To recall5 , the L1 covering number of a function class at scale ǫ and m points, N1 (ǫ, F, m), is the cardinality of the smallest set of functions P fj ∈ F which will guarantee that that, for any choice of points a1 , . . . am , m i=1 |f (ai ) − fj (ai )| ≤ ǫ for some fj . Typically, as in Anthony and Bartlett (1999, Theorem 17.1, p. 241), a uniform concentration inequality takes the form of !  (35) P r sup |f − E [f ]| ≥ ǫ ≤ c0 c1 N1 (ǫc2 , F, c3 m) exp −c4 ǫ2 r(m) f ∈F where the individual deviation inequality is (36)  P r (|f − E [f ] | ≥ ǫ) ≤ c0 exp − −ǫ2 r(m) In turn, Anthony and Bartlett (1999, Theorem 18.4, p. 251) shows that the L1 covering number of a class of functions F with finite pseudo-dimension v at scale ǫ and m observations is bounded:  v 2e (37) N1 (ǫ, F, m) ≤ e(v + 1) ǫ In our setting, we have m = 1. (That is, we observe one high-dimensional sample; notice that the bound is independent of m so this hardly matters.) It thus remains to bound the pseudo-dimension of Ln . This involves a rather technical geometric argument, ultimately revolving on the group structure of the isometries of (M, dist). This may be summed up in the existence of a constant BM , which is 2 for any Euclidean space, and (as it happens) also 2 for H2 . We bracket this matter in §4.3. 5 See, e.g., Anthony and Bartlett (1999) or Vidyasagar (2003). CONSISTENCY FOR CONTINUOUS NETWORK MODELS Theorem 16. Then 17 Suppose that the CLS model is regular and logit-bounded. P sup |ℓ(x1:n ) − ℓ(x1:n )| → 0 x1:n with the probability of a size ǫ deviation shrinking exponentially in ǫ2 n2 /vn2 . Proof. Presume for the moment that we know the L1 covering number of Ln is at most N1 (Ln , ǫ). Then (38)     n(n − 1)ǫ2 P r sup |ℓ(x1:n ) − ℓ(x1:n )| ≥ ǫ ≤ 4N1 (Ln , ǫ/16) exp − 16vn2 x1:n The proof is entirely parallel to that of Theorem 17.1 in Anthony and Bartlett (1999, p. 241), except for using Lemma 15 in place of Hoeffding’s inequality, and so omitted. Now, by Theorem 12 and Proposition 2, the pseudo-dimension of Ln is at most 2 log2 BM + 2n dim M log2 e. The L1 covering number of Ln is thus exponentially bounded in O(n log 1/ǫ), specifically (Anthony and Bartlett, 1999, Theorem 18.4, p. 251): (39)  2 log2 BM +2n dim M log2 e 2e N1 (Ln , ǫ) ≤ e(1 + 2 log2 BM + 2n dim M log2 e) ǫ (38) grows exponentially in O(n log 1/ǫ), while (33) shrinks exponentially in O(ǫ2 n2 /vn2 ). For fixed ǫ, then, the uniform deviation probability over all of Ln in (38) is therefore exponentially small in ǫ2 n2 /vn2 , hence we have convergence in probability to zero. Remark 1: In applying the theorems from Anthony and Bartlett (1999), remember that we have only one sample (m = 1), which is however of growing (O(n2 )) dimensions, with a more-slowly growing (O(n)) number of parameters. Remark 2: From the proof of the theorem, we see that the uniform deviation probabilities are exponentially small in n2 /vn2 . Thus if vn2 grows slowly enough, the sum of the deviation probabilities tends to a finite limit. Convergence in probability would then be converted to almost-sure convergence by means of the Borel-Cantelli lemma, if the graphs at different n can all be placed into a common probability space. Doing so however raises some subtle issues we prefer not to address here (cf. Shalizi and Rinaldo 2013). 18 SHALIZI AND ASTA 4.6. The Main Convergence Results. proof of Theorem 7. For each n, define fn (x1:∗ ) = n X 2−i ℓ(x1:i ), f (x1:∗ ) = i=1 ∞ X 2−i ℓ(x1:i ). i=1 For each n, fn : M ∞ → R is continuous because ℓ is continuous. The function f : M ∞ → R is continuous because the defining series above converges uniformly. In an abuse of notation, let [M n ] denote the quotient of M n by the natural action of the isometry group of M for n = 0, 1, 2, . . . , ∞. Note that f0 , f1 , . . . , f induce well-defined continuous functions f¯1 , f¯2 , . . . , f¯ : [M n ] → R for n = 0, 1, 2, . . . , ∞. First note that supx1:∗ |fn (x1:∗ ) − f (x1:∗ )| = · · · = sup x1:∗ ≤ sup x1:∗ n X −i 2 (ℓ(x1:i ) − ℓ(x1:i )) + 2−i ℓ(x1:i ) i=n+1 i=1 n X ∞ X 2−i (ℓ(x1:i ) − ℓ(x1:i )) + O(n−1 ) i=1 because the wi ’s are logit-bounded. Each summand in the last line converges in probability to 0 by Theorem 16. It follows that P sup |f¯n ([x1:∗ ]) − f¯([x1:∗ ])| → 0. x1:∗ It suffices to show that f¯ has a well-separated maximum. Then the desired convergence would follow (van der Vaart, 1998, Theorem 5.7, p. 45). Let Bn be the finite union of n closed balls, each with radius      wn dist x∗i , x∗j  , R = max wn−1  P ∗ ∗ i,j i′ ,j ′ log wn dist xi′ ,xj ′ e about each of the points x∗1 , x∗2 , . . . , x∗n . Then Bn is compact because M is complete and closed balls in complete Riemannian manifolds are compact. Therefore [Bnn ] is compact for each n because quotients and products of compact spaces are compact. Moreoever, [Bnn ] contains [x∗1:n ]. Therefore the restriction of f¯n to [Bnn ] has [x∗1:n ] as its well-separated maximum because f¯n is continuous and has compact domain. CONSISTENCY FOR CONTINUOUS NETWORK MODELS 19 Consider [x1:n ] ∈ [M n ] − [Bnn ]. We can take x1 = x∗1 because M is homogeneous and x2 ∈ / Bn because [x1:n ] ∈ / [Bnn ]. Therefore log wn (dist (x∗1 , x∗2 )) − log wn (dist (x1 , x2 )) > log wn (dist (x∗1 , x∗2 )) − log wn (R) X  > log wn dist x∗i , x∗j i,j Therefore ℓ(x1:n ) < ℓ(x∗1:n ) − ǫn . Thus f¯n has a well-separated maximum on all of [M n ] for each n. It then follows that f¯ has a well-separated maximum. ∗ so that proof of Corollary 8. Define X1:n X1∗ , X2∗ , . . . , Xn∗ ∼ f. P ∗ → f and so Since the density estimator is consistent, fˆX1:n Also by Theorem 7, h i P ∗ fˆX1:n = fˆ[X ∗ ] → [f ] . 1:n h i P ∗ X̂1:n → [X1:n ]. Since the density estimator is continuous in its inputs, an application of the continuous mapping principle (Mann and Wald, 1943) yields the result. proof of Corollary 9. For every m, graphm (f ) is continuous in f . Combining Corollary 8 with another application of the continuous mapping principle thus proves the desired convergence. 5. Conclusion. Thus we have formulated and proven a notion of consistency for non-parametric likelihood estimators of graphs generated from continuous latent space models, under some mild assumptions on the generative models. Traditional consistency results for statistical estimators are a kind of ergodicity, or long-term mixing, for multiple, independent samples. The size of a single sample network here plays the role of the number of samples in traditional formulations of consistency. Continuous latent space models turn out to provide the necessary ergodicity through conditional independence. Consequently, we obtain three levels of consistency: consistency 20 SHALIZI AND ASTA of MLE graph embeddings, consistency of non-parametric node density estimators, and consistency of non-parametric random graph estimators, all as the size of the graphs increases. These main results hold even when our generative models are mis-specified, i.e. when we fix a latent space but the generating graph distributions are not defined in terms of the space, under some additional assumptions [Appendix A]. APPENDIX A: MIS-SPECIFIED MODELS Our consistency results extend from specified to certain mis-specified models. We still assume the existence of a latent space (M, w1:∞ ) as before, but assume that sample graphs are sampled not by a distribution of the form graphn (x1:n ) but in fact by some arbitrary distribution of graphs having n nodes. We call a sequence G1 , G2 , . . . of random graphs almostspecified if there exists x∗1:∗ ∈ M ∞ such that, for all sufficiently large n, ℓ(x1:n ) achives a maximum uniquely exactly for x1:n ∈ [x∗1:n ]. For such an almost-specified model, x∗1:∗ plays the role of the true coordinates and the assumption of being almost specified plays the role of Lemma 13 (e.g. in all proofs); we call such x∗1:∗ the pseudo-coordinates of the almost-specified model. Consequently, we can restate our main results at the following level of generality. Theorem 17. For an almost specified model with pseudo-coordinates x∗1:∗ and a compact, regular latent space (M, w1:∞ ), h i P (40) X̂1:n → [x∗1:n ] . ACKNOWLEDGEMENTS Our work was supported by NSF grant DMS-1418124; DA also received support from NSF Graduate Research Fellowship under grant DGE-1252522, and CRS from NSF grant DMS-1207759. We are grateful for valuable discussions with Carl Bergstrom, Elizabeth Casman, David Choi, Aaron Clauset, Steve Fienberg, Christopher Genovese, Aryeh Kontorovich, Dmitri Krioukov, Cris Moore, Alessandro Rinaldo, Mitch Small, Neil Spencer, Andrew Thomas, Larry Wasserman, and Chris Wiggins, and for feedback from seminar audiences at CMU, UCLA and UW-Seattle. REFERENCES Albert, R., DasGupta, B. and Mobasheri, N. (2014). Topological Implications of Negative Curvature for Biological and Social Networks. Physical Review E 89 032811. CONSISTENCY FOR CONTINUOUS NETWORK MODELS 21 Amari, S.-i., Barndorff-Nielsen, O. E., Kass, R. E., Lauritzen, S. L. and Rao, C. R. (1987). Differential Geometry in Statistical Inference. Institute of Mathematical Statistics Lecture Notes-Monographs Series 10. Institute of Mathematical Statistics, Hayward, California. Anthony, M. and Bartlett, P. L. (1999). Neural Network Learning: Theoretical Foundations. Cambridge University Press, Cambridge, England. Asta, D. (2015). Kernel Density Estimation on Symmetric Spaces. In Geometric Science of Information (F. Nielsen and F. Barbaresco, eds.) 779–787. Springer, Berlin. Asta, D. and Shalizi, C. R. (2015). Geometric Network Comparison. In 31st Conference on Uncertainty in Artificial Intelligence [UAI 2015] (M. Meila and T. Heskes, eds.) 102–110. AUAI Press, Corvallis, Oregon. Boucheron, S., Lugosi, G. and Massart, P. (2013). Concentration Inequalities: A Nonasymptotic Theory of Independence. Oxford University Press, Oxford. Cover, T. M. and Thomas, J. A. (2006). Elements of Information Theory, Second ed. John Wiley, New York. Hoff, P. D., Raftery, A. E. and Handcock, M. S. (2002). Latent Space Approaches to Social Network Analysis. Journal of the American Statistical Association 97 1090– 1098. Kallenberg, O. (2002). Foundations of Modern Probability, Second ed. Springer-Verlag, New York. Katok, S. (1992). Fuchsian Groups. University of Chicago Press, Chicago. Kennedy, W. S., Narayan, O. and Saniee, I. (2013). On the Hyperbolicity of LargeScale Networks. arxiv:1307.0031. Krioukov, D., Papadopoulos, F., Kitsak, M., Vahdat, A. and Boguñá, M. (2010). Hyperbolic Geometry of Complex Networks. Physical Review E 82 036106. Kullback, S. (1968). Information Theory and Statistics, 2nd ed. Dover Books, New York. Mann, H. B. and Wald, A. (1943). On stochastic limit and order relationships. Annals of Mathematical Statistics 14 217–226. Penrose, M. (2003). Random Geometric Graphs. Oxford University Press, Oxford. Shalizi, C. R. and Kontorovich, A. L. (2013). Predictive PAC Learning and Process Decompositions. In Advances in Neural Information Processing Systems 26 [NIPS 2013] (C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani and K. Q. Weinberger, eds.) 1619–1627. MIT Press, Cambridge, Massachusetts. Shalizi, C. R. and Rinaldo, A. (2013). Consistency Under Sampling of Exponential Random Graph Models. Annals of Statistics 41 508–535. van der Vaart, A. W. (1998). Asymptotic Statistics. Cambridge University Press, Cambridge, England. Vidyasagar, M. (2003). Learning and Generalization: With Applications to Neural Networks, Second ed. Springer-Verlag, Berlin. White, H. (1994). Estimation, Inference and Specification Analysis. Cambridge University Press, Cambridge, England. Department of Statistics Carnegie Mellon University Pittsburgh, PA 15213 USA and Santa Fe Institute 1399 Hyde Park Road Santa Fe, NM 87501, USA E-mail: [email protected] Department of Statistics Ohio State University Columbus, OH 43210 USA E-mail: [email protected]
10math.ST
RFM-SLAM: Exploiting Relative Feature Measurements to Separate Orientation and Position Estimation in SLAM Vikram Shree I. I NTRODUCTION Suman Chakravorty Measurements-based Simultaneous Localization and Mapping (RFM-SLAM). RFM-SLAM Estimate GTSAM Estimate 80 80 60 60 40 40 20 20 Y (m) Y (m) Abstract—The SLAM problem is known to have a special property that when robot orientation is known, estimating the history of robot poses and feature locations can be posed as a standard linear least squares problem. In this work, we develop a SLAM framework that uses relative feature-to-feature measurements to exploit this structural property of SLAM. Relative feature measurements are used to pose a linear estimation problem for pose-to-pose orientation constraints. This is followed by solving an iterative non-linear on-manifold optimization problem to compute the maximum likelihood estimate for robot orientation given relative rotation constraints. Once the robot orientation is computed, we solve a linear problem for robot position and map estimation. Our approach reduces the computational burden of non-linear optimization by posing a smaller optimization problem as compared to standard graph-based methods for featurebased SLAM. Further, empirical results show our method avoids catastrophic failures that arise in existing methods due to using odometery as an initial guess for non-linear optimization, while its accuracy degrades gracefully as sensor noise is increased. We demonstrate our method through extensive simulations and comparisons with an existing state-of-the-art solver. Keywords: SLAM, graph-based SLAM, non-linear optimization, relative measurements 0 0 -20 -20 -40 -40 -60 -60 -80 -60 -40 -20 0 20 40 60 80 100 -80 -60 -40 -20 X (m) 0 20 40 60 80 100 X (m) (a) RFM-SLAM estimate for robot trajectory in one of our simulations. RMS position error is 1.88m. (b) GTSAM estimate for robot trajectory in the same run, catastrophic failure due to bad initial guess. Fig. 1: Simulation results for map M1 with ≈ 1000 nodes for RFM-SLAM and GTSAM given identical data. The true trajectory and landmarks are in green, odometery is in black, RFM-SLAM estimates are shown in blue and GTSAM estimates in magenta. Feature plots are omitted for the sake of clarity. Relative measurements [7, 21–24] allow a robot to exploit structural properties of the environment, e.g., relative displacement from one landmark to another is independent of how a robot moves in a static world given a particular frame of reference. Taking note of this property, we present a 2D SLAM approach in which range bearing measurements are transformed into relative displacements between features. In our method, relative orientation constraints between poses are formulated using translation and rotation invariant structural properties. This allows our method to exploit the separable structure of SLAM [4, 6, 17], i.e., robot heading estimation is separated from the estimation of past robot positions and feature locations. Using relative orientations between the set of robot poses, our method solves a non-linear optimization problem over the set of robot orientations following which we solve a linear least squares problem for position (robot trajectory and map). We call this method Relative Feature Fig. 2: Simulation results for map M2 with ≈ 2000 nodes for RFM-SLAM and GTSAM given identical data. Saurav Agarwal ([email protected]) and Suman Chakravorty ([email protected]) are with the Department of Aerospace Engineering, Texas A&M University, College Station, TX 77840, USA. Vikram Shree ([email protected]) is with the Department of Aerospace Engineering, Indian Institute of Technology, Kanpur, India. Figures 1 and 2 shows a comparison between RFM-SLAM and GTSAM [8] for two maps. When the simulated data is input to GTSAM, the odometery based initial guess results in catastrophic failure for both maps as GTSAM gets stuck in a RFM-SLAM Estimate GTSAM Estimate 100 100 80 80 60 60 40 40 20 20 Y (m) Y (m) arXiv:1609.05235v1 [cs.RO] 16 Sep 2016 Saurav Agarwal 0 0 -20 -20 -40 -40 -60 -60 -80 -80 -100 -100 -100 -50 0 50 100 X (m) (a) RFM-SLAM estimate for robot trajectory in one of our simulations. RMS position error is 1.44m. -100 -50 0 50 100 X (m) (b) GTSAM estimate for robot trajectory for the same run, catastrophic failure due to bad initial guess. local minima whereas RFM-SLAM recovers the robot trajectory and map given identical data. The major contributions of this paper can be summed up as follows: 1) RFM-SLAM reduces computational complexity of the optimization problem, i.e., if there are N poses where each pose xk = [pk , θk ]T and L landmarks then we solve for N variables as opposed to 3N + 2L in existing methods (for the planar SLAM problem). 2) By separating orientation estimation and formulating the robot and landmark position estimation as a linear least squares problem, no initial guess is required for the positions. Further, we show through empirical results that as odometery noise increases, our method avoids catastrophic failures which may occur in nonlinear optimization-based methods due to reliance on odometery-based initial guess. We now proceed to discuss relevant related work. In Section III we state our problem and preliminaries, subsequently in Section IV we present our approach wherein some mathematical details are relegated to Appendix A. Results are discussed in Section V followed by conclusions. solver and this guess is usually provided by odometery. However, it is well known that odometery error grows unbounded and is often unreliable. This reliance on odometery for initial guess makes non-linear optimization methods susceptible to getting trapped in local minima often resulting in arbitrarily bad solutions [4, 5] (sometimes referred to as catastrophic failures, see Figs. 1 and 2). Recent works [4, 6, 17] have analyzed structural properties of SLAM with the aim of decoupling non-linearities that arise due to orientation. The works of [4, 6] provided several important insights, demonstrating that estimating orientation as the first step and using these estimates to initialize pose graph optimization results in a robust solution. In [2] a general on-manifold optimization based method is developed to estimate orientations from noisy relative measurements corrupted by outliers. In relation to [2], our orientation estimation method (Section IV-B2) is only concerned with measurement data corrupted by zero-mean Gaussian noise similar to [6, 17]. We direct the reader to [5] for a recent survey of 3D rotation estimation techniques. The works of [6, 17] are closely related to ours, hence we proceed to discuss these in greater detail. II. R ELATED W ORK Linear Approximation for pose Graph Optimization (LAGO) [6] is a method for planar relative pose graph SLAM that separates robot orientation and position estimation into two successive linear problems with the key benefit of a reduced risk of convergence to local minima and provides a robust initial guess for iterative optimization. The LAGO formulation does not deal with feature-based measurements and cannot be extended to 3D. In contrast, RFM-SLAM is designed for feature-based SLAM and majority of the algorithm presented in this paper ports directly to the 3D domain (see discussion in Section IV-D). LAGO develops a closed form approach (regularization) to solve the angle wrap-around problem that relies on rounding-off noisy relative orientation measurements. This technique may degrade rapidly once sensor accuracy reduces beyond a certain threshold ([6], Section 6). In contrast, RFM-SLAM does not invoke any such approximation as it computes the maximum likelihood estimate for the orientations via an on-manifold optimization. In this regard, compared to LAGO, our approach trades computational speed, for accuracy and reliability in the orientation estimation phase. In [17], the authors develop a modified Variable Projection (VP) technique for non-linear optimization that exploits the separation of position and orientation in SLAM and runs faster than the standard Gauss Newton algorithm. The method of [17] solves for orientation and position successively in an iterative manner as opposed to RFM-SLAM wherein iterative nonlinear optimization is only applied to orientation estimation. The method of [17] may get trapped in local minima and in few instances may not converge to a solution ([17], Section 5) as it relies on odometery for the initial guess which may be arbitrarily bad. Our empirical observations indicate that as sensor noise is increased, RFM-SLAM performance degrades gracefully and we do not observe catastrophic failures (see Table I). The initial work of [25] introduced filtering as a tool to tackle the SLAM problem. Several later works [7, 21, 22] proposed to exploit relative feature measurements in a filteringbased approach. In [7] the correlations between relative measurements from common landmarks are not considered which leads to a sub-optimal estimate. In [22] only relative distances are estimated which neglects the information provided by the direction component of relative measurements. The method of [21] exploits the shift and rotation invariance of map structure but cannot consistently incorporate long range correlations and is thus unable to close loops. In comparison to aforementioned methods [7, 21, 22] our formulation takes into account both; correlations between relative measurements from common landmarks; and long range correlations between relative measurements in the global frame. This allows RFMSLAM to form consistent estimates and close large loops. The method of [27] exploits relative feature measurements to decouple map estimation from robot localization in an Extended Information Filter-based formulation, while maintaining long range correlations. Compared to [7, 21, 22, 27] we exploit relative measurements to decouple robot orientation estimation from map and robot position. Further RFM-SLAM does not maintain a recursive estimate over the map or robot state, it falls into the category of methods that solve the full SLAM problem. The seminal contribution of [19] introduced a non-linear optimization based approach to solving the full SLAM problem wherein robot poses are treated as nodes of a graph and constraints as edges. In [26] the authors extended graphbased SLAM to feature mapping and several others [9, 11– 14, 18, 20] made significant contributions to extend the initial work of [19]. A key limitation of non-linear iterative optimization methods is that an initial guess is required to bootstrap the III. P RELIMINARIES AND P ROBLEM Let xk ∈ X, uk ∈ U, and zk ∈ Z represent the system state, control input, and observation at time step k respectively, where X, U, Z denote the state, control, and observation spaces respectively. The measurement model h is denoted as zk = h(xk ) + vk , where vk ∼ N (0, Rk ) is zero-mean Gaussian measurement noise. The map (unknown at t0 ) is a set of landmarks (features) distributed throughout the environment. We define the j-th landmark as lj and ˆlj as the estimate of lj . The observation for landmark lj at time tk is denoted by zkj ∈ zk . The inverse measurement model is denoted by g such that for a given measurement zkj and the state xk at which it was made, g computes the landmark location lj = g(xk , zkj ). The state evolution model f is denoted as xk+1 = f (xk , uk ) + wk where wk ∼ N (0, Qk ) is zero-mean Gaussian process noise. We define l dij k to be the relative feature measurement, from feature li to lj in the local frame of the robot at time tk . In our framework, a relative feature measurement is an estimate of the displacement vector from one feature to another (Fig. 3(a)). l j The local relative measurement is computed as l dij k = ∆k − l i l j l i ∆k , where ∆k , ∆k are relative positions of features li and lj respectively with respect to the robot in its local frame. Thus it is linear in positions of the two features in the local frame. Let C(θk ) denote the Direction Cosine Matrix (DCM) of the robot orientation at state xk . C is a function of the robot orientation parameter θk (e.g., Euler angles, Quaternions etc.). A local measurement in the robot frame can be projected into the world (global) frame as C(θk )T l ∆ik = w ∆ik = li − pk , (1) where li and pk are the feature and robot positions in the world frame. Thus, it is the transformation of local measurements to the global frame that introduces non-linearity due to the trigonometric functions of orientation. If heading θ ∗ is known, define l ∆ to be the vector of all local feature position measurements and let [pT lT ]T be the vector of all robot and feature positions in the world frame, then we have the following standard linear estimation problem in position   ∗ T l 0 p C(θ ) ∆ = A , (2) l where A0 is a matrix composed of elements in the set {−1, 0, 1}. However, direct heading estimates may not be readily available due to which we need to estimate the robot heading. In the proceeding section we develop the RFMSLAM algorithm and describe our heading and position estimation method in detail. It is assumed that relative orientation measurements are independent and the front-end is given, the focus of this paper is on the back-end estimation problem. IV. M ETHODOLOGY The key steps in RFM-SLAM are as follows: 1) Transform range bearing observations from robot to features into relative position measurements in the robot’s local frame at each pose, then calculate feature-tofeature displacements vectors (Section IV-A). 2) Compute the relative rotation constraints for poses that either are connected by proprioceptive odometery or view identical pairs of landmarks or both (Section IV-B1). 3) Compute the Maximum Likelihood Estimate (MLE) for the robot orientation given constraints computed in the previous step (Section IV-B2). 4) Solve the global linear estimation problem over robot and feature positions (Section IV-C). A. Relative Feature Displacement Estimation Figure 3 depicts our proposed feature mapping process. At time tk let the robot make range bearing measurements zki and zkj to landmarks li and lj respectively. Using the inverse measurement model g (Section III), we have the position of li in robot’s local frame as l ∆ik = l g∆ (zik ) and l ∆jk = l g∆ (zjk ) for lj . Thus, we can compute the displacement vector from li to lj in the robot frame as l ij dk = l ∆jk − l ∆ik = l g∆ (zjk ) − l g∆ (zjk ) = l gd (zjk , zik ). (3) gd (zjk , zik ) is the relative measurement from li to lj in the robot’s frame, which is independent of robot position and orientation. Figure 3(a) shows a simple depiction of a robot making a relative position measurement between two features. Let Lk = {lk1 , lk2 , . . . , lkn } be the set of landl l l marks visible at time tk and zk = {zkk1 , zkk2 , . . . , zkkn } be the set of range bearing observations to the same. Let Dk = {dlk1 lk2 , dlk1 lk3 , . . . , dlkn−1 lkn } be the set of relative  observations between these features, where |Dk | = |z2k | . Hence, the vector of local relative measurements is as follows   l l l gd (zkk1 , zkk2 ) lk lk  l   gd (zk 1 , zk 3 )  l l . (4) d̂k = gd (zk ) =  ..     . l l lk l gd (zk n−1 , zkkn ) To estimate the error covariance of the relative measurement ¯ l gd |z to be the Jacobian in Eq. 4 we linearize l gd (zk ). Let ∇ k of the local relative measurement function in Eq. 4 and let Rzk = diag([Rlk1 , Rlk2 , . . . ]) be the noise covariance of zk , where Rlki is the noise covariance of robot’s range bearing measurement to feature lki . It is important to note that though measurements to each feature are independent, the set of relative feature measurements is correlated. This can be attributed to the correlations between relative measurements from common landmarks (see Eq. 4). Finally, we have l ¯ l gd |z Rz ∇ ¯ l gT |z ). d̂k ∼ N (l dk , l Rdk = ∇ k k d k B. Heading Estimation We now proceed to develop a two-part heading estimation technique. First, we recognize the fact that relative feature (a) Robot making local relative measurements. (b) Robot observes same features from two different poses forming a relative rotation constraint. (c) Tranformation of local robot to feature relative measurements to the global frame. Fig. 3: (a) A robot making observations to two features li and lj at time tk , the range bearing measurements allow the robot to compute the relative positions l ∆ik and l ∆jk of the features in its local frame which are then transformed to a relative displacement measurement l dij k between the two features. (b) A robot making observations to two features from poses xp (green arrows) and xq (blue arrows). Seeing the same two features forms a rotation constraint Cqp between these poses. (c) A robot sees the same landmark from two poses, the transformation of local relative measurements to the global frame is used in Section IV-C to solve for robot and feature positions. measurements-based constraints on the rotation between two poses are linear in the elements of relative orientation Direction Cosine Matrix (DCM). Thus we propose a linear least squares formulation to estimate the relative rotation between poses. The second step is described in Section IV-B2 where we apply an on-manifold optimization approach to solve the general non-linear heading estimation problem at loop closure given relative orientation estimates. 1) Linear Relative Rotation Estimation: Let Cqp be the relative rotation matrix between two poses xp , xq such that vp = Cqp vq , i.e, the vector v in frame q can be transformed through Cqp to frame p. We know that Cqp = Cp CTq where Cp , Cq ∈ SO(2). Let there be two landmarks li , lj visible l ij from poses xp , xq . Let l dij p , dq be the vectors from li to lj in the local frames at each pose. Then we have a constraint l ij dp − l Cqp dij q = 0 for every pair of landmarks (li , lj ) visible from xp and xq . Let cqp ∈ R2 be the vector of parameters for Cqp (see Eq. 19, Appendix A). As a robot moves, it makes two types of noisy observations: b odo ∼ 1) Proprioceptive odometery measurements δθ 2 N (δθ, σodo ) provide a direct estimate of the relative rotation δθ between successive poses xp and xq=p+1 , 2 where σodo is the measurement noise variance. Thus the b odo ), sin(δθ b odo )]T . vector ĉqp,odo = [cos(δθ 2) Relative feature measurements to common landmarks from two poses provide a relative orientation constraint. Define Dpq = Dp ∩ Dq to be the set of common relative measurements made from poses xp and xq , and l d̂0p ⊆ l d̂p , l d̂0q ⊆ l d̂q be the respective local measurements in the set Dpq with error covariances l 0 Rdp , l R0dq respectively. We have the following linear problem for the relative rotation parameter vector cqp , l 0 d̂p = B0qp cqp + vdpq , (5) where B0qp (l d̂0q ) (see Eq. 20, Appendix A) is a matrix function of the relative measurements from pose xq and vdpq ∼ N (0, Rdpq ) is a zero-mean Gaussian measurement noise. The error covariance in this measurement is approximated as Rdpq = l R0dp + Ĉqp,init l R0dq ĈTqp,init . For successive poses, Ĉqp,init = Ĉqp,odo , i.e., the relative rotation estimate from proprioceptive odometery. Between successive poses, all feature constraints in the form of Eq. 5 can be stacked along with proprioceptive odometery measurements which gives us the following linear problem       ĉqp,odo I vcqp,odo c + = l B0qp vdpq d̂p = Bqp c + vcpq where vcpq ∼ N (0, Rcqp ), and Rcqp diag([Rcqp,odo , Rdpq ]). Equation 6 can be rewritten as zcqp = Bqp cqp + vcqp . (6) = (7) Dropping the pose subscript for clarity, we can compute −1 T −1 the estimate ĉ = (BT R−1 B Rc zc and its error c B) T −1 −1 covariance Σc = (B Rc B) . Thus between successive poses, proprioceptive odometery measurements are augmented with exteroceptive measurements. A robot may close a loop and return to a previously visited location and re-observe features. At loop closure, we may solve Eq. 5 to estimate the relative rotation between two poses xp and xq . In this case, Ĉqp,init = Ĉp ĈTq , where Ĉp , ĈTq are estimated by chaining together successive relative rotation estimates computed according to Eq. 7. Note that Eq. 5 can be solved similar to Eq. 7 to compute the relative rotation constraint at loop closure. Once Eq. 7 (or Eq. 5) is solved, it needs to be ensured that the solution is an orthogonal rotation, thus we project it back onto the SO(2) manifold as ĉproj = η(ĉ), where η is a vector valued function (see Eq. 22, Appendix A). The error covariance post projection ¯ ĉ Σc ∇ ¯ T η|ĉ where ∇η| ¯ ĉ is the Jacobian of is Σcproj = ∇η| projection function η computed at the estimated values. Future references to c will drop the projection subscript for clarity. Once ĉ is computed, it is transformed into the relative heading angle value (Eq. 23, Appendix Appendix A), which in b Planar SLAM has the property that relative 2D is the scalar δθ. orientation measurements are linear in heading by virtue of which we can formulate the following linear problem c = Hθ + vθ , δθ (8) c is the vector all relative orientation measurements, where δθ H is a matrix composed of elements from the set {−1, 0, +1} and θ is the vector of robot heading angles. However, solving Eq. 8 directly may not provide the correct answer as the linear least squares formulation is indifferent to the angle wrap-around problem. In the proceeding section we describe how to overcome this problem. Lastly, we may compute the information matrix of the global heading estimate from Eq. 8 as Ωθ = HT R−1 θ H where Rθ is a diagonal matrix composed of uncertainty in relative orientation estimates. In Section IV-C we show how information matrix Ωθ is used by our algorithm to compute the map and history of robot positions. 2) On-Manifold Optimization Using Relative Orientation Measurements: The method described previously allows us to estimate relative rotations between poses. The set of poses and constraints from relative rotation estimates form a graph G = (V, E) whose nodes V = {ν1 , . . . , νn } are the pose orientations and whose edge pq ∈ E is a relative orientation constraint between nodes νp , νq . The problem at hand is to compute the global orientations for all nodes given relative rotation measurements. Let Ĉqp be the estimate of DCM Cqp for the relative rotation between nodes νp , νq . In the noise free measurement case, Ĉqp Cq = Cp .P However, given a set of noisy measurements we minimize pq ∈E κqp ||Ĉqp Cq −Cp ||F where ||·||F denotes the Frobenius matrix norm and κqp is a weight for the measurement Ĉqp . Now the Frobenius norm can be expanded as follows, ||Ĉqp Cq − Cp ||2 = ||Cp ||2 + ||Cq ||2 − 2tr(CTq ĈTqp Cp ). (9) Thus minimizing the Frobenius norm is equivalent to minimizing the term −tr(CTq ĈTqp Cp ) where tr(·) denotes the trace operator. Using properties of trace (tr(X) = tr(XT )), we have the cost function to minimize as X J =− κqp tr(CTp Ĉqp Cq ), (10) pq ∈E where κqp = 1/σδθqp , i.e., inverse of standard deviation of relative rotation estimate. The Euclidean gradients for the cost function J are X X ∂Fc ∂J =− κqp Ĉqp Cq , =− κqp ĈTqp Cp . ∂Cp ∂Cq pq ∈E pq ∈E (11) Note that in the cost function given by Eq. 10, we directly optimize over the set of orientations for all poses. The initial guess can be computed by chaining together relative rotation estimates computed in Section IV-B1. Another way of looking at Eq. 10 is as follows, we have Ĉqp = Vqp Cp Cq where Vqp is the perturbation due to noise. Then solving Eq. 10 is equivalent to computing the maximum likelihood estimator with a Langevin prior on the perturbation Vqp where κqp becomes the Langevin concentration parameter [2]. We use the Manopt MATLAB toolbox developed in [3] to minimize the cost function J using trust regions based optimization routine [1]. C. Global Trajectory and Feature Estimation ˆ ∼ N (l ∆, l R∆ = blkdiag([l R∆ , l R∆ . . . ])) be Let l ∆ 1 2 the vector of all local relative position measurements from robot to features. After computing the global orientations according to Section IV-B2, the vector of local relative meaˆ can be transformed to the world frame similar surements l ∆ to Eq. 2. From the transformed global measurements we can formulate the linear estimation problem as   w ˆ T l ˆ 0 p ∆ = Ĉ ∆ = A + w v∆ , (12) l where Ĉ = C(θ̂) is the corresponding composition of DCM matrices parametrized by the estimated heading θ̂, [pT lT ]T is the vector of robot and feature positions, A0 is a matrix with each row containing elements of the set {−1, 0, +1} and w v∆ ∼ N (0, w R∆ = CT l R∆ C) is the noise vector. If we were to solve for the feature positions directly from Eq. 12, we would end up with an incorrect estimate as the global orientation estimates θ̂ are correlated. Thus relative feature measurements in the global frame are correlated with heading estimates as well. We now describe how to setup the position estimation problem while correctly incorporating the appropriate error covariances similar to the trick employed in LAGO [6]. After computing the orientation estimates θ̂ along with the transformed global relative robot to feature measurements we stack them to give us a new measurement vector γ. Then we have  T l   0 ˆ A Ĉ ∆ l γ = hw ( ∆, θ)+vw = = 0 θ̂ | {z A     p  0   w v∆ l + . vθ I } θ (13) The error covariance Rγ of measurement vector γ is then given by, l  ¯ w R∆ 0 ∇ ¯ T hw Rγ = ∇h (14) 0 Σθ ¯ w is the Jacobian of measurement function hw where ∇h (Eq. 13) given by  T  ˆ C M l∆ ¯ ∇hw = , (15) 0 I where M = ∂CT ∂θ . Thus we have w R∆ + MΣθ MT Rγ = Σθ MT that affect solution accuracy, i.e., map, odometery noise and range bearing sensor accuracy.  MΣθ . Σθ (16) 80 100 80 40 60 20 40 Y (m) Y (m) Finally, the solution to the linear estimation problem of Eq. 13 is given by  ∗ p −1 T −1  l∗  = (AT R−1 A Rγ γ. (17) γ A) ∗ θ 60 0 20 0 -20 -20 -40 -40 -60 -60 -80 -60 -40 -20 0 20 40 60 80 100 X (m) Note that Eq. 17 involves the inversion of a large sparse matrix Rγ which may not be suitable for implementation due to complexity and potential numerical issues. However, this inversion is easily avoided by analytically computing the information matrix Ωγ = R−1 γ using block-matrix inversion rules as  w −1  R∆ −w R−1 ∆ M Ωγ = . (18) −MT w R−1 Ωθ + MT w R−1 ∆ ∆ M (a) Map M1 with 1129 robot poses and 286 landmarks. The robot trajectory is 544.50m long with 2 loop closures but robot does not return to start. -120 -100 -80 -60 -40 -20 0 20 40 60 80 X (m) (b) Map M2 with 2064 robot poses and 777 landmarks. The robot trajectory is 1000.87m long with 5 loop closures. Fig. 4: The two scenarios used in the simulations and comparisons. D. Extending RFM-SLAM to 3D A. Changing Map The global orientation optimization problem given relative measurements (Eq. 10) does not change from 2D to 3D. A minor difference arises in solving for relative orientation at loop closure (Eq. 5) where a robot would require observations to 3 features from two poses as 9 constraints are required to solve for the DCM (Ck ∈ R3×3 in SO(3)). Further, the linear position estimation problem of Eq. 13 also remains identical. The key difference occurs in computing the uncertainty over global orientation estimates as the 3D rotation problem cannot be setup similar to the 2D case (Eq. 8). In 3D, relative orientations measurements are not linear in robot orientation, rather they are non-linear functions of rotation parameters. In this regard, the work of [10] develops an analysis for firstorder error propagation in 3D rotation estimation which may be applicable to 3D RFM-SLAM. Investigating this aspect of the estimation problem forms part of our future work. Figure 4 shows the two maps; map M1 with 1129 robot poses and 286 landmarks; and map M2 with 2064 robot poses and 777 features. Each map presents a different challenge, i.e., in M1 there are 2 loop closures and robot trajectory does not terminate at the start location, whereas in M2 there are 5 loop closures and robot returns to its start location. Table I shows that GTSAM average RMSE in robot pose is greater for map M2 than M1 for all noise combinations except for α = 4, β = 1. We note GTSAM suffers more catastrophic failures in map M2 than map M1 (Table I). This is despite the fact that there are more loop closures in M2 and robot returns to start. The previous observation may be attributed to the trajectory in M2 (≈ 1000m) being longer than in M1 (≈ 500m) which results in odometery based initial guess being further from the ground truth than for map M1. An interesting difference emerges, for all noise combinations in the case of RFM-SLAM, average RMSE for map M2 is smaller than that for M1 despite the trajectory in M2 being twice as long as that of M1. This may be attributed to two factors; RFM-SLAM is able to exploit the graph topology for M2 (multiple loop closures) in the orientation estimation phase1 ; using range bearing measurements to augment relative orientation estimation provides a measure of robustness to the on-manifold optimization problem and purely odometerybased initial guess plays no role in the estimation process. V. R ESULTS We conducted 1600 simulations in total for two planar maps M1 and M2 (see Figs. 4(a) and 4(b)). The maps themselves were constructed by randomly sampling landmarks in a 2D environment after which simulated sensor data was collected by driving the robot around a sequence of waypoints. Proprioceptive odometery noise σodo is varied by scale factor α = {1, 2, 3, 4}, where α = 1 corresponds to σodo = diag([0.05m, 0.05m, 0.6◦ ]) and range bearing sensor noise σrb is varied by scale factor β = {1, 2, 3, 4}, where β = 1 corresponds to σrb = diag([0.05m, 0.6◦ ]). For each map, 50 simulations were conducted for each fixed noise level and 16 variations of noise values were used in total. For each simulation the resulting data was processed by both RFMSLAM (MATLAB) and GTSAM (C++) [8]. GTSAM utilized the Levenberg-Marquardt Algorithm and both Manopt [3] and GTSAM were allowed a maximum of 100 iterations. We now proceed to discuss our results in the context of key aspects B. Increasing Proprioceptive Odometery Noise Figure 5 shows that for low odometery noise β = 1 both methods perform comparably (same order of magnitude in RMSE) in both scenarios. For β = 1, in the case of map M1 GTSAM performs slightly better than RFM-SLAM. Increasing the proprioceptive odometery noise has the effect of reducing the quality of initial guess that GTSAM relies on which is 1 An excellent insight into the problem of how graph topology affects SLAM accuracy is provided in [15, 16]. 11 9 RFM-SLAM α = 1 RFM-SLAM α = 2 RFM-SLAM α = 3 RFM-SLAM α = 4 GTSAM α = 1 GTSAM α = 2 GTSAM α = 3 GTSAM α = 4 35 30 RMSE (m) 8 RMSE (m) the same map, we see a rise from 1.004m to 2.687m. In case of map M2, RFM-SLAM RMSE increases from 0.859m to 4.4m (418% increase) whereas for GTSAM we see a rise from 1.718m to 1.771m. Thus RFM-SLAM exhibits a higher relative increase in RMSE than GTSAM for increasing α. Thus simulation results show that compared to GTSAM, RFMSLAM performance is dominated by range bearing sensor noise. 40 RFM-SLAM α = 1 RFM-SLAM α = 2 RFM-SLAM α = 3 RFM-SLAM α = 4 GTSAM α = 1 GTSAM α = 2 GTSAM α = 3 GTSAM α = 4 10 7 6 5 25 20 15 4 10 3 5 2 1 0 1 2 3 4 1 2 3 β 4 β (a) RMSE vs. β for map M1. (b) RMSE vs. β for map M2. Fig. 5: Behavior of RMSE in robot position as odometery noise level β is increased for different α. The solid blue curves depict RFM-SLAM behavior and dashed magenta curves are for GTSAM. 11 40 RFM-SLAM β = 1 RFM-SLAM β = 2 RFM-SLAM β = 3 RFM-SLAM β = 4 GTSAM β = 1 GTSAM β = 2 GTSAM β = 3 GTSAM β = 4 10 9 30 RMSE (m) RMSE (m) 8 RFM-SLAM β = 1 RFM-SLAM β = 2 RFM-SLAM β = 3 RFM-SLAM β = 4 GTSAM β = 1 GTSAM β = 2 GTSAM β = 3 GTSAM β = 4 35 7 6 5 25 20 15 4 10 3 5 2 1 0 1 2 3 4 1 2 α (a) RMSE vs. α for map M1. 3 4 α (b) RMSE vs. α for map M2. Fig. 6: Behavior of RMSE in robot position as range bearing noise level α is increased for different β. evident from Figs. 5(a) and 5(b). In both maps, as β is increased, RFM-SLAM performance degrades much slower compared to GTSAM, where in map M2 particularly (Fig. 5(b)) GTSAM shows a rapid decline in solution accuracy. We take the case of α = 1 to highlight the variation in solution accuracy as odometeric noise is increased from lowest (β = 1) to its highest (β = 4) value. In the case of M1, GTSAM solution accuracy degrades from 1.004m to 5.389m as the number of catastrophic failures increased from 0 to 4, whereas RFM-SLAM accuracy degrades from 1.475m to 2.256m. In the case of M2, GTSAM solution accuracy degrades rapidly by 1709.3% as RMSE rises from 1.718m to 31.084m due to the number of catastrophic failures rising from 1 to 18 whereas RFM-SLAM accuracy reduces gently from 0.859m to 0.982m. Thus simulation results show that RFM-SLAM solution accuracy degrades gracefully for both maps with increasing noise as it does not suffer catastrophic failure whereas GTSAM’s performance is dominated by its sensitivity to the initial guess error (odometery). C. Increasing Range Bearing Sensor Noise Figure 6 shows that for the lowest odometeric noise value (β = 1), both methods show a well defined behavior in RMSE growth as α increases. We look at the variation in error between lowest (α = 1) and highest (α = 4) range bearing sensor noise when proprioceptive odometery noise is lowest (β = 1). In map M1 as α increases from 1 to 4, RFMSLAM RMSE rises from 1.475m to 5.028m, for GTSAM in D. Discussion Each method has a dominating factor that affects its behavior; for RFM-SLAM it is the range bearing sensor noise as we rely on this information in the orientation optimization phase; for GTSAM it is the proprioceptive odometery as it relies on odometery to bootstrap the solver. However, our results indicate that for all noise values, RFM-SLAM remains free of catastrophic failures due to which RMSE growth behaves well unlike in the case of GTSAM where the propensity of catastrophic failures increases with odometeric noise. In the case of GTSAM we see an order of magnitude increase in maximum RMSE over RFM-SLAM (≈ 40m vs. ≈ 7m) at α = 3, β = 4. In few cases, GTSAM failed to converge to a solution, these numbers are also reported in Table I. Further as the number of robot poses grows, odometery based initial guess diverges in an unbounded manner which may tend to dominate the solution accuracy in existing methods compared to noise in range bearing sensing. These results indicate a clear benefit of separating orientation and position estimation as it enhances robustness and reliability of the SLAM solution. VI. C ONCLUSIONS AND F UTURE W ORK In this work, a novel approach to solving the featurebased SLAM problem was presented that exploits separation of robot orientation from position estimation. Our proposed method RFM-SLAM undertakes a computationally cheaper optimization problem than standard graph-based approaches. Further, empirical results indicate that RFM-SLAM is able to avoid catastrophic failure and solution accuracy behaves well under varying noise conditions. We can safely conclude that decoupling orientation estimation from position exhibits a distinct advantage in that robust solutions can be obtained due to reduced risk of catastrophic failures. Future work involves implementing RFM-SLAM in more efficient frameworks, e.g. C++ to compare the time required to solve given problems with state-of-the-art solvers. Though the non-linear optimization problem for orientation may be susceptible to initial guess error, such an issue was not observed, perhaps the underlying nature of the orientation estimation problem is less sensitive to the initial guess. This is an interesting aspect of our approach which will be studied as part of future work. R EFERENCES [1] P.-A. Absil, C. G. Baker, and K. A. Gallivan. Trust-region methods on Riemannian manifolds. Found. Comput. Math., 7(3):303–330, July 2007. doi: 10.1007/s10208-005-0179-9. [2] N. Boumal, A. Singer, and P. A. Absil. Robust estimation of rotations from relative measurements by maximum likelihood. In 52nd IEEE Conference on Decision and Control, Dec 2013. Scenario M1 M2 M1 M2 M1 M2 M1 M2 Average RMSE in robot position estimate (number of catastrophic failures, number of cases with no convergence) α=1 α=2 α=3 α=4 RFM-SLAM GTSAM RFM-SLAM GTSAM RFM-SLAM GTSAM RFM-SLAM GTSAM β=1 1.475 (0) 1.004 (0) 2.822 (0) 1.696 (0) 4.395 (0) 2.182 (0) 5.028 (0) 2.687 (0) 0.859 (0) 1.718 (1) 1.976 (0) 2.682 (2) 3.365 (0) 2.882 (1) 4.400 (0) 1.771 (0) β=2 1.789 (0) 8.846 (8) 3.243 (0) 3.772 (2) 3.909 (0) 2.708 (0) 5.246 (0) 3.790 (0) 0.947 (0) 14.593 (10) 1.898 (0) 13.214 (7) 3.475 (0) 4.528 (1) 4.471 (0) 17.472 (8,5) β=3 1.894 (0) 10.489 (8) 2.873 (0) 7.500 (7) 4.843 (0) 4.999 (3,1) 6.592 (0) 6.417 (3,3) 0.997 (0) 19.445 (13) 2.422 (0) 25.437 (16,1) 3.623 (0) 21.675 (12,5) 5.288 (0) 20.461 (11,3) β=4 2.256 (0) 5.389 (4) 3.629 (0) 10.830 (7) 5.377 (0) 6.856 (2,1) 6.738 (0) 9.640 (7,5) 0.982 (0) 31.084 (18,1) 2.442 (0) 28.777 (15,1) 3.384 (0) 39.631 (21,4) 5.193 (0) 33.397 (17,4) TABLE I: Average robot position RMSE in meters with the number of catastrophic failures and number of instances where there was no solution in bold brackets as odometery and range bearing sensor noise are varied. For each noise and map combination, 50 simulations were conducted and the RMSE in pose estimation was averaged over these simulations (excluding runs for which GTSAM did not converge to a solution). [3] Nicolas Boumal, Bamdev Mishra, P.-A. Absil, and Rodolphe Sepulchre. Manopt, a matlab toolbox for optimization on manifolds. Journal of Machine Learning Research, 15, 2014. URL http://jmlr.org/papers/v15/boumal14a.html. [4] L. Carlone and A. Censi. From angular manifolds to the integer lattice: Guaranteed orientation estimation with application to pose graph optimization. IEEE Transactions on Robotics, 30(2):475–492, April 2014. ISSN 1552-3098. [5] L. Carlone, R. Tron, K. Daniilidis, and F. Dellaert. Initialization techniques for 3d slam: A survey on rotation estimation and its use in pose graph optimization. In 2015 IEEE International Conference on Robotics and Automation (ICRA), pages 4597–4604, May 2015. doi: 10.1109/ICRA.2015.7139836. [6] Luca Carlone, Rosario Aragues, Jos A. Castellanos, and Basilio Bona. A fast and accurate approximation for planar pose graph optimization. The International Journal of Robotics Research, 33(7):965–987, 2014. [7] M. Csorba, J. K. Uhlmann, and H. F. Durrant-Whyte. A sub-optimal algorithm for automatic map building. In American Control Conference, 1997. Proceedings of the 1997, volume 1, pages 537–541 vol.1, Jun 1997. [8] Frank Dellaert. Factor graphs and gtsam: A hands-on introduction. 2012. [9] Frank Dellaert and Michael Kaess. Square root sam: Simultaneous localization and mapping via square root information smoothing. The International Journal of Robotics Research, 25(12):1181–1203, 2006. [10] Leo Dorst. First order error propagation of the procrustes method for 3d attitude estimation. IEEE transactions on pattern analysis and machine intelligence, 27(2): 221–229, 2005. [11] J. Folkesson and H. Christensen. Graphical slam - a self-correcting map. In Robotics and Automation, 2004. Proceedings. ICRA ’04. 2004 IEEE International Conference on, volume 1, pages 383–390 Vol.1, April 2004. [12] M. Kaess, A. Ranganathan, and F. Dellaert. iSAM: Incremental smoothing and mapping. IEEE Trans. on Robotics (TRO), 24(6):1365–1378, December 2008. [13] Michael Kaess, Viorela Ila, Richard Roberts, and Frank Dellaert. Algorithmic Foundations of Robotics IX: Selected Contributions of the Ninth International Workshop on the Algorithmic Foundations of Robotics, chapter The Bayes Tree: An Algorithmic Foundation for Probabilistic Robot Mapping, pages 157–173. Springer Berlin Heidelberg, Berlin, Heidelberg, 2011. [14] Michael Kaess, Hordur Johannsson, Richard Roberts, Viorela Ila, John J Leonard, and Frank Dellaert. isam2: Incremental smoothing and mapping using the bayes tree. The International Journal of Robotics Research, 31(2):216–235, 2012. doi: 10.1177/0278364911430419. [15] K. Khosoussi, S. Huang, and G. Dissanayake. Novel insights into the impact of graph structure on slam. In 2014 IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 2707–2714, Sept 2014. [16] K. Khosoussi, Shoudong Huang, and G. Dissanayake. Tree-connectivity: Evaluating the graphical structure of slam. In 2016 IEEE International Conference on Robotics and Automation (ICRA), pages 1316–1322, May 2016. [17] Kasra Khosoussi, Shoudong Huang, and Gamini Dissanayake. Exploiting the separable structure of slam. In Proceedings of Robotics: Science and Systems, Rome, Italy, July 2015. doi: 10.15607/RSS.2015.XI.023. [18] K. Konolige, G. Grisetti, R. Kmmerle, W. Burgard, B. Limketkai, and R. Vincent. Efficient sparse pose adjustment for 2d mapping. In Intelligent Robots and Systems (IROS), 2010 IEEE/RSJ International Conference on, pages 22–29, Oct 2010. doi: 10.1109/IROS.2010.5649043. [19] F. Lu and E. Milios. Globally consistent range scan alignment for environment mapping. Auton. Robots, 4(4):333–349, October 1997. ISSN 0929-5593. doi: 10.1023/A:1008854305733. [20] I. Mahon, S. B. Williams, O. Pizarro, and M. Johnson-Roberson. Efficient viewbased slam using visual loop closures. IEEE Transactions on Robotics, 24(5): 1002–1014, Oct 2008. [21] Agostino Martinelli, Viet Nguyen, Nicola Tomatis, and Roland Siegwart. A relative map approach to slam based on shift and rotation invariants. Robotics and Autonomous Systems, 55(1):50–61, 2007. [22] Paul M. Newman and Hugh F. Durrant-Whyte. Geometric projection filter: an efficient solution to the slam problem. Proc. SPIE, 4571:22–33, 2001. [23] Cdric Pradalier and Sepanta Sekhavat. Simultaneous localization and mapping using the geometric projection filter and correspondence graph matching. Advanced Robotics, 17(7):675–690, 2003. [24] G. Sibley, C. Mei, I. Reid, and P. Newman. Adaptive relative bundle adjustment. In Proceedings of Robotics: Science and Systems, Seattle, USA, June 2009. doi: 10.15607/RSS.2009.V.023. [25] Randall Smith, Matthew Self, and Peter Cheeseman. A stochastic map for uncertain spatial relationships. In Proceedings of the 4th International Symposium on Robotics Research, pages 467–474, Cambridge, MA, USA, 1988. MIT Press. ISBN 0-262-02272-9. URL http://dl.acm.org/citation.cfm?id=57425.57472. [26] Sebastian Thrun and Michael Montemerlo. The graph slam algorithm with applications to large-scale mapping of urban structures. The International Journal of Robotics Research, 25(5-6):403–429, 2006. URL http://ijr.sagepub.com/content/ 25/5-6/403.abstract. [27] Zhan Wang, Shoudong Huang, and Gamini Dissanayake. D-slam: A decoupled solution to simultaneous localization and mapping. The International Journal of Robotics Research, 26(2):187–204, 2007. doi: 10.1177/0278364906075173. A PPENDIX A R ELATIVE M EASUREMENTS AND ROTATIONS IN 2D Parameterizing the Direction Cosine Matrix: Let the rotation from pose xp to xq be δθ. The DCM Cqp for the relative rotation δθ between xp and xq is,   cos(δθ) −sin(δθ) Cqp = . (19) sin(δθ) cos(δθ) Thus in planar scenarios the matrix Cqp is parameterized by the 2-vector cqp = [cos(δθ), sin(δθ)]T . Relative Feature Measurements-based Constraints on Orientation: Let a robot make observations to two landmarks li and lj from poses xp and xq as shown in Fig. 3(b). Observing this pair of landmarks from both poses forms a relative orientation l ij constraint Cqp between xp and xq . Let l dij p and dq be the relative feature measurements made from xp and xq respectively, then we have the following relation l ij dp = Cqp l dij q . Using Eq. 19 in this relation and rearranging, we have the following constraint on the relative orientation parameters, " # " #  l ij l ij dp,x dq,x −l dij cos(δθ) q,y . (20) = l ij l ij l ij sin(δθ) dp,y dq,y dq,x {z } | B0qp Projection onto SO(2) Manifold: As discussed in Section IV-B1, solving Eq. 7 or Eq. 5 does not provide an orthogonal rotation as the solution. Thus the linear least squares solution ĉ is projected back on the SO2 manifold by normalization ĉnormalized = η(ĉ) = Followed by computing the Jacobian ĉ . ||ĉ|| (21) ¯ = q 1 ∇η c21 + c22 c22 −c2 c1   −c2 c1 , 2 c1 (22) and then transforming the covariance given by the linear problem as ¯ ¯T Σcnormalized = ∇ηΣ c ∇ η. We drop the normalized subscript for readability. From the projected DCM parameters we can compute the rotation angle −1 δ θ̂ = tan ( c2 ). c1 (23)
3cs.SY
RICCI FLOW AND DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS arXiv:1712.06197v1 [math.DG] 17 Dec 2017 RICHARD H. BAMLER AND BRUCE KLEINER Abstract. We complete the proof of the Generalized Smale Conjecture, apart from the case of RP 3 , and give a new proof of Gabai’s theorem for hyperbolic 3manifolds. We use an approach based on Ricci flow through singularities, which applies uniformly to spherical space forms other than S 3 and RP 3 and hyperbolic manifolds, to prove that the moduli space of metrics of constant sectional curvature is contractible. As a corollary, for such a 3-manifold X, the inclusion Isom(X, g) → Diff(X) is a homotopy equivalence for any Riemannian metric g of constant sectional curvature. Contents 1. Introduction 2. Preliminaries 3. The canonical limiting constant curvature metric 4. Extending constant curvature metrics 5. Proof of Theorem 1.2 for spherical space forms 6. Proof of Theorem 1.2 for hyperbolic manifolds References 1 6 16 19 25 26 28 1. Introduction Let X be a compact connected smooth 3-manifold. We let Diff(X) and Met(X) denote the group of smooth diffeomorphisms of X, and the set of Riemannian metrics on X, respectively, equipped with their C ∞ -topologies. Our focus in this paper will be on the following conjecture: Conjecture 1.1 (Generalized Smale Conjecture [Sma61, Gab01, HKMR12]). If g is a Riemannian metric of constant sectional curvature ±1 on X, then the inclusion Isom(X, g) ,→ Diff(X) is a homotopy equivalence. Date: December 19, 2017. The first author was supported by a Sloan Research Fellowship and NSF grant DMS-1611906. The second author was supported by NSF grants DMS-1405899, DMS-1406394, DMS-1711556, and a Simons Collaboration grant. 1 2 RICHARD H. BAMLER AND BRUCE KLEINER Smale’s original conjecture was for the case X = S 3 [Sma61]. Cerf proved that the inclusion Isom(S 3 , g) → Diff(S 3 ) induces a bijection on path components [Cer64a, Cer64b, Cer64c, Cer64d], and the full conjecture was proven by Hatcher [Hat83]. Hatcher used a blend of combinatorial and smooth techniques to show that the space of smoothly embedded 2-spheres in R3 is contractible. This is equivalent to the assertion that O(4) ' Isom(S 3 , g) → Diff(S 3 ) is a homotopy equivalence when g has sectional curvature 1. Other spherical space forms were studied starting in the late 1970s. Through the work of a number of authors it was shown that the inclusion Isom(X) → Diff(X) induces a bijection on path components for any spherical space form X [Asa78, Rub79, CS79, Bon83, RB84, BO91]. Conjecture 1.1 was previously known for certain spherical space forms – those containing geometrically incompressible one-sided Klein bottles (prism and quaternionic manifolds), as well as Lens spaces other than RP 3 [Iva82, Iva84, HKMR12]. The conjecture was proven for hyperbolic manifolds by Hatcher and Ivanov in the Haken case [Iva76, Hat76] (extending the earlier work of Waldhausen and Laudenbach [Wal68, Lau74]) and by Gabai in general [Gab01]. We recommend [HKMR12, Section 1] for a nice discussion of these results and other background on diffeomorphism groups. In this paper we will use Ricci flow through singularities to prove: Theorem 1.2. Let (X, g) be a compact connected Riemannian 3-manifold of constant sectional curvature k ∈ {±1}, other than S 3 or RP 3 , and let MetK≡k (X) ⊂ Met(X) be the moduli space of Riemannian metrics on X of constant sectional curvature k. Then MetK≡k (X) is contractible. By a well-known argument (see Lemma 2.2), the contractibility of MetK≡k (X) is equivalent to the validity of the Generalized Smale Conjecture for X. Hence Theorem 1.2 confirms the Generalized Smale Conjecture for several new infinite families of spherical space forms (tetrahedral, octahedral, and icosahedral manifolds), thereby completing the proof of the Generalized Smale Conjecture, apart from the RP 3 case. It also provides a new proof for the other spherical space forms, and for hyperbolic manifolds. The proof of Theorem 1.2 exploits Ricci flow through singularities as developed in the papers [KL14, BKb], and gives a conceptually simple treatment that works uniformly for all manifolds X as in the theorem. By contrast, the previously known cases of Theorem 1.2 were established using traditional tools from 3-manifold topology. They rely on the presence of certain types of distinguished surfaces: geometrically incompressible Klein bottles or surfaces obtained from sweepouts in the spherical space form cases [Iva82, Iva84, HKMR12], or canonical solid tori arising from the Gabai’s insulator techniques in the hyperbolic case [Gab01]. The method used in this paper breaks down for S 3 and RP 3 due to the geometric structure of the “thin” part of a Ricci flow through singularities. We will treat these cases in a separate paper [BKa] using a more involved approach (still based on Ricci flow). Ricci flow also gives a strategy for analyzing diffeomorphism groups of some other families of 3-manifolds. We will discuss this in a forthcoming paper. DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 3 We remark that it has been a longstanding question whether it is possible to use techniques from geometric analysis to analyze diffeomorphism groups in dimension 3. There are variety of natural variational approaches to studying the space of 2-spheres in R3 (or S 3 ) that break down due to the absence of a Palais-Smale condition, because there are too many critical points, or because the natural gradient flow does not respect embeddedness; analogous issues plague other strategies based more directly on diffeomorphisms. Theorem 1.2 is the first instance where techniques from geometric analysis have been successfully applied to the study of diffeomorphism groups of 3-manifolds. This success depends crucially on the recent results establishing existence and uniqueness of Ricci flow through singularities for arbitrary initial conditions [KL14, BKb]. Informal sketch of proof. Let X be as in the statement of Theorem 1.2. To simplify notation we will focus on the case in which X is a spherical space form; at the end we comment on the modifications needed for the hyperbolic case. Thus our aim is to show that MetK≡1 (X) is contractible, which reduces to showing that all of its homotopy groups are trivial. Let gX ∈ MetK≡1 (X) be a reference metric. It is a classical fact that any two metrics in MetK≡1 (X) are isometric. Before proceeding, we first recall some the properties of Ricci flow through singularities, as established in [KL14, BKb]. We keep the discussion informal, and refer the reader to Section 2 for precise definitions and references. For every g ∈ Met(X), there exists a singular Ricci flow with initial data (X, g). This is a Ricci flow spacetime, i.e. a 4-manifold M equipped with a time function t and time vector field ∂t , as well as a Riemannian metric along time slices that satisfies the Ricci flow equation. Locally, the spacetime looks like an a piece of a Ricci flow defined for a short time in some open subset of U ⊂ R3 , and the trajectories of the time vector field ∂t correspond to the spacetime tracks of points that are motionless. The time-t slice Mt of M is the result of evolving the metric (X, g) under Ricci flow for a duration t. For small t ≥ 0 this corresponds to the usual Ricci flow, but singularities may develop subsequently, which can result in noncompact time slices. Although the structure of the spacetime may be rather complicated, it still has good topological and geometric properties: (a) For every t, at most one connected component of the time slice Mt is diffeomorphic to X with possibly finitely many punctures, while the remaining components are topologically trivial – copies of S 3 with possibly finitely many punctures. (b) There is a T < ∞, depending only on bounds on the geometry of g, such that Mt = ∅ for t ≥ T . We establish this fact using the extinction results from [CM05, Per03a], and the fact that X is prime and not aspherical. (c) Let ω(g) ∈ (0, T ] be the supremum of the times t ∈ [0, ∞) for which Mt has a topologically nontrivial component. As t → ω(g), the time slice Mt 4 RICHARD H. BAMLER AND BRUCE KLEINER t ω(g) t St Ct ∂t (X, g) 0 Wg Figure 1. A Ricci flow spacetime M (aka singular Ricci flow) with initial data (X, g). The time function t is expressed as height function and the arrows indicate the time vector field ∂t . The dashed level sets indicate time slices (the second and third time slices are singular). For all t < ω(g) the time-t-slice contains exactly one component Ct that is not diffeomorphic to a sphere. The flow of ∂t restricted to W is defined on the time interval [0, ω(g)). The union of these trajectories is shaded in dark gray. For each t the trajectory of ∂t starting from each but a finite set of points St ⊂ Ct intersects the time-0-slice. These points are drawn as dark dots and their trajectories, which cease to exist at a singular time, as dotted curves. has a unique component Ct diffeomorphic to X, and Ct becomes asymptotically round as t → ω(g), i.e. the family of Riemannian manifolds (Ct )t<ω(g) converges, modulo rescaling, to (X, gX ). We remark that assertion (c) is based on rigidity properties of κ-solutions (the geometric models for the large curvature part of M), and it makes use of the assumption that X is not diffeomorphic to S 3 or RP 3 in order to exclude more complicated geometric behavior as t → ω(g). Now consider a time t < ω(g) close to ω(g). By [KL14], there is a finite subset St ⊂ Ct such that the entire complement Ct \ St lies in the domain of the time-(−t)flow of the time vector field. In other words, every point in Ct \ St lies on a trajectory DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 5 of the time vector field starting from the time-0 slice M0 = (X, g). Hence we may pushforward the metric on Ct \ St under the flow, to obtain a Riemannian metric ǧt on open subset Wg (t) of the time-0 slice M0 = X. We prove that ǧt converges, modulo rescaling, to a metric ǧ ∈ MetK≡1 (Wg ), where Wg ⊂ X is an open subset, and the Riemannian manifold (Wg , ǧ) is isometric (X \ Sg , gX ) for some finite set Sg . To summarize, using singular Ricci flow we have taken an arbitrary Riemannian metric g ∈ Met(X), and produced a Riemannian metric of constant sectional curvature 1, albeit one defined only on some open subset Wg ⊂ X. We point out that although Wg might in principle be rather wild, it still contains the interesting topology of X because it is diffeomorphic to X \ Sg for some finite set Sg ⊂ X. Note that if g has constant sectional curvature 1, then M corresponds to an ordinary Ricci flow and we have Ct = Mt , Wg (t) = X for all t < ω(g), and (Wg , ǧ) = (X, g). Since the singular Ricci flow M is unique up to isometry [BKb], the partially defined constant curvature metric (Wg , ǧ) is canonically attached to g. Furthermore, using the stability theorem [BKb] and [FGKO15], we show that (Wg , ǧ) depends continuously on g, in an appropriate sense. We now return to the task of showing that the homotopy groups of MetK≡1 (X) are trivial. Pick m ≥ 0, and consider a (continuous) map h : S m → MetK≡1 (X). Our goal is to extend h to a map ĥ : Dm+1 → MetK≡1 (X). Since Met(X) is contractible, there is h an extension g : Dm+1 → Met(X) of the composition S m → MetK≡1 (X) ,→ Met(X). For every p ∈ Dm+1 , let (Wg(p) , ǧ(p)) be the partially defined metric described in the preceding paragraphs. Note that (Wg(p) , ǧ(p)) = (X, g(p)) when p ∈ S m . To complete the proof, we show that after shrinking Wg(p) slightly, one can extend ǧ(p) to a metric b h(p) with sectional curvature 1 defined on all of X, where b h(p) depends continuously on p. We now give an indication of the extension process. Pick p ∈ Dm+1 . Since Wg(p) is diffeomorphic to X \ Sg(p) and X is irreducible, there is a compact domain with boundary Zp ⊂ Wp , such that the closure X \ Zp is a finite disjoint collection of closed 3-disks. We would like to extend the restriction ǧ(p)|Zp across each of the 3-disk components of X \ Zp to obtain b h(p) ∈ MetK≡1 (X). Pick one such 3-disk D. It is not hard to see that the extension problem is equivalent to an extension problem for embeddings: for a suitable open neighborhood U of the boundary ∂D in D, one is given a smooth embedding of U into the round 3-sphere, and one has to extend this to an embedding D → S 3 . Hatcher’s theorem [Hat83] implies that this problem has a contractible solution set. To handle the full extension problem, we take a suitable fine triangulation of Dm+1 , and carry out a parametrized analog of this extension procedure, by induction over the skeleta. This is similar in spirit to an argument using obstruction theory, where the obstruction group is trivial. 6 RICHARD H. BAMLER AND BRUCE KLEINER We now discuss the hyperbolic case. Suppose X is a hyperbolic manifold, and pick a hyperbolic metric gX ∈ MetK≡−1 (X); for simplicity we assume here that X is orientable. Any g ∈ Met(X) can be evolved into a singular Ricci flow M as before. Its properties are similar to those in the spherical space form case, except that assertions (b) and (c) have to be modified: for every t ∈ [0, ∞) there is a unique component Ct of Mt that is diffeomorphic to a punctured copy of X, and as t → ∞ the family of Riemannian manifolds (Ct )t<∞ converges, modulo rescaling, to (X, gX ). Proceeding as before we use this to construct a canonical partially defined metric (Wg , ǧ) with sectional curvature −1, where Wg ⊂ X, and (Wg , ǧ) is isometric to (X \ Sg , gX ) for some finite subset Sg ⊂ X. The rest of the proof is essentially the same as for spherical space forms. Remark 1.3. We point out that one may use singular Ricci flow to show that any two metrics g(0), g(1) ∈ MetK≡1 (X) are isometric, without appealing to Reidemeister or Whitehead torsion [Mil66]. (Of course the Ricci flow proof is vastly more complicated than proofs using torsion, since it invokes Perelman’s work as well as [BKb].) The idea is as follows. Let g : [0, 1] → Met(X) be a path from g(0) to g(1). For every p ∈ [0, 1], we let Mp be the singular Ricci flow with Mp0 = (X, gt ). As explained in the sketch above, the spacetime Mp contains a family {Ctp } of time slices that become asymptotically round as t → ω(g(p)). This may be used to construct p a family {(C , g(p))}p∈[0,1] of compact Riemannian manifolds with constant sectional curvature 1 which interpolates between (X, g(0)) and (X, g(1)) and which varies continuously in the smooth topology on Riemannian manifolds. Therefore the set of isometry classes of such metrics, equipped with the smooth topology on Riemannian manifolds, is connected. On the other hand, one knows that the space of isometry classes is finite: this follows from the isometric classification of spherical space forms, or alternatively, from a simple general argument based on the finiteness of the set of irreducible representations of a finite group. Hence it contains a single point. The same remark also applies to the hyperbolic case – using singular Ricci flow one can give a new proof of Mostow rigidity assuming only local rigidity of hyperbolic metrics (in the appropriate form). However, to carry this out one would have to modify the existing large-time analysis slightly so that it only invokes local rigidity rather than Mostow-Prasad rigidity. 2. Preliminaries 2.1. Spaces of maps and metrics. If M , N are smooth manifolds with boundary, we let Embed(M, N ) denote the set of smooth embeddings M → N equipped with ∞ the Cloc -topology. If M is a smooth manifold, we let Met(M ) denote the set of smooth Riemannian ∞ metrics on M equipped with the Cloc -topology. For k ∈ R, we let MetK≡k (M ) be the subspace of metrics with constant sectional curvature k. DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 7 We will need the following consequence of the Smale Conjecture [Hat83]. Lemma 2.1. Let Embed+ (D3 , S 3 ) ⊂ Embed(D3 , S 3 ) be the subset of orientationpreserving embeddings, and let π : Embed+ (D3 , S 3 ) −→ Embed(S 2 , S 3 ) be the map induced by restriction. Then: (a) π : Embed+ (D3 , S 3 ) −→ Embed(S 2 , S 3 ) is a fiber bundle with contractible fiber. (b) Let m ≥ 0. Suppose φm+1 : Dm+1 → Embed(S 2 , S 3 ) is a continuous map and φbm : S m → Embed+ (D3 , S 3 ) is a lift of φm+1 |S m , i.e. π ◦ φbm = φm+1 |S m . Then there is an extension φbm+1 : Dm+1 → Embed+ (D3 , S 3 ) of φbm that is a lift of φm+1 . Proof. The fact that π is a fiber bundle is a standard consequence of isotopy extension, which we briefly recall (see [HKMR12]). Given f0 ∈ Embed(S 2 , S 3 ) there is an open neighborhood N (f0 ) of f0 and a continuous map Φ : N (f0 ) → Diff(S 3 ) such that for all f ∈ N (f0 ) we have f = Φ(f ) ◦ f0 . The map Φ may be obtained by constructing a locally defined isotopy near f0 (S 2 ) using normal exponential maps, and then gluing this to the identity map with a partition of unity. Letting F := π −1 (f0 ), we obtain a bundle chart N (f0 ) × F → π −1 (N (f0 )) for π by sending (f, φ) to Φ(f ) ◦ φ. By [Hat83, p.604], the subset n o Diff(D3 rel∂D3 ) := α ∈ Diff(D3 ) | α|S 2 = idS 2 is contractible. If φ0 ∈ F , then we obtain a homeomorphism n o 3 3 3 2 Diff(D rel∂D ) := α ∈ Diff(D ) | α|S 2 = idS −→ F by sending α to φ0 ◦ α. Hence F is also contractible. Thus assertion (a) holds. Since π is a fiber bundle with contractible fiber, any map can be lifted relative to its boundary. Hence assertion (a) holds.  The following is well-known: Lemma 2.2. Let X be a compact connected 3-manifold, and gX ∈ MetK≡k (X) for k ∈ {±1}. Then: • There is a fibration Diff(X) → MetK≡k (X) with fiber homeomorphic to Isom(X, gX ). • Diff(X) and MetK≡k (X) are homotopy equivalent to CW complexes. • MetK≡k (X) is contractible if and only if the inclusion Isom(X, gX ) → Diff(X) is a homotopy equivalence. 8 RICHARD H. BAMLER AND BRUCE KLEINER Sketch of proof. The metric gX is unique up to isometry; this follows from Mostow rigidity when k = −1, and by the isometric and smooth classification of spherical space forms when k = 1. Therefore the action Diff(X) y MetK≡k (X) by pushforward is transitive, with stabilizer Isom(X, gX ). The space MetK≡k (X) is then homeomorphic to the orbit space Diff(X)/ Isom(X, gX ), and we have a fibration Diff(X) → MetK≡k (X) with fiber homeomorphic to Isom(X, gX ). The diffeomorphism group Diff(X) is a Frechet manifold that is locally diffeomorphic to the space ΓC ∞ (T X) of C ∞ vector fields on X. Using the orbit space representation, one gets that MetK≡k (X) is a separable Frechet manifold modelled on a finite codimension closed subspace of ΓC ∞ (T X). Hence both spaces have the homotopy type of CW complexes. Finally, using the exact homotopy sequence of the fibration Diff(X) → MetK≡k (X), we get MetK≡k (X) is contractible ⇐⇒ MetK≡k (X) is weakly contractible ⇐⇒ The inclusion Isom(X, gX ) → Diff(X) is a weak homotopy equivalence ⇐⇒ The inclusion Isom(X, gX ) → Diff(X) is a homotopy equivalence.  We will also work with the collection of Riemannian metrics defined on different subsets of a given manifold. Definition 2.3 (Topology on partially defined metrics). Let M be a smooth manifold, and let PartMet(M ) be the set of partially defined Riemannian metrics on M , i.e. the set of pairs (U, h) where U ⊂ M is open and h is a smooth Riemannian metric on U . We topologize PartMet(M ) as follows. For every (U0 , h0 ) ∈ PartMet(M ), K ⊂ U0 compact, k < ∞, and  > 0, we let U(U0 , h0 , K, k, ) := {(U, h) ∈ PartMet(X) | K ⊂ U, k(∇jh0 (h − h0 ))(x)kh0 <  for all x ∈ K, j ≤ k} . The collection of all such subsets U(U0 , h0 , K, k, ) is a basis for the topology on PartMet(X). Note that if Z is a metric space, then in order to verify that a map Z 3 z 7→ (U (z), g(z)) ∈ PartMet(M ) is continuous, it suffices to show that if zj → z∞ ∈ Z, then for every compact subset K ⊂ U (z∞ ) we have K ⊂ U (zj ) for large j, and ∇kg(z∞ ) (g(zj ) − g(z∞ )) → 0 uniformly on K. Remark 2.4. The topology on PartMet(M ) has the somewhat alarming property of being non-Hausdorff. This is due to the fact that it formalizes the lower semicontinuous dependence of the open set U . It may be compared to the non-Hausdorff topology on R generated by the set of open rays {(a, ∞)}a∈R , which may be used to characterize lower semicontinuous real-valued functions X → R. DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 9 2.2. Closeness and convergence of Riemannian manifolds. We now recall notions of closeness for Riemannian manifolds. Definition 2.5 (Geometric closeness). We say that a pointed Riemannian manifold (M, g, x) is -close to another pointed Riemannian manifold (M , g, x) at scale λ > 0 if there is a diffeomorphism onto its image ψ : B M (x, −1 ) −→ M such that ψ(x) = x and λ−2 ψ ∗ g − g −1 ] C [ (B M (x,−1 )) < . −1 Here the C [ ] -norm of a tensor h is defined to be the sum of the C 0 -norms of −1 the tensors h, ∇g h, ∇g,2 h, . . . , ∇g,[ ] h with respect to the metric g. We say that (M, g, x) is -close to (M , g, x) if it is -close at scale 1. We have analogous notions for (unpointed) Riemannian manifolds: (M, g) is -close to (M , g) if there is a diffeomorphism ψ : M → M such that ψ∗g − g −1 ] C [ (M ) < . The notion of closeness provides a notion of convergence of sequences (or families) of Riemannian manifolds, in the usual way. 2.3. Ricci flow spacetimes. We now recall the properties of singular Ricci flows that will be essential in this paper. We refer the reader to [KL14, BKb] for more details. Definition 2.6 (Ricci flow spacetimes). A Ricci flow spacetime (starting at time a ∈ R) is a tuple (M, t, ∂t , g) with the following properties: (1) M is a smooth 4-manifold with (smooth) boundary ∂M. (2) t : M → [a, ∞) is a smooth function without critical points (called time function). For any t ≥ a we denote by Mt := t−1 (t) ⊂ M the time-t-slice of M. (3) We have Ma = t−1 (a) = ∂M, i.e. the initial time-slice is equal to the boundary of M. (4) ∂t is a smooth vector field (the time vector field), which satisfies ∂t t ≡ 1. (5) g is a smooth inner product on the spatial subbundle ker(dt) ⊂ T M. For any t ≥ a we denote by gt the restriction of g to the time-t-slice Mt (note that gt is a Riemannian metric on Mt ). (6) g satisfies the Ricci flow equation: L∂t g = −2 Ric(g). Here Ric(g) denotes the symmetric (0, 2)-tensor on ker(dt) that restricts to the Ricci tensor of (Mt , gt ) for all t ≥ a. 10 RICHARD H. BAMLER AND BRUCE KLEINER For any interval I ⊂ [a, ∞) we also write MI = t−1 (I) and call this subset the time-slab of M over the time interval I. Curvature quantities on M, such as the Riemannian curvature tensor Rm, the Ricci curvature Ric, or the scalar curvature R will refer to the corresponding quantities with respect to the metric gt on each timeslice. Tensorial quantities will be embedded using the splitting T M = ker(dt) ⊕ h∂t i. Unless otherwise specified, we will implicitly take a = 0. When there is no chance of confusion, we will usually abbreviate the tuple (M, t, ∂t , g) by M. Definition 2.7 (Survival). Let (M, t, ∂t , g) be a Ricci flow spacetime and x ∈ M be a point. Set t := t(x). Consider the maximal trajectory γx : I → M, I ⊂ [0, ∞) of the time-vector field ∂t such that γx (t) = x. Note that then t(γx (t0 )) = t0 for all t0 ∈ I. For any t0 ∈ I we say that x survives until time t0 , and we write x(t0 ) := γx (t0 ). Similarly, if X ⊂ Mt is a subset in the time-t time-slice, then we say that X survives until time t0 if this is true for every x ∈ X and we set X(t0 ) := {x(t0 ) : x ∈ X}. A product Ricci flow spacetime is a Ricci flow spacetime associated with an ordinary Ricci flow (g(t))t∈[a,T ) on a manifold M , i.e. it is of the form (M ×[a, T ), t, ∂t , g), where t = π[a,T ) is projection onto the interval factor [a, T ), ∂t corresponds to the vec∗ g(t) where πM : M × [a, T ) → M is the tor field coming from [a, T ), and gt = πM canonical projection. Definition 2.8 (Product domain). Let (M, t, ∂t , g) be a Ricci flow spacetime and let X ⊂ M be a subset. We call X a product domain if there is an interval I ⊂ [0, ∞) such that for any t ∈ I any point x ∈ X survives until time t and x(t) ∈ X. Definition 2.9 (Completeness of Ricci flow spacetimes). We say that a Ricci flow spacetime (M, t, ∂t , g) is 0-complete if, whenever γ : [0, s0 ) → M is either an integral curve of ±∂t or a unit speed curve in some time slice, and sups∈[0,s0 ) | Rm |(γ(s)) < ∞, then lims→s0 γ(s) exists. The next lemma states that maximal product domains in 0-complete Ricci flow spacetimes correspond to ordinary Ricci flows, provided their time slices are compact manifolds. Lemma 2.10. Let (M, t, ∂t , g) be a 0-complete Ricci flow spacetime, t0 ≥ 0, and C ⊂ Mt0 be a compact 3-dimensional submanifold without boundary (i.e. a finite union of compact components). Let C ⊂ M be the maximal product domain in M≥t0 with initial time slice C, and (h(t))t∈[t0 ,T ) be the maximal Ricci flow on C whose initial metric h(t0 ) is equal to the restriction of the time slice metric gt0 to C ⊂ Mt0 . Then C is isometric to the product Ricci flow spacetime associated with (h(t))t∈[t0 ,T ) . Proof. Let I ⊂ [t0 , ∞) be the time interval on which C is defined. The compactness of C implies that I = [t0 , t+ ) for some t+ ∈ (t0 , ∞]. For t ∈ [t0 , t+ ), let gt,t0 be the DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 11 Riemannian metric on C obtained by pushing forward g |Ct under the time-(t0 − t) flow of the time vector field ∂t . It follows from the definition of Ricci flow spacetimes that the family of metrics (gt,t0 )t∈[t0 ,t+ ) defines a Ricci flow. By the uniqueness of Ricci flow, we therefore have gt,t0 = h(t) for t < min(T, t+ ). It follows that t+ ≤ T . Suppose t+ < T . Choose x ∈ C. Since t+ < T , the curvature |Rm|(x(t)) remains uniformly bounded for t ∈ [t0 , t+ ), and hence by 0-completeness, x survives until time t+ , and hence to some t0 > t+ . By continuity of the flow of ∂t , an open neighborhood of x in C survives until some time tx > t+ . By compactness C survives until some time t0 > t+ , which is a contradiction.  2.4. Singular Ricci flows. To define singular Ricci flows, we require the definition of a κ-solution. Definition 2.11 (κ-solution). An ancient Ricci flow (M, (g(t))t∈(−∞,0] ) on a 3-dimensional manifold M is called a (3-dimensional) κ-solution, for κ > 0, if the following holds: (1) (2) (3) (4) (5) (M, g(t)) is complete for all t ∈ (−∞, 0], |Rm| is bounded on M × I for all compact I ⊂ (−∞, 0], secg(t) ≥ 0 on M for all t ∈ (−∞, 0], R > 0 on M × (−∞, 0], (M, g(t)) is κ-noncollapsed at all scales for all t ∈ (−∞, 0] (This means that for any (x, t) ∈ M × (−∞, 0] and any r > 0 if |Rm| ≤ r−2 on the time-t ball B(x, t, r), then we have |B(x, t, r)| ≥ κrn for its volume.) We can now define the canonical neighborhood assumption. This characterizes the local geometry of a Ricci flow spacetime by the geometry of κ-solution using the notion of pointed closeness from Definition 2.5. The main statement of this assumption is that regions of small scale (i.e. high curvature) are geometrically close to regions of κ-solutions. Definition 2.12 (Canonical neighborhood assumption). Let (M, g) be a (possibly incomplete) Riemannian manifold. We say that (M, g) satisfies the -canonical neighborhood assumption at some point x if there is a κ > 0, a κ-solution (M , (g(t))t∈(−∞,0] ) and a point x ∈ M such that |Rm|(x, 0) = 1 and such that (M, g, x) is -close to (M , g(0), x) at some (unspecified) scale λ > 0. For r > 0, we say that a subset X of a Ricci flow spacetime (M, t, ∂t , g) satisfies the -canonical neighborhood assumption at scales below r if the -canonical neighborhood assumption holds at all x ∈ X with |Rm|(x) > r−2 . Definition 2.13 (Singular Ricci flow). If  > 0 and r : [0, ∞) → (0, ∞) is a nonincreasing function, then an (, r)-singular Ricci flow is an orientable Ricci flow spacetime (M, t, ∂t , g) such that: • The initial time slice M0 is compact. 12 RICHARD H. BAMLER AND BRUCE KLEINER • M is 0-complete. • M[0,t] satisfies the -canonical neighborhood assumption at scales < r(t). A singular Ricci flow is a Ricci flow spacetime that is an (, r)-singular Ricci flow for some , r. We remark that our notion of singular Ricci flow here is equivalent to the one in [BKb], which is weaker than the one in [KL14]. The existence theorem in [KL14] yields singular Ricci flows satisfying the stronger condition. Theorem 2.14 (Existence and uniqueness of singular Ricci flow). • (Existence [KL14]) For every compact orientable Riemannian 3-manifold (M, g) there is a singular Ricci flow M with M0 isometric to (M, g). Moreover, for every  > 0 there is an r : [0, ∞) → (0, ∞) such that M is an (, r)singular Ricci flow, where r depends only on  and an upper bound on | Rm | and a lower bound on the injectivity radius of M . • (Uniqueness [BKb]) There is a universal constant can > 0 such that if M1 , M2 are (can , r)-singular Ricci flows for some r : [0, ∞) → (0, ∞), then any isometry φ : M10 → M20 extends to an isometry φb : M1 → M2 . Theorem 2.15 (Convergence of singular Ricci flows). Suppose {hj } is a sequence of smooth Riemannian metrics on a compact orientable 3-manifold M , and hj → h∞ smoothly as j → ∞. For j ∈ N ∪ ∞, let (Mj , tj , ∂tj , g j ) be a singular Ricci flow with time-0 slice (M, hj ), and for every T, C < ∞, let MjT,C := {x ∈ Mj | t(x) ≤ T, |Rm| ≤ C} . Φj Then there is a sequence {M∞ ⊃ U j −→ V j ⊂ Mj } where: (1) U j , V j are open, and Φj is a diffeomorphism. j j (2) For every T , C, we have U j ⊃ M∞ T,C , V ⊃ MT,C . for large j. (3) Φj is time-preserving, and the sequences {(Φj )∗ ∂tj }, {(Φj )∗ g j } converge smoothly on compact subsets M∞ to ∂t∞ and g ∞ , respectively. If M is a manifold, then a punctured copy of M is a manifold diffeomorphic to M \ S, where S ⊂ M is a finite (possibly empty) subset. Note that if M1 , M2 are compact 3-manifolds, then punctured copies of M1 and M2 can be diffeomorphic only if M1 is diffeomorphic to M2 . This follows from the fact that if D, D0 are 3-disks where D0 ⊂ Int D, then D \ D0 is diffeomorphic to S 2 × [0, 1]. Hence the notion of “filling in” punctures is well-defined. The following result collects most of the topological and geometric properties of singular Ricci flows that will be needed in this paper. Theorem 2.16 (Structure of singular Ricci flows). Let (M, t, ∂t , g) be an (can , r)singular Ricci flow, where can is as in Theorem 2.14. Then: (1) For every t ∈ [0, ∞), each component C ⊂ Mt is a punctured copy of some compact 3-manifold. DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 13 be the (possibly empty) 3-manifold obtained from Mt by filling in (2) Let Mfill t the punctures and throwing away the copies of S 3 . Then Mfill t is a compact 3-manifold, i.e. all but finitely many components of Mt are punctured copies of S 3 . Furthermore, for every t1 < t2 the prime decomposition of Mfill t2 is part fill of the prime decomposition of Mt1 . Hence there are only finitely many times at which the prime decomposition of Mfill t changes. fill (3) Mt is irreducible and aspherical for large t, depending only on the following bounds on the geometry of M0 : upper bounds on the curvature and volume, and a lower bound on the injectivity radius. (4) If the time-0 slice M0 is a spherical space form, then there is a time ω ∈ [0, ∞) such that: (a) For every t < ω, precisely one component Ct of the time-t-slice Mt is a punctured copy of M0 , and all other components are punctured copies of S 3. (b) For every t ≥ ω, the components of Mt are punctured S 3 s. (c) If M0 is not diffeomorphic to S 3 or RP 3 , then Ct has no punctures for t close to ω(g) and the family of Riemannian manifolds (Ct )t<ω converges smoothly, modulo rescaling, to a manifold of constant sectional curvature 1 as t → ω. More precisely, if t0 < ω(g) is close enough to ω(g) that Ct0 is compact and has positive sectional curvature, then: (i) The maximal product domain C with initial time slice Ct0 is defined on [t0 , ω(g)), and is isometric to the Ricci flow spacetime of the (maximal) Ricci flow (gt,t0 )t0 ∈[t0 ,ω(g)) on Ct0 with initial condition gt0 . (ii) Modulo rescaling, the family of Riemannian metrics (gt,t0 )t0 ∈[t0 ,ω(g)) converges in the C ∞ -topology as t → ω(g) to a metric g of constant sectional curvature 1. (iii) For every t ∈ [t0 , ω(g)), the time slice Ct coincides with Ct . (5) If M0 is diffeomorphic to a closed hyperbolic 3-manifold, then modulo rescaling the family of Riemannian manifolds (Mt )t∈[0,∞) converges smoothly to M0 equipped with a hyperbolic metric as t → ∞. More precisely, if t0 < ∞, the time slice Ct0 is compact, and the maximal product domain C with initial time slice Ct0 is defined on [t0 , ∞), then: (i) If (gt,t0 )t0 ∈[t0 ,∞) is the maximal Ricci flow on Ct0 with initial condition gt0 (which corresponds to C (cf. Lemma 2.10), then, modulo rescaling, the family of Riemannian metrics (gt,t0 )t0 ∈[t0 ,∞) converges in the C ∞ -topology as t → ∞ to a metric g of constant sectional curvature −1. (ii) For every t ∈ [t0 , ∞), the time slice Ct coincides with Ct . Proof. The proof is a combination of known results. (1) is contained in [KL14, Prop. 5.31]. We now prove (2). Pick 0 ≤ t1 < t2 < ∞. Let Y ⊂ Mt2 be the union of finitely many connected components none of which is a punctured copy of S 3 , and let Y fill be 14 RICHARD H. BAMLER AND BRUCE KLEINER the result of filling in the punctures of Y . By [KL14, Theorem 1.13], there is a finite subset S ⊂ Y such that flow of the time vector field ∂t is defined on Y \S over the time interval [t1 − t2 , 0], and hence it defines a smooth embedding Y \ S ,→ Mt1 . Taking t1 = 0, we see that the prime decomposition of Y fill is part of the prime decomposition of M0 , and hence the number of summands is bounded independently of the choice fill of t2 and Y . It follows that Mfill t2 (and similarly Mt1 ) are compact 3-manifolds, and without loss of generality we may assume that Y is the union of all components of Mt2 that are not punctured copies of S 3 . The embedding Y ,→ Mt1 implies that the fill prime decomposition of Mfill t2 is part of the prime decomposition of Mt1 . This proves (2). By [CM05, Per03a], there is a t < ∞ such that for any Ricci flow with surgery (in the sense of Perelman [Per03b]) with sufficiently precise cutoff and starting from the Riemannian manifold M0 , then for any t ≥ t every component of the time-t slice is irreducible and aspherical or a copy of S 3 . Pick t ≥ t. Choose a connected component C ⊂ Mt that is not a punctured copy of S 3 , and let Z ⊂ C be a compact domain with spherical boundary components such that Int Z is diffeomorphic to C. By the convergence theorem [KL14, Thm. 1.2] and [BKb, Cor. 1.4], the domain Z smoothly embeds in the time-t slice of some Ricci flow with surgery starting from M0 . It follows that filling in the punctures of C, we get an irreducible and aspherical 3-manifold. This proves (3). Suppose M0 is diffeomorphic to a spherical space form. If M0 is a copy of S 3 , then by (2), for every t ≥ 0 all components of Mt are punctured copies of S 3 , and taking ω = 0, assertions (a) and (b) follow. If M0 is not a copy of S 3 , then by (2) and (3) there is an ω ∈ (0, ∞) such that Mfill t fill is a copy of M0 for t < ω and Mfill = ∅ for t > ω. If M is a copy of M , then there 0 t ω is a compact domain with smooth boundary Z ⊂ Mω such that Int Z is a punctured copy of M0 . Applying the flow of the time vector field ∂t for short time, we see that fill Z embeds in Mt for some t > ω, contradicting Mfill t = ∅. Therefore Mω = ∅. Hence assertions (4)(a) and (4)(b) hold. Now suppose M0 is not a copy of S 3 or RP 3 . Choose t < ω, and let Z ⊂ Mt be the component that is a punctured copy of M0 . Choose ˆ > 0, and suppose Z is not ˆ-close modulo rescaling to M0 equipped with a K ≡ 1 metric. By [KL14, Prop. 5.31], there is a finite disjoint collection {Ni }ki=1 where: (i) Each Ni is a domain with boundary in Z which is diffeomorphic to one of the following: S 3 , RP 3 , S 2 × S 1 , RP 3 #RP 3 , S 2 × [0, ∞), D3 , RP 3 \ B 3 , or S 2 × [0, 1]. (ii) |Rm| < Cr−2 (t) on the complement Z \ ∪i Ni , where C is a universal constant. Since M0 is not a copy of S 3 or RP 3 and Z is a punctured copy of M0 , which is irreducible, each Ni must be a copy of S 2 × [0, ∞), D3 , or S 2 × [0, 1]. The components of Z \ ∪i Ni embed in M0 , and are therefore punctured copies of S 3 or M0 . It follows that some component W of Z \ ∪i Ni is a punctured copy of M0 . Let r∗ > 0 be a DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 15 lower bound on r(t) for t ∈ [0, ω). By the canonical neighborhood assumption we can find a universal constant C∗ such that |∂t |Rm|| < C∗ r∗−2 whenever |Rm| ∈ (r∗−2 , 2r∗−2 ) (see [BKb, Lemma 8.1]). Integrating this inequality, using the curvature bound in (ii) and 0-completeness, it follows that there is a constant τ = 21 C∗−1 r∗2 > 0, which is independent of t, such that W survives until time t + τ and such that |Rm| < 2r∗−2 on W (t0 ) for all t0 ∈ [t, t + τ ] (compare [BKb, Lemma 8.4]). So if t is sufficiently close to t, then W survives until time ω, contradicting the fact that Mfill ω = ∅. Hence modulo rescaling Z is ˆ-close to M0 equipped with a metric of constant sectional curvature 1. Thus the first part of assertion (4)(c) holds. Now suppose that Ct0 is compact and has positive sectional curvature for some t0 < ω(g). Let C ⊂ M[t0 ,∞) be the maximal product domain with initial time slice Ct0 , and let [t0 , t+ ) be the time interval on which C is defined. By Lemma 2.10, C is isometric to the spacetime for the ordinary Ricci flow (gt,t0 )t∈[t0 ,t+ ) on Ct0 with initial condition given by gt0 . Because gt0 has positive sectional curvature, it follows from [Ham82] that the metrics (gt,t0 )t∈[t0 ,t+ ) converge modulo rescaling to a K ≡ 1 metric g on Ct0 as t → t+ . If t+ > ω(g), then Mt would contain a copy of X for some t > ω(g), contradicting assertion (4)(b). If t+ < ω(g), then by the compactness of Ct+ , we may flow Ct+ backward and forward under ∂t for a short time. By (4)(a) this yields Ct for t close to t+ , and in particular Ct for t < t+ close to t+ . Hence C may be extended past t+ , which is a contradiction. Thus t+ = ω(g). Hence (4)(c)(i) and (4)(c)(ii) hold. Assertion (4)(c)(iii) follows from (4)(a). Now suppose M0 is diffeomorphic to a hyperbolic 3-manifold. Let (Mj , tj , ∂tj , g j ) → M∞ be a convergent sequence of Ricci flow spacetimes as in [KL14, Thm. 1.2], i.e. the Mj s are associated with a sequence of Ricci flows with surgery with initial conditions isometric to M0 , where the Perelman surgery parameter δj tends to zero as j → ∞. By [BKb, Cor. 1.4] we may take M∞ = M. We recall that Perelman’s work implies that for fixed j, a statement similar to (5) holds: as t → ∞ i.e. the Riemannian manifolds (Mjt , t−2 gtj ) converge in the smooth topology to M0 with a hyperbolic metric [Per03b, Bam17]. Although Perelman’s argument by itself does not provide the uniform control needed to pass the statement to the limit to obtain (5) directly, his argument can nonetheless be implemented by using some results from [KL14], as we now explain. Claim. For every j ∈ N ∪ {∞}, and every t ∈ [0, ∞): j • The scalar curvature attains a nonpositive minimum Rmin (t) on Mjt . 2 bj (t) := Rj (t)(V j ) 3 (t) is nondecreasing, where V j (t) is • the function t 7→ R min the volume of Mjt . bj → R b∞ uniformly on compact sets as j → ∞. Moreover, R j bj (t) Proof. For j ∈ N, the fact that Rmin (t) is well-defined and negative, and t 7→ R is nondecreasing, was shown by Perelman. From the properness asserted in [KL14, ∞ Thm. 1.2(a)] it follows that t 7→ Rmin (t) is a well-defined continuous function, and 16 RICHARD H. BAMLER AND BRUCE KLEINER j ∞ uniformly on the main assertion of [KL14, Thm. 1.2] then implies that Rmin → Rmin compact sets. Since V ∞ is continuous and V j → V ∞ uniformly on compact sets by [KL14, bj → R b∞ uniformly on compact sets. Because Thm. 4.1, Cor. 7.11], it follows that R b∞ is a uniform limit of nondecreasing functions, it is also nondecreasing. R  bj → R b∞ uniformly on compact sets, the arguments from Using the fact that R [KL08, Secs. 89-91] may now be implemented uniformly for all the Ricci flows with surgery, with the slight modification that the “slowly varying almost hyperbolic structures” in [KL08, Prop. 90.1] are only defined on an interval [T0 , Tj ] for some sequence Tj → ∞. After passing to a subsequence, we may use [KL14, Thm. 1.2] to obtain a version of [KL08, Prop. 90.1] for M = M∞ . The proof of incompressibility of the cuspidal tori as in [KL08, Sec. 91] carries over to the singular Ricci flow M, since compressing disks avoid the thin parts of M. Alternatively, one may deduce incompressibility in time slices of M∞ from incompressibility in Mj for large j. The complement of the (truncated) hyperbolic regions consists of graph manifolds [KL08, Sec. 91]. By (2) we conclude that there is precisely one hyperbolic component, and it coincides with M∞ t for large t. Thus we have proven the first part of assertion (5). The proof of (5)(i)–(ii) is similar to the proof of (4)(c)(i)–(iii), except that instead of appealing to [Ham82], we use the convergence of normalized Ricci flow shown in [Ye93, Bam14].  3. The canonical limiting constant curvature metric In this section, we let X be a 3-dimensional spherical space form other than S 3 or RP 3 . Recall that 3-dimensional spherical space forms are always orientable. By Theorem 2.16, a singular Ricci flow M starting from an arbitrary metric g ∈ Met(X), contains a family of time slice components whose metrics converge, modulo rescaling, to a round metric. In this section, we will use a result from [KL14] to flow these metrics back to the time 0 slice M0 ' X, with the caveat that the flow is not defined everywhere – it is only defined on the complement of a finite subset. Using the uniqueness and continuity theorems of [BKb], we show that this process yields a canonical partially defined metric of constant of sectional curvature 1 on X, which depends continuously on g in the sense of Definition 2.3. See Figure 1 for a depiction of this. Pick g ∈ Met(X) and let M be a singular Ricci flow with M0 = (X, g). Let ω(g) = ω be as in Theorem 2.16, and for every t < ω(g) let Ct be the unique component of Mt that is a punctured copy of X. For every t1 , t2 ∈ [0, ω(g)), let Ct1 ,t2 ⊂ Ct1 be the set of points in Ct1 that survive until time t2 , i.e. the points for which the time (t2 − t1 )-flow of the time vector field ∂t is defined. Then Ct1 ,t2 is an open subset of Ct1 , and the time (t2 −t1 )-flow of ∂t defines a smooth map Φt1 ,t2 : Ct1 ,t2 → Mt2 , which is a diffeomorphism onto its image. We DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 17 define a metric gt1 ,t2 on Φt1 ,t2 (Ct1 ,t2 ) by gt1 ,t2 := (Φt1 ,t2 )∗ gt1 , where gt1 is the spacetime metric on Ct1 ,t2 ⊂ Mt1 . We let Wg (t) := Φt,0 (Ct,0 ), so gt,0 is a metric on Wg (t). Lemma 3.1 (Limiting K ≡ 1 metric). Choose t0 < ω(g) such that Ct0 is compact and has positive sectional curvature; such a time t0 exists by Theorem 2.16(4)(a). Then: (1) Wg (t) = Wg (t0 ) =: Wg for all t ∈ [t0 , ω(g)). (2) Modulo rescaling, gt,0 converges in the smooth topology to a K ≡ 1 metric ǧ on Wg as t → ω(g). (3) (Wg , ǧ) is isometric to (X \ S, gX ) for some finite (possibly empty) subset S ⊂ X, where the cardinality of S is bounded above by a constant depending only on bounds on the curvature, injectivity radius, and volume of g. (4) If g has constant sectional curvature, then Wg = X and ǧ = λg for some λ ∈ (0, ∞). We caution the reader that although (Wg , ǧ) is isometric to (X, gX ) with finitely many points removed, the complement X \Wg may have nonempty interior and could, in principle, be quite irregular. Proof of Lemma 3.1. Let C ⊂ M[t0 ,∞) be the maximal product domain with Ct0 = Ct0 . By Theorem 2.16(4)(c), the domain C is defined on the time interval [t0 , ω(g)). Hence for all t ∈ [t0 , ω(g)) we have Ct,t0 = Ct , Ct,0 = Φ−1 t,t0 (Ct0 ,0 ), Φt,0 = Φt0 ,0 ◦ Φt,t0 and Wg (t) = Φt,0 (Ct,0 ) = Φt0 ,0 (Ct0 ,0 ) = Wg (t0 ). Thus (1) holds. Note that on Φt,0 (Ct,0 ) gt,0 = (Φt,0 )∗ gt = (Φt0 ,0 )∗ (Φt,t0 )∗ (gt ) = (Φt0 ,0 )∗ gt,t0 . By Theorem 2.16(4), modulo rescaling, (gt,t0 )t∈[t0 ,ω(g)) converges in Met(Ct0 ,0 ) to the K ≡ 1 metric g on Ct0 ,0 as t → ω(g). Consequently, modulo rescaling, (gt,0 )t∈[t0 ,ω(g)) converges in Met(Wg ) to the K ≡ 1 metric (Φt0 ,0 )∗ g. Thus assertion (2) holds. By [KL14, Theorem 1.13], all but finitely many points in Ct0 survive until t = 0, i.e. Ct0 \ Ct0 ,0 is finite; moreover the cardinality is bounded above depending only on the volume of M0 and ω(g). There is a unique K ≡ 1 metric on X up to isometry [Mil66], so (Ct0 , g) is isometric to (X, gX ). Since (Wg , ǧ) is isometric to (Ct0 ,0 , g), assertion (3) holds. Now suppose g has constant sectional curvature. Then M is the product Ricci flow spacetime corresponding to a shrinking round space form. Hence Wg = X, and gt,0 agrees with g modulo rescaling, for all t ∈ [0, ω(g)), so ǧ agrees with g modulo rescaling, and assertion (4) holds.  By Theorem 2.16, for every g ∈ Met(X) there exists a singular Ricci flow M with M0 isometric to (X, g) which is unique up to isometry; hence the pair (Wg , ǧ) is also independent of the choice of M, i.e. it is a well-defined invariant of g ∈ Met(X). 18 RICHARD H. BAMLER AND BRUCE KLEINER Next, we show that the pair (Wg , ǧ) varies continuously with g, in the sense of Definition 2.3. After unwinding definitions, this is a straightforward consequence of the convergence theorem of [BKb]. Lemma 3.2. The assignment g 7→ (Wg , ǧ) defines a continuous map Met(X) → PartMet(X). Proof. Suppose g j → g ∞ in Met(X). For all j ∈ N ∪ {∞}, let Mj be a singular Ricci flow with Mj0 = (X, g j ), let ω(g j ), Ctj , be as in Theorem 2.16, and (Wgj , ǧ j ) be as in Corollary 3.1. Choose a compact subset Z ⊂ Wg∞ . To prove the lemma, we will show that Z ⊂ Wgj for large j, and that ǧ j → ǧ ∞ in the C ∞ -topology, on an open subset containing Z. Let φj : M∞ ⊃ U j → V j ⊂ Mj be the diffeomorphism onto its image from Theorem 2.15. Let t0 be the time from Lemma 3.1 for M∞ . By Theorem 2.15, the map φj is defined on Ct∞ for large j, and (φjt0 )∗ g j → g ∞ on Ct∞ . Therefore, without loss of 0 0 j ∞ generality, we may assume that φ is defined on Ct0 for all j, and Ctj0 has positive sectional curvature. For j ∈ N∪{∞}, if C j ⊂ Mj is the maximal product domain with time-t0 slice Ctj0 , then C j is defined on [t0 , ω(g j )) and Ctj = Ctj for all t ∈ [t0 , ω(g j )), by Theorem 2.16(4). The flow Φjt,t0 of the time vector field ∂tj is defined on Ctj for t ∈ [t0 , ω(g j )), j ∈ N ∪ {∞}, since C j is a product domain in [t0 , ω(g j )). Thus, for j ∈ N ∪ {∞}, j gt,t := (Φjt,t0 )∗ g j is a well-defined smooth metric on Ctj0 for all t ∈ [t0 , ω(g j )), and 0 j modulo rescaling, gt,t → g j ∈ MetK≡1 (Ctj0 ) as t → ω(g j ). By [FGKO15], since 0 (φj )∗ g j → g ∞ on Ct∞ in the C ∞ -topology, it follows that (φj )∗ g j → g ∞ in the C ∞ 0 topology. ∞ By assumption Z ⊂ Wg∞ , so it survives until time t0 in M∞ , and Φ∞ 0,t0 (Z) ⊂ Ct0 . ∞ ∞ Since Z is compact, there is a product domain N ⊂ M defined on [0, t0 ], such that N ∞ has compact closure in M∞ , and the time zero slice N0∞ is an open subset of Wg∞ containing Z. b j be the pullback of For large j the map φj is defined on N ∞ , and we let N b j := (N ∞ , btj = t∞ , ∂bj , gbj ) where ∂bj := (φj |N ∞ )∗ ∂tj , Mj under φj |N ∞ , i.e. N t t j j ∞ ∗ j j b gb := (φ |N ) g . (Note that N is not quite a Ricci flow spacetime because it has boundary points in the time-t0 slice.) By Theorem 2.15, we have ∂btj → ∂t∞ , gbj → g ∞ in the C ∞ -topology on N ∞ as j → ∞. Now choose an open set Z 0 ⊂ N0∞ with compact closure in N0∞ , such that Z ⊂ Z 0 . Since ∂btj converges to the product vector field ∂t∞ on N ∞ , it follows that for large j, 0 b j0,t |Z 0 of ∂bj is defined and takes values in Ct∞ , and Φ b j0,t |Z 0 → Φ∞ the flow Φ 0,t0 |Z in t 0 0 0 the C ∞ -topology as j → ∞. Because (φjt0 )∗ g j → g ∞ as j → ∞, we get  ∗ ∗ ∞ b j0,t (3.3) Φ (φjt0 )∗ g j → (Φ∞ = ǧ ∞ on Z0 0,t0 ) g 0 DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 19 in the C ∞ topology, as j → ∞. b j → φj (N ∞ ) ⊂ Mj preserves time functions, time vector fields, The map φj : N and metrics. Therefore, the assertions in the previous paragraph imply that for large j, Φj0,t0 is defined on Z 0 and takes values in φjt0 (Ct∞ ) = Ctj0 and ǧ j |Z 0 = (Φj0,t0 |Z 0 )∗ g j = 0 b j0,t |Z 0 )∗ (φjt )∗ g j . By (3.3) we conclude that ǧ j |Z 0 → ǧ ∞ |Z 0 in (φj0 )∗ (Φj0,t0 |Z 0 )∗ g j = (Φ 0 0 the C ∞ - topology as j → ∞.  Remark 3.4. In order to prove the continuous dependence of the limiting round metric on the initial metric of positive sectional curvature, we invoked the continuity theorem from [FGKO15]. However, in our applications in the next section, it would work equally well if instead of using the limiting K ≡ 1 metric produced by Ricci flow, we used some other geometric construction to replace a metric h that is -close to a round Riemannian metric with a round metric h, as long as h depends continuously on h in the smooth topology and is equivariant with respect to diffeomorphisms. For instance, one could use the smooth dependence of certain eigenspaces of the Laplacian. 4. Extending constant curvature metrics The goal of this section is the following proposition, which asserts that under certain conditions a finite dimensional continuous family of partially defined K ≡ 1 metrics can be extended to a continuous family of globally defined K ≡ 1 metrics. In this section X will denote a spherical space form other than S 3 . Pick gX ∈ MetK≡1 (X). We recall that gX is unique up to isometry [Mil66, dR40, Fra35, Rei35]. In the following we will use the term polyhedron to refer to (the geometric realization of) a simplicial complex. Proposition 4.1 (Extending K ≡ 1 metrics). Let P0 be a finite polyhedron, and Q0 ⊂ P0 a subpolyhedron. Suppose P0 3 p 7→ (Wp , g(p)) is an assignment with the following properties: (i) p 7→ (Wp , g(p)) defines a continuous map P0 → PartMet(X). (ii) There is an n < ∞ such that for every p ∈ P0 the Riemannian manifold (Wp , g(p)) is isometric to (X \Sp , gX ) for a finite subset Sp ⊂ X with |Sp | ≤ n. (iii) Wq = X for all q ∈ Q0 . Then there is a continuous map gb : P0 → MetK≡1 (X) such that for every q ∈ Q0 we have gb(q) = g(q). We remark that we will only apply Proposition 4.1 in the case when P0 is an (m + 1)-disk and Q0 = ∂P0 is its boundary m-sphere, for some m ≥ 0. Before proceeding with the proof, we first provide some motivation for the proof. Take p ∈ P0 , and consider the open subset Wp ⊂ X. Since (Wp , g(p)) is isometric to (X \ Sp , gX ), the ends of Wp are diffeomorphic to S 2 × [0, ∞), and hence there is a compact domain with smooth boundary Zp ⊂ Wp with 2-sphere boundary components, such that Int Zp is diffeomorphic to X \ Sp . By a simple topological argument, 20 RICHARD H. BAMLER AND BRUCE KLEINER the closure of X \ Zp is a union of a disjoint collection Cp of 3-disks. It is not hard to see that for every 3-disk Y ∈ Cp , the restriction of g(p) to a small neighborhood of ∂Y in Y extends to a metric on Y with K ≡ 1. Moreover, by using Hatcher’s theorem, one can see that the extension is unique, up to contractible ambiguity. Combining the extensions for each Y ∈ Cp , we obtain an extension of g(p)|Zp to X, which is also unique up to contractible ambiguity. To adapt the preceding observations into a proof of the proposition, we first choose a fine subdivision P of P0 , and for every face σ of P , we choose a domain with smooth boundary Zσ ⊂ X such that (among other things) Zσ ⊂ Wp for every p ∈ σ, and Zσ = X if p ∈ Q0 . We then prove the proposition by extending g inductively over the skeleta of P . In the induction step, we assume that gb has been defined on the m-skeleton of P , and then we extend it to an (m + 1)-face σ ⊂ P , such that it agrees with g on Zσ . Since the closure of X \ Zσ is a disjoint collection of 3-disks, our problem reduces to solving an extension problem for 3-disks, which may be deduced from Hatcher’s theorem. For the remainder of the section we fix an assignment P0 3 p 7→ (Wp , g(p)) as in the statement of Proposition 4.1. The first step in the proof of Proposition 4.1 is to define the subdivision P and the collection {Zσ }σ∈Face P described above. Lemma 4.2. There is a subdivision P of P0 , and to every face σ of P we can assign a triple (Zσ , Cσ , Uσ ) with the following properties: (a) For every face σ of P , Cσ is a finite disjoint collection of 3-disks in X, and Zσ = X \ ∪Y ∈Cσ Y . (b) For every strict inclusion of faces σ1 ( σ2 we have Zσ2 ⊂ Int(Zσ1 ). (c) For every face σ of P , and every p ∈ σ, we have: (i) Uσ is an open subset of X with Zσ ⊂ Uσ ⊂ Wp . (ii) (Uσ ∩ Y, g(p)) isometrically embeds in (S 3 , gS 3 ) for every Y ∈ Cσ . (iii) If σ ∩ Q0 6= ∅, then Zσ = X. To prove Proposition 4.1 using the combinatorial structure from Lemma 4.2, the main ingredient is the following local extension lemma, which is based on (a version of) the Smale conjecture, as proved by Hatcher [Hat83]. Lemma 4.3 (Extending K ≡ 1 metrics over a ball). In the following, we let S 2 and D3 denote the unit sphere and unit disk in R3 , respectively, and we let Nr (S 2 ) denote the metric r-neighborhood of S 2 ⊂ R3 . Suppose m ≥ 0, ρ > 0 and: (i) hm+1 : Dm+1 → MetK≡1 (Nρ (S 2 ) ∩ D3 ) is a continuous map such that for all p ∈ Dm+1 , the Riemannian manifold (Nρ (S 2 ) ∩ D3 , hm+1 (p)) isometrically ∞ embeds in (S 3 , gS 3 ). Here MetK≡1 (Nρ (S 2 ) ∩ D3 ) is equipped with the Cloc topology. DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 21 (ii) b hm : S m → MetK≡1 (D3 ) is a continuous map such that for every p ∈ S m we have b hm (p) = hm+1 (p) on Nρ (S 2 ) ∩ D3 , and (D3 , hm (p)) isometrically embeds in (S 3 , gS 3 ). Then, after shrinking ρ if necessary, there is a continuous map b hm+1 : Dm+1 → 3 MetK≡1 (D ) such that: (a) (b) b hm+1 (p) = hm+1 (p) on Nρ (S 2 ) ∩ D3 for all p ∈ Dm+1 . b hm+1 (p) = hm (p) for all p ∈ S m . Proof of Proposition 4.1 assuming Lemmas 4.2 and 4.3. Let P and the assignment Face P 3 σ 7→ (Zσ , Cσ , Uσ ) be as in Lemma 4.2. Let Q be the corresponding subdivision of Q0 . Pick m + 1 ≥ 0 with m + 1 ≤ dim(P \ Q). Assume inductively that if m ≥ 0, then we have defined a continuous map gbm : P (m) ∪ Q → MetK≡1 (X) such that for every face τ ⊂ P (m) ∪ Q, and every p ∈ τ , the metric gbm (p) agrees with g(p) on Zτ ⊂ Wp . Pick an (m + 1)-face σ ⊂ P (m+1) with σ 6⊂ Q, and choose Y ∈ Cσ . We wish to apply Lemma 4.3. To that end we choose a diffeomorphism α : D3 → Y , and a homeomorphism β : Dm+1 → σ. If ρ > 0 is sufficiently small, then α(Nρ (S 2 ) ∩ D3 ) ⊂ ∩τ (σ Zτ by assertion (b) of Lemma 4.2. Since ∩τ (σ Zτ ⊂ Uσ ⊂ ∩p∈∂σ Wp by assertion (c) of Lemma 4.2, we may define continuous maps hm+1 : Dm+1 −→ MetK≡1 (Nρ (S 2 ) ∩ D3 ) , b hm : S m −→ MetK≡1 (D3 ) by hm+1 (p) := (α|Nρ (S 2 ) ∩ D3 )∗ g(β(p)), b hm (p) := α∗ gbm (β(p)). Note that for every p ∈ S m , the Riemannian manifold (D3 , b hm (p)) isometrically embeds in (X, gX ) by 3 construction, and since D is simply connected, this embedding may be lifted to an isometric embedding (D3 , b hm (p)) → (S 3 , gS 3 ). Similarly, for every p ∈ Dm+1 , the manifold (Nρ (S 2 ) ∩ D3 , hm+1 (p)) isometrically embeds in (S 3 , gS 3 ) by assertion (c)(ii) of Lemma 4.2. Applying Lemma 4.3, after shrinking ρ, we obtain a continuous map b hm+1 : Dm+1 → MetK≡1 (D3 ) such that b hm+1 (p) = b hm (p) for all p ∈ S m , b hm+1 (p) = hm+1 (p) on 2 3 m+1 Nρ (S ) ∩ D for all p ∈ D . Now let gσ,Y : σ → MetK≡1 (Y ) be given by gσ,Y (β(p)) = α∗b hm+1 (p). We may extend gbm to a continuous map gbm+1 : P (m+1) ∪Q → MetK≡1 (X) by letting gbm+1 |σ agree with gσ,Y on Y for each Y ∈ Cσ . Note that by construction, for every face σ of P (m+1) and every p ∈ σ, gbm+1 (p) agrees with g(p) on Zσ , and hence on X if p ∈ Q, by assertion (c)(iii) of Lemma 4.2. By induction we obtain the desired map gb : P → MetK≡1 (X).  22 RICHARD H. BAMLER AND BRUCE KLEINER We now prove Lemmas 4.2 and 4.3. Before proving Lemma 4.2, we need a preparatory result. Lemma 4.4. (1) Let C be a finite disjoint collection of 3-disks in X, and Z ⊂ X be a domain with smooth boundary diffeomorphic to X \ ∪Y ∈C Y . Then there is a (unique) finite disjoint collection of 3-disks C 0 such that Z = X \ ∪Y ∈C 0 Y . (2) Let C be a collection of at most j closed balls of radius at most r in a metric space Z. Then there is a disjoint collection C 0 of at most j closed balls of radius < 4j r such that {Int Y }Y ∈C 0 covers ∪Y ∈C Y . Proof. (1). Recall that X is irreducible and not diffeomorphic to S 3 , so every embedded 2-sphere in X bounds two domains with boundary, precisely one of which is a 3-disk. Let C 0 be the collection of closures of the components of X \ Z. Suppose that Y0 ∈ C 0 is not diffeomorphic to a 3-disk. Then X \ Int Y0 is a 3-disk, and hence Z ⊂ X \ Int Y0 embeds in S 3 . But then the embedding Z → S 3 may be extended to a diffeomorphism X → S 3 by extending over the 3-ball components of X \ Z; this is a contradiction. Therefore C 0 is a collection of 3-disks, and assertion (1) follows. (2). This follows by induction on j, by replacing a pair of balls B(x1 , r1 ), B(x2 , r2 ) with r1 ≤ r2 such that B(x1 , r1 ) ∩ B(x2 , r2 ) 6= ∅ with B(x2 , 4r2 ).  Proof of Lemma 4.2. Let rX > 0 be injectivity radius of (X, gX ), and let r ∈ (0, rX ) be a constant to be determined later. For p ∈ Dm+1 let dp be the Riemannian distance function for (Wp , g(p)), and let (W p , dp ) be the completion of the metric space (Wp , dp ). By assumption (ii) of Proposition 4.1, we know that (W p , dp ) is isometric to (X, dX ). For each p ∈ P0 , we let Zp0 := W p \ ∪x∈W p \Wp Bdp (x, r), so Zp0 ⊂ Wp ⊂ X. By the definition of the topology on PartMet(X) and condition (i) of Proposition 4.1, for all p ∈ P0 there is an open subset Vp ⊂ P0 such that for all p0 ∈ Vp , we have Zp0 ⊂ Wp0 , and 2−1 g(p) < g(p0 ) < 2g(p) on Zp0 . Let P be a subdivision of P0 such that the closed star cover {St(v, P )}v∈P (0) refines the cover {Vp }p∈P0 . For every vertex v ∈ P (0) choose pv ∈ P such that Vpv ⊃ St(v, P ), and let Zv1 := Zp0v . After refining P if necessary, we may assume Zv1 = X for every vertex v with St(v, P ) ∩ Q 6= ∅. For every face σ of P , choose bσ ∈ σ, and let Zσ1 := ∪v∈σ(0) Zv1 . Note that if p ∈ σ, then Zσ1 ⊂ Wp , and 2−1 g(bp ) < g(p) < 2g(bp ) on Zσ1 . Claim. (Let n be the constant from Proposition 4.1(ii)). There exist universal constants {ck }k≥0 , {c0k (n)}k≥0 , {r(k, n)}k≥0 such that if r ≤ r(dim P, n), then there are collections {Cσ }σ∈Face P such that: (a) Cσ is a disjoint collection of 3-disks in X for every σ ∈ Face P . DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 23 (b) {Int Y }Y ∈Cσ covers X \ Zσ1 for every σ ∈ Face P . (c) For every k-face σ of P , |Cσ | ≤ ck n and for every Y ∈ Cσ , the boundary 2-sphere ∂Y has intrinsic diameter ≤ c0k (n)r w.r.t. the Riemannian metric g(bσ ). Note that g(bσ ) is defined on ∂Y since (b) implies ∂Y ⊂ Zσ1 ⊂ Wbσ . (d) For all σ1 ( σ2 the collection {Int Y }Y ∈Cσ2 covers ∪Y ∈Cσ1 Y . (e) If σ ∈ Face P and Wpv = X for every v ∈ σ (0) , then Cσ = ∅. Proof. By induction on m we will prove the existence the constants {ck }k≤m , {c0k (n)}k≤m , {r(k, n)}k≤m , and collections Cσ , where σ ranges over the m-skeleton P (m) . First suppose that m = 0, and pick a vertex v ∈ P (0) . Let Cv0 := {Bdpv (x, 2r) | x ∈ W pv \ Wpv }, and hence {Int Y }Y ∈Cv0 covers W pv \ Zp0v . Applying Lemma 4.4, we get a disjoint collection Cv1 of closed balls in (W pv , dpv ) such that {Int Y }Y ∈Cv1 covers ∪Y ∈Cv0 Y , where |Cv1 | ≤ n, and every Y ∈ Cv1 has radius < 4n · 2r. If 4n · 2r < rX , then every Y is a 3-disk, and hence by Lemma 4.4 there is a unique disjoint collection Cv of 3-disks in X such that X \ ∪Y ∈Cv Y = W pv \ ∪Y ∈Cv1 Y . Taking c0 = 1, c00 = 4n+2 π, 1 0 r(0) = c−1 0 rX , since g(bv ) ≤ 2g(pv ) on Zv = Zpv properties (a)–(d) follow immediately. 0 If Wpv = X, then Cv = ∅, so (e) holds. Now suppose m > 0, and assume that universal constants {ck }k≤m−1 , {c0k (n)}k≤m−1 , {r(k, n)}k≤m−1 , and collections Cτ where τ ranges over the (m − 1)-skeleton P (m−1) , have been chosen so that (a)–(e) hold. Pick an m-face σ ⊂ P . By our induction assumption, for every τ ( σ, {Int Y }Y ∈Cτ covers X \ Zτ1 . Since 1 Zτ ⊂ Zσ1 ⊂ Wbσ , it follows that {Int Y }Y ∈Cτ covers X \ Zσ1 , and we may apply Lemma 4.4 to obtain a disjoint collection Cτ0 of 3-disks in W bσ such that W bσ \ ∪Y ∈Cτ0 Y = X \ ∪Y ∈Cτ Y . By (c) of our induction assumption and the fact that 2−1 g(bτ ) < g(bσ ) < 2g(bτ ) on Zσ1 , for all Y ∈ Cτ0 the boundary 2-sphere ∂Y has intrinsic diameter < 2c0m−1 (n)r with respect to g(bσ ). So for all Y ∈ Cτ0 , the boundary ∂Y is contained in a dbσ -ball BY ⊂ W bσ of radius 2c0m−1 (n)r. Therefore if 2c0m−1 (n)r < rX , we get that ∂Y bounds a 3-disk DY in BY . We must have DY = Y , since ∂Y bounds two domains with boundary in W bσ , precisely one of which is a 3-disk; hence Y ⊂ BY . Now let Cσ0 = ∪{Cτ0 | τ ⊂ σ is an (m − 1)-face}. Thus |Cσ0 | ≤ (m + 1)cm−1 n. Applying Lemma 4.4 to Cσ0 , we obtain a disjoint collection Cσ1 of closed balls of radius ≤ 4(m+1)cm−1 n · 2c0m−1 (n)r, where |Cσ1 | ≤ (m + 1)cm−1 n, such that {Int Y }Y ∈Cσ1 covers ∪Y ∈Cσ0 Y . Provided r < 4−(m+1)cm−1 n (2c0m−1 (n))−1 rX , every Y ∈ Cσ1 will be a 3-disk. Applying Lemma 4.4, there is a unique disjoint collection Cσ of 3-disks in X such that X \ ∪Y ∈Cσ Y = W bσ \ ∪Y ∈Cσ1 Y . As {Int Y }y∈Cσ1 covers Cτ1 for every (m − 1)-face τ of σ, we have X \ ∪Y ∈Cσ Int Y = W bσ \ ∪Y ∈Cσ1 Int Y ⊂ W bσ \ ∪Y ∈Cτ0 Int Y = X \ ∪Y ∈Cτ Y. Therefore, {Int Y }Y ∈Cσ covers Cτ for every (m − 1)-face τ of σ, and hence by the induction assumption, it also covers X \ Zσ1 . Also, if Wpv = X for every v ∈ σ (0) , then 24 RICHARD H. BAMLER AND BRUCE KLEINER by our induction assumption Cτ = ∅ for every (m − 1)-face τ ⊂ σ, which implies that Cσ = ∅ as well. Letting cm := (m + 1)cm−1 , c0m (n) = 4(m+1)cm−1 n · 2c0m−1 (n)π, and r(k, n) = c0m (n)−1 rX , assertions (a)–(e) of the claim follow.  For every σ ∈ Face P we let Zσ := X \ ∪Y ∈Cσ Y . Hence assertion (a) of Lemma 4.2 holds. If σ1 , σ2 ∈ Face P and σ1 ( σ2 , then by assertion (b) of the claim {Int Y }Y ∈Cσ2 covers ∪Y ∈Cσ1 Y . Hence Zσ2 = X \ ∪Y ∈Cσ2 Int Y ⊂ X \ ∪Y ∈Cσ1 Y = Int Zσ1 and assertion (b) of Lemma 4.2 holds. Pick σ ∈ Face P . For every τ ( σ, and every p ∈ σ, assertion (b) of the claim and the definition of Zτ1 give Zσ ⊂ Int Zτ ⊂ Zτ1 ⊂ Zσ1 ⊂ Wp . We let Uσ be an open subset of ∩τ (σ Int Zτ containing Zσ such that Uσ ∩ Y is simplyconnected for all Y ∈ Cσ . If Ψp : (Wp , g(p)) → (X \ Sp , gX ) is an isometry as in assertion (ii) of Proposition 4.1, then for every Y ∈ Cσ , p ∈ σ, the composition Ψp Uσ ∩ Y −→ Wp −→ X \ Sp −→ X is an isometric embedding of (Uσ ∩ Y, g(p)) into (X, gX ). This lifts to an isometric embedding of (Uσ ∩ Y, g(p)) into the universal cover of (X, gX ), which is isometric to (S 3 , gS 3 ). Thus assertions (c)(i) and (c)(ii) of Lemma 4.2 hold. If σ ∩ Q0 6= ∅, then for every v ∈ σ (0) we have St(v, P ) ∩ Q0 6= ∅, which implies that Wpv = X by the choice of pv . Assertion (e) of the claim gives Cσ = ∅, so Zσ = X, and assertion (c)(iii) of Lemma 4.2 holds.  Proof of Lemma 4.3. The idea of the proof is to convert the extension problem for the family of K ≡ 1 metrics to an extension problem for embeddings into S 3 , by working with (suitably normalized) isometric embeddings, rather than the metrics themselves. The extension problem for the embeddings can then be solved by appealing to Hatcher’s theorem. Pick x ∈ S 2 , x0 ∈ S 3 and oriented bases e1 , e2 , e3 ⊂ Tx R3 , e01 , e02 , e03 ⊂ Tx0 S 3 which are orthonormal with respect to gR3 and gS 3 respectively. For each p ∈ Dm+1 , apply the Gram-Schmidt process to e1 , e2 , e3 to obtain an hm+1 (p)-orthonormal basis f1 (p), f2 (p), f3 (p) for Tx R3 . For all p ∈ Dm+1 let ψm+1 (p) : (Nρ (S 2 ) ∩ D3 , hm+1 (p)) → (S 3 , gS 3 ) be the isometric embedding that sends f1 (p), f2 (p), f3 (p) to e01 , e02 , e03 ; similarly, for p ∈ S m let ψbm (p) : (D3 , b hm (p)) → (S 3 , gS 3 ) be the isometric embedding DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 25 sending f1 (p), f2 (p), f3 (p) to e01 , e02 , e03 . By standard regularity for isometries, this yields continuous maps ψm+1 : Dm+1 → Embed+ (Nρ (S 2 ) ∩ D3 , S 3 ) , ψbm : S m → Embed+ (D3 , S 3 ) , where ψbm (p)|(Nρ (S 2 ) ∩ D3 ) = ψm+1 (p) for all p ∈ S m . Next, we apply Lemma 2.1 to produce a continuous map φbm+1 : Dm+1 → Embed+ (D3 , S 3 ) such that φbm+1 (p) agrees with ψm+1 (p) on S 2 for all p ∈ Dm+1 , and φbm+1 (p) = ψbm (p) for all p ∈ S m . Although φbm+1 agrees with φbm on S 2 , it may not agree with φbm near S 2 . To address this issue, we adjust φbm+1 by precomposing it with a suitable family of diffeomorphisms of D3 that fix ∂D3 pointwise. To that end, after shrinking ρ if necessary, let b m+1 : Dm+1 → Diff(D3 rel∂D3 ) be a continuous map such that φbm+1 (p) = idD3 for all Φ 2 3 m+1 b m+1 (p) = φb−1 p ∈ S m , and Φ . The map m+1 (p)◦ψm+1 (p) on Nρ (S )∩D for all p ∈ D −1 b m+1 (p) may be obtained, for instance, by interpolating between φbm+1 (p) ◦ ψm+1 (p) Φ and idD3 using a partition of unity, i.e. letting   φbm+1 (p)(x) = u(|x|) φb−1 (p) ◦ ψ (p)(x) + (1 − u(|x|))x m+1 m+1 where u : [0, 1] → [0, 1] is a smooth function supported in [1−, 1] for some sufficiently small  > 0, and k∂x ukC 0 , 2 k∂x2 ukC 0 < C for some universal constant C. b m+1 (p) on D3 for all p ∈ Dm+1 . By the We now let ψbm+1 (p) := φbm+1 (p) ◦ Φ b m+1 it follows that ψbm+1 (p) agrees with ψm+1 (p) on Nρ (S 2 ) ∩ D3 , construction of Φ ∗ gS 3 , we obtain the and ψbm+1 (p) = φbm+1 (p) for all p ∈ S m . Setting b hm+1 (p) := ψbm+1 m+1 3 3 desired map b hm+1 : D → MetK≡1 (D , S ).  5. Proof of Theorem 1.2 for spherical space forms Let X be a spherical space form other than S 3 or RP 3 . Choose m ≥ 0, and a map h : S m → MetK≡1 (X). h Let g : Dm+1 → Met(X) be a continuous extension of the composition S m → MetK≡1 (X) ,→ Met(X). For every p ∈ Dm+1 , let (Wg(p) , ǧ(p)) ∈ PartMetK≡1 (X) be the canonical partially defined metric constructed in Section 3. By Lemma 3.2, the assignment p 7→ (Wg(p) , ǧ(p)) defines a continuous map Dm+1 → PartMet(X). Taking P0 = Dm+1 , Q0 = S m , by Lemma 3.1 the map p 7→ (Wg(p) , ǧ(p)) satisfies the hypotheses of Proposition 4.1. Now the map Dm+1 3 p 7→ gb(p) furnished by Proposition 4.1 defines a continuous extension gb : Dm+1 → MetK≡1 (X) of h. The argument above implies that the homotopy groups of MetK≡1 (X) are trivial. The space MetK≡1 (X) is homotopy equivalent to a CW complex (see Lemma 2.2), so it is contractible. 26 RICHARD H. BAMLER AND BRUCE KLEINER 6. Proof of Theorem 1.2 for hyperbolic manifolds The proof of Theorem 1.2 for hyperbolic manifolds is the same as the proof for spherical space forms, apart from some minor changes, which we now explain. In Section 3 (see Lemma 3.2) we used [Ham82, FGKO15] to show that when Y is a spherical space form, if g ∈ Met(Y ) has positive sectional curvature, then modulo rescaling the maximal Ricci flow (g(t))t∈[0,T ) with g(0) = g converges in the C ∞ topology to a metric g ∈ MetK≡1 (Y ) as t tends to the blow-up time T , and the limit g depends continuously on g. Here we may replace this with the assertion that for every gX ∈ MetK≡−1 (X), there is an gX > 0 such that if g ∈ Met(X) is gX -close to gX and (g(t))t∈[0,T ) is the maximal Ricci flow with g(0) = g, then: (i) T = ∞. (ii) Modulo rescaling g(t) converges in the C ∞ -topology to a metric g ∈ MetK≡−1 (X) as t → ∞. (iii) The limit metric g depends continuously on g. Statements (i) and (ii) follow immediately from the convergence of normalized Ricci flow shown in [Ye93, Bam14]. The continuity assertion (iii) is a consequence of the uniform exponential decay of the time derivatives, which follows readily from their arguments. We now adapt the results in Section 3 to the hyperbolic case. The statements are nearly identical, apart from obvious changes. Let X be a compact, connected, hyperbolic manifold. We first assume in addition that X is orientable; we will remove this assumption below. Pick a hyperbolic metric gX ∈ MetK≡−1 (X). Pick g ∈ Met(X) and let M be a singular Ricci flow with M0 = (X, g). By Theorem 2.16, for every t < ∞ there is a unique component Ct of Mt that is a punctured copy of X. For every t1 , t2 ∈ [0, ∞), let Ct1 ,t2 ⊂ Ct1 be the set of points in Ct1 that survive until time t2 , i.e. the points for which the time (t2 − t1 )-flow of the time vector field ∂t is defined. Then Ct1 ,t2 is an open subset of Ct1 , and the time (t2 −t1 )-flow of ∂t defines a smooth map Φt1 ,t2 : Ct1 ,t2 → Mt2 , which is a diffeomorphism onto its image. We define a metric gt1 ,t2 on Φt1 ,t2 (Ct1 ,t2 ) by gt1 ,t2 := (Φt1 ,t2 )∗ gt1 , where gt1 is the spacetime metric on Ct1 ,t2 ⊂ Mt1 . We let Wg (t) := Φt,0 (Ct,0 ), so gt,0 is a metric on Wg (t). Lemma 6.1 (Limiting K ≡ −1 metric). Choose t0 < ∞ such that Ct0 is compact and gX -close to (X, gX ), where gX > 0 is the constant for which (i)–(iii) hold. Then: (1) Wg (t) = Wg (t0 ) =: Wg for all t ∈ [t0 , ∞). (2) Modulo rescaling, gt,0 converges in the smooth topology to a K ≡ −1 metric ǧ on Wg as t → ∞. (3) (Wg , ǧ) is isometric to (X \ S, gX ) for some finite (possibly empty) subset S ⊂ X, where the cardinality of S is bounded above depending only on t0 , and the bounds the curvature, injectivity radius, and volume of g. DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 27 (4) If g has constant sectional curvature, then Wg = X and ǧ = λg for some λ ∈ (0, ∞). The proof is nearly identical to the proof of Lemma 3.1, except that we appeal to Theorem 2.16(5) rather than Theorem 2.16(4). As in the spherical space form case, Theorem 2.16 implies that (Wg , ǧ) is welldefined. Then the proof of continuity in Lemma 3.2 carries over, using Theorem 2.16(5) and (iii) instead of Theorem 2.16(4) and [FGKO15]. Now assume that X is not orientable. b → X be the 2-fold orientation cover, with deck group action Z2 y X. b For Let X b be the pullbacks of g, gb to X, b respectively, every g ∈ Met(X), let gb, gbX ∈ Met(X) c be a singular Ricci flow with M0 given by (X, b gb). and let M b = M0 extends uniquely to an isoBy Theorem 2.14, the deck group action Z2 y X c b metric action Z2 y M. Since the partially defined metric (Wgb, b̌ g) ∈ PartMetK≡−1 (X) is canonical and depends continuously on g, it is Z2 -invariant, and descends to X, yielding a partially defined metric (Wg , ǧ) ∈ PartMetK≡−1 (X), which depends continuously on g. b gbX ) punctured By Lemma 6.1 the Riemannian manifold (Wgb, gbω ) is isometric to (X, at a finite set of points of cardinality controlled by bounds on the geometry of g and t0 , as in assertion (3) of Lemma 6.1. Therefore the metric completion (Wgb, b̌ g) of (Wgb, b̌ g) b b̌ is isometric to (X, gbX ). The isometric action Z2 y (Wgb, g) extends canonically to an isometric action Z2 y (Wgb, b̌ g). Suppose some point x ∈ (Wgb, b̌ g) \ (Wgb, b̌ g) is fixed by the Z2 action. Then the Z2 -action will preserve a small metric sphere N ⊂ Wgb centered at x, preserving an orientation of its normal bundle. It follows that the quotient N/Z2 is a 2-sided copy of RP 2 embedded in X. This contradicts the fact that X is a compact hyperbolic manifold. Therefore the action Z2 y (Wgb, b̌ g) is free. 0 0 Hence the completion of (Wg , ǧ) is a compact hyperbolic 3-manifold (X , gX 0 ), and 0 0 0 (Wg , ǧ) is isometric to (X 0 \S 0 , gX 0 ). Now the embedding X \S ' Wg ,→ X, together with the irreducibility of X, implies that X 0 is diffeomorphic to X. Thus we have shown that we have a well-defined continuous assignment g 7→ (Wg , ǧ) ∈ PartMet(X) such that (Wg , ǧ) is isometric to (X \ Sg , gX ) for some finite set Sg ⊂ X, where the cardinality |Sg | is controlled by the constant t0 = t0 (g) as in Lemma 6.1, and bounds on the geometry of g. However, by Theorem 2.15 and the convergence property stated in (i)–(iii) in the beginning of this section we may choose t0 (g) to be a locally bounded function of g. In particular, on any compact subset of Met(X), we may choose g 7→ t0 (g) to be bounded. Sections 4 and 5 now carry over after making the obvious change in the sign of curvature, and replacing S 3 with hyperbolic 3-space H3 . 28 RICHARD H. BAMLER AND BRUCE KLEINER Remark 6.2. (cf. Remark 3.4) Rather than using the uniform exponential convergence of the normalized Ricci flow to a hyperbolic metric, for the applications in this paper it would work equally well if we used another procedure for converting an almost hyperbolic metric to a hyperbolic metric. For instance, if (X, gX ) is a hyperbolic manifold, and g ∈ Met(X) is sufficiently close to gX , then there is a unique harmonic map φg : (X, g) → (X, gX ) homotopic to the identity map idX , and the pullback φ∗g gX is a hyperbolic metric. Furthermore (by a simple compactness argument) φ∗g gX varies continuously with g. References [Asa78] K. Asano, Homeomorphisms of prism manifolds, Yokohama Math. J. 26 (1978), no. 1, 19–25. [Bam14] R. Bamler, Stability of hyperbolic manifolds with cusps under Ricci flow, Adv. Math. 263 (2014), 412–467. [Bam17] Richard H. Bamler, The long-time behavior of 3-dimensional Ricci flow on certain topologies, J. Reine Angew. Math. 725 (2017), 183–215. [BKa] R. Bamler and B. Kleiner, in preparation. [BKb] , Uniqueness and stability of Ricci flow through singularities, http://lanl.arxiv.org/abs/1709.04122. [BO91] M. Boileau and J-P. Otal, Scindements de Heegaard et groupe des homéotopies des petites variétés de Seifert, Invent. Math. 106 (1991), no. 1, 85–107. [Bon83] F. Bonahon, Difféotopies des espaces lenticulaires, Topology 22 (1983), no. 3, 305–314. [Cer59] J. Cerf, Groupes d’automorphismes et groupes de difféomorphismes des variétés compactes de dimension 3, Bull. Soc. Math. France 87 (1959), 319–329. [Cer64a] , La nullité de π0 (DiffS 3 . 1. Position du problème, Séminaire Henri Cartan, 1962/63, Exp. 9-10, Secrétariat mathématique, Paris, 1964, p. 27. MR 0198484 [Cer64b] , La nullité de π0 (Diff S 3 . 2. Espaces fonctionnels liés aux décompositions d’une sphěre plongée dans R3, Séminaire Henri Cartan, 1962/63, Exp. 20, Secrétariat mathématique, Paris, 1964, p. 29. MR 0198485 [Cer64c] , La nullité de π0 (DiffS 3 . 3. Construction d’une section pour le revêtement R, Séminaire Henri Cartan, 1962/63, Exp. 21, Secrétariat mathématique, Paris, 1964, p. 25. MR 0198486 [Cer64d] , La nullité de π0 (DiffS 3 . Théorèmes de fibration des espaces de plongements. Applications, Séminaire Henri Cartan, 1962/63, Exp. 8, Secrétariat mathématique, Paris, 1964, p. 13. MR 0198483 [CM05] T. H. Colding and W. P. Minicozzi, II, Estimates for the extinction time for the Ricci flow on certain 3-manifolds and a question of Perelman, J. Amer. Math. Soc. 18 (2005), no. 3, 561–569. [CS79] S. E. Cappell and J. L. Shaneson, A counterexample on the oozing problem for closed manifolds, Algebraic topology, Aarhus 1978 (Proc. Sympos., Univ. Aarhus, Aarhus, 1978), Lecture Notes in Math., vol. 763, Springer, Berlin, 1979, pp. 627–634. [dR40] G. de Rham, Sur les complexes avec automorphismes, Comment. Math. Helv. 12 (1940), 191–211. [FGKO15] T. Farrell, Z. Gang, D. Knopf, and P. Ontaneda, Sphere bundles with 1/4-pinched metrics, Trans. AMS (2015). [Fra35] W. Franz, über die Torsion einer überdeckung, J. Reine Angew. Math. 173 (1935), 245–254. [Gab01] D. Gabai, The Smale conjecture for hyperbolic 3-manifolds: Isom(M 3 ) ' Diff(M 3 ), J. Differential Geom. 58 (2001), no. 1, 113–149. DIFFEOMORPHISM GROUPS OF 3-MANIFOLDS 29 [Ham82] R. S. Hamilton, Three-manifolds with positive Ricci curvature, J. Differential Geom. 17 (1982), no. 2, 255–306. [Hat76] A. Hatcher, Homeomorphisms of sufficiently large P 2 -irreducible 3-manifolds, Topology 15 (1976), no. 4, 343–347. , A proof of the Smale conjecture, Diff(S 3 ) ' O(4), Ann. of Math. (2) 117 (1983), [Hat83] no. 3, 553–607. [HKMR12] S. Hong, J. Kalliongis, D. McCullough, and J. H. Rubinstein, Diffeomorphisms of elliptic 3-manifolds, Lecture Notes in Mathematics, vol. 2055, Springer, Heidelberg, 2012. [Iva76] N. V. Ivanov, Groups of diffeomorphisms of Waldhausen manifolds, Zap. Naučn. Sem. Leningrad. Otdel. Mat. Inst. Steklov. (LOMI) 66 (1976), 172–176, 209, Studies in topology, II. , Homotopy of spaces of diffeomorphisms of some three-dimensional manifolds, [Iva82] Zap. Nauchn. Sem. Leningrad. Otdel. Mat. Inst. Steklov. (LOMI) 122 (1982), 72–103, 164–165, Studies in topology, IV. , Homotopy of spaces of diffeomorphisms of some three-dimensional manifolds, [Iva84] J. Soviet Math. 26 (1984), 1646–1664. [KL08] B. Kleiner and J. Lott, Notes on Perelman’s papers, Geometry & Topology 12 (2008), no. 5, 2587–2855. , Singular Ricci flows I, http://arxiv.org/abs/1408.2271v2, to appear in Acta [KL14] Mathematica (2014). [Lau74] F. Laudenbach, Topologie de la dimension trois: homotopie et isotopie, Société Mathématique de France, Paris, 1974, With an English summary and table of contents, Astérisque, No. 12. [Mil66] J. Milnor, Whitehead torsion, Bull. Amer. Math. Soc. 72 (1966), 358–426. [Per03a] G. Perelman, Finite extinction time for the solutions to the Ricci flow on certain threemanifolds. [Per03b] , Ricci flow with surgery on three-manifolds, http://arxiv.org/abs/math/0303109v1 (2003). [RB84] J. H. Rubinstein and J. S. Birman, One-sided Heegaard splittings and homeotopy groups of some 3-manifolds, Proc. London Math. Soc. (3) 49 (1984), no. 3, 517–536. [Rei35] K. Reidemeister, Homotopieringe und Linsenräume, Abh. Math. Sem. Univ. Hamburg 11 (1935), no. 1, 102–109. [Rub79] J. H. Rubinstein, On 3-manifolds that have finite fundamental group and contain Klein bottles, Trans. Amer. Math. Soc. 251 (1979), 129–137. [Sma61] S. Smale, Review of Cerf’s paper [Cer59], 1961. [Wal68] F. Waldhausen, On irreducible 3-manifolds which are sufficiently large, Ann. of Math. (2) 87 (1968), 56–88. [Ye93] R. Ye, Ricci flow, Einstein metrics and space forms, Trans. Amer. Math. Soc. 338 (1993), no. 2, 871–896. Department of Mathematics, University of California, Berkeley, Berkeley, CA 94720 E-mail address: [email protected] Courant Institute of Mathematical Sciences, New York University, 251 Mercer St., New York, NY 10012 E-mail address: [email protected]
4math.GR
arXiv:1712.00846v1 [cs.AI] 3 Dec 2017 Always Lurking: Understanding and Mitigating Bias in Online Human Trafficking Detection Kyle Hundman Thamme Gowda ∗ [email protected] NASA Jet Propulsion Laboratory California Institute of Technology Pasadena, CA 91109 USA [email protected] Information Sciences Institute University of Southern California Marina Del Rey, CA 90292, USA Mayank Kejriwal Benedikt Boecking [email protected] Information Sciences Institute University of Southern California Marina Del Rey, CA 90292, USA [email protected] Carnegie Mellon University Pittsburgh, PA 15213, USA Abstract Web-based human trafficking activity has increased in recent years but it remains sparsely dispersed among escort advertisements and difficult to identify due to its often-latent nature. The use of intelligent systems to detect trafficking can thus have a direct impact on investigative resource allocation and decision-making, and, more broadly, help curb a widespread social problem. Trafficking detection involves assigning a normalized score to a set of escort advertisements crawled from the Web – a higher score indicates a greater risk of trafficking-related (involuntary) activities. In this paper, we define and study the problem of trafficking detection and present a trafficking detection pipeline architecture developed over three years of research within the DARPA Memex program. Drawing on multi-institutional data, systems, and experiences collected during this time, we also conduct post hoc bias analyses and present a bias mitigation plan. Our findings show that, while automatic trafficking detection is an important application of AI for social good, it also provides cautionary lessons for deploying predictive machine learning algorithms without appropriate de-biasing. This ultimately led to integration of an interpretable solution into a search system that contains over 100 million advertisements and is used by over 200 law enforcement agencies to investigate leads. Introduction Human trafficking has seen increasing media attention and government focus in recent years due to its pervasiveness and insidious nature (Austin and Farrell 2017). It is also characterized by a significant Web presence, with traffickers often advertising their victims on public platforms such as backpage.com (Szekely et al. 2015). Forums and review sites also contain discussions by ‘clients’ about (potentially trafficked) escorts, and other aspects of their experiences, such as the youth of, and services provided by, the escort. The high prevalence of online sex advertisements (ads) and reviews, even on the Open Web, was a motivating fac∗ This work was done when the author was at the NASA Jet Propulsion Laboratory, Pasadena, CA, USA. Copyright c 2018, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. tor in the creation of the DARPA Memex1 program, under which this work was funded and conducted over a period of three years. Memex was designed to advance the stateof-the-art in building domain-specific search systems over massive Web corpora, especially in difficult domains like human trafficking. Various Memex-funded systems can be integrated to build end-to-end domain-specific search systems, starting from domain modeling and discovery (including crawling the Web for relevant pages), knowledge graph construction, machine learning and information retrieval (Szekely et al. 2015), (Kejriwal and Szekely 2017), (Krishnamurthy et al. 2016), (Shin et al. 2015). An important inferential problem that needs to be addressed at scale in this pipeline is to detect potential trafficking activity by assigning a risk score to a set of advertisements, usually collected by an investigative expert like a law enforcement official. In the simplest case, the risk score is a binary flag, with 1 indicating that the ads in the set warrant further trafficking-related investigation. Intuitively, a set represents an informal version of a ‘case study’ that, for reasons grounded in real-world activities like tip-offs from contacts in the field, arrest records or exploratory search, has come to the attention of an official. While a single ad is often not useful by itself, intriguingly, when considered in aggregate, even a small set of ads in the case study can provide subtle clues indicating trafficking, rather than voluntary escort activities. For example, there may be evidence in one of the ads that an escort is underage or is advertising sex services that are risky and unusual relative to the domain. There may also be evidence of movement between cities, or in the case of brothels often fronting as Asian massage parlors, ethnicity-related clues. The problem of trafficking detection, even by a human carefully analyzing the case study, is further compounded by the fact that ads in such case studies tend to be related only latently, and the relation itself can be subtle. In most cases, the assumption in identifying trafficking-related case studies is that escorts represented in the case study ads are being trafficked in a similar context, i.e. by a single individual or 1 https://www.darpa.mil/program/memex an organization. Precisely identifying such contexts, and evidence backing the contexts, can be used to inform investigative decision making, alleviate the cognitive burden and significantly preserve the limited resources of both law enforcement and state district attorneys, who are often tasked with prosecuting trafficking-related cases. Given that the Memex program has already scraped many millions of sex advertisements on the Web for investigative purposes (Kejriwal and Szekely 2017), automatic detection methods, ideally with interpretation, can serve an important, socially beneficial function. At the same time, because the latest state-of-the-art methods in text classification use complex machine learning models like deep neural networks (Zhang, Zhao, and LeCun 2015a), with strong (and not very well understood) dependencies on the input data, it is important to understand the biases and limitations of such methods. Systematically understanding the tradeoff described above, between building a system that can serve as an important example of AI for Social Good, and ensuring that the system is fit for use in a real world, requires a collaborative, socio-technological exchange. The Memex program provided such an exchange through a series of competitions and quarterly progress reviews (QPRs) when participants would regularly gather for myriad purposes such as system evaluation, strategic collaborations, and detailed meetings with potential real-world users of the system such as law enforcement. The QPRs led to a rich trove of insights around trafficking detection, both as a technical and an investigative field problem. In this paper, we use these insights to present the trafficking detection problem in depth for the broader research community, solutions explored and developed over the course of three years, corresponding lessons learned, eventual (and ongoing) integration into a comprehensive search system, and continuing impact. Specific contributions are listed below. Contributions. The main contributions of this work are described as follows. We describe the trafficking detection problem and the motivations for devising automatic trafficking detection methods. We present an architectural overview of the approach that was first developed (before bias analysis and mitigation), followed by a bias mitigation plan that was put in place and continues to be implemented. We describe the lessons learned over three years of research from this exercise, and the changes that were made to the system in response to real-world users. The most important change was that the problem definition itself became finergrained, allowing a degree of interpretability. Solutions to this finer-grained problem are already in the process of being integrated into a large-scale domain-specific search system that has had considerable impact in the last year on sex trafficking-related prosecutions. In keeping with the scope of this work, we favor discussions of methodology over technical descriptions, except when necessary. Similarly, while we attempt to provide quantitative data when feasible, we also pay close attention to aspects of this work that cannot be easily controlled for or quantified, but still provide important lessons for deploying similarly complex systems. Related Work This work primarily draws on two emerging areas of research that are continuing to increase in significance. First, devising feasible and useful solutions for automatic trafficking detection is a good example of the general field of AI for social good, at the levels of both algorithmic development and engineering effort. Second, the bias analysis conducted in this paper directly reflects recent debate on the (often unintentional) biases that creep into AI systems. Rather than attempt comprehensive coverage of these research areas, we focus on work that is closely tied to human trafficking (and where applicable, similar illicit domains). Intelligent Systems for Counter-Human Trafficking. Because of the alarming rise in online sex advertisement activity, a non-trivial portion of which may pertain to trafficking, building intelligent systems for assisting investigators and for enabling counter-human trafficking efforts has emerged as an important agenda. (Dubrawski et al. 2015) presented a host of data mining methods to support sex trafficking investigators in individual cases as well as lawmakers in understanding community-level statistics, amongst them the use of anomaly detection methods for community level statistics and an analysis of different text classifiers to detect sex trafficking-related activity. (Portnoff et al. 2017) present techniques to link related escort advertisements including a stylometry based classifier as well as an approach that exploits data leakage in the payment system of advertisements conducted via bitcoin. (Nagpal et al. 2015) investigate clustering approaches for escort advertisements and rely on blocking schemes to link large amounts of escort advertisement data. Features such as rare n-grams or rare images can be used to create blocks of data within which exact comparisons of advertisements are carried out to generate clusters. The final cluster resolution is then achieved by subsequently resolving the dataset across blocks. More generally, there is a growing body of work for assisting investigative efforts in illicit domains, which includes not just human trafficking (HT), but also domains such as illegal weapons sales and securities fraud, both of which have also been investigated under the Memex program. Often, both text and multi-modal data are involved. (Mattmann et al. 2016) explored metadata of multimedia files (such as Exif Tags in images and videos) retrieved from escort ad websites to assist HT forensics. (Gowda, Hundman, and Mattmann 2017) applied a deep learning-based computer vision framework to assist the detection and classification of ads related to illegal and dangerous weapons. Other relevant examples include building search systems for helping investigators search for, and research, promising leads. The Domain-specific Insight Graph (DIG) system is a good example of the latter and is currently being used by over 200 law enforcement agencies to counter human trafficking (Szekely et al. 2015; Kejriwal and Szekely 2017). Trust and Bias in AI. A series of recent studies have shown that even standard algorithms are not without bias. For example, (Caliskan, Bryson, and Narayanan 2017) show that standard learning algorithms trained on widespread text corpora learn stereotyped biases. (Sandvig et al. 2014) provide an overview of research that criticizes and reverse en- gineers algorithms to understand consequences of their deployment and to discuss potential discrimination stemming from their use. The presence of undesired bias in feature representations automatically learned from the training dataset has also been studied in the literature; for instance, (Zhao et al. 2017) analyzed the gender biases in machine learning models. The studies cited above make it clear that detecting bias in intelligent systems is both important and non-trivial. Thus, in describing our trafficking detection approach, we also present a bias mitigation plan that emerged from months of effort, and key elements of which are already being integrated in an in-use counter-trafficking search system. Problem Definition and Challenges We assume a data collection process that yields a domainspecific collection C of webpages, almost all of which may be assumed to be either advertising sex (an escort ad) or reviewing the services of an escort (a review ad), collected via specially-tuned Web crawlers. In the most general case, each ad c ∈ C is simply an HTML page, but it is convenient to assume that some preprocessing has been done (most importantly, text scraping and information extraction) and that c is itself a set of key-value pairs. More concretely, the schema of C, which is a union over all keys in the collection, includes such attributes as phone numbers, locations, dates, and cleaned ad text, to name a few, and were used both for modeling and bias mitigation as well as in search systems that were eventually exposed to law enforcement. Given a small set C 0 ⊂ C of ads from this collection, we define the automatic trafficking detection problem as discovering an assignment function f : C 0 → [0, 1], where we denote f (C 0 ) as the trafficking risk score of the case study C 0 . There are reasons for using this terminology. First, the manner in which C 0 is isolated from C is qualitatively similar to how a case study file is constructed. Ads in C 0 are not sampled at random, although the precise reason for grouping the ads in C 0 together may not be known in advance. Second, we note that any outputs by f cannot be validated (even by a human reading the ad) except through a real-world investigation. In this sense, the problem is different from ordinary text or cluster classification problems, and more similar to Information Retrieval problems that seek to assess ‘relevance.’ For this reason, f is only said to assign a risk score. Given the success and pervasive use of commercial search platforms like Google, why is an automated solution to trafficking detection even necessary? It is not unreasonable to assume a hypothetical lead generation workflow whereby an investigator, after a period of browsing or exploration on high-activity portals like the adult section of backpage. com, could make informed investigative decisions in an online fashion on whether a generated lead warrants a highpriority investigation. There are several problems that arise with such exploratory lead generation. First, although a sizable portion of trafficking activity takes place on the public Web, it is sparsely interspersed among escort ads and reviews. In general, the connection between human trafficking and online sex advertising is still not well-understood (Latonero 2011) but preliminary studies conducted under Memex provided some evidence that trafficking-related lead generation is a non-trivial problem. For investigative purposes, nontrafficking leads do not take priority over those that may exhibit some form of trafficking. The second problem, which aggravates the effects of sparsity, is prohibitive scale2 . Although potential case study clusters can be isolated from this collection through a conservative process of rule- or keyword-based application, the many thousands of clusters that emerge as a result are far too many for a human to classify or study. Even more importantly, the domain is notoriously dynamic and adversarial, since potentially indicative signals (such as tattoos on specific body parts, and language use in advertisements) are constantly evolving, and are not well-understood sociologically. Beyond addressing general problems of scale and sparsity (particularly, class skew), timely and automatic detection of trafficking-related activity has two other domain-specific motivations, both of which have the potential for widespread social impact. First, identifying cases at high risk can lead to early investigations, which may stop others from being trafficked. In this case, the motivation has a preventive aspect to it. Second, the ads, if flagged in time and retained offline, have proven to be potent exhibits in actual trafficking-related criminal cases that were recently prosecuted in the US in New York and California (Greenemeier 2016). By supporting prosecutions and evidence gathering, automatic detection systems have real potential for accelerating social justice and for raising the barrier to entry for traffickers that are using the Web to advertise illicit activity. Approach Human trafficking detection, from the algorithmic perspective, is a binary classification task on retrieved escort ad and review data. Several tasks involved in this pipeline were performed as a collaborative effort among multiple research groups funded by the Memex program. Figure 1 illustrates the stages involved in an end-to-end pipeline designed for training and evaluating automatic trafficking detection: Step 1: Crawling and Data Collection: Web crawlers designed under Memex were tuned to search for, and scrape, sex-related advertisements, particularly from online marketplaces with significant escort- and escort review-related activity. Data analysis showed the majority of ads and reviews to be respectively coming from the adult sections of backpage.com and craigslist.com, and eroticreview.com. Data collected from crawlers was made available by indexing to the common data repository (CDR) system. Step 2: Extraction: In this stage, the crawled webpages and multimedia files were processed by Information Extraction algorithms (Chang et al. 2006) that extracted domainspecific attributes such as phone numbers, dates, locations of services, image links, and plain text decriptions (Szekely et al. 2015; Mattmann and Zitting 2011). All extractions were indexed in the CDR along with the raw data. Step 3: Labeling: Labeling of escort data by trafficking experts is a costly and time-consuming task, involving sig2 The current Memex repository indexes over 100M documents. Figure 1: The end-to-end trafficking detection pipeline designed for multi-modal Web-scale corpora containing sex advertisements and reviews. This pipeline includes data collection stages such as crawling and extraction, data preparation stages such as sampling and clustering for acquiring labeled data for training and evaluation, and finally, the standard machine learning stages of featurization, training, ensembling, evaluation and post hoc feature analysis. nificance cognitive burden. Several law enforcement partners across the U.S. shared information on historical and recent cases of (suspected) human trafficking that allowed us to retrieve relevant positive advertisements using unique identifiers such as phone numbers. Obtaining a reasonable amount of negatively labeled (i.e. not of investigative interest) ad data proved to be more difficult. Athough the Memex program contracted experts to acquire a training set of negatively labeled ads, the data was limited. Step 4: Sampling and Clustering: Sampling attempts to address the scarcity of negatively-labeled ads by relying on the assumption that the relative prevalence of positive ads is small. The key idea is to obtain noisy negative labels by selecting groups of related advertisements at random from the entire corpus, and labeling them as negative. However, since this process of obtaining negative labels is substantially different from the process of obtaining positive labels, the approach resulted in biased training subsets. This led to the development of a more rigorous negative sampling approach detailed further in the Bias Mitigation Plan. In the real world, as discussed in earlier section, ads are not independently created and there exist underlying clusters of ads (denoted earlier as case studies) that are generated by distinct entities (such as escorts) but tend to contain similar text and media by way of a latent relationship. Clusters acquired for the purposes of training and evaluating the system need to satisfy downstream independent and identically distributed (i.i.d.) data modeling assumptions. To achieve this, we designed a set of multi-modal similarity functions over extracted attributes such as descriptive text, phone numbers, and images. Intuitively, these similarities can be used to cluster similar ads together and dissimilar items apart. Correlation clustering is one such clustering approach that was found to be very useful in practice. There exist fast correlation clustering approaches with provable guarantees that scale linearly with the data, such as KWIKCLUSTER (Ailon, Charikar, and Newman 2008), which obtains a 3-approximation ratio. Parallel correlation clustering approaches (Pan et al. 2015) based on KWIKCLUSTER have proven to be both efficient and effective in practice. Building on prior research findings (Elsner and Schudy 2009), we tuned and implemented a combination of KWIKCLUSTER, consensus clustering and local heuristics in our approach. Steps 5 and 6: Featurization and Binary Classification Supervised text classification generally involves the mapping words and phrases into numerical feature vectors, using both classic bag-of-words approaches, and in more recent work, word embedding algorithms like word2vec and fastText (Bojanowski et al. 2016). A variety of approaches for both ‘featurization’ and model selection were explored throughout the project, but bias issues made systematic comparisons and validation of models a difficult task. We note that ‘black box’ machine learning models such as deep neural networks provide no assurance that the learned features are not fitting to undesired biases in the labeled dataset (in addition to offering limited performance benefits for smaller training sets like ours (Zhang, Zhao, and LeCun 2015b)). This led us to favor more transparent approaches, allow- ing for greater visibility into potential sources of bias in our system. Models that generally performed well, and offered (at least marginal) interpretability were linear-kernel SVMs (which are capable of suggesting the relative importance of features per (Guyon et al. 2002)), ensemble models such as random forest classifiers, and penalized logistic regression models trained on bag-of-word vectors. These modeling experiments informed both the Bias Mitigation Plan, and the subsequent integration of the approach into end-user tools. Step 7: Evaluation: The approach was evaluated on an independent set of ad clusters that was mutually exclusive from the training set, but was gathered using a similar protocol. We used the area under the Receiver Operating Characteristic (ROC) curve as the performance metric. Posthoc evaluation studies involved detailed analysis of feature importance, and the origin of important features. Bias Mitigation Plan . Mitigating bias in intelligent systems is a complicated issue, as the sources of bias are not easy to isolate. Bias may arise when certain algorithmic assumptions are violated, or when the training data is biased, either because the sample size (compared to the population) is too small, or because the labeled data acquisition process is biased. For example, while positive labels for groups of escort ads may come from a small number of law enforcement contacts that only provide cases for specific regions, noisy negative labels sampled at random will follow the true location distribution in the corpus more closely. Classifiers trained on such data may learn to differentiate classes using locations specific to law enforcement contacts, rather than learn actual and meaningful signals indicating human trafficking. Diagnosing and Evaluating Bias The first step in addressing bias is identifying potential sources of bias that often become apparent through thorough data exploration, domain understanding, or the modeling process. Simple statistical significance tests or the computation of correlation coefficients can assist in validating suspected biases. Also, expert knowledge can also help us determine obvious information in the data that should not be indicative of the output label. For example, we can test the null hypothesis that the distribution of a potentially-biased feature like Web domain is independent with respect to label class (i.e. not biased via sampling, labeling, clustering, etc.) with a Pearson’s chisquared test (Pearson 1900). Using α = 0.05 as the threshold for rejecting our null hypothesis, the below table shows . counts of ads for labeled data available for modeling actual during the program: Table 2: Ads by Domain Group and Label Class Positive Negative Total backpage.com 165,686 125,467 291,153 other 155,271 154,627 309,898 Total 320,957 280,094 601,051 Calculation of the test statistic and subsequent p-value results in p < 0.00001 and our assumption of independence is violated at the chosen α. To correct for this bias we can sample additional (presumably) negative ads from the CDR with the aim of aligning the two distributions. Although these are actual numbers, this is a simplified example intended for demonstration – a more appropriate correction would involve more granular groupings of domains and other biased features would need to be considered during the sampling of additional negatives. Under a more traditional multiple hypothesis testing scenario this would necessitate correcting for the issue of multiple comparisons using, for instance, a Bonferroni correction (Curran-Everett 2000) to set a more rigorous threshold for finding statistically significant relationships. Our motives differ, however, in that we are not using hypothesis tests to identify variables that may help explain a resulting dependent variable, but rather that we are using domain knowledge to determine information that should not strongly correlate with the class labels. In addition to testing for bias, this approach can be used to evaluate the effectiveness of mitigation efforts described below. It should also be used when constructing folds for cross validation to ensure independence assumptions hold during learning. If mitigation is successful independence assumptions should be satisfied according to the above criteria. Mitigation of Bias Information Removal and Conditioned Sampling. Upon identifying biased information in training data, we want to ensure that we correct for the bias before or during model training. One way to achieve this is to try to remove any information that relates to a biased feature either before or after vectorization of the data points. For example, in the context of location bias, one could try to remove any tokens in the ad text that refer to locations. Naturally, this requires information extractors with high recall and ideally high precision, which may not always be available. Another approach towards alleviating this issue is to add or remove data points from the training data with the goal of ensuring that the distribution of the biased feature is similar across the positive and negative data points. Adding additional human-labeled data, especially in such a way as to align distributions is difficult, expensive, and may introduce additional unwanted sampling biases. In this context, a more appropriate method to control for bias is to extract additional negative ads from the CDR such that our sample contains similar distributions of biased features across classes, discouraging classifiers from learning them. As mentioned in Step 4 of the Approach section, the process of sampling of negative ads and clusters from the CDR is conducive to the conditioning, especially when extractions for biased features are readily available. This strategy introduces the step of determining how to measure similarity between distributions, which may be done via distribution divergence measures such as the Rényi divergence (Van Erven and Harremos 2014) or by doing a two-sample Kolmogorov– Smirnov test (Daniel and others 1978). Clustering. Ignoring inherent dependencies between ads Bias Type Overview Table 1: Bias Mitigation Overview Diagnosis and Evaluation Mitigation Steps Labeling Labeled data biased toward certain locations, Web domains, and positive class due to nature of labeling 1. Use correlation and hypothesis tests to evaluate independence of potentially-biased features relative to class 1. Sample additional negative examples conditioned on biases found in positive class data 2. Remove biased features Domain-Specific Cluster sizes vary and escort ad content is often duplicated across accounts and domains 1. Single-feature modeling (e.g. cluster size) 2. Test for duplicate data across classes 1. Sample negative clusters to resemble positive cluster sizes 2. Use multi-objective clustering to prevent duplicated content from appearing across clusters Estimation Training data is limited and careless partitioning can cause overfitting to samples and invalid results 1. Classes in cross-validation folds should show homogeneity between distributions of biased features 1. Condition cross-validation folds to have matching distributions of unwanted features 2. Maintain model interpretability introduces numerous problems when the aim is to build text classifiers that assume i.i.d. data. For example, the implicit weighting of features that occurs in a dataset with many near duplicates will not reflect the importance of the features in relation to the output label one is trying to predict. Rather, a model will be encouraged to memorize specific patterns in training data duplicated across classes. This is especially problematic under widely varying cluster sizes, which would suggest cluster-level classification as a sensible scheme. Recovering the true underlying clusters presents unique challenges. The same person or group may produce ads for multiple individuals. Additionally, ad text and images are sometimes copied across personas and phone numbers are often intentionally obfuscated. As described in Step 4 of the Approach, we used a correlation clustering method and some local heuristics to achieve subjectively good clustering results. To estimate how well the clustering helped in creating a clean training and test split as well as clean crossvalidation folds one can estimate the out-of-cluster loss of a model under dependency within latent clusters, i.e. a way to recover the loss in the independent setting, such as shown in (Barnes and Dubrawski 2017). Indicator Mining and Integration. In Table 1, interpretability of the model is a key mitigation step and involves a social aspect since the utility of interpretability is to the users of the system. Detailed conversations with law enforcement officials revealed a strong desire that the systems produce finer-grained ‘clues’ suggestive of potential, context-dependent trafficking detection, rather than a single score. These clues, called indicators, are highly specific and are designed to detect such high-level features as escort movement, advertisement of risky sex services, and presence of multiple girls within a single advertisement and several others. Indicators are defined to be features that are (believed to be) relevant to inferring accurate trafficking risk scores. In the last phase of the program, we significantly extended the principles of the approach with expert-elicited rules and unsupervised text embeddings to supplement ads with indicators. At the time of writing, these indicators are actively being integrated into the DIG search system, currently in use by more than 200 U.S. law enforcement agencies. Impact and Conclusion The majority of Memex trafficking detection systems are being permanently transitioned to the office of the District Attorney of New York, and generic ‘non-trafficking’ versions have been released as open-source software in the DARPA Memex catalog3 . In the last year, DIG, along with other trafficking detection tools from Memex, has led to at least three trafficking prosecutions, including a recently concluded case in San Francisco where a man was sentenced to 97 years to life for human trafficking4 . More than 25 victims were rescued, and the DA’s office in San Francisco publicly acknowledged the Memex tools in making this possible. This paper presented and defined an important problem called trafficking detection, which has much potential to be aided by recent advances in intelligent systems. We presented a general approach to the problem developed and evaluated over years of research under the DARPA Memex program, and a mitigation plan for addressing biases in the approach. Given Memex’s sustained impact, we hope to continue improving our trafficking detection systems. Acknowledgements.This effort was supported in part by JPL, managed by the California Institute of Technology on behalf of NASA, and additionally in part by the DARPA Memex/XDATA/D3M programs and NSF award numbers ICER-1639753, PLR-1348450 and PLR-144562 funded a portion of the work. The authors particularly thank Dr. Chris Mattmann from JPL, Dr. Pedro Szekely from ISI, and Dr. Artur Dubrawski from Carnegie Mellon University for their support and all of the Memex collaborators for their contributions. 3 https://opencatalog.darpa.mil/MEMEX.html http://www.sfgate.com/crime/article/ Man-sentenced-to-97-years-in-human-\ trafficking-7294727.php 4 References [Ailon, Charikar, and Newman 2008] Ailon, N.; Charikar, M.; and Newman, A. 2008. Aggregating inconsistent information: ranking and clustering. Journal of the ACM (JACM) 55(5):23. [Austin and Farrell 2017] Austin, R., and Farrell, A. 2017. Human trafficking and the media in the united states. [Barnes and Dubrawski 2017] Barnes, M., and Dubrawski, A. 2017. The binomial block bootstrap estimator for evaluating loss on dependent clusters. In In Proceedings of the Conference on Uncertainty in Artificial Intelligence (UAI). [Bojanowski et al. 2016] Bojanowski, P.; Grave, E.; Joulin, A.; and Mikolov, T. 2016. Enriching word vectors with subword information. arXiv preprint arXiv:1607.04606. [Caliskan, Bryson, and Narayanan 2017] Caliskan, A.; Bryson, J. J.; and Narayanan, A. 2017. Semantics derived automatically from language corpora contain human-like biases. Science 356(6334):183–186. [Chang et al. 2006] Chang, C.-H.; Kayed, M.; Girgis, M. R.; and Shaalan, K. F. 2006. A survey of web information extraction systems. IEEE transactions on knowledge and data engineering 18(10):1411–1428. [Curran-Everett 2000] Curran-Everett, D. 2000. Multiple comparisons: philosophies and illustrations. American Journal of Physiology-Regulatory, Integrative and Comparative Physiology 279(1):R1–R8. [Daniel and others 1978] Daniel, W. W., et al. 1978. Applied nonparametric statistics. Houghton Mifflin. [Dubrawski et al. 2015] Dubrawski, A.; Miller, K.; Barnes, M.; Boecking, B.; and Kennedy, E. 2015. Leveraging publicly available data to discern patterns of human-trafficking activity. Journal of Human Trafficking 1(1):65–85. [Elsner and Schudy 2009] Elsner, M., and Schudy, W. 2009. Bounding and comparing methods for correlation clustering beyond ilp. In Proceedings of the Workshop on Integer Linear Programming for Natural Langauge Processing, 19–27. Association for Computational Linguistics. [Gowda, Hundman, and Mattmann 2017] Gowda, T.; Hundman, K.; and Mattmann, C. A. 2017. An approach for automatic and large scale image forensics. In Proceedings of the 2nd International Workshop on Multimedia Forensics and Security, 16–20. ACM. [Greenemeier 2016] Greenemeier, L. 2016. Human traffickers caught on hidden internet. [Guyon et al. 2002] Guyon, I.; Weston, J.; Barnhill, S.; and Vapnik, V. 2002. Gene selection for cancer classification using support vector machines. Machine learning 46(1):389– 422. [Kejriwal and Szekely 2017] Kejriwal, M., and Szekely, P. 2017. Knowledge graphs for social good: An entity-centric search engine for the human trafficking domain. IEEE Transactions on Big Data. [Krishnamurthy et al. 2016] Krishnamurthy, Y.; Pham, K.; Santos, A.; and Freire, J. 2016. Interactive exploration for domain discovery on the web. Proc. of KDD IDEA. [Latonero 2011] Latonero, M. 2011. Human trafficking online: The role of social networking sites and online classifieds. [Mattmann and Zitting 2011] Mattmann, C., and Zitting, J. 2011. Tika in action. Manning Publications Co. [Mattmann et al. 2016] Mattmann, C. A.; Yang, G. H.; Manjunatha, H.; Gowda, T.; Zhou, A. J.; Luo, J.; and McGibbney, L. J. a. 2016. Multimedia metadata-based forensics in human trafficking web data. Second Workshop on Search and Exploration of X-Rated Information (SEXI’16), Proceedings of the Ninth ACM International Conference on Web Search and Data Mining 10. [Nagpal et al. 2015] Nagpal, C.; Miller, K.; Boecking, B.; and Dubrawski, A. 2015. An entity resolution approach to isolate instances of human trafficking online. arXiv preprint arXiv:1509.06659. [Pan et al. 2015] Pan, X.; Papailiopoulos, D.; Oymak, S.; Recht, B.; Ramchandran, K.; and Jordan, M. I. 2015. Parallel correlation clustering on big graphs. In Advances in Neural Information Processing Systems, 82–90. [Pearson 1900] Pearson, K. 1900. X. on the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science 50(302):157–175. [Portnoff et al. 2017] Portnoff, R. S.; Huang, D. Y.; Doerfler, P.; Afroz, S.; and McCoy, D. 2017. Backpage and bitcoin: Uncovering human traffickers. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 1595–1604. ACM. [Sandvig et al. 2014] Sandvig, C.; Hamilton, K.; Karahalios, K.; and Langbort, C. 2014. Auditing algorithms: Research methods for detecting discrimination on internet platforms. Data and discrimination: converting critical concerns into productive inquiry. [Shin et al. 2015] Shin, J.; Wu, S.; Wang, F.; De Sa, C.; Zhang, C.; and Ré, C. 2015. Incremental knowledge base construction using deepdive. Proceedings of the VLDB Endowment 8(11):1310–1321. [Szekely et al. 2015] Szekely, P.; Knoblock, C. A.; Slepicka, J.; Philpot, A.; Singh, A.; Yin, C.; Kapoor, D.; Natarajan, P.; Marcu, D.; Knight, K.; Stallard, D.; Karunamoorthy, S. S.; Bojanapalli, R.; Minton, S.; Amanatullah, B.; Hughes, T.; Tamayo, M.; Flynt, D.; Artiss, R.; Chang, S.-F.; Chen, T.; Hiebel, G.; and Ferreira, L. 2015. Building and using a knowledge graph to combat human trafficking. In Proceedings of the 14th International Semantic Web Conference (ISWC 2015). [Van Erven and Harremos 2014] Van Erven, T., and Harremos, P. 2014. Rényi divergence and kullback-leibler divergence. IEEE Transactions on Information Theory 60(7):3797–3820. [Zhang, Zhao, and LeCun 2015a] Zhang, X.; Zhao, J.; and LeCun, Y. 2015a. Character-level convolutional networks for text classification. In Advances in neural information processing systems, 649–657. [Zhang, Zhao, and LeCun 2015b] Zhang, X.; Zhao, J.; and LeCun, Y. 2015b. Character-level convolutional networks for text classification. In Cortes, C.; Lawrence, N. D.; Lee, D. D.; Sugiyama, M.; and Garnett, R., eds., Advances in Neural Information Processing Systems 28. Curran Asso- ciates, Inc. 649–657. [Zhao et al. 2017] Zhao, J.; Wang, T.; Yatskar, M.; Ordonez, V.; and Chang, K.-W. 2017. Men also like shopping: Reducing gender bias amplification using corpus-level constraints. In EMNLP.
2cs.AI
In-Place Sparse Suffix Sorting∗ arXiv:1608.05100v11 [cs.DS] 1 Nov 2017 Nicola Prezza† Abstract Suffix arrays encode the lexicographical order of all suffixes of a text and are often combined with the Longest Common Prefix array (LCP) to simulate navigational queries on the suffix tree in reduced space. In space-critical applications such as sparse and compressed text indexing, only information regarding the lexicographical order of a size-b subset of all n text suffixes is often needed. Such information can be stored space-efficiently (in b words) in the sparse suffix array (SSA). The SSA and its relative sparse LCP array (SLCP) can be used as a space-efficient substitute of the sparse suffix tree. Very recently, Gawrychowski and Kociumaka [11] showed that the sparse suffix tree (and therefore SSA and SLCP) can be built in asymptotically optimal O(b) space with a Monte Carlo algorithm running in O(n) time. The main reason for using the SSA and SLCP arrays in place of the sparse suffix tree is, however, their reduced space of b words each. This leads naturally to the quest for in-place algorithms building these arrays. Franceschini and Muthukrishnan [8] showed that the full suffix array can be built in-place and in optimal running time. On the other hand, finding sub-quadratic in-place algorithms for building the SSA and SLCP for general subsets of suffixes has been an elusive task for decades. In this paper, we give the first solution to this problem. We provide the first in-place algorithm building the full LCP array in O(n log n) expected time and the first Monte Carlo in-place algorithms building the SSA and SLCP in O(n + b log2 n) expected time. We moreover describe the first in-place solution for the suffix selection problem: to compute the i-th smallest text suffix. In order to achieve these results, we show that we can quickly overwrite the text with a reversible and implicit data structure supporting Longest Common Extension queries in polylogarithmic time and text extraction in optimal time: this structure is strictly more powerful than a plain text representation and is of independent interest. ∗ Part of this work was done while the author was a PhD student at the University of Udine, Italy. Work supported by the Danish Research Council (DFF-4005-00267). † DTU Compute, Technical University of Denmark 1 Introduction The suffix sorting problem — to compute the lexicographic order of all suffixes of a text — has been the subject of study of dozens of research articles since the introduction of suffix arrays in [1, 13, 27], and is a fundamental step in most of the indexing and compression algorithms developed to date. The algorithm originally introduced by Manber and Myers in [27] sorts all suffixes of a text of length n in O(n) words of space and O(n log n) time. Even faster construction times can be achieved by constructing the suffix tree in linear time [34] and traversing it. Reducing the constants hidden in the asymptotic linear running time and linear space occupancy of suffix sorting algorithms has been one of the main goals of subsequent works tackling the problem. The survey [29] gives a good overview of the main suffix sorting techniques developed in the two decades following the introduction of suffix arrays. Relevant to our work are the results of Franceschini and Muthukrishnan [8], Goto [15], and Li et al. [24]. The authors of these papers showed that suffix sorting is possible within the same space of the text and the final suffix array, that is, in place. Parallel to the study of techniques to sort all suffixes of a text, several authors started considering the problem of efficiently sorting only a subset of b text’s suffixes [2, 3, 6, 11, 17, 19, 20], a fundamental step in the construction of compressed and sparse text indexes [20] and space-efficient compression algorithms. Very recently, Gawrychowski and Kociumaka [11] gave the first optimal time-and-space solution to the problem, showing that O(b) working space and O(n) running time are achievable with a Monte Carlo algorithm (they also consider a Las Vegas algorithm with higher running time). Interestingly, to date no in-place (i.e. O(1) working space) and sub-quadratic (i.e. o(n · b) time) algorithm is known for the general sparse suffix sorting problem. Such an algorithm should take as input a text T and an array S of b text positions, and suffix-sort S using O(1) words of working space on top of T and S. The hardness of this problem resides — arguably — in its generality: since the b text positions to be sorted can be arbitrarily distributed in the text, it seems hard to devise prefix-doubling or recursive techniques such as the ones existing for the full suffix array or for equallyCopyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited sampled sparse suffix arrays. It is well known (see, e.g. [2]) that the Longest Common Extension problem (LCE) — that is, to find the length of the longest common prefix between any two text suffixes — is closely related to the suffix sorting problem. In this paper, we exploit this relation and give the first in-place solution to the sparse suffix sorting problem. We tackle the problem from a different standpoint with respect to the in-place suffix sorting algorithms described in [8,15,24]: instead of inducing in-place the ordering of S starting from the already-defined ordering of a subset of S, we devise a strategy to replace in-place the text with an implicit data structure (i.e. of the same size of the text plus a constant number of memory words) supporting fast LCE and text access queries. To achieve this result, we first show how to replace the text with the Karp-Rabin fingerprints [21] of a subset of its prefixes. This text representation supports fast computation of the fingerprint of any text substring and optimal-time text extraction, and therefore can be used to answer LCE queries with a simple binary search strategy. By slightly modifying Karp-Rabin’s technique, we are then able to compress these fingerprints to exactly the text’s size (plus a constant number of memory words). Our transformation is fully reversible, implying in particular that the text can be reconstructed (and efficiently accessed) from it. More in detail, let w be the memory word size (in bits), T ∈ {0, . . . , σ − 1}n be the input text stored in n⌈log σ⌉ bits, and ℓ be the result of the LCE query. We show that T can be replaced in-place and O(n) expected time with a data structure of size n⌈log σ⌉+O(w) bits supporting O(log2 ℓ)-time LCE queries with high probability and optimal O(m log σ/w)-time extraction of any length-m text substring. LCE queries can be speeded up to O(log ℓ) time using O(log n) additional words of space. By allowing O(n) additional words of working space and O(n log n) expected time during construction, our structure can be made deterministic, i.e. the returned LCE values are always correct. As a first immediate result, we obtain the first solution for the LCE problem that uses constant space on top of the text while supporting polylogarithmictime LCE queries (see [3, 4, 18, 28, 32, 33] for other space-efficient solutions). Our structure is strictly more powerful than a plain text representation and is of independent interest. Interestingly, our data structures permit to circumvent a lower bound that holds in the read-only model for LCE structures occupying at least linear space. If we are not allowed to modify the text (but only store additional structures on top of it), then the relation s(n)t(n) ∈ Ω(n log n) must hold, where s(n) ∈ Ω(n) and t(n) are the space (in bits) used on top of the text and the time for answering LCE queries, respectively [23]. Both our bounds satisfy, instead, s(n)t(n) ∈ O(log3 n). This is possible because (i) we use O(polylog(n)) space on top of the text, which is in contrast with the requirement s(n) ∈ Ω(n) of [23], and (ii) we allow the text to be overwritten. Our LCE structure can be directly used to solve in-place the sparse suffix sorting problem. We present an algorithm sorting an arbitrary subset of b text suffixes in-place and O(n + b log2 n) expected time. The algorithm returns the correct result with high probability. The second problem we consider is that of building in-place the Longest Common Prefix array (LCP), that is, the array storing the lengths of the longest common prefixes between lexicographically adjacent text suffixes. As SA construction algorithms, LCP construction algorithms have been the subject of several research articles (see [12,30] and references therein). As opposed to suffix arrays, in-place algorithms for building the LCP array have been considered only very recently [25]. The timegap between solutions for building in-place the (full) SA and the LCP is considerable, as the fastest known algorithm for the latter problem runs in O(n2 ) time [25]. The second contribution of this paper is the first subquadratic in-place LCP array construction algorithm. Our algorithm uses constant space on top of T and LCP, runs in O(n log n) expected time on alphabets of size nO(1) , and returns always the correct result. On more general alphabets whose elements fit in a constant number of memory words, we provide an in-place LCP construction algorithm running in O(n log2 n) expected time. To achieve these results, we show how to derandomize our LCE data structure in n words of space by applying multiple rounds of in-place integer sorting to the text’s positions using Karp-Rabin’s fingerprints as comparison values. We then build in-place the suffix array with existing techniques [8] and convert it to the LCP array using our LCE data structure. O(n log n) running time is achieved using in-place radix sorting [10] and compressing a portion of the suffix array to get the extra space for supporting fast LCE queries. Applying the same techniques to the sparse suffix array, we obtain the first solution to the in-place sparse LCP array (SLCP) construction problem. Our algorithm replaces a set S of b text position with the SLCP array relative to the SSA of S in O(n + b log2 n) expected time. The algorithm returns the correct answer with high probability. To conclude, we consider the suffix selection problem: to return the i-th lexicographically smallest text suffix. It is known that this problem can be solved in optimal O(n) time and O(n) words of space on top of the text [9]. Considering that the output consists of only one text position, this solution is far from being spaceCopyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited efficient. In this paper, we present the first in-place solution for the suffix selection problem: our algorithm runs in O(n log3 n) expected time, uses only constant space on top of the text, and returns the correct result with high probability. All our algorithms work under the assumption that the text is re-writable. After execution, we restore the text in its original form. 2 Preliminaries We work under the following model. We assume our input T to be a text of length n drawn from an integer alphabet Σ = {0, . . . , σ − 1}, stored using ⌈log σ⌉ bits per character. We moreover assume that T is rewritable. After execution, our algorithms restore T in its original form. Even though these might seem to be strong requirements, we note that the same assumptions are often (implicitly) made when dealing with in-place algorithms. For example, the assumption that the input takes ⌈log σ⌉ bits per character is equivalent to the one made when sorting in-place n integers of ⌈log σ⌉ bits each, where σ is the largest integer in the array. It is known that the integers could be represented so that they use overall ⌈n log2 σ⌉ + O(1) bits [5], and better representations such as arithmetic or prefix-free encodings achieve even compressed space. Standard in-place sorting algorithms need to assume efficient access to the array, which translates (implicitly) to assumptions on the input format. Generalizing our solutions to more efficient encodings represents therefore a first line of improvement over the results described in this paper. As far as the requirement of re-writable text is concerned, the usual definition of in-place algorithm is “an algorithm which transforms the input into the output using constant additional working space” (where “constant” is measured in computer memory words). In the case of sparse suffix sorting, the input is represented by the text T and the array of positions S, and the output consists of T and the lexicographically-sorted S (or even just S). It is also true that, in our case, we cannot exclude that the same results described in this paper could be obtain re-using only the space of S (as done in [8] for the full suffix array). Also this represents a possible line of improvement over our work. w ≥ 1 is the memory word size (in bits). In our proofs we assume n ∈ ω(1) (clearly, if n ∈ O(1) then all considered problems can be trivially implemented in constant time), log n ≤ w, and ⌈log σ⌉ ≤ w. Since we make use only of integer additions, multiplications, modulo, and bitwise operations (masks, shifts), we assume that we can simulate a memory word of size w′ = c · w for any constant c with only a constant slowdown in the execution of these operations. Subtractions, additions and multiplications between (c · w)-bits words take trivially constant time by breaking the operands in 2c digits of w/2 bits each and use schoolbook’s algorithms (i.e. O(c)-time addition and O(c2 )-time multiplication). The modulo operator a mod q (with q fixed) can be computed as a mod q = a − ⌊a/q⌋ · q. Computing ⌊a/q⌋ can be done efficiently using Knuth’s long division algorithm [22]. Bitwise operations on (c · w)-bits words can trivially be implemented with c bitwise operations between w-bits words. Since we can simulate words of size O(w) with no asymptotic slowdown, our results are generalizable to the case log n ∈ O(w) and log σ ∈ O(w). For some of the results described in Section 5 we will require the stricter bound σ ≤ nO(1) . For a more compact notation, with T [i, . . . , j] we denote both T ’s substring starting at position i and ending at position j, and the integer with binary representation T [i]T [i + 1] . . . , T [j] (each T [i] being a ⌈log σ⌉-bits integer). If j < i, T [i, . . . , j] denotes the empty string ǫ or the integer 0. The use (string/integer) will be clear from the context. T.LCE(i, j) indicates the length of the longest common prefix of T [i, . . . , n − 1] and T [j, . . . , n − 1], i.e. the i-th and j-th suffixes of T . φq : {0, 1}∗ → [0, q − 1] indicates the Karp-Rabin hash function [21] with modulo q on strings from the binary alphabet {0, 1}. This function is defined as φq (S) = S mod q, where ‘S’ has to be interpreted as a binary string on the left hand-side of the equation, and as a binary number of |S| digits on the right-hand side of the equation. W.h.p. (with high probability) means with probability at least 1 − n−c for an arbitrarily large constant c. If not otherwise specified, logarithms are in base 2. 3 A Monte Carlo in-place LCE data structure Our strategy to obtain a data structure supporting LCE queries follows the one described by Bille et al. [3, 4]. Our improvements over this result regard space of the structure and its construction time. First, we describe an implicit data structure supporting efficient computation of the Karp-Rabin fingerprint of any text substring. Our original idea is to replace the text (not just augment it) with the fingerprints of a subset of its prefixes. The loss in space efficiency is avoided by repeatedly picking the Karp-Rabin modulus q very close, but above, a power of two until all residues are below that power of two (thus saving 1 bit per stored fingerprint). Using Karp-Rabin fingerprints, LCE queries are then answered with a technique similar to the one used in [3, 4] (i.e. exponential and binary search on O(log ℓ) prefixes of the two text suffixes). We start considering the binary case σ = 2, and then extend the result to more general alphabets. We Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited introduce two sources of randomness in our structure: the modulus q and the seed s̄. First, we choose a random prime q uniformly in the interval 1 [2, 2w − 1]. We define a block size τ = ⌈log q⌉. Without loss of generality, we assume that n is a multiple of τ (the general case can be reduced to this case by left-padding the text with τ −(n mod τ ) bits). At this point, we choose uniformly a random number (the seed) s̄ in the interval [0, q − 1]. s̄ is an integer of τ bits (after a suitable left-padding of zeros); we left-pad our binary text T with s̄ written in binary. Clearly, LCE(i, j) queries on T can still be solved using the padded text s̄T by simply adding τ to the arguments of LCE (i.e. solving LCE(i + τ, j + τ ) on the padded text). To improve readability, in what follows we assume that T is prefixed by s̄ (and thus write just T and n instead of s̄T and n + τ , respectively). Let B, P ′ ∈ [0, q − 1]n/τ be the arrays defined as Computing 2e mod q takes O(log e) time with the fast exponentiation algorithm, therefore the computation of φq (T [i, . . . , j]) takes O(log(j − i + 1)) time with our structure for all 0 ≤ i ≤ j < n. 3.1 Reducing space usage In order to remove the n/τ -bits overhead, we build an auxiliary array S = hi : ⌊P ′ [i]/2τ −1⌋ = 1, i = 0, . . . , n/τ − 1i storing all i’s such that the most significant bit of P ′ [i] is equal to 1. At this point, we replace P ′ with an array P of n/τ integers of (τ − 1) bits each defined as P [i] = P ′ [i] mod 2τ −1 , i = 0, . . . , n/τ − 1, i.e. we remove the most significant bit from each P ′ [i]. P takes n · (τ − 1)/τ bits of space. Clearly, by using P and S we can retrieve any P ′ [i] in O(|S|) time with a simple linear scan on S. The main idea, at this point, is to choose the prime q in such a way that the expected size of S becomes constant (in fact: equal to zero). B[i] = T [i · τ, . . . , (i + 1) · τ − 1], i = 0, . . . , n/τ − 1 We reverse our strategy. We first choose a block size and τ ∈ Θ(w), pick a uniform prime q such that ⌈log q⌉ = τ , Pi P ′ [i] = j=0 2(i−j)·τ · B[j] mod q and then choose a uniform seed s̄ in [0, q−1]. Operations on integers of size τ ∈ Θ(w) can still be performed = φq (T [0, . . . , (i + 1) · τ − 1]) in constant time. In Sections 3.2 and 3.3 we show First, note that B[i] − q ≤ (2τ − 1) − 2τ −1 < 2τ −1 ≤ how to choose τ . The key point is that each P ′ [i] is q, so ⌊B[i]/q⌋ ∈ {0, 1} holds. We build a bitvector a uniform random variable taking values in the range D[0, . . . , n/τ −1] defined as D[i] = ⌊B[i]/q⌋. To simplify [0, q − 1]. To prove this statement, note that P ′ [i] notation, let P ′ [−1] = 0. At this point, B’s values can can be written as P ′ [i] = s̄ · 2i·τ + t̄i mod q, where be retrieved as B[i] = (P ′ [i] − 2τ · P ′ [i − 1] mod q) + t̄i = φq (T [τ, . . . , (i + 1) · τ − 1]). Let P(P ′ [i] = x), D[i] · q. Arrays P ′ and D take n + n/τ bits of space x < q, be the probability that P ′ [i] is equal to x. Then, and replace the text in that they support the retrieval for any x < q, of any B[i]. First, we show how to compute efficiently φq (T [i, . . . , j]) for any 0 ≤ i ≤ j < n by using P ′ and D. P(P ′ [i] = x) = P(s̄ · 2i·τ + t̄i ≡q x) We then show how to reduce the space usage to n+O(w) (3.2) = P(s̄ ≡q (x − t̄i ) · 2−i·τ ) bits while still being able to support constant-time text extraction and Karp-Rabin fingerprint computation. = 1/q Let j = ⌊i/τ ⌋. Then, The fact that q is prime guarantees the existence of φq (T [0, . . . , i]) = φq (T [0, . . . , j · τ − 1]) · 2i−j·τ +1 + the inverse of 2i·τ modulo q. Let x < q. Equation 3.2 implies, in particular, that φq (T [j · τ, . . . , i]) mod q = P ′ [j − 1] · 2i−j·τ +1 + ⌊B[j]/2τ −i+j·τ −1⌋ (3.3) mod q We now have to show how to compute the fingerprint φq (T [i, . . . , j]), j ≥ i, of any text substring. This can be easily achieved by means of the equality: (3.1) φq (T [i, . . . , j]) = φq (T [0, . . . , j]) − φq (T [0, . . . , i − 1]) · 2j−i+1 mod q 1 Note that we can generate uniform primes from any interval with the naive algorithm that picks a random integer from that interval, tests it for primality, and returns it if prime (repeating until a prime is found). See [7] for more efficient methods. P(P ′ [i] < x) = x/q Let 1̄i ∈ {0, 1} be the indicator random variable taking value 1 iff the most significant bit of P ′ [i] is equal to 1. Equation 3.3 implies that 1̄i has a Bernoullian distribution with success probability p = (q − 2τ −1 )/q. We want this probability to be at most 1/n in order to get an expected constant size for S. By solving (q − 2τ −1 )/q ≤ 1/n and by adding the constraint ⌈log q⌉ = τ , we obtain that the interval Z from which we have to uniformly pick q in order to satisfy both constraints is    n (3.4) Z = 2τ −1 , 2τ −1 n−1 Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited At this point, S’s expected size E[|S|] can be computed holds. From Equation 3.5, E[|S|] ≤ 1/τ , therefore as P(|S| > 0) ≤ 1/τ . This yields P(|S| = 0) ≥ 1 − 1/τ . i hP We choose n/τ −1 E[|S|] = E 1̄i i=0 Pn/τ −1 (3.8) τ = cw ≥ c log n = i=0 E[1̄i ] for any constant c ≥ 1 fixed at construction time, so the (3.5) = nτ E[1̄i ] τ −1 above probability is at least 1 − 1/ log n. Later we will = nτ · q−2q show how to choose c keeping in mind also Constraint ≤ nτ · n1 = τ1 (3.7). Finally, since we assume n ∈ ω(1), then log n ≥ 2 and we obtain P(|S| = 0) ≥ 0.5. Given that we repeat Let b = ⌈log σ⌉. On a general alphabet size such the construction of our structure as long as |S| > 0 that b ≤ w, the text is processed as a binary sequence of holds, the number R of times we repeat the construction nb bits, and the validity of the above results is preserved is a geometric random variable with success probability by substituting n with nb in Equation 3.4. In particular, p = P(|S| = 0) ≥ 0.5, and has therefore expected value Z’s size becomes |Z| = 2τ −1 /(nb − 1) ≥ 2τ −1 /(nb) = 1/p ≤ 2. Note that, since τ ∈ Θ(w) and ⌈log σ⌉ ≤ w, 2τ −1−log n−log b . Since we assume w ≥ log n and w ≥ arrays P and D have O(n) entries each. We obtain the b ≥ log b, we get the lower bound following Lemma: (3.6) |Z| ≥ 2τ −1−2w Lemma 3.1. In O(n) expected time we can build arrays P , D, and S taking overall n⌈log σ⌉+O(w) bits of space Let π(x) denote the number of primes smaller than and supporting the computation of any B[i] and P ′ [i] in x. Let moreover A = 2τ −1 and H = 2τ −1−2w be the constant time. smallest element contained in Z and the lower bound for |Z| stated in Equation 3.6, respectively. Our aim in this 3.3 Monte Carlo LCE data structure On a biparagraph is to compute a lower bound for the number nary alphabet, we can easily answer LCE(i, j) by zp = π(A + H) − π(A) of primes contained in Z. This comparing φq (T [i, . . . , i + k]) with φq (T [j, . . . , j + k]) will be needed later in order to compute the collision for O(log n) values of k with binary search. We probability of our hash function. Note that the Prime can furthermore improve this query time by performNumber Theorem can be applied to solve this task only ing an exponential search before applying the binary if H ≥ A · c, for some fixed c > 0, so we cannot use it in search procedure. We compare φq (T [i, . . . , i + k]) with our case. Luckily for us, Heath-Brown [16] proved (see φq (T [j, . . . , j + k]) for k = 20 , 21 , 22 , . . . until the two also [26]) that, if H grows at least as quickly as A7/12 , fingerprints differ. Letting ℓ = LCE(i, j), this procethen π(A + H) − π(A) ∼ H/ loge A (for A → ∞. e is dure terminates in O(log ℓ) steps. We then apply the the natural logarithm base). Solving H ≥ A7/12 we get binary search procedure described above on the interval the constraint of size O(ℓ) obtained with the exponential search. Each exponential and binary search step take O(log ℓ) time (3.7) τ ≥ (24/5)w + 1 (from the fast exponentiation algorithm). On a more general alphabet, each character takes Later we will show how to choose τ (keeping (3.7) in b = ⌈log σ⌉ ∈ O(w) bits, and our structure is therefore mind). Heath-Brown’s theorem gives us zp ≥ logH A = e built over a binary text T ′ of length n · b. We can 2τ −1−2w 2τ −1−2w 2τ −1−2w . make the query time alphabet-independent as follows. loge (2τ −1 ) ≥ (τ −1) ≥ τ First of all, while computing T.LCE(i, j) we perform 3.2 Deterministic space With the above strategy, exponential and binary searches by comparing φq (T ′ [i · our structure takes n⌈log σ⌉ + O(w) bits of space with b, . . . , (i + k) · b]) with φq (T ′ [j · b, . . . , (j + k) · b]), i.e. we high probability only. We can assure that the space is compare T ′ substrings starting and ending at character with certainty n⌈log σ⌉ + O(w) bits by picking multiple boundaries. This reduces the number of steps to be random pairs q, s̄ as described above and re-building the performed from O(log(ℓ · b)) to O(log ℓ). At this point, structure until this requirement is satisfied (i.e. we move note that each step requires the computation of 2t·b the randomness into the construction algorithm). Our mod q with the fast exponentiation algorithm, t ∈ goal in this section is to compute the expected number O(ℓ) being the length of the two compared substrings R of pairs q, s̄ we have to randomly factor in all P pick before obtaining (O(log(ℓ log σ)) time). Since b is a common b k·P(|S| = k) and an empty S. Note that E[|S|] = exponents, we can pre-compute Y = 2 mod q and—at k>0 P P(|S| > 0) = k>0 P(|S| = k), so P(|S| > 0) ≤ E[|S|] each step—compute Y t mod q instead of 2t·b mod q Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited with the fast exponentiation algorithm. This reduces 2−c log n = n−c . Note that this choice of τ satisfies the number of steps of the exponentiation algorithm to constraints (3.7) and (3.8). This leads to: O(log ℓ). Finally, note that extracting text corresponds P(wrong LCE) ≤ P(C > 0) ≤ n−c to reading array B (τ ∈ Θ(w) bits of the text per B element).  Plugging the lower bound—computed in Section for an arbitrarily large constant c. 3.1—for the number of primes contained in Z inside a Lemma 3.2 leads to our first core result: standard analysis for Karp-Rabin collision probability, we can prove the following: Theorem 3.1. In O(n) expected time we can build a Lemma 3.2. If we choose τ ≥ (9+c)w for an arbitrarily data structure of n⌈log σ⌉+O(w) bits of space supporting large constant c, then the probability that our LCE extraction of any length-m text substring and LCE structure returns a wrong result is upper-bounded by queries w.h.p. in O (m log σ/w) and O(log2 ℓ) worstcase time, respectively. n−c . Proof. We start the analysis from the binary case σ = 2. Let C be the random variable denoting the number of pairs hX, Y i of equal-length T substrings (|X| = |Y |) that generate a collision, i.e. X 6= Y and φq (X) = φq (Y ). Our goal is to compute an upper bound for the probability P(C > 0). Clearly, P(C > 0) is an upper bound to the probability of computing a wrong LCE with our structure. Let Xik denote T ’s substring of length k starting at position i. There is at least one collision (C > 0) iff Xik ≡q Yjk for at least one pair Xik 6= Yjk , i.e. iff q divides at least one of the numbers |Xik − Yjk | such that Xik 6= Yjk . Since q is prime, z = Qn−1 Qthis happensk iff qk divides their product k k |X −Y |. Since each |X −Y | has at k k i j i j k=1 i,j:X 6=Y i j most n binary digits and there are no more than n2 such 4 pairs for every k, we have that z < 2n . It follows that there cannot be more than n4 distinct primes dividing z. Let b = ⌈log σ⌉. On a more general alphabet with b ≤ w, each |Xik − Yjk | has at most nb binary digits, 4 and we obtain z < 2n ·b . It follows that there cannot be more than n4 · b distinct primes dividing z. The probability of uniformly picking a prime q ∈ Z dividing z is therefore upper bounded by n4 · b/zp , where zp is a lower bound on the number of primes contained in Z, see Section 3.1. Recall that zp ≥ 2τ −1−2w /τ , so n4 ·b/zp ≤ n4 ·b·τ /2τ −1−2w = 24 log n+log b+log τ +1+2w−τ . We choose (3.9) τ = (9 + c)w for an arbitrarily large constant c. Being w ∈ ω(1) (because n ∈ ω(1) and w ≥ log n), we assume2 w ≥ log τ = log(9 + c) + log w. We obtain τ = (9 + c)w ≥ (4 + c) log n + log b + log τ + 1 + 2w, therefore n4 · b/zp ≤ 2 Note that this inequality always holds after simulating a memory word of size w ′ = dw for a sufficiently large constant d. Let b = ⌈log σ⌉ and let T ′ ∈ {0, 1}n·b be the concatenation of T ’s characters written in binary. We can avoid the overhead introduced by the fast exponentiation algorithm by pre-computing and storing (in O(log n) words) i values zi = 2b·2 mod q, i = 0, . . . , ⌊log n⌋ and always comparing text substrings whose length is a power of two during binary search: Theorem 3.2. In O(n) expected time we can build a data structure taking n⌈log σ⌉ + O(w log n) bits of space and supporting extraction of any length-m text substring and LCE queries w.h.p. in O (m log σ/w) and O(log ℓ) worst-case time, respectively. Proof. First, note that z0 = 2b mod q and zi+1 = (zi )2 mod q, so the values zi can be pre-computed in O(log n) time. Let the notation hi, j, e, ki, with 0 ≤ i, j, e, k < n and e < k, denote that we already verified (w.h.p.) that T [i, . . . , i + e − 1] = T [j, . . . , j + e − 1] and T [i, . . . , i + k − 1] 6= T [j, . . . , j + k − 1]. We use this notation to indicate the state of a binary search step, and start from state hi, j, 0, n − ji (we assume for simplicity that T [i, . . . , i + (n − j) − 1] 6= T [j, . . . , n − 1]; otherwise, LCE(i, j) = n − j). We use a modified version of Equation 3.1 by adding a parameter (exponential E) to the Karp-Rabin hash function: (3.10) φ′q (T ′ [i, . . . , j], E) = φq (T ′ [0, . . . , j]) − φq (T ′ [0, . . . , i − 1]) · E mod q Note that φq (T ′ [i, . . . , j]) = φ′q (T ′ [i, . . . , j], 2(j−i+1)·b ). At binary search step hi, j, e, ki we still have to compare the last l = k − e characters of T [i, . . . , i + k − 1] and T [j, . . . , j + k − 1]. We split each of these two substrings in the left part of length l′ = 2⌊log(l/2)⌋ (i.e. the closest power of 2 smaller than or equal to l/2) and ′ the right part of length l − l′ . Note that value 2l ·b mod q = zlog l′ = z⌊log(l/2)⌋ has been pre-computed, so Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited we can compute and compare in constant time the two scan one last time the text and, for i = 1, . . . , n/τ − 1, values we replace the most significant bit of B[i] with the bit D[i], and the remaining τ − 1 bits with the value φq (T ′ [(i + e) · b, . . . , (i + e + l′ − 1) · b]) = P [i] (clearly, this allows to retrieve any P [i] and D[i] in constant time). Overall we spend O(n/w) time. ′ ′ ′ φq (T [(i + e) · b, . . . , (i + e + l − 1) · b], z⌊log(l/2)⌋ ) On a general alphabet with ⌈log σ⌉ ∈ O(w), we build the structure on the binary representation of the text and and the construction algorithm terminates therefore in σ ′ ′ expected optimal O( n log φq (T [(j + e) · b, . . . , (j + e + l − 1) · b]) = w ) time (assuming that the input text is already packed) while taking only O(1) φ′q (T ′ [(j + e) · b, . . . , (j + e + l′ − 1) · b], z⌊log(l/2)⌋ ) words on top of the space of the text. As a final remark, note that the above process can If the two values differ, then we recurse on hi, j, e, e + l′ i. be easily reverted to restore the text. It is easy to see If the two values are equal, then we recurse on hi, j, e + that B[i] can be computed in constant time using P [i], l′ , ki. Note that we always compare (fingerprints of) P [i−1], and D[i] (recall that B[i] has been replaced with strings whose lengths are powers of two. This will be P [i] and D[i] during construction), so we can restore the crucial in the next section in order to efficiently de- text in O(n/w) time using O(1) words of working space. randomize our structure. Since l/4 < l′ ≤ l/2, this binary search procedure terminates in O(log n) steps, 4 Exact LCE queries each taking constant time. As done in the previous section, we can perform an exponential search before The aim of this section is to show how to make sure the binary search in order to reduce the size of the that our data structure always returns the correct binary search interval from O(n) to O(ℓ). Note that result. We achieve this by moving the randomization with our sampling zi it is straightforward to implement in the construction process. We start by proving three each exponential search step in constant time. Note lemmas solving with different space/time trade-offs the moreover that values zi need to be explicitly stored for problem of checking whether φq generates collisions over the binary search as this step might need access to a a specific subset of text substrings. The first lemma is zi with arbitrarily small i (and, while we can quickly due to Bille et al. [4]: compute zi from zi−1 , the opposite is not true).  Lemma 4.1. In O(n log n) expected time and O(n) Note that, in Theorem 3.2, we might as well allocate words of space we can check whether φq is collision-free at most O(log ℓ) words during query time on top of the over all pairs of substrings of T having the same length e n⌈log σ⌉ bits of the main structure. Note also that, k = 2 , for all 0 ≤ e ≤ log n. even if we assumed ⌈log σ⌉ ≤ w, it is easy to see that our results are valid also for the more general case Proof. The idea is to check the property on strings log σ ∈ O(w) by simulating a larger word. of length 2e by using the already-checked property on strings of length 2e−1 . First, we build a data 3.4 In-place construction algorithm In this sec- structure supporting the computation of φq (T [i, . . . , j]) tion we show that our data structure can be built in- in constant time. To this end, we can use the structure place, i.e. we can replace the text with the data struc- described Section 3.4, augmented with n words storing ture and use only O(1) memory words of extra space values 2⌈log n⌉·i mod q, i = 0, . . . , n − 1 (to guarantee during construction. constant-time retrieval of powers of 2 modulo q). We We first consider the binary case σ = 2. First, start with e = 0 and repeat log n + 1 times the following we pick τ , q, s̄ as described in the previous sections. procedure, each time incrementing e by one. We use a We consider the text as a sequence B[0, . . . , n/τ − 1] of hash table H of size O(n) with associated hash function integers in the range [0, 2τ − 1] (again, we assume for h : [0, q − 1] → [0, |H| − 1] mapping Karp-Rabin simplicity that τ divides n), and, for i = 1, . . . , n/τ − 1, fingerprints of length-2e text substrings to numbers in we compute P ′ [i] and discard P ′ [i − 1]. If the most [0, |H| − 1]. H can be implemented with linear probing significant bit of P ′ [i] is equal to 1 at any construction in order to guarantee expected constant-time operations step i, then we pick another random pair q, s̄ and repeat (see, e.g. [14]). Each entry of H is associated with a the process from the beginning. From Section 3.2, we list of integers. We scan T left-to-right and, for each need to pick at most O(1) pairs in the expected case 0 ≤ i ≤ n − 2e , append the value i at the end of before the most significant bits of all P ′ [i] are equal the list H[h(φq (T [i, . . . , i + 2e − 1]))]. Then, for each to 0 (and, in particular, P ′ = P ). At this point, we 0 ≤ t < |H|, we check that all i1 , i2 ∈ H[t] are such that Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited T [i1 , . . . , i1 + 2e − 1] = T [i2 , . . . , i2 + 2e − 1]. This task can be performed in O(|H[t]|) time as follows. Let H[t] = hi0 , . . . , id−1 i. We only need to perform d − 1 comparisons T [ij , . . . , ij + 2e − 1] = T [ij+1 , . . . , ij+1 + 2e − 1] for 0 ≤ j < d. If e = 0, then each comparison takes constant time and can be done by simply accessing the text. If e > 0, then T [ij , . . . , ij + 2e − 1] = T [ij+1 , . . . , ij+1 + 2e − 1] holds if and only if both φq (T [ij , . . . , ij + 2e−1 − 1]) = φq (T [ij+1 , . . . , ij+1 + 2e−1 − 1]) and φq (T [ij + 2e−1 , . . . , ij + 2e − 1]) = φq (T [ij+1 + 2e−1 , . . . , ij+1 + 2e − 1]) hold (constant time by using our structure to compute any φq (T [i′ , . . . , j ′ ])). Note that we already verified that φq is collision-free over T ’s substrings of length 2e−1 , so both checks never fail. All lists in H store overall n − 2e + 1 elements, therefore the procedure terminates in O(n) expected time. Since we have to repeat this for every integer 0 ≤ e ≤ log n, the overall expected time is O(n log n).  This bound can be improved by replacing hashing with in-place integer sorting: Lemma 4.2. In O(n log2 n) expected time and n words of space (on top of T ) we can check whether φq is collision-free over all pairs of substrings of T having the same length k = 2e , for all 0 ≤ e ≤ log n. Proof. First, we build in-place and O(n) time the inplace data structure supporting the computation of φq (T [i, . . . , j]) in O(log n) time described in Section 3.4. For e = 0, . . . , ⌊log n⌋ we repeat the following procedure. We initialize an array (text positions) A[0, . . . , n − 2e ] with A[i] = i. We use any O(n log n) inplace comparison-sorting algorithm to sort A according to length-2e fingerprints, i.e. using the ordering ≺ defined by A[i] ≺ A[j] iff φq (T [A[i], . . . , A[i] + 2e − 1]) < φq (T [A[j], . . . , A[j] + 2e − 1]). At this point, we scan A and, for every pair of adjacent A’s elements A[i], A[i+1], if φq (T [A[i], . . . , A[i]+2e −1]) = φq (T [A[i+ 1], . . . , A[i+1]+2e −1]), then we check deterministically that the two substrings T [A[i], . . . , A[i] + 2e − 1] and T [A[i + 1], . . . , A[i + 1] + 2e − 1] are indeed equal with the same strategy used in the proof of Theorem 4.1 (i.e. we compare the fingerprints of their two halves of length 2e−1 , or we just access the text if e = 0). Finally, we free the memory allocated for A. Analysis. For every e ≤ log n we sort A (O(n log n) comparisons). Note that fingerprints have all the same e length 2e , so we only need to pre-compute value 2b·2 mod q, with b = ⌈log σ⌉, in order to support fingerprint computation in constant time. Each comparison in the sorting algorithm requires the computation of two fingerprints and takes therefore constant time. We e−1 moreover need value 2b·2 mod q to perform the e deterministic collision checks. Since 2b·2 mod q can be b·2e−1 computed in constant time from 2 mod q, we need to reserve only two memory words for this sampling of powers of 2 modulo q (updating these two values every time e is incremented).  If we limit the word size to w ∈ Θ(log n), then we can use in-place radix sorting [10] to improve upon the above result: Lemma 4.3. If w ∈ Θ(log n), then in O(n log n) expected time and n words of space (on top of T ) we can check whether φq is collision-free over all pairs of substrings of T having the same length k = 2e , for all 0 ≤ e ≤ log n. Proof. We need to show that we can sort in-place (i.e. n log n bits of space) and O(n) time text positions i = 0, . . . , n − 2e using as comparison values φq (T [i, . . . , i + 2e − 1]). Then, we plug this sorting procedure in the proof of Theorem 4.2 to obtain the claimed bounds of the theorem. A Karp-Rabin fingerprint takes τ = O(w) = O(log n) bits of space. Let c′ be a constant such that τ ≤ c′ log n. Let xi = φq (T [i, . . . , i + 2e − 1])i be the concatenation of the fingerprint of T [i, . . . , i+2e −1] and of position i written in binary. xi takes (c′ + 1) log n bits of space (if less, left-pad with zeros). Note that Karp-Rabin Fingerprints can be computed in constant time using our Monte Carlo structure as the power 2e mod q is fixed. We store x0 , . . . xn/(c′ +1)−1 in an array A taking n log n bits of space. We sort x0 , . . . xn/(c′ +1)−1 in-place and O(n) time using in-place radix sort [10]. Then, we compact A by replacing each xi with the integer i. As a result, the first n/(c′ + 1) entries of A now contain text positions 0, . . . , n/(c′ + 1) − 1 sorted by their fingerprint. We apply recursively the above procedure to text positions n/(c′ + 1), . . . , n − 1 using the free space left in A (i.e. n log n − c′n+1 log n bits) to perform sorting. Note that, at each recursion step, the numbers we are sorting are always of fixed length ′ ((c′ + 1) log n bits). We recurse on n − c′n+1 = n c′c+1 ′ > 1. This gives us text positions. Let d = c c+1 ′ the recurrence T (n) = O(n) + T (n/d) for our overall procedure (with base case T (1) = O(1)), which results in overall T (n) = O(n) time (since d > 1). After terminating the above procedure, A contains O(log n) sub-arrays of text positions sorted by their fingerprints. Starting from the two rightmost such subarrays, we repeatedly apply in-place merge sort [31] until the whole A is sorted. Note that a single comparison of two text positions i and j requires computing φq (T [i, . . . , i + 2e − 1]) and φq (T [j, . . . , j + 2e − 1]) Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited 3.2—P(|S| > 0) = 1 − P(|S| = 0) ≤ 1 − 0.5 = 0.5. It follows that quantity in Equation 4.12 is greater than or equal to 0.5 − P(C > 0). Finally—see proof of Lemma 3.2—the choice τ = 10w implies P(C > 0) ≤ n−1 . This, plugged into the above inequalities, gives us P(C = 0 ∧ |S| = 0) ≥ 0.5 − n−1 . Note that n−1 ≤ 0.25 holds for n ≥ 4, which is true by our assumption n ∈ ω(1). We obtain: P(C = 0 ∧ |S| = 0) ≥ 0.25. Note that we can always reduce the word size The number R of rounds of our construction algorithm to w ∈ Θ(log n). This, however, comes at the cost is a geometric random variable with success probability of limiting the alphabet size to σ ≤ nO(1) (as we p = P(C = 0 ∧ |S| = 0) ≥ 0.25, and has therefore assume alphabet characters fit in a constant number of expected value 1/p ≤ 4.  memory words). We can now use these results to build with a randomized algorithm a deterministic LCE data We use the technique exploited in Theorem 3.2— structure (i.e. that always returns the correct results). i.e. we only compare substrings whose length is a We randomly pick pairs q, s̄ and keep re-building our power of 2 during exponential and binary search—in LCE structure until: (1) its total space usage is of order to compute LCE queries with our structure, so n⌈log σ⌉ + O(w) bits, and (2) φq is collision-free over all that we only need φq to be collision-free between text pairs of substrings of T having the same length k = 2e , substrings whose lengths are powers of two. If we i for all 1 ≤ e ≤ log n. Checking property (1) can be do not pre-compute values 2⌈log σ⌉·2 mod q, 0 ≤ i < done during construction. As described in Section 3.4, log n, at each binary/exponential search step we have by reversing the construction whenever S becomes non- to compute one of them in O(log ℓ) time using the fast empty, the working space never exceeds n⌈log σ⌉+O(w) exponentiation algorithm. Using the collision-checking bits. After successful construction, property (2) can be procedures described in Lemmas 4.1-4.3 we obtain: checked with the space/time tradeoffs of Lemmas 4.14.3. We are left to show what is the expected number R Theorem 4.1. Within the following time-space bounds of pairs q, s̄ we have to pick before both properties are (space is on top of T ): satisfied. Using the results stated in Lemmas 3.1 and • O(n log n) expected time and O(n) words of space, 3.2, we prove the following: or Lemma 4.4. If we choose τ = 10w, then we need to repeat the construction of our LCE structure O(1) • O(n log2 n) expected time and n words of space, or expected times until (1) its total space usage is of n⌈log σ⌉+O(w) bits, and (2) φq is collision-free over all • O(n log n) expected time and n words of space — pairs of substrings of T having the same length k = 2e , provided that w ∈ Θ(log n) for all 1 ≤ e ≤ log n. we can replace the text with a deterministic data Proof. Recall (proof of Lemma 3.2) that C is the structure of n⌈log σ⌉ + O(w) bits supporting extracrandom variable denoting the number of pairs hX, Y i tion of any length-m text substring and LCE queries of T substrings with |X| = |Y | that generate a collision, in O (m log σ/w) and O(log2 ℓ) worst-case time, respeci.e. X 6= Y and φq (X) = φq (Y ), and that S is the set tively. LCE queries are supported in O(log ℓ) time using containing all positions i such that the most significant O(log n) additional words of space. bit of P ′ [i] is equal to 1. We are interested in computing a lower bound for the success probability Note that our data structure replaces the text and uses s(n) = Θ(log n) or s(n) = Θ(log2 n) bits of space (4.11) P(C = 0 ∧ |S| = 0) = 1 − P(C > 0 ∨ |S| > 0) on top of the text (taking w to be log n) to support LCE queries in time t(n) = O(log2 n) and t(n) = O(log n), From the inequality P (C > 0 ∨ |S| > 0) ≤ P(C > respectively. Very recently, Kosolobov showed [23] that 0)+P(|S| > 0), we obtain that the quantity in Equation the relation s(n)t(n) ∈ Ω(n log n) must hold when the 4.11 is greater than or equal to text is read-only and s(n) ∈ Ω(n). Our results satisfy s(n)t(n) ∈ O(log3 n), but do not break the above lower (4.12) 1 − P(C > 0) − P(|S| > 0) bound in that (i) our space violates the requirement We choose τ = 10w. This satisfies Constraints s(n) ∈ Ω(n), and (ii) our model allows the text to be (3.7), (3.8), and (3.9) and implies that—see Section overwritten. (constant time with our structure and using the precomputed value 2e mod q). Boundaries of the subarrays can be computed on-the-fly (i.e. 0, n − n/d, n − n/d2 , ...). Analogously to the above analysis, at the jth step, j ≥ 0, we merge in linear time two sub-arrays of total size O(dj ). The overall time spent inside this Plog n procedure is therefore O( i=1d dj ) = O(n).  Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited Proof. To get bound (1), we build and de-randomize our LCE structure using Lemma 4.2. We store in O(1) In this section we attack the problems of computing words the modulo q and the seed s̄ computed during in-place the LCP, the SSA, and the SLCP arrays. We construction and restore the text. We build the suffix assume that each entry of these arrays is stored using array SA in-place and O(n log n) time using [8]. We relog n bits. We moreover describe the first in-place build our deterministic LCE structure using the values solution for the suffix selection problem: to return the q and s̄ computed above (in-place and O(n) time). We convert SA to LCP using slow LCE queries to compute i-th lexicographically smallest text suffix. 2 With slow LCE queries on our LCE data structure LCE’s of adjacent suffixes (in-place and O(n log n) we denote queries running in O(log2 n) time and O(w) time). To conclude, we restore the text inverting the bits of space on top of the text’s space. With fast LCE construction of our structure. To get bound (2), we queries we denote those running in O(log n) time and must be more careful. First of all, we limit the word requiring τ · log n = 10w log n bits of space on top of size to w = log n. Then: the text’s space (this space is needed to store values • We build and de-randomize our LCE structure usi 2⌈log σ⌉·2 mod q, see Theorem 3.2). Note that the ing Lemma 4.3. We store in O(1) words the modulo lexicographic order of any two text suffixes can be easily q and the seed s̄ computed during construction and computed by comparing the two characters following restore the text (needed for the next step). their longest common prefix (i.e. one LCE query and one text access). • We build the suffix array SA in-place and In some of our results below, we obtain the space O(n log n) time using [8]. Note that we cannot perto support fast LCE queries by compressing integer form this step before computing q and s̄, as the desequences as done in [8,10]: given a sequence S[1, . . . , k] randomization procedures needs n words of space. of log n-bits integers, with k ≥ 10w log n, we first sort • We re-build our deterministic LCE structure using it in-place and in O(k log k) time using any in-place the values q and s̄ computed in the first step. This comparison-sort algorithm. Then, we store in one word step runs in-place and O(n) time. the index of the first integer in the sorted sequence starting with bit ‘1’ and compact S in k log n − k • We compress the integers in SA′ = adjacent bits by removing the most significant bit from SA[1, . . . , n/ log2 n] with the procedure described each integer. This saves k ≥ 10w log n bits of space. We i at the beginning of this section (in-place and store values 2⌈log σ⌉·2 mod q in this space, so that our O(n/ log n) time). This saves n/ log2 n > 10 log2 n structure supports fast LCE queries. When fast LCE bits of space (this inequality holds for n larger queries are no more needed, S can be decompressed i than some constant). We store values 2⌈log σ⌉·2 (i.e. pre-pending again the most significant bit to each mod q in this space, so that our structure now integer). supports fast LCE queries. Note that SA′ is no more suffix-sorted. 5.1 In-place LCP array In this paragraph we de5 In-place LCP array, sparse suffix sorting, and suffix selection scribe a sub-quadratic in-place LCP construction algorithm. The result, stated in the following theorem, follows from a careful combination of our deterministic LCE data structure, in-place suffix sorting [8], in-place radix sorting [10], and compression of integer sequences: Theorem 5.1. The Longest Common Prefix array (LCP ) of a text T ∈ Σn stored in n⌈log σ⌉ bits can be computed within the following bounds: 1. O(n log2 n) expected time and O(1) words of space on top of the text and the LCP , provided that |Σ| ≤ 2O(w), or 2. O(n log n) expected time and O(1) words of space on top of the text and the LCP , provided that |Σ| ≤ nO(1) . • We convert SA′′ = SA[n/ log2 n + 1, . . . , n] to LCP [n/ log2 n+1, . . . , n] by computing LCE values of adjacent suffixes using fast LCE queries. This step runs in-place and O(n log n) time. • We decompress SA′ . Now our LCE structure supports only slow LCE queries. • We suffix-sort in-place (comparison-based sorting) SA′ using slow LCE queries. This step takes O((n/ log2 n) log(n/ log2 n) log2 n) = O(n log n) time. • We convert SA′ to LCP [1, . . . , n/ log2 n] by computing LCE values of adjacent suffixes using slow   LCE queries. This step runs in O logn2 n · log2 n = O(n) time and in-place. Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited 5.2 In-place SSA and SLCP arrays By combining our Monte Carlo data structure with in-place comparison sorting, in-place comparison-based merging [31], and compression of integer sequences we obtain: Theorem 5.2. Any set S = {i1 , . . . , ib } of b suffixes of a text T ∈ Σn stored in n⌈log σ⌉ bits, with |Σ| ≤ nO(1) , can be sorted correctly with high probability in O(n + b log2 n) expected time using O(1) words of space on top of T and S. Proof. We limit the word size to w = log n, with the resulting requirement |Σ| ≤ nO(1) . We first build our Monte Carlo structure using the in-place construction algorithm of Section 3.4 (O(n) expected time). If b < n/ log3 n, then we suffix-sort the b text positions plugging slow LCE queries in any in-place comparison sorting algorithm terminating within O(b log b) comparisons. This requires O(b log b log2 n) ∈ O(n) time. If b ≥ n/ log3 n, then we divide S in two sub-arrays S ′ = S[1, . . . , n/ log3 n] and S ′′ = S[n/ log3 n + 1, . . . , b] and: 5.3 In-place suffix selection In this paragraph we provide the first optimal-space sub-quadratic algorithm solving the suffix selection problem: given a text T and an index 0 ≤ i < n, output the text position corresponding to the i-th lexicographically smallest text suffix. Our idea is to use a variant of the quickselect algorithm (i.e. solving the selection problem on integers) operating with the lexicographical ordering of text suffixes. Theorem 5.4. Given a text T ∈ Σn stored in n⌈log σ⌉ bits, with |Σ| ≤ 2O(w) , and an index 0 ≤ i < n, we can—with high probability of success—find the ith lexicographically smallest text suffix in O(n log3 n) expected time using O(1) words of working space on top of T . Proof. We build our Monte Carlo structure using the in-place construction algorithm of Section 3.4 (O(n) expected time). In our procedure below, we use slow LCE queries to lexicographically compare pairs of suffixes. We scan T and find the lexicographically smallest • We compress S ′ in-place and O(n/ log2 n) time as and largest text suffixes imin , imax in O(n log2 n) time3 . described at the beginning of this section. This Then, we scan again T and count the number m of sufsaves n/ log3 n > 10 log2 n bits of space (note fixes inside the lexicographic range [imin , imax ] (at the that this inequality holds for n larger than some beginning, m = n). We pick a uniform random number i constant). We store values 2⌈log σ⌉·2 mod q in this r in [1, m], scan again the text, and select the r-th sufspace, so that our structure now supports fast LCE fix ir falling inside lexicographic range [imin , imax ] that queries. we see during the scan. Finally, we recurse on [imin , ir ] or [ir , imax ] depending on where the i-th smallest suffix • We suffix-sort in-place (comparison-based sorting) ′′ falls (as in quick select, we repeat the process of choosing S using fast LCE queries. This step terminates in 2 r until we recurse on a set with at most 3m/4 elements. O(b log b log n) ⊆ O(b log n) time. Since ir is uniform inside range [imin , imax ], we need to • We decompress S ′ . Now our structure supports pick at most O(1) values of r until this condition is satonly slow LCE queries. isfied). We perform at most O(log n) recursive steps, the expected running time of our algorithm is • We suffix sort in-place (comparison-based sorting) therefore 3 ′ O(n log n). S using slow LCE queries. This step terminates in O((n/ log3 n) · log(n/ log3 n) · log2 n) ∈ O(n) time 6 Conclusions and open problems • We merge S ′ and S ′′ using slow LCE queries and In this paper we have described the first in-place soluin-place comparison-based merging [31]. This step tions to the following problems: (i) sparse suffix-sorting, 2 terminates in O(b log n) time. (ii) sparse LCP array construction, and (iii) suffix selecNote that we can add a further step to the above- tion. To achieve our results, we have introduced a novel described procedure: after obtaining the SSA, we can implicit LCE data structure whose space is only a conoverwrite it with the SLCP by replacing adjacent SSA stant number of memory words higher than that of the entries with their LCE. This step runs in-place and text. The text can be replaced in-place and linear time with our data structure; this transformation is a general O(b log2 n) time using slow LCE queries. We obtain: and powerful tool that — in particular — can be used n Theorem 5.3. Given a text T ∈ Σ stored in n⌈log σ⌉ to solve in-place problems (i-iii). O(1) bits, with |Σ| ≤ n , and a subset S = {i1 , . . . , ib } of b suffixes of T , we can—with high probability of success— 3 i.e. for every 0 ≤ j < n we compare the j-th suffix with replace S with the sparse LCP array relative to S in the i -th and imax -th suffixes and determine whether j is min O(n + b log2 n) expected time using O(1) words of space the new imin or imax . At the beginning, we can start with imin = minlex (0, 1) and imax = maxlex (0, 1). on top of T and S. Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited Interestingly, previous strategies solving in-place the suffix sorting problem [8, 15, 24] re-use only the space of the suffix array (through integer compression) to achieve constant working space. In this work, we re-use both the space of the text (replacing it with a more powerful representation) and of the sparse suffix array (through integer compression) to achieve the more ambitious goal of sorting in-place any subset of text positions. It is therefore natural to ask whether or not it is possible to achieve the same goal without overwriting the text. Note that only our algorithms for computing inplace the full LCP and suffix arrays return always the correct result. Our other solutions return the correct answer with high probability only. One important improvement over our work could therefore be that of obtaining Las Vegas versions of our algorithms. Crucially, this should be achieved without increasing working space (since asymptotically optimal solutions are already known). One possible line of attack could be to devise an in-place procedure for checking the correctness of a sparse suffix array. Alternatively, one could try to verify that the Karp-Rabin hash function used in our LCE data structure is collision-free on text substrings relevant to the suffix-sorting procedure. To this extent, we note that the b input text positions could be used to encode extra information needed in the derandomization process; we already showed that this is possible if b = n. The case n − b = ω(1) remains an intriguing open problem. [6] [7] [8] [9] [10] [11] [12] [13] 6.1 Acknowledgments I wish to thank Tomasz Kociumaka and anonymous reviewers for useful comments on a preliminary version of the paper. [14] References [15] [1] Ricardo Baeza-Yates and Gaston H Gonnet. A new approach to text searching. Communications of the ACM, 35(10):74–82, 1992. [2] Philip Bille, Johannes Fischer, Inge Li Gørtz, Tsvi Kopelowitz, Benjamin Sach, and Hjalte Wedel Vildhøj. Sparse text indexing in small space. ACM Transactions on Algorithms (TALG), 12(3):39, 2016. [3] Philip Bille, Inge Li Gørtz, Mathias Bæk Tejs Knudsen, Moshe Lewenstein, and Hjalte Wedel Vildhøj. Longest common extensions in sublinear space. In Annual Symposium on Combinatorial Pattern Matching, pages 65–76. Springer, 2015. [4] Philip Bille, Inge Li Gørtz, Benjamin Sach, and Hjalte Wedel Vildhøj. Time–space trade-offs for longest common extensions. Journal of Discrete Algorithms, 25:42–50, 2014. [5] Yevgeniy Dodis, Mihai Patrascu, and Mikkel Thorup. Changing base without losing space. In Proceedings [16] [17] [18] [19] [20] of the forty-second ACM symposium on Theory of computing, pages 593–602. ACM, 2010. Johannes Fischer, I Tomohiro, and Dominik Köppl. Deterministic sparse suffix sorting on rewritable texts. In Latin American Symposium on Theoretical Informatics, pages 483–496. Springer, 2016. Pierre-Alain Fouque and Mehdi Tibouchi. Close to uniform prime number generation with fewer random bits. In International Colloquium on Automata, Languages, and Programming, pages 991–1002. Springer, 2014. Gianni Franceschini and S Muthukrishnan. In-place suffix sorting. In International Colloquium on Automata, Languages, and Programming, pages 533–545. Springer, 2007. Gianni Franceschini and S Muthukrishnan. Optimal suffix selection. In Proceedings of the thirty-ninth annual ACM symposium on Theory of computing, pages 328–337. ACM, 2007. Gianni Franceschini, S. Muthukrishnan, and Mihai Patrascu. Radix sorting with no extra space. In Proc. 15th ESA, pages 194–205, 2007. Pawel Gawrychowski and Tomasz Kociumaka. Sparse suffix tree construction in optimal time and space. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 425–439. SIAM, 2017. Simon Gog and Enno Ohlebusch. Fast and lightweight LCP-array construction algorithms. In Proceedings of the Meeting on Algorithm Engineering & Expermiments, pages 25–34. Society for Industrial and Applied Mathematics, 2011. Gaston H Gonnet, Ricardo A Baeza-Yates, and Tim Snider. New indices for text: Pat trees and pat arrays. Information Retrieval: Data Structures & Algorithms, 66:82, 1992. Michael T Goodrich and Roberto Tamassia. Algorithm design and applications, Section 6.3.3: Linear Probing. Wiley Publishing, 2014. Keisuke Goto. Optimal time and space construction of suffix arrays and lcp arrays for integer alphabets. arXiv preprint arXiv:1703.01009, 2017. DR Heath-Brown. The differences between consecutive primes. Journal of the London Mathematical Society, 2(1):7–13, 1978. Tomohiro I, Juha Kärkkäinen, and Dominik Kempa. Faster Sparse Suffix Sorting. In 31st International Symposium on Theoretical Aspects of Computer Science, pages 386–396. Schloss Dagstuhl-LeibnizZentrum fuer Informatik, 2014. Shunsuke Inenaga. A faster longest common extension algorithm on compressed strings and its applications. In Prague Stringology Conference, pages 1–4, 2015. Juha Kärkkäinen, Peter Sanders, and Stefan Burkhardt. Linear work suffix array construction. Journal of the ACM (JACM), 53(6):918–936, 2006. Juha Kärkkäinen and Esko Ukkonen. Sparse suffix trees. Computing and Combinatorics, pages 219–230, Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited 1996. [21] Richard M Karp and Michael O Rabin. Efficient randomized pattern-matching algorithms. IBM Journal of Research and Development, 31(2):249–260, 1987. [22] Donald Knuth. The Art of Computer Programming, Seminumerical Algorithms, volume 2. Addison-Wesley, 1981. [23] Dmitry Kosolobov. Tight lower bounds for the longest common extension problem. Information Processing Letters, 125:26–29, 2017. [24] Zhize Li, Jian Li, and Hongwei Huo. Optimal in-place suffix sorting. arXiv preprint arXiv:1610.08305, 2016. [25] Felipe A. Louza, Travis Gagie, and Guilherme P. Telles. Burrows-Wheeler transform and LCP array construction in constant space. Journal of Discrete Algorithms, 42(Supplement C):14 – 22, 2017. [26] Helmut Maier et al. Primes in short intervals. The Michigan Mathematical Journal, 32(2):221–225, 1985. [27] Udi Manber and Gene Myers. Suffix arrays: a new method for on-line string searches. siam Journal on Computing, 22(5):935–948, 1993. [28] Takaaki Nishimoto, I Tomohiro, Shunsuke Inenaga, Hideo Bannai, and Masayuki Takeda. Fully Dynamic Data Structure for LCE Queries in Compressed Space. In 41st International Symposium on Mathematical Foundations of Computer Science, pages 72:1– 72:15, 2015. [29] Simon J Puglisi, William F Smyth, and Andrew H Turpin. A taxonomy of suffix array construction algorithms. acm Computing Surveys (CSUR), 39(2):4, 2007. [30] Simon J Puglisi and Andrew Turpin. Space-time tradeoffs for longest-common-prefix array computation. In International Symposium on Algorithms and Computation, pages 124–135. Springer, 2008. [31] Jeffrey S. Salowe and William L. Steiger. Simplified stable merging tasks. J. Algorithms, 8(4):557–571, 1987. [32] Yuka Tanimura, Tomohiro I, Hideo Bannai, Shunsuke Inenaga, Simon J. Puglisi, and Masayuki Takeda. Deterministic sub-linear space LCE data structures with efficient construction. In Annual Symposium on Combinatorial Pattern Matching. Springer, 2016. [33] Yuka Tanimura, Takaaki Nishimoto, Hideo Bannai, Shunsuke Inenaga, and Masayuki Takeda. Small-space encoding lce data structure with constant-time queries. arXiv preprint arXiv:1702.07458, 2017. [34] Esko Ukkonen. On-line construction of suffix trees. Algorithmica, 14(3):249–260, 1995. Copyright c 2018 by SIAM Unauthorized reproduction of this article is prohibited
8cs.DS
Irredundant generating sets and dimension-like arXiv:1712.03923v2 [math.GR] 13 Dec 2017 invariants of the finite group Minh Nguyen April 9, 2018 Abstract Whiston proved that the maximum size of an irredundant generating set in the symmetric group Sn is n − 1, and Cameron and Cara characterized all irredundant generating sets of Sn that achieve this size. Our goal is to extend their results. Using properties of transitive subgroups of the symmetric group, we are able to classify all irredundant generating sets with sizes n − 2 in both An and Sn . Next, based on this classification, we derive other interesting properties for the alternating group An . Finally, using Whiston’s lemma, we will derive the formulas for calculating dimension-like invariants of some specific types of wreath products. 1 Contents 1 Introduction 3 2 Properties of irredundant generating sets in the alternating group 4 3 Properties of irredundant generating set of arbitrary length in the symmetric group 3.1 23 Classification of irredundant generating sets of length n − 2 of symmetric group . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.2 Elements in an irredundant generating set of arbitrary length in the symmetric group . . . . . . . . . . . . . . . . . . . . . . 30 4 Dimension-like invariants of wreath product 4.1 47 Computing m of wreath product of simple group and 2-transitive permutation group . . . . . . . . . . . . . . . . . . . . . . . . 47 4.2 Computing i of wreath product of strongly flat simple group and permutation group . . . . . . . . . . . . . . . . . . . . . . 53 5 Acknowledgment 57 2 1. Introduction This paper is the report for summer undergraduate research program at Cornell University. The paper mainly deals with an irredundant generating set and dimension-like invariants of a finite group. The paper consists of three main parts. In the first part, we will classify all irredundant generating sets of length n − 2 in An . Then, from this classification, we will prove many other properties of the alternating group An Cameron and Cara, in their paper, classify all irredundant generating sets of length n − 1 in Sn . In the second part of this paper, we will try to study a more general problem, which is the classification of all irredundant generating sets of arbitrary length in Sn . In the final part, we will derive the formulas for calculating dimension-like invariants of some specific types of wreath products. We start with definitions of dimension-like invariants for a finite group. Definition 1. For a finite group G, and a set H ⊂ G, let hHi denote the subgroup of G generated by H. For a finite group G, the set s = (g1 , ..., gn ) of elements of G is called irredundant if h{gi }i6=j i = 6 h{gi }i ∀j ∈ 1, n Let i(G) be the maximal size of an irredundant set in G, and m(G) be the maximal size of an irredundant generating set in G. Then, clearly, m(G) ≤ i(G). For |G| = k Q pαi i , let λ(G) denote the sum i=1 k P αi . Then it is easy to see i=1 that i(G) ≤ λ(G). A finite group G is flat if m(H) ≤ m(G) for all subgroup H of G, and is strongly flat if m(H) < m(G) for all proper subgroup H of G. In both cases, i(G) = m(G). 3 Notation 1. We denote the cycle in the symmetric group Sn that maps xi to xi+1 for i ∈ 1, k, with xk+1 = x1 , by (x1 , x2 , . . . , xk ). 2. Properties of irredundant generating sets in the alternating group Lemma 1. (Whiston) Suppose (g1 , . . . , gm ) is an irredundant generating set of some group G, and N E G is a normal subgroup of G. Then, possibly after reordering the gi , there exists some k ≤ m and some elements hk+1 , . . . , hm ∈ N such that the projections g1 , . . . , gk form an irredundant generating set of G/N and g1 , . . . , gk , hk+1 , . . . , hm form a new irredundant generating set for G. Definition 2. Assume that H is an imprimitive subgroup of Sn or H ≤ SΓ o S∆ ≤ Sn with n = |Γ||∆|. Suppose also that Γ1 , . . . , Γ|∆| are copies of |Γ| or blocks such that we can consider H as a group that acts on n points of Γ1 ∪ . . . ∪ Γ|∆| by permuting points of each individual block Γi , and by permuting blocks Γi themselves. Let {g1 , g2 , . . . , gl } be an irredundant generating set for H. By lemma 1 |∆| Q |∆| for G = SΓ o S∆ , and its normal subgroup SΓ = SΓi , we can assume that i=1 for some k, g1 , . . . , gk generates block action for H, and gk+1 , . . . , gl fix the blocks. Lemma 2. (Whiston) Suppose H is the subgroup of Sn that is defined as in definition 2. If the subgroup generated by {gk+1 , . . . , gl } acts as SΓ1 or AΓ1 on Γ1 , then m(H) = l ≤ |Γ| + 2|∆| − 3. Note that the lemma is true if Γ1 is replaced by any Γi . Theorem 1. (O’Nan-Scott’s theorem. See references) If H is any proper primitive subgroup of Sn other than An , then H is a subgroup of one of the following subgroups: 4 1. A primitive wreath product, Sk o Sm , where n = k m ; 2. An affine group AGLs (p), where n = ps 3. A group of shape T k · (Out(T ) × Sk ), where T is a non-abelian simple group, acting on the cosets of ’diagonal’ subgroup of Aut(T )×Sk , where n = |T |k−1 4. H ≤ Aut(T ) with some simple group T ≤ Sn Lemma 3. H 6= An is a primitve subgroup of Sn , n ≥ 13. Then m(H) ≤ n − 4. More generally, there exists n0 ∈ Z such that for any n ≥ n0 , and any primitive subgroup H of Sn , we have m(H) ≤ n2 . Proof. We will follow Whiston’s proof to prove for m(H) ≤ n − 4. To prove the more general inequality, we just need to follow exactly every case Whiston considered in his proof. Based on O’Nan-Scott’s theorem and the classification of finite simple groups, we will primitive subgroup of Sn other than An cases by cases to prove that m(H) ≤ n − 4: Case 1: H is a subgroup of the affine group AGLs (p). Then |H| ≤ |AGLs (p)| ≤ ps 2 +s , so m(H) ≤ λ(H) ≤ log2 |H| ≤ (s2 + s) log2 (p), while n = ps . For s ≥ 3 and p ≥ 5, we have s − 1 ≤ log2 (s + 1). Hence, (s − 1) log2 (p) + log2 ( 23 ) ≥ 2 log2 ( 45 ) + log2 ( 23 ) + (s − 1).2 ≥ 0 + 2. log2 (s + 1) > log2 (s2 + s). As a result, (s2 + s) log2 p ≤ (s2 + s)p ≤ 32 ps ≤ ps − 4. For s ≥ 3 and p = 3, n = 3s ≥ (s2 + s) log2 3 + 4 ≥ m(H) + 4 For s ≥ 6 and p = 2, n = 2s ≥ s2 + s + 4 ≥ m(H) + 4 For s = 2 and p ≥ 5, p2 ≥ 6 log2 p + 4 ≥ m(H) + 4. For p = 3, s = 2, m(H) ≤ 9 ≤ n − 4. For p = 2, s = 3, |AGL3 (2)| = 26 .3.7 so m(H) ≤ 8 < n − 4. 5 For p = 2, s = 5, |AGL5 (2)| = 21 5.32 .5.7.31, so m(H) ≤ 20 < 25 − 4 = n − 4. For p = 2, s = 4, AGL4 (2) ∼ = C24 .A8 , and by Whiston’s lemma and the second isomorphism theorem for normal subgroup N = C24 of AGL4 (2), m(H) ≤ i(H∩N )+m(H/H∩N ) ≤ i(N )+m(HN/N ) ≤ i(N )+i(AGL4 (2)/N ) = i(N ) + i(A8 ) = 1 + 6 = 7 < n − 4 Case 2: H ≤ T k ·(Out(T )×Sk ) with n = |T |k−1 . T is non-abelian simple group so |T | ≥ 60. Because |T k · (Out(T ) × Sk )| ≤ |T |k · |Sk ||Out(T )| ≤ |T |k · k k |T |log2 |T | , m(H) ≤ λ(H) ≤ k log2 |T | + k log2 k + (log2 |T |)2 . For k ≤ 3, we have: |T |k−1 = |T |k−2 |T | ≥ k · 4 log2 |T |, |T |k−1 ≥ 4k 2 ≥ 4k log2 k, and |T |k−1 ≥ |T |2 ≥ (2 log2 |T |)2 Hence n − 4 = |T |k−1 − 4 ≥ 43 |T |k−1 ≥ k log2 |T | + k log2 k + (log2 |T |)2 ≥ m(H). Let d(G) be the minimal degree of a permutation representation of G. Now we need to handle the case where H ≤ Aut(T ) where T is simple and d(T ) ≤ n. By the classification of finite simple groups we have the following cases: Case 3: H ≤ Aut(T ), with T = P SL(m, q). We have n ≥ d(T ) = qm − 1 , and m(H) ≤ λ(H) ≤ λ(Aut(T )) ≤ m2 log2 (q) + 1. q−1 Case 3a: For m ≥ 4, d(T ) − 4 ≥ q m−1 + 1. We have (m − 2) log2 q ≤ 2 log2 m except for (m, q) = (7, 2), (6, 2), (5, 2), (4, 3), (4, 2), and therefore, (m − 1) log2 q ≥ 2 log2 m + log2 q, and so q m−1 ≥ m2 q ≥ m2 log2 (q). As a result, n − 4 ≥ d(T ) − 4 ≥ q m−1 + 1 ≥ m2 log2 (q) + 1 ≥ m(H). qm − 1 For (m, q) = (7, 2), (6, 2), (5, 2), n − 4 = − 4 ≥ m2 log2 q + 1 ≥ q−1 m(H). For (m, q) = (4, 2), |Aut(P SL(4, 2))| = 27 .32 .5.7 so m(H) ≤ 11 = 6 24 − 1 − 4 ≤ n − 4. 2−1 For (m, q) = (4, 3), |Aut(P SL(4, 3))| = 29 .36 .5.13 so m(H) ≤ 17 < 4 3 −1 − 4 ≤ n − 4. 3−1 q3 − 1 Case 3b: m = 3. We have ≥ 9 log2 q + 5 ∀q ≥ 5, and so m(H) ≤ q−1 n − 4. For q = 2, |Aut(P SL(3, 2))| = 24 .3.7, so m(H) ≤ 6 < n − 4. For q = 3, |Aut(P SL(3, 3))| = 25 .33 .13, so m(H) ≤ 9 ≤ n − 4. Case 3c: m = 2. We have q ≥ 4 log2 q +4 ∀q ≥ 22, and so m(H) ≤ n−4. For q ≤ 5, m(H) ≤ b4 log2 5c = 9 ≤ n − 4. Now for other q, we show that m(H) ≤ 9 ≤ n − 4 by considering the following tables: q 7 |Aut(P SL(2, q))| 24 .3.7 m(H) ≤ λ(H) ≤ q 8 9 11 23 .33 .7 25 .32 .5 23 .3.5.11 6 7 13 8 16 6 17 19 |Aut(P SL(2, q))| 23 .3.7.13 26 .3.5.17 25 .32 .17 24 .34 .5 m(H) ≤ λ(H) ≤ 5 9 8 9 Case 4: H ≤ Aut(T ), with T = P Sp(2m, q), m ≥ 2. n ≤ d(T ) = q −1 , and m(H) ≤ λ(H) ≤ λ(Aut(T )) ≤ (2m2 + m + 1) log2 (q). q−1 q 2m − 1 We have > q 2m−1 + 4. Now for (m, q) 6= (3, 2), (2, 2), (2, 3), q−1 (2m − 1) log2 (q) ≥ log2 (2m2 + m + 1), and so (2m − 1) log2 (q) ≥ log2 (2m2 + 2m m + 1) + log2 (log2 (q)). Therefore, q 2m−1 ≥ (2m2 + m + 1) log2 (q), and so n − 4 ≥ m(H). For (m, q) = (3, 2), (2, 2) or (2, 3), we have the following table: 7 T P sP (4, 2) P sP (4, 3) P sP (6, 2) |Aut(T )| 25 .32 .5 27 .34 .5 29 .34 .5.7 m(H) ≤ λ(H) ≤ 8 < 24 −1 2−1 −4 12 < 34 −1 3−1 − 4 15 < 26 −1 2−1 −4 Case 5: Now we consider the case when T = P Ω(n, q). Case 5a: H ≤ Aut(T ), with T = P Ω(2l + 1, q), l ≥ 3, q odd. q 2l − 1 For q ≥ 5, n ≥ d(T ) = , and m(H) ≤ λ(H) ≤ λ(Aut(T )) ≤ q−1 (2l2 + l) log2 (q). Therefore, d(T ) > q 2l−1 + 4. q 2l−2 ≥ 52l−2 ≥ 2l2 + 2, and so n ≥ d(T ) ≥ m(H) − 4. For q = 3, n ≥ d(T ) = 12 3l (3l − 1) ≥ 2(l2 + l) log2 3 + 4 ≥ m(H) − 4. Case 5b : H ≤ Aut(T ), with T = P Ω+ (2l, q), l ≥ 4 (q l − 1)(q l−1 + 1) For q 6= 2, n ≥ d(T ) = , and m(H) ≤ λ(H) ≤ q−1 λ(Aut(T )) ≤ (2l2 + 1) log2 (q) + log2 6. We have d(T ) ≥ (q l−1 + q 2 + q + 1)(q l−1 + 1) ≥ (q l−1 + 8)(q l−1 + 1) > q 2l−2 + 8. Also note that q ≥ log2 q and q 2l−3 ≥ 32l−3 ≥ 2l2 + 1. Therefore n ≥ d(T ) ≥ q 2l−2 + 8 ≥ (2l2 + 1) log2 q + 8 > m(H) + 4. For q = 2, n ≥ d(T ) = 2l−1 (2l − 1) ≥ 2l2 + 7 > m(H) + 4 Case 5c: H ≤ Aut(T ), with T = P Ω− (2l, q) with l ≥ 4, q ≥ 3 or l ≥ 5, q = 2. We have n ≥ d(T ) ≥ q 2l−3 , and m(H) ≤ λ(H) ≤ λ(Aut(T )) ≤ (2l2 + 2) log2 (q) + 1. Note that for q ≥ 3, l ≥ 4, q 2l−4 ≥ 32l−4 ≥ 2l2 + 4, log2 (q) ≤ q, and 5 ≤ 2q. Therefore, m(H) + 4 ≤ (2l2 + 2)q + 2q ≤ q 2l−3 ≤ n. For q = 2, l ≥ 4, n ≥ 22l−3 ≥ 2l2 + 7 ≥ m(H) + 4. Case 6: H ≤ Aut(T ), with T = U (n, q), and m(H) ≤ λ(H) ≤ λ(Aut(T )) ≤ n2 log2 (q + 1) + 1. 8 Case 6a: n ≥ 5 and (n, q) is neither (6m, 2) or (6m, 3). We have n ≥ (q n − 1)(q n−1 − 1) d(T ) ≥ , and so d(T ) ≥ q 2n−3 − q n−2 − q n−3 + 1 ≥ (q − q2 1)q 2n−4 + 4 + 1. For q ≥ 3, log2 (q + 1) ≤ q − 1, and q 2n−4 ≥ 32n−4 ≥ n2 for n ≥ 5. Hence, n ≥ d(T ) ≥ n2 (q) + 5 ≥ n2 log2 (q + 1) + 5 ≥ m(H) + 4. For q = 2, 22n−4 ≥ n2 log2 3 ∀n ≥ 5, so again we get n ≥ m(H) + 4. Case 6b: T = U (6m, 3). Then d(T ) ≥ 41 (3n − 1)3n−1 ≥ 2n2 + 5 with n ≥ 6, so n ≥ m(H) + 4. Case 6c: T = U (6m, 2). Then d(T ) ≥ 13 2n−1 (2n − 1) ≥ n2 log2 3 + 5 with n ≥ 6, so n ≥ m(H) + 4. Case 6d: T = U (4, q). Then d(T ) ≥ (q + 1)(q 3 + 1) ≥ 16 log2 q + 5 with n ≥ 6, so n ≥ m(H) + 4. Case 6e: T = U (3, q). Then d(T ) − 1 ≥ q 3 ≥ 9 log2 q + 4 with n ≥ 6, so n ≥ m(H) + 4. The case where H is a subgroup of primitive wreath product and the case when H ≤ Aut(T ) with T is either Lie-type group (twisted Chevalley group or the Tits group) or sporadic group are already handled by Whiston Remark 1. Using GAP, Sophie Le analyzes primitive subgroup of Sn for n = 9, 12, and obtained the result that m(H) ≤ n − 4. Therefore, lemma 3 holds for n ≥ 9. Lemma 4. Let P = {X0 , X1 , . . . , Xm } be a partition of Σ = {1, 2, . . . , n} with m ≥ 1. Then for every h ∈ SΣ = Sn , there exists α, β0 and {βi }pi=1 such p Q that h = α.β0 . βi , and α ∈ SX1 × SX2 × . . . . × SXm , β0 ∈ SX0 , and each i=1 βi 6∈ SXt ∀t ∈ 0, m is a single cycle such that for each j ∈ 1, m, elements in Xj that are not fixed by h are all in the some same cycle βi . Moreover, β0 commutes with α and βi ∀i ∈ 1, p, and βi with i ∈ 1, p commutes with p Q each other. We call this representation h = α.β0 . βi the M -decomposition i=1 9 of h ∈ Sn . Also note that if we let Yi be the set of all j ∈ 1, m such that elements in Xj are in the cycle βi , then Q = {Y1 , . . . , Yp } is a partition of µ for some subset µ ⊂ {1, 2, . . . , m}. We call this partition Q the associated partition of the M -decomposition of h ∈ Sn . Now suppose that P is a partition {X, Y } of Σ instead. Then each element h ∈ SΣ = Sn can be represented as α.β, where α ∈ SX × SY and β is 1 or is a single cycle of the form (x1 , y1 , x2 , y2 , . . . , xk , yk ) with xi ∈ X, and yi ∈ Y . We will call this representation the strong M -decomposition of h ∈ Sn . Proof. Consider an element h ∈ Sn . Write the cycle decomposition of h. Q First, group all cycles that are in m i=1 SXi into α0 , and all cycles in SX0 into β0 . We say that 2 cycles in are equivalent if they both have elements that are in some same Xj . Then we will have p equivalent classes of cycles. Note that from the definition of equivalent relation, if we let Yi be the set of all j such that some element in Xj are in some cycle of the ith equivalent classes, then Yi are all disjoint and Q = {Y1 , . . . , Yp }, is therefore a parition of {1, . . . , m}. Then using the identity (a, x1 . . . , xk )(b, y1 , . . . , yl ) = (a, b)(a, x1 , . . . , xk , b, y1 , . . . , yl ) with a, b ∈ Xj , we can represent product of Q all cycles in the same ith equivalent classes as αi βi , where αi ∈ j∈Yi Xj , and βi is a single cycle containing elements in X0 and Xj with j ∈ Yi . Q Therefore, we get h = α0 .β0 . pi=1 αi βi . Now note that αj commutes with βk for k 6= j so we can push all αj to the top positions, and so Q h = α0 α1 · · · αp β0 β1 · · · βp , and if we let α = pi=0 αi , then we have the M -decomposition of h. For the case P = {X, Y }, based on M - decompostion of h, we will get h = M.N , where M ∈ SX × SY and N is 1 or is a single cycle containing both elements of X and Y . Now suppose that N 6= 1 and has at least 2 adjacent elements that are both ∈ X or both ∈ Y . WLOG, assume that N = (x1 , x2 , t1 , t2 , . . . , tk ) 10 with x1 , x2 ∈ X, then N can also be rewritten as (x1 , x2 )(x2 , t1 , t2 , . . . , tk ). Continuing this process, we can represent N in term of N1 .T where T = (x1 , y1 , x2 , y2 , . . . , xk , yk ) or 1 with some N1 ∈ SX × SY , and xi ∈ X, yi ∈ Y . If we let α = M.N1 ∈ SX × SY , and β = T , we will get the strong M -decomposition of h. Definition 3. Given m ∈ Z, and a partition P = {X0 , X1 , . . . Xp } of Σ = {1, 2, . . . , m}, we say that a subgroup G of Sm = SΣ has M -property wrt P p Q if for any h ∈ G, and σ ∈ SXi , σhσ −1 ∈ G i=1 Now for a subset T of Sm , we define G(T, P) to be the smallest subgroup of Sm that contains T and has M -property wrt P. It is easy to see that p Q G(T, P) is the subgroup generated by {σhσ −1 , h ∈ T, σ ∈ SXi } i=1 Lemma 5. Suppose m ∈ Z, and Sm = SΣ0 with Σ ⊂ Σ0 = {1, 2, . . . , m}. Let P = {Σ0 \ Σ, X, Y } be a partition of Σ0 such that |Σ| > 4. Assume that a subgroup G of Sm has M -property wrt P, and α(aby) ∈ G for some α ∈ SX × SY , a, b ∈ X, and y ∈ Y . Then AΣ = AX∪Y ⊂ G Proof. Starting with arbitrary α ∈ SX × SY , we will try to find α0 with much simpler form such that α0 (a, b, y) is still in G. First, we notice that (a, b, y).α ∈ G. Hence α(a, b, y)(a, b, y)α ∈ G, and therefore α2 (a, y, b) ∈ G. Repeating this argument, we get α4 (a, b, y) ∈ G. So first, we can always eliminate all transpositions, if any, in the cycle decomposition of α. Moreover, if some cycle (. . . , m, n, . . . ), which is not a transposition, appears the cycle decomposition of α such that m, n is not a, b, and all elements in this cycle are in X, then we can consider σ ∈ SX that swap m and n. We have α(σασ −1 )−1 = (x1 , . . . , xk , m, n, y1 , . . . , yl ).(yl , . . . , y1 , m, n, xk , . . . , x1 ) = (n, m, y1 ) ∈ G. 11 Therefore, AX ⊂ G. Using this observation, we can eliminate all even permutation of SX , and therefore all elements of SX that are in the cycle decomposition of α. As a result, we can assume that in the cycle decomposition of α, its only possible non-identity term in SX is a single 3-cycles that contains a, b and some other element c ∈ X. Using similar argument, we can further assume that α contains no non-identity element of SY . Therefore, we must have either (a, b, y) ∈ G or (a, b, c)(a, b, y) = (a, c)(b, y) ∈ G or (a, c, b)(a, b, y) = (b, y, c) ∈ G. In short, we have (a, b)(c, y) ∈ G or (a, b, y) ∈ G, with some a, b, c ∈ X, y ∈ Y . If (a, b, y) = (y, a, b) ∈ G, then (y, c, d) ∈ G with any c, d ∈ X, and so AX∪{y} ∈ G. As a result, (a, b, c) ∈ G with any c 6= a, b in X, if any. Since (a, b, y) ∈ G, (a, b, z) ∈ G for each z ∈ Y . Therefore, (a, b, t) ∈ G with every t 6= a, b. Hence AΣ ⊂ G. The case when (a, b)(c, y) ∈ U is handled in a similar fashion. Lemma 6. Let H be a subset of Sn (n ≥ 10), and P = {X, Y } is a partition of Σ = {1, 2, . . . , n}. There exists a subset K of H with |K| ≤ 9 such that H ⊂ G(K, P) Proof. P is fixed throughout the proof of this lemma so we can just write G(T ) instead of G(T, P). Now we consider the following cases: Case 1: Now assume that for some hi0 , the β component in its M decomposition (lemma 4) is not 1 and doesn’t contain some b ∈ X. We have β = (. . . , a, c, . . . ) for some a ∈ X, c ∈ Y . Consider element σ ∈ SX × SY that swaps a and b. Let U = G({hi0 }). Then α2 σβσ −1 = σhi0 σ −1 ∈ U with α2 = σασ −1 ∈ SX ×SY . Therefore, αβ(σβσ −1 )−1 (α2 )−1 ∈ U . Hence, α2−1 αβ(σβσ −1 )−1 ∈ U . 12 In other word, α3 β(σβσ −1 )−1 = α3 (x1 , . . . , xk , a, c, y1 , . . . , yl )(yl , . . . , y1 , c, b, xk , . . . , x1 ) = α3 (cba) ∈ U for some α3 = α2−1 α ∈ SX × SY . Hence, its inverse (abc).α3−1 ∈ U . As a result, α3−1 (a, b, c) ∈ U , and by lemma 5, An ⊂ U . Now if all hj are even permutation then U already contains all hj . Otherwise, we just need at most one element hj0 together with U to generate the whole SΣ , and therefore generate all hi . Therefore, our set K needs at most 2 elements hi0 and hj0 . Case 2: Now we only need to handle the case when the M -decomposition of h ∈ H has the form h = αβ with α ∈ SX ×SY , and β = (x1 , y1 , . . . , xk , yk ), where k = |X| = |Y |, xi ∈ X, yi ∈ Y or β = 1. Note that n ≥ 10 so k ≥ 5. Let H1 = {hi ∈ H : β = 1}, and H2 = {hi ∈ H : β = (x1 , y1 , . . . , xk , yk )}. We now prove that K needs at most four hi ∈ H1 , and needs five more hj ∈ H2 to generate all elements in H = H1 ∪ H2 . Suppose there exists some h1 = α = A.B ∈ SX × SY , where A, B are nontrivial permutations of SX and SY . Then consider U = G({h1 }). For any −1 −1 σ ∈ SX , σh1 σ −1 h−1 ∈ U . Since A is not identity, there exists σ 1 = σAσ A such that σAσ −1 A−1 is a non-trivial permutation of SX . Therefore, AX ∈ U . Similarly, AY ∈ U . We say that hi ∼ hj with hi , hj ∈ H1 if hi h−1 j ∈ AX ×AY . Note that, for any equivalent class C, C ⊂ G({gi }∪{h1 }) ∀gi ∈ C. Therefore, we need ≤ 3 other hi to generate the whole H1 because there are at most 4 equivalent classes, and so K only needs ≤ 4 elements of H1 to generate all elements in H1 . If H1 ∈ SX ∪ SY , then by similar arguments, K only needs ≤ 2 + 2 = 4 elements from H1 . Now we will handle H2 . Choose a fixed cycle C = (u1 , v1 , . . . , uk , vk ), ui ∈ SX , vi ∈ SY . For each hi = α(x1 , y1 , . . . , xk , yk ), there exist σi ∈ SX × SY such that: σi hi σi−1 = (σi ασi−1 )(σi (x1 , y1 , . . . , xk , yk )σi−1 ) = αi .C. If αi are 13 the same for all i, then G({hi }) contains H1 for any hi ∈ H1 . Now suppose there is some i0 and j0 such that αi0 αj−1 = A.B, A and B 0 are non-trivial permutations in SX and SY . Then again, AX , and AY are both subsets of G({αi0 , αj0 }). We say that hm ∼ hn if αm αn−1 ∈ AX × AY . Using the same argument for H1 , we only need at most 3 more hk so that G({hi0 , hj0 , hk1 , hk2 , hk3 }) contains H2 . The case αi αj−1 ∈ AX ∪ AY ∀i, j is handled in a similar way. As a result, our set K needs ≤ 4 + 5 = 9 elements. Theorem 2. Suppose that H 6= An is a proper subgroup of the symmetric group Sn , and H is transitive. Then m(H) ≤ n−4 ∀n ≥ 25. If H is a proper subgroup of An , then m(H) ≤ n − 4 ∀n ≥ 9. Proof. First, by lemma 3, we only need to handle the case when H is an imprimitive but transitive subgroup of Sn . Therefore, we can assume that H ≤ SΓ o S∆ . Using the same notation as in definition 2, we have n copies of Γ or n blocks, Γ1 , Γ2 , . . . , Γ|∆| , and an irredundant generating set of length m(H) = l, {g1 , . . . , gl }, so that {g1 , . . . , gk } generates block permutations while K = {gk+1 , . . . , gl } contains elements fixing the blocks. The proof of theorem 2 is based on Whiston’s proof for Sn with one exceptional case that is handled by lemma 6. Whiston proved that for n ≥ 7, if H 6= An is a transitive subgroup of the symmetric group Sn , and is not a subgroup of S2 o S n2 , then m(H) ≤ n − 3. Cameron and Cara further showed that m(H) ≤ n − 3 even if H ≤ S2 o S n2 . Using GAP, Sophie Le checked for S5 and S6 and found that no transitive subgroup of Sn other than An has m(H) > n − 3 for n = 5, 6. Therefore, if H 6= An is a transitive subgroup of Sn , n ≥ 5, then m(H) ≤ n − 3. Let X1 be the smallest subset of {gk+1 , . . . , gl } such that X1 generates the action of K on Γ1 , and suppose that X1 = {gk+1 , . . . , gr }. Then there exists hi generated by X1 such that gi0 = hi gi with i > r fixes Γ1 pointwise. 14 Let K1 = {gi0 , i > r}. We have K1 is irredundant because K is irredundant. Now take X2 to be a subset of K1 that generates the action on Γ2 . Then we will have an irredundant set K2 that fixes Γ1 and Γ2 . We continue this process to build Xi that generates the action of Ki−1 on Γi , and Ki be the set built from remaining gi : Ki = {tj gj , tj ∈ hX1 ∪ . . . ∪ Xi i. Notice that Ki must be irredundant, and therefore K|∆| must be an empty set, and so we P P have l − k = |K| = i |Xi |. Hence, l − k ≤ i m(Xi ). We now consider several cases to prove the inequality m(H) ≤ n − 4: Case 1: If there is no i such that the subgroup generated by H1 = {gk+1 , . . . , gl } acts as SΓ or AΓ on Γi . Since Xi cannot acts as SΓ on Γi , P m(Xi ) ≤ |Γ| − 2, so we get l − k ≤ i m(Xi ) ≤ |∆|(|Γ| − 2), and therefore m(H) = l ≤ n − |∆| − 1 ≤ n − 4 for |∆| ≥ 3. Now suppose that |∆| = 2. Then |Γ| ≥ 5. If either X1 or X2 acts transitively on Γ1 or Γ2 , then m(X1 ) or m(X2 ) ≤ |Γ| − 3. Hence l ≤ 1 + |Γ| − 2 + |Γ| − 3 = n − 4. So now we just need to consider the case where X1 and X2 both acts intransitively on Γ1 and Γ2 . In this case, there are partitions Pi = {Ui , Vi } of Γi such that Xi acts seperately on the sets Ui , Vi . Therefore m(Xi ) ≤ m(XiUi ) + i(XiVi ) ≤ |Ui | − 1 + |Vi | − 1 = |Γ| − 2 (XiT is the group action of Xi on T ). Hence, l ≤ 1 + |Γ| − 2 + |Γ| − 2 = n − 3. If the equality occurs, then Xi must acts as SUi × SVi on Γi for i = 1, 2. If H is a subgroup of An , this case cannot happen. If, however, H is just a subgroup of Sn , then we will use lemma 6 to handle this case. Let h21 be the element that move block 2 to block 1. Suppose that h21 , after moving the block, performs a permutation σ on Γ1 . Let hδ be −1 an element in L, the subgroup generated by {h−1 21 gk+1 h21 , . . . , h21 gr h21 } such that hδ fixes the blocks and performs permutation δ on Γ2 . Note that δ ∈ σ −1 X1Γ1 σ = SU10 × SV10 for some partition {U10 , V10 } of Σ. 0 0 Now the elements h−1 δ gi hδ (here gi = hi gi ∈ X2 = K1 ) will again fixes 15 Γ1 and performs the permutation δ −1 gi0 δ on Γ2 . Then by lemma 6, we only need ≤ 9 elements of X2 together with {g1 , . . . , gr } to generate the whole X2 . Hence we must have: m(H) ≤ 1 + n/2 − 1 + 9 ≤ n − 4 for n ≥ 25. Case 2: If |Γ| > 2, and there is some i such that H acts as An or Sn on Γi . Then by lemma 2, m(H) ≤ |Γ| + 2|∆| − 3 = n − (|Γ| − 2)(|∆| − 1) − 1 ≤ n − 3 − 1 = n − 4 for n = |Γ||∆| ≥ 10 and |Γ| > 2. For n = 9, |Γ| = |∆| = 3. WLOG, suppose i = 1. If m(H) = n − 3 = 6, then the block permutation of H must be isomorphic to S3 , which is 2transitive, and then by lemma 21, we only need at most 5 elements to generate the whole H. Contradiction. Hence m(H) ≤ 5 ≤ n−4, and so the case n = 9 is also handled. Case 3: Now we need to handle the case when |Γ| = 2, |∆| ≥ 5. By lemma 15 (for k = 4), and the fact that m(K) ≤ n − 3 for all transitive subgroup K 6= An ≤ Sn with n ≥ 5, m(H) ≤ 2|Γ| − 4 = n − 4. Corollary 1. An is strongly flat for n ≥ 9. Proof. For any proper subgroup H of An , we will prove that m(H) < n− 2 = m(An ). By theorem 2, we only need to consider the case when H is intransitive. Then there exists a partition P = {X, Y } of Σ = {1, 2, . . . , n} so that H ⊂ SX × SY ≤ Sn = SΣ . Suppose πX : SX × SY → SX is the projection from SX × SY to its first factor, and H X = πX (H). Similarly, we have πY , and H Y . Therefore, m(H) ≤ m(H X ) + m(H Y ) ≤ |X| − 1 + |Y | − 1 = n − 2. The equality holds if and only if H X = SX and H Y = SY , and therefore, H must be SX × SY . Contradiction since SX × SY is not a subgroup of An . Therefore, m(H) ≤ n − 3, and we finish the proof for corollary 1. Now to classify all irredundant generating set of size n − 2 in An , we will consider graphs which are similar to the one used in Cameron and Cara’s paper. 16 Definition 4. Let G be the group Sn or An . Suppose {h1 , h2 , . . . , hn−2 } is an irredundant generating set of length n − 2 of G. Let Gi be the proper subgroup of Sn generated by (hi )i6=j . Then by theorem 2, for G = An , and n ≥ 9, or for G = Sn and n ≥ 25, Gi is an intransitive subgroup if Gi 6= An . Now we will build the original graph Gro . We start with the set of vertices Σ = {1, 2, · · · , n}. Now for each i ∈ 1, n − 2 such that Gi is intransitive, there exists x and y in Σ such that hi maps x to y, and x, y are not in the same Gi − orbit. Such x, y exist because if x, y are in the same Gi − orbit whenever hi maps x to y, then the orbits of G are the same as the orbits as Gi . This is impossible because Gi is intransitve while G is transitive. Add the edge that connects x to y, (x, y), to the graph and named this edge hi . Then we have a graph Go with either n − 2 or n − 3 edges. Here note that the edge (x, y) is different from the transposition (x, y) even though they are related to each other. Lemma 7. The graph Go is a forest Proof. If there is a cycle, then consider an edge (x, y) that correponds to some hi in this cycle. Then we can go around the cycle from x to y through other edges correponding to hj with j 6= i. This leads to contradiction because x and y are not in the same Gi -orbit. Lemma 8. If G = An , then the corresponding forest Gro has n − 2 edges. Moreover, each element hi is the product of exactly 2 transpositions, one of which correponds to an edge lying in Gro If G = Sn then there are two possible cases: • There is exactly one Gi = An , and we can assume i = 1. Then Go has n − 3 edges. Moreover, h1 is a transpositions, and other n − 3 elements hi are product of exactly 2 transpositions, one of which already appear in Gro . • Or if for every i, Gi 6= An , then Gro has n − 2 edges, and each element hi 17 is product of ≤ 2 transpositions, one of which corresponds to an edge lying in Gro . Finally, let E1 (hi ) be the edge that connects x to y and lies in Gro and corresponds to one transposition (x, y) of hi , and let E2 (hi ) be the edge that correponds to the other transposition, if any. For the transposition h1 in Sn case, we just use the notation E1 (h1 ) Proof. Consider a particular hi , and write the cycle decomposition of hi . Then represent each cycle (u1 , u2 , . . . , uk ) in the decompostion in term of products of transpositions (u1 , u2 ), (u2 , u3 ), . . . , (uk−1 , uk ). Now, add to the original graph Gro edges that connect these ui to ui+1 . Suppose that there’s a cycle in the resulting graph. If this cycle contains some edges {x, y} that corresponds to hj with j 6= i, then by going along the other edge of this cycle, we can connect x to y by edges corresponding to elements in Gj , and this is again impossible. Therefore, the only edges that can be in the cycle is the edges built from cycle decomposition of hi as we described above. But those edges clearly cannot create a cycle. Therefore, the resulting graph must be forest and can only have at most n − 1 edges. Now if G = An or G = Sn and Gi 6= An ∀i, then Gro already has n − 2 edges. So one can only add at most one edge from the cycle decomposition of some hi . Hence, hi can be product of at most 2 transpositions, and one of those transpositions has already appeared in the graph Go . In the case G = An , hj , therefore, must be product of exactly 2 transpositions. If G = Sn and G1 6= An , then there are already n − 3 edges corresponding to hi with i 6= 1 in Go . If we add k transpositions from h1 ’s decomposition, then by a similar argument as above, the new graph is still a forest, and k + n − 3 ≤ n − 1 or k ≤ 2. Since h1 is an odd permutation, k must be 1, and, therefore, h1 is a transpositions. Similarly, for i 6= 1, hi must be product of ≤ 3 transposition. Because hi , i 6= 1, is an even permutation, it must be the product of exactly 2 transpositions. 18 Theorem 3. All irredundant generating sets of length n − 2 in An , H = e n−2 , ei ∈ {1, −1}}, where {h1 , h2 , . . . , hn−2 }, has the form {sg1e1 , sg2e2 , . . . , sgn−2 s, gi are transpositions such that the graph associated with these transpositions is a tree. Proof. Now start with the forest (original graph) Gro associated to G = An that is defined above. If all E2 (hi ) are the same and are some edge E, then we can add E to Go , and the resulting graph is still a forest, and, therefore, is a tree. Therefore the irredundant generating set H = {hi } has the form as desired. Now for some j 6= i such that E2 (hi ) 6= E2 (hj ), add E2 (hi ) and E2 (hj ) to the forest Gro . Then we will get n edges in the resulting graph, and there must be some cycle C(i, j) in this new graph. Notice that E1 (hk ) for k 6= i, j cannot be in this cycle, so the cycle has ≤ 4 edges. Also, note that the cycle must has at least 3 edges so it must contains both E1 (ht ) and E2 (ht ) for t = i or t = j. WLOG, suppose that the cycle C(i, j) contains E1 (hi ) and E2 (hi ), and has 4 vertices 1, 2, 3, 4. Now we have 2 following cases : Case 1: E1 (hi ) and E2 (hi ) share no common vertex. Then the cycle must have at least 4 edges and therefore have exactly 4 edges Ek (ht ), k = 1, 2, t ∈ {i, j}. WLOG, suppose that E1 (hi ) = (1, 2), E2 (hi ) = (3, 4), E1 (hj ) = (2, 3) and E2 (hj ) = (1, 4). Then 3 and 4 must be in different Gi -orbits while 1 and 4 must be in different Gj -orbit . Clearly, E2 (hk ) 6= E2 (hi ), for k 6= j, so we can consider the cycle C(i, k) instead. C(i, j) must contain E2 (hk ). This is impossible because no two vertices in {1, 2, 3, 4} can be in the same Gi or Gj -orbits and cannot be connected by an edge correponding to hk with k 6= i, j. 19 Case 2: If two edges of hi share a common vertex. Again, WLOG, suppose E1 (hi ) = (1, 2), and E2 (hi ) = (1, 3). Hence 1 and 3 are not in the same Gi -orbit. For any k 6= i, j, we again consider the cycle C(i, k). 1, 2, and 3 are in different Gi -orbits, so C(i, k) must contain both E1 (hi ) and E2 (hi ). Therefore, this cycle has only two possible forms: First, we will change hi to h0i = h2i so that E2 (h0i ) = (2, 3). In the second form, if any, we can change hk to h0k = h2k so that all edges E2 (h0t ) with the new h0t = ht or h2t are the same and are the edge (2, 3). As a result, {h0j } and {hj } has the form indicated. Remark 2. Sophie Le found that theorem 3 is also true for A7 and A8 . It is easy to see that theorem 3 is true for A4 and A3 , and therefore theorem 3 is true for all n 6= 5, 6 ≥ 3. Lemma 9. Let {X, Y } be a partition of Σ = {1, 2, .., n}. Suppose that G = (SX × SY ) ∩ An . Then either G is maximal subgroup of An or |X| = |Y | = 20 n 2 and there is an unique maximal subgroup M = (S n2 o S2 ) ∩ An that contains G. Proof. Suppose we have an element h ∈ An \ G. Write the M -decomposition of h: h = M.N , where M ∈ SX × SY , and N = (x1 , y1 , . . . , xk , yk ) with xi ∈ X, yi ∈ Y . Let F be the subgroup generated by h and G. Suppose that there is some x ∈ X that not in the cycle N of h. Let σ ∈ SX be the permutation that swaps x1 and x. Because h ∈ F , h0 = (ab).N ∈ F , where (ab) is some transpostion in SX . We have N.(a, b)(a, b).N = N 2 = (x1 , . . . , xk )(y1 , . . . , yk ) ∈ G, so N.(a, b) is also in F . Because h ∈ F , and σ −1 (a, b) ∈ G, M.σ −1 σN (σ −1 (a, b)) ∈ F . Hence σN σ −1 (a, b) = (x, y1 , . . . , xk , yk )(a, b) ∈ F since M.σ −1 is in G = (SX × SY ) ∩ An . But we also have N.(a, b) ∈ F , so (a, b).N −1 ∈ F . Therefore, (x, y1 , . . . , xk , yk )(a, b)(a, b)(yk , xk , . . . , y1 , x1 ) = (y1 , x1 , x) ∈ F . As a result, An = F . Consequently, if G is not maximal, and F0 is some maximal subgroup containing G, then F0 can only contain elements of the form M (x1 , y1 , . . . , xk , yk ), where M ∈ SX × SY , and {xi , yi }ki=1 is exactly the set Σ. Hence, F0 must be (S n2 o S2 ) ∩ An . Moreover, because of the same reason, F0 = (S n2 o S2 ) ∩ An must also be a maximal subgroup of An . Theorem 4. Let {h1 , h2 , . . . , hn−2 } be any irredundant generating set in An of length n − 2 (n 6= 5, 6 ≥ 3). There is an unique collection of maximal subgroups M1 , M2 , . . . , Mn−2 that are certified by hi . In other word, An satisfies the uniqueness property Proof. By theorem 3, we can assume that hi = ssi , with i = 1, n − 2 so that the edge E(s) = E2 (hi ) and E(si ) = E1 (hi ) corresponding to transpositions s and si create a tree T on the set of vertices Σ = {1, 2, . . . , n}. Again, if Gi be the subgroup generated by {hj }j6=i , then we have Gi = 21 SX ×SY ∩An , where X and Y are sets of vertices of two connected components of T \{E1 (hi ) = E(si )}. Then by lemma 9, Gi is almost maximal. Therefore, the uniqueness property is satisfied. Definition 5. A group G with m = m(G) satisfies the replacement property if for any irredundant generating set H = {h1 , h2 , . . . , hm } of length m of G and any non-identity element h ∈ G, there exists some i ∈ 1, m so that the set {hj }j6=i ∪ {h} still generates G. Theorem 5. An satisfies the replacement property for all n > 0. Proof. Using GAP, G. Frieden and Sophie Le found that An satisfies replacement property for n = 1, 8. So we just need to consider the case when n ≥ 9. Again, by theorem 3, we can consider an irredundant generating set of length n − 2 of the form H = {hi = ssi , i = 1, n − 2} so that edges E(s) and E(si ) corresponding to transpositions s and si create a tree T on the set of vertices Σ = {1, 2, . . . , n}. Consider any element h ∈ An . Then there are at least 2 pair of elements in Σ, (x, y) and (z, t), such that h maps x to y, and maps z to t. Consider the paths Li in T that connect xi to yi for all distinct pairs (xi , yi ) such that h maps xi to yi . Suppose that there exists two edges E(si ) and E(sj ) with si , sj 6= s in ∪ki=1 Li (k ≥ 2). Then h 6∈ Gi and h 6∈ Gj . By lemma 9, either Gi or Gj must be maximal because (S n2 o S2 ) ∩ An cannot contain Gi ∪ Gj = An . WLOG, suppose that Gi is a maximal subgroup. Then we can replace hi by h. Otherwise, if ∪ki=1 Li = {E(si ), E(s)} for some i, then k = 2, and h must be ssi , and we can replace hi by itself. 22 3. Properties of irredundant generating set of arbitrary length in the symmetric group 3.1. Classification of irredundant generating sets of length n − 2 of symmetric group Cameron and Cara classified all irredundant generating sets of length n − 1 in Sn . Now we will classify all irredundant generating sets of length n − 2 in Sn . Definition 6. Let Σ = {1, 2, . . . , n}. For a subset S ⊂ Sn consisting of transpositions, we define GrS to be the graph on the set of vertices Σ such that x and y is connected to by an edge E(s) if there exists some transposition s ∈ S such that s = (xy). Theorem 6. (Classification of irredundant generating sets of length n − 2 for Sn with n > 24) Let H = {h1 , h2 , . . . , hn−2 } be an irredundant generating set of length n − 2 of Sn . Then we can change some of the element hi of H to h−1 so i that the resulting set has one of the following types: (Here s, t, r, and si are always distinct transpositions) 1. H = {ss1 , . . . , ssk , sk+1 , . . . , sn−2 } with 1 ≤ k < n−2 such that Gr{s,si } is a tree. 2. H = {s1 s2 , s3 s4 , s5 , . . . , sn } such that Gr{s,si } is connected and contains exactly 1 cycle (E(s1 ), E(s3 ), E(s2 ), E(s4 )). 3. H = {ts1 , . . . , tsk , s, ssk+1 , . . . , ssn−3 , } with 1 ≤ k ≤ n − 3 such that Gr{t,s,si } is a tree. 4. H = {s1 s2 , s3 s4 , s, ss5 , . . . , ssn−1 } such that Gr{s,si } is connected and contains exactly 1 cycle (E(s1 ), E(s3 ), E(s2 ), E(s4 )). 5. H = {s1 s2 , ts3 , . . . , tsk , s, ssk+1 , . . . , ssn−2 } with 3 ≤ k ≤ n − 2 such that Gr{s,t,si } is connected, and contains exactly 1 cycle (E(s1 ), E(s), E(s2 ), E(t)). 23 6. H = {s1 s2 , s3 s4 , s, ss5 , . . . , ssn−1 } such that Gr{s,si } is connected and contains exactly 1 cycle (E(s1 ), E(s3 ), E(s2 ), E(s4 ), E(s)). 7. H = {ts1 , . . . , tsk , rsk+1 , . . . , rsl , s, ssl+1 , . . . , ssn−3 } with 1 ≤ k < l ≤ n − 3 such that Gr{s,t,r,si } is connected and contains exactly 1 cycle (E(s), E(t), E(r)). Proof. Recall that Gi is the subgroup of G = Sn generated by {hj }j6=i . We divide the problem into 2 following cases: Case I: Gi 6= An ∀i. In this case, by ??, Gro is a tree with n − 2 edges. Moreover, each hi is product of ≤ 2 transpositions, and E1 (hi ), the edge corresponding to the first transposition of hi , lies in Gro . Starting with Gro , if hi and hj are not transpositions, and E2 (hi ) 6= E2 (hj ), then we add E2 (hi ) and E2 (hj ) to Gro . We will have a new graph Gr(i, j) with n edges. Therefore, there must be some cycle C(i, j). If C(i, j) contains some edge E1 (hk ) = (x, y), then by going along the other edge of the cycle, we would get that x and y are in the same Gk -orbit, and that cannot happen. Therefore, edges of C(i, j) can only be E1 (hi ), E1 (hj ), E2 (hi ), and E2 (hj ). There exists hi such that it is the product of 2 transpostions because otherwise the set {hj } cannot generate Sn . So now we have 2 subcases: Case I.1: Suppose that all hi have the same second transpositions s. Then add the edge corresponding to s to Go , we will get a tree T . This means that H has type 1. Case I.2: Suppose that there are hi and hj such that E2 (hi ) 6= E2 (hj ). Then consider the graph Gr(i, j), and the resulting cycle C(i, j). WLOG, we can assume that C(i, j) contains both E1 (hi ) and E2 (hi ). As a result, E2 (hi ) must have 2 vertices that are in different Gi -orbit, and therefore, E2 (hi ) 6= E2 (hk ) for any k 6= i, so there exists the cycle C(i, k) for any k 6= i that hk is not a transposition. Now we consider different possible forms of C(i, j): 24 Case I.2.a: If for some C(i, j), E1 (hi ) and E2 (hi ) share no common vertices. Then C(i, j) must be a 4 cycles and contains E1 (hi ), E2 (hi ), E1 (hj ), and E2 (hj ). Hence, E2 (hi ) must have 2 vertices that are in different Gi -orbits. Similarly, E2 (hj ) also has 2 vertices that are in different Gj -orbits. Because vertices in both edges correponding to hi are in different Gi orbits, C(i, k) must contain both these edges. Therefore, C(i, k) must contain, E2 (hk ), E1 (hi ), E2 (hi ). However, in no way, two vertices of E2 (hk ) can be 2 of 4 vertices of E1 (hi ) and E2 (hi ). Contradiction. Therefore, for k 6= i, j, hk must be a transpositions. As a result, H has type 2. Case I.2.b: If two edges E1 (hi ) and E2 (hi ) in C(i, j) share a common vertex instead. We can again assume that E1 (hi ) = (1, 2) and E2 (hi ) = (1, 3). Then for any k 6= i such that hk is not a transposition, E2 (hk ) 6= E2 (hi ), and C(i, k) can only have two possible forms: As a result, we can change hi to h2i = h−1 i , and change some other hj to h2j = h−1 j so that H will have type 1. Case II: Assume that there is some Gi = An . Again, by ??, h1 is a transposition, and other n − 3 hi ’s are product of 2 transpositions such that E1 (hi ), the edge corresponding to the first transposition of hi , lies in Gro . Suppose that h1 = (x, y). If E2 (hi ) 6= E2 (hj ), and they are different from E1 (h1 ) = (x, y), then we 25 add E1 (h1 ), E2 (hi ) and E2 (hj ) to Gro so that we have a new graph Gr(i, j) with n edges. There must be some cycle C(i, j). C(i, j) cannot contain some edge E1 (hk ) = (x, y) for k 6= i, j and 1 because otherwise x and y will be in the same Gk -orbit by going the other way from x to y along the cycle. So C(i, j) can only contains ≤ 5 edges: E1 (hi ), E1 (hj ), E2 (hi ), E2 (hj ), E1 (h1 ). Let M be the set of hi such that both hi and h2i doesn’t map x to y. Note that for hi 6∈ M and hi 6= h1 , the second transposition of hi or h2i is exactly h1 . Now M must have at least 1 element because otherwise H cannot generate Sn . Case II.0: If |M | = 1, then by changing hi to h2i appropriately, we will get H = {h1 , h1 x1 , . . . , h1 xn−4 , xn−3 xn−2 }. Moreover, edges corresponding to transpostions h1 and xi with i ∈ 1, n − 2 will create a forest (and therefore a tree) on the set of vertices Σ. So H has type 3. Now suppose |M | ≥ 2. Case II.1: Assume that there is some element hi of M such that E1 (hi ) and E2 (hi ) have no common vertex, and E2 (hi ) = (u, v), with u and v are in different Gi -orbit. For another hj ∈ M , E2 (hj ) 6= E1 (h1 ). Also E2 (hi ) 6= E2 (hj ), E1 (h1 ) because of our assumption that u and v are in different Gi -orbits. Then we can consider the graph cycle C(i, j) that we defined above. Note that C(i, j) cannot contain only 1 edge of hi because 2 vertices of that edge cannot be in the same Gi -orbit. Moreover, C(i, j) cannot be a cycle with 3 edges E1 (hj ), E2 (hj ), and E1 (h1 ) because hj 6∈ M . As a result, C(i, j) must contain both E1 (hi ) and E2 (hi ) Now this cycle C(i, j) has only 4 possible forms: 26 If C(i, j) has form 1, then 2 vertices of E2 (hj ) must be in different Gj orbits. Moreover, if there exists hk ∈ M with k 6= i, j, then C(i, k) must contains both edges correponding to hi , and also E2 (hk ). Again, similar to Case I.2.a, we see that this cannot happen. Hence M must be {hi , hj }, and H has type 4. Assume that C(i, j) has form 2. For hk ∈ M, k 6= i, j, consider the cycle C(i, k). C(i, k) must contain both edges correponding to hi and also E2 (hk ). As a result, either E2 (hk ) = E2 (hj ) = B or C(i, k) has the following form: Therefore, for hk ∈ M , we can change hk to h2k = h−1 k , if necessary, so that E2 (hk ) = E2 (hj ) = B. So H has type 5. Now suppose that C(i, j) has form 3. Then, by a similar argument we used for form 2, we can show that H must also have type 5. 27 Finally, we handle the case when C(i, j) has form 4. If there is any hk ∈ M , k 6= i, j, then we can consider C(i, k). This cycle again must contain both edges correponding to hi , E2 (hk ), and possibly E1 (h1 ). If C(i, k) has 4 edges, then we can connect 2 vertices of E1 (hj ) by edges other than E1 (hj ) and E2 (hj ), and therefore these vertices have to be in the same Gj -orbit. Contradiction. So C(i, j) must have 5 edges, and must contain E1 (h1 ). But with such arrangment of edges E1 (h1 ), E1 (hi ) and E2 (hi ) in form 4, this cycle must contain all 5 vertices of C(i, j). Again, we get that two vertices of E1 (h1 ) are in the same Gj -orbit, and this is impossible. Therefore M must be {hi , hj }. As a result, H must have type 6. Case II.2: For each hi ∈ M , either E1 (hi ) and E2 (hi ) have a common vertex or E2 (hi ) = (x, y), with x and y are in the same Gi -orbit. Suppose that there exists some hi ∈ M such that E2 (hi ) has two vertices in the same Gi -orbit. If for every hj ∈ M , E2 (hj ) = E2 (hi ) or E2 (h2j ) = E2 (hi ), then H must have type 3. If there is some hj ∈ M , both E2 (hj ) and E2 (h2j ) 6= E2 (hi ), then we can consider the cycle C(i, j). This cycle cannot contain E1 (hi ). Also, either E1 (hj ) is not in C(i, j) or E1 (hj ) and E2 (hj ) have a common vertex. Moreover, this cycle cannot be (E2 (hi ), E1 (hj ), E2 (hj )) because otherwise, E2 (h2j ) = E2 (hi ) Therefore, the cycle C(i, j) must be either (E1 (h1 ), E2 (hi ), E2 (hj )) or (E1 (h1 ), E2 (hi ), E2 (hj ), E1 (hj )). 28 In each case, for any other hk ∈ M , then we can change hk to h2k = h−1 k , if necessary, so that all E2 (hk ) can only be the edge A or B. As a result, H has type 7. We now can assume that for every hi ∈ M , E1 (hi ) and E2 (hi ) have a common vertex, and 2 vertices of E2 (hi ) are not in the same Gi -orbit. Therefore, for any hi , hj ∈ M , E2 (hi ) 6= E2 (hj ), and both are different from E1 (h1 ). Moreover, the cycle C(i, j) cannot be a 3 cycles and can only has 1 of the following forms: If for alll hj ∈ M, j 6= i, C(i, j) has the first form, then we can change hk ∈ M to h2k , such that for all new hk , E2 (hk ) is A. Therefore, H has type 3. If there is some C(i, j) with the second form. Then, again we can change some hk ∈ M to h2k = h−1 k such that E2 (hk ) is either B or C. Therefore H has type 7. Finally, it is easy to check that each sequence of type 1 to 7 is irredundant and generates Sn , and so our proof is complete. 29 3.2. Elements in an irredundant generating set of arbitrary length in the symmetric group Lemma 10. There exists an integer-valued function f = f (k, q) with 2 varik Q ables q and k ∈ Z > 0 such that di ≤ f (k, q) for any {di }ki=1 ∈ Z that i=0 k 1 P = q (q ∈ Q > 0) satisfies i=1 di 1 Proof. For any q ∈ Q > 0, let f (1, q) = b c ∈ Z. q We define f (k, q) recursively: f (k, q) = max tf (k − 1, q − 1t ) ∀k ≥ 2 1 <t∈Z≤ kq q and q > 0 ∈ Q. Now we prove that k Q di ≤ f (k, q) for any {di }ki=1 ∈ Z that satisfies i=0 k 1 P = q by induction on k. i=1 di If k = 1, it is obvious from the definition of f (1, q). Now suppose {di }ki=1 ∈ k 1 P Z that satisfies = q, and WLOG, suppose that d1 = min di . Then we i∈1,k i=1 di k 1 k k get ≥ q, and so d1 ≤ . Suppose d1 = t with < t ∈ Z ≤ . Then d1 q q q k k P Q 1 di = q − > 0, and so by induction hypothesis on k − 1, we get di ≤ t i=2 i=2 f (k − 1, q − 1t ). As a result, d1 d2 . . . dk ≤ max tf (k − 1, q − 1t ) = f (k, q) 1 <t∈Z≤ kq q as desired. Definition 7. Consider two partitions P = {X0 , X1 , . . . , Xm }, and P0 = {Y0 , Y1 , . . . , Ym0 } of Σ = {1, 2, . . . , n} with m, m0 ≥ 1. (Note that these are special partitions because |X0 | and |Y0 | can be zero). We say that P < P0 (or P0 > P) if one of the following conditions holds: • m0 = m and there exists i0 , and x0 ∈ X0 such that Y0 = X0 \ {x0 }, Yi0 = Xi0 ∪ {x0 }, and Xi = Yi ∀i 6= i0 . • m0 = m − 1, and for some i0 > 0, Xi = Yi ∀i < i0 , Yi0 = Xi0 ∪ Xi0 +1 , and Xi+1 = Yi ∀i > i0 . 30 Now for each partition P of Σ, let d(P) = |X0 | + m ≤ 1. Then for each pair of partitions P < P0 , d(P0 ) = d(P) − 1 Therefore, for a partition P = P0 of Σ, any increasing chain of partitions starting at P0 , P0 < P1 < . . . . < Pt−1 , has at most d(P0 ) elements. Lemma 11. There exists a function φ(k, l) so that if H be a subset of Sn (n ≥ 10), and P = {Xi }m i=0 is a partition of Σ = {1, 2, . . . , n} such that |Xi | ≥ 4 ∀i ∈ 1, m and |X0 | = k ≥ 0 (X0 can be empty), then: • Either there exists h0 ∈ H such that there is a partition P0 > P so that if G ≤ Sn has M -property wrt P (defined in definition 3), and contains h0 , then G also has M -property wrt P 0 • Or there exists a subset K of H with |K| ≤ φ(|X0 |, m) such that if some G ≤ Sn has M -property wrt P and contains K, then G also contains H. Proof. For u ∈ Z > 0, k, l ∈ Z ≥ 0, and µ is a set, we define the following integer-valued functions: f1 (u, k) = k! k P f (u + t, 1), where the function f is defined in lemma 10 , t=0 P g(k, µ) = k! p Q f1 (|Yi |, k), where the sum is taken over all par- Q={Y1 ,...,Yp } i=1 tition Q of µ, g1 (k, l) = max g(k, µ), µ⊂{1,2,...,l} and finally, φ(k, l) = (2l + 1)g1 (k, l), Now assume by contradiction that the lemma does not hold. Consider an element h0 of H, and let G ≤ Sn be the subgroup that has M -property wrt P (defined in definition 3), and contains h0 . Write the M -decomposition wrt P (defined in lemma 4) of h0 : h0 = p m Q Q α.β0 . βi (α ∈ SXi , β0 ∈ SX0 , and βi commute with each other). Let Q = i=1 i=1 {Y1 , . . . , Yp } be the partition of {1, 2, . . . , m0 } (m0 ≤ m) that is associated 31 with this decomposition so that βi 6∈ SXt ∀t ∈ 0, m is a single cycle that contains all elements of Xj that are not fixed by h with j ∈ Yi . Now we prove that for each 1 ≤ j ≤ m0 , elements in Xj lies in the cycle βi with j ∈ Yi in such a way that the distance between 2 consecutive elements is the same. Assume by contradiction that this is not the case for some Xj0 , then if we let d0 be the smallest distance between 2 elements of Xj0 that lies in the cycle βi0 , we will have βid00 = Z.T = (y1 , y2 , . . . , yl , a, b, x, x1 , x2 , . . . , xk ).T , where a, b ∈ Xj0 while x ∈ Xj1 , j1 6= j0 . Here Z and T are products of distinct terms in the cycle decomposition of βid00 . p p Q Q First, we have h0 = α. βi ∈ G, so βi .α ∈ G. Therefore, α. p Q βi . i=0 p Q i=0 βi .α = α i=0 p Q i=0 βi2 α ∈ G. Again, we get α2 i=0 In a similar manner,we will get L = αd0 p Q p Q βi2 ∈ G. i=0 βid0 ∈ G. i=0 Hence, L1 = (a, b)α d0 p Y βid0 (a, b) i=0 d0 = (a, b)α (a, b).(y1 , y2 , . . . , yl , b, a, x, x1 , x2 , . . . , xk )T. Y βid0 ∈ G. i6=i0 As a result, d0 LL−1 1 = α (y1 , y2 , . . . , yl , a, b, x, x1 , x2 , . . . , xk )· (xk , . . . , x2 , x1 , x, a, b, yl , . . . , y2 , y1 )(a, b)α−d0 (a, b) = αd0 (x, b, a)(a, b)α−d0 (a, b) ∈ G Hence, (a, b)α−d0 (a, b)αd0 (x, b, a) = α1 (x, b, a) ∈ G with α1 ∈ SXj0 . If j1 > 0, then let Σ0 = Xj0 ∪ Xj1 . Applying lemma 5 for the partition {Σ \ Σ0 , Xj0 , Xj1 }, we get AΣ0 ⊂ G. For σ ∈ SΣ0 and h ∈ G, if σ is an even permutation, σhσ −1 ∈ G because AΣ0 ⊂ G. Otherwise, if σ is an odd permutation, σhσ −1 = σ(a, b)(a, b)h(a, b)(a, b)σ −1 ∈ G because 32 (a, b)h(a, b) ∈ G, and σ(a, b) ∈ AΣ0 ⊂ G. Therefore, G has M -property wrt P0 = {Xi , Xj0 ∪ Xj1 }i6=j0 ,j1 . Now if j1 = 0 instead, then we get A{x}∪Xj0 ⊂ G. By a similar argument as above, we get σhσ −1 ∈ G ∀h ∈ G, σ ∈ S{x}∪Xj0 . Hence, G has M -property wrt P0 = {X0 \ {x}, {x} ∪ Xj0 , Xi }i6=j0 >0 . In either cases, P0 > P, and the first statement in the lemma holds, and this contradicts with our initial assumption. In a similar manner, we can prove that all elements of Xj with j ∈ Yi appear in the cycle βi by using the identity: (y1 , y2 , . . . , yl , a, x, x1 , x2 , . . . , xk )(xk . . . , x2 , x1 , x, b, yl · · · y2 , y1 ) = (x, b, a) , for a, b ∈ Xj , and x ∈ Xj1 6= Xj . As a result, for all h ∈ H, the M -decomposition of h is h = α.β0 . p Q βi i=1 with the associated partition Q = {Y1 , . . . , Yp } of {1, 2, . . . , m0 }(m0 ≤ m) such that all elements of Xj appear in βi , and the distance between any 2 elements of Xj in this cycle is the same and is dj ∀j ∈ Yi . Then there exists h0 , which is a conjugate of h by an element in m Q SXi , i=1 such that the cycle βi (1 ≤ i ≤ p) in the M -decomposition of h0 contains all elements Xj with j ∈ Yi which are in an increasing order and the distance between any 2 elements in Xj is the same and is dj (j ∈ Yi ). Therefore, if P k , t ≤ |X0 |. βi contains k elements and t elements in X0 , then k = t + dj j∈Yi P 1 (with t terms k1 ). By lemma 10, Therefore, we get 1 = k1 + . . . + k1 + dj j∈Yi Q Q for t ∈ 1, |X0 |, dj ≤ k t dj ≤ f (|Yi | + t, 1). j∈Yi j∈Yi Notice that the first element of Xj that is in the cycle βi must appear in the lth position for some l ∈ 1, dj , and subsequent element of Xj in βi is p Q determined by adding a multiple of dj to that first element. Therefore, βi i=0 33 of h0 has at most X |X0 |! · k=t+ k j∈Yi dj P Y dj ≤ |X0 |! X0 X f (|Yi | + t, 1) = f1 (|Yi |, |X0 |) t=0 j∈Yi possible forms. Q Therefore, h0 = α0 .T where α0 ∈ m i=1 SXi so that T = can only have ≤ p P Q |X0 |! f1 (|Yi |, |X0 |) = g(X0 , µ) ≤ max g(X0 , µ) = g1 (X0 , m) µ⊂{1,2,...,m} Q={Y1 ,...,Yp } i=1 possible forms, where Q is a partition of some subset µ of {1, 2, . . . , m}. Now for h, k ∈ H, we say that h ∼ k if the correponding h0 = αh .T and Q k 0 = αk .T for some αh and αk ∈ m i=1 SXi . So we have at most g1 (X0 , m) equivalent classes in H. Consider a particular equivalent class C and h0 ∈ C. Suppose G has Q M -property wrt P, and h0 , k ∈ G for some k ∈ C, then αh0 αk−1 = i∈J xi ∈ Q i∈J SXi ∈ G with xi 6= 1. Then AXi ⊂ G for all i ∈ J . Let J0 = Qm Qm {i0 such that ∃k so that αh0 αk−1 = i=1 SXi so that xi0 6= 1}. i=1 xi ∈ Then G needs to contain at most m elements k 6= h0 ∈ C so that A{ Xi } ⊂ Q G ∀i ∈ J0 . Because elements xi from the product αh0 αk−1 = m i=1 xi ∈ Qm i=1 SXi can be odd permutations, we will need at most other m elements k 0 ∈ C so that if G contains these k and k 0 together with h0 , then G will contain C . Therefore, if G is some subgroup that has M -property wrt P, then G just needs to contain at most (2m + 1) elements in an equivalent class C to contain all elements in this class. As a result, there exists K ⊂ H |K| ≤ (2m + 1)g1 (X0 , m) = φ(X0 , m) such that if G contains K, then G contains H. Lemma 12. (Generalization of lemma 6) There exists a function ψ = ψ(k, l) such that for any partition P = {X0 , X1 , . . . , Xm } of {1, 2, . . . , n} with |Xi | ≥ 4 ∀i = 1, m, and any subset H ⊂ Sn , there exists a subset K ⊂ H such 34 that |K| ≤ ψ(|X0 |, m) and that any subgroup G with M -property wrt P that contains K also contains H. Proof. Consider ψ(k, l) = φ(k, l) + k + l, where the function φ is defined in lemma 11 Let P0 = P, and start with an empty set K0 . For i ≥ 0, if we have partition Pi and there exists some hi ∈ H such that any group G that has M -property wrt Pi containing hi also has M -property wrt Pi+1 with some Pi+1 > Pi , we will add that hi to K0 . Because the longest chain of increasing paritions has size |X0 | + m, |K0 | ≤ |X0 | + m. Suppose that G is some subgroup of Sn that has M -property wrt P|K0 | . Because P|K0 | is the final partition obtained from the previous process, there is no partition Q = {Q0 , Q1 , . . . , Qm0 } > P|K0 | of {1, 2, . . . , n} such that there is some h ∈ H so that any group G that has M -property wrt P|K0 | containing h also has M -property wrt Q. Therefore, by lemma 11, there exist K1 ≤ H with |K1 | ≤ φ(|X0 |, m) so that any G that has M -property wrt P|K0 | and contains K1 also contains H. Now consider any G ≤ Sn containing K0 ∪ K1 and has M -property wrt P . Because K0 ⊂ G, G must have M -property wrt P|K0 | . Now because G contains K1 , G must contain H. Finally, we have |K0 ∪ K1 | ≤ |K0 | + |K1 | ≤ |X0 | + m + φ(|X0 |, m) = ψ(|X0 |, m), so we can finish the proof here. Definition 8. For a partition P = {X0 , X1 , . . . , Xm } of {1, 2, . . . , n}. A subgroup I ≤ Sn has SP-property wrt P if given any m transpositions si ∈ m Q SXi for i ∈ 1, m, for any s ∈ SXi , there exists t ∈ {0, 1} so that s · i=1 Qm t t=1 st ∈ I. It is obvious that if I 0 has SP-property wrt P, and I 0 ≤ I ≤ Sn , then I also has SP-property wrt P Given a subgroup I ≤ Sn with SP-property wrt P, we define G(I, K, P) to be the subgroup of Sn that is generated by xkx−1 with x ∈ I, k ∈ K. 35 Lemma 13. Assume P = {X0 , X1 , . . . , Xm }, m ≥ 1, is a partition of {1, 2, . . . , n}, and X is a subset of ∪m i=1 Xi such that |X| = k, and |Xi \ X| ≥ 4 ∀i ∈ 1, m. Moreover, assume that I ≤ Sn has SP-property wrt P. Then there exists K ⊂ H, with |K| ≤ k(m + |X0 |) such that there exists {gh }h∈H ⊂ G(I, K, P) so that ∀h ∈ H, gh h fixes all points in X. Proof. We prove by induction on k ≥ 0. For k = 0, there is nothing to prove. Suppose the statement is true for k − 1 (k ≥ 1). We prove that it is also true for k. Consider a point x ∈ X. Applying the induction hypothesis on k−1 for X \{x}, there exists K1 ⊂ H, with |K1 | ≤ (k−1)(m+|X0 |) such that there exists lh = gh h fixed all points in X \ {x}. Here {gh }h∈H ⊂ G(I, K1 , P) Consider the set S = {lh (x), h ∈ H, lh (x) 6= x}, which is the set of points 6= x that lh maps x to. For s, t ∈ S, we say that s ∼ t if s and t are in the same Xi for some i ≥ 1. Then we have t ≤ m + |X0 | equivalent classes in S. Now suppose that {si }ti=1 are representatives of these equivalent classes such that lki (x) = si . Let K2 = {ki }ti=1 ⊂ H. We will prove that K = K1 ∪K2 is the set K that we need to find. First notice that |K| ≤ |K1 | + |K2 | ≤ (k − 1)(m + |X0 |) + (m + |X0 |) = k(m + |X0 |) For h ∈ H such that lh (x) = x, then lh (x) fixes all points in X, and we have gh h = lh fixes all points in X with gh ∈ G(I, K1 , P) ≤ G(I, K, P). We now prove that for other h ∈ H, there exists mh = glki g −1 for some i ∈ 1, t, and some g ∈ I such that m−1 h lh fixes all points in X. Consider h ∈ H such that lh (x) 6= x. Assume that lh (x) = sh ∼ si for some i ∈ 1, t. If sh = si , then choose mh = lki , and we will have m−1 h lh fixes x and all points in X \ {x}. We suppose that sh 6= si are in some same set Xj (1 ≤ j ≤ m). First, sh and si 6∈ X \ {x} because lh and lki don’t fixes sh and sj . Now choose two other elements yj 6= zj 6= sh , si ∈ Xj \ X, and yt 6= zt ∈ Xt \ X for 1 ≤ t 6= j ≤ m (yj , zj , yt , and zt exist because |Xi \ X| ≥ 4). 36 By definition, nh = (sh si ) · m Q (yt zt )t ∈ I for some t ∈ {0, 1}. As a result, t=1 mh = nh lki n−1 h = nh lki nh will still fixes all points in X \ {x} because sh , si 6∈ X \ {x}, and yt , zt 6∈ X \ {x} for t ∈ 1, m. Furthermore, mh maps x to sh , and therefore m−1 h lh fixes all points in X. −1 Now note that we have m−1 h lh = mh gh h = uh h fixes all points in X. −1 −1 −1 Moreover, uh = m−1 h gh = nh lki nh gh = nh gki nh nh ki nh gh ∈ G(I, K, P) be−1 cause nh gki n−1 h and gh ∈ G(I, K1 , P) ⊂ G(I, K, P), and nh ki nh ∈ G(I, K2 , P) ⊂ G(I, K, P). Therefore, K is the set that we need to find to finish the induction step on k and, therefore, to finish the proof. Definition 9. Let P = {X0 , X1 , . . . , Xm } be a partition of {1, 2, . . . , n}, and I be a subgroup of Sn that has SP-property wrt P. We say that G ≤ Sn has K-property wrt P and I if xgx−1 ∈ G ∀g ∈ G, x ∈ I. Lemma 14. There exists a function ω = ω(u, v) so that for any partition P = {X0 , X1 , . . . , Xm } of {1, 2, . . . , n} with |Xi | ≥ 6 ∀i ∈ 1, m, any subgroup I ≤ Sn that satisfies SP-property wrt P, and subset H ⊂ Sn , there exists a subset K ⊂ H such that |K| ≤ ω(|X0 |, m) and that any subgroup G with K-property wrt P and I that contains K also contains H. Proof. By lemma 12, there exists a function ψ(k, l) so that for any partition P0 = {X0 , X1 , . . . , Xm0 } of {1, 2, . . . , n} with |Xi | ≥ 4, and any subset U ⊂ Sn , there exists a subset V ⊂ U with |M | ≤ ψ(|X0 |, m) such that any subgroup G ≤ Sn that has M -property wrt P and contains V also contains U . Then we define ω(k, l) = ψ(k, l) + 2l(k + l) for k, l ∈ Z ≥ 0. Now consider any subset H ⊂ Sn . Let X = ∪m i=1 {xi , yi }, in which xi and yi are two fixed elements of Xi . By lemma 13 for H, X, and partition P, there exists K1 ⊂ H with |K1 | ≤ |X| · (m + |X0 |) = 2m(m + |X0 |) such that ∀h ∈ H, gh h fixed all points in X for some gh ∈ G(I, K1 , P). Let H 0 = {gh h, h ∈ H}. Then by definition of ψ, there exists a subset 37 K 0 ⊂ H 0 with |K 0 | ≤ ψ(X0 , m) so that any subgroup G ≤ Sn with Mproperty wrt P that contains K 0 also contains H 0 . We can assume that K 0 = {gki ki }ti=1 for some ki ∈ H and t ≤ ψ(|X0 |, m). Now let K = K1 ∪ {ki }ti=1 . We will prove that K is the subset of H that we need to find. Suppose that G0 is the subgroup of Sn that is generated by gk 0 g −1 with m Q k 0 ∈ K 0 and g 0 ∈ SXi . Then G0 has M -property wrt P and also contains i=1 K 0 . Therefore, G0 contains H 0 . Q Now for each generator l = gl gki ki gl−1 of G0 with gl ∈ m j=1 SXi . By m Q definition of I, there exists t ∈ {0, 1} such that nl = gl · (xt yt )t ∈ I. Because gki ki ∈ H fixes xj and yj , nl gki ki n−1 l t=1 m m Y Y t = gl ( (xt yt ) gki ki (xt yt )t )gl−1 = gl (gki ki )gl−1 = l t=1 t=1 As a result, l ∈ G(I, K, P) because gki ∈ G(I, K1 , P) ⊂ G(I, K, P), and ki ∈ K ⊂ G(I, K, P). Therefore, G0 ≤ G(I, K, P), and so H 0 ⊂ G(I, K, P). Then for any h ∈ H, gh h ∈ H 0 ⊂ G(I, K, P), and because gh ∈ G(I, K1 , P) ⊂ G(I, K, P), h ∈ G(I, K, P). Hence H ⊂ G(I, K, P). Finally, any subgroup of Sn with K-property wrt P and I that contains K also contains G(I, K, P) and, therefore, contains H. Because |K| ≤ |K1 |+t ≤ 2m(m + |X0 |) + ψ(|X0 |, m) = ω(|X0 |, m), we finish our proof here. Lemma 15. Suppose that H ≤ S2 o Sm , and ∀n ≥ n0 , if K 6= An ≤ Sn , then m(K) ≤ n − k + 1. Then for all m ≥ max{n0 , k + 1}, m(H) ≤ 2m − k Proof. By Whiston’s lemma, we can assume that there is an irredundant generating set {g1 , . . . , gl } with l = m(H) such that {g1 , . . . , gr } generates block permutation, and {gr+1 , . . . , gl } ⊂ S2m . Case 1: The subgroup generating block permutation and generated by {g1 , . . . , gr } doesn’t act as Sm or Am on m blocks, then r ≤ m − k + 1. 38 If K = {gr+1 , . . . , gl } doesn’t generate the whole vector space S2m = F2m , l − r ≤ m − 1. Hence, m(H) = l ≤ m − k + 1 + m − 1 = 2m − k. Now suppose K generates the whole vector space F2m . Take some gi that is not (1, 1, . . . , 1). Then there is some entry 0 of gi , and WLOG, assume that there is one entry 0 on gi ’s last coordinate. Also, WLOG, assume that 1 appears in the first coordinate of gi . Because H is transitive, there exists h generated by g1 , . . . , gr that moves mth block to the first block. Hence h−1 gi h P will have the last entry turned to 1 and therefore is of the form αj gj with some αj 6= 0 and j 6= i. Hence {g1 , . . . , gˆj , .., gl } generates the whole space. This is impossible because the original set {g1 , . . . , gl } must be irredundant. Case 2: The subgroup generating block permutation and generated by {g1 , . . . , gr } acts as Sm or Am on m blocks. Then, since F2 is abelian, for any element gi , after performing an even permutation on the coordinates of gi , the new vector will be generated by {g1 , . . . , gk } and gi . Now, WLOG, suppose that the element gk+1 of {gk+1 , . . . , gl } = (1, , . . . , 1, 0, . . . , 0) 6= (1, 1, , . . . , 1). First permute 2 zero entries or 2 one entries, if any, of gk+1 , and then move the first entry, which is 1, to the position of the first zero entry. Hence, we get the new vector of the form (0, 1, . . . 1, 0, . . . , 0) that is generated by {g1 , . . . , gk+1 } . Continue doing this until we get the set of vectors (0, ..0, 1, ..1, 0, .., 0) with i first zero entries for any i. Therefore, by using only {g1 , . . . , gk }, and gk+1 , we can already cover the subspace {(x1 , . . . , xm ) : x1 + . . . + xm = 0} of F2m . To generate the whole space, we only need at most 1 more vector. So, in total, we only need ≤ 2 elements gi together with {g1 , . . . , gk } to generate all elements in K. Therefore m(H) = l ≤ m − 1 + 2 = m + 1 ≤ 2m − k for m ≥ k + 1. Notation 2. For any direct product G = Qk i=1 Gi for some finite group Gi , πi : G → Gi denotes the projection map from G to its factor Gi , and j Q π{i1 ,i2 ,...,ij } : G → Git denotes the projection map from G to the product of t=1 its factors Git for t = 1, j. Note that πi = π{i} . 39 In particular, for g = k Q gt ∈ G with gi ∈ Gi , πi (g) = gi , and t=1 π{i1 ,i2 ,...,ij } (g) = j Q git . t=1 If H is a subset or subgroup of G, πi (H) denotes the image of H under the projection map πi . Similarly, we also have πi1 ,i2 ,...,ij (H). Lemma 16. Let H be a subgroup of G = k Q Gi for some finite group Gi , and i=1 let m(H) = m. Assume also that πi : G → Gi be the projection map from G k k Q P to its factor Gi . Then there exists Hi ⊂ Gj ∩ H, so that m = |Hi | ≤ j=i k P i=1 m(Ti ), Ti = πi (hHi i). (πi is defined in notation 2) i=1 Proof. Suppose K = {h1 , . . . , hm } is an irredundant generating set of H. Let H1 be the smallest subset of K0 = K = {h1 , . . . , hm } such that π1 (H1 ) generates T1 = π1 (H). Then π1 (H1 ) is an irredundant generating set of T1 , and so |H1 | ≤ m(T1 ). Then there exists gi generated by H1 such that h0i = k Q gi hi with i > r and π1 (h0i ) = 1. As a result, hK1 i = h{h0i , i > r}i ≤ Gi . i=2 The set K1 is irredundant because K is irredundant. Now take H2 to be the smallest subset of K1 that generates T2 = π2 (hK1 i) ≤ G2 . So π2 (hK1 i) = π2 (hH2 i). Then we will again have an irredundant set K2 so that π1 (K2 ) = π2 (K2 ) = 1. We continue this process to build Hi ⊂ Ki−1 that generates πi (hKi−1 i) ≤ Gi . From this, we will have an irredundant set Ki that are built from remaining hi : Ki = {tj hj , tj ∈ hX1 ∪ . . . ∪ Xi i that fixes first i factors or π1 (Ki ) = . . . = πi (Ki ) = 1}. Since Ki must be irrek P dundant, Kk must be an empty set. As a result, we have m = |Xi | ≤ i=1 k P i=1 m(πi (hHi i)) = k P m(Ti ). i=1 Now using previous results, we will try to characterize elements that can be in an irredundant generating set of length n − 3, n − 4, or n − 5 in Sn 40 Theorem 7. For k ≤ 7, there exists function Ψ such that m(H) = m ≤ n−k for any transitive subgroup H of Sn that is not either An or Sn with n ≥ Ψ(k) Proof. Now we will define Ψ(k) recursively: Ψ(1) = 1. Ψ(k) = max{2Ψ(k − 1) · (k − 1), (k + max ω(x, y)) · (k − 1), n0 , k 2 } x≤Ψ(k−1) y≤3 for k ≥ 2, where ω is defined in lemma 14 First, by lemma 3, for n ≥ Ψ(k) ≥ n0 , m(H) ≤ n 2 ≤ n − k (n ≥ k 2 ≥ 2k) if H is primitive subgroup of Sn . So we only need to handle the case when H is an imprimitive but transitive subgroup of Sn . Therefore, we can assume that H ≤ SΓ o S∆ (n = |Γ||∆|, |Γ|, |∆| ≥ 2) By Whiston’s lemma, if {g1 , g2 , . . . , gm } is an irredundant generating set of H, then we can asssume that {g1 , . . . , gl } generates block permutation |∆| Q while {gl+1 , . . . , gm } is an irredundant set in SΓ . So l ≤ |∆| − 1. i=1 We will prove that for n ≥ Ψ(k), m(H) = m ≤ n − k by induction on 1 ≤ k ∈ Z ≤ 9. If k = 1, then it is true from Whiston’s paper. Suppose that the statement is true for k − 1, we prove that it is true for k (k ≤ 7) Consider n ≥ Ψ(k). Suppose by contradiction that we have an imprimitive but transitive subgroup H ≤ SΓ o S∆ so that n = |Γ||∆|, and m(H) > n − k. Q By lemma 16 for K = h{gl+1 , . . . , gm }i ≤ |∆| i=1 SΓ , there exists Ki ⊂ |∆| k Q P Gj ∩ K. so that m − l ≤ m(Ti ) with Ti = πi (hKi i) ≤ SΓ . Here πi is i=1 j=i the projection from K to ith copy of SΓ (defined in notation 2) If K acts as SΓ or AΓ on Γi for some i ∈ 1, |∆|. Then, by lemma 2, we have m(H) ≤ |Γ|+2|∆|−3 = n−(|Γ|−2)(|∆|−1)−1 ≤ n−(k−1)−1 = n−k for n = |Γ||∆| ≥ k 2 − 1 and |Γ| > 2. If |Γ| = 2 then |∆| ≥ Ψ(k − 1), and by lemma 15, m(H) ≤ n − k. Therefore, we can suppose that K cannot acts as SΓ or AΓ on Γi , or 41 πi (K) 6= SΓ or AΓ ∀i ∈ 1, |∆|. Then Ti ≤ πi (K) 6= SΓ , and, therefore, m(Ti ) ≤ |Γ| − 2 because of the strongly flatness of SΓ . As a result, m(H) = m = l +m−l ≤ |∆|−1+|∆|(|Γ|−2) = n−|∆|−1 ≤ n − k if |∆| ≥ k − 1. So we must have 2 ≤ |∆| < k − 1. As a result, |Γ| ≥ 2Ψ(k − 1), and |Γ| ≥ max ω(x, y) + k x≤Ψ(k−1) y≤3 Lemma 17. For i ∈ 1, |∆|, m(Ti ) ≤ |Γ| − 4 or Ti , and therefore, πi (K) has SP-property (defined in definition 9) wrt some partition P = {P0 , P1 , . . . , Pk } of ζ = {1, 2, . . . , |Γ|} with |P0 | < Ψ(k − 1) and k ≤ 3. Proof. Suppose that for some i0 ∈ 1, |∆|, m(Ti0 ) = t ≥ |Γ| − 3, and we have an irredundant generating set U0 = {u1 , u2 , . . . , ut } of Ti0 . Start with an empty collection of disjoint subsets of ζ = {1, 2, . . . , |Γ|}, χ. There exists a partition Q1 = {R1 , R2 , . . . , Rk1 } of ζ so that U0 and Ti0 k1 Q are subsets of SRi , and Ti0 acts transitively on each Ri . By lemma 16, i=1 m(Ti0 ) ≤ |Γ| − k1 , and so k1 ≤ 3. WLOG, assume that |R1 | = min |Ri |, i∈1,k1 and add R1 = L1 to χ. Moreover, assume that V1 = {u1 , . . . , ur } (r ≤ t) so k1 Q that π1 (V1 ) generates π1 (U0 ), where π1 : SRi → SR1 is the projection map i=1 defined in notation 2. Then there exists an irredundant set U1 = {gi ui }i>r ⊂ Sζ\R1 with gi generated by {u1 , . . . , ur }. If k1 ≥ 2, there exists a partition Q2 = {R10 , R20 , . . . , Rk0 2 } of ζ \ L1 so that k2 Q U1 ⊂ SRi0 , and the subgroup generated by U1 acts transitively on each Ri . i=1 Assume again that R10 has the smallest size among Ri0 , and add R10 = L2 to χ. If k2 ≥ 2, continue this process as before to get V2 ⊂ U1 that generates k1 Q π1 (U1 ), where π1 : SRi0 → SR10 is the projection map defined in notation 2, i=1 and an irredundant set U2 ⊂ Sζ\(L1 ∪L2 ) . We will continue this process as long as ki ≥ 2 in step i. The process cannot reach L4 because otherwise, m(Ti0 ) ≤ 3 P i=1 42 |Vi | + m(hU4 i) ≤ 3 P (|Li | − 1) + |ζ \ ∪3i=1 Li | − 1 = n − 4. Contradiction. i=1 As a result, we get the partition χ = {L1 , . . . , Lu } of ζ so that Ui ⊂ Qu SLj is an irredundant set, and the group generated by Ui acts transij P Q tively on Li . Moreover, m(Ti0 ) ≤ m(πi (Ui )), where πi : uj=1 SLj → SLi j=i i=1 is the projection map defined in notation 2. From the choice of Li , we also |Γ| get |Lu | ≥ u−1 2 u P We have m(Ti0 ) ≤ (|Li | − 1) = |Γ| − u. So u ≤ 3. i=1 If u = 3, then |Γ| − 3 ≤ m(Ti0 ) ≤ 3 P m(πi (Ui )) ≤ i=1 3 P (|Li | − 1) = |Γ| − 3. i=1 Hence the equality holds, and πi (Ui ) = SLi and therefore, SL1 × SL2 × SL3 ⊂ Ti0 , and so Ti0 has SP-property wrt the partition {P0 , L1 , L2 , L3 }, where P0 is an empty set. |Γ| ≥ Ψ(k − 1). By induction hypothesis on 2u−1 k − 1 for U2 ≤ SL2 , we must have AL2 ⊂ U2 because otherwise, m(π2 (U2 )) ≤ If u = 2, then |L2 | ≥ |L2 | − k, and so m(Ti0 ) ≤ |Γ| − k. As a result, m ≤ |∆| − 1 + |Γ| − k + (|∆| − 1)(|Γ| − 2) = n − k + 1 − |∆| < n − k. Contradiction. If |L1 | ≥ Ψ(k − 1), then we also have AL1 ≤ π1 (U1 ), and therefore Ti0 satisfies SP- property wrt the partition {P0 , L1 , L2 }, where P0 is empty. Otherwise, Ti0 satisfies SPproperty wrt the partition {P0 , L2 }, where P0 = L1 and has size less than Ψ(k − 1). Now come back to the proof of theorem 7. If m(Ti ) ≤ |Γ| − 4 ∀i ∈ 1, |Γ|, then m ≤ |∆| − 1 + |∆|(|Γ| − 4) = n − 3|∆| − 1 ≤ n − 7 ≤ n − k. Otherwise, by lemma 17, there is some Ti0 that has SP-property wrt some partition of P = {P0 , P1 , · · · , Pq } of {1, 2, . . . , |Γ|} (q ≤ 3) WLOG, suppose that i0 = 1. Suppose that T1 = {gl+1 , . . . , gr } such that {π1 (gt )}rt=l+1 generates G = π1 (K). Suppose further that T = {hi gi , i > r, hi generated by T1 } is the set 43 that fixes Γ1 pointwise. By lemma 14, there exists T 0 ⊂ T with |T 0 | ≤ ω(|P0 |, q) so that any subgroup G with K-property wrt P and G that contains π2 (T 0 ) also contains π2 (T ) ⊂ SΓ . WLOG, suppose T 0 = {hi gi }si=r+1 , with S ≤ ω(|P0 |, q). There exist γ generated by {g1 , . . . , gl } that moves block 1 to block 2. Then π2 (γgγ −1 ) = xπ1 (g)x−1 ∀g ∈ H. By renaming elements in the second copy of Γ, Γ2 , we can assume that x = 1, and therefore, π2 (γgγ −1 ) = π1 (g). Now consider the group M = N ∩ |∆| Q SΓi , where N = h{g1 , . . . , gs }i. i=1 Now suppose πi : |∆| Q SΓi → SΓi is the projection map defined in nota- i=1 tion 2. From our previous observation, if g = π1 (tg ) ∈ G for some tg ∈ T1 , then |∆| Q π2 (mg ) = π2 (γtg γ −1 ) = π1 (tg ) = g (mg ∈ SΓ ). Therefore, for m ∈ M i=1 −1 −1 with π2 (m) = t, mg mm−1 g also in M , and π2 (mg mmg ) = gtg . Therefore π2 (M ) has K-property wrt P and G. π2 (M ) contains π2 (T 0 ), and, therefore, π2 (M ) must contain π2 (T ). As a result, there exists T2 = {ht gt , t > s} that fixes both Γ1 and Γ2 pointwise, in which ht generated by {g1 , .., gs }}. By a similar argument as before, we get m(H) = m = l + r − l + s − r + m − s ≤ |∆| − 1 + |Γ| − 1 + ω(|P0 |, q) + (|∆| − 2)(|Γ| − 2). Since ω(|P0 |, q) ≤ max ω(x, y) ≤ |Γ| − k, m(H) ≤ |∆| − 1 + |Γ| − 1 + x≤Ψ(k−1) y≤3 |Γ| − k + (|∆| − 2)(|Γ| − 2) = n − |∆| − k + 2 ≤ n − k. Contradiction. As a result, m(H) ≤ n − k, and we finish the proof by induction on k. Definition 10. For a cycle c = (u1 u2 . . . us ) ∈ Sn with ui ∈ {1, 2, . . . , n}, we define d(c) = s − 1. For x ∈ Sn , we write the cycle decomposition of k P x = c1 .c2 . . . ck , where ci is one cycle, and then define d(x) = ci . i=1 Theorem 8. Given a positive integer k ≤ 5 and n ∈ N such that n ≥ Ψ(k + 44 2), where Ψ is the function defined in theorem 7. Suppose that {h1 , h2 , . . . , hn−k } is an irredundant generating set of Sn of length n − k. Then d(hi ) ≤ k + 1. Moreover, if d(hi ) = k + 1, then hi must be an even permutation. Proof. Let Gi be the proper subgroup of Sn generated by {hi }i6=j . Then, by theorem 7, if Gi 6= An , then Gi has to be intransitive, because otherwise, Gi will have m less than n − k − 1. Note that there is at most one i so that Gi = An . Now consider a graph Ω on the set of vertices Σ = {1, 2, . . . , n}. For each i ∈ 1, n − k such that Gi is intransitive, there exists x and y in Σ so that hi maps x to y such that x and y are not in the same Gi -orbit. Such x, y exists because if x, y are in the same Gi -orbit whenever hi maps x to y, then the orbits of G are the same as the orbits of Gi . Contradiction since Gi is transitive while G is not. Now take hi1 with any i1 ∈ 1, n − k, write the cycle decomposition of hi1 , and represent each cycle (u1 , u2 , . . . , uk ) in terms of product of k − 1 transpositions (ut−1 , ut ). We add edges that connect ut−1 to ut ∈ Σ to the graph Ω to create new graph Ω0 . Let E(Gr) be the number of edges in a graph Gr. If there is hi0 so that Gi0 = 1, then E(Ω) = n − k − 1, and   n − k − 1 + d(h ) − 1 if i 6= i i1 1 0 0 E(Ω ) =  n − k − 1 + d(hi ) if i1 = i0 1 Note that in this case, hi with i 6= i0 will be in An and is therefore, an even permutation. If there is no hi0 so that Gi0 = 1, then E(Ω) = n − k, and E(Ω0 ) = n − k + d(hi1 ) − 1. Therefore, E(Ω0 ) ≥ n − k + d(hi1 ) − 2, and the equality holds only if i1 6= i0 , and hi1 ∈ An . Now we prove that Ω0 is a forest. Suppose that there is a cycle in Ω0 . If 45 Therefore, edges that can be in this cycle are edges (ui−1 , ui ) that correponds to the cycle decomposition of H. But clearly, the edges are union of straight lines with k − 1 edges (ui−1 , ui ) that correspond to cycles (u1 , u2 , . . . , uk ). Therefore, they cannot create a cycle. As a result, Ω0 is a forest, and E(Ω0 ) ≤ n − 1. Therefore, either n − k + d(hi1 ) − 1 ≤ n − 1 or n − k + d(hi1 ) − 2 ≤ n − 1, and hi1 ∈ An . In other word, d(hi1 ) ≤ k or d(hi1 ) = k + 1 and hi1 must be an even permutation. Lemma 18. Given n ∈ N ≥ 3k + 3. Suppose that x ∈ Sn such that d(x) ≤ k or x ∈ An and d(x) = k + 1, with k odd. Then there exists an irredundant generating set of Sn of length n − k that contains x. Proof. By renaming elements of Σ = {1, 2, . . . , n}, we can assume that x = m Q ci , where ci is the cycle (di + 1, di + 2, . . . , di+1 ), where d1 = 0, and i=1 d(x) = m P (di+1 − di − 1) = dm+1 − m. Here i=1 Suppose that d(x) ≤ k. Now consider the set H that includes x, m − 1 transpositions (di+1 , di+1 + 1) for i = 1, m − 1, l −dm+1 other transpositions {(t, t+1)}l−1 t=dm+1 , and finally a cycle (l, l + 1, . . . , n) with n − k ≤ l = n − k + d(x) − 1 ≤ n − 1. Note that dm+1 = m + d(x) ≤ 2d(x) ≤ 2(k + 1) ≤ n − k − 1 < l, so we have at least 1 transposition of the form {(t, t + 1)}l−1 t=dm+1 . Then H has 1 + m − 1 + l − dm+1 + 1 = l + 1 − d(x) = n − k elements. If we remove one transposition (u, u + 1) in H or the cycle (l, l + 1, . . . , n), then the subgroup generated by the remaning elements cannot map u to u+1 or l to l + 1. If we remove x then it cannot even map 1 to 2. Therefore, H is irredundant. Because x and the first m − 1 transpositions (di+1 , di+1 + 1) generate a single cycle that includes all elements from 1 to dm+1 , and, therefore, together with the transposition (dm+1 , dm ) will generates the whole S{1,2,..,dm+1 } . As a result, H will generate Sn , and so H an irredundant generating set of length 46 n − k of Sn that contains x. Now for even permutation x with d(x) = k + 1, we consider the set K that includes x, the transposition (1, 2), m − 1 products of 2 transpositions (1, 2) · (di+1 , di+1 + 1) for i = 1, m − 1, n − dm+1 = n − m − k − 1 other products of 2 transpositions {(1, 2) · (t, t + 1)}n−1 t=dm+1 By a similar argument, K is also an irredundant generating set of length n − k of Sn that contains x, and we finish the proof for lemma 18. Corollary 2. Given a positive integer 1 ≤ k ≤ 5 and a natural number n so that n ≥ max{Ψ(k + 2), 3k + 3}, where Ψ is the function defined in theorem 7. Then ιn−k (Sn ) = {x ∈ Sn : d(x) ≤ k} ∪ {even permutation x : d(x) = k + 1, k odd}. Here ιm (G) is the set of elements in a finite group G that lies in some irredundant generating set of length m of G. Proof. This follows from theorem 8 and lemma 18. 4. 4.1. Dimension-like invariants of wreath product Computing m of wreath product of simple group and 2-transitive permutation group Lemma 19. (Goursat’s lemma for simple group) Let S be a simple group, and K be a subdirect product of S 2 . Then either K = S 2 or K = {(s, φ(s)), s ∈ S}, for some automorphism φ of S. Lemma 20. Let S be a non-abelian simple group, and K be a subdirect product of S n . If the projection πij : K → S 2 onto ith and jth coordinates is surjective for any i 6= j, then K = S n . Theorem 9. (P. Hall) Let S be a non-abelian simple group, and s1 , . . . , sn be n elements in S k . Then k coordinate of s1 × s2 × . . . × sn generates S n if and only if si generate S, and for any i 6= j, there is no automorphism of S that maps si component-wise into sj . 47 Theorem 10. Let S be a non-abelian simple group, and P 6= Z2 be a 2transitive permutation group. Then m(S) + m(P ) ≤ m(S o P ) ≤ m(S) + m(P ) + 1. Moreover, • If S doesn’t satisfy replacement property, then m(S oP ) = m(S)+m(P )+1 • If S satisfies replacement property, then m(S o P ) = m(S) + m(P ) Proof. For K ⊂ S n and 1 ≤ i 6= j ≤ n, let πi (K) ⊂ S be the image of the projection from K to the ith coordinate, and πij (K) ⊂ S 2 be the image of the projection from K to the ith and jth coordinates. Now assume that P is a 2-transitive subgroup of Sn for n > 2, and G = S o P = S n o P , where P acts on S n by permuting n copies of S. First, suppose that {s1 , . . . , sm(S) } is an irredundant generating set of S, and {p1 , p2 , . . . , pm(P ) } is an irredundant generating set of P . Let H = {s1 × (1S )n−1 , s2 × (1S )n−1 , . . . , sm(S) × (1S )n−1 , k1 , k2 , . . . , km(P ) }, where si × (1S )n−1 ∈ S n and ki = (1, si ) ∈ 1S n × P such that si acts on S n by purely permuting copies of S. It is easy to see that H is an irredundant generating set of S o P , and so m(S o P ) ≥ m(S) + m(P ) Suppose that m(G) = m(S o P ) = m, and take an irredundant generating set of length m, H = {h1 , h2 , . . . , hm }. Applying Whiston’s lemma for G and its normal subgroup S n , we can assume that images of H1 = {h1 , h2 , . . . , hr } in G/S n = P is an irredundant generating set of P , and hr+1 , . . . , hm ∈ S n . It is obvious that r ≤ m(P ) . Let G1 be the group generated by H1 . Now note that S n = G ∩ S n is generated by elements in the set X = X1 ∪ X2 = {ghi g −1 , i > r, g ∈ G1 } ∪ (G1 ∩ S n ) ⊂ S n . As a result, π1 (X) generates S, and so some subset of the set π1 (X) must be an irredundant generating set of S. Therefore, there exists Γ ⊂ X such that |Γ| ≤ m(S), and π1 (Γ) is an irredundant generating set of S. Consider all hi with i > r such that some ghi g −1 is in Γ. Since |Γ| ≤ m(S), there are at most m(S) such hi ’s. WLOG, we can assume 48 that those hi ’s are hr+1 , . . . , hl with l − r ≤ m(S). As a result, if we let K0 = hh1 , . . . , hl i ∩ S n , then π1 (K0 ) = S. Lemma 21. If K = L ∩ S n is some subgroup of S n such that H1 ⊂ L ≤ G, and π1 (K) = S, then either K = S n or K = {(s, φ2 (s), . . . , φn (s)), s ∈ S}, where φi is some inner automorphism of S. Proof. First we show that such K is a subdirect product of S n . For i ∈ 2, n, there exists σi ∈ G generated by H1 that move ith copy of S to the 1st copy. Suppose that σi = a.b, where a ∈ S n , and b is a pure permutation of copies of S. Then, for any k ∈ K, k 0 = σi−1 kσi is also in K, and so π1 (a)−1 π1 (k)π1 (a) = πi (k 0 ) ∈ πi (K). Therefore S = π1 (a)−1 π1 (K)π1 (a)−1 ⊂ πi (K) ∀i 6= 1. Hence, K is a subdirect product of S n . This means that πij (K) is also a subdirect product of S 2 . By Goursat’s lemma, either πij (K) = S 2 or πij (K) = {(s, φ(s)), s ∈ S} for some automorphism φ of S. Suppose that for all i 6= j, πij (K) = {(s, φ(s)), s ∈ S}. If π1i (K) = {(s, φi (s)), s ∈ S} for some automorphisms φi of S, then it is obvious that K = {(s, φ2 (s), . . . , φn (s)), s ∈ S}. For any i 6= j ∈ 1, n, choose k ∈ 1, n such that i, j 6= k. Note that K −1 −1 can also be rewritten as {φ−1 k (s), . . . , φk φk−1 (s), s, . . . , φk φn (s)), s ∈ S} or {(ψ1 (s), . . . ., ψk−1 (s), s, ψk+1 (s), . . . , ψn (s)), s ∈ S} for some automorphisms ψi of S. There exists σij ∈ G generated by H1 that moves jth copy to ith copy of S and doesn’t move the kth copy because P is 2-transitive. For any −1 0 h ∈ K, h0 = σij−1 hσij ∈ K with πk (h0 ) = aij πk (h)a−1 ij , and πj (h ) = bij πi (h)bij for some a = aij , b = bij ∈ S that only depends on σij . Because πj (h0 ) = ψj (πk (h0 )), bπi (h)b−1 = ψj (aπk (h)a−1 ) = ψj (a)ψj (πk (h))ψj (a)−1 . Hence if we −1 let cij = b−1 ψj (a), then πi (h) = cij ψj (πk (h))c−1 ij = cij πj (h)cij ∀h ∈ K. As a result, for any i 6= j ∈ 1, n, there exists cij ∈ S, πi (h) = cij πj (h)c−1 ij ∀h ∈ K. Therefore, for i > 1, φi is an inner automorphism such that φi (s) = ci1 sc−1 i1 . 49 Now suppose πi0 j0 (K) = S 2 for some i0 6= j0 ≤ n instead. Then because P is 2-transitive, by a similar argument as above, (axa−1 , byb−1 ) ∈ πij (K) for each (x, y) ∈ πi0 j0 (K) = S 2 . Hence, πij (K) = S 2 ∀i 6= j ≤ n. Then, by lemma 20, K must be S n . Now we come back to the proof of theorem 10. If K0 = S n , then m = l = r + l − r ≤ m(P ) + m(S). Otherwise, by lemma 21, K0 must be {(s, φ2 (s), . . . , φn (s)), s ∈ S} for some automorphisms φi . If m > l, then because of the irredundancy of {hi }, hl+1 6∈ K0 . Then K1 = hh1 , . . . , hl+1 i∩ S n is also a subdirect product of Sn . If K1 has the form {(s, φ02 (s), . . . , φ0n (s)), s ∈ S}, then because K0 ⊂ K1 , φi (s) = φ0i (s) for each s ∈ S. Hence K1 = K0 , and this is impossible since hl+1 ∈ K0 . Therefore, by lemma 21, K1 = S n , and so m = l + 1 = r + l − r + 1 ≤ m(P ) + m(S) + 1. If S doesn’t satisfy the replacement property, then there exists an irredundant generating set T = {t1 , t2 , . . . , tm(S) }, and a t ∈ S such that t cannot replace any ti in T . Consider the set H = {(t1 , t1 , . . . , t1 ), . . . , (tm(S) , tm(S) , . . . , tm(S) ), (t, 1, . . . , 1), p1 , . . . , pm(P ) }, where the first m(S) + 1 elements are in S n , and pi acts as pure permutations such that {pi } is an irredundant generating set of P . If we remove some (ti , ti , . . . , ti ), then we cannot even generate the first coordinate. Using this observation, it is easy to see that H is irredundant. Because P is transitive, H, in fact, generates H 0 = H ∪ {ui }ni=1 where ui = (1, 1, . . . , t, . . . , 1) ∈ S n such that t = πi (ui ). By P. Hall’s theorem, H 0 ∩ S n generates S n , and therefore H generates G. As a result, m(G) = m(P ) + m(S) + 1. Now suppose that S satisfies the replacement property. We will prove that m(S o P ) = m(S) + m(P ). Assume by contradiction that m(S oP ) = m(S)+m(P )+1. Then K0 must be {(s, φ2 (s), . . . , φn (s)), s ∈ S} for some inner automorphisms φi . Also, the set Γ we considered must be {gi hi gi−1 , i ∈ r + 1, l, gi ∈ G1 }, with l−r = m(S) 50 elements. Moreover, ∀i ∈ 1, n, the set of ith coordinates of these elements is an irredundant generating set of S. Therefore, WLOG, we can assume that the first coordinate of hl+1 6= 1S n is a non-identity element of S. Assume −1 further that we can replace first coordinate of gr+1 hr+1 gr+1 by that of hl+1 so that the first coordinates of elements in {gi hi gi−1 , i ∈ r + 2, l, gi ∈ G1 } ∪ {hl+1 } still generate S. Hence, if we let K1 = hh1 , . . . , hr , hr+2 , . . . , hl+1 i∩ S n , then π1 (K1 ) is still S. By lemma 21, we get K1 = {(s, φ02 (s), . . . , φ0n (s)), s ∈ S} for some inner automorphisms φ0i . Let si = π1 (gi hi gi−1 ) for i ∈ r + 1, l, and sl+1 = π1 (hl+1 ). Assume also 0 0 −1 0 that ∀s ∈ S, φi (s) = ci sc−1 i , and φi (s) = ci sci . First, we have that {sr+1 , sr+2 , . . . , sl } is an irredundant generating set of length m(S) in S. Suppose there is a proper subset I of J = {r + 2, . . . , l + 1} such that hsi ii∈I generates S. Then π1 (KI ) = S, with KI = h{h1 , h2 , . . . , hr } ∪ {hi }i∈I i ∩ S n . Hence KI = K1 , and for any i0 ∈ J \ I, hi0 ∈ h{hi }i6=i0 i. This is impossible because of the irredundancy of {hi }. Therefore, {sr+2 , . . . , sl+1 } is also an irredundant generating set of S. For k > 1, there is a σk generated by H1 that swap the 1st copy and the k copy. Hence, there exists ak and bk that depend only on σk such that for any −1 x ∈ S, and y = φk (x), σk (x, . . . , y, . . . )σk−1 = (ak ya−1 k , . . . , bk xbk , . . . ) ∈ K. Let a = ak , b = bk , and c = ack . Now we have the following observation. Lemma 22. Suppose that T = hH1 ∪ {hi }i∈I1 i is a subgroup of K0 for some subset I1 of J1 = {r + 1, . . . , l}. If there is some h ∈ T such that π1 (h) = x, then for any k ∈ Z ≥ 0, there exists h0 ∈ T such that π1 (h0 ) = ck xc−k . Proof. We will prove the statement by induction on k ∈ Z ≥ 0. For k = 0, the statement is trivial. Suppose the statement is true for k − 1 (k ≥ 1). We will prove that this is true for k. By induction hypothesis, for any h ∈ T such that π1 (h) = x, there exists 51 some h0 ∈ S n = (x0 , . . . , y 0 , . . . ) with x0 = ck−1 xc−k+1 and y 0 = φk (x0 ) = ck x0 ck−1 such that h0 ∈ T . Therefore, h00 = σk h0 σk−1 = (ay 0 a−1 , . . . , bx0 b−1 , . . . ) is also in T . −1 Note that π1 (h00 ) = ay 0 a−1 = ack x0 c−1 = cx0 c−1 = cck−1 xc−k+1 c−1 = k a ck xc−k . Hence, we can finish the induction step here. Now suppose that c 6= 1. Because {sr+1 , . . . , sl } is an irredundant generating set of length m(S) in S, and S satisfy replacement property, there exist j0 such that hc, {si }r+1≤i6=j0 ≤l i = S. Let K2 = hH1 ∪ {hi }r+1≤i6=j0 ≤l i ∩ S n is a subgroup of S n . By lemma 22, M = h{ck si c−k }r+1≤i6=j0 ≤l, k∈Z i must be a subgroup of π1 (K2 ). Because S is simple, S is exactly the set of elements x such that x can be represented as product of s and si in a way that the sum of exponents u in su term in this representation is 0. As a result, S is generated by generators of M , and so π1 (K2 ) = S = M . Again by lemma 21, we get K2 = {(s, φ002 (s), . . . , φ00n (s)), s ∈ S}. As a result, |K2 | = |K0 | = |S| and therefore, hj0 ∈ hH1 ∪ {hi }r+1≤i6=j0 ≤l i. This is impossible because of the irredundancy of {hi }. −1 0 0 Therefore, c = 1 and ck = a−1 k . Similarly, ck = ak . As a result, ck = ck , and φk = φ0k ∀k > 1. Hence, K0 = K1 . However, hl+1 ∈ K0 , which is a subgroup of h{hi }i≤l i. This yields contradiction with the irredundancy of {hi }. As a result, m(S o P ) = m(S) + m(P ) as desired. Corollary 3. We have m(An o An ) = 2n − 4 for all n > 0. In particular, m(A5 o A5 ) = 6. Proof. This follows from theorem 5 and theorem 10 Remark 3. Sophie Le found that M23 , J1 , J2 , and P SL2 (p) for p = 17, 23, 29, 41, 47 don’t satisfy the replacement property, and she calculated m of these groups. Furthermore, G.Frieden discovered that groups P SL2 (p) with p = 7 52 and p = 31, which has m = 4, satisfy replacement property. As a result, we can replace S in theorem 10 by M23 , J1 , J2 , or P SL2 (p) with p = 7, 17, 23, 29, 31, 41, 47 For instance, thanks to Sophie, we can now calculate m(G) = m(M23 o M23 ) = m(M23 ) + m(M23 ) + 1 = 6 + 6 + 1 = 13 (Here M23 acts on 23 copies of M23 , so the order of G should be very big!) 4.2. Computing i of wreath product of strongly flat simple group and permutation group Lemma 23. Suppose that H ⊂ k Q Si , where Si ∼ = S, which is a strongly flat i=1 group. Moreover, assume that m = m(S) = i(S) ≥ 3, and πi (hHi) 6= S ∀i ∈ 1, k. Then there exists a subset H 0 ⊂ H with |H 0 | ≤ (m − 1)k so that the k Q group generated by H 0 , hH 0 i, is exactly hHi. Here πi : Sj → Si is the j=1 projection map defined in notation 2 Proof. We will prove by induction on k. For k = 1, it is obvious from the definition of m = m(S) = i(S). Suppose that the lemma is true for k − 1. We will prove that the lemma is also true for k (k ≥ 2). Choose the smallest subset K of π1 (H) that generates π1 (hHi) 6= S. Then K must be irredundant, and, by definition of i(S) = m(S), for strongly flat S, |K| ≤ m − 1. Suppose that K = {π1 (k), k ∈ K1 ⊂ H} for some subset K1 ⊂ H with |K1 | ≤ m − 1. Therefore, for every h ∈ H, there exists kh generated by K1 so that k Q kh h ∈ Si . i=2 Consider H 0 = {kh h, h ∈ H} ⊂ k Q Si ∩ hHi. Hence, πi hH 0 i ⊂ πi (hHi) 6= i=2 S ∀i = 2, k. Using induction hypothesis on H 0 = {kh h, h ∈ H} ⊂ k Q i=2 Si , there exists some K 0 ⊂ H 0 with |K 0 | ≤ (m − 1)(k − 1) so that hK 0 i = hH 0 i. 53 Assume that K 0 = {kh h, h ∈ K2 } for some K2 ⊂ H, |K2 | ≤ (k − 1)(m − 1). As a result, hK1 ∪ K2 i = hHi, and |K1 ∪ K2 | ≤ |K1 | + |K2 | ≤ m − 1 + (k − 1)(m − 1) = k(m − 1). So we finish induction step here, and therefore finish the proof for lemma 23 Theorem 11. For a simple strongly flat group S with m = m(S) = i(S), and permutation group P of degree n = deg(P ), i(S o P ) = i(S).deg(P ) = m.n Proof. Suppose there is an irredundant set {h1 , . . . , hi(G) } in G = S o P . Let n Q H ≤ G be the subgroup generated by these hi . Let N = S n = Si E G i=1 (Si ∼ = S). Using Whiston’s lemma for H and its normal subgroup (H ∩ N ) E H, we can assume that for some g1 , . . . , gl ∈ S n , and the images of {h1 , h2 , . . . , hk } under the projection map: H → H/(H ∩ N ), h1 , h2 , . . . , hl is an irredundant generating set of K = H/(H ∩N ) ∼ = HN/N ≤ G/N ∼ = P ≤ Sn (i(G) = l+k). There exists a partition P = {X1 , X2 , . . . , Xp } (p ≥ 1) of {1, 2, . . . , n} so p Q that K ≤ SXj , and acts transitively on each of Xi . WLOG, assume that j=1 Xi = {di−1 + 1, . . . , di }, with d0 = 1 and dp = n Lemma 24. For 1 ≤ q ≤ p + 1 that, after reordering gi , there exists q−1 P g1 , . . . , gs with s ≤ max{m + |Xi | − 1, (m − 1)|Xi |} such that ∀t ∈ 1, l, n Q xt g t ∈ i=1 Si for some xt generated by g1 , . . . , gs and h1 , h2 , . . . , hk (Here i=dq−1 +1 n Q Si = {1}). i=dp +1 Proof. We will prove lemma 24 by induction on q. For q = 1, we don’t need to prove anything. Assume that the statement is true for q. We will prove that it is true for q + 1 (1 ≤ q ≤ p). By induction hypothesis on q, there exists g1 , g2 , . . . , gs0 with q−1 P s0 ≤ max{m + |Xi | − 1, (m − 1)|Xi |} so that T = {xi gi }li=1 ⊂ i=1 n Q i=dq−1 +1 with some xi generated by g1 , . . . , gs0 and h1 , . . . , hk . 54 Si , Now let πi : S n = n Q Si → S be the projection map from S n to its ith i=1 factor, and πi1 ,i2 ,...,ik : S n → k Q Sij be the projection map from S n to some of j=1 its factors (defined in notation 2). We have two following cases to consider: Case 1: πi (hT i) 6= S ∀i = dq−1 + 1, dq . By lemma 23 for π{dq−1 +1,...,dq } (hT i), there exists T 0 ⊂ T with |T 0 | ≤ (m − 1)(dq − dq−1 ) = (m − 1)|Xq | so that π{dq−1 +1,...,dq } (hT 0 i) = π{dq−1 +1,...,dq } (hT i). Suppose that T 0 = {xi gi , i ∈ I} for some |I| ≤ (m − 1)|Xq |. Hence, there exists zi generated by {xi gi }i∈I and, therefore, by {gi } with i ∈ {1, 2, . . . , s} ∪ I and by {h1 , . . . , hk } so that n Q x0i gi = zi xi gi ∈ Si ∀i ∈ 1, l. By reordering gi , we can assume that i=dq +1 I = {s + 1, . . . , s0 } with s0 ≤ s + (m − 1)|Xq | ≤ q−1 P max{m + |Xi | − 1, (m − i=1 1)|Xi |} + (m − 1)|Xq | ≤ q−1 P max{m + |Xi | − 1, (m − 1)|Xi |}, and because, i=1 x0i is generated by {g1 , . . . , gs0 } and {h1 , h2 , . . . , hk }, we can finish induction step here. Case 2: If πi (hT i) = S for some i ∈ dq−1 + 1, dq . WLOG, we can assume that i = dq−1 + 1 = d0 . Moreover, after reordering qi , assume that images of 00 {xi gi }si=s0 +1 under the map πd0 , which are πd0 (xs0 gs0 ), . . . , πd0 (xs00 gs00 ), generates S. (s00 − s0 ≤ m = m(S) = i(S)). As a result, there exists yi generated n Q by {g1 , . . . , gs00 } and {h1 , . . . , hk } so that {yi gi }li=1 ⊂ Si i=dq−1 +2 Lemma 25. For any 0 ≤ j ≤ |Xi | − 1, after reordering gj , there exists zi generated by {g1 , g2 , . . . , gj+s00 } and {h1 , h2 , . . . , hk } so that {zi gi }li=1 ⊂ n Q Si i=d0 +1+j Proof. We will prove lemma 25 by induction on j. For j = 0, this is true obviously. Suppose that this is true for j − 1. Then there exists zi generated n Q by {g1 , g2 , . . . , gj−1+s00 } and {h1 , h2 , . . . , hk } so that {zi gi }li=1 ⊂ Si . We i=d0 +j will prove that the statement is also true for j. 55 If {zi gi }li=s00 +j ⊂ n Q Si , then we are done already. Otherwise, there i=d0 +1+j 00 will be some gi0 with s + j ≤ i0 ≤ l so that πd0 +j (zi0 gi0 ) 6= 1S , and, by reordering gi , we can assume that gi0 = gs00 +j with πd0 +j (zs00 +j gs00 +j ) = u0 K is transitive on Xq = {dq−1 + 1, . . . , dq } so there exists γ generated by {hi } that moves dq−1 + 1 + j = (d0 + j)th copy of S to dq−1 + 1 = d0 th copy of n Q S. Then there exists x ∈ S depending on γ so that ∀k ∈ Si , πd0 +j (k 0 ) = i=1 πd0 +j (γ −1 kγ) = xπd0 (k)x−1 . Since πd0 (xs0 gs0 ), · · · , πd0 (xs00 gs00 ) generate S, and n Q xSx−1 = S, there exists k 0 ∈ Si generated by {h1 , . . . , hk } and g1 , . . . , gs00 i=1 so that πd0 +j (k 0 ) = v for any v ∈ S. Then, for any v ∈ S, πd0 +j (k 0 zi0 gi0 k 0−1 ) = vu0 v −1 (i0 = s00 + j) with some n Q k 0 zi0 gi0 k 0−1 ∈ Si generated by {g1 , . . . , gs00 +j } and {h1 , . . . , hk }. Because i=d0 +j S is simple, S is generated by {vu0 v −1 , v ∈ S}. As a result, for any u ∈ S, n Q there exists k 00 ∈ Si generated by {g1 , . . . , gs00 +j } and {h1 , . . . , hk } so i=d0 +j that πd0 +j (k 00 ) = u, and so for all i ∈ 1, l, there exists zi00 ∈ n Q Si generated i=d0 +j by {g1 , . . . , gs00 +j } and {h1 , . . . , hk } so that πd0 +j (zi00 ) = πd0 +j (zi gi )−1 . Hence, n Q Si , and we finish induction step here. {zi00 zi gi } ⊂ i=d0 +j+1 Applying lemma 25 for j = dq − dq−1 − 1 = |Xq | − 1, then we finish the induction step for lemma 24 Now by lemma 24, we must have l ≤ p P max{m + |Xi | − 1, (m − 1)|Xi |}. i=1 Also, by definition of partition P, we must have k ≤ m(K) ≤ n − p. 56 As a result, i(G) ≤ n − p + p X max{m + |Xi | − 1, (m − 1)|Xi |} i=1 X =n−p+ m+ i:|Xi |=1 X =n−p+ X (m − 1)|Xi | i:|Xi |>1 m + (m − 1)( i:|Xi |=1 X |Xi |) i:|Xi |>1 = n − p + tm + (m − 1)(n − t) (t = |{i : |Xi | = 1}| ≤ p) = n − p + tm + mn − n − tm + t = mn + t − p ≤ mn Now take any irredundant generating set {s1 , . . . , sm } of S. Consider the set H = {(1, 1, . . . , si , 1, . . . , 1)} ⊂ S n , where si can be in any jth positions for 1 ≤ j ≤ n, and i can be any number between 1 and m. It is easy to see that H is irredundant, and because S n ≤ S o P , i(S o P ) ≥ |H| = mn. As a result, i(S o P ) = mn. Corollary 4. i(An o An ) = n2 − 2n for n ≥ 9. Proof. This follows from theorem 11 and corollary 1. 5. Acknowledgment I would like to thank Professor Keith Dennis and Ravi Fernando for their great guidance and assistance, and Summer Math Foundation Fellowship and my donor for providing me with financial support to participate in the summer research. I also thank the SPUR program and Cornell’s math department for organizing this summer research program. 57 References [1] Julius Whiston, Maximal Independent Generating Sets of the Symmetric Group, Journal of Algebra, 232, 255-268 (2000). [2] Peter J. Cameron and Philippe Cara, Independent generating sets and geometries for symmetric groups, Journal of Algebra, 258, 641-650 (2002). [3] Ravi Fernando, On an Inequality of Dimension-like Invariants for Finite Groups, 2015. https://arxiv.org/pdf/1502.00360.pdf [4] Robert A. Wilson, The O’Nan–Scott Theorem, 2005. http://www.maths.qmul.ac.uk/∼ raw/talks files/ONStalk.pdf [5] G. Frieden, Computing m(S o Z2 ), REU at Cornell 2011. 58
4math.GR
SIMULATION OF ELECTRICAL MACHINES – A FEM-BEM COUPLING SCHEME arXiv:1610.05472v2 [cs.CE] 22 Oct 2016 LARS KIELHORN, THOMAS RÜBERG, JÜRGEN ZECHNER Abstract. Electrical machines commonly consist of moving and stationary parts. The field simulation of such devices can be very demanding if the underlying numerical scheme is solely based on a domain discretization, such as in case of the Finite Element Method (FEM). Here, a coupling scheme based on FEM together with Boundary Element Methods (BEM) is presented that neither hinges on re-meshing techniques nor deals with a special treatment of sliding interfaces. While the numerics are certainly more involved the reward is obvious: The modeling costs decrease and the application engineer is provided with an easy-to-use, versatile, and accurate simulation tool. 1. Introduction Today’s development cycles of electric machines, magnetic sensors, or transformers are intimately connected with numerical simulation. A cost-effective development and optimization of these devices is hardly viable without virtual prototyping. The fundamentals of electromagnetic simulations are the Maxwell’s equations and one of the most popular and most versatile numerical discretization schemes is the Finite Element Method (FEM). While originally applied to problems in structural mechanics the FEM succeeded also for electromagnetic problems for more than 30 years. However, the simplicity of the FEM does not come for free. Since electric and magnetic fields extend into the unbounded exterior air region one typically introduces homogeneous boundary conditions some distance away from the solid parts. Then by expanding the Finite Element grid to parts of the air region an approximation for the unknown fields can be obtained. Thanks to the decay properties of the electromagnetic fields this approach is widely applied, accepted, and justified for many applications. Nevertheless, some problems remain: • Non-physical boundary conditions are imposed on the domain’s (fictitious) boundary and the introduced modeling error leads to contaminated solutions. This might become critical when highly accurate simulation results are needed. • The meshing of the air region requires a considerable amount of time and effort. In many situations the number of elements in the air region even exceeds the number of elements used for the solid parts. • Electrical devices often contain moving parts. For instance, the variation of the rotor/stator positions of an electric motor requires either a re-meshing of the air gap or a fundamental modification of the Finite Element scheme. • The accurate computation of electro-mechanical forces with a FEM-only discretization remains a challenge. In this work we are going to present the implementation of a FEM-BEM coupling scheme in which the air region is handled by the Boundary Element Method (BEM) while only the solid parts are discretized by the FEM. The BEM is a convenient tool to tackle unbounded exterior domains and it is well-designed to eliminate the 1 2 L. KIELHORN, T. RÜBERG, J. ZECHNER above mentioned problems. The method is based on the discretization of Boundary Integral Equations (BIEs) [10] that are defined on the surface of the computational domain. Hence, no meshing is required for the air region. Further, the BIEs fulfill the decay and radiation conditions of the electromagnetic fields such that no additional modeling errors occur. And finally, a simple, automatic treatment of moving parts is intrinsic to the presented scheme. The force computation is beyond the scope of this paper but it is important to note that the BEM computations provide us with additional information such that these calculations can be carried out with unparalleled accuracy. This work is organized as follows: Section 2 recalls the main idea of the FEMBEM coupling. The coupling relies mainly on the theoretical work presented in [7]. For proper definitions of the mathematical spaces, their traces, and the occurring surface differential operators we refer to that publication and to the references cited therein. In section 3 the method itself and the presented preconditioning strategy are verified. Additionally, applications to industrial models are presented, where we remark on the incorporation of periodic constraints. Finally, this work closes with a conclusion in section 4. 2. Symmetric FEM-BEM Coupling We summarize the FEM-BEM coupling scheme as it has been proposed in [7]. The governing equations for magnetostatics are (1) div B = 0 , curl H = j , B = µ (H + M) . The first equation is Gauss’s law for magnetism, the second equation is Ampéres law in differential form, and the third equation is the material law. It connects the magnetic flux B with the magnetic field H via the – possibly non-linear – magnetic permeability µ. The prescribed quantities are the solenoidal excitation current, j, and a given magnetization M. By introducing the non-gauged vector potential A such that curl A := B the following variational formulation holds: Find A ∈ H(curl, Ω− ) such that (2) − − 0 hµ−1 curl A, curl A0 iΩ− − hµ−1 γN A, γD A iΓ = hj, A0 iΩ− + hM, curl A0 iΩ− for all test-functions A0 ∈ H(curl, Ω− ). R Above, we have used the notation hu, wiM := M u · w dM . The interior domain is Ω− ⊂ R3 and Γ := ∂Ω− is its boundary. The complementary unbounded exterior air region is given by Ω+ = R3 \ Ω− . The space H(curl, Ω− ) denotes the space of square integrable vector functions with a square integrable curl [13]. Further, γ denotes the trace operator. The Dirichlet and Neumann traces for the interior as well as for the exterior domain are given by ± γD A := (3) ± γN A := lim n(x) × (A(x̃) × n(x)) lim curlx̃ A(x̃) × n(x) Ω± 3x̃→x∈Γ Ω± 3x̃→x∈Γ with n being the normal vector outward to Ω− . Schemes that rely solely on Finite − Element Methods commonly neglect the boundary term in (2), i.e., either γN A − 0 or γD A are ignored such that the variational formulation corresponds to a homogeneous Neumann- or Dirichlet-problem, respectively. However, in a coupled formulation the interior traces are expressed by their exterior counterparts via appropriate transmission conditions. For the given physical model, these transmission conditions read (4) − + γD A = γD A − + µ−1 γN A = µ−1 0 γN A SIMULATION OF ELECTRICAL MACHINES – A FEM-BEM COUPLING SCHEME 3 with µ0 denoting the vacuum permeability. The vector potential A fulfills the following representation formula [3, Ch. 6.2] Z + A(x̃) = U (x̃ − y) γN A(y) dsy Γ Z (5) − curlx̃ U (x̃ − y) (n × A)(y) dsy Γ + gradx̃ S(A) for all points x̃ ∈ Ω+ , y ∈ Γ, and with U (x̃ − y) := 1/4π|x̃−y| being the fundamental solution for the Laplace operator. The last term in (5) is Z (6) S(A) := U (x̃ − y) (n · A)(y) dsy . Γ + + Applying the traces γD , and γN to (5) we arrive at the set of weak boundary integral equations (7) + + + hγD A, ζiΓ = hK(γD A), ζiΓ − hV(γN A), ζiΓ + + + hγN A, wiΓ = hN(γD A), wiΓ − hK∗ (γN A), wiΓ . Above, V denotes the Maxwell single layer potential, N is the hypersingular operator, and K, K∗ are the Maxwell double layer potential and its adjoint, respectively (8) + + + V(γN A) := γD ψ A (γN A) + + + K(γD A) := γD ψ M (γD A) + + + K∗ (γN A) := γN ψ A (γN A) + + + N(γD A) := γN ψ M (γD A) . The potentials ψ A and ψ M read (9) (ψ A u)(x̃) := Z Γ U (x̃ − y) u(y) dsy (ψ M v)(x̃) := curlx̃ ψ A (n × v)(x̃) for all points x̃ ∈ / Γ. For further informations on the above introduced boundary integral operators we refer to [7]. Eqn. (7) holds for ζ ∈ H(divΓ 0, Γ) ⊂ H(divΓ , Γ) and w ∈ H(curlΓ , Γ). While w is an element of the trace space of H(curl, Ω− ), the function ζ is taken from the space of vector fields with vanishing surface divergence, i.e., divΓ ζ ≡ 0. The use of this special space is motivated by the fact that the potential in (6) has no physical meaning within this physical context and, therefore, shall be removed from the final numerical scheme. Because of curl grad S ≡ 0 the potential drops out naturally when the Neumann trace is applied to (5). Contrary, for the Dirichlet trace it vanishes only in the weak setting. Integration by parts then gives (10) + hγD gradx̃ S(A), ζiΓ = hgradΓ S(A), ζiΓ = −hS(A), divΓ ζiΓ = 0 . Due to divΓ curlΓ ϕ ≡ 0 the divergence-free constraint can be imposed via the sur+ face rotation curlΓ of some continuous scalar function ϕ. Let λ := γN A abbreviate the exterior Neumann trace. We then define the vector field (11) λ := curlΓ ϕ , ϕ ∈ H 1/2 (Γ) . Using the transmission conditions (4), the variational formulations (2) and (7) − are combined. Introducing the relative permeability µr := µ/µ0 together with γD = + − 1/2 γD =: γD , the coupled variational form reads: Find A ∈ H(curl, Ω ), ϕ ∈ H (Γ) such that 0 0 ∗ 0 hµ−1 r curl A, curl A iΩ− − hN(γD A), γD A iΓ +hK curlΓ ϕ, γD A iΓ (12) = µ0 hj, A0 iΩ− + µ0 hM, curl A0 iΩ− h(K − Id) (γD A), curlΓ ψiΓ − hV curlΓ ϕ, curlΓ ψiΓ = 0 4 L. KIELHORN, T. RÜBERG, J. ZECHNER for all functions A0 ∈ H(curl, Ω− ), ψ ∈ H 1/2 (Γ). Note that the variational form (12) is symmetric because of hK∗ λ, wiΓ = h(K − Id)w, λiΓ (13) for all w ∈ H(curlΓ , Γ), λ ∈ H(divΓ 0, Γ) [7]. − Next, a geometrically conformal triangulation Ωh := ∪N is intron=1 Kn ≈ Ω duced. The N mesh elements Kn may consist of tetrahedra, hexahedra, prisms, and pyramids. Additionally, this triangulation induces a surface mesh Γh of Γ composed of triangles and/or quadrilaterals. Nédélec elements [2, 14] are used for a conformal discretization of H(curl, Ω− ). The linear system corresponding to (12) then reads Sx = g (14) with (15) S=  A + R> N R G> KR      a f R> K > G , x = , g = . ϕ −G> V G 0 Above, A is the matrix corresponding to the discretization of the curl-operator (see Eqn. (2)), and N , K, and V are matrix representations of the formerly introduced BEM-operators. The given right hand side is f = f (j; M) and it represents the right hand side terms of the first equation in (12). Fast Boundary Element Methods are utilized in order to obtain data sparse representations of the originally dense BEM matrices [4, 5]. Their use is mandatory since they reduce the quadratic complexity O(N 2 ) of the Boundary Element Method to quasi-linear costs O(N log N ) or even to linear costs O(N ), respectively. It remains to comment on the matrices R and G, respectively. In (15), R is a restriction matrix that extracts the boundary coefficients. The matrix G maps the surface curls of piecewise linear continuous functions to elements of H(divΓ , Γ). It is sometimes denoted as topological gradient [6, Ch. 3]. The entries of G are given by G[`, k] = π` (curlΓ ϕk ). Here, π` denotes the functional that defines the degrees of freedom for the Raviart-Thomas element which is used for the discretization of H(divΓ , Γ) [17]. For the lowest order space R this functional is π` (v) := E` (n × v) · ds with E` being the `-th edge of the surface mesh Γh . γ10 γ1 Figure 1. Torus with its generating cycles γ1 and γ10 The construction of the numerical scheme is almost complete. However, one challenge remains: In most applications, the interior domain Ω− is non-simply connected. The torus in Fig. 1 depicts such a domain since the two loops γ10 and γ1 cannot be contracted on the surface to a point. The definition (11) introduces a scalar potential for the exterior domain such that we have H+ = − grad ϕ for the SIMULATION OF ELECTRICAL MACHINES – A FEM-BEM COUPLING SCHEME 5 exterior magnetic field. Let Σ be some oriented cross section area and γ = ∂Σ a closed path. The integral form of Ampére’s law is I Z (16) H+ · d` = j · dΣ = I γ Σ with the total current density I. We assume that the torus in Fig. 1 features a total current density I 6= 0. Obviously Ampére’s law is violated if the path γ10 is chosen. In this case the path integral of the gradient field evaluates to zero. This contradicts (16) and the choice (11) has to be augmented (17) λ := curlΓ ϕ + M X αm η m . m=1 In (17), the functions η m ∈ H(divΓ 0, Γ) are current sheets along paths γm . They feature the jump I (18) (n × η m ) · d` = 1 0 γm across the path γm . The number M of relevant paths is given by the number of holes drilled through Ω− . An algorithm for the construction of these paths can be found in [8]. Inserting (17) into the variational form (12) results in the modified system       g S Fη x = . (19) · Fη> Hη α 0 With Sη := Fη Hη−1 Fη> , (19) can alternatively be written as (20) b = g, Sx Sb := S − Sη . The matrix Sη is a rank(M ) perturbation of the original system (14). Since M  dim(S), this perturbation does not significantly alter the spectral properties of S. Hence, the upcoming preconditioning strategy neglects the influence of Sη . The linear system (14) is symmetric but not positive definite. We therefore apply a MINRES solver [16] to the preconditioned system. The block preconditioner −1 −1 is given by PS−1 = diag(PAMS , PV−1 ) where PAMS is an AMG/AMS preconditioner. This preconditioner is based on algebraic multigrid methods (AMG) as they have been developed for the discretization of Finite Element spaces like, e.g., H 1 (Ω). However, since we are dealing with Nédélec-type Finite Element spaces the standard AMG preconditioners cannot be applied directly. An enhancement based on auxiliary space methods has been developed in [9]. It is denoted as auxiliary Maxwell space preconditioner (AMS) and appears to be the natural choice for magnetostatic and eddy-current problems. The BEM preconditioner PV−1 is based on operator preconditioning techniques [15]. Due to the use of hierarchical function spaces [2] (cf. Fig. 2), subspace correction methods are used in case of higher order schemes [18]. 3. Numerical Examples 3.1. Verification. The numerical scheme is verified by means of an academic example. We consider a magnetized unit sphere, i.e., Ω− := {x : |x| < 1}. The sphere has a constant magnetization M = M0 e3 in x3 -direction with M0 = 1. The analytic solution for the magnetic flux is B− = 2µ0/3M and ϕ(x) = x3/3 for the scalar potential [11, Ch. 5.10]. In Fig. 4 the L2 -norms for the computed magnetic fluxes are compared against p − − − the analytic solution µ−1 0 kB k2,sphere = |B | vol(Ω ) ≈ 1.3644. In addition, b R := pure FEM computations have been taken out for various fictitious domains Ω 6 L. KIELHORN, T. RÜBERG, J. ZECHNER Figure 2. Hierarchical functions on the triangle. Upper row: 2nd and 3rd order functions for H 1/2 (Γ). Lower row: 1st and 2nd order functions for H(curlΓ , Γ). Figure 3. Comparison between FEM and FEM-BEM. Left: FEM solution B with field lines artificially normal to the boundary. Right: FEM-BEM solution shows correct behavior. b R. Ω− ∪ {x : 1 ≤ |x| < R} with homogeneous Neumann boundary conditions on ∂ Ω Curved tetrahedral elements have been used for the experiments. Clearly, the modeling error prevents the FEM computations from converging to the correct result (cf. Fig. 3). Even 20 millions of FEM degrees of freedoms (dofs) for the b 5 are outperformed by just 600 FEM dofs that are used within the finest grid on Ω FEM-BEM scheme for the coarsest grid on Ω− . However, while the results from Fig. 4 are proving the correctness of the FEMBEM formulation, the comparison with the FEM-only computations is slightly unfair. This is due to the nature of the analytic solution. It is constant for the magnetic flux within the sphere and linear for the scalar potential on the boundary. Both fields can be represented exactly by the used FE spaces. Hence, the errors for the FEM-BEM formulation in Fig. 4 are just due to the geometrical error induced by the triangulation. Therefore, in the following example the FEM-BEM b 4 that scheme is not only applied to the magnetized sphere Ω− but to the domain Ω includes some air region. In this case the magnetic flux in the air region is given x3 by B+ = −µ0 M0 grad 3|x| 3 which is not covered by the Finite Element spaces. SIMULATION OF ELECTRICAL MACHINES – A FEM-BEM COUPLING SCHEME 7 − µ−1 0 kB k2,sphere 1.38 1.36 analytic 1.34 b 5) FEM (Ω b 4) FEM (Ω b 3) FEM (Ω 1.32 FEM-BEM (Ω− ) 103 104 105 106 107 No. of FEM degrees of freedom bR Figure 4. FEM-BEM on Ω− vs. FEM on Ω − µ−1 0 kB k2,sphere 1.36 1.34 analytic FEM (1st order) 1.32 FEM (2nd order) FEM-BEM (1st order) FEM-BEM (2nd order) 104 105 106 107 No. of FEM degrees of freedom b 4 vs. FEM on Ω b5 Figure 5. FEM-BEM on Ω Fig. 5 shows the results for the coupled scheme together with those for the pure FEM computations. Again, we notice that there is convergence towards the correct solution but now the geometric error is dominated by the approximation error. Since the lowest order FE spaces exhibit only linear convergence, higher order schemes are also exploited. Their use is highly beneficial: Even the results for the second coarsest grid reveal an accuracy that cannot be achieved by lowest order discretizations on any of the used grids. 3.2. Preconditioning. Now that the scheme has been verified, the performance of the preconditioner is investigated. In Fig. 6, a circular current loop surrounds a magnetic core. The model is discretized with three different grids (see Tab. 1). In Tab. 2 the iteration numbers are given for the three refinement levels Li as well as for varying permeabilities µr . The relative solver tolerance has been set to 8 L. KIELHORN, T. RÜBERG, J. ZECHNER Figure 6. Left: Magnetic flux B and excitation current j. Right: Potential ϕ with jump across generating cycle. Table 1. Discretizations Li Mesh size NFEM NBEM 1 2 3 0.60 0.39 0.19 5 402 27 251 166 748 706 2 872 12 049 εr = 10−8 . Obviously, the preconditioner is very effective since it reveals only a slight dependence on the mesh size and on the jumps of material coefficients. Table 2. Iteration numbers µr L1 L2 L3 100 102 105 47 78 84 51 88 92 63 117 119 3.3. Periodicities. For industrial applications it is important to deal with models that feature geometrical periodicities. Fig. 7 shows a simple motor model that exploits periodicities. Only a sixth of the model has been discretized. While it is quite simple to impose periodic constraints into Finite Element schemes, the situation is a bit more complicated with Boundary Elements. Figure 7. Device with periodicities. Magnetic flux B. 1.5 · 106 FEM-dofs and 1.4 · 104 BEM-dofs Fig. 8 sketches a model with periodicities. Due to the non-local kernel function U (x − y) interactions on domains Ωi , i = 1, . . . , n with all other domains Ωj occur. SIMULATION OF ELECTRICAL MACHINES – A FEM-BEM COUPLING SCHEME 9 The resulting BEM matrix V formally has n × n blocks Vi,j but the periodicities render V as block circulant matrix   V1,1 V1,2 V1,3 . . . V1,n  V1,n V1,1 V1,2 . . . V1,n−1    V1,n−1 V1,n V1,1 . . . V1,n−2  (21) V =  .   .. .. ..   . . . V1,2 V1,3 V1,4 . . . V1,1 Hence, only the matrices V1,i , i = 1, . . . , n need to be computed and stored. If we Ωn Ω1 Ωn−1 Ω2 ... Ω3 Figure 8. Periodicities assume a periodic excitation, we get for the solution vector blocks x1 = . . . = xn =: x and therefore the matrix-vector product (21) simplifies to (22) y= n X V1,i x . i=1 The above expression simplifies further if the properties of the Galerkin-scheme are taken into account. The BEM matrices in Eqn. (15) are symmetric and this symmetry reduces the complexity even further. In case of non-periodic excitations, techniques like the Fast Fourier Transform are exploited to define a fast matrix-vector product for the matrix (21). More information about the handling of periodicities can be found in [1, 12]. 3.4. Magnetic valve with moving armature. Finally, Fig. 9 shows a magnetic valve that consists of approximately 2.4·106 degrees of freedom in the FEM domain and of 1.1 · 105 degrees of freedom for the BEM part. At its bottom the valve has a moving armature and the excitation is given by a circular current j. The relative solver tolerance is set to εr = 10−6 and 236 iterations are required to solve the system for the initial configuration (Fig. 9). Less iterations are then needed for the moving parts because the previous solution provides a good start vector. The magnetic valve, consists of three distinct components: The armature at its bottom, the toroidal coil, and the remaining composite components like, e.g., some permanent magnets and the housing. Thus, for M distinct components the linear system (20) can be partitioned w.r.t. the M domains   Sb11 . . . Sb1m  ..  , m = 1, . . . , M . .. (23) Sb =  ... . .  > Sb . . . Sbmm 1m The same holds for the preconditioner. The partitioned preconditioner is PS−1 = diag(PS−1 , . . . , PS−1 ). Hence, if one component k changes its position, only the 11 mm 10 L. KIELHORN, T. RÜBERG, J. ZECHNER Figure 9. Moving armature: B-field and scalar potential ϕ on the toroidal coil. Note the jump of the scalar potential on the coil’s surface. off-diagonal blocks Sbkm , m = 1, . . . , M with m 6= k need to be updated while the preconditioner remains unchanged. This simplicity in handling moving parts is a preeminent advantage for the presented FEM-BEM coupling. The application engineer is provided with maximal convenience without loss of accuracy during the modeling process. 4. Conclusion This work presents an implementation of a FEM-BEM coupling scheme for electromagnetic field simulations. The coupling eliminates problems that are inherent to a pure FEM approach. In detail, the benefits of the FEM-BEM scheme are: The decay conditions are fulfilled exactly, no meshing of parts of the exterior air region is necessary, and – most importantly – the handling of moving parts is incorporated in an intriguingly simple fashion. As a downside, the coupling is considerably more complex than a pure Finite Element scheme: The use of Boundary Element Methods requires advanced compression techniques and the incorporation of non-simply connected domains demands further adoptions of the scheme. However, once these issues have been handled, the FEM-BEM formulation in conjunction with a stateof-the-art preconditioner demonstrates its potency. The numerical tests not only reveal an accurate convergence behavior but also prove the algorithm to be suitable for industrial applications – especially, if improvements such as the incorporation of periodicities and the handling of multiple domains are implemented. Eventually, the presented FEM-BEM formulation is an expedient supplement to a pure FEM. While not intended to be used under all circumstances it represents a powerful tool in case that high accuracies together with simple mesh-handling facilities are required. References 1. E. L. Allgower, K. Georg, R. Miranda, and J. Tausch, Numerical Exploitation of Equivariance, ZAMM - Journal of Applied Mathematics and Mechanics 78 (1998), no. 12, 795–806. 2. M. Bergot and M. Duruflé, High-order optimal edge elements for pyramids, prisms and hexahedra, Journal of Computational Physics 232 (2013), no. 1, 189–213. 3. D. Colton and R. Kress, Inverse acoustic and electromagnetic scattering theory, vol. 93, Springer Science & Business Media, 2012. SIMULATION OF ELECTRICAL MACHINES – A FEM-BEM COUPLING SCHEME 11 4. L. Greengard and V. Rokhlin, A new version of the Fast Multipole Method for the Laplace equation in three dimensions, Acta Numerica 6 (1997), 229–269. 5. W. Hackbusch, Hierarchische matrizen: Algorithmen und analysis, SpringerVerlag Berlin Heidelberg, 2009. 6. R. Hiptmair, Finite elements in computational electromagnetism, Acta Numerica 11 (2002), 237–339. 7. R. Hiptmair, Symmetric coupling for eddy current problems, SIAM Journal on Numerical Analysis 40 (2002), no. 1, 41–65. 8. R. Hiptmair and J. Ostrowski, Generators of H1 (Γh , Z) for Triangulated Surfaces: Construction and Classification, SIAM Journal on Computing 31 (2002), no. 5, 1405–1423. 9. R. Hiptmair and J. Xu, Nodal auxiliary space preconditiong in H(curl) and H(div) spaces, SIAM Journal on Numerical Analysis 45 (2007), 2483–2509. 10. G.C. Hsiao and W.L. Wendland, Boundary integral equations, Applied mathematical sciences, Springer, 2008. 11. J. D. Jackson, Classical electrodynamics, 3rd ed., John Wiley & Sons, Inc., 1999. 12. S. Kurz, O. Rain, and S. Rjasanow, Application of the adaptive cross approximation technique for the coupled BE-FE solution of symmetric electromagnetic problems, Computational mechanics 32 (2003), no. 4-6, 423–429. 13. P. Monk, Finite element methods for maxwell’s equations, Oxford University Press, 2003. 14. J.C. Nédélec, Mixed finite elements in R3 , Numerische Mathematik 35 (1980), 315–341. 15. G. Of, BETI-Gebietszerlegungsmethoden mit schnellen Randelementverfahren und Anwendungen, Ph.D. thesis, Institut für Angewandte Analysis und Numerische Simulation, Universität Stuttgart, 2006. 16. C. C. Paige and M. A. Saunders, Solution of sparse indefinite systems of linear equations, SIAM Journal on Numerical Analysis 12 (1975), no. 4, 617–629. 17. P. A. Raviart and J. M. Thomas, A mixed finite element method for 2-nd order elliptic problems, Mathematical aspects of finite element methods, Springer, 1977, pp. 292–315. 18. J. Xu, Iterative methods by space decomposition and subspace correction, SIAM review 34 (1992), no. 4, 581–613. TailSiT GmbH, Nikolaiplatz 4, 8020 Graz E-mail address: [email protected] URL: http://tailsit.com
5cs.CE